@vonage/vivid 5.1.0 → 5.3.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 (386) hide show
  1. package/accordion-item/definition.cjs +2 -1
  2. package/accordion-item/definition.js +2 -1
  3. package/alert/index.cjs +1 -1
  4. package/alert/index.js +1 -1
  5. package/audio-player/definition.cjs +41 -6
  6. package/audio-player/definition.js +41 -6
  7. package/audio-player/index.cjs +27 -25
  8. package/audio-player/index.js +88 -62
  9. package/badge/index.cjs +2 -2
  10. package/badge/index.js +4 -4
  11. package/banner/index.cjs +3 -3
  12. package/banner/index.js +6 -6
  13. package/breadcrumb-item/index.cjs +1 -1
  14. package/breadcrumb-item/index.js +1 -1
  15. package/bundled/affix.cjs +7 -7
  16. package/bundled/affix.js +5 -5
  17. package/bundled/anchored.cjs +1 -1
  18. package/bundled/anchored.js +6 -6
  19. package/bundled/attribute-binding-behaviour.cjs +1 -1
  20. package/bundled/attribute-binding-behaviour.js +15 -13
  21. package/bundled/base-color-picker.cjs +13 -0
  22. package/bundled/base-color-picker.js +194 -0
  23. package/bundled/button.cjs +1 -1
  24. package/bundled/button.js +2 -2
  25. package/bundled/calendar-picker.template.cjs +1 -1
  26. package/bundled/calendar-picker.template.js +21 -21
  27. package/bundled/char-count.cjs +1 -1
  28. package/bundled/char-count.js +1 -1
  29. package/bundled/children.cjs +1 -1
  30. package/bundled/children.js +28 -20
  31. package/bundled/definition.cjs +3 -3
  32. package/bundled/definition.js +38 -38
  33. package/bundled/definition10.cjs +72 -18
  34. package/bundled/definition10.js +351 -65
  35. package/bundled/definition11.cjs +19 -10
  36. package/bundled/definition11.js +66 -37
  37. package/bundled/definition12.cjs +10 -1
  38. package/bundled/definition12.js +38 -14
  39. package/bundled/definition13.cjs +1 -73
  40. package/bundled/definition13.js +15 -354
  41. package/bundled/definition15.cjs +1 -1
  42. package/bundled/definition15.js +1 -1
  43. package/bundled/definition16.cjs +2 -2
  44. package/bundled/definition16.js +8 -8
  45. package/bundled/definition17.cjs +7 -7
  46. package/bundled/definition17.js +17 -17
  47. package/bundled/definition19.cjs +17 -14
  48. package/bundled/definition19.js +85 -77
  49. package/bundled/definition2.cjs +9 -5
  50. package/bundled/definition2.js +21 -17
  51. package/bundled/definition22.cjs +9 -9
  52. package/bundled/definition22.js +31 -31
  53. package/bundled/definition3.cjs +1 -1
  54. package/bundled/definition3.js +1 -1
  55. package/bundled/definition6.cjs +6 -6
  56. package/bundled/definition6.js +34 -31
  57. package/bundled/definition7.cjs +1 -1
  58. package/bundled/definition7.js +6 -6
  59. package/bundled/definition8.cjs +2 -2
  60. package/bundled/definition8.js +4 -4
  61. package/bundled/definition9.cjs +1 -1
  62. package/bundled/definition9.js +1 -1
  63. package/bundled/delegates-aria.cjs +1 -1
  64. package/bundled/delegates-aria.js +59 -46
  65. package/bundled/form-associated.cjs +1 -1
  66. package/bundled/form-associated.js +3 -3
  67. package/bundled/host-semantics.cjs +1 -1
  68. package/bundled/host-semantics.js +48 -34
  69. package/bundled/localized.cjs +1 -1
  70. package/bundled/localized.js +43 -31
  71. package/bundled/mixins.cjs +18 -18
  72. package/bundled/mixins.js +99 -93
  73. package/bundled/normalize.cjs +1 -0
  74. package/bundled/normalize.js +7 -0
  75. package/bundled/picker-field.template.cjs +18 -13
  76. package/bundled/picker-field.template.js +45 -37
  77. package/bundled/ref.cjs +1 -1
  78. package/bundled/ref.js +8 -25
  79. package/bundled/repeat.cjs +1 -1
  80. package/bundled/repeat.js +459 -233
  81. package/bundled/slider.template.cjs +1 -1
  82. package/bundled/slider.template.js +2 -2
  83. package/bundled/slotted.cjs +1 -1
  84. package/bundled/slotted.js +62 -45
  85. package/bundled/text-field.cjs +1 -1
  86. package/bundled/text-field.js +1 -1
  87. package/bundled/time-selection-picker.template.cjs +1 -1
  88. package/bundled/time-selection-picker.template.js +5 -5
  89. package/bundled/vivid-element.cjs +1 -1
  90. package/bundled/vivid-element.js +2126 -1172
  91. package/bundled/when.cjs +1 -1
  92. package/bundled/when.js +8 -7
  93. package/bundled/with-contextual-help.cjs +1 -1
  94. package/bundled/with-contextual-help.js +17 -7
  95. package/calendar/definition.cjs +1 -1
  96. package/calendar/definition.js +2 -2
  97. package/calendar/index.cjs +1 -1
  98. package/calendar/index.js +6 -6
  99. package/calendar-event/index.cjs +1 -1
  100. package/calendar-event/index.js +1 -1
  101. package/card/definition.cjs +10 -2
  102. package/card/definition.js +10 -2
  103. package/card/index.cjs +19 -11
  104. package/card/index.js +35 -27
  105. package/color-picker/definition.cjs +1079 -0
  106. package/color-picker/definition.js +1073 -0
  107. package/color-picker/index.cjs +127 -0
  108. package/color-picker/index.js +726 -0
  109. package/combobox/definition.cjs +13 -6
  110. package/combobox/definition.js +14 -7
  111. package/combobox/index.cjs +15 -11
  112. package/combobox/index.js +82 -75
  113. package/contextual-help/index.cjs +1 -1
  114. package/contextual-help/index.js +1 -1
  115. package/custom-elements.json +1621 -325
  116. package/data-grid/definition.cjs +862 -27
  117. package/data-grid/definition.js +863 -28
  118. package/data-grid/index.cjs +25 -25
  119. package/data-grid/index.js +175 -168
  120. package/date-picker/index.cjs +1 -1
  121. package/date-picker/index.js +2 -2
  122. package/date-range-picker/index.cjs +1 -1
  123. package/date-range-picker/index.js +2 -2
  124. package/date-time-picker/index.cjs +1 -1
  125. package/date-time-picker/index.js +2 -2
  126. package/dial-pad/definition.cjs +55 -1
  127. package/dial-pad/definition.js +56 -2
  128. package/dial-pad/index.cjs +21 -18
  129. package/dial-pad/index.js +138 -104
  130. package/dialog/definition.cjs +4 -1
  131. package/dialog/definition.js +4 -1
  132. package/dialog/index.cjs +21 -18
  133. package/dialog/index.js +43 -40
  134. package/empty-state/definition.cjs +7 -2
  135. package/empty-state/definition.js +7 -2
  136. package/empty-state/index.cjs +10 -5
  137. package/empty-state/index.js +18 -13
  138. package/fab/index.cjs +2 -2
  139. package/fab/index.js +4 -4
  140. package/file-picker/definition.cjs +16 -7
  141. package/file-picker/definition.js +17 -8
  142. package/file-picker/index.cjs +12 -9
  143. package/file-picker/index.js +103 -93
  144. package/icon/definition.cjs +10 -6
  145. package/icon/definition.js +10 -6
  146. package/index.cjs +4 -0
  147. package/index.js +1 -0
  148. package/lib/accordion-item/accordion-item.d.ts +2 -2
  149. package/lib/action-group/action-group.d.ts +2 -2
  150. package/lib/alert/alert.d.ts +4 -4
  151. package/lib/audio-player/audio-player.d.ts +6 -2
  152. package/lib/avatar/avatar.d.ts +2 -2
  153. package/lib/badge/badge.d.ts +2 -2
  154. package/lib/banner/banner.d.ts +6 -6
  155. package/lib/breadcrumb/breadcrumb.d.ts +2 -2
  156. package/lib/breadcrumb-item/breadcrumb-item.d.ts +2 -2
  157. package/lib/button/button.d.ts +6 -6
  158. package/lib/button/button.template.d.ts +2 -1
  159. package/lib/calendar/calendar.d.ts +1 -1
  160. package/lib/calendar-event/calendar-event.d.ts +2 -2
  161. package/lib/card/card.d.ts +2 -2
  162. package/lib/checkbox/checkbox.d.ts +12 -12
  163. package/lib/color-picker/color-picker.d.ts +2420 -0
  164. package/lib/color-picker/color-picker.template.d.ts +3 -0
  165. package/lib/color-picker/definition.d.ts +4 -0
  166. package/lib/color-picker/locale.d.ts +9 -0
  167. package/lib/combobox/combobox.d.ts +495 -78
  168. package/lib/components.d.ts +1 -0
  169. package/lib/data-grid/data-grid-cell.d.ts +4 -4
  170. package/lib/data-grid/data-grid-row.d.ts +3 -4
  171. package/lib/data-grid/data-grid.d.ts +1 -2
  172. package/lib/date-picker/date-picker.d.ts +906 -894
  173. package/lib/date-range-picker/date-range-picker.d.ts +596 -590
  174. package/lib/date-time-picker/date-time-picker.d.ts +907 -895
  175. package/lib/dial-pad/dial-pad.d.ts +3 -2
  176. package/lib/dial-pad/dial-pad.template.d.ts +1 -1
  177. package/lib/dial-pad/locale.d.ts +1 -0
  178. package/lib/dialog/dialog.d.ts +4 -4
  179. package/lib/divider/divider.d.ts +2 -2
  180. package/lib/fab/fab.d.ts +2 -2
  181. package/lib/file-picker/file-picker.d.ts +495 -78
  182. package/lib/header/header.d.ts +2 -2
  183. package/lib/menu/menu.d.ts +5 -4
  184. package/lib/menu-item/menu-item.d.ts +4 -4
  185. package/lib/nav/nav.d.ts +2 -2
  186. package/lib/nav-disclosure/nav-disclosure.d.ts +4 -4
  187. package/lib/nav-item/nav-item.d.ts +4 -4
  188. package/lib/note/note.d.ts +2 -2
  189. package/lib/number-field/number-field.d.ts +19 -18
  190. package/lib/option/option.d.ts +4 -4
  191. package/lib/pagination/pagination.d.ts +2 -2
  192. package/lib/progress/progress.d.ts +2 -2
  193. package/lib/progress-ring/progress-ring.d.ts +2 -2
  194. package/lib/radio/radio.d.ts +6 -6
  195. package/lib/radio-group/radio-group.d.ts +2 -2
  196. package/lib/range-slider/range-slider.d.ts +6 -6
  197. package/lib/rich-text-editor/menubar/menubar.d.ts +2 -2
  198. package/lib/rich-text-editor/rich-text-editor.d.ts +2 -2
  199. package/lib/searchable-select/option-tag.d.ts +2 -2
  200. package/lib/searchable-select/searchable-select.d.ts +521 -104
  201. package/lib/select/select.d.ts +484 -67
  202. package/lib/selectable-box/selectable-box.d.ts +2 -2
  203. package/lib/simple-color-picker/locale.d.ts +0 -1
  204. package/lib/simple-color-picker/simple-color-picker.d.ts +47 -821
  205. package/lib/slider/slider.d.ts +6 -6
  206. package/lib/split-button/split-button.d.ts +6 -6
  207. package/lib/switch/switch.d.ts +4 -4
  208. package/lib/tab/tab.d.ts +6 -6
  209. package/lib/tab-panel/tab-panel.d.ts +2 -2
  210. package/lib/tag/tag.d.ts +6 -6
  211. package/lib/tag-group/tag-group.d.ts +2 -2
  212. package/lib/tag-name-map.d.ts +2 -1
  213. package/lib/text-area/text-area.d.ts +17 -16
  214. package/lib/text-field/text-field.d.ts +19 -18
  215. package/lib/time-picker/time-picker.d.ts +579 -573
  216. package/lib/toggletip/toggletip.d.ts +4 -4
  217. package/lib/tooltip/tooltip.d.ts +2 -2
  218. package/lib/tree-item/tree-item.d.ts +4 -4
  219. package/lib/tree-view/tree-view.d.ts +2 -2
  220. package/lib/video-player/video-player.d.ts +2 -2
  221. package/locales/de-DE.cjs +15 -3
  222. package/locales/de-DE.js +15 -3
  223. package/locales/en-GB.cjs +15 -3
  224. package/locales/en-GB.js +15 -3
  225. package/locales/en-US.cjs +15 -3
  226. package/locales/en-US.js +15 -3
  227. package/locales/ja-JP.cjs +15 -3
  228. package/locales/ja-JP.js +15 -3
  229. package/locales/zh-CN.cjs +15 -3
  230. package/locales/zh-CN.js +15 -3
  231. package/menu/definition.cjs +8 -4
  232. package/menu/definition.js +9 -5
  233. package/note/index.cjs +2 -2
  234. package/note/index.js +4 -4
  235. package/number-field/definition.cjs +3 -3
  236. package/number-field/definition.js +4 -4
  237. package/number-field/index.cjs +8 -8
  238. package/number-field/index.js +41 -40
  239. package/option/index.cjs +1 -1
  240. package/option/index.js +1 -1
  241. package/package.json +5 -5
  242. package/pagination/definition.cjs +2 -1
  243. package/pagination/definition.js +2 -1
  244. package/pagination/index.cjs +12 -12
  245. package/pagination/index.js +59 -59
  246. package/progress/index.cjs +1 -1
  247. package/progress/index.js +1 -1
  248. package/radio/definition.cjs +9 -9
  249. package/radio/definition.js +10 -10
  250. package/radio-group/definition.cjs +2 -1
  251. package/radio-group/definition.js +2 -1
  252. package/radio-group/index.cjs +5 -5
  253. package/radio-group/index.js +80 -77
  254. package/range-slider/index.cjs +1 -1
  255. package/range-slider/index.js +1 -1
  256. package/rich-text-editor/definition.cjs +1 -1
  257. package/rich-text-editor/definition.js +2 -2
  258. package/rich-text-editor/index.cjs +2 -2
  259. package/rich-text-editor/index.js +3 -3
  260. package/searchable-select/definition.cjs +30 -21
  261. package/searchable-select/definition.js +31 -22
  262. package/searchable-select/index.cjs +28 -25
  263. package/searchable-select/index.js +149 -140
  264. package/select/definition.cjs +15 -7
  265. package/select/definition.js +16 -8
  266. package/selectable-box/definition.cjs +1 -1
  267. package/selectable-box/definition.js +1 -1
  268. package/selectable-box/index.cjs +3 -3
  269. package/selectable-box/index.js +20 -20
  270. package/shared/aria/aria-change-subscription.d.ts +0 -1
  271. package/shared/aria/aria-mixin.d.ts +2 -2
  272. package/shared/aria/delegate-aria-behavior.d.ts +5 -10
  273. package/shared/aria/delegates-aria.d.ts +3 -3
  274. package/shared/aria/host-semantics-behavior.d.ts +5 -8
  275. package/shared/aria/host-semantics.d.ts +3 -3
  276. package/shared/color-picker/base-color-picker.d.ts +436 -0
  277. package/shared/color-picker/index.d.ts +1 -0
  278. package/shared/color-picker/locale.d.ts +3 -0
  279. package/shared/color-picker/utils.d.ts +1 -0
  280. package/shared/deprecation/replaced-props.d.ts +317 -2
  281. package/shared/design-system/defineVividComponent.d.ts +2 -2
  282. package/shared/feedback/feedback-message.d.ts +2 -2
  283. package/shared/feedback/mixins.d.ts +4 -4
  284. package/shared/foundation/button/button.d.ts +4 -4
  285. package/shared/foundation/form-associated/form-associated.d.ts +4 -4
  286. package/shared/foundation/vivid-element/vivid-element.d.ts +335 -8
  287. package/shared/localization/Locale.d.ts +4 -0
  288. package/shared/patterns/affix.d.ts +4 -4
  289. package/shared/patterns/anchored.d.ts +4 -4
  290. package/shared/patterns/char-count/char-count.d.ts +2 -2
  291. package/shared/patterns/form-elements/form-element.d.ts +4 -4
  292. package/shared/patterns/form-elements/index.d.ts +1 -0
  293. package/shared/patterns/form-elements/with-contextual-help.d.ts +7 -6
  294. package/shared/patterns/form-elements/with-error-text.d.ts +6 -6
  295. package/shared/patterns/form-elements/with-success-text.d.ts +2 -2
  296. package/shared/patterns/linkable.d.ts +2 -2
  297. package/shared/patterns/localized.d.ts +2 -2
  298. package/shared/patterns/trapped-focus.d.ts +2 -2
  299. package/shared/picker-field/mixins/calendar-picker.d.ts +454 -451
  300. package/shared/picker-field/mixins/calendar-picker.template.d.ts +454 -451
  301. package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +2 -2
  302. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +600 -594
  303. package/shared/picker-field/mixins/single-date-picker.d.ts +746 -737
  304. package/shared/picker-field/mixins/single-value-picker.d.ts +451 -448
  305. package/shared/picker-field/mixins/time-selection-picker.d.ts +580 -574
  306. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +579 -573
  307. package/shared/picker-field/picker-field.d.ts +495 -78
  308. package/shared/templating/attribute-binding-behaviour.d.ts +3 -4
  309. package/shared/templating/render-in-light-dom.d.ts +13 -12
  310. package/side-drawer/index.cjs +1 -1
  311. package/side-drawer/index.js +1 -1
  312. package/simple-color-picker/definition.cjs +28 -215
  313. package/simple-color-picker/definition.js +29 -216
  314. package/simple-color-picker/index.cjs +9 -21
  315. package/simple-color-picker/index.js +71 -185
  316. package/styles/core/all.css +1 -1
  317. package/styles/core/theme.css +1 -1
  318. package/styles/core/typography.css +1 -1
  319. package/styles/tokens/theme-dark.css +4 -4
  320. package/styles/tokens/theme-light.css +4 -4
  321. package/styles/tokens/vivid-2-compat.css +1 -1
  322. package/switch/index.cjs +2 -2
  323. package/switch/index.js +4 -4
  324. package/tabs/definition.cjs +1 -1
  325. package/tabs/definition.js +2 -2
  326. package/tabs/index.cjs +2 -2
  327. package/tabs/index.js +16 -16
  328. package/tag/index.cjs +1 -1
  329. package/tag/index.js +1 -1
  330. package/text-area/definition.cjs +1 -1
  331. package/text-area/definition.js +1 -1
  332. package/text-area/index.cjs +3 -3
  333. package/text-area/index.js +9 -9
  334. package/text-field/definition.cjs +3 -3
  335. package/text-field/definition.js +4 -4
  336. package/text-field/index.cjs +1 -1
  337. package/text-field/index.js +1 -1
  338. package/time-picker/index.cjs +1 -1
  339. package/time-picker/index.js +2 -2
  340. package/toggletip/definition.cjs +1 -1
  341. package/toggletip/definition.js +2 -2
  342. package/tree-view/definition.cjs +1 -1
  343. package/tree-view/definition.js +2 -2
  344. package/tree-view/index.cjs +2 -2
  345. package/tree-view/index.js +6 -6
  346. package/unbundled/_commonjsHelpers.cjs +36 -0
  347. package/unbundled/_commonjsHelpers.js +32 -0
  348. package/unbundled/affix.cjs +1 -1
  349. package/unbundled/affix.js +1 -1
  350. package/unbundled/attribute-binding-behaviour.cjs +11 -10
  351. package/unbundled/attribute-binding-behaviour.js +11 -10
  352. package/unbundled/base-color-picker.cjs +278 -0
  353. package/unbundled/base-color-picker.js +275 -0
  354. package/unbundled/button.cjs +1 -1
  355. package/unbundled/button.js +2 -2
  356. package/unbundled/calendar-picker.template.cjs +3 -3
  357. package/unbundled/calendar-picker.template.js +4 -4
  358. package/unbundled/definition2.cjs +1 -1
  359. package/unbundled/definition2.js +2 -2
  360. package/unbundled/definition3.cjs +2 -1
  361. package/unbundled/definition3.js +2 -1
  362. package/unbundled/delegates-aria.cjs +67 -33
  363. package/unbundled/delegates-aria.js +69 -35
  364. package/unbundled/form-associated.cjs +2 -2
  365. package/unbundled/form-associated.js +3 -3
  366. package/unbundled/host-semantics.cjs +47 -22
  367. package/unbundled/host-semantics.js +48 -23
  368. package/unbundled/mixins.cjs +34 -27
  369. package/unbundled/mixins.js +35 -28
  370. package/unbundled/picker-field.template.cjs +13 -5
  371. package/unbundled/picker-field.template.js +14 -6
  372. package/unbundled/text-field.cjs +1 -1
  373. package/unbundled/text-field.js +1 -1
  374. package/unbundled/time-selection-picker.template.cjs +4 -4
  375. package/unbundled/time-selection-picker.template.js +5 -5
  376. package/unbundled/vivid-element.cjs +22 -15
  377. package/unbundled/vivid-element.js +23 -15
  378. package/unbundled/with-contextual-help.cjs +11 -0
  379. package/unbundled/with-contextual-help.js +11 -0
  380. package/video-player/definition.cjs +69007 -1
  381. package/video-player/definition.js +69007 -1
  382. package/video-player/index.cjs +35 -35
  383. package/video-player/index.js +1358 -1384
  384. package/visually-hidden/index.cjs +1 -1
  385. package/visually-hidden/index.js +1 -1
  386. package/vivid.api.json +347 -69
@@ -1,26 +1,26 @@
1
- "use strict";const ft=require("../bundled/vivid-element.cjs"),j0=require("../bundled/enums.cjs"),I0=require("../bundled/playbackRates.cjs"),P0=require("../bundled/localized.cjs"),L0=require("../bundled/class-names.cjs"),O0='.vjs-svg-icon{display:inline-block;background-repeat:no-repeat;background-position:center;fill:currentColor;height:1.8em;width:1.8em}.vjs-svg-icon:before{content:none!important}.vjs-svg-icon:hover,.vjs-control:focus .vjs-svg-icon{filter:drop-shadow(0 0 .25em #fff)}.vjs-modal-dialog .vjs-modal-dialog-content,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABTsAAsAAAAAIpAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV32Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADtIAABckI4l972hlYWQAABFkAAAAKwAAADYsvIjpaGhlYQAAEZAAAAAdAAAAJA+RCL1obXR4AAARsAAAABcAAAC8Q2YAAGxvY2EAABHIAAAAYAAAAGB7CIGGbWF4cAAAEigAAAAfAAAAIAFAAI9uYW1lAAASSAAAASUAAAIK1cf1oHBvc3QAABNwAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7yDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADaGCyYAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1hU17U+a5/HMA4iA3NmVBDmoQwP5TFnHlFeA4gYiUFRQINoSCBAyK3G2yi+0aipYtFcHYo2xsb4NiY3+VrNxSaX5uvt495ozNdoYoxmem2/L8HGpLc+InB279pnhlGr5mvL4eyz99nrrL32eu1/DQcc/okdYgdHOA6MQKp4r9gx0EcMHMezOalVasW5BM7NcXoSb9fFgE6KtSSBxWz1FYDPG+vMBGcKb9cebu2VS5s2aaTkCvRSf6C7Y+Ppibm5E09v7IDs2/3uZQtbD0zIyppwoHXh/93ukmyYgdePNRp65p5v+3v/9otQl2O7wP34cT88p8Md2YxpYLQZoRcy6FlSBRnwnGAe6BPMSCZo+7NJVqS0cE4uHendzhSnbPH6TDqL1+Nme5LZXkCHnGyoH0kne30WH+gswhm3q+pt/mTas9NLS64GnjmSlTPw0wVQT/ewRaBgxtydy3cuUB9/6SW+vb5yRvr+t0eOfPKJZ/9t3+4tL7xj32Xd3thCxi+ge6ifdsAN+l5+wi5HQ/cCoeull1AszS7CUfEcJzK7sKWJAdJhCd0sPM4+EY7QDm5ov08hXRQXE5bf6PV5Q5+IjW7X7Nku92Ask4l2hCRRD6TPqISiCJeQna3SCFwrhrNzXHzo4yFevBwxpzxk8WCIIfkvVEKVy32SbT8n68gzgaslpaiO2zIGIyuSb7RNf9HSuN26y/7OC1tgEmpiyA6aD4qcgTOiLThwGG0eB694FI8NHLLN6OBlRVaMxNAFS4JdXUG6mW8PwpKuYLCLXKGbu8iwYNdgO06Sn3Th+/vyZAxs8Ro30DjHe9gy8Fywi24OMm7Qyzh3MTZVOMYhLBnoC+J79lpTUyQmorjhnMwlcQ5uPEYGpDjsOkkH49BjQLQBqs3jFtFdJNlksYmoQFDArLh8Xh+Qd6Ghcsb6FUuehDi+U/lqD71K/qiegeV1imcwjl7ExwiSrf4BZyCujV6cVcFo6VX+G9IcPyFjJnUufbU/jzrL1X99as36reXl8K32nFaOr+E8jWJEcJ55DpMVfSMe95/AJaOsGBH2GJCNpiRQbK4C8BjdmQA22QY2j03Em13i2YHqtNLU1NI04Yj2HJgA6fQc6VPNpA/D+Ryks554NnVy2mB72uRUfPLsqR4N0LOBQKArwJYO+5W2fgZX8oC1HR6HjNaQTVIG2FPwnTcXXGZZfNB7TE6pTKZUwaw91XWLAoFFGcnB5PHjsckgBjbWutrL+0h5Y1xw3DRGDumsnXb3MJwXrJIN5U7m0rgJ3yG5w4he5ckFG4pmNEkOm0/xOO4r4yL87wqtQM+hiJIVp+6iG2wPBKD35ElGkDx+UfC2v1mFG1o+M3AjNFty8biKMXwzyxnZLds8wYD2BxmCPHAldPOeLsy/0BugftYhVYFAhO8SqQ0j3oK7dHJZnI/jxmUS4onlxskSF8thmvNZjIrRZwEPxr0lBuLRuz3oy/FOHCsxwOPYh2M+e9u3J5pgPYz9gp6G7C9m0A11F9ddqKMfV+4sbq45/YspOysXvT+3pdFdYNg2fHbW8Dz301MqDVuGrz0Fuh0YMW8mddrpqzST7rV9BcvqPoNvadRndWp0p8HvbiqrFj5yFQ/vNFSXDpxpLEFWp+DcrF3FT1afWshFcmCfeAMjEvO65i0Y6XijQfSRPWx3TV/Df7Km3E1l+kLt56s/rwVzuRusNMhudznkwdLaS+QNdeal2jDPP4l9qHc98vTYZOSkxzD+njBWVWjFPKgipx6DkWvXQiW8OYcewVHE5yukinDMcfGgc0opDltYKDxIGBedkzc6jSfE7tlvESCDFUw0Hx0opS+U0lHCxNottbNWSxX9zZVvEhKWUSyBpaXwBc2a98M6UqPeXAs/GDon8Ax7hsthO8cM5HU7Ad0UvRR9lHmtyQKZ4MAe814X5h9MSUkQmhf96eVJ6p90OjIiqSIjvykvr2l5U55O/fPQKD+jIomYpNyGJQ25uQ2kIikRfAmuBHCPsWqkSDEqgZ5KDI2sifS/R43MbZg0idFHbCPNxXxZws1ACVE6hAhOdJwRkJLFBLPZpRGYJ50pko6XzMkgmSx40ljik6AQcKhFnLcQE6rF7PXFe1Ocoj0T3AXgSgJTDIhHRfHlYZKuSzc6uievOJGXY+i5GJkkTp7UM3y0LqATDbtFcbdBxO7o4T25JYlEjoH0uynUh8rapkxp62QN70svSF+hT4gGPlovlmcm/ComLi7mV4kTykV9NFWjE/QrwgQ4uIcAP0rQF4VZYRP2o3PhHHzfPMJj9Ir+uzKUlrH49ntT18AVvj1sc3YGjUT/Mt2Dxawa8ArcA7bCQIpvfwAYu22vEG/No/5RvPdA7g+AelLrPwzy+LtkLPhnpIxH14m4EYq8eeMHbPEPNm6G7Nv9B4jcFPZ8bJj0SEjP3MPgQdKTqqEoy2v6G32P/Y6dxOv04AxnoAeq+GILvUavtYCBXm+BaIhuodcfrN5B/V2EYMCPh+SxavjGyPwV0x4CJgUPGT0mQaODGBACIJZGsMXwAD0LGXx7l3CdAcKMIKI+f5CepWeD0BvyU/GcdBxPF8SwejC6LGZmAURFdsSWKR5HyHld2kbdIZO1Ixx+bnnzU7n5+blPNV9jnUDWhP2tC68tbN3PVIldsQPxSAcSpjOav7Q05uXn5zW2LLvDXn9B6syscPy9iDLEMmSrJz6nYuWMipukjM0AH8JkGS+XFyMRkzSCH7KD/hwm172SAyZYumHlefr5AddrtA0O0TnwaVZxcRY9Bfukn9Gf05N1r9DV9MoBsJ1f+ZrqUvtPHizJAntWybv7hmqLt6QLuK6ZS9Fqi1jO5rDoWPZXXII5Tgajg53cIXCjDCGIcYrRIY2n6+mXOa/W0bdhau3ryiEYe2FV/5oeaIYK/5w5frCyll6/cYO8DiNhw6t1MBWmznt91QX62UF1N7l0eHBZTRGpKaqpKVIPF9UcIzmReud9TSY75+K899GHbBu6wjoR7RKKZVYiYxSPf5/2wJT5e3NAhmUbVn5KLx1Ujg0+BGvpAIh0DezInTkzF37KVocxrKU3r1+XLtAe2lO3l66kfQfB/unKY+q8N375Ru8bc4pJXfEcESU95q+p8ZNZRTWH1d9FzvUdYXk5rLkcdkEisoKKVHQW/b3GEx6tPaYcoJfOr9wAbSBnv1IHpep0OExr4LPMkpJM+j7sly7UHkOzXjoAZljHCGiyegtNlwljM0v+c19ET9Pvst09a2Mtgcf5/ZSzYO5h1156+eyydfAsxGa9XAuF6vzjh6CssLq6ECysperXX0sX5h5ZdpZe3guxsGIPEtHk/aqXX1hVqP5HYVVVISkrrNqvXorIc+5Ou91Hnr/LcD2afi6eX7UBloOcs7cOpqgGaNfs1g7bNbs9z6wASaylN69d0/TFTIz6Ws8+oGV3mE2612wRTHKcVUbhjKadebloMc+dyXgMVtVK6BwMB/+mVW09igdRBWaRtNQX59d/VD//xdQ0TCiYNj1KT9sq6Wdu5WTbqk3qDXyDaLa1fv621LS01G3z61sD6lH8lAxDLicV921s6Bf92JOYvzNYCL1khbqBXEFUzC521N5NyzNaQIWhjyFyDoBIVrAjmv2UEaLlI+c6zw1jmVIPLLLZZUTj6GxGHW+mq1tgHXR2D85p4Q934+jLbtjVLcyCdS10NVzpHqxp4Q/hK7WopY/NRGx9HGsPGdFjOjcpjBnGYMVqY/4eqT5khWEHWUup2A/pTw7pdWgsWft7ETUERL96nRg0HNFPmCYba6pylECaExX89A9WLUOVB4oKLu/o1oqSYHCgLzBUlAz8hNFDRpeSU1XT+LRmDUgPaKbYdHDn9suF/tu13nHJij0N97LfS0QmqONuyONk7zvUI6Qa0pF9f2+oABL92AT6e0U//z9YqAiWtJLU1JK0gS+1aacwamiNqK067u9ZQ8f1d4qLodMzz3uL89Z68V/Hnr++hXWUuHgw8dfi972PeTyPefu3aNNucemQ74qFuIaJnVkOu4Q+yjuwmmC1FqZpl1i4uzoPxjkpPf3Xv545tl26Rr+dOvUd+omqJzch9dOeU7f10Y64nMcKK137DccIZq2WdXtdZjbEoLSzHwiMtrjYLDxpHQW8gjMX6XFYAE2zSWVD04EGYSs9MbO6sEo20BMEAB4mpvSypsKjZ4Stgzb+c3A9/MQT2+vrBy+qvyFxLUtLlSRF/Ri2wjfZ2dus2Q8lXx4608/jnqK5OOap6NY2PSjYYnECCjiEeLJll/pbmqfeIK+ps3+MxrlEhqmTPipVP7kqlF4VhpEb6r+Q7YOJg38kJ9SHBf3NBl6+9YchfbUjb5ahLSzUM3kPHmwFAsZ5rpai0S7E5xWzZ1j+fW7zsUWP2g5NXTw52ySCTrgG0+lbw60l2Y/CB185CoA8NK+tbRKxfjy6pm5hzQRRR+cMqv1Jbiw6STivtEvt3DRcy0QEh92JlUGo2PG4tSKHl00YD6xc8CK+YPYyy3io2lN8BcSjKRzrIV6ypOAobqxViJPaT9M9Hy5szY33mp7OX/Zu89L/7Ww5vqY2Y8b0pKgoiUhG5cPDPzq8qTV/WkzUOIvXVVA96kmjcBrr3HrYC/Wn+fYP6Z7T1rqy3zknbvqma/FvVk96fNXGkuaXrdHW5JGSxZT/2I/O73v+yNWafMdzc5NdxYurHs6h86e01sLKLz9EBrg+x36rxAaED7hRnAMx7Vzu+9wabh3zG8XLQjx0ablUJzmxdErxYT3kzQSd0SSafVqF5PXgpp0OyYJ1EyNHpGUZmvK575ySzd85JSqF7IBzSAbMM04+MbE58xF3/njXOGecSaermlw2y9PsSQdytLJVr8t+wg+rR8cZYoeNxVIzNdk3Bngi8U5LAlgTFoQnzJCa5EsCgYhCaGL+qPj7TdhG31p9tej3R04N//PXxNwJvyUqwaJqRPJY98TJ5TPndmflRAkAhBfe46sfKW5wizSge08Xb7Ca/GUVs55trngkKkrUS2WPzKttaaqq+idmahugkY+W6fN0I6i3gPt/x88U4wAAeJxjYGRgYADiGU9YXsXz23xl4GZnAIFH7fO+IdMc/WBxDgYmEAUASbMKwAB4nGNgZGBgZwABjj4Ghv//OfoZGBlQgT4ARicDZAAAAHicY2BgYGAfxJijD8Fmu4EqBwCSpgKpAAAAAAAADgBoAH4AzADgAQIBQgFsAZgB7gIuAooC0AL8A2IDjAOoA+AEMASwBNoFCAVaBcAGCAYuBnAGrAb2B04HigfSCCoIcAiGCJwIyAkkCVYJiAmsCfIKIApWCsQLknicY2BkYGDQZ2hmYGcAASYg5gJCBob/YD4DABqrAdAAeJxdkE1qg0AYhl8Tk9AIoVDaVSmzahcF87PMARLIMoFAl0ZHY1BHdBJIT9AT9AQ9RQ9Qeqy+yteNMzDzfM+88w0K4BY/cNAMB6N2bUaPPBLukybCLvleeAAPj8JD+hfhMV7hC3u4wxs7OO4NzQSZcI/8Ltwnfwi75E/hAR7wJTyk/xYeY49fYQ/PztM+jbTZ7LY6OWdBJdX/pqs6NYWa+zMxa13oKrA6Uoerqi/JwtpYxZXJ1coUVmeZUWVlTjq0/tHacjmdxuL90OR8O0UEDYMNdtiSEpz5XQGqzlm30kzUdAYFFOb8R7NOZk0q2lwAyz1i7oAr1xoXvrOgtYhZx8wY5KRV269JZ5yGpmzPTjQhvY9je6vEElPOuJP3mWKnP5M3V+YAAAB4nG2ReVPbMBDF/ULi2EkDBFqO3gdHLxUzDB9IkdexBllydRD49ihO3Ckz7B/a31utZnafkkGyiXnyclxhgB0MMUKKMTLkmGCKV5hhF3vYxxwHOMRrvMERjnGCU7zFO7zHB3zEJ3zGF3zFN5zhHBe4xHf8wE/8wm8w/MEVimTYKv44XR9MSCsUjVoeHE3vjQoNsSZ4mmxZmVWPjSz7jlou6/0qKOWEJdKMtCe793/hQfqxa6XWZHMXFl56RS4TvPXSaDeoy0zUUZB109KstDK8lHo5q6Qi1hcOnqkImubPS6aqRq7mlnaEWabub4iYblba3SRmgldS0+FWdhNtt04F14JUaqkl7tcpOpJtErvNt3Bd9HRT5JWxK25Ldjvp6br4hzfFiIdSmlzTg2fSUzNrLd1LE1ynxq4OVaVoKLjzJ60UPtj1RKzHzsbjly6inVnFBS2MucviPncU7Rr7lfTxRepDs1A2j3ZHRc7PuzFYSfE3ZOd4kjwBy227hA==) format("woff");font-weight:400;font-style:normal}.vjs-icon-play,.video-js .vjs-play-control .vjs-icon-placeholder,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{content:""}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:""}.vjs-icon-pause,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pause:before,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mute,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mute:before,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-low,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-low:before,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mid,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mid:before,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-high,.video-js .vjs-mute-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-high:before,.video-js .vjs-mute-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-enter,.video-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-enter:before,.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-exit,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-exit:before,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:""}.vjs-icon-subtitles,.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-subtitles:before,.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before{content:""}.vjs-icon-captions,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-captions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-captions:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-captions-button .vjs-icon-placeholder:before{content:""}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:""}.vjs-icon-chapters,.video-js .vjs-chapters-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-chapters:before,.video-js .vjs-chapters-button .vjs-icon-placeholder:before{content:""}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:""}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:""}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:""}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:""}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:""}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:""}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:""}.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder,.video-js .vjs-volume-level,.video-js .vjs-play-progress{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before,.video-js .vjs-volume-level:before,.video-js .vjs-play-progress:before{content:""}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:""}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:""}.vjs-icon-cancel,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cancel:before,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before{content:""}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:""}.vjs-icon-replay,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay:before,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-5,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-5:before,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-10,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-10:before,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-30,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-30:before,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-5,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-5:before,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-10,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-10:before,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-30,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-30:before,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-audio,.video-js .vjs-audio-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio:before,.video-js .vjs-audio-button .vjs-icon-placeholder:before{content:""}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:""}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:""}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:""}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:""}.vjs-icon-picture-in-picture-enter,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-enter:before,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-picture-in-picture-exit,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-exit:before,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:""}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:""}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:""}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:""}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:""}.vjs-icon-audio-description,.video-js .vjs-descriptions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio-description:before,.video-js .vjs-descriptions-button .vjs-icon-placeholder:before{content:""}.video-js{display:inline-block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"]{outline:none}.video-js *,.video-js *:before,.video-js *:after{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin:0}.video-js.vjs-fluid,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-1-1{width:100%;max-width:100%}.video-js.vjs-fluid:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.video-js.vjs-1-1:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen,body.vjs-pip-window .video-js{position:fixed;overflow:hidden;z-index:1000;inset:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:#000000b3;padding:.5em;text-align:center;width:100%}.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text,.vjs-layout-small.vjs-pip-container .vjs-pip-text{bottom:0;font-size:1.4em}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:50%;left:50%;padding:0;margin-top:-.81666em;margin-left:-1.5em;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:#2b333fb3;border-radius:.3em;transition:all .4s}.vjs-big-play-button .vjs-svg-icon{width:1em;height:1em;position:absolute;top:50%;left:50%;line-height:1;transform:translate(-50%,-50%)}.video-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus{border-color:#fff;background-color:#73859f;background-color:#73859f80;transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button,.vjs-error .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause:not(.vjs-seeking,.vjs-scrubbing,.vjs-error) .vjs-big-play-button{display:block}.video-js button{background:none;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.video-js.vjs-spatial-navigation-enabled .vjs-button:focus{outline:.0625em solid white;box-shadow:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:#000c;background:linear-gradient(180deg,#000c,#fff0);overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{display:flex;justify-content:center;list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover,.js-focus-visible .vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:#73859f80}.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover,.js-focus-visible .vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.vjs-menu li.vjs-selected .vjs-svg-icon,.vjs-menu li.vjs-selected:focus .vjs-svg-icon,.vjs-menu li.vjs-selected:hover .vjs-svg-icon,.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.video-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.js-focus-visible .vjs-menu *:not(.vjs-selected):focus:not(.focus-visible){background:none}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0em;margin-bottom:1.5em;border-top-color:#2b333fb3}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:#2b333fb3;position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu,.vjs-menu-button-popup .vjs-menu.vjs-lock-showing{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline:hover,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline.vjs-slider-active{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline:hover .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline.vjs-slider-active .vjs-menu{display:block;opacity:1}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:#2b333fb3}.video-js.vjs-spatial-navigation-enabled .vjs-control-bar{gap:1px}.video-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing{display:flex!important}.vjs-has-started .vjs-control-bar,.vjs-audio-only-mode .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar,.vjs-error .vjs-control-bar{display:none!important}.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.vjs-button>.vjs-svg-icon{display:inline-block}.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before,.video-js .vjs-control:focus{text-shadow:0em 0em 1em white}.video-js *:not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder,.video-js.vjs-scrubbing.vjs-touch-enabled .vjs-progress-control .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-play-progress,.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;line-height:.35em;z-index:1}.vjs-svg-icons-enabled .vjs-play-progress:before{content:none!important}.vjs-play-progress .vjs-svg-icon{position:absolute;top:-.35em;right:-.4em;width:.9em;height:.9em;pointer-events:none;line-height:.15em;z-index:1}.video-js .vjs-load-progress{background:#73859f80}.video-js .vjs-load-progress div{background:#73859fbf}.video-js .vjs-time-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js.vjs-scrubbing.vjs-touch-enabled .vjs-progress-control .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.video-js .vjs-progress-control:hover .vjs-mouse-display,.video-js.vjs-scrubbing.vjs-touch-enabled .vjs-progress-control .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display,.video-js.vjs-touch-enabled:not(.vjs-scrubbing) .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:#000c}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:#73859f80}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0em 0em 1em white;box-shadow:0 0 1em #fff}.video-js.vjs-spatial-navigation-enabled .vjs-slider:focus{outline:.0625em solid white}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-svg-icons-enabled .vjs-volume-level:before{content:none}.vjs-volume-level .vjs-svg-icon{position:absolute;width:.9em;height:.9em;pointer-events:none;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{line-height:.35em;right:-.5em}.vjs-slider-horizontal .vjs-volume-level .vjs-svg-icon{right:-.3em;transform:translateY(-50%)}.vjs-slider-vertical .vjs-volume-level .vjs-svg-icon{top:-.55em;transform:translate(-50%)}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:#2b333fb3}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:#000c}.vjs-poster{display:inline-block;vertical-align:middle;cursor:pointer;margin:0;padding:0;position:absolute;inset:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster,.vjs-pip-container.vjs-has-started .vjs-poster{display:block}.vjs-poster img{width:100%;height:100%;object-fit:contain}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js:not(.vjs-live) .vjs-live-control,.video-js.vjs-liveui .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-svg-icons-enabled .vjs-seek-to-live-control{line-height:0}.vjs-seek-to-live-control .vjs-svg-icon{width:1em;height:1em;pointer-events:none;fill:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-svg-icon{fill:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider,.video-js .vjs-current-time,.video-js .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.vjs-normalise-time-controls:not(.vjs-live) .vjs-time-control{display:flex}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;inset:0 0 3em;pointer-events:none}.vjs-error .vjs-text-track-display{display:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js.vjs-force-center-align-cues .vjs-text-track-cue{text-align:center!important;width:80%!important}@supports not (inset: 10px){.video-js .vjs-text-track-display>div{inset:0}}.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate>.vjs-menu-button,.vjs-playback-rate .vjs-playback-rate-value{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:.85;text-align:left;border:.6em solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:5em;height:5em;border-radius:50%;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:flex;justify-content:center;align-items:center;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:before,.vjs-loading-spinner:after{content:"";position:absolute;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:before,.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after{animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{to{transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}to{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button{display:none}.vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-svg-icon{width:1.5em;height:1.5em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" ";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.video-js.vjs-layout-small .vjs-time-divider,.video-js.vjs-layout-small .vjs-duration,.video-js.vjs-layout-small .vjs-remaining-time,.video-js.vjs-layout-small .vjs-playback-rate,.video-js.vjs-layout-small .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.video-js.vjs-layout-x-small .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-duration,.video-js.vjs-layout-x-small .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.video-js.vjs-layout-tiny .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-duration,.video-js.vjs-layout-tiny .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover{width:auto;width:initial}.video-js.vjs-layout-x-small .vjs-progress-control,.video-js.vjs-layout-tiny .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:#2b333fbf;color:#fff;height:70%}.vjs-spatial-navigation-enabled .vjs-modal-dialog.vjs-text-track-settings{height:80%}.vjs-error .vjs-text-track-settings{display:none}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-font,.vjs-text-track-settings .vjs-track-settings-controls{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display: grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-text-track-settings select{font-size:inherit}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:10px;border:none}.vjs-text-track-settings fieldset span{display:inline-block;padding:0 .6em .8em}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-weight:700;font-size:1.2em}.vjs-text-track-settings .vjs-label{margin:0 .5em .5em 0}.vjs-track-settings-controls button:focus,.vjs-track-settings-controls button:active{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f)}.vjs-track-settings-controls button:hover{color:#2b333fbf}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:#000000e6;background:linear-gradient(180deg,#000000e6,#000000b3 60%,#0000);font-size:1.2em;line-height:1.5;transition:opacity .1s;padding:.666em 1.333em 4em;pointer-events:none;position:absolute;top:0;width:100%}.vjs-error .vjs-title-bar{display:none}.vjs-title-bar-title,.vjs-title-bar-description{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-title-bar-title{font-weight:700;margin-bottom:.333em}.vjs-playing.vjs-user-inactive .vjs-title-bar{opacity:0;transition:opacity 1s}.video-js .vjs-skip-forward-5,.video-js .vjs-skip-forward-10,.video-js .vjs-skip-forward-30,.video-js .vjs-skip-backward-5,.video-js .vjs-skip-backward-10,.video-js .vjs-skip-backward-30{cursor:pointer}.video-js .vjs-transient-button{position:absolute;height:3em;display:flex;align-items:center;justify-content:center;background-color:#32323280;cursor:pointer;opacity:1;transition:opacity 1s}.video-js:not(.vjs-has-started) .vjs-transient-button{display:none}.video-js.not-hover .vjs-transient-button:not(.force-display),.video-js.vjs-user-inactive .vjs-transient-button:not(.force-display){opacity:0}.video-js .vjs-transient-button span{padding:0 .5em}.video-js .vjs-transient-button.vjs-left{left:1em}.video-js .vjs-transient-button.vjs-right{right:1em}.video-js .vjs-transient-button.vjs-top{top:1em}.video-js .vjs-transient-button.vjs-near-top{top:4em}.video-js .vjs-transient-button.vjs-bottom{bottom:4em}.video-js .vjs-transient-button:hover{background-color:#323232e6}@media print{.video-js>*:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js *:focus:not(.focus-visible){outline:none}.video-js *:focus:not(:focus-visible){outline:none}:host{display:block}.vjs-theme-vivid{--focus-stroke-gap-color: transparent;position:relative;overflow:hidden;border-radius:8px;color:#fff;container-type:inline-size;font:var(--vvd-typography-base)}.vjs-theme-vivid .vjs-big-play-button{align-items:center;justify-content:center;border-radius:50%;background-color:#0d0d0dcc;block-size:60px;inline-size:60px;margin-block-start:-30px;margin-inline-start:-30px}.vjs-theme-vivid .vjs-big-play-button:focus-visible{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}@media (hover: hover){.vjs-theme-vivid .vjs-big-play-button:hover{background-color:#1a1a1a}}.vjs-theme-vivid .vjs-big-play-button:active{background-color:#333}.vjs-fluid:not(.vjs-has-started) .vjs-theme-vivid .vjs-big-play-button{display:flex}.vjs-theme-vivid .vjs-big-play-button .vjs-svg-icon{display:flex;filter:none;inline-size:30px;margin-inline-start:2px}.vjs-theme-vivid .vjs-poster,.vjs-theme-vivid .vjs-tech{overflow:hidden;border-radius:8px}.vjs-theme-vivid .vjs-fluid:not(.vjs-fullscreen) .vjs-text-track-display .vjs-text-track-cue{font:var(--vvd-typography-heading-4)!important}.vjs-theme-vivid .vjs-time-control{display:flex;flex-direction:column;justify-content:center;padding:0;font:var(--vvd-typography-base);min-inline-size:auto}.vjs-theme-vivid .vjs-time-divider{padding:0 4px}.vjs-theme-vivid .vjs-remaining-time{display:none}.vjs-theme-vivid .vjs-control-bar{flex-wrap:wrap;padding:4px 4px 8px;border-radius:0 0 8px 8px;margin:8px;background-color:#0d0d0dcc;block-size:44px;column-gap:4px;inline-size:calc(100% - 16px)}.vjs-theme-vivid .vjs-control-bar:before{position:absolute;border-radius:8px 8px 0 0;background-color:inherit;block-size:32px;content:"";inline-size:100%;inset-block-start:-32px;inset-inline-start:0}.vjs-theme-vivid .vjs-button{display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:4px;aspect-ratio:1;color:inherit;font:var(--vvd-typography-base);inline-size:32px}.vjs-theme-vivid .vjs-button:focus-visible{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}@media (hover: hover){.vjs-theme-vivid .vjs-button:hover{background:#1a1a1a}}.vjs-theme-vivid .vjs-button:active{background:#333}.vjs-theme-vivid .vjs-button>.vjs-svg-icon{block-size:16px;filter:none;inline-size:16px}.vjs-theme-vivid .vjs-menu{--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.vjs-theme-vivid .vjs-menu{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.vjs-theme-vivid .vjs-menu ::-webkit-scrollbar{width:4px}.vjs-theme-vivid .vjs-menu ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.vjs-theme-vivid .vjs-menu ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-fallback-track-color, var(--scrollbar-thumb-color))}.vjs-theme-vivid .vjs-menu{--vvd-color-neutral-950: #fff}.vjs-theme-vivid .vjs-menu-button,.vjs-theme-vivid .vjs-menu ul{border-radius:8px}.vjs-theme-vivid .vjs-menu li{align-items:center;justify-content:start;padding:4px 8px;color:#fff;font:var(--vvd-typography-base);min-block-size:40px;text-align:left}.vjs-theme-vivid .vjs-menu li:focus-visible{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}@media (hover: hover){.vjs-theme-vivid .vjs-menu li:not(.vjs-selected,.vjs-menu-title):hover{background:#1a1a1a}}.vjs-theme-vivid .vjs-menu li.vjs-selected{background:#333}@media (hover: hover){.vjs-theme-vivid .vjs-menu li.vjs-selected:hover{color:#fff}}.vjs-theme-vivid .vjs-progress-control{position:absolute;block-size:20px;inline-size:calc(100% - 80px);inset-block-start:-20px;inset-inline-start:40px;isolation:isolate}@media (hover: hover){.vjs-theme-vivid .vjs-progress-control:hover .vjs-play-progress .vjs-time-tooltip{display:none}}.vjs-theme-vivid .vjs-progress-control .vjs-icon-placeholder{top:-.3em}.vjs-theme-vivid .vjs-progress-control .vjs-progress-holder,.vjs-theme-vivid .vjs-progress-control .vjs-load-progress,.vjs-theme-vivid .vjs-progress-control .vjs-play-progress{border-radius:4px}.vjs-theme-vivid .vjs-progress-control .vjs-progress-holder:focus-visible{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.vjs-theme-vivid .vjs-duration,.vjs-theme-vivid .vjs-current-time{position:absolute;block-size:auto;inset-block-start:-20px;inset-inline-end:8px}.vjs-theme-vivid .vjs-current-time{inset-inline:8px auto}.vjs-theme-vivid .vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{border-radius:4px}.vjs-theme-vivid .vjs-volume-bar.vjs-slider-vertical:focus-visible{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.vjs-theme-vivid .vjs-subs-caps-button .vjs-menu,.vjs-theme-vivid .vjs-chapters-button .vjs-menu,.vjs-theme-vivid .vjs-descriptions-button .vjs-menu{left:-62px;inline-size:168px;inset-block-end:-4px;margin-block-end:16px}.vjs-theme-vivid .vjs-playback-rate{inline-size:40px}.vjs-theme-vivid .vjs-playback-rate .vjs-playback-rate-value{z-index:1;font:var(--vvd-typography-base-extended);line-height:32px}.vjs-theme-vivid .vjs-playback-rate .vjs-menu{inline-size:66px;inset-block-end:-4px;inset-inline-start:-8px;margin-block-end:16px}.vjs-theme-vivid .vjs-audio-button .vjs-menu{inset-block-end:-4px;margin-block-end:16px}.vjs-theme-vivid .vjs-menu-button-popup .vjs-menu .vjs-menu-content{display:flex;flex-direction:column;background:linear-gradient(#ffffff14,#ffffff14),#0d0d0d;gap:1px;inset-block-end:20px;padding-block:8px}.vjs-theme-vivid .vjs-volume-panel{font:var(--vvd-typography-base);inline-size:32px!important;margin-inline-end:auto}.vjs-theme-vivid .vjs-volume-panel .vjs-volume-control{border-radius:8px;background:linear-gradient(#ffffff14,#ffffff14),#0d0d0d;inset-block-end:calc(8em + 4px)}.vjs-theme-vivid .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{inline-size:32px}.vjs-theme-vivid .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.vjs-theme-vivid .vjs-volume-panel.vjs-slider-active .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical{left:-31px}.vjs-theme-vivid .vjs-text-track-display{inline-size:100%;inset-inline:0!important}.vjs-theme-vivid .vjs-modal-dialog-content{text-align:center}.vjs-theme-vivid .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{display:none}@container (max-inline-size: 660px){.vjs-theme-vivid .vjs-fluid:not(.vjs-fullscreen) .vjs-text-track-display .vjs-text-track-cue{font:var(--vvd-typography-base-extended-bold)!important}}';var Zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sr(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function qc(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(s){var r=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return i[s]}})}),t}var Rs;typeof window<"u"?Rs=window:typeof Zr<"u"?Rs=Zr:typeof self<"u"?Rs=self:Rs={};var An=Rs;const S=sr(An),M0={},R0=Object.freeze(Object.defineProperty({__proto__:null,default:M0},Symbol.toStringTag,{value:"Module"})),N0=qc(R0);var pu=typeof Zr<"u"?Zr:typeof window<"u"?window:{},B0=N0,Ns;typeof document<"u"?Ns=document:(Ns=pu["__GLOBAL_DOCUMENT_CACHE@4"],Ns||(Ns=pu["__GLOBAL_DOCUMENT_CACHE@4"]=B0));var zc=Ns;const V=sr(zc);var yo={exports:{}};function _e(){return _e=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)({}).hasOwnProperty.call(t,s)&&(i[s]=t[s])}return i},_e.apply(null,arguments)}const F0=Object.freeze(Object.defineProperty({__proto__:null,get default(){return _e}},Symbol.toStringTag,{value:"Module"})),U0=qc(F0);var V0=q0,H0=Object.prototype.toString;function q0(i){if(!i)return!1;var e=H0.call(i);return e==="[object Function]"||typeof i=="function"&&e!=="[object RegExp]"||typeof window<"u"&&(i===window.setTimeout||i===window.alert||i===window.confirm||i===window.prompt)}function z0(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t)return(t=t.call(i)).next.bind(t);if(Array.isArray(i)||(t=$0(i))||e){t&&(i=t);var s=0;return function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $0(i,e){if(i){if(typeof i=="string")return mu(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return mu(i,e)}}function mu(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=i[t];return s}var G0=function(){function i(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var e=i.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},e.addInterceptor=function(s,r){this.typeToInterceptorsMap_.has(s)||this.typeToInterceptorsMap_.set(s,new Set);var n=this.typeToInterceptorsMap_.get(s);return n.has(r)?!1:(n.add(r),!0)},e.removeInterceptor=function(s,r){var n=this.typeToInterceptorsMap_.get(s);return n&&n.has(r)?(n.delete(r),!0):!1},e.clearInterceptorsByType=function(s){var r=this.typeToInterceptorsMap_.get(s);return r?(this.typeToInterceptorsMap_.delete(s),this.typeToInterceptorsMap_.set(s,new Set),!0):!1},e.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},e.getForType=function(s){return this.typeToInterceptorsMap_.get(s)||new Set},e.execute=function(s,r){for(var n=this.getForType(s),a=z0(n),l;!(l=a()).done;){var u=l.value;try{r=u(r)}catch{}}return r},i}(),W0=G0,X0=function(){function i(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var e=i.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},e.getMaxAttempts=function(){return this.maxAttempts_},e.setMaxAttempts=function(s){this.maxAttempts_=s},e.getDelayFactor=function(){return this.delayFactor_},e.setDelayFactor=function(s){this.delayFactor_=s},e.getFuzzFactor=function(){return this.fuzzFactor_},e.setFuzzFactor=function(s){this.fuzzFactor_=s},e.getInitialDelay=function(){return this.initialDelay_},e.setInitialDelay=function(s){this.initialDelay_=s},e.createRetry=function(s){var r=s===void 0?{}:s,n=r.maxAttempts,a=r.delayFactor,l=r.fuzzFactor,u=r.initialDelay;return new Y0({maxAttempts:n||this.maxAttempts_,delayFactor:a||this.delayFactor_,fuzzFactor:l||this.fuzzFactor_,initialDelay:u||this.initialDelay_})},i}(),Y0=function(){function i(t){this.maxAttempts_=t.maxAttempts,this.delayFactor_=t.delayFactor,this.fuzzFactor_=t.fuzzFactor,this.currentDelay_=t.initialDelay,this.currentAttempt_=1}var e=i.prototype;return e.moveToNextAttempt=function(){this.currentAttempt_++;var s=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+s},e.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},e.getCurrentDelay=function(){return this.currentDelay_},e.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},e.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},e.getCurrentFuzzedDelay=function(){var s=this.getCurrentMinPossibleDelay(),r=this.getCurrentMaxPossibleDelay();return s+Math.random()*(r-s)},i}(),K0=X0,Q0=An,J0=function(e,t){return t===void 0&&(t=!1),function(s,r,n){if(s){e(s);return}if(r.statusCode>=400&&r.statusCode<=599){var a=n;if(t)if(Q0.TextDecoder){var l=Z0(r.headers&&r.headers["content-type"]);try{a=new TextDecoder(l).decode(n)}catch{}}else a=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:a});return}e(null,n)}};function Z0(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(e,t){var s=t.split("="),r=s[0],n=s[1];return r.trim()==="charset"?n.trim():e},"utf-8")}var eg=J0,$c=An,tg=U0,ig=V0,Gc=W0,sg=K0;xe.httpHandler=eg;xe.requestInterceptorsStorage=new Gc;xe.responseInterceptorsStorage=new Gc;xe.retryManager=new sg;/**
1
+ "use strict";const Ce=require("../bundled/vivid-element.cjs"),w0=require("../bundled/enums.cjs"),D0=require("../bundled/playbackRates.cjs"),k0=require("../bundled/localized.cjs"),j0=require("../bundled/class-names.cjs"),I0='.vjs-svg-icon{display:inline-block;background-repeat:no-repeat;background-position:center;fill:currentColor;height:1.8em;width:1.8em}.vjs-svg-icon:before{content:none!important}.vjs-svg-icon:hover,.vjs-control:focus .vjs-svg-icon{filter:drop-shadow(0 0 .25em #fff)}.vjs-modal-dialog .vjs-modal-dialog-content,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABTsAAsAAAAAIpAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV32Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADtIAABckI4l972hlYWQAABFkAAAAKwAAADYsvIjpaGhlYQAAEZAAAAAdAAAAJA+RCL1obXR4AAARsAAAABcAAAC8Q2YAAGxvY2EAABHIAAAAYAAAAGB7CIGGbWF4cAAAEigAAAAfAAAAIAFAAI9uYW1lAAASSAAAASUAAAIK1cf1oHBvc3QAABNwAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7yDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADaGCyYAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1hU17U+a5/HMA4iA3NmVBDmoQwP5TFnHlFeA4gYiUFRQINoSCBAyK3G2yi+0aipYtFcHYo2xsb4NiY3+VrNxSaX5uvt495ozNdoYoxmem2/L8HGpLc+InB279pnhlGr5mvL4eyz99nrrL32eu1/DQcc/okdYgdHOA6MQKp4r9gx0EcMHMezOalVasW5BM7NcXoSb9fFgE6KtSSBxWz1FYDPG+vMBGcKb9cebu2VS5s2aaTkCvRSf6C7Y+Ppibm5E09v7IDs2/3uZQtbD0zIyppwoHXh/93ukmyYgdePNRp65p5v+3v/9otQl2O7wP34cT88p8Md2YxpYLQZoRcy6FlSBRnwnGAe6BPMSCZo+7NJVqS0cE4uHendzhSnbPH6TDqL1+Nme5LZXkCHnGyoH0kne30WH+gswhm3q+pt/mTas9NLS64GnjmSlTPw0wVQT/ewRaBgxtydy3cuUB9/6SW+vb5yRvr+t0eOfPKJZ/9t3+4tL7xj32Xd3thCxi+ge6ifdsAN+l5+wi5HQ/cCoeull1AszS7CUfEcJzK7sKWJAdJhCd0sPM4+EY7QDm5ov08hXRQXE5bf6PV5Q5+IjW7X7Nku92Ask4l2hCRRD6TPqISiCJeQna3SCFwrhrNzXHzo4yFevBwxpzxk8WCIIfkvVEKVy32SbT8n68gzgaslpaiO2zIGIyuSb7RNf9HSuN26y/7OC1tgEmpiyA6aD4qcgTOiLThwGG0eB694FI8NHLLN6OBlRVaMxNAFS4JdXUG6mW8PwpKuYLCLXKGbu8iwYNdgO06Sn3Th+/vyZAxs8Ro30DjHe9gy8Fywi24OMm7Qyzh3MTZVOMYhLBnoC+J79lpTUyQmorjhnMwlcQ5uPEYGpDjsOkkH49BjQLQBqs3jFtFdJNlksYmoQFDArLh8Xh+Qd6Ghcsb6FUuehDi+U/lqD71K/qiegeV1imcwjl7ExwiSrf4BZyCujV6cVcFo6VX+G9IcPyFjJnUufbU/jzrL1X99as36reXl8K32nFaOr+E8jWJEcJ55DpMVfSMe95/AJaOsGBH2GJCNpiRQbK4C8BjdmQA22QY2j03Em13i2YHqtNLU1NI04Yj2HJgA6fQc6VPNpA/D+Ryks554NnVy2mB72uRUfPLsqR4N0LOBQKArwJYO+5W2fgZX8oC1HR6HjNaQTVIG2FPwnTcXXGZZfNB7TE6pTKZUwaw91XWLAoFFGcnB5PHjsckgBjbWutrL+0h5Y1xw3DRGDumsnXb3MJwXrJIN5U7m0rgJ3yG5w4he5ckFG4pmNEkOm0/xOO4r4yL87wqtQM+hiJIVp+6iG2wPBKD35ElGkDx+UfC2v1mFG1o+M3AjNFty8biKMXwzyxnZLds8wYD2BxmCPHAldPOeLsy/0BugftYhVYFAhO8SqQ0j3oK7dHJZnI/jxmUS4onlxskSF8thmvNZjIrRZwEPxr0lBuLRuz3oy/FOHCsxwOPYh2M+e9u3J5pgPYz9gp6G7C9m0A11F9ddqKMfV+4sbq45/YspOysXvT+3pdFdYNg2fHbW8Dz301MqDVuGrz0Fuh0YMW8mddrpqzST7rV9BcvqPoNvadRndWp0p8HvbiqrFj5yFQ/vNFSXDpxpLEFWp+DcrF3FT1afWshFcmCfeAMjEvO65i0Y6XijQfSRPWx3TV/Df7Km3E1l+kLt56s/rwVzuRusNMhudznkwdLaS+QNdeal2jDPP4l9qHc98vTYZOSkxzD+njBWVWjFPKgipx6DkWvXQiW8OYcewVHE5yukinDMcfGgc0opDltYKDxIGBedkzc6jSfE7tlvESCDFUw0Hx0opS+U0lHCxNottbNWSxX9zZVvEhKWUSyBpaXwBc2a98M6UqPeXAs/GDon8Ax7hsthO8cM5HU7Ad0UvRR9lHmtyQKZ4MAe814X5h9MSUkQmhf96eVJ6p90OjIiqSIjvykvr2l5U55O/fPQKD+jIomYpNyGJQ25uQ2kIikRfAmuBHCPsWqkSDEqgZ5KDI2sifS/R43MbZg0idFHbCPNxXxZws1ACVE6hAhOdJwRkJLFBLPZpRGYJ50pko6XzMkgmSx40ljik6AQcKhFnLcQE6rF7PXFe1Ocoj0T3AXgSgJTDIhHRfHlYZKuSzc6uievOJGXY+i5GJkkTp7UM3y0LqATDbtFcbdBxO7o4T25JYlEjoH0uynUh8rapkxp62QN70svSF+hT4gGPlovlmcm/ComLi7mV4kTykV9NFWjE/QrwgQ4uIcAP0rQF4VZYRP2o3PhHHzfPMJj9Ir+uzKUlrH49ntT18AVvj1sc3YGjUT/Mt2Dxawa8ArcA7bCQIpvfwAYu22vEG/No/5RvPdA7g+AelLrPwzy+LtkLPhnpIxH14m4EYq8eeMHbPEPNm6G7Nv9B4jcFPZ8bJj0SEjP3MPgQdKTqqEoy2v6G32P/Y6dxOv04AxnoAeq+GILvUavtYCBXm+BaIhuodcfrN5B/V2EYMCPh+SxavjGyPwV0x4CJgUPGT0mQaODGBACIJZGsMXwAD0LGXx7l3CdAcKMIKI+f5CepWeD0BvyU/GcdBxPF8SwejC6LGZmAURFdsSWKR5HyHld2kbdIZO1Ixx+bnnzU7n5+blPNV9jnUDWhP2tC68tbN3PVIldsQPxSAcSpjOav7Q05uXn5zW2LLvDXn9B6syscPy9iDLEMmSrJz6nYuWMipukjM0AH8JkGS+XFyMRkzSCH7KD/hwm172SAyZYumHlefr5AddrtA0O0TnwaVZxcRY9Bfukn9Gf05N1r9DV9MoBsJ1f+ZrqUvtPHizJAntWybv7hmqLt6QLuK6ZS9Fqi1jO5rDoWPZXXII5Tgajg53cIXCjDCGIcYrRIY2n6+mXOa/W0bdhau3ryiEYe2FV/5oeaIYK/5w5frCyll6/cYO8DiNhw6t1MBWmznt91QX62UF1N7l0eHBZTRGpKaqpKVIPF9UcIzmReud9TSY75+K899GHbBu6wjoR7RKKZVYiYxSPf5/2wJT5e3NAhmUbVn5KLx1Ujg0+BGvpAIh0DezInTkzF37KVocxrKU3r1+XLtAe2lO3l66kfQfB/unKY+q8N375Ru8bc4pJXfEcESU95q+p8ZNZRTWH1d9FzvUdYXk5rLkcdkEisoKKVHQW/b3GEx6tPaYcoJfOr9wAbSBnv1IHpep0OExr4LPMkpJM+j7sly7UHkOzXjoAZljHCGiyegtNlwljM0v+c19ET9Pvst09a2Mtgcf5/ZSzYO5h1156+eyydfAsxGa9XAuF6vzjh6CssLq6ECysperXX0sX5h5ZdpZe3guxsGIPEtHk/aqXX1hVqP5HYVVVISkrrNqvXorIc+5Ou91Hnr/LcD2afi6eX7UBloOcs7cOpqgGaNfs1g7bNbs9z6wASaylN69d0/TFTIz6Ws8+oGV3mE2612wRTHKcVUbhjKadebloMc+dyXgMVtVK6BwMB/+mVW09igdRBWaRtNQX59d/VD//xdQ0TCiYNj1KT9sq6Wdu5WTbqk3qDXyDaLa1fv621LS01G3z61sD6lH8lAxDLicV921s6Bf92JOYvzNYCL1khbqBXEFUzC521N5NyzNaQIWhjyFyDoBIVrAjmv2UEaLlI+c6zw1jmVIPLLLZZUTj6GxGHW+mq1tgHXR2D85p4Q934+jLbtjVLcyCdS10NVzpHqxp4Q/hK7WopY/NRGx9HGsPGdFjOjcpjBnGYMVqY/4eqT5khWEHWUup2A/pTw7pdWgsWft7ETUERL96nRg0HNFPmCYba6pylECaExX89A9WLUOVB4oKLu/o1oqSYHCgLzBUlAz8hNFDRpeSU1XT+LRmDUgPaKbYdHDn9suF/tu13nHJij0N97LfS0QmqONuyONk7zvUI6Qa0pF9f2+oABL92AT6e0U//z9YqAiWtJLU1JK0gS+1aacwamiNqK067u9ZQ8f1d4qLodMzz3uL89Z68V/Hnr++hXWUuHgw8dfi972PeTyPefu3aNNucemQ74qFuIaJnVkOu4Q+yjuwmmC1FqZpl1i4uzoPxjkpPf3Xv545tl26Rr+dOvUd+omqJzch9dOeU7f10Y64nMcKK137DccIZq2WdXtdZjbEoLSzHwiMtrjYLDxpHQW8gjMX6XFYAE2zSWVD04EGYSs9MbO6sEo20BMEAB4mpvSypsKjZ4Stgzb+c3A9/MQT2+vrBy+qvyFxLUtLlSRF/Ri2wjfZ2dus2Q8lXx4608/jnqK5OOap6NY2PSjYYnECCjiEeLJll/pbmqfeIK+ps3+MxrlEhqmTPipVP7kqlF4VhpEb6r+Q7YOJg38kJ9SHBf3NBl6+9YchfbUjb5ahLSzUM3kPHmwFAsZ5rpai0S7E5xWzZ1j+fW7zsUWP2g5NXTw52ySCTrgG0+lbw60l2Y/CB185CoA8NK+tbRKxfjy6pm5hzQRRR+cMqv1Jbiw6STivtEvt3DRcy0QEh92JlUGo2PG4tSKHl00YD6xc8CK+YPYyy3io2lN8BcSjKRzrIV6ypOAobqxViJPaT9M9Hy5szY33mp7OX/Zu89L/7Ww5vqY2Y8b0pKgoiUhG5cPDPzq8qTV/WkzUOIvXVVA96kmjcBrr3HrYC/Wn+fYP6Z7T1rqy3zknbvqma/FvVk96fNXGkuaXrdHW5JGSxZT/2I/O73v+yNWafMdzc5NdxYurHs6h86e01sLKLz9EBrg+x36rxAaED7hRnAMx7Vzu+9wabh3zG8XLQjx0ablUJzmxdErxYT3kzQSd0SSafVqF5PXgpp0OyYJ1EyNHpGUZmvK575ySzd85JSqF7IBzSAbMM04+MbE58xF3/njXOGecSaermlw2y9PsSQdytLJVr8t+wg+rR8cZYoeNxVIzNdk3Bngi8U5LAlgTFoQnzJCa5EsCgYhCaGL+qPj7TdhG31p9tej3R04N//PXxNwJvyUqwaJqRPJY98TJ5TPndmflRAkAhBfe46sfKW5wizSge08Xb7Ca/GUVs55trngkKkrUS2WPzKttaaqq+idmahugkY+W6fN0I6i3gPt/x88U4wAAeJxjYGRgYADiGU9YXsXz23xl4GZnAIFH7fO+IdMc/WBxDgYmEAUASbMKwAB4nGNgZGBgZwABjj4Ghv//OfoZGBlQgT4ARicDZAAAAHicY2BgYGAfxJijD8Fmu4EqBwCSpgKpAAAAAAAADgBoAH4AzADgAQIBQgFsAZgB7gIuAooC0AL8A2IDjAOoA+AEMASwBNoFCAVaBcAGCAYuBnAGrAb2B04HigfSCCoIcAiGCJwIyAkkCVYJiAmsCfIKIApWCsQLknicY2BkYGDQZ2hmYGcAASYg5gJCBob/YD4DABqrAdAAeJxdkE1qg0AYhl8Tk9AIoVDaVSmzahcF87PMARLIMoFAl0ZHY1BHdBJIT9AT9AQ9RQ9Qeqy+yteNMzDzfM+88w0K4BY/cNAMB6N2bUaPPBLukybCLvleeAAPj8JD+hfhMV7hC3u4wxs7OO4NzQSZcI/8Ltwnfwi75E/hAR7wJTyk/xYeY49fYQ/PztM+jbTZ7LY6OWdBJdX/pqs6NYWa+zMxa13oKrA6Uoerqi/JwtpYxZXJ1coUVmeZUWVlTjq0/tHacjmdxuL90OR8O0UEDYMNdtiSEpz5XQGqzlm30kzUdAYFFOb8R7NOZk0q2lwAyz1i7oAr1xoXvrOgtYhZx8wY5KRV269JZ5yGpmzPTjQhvY9je6vEElPOuJP3mWKnP5M3V+YAAAB4nG2ReVPbMBDF/ULi2EkDBFqO3gdHLxUzDB9IkdexBllydRD49ihO3Ckz7B/a31utZnafkkGyiXnyclxhgB0MMUKKMTLkmGCKV5hhF3vYxxwHOMRrvMERjnGCU7zFO7zHB3zEJ3zGF3zFN5zhHBe4xHf8wE/8wm8w/MEVimTYKv44XR9MSCsUjVoeHE3vjQoNsSZ4mmxZmVWPjSz7jlou6/0qKOWEJdKMtCe793/hQfqxa6XWZHMXFl56RS4TvPXSaDeoy0zUUZB109KstDK8lHo5q6Qi1hcOnqkImubPS6aqRq7mlnaEWabub4iYblba3SRmgldS0+FWdhNtt04F14JUaqkl7tcpOpJtErvNt3Bd9HRT5JWxK25Ldjvp6br4hzfFiIdSmlzTg2fSUzNrLd1LE1ynxq4OVaVoKLjzJ60UPtj1RKzHzsbjly6inVnFBS2MucviPncU7Rr7lfTxRepDs1A2j3ZHRc7PuzFYSfE3ZOd4kjwBy227hA==) format("woff");font-weight:400;font-style:normal}.vjs-icon-play,.video-js .vjs-play-control .vjs-icon-placeholder,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{content:""}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:""}.vjs-icon-pause,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pause:before,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mute,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mute:before,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-low,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-low:before,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mid,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mid:before,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-high,.video-js .vjs-mute-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-high:before,.video-js .vjs-mute-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-enter,.video-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-enter:before,.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-exit,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-exit:before,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:""}.vjs-icon-subtitles,.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-subtitles:before,.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before{content:""}.vjs-icon-captions,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-captions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-captions:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-captions-button .vjs-icon-placeholder:before{content:""}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:""}.vjs-icon-chapters,.video-js .vjs-chapters-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-chapters:before,.video-js .vjs-chapters-button .vjs-icon-placeholder:before{content:""}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:""}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:""}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:""}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:""}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:""}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:""}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:""}.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder,.video-js .vjs-volume-level,.video-js .vjs-play-progress{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before,.video-js .vjs-volume-level:before,.video-js .vjs-play-progress:before{content:""}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:""}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:""}.vjs-icon-cancel,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cancel:before,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before{content:""}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:""}.vjs-icon-replay,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay:before,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-5,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-5:before,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-10,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-10:before,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-30,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-30:before,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-5,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-5:before,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-10,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-10:before,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-30,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-30:before,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-audio,.video-js .vjs-audio-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio:before,.video-js .vjs-audio-button .vjs-icon-placeholder:before{content:""}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:""}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:""}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:""}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:""}.vjs-icon-picture-in-picture-enter,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-enter:before,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-picture-in-picture-exit,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-exit:before,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:""}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:""}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:""}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:""}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:""}.vjs-icon-audio-description,.video-js .vjs-descriptions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio-description:before,.video-js .vjs-descriptions-button .vjs-icon-placeholder:before{content:""}.video-js{display:inline-block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"]{outline:none}.video-js *,.video-js *:before,.video-js *:after{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin:0}.video-js.vjs-fluid,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-1-1{width:100%;max-width:100%}.video-js.vjs-fluid:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.video-js.vjs-1-1:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen,body.vjs-pip-window .video-js{position:fixed;overflow:hidden;z-index:1000;inset:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:#000000b3;padding:.5em;text-align:center;width:100%}.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text,.vjs-layout-small.vjs-pip-container .vjs-pip-text{bottom:0;font-size:1.4em}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:50%;left:50%;padding:0;margin-top:-.81666em;margin-left:-1.5em;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:#2b333fb3;border-radius:.3em;transition:all .4s}.vjs-big-play-button .vjs-svg-icon{width:1em;height:1em;position:absolute;top:50%;left:50%;line-height:1;transform:translate(-50%,-50%)}.video-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus{border-color:#fff;background-color:#73859f;background-color:#73859f80;transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button,.vjs-error .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause:not(.vjs-seeking,.vjs-scrubbing,.vjs-error) .vjs-big-play-button{display:block}.video-js button{background:none;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.video-js.vjs-spatial-navigation-enabled .vjs-button:focus{outline:.0625em solid white;box-shadow:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:#000c;background:linear-gradient(180deg,#000c,#fff0);overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{display:flex;justify-content:center;list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover,.js-focus-visible .vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:#73859f80}.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover,.js-focus-visible .vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.vjs-menu li.vjs-selected .vjs-svg-icon,.vjs-menu li.vjs-selected:focus .vjs-svg-icon,.vjs-menu li.vjs-selected:hover .vjs-svg-icon,.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.video-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.js-focus-visible .vjs-menu *:not(.vjs-selected):focus:not(.focus-visible){background:none}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0em;margin-bottom:1.5em;border-top-color:#2b333fb3}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:#2b333fb3;position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu,.vjs-menu-button-popup .vjs-menu.vjs-lock-showing{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline:hover,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline.vjs-slider-active{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline:hover .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline.vjs-slider-active .vjs-menu{display:block;opacity:1}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:#2b333fb3}.video-js.vjs-spatial-navigation-enabled .vjs-control-bar{gap:1px}.video-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing{display:flex!important}.vjs-has-started .vjs-control-bar,.vjs-audio-only-mode .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar,.vjs-error .vjs-control-bar{display:none!important}.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.vjs-button>.vjs-svg-icon{display:inline-block}.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before,.video-js .vjs-control:focus{text-shadow:0em 0em 1em white}.video-js *:not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder,.video-js.vjs-scrubbing.vjs-touch-enabled .vjs-progress-control .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-play-progress,.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;line-height:.35em;z-index:1}.vjs-svg-icons-enabled .vjs-play-progress:before{content:none!important}.vjs-play-progress .vjs-svg-icon{position:absolute;top:-.35em;right:-.4em;width:.9em;height:.9em;pointer-events:none;line-height:.15em;z-index:1}.video-js .vjs-load-progress{background:#73859f80}.video-js .vjs-load-progress div{background:#73859fbf}.video-js .vjs-time-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js.vjs-scrubbing.vjs-touch-enabled .vjs-progress-control .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.video-js .vjs-progress-control:hover .vjs-mouse-display,.video-js.vjs-scrubbing.vjs-touch-enabled .vjs-progress-control .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display,.video-js.vjs-touch-enabled:not(.vjs-scrubbing) .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:#000c}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:#73859f80}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0em 0em 1em white;box-shadow:0 0 1em #fff}.video-js.vjs-spatial-navigation-enabled .vjs-slider:focus{outline:.0625em solid white}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-svg-icons-enabled .vjs-volume-level:before{content:none}.vjs-volume-level .vjs-svg-icon{position:absolute;width:.9em;height:.9em;pointer-events:none;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{line-height:.35em;right:-.5em}.vjs-slider-horizontal .vjs-volume-level .vjs-svg-icon{right:-.3em;transform:translateY(-50%)}.vjs-slider-vertical .vjs-volume-level .vjs-svg-icon{top:-.55em;transform:translate(-50%)}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:#2b333fb3}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:#000c}.vjs-poster{display:inline-block;vertical-align:middle;cursor:pointer;margin:0;padding:0;position:absolute;inset:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster,.vjs-pip-container.vjs-has-started .vjs-poster{display:block}.vjs-poster img{width:100%;height:100%;object-fit:contain}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js:not(.vjs-live) .vjs-live-control,.video-js.vjs-liveui .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-svg-icons-enabled .vjs-seek-to-live-control{line-height:0}.vjs-seek-to-live-control .vjs-svg-icon{width:1em;height:1em;pointer-events:none;fill:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-svg-icon{fill:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider,.video-js .vjs-current-time,.video-js .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.vjs-normalise-time-controls:not(.vjs-live) .vjs-time-control{display:flex}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;inset:0 0 3em;pointer-events:none}.vjs-error .vjs-text-track-display{display:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js.vjs-force-center-align-cues .vjs-text-track-cue{text-align:center!important;width:80%!important}@supports not (inset: 10px){.video-js .vjs-text-track-display>div{inset:0}}.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate>.vjs-menu-button,.vjs-playback-rate .vjs-playback-rate-value{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:.85;text-align:left;border:.6em solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:5em;height:5em;border-radius:50%;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:flex;justify-content:center;align-items:center;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:before,.vjs-loading-spinner:after{content:"";position:absolute;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:before,.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after{animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{to{transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}to{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button{display:none}.vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-svg-icon{width:1.5em;height:1.5em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" ";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.video-js.vjs-layout-small .vjs-time-divider,.video-js.vjs-layout-small .vjs-duration,.video-js.vjs-layout-small .vjs-remaining-time,.video-js.vjs-layout-small .vjs-playback-rate,.video-js.vjs-layout-small .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.video-js.vjs-layout-x-small .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-duration,.video-js.vjs-layout-x-small .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.video-js.vjs-layout-tiny .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-duration,.video-js.vjs-layout-tiny .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover{width:auto;width:initial}.video-js.vjs-layout-x-small .vjs-progress-control,.video-js.vjs-layout-tiny .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:#2b333fbf;color:#fff;height:70%}.vjs-spatial-navigation-enabled .vjs-modal-dialog.vjs-text-track-settings{height:80%}.vjs-error .vjs-text-track-settings{display:none}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-font,.vjs-text-track-settings .vjs-track-settings-controls{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display: grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-text-track-settings select{font-size:inherit}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:10px;border:none}.vjs-text-track-settings fieldset span{display:inline-block;padding:0 .6em .8em}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-weight:700;font-size:1.2em}.vjs-text-track-settings .vjs-label{margin:0 .5em .5em 0}.vjs-track-settings-controls button:focus,.vjs-track-settings-controls button:active{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f)}.vjs-track-settings-controls button:hover{color:#2b333fbf}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:#000000e6;background:linear-gradient(180deg,#000000e6,#000000b3 60%,#0000);font-size:1.2em;line-height:1.5;transition:opacity .1s;padding:.666em 1.333em 4em;pointer-events:none;position:absolute;top:0;width:100%}.vjs-error .vjs-title-bar{display:none}.vjs-title-bar-title,.vjs-title-bar-description{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-title-bar-title{font-weight:700;margin-bottom:.333em}.vjs-playing.vjs-user-inactive .vjs-title-bar{opacity:0;transition:opacity 1s}.video-js .vjs-skip-forward-5,.video-js .vjs-skip-forward-10,.video-js .vjs-skip-forward-30,.video-js .vjs-skip-backward-5,.video-js .vjs-skip-backward-10,.video-js .vjs-skip-backward-30{cursor:pointer}.video-js .vjs-transient-button{position:absolute;height:3em;display:flex;align-items:center;justify-content:center;background-color:#32323280;cursor:pointer;opacity:1;transition:opacity 1s}.video-js:not(.vjs-has-started) .vjs-transient-button{display:none}.video-js.not-hover .vjs-transient-button:not(.force-display),.video-js.vjs-user-inactive .vjs-transient-button:not(.force-display){opacity:0}.video-js .vjs-transient-button span{padding:0 .5em}.video-js .vjs-transient-button.vjs-left{left:1em}.video-js .vjs-transient-button.vjs-right{right:1em}.video-js .vjs-transient-button.vjs-top{top:1em}.video-js .vjs-transient-button.vjs-near-top{top:4em}.video-js .vjs-transient-button.vjs-bottom{bottom:4em}.video-js .vjs-transient-button:hover{background-color:#323232e6}@media print{.video-js>*:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js *:focus:not(.focus-visible){outline:none}.video-js *:focus:not(:focus-visible){outline:none}:host{display:block}.vjs-theme-vivid{--focus-stroke-gap-color: transparent;position:relative;overflow:hidden;border-radius:8px;color:#fff;container-type:inline-size;font:var(--vvd-typography-base)}.vjs-theme-vivid .vjs-big-play-button{align-items:center;justify-content:center;border-radius:50%;background-color:#0d0d0dcc;block-size:60px;inline-size:60px;margin-block-start:-30px;margin-inline-start:-30px}.vjs-theme-vivid .vjs-big-play-button:focus-visible{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}@media (hover: hover){.vjs-theme-vivid .vjs-big-play-button:hover{background-color:#1a1a1a}}.vjs-theme-vivid .vjs-big-play-button:active{background-color:#333}.vjs-fluid:not(.vjs-has-started) .vjs-theme-vivid .vjs-big-play-button{display:flex}.vjs-theme-vivid .vjs-big-play-button .vjs-svg-icon{display:flex;filter:none;inline-size:30px;margin-inline-start:2px}.vjs-theme-vivid .vjs-poster,.vjs-theme-vivid .vjs-tech{overflow:hidden;border-radius:8px}.vjs-theme-vivid .vjs-fluid:not(.vjs-fullscreen) .vjs-text-track-display .vjs-text-track-cue{font:var(--vvd-typography-heading-4)!important}.vjs-theme-vivid .vjs-time-control{display:flex;flex-direction:column;justify-content:center;padding:0;font:var(--vvd-typography-base);min-inline-size:auto}.vjs-theme-vivid .vjs-time-divider{padding:0 4px}.vjs-theme-vivid .vjs-remaining-time{display:none}.vjs-theme-vivid .vjs-control-bar{flex-wrap:wrap;padding:4px 4px 8px;border-radius:0 0 8px 8px;margin:8px;background-color:#0d0d0dcc;block-size:44px;column-gap:4px;inline-size:calc(100% - 16px)}.vjs-theme-vivid .vjs-control-bar:before{position:absolute;border-radius:8px 8px 0 0;background-color:inherit;block-size:32px;content:"";inline-size:100%;inset-block-start:-32px;inset-inline-start:0}.vjs-theme-vivid .vjs-button{display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:4px;aspect-ratio:1;color:inherit;font:var(--vvd-typography-base);inline-size:32px}.vjs-theme-vivid .vjs-button:focus-visible{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}@media (hover: hover){.vjs-theme-vivid .vjs-button:hover{background:#1a1a1a}}.vjs-theme-vivid .vjs-button:active{background:#333}.vjs-theme-vivid .vjs-button>.vjs-svg-icon{block-size:16px;filter:none;inline-size:16px}.vjs-theme-vivid .vjs-menu{--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.vjs-theme-vivid .vjs-menu{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.vjs-theme-vivid .vjs-menu ::-webkit-scrollbar{width:4px}.vjs-theme-vivid .vjs-menu ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.vjs-theme-vivid .vjs-menu ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-fallback-track-color, var(--scrollbar-thumb-color))}.vjs-theme-vivid .vjs-menu{--vvd-color-neutral-950: #fff}.vjs-theme-vivid .vjs-menu-button,.vjs-theme-vivid .vjs-menu ul{border-radius:8px}.vjs-theme-vivid .vjs-menu li{align-items:center;justify-content:start;padding:4px 8px;color:#fff;font:var(--vvd-typography-base);min-block-size:40px;text-align:left}.vjs-theme-vivid .vjs-menu li:focus-visible{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}@media (hover: hover){.vjs-theme-vivid .vjs-menu li:not(.vjs-selected,.vjs-menu-title):hover{background:#1a1a1a}}.vjs-theme-vivid .vjs-menu li.vjs-selected{background:#333}@media (hover: hover){.vjs-theme-vivid .vjs-menu li.vjs-selected:hover{color:#fff}}.vjs-theme-vivid .vjs-progress-control{position:absolute;block-size:20px;inline-size:calc(100% - 80px);inset-block-start:-20px;inset-inline-start:40px;isolation:isolate}@media (hover: hover){.vjs-theme-vivid .vjs-progress-control:hover .vjs-play-progress .vjs-time-tooltip{display:none}}.vjs-theme-vivid .vjs-progress-control .vjs-icon-placeholder{top:-.3em}.vjs-theme-vivid .vjs-progress-control .vjs-progress-holder,.vjs-theme-vivid .vjs-progress-control .vjs-load-progress,.vjs-theme-vivid .vjs-progress-control .vjs-play-progress{border-radius:4px}.vjs-theme-vivid .vjs-progress-control .vjs-progress-holder:focus-visible{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.vjs-theme-vivid .vjs-duration,.vjs-theme-vivid .vjs-current-time{position:absolute;block-size:auto;inset-block-start:-20px;inset-inline-end:8px}.vjs-theme-vivid .vjs-current-time{inset-inline:8px auto}.vjs-theme-vivid .vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{border-radius:4px}.vjs-theme-vivid .vjs-volume-bar.vjs-slider-vertical:focus-visible{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.vjs-theme-vivid .vjs-subs-caps-button .vjs-menu,.vjs-theme-vivid .vjs-chapters-button .vjs-menu,.vjs-theme-vivid .vjs-descriptions-button .vjs-menu{left:-62px;inline-size:168px;inset-block-end:-4px;margin-block-end:16px}.vjs-theme-vivid .vjs-playback-rate{inline-size:40px}.vjs-theme-vivid .vjs-playback-rate .vjs-playback-rate-value{z-index:1;font:var(--vvd-typography-base-extended);line-height:32px}.vjs-theme-vivid .vjs-playback-rate .vjs-menu{inline-size:66px;inset-block-end:-4px;inset-inline-start:-8px;margin-block-end:16px}.vjs-theme-vivid .vjs-audio-button .vjs-menu{inset-block-end:-4px;margin-block-end:16px}.vjs-theme-vivid .vjs-menu-button-popup .vjs-menu .vjs-menu-content{display:flex;flex-direction:column;background:linear-gradient(#ffffff14,#ffffff14),#0d0d0d;gap:1px;inset-block-end:20px;padding-block:8px}.vjs-theme-vivid .vjs-volume-panel{font:var(--vvd-typography-base);inline-size:32px!important;margin-inline-end:auto}.vjs-theme-vivid .vjs-volume-panel .vjs-volume-control{border-radius:8px;background:linear-gradient(#ffffff14,#ffffff14),#0d0d0d;inset-block-end:calc(8em + 4px)}.vjs-theme-vivid .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{inline-size:32px}.vjs-theme-vivid .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.vjs-theme-vivid .vjs-volume-panel.vjs-slider-active .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical{left:-31px}.vjs-theme-vivid .vjs-text-track-display{inline-size:100%;inset-inline:0!important}.vjs-theme-vivid .vjs-modal-dialog-content{text-align:center}.vjs-theme-vivid .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{display:none}@container (max-inline-size: 660px){.vjs-theme-vivid .vjs-fluid:not(.vjs-fullscreen) .vjs-text-track-display .vjs-text-track-cue{font:var(--vvd-typography-base-extended-bold)!important}}';var Rs;typeof window<"u"?Rs=window:typeof Ce.commonjsGlobal<"u"?Rs=Ce.commonjsGlobal:typeof self<"u"?Rs=self:Rs={};var Cn=Rs;const S=Ce.getDefaultExportFromCjs(Cn);var hu=typeof Ce.commonjsGlobal<"u"?Ce.commonjsGlobal:typeof window<"u"?window:{},Ns;typeof document<"u"?Ns=document:(Ns=hu["__GLOBAL_DOCUMENT_CACHE@4"],Ns||(Ns=hu["__GLOBAL_DOCUMENT_CACHE@4"]={}));var Vc=Ns;const V=Ce.getDefaultExportFromCjs(Vc);var go={exports:{}};function _e(){return _e=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)({}).hasOwnProperty.call(t,s)&&(i[s]=t[s])}return i},_e.apply(null,arguments)}const P0=Object.freeze(Object.defineProperty({__proto__:null,get default(){return _e}},Symbol.toStringTag,{value:"Module"})),L0=Ce.getAugmentedNamespace(P0);var O0=R0,M0=Object.prototype.toString;function R0(i){if(!i)return!1;var e=M0.call(i);return e==="[object Function]"||typeof i=="function"&&e!=="[object RegExp]"||typeof window<"u"&&(i===window.setTimeout||i===window.alert||i===window.confirm||i===window.prompt)}function N0(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t)return(t=t.call(i)).next.bind(t);if(Array.isArray(i)||(t=B0(i))||e){t&&(i=t);var s=0;return function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B0(i,e){if(i){if(typeof i=="string")return fu(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return fu(i,e)}}function fu(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=i[t];return s}var F0=function(){function i(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var e=i.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},e.addInterceptor=function(s,r){this.typeToInterceptorsMap_.has(s)||this.typeToInterceptorsMap_.set(s,new Set);var n=this.typeToInterceptorsMap_.get(s);return n.has(r)?!1:(n.add(r),!0)},e.removeInterceptor=function(s,r){var n=this.typeToInterceptorsMap_.get(s);return n&&n.has(r)?(n.delete(r),!0):!1},e.clearInterceptorsByType=function(s){var r=this.typeToInterceptorsMap_.get(s);return r?(this.typeToInterceptorsMap_.delete(s),this.typeToInterceptorsMap_.set(s,new Set),!0):!1},e.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},e.getForType=function(s){return this.typeToInterceptorsMap_.get(s)||new Set},e.execute=function(s,r){for(var n=this.getForType(s),a=N0(n),l;!(l=a()).done;){var u=l.value;try{r=u(r)}catch{}}return r},i}(),U0=F0,V0=function(){function i(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var e=i.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},e.getMaxAttempts=function(){return this.maxAttempts_},e.setMaxAttempts=function(s){this.maxAttempts_=s},e.getDelayFactor=function(){return this.delayFactor_},e.setDelayFactor=function(s){this.delayFactor_=s},e.getFuzzFactor=function(){return this.fuzzFactor_},e.setFuzzFactor=function(s){this.fuzzFactor_=s},e.getInitialDelay=function(){return this.initialDelay_},e.setInitialDelay=function(s){this.initialDelay_=s},e.createRetry=function(s){var r=s===void 0?{}:s,n=r.maxAttempts,a=r.delayFactor,l=r.fuzzFactor,u=r.initialDelay;return new H0({maxAttempts:n||this.maxAttempts_,delayFactor:a||this.delayFactor_,fuzzFactor:l||this.fuzzFactor_,initialDelay:u||this.initialDelay_})},i}(),H0=function(){function i(t){this.maxAttempts_=t.maxAttempts,this.delayFactor_=t.delayFactor,this.fuzzFactor_=t.fuzzFactor,this.currentDelay_=t.initialDelay,this.currentAttempt_=1}var e=i.prototype;return e.moveToNextAttempt=function(){this.currentAttempt_++;var s=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+s},e.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},e.getCurrentDelay=function(){return this.currentDelay_},e.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},e.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},e.getCurrentFuzzedDelay=function(){var s=this.getCurrentMinPossibleDelay(),r=this.getCurrentMaxPossibleDelay();return s+Math.random()*(r-s)},i}(),q0=V0,z0=Cn,$0=function(e,t){return t===void 0&&(t=!1),function(s,r,n){if(s){e(s);return}if(r.statusCode>=400&&r.statusCode<=599){var a=n;if(t)if(z0.TextDecoder){var l=G0(r.headers&&r.headers["content-type"]);try{a=new TextDecoder(l).decode(n)}catch{}}else a=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:a});return}e(null,n)}};function G0(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(e,t){var s=t.split("="),r=s[0],n=s[1];return r.trim()==="charset"?n.trim():e},"utf-8")}var W0=$0,Hc=Cn,X0=L0,Y0=O0,qc=U0,K0=q0;xe.httpHandler=W0;xe.requestInterceptorsStorage=new qc;xe.responseInterceptorsStorage=new qc;xe.retryManager=new K0;/**
3
3
  * @license
4
4
  * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
5
5
  * Copyright (c) 2014 David Björklund
6
6
  * Available under the MIT license
7
7
  * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
8
- */var rg=function(e){var t={};return e&&e.trim().split(`
9
- `).forEach(function(s){var r=s.indexOf(":"),n=s.slice(0,r).trim().toLowerCase(),a=s.slice(r+1).trim();typeof t[n]>"u"?t[n]=a:Array.isArray(t[n])?t[n].push(a):t[n]=[t[n],a]}),t};yo.exports=xe;yo.exports.default=xe;xe.XMLHttpRequest=$c.XMLHttpRequest||lg;xe.XDomainRequest="withCredentials"in new xe.XMLHttpRequest?xe.XMLHttpRequest:$c.XDomainRequest;ng(["get","put","post","patch","head","delete"],function(i){xe[i==="delete"?"del":i]=function(e,t,s){return t=Wc(e,t,s),t.method=i.toUpperCase(),_o(t)}});function ng(i,e){for(var t=0;t<i.length;t++)e(i[t])}function ag(i){for(var e in i)if(i.hasOwnProperty(e))return!1;return!0}function Wc(i,e,t){var s=i;return ig(e)?(t=e,typeof i=="string"&&(s={uri:i})):s=tg({},e,{uri:i}),s.callback=t,s}function xe(i,e,t){return e=Wc(i,e,t),_o(e)}function _o(i){if(typeof i.callback>"u")throw new Error("callback argument missing");if(i.requestType&&xe.requestInterceptorsStorage.getIsEnabled()){var e={uri:i.uri||i.url,headers:i.headers||{},body:i.body,metadata:i.metadata||{},retry:i.retry,timeout:i.timeout},t=xe.requestInterceptorsStorage.execute(i.requestType,e);i.uri=t.uri,i.headers=t.headers,i.body=t.body,i.metadata=t.metadata,i.retry=t.retry,i.timeout=t.timeout}var s=!1,r=function(O,F,B){s||(s=!0,i.callback(O,F,B))};function n(){f.readyState===4&&!xe.responseInterceptorsStorage.getIsEnabled()&&setTimeout(u,0)}function a(){var L=void 0;if(f.response?L=f.response:L=f.responseText||og(f),w)try{L=JSON.parse(L)}catch{}return L}function l(L){if(clearTimeout(I),clearTimeout(i.retryTimeout),L instanceof Error||(L=new Error(""+(L||"Unknown XMLHttpRequest Error"))),L.statusCode=0,!v&&xe.retryManager.getIsEnabled()&&i.retry&&i.retry.shouldRetry()){i.retryTimeout=setTimeout(function(){i.retry.moveToNextAttempt(),i.xhr=f,_o(i)},i.retry.getCurrentFuzzedDelay());return}if(i.requestType&&xe.responseInterceptorsStorage.getIsEnabled()){var O={headers:j.headers||{},body:j.body,responseUrl:f.responseURL,responseType:f.responseType},F=xe.responseInterceptorsStorage.execute(i.requestType,O);j.body=F.body,j.headers=F.headers}return r(L,j)}function u(){if(!v){var L;clearTimeout(I),clearTimeout(i.retryTimeout),i.useXDR&&f.status===void 0?L=200:L=f.status===1223?204:f.status;var O=j,F=null;if(L!==0?(O={body:a(),statusCode:L,method:E,headers:{},url:T,rawRequest:f},f.getAllResponseHeaders&&(O.headers=rg(f.getAllResponseHeaders()))):F=new Error("Internal XMLHttpRequest Error"),i.requestType&&xe.responseInterceptorsStorage.getIsEnabled()){var B={headers:O.headers||{},body:O.body,responseUrl:f.responseURL,responseType:f.responseType},U=xe.responseInterceptorsStorage.execute(i.requestType,B);O.body=U.body,O.headers=U.headers}return r(F,O,O.body)}}var f=i.xhr||null;f||(i.cors||i.useXDR?f=new xe.XDomainRequest:f=new xe.XMLHttpRequest);var m,v,T=f.url=i.uri||i.url,E=f.method=i.method||"GET",A=i.body||i.data,y=f.headers=i.headers||{},k=!!i.sync,w=!1,I,j={body:void 0,headers:{},statusCode:0,method:E,url:T,rawRequest:f};if("json"in i&&i.json!==!1&&(w=!0,y.accept||y.Accept||(y.Accept="application/json"),E!=="GET"&&E!=="HEAD"&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),A=JSON.stringify(i.json===!0?A:i.json))),f.onreadystatechange=n,f.onload=u,f.onerror=l,f.onprogress=function(){},f.onabort=function(){v=!0,clearTimeout(i.retryTimeout)},f.ontimeout=l,f.open(E,T,!k,i.username,i.password),k||(f.withCredentials=!!i.withCredentials),!k&&i.timeout>0&&(I=setTimeout(function(){if(!v){v=!0,f.abort("timeout");var L=new Error("XMLHttpRequest timeout");L.code="ETIMEDOUT",l(L)}},i.timeout)),f.setRequestHeader)for(m in y)y.hasOwnProperty(m)&&f.setRequestHeader(m,y[m]);else if(i.headers&&!ag(i.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in i&&(f.responseType=i.responseType),"beforeSend"in i&&typeof i.beforeSend=="function"&&i.beforeSend(f),f.send(A||null),f}function og(i){try{if(i.responseType==="document")return i.responseXML;var e=i.responseXML&&i.responseXML.documentElement.nodeName==="parsererror";if(i.responseType===""&&!e)return i.responseXML}catch{}return null}function lg(){}var ug=yo.exports;const Xc=sr(ug);var Yc={exports:{}},gu=zc,bo=Object.create||function(){function i(){}return function(e){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return i.prototype=e,new i}}();function Ze(i,e){this.name="ParsingError",this.code=i.code,this.message=e||i.message}Ze.prototype=bo(Error.prototype);Ze.prototype.constructor=Ze;Ze.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function To(i){function e(s,r,n,a){return(s|0)*3600+(r|0)*60+(n|0)+(a|0)/1e3}var t=i.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return t?t[3]?e(t[1],t[2],t[3].replace(":",""),t[4]):t[1]>59?e(t[1],t[2],0,t[4]):e(0,t[1],t[2],t[4]):null}function Hs(){this.values=bo(null)}Hs.prototype={set:function(i,e){!this.get(i)&&e!==""&&(this.values[i]=e)},get:function(i,e,t){return t?this.has(i)?this.values[i]:e[t]:this.has(i)?this.values[i]:e},has:function(i){return i in this.values},alt:function(i,e,t){for(var s=0;s<t.length;++s)if(e===t[s]){this.set(i,e);break}},integer:function(i,e){/^-?\d+$/.test(e)&&this.set(i,parseInt(e,10))},percent:function(i,e){return e.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(e=parseFloat(e),e>=0&&e<=100)?(this.set(i,e),!0):!1}};function Bs(i,e,t,s){var r=s?i.split(s):[i];for(var n in r)if(typeof r[n]=="string"){var a=r[n].split(t);if(a.length===2){var l=a[0].trim(),u=a[1].trim();e(l,u)}}}function cg(i,e,t){var s=i;function r(){var l=To(i);if(l===null)throw new Ze(Ze.Errors.BadTimeStamp,"Malformed timestamp: "+s);return i=i.replace(/^[^\sa-zA-Z-]+/,""),l}function n(l,u){var f=new Hs;Bs(l,function(m,v){switch(m){case"region":for(var T=t.length-1;T>=0;T--)if(t[T].id===v){f.set(m,t[T].region);break}break;case"vertical":f.alt(m,v,["rl","lr"]);break;case"line":var E=v.split(","),A=E[0];f.integer(m,A),f.percent(m,A)&&f.set("snapToLines",!1),f.alt(m,A,["auto"]),E.length===2&&f.alt("lineAlign",E[1],["start","center","end"]);break;case"position":E=v.split(","),f.percent(m,E[0]),E.length===2&&f.alt("positionAlign",E[1],["start","center","end"]);break;case"size":f.percent(m,v);break;case"align":f.alt(m,v,["start","center","end","left","right"]);break}},/:/,/\s/),u.region=f.get("region",null),u.vertical=f.get("vertical","");try{u.line=f.get("line","auto")}catch{}u.lineAlign=f.get("lineAlign","start"),u.snapToLines=f.get("snapToLines",!0),u.size=f.get("size",100);try{u.align=f.get("align","center")}catch{u.align=f.get("align","middle")}try{u.position=f.get("position","auto")}catch{u.position=f.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},u.align)}u.positionAlign=f.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},u.align)}function a(){i=i.replace(/^\s+/,"")}if(a(),e.startTime=r(),a(),i.substr(0,3)!=="-->")throw new Ze(Ze.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+s);i=i.substr(3),a(),e.endTime=r(),a(),n(i,e)}var _a=gu.createElement&&gu.createElement("textarea"),dg={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},vu={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},hg={v:"title",lang:"lang"},yu={rt:"ruby"};function Kc(i,e){function t(){if(!e)return null;function A(k){return e=e.substr(k.length),k}var y=e.match(/^([^<]*)(<[^>]*>?)?/);return A(y[1]?y[1]:y[2])}function s(A){return _a.innerHTML=A,A=_a.textContent,_a.textContent="",A}function r(A,y){return!yu[y.localName]||yu[y.localName]===A.localName}function n(A,y){var k=dg[A];if(!k)return null;var w=i.document.createElement(k),I=hg[A];return I&&y&&(w[I]=y.trim()),w}for(var a=i.document.createElement("div"),l=a,u,f=[];(u=t())!==null;){if(u[0]==="<"){if(u[1]==="/"){f.length&&f[f.length-1]===u.substr(2).replace(">","")&&(f.pop(),l=l.parentNode);continue}var m=To(u.substr(1,u.length-2)),v;if(m){v=i.document.createProcessingInstruction("timestamp",m),l.appendChild(v);continue}var T=u.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!T||(v=n(T[1],T[3]),!v)||!r(l,v))continue;if(T[2]){var E=T[2].split(".");E.forEach(function(A){var y=/^bg_/.test(A),k=y?A.slice(3):A;if(vu.hasOwnProperty(k)){var w=y?"background-color":"color",I=vu[k];v.style[w]=I}}),v.className=E.join(" ")}f.push(T[1]),l.appendChild(v),l=v;continue}l.appendChild(i.document.createTextNode(s(u)))}return a}var _u=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function fg(i){for(var e=0;e<_u.length;e++){var t=_u[e];if(i>=t[0]&&i<=t[1])return!0}return!1}function pg(i){var e=[],t="",s;if(!i||!i.childNodes)return"ltr";function r(l,u){for(var f=u.childNodes.length-1;f>=0;f--)l.push(u.childNodes[f])}function n(l){if(!l||!l.length)return null;var u=l.pop(),f=u.textContent||u.innerText;if(f){var m=f.match(/^.*(\n|\r)/);return m?(l.length=0,m[0]):f}if(u.tagName==="ruby")return n(l);if(u.childNodes)return r(l,u),n(l)}for(r(e,i);t=n(e);)for(var a=0;a<t.length;a++)if(s=t.charCodeAt(a),fg(s))return"rtl";return"ltr"}function mg(i){if(typeof i.line=="number"&&(i.snapToLines||i.line>=0&&i.line<=100))return i.line;if(!i.track||!i.track.textTrackList||!i.track.textTrackList.mediaElement)return-1;for(var e=i.track,t=e.textTrackList,s=0,r=0;r<t.length&&t[r]!==e;r++)t[r].mode==="showing"&&s++;return++s*-1}function wn(){}wn.prototype.applyStyles=function(i,e){e=e||this.div;for(var t in i)i.hasOwnProperty(t)&&(e.style[t]=i[t])};wn.prototype.formatStyle=function(i,e){return i===0?0:i+e};function en(i,e,t){wn.call(this),this.cue=e,this.cueDiv=Kc(i,e.text);var s={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(s,this.cueDiv),this.div=i.document.createElement("div"),s={direction:pg(this.cueDiv),writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:e.align==="middle"?"center":e.align,font:t.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(s),this.div.appendChild(this.cueDiv);var r=0;switch(e.positionAlign){case"start":case"line-left":r=e.position;break;case"center":r=e.position-e.size/2;break;case"end":case"line-right":r=e.position-e.size;break}e.vertical===""?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(e.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),height:this.formatStyle(e.size,"%")}),this.move=function(n){this.applyStyles({top:this.formatStyle(n.top,"px"),bottom:this.formatStyle(n.bottom,"px"),left:this.formatStyle(n.left,"px"),right:this.formatStyle(n.right,"px"),height:this.formatStyle(n.height,"px"),width:this.formatStyle(n.width,"px")})}}en.prototype=bo(wn.prototype);en.prototype.constructor=en;function Ue(i){var e,t,s,r;if(i.div){t=i.div.offsetHeight,s=i.div.offsetWidth,r=i.div.offsetTop;var n=(n=i.div.childNodes)&&(n=n[0])&&n.getClientRects&&n.getClientRects();i=i.div.getBoundingClientRect(),e=n?Math.max(n[0]&&n[0].height||0,i.height/n.length):0}this.left=i.left,this.right=i.right,this.top=i.top||r,this.height=i.height||t,this.bottom=i.bottom||r+(i.height||t),this.width=i.width||s,this.lineHeight=e!==void 0?e:i.lineHeight}Ue.prototype.move=function(i,e){switch(e=e!==void 0?e:this.lineHeight,i){case"+x":this.left+=e,this.right+=e;break;case"-x":this.left-=e,this.right-=e;break;case"+y":this.top+=e,this.bottom+=e;break;case"-y":this.top-=e,this.bottom-=e;break}};Ue.prototype.overlaps=function(i){return this.left<i.right&&this.right>i.left&&this.top<i.bottom&&this.bottom>i.top};Ue.prototype.overlapsAny=function(i){for(var e=0;e<i.length;e++)if(this.overlaps(i[e]))return!0;return!1};Ue.prototype.within=function(i){return this.top>=i.top&&this.bottom<=i.bottom&&this.left>=i.left&&this.right<=i.right};Ue.prototype.overlapsOppositeAxis=function(i,e){switch(e){case"+x":return this.left<i.left;case"-x":return this.right>i.right;case"+y":return this.top<i.top;case"-y":return this.bottom>i.bottom}};Ue.prototype.intersectPercentage=function(i){var e=Math.max(0,Math.min(this.right,i.right)-Math.max(this.left,i.left)),t=Math.max(0,Math.min(this.bottom,i.bottom)-Math.max(this.top,i.top)),s=e*t;return s/(this.height*this.width)};Ue.prototype.toCSSCompatValues=function(i){return{top:this.top-i.top,bottom:i.bottom-this.bottom,left:this.left-i.left,right:i.right-this.right,height:this.height,width:this.width}};Ue.getSimpleBoxPosition=function(i){var e=i.div?i.div.offsetHeight:i.tagName?i.offsetHeight:0,t=i.div?i.div.offsetWidth:i.tagName?i.offsetWidth:0,s=i.div?i.div.offsetTop:i.tagName?i.offsetTop:0;i=i.div?i.div.getBoundingClientRect():i.tagName?i.getBoundingClientRect():i;var r={left:i.left,right:i.right,top:i.top||s,height:i.height||e,bottom:i.bottom||s+(i.height||e),width:i.width||t};return r};function gg(i,e,t,s){function r(k,w){for(var I,j=new Ue(k),L=1,O=0;O<w.length;O++){for(;k.overlapsOppositeAxis(t,w[O])||k.within(t)&&k.overlapsAny(s);)k.move(w[O]);if(k.within(t))return k;var F=k.intersectPercentage(t);L>F&&(I=new Ue(k),L=F),k=new Ue(j)}return I||j}var n=new Ue(e),a=e.cue,l=mg(a),u=[];if(a.snapToLines){var f;switch(a.vertical){case"":u=["+y","-y"],f="height";break;case"rl":u=["+x","-x"],f="width";break;case"lr":u=["-x","+x"],f="width";break}var m=n.lineHeight,v=m*Math.round(l),T=t[f]+m,E=u[0];Math.abs(v)>T&&(v=v<0?-1:1,v*=Math.ceil(T/m)*m),l<0&&(v+=a.vertical===""?t.height:t.width,u=u.reverse()),n.move(E,v)}else{var A=n.lineHeight/t.height*100;switch(a.lineAlign){case"center":l-=A/2;break;case"end":l-=A;break}switch(a.vertical){case"":e.applyStyles({top:e.formatStyle(l,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(l,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(l,"%")});break}u=["+y","-x","+x","-y"],n=new Ue(e)}var y=r(n,u);e.move(y.toCSSCompatValues(t))}function rs(){}rs.StringDecoder=function(){return{decode:function(i){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))}}};rs.convertCueToDOMTree=function(i,e){return!i||!e?null:Kc(i,e)};var vg=.05,yg="sans-serif",_g="1.5%";rs.processCues=function(i,e,t){if(!i||!e||!t)return null;for(;t.firstChild;)t.removeChild(t.firstChild);var s=i.document.createElement("div");s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top="0",s.style.bottom="0",s.style.margin=_g,t.appendChild(s);function r(m){for(var v=0;v<m.length;v++)if(m[v].hasBeenReset||!m[v].displayState)return!0;return!1}if(!r(e)){for(var n=0;n<e.length;n++)s.appendChild(e[n].displayState);return}var a=[],l=Ue.getSimpleBoxPosition(s),u=Math.round(l.height*vg*100)/100,f={font:u+"px "+yg};(function(){for(var m,v,T=0;T<e.length;T++)v=e[T],m=new en(i,v,f),s.appendChild(m.div),gg(i,m,l,a),v.displayState=m.div,a.push(Ue.getSimpleBoxPosition(m))})()};rs.Parser=function(i,e,t){t||(t=e,e={}),e||(e={}),this.window=i,this.vttjs=e,this.state="INITIAL",this.buffer="",this.decoder=t||new TextDecoder("utf8"),this.regionList=[]};rs.Parser.prototype={reportOrThrowError:function(i){if(i instanceof Ze)this.onparsingerror&&this.onparsingerror(i);else throw i},parse:function(i){var e=this;i&&(e.buffer+=e.decoder.decode(i,{stream:!0}));function t(){for(var m=e.buffer,v=0;v<m.length&&m[v]!=="\r"&&m[v]!==`
8
+ */var Q0=function(e){var t={};return e&&e.trim().split(`
9
+ `).forEach(function(s){var r=s.indexOf(":"),n=s.slice(0,r).trim().toLowerCase(),a=s.slice(r+1).trim();typeof t[n]>"u"?t[n]=a:Array.isArray(t[n])?t[n].push(a):t[n]=[t[n],a]}),t};go.exports=xe;go.exports.default=xe;xe.XMLHttpRequest=Hc.XMLHttpRequest||tg;xe.XDomainRequest="withCredentials"in new xe.XMLHttpRequest?xe.XMLHttpRequest:Hc.XDomainRequest;J0(["get","put","post","patch","head","delete"],function(i){xe[i==="delete"?"del":i]=function(e,t,s){return t=zc(e,t,s),t.method=i.toUpperCase(),vo(t)}});function J0(i,e){for(var t=0;t<i.length;t++)e(i[t])}function Z0(i){for(var e in i)if(i.hasOwnProperty(e))return!1;return!0}function zc(i,e,t){var s=i;return Y0(e)?(t=e,typeof i=="string"&&(s={uri:i})):s=X0({},e,{uri:i}),s.callback=t,s}function xe(i,e,t){return e=zc(i,e,t),vo(e)}function vo(i){if(typeof i.callback>"u")throw new Error("callback argument missing");if(i.requestType&&xe.requestInterceptorsStorage.getIsEnabled()){var e={uri:i.uri||i.url,headers:i.headers||{},body:i.body,metadata:i.metadata||{},retry:i.retry,timeout:i.timeout},t=xe.requestInterceptorsStorage.execute(i.requestType,e);i.uri=t.uri,i.headers=t.headers,i.body=t.body,i.metadata=t.metadata,i.retry=t.retry,i.timeout=t.timeout}var s=!1,r=function(O,F,B){s||(s=!0,i.callback(O,F,B))};function n(){f.readyState===4&&!xe.responseInterceptorsStorage.getIsEnabled()&&setTimeout(u,0)}function a(){var L=void 0;if(f.response?L=f.response:L=f.responseText||eg(f),w)try{L=JSON.parse(L)}catch{}return L}function l(L){if(clearTimeout(I),clearTimeout(i.retryTimeout),L instanceof Error||(L=new Error(""+(L||"Unknown XMLHttpRequest Error"))),L.statusCode=0,!v&&xe.retryManager.getIsEnabled()&&i.retry&&i.retry.shouldRetry()){i.retryTimeout=setTimeout(function(){i.retry.moveToNextAttempt(),i.xhr=f,vo(i)},i.retry.getCurrentFuzzedDelay());return}if(i.requestType&&xe.responseInterceptorsStorage.getIsEnabled()){var O={headers:j.headers||{},body:j.body,responseUrl:f.responseURL,responseType:f.responseType},F=xe.responseInterceptorsStorage.execute(i.requestType,O);j.body=F.body,j.headers=F.headers}return r(L,j)}function u(){if(!v){var L;clearTimeout(I),clearTimeout(i.retryTimeout),i.useXDR&&f.status===void 0?L=200:L=f.status===1223?204:f.status;var O=j,F=null;if(L!==0?(O={body:a(),statusCode:L,method:E,headers:{},url:T,rawRequest:f},f.getAllResponseHeaders&&(O.headers=Q0(f.getAllResponseHeaders()))):F=new Error("Internal XMLHttpRequest Error"),i.requestType&&xe.responseInterceptorsStorage.getIsEnabled()){var B={headers:O.headers||{},body:O.body,responseUrl:f.responseURL,responseType:f.responseType},U=xe.responseInterceptorsStorage.execute(i.requestType,B);O.body=U.body,O.headers=U.headers}return r(F,O,O.body)}}var f=i.xhr||null;f||(i.cors||i.useXDR?f=new xe.XDomainRequest:f=new xe.XMLHttpRequest);var m,v,T=f.url=i.uri||i.url,E=f.method=i.method||"GET",A=i.body||i.data,y=f.headers=i.headers||{},k=!!i.sync,w=!1,I,j={body:void 0,headers:{},statusCode:0,method:E,url:T,rawRequest:f};if("json"in i&&i.json!==!1&&(w=!0,y.accept||y.Accept||(y.Accept="application/json"),E!=="GET"&&E!=="HEAD"&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),A=JSON.stringify(i.json===!0?A:i.json))),f.onreadystatechange=n,f.onload=u,f.onerror=l,f.onprogress=function(){},f.onabort=function(){v=!0,clearTimeout(i.retryTimeout)},f.ontimeout=l,f.open(E,T,!k,i.username,i.password),k||(f.withCredentials=!!i.withCredentials),!k&&i.timeout>0&&(I=setTimeout(function(){if(!v){v=!0,f.abort("timeout");var L=new Error("XMLHttpRequest timeout");L.code="ETIMEDOUT",l(L)}},i.timeout)),f.setRequestHeader)for(m in y)y.hasOwnProperty(m)&&f.setRequestHeader(m,y[m]);else if(i.headers&&!Z0(i.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in i&&(f.responseType=i.responseType),"beforeSend"in i&&typeof i.beforeSend=="function"&&i.beforeSend(f),f.send(A||null),f}function eg(i){try{if(i.responseType==="document")return i.responseXML;var e=i.responseXML&&i.responseXML.documentElement.nodeName==="parsererror";if(i.responseType===""&&!e)return i.responseXML}catch{}return null}function tg(){}var ig=go.exports;const $c=Ce.getDefaultExportFromCjs(ig);var Gc={exports:{}},pu=Vc,yo=Object.create||function(){function i(){}return function(e){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return i.prototype=e,new i}}();function et(i,e){this.name="ParsingError",this.code=i.code,this.message=e||i.message}et.prototype=yo(Error.prototype);et.prototype.constructor=et;et.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function _o(i){function e(s,r,n,a){return(s|0)*3600+(r|0)*60+(n|0)+(a|0)/1e3}var t=i.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return t?t[3]?e(t[1],t[2],t[3].replace(":",""),t[4]):t[1]>59?e(t[1],t[2],0,t[4]):e(0,t[1],t[2],t[4]):null}function Hs(){this.values=yo(null)}Hs.prototype={set:function(i,e){!this.get(i)&&e!==""&&(this.values[i]=e)},get:function(i,e,t){return t?this.has(i)?this.values[i]:e[t]:this.has(i)?this.values[i]:e},has:function(i){return i in this.values},alt:function(i,e,t){for(var s=0;s<t.length;++s)if(e===t[s]){this.set(i,e);break}},integer:function(i,e){/^-?\d+$/.test(e)&&this.set(i,parseInt(e,10))},percent:function(i,e){return e.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(e=parseFloat(e),e>=0&&e<=100)?(this.set(i,e),!0):!1}};function Bs(i,e,t,s){var r=s?i.split(s):[i];for(var n in r)if(typeof r[n]=="string"){var a=r[n].split(t);if(a.length===2){var l=a[0].trim(),u=a[1].trim();e(l,u)}}}function sg(i,e,t){var s=i;function r(){var l=_o(i);if(l===null)throw new et(et.Errors.BadTimeStamp,"Malformed timestamp: "+s);return i=i.replace(/^[^\sa-zA-Z-]+/,""),l}function n(l,u){var f=new Hs;Bs(l,function(m,v){switch(m){case"region":for(var T=t.length-1;T>=0;T--)if(t[T].id===v){f.set(m,t[T].region);break}break;case"vertical":f.alt(m,v,["rl","lr"]);break;case"line":var E=v.split(","),A=E[0];f.integer(m,A),f.percent(m,A)&&f.set("snapToLines",!1),f.alt(m,A,["auto"]),E.length===2&&f.alt("lineAlign",E[1],["start","center","end"]);break;case"position":E=v.split(","),f.percent(m,E[0]),E.length===2&&f.alt("positionAlign",E[1],["start","center","end"]);break;case"size":f.percent(m,v);break;case"align":f.alt(m,v,["start","center","end","left","right"]);break}},/:/,/\s/),u.region=f.get("region",null),u.vertical=f.get("vertical","");try{u.line=f.get("line","auto")}catch{}u.lineAlign=f.get("lineAlign","start"),u.snapToLines=f.get("snapToLines",!0),u.size=f.get("size",100);try{u.align=f.get("align","center")}catch{u.align=f.get("align","middle")}try{u.position=f.get("position","auto")}catch{u.position=f.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},u.align)}u.positionAlign=f.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},u.align)}function a(){i=i.replace(/^\s+/,"")}if(a(),e.startTime=r(),a(),i.substr(0,3)!=="-->")throw new et(et.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+s);i=i.substr(3),a(),e.endTime=r(),a(),n(i,e)}var va=pu.createElement&&pu.createElement("textarea"),rg={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},mu={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},ng={v:"title",lang:"lang"},gu={rt:"ruby"};function Wc(i,e){function t(){if(!e)return null;function A(k){return e=e.substr(k.length),k}var y=e.match(/^([^<]*)(<[^>]*>?)?/);return A(y[1]?y[1]:y[2])}function s(A){return va.innerHTML=A,A=va.textContent,va.textContent="",A}function r(A,y){return!gu[y.localName]||gu[y.localName]===A.localName}function n(A,y){var k=rg[A];if(!k)return null;var w=i.document.createElement(k),I=ng[A];return I&&y&&(w[I]=y.trim()),w}for(var a=i.document.createElement("div"),l=a,u,f=[];(u=t())!==null;){if(u[0]==="<"){if(u[1]==="/"){f.length&&f[f.length-1]===u.substr(2).replace(">","")&&(f.pop(),l=l.parentNode);continue}var m=_o(u.substr(1,u.length-2)),v;if(m){v=i.document.createProcessingInstruction("timestamp",m),l.appendChild(v);continue}var T=u.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!T||(v=n(T[1],T[3]),!v)||!r(l,v))continue;if(T[2]){var E=T[2].split(".");E.forEach(function(A){var y=/^bg_/.test(A),k=y?A.slice(3):A;if(mu.hasOwnProperty(k)){var w=y?"background-color":"color",I=mu[k];v.style[w]=I}}),v.className=E.join(" ")}f.push(T[1]),l.appendChild(v),l=v;continue}l.appendChild(i.document.createTextNode(s(u)))}return a}var vu=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function ag(i){for(var e=0;e<vu.length;e++){var t=vu[e];if(i>=t[0]&&i<=t[1])return!0}return!1}function og(i){var e=[],t="",s;if(!i||!i.childNodes)return"ltr";function r(l,u){for(var f=u.childNodes.length-1;f>=0;f--)l.push(u.childNodes[f])}function n(l){if(!l||!l.length)return null;var u=l.pop(),f=u.textContent||u.innerText;if(f){var m=f.match(/^.*(\n|\r)/);return m?(l.length=0,m[0]):f}if(u.tagName==="ruby")return n(l);if(u.childNodes)return r(l,u),n(l)}for(r(e,i);t=n(e);)for(var a=0;a<t.length;a++)if(s=t.charCodeAt(a),ag(s))return"rtl";return"ltr"}function lg(i){if(typeof i.line=="number"&&(i.snapToLines||i.line>=0&&i.line<=100))return i.line;if(!i.track||!i.track.textTrackList||!i.track.textTrackList.mediaElement)return-1;for(var e=i.track,t=e.textTrackList,s=0,r=0;r<t.length&&t[r]!==e;r++)t[r].mode==="showing"&&s++;return++s*-1}function En(){}En.prototype.applyStyles=function(i,e){e=e||this.div;for(var t in i)i.hasOwnProperty(t)&&(e.style[t]=i[t])};En.prototype.formatStyle=function(i,e){return i===0?0:i+e};function Jr(i,e,t){En.call(this),this.cue=e,this.cueDiv=Wc(i,e.text);var s={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(s,this.cueDiv),this.div=i.document.createElement("div"),s={direction:og(this.cueDiv),writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:e.align==="middle"?"center":e.align,font:t.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(s),this.div.appendChild(this.cueDiv);var r=0;switch(e.positionAlign){case"start":case"line-left":r=e.position;break;case"center":r=e.position-e.size/2;break;case"end":case"line-right":r=e.position-e.size;break}e.vertical===""?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(e.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),height:this.formatStyle(e.size,"%")}),this.move=function(n){this.applyStyles({top:this.formatStyle(n.top,"px"),bottom:this.formatStyle(n.bottom,"px"),left:this.formatStyle(n.left,"px"),right:this.formatStyle(n.right,"px"),height:this.formatStyle(n.height,"px"),width:this.formatStyle(n.width,"px")})}}Jr.prototype=yo(En.prototype);Jr.prototype.constructor=Jr;function Ve(i){var e,t,s,r;if(i.div){t=i.div.offsetHeight,s=i.div.offsetWidth,r=i.div.offsetTop;var n=(n=i.div.childNodes)&&(n=n[0])&&n.getClientRects&&n.getClientRects();i=i.div.getBoundingClientRect(),e=n?Math.max(n[0]&&n[0].height||0,i.height/n.length):0}this.left=i.left,this.right=i.right,this.top=i.top||r,this.height=i.height||t,this.bottom=i.bottom||r+(i.height||t),this.width=i.width||s,this.lineHeight=e!==void 0?e:i.lineHeight}Ve.prototype.move=function(i,e){switch(e=e!==void 0?e:this.lineHeight,i){case"+x":this.left+=e,this.right+=e;break;case"-x":this.left-=e,this.right-=e;break;case"+y":this.top+=e,this.bottom+=e;break;case"-y":this.top-=e,this.bottom-=e;break}};Ve.prototype.overlaps=function(i){return this.left<i.right&&this.right>i.left&&this.top<i.bottom&&this.bottom>i.top};Ve.prototype.overlapsAny=function(i){for(var e=0;e<i.length;e++)if(this.overlaps(i[e]))return!0;return!1};Ve.prototype.within=function(i){return this.top>=i.top&&this.bottom<=i.bottom&&this.left>=i.left&&this.right<=i.right};Ve.prototype.overlapsOppositeAxis=function(i,e){switch(e){case"+x":return this.left<i.left;case"-x":return this.right>i.right;case"+y":return this.top<i.top;case"-y":return this.bottom>i.bottom}};Ve.prototype.intersectPercentage=function(i){var e=Math.max(0,Math.min(this.right,i.right)-Math.max(this.left,i.left)),t=Math.max(0,Math.min(this.bottom,i.bottom)-Math.max(this.top,i.top)),s=e*t;return s/(this.height*this.width)};Ve.prototype.toCSSCompatValues=function(i){return{top:this.top-i.top,bottom:i.bottom-this.bottom,left:this.left-i.left,right:i.right-this.right,height:this.height,width:this.width}};Ve.getSimpleBoxPosition=function(i){var e=i.div?i.div.offsetHeight:i.tagName?i.offsetHeight:0,t=i.div?i.div.offsetWidth:i.tagName?i.offsetWidth:0,s=i.div?i.div.offsetTop:i.tagName?i.offsetTop:0;i=i.div?i.div.getBoundingClientRect():i.tagName?i.getBoundingClientRect():i;var r={left:i.left,right:i.right,top:i.top||s,height:i.height||e,bottom:i.bottom||s+(i.height||e),width:i.width||t};return r};function ug(i,e,t,s){function r(k,w){for(var I,j=new Ve(k),L=1,O=0;O<w.length;O++){for(;k.overlapsOppositeAxis(t,w[O])||k.within(t)&&k.overlapsAny(s);)k.move(w[O]);if(k.within(t))return k;var F=k.intersectPercentage(t);L>F&&(I=new Ve(k),L=F),k=new Ve(j)}return I||j}var n=new Ve(e),a=e.cue,l=lg(a),u=[];if(a.snapToLines){var f;switch(a.vertical){case"":u=["+y","-y"],f="height";break;case"rl":u=["+x","-x"],f="width";break;case"lr":u=["-x","+x"],f="width";break}var m=n.lineHeight,v=m*Math.round(l),T=t[f]+m,E=u[0];Math.abs(v)>T&&(v=v<0?-1:1,v*=Math.ceil(T/m)*m),l<0&&(v+=a.vertical===""?t.height:t.width,u=u.reverse()),n.move(E,v)}else{var A=n.lineHeight/t.height*100;switch(a.lineAlign){case"center":l-=A/2;break;case"end":l-=A;break}switch(a.vertical){case"":e.applyStyles({top:e.formatStyle(l,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(l,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(l,"%")});break}u=["+y","-x","+x","-y"],n=new Ve(e)}var y=r(n,u);e.move(y.toCSSCompatValues(t))}function rs(){}rs.StringDecoder=function(){return{decode:function(i){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))}}};rs.convertCueToDOMTree=function(i,e){return!i||!e?null:Wc(i,e)};var cg=.05,dg="sans-serif",hg="1.5%";rs.processCues=function(i,e,t){if(!i||!e||!t)return null;for(;t.firstChild;)t.removeChild(t.firstChild);var s=i.document.createElement("div");s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top="0",s.style.bottom="0",s.style.margin=hg,t.appendChild(s);function r(m){for(var v=0;v<m.length;v++)if(m[v].hasBeenReset||!m[v].displayState)return!0;return!1}if(!r(e)){for(var n=0;n<e.length;n++)s.appendChild(e[n].displayState);return}var a=[],l=Ve.getSimpleBoxPosition(s),u=Math.round(l.height*cg*100)/100,f={font:u+"px "+dg};(function(){for(var m,v,T=0;T<e.length;T++)v=e[T],m=new Jr(i,v,f),s.appendChild(m.div),ug(i,m,l,a),v.displayState=m.div,a.push(Ve.getSimpleBoxPosition(m))})()};rs.Parser=function(i,e,t){t||(t=e,e={}),e||(e={}),this.window=i,this.vttjs=e,this.state="INITIAL",this.buffer="",this.decoder=t||new TextDecoder("utf8"),this.regionList=[]};rs.Parser.prototype={reportOrThrowError:function(i){if(i instanceof et)this.onparsingerror&&this.onparsingerror(i);else throw i},parse:function(i){var e=this;i&&(e.buffer+=e.decoder.decode(i,{stream:!0}));function t(){for(var m=e.buffer,v=0;v<m.length&&m[v]!=="\r"&&m[v]!==`
10
10
  `;)++v;var T=m.substr(0,v);return m[v]==="\r"&&++v,m[v]===`
11
- `&&++v,e.buffer=m.substr(v),T}function s(m){var v=new Hs;if(Bs(m,function(E,A){switch(E){case"id":v.set(E,A);break;case"width":v.percent(E,A);break;case"lines":v.integer(E,A);break;case"regionanchor":case"viewportanchor":var y=A.split(",");if(y.length!==2)break;var k=new Hs;if(k.percent("x",y[0]),k.percent("y",y[1]),!k.has("x")||!k.has("y"))break;v.set(E+"X",k.get("x")),v.set(E+"Y",k.get("y"));break;case"scroll":v.alt(E,A,["up"]);break}},/=/,/\s/),v.has("id")){var T=new(e.vttjs.VTTRegion||e.window.VTTRegion);T.width=v.get("width",100),T.lines=v.get("lines",3),T.regionAnchorX=v.get("regionanchorX",0),T.regionAnchorY=v.get("regionanchorY",100),T.viewportAnchorX=v.get("viewportanchorX",0),T.viewportAnchorY=v.get("viewportanchorY",100),T.scroll=v.get("scroll",""),e.onregion&&e.onregion(T),e.regionList.push({id:v.get("id"),region:T})}}function r(m){var v=new Hs;Bs(m,function(T,E){switch(T){case"MPEGT":v.integer(T+"S",E);break;case"LOCA":v.set(T+"L",To(E));break}},/[^\d]:/,/,/),e.ontimestampmap&&e.ontimestampmap({MPEGTS:v.get("MPEGTS"),LOCAL:v.get("LOCAL")})}function n(m){m.match(/X-TIMESTAMP-MAP/)?Bs(m,function(v,T){switch(v){case"X-TIMESTAMP-MAP":r(T);break}},/=/):Bs(m,function(v,T){switch(v){case"Region":s(T);break}},/:/)}try{var a;if(e.state==="INITIAL"){if(!/\r\n|\n/.test(e.buffer))return this;a=t();var l=a.match(/^WEBVTT([ \t].*)?$/);if(!l||!l[0])throw new Ze(Ze.Errors.BadSignature);e.state="HEADER"}for(var u=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(u?u=!1:a=t(),e.state){case"HEADER":/:/.test(a)?n(a):a||(e.state="ID");continue;case"NOTE":a||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(a)){e.state="NOTE";break}if(!a)continue;e.cue=new(e.vttjs.VTTCue||e.window.VTTCue)(0,0,"");try{e.cue.align="center"}catch{e.cue.align="middle"}if(e.state="CUE",a.indexOf("-->")===-1){e.cue.id=a;continue}case"CUE":try{cg(a,e.cue,e.regionList)}catch(m){e.reportOrThrowError(m),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var f=a.indexOf("-->")!==-1;if(!a||f&&(u=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+=`
11
+ `&&++v,e.buffer=m.substr(v),T}function s(m){var v=new Hs;if(Bs(m,function(E,A){switch(E){case"id":v.set(E,A);break;case"width":v.percent(E,A);break;case"lines":v.integer(E,A);break;case"regionanchor":case"viewportanchor":var y=A.split(",");if(y.length!==2)break;var k=new Hs;if(k.percent("x",y[0]),k.percent("y",y[1]),!k.has("x")||!k.has("y"))break;v.set(E+"X",k.get("x")),v.set(E+"Y",k.get("y"));break;case"scroll":v.alt(E,A,["up"]);break}},/=/,/\s/),v.has("id")){var T=new(e.vttjs.VTTRegion||e.window.VTTRegion);T.width=v.get("width",100),T.lines=v.get("lines",3),T.regionAnchorX=v.get("regionanchorX",0),T.regionAnchorY=v.get("regionanchorY",100),T.viewportAnchorX=v.get("viewportanchorX",0),T.viewportAnchorY=v.get("viewportanchorY",100),T.scroll=v.get("scroll",""),e.onregion&&e.onregion(T),e.regionList.push({id:v.get("id"),region:T})}}function r(m){var v=new Hs;Bs(m,function(T,E){switch(T){case"MPEGT":v.integer(T+"S",E);break;case"LOCA":v.set(T+"L",_o(E));break}},/[^\d]:/,/,/),e.ontimestampmap&&e.ontimestampmap({MPEGTS:v.get("MPEGTS"),LOCAL:v.get("LOCAL")})}function n(m){m.match(/X-TIMESTAMP-MAP/)?Bs(m,function(v,T){switch(v){case"X-TIMESTAMP-MAP":r(T);break}},/=/):Bs(m,function(v,T){switch(v){case"Region":s(T);break}},/:/)}try{var a;if(e.state==="INITIAL"){if(!/\r\n|\n/.test(e.buffer))return this;a=t();var l=a.match(/^WEBVTT([ \t].*)?$/);if(!l||!l[0])throw new et(et.Errors.BadSignature);e.state="HEADER"}for(var u=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(u?u=!1:a=t(),e.state){case"HEADER":/:/.test(a)?n(a):a||(e.state="ID");continue;case"NOTE":a||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(a)){e.state="NOTE";break}if(!a)continue;e.cue=new(e.vttjs.VTTCue||e.window.VTTCue)(0,0,"");try{e.cue.align="center"}catch{e.cue.align="middle"}if(e.state="CUE",a.indexOf("-->")===-1){e.cue.id=a;continue}case"CUE":try{sg(a,e.cue,e.regionList)}catch(m){e.reportOrThrowError(m),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var f=a.indexOf("-->")!==-1;if(!a||f&&(u=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+=`
12
12
  `),e.cue.text+=a.replace(/\u2028/g,`
13
13
  `).replace(/u2029/g,`
14
14
  `);continue;case"BADCUE":a||(e.state="ID");continue}}}catch(m){e.reportOrThrowError(m),e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var i=this;try{if(i.buffer+=i.decoder.decode(),(i.cue||i.state==="HEADER")&&(i.buffer+=`
15
15
 
16
- `,i.parse()),i.state==="INITIAL")throw new Ze(Ze.Errors.BadSignature)}catch(e){i.reportOrThrowError(e)}return i.onflush&&i.onflush(),this}};var bg=rs,Tg="auto",xg={"":1,lr:1,rl:1},Sg={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function Cg(i){if(typeof i!="string")return!1;var e=xg[i.toLowerCase()];return e?i.toLowerCase():!1}function ba(i){if(typeof i!="string")return!1;var e=Sg[i.toLowerCase()];return e?i.toLowerCase():!1}function Qc(i,e,t){this.hasBeenReset=!1;var s="",r=!1,n=i,a=e,l=t,u=null,f="",m=!0,v="auto",T="start",E="auto",A="auto",y=100,k="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return s},set:function(w){s=""+w}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(w){r=!!w}},startTime:{enumerable:!0,get:function(){return n},set:function(w){if(typeof w!="number")throw new TypeError("Start time must be set to a number.");n=w,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(w){if(typeof w!="number")throw new TypeError("End time must be set to a number.");a=w,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return l},set:function(w){l=""+w,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(w){u=w,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return f},set:function(w){var I=Cg(w);if(I===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");f=I,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return m},set:function(w){m=!!w,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return v},set:function(w){if(typeof w!="number"&&w!==Tg)throw new SyntaxError("Line: an invalid number or illegal string was specified.");v=w,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return T},set:function(w){var I=ba(w);I?(T=I,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return E},set:function(w){if(w<0||w>100)throw new Error("Position must be between 0 and 100.");E=w,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return A},set:function(w){var I=ba(w);I?(A=I,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return y},set:function(w){if(w<0||w>100)throw new Error("Size must be between 0 and 100.");y=w,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return k},set:function(w){var I=ba(w);if(!I)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");k=I,this.hasBeenReset=!0}}}),this.displayState=void 0}Qc.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Eg=Qc,Ag={"":!0,up:!0};function wg(i){if(typeof i!="string")return!1;var e=Ag[i.toLowerCase()];return e?i.toLowerCase():!1}function ks(i){return typeof i=="number"&&i>=0&&i<=100}function Dg(){var i=100,e=3,t=0,s=100,r=0,n=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return i},set:function(l){if(!ks(l))throw new Error("Width must be between 0 and 100.");i=l}},lines:{enumerable:!0,get:function(){return e},set:function(l){if(typeof l!="number")throw new TypeError("Lines must be set to a number.");e=l}},regionAnchorY:{enumerable:!0,get:function(){return s},set:function(l){if(!ks(l))throw new Error("RegionAnchorX must be between 0 and 100.");s=l}},regionAnchorX:{enumerable:!0,get:function(){return t},set:function(l){if(!ks(l))throw new Error("RegionAnchorY must be between 0 and 100.");t=l}},viewportAnchorY:{enumerable:!0,get:function(){return n},set:function(l){if(!ks(l))throw new Error("ViewportAnchorY must be between 0 and 100.");n=l}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(l){if(!ks(l))throw new Error("ViewportAnchorX must be between 0 and 100.");r=l}},scroll:{enumerable:!0,get:function(){return a},set:function(l){var u=wg(l);u===!1?console.warn("Scroll: an invalid or illegal string was specified."):a=u}}})}var kg=Dg,Mt=An,Ti=Yc.exports={WebVTT:bg,VTTCue:Eg,VTTRegion:kg};Mt.vttjs=Ti;Mt.WebVTT=Ti.WebVTT;var jg=Ti.VTTCue,Ig=Ti.VTTRegion,Pg=Mt.VTTCue,Lg=Mt.VTTRegion;Ti.shim=function(){Mt.VTTCue=jg,Mt.VTTRegion=Ig};Ti.restore=function(){Mt.VTTCue=Pg,Mt.VTTRegion=Lg};Mt.VTTCue||Ti.shim();var Og=Yc.exports;const bu=sr(Og);var Tu="https://example.com",Dn=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=S.location&&S.location.href||"");var s=/^\/\//.test(e),r=!S.location&&!/\/\//i.test(e);e=new S.URL(e,S.location||Tu);var n=new URL(t,e);return r?n.href.slice(Tu.length):s?n.href.slice(n.protocol.length):n.href},xo=function(){function i(){this.listeners={}}var e=i.prototype;return e.on=function(s,r){this.listeners[s]||(this.listeners[s]=[]),this.listeners[s].push(r)},e.off=function(s,r){if(!this.listeners[s])return!1;var n=this.listeners[s].indexOf(r);return this.listeners[s]=this.listeners[s].slice(0),this.listeners[s].splice(n,1),n>-1},e.trigger=function(s){var r=this.listeners[s];if(r)if(arguments.length===2)for(var n=r.length,a=0;a<n;++a)r[a].call(this,arguments[1]);else for(var l=Array.prototype.slice.call(arguments,1),u=r.length,f=0;f<u;++f)r[f].apply(this,l)},e.dispose=function(){this.listeners={}},e.pipe=function(s){this.on("data",function(r){s.push(r)})},i}(),Mg=function(e){return S.atob?S.atob(e):Buffer.from(e,"base64").toString("binary")};function Jc(i){for(var e=Mg(i),t=new Uint8Array(e.length),s=0;s<e.length;s++)t[s]=e.charCodeAt(s);return t}/*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */class Rg extends xo{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(`
16
+ `,i.parse()),i.state==="INITIAL")throw new et(et.Errors.BadSignature)}catch(e){i.reportOrThrowError(e)}return i.onflush&&i.onflush(),this}};var fg=rs,pg="auto",mg={"":1,lr:1,rl:1},gg={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function vg(i){if(typeof i!="string")return!1;var e=mg[i.toLowerCase()];return e?i.toLowerCase():!1}function ya(i){if(typeof i!="string")return!1;var e=gg[i.toLowerCase()];return e?i.toLowerCase():!1}function Xc(i,e,t){this.hasBeenReset=!1;var s="",r=!1,n=i,a=e,l=t,u=null,f="",m=!0,v="auto",T="start",E="auto",A="auto",y=100,k="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return s},set:function(w){s=""+w}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(w){r=!!w}},startTime:{enumerable:!0,get:function(){return n},set:function(w){if(typeof w!="number")throw new TypeError("Start time must be set to a number.");n=w,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(w){if(typeof w!="number")throw new TypeError("End time must be set to a number.");a=w,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return l},set:function(w){l=""+w,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(w){u=w,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return f},set:function(w){var I=vg(w);if(I===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");f=I,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return m},set:function(w){m=!!w,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return v},set:function(w){if(typeof w!="number"&&w!==pg)throw new SyntaxError("Line: an invalid number or illegal string was specified.");v=w,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return T},set:function(w){var I=ya(w);I?(T=I,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return E},set:function(w){if(w<0||w>100)throw new Error("Position must be between 0 and 100.");E=w,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return A},set:function(w){var I=ya(w);I?(A=I,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return y},set:function(w){if(w<0||w>100)throw new Error("Size must be between 0 and 100.");y=w,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return k},set:function(w){var I=ya(w);if(!I)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");k=I,this.hasBeenReset=!0}}}),this.displayState=void 0}Xc.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var yg=Xc,_g={"":!0,up:!0};function bg(i){if(typeof i!="string")return!1;var e=_g[i.toLowerCase()];return e?i.toLowerCase():!1}function ks(i){return typeof i=="number"&&i>=0&&i<=100}function Tg(){var i=100,e=3,t=0,s=100,r=0,n=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return i},set:function(l){if(!ks(l))throw new Error("Width must be between 0 and 100.");i=l}},lines:{enumerable:!0,get:function(){return e},set:function(l){if(typeof l!="number")throw new TypeError("Lines must be set to a number.");e=l}},regionAnchorY:{enumerable:!0,get:function(){return s},set:function(l){if(!ks(l))throw new Error("RegionAnchorX must be between 0 and 100.");s=l}},regionAnchorX:{enumerable:!0,get:function(){return t},set:function(l){if(!ks(l))throw new Error("RegionAnchorY must be between 0 and 100.");t=l}},viewportAnchorY:{enumerable:!0,get:function(){return n},set:function(l){if(!ks(l))throw new Error("ViewportAnchorY must be between 0 and 100.");n=l}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(l){if(!ks(l))throw new Error("ViewportAnchorX must be between 0 and 100.");r=l}},scroll:{enumerable:!0,get:function(){return a},set:function(l){var u=bg(l);u===!1?console.warn("Scroll: an invalid or illegal string was specified."):a=u}}})}var xg=Tg,Mt=Cn,Ti=Gc.exports={WebVTT:fg,VTTCue:yg,VTTRegion:xg};Mt.vttjs=Ti;Mt.WebVTT=Ti.WebVTT;var Sg=Ti.VTTCue,Cg=Ti.VTTRegion,Eg=Mt.VTTCue,Ag=Mt.VTTRegion;Ti.shim=function(){Mt.VTTCue=Sg,Mt.VTTRegion=Cg};Ti.restore=function(){Mt.VTTCue=Eg,Mt.VTTRegion=Ag};Mt.VTTCue||Ti.shim();var wg=Gc.exports;const yu=Ce.getDefaultExportFromCjs(wg);var _u="https://example.com",An=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=S.location&&S.location.href||"");var s=/^\/\//.test(e),r=!S.location&&!/\/\//i.test(e);e=new S.URL(e,S.location||_u);var n=new URL(t,e);return r?n.href.slice(_u.length):s?n.href.slice(n.protocol.length):n.href},bo=function(){function i(){this.listeners={}}var e=i.prototype;return e.on=function(s,r){this.listeners[s]||(this.listeners[s]=[]),this.listeners[s].push(r)},e.off=function(s,r){if(!this.listeners[s])return!1;var n=this.listeners[s].indexOf(r);return this.listeners[s]=this.listeners[s].slice(0),this.listeners[s].splice(n,1),n>-1},e.trigger=function(s){var r=this.listeners[s];if(r)if(arguments.length===2)for(var n=r.length,a=0;a<n;++a)r[a].call(this,arguments[1]);else for(var l=Array.prototype.slice.call(arguments,1),u=r.length,f=0;f<u;++f)r[f].apply(this,l)},e.dispose=function(){this.listeners={}},e.pipe=function(s){this.on("data",function(r){s.push(r)})},i}(),Dg=function(e){return S.atob?S.atob(e):Buffer.from(e,"base64").toString("binary")};function Yc(i){for(var e=Dg(i),t=new Uint8Array(e.length),s=0;s<e.length;s++)t[s]=e.charCodeAt(s);return t}/*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */class kg extends bo{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(`
17
17
  `);t>-1;t=this.buffer.indexOf(`
18
- `))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const Ng=" ",Ta=function(i){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(i||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},Bg=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},Ne=function(i){const e={};if(!i)return e;const t=i.split(Bg());let s=t.length,r;for(;s--;)t[s]!==""&&(r=/([^=]*)=(.*)/.exec(t[s]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e},xu=i=>{const e=i.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};class Fg extends xo{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,s;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((n,a)=>{const l=a(e);return l===e?n:n.concat([l])},[e]).forEach(n=>{for(let a=0;a<this.customParsers.length;a++)if(this.customParsers[a].call(this,n))return;if(n.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:n.slice(1)});return}if(n=n.replace("\r",""),t=/^#EXTM3U/.exec(n),t){this.trigger("data",{type:"tag",tagType:"m3u"});return}if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(n),t){s={type:"tag",tagType:"inf"},t[1]&&(s.duration=parseFloat(t[1])),t[2]&&(s.title=t[2]),this.trigger("data",s);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(n),t){s={type:"tag",tagType:"targetduration"},t[1]&&(s.duration=parseInt(t[1],10)),this.trigger("data",s);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(n),t){s={type:"tag",tagType:"version"},t[1]&&(s.version=parseInt(t[1],10)),this.trigger("data",s);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){s={type:"tag",tagType:"media-sequence"},t[1]&&(s.number=parseInt(t[1],10)),this.trigger("data",s);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){s={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(s.number=parseInt(t[1],10)),this.trigger("data",s);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(n),t){s={type:"tag",tagType:"playlist-type"},t[1]&&(s.playlistType=t[1]),this.trigger("data",s);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(n),t){s=_e(Ta(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",s);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(n),t){s={type:"tag",tagType:"allow-cache"},t[1]&&(s.allowed=!/NO/.test(t[1])),this.trigger("data",s);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(n),t){if(s={type:"tag",tagType:"map"},t[1]){const a=Ne(t[1]);a.URI&&(s.uri=a.URI),a.BYTERANGE&&(s.byterange=Ta(a.BYTERANGE))}this.trigger("data",s);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(n),t){s={type:"tag",tagType:"stream-inf"},t[1]&&(s.attributes=Ne(t[1]),s.attributes.RESOLUTION&&(s.attributes.RESOLUTION=xu(s.attributes.RESOLUTION)),s.attributes.BANDWIDTH&&(s.attributes.BANDWIDTH=parseInt(s.attributes.BANDWIDTH,10)),s.attributes["FRAME-RATE"]&&(s.attributes["FRAME-RATE"]=parseFloat(s.attributes["FRAME-RATE"])),s.attributes["PROGRAM-ID"]&&(s.attributes["PROGRAM-ID"]=parseInt(s.attributes["PROGRAM-ID"],10))),this.trigger("data",s);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(n),t){s={type:"tag",tagType:"media"},t[1]&&(s.attributes=Ne(t[1])),this.trigger("data",s);return}if(t=/^#EXT-X-ENDLIST/.exec(n),t){this.trigger("data",{type:"tag",tagType:"endlist"});return}if(t=/^#EXT-X-DISCONTINUITY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(n),t){s={type:"tag",tagType:"program-date-time"},t[1]&&(s.dateTimeString=t[1],s.dateTimeObject=new Date(t[1])),this.trigger("data",s);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(n),t){s={type:"tag",tagType:"key"},t[1]&&(s.attributes=Ne(t[1]),s.attributes.IV&&(s.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(s.attributes.IV=s.attributes.IV.substring(2)),s.attributes.IV=s.attributes.IV.match(/.{8}/g),s.attributes.IV[0]=parseInt(s.attributes.IV[0],16),s.attributes.IV[1]=parseInt(s.attributes.IV[1],16),s.attributes.IV[2]=parseInt(s.attributes.IV[2],16),s.attributes.IV[3]=parseInt(s.attributes.IV[3],16),s.attributes.IV=new Uint32Array(s.attributes.IV))),this.trigger("data",s);return}if(t=/^#EXT-X-START:(.*)$/.exec(n),t){s={type:"tag",tagType:"start"},t[1]&&(s.attributes=Ne(t[1]),s.attributes["TIME-OFFSET"]=parseFloat(s.attributes["TIME-OFFSET"]),s.attributes.PRECISE=/YES/.test(s.attributes.PRECISE)),this.trigger("data",s);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(n),t){s={type:"tag",tagType:"cue-out-cont"},t[1]?s.data=t[1]:s.data="",this.trigger("data",s);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(n),t){s={type:"tag",tagType:"cue-out"},t[1]?s.data=t[1]:s.data="",this.trigger("data",s);return}if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(n),t){s={type:"tag",tagType:"cue-in"},t[1]?s.data=t[1]:s.data="",this.trigger("data",s);return}if(t=/^#EXT-X-SKIP:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"skip"},s.attributes=Ne(t[1]),s.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(s.attributes["SKIPPED-SEGMENTS"]=parseInt(s.attributes["SKIPPED-SEGMENTS"],10)),s.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(s.attributes["RECENTLY-REMOVED-DATERANGES"]=s.attributes["RECENTLY-REMOVED-DATERANGES"].split(Ng)),this.trigger("data",s);return}if(t=/^#EXT-X-PART:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"part"},s.attributes=Ne(t[1]),["DURATION"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=parseFloat(s.attributes[a]))}),["INDEPENDENT","GAP"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=/YES/.test(s.attributes[a]))}),s.attributes.hasOwnProperty("BYTERANGE")&&(s.attributes.byterange=Ta(s.attributes.BYTERANGE)),this.trigger("data",s);return}if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"server-control"},s.attributes=Ne(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=parseFloat(s.attributes[a]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=/YES/.test(s.attributes[a]))}),this.trigger("data",s);return}if(t=/^#EXT-X-PART-INF:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"part-inf"},s.attributes=Ne(t[1]),["PART-TARGET"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=parseFloat(s.attributes[a]))}),this.trigger("data",s);return}if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"preload-hint"},s.attributes=Ne(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(a){if(s.attributes.hasOwnProperty(a)){s.attributes[a]=parseInt(s.attributes[a],10);const l=a==="BYTERANGE-LENGTH"?"length":"offset";s.attributes.byterange=s.attributes.byterange||{},s.attributes.byterange[l]=s.attributes[a],delete s.attributes[a]}}),this.trigger("data",s);return}if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"rendition-report"},s.attributes=Ne(t[1]),["LAST-MSN","LAST-PART"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=parseInt(s.attributes[a],10))}),this.trigger("data",s);return}if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"daterange"},s.attributes=Ne(t[1]),["ID","CLASS"].forEach(function(l){s.attributes.hasOwnProperty(l)&&(s.attributes[l]=String(s.attributes[l]))}),["START-DATE","END-DATE"].forEach(function(l){s.attributes.hasOwnProperty(l)&&(s.attributes[l]=new Date(s.attributes[l]))}),["DURATION","PLANNED-DURATION"].forEach(function(l){s.attributes.hasOwnProperty(l)&&(s.attributes[l]=parseFloat(s.attributes[l]))}),["END-ON-NEXT"].forEach(function(l){s.attributes.hasOwnProperty(l)&&(s.attributes[l]=/YES/i.test(s.attributes[l]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(l){s.attributes.hasOwnProperty(l)&&(s.attributes[l]=s.attributes[l].toString(16))});const a=/^X-([A-Z]+-)+[A-Z]+$/;for(const l in s.attributes){if(!a.test(l))continue;const u=/[0-9A-Fa-f]{6}/g.test(s.attributes[l]),f=/^\d+(\.\d+)?$/.test(s.attributes[l]);s.attributes[l]=u?s.attributes[l].toString(16):f?parseFloat(s.attributes[l]):String(s.attributes[l])}this.trigger("data",s);return}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(n),t){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"i-frames-only"});return}if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(n),t){s={type:"tag",tagType:"content-steering"},s.attributes=Ne(t[1]),this.trigger("data",s);return}if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(n),t){s={type:"tag",tagType:"i-frame-playlist"},s.attributes=Ne(t[1]),s.attributes.URI&&(s.uri=s.attributes.URI),s.attributes.BANDWIDTH&&(s.attributes.BANDWIDTH=parseInt(s.attributes.BANDWIDTH,10)),s.attributes.RESOLUTION&&(s.attributes.RESOLUTION=xu(s.attributes.RESOLUTION)),s.attributes["AVERAGE-BANDWIDTH"]&&(s.attributes["AVERAGE-BANDWIDTH"]=parseInt(s.attributes["AVERAGE-BANDWIDTH"],10)),s.attributes["FRAME-RATE"]&&(s.attributes["FRAME-RATE"]=parseFloat(s.attributes["FRAME-RATE"])),this.trigger("data",s);return}if(t=/^#EXT-X-DEFINE:(.*)$/.exec(n),t){s={type:"tag",tagType:"define"},s.attributes=Ne(t[1]),this.trigger("data",s);return}this.trigger("data",{type:"tag",data:n.slice(4)})})}addParser({expression:e,customType:t,dataParser:s,segment:r}){typeof s!="function"&&(s=n=>n),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:s(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const s=r=>e.test(r)?t(r):r;this.tagMappers.push(s)}}const Ug=i=>i.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),zt=function(i){const e={};return Object.keys(i).forEach(function(t){e[Ug(t)]=i[t]}),e},xa=function(i){const{serverControl:e,targetDuration:t,partTargetDuration:s}=i;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",l=t&&t*3,u=s&&s*2;t&&!e.hasOwnProperty(n)&&(e[n]=l,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${l}).`})),l&&e[n]<l&&(this.trigger("warn",{message:`${r} clamping HOLD-BACK (${e[n]}) to targetDuration * 3 (${l})`}),e[n]=l),s&&!e.hasOwnProperty(a)&&(e[a]=s*3,this.trigger("info",{message:`${r} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[a]}).`})),s&&e[a]<u&&(this.trigger("warn",{message:`${r} clamping PART-HOLD-BACK (${e[a]}) to partTargetDuration * 2 (${u}).`}),e[a]=u)};class Vg extends xo{constructor(e={}){super(),this.lineStream=new Rg,this.parseStream=new Fg,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;const t=this,s=[];let r={},n,a,l=!1;const u=function(){},f={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},m="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let v=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let T=0,E=0;const A={};this.on("end",()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&n&&(r.map=n),!r.key&&a&&(r.key=a),!r.timeline&&typeof v=="number"&&(r.timeline=v),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(y){let k,w;if(t.manifest.definitions){for(const I in t.manifest.definitions)if(y.uri&&(y.uri=y.uri.replace(`{$${I}}`,t.manifest.definitions[I])),y.attributes)for(const j in y.attributes)typeof y.attributes[j]=="string"&&(y.attributes[j]=y.attributes[j].replace(`{$${I}}`,t.manifest.definitions[I]))}({tag(){({version(){y.version&&(this.manifest.version=y.version)},"allow-cache"(){this.manifest.allowCache=y.allowed,"allowed"in y||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const I={};"length"in y&&(r.byterange=I,I.length=y.length,"offset"in y||(y.offset=T)),"offset"in y&&(r.byterange=I,I.offset=y.offset),T=I.offset+I.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),y.title&&(r.title=y.title),y.duration>0&&(r.duration=y.duration),y.duration===0&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=s},key(){if(!y.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(y.attributes.METHOD==="NONE"){a=null;return}if(!y.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(y.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:y.attributes};return}if(y.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:y.attributes.URI};return}if(y.attributes.KEYFORMAT===m){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(y.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(y.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),y.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(y.attributes.KEYID&&y.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:y.attributes.KEYFORMAT,keyId:y.attributes.KEYID.substring(2)},pssh:Jc(y.attributes.URI.split(",")[1])};return}y.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:y.attributes.METHOD||"AES-128",uri:y.attributes.URI},typeof y.attributes.IV<"u"&&(a.iv=y.attributes.IV)},"media-sequence"(){if(!isFinite(y.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+y.number});return}this.manifest.mediaSequence=y.number},"discontinuity-sequence"(){if(!isFinite(y.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+y.number});return}this.manifest.discontinuitySequence=y.number,v=y.number},"playlist-type"(){if(!/VOD|EVENT/.test(y.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+y.playlist});return}this.manifest.playlistType=y.playlistType},map(){n={},y.uri&&(n.uri=y.uri),y.byterange&&(n.byterange=y.byterange),a&&(n.key=a)},"stream-inf"(){if(this.manifest.playlists=s,this.manifest.mediaGroups=this.manifest.mediaGroups||f,!y.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}r.attributes||(r.attributes={}),_e(r.attributes,y.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||f,!(y.attributes&&y.attributes.TYPE&&y.attributes["GROUP-ID"]&&y.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const I=this.manifest.mediaGroups[y.attributes.TYPE];I[y.attributes["GROUP-ID"]]=I[y.attributes["GROUP-ID"]]||{},k=I[y.attributes["GROUP-ID"]],w={default:/yes/i.test(y.attributes.DEFAULT)},w.default?w.autoselect=!0:w.autoselect=/yes/i.test(y.attributes.AUTOSELECT),y.attributes.LANGUAGE&&(w.language=y.attributes.LANGUAGE),y.attributes.URI&&(w.uri=y.attributes.URI),y.attributes["INSTREAM-ID"]&&(w.instreamId=y.attributes["INSTREAM-ID"]),y.attributes.CHARACTERISTICS&&(w.characteristics=y.attributes.CHARACTERISTICS),y.attributes.FORCED&&(w.forced=/yes/i.test(y.attributes.FORCED)),k[y.attributes.NAME]=w},discontinuity(){v+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(s.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=y.dateTimeString,this.manifest.dateTimeObject=y.dateTimeObject),r.dateTimeString=y.dateTimeString,r.dateTimeObject=y.dateTimeObject;const{lastProgramDateTime:I}=this;this.lastProgramDateTime=new Date(y.dateTimeString).getTime(),I===null&&this.manifest.segments.reduceRight((j,L)=>(L.programDateTime=j-L.duration*1e3,L.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(y.duration)||y.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+y.duration});return}this.manifest.targetDuration=y.duration,xa.call(this,this.manifest)},start(){if(!y.attributes||isNaN(y.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:y.attributes["TIME-OFFSET"],precise:y.attributes.PRECISE}},"cue-out"(){r.cueOut=y.data},"cue-out-cont"(){r.cueOutCont=y.data},"cue-in"(){r.cueIn=y.data},skip(){this.manifest.skip=zt(y.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",y.attributes,["SKIPPED-SEGMENTS"])},part(){l=!0;const I=this.manifest.segments.length,j=zt(y.attributes);r.parts=r.parts||[],r.parts.push(j),j.byterange&&(j.byterange.hasOwnProperty("offset")||(j.byterange.offset=E),E=j.byterange.offset+j.byterange.length);const L=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${L} for segment #${I}`,y.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((O,F)=>{O.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${F} lacks required attribute(s): LAST-PART`})})},"server-control"(){const I=this.manifest.serverControl=zt(y.attributes);I.hasOwnProperty("canBlockReload")||(I.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),xa.call(this,this.manifest),I.canSkipDateranges&&!I.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const I=this.manifest.segments.length,j=zt(y.attributes),L=j.type&&j.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(j),j.byterange&&(j.byterange.hasOwnProperty("offset")||(j.byterange.offset=L?E:0,L&&(E=j.byterange.offset+j.byterange.length)));const O=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${O} for segment #${I}`,y.attributes,["TYPE","URI"]),!!j.type)for(let F=0;F<r.preloadHints.length-1;F++){const B=r.preloadHints[F];B.type&&B.type===j.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${O} for segment #${I} has the same TYPE ${j.type} as preload hint #${F}`})}},"rendition-report"(){const I=zt(y.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(I);const j=this.manifest.renditionReports.length-1,L=["LAST-MSN","URI"];l&&L.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${j}`,y.attributes,L)},"part-inf"(){this.manifest.partInf=zt(y.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",y.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),xa.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(zt(y.attributes));const I=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${I}`,y.attributes,["ID","START-DATE"]);const j=this.manifest.dateRanges[I];j.endDate&&j.startDate&&new Date(j.endDate)<new Date(j.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),j.duration&&j.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),j.plannedDuration&&j.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const L=!!j.endOnNext;if(L&&!j.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),L&&(j.duration||j.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),j.duration&&j.endDate){const F=j.startDate.getTime()+j.duration*1e3;this.manifest.dateRanges[I].endDate=new Date(F)}if(!A[j.id])A[j.id]=j;else{for(const F in A[j.id])if(j[F]&&JSON.stringify(A[j.id][F])!==JSON.stringify(j[F])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const O=this.manifest.dateRanges.findIndex(F=>F.id===j.id);this.manifest.dateRanges[O]=_e(this.manifest.dateRanges[O],j),A[j.id]=_e(A[j.id],j),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=zt(y.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",y.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const I=(j,L)=>{if(j in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${j}`});return}this.manifest.definitions[j]=L};if("QUERYPARAM"in y.attributes){if("NAME"in y.attributes||"IMPORT"in y.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const j=this.params.get(y.attributes.QUERYPARAM);if(!j){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${y.attributes.QUERYPARAM}`});return}I(y.attributes.QUERYPARAM,decodeURIComponent(j));return}if("NAME"in y.attributes){if("IMPORT"in y.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in y.attributes)||typeof y.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${y.attributes.NAME}`});return}I(y.attributes.NAME,y.attributes.VALUE);return}if("IMPORT"in y.attributes){if(!this.mainDefinitions[y.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${y.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}I(y.attributes.IMPORT,this.mainDefinitions[y.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:y.attributes,uri:y.uri,timeline:v}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",y.attributes,["BANDWIDTH","URI"])}}[y.tagType]||u).call(t)},uri(){r.uri=y.uri,s.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),a&&(r.key=a),r.timeline=v,n&&(r.map=n),E=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){y.segment?(r.custom=r.custom||{},r.custom[y.customType]=y.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[y.customType]=y.data)}})[y.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,s){const r=[];s.forEach(function(n){t.hasOwnProperty(n)||r.push(n)}),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(`
19
- `),this.manifest.dateRanges.length&&this.lastProgramDateTime===null&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var fi={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},Hg=["video","audio","text"],Su=["Video","Audio","Text"],Zc=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,s,r){var n=("00"+Number(s).toString(16)).slice(-2),a=("00"+Number(r).toString(16)).slice(-2);return"avc1."+n+"00"+a})},vt=function(e){e===void 0&&(e="");var t=e.split(","),s=[];return t.forEach(function(r){r=r.trim();var n;Hg.forEach(function(a){var l=fi[a].exec(r.toLowerCase());if(!(!l||l.length<=1)){n=a;var u=r.substring(0,l[1].length),f=r.replace(u,"");s.push({type:u,details:f,mediaType:a})}}),n||s.push({type:r,details:"",mediaType:"unknown"})}),s},qg=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var s=e.mediaGroups.AUDIO[t];if(!s)return null;for(var r in s){var n=s[r];if(n.default&&n.playlists)return vt(n.playlists[0].attributes.CODECS)}return null},ed=function(e){return e===void 0&&(e=""),fi.audio.test(e.trim().toLowerCase())},zg=function(e){return e===void 0&&(e=""),fi.text.test(e.trim().toLowerCase())},Gi=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return Zc(n.trim())}),s="video";t.length===1&&ed(t[0])?s="audio":t.length===1&&zg(t[0])&&(s="application");var r="mp4";return t.every(function(n){return fi.mp4.test(n)})?r="mp4":t.every(function(n){return fi.webm.test(n)})?r="webm":t.every(function(n){return fi.ogg.test(n)})&&(r="ogg"),s+"/"+r+';codecs="'+e+'"'}},qs=function(e,t){return e===void 0&&(e=""),t===void 0&&(t=!1),S.MediaSource&&S.MediaSource.isTypeSupported&&S.MediaSource.isTypeSupported(Gi(e))||t&&S.ManagedMediaSource&&S.ManagedMediaSource.isTypeSupported&&S.ManagedMediaSource.isTypeSupported(Gi(e))||!1},Sa=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var s=0;s<Su.length;s++){var r=Su[s];if(fi["muxer"+r].test(t))return!0}return!1})},Cu="mp4a.40.2",$g="avc1.4d400d",Gg=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,Wg=/^application\/dash\+xml/i,td=function(e){return Gg.test(e)?"hls":Wg.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},Xg=function(e){return e.toString(2).length},Yg=function(e){return Math.ceil(Xg(e)/8)},id=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},Kg=function(e){return id(e)},G=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!Kg(e)&&!(e instanceof ArrayBuffer)&&(typeof e!="number"||typeof e=="number"&&e!==e?e=0:e=[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},je=S.BigInt||Number,Va=[je("0x1"),je("0x100"),je("0x10000"),je("0x1000000"),je("0x100000000"),je("0x10000000000"),je("0x1000000000000"),je("0x100000000000000"),je("0x10000000000000000")];(function(){var i=new Uint16Array([65484]),e=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var Qg=function(e,t){var s=t===void 0?{}:t,r=s.signed,n=r===void 0?!1:r,a=s.le,l=a===void 0?!1:a;e=G(e);var u=l?"reduce":"reduceRight",f=e[u]?e[u]:Array.prototype[u],m=f.call(e,function(T,E,A){var y=l?A:Math.abs(A+1-e.length);return T+je(E)*Va[y]},je(0));if(n){var v=Va[e.length]/je(2)-je(1);m=je(m),m>v&&(m-=v,m-=v,m-=je(2))}return Number(m)},Jg=function(e,t){var s={},r=s.le,n=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=je(e);for(var a=Yg(e),l=new Uint8Array(new ArrayBuffer(a)),u=0;u<a;u++){var f=n?u:Math.abs(u+1-l.length);l[f]=Number(e/Va[u]&je(255)),e<0&&(l[f]=Math.abs(~l[f]),l[f]-=u===0?1:2)}return l},sd=function(e,t){if(typeof e!="string"&&e&&typeof e.toString=="function"&&(e=e.toString()),typeof e!="string")return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var s=new Uint8Array(e.length),r=0;r<e.length;r++)s[r]=e.charCodeAt(r);return s},Zg=function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];if(t=t.filter(function(l){return l&&(l.byteLength||l.length)&&typeof l!="string"}),t.length<=1)return G(t[0]);var r=t.reduce(function(l,u,f){return l+(u.byteLength||u.length)},0),n=new Uint8Array(r),a=0;return t.forEach(function(l){l=G(l),n.set(l,a),a+=l.byteLength}),n},pe=function(e,t,s){var r=s===void 0?{}:s,n=r.offset,a=n===void 0?0:n,l=r.mask,u=l===void 0?[]:l;e=G(e),t=G(t);var f=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&f.call(t,function(m,v){var T=u[v]?u[v]&e[a+v]:e[a+v];return m===T})},e1=function(e,t,s){t.forEach(function(r){for(var n in e.mediaGroups[r])for(var a in e.mediaGroups[r][n]){var l=e.mediaGroups[r][n][a];s(l,r,n,a)}})},Zt={},Ft={};function t1(i,e,t){if(t===void 0&&(t=Array.prototype),i&&typeof t.find=="function")return t.find.call(i,e);for(var s=0;s<i.length;s++)if(Object.prototype.hasOwnProperty.call(i,s)){var r=i[s];if(e.call(void 0,r,s,i))return r}}function So(i,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(i):i}function i1(i,e){if(i===null||typeof i!="object")throw new TypeError("target is not an object");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);return i}var rd=So({HTML:"text/html",isHTML:function(i){return i===rd.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),nd=So({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(i){return i===nd.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Ft.assign=i1;Ft.find=t1;Ft.freeze=So;Ft.MIME_TYPE=rd;Ft.NAMESPACE=nd;var ad=Ft,St=ad.find,Ys=ad.NAMESPACE;function s1(i){return i!==""}function r1(i){return i?i.split(/[\t\n\f\r ]+/).filter(s1):[]}function n1(i,e){return i.hasOwnProperty(e)||(i[e]=!0),i}function Eu(i){if(!i)return[];var e=r1(i);return Object.keys(e.reduce(n1,{}))}function a1(i){return function(e){return i&&i.indexOf(e)!==-1}}function rr(i,e){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}function Xe(i,e){var t=i.prototype;if(!(t instanceof e)){let s=function(){};s.prototype=e.prototype,s=new s,rr(t,s),i.prototype=t=s}t.constructor!=i&&(typeof i!="function"&&console.error("unknown Class:"+i),t.constructor=i)}var Ye={},ct=Ye.ELEMENT_NODE=1,Wi=Ye.ATTRIBUTE_NODE=2,tn=Ye.TEXT_NODE=3,od=Ye.CDATA_SECTION_NODE=4,ld=Ye.ENTITY_REFERENCE_NODE=5,o1=Ye.ENTITY_NODE=6,ud=Ye.PROCESSING_INSTRUCTION_NODE=7,cd=Ye.COMMENT_NODE=8,dd=Ye.DOCUMENT_NODE=9,hd=Ye.DOCUMENT_TYPE_NODE=10,Rt=Ye.DOCUMENT_FRAGMENT_NODE=11,l1=Ye.NOTATION_NODE=12,Oe={},ke={};Oe.INDEX_SIZE_ERR=(ke[1]="Index size error",1);Oe.DOMSTRING_SIZE_ERR=(ke[2]="DOMString size error",2);var ze=Oe.HIERARCHY_REQUEST_ERR=(ke[3]="Hierarchy request error",3);Oe.WRONG_DOCUMENT_ERR=(ke[4]="Wrong document",4);Oe.INVALID_CHARACTER_ERR=(ke[5]="Invalid character",5);Oe.NO_DATA_ALLOWED_ERR=(ke[6]="No data allowed",6);Oe.NO_MODIFICATION_ALLOWED_ERR=(ke[7]="No modification allowed",7);var fd=Oe.NOT_FOUND_ERR=(ke[8]="Not found",8);Oe.NOT_SUPPORTED_ERR=(ke[9]="Not supported",9);var Au=Oe.INUSE_ATTRIBUTE_ERR=(ke[10]="Attribute in use",10);Oe.INVALID_STATE_ERR=(ke[11]="Invalid state",11);Oe.SYNTAX_ERR=(ke[12]="Syntax error",12);Oe.INVALID_MODIFICATION_ERR=(ke[13]="Invalid modification",13);Oe.NAMESPACE_ERR=(ke[14]="Invalid namespace",14);Oe.INVALID_ACCESS_ERR=(ke[15]="Invalid access",15);function Se(i,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,ke[i]),this.message=ke[i],Error.captureStackTrace&&Error.captureStackTrace(this,Se);return t.code=i,e&&(this.message=this.message+": "+e),t}Se.prototype=Error.prototype;rr(Oe,Se);function Lt(){}Lt.prototype={length:0,item:function(i){return i>=0&&i<this.length?this[i]:null},toString:function(i,e){for(var t=[],s=0;s<this.length;s++)Li(this[s],t,i,e);return t.join("")},filter:function(i){return Array.prototype.filter.call(this,i)},indexOf:function(i){return Array.prototype.indexOf.call(this,i)}};function Xi(i,e){this._node=i,this._refresh=e,Co(this)}function Co(i){var e=i._node._inc||i._node.ownerDocument._inc;if(i._inc!==e){var t=i._refresh(i._node);if(Ed(i,"length",t.length),!i.$$length||t.length<i.$$length)for(var s=t.length;s in i;s++)Object.prototype.hasOwnProperty.call(i,s)&&delete i[s];rr(t,i),i._inc=e}}Xi.prototype.item=function(i){return Co(this),this[i]||null};Xe(Xi,Lt);function sn(){}function pd(i,e){for(var t=i.length;t--;)if(i[t]===e)return t}function wu(i,e,t,s){if(s?e[pd(e,s)]=t:e[e.length++]=t,i){t.ownerElement=i;var r=i.ownerDocument;r&&(s&&vd(r,i,s),u1(r,i,t))}}function Du(i,e,t){var s=pd(e,t);if(s>=0){for(var r=e.length-1;s<r;)e[s]=e[++s];if(e.length=r,i){var n=i.ownerDocument;n&&(vd(n,i,t),t.ownerElement=null)}}else throw new Se(fd,new Error(i.tagName+"@"+t))}sn.prototype={length:0,item:Lt.prototype.item,getNamedItem:function(i){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==i)return t}},setNamedItem:function(i){var e=i.ownerElement;if(e&&e!=this._ownerElement)throw new Se(Au);var t=this.getNamedItem(i.nodeName);return wu(this._ownerElement,this,i,t),t},setNamedItemNS:function(i){var e=i.ownerElement,t;if(e&&e!=this._ownerElement)throw new Se(Au);return t=this.getNamedItemNS(i.namespaceURI,i.localName),wu(this._ownerElement,this,i,t),t},removeNamedItem:function(i){var e=this.getNamedItem(i);return Du(this._ownerElement,this,e),e},removeNamedItemNS:function(i,e){var t=this.getNamedItemNS(i,e);return Du(this._ownerElement,this,t),t},getNamedItemNS:function(i,e){for(var t=this.length;t--;){var s=this[t];if(s.localName==e&&s.namespaceURI==i)return s}return null}};function md(){}md.prototype={hasFeature:function(i,e){return!0},createDocument:function(i,e,t){var s=new nr;if(s.implementation=this,s.childNodes=new Lt,s.doctype=t||null,t&&s.appendChild(t),e){var r=s.createElementNS(i,e);s.appendChild(r)}return s},createDocumentType:function(i,e,t){var s=new kn;return s.name=i,s.nodeName=i,s.publicId=e||"",s.systemId=t||"",s}};function ne(){}ne.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(i,e){return rn(this,i,e)},replaceChild:function(i,e){rn(this,i,e,_d),e&&this.removeChild(e)},removeChild:function(i){return yd(this,i)},appendChild:function(i){return this.insertBefore(i,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(i){return Ha(this.ownerDocument||this,this,i)},normalize:function(){for(var i=this.firstChild;i;){var e=i.nextSibling;e&&e.nodeType==tn&&i.nodeType==tn?(this.removeChild(e),i.appendData(e.data)):(i.normalize(),i=e)}},isSupported:function(i,e){return this.ownerDocument.implementation.hasFeature(i,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(i){for(var e=this;e;){var t=e._nsMap;if(t){for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&t[s]===i)return s}e=e.nodeType==Wi?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(i){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i];e=e.nodeType==Wi?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(i){var e=this.lookupPrefix(i);return e==null}};function gd(i){return i=="<"&&"&lt;"||i==">"&&"&gt;"||i=="&"&&"&amp;"||i=='"'&&"&quot;"||"&#"+i.charCodeAt()+";"}rr(Ye,ne);rr(Ye,ne.prototype);function Ks(i,e){if(e(i))return!0;if(i=i.firstChild)do if(Ks(i,e))return!0;while(i=i.nextSibling)}function nr(){this.ownerDocument=this}function u1(i,e,t){i&&i._inc++;var s=t.namespaceURI;s===Ys.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function vd(i,e,t,s){i&&i._inc++;var r=t.namespaceURI;r===Ys.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function Eo(i,e,t){if(i&&i._inc){i._inc++;var s=e.childNodes;if(t)s[s.length++]=t;else{for(var r=e.firstChild,n=0;r;)s[n++]=r,r=r.nextSibling;s.length=n,delete s[s.length]}}}function yd(i,e){var t=e.previousSibling,s=e.nextSibling;return t?t.nextSibling=s:i.firstChild=s,s?s.previousSibling=t:i.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,Eo(i.ownerDocument,i),e}function c1(i){return i&&(i.nodeType===ne.DOCUMENT_NODE||i.nodeType===ne.DOCUMENT_FRAGMENT_NODE||i.nodeType===ne.ELEMENT_NODE)}function d1(i){return i&&(Ct(i)||Ao(i)||Nt(i)||i.nodeType===ne.DOCUMENT_FRAGMENT_NODE||i.nodeType===ne.COMMENT_NODE||i.nodeType===ne.PROCESSING_INSTRUCTION_NODE)}function Nt(i){return i&&i.nodeType===ne.DOCUMENT_TYPE_NODE}function Ct(i){return i&&i.nodeType===ne.ELEMENT_NODE}function Ao(i){return i&&i.nodeType===ne.TEXT_NODE}function ku(i,e){var t=i.childNodes||[];if(St(t,Ct)||Nt(e))return!1;var s=St(t,Nt);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}function ju(i,e){var t=i.childNodes||[];function s(n){return Ct(n)&&n!==e}if(St(t,s))return!1;var r=St(t,Nt);return!(e&&r&&t.indexOf(r)>t.indexOf(e))}function h1(i,e,t){if(!c1(i))throw new Se(ze,"Unexpected parent node type "+i.nodeType);if(t&&t.parentNode!==i)throw new Se(fd,"child not in parent");if(!d1(e)||Nt(e)&&i.nodeType!==ne.DOCUMENT_NODE)throw new Se(ze,"Unexpected node type "+e.nodeType+" for parent node type "+i.nodeType)}function f1(i,e,t){var s=i.childNodes||[],r=e.childNodes||[];if(e.nodeType===ne.DOCUMENT_FRAGMENT_NODE){var n=r.filter(Ct);if(n.length>1||St(r,Ao))throw new Se(ze,"More than one element or text in fragment");if(n.length===1&&!ku(i,t))throw new Se(ze,"Element in fragment can not be inserted before doctype")}if(Ct(e)&&!ku(i,t))throw new Se(ze,"Only one element can be added and only after doctype");if(Nt(e)){if(St(s,Nt))throw new Se(ze,"Only one doctype is allowed");var a=St(s,Ct);if(t&&s.indexOf(a)<s.indexOf(t))throw new Se(ze,"Doctype can only be inserted before an element");if(!t&&a)throw new Se(ze,"Doctype can not be appended since element is present")}}function _d(i,e,t){var s=i.childNodes||[],r=e.childNodes||[];if(e.nodeType===ne.DOCUMENT_FRAGMENT_NODE){var n=r.filter(Ct);if(n.length>1||St(r,Ao))throw new Se(ze,"More than one element or text in fragment");if(n.length===1&&!ju(i,t))throw new Se(ze,"Element in fragment can not be inserted before doctype")}if(Ct(e)&&!ju(i,t))throw new Se(ze,"Only one element can be added and only after doctype");if(Nt(e)){if(St(s,function(u){return Nt(u)&&u!==t}))throw new Se(ze,"Only one doctype is allowed");var a=St(s,Ct);if(t&&s.indexOf(a)<s.indexOf(t))throw new Se(ze,"Doctype can only be inserted before an element")}}function rn(i,e,t,s){h1(i,e,t),i.nodeType===ne.DOCUMENT_NODE&&(s||f1)(i,e,t);var r=e.parentNode;if(r&&r.removeChild(e),e.nodeType===Rt){var n=e.firstChild;if(n==null)return e;var a=e.lastChild}else n=a=e;var l=t?t.previousSibling:i.lastChild;n.previousSibling=l,a.nextSibling=t,l?l.nextSibling=n:i.firstChild=n,t==null?i.lastChild=a:t.previousSibling=a;do n.parentNode=i;while(n!==a&&(n=n.nextSibling));return Eo(i.ownerDocument||i,i),e.nodeType==Rt&&(e.firstChild=e.lastChild=null),e}function p1(i,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=i,e.previousSibling=i.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:i.firstChild=e,i.lastChild=e,Eo(i.ownerDocument,i,e),e}nr.prototype={nodeName:"#document",nodeType:dd,doctype:null,documentElement:null,_inc:1,insertBefore:function(i,e){if(i.nodeType==Rt){for(var t=i.firstChild;t;){var s=t.nextSibling;this.insertBefore(t,e),t=s}return i}return rn(this,i,e),i.ownerDocument=this,this.documentElement===null&&i.nodeType===ct&&(this.documentElement=i),i},removeChild:function(i){return this.documentElement==i&&(this.documentElement=null),yd(this,i)},replaceChild:function(i,e){rn(this,i,e,_d),i.ownerDocument=this,e&&this.removeChild(e),Ct(i)&&(this.documentElement=i)},importNode:function(i,e){return Cd(this,i,e)},getElementById:function(i){var e=null;return Ks(this.documentElement,function(t){if(t.nodeType==ct&&t.getAttribute("id")==i)return e=t,!0}),e},getElementsByClassName:function(i){var e=Eu(i);return new Xi(this,function(t){var s=[];return e.length>0&&Ks(t.documentElement,function(r){if(r!==t&&r.nodeType===ct){var n=r.getAttribute("class");if(n){var a=i===n;if(!a){var l=Eu(n);a=e.every(a1(l))}a&&s.push(r)}}}),s})},createElement:function(i){var e=new yi;e.ownerDocument=this,e.nodeName=i,e.tagName=i,e.localName=i,e.childNodes=new Lt;var t=e.attributes=new sn;return t._ownerElement=e,e},createDocumentFragment:function(){var i=new jn;return i.ownerDocument=this,i.childNodes=new Lt,i},createTextNode:function(i){var e=new wo;return e.ownerDocument=this,e.appendData(i),e},createComment:function(i){var e=new Do;return e.ownerDocument=this,e.appendData(i),e},createCDATASection:function(i){var e=new ko;return e.ownerDocument=this,e.appendData(i),e},createProcessingInstruction:function(i,e){var t=new Io;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=i,t.nodeValue=t.data=e,t},createAttribute:function(i){var e=new nn;return e.ownerDocument=this,e.name=i,e.nodeName=i,e.localName=i,e.specified=!0,e},createEntityReference:function(i){var e=new jo;return e.ownerDocument=this,e.nodeName=i,e},createElementNS:function(i,e){var t=new yi,s=e.split(":"),r=t.attributes=new sn;return t.childNodes=new Lt,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=i,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,r._ownerElement=t,t},createAttributeNS:function(i,e){var t=new nn,s=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=i,t.specified=!0,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,t}};Xe(nr,ne);function yi(){this._nsMap={}}yi.prototype={nodeType:ct,hasAttribute:function(i){return this.getAttributeNode(i)!=null},getAttribute:function(i){var e=this.getAttributeNode(i);return e&&e.value||""},getAttributeNode:function(i){return this.attributes.getNamedItem(i)},setAttribute:function(i,e){var t=this.ownerDocument.createAttribute(i);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},removeAttribute:function(i){var e=this.getAttributeNode(i);e&&this.removeAttributeNode(e)},appendChild:function(i){return i.nodeType===Rt?this.insertBefore(i,null):p1(this,i)},setAttributeNode:function(i){return this.attributes.setNamedItem(i)},setAttributeNodeNS:function(i){return this.attributes.setNamedItemNS(i)},removeAttributeNode:function(i){return this.attributes.removeNamedItem(i.nodeName)},removeAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(i,e){return this.getAttributeNodeNS(i,e)!=null},getAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);return t&&t.value||""},setAttributeNS:function(i,e,t){var s=this.ownerDocument.createAttributeNS(i,e);s.value=s.nodeValue=""+t,this.setAttributeNode(s)},getAttributeNodeNS:function(i,e){return this.attributes.getNamedItemNS(i,e)},getElementsByTagName:function(i){return new Xi(this,function(e){var t=[];return Ks(e,function(s){s!==e&&s.nodeType==ct&&(i==="*"||s.tagName==i)&&t.push(s)}),t})},getElementsByTagNameNS:function(i,e){return new Xi(this,function(t){var s=[];return Ks(t,function(r){r!==t&&r.nodeType===ct&&(i==="*"||r.namespaceURI===i)&&(e==="*"||r.localName==e)&&s.push(r)}),s})}};nr.prototype.getElementsByTagName=yi.prototype.getElementsByTagName;nr.prototype.getElementsByTagNameNS=yi.prototype.getElementsByTagNameNS;Xe(yi,ne);function nn(){}nn.prototype.nodeType=Wi;Xe(nn,ne);function ar(){}ar.prototype={data:"",substringData:function(i,e){return this.data.substring(i,i+e)},appendData:function(i){i=this.data+i,this.nodeValue=this.data=i,this.length=i.length},insertData:function(i,e){this.replaceData(i,0,e)},appendChild:function(i){throw new Error(ke[ze])},deleteData:function(i,e){this.replaceData(i,e,"")},replaceData:function(i,e,t){var s=this.data.substring(0,i),r=this.data.substring(i+e);t=s+t+r,this.nodeValue=this.data=t,this.length=t.length}};Xe(ar,ne);function wo(){}wo.prototype={nodeName:"#text",nodeType:tn,splitText:function(i){var e=this.data,t=e.substring(i);e=e.substring(0,i),this.data=this.nodeValue=e,this.length=e.length;var s=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling),s}};Xe(wo,ar);function Do(){}Do.prototype={nodeName:"#comment",nodeType:cd};Xe(Do,ar);function ko(){}ko.prototype={nodeName:"#cdata-section",nodeType:od};Xe(ko,ar);function kn(){}kn.prototype.nodeType=hd;Xe(kn,ne);function bd(){}bd.prototype.nodeType=l1;Xe(bd,ne);function Td(){}Td.prototype.nodeType=o1;Xe(Td,ne);function jo(){}jo.prototype.nodeType=ld;Xe(jo,ne);function jn(){}jn.prototype.nodeName="#document-fragment";jn.prototype.nodeType=Rt;Xe(jn,ne);function Io(){}Io.prototype.nodeType=ud;Xe(Io,ne);function xd(){}xd.prototype.serializeToString=function(i,e,t){return Sd.call(i,e,t)};ne.prototype.toString=Sd;function Sd(i,e){var t=[],s=this.nodeType==9&&this.documentElement||this,r=s.prefix,n=s.namespaceURI;if(n&&r==null){var r=s.lookupPrefix(n);if(r==null)var a=[{namespace:n,prefix:null}]}return Li(this,t,i,e,a),t.join("")}function Iu(i,e,t){var s=i.prefix||"",r=i.namespaceURI;if(!r||s==="xml"&&r===Ys.XML||r===Ys.XMLNS)return!1;for(var n=t.length;n--;){var a=t[n];if(a.prefix===s)return a.namespace!==r}return!0}function Ca(i,e,t){i.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,gd),'"')}function Li(i,e,t,s,r){if(r||(r=[]),s)if(i=s(i),i){if(typeof i=="string"){e.push(i);return}}else return;switch(i.nodeType){case ct:var n=i.attributes,a=n.length,w=i.firstChild,l=i.tagName;t=Ys.isHTML(i.namespaceURI)||t;var u=l;if(!t&&!i.prefix&&i.namespaceURI){for(var f,m=0;m<n.length;m++)if(n.item(m).name==="xmlns"){f=n.item(m).value;break}if(!f)for(var v=r.length-1;v>=0;v--){var T=r[v];if(T.prefix===""&&T.namespace===i.namespaceURI){f=T.namespace;break}}if(f!==i.namespaceURI)for(var v=r.length-1;v>=0;v--){var T=r[v];if(T.namespace===i.namespaceURI){T.prefix&&(u=T.prefix+":"+l);break}}}e.push("<",u);for(var E=0;E<a;E++){var A=n.item(E);A.prefix=="xmlns"?r.push({prefix:A.localName,namespace:A.value}):A.nodeName=="xmlns"&&r.push({prefix:"",namespace:A.value})}for(var E=0;E<a;E++){var A=n.item(E);if(Iu(A,t,r)){var y=A.prefix||"",k=A.namespaceURI;Ca(e,y?"xmlns:"+y:"xmlns",k),r.push({prefix:y,namespace:k})}Li(A,e,t,s,r)}if(l===u&&Iu(i,t,r)){var y=i.prefix||"",k=i.namespaceURI;Ca(e,y?"xmlns:"+y:"xmlns",k),r.push({prefix:y,namespace:k})}if(w||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(l)){if(e.push(">"),t&&/^script$/i.test(l))for(;w;)w.data?e.push(w.data):Li(w,e,t,s,r.slice()),w=w.nextSibling;else for(;w;)Li(w,e,t,s,r.slice()),w=w.nextSibling;e.push("</",u,">")}else e.push("/>");return;case dd:case Rt:for(var w=i.firstChild;w;)Li(w,e,t,s,r.slice()),w=w.nextSibling;return;case Wi:return Ca(e,i.name,i.value);case tn:return e.push(i.data.replace(/[<&>]/g,gd));case od:return e.push("<![CDATA[",i.data,"]]>");case cd:return e.push("<!--",i.data,"-->");case hd:var I=i.publicId,j=i.systemId;if(e.push("<!DOCTYPE ",i.name),I)e.push(" PUBLIC ",I),j&&j!="."&&e.push(" ",j),e.push(">");else if(j&&j!=".")e.push(" SYSTEM ",j,">");else{var L=i.internalSubset;L&&e.push(" [",L,"]"),e.push(">")}return;case ud:return e.push("<?",i.target," ",i.data,"?>");case ld:return e.push("&",i.nodeName,";");default:e.push("??",i.nodeName)}}function Cd(i,e,t){var s;switch(e.nodeType){case ct:s=e.cloneNode(!1),s.ownerDocument=i;case Rt:break;case Wi:t=!0;break}if(s||(s=e.cloneNode(!1)),s.ownerDocument=i,s.parentNode=null,t)for(var r=e.firstChild;r;)s.appendChild(Cd(i,r,t)),r=r.nextSibling;return s}function Ha(i,e,t){var s=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];typeof n!="object"&&n!=s[r]&&(s[r]=n)}switch(e.childNodes&&(s.childNodes=new Lt),s.ownerDocument=i,s.nodeType){case ct:var a=e.attributes,l=s.attributes=new sn,u=a.length;l._ownerElement=s;for(var f=0;f<u;f++)s.setAttributeNode(Ha(i,a.item(f),!0));break;case Wi:t=!0}if(t)for(var m=e.firstChild;m;)s.appendChild(Ha(i,m,t)),m=m.nextSibling;return s}function Ed(i,e,t){i[e]=t}try{if(Object.defineProperty){let i=function(e){switch(e.nodeType){case ct:case Rt:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(i(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};Object.defineProperty(Xi.prototype,"length",{get:function(){return Co(this),this.$$length}}),Object.defineProperty(ne.prototype,"textContent",{get:function(){return i(this)},set:function(e){switch(this.nodeType){case ct:case Rt:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Ed=function(e,t,s){e["$$"+t]=s}}}catch{}Zt.DocumentType=kn;Zt.DOMException=Se;Zt.DOMImplementation=md;Zt.Element=yi;Zt.Node=ne;Zt.NodeList=Lt;Zt.XMLSerializer=xd;var In={},Ad={};(function(i){var e=Ft.freeze;i.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),i.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
20
- `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),i.entityMap=i.HTML_ENTITIES})(Ad);var Po={},Qs=Ft.NAMESPACE,qa=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Pu=new RegExp("[\\-\\.0-9"+qa.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Lu=new RegExp("^"+qa.source+Pu.source+"*(?::"+qa.source+Pu.source+"*)?$"),js=0,$t=1,Ai=2,Is=3,wi=4,Di=5,Ps=6,qr=7;function Yi(i,e){this.message=i,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Yi)}Yi.prototype=new Error;Yi.prototype.name=Yi.name;function wd(){}wd.prototype={parse:function(i,e,t){var s=this.domBuilder;s.startDocument(),Dd(e,e={}),m1(i,e,t,s,this.errorHandler),s.endDocument()}};function m1(i,e,t,s,r){function n(ee){if(ee>65535){ee-=65536;var be=55296+(ee>>10),Dt=56320+(ee&1023);return String.fromCharCode(be,Dt)}else return String.fromCharCode(ee)}function a(ee){var be=ee.slice(1,-1);return Object.hasOwnProperty.call(t,be)?t[be]:be.charAt(0)==="#"?n(parseInt(be.substr(1).replace("x","0x"))):(r.error("entity not found:"+ee),ee)}function l(ee){if(ee>y){var be=i.substring(y,ee).replace(/&#?\w+;/g,a);T&&u(y),s.characters(be,0,ee-y),y=ee}}function u(ee,be){for(;ee>=m&&(be=v.exec(i));)f=be.index,m=f+be[0].length,T.lineNumber++;T.columnNumber=ee-f+1}for(var f=0,m=0,v=/.*(?:\r\n?|\n)|.*$/g,T=s.locator,E=[{currentNSMap:e}],A={},y=0;;){try{var k=i.indexOf("<",y);if(k<0){if(!i.substr(y).match(/^\s*$/)){var w=s.doc,I=w.createTextNode(i.substr(y));w.appendChild(I),s.currentElement=I}return}switch(k>y&&l(k),i.charAt(k+1)){case"/":var J=i.indexOf(">",k+3),j=i.substring(k+2,J).replace(/[ \t\n\r]+$/g,""),L=E.pop();J<0?(j=i.substring(k+2).replace(/[\s<].*/,""),r.error("end tag name: "+j+" is not complete:"+L.tagName),J=k+1+j.length):j.match(/\s</)&&(j=j.replace(/[\s<].*/,""),r.error("end tag name: "+j+" maybe not complete"),J=k+1+j.length);var O=L.localNSMap,F=L.tagName==j,B=F||L.tagName&&L.tagName.toLowerCase()==j.toLowerCase();if(B){if(s.endElement(L.uri,L.localName,j),O)for(var U in O)Object.prototype.hasOwnProperty.call(O,U)&&s.endPrefixMapping(U);F||r.fatalError("end tag name: "+j+" is not match the current start tagName:"+L.tagName)}else E.push(L);J++;break;case"?":T&&u(k),J=b1(i,k,s);break;case"!":T&&u(k),J=_1(i,k,s,r);break;default:T&&u(k);var X=new kd,ae=E[E.length-1].currentNSMap,J=g1(i,k,X,ae,a,r),le=X.length;if(!X.closed&&y1(i,J,X.tagName,A)&&(X.closed=!0,t.nbsp||r.warning("unclosed xml attribute")),T&&le){for(var z=Ou(T,{}),Z=0;Z<le;Z++){var Me=X[Z];u(Me.offset),Me.locator=Ou(T,{})}s.locator=z,Mu(X,s,ae)&&E.push(X),s.locator=T}else Mu(X,s,ae)&&E.push(X);Qs.isHTML(X.uri)&&!X.closed?J=v1(i,J,X.tagName,a,s):J++}}catch(ee){if(ee instanceof Yi)throw ee;r.error("element parse error: "+ee),J=-1}J>y?y=J:l(Math.max(k,y)+1)}}function Ou(i,e){return e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber,e}function g1(i,e,t,s,r,n){function a(T,E,A){t.attributeNames.hasOwnProperty(T)&&n.fatalError("Attribute "+T+" redefined"),t.addValue(T,E.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),A)}for(var l,u,f=++e,m=js;;){var v=i.charAt(f);switch(v){case"=":if(m===$t)l=i.slice(e,f),m=Is;else if(m===Ai)m=Is;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(m===Is||m===$t)if(m===$t&&(n.warning('attribute value must after "="'),l=i.slice(e,f)),e=f+1,f=i.indexOf(v,e),f>0)u=i.slice(e,f),a(l,u,e-1),m=Di;else throw new Error("attribute value no end '"+v+"' match");else if(m==wi)u=i.slice(e,f),a(l,u,e),n.warning('attribute "'+l+'" missed start quot('+v+")!!"),e=f+1,m=Di;else throw new Error('attribute value must after "="');break;case"/":switch(m){case js:t.setTagName(i.slice(e,f));case Di:case Ps:case qr:m=qr,t.closed=!0;case wi:case $t:break;case Ai:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return n.error("unexpected end of input"),m==js&&t.setTagName(i.slice(e,f)),f;case">":switch(m){case js:t.setTagName(i.slice(e,f));case Di:case Ps:case qr:break;case wi:case $t:u=i.slice(e,f),u.slice(-1)==="/"&&(t.closed=!0,u=u.slice(0,-1));case Ai:m===Ai&&(u=l),m==wi?(n.warning('attribute "'+u+'" missed quot(")!'),a(l,u,e)):((!Qs.isHTML(s[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),a(u,u,e));break;case Is:throw new Error("attribute value missed!!")}return f;case"€":v=" ";default:if(v<=" ")switch(m){case js:t.setTagName(i.slice(e,f)),m=Ps;break;case $t:l=i.slice(e,f),m=Ai;break;case wi:var u=i.slice(e,f);n.warning('attribute "'+u+'" missed quot(")!!'),a(l,u,e);case Di:m=Ps;break}else switch(m){case Ai:t.tagName,(!Qs.isHTML(s[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),a(l,l,e),e=f,m=$t;break;case Di:n.warning('attribute space is required"'+l+'"!!');case Ps:m=$t,e=f;break;case Is:m=wi,e=f;break;case qr:throw new Error("elements closed character '/' and '>' must be connected to")}}f++}}function Mu(i,e,t){for(var s=i.tagName,r=null,v=i.length;v--;){var n=i[v],a=n.qName,l=n.value,T=a.indexOf(":");if(T>0)var u=n.prefix=a.slice(0,T),f=a.slice(T+1),m=u==="xmlns"&&f;else f=a,u=null,m=a==="xmlns"&&"";n.localName=f,m!==!1&&(r==null&&(r={},Dd(t,t={})),t[m]=r[m]=l,n.uri=Qs.XMLNS,e.startPrefixMapping(m,l))}for(var v=i.length;v--;){n=i[v];var u=n.prefix;u&&(u==="xml"&&(n.uri=Qs.XML),u!=="xmlns"&&(n.uri=t[u||""]))}var T=s.indexOf(":");T>0?(u=i.prefix=s.slice(0,T),f=i.localName=s.slice(T+1)):(u=null,f=i.localName=s);var E=i.uri=t[u||""];if(e.startElement(E,f,s,i),i.closed){if(e.endElement(E,f,s),r)for(u in r)Object.prototype.hasOwnProperty.call(r,u)&&e.endPrefixMapping(u)}else return i.currentNSMap=t,i.localNSMap=r,!0}function v1(i,e,t,s,r){if(/^(?:script|textarea)$/i.test(t)){var n=i.indexOf("</"+t+">",e),a=i.substring(e+1,n);if(/[&<]/.test(a))return/^script$/i.test(t)?(r.characters(a,0,a.length),n):(a=a.replace(/&#?\w+;/g,s),r.characters(a,0,a.length),n)}return e+1}function y1(i,e,t,s){var r=s[t];return r==null&&(r=i.lastIndexOf("</"+t+">"),r<e&&(r=i.lastIndexOf("</"+t)),s[t]=r),r<e}function Dd(i,e){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}function _1(i,e,t,s){var r=i.charAt(e+2);switch(r){case"-":if(i.charAt(e+3)==="-"){var n=i.indexOf("-->",e+4);return n>e?(t.comment(i,e+4,n-e-4),n+3):(s.error("Unclosed comment"),-1)}else return-1;default:if(i.substr(e+3,6)=="CDATA["){var n=i.indexOf("]]>",e+9);return t.startCDATA(),t.characters(i,e+9,n-e-9),t.endCDATA(),n+3}var a=T1(i,e),l=a.length;if(l>1&&/!doctype/i.test(a[0][0])){var u=a[1][0],f=!1,m=!1;l>3&&(/^public$/i.test(a[2][0])?(f=a[3][0],m=l>4&&a[4][0]):/^system$/i.test(a[2][0])&&(m=a[3][0]));var v=a[l-1];return t.startDTD(u,f,m),t.endDTD(),v.index+v[0].length}}return-1}function b1(i,e,t){var s=i.indexOf("?>",e);if(s){var r=i.substring(e,s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,t.processingInstruction(r[1],r[2]),s+2):-1}return-1}function kd(){this.attributeNames={}}kd.prototype={setTagName:function(i){if(!Lu.test(i))throw new Error("invalid tagName:"+i);this.tagName=i},addValue:function(i,e,t){if(!Lu.test(i))throw new Error("invalid attribute:"+i);this.attributeNames[i]=this.length,this[this.length++]={qName:i,value:e,offset:t}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};function T1(i,e){var t,s=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=e,r.exec(i);t=r.exec(i);)if(s.push(t),t[1])return s}Po.XMLReader=wd;Po.ParseError=Yi;var x1=Ft,S1=Zt,Ru=Ad,jd=Po,C1=S1.DOMImplementation,Nu=x1.NAMESPACE,E1=jd.ParseError,A1=jd.XMLReader;function Id(i){return i.replace(/\r[\n\u0085]/g,`
18
+ `))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const jg=" ",_a=function(i){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(i||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},Ig=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},Be=function(i){const e={};if(!i)return e;const t=i.split(Ig());let s=t.length,r;for(;s--;)t[s]!==""&&(r=/([^=]*)=(.*)/.exec(t[s]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e},bu=i=>{const e=i.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};class Pg extends bo{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,s;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((n,a)=>{const l=a(e);return l===e?n:n.concat([l])},[e]).forEach(n=>{for(let a=0;a<this.customParsers.length;a++)if(this.customParsers[a].call(this,n))return;if(n.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:n.slice(1)});return}if(n=n.replace("\r",""),t=/^#EXTM3U/.exec(n),t){this.trigger("data",{type:"tag",tagType:"m3u"});return}if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(n),t){s={type:"tag",tagType:"inf"},t[1]&&(s.duration=parseFloat(t[1])),t[2]&&(s.title=t[2]),this.trigger("data",s);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(n),t){s={type:"tag",tagType:"targetduration"},t[1]&&(s.duration=parseInt(t[1],10)),this.trigger("data",s);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(n),t){s={type:"tag",tagType:"version"},t[1]&&(s.version=parseInt(t[1],10)),this.trigger("data",s);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){s={type:"tag",tagType:"media-sequence"},t[1]&&(s.number=parseInt(t[1],10)),this.trigger("data",s);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){s={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(s.number=parseInt(t[1],10)),this.trigger("data",s);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(n),t){s={type:"tag",tagType:"playlist-type"},t[1]&&(s.playlistType=t[1]),this.trigger("data",s);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(n),t){s=_e(_a(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",s);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(n),t){s={type:"tag",tagType:"allow-cache"},t[1]&&(s.allowed=!/NO/.test(t[1])),this.trigger("data",s);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(n),t){if(s={type:"tag",tagType:"map"},t[1]){const a=Be(t[1]);a.URI&&(s.uri=a.URI),a.BYTERANGE&&(s.byterange=_a(a.BYTERANGE))}this.trigger("data",s);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(n),t){s={type:"tag",tagType:"stream-inf"},t[1]&&(s.attributes=Be(t[1]),s.attributes.RESOLUTION&&(s.attributes.RESOLUTION=bu(s.attributes.RESOLUTION)),s.attributes.BANDWIDTH&&(s.attributes.BANDWIDTH=parseInt(s.attributes.BANDWIDTH,10)),s.attributes["FRAME-RATE"]&&(s.attributes["FRAME-RATE"]=parseFloat(s.attributes["FRAME-RATE"])),s.attributes["PROGRAM-ID"]&&(s.attributes["PROGRAM-ID"]=parseInt(s.attributes["PROGRAM-ID"],10))),this.trigger("data",s);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(n),t){s={type:"tag",tagType:"media"},t[1]&&(s.attributes=Be(t[1])),this.trigger("data",s);return}if(t=/^#EXT-X-ENDLIST/.exec(n),t){this.trigger("data",{type:"tag",tagType:"endlist"});return}if(t=/^#EXT-X-DISCONTINUITY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(n),t){s={type:"tag",tagType:"program-date-time"},t[1]&&(s.dateTimeString=t[1],s.dateTimeObject=new Date(t[1])),this.trigger("data",s);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(n),t){s={type:"tag",tagType:"key"},t[1]&&(s.attributes=Be(t[1]),s.attributes.IV&&(s.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(s.attributes.IV=s.attributes.IV.substring(2)),s.attributes.IV=s.attributes.IV.match(/.{8}/g),s.attributes.IV[0]=parseInt(s.attributes.IV[0],16),s.attributes.IV[1]=parseInt(s.attributes.IV[1],16),s.attributes.IV[2]=parseInt(s.attributes.IV[2],16),s.attributes.IV[3]=parseInt(s.attributes.IV[3],16),s.attributes.IV=new Uint32Array(s.attributes.IV))),this.trigger("data",s);return}if(t=/^#EXT-X-START:(.*)$/.exec(n),t){s={type:"tag",tagType:"start"},t[1]&&(s.attributes=Be(t[1]),s.attributes["TIME-OFFSET"]=parseFloat(s.attributes["TIME-OFFSET"]),s.attributes.PRECISE=/YES/.test(s.attributes.PRECISE)),this.trigger("data",s);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(n),t){s={type:"tag",tagType:"cue-out-cont"},t[1]?s.data=t[1]:s.data="",this.trigger("data",s);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(n),t){s={type:"tag",tagType:"cue-out"},t[1]?s.data=t[1]:s.data="",this.trigger("data",s);return}if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(n),t){s={type:"tag",tagType:"cue-in"},t[1]?s.data=t[1]:s.data="",this.trigger("data",s);return}if(t=/^#EXT-X-SKIP:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"skip"},s.attributes=Be(t[1]),s.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(s.attributes["SKIPPED-SEGMENTS"]=parseInt(s.attributes["SKIPPED-SEGMENTS"],10)),s.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(s.attributes["RECENTLY-REMOVED-DATERANGES"]=s.attributes["RECENTLY-REMOVED-DATERANGES"].split(jg)),this.trigger("data",s);return}if(t=/^#EXT-X-PART:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"part"},s.attributes=Be(t[1]),["DURATION"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=parseFloat(s.attributes[a]))}),["INDEPENDENT","GAP"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=/YES/.test(s.attributes[a]))}),s.attributes.hasOwnProperty("BYTERANGE")&&(s.attributes.byterange=_a(s.attributes.BYTERANGE)),this.trigger("data",s);return}if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"server-control"},s.attributes=Be(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=parseFloat(s.attributes[a]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=/YES/.test(s.attributes[a]))}),this.trigger("data",s);return}if(t=/^#EXT-X-PART-INF:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"part-inf"},s.attributes=Be(t[1]),["PART-TARGET"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=parseFloat(s.attributes[a]))}),this.trigger("data",s);return}if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"preload-hint"},s.attributes=Be(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(a){if(s.attributes.hasOwnProperty(a)){s.attributes[a]=parseInt(s.attributes[a],10);const l=a==="BYTERANGE-LENGTH"?"length":"offset";s.attributes.byterange=s.attributes.byterange||{},s.attributes.byterange[l]=s.attributes[a],delete s.attributes[a]}}),this.trigger("data",s);return}if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"rendition-report"},s.attributes=Be(t[1]),["LAST-MSN","LAST-PART"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=parseInt(s.attributes[a],10))}),this.trigger("data",s);return}if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"daterange"},s.attributes=Be(t[1]),["ID","CLASS"].forEach(function(l){s.attributes.hasOwnProperty(l)&&(s.attributes[l]=String(s.attributes[l]))}),["START-DATE","END-DATE"].forEach(function(l){s.attributes.hasOwnProperty(l)&&(s.attributes[l]=new Date(s.attributes[l]))}),["DURATION","PLANNED-DURATION"].forEach(function(l){s.attributes.hasOwnProperty(l)&&(s.attributes[l]=parseFloat(s.attributes[l]))}),["END-ON-NEXT"].forEach(function(l){s.attributes.hasOwnProperty(l)&&(s.attributes[l]=/YES/i.test(s.attributes[l]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(l){s.attributes.hasOwnProperty(l)&&(s.attributes[l]=s.attributes[l].toString(16))});const a=/^X-([A-Z]+-)+[A-Z]+$/;for(const l in s.attributes){if(!a.test(l))continue;const u=/[0-9A-Fa-f]{6}/g.test(s.attributes[l]),f=/^\d+(\.\d+)?$/.test(s.attributes[l]);s.attributes[l]=u?s.attributes[l].toString(16):f?parseFloat(s.attributes[l]):String(s.attributes[l])}this.trigger("data",s);return}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(n),t){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"i-frames-only"});return}if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(n),t){s={type:"tag",tagType:"content-steering"},s.attributes=Be(t[1]),this.trigger("data",s);return}if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(n),t){s={type:"tag",tagType:"i-frame-playlist"},s.attributes=Be(t[1]),s.attributes.URI&&(s.uri=s.attributes.URI),s.attributes.BANDWIDTH&&(s.attributes.BANDWIDTH=parseInt(s.attributes.BANDWIDTH,10)),s.attributes.RESOLUTION&&(s.attributes.RESOLUTION=bu(s.attributes.RESOLUTION)),s.attributes["AVERAGE-BANDWIDTH"]&&(s.attributes["AVERAGE-BANDWIDTH"]=parseInt(s.attributes["AVERAGE-BANDWIDTH"],10)),s.attributes["FRAME-RATE"]&&(s.attributes["FRAME-RATE"]=parseFloat(s.attributes["FRAME-RATE"])),this.trigger("data",s);return}if(t=/^#EXT-X-DEFINE:(.*)$/.exec(n),t){s={type:"tag",tagType:"define"},s.attributes=Be(t[1]),this.trigger("data",s);return}this.trigger("data",{type:"tag",data:n.slice(4)})})}addParser({expression:e,customType:t,dataParser:s,segment:r}){typeof s!="function"&&(s=n=>n),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:s(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const s=r=>e.test(r)?t(r):r;this.tagMappers.push(s)}}const Lg=i=>i.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),zt=function(i){const e={};return Object.keys(i).forEach(function(t){e[Lg(t)]=i[t]}),e},ba=function(i){const{serverControl:e,targetDuration:t,partTargetDuration:s}=i;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",l=t&&t*3,u=s&&s*2;t&&!e.hasOwnProperty(n)&&(e[n]=l,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${l}).`})),l&&e[n]<l&&(this.trigger("warn",{message:`${r} clamping HOLD-BACK (${e[n]}) to targetDuration * 3 (${l})`}),e[n]=l),s&&!e.hasOwnProperty(a)&&(e[a]=s*3,this.trigger("info",{message:`${r} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[a]}).`})),s&&e[a]<u&&(this.trigger("warn",{message:`${r} clamping PART-HOLD-BACK (${e[a]}) to partTargetDuration * 2 (${u}).`}),e[a]=u)};class Og extends bo{constructor(e={}){super(),this.lineStream=new kg,this.parseStream=new Pg,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;const t=this,s=[];let r={},n,a,l=!1;const u=function(){},f={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},m="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let v=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let T=0,E=0;const A={};this.on("end",()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&n&&(r.map=n),!r.key&&a&&(r.key=a),!r.timeline&&typeof v=="number"&&(r.timeline=v),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(y){let k,w;if(t.manifest.definitions){for(const I in t.manifest.definitions)if(y.uri&&(y.uri=y.uri.replace(`{$${I}}`,t.manifest.definitions[I])),y.attributes)for(const j in y.attributes)typeof y.attributes[j]=="string"&&(y.attributes[j]=y.attributes[j].replace(`{$${I}}`,t.manifest.definitions[I]))}({tag(){({version(){y.version&&(this.manifest.version=y.version)},"allow-cache"(){this.manifest.allowCache=y.allowed,"allowed"in y||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const I={};"length"in y&&(r.byterange=I,I.length=y.length,"offset"in y||(y.offset=T)),"offset"in y&&(r.byterange=I,I.offset=y.offset),T=I.offset+I.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),y.title&&(r.title=y.title),y.duration>0&&(r.duration=y.duration),y.duration===0&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=s},key(){if(!y.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(y.attributes.METHOD==="NONE"){a=null;return}if(!y.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(y.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:y.attributes};return}if(y.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:y.attributes.URI};return}if(y.attributes.KEYFORMAT===m){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(y.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(y.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),y.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(y.attributes.KEYID&&y.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:y.attributes.KEYFORMAT,keyId:y.attributes.KEYID.substring(2)},pssh:Yc(y.attributes.URI.split(",")[1])};return}y.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:y.attributes.METHOD||"AES-128",uri:y.attributes.URI},typeof y.attributes.IV<"u"&&(a.iv=y.attributes.IV)},"media-sequence"(){if(!isFinite(y.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+y.number});return}this.manifest.mediaSequence=y.number},"discontinuity-sequence"(){if(!isFinite(y.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+y.number});return}this.manifest.discontinuitySequence=y.number,v=y.number},"playlist-type"(){if(!/VOD|EVENT/.test(y.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+y.playlist});return}this.manifest.playlistType=y.playlistType},map(){n={},y.uri&&(n.uri=y.uri),y.byterange&&(n.byterange=y.byterange),a&&(n.key=a)},"stream-inf"(){if(this.manifest.playlists=s,this.manifest.mediaGroups=this.manifest.mediaGroups||f,!y.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}r.attributes||(r.attributes={}),_e(r.attributes,y.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||f,!(y.attributes&&y.attributes.TYPE&&y.attributes["GROUP-ID"]&&y.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const I=this.manifest.mediaGroups[y.attributes.TYPE];I[y.attributes["GROUP-ID"]]=I[y.attributes["GROUP-ID"]]||{},k=I[y.attributes["GROUP-ID"]],w={default:/yes/i.test(y.attributes.DEFAULT)},w.default?w.autoselect=!0:w.autoselect=/yes/i.test(y.attributes.AUTOSELECT),y.attributes.LANGUAGE&&(w.language=y.attributes.LANGUAGE),y.attributes.URI&&(w.uri=y.attributes.URI),y.attributes["INSTREAM-ID"]&&(w.instreamId=y.attributes["INSTREAM-ID"]),y.attributes.CHARACTERISTICS&&(w.characteristics=y.attributes.CHARACTERISTICS),y.attributes.FORCED&&(w.forced=/yes/i.test(y.attributes.FORCED)),k[y.attributes.NAME]=w},discontinuity(){v+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(s.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=y.dateTimeString,this.manifest.dateTimeObject=y.dateTimeObject),r.dateTimeString=y.dateTimeString,r.dateTimeObject=y.dateTimeObject;const{lastProgramDateTime:I}=this;this.lastProgramDateTime=new Date(y.dateTimeString).getTime(),I===null&&this.manifest.segments.reduceRight((j,L)=>(L.programDateTime=j-L.duration*1e3,L.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(y.duration)||y.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+y.duration});return}this.manifest.targetDuration=y.duration,ba.call(this,this.manifest)},start(){if(!y.attributes||isNaN(y.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:y.attributes["TIME-OFFSET"],precise:y.attributes.PRECISE}},"cue-out"(){r.cueOut=y.data},"cue-out-cont"(){r.cueOutCont=y.data},"cue-in"(){r.cueIn=y.data},skip(){this.manifest.skip=zt(y.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",y.attributes,["SKIPPED-SEGMENTS"])},part(){l=!0;const I=this.manifest.segments.length,j=zt(y.attributes);r.parts=r.parts||[],r.parts.push(j),j.byterange&&(j.byterange.hasOwnProperty("offset")||(j.byterange.offset=E),E=j.byterange.offset+j.byterange.length);const L=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${L} for segment #${I}`,y.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((O,F)=>{O.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${F} lacks required attribute(s): LAST-PART`})})},"server-control"(){const I=this.manifest.serverControl=zt(y.attributes);I.hasOwnProperty("canBlockReload")||(I.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),ba.call(this,this.manifest),I.canSkipDateranges&&!I.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const I=this.manifest.segments.length,j=zt(y.attributes),L=j.type&&j.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(j),j.byterange&&(j.byterange.hasOwnProperty("offset")||(j.byterange.offset=L?E:0,L&&(E=j.byterange.offset+j.byterange.length)));const O=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${O} for segment #${I}`,y.attributes,["TYPE","URI"]),!!j.type)for(let F=0;F<r.preloadHints.length-1;F++){const B=r.preloadHints[F];B.type&&B.type===j.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${O} for segment #${I} has the same TYPE ${j.type} as preload hint #${F}`})}},"rendition-report"(){const I=zt(y.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(I);const j=this.manifest.renditionReports.length-1,L=["LAST-MSN","URI"];l&&L.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${j}`,y.attributes,L)},"part-inf"(){this.manifest.partInf=zt(y.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",y.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),ba.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(zt(y.attributes));const I=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${I}`,y.attributes,["ID","START-DATE"]);const j=this.manifest.dateRanges[I];j.endDate&&j.startDate&&new Date(j.endDate)<new Date(j.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),j.duration&&j.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),j.plannedDuration&&j.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const L=!!j.endOnNext;if(L&&!j.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),L&&(j.duration||j.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),j.duration&&j.endDate){const F=j.startDate.getTime()+j.duration*1e3;this.manifest.dateRanges[I].endDate=new Date(F)}if(!A[j.id])A[j.id]=j;else{for(const F in A[j.id])if(j[F]&&JSON.stringify(A[j.id][F])!==JSON.stringify(j[F])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const O=this.manifest.dateRanges.findIndex(F=>F.id===j.id);this.manifest.dateRanges[O]=_e(this.manifest.dateRanges[O],j),A[j.id]=_e(A[j.id],j),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=zt(y.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",y.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const I=(j,L)=>{if(j in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${j}`});return}this.manifest.definitions[j]=L};if("QUERYPARAM"in y.attributes){if("NAME"in y.attributes||"IMPORT"in y.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const j=this.params.get(y.attributes.QUERYPARAM);if(!j){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${y.attributes.QUERYPARAM}`});return}I(y.attributes.QUERYPARAM,decodeURIComponent(j));return}if("NAME"in y.attributes){if("IMPORT"in y.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in y.attributes)||typeof y.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${y.attributes.NAME}`});return}I(y.attributes.NAME,y.attributes.VALUE);return}if("IMPORT"in y.attributes){if(!this.mainDefinitions[y.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${y.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}I(y.attributes.IMPORT,this.mainDefinitions[y.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:y.attributes,uri:y.uri,timeline:v}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",y.attributes,["BANDWIDTH","URI"])}}[y.tagType]||u).call(t)},uri(){r.uri=y.uri,s.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),a&&(r.key=a),r.timeline=v,n&&(r.map=n),E=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){y.segment?(r.custom=r.custom||{},r.custom[y.customType]=y.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[y.customType]=y.data)}})[y.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,s){const r=[];s.forEach(function(n){t.hasOwnProperty(n)||r.push(n)}),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(`
19
+ `),this.manifest.dateRanges.length&&this.lastProgramDateTime===null&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var fi={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},Mg=["video","audio","text"],Tu=["Video","Audio","Text"],Kc=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,s,r){var n=("00"+Number(s).toString(16)).slice(-2),a=("00"+Number(r).toString(16)).slice(-2);return"avc1."+n+"00"+a})},vt=function(e){e===void 0&&(e="");var t=e.split(","),s=[];return t.forEach(function(r){r=r.trim();var n;Mg.forEach(function(a){var l=fi[a].exec(r.toLowerCase());if(!(!l||l.length<=1)){n=a;var u=r.substring(0,l[1].length),f=r.replace(u,"");s.push({type:u,details:f,mediaType:a})}}),n||s.push({type:r,details:"",mediaType:"unknown"})}),s},Rg=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var s=e.mediaGroups.AUDIO[t];if(!s)return null;for(var r in s){var n=s[r];if(n.default&&n.playlists)return vt(n.playlists[0].attributes.CODECS)}return null},Qc=function(e){return e===void 0&&(e=""),fi.audio.test(e.trim().toLowerCase())},Ng=function(e){return e===void 0&&(e=""),fi.text.test(e.trim().toLowerCase())},Gi=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return Kc(n.trim())}),s="video";t.length===1&&Qc(t[0])?s="audio":t.length===1&&Ng(t[0])&&(s="application");var r="mp4";return t.every(function(n){return fi.mp4.test(n)})?r="mp4":t.every(function(n){return fi.webm.test(n)})?r="webm":t.every(function(n){return fi.ogg.test(n)})&&(r="ogg"),s+"/"+r+';codecs="'+e+'"'}},qs=function(e,t){return e===void 0&&(e=""),t===void 0&&(t=!1),S.MediaSource&&S.MediaSource.isTypeSupported&&S.MediaSource.isTypeSupported(Gi(e))||t&&S.ManagedMediaSource&&S.ManagedMediaSource.isTypeSupported&&S.ManagedMediaSource.isTypeSupported(Gi(e))||!1},Ta=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var s=0;s<Tu.length;s++){var r=Tu[s];if(fi["muxer"+r].test(t))return!0}return!1})},xu="mp4a.40.2",Bg="avc1.4d400d",Fg=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,Ug=/^application\/dash\+xml/i,Jc=function(e){return Fg.test(e)?"hls":Ug.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},Vg=function(e){return e.toString(2).length},Hg=function(e){return Math.ceil(Vg(e)/8)},Zc=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},qg=function(e){return Zc(e)},G=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!qg(e)&&!(e instanceof ArrayBuffer)&&(typeof e!="number"||typeof e=="number"&&e!==e?e=0:e=[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},Ie=S.BigInt||Number,Fa=[Ie("0x1"),Ie("0x100"),Ie("0x10000"),Ie("0x1000000"),Ie("0x100000000"),Ie("0x10000000000"),Ie("0x1000000000000"),Ie("0x100000000000000"),Ie("0x10000000000000000")];(function(){var i=new Uint16Array([65484]),e=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var zg=function(e,t){var s=t===void 0?{}:t,r=s.signed,n=r===void 0?!1:r,a=s.le,l=a===void 0?!1:a;e=G(e);var u=l?"reduce":"reduceRight",f=e[u]?e[u]:Array.prototype[u],m=f.call(e,function(T,E,A){var y=l?A:Math.abs(A+1-e.length);return T+Ie(E)*Fa[y]},Ie(0));if(n){var v=Fa[e.length]/Ie(2)-Ie(1);m=Ie(m),m>v&&(m-=v,m-=v,m-=Ie(2))}return Number(m)},$g=function(e,t){var s={},r=s.le,n=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=Ie(e);for(var a=Hg(e),l=new Uint8Array(new ArrayBuffer(a)),u=0;u<a;u++){var f=n?u:Math.abs(u+1-l.length);l[f]=Number(e/Fa[u]&Ie(255)),e<0&&(l[f]=Math.abs(~l[f]),l[f]-=u===0?1:2)}return l},ed=function(e,t){if(typeof e!="string"&&e&&typeof e.toString=="function"&&(e=e.toString()),typeof e!="string")return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var s=new Uint8Array(e.length),r=0;r<e.length;r++)s[r]=e.charCodeAt(r);return s},Gg=function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];if(t=t.filter(function(l){return l&&(l.byteLength||l.length)&&typeof l!="string"}),t.length<=1)return G(t[0]);var r=t.reduce(function(l,u,f){return l+(u.byteLength||u.length)},0),n=new Uint8Array(r),a=0;return t.forEach(function(l){l=G(l),n.set(l,a),a+=l.byteLength}),n},pe=function(e,t,s){var r=s===void 0?{}:s,n=r.offset,a=n===void 0?0:n,l=r.mask,u=l===void 0?[]:l;e=G(e),t=G(t);var f=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&f.call(t,function(m,v){var T=u[v]?u[v]&e[a+v]:e[a+v];return m===T})},Wg=function(e,t,s){t.forEach(function(r){for(var n in e.mediaGroups[r])for(var a in e.mediaGroups[r][n]){var l=e.mediaGroups[r][n][a];s(l,r,n,a)}})},Zt={},Ft={};function Xg(i,e,t){if(t===void 0&&(t=Array.prototype),i&&typeof t.find=="function")return t.find.call(i,e);for(var s=0;s<i.length;s++)if(Object.prototype.hasOwnProperty.call(i,s)){var r=i[s];if(e.call(void 0,r,s,i))return r}}function To(i,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(i):i}function Yg(i,e){if(i===null||typeof i!="object")throw new TypeError("target is not an object");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);return i}var td=To({HTML:"text/html",isHTML:function(i){return i===td.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),id=To({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(i){return i===id.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Ft.assign=Yg;Ft.find=Xg;Ft.freeze=To;Ft.MIME_TYPE=td;Ft.NAMESPACE=id;var sd=Ft,St=sd.find,Ys=sd.NAMESPACE;function Kg(i){return i!==""}function Qg(i){return i?i.split(/[\t\n\f\r ]+/).filter(Kg):[]}function Jg(i,e){return i.hasOwnProperty(e)||(i[e]=!0),i}function Su(i){if(!i)return[];var e=Qg(i);return Object.keys(e.reduce(Jg,{}))}function Zg(i){return function(e){return i&&i.indexOf(e)!==-1}}function sr(i,e){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}function Ye(i,e){var t=i.prototype;if(!(t instanceof e)){let s=function(){};s.prototype=e.prototype,s=new s,sr(t,s),i.prototype=t=s}t.constructor!=i&&(typeof i!="function"&&console.error("unknown Class:"+i),t.constructor=i)}var Ke={},dt=Ke.ELEMENT_NODE=1,Wi=Ke.ATTRIBUTE_NODE=2,Zr=Ke.TEXT_NODE=3,rd=Ke.CDATA_SECTION_NODE=4,nd=Ke.ENTITY_REFERENCE_NODE=5,e1=Ke.ENTITY_NODE=6,ad=Ke.PROCESSING_INSTRUCTION_NODE=7,od=Ke.COMMENT_NODE=8,ld=Ke.DOCUMENT_NODE=9,ud=Ke.DOCUMENT_TYPE_NODE=10,Rt=Ke.DOCUMENT_FRAGMENT_NODE=11,t1=Ke.NOTATION_NODE=12,Me={},je={};Me.INDEX_SIZE_ERR=(je[1]="Index size error",1);Me.DOMSTRING_SIZE_ERR=(je[2]="DOMString size error",2);var $e=Me.HIERARCHY_REQUEST_ERR=(je[3]="Hierarchy request error",3);Me.WRONG_DOCUMENT_ERR=(je[4]="Wrong document",4);Me.INVALID_CHARACTER_ERR=(je[5]="Invalid character",5);Me.NO_DATA_ALLOWED_ERR=(je[6]="No data allowed",6);Me.NO_MODIFICATION_ALLOWED_ERR=(je[7]="No modification allowed",7);var cd=Me.NOT_FOUND_ERR=(je[8]="Not found",8);Me.NOT_SUPPORTED_ERR=(je[9]="Not supported",9);var Cu=Me.INUSE_ATTRIBUTE_ERR=(je[10]="Attribute in use",10);Me.INVALID_STATE_ERR=(je[11]="Invalid state",11);Me.SYNTAX_ERR=(je[12]="Syntax error",12);Me.INVALID_MODIFICATION_ERR=(je[13]="Invalid modification",13);Me.NAMESPACE_ERR=(je[14]="Invalid namespace",14);Me.INVALID_ACCESS_ERR=(je[15]="Invalid access",15);function Se(i,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,je[i]),this.message=je[i],Error.captureStackTrace&&Error.captureStackTrace(this,Se);return t.code=i,e&&(this.message=this.message+": "+e),t}Se.prototype=Error.prototype;sr(Me,Se);function Lt(){}Lt.prototype={length:0,item:function(i){return i>=0&&i<this.length?this[i]:null},toString:function(i,e){for(var t=[],s=0;s<this.length;s++)Li(this[s],t,i,e);return t.join("")},filter:function(i){return Array.prototype.filter.call(this,i)},indexOf:function(i){return Array.prototype.indexOf.call(this,i)}};function Xi(i,e){this._node=i,this._refresh=e,xo(this)}function xo(i){var e=i._node._inc||i._node.ownerDocument._inc;if(i._inc!==e){var t=i._refresh(i._node);if(xd(i,"length",t.length),!i.$$length||t.length<i.$$length)for(var s=t.length;s in i;s++)Object.prototype.hasOwnProperty.call(i,s)&&delete i[s];sr(t,i),i._inc=e}}Xi.prototype.item=function(i){return xo(this),this[i]||null};Ye(Xi,Lt);function en(){}function dd(i,e){for(var t=i.length;t--;)if(i[t]===e)return t}function Eu(i,e,t,s){if(s?e[dd(e,s)]=t:e[e.length++]=t,i){t.ownerElement=i;var r=i.ownerDocument;r&&(s&&pd(r,i,s),i1(r,i,t))}}function Au(i,e,t){var s=dd(e,t);if(s>=0){for(var r=e.length-1;s<r;)e[s]=e[++s];if(e.length=r,i){var n=i.ownerDocument;n&&(pd(n,i,t),t.ownerElement=null)}}else throw new Se(cd,new Error(i.tagName+"@"+t))}en.prototype={length:0,item:Lt.prototype.item,getNamedItem:function(i){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==i)return t}},setNamedItem:function(i){var e=i.ownerElement;if(e&&e!=this._ownerElement)throw new Se(Cu);var t=this.getNamedItem(i.nodeName);return Eu(this._ownerElement,this,i,t),t},setNamedItemNS:function(i){var e=i.ownerElement,t;if(e&&e!=this._ownerElement)throw new Se(Cu);return t=this.getNamedItemNS(i.namespaceURI,i.localName),Eu(this._ownerElement,this,i,t),t},removeNamedItem:function(i){var e=this.getNamedItem(i);return Au(this._ownerElement,this,e),e},removeNamedItemNS:function(i,e){var t=this.getNamedItemNS(i,e);return Au(this._ownerElement,this,t),t},getNamedItemNS:function(i,e){for(var t=this.length;t--;){var s=this[t];if(s.localName==e&&s.namespaceURI==i)return s}return null}};function hd(){}hd.prototype={hasFeature:function(i,e){return!0},createDocument:function(i,e,t){var s=new rr;if(s.implementation=this,s.childNodes=new Lt,s.doctype=t||null,t&&s.appendChild(t),e){var r=s.createElementNS(i,e);s.appendChild(r)}return s},createDocumentType:function(i,e,t){var s=new wn;return s.name=i,s.nodeName=i,s.publicId=e||"",s.systemId=t||"",s}};function ne(){}ne.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(i,e){return tn(this,i,e)},replaceChild:function(i,e){tn(this,i,e,gd),e&&this.removeChild(e)},removeChild:function(i){return md(this,i)},appendChild:function(i){return this.insertBefore(i,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(i){return Ua(this.ownerDocument||this,this,i)},normalize:function(){for(var i=this.firstChild;i;){var e=i.nextSibling;e&&e.nodeType==Zr&&i.nodeType==Zr?(this.removeChild(e),i.appendData(e.data)):(i.normalize(),i=e)}},isSupported:function(i,e){return this.ownerDocument.implementation.hasFeature(i,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(i){for(var e=this;e;){var t=e._nsMap;if(t){for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&t[s]===i)return s}e=e.nodeType==Wi?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(i){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i];e=e.nodeType==Wi?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(i){var e=this.lookupPrefix(i);return e==null}};function fd(i){return i=="<"&&"&lt;"||i==">"&&"&gt;"||i=="&"&&"&amp;"||i=='"'&&"&quot;"||"&#"+i.charCodeAt()+";"}sr(Ke,ne);sr(Ke,ne.prototype);function Ks(i,e){if(e(i))return!0;if(i=i.firstChild)do if(Ks(i,e))return!0;while(i=i.nextSibling)}function rr(){this.ownerDocument=this}function i1(i,e,t){i&&i._inc++;var s=t.namespaceURI;s===Ys.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function pd(i,e,t,s){i&&i._inc++;var r=t.namespaceURI;r===Ys.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function So(i,e,t){if(i&&i._inc){i._inc++;var s=e.childNodes;if(t)s[s.length++]=t;else{for(var r=e.firstChild,n=0;r;)s[n++]=r,r=r.nextSibling;s.length=n,delete s[s.length]}}}function md(i,e){var t=e.previousSibling,s=e.nextSibling;return t?t.nextSibling=s:i.firstChild=s,s?s.previousSibling=t:i.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,So(i.ownerDocument,i),e}function s1(i){return i&&(i.nodeType===ne.DOCUMENT_NODE||i.nodeType===ne.DOCUMENT_FRAGMENT_NODE||i.nodeType===ne.ELEMENT_NODE)}function r1(i){return i&&(Ct(i)||Co(i)||Nt(i)||i.nodeType===ne.DOCUMENT_FRAGMENT_NODE||i.nodeType===ne.COMMENT_NODE||i.nodeType===ne.PROCESSING_INSTRUCTION_NODE)}function Nt(i){return i&&i.nodeType===ne.DOCUMENT_TYPE_NODE}function Ct(i){return i&&i.nodeType===ne.ELEMENT_NODE}function Co(i){return i&&i.nodeType===ne.TEXT_NODE}function wu(i,e){var t=i.childNodes||[];if(St(t,Ct)||Nt(e))return!1;var s=St(t,Nt);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}function Du(i,e){var t=i.childNodes||[];function s(n){return Ct(n)&&n!==e}if(St(t,s))return!1;var r=St(t,Nt);return!(e&&r&&t.indexOf(r)>t.indexOf(e))}function n1(i,e,t){if(!s1(i))throw new Se($e,"Unexpected parent node type "+i.nodeType);if(t&&t.parentNode!==i)throw new Se(cd,"child not in parent");if(!r1(e)||Nt(e)&&i.nodeType!==ne.DOCUMENT_NODE)throw new Se($e,"Unexpected node type "+e.nodeType+" for parent node type "+i.nodeType)}function a1(i,e,t){var s=i.childNodes||[],r=e.childNodes||[];if(e.nodeType===ne.DOCUMENT_FRAGMENT_NODE){var n=r.filter(Ct);if(n.length>1||St(r,Co))throw new Se($e,"More than one element or text in fragment");if(n.length===1&&!wu(i,t))throw new Se($e,"Element in fragment can not be inserted before doctype")}if(Ct(e)&&!wu(i,t))throw new Se($e,"Only one element can be added and only after doctype");if(Nt(e)){if(St(s,Nt))throw new Se($e,"Only one doctype is allowed");var a=St(s,Ct);if(t&&s.indexOf(a)<s.indexOf(t))throw new Se($e,"Doctype can only be inserted before an element");if(!t&&a)throw new Se($e,"Doctype can not be appended since element is present")}}function gd(i,e,t){var s=i.childNodes||[],r=e.childNodes||[];if(e.nodeType===ne.DOCUMENT_FRAGMENT_NODE){var n=r.filter(Ct);if(n.length>1||St(r,Co))throw new Se($e,"More than one element or text in fragment");if(n.length===1&&!Du(i,t))throw new Se($e,"Element in fragment can not be inserted before doctype")}if(Ct(e)&&!Du(i,t))throw new Se($e,"Only one element can be added and only after doctype");if(Nt(e)){if(St(s,function(u){return Nt(u)&&u!==t}))throw new Se($e,"Only one doctype is allowed");var a=St(s,Ct);if(t&&s.indexOf(a)<s.indexOf(t))throw new Se($e,"Doctype can only be inserted before an element")}}function tn(i,e,t,s){n1(i,e,t),i.nodeType===ne.DOCUMENT_NODE&&(s||a1)(i,e,t);var r=e.parentNode;if(r&&r.removeChild(e),e.nodeType===Rt){var n=e.firstChild;if(n==null)return e;var a=e.lastChild}else n=a=e;var l=t?t.previousSibling:i.lastChild;n.previousSibling=l,a.nextSibling=t,l?l.nextSibling=n:i.firstChild=n,t==null?i.lastChild=a:t.previousSibling=a;do n.parentNode=i;while(n!==a&&(n=n.nextSibling));return So(i.ownerDocument||i,i),e.nodeType==Rt&&(e.firstChild=e.lastChild=null),e}function o1(i,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=i,e.previousSibling=i.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:i.firstChild=e,i.lastChild=e,So(i.ownerDocument,i,e),e}rr.prototype={nodeName:"#document",nodeType:ld,doctype:null,documentElement:null,_inc:1,insertBefore:function(i,e){if(i.nodeType==Rt){for(var t=i.firstChild;t;){var s=t.nextSibling;this.insertBefore(t,e),t=s}return i}return tn(this,i,e),i.ownerDocument=this,this.documentElement===null&&i.nodeType===dt&&(this.documentElement=i),i},removeChild:function(i){return this.documentElement==i&&(this.documentElement=null),md(this,i)},replaceChild:function(i,e){tn(this,i,e,gd),i.ownerDocument=this,e&&this.removeChild(e),Ct(i)&&(this.documentElement=i)},importNode:function(i,e){return Td(this,i,e)},getElementById:function(i){var e=null;return Ks(this.documentElement,function(t){if(t.nodeType==dt&&t.getAttribute("id")==i)return e=t,!0}),e},getElementsByClassName:function(i){var e=Su(i);return new Xi(this,function(t){var s=[];return e.length>0&&Ks(t.documentElement,function(r){if(r!==t&&r.nodeType===dt){var n=r.getAttribute("class");if(n){var a=i===n;if(!a){var l=Su(n);a=e.every(Zg(l))}a&&s.push(r)}}}),s})},createElement:function(i){var e=new yi;e.ownerDocument=this,e.nodeName=i,e.tagName=i,e.localName=i,e.childNodes=new Lt;var t=e.attributes=new en;return t._ownerElement=e,e},createDocumentFragment:function(){var i=new Dn;return i.ownerDocument=this,i.childNodes=new Lt,i},createTextNode:function(i){var e=new Eo;return e.ownerDocument=this,e.appendData(i),e},createComment:function(i){var e=new Ao;return e.ownerDocument=this,e.appendData(i),e},createCDATASection:function(i){var e=new wo;return e.ownerDocument=this,e.appendData(i),e},createProcessingInstruction:function(i,e){var t=new ko;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=i,t.nodeValue=t.data=e,t},createAttribute:function(i){var e=new sn;return e.ownerDocument=this,e.name=i,e.nodeName=i,e.localName=i,e.specified=!0,e},createEntityReference:function(i){var e=new Do;return e.ownerDocument=this,e.nodeName=i,e},createElementNS:function(i,e){var t=new yi,s=e.split(":"),r=t.attributes=new en;return t.childNodes=new Lt,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=i,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,r._ownerElement=t,t},createAttributeNS:function(i,e){var t=new sn,s=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=i,t.specified=!0,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,t}};Ye(rr,ne);function yi(){this._nsMap={}}yi.prototype={nodeType:dt,hasAttribute:function(i){return this.getAttributeNode(i)!=null},getAttribute:function(i){var e=this.getAttributeNode(i);return e&&e.value||""},getAttributeNode:function(i){return this.attributes.getNamedItem(i)},setAttribute:function(i,e){var t=this.ownerDocument.createAttribute(i);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},removeAttribute:function(i){var e=this.getAttributeNode(i);e&&this.removeAttributeNode(e)},appendChild:function(i){return i.nodeType===Rt?this.insertBefore(i,null):o1(this,i)},setAttributeNode:function(i){return this.attributes.setNamedItem(i)},setAttributeNodeNS:function(i){return this.attributes.setNamedItemNS(i)},removeAttributeNode:function(i){return this.attributes.removeNamedItem(i.nodeName)},removeAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(i,e){return this.getAttributeNodeNS(i,e)!=null},getAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);return t&&t.value||""},setAttributeNS:function(i,e,t){var s=this.ownerDocument.createAttributeNS(i,e);s.value=s.nodeValue=""+t,this.setAttributeNode(s)},getAttributeNodeNS:function(i,e){return this.attributes.getNamedItemNS(i,e)},getElementsByTagName:function(i){return new Xi(this,function(e){var t=[];return Ks(e,function(s){s!==e&&s.nodeType==dt&&(i==="*"||s.tagName==i)&&t.push(s)}),t})},getElementsByTagNameNS:function(i,e){return new Xi(this,function(t){var s=[];return Ks(t,function(r){r!==t&&r.nodeType===dt&&(i==="*"||r.namespaceURI===i)&&(e==="*"||r.localName==e)&&s.push(r)}),s})}};rr.prototype.getElementsByTagName=yi.prototype.getElementsByTagName;rr.prototype.getElementsByTagNameNS=yi.prototype.getElementsByTagNameNS;Ye(yi,ne);function sn(){}sn.prototype.nodeType=Wi;Ye(sn,ne);function nr(){}nr.prototype={data:"",substringData:function(i,e){return this.data.substring(i,i+e)},appendData:function(i){i=this.data+i,this.nodeValue=this.data=i,this.length=i.length},insertData:function(i,e){this.replaceData(i,0,e)},appendChild:function(i){throw new Error(je[$e])},deleteData:function(i,e){this.replaceData(i,e,"")},replaceData:function(i,e,t){var s=this.data.substring(0,i),r=this.data.substring(i+e);t=s+t+r,this.nodeValue=this.data=t,this.length=t.length}};Ye(nr,ne);function Eo(){}Eo.prototype={nodeName:"#text",nodeType:Zr,splitText:function(i){var e=this.data,t=e.substring(i);e=e.substring(0,i),this.data=this.nodeValue=e,this.length=e.length;var s=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling),s}};Ye(Eo,nr);function Ao(){}Ao.prototype={nodeName:"#comment",nodeType:od};Ye(Ao,nr);function wo(){}wo.prototype={nodeName:"#cdata-section",nodeType:rd};Ye(wo,nr);function wn(){}wn.prototype.nodeType=ud;Ye(wn,ne);function vd(){}vd.prototype.nodeType=t1;Ye(vd,ne);function yd(){}yd.prototype.nodeType=e1;Ye(yd,ne);function Do(){}Do.prototype.nodeType=nd;Ye(Do,ne);function Dn(){}Dn.prototype.nodeName="#document-fragment";Dn.prototype.nodeType=Rt;Ye(Dn,ne);function ko(){}ko.prototype.nodeType=ad;Ye(ko,ne);function _d(){}_d.prototype.serializeToString=function(i,e,t){return bd.call(i,e,t)};ne.prototype.toString=bd;function bd(i,e){var t=[],s=this.nodeType==9&&this.documentElement||this,r=s.prefix,n=s.namespaceURI;if(n&&r==null){var r=s.lookupPrefix(n);if(r==null)var a=[{namespace:n,prefix:null}]}return Li(this,t,i,e,a),t.join("")}function ku(i,e,t){var s=i.prefix||"",r=i.namespaceURI;if(!r||s==="xml"&&r===Ys.XML||r===Ys.XMLNS)return!1;for(var n=t.length;n--;){var a=t[n];if(a.prefix===s)return a.namespace!==r}return!0}function xa(i,e,t){i.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,fd),'"')}function Li(i,e,t,s,r){if(r||(r=[]),s)if(i=s(i),i){if(typeof i=="string"){e.push(i);return}}else return;switch(i.nodeType){case dt:var n=i.attributes,a=n.length,w=i.firstChild,l=i.tagName;t=Ys.isHTML(i.namespaceURI)||t;var u=l;if(!t&&!i.prefix&&i.namespaceURI){for(var f,m=0;m<n.length;m++)if(n.item(m).name==="xmlns"){f=n.item(m).value;break}if(!f)for(var v=r.length-1;v>=0;v--){var T=r[v];if(T.prefix===""&&T.namespace===i.namespaceURI){f=T.namespace;break}}if(f!==i.namespaceURI)for(var v=r.length-1;v>=0;v--){var T=r[v];if(T.namespace===i.namespaceURI){T.prefix&&(u=T.prefix+":"+l);break}}}e.push("<",u);for(var E=0;E<a;E++){var A=n.item(E);A.prefix=="xmlns"?r.push({prefix:A.localName,namespace:A.value}):A.nodeName=="xmlns"&&r.push({prefix:"",namespace:A.value})}for(var E=0;E<a;E++){var A=n.item(E);if(ku(A,t,r)){var y=A.prefix||"",k=A.namespaceURI;xa(e,y?"xmlns:"+y:"xmlns",k),r.push({prefix:y,namespace:k})}Li(A,e,t,s,r)}if(l===u&&ku(i,t,r)){var y=i.prefix||"",k=i.namespaceURI;xa(e,y?"xmlns:"+y:"xmlns",k),r.push({prefix:y,namespace:k})}if(w||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(l)){if(e.push(">"),t&&/^script$/i.test(l))for(;w;)w.data?e.push(w.data):Li(w,e,t,s,r.slice()),w=w.nextSibling;else for(;w;)Li(w,e,t,s,r.slice()),w=w.nextSibling;e.push("</",u,">")}else e.push("/>");return;case ld:case Rt:for(var w=i.firstChild;w;)Li(w,e,t,s,r.slice()),w=w.nextSibling;return;case Wi:return xa(e,i.name,i.value);case Zr:return e.push(i.data.replace(/[<&>]/g,fd));case rd:return e.push("<![CDATA[",i.data,"]]>");case od:return e.push("<!--",i.data,"-->");case ud:var I=i.publicId,j=i.systemId;if(e.push("<!DOCTYPE ",i.name),I)e.push(" PUBLIC ",I),j&&j!="."&&e.push(" ",j),e.push(">");else if(j&&j!=".")e.push(" SYSTEM ",j,">");else{var L=i.internalSubset;L&&e.push(" [",L,"]"),e.push(">")}return;case ad:return e.push("<?",i.target," ",i.data,"?>");case nd:return e.push("&",i.nodeName,";");default:e.push("??",i.nodeName)}}function Td(i,e,t){var s;switch(e.nodeType){case dt:s=e.cloneNode(!1),s.ownerDocument=i;case Rt:break;case Wi:t=!0;break}if(s||(s=e.cloneNode(!1)),s.ownerDocument=i,s.parentNode=null,t)for(var r=e.firstChild;r;)s.appendChild(Td(i,r,t)),r=r.nextSibling;return s}function Ua(i,e,t){var s=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];typeof n!="object"&&n!=s[r]&&(s[r]=n)}switch(e.childNodes&&(s.childNodes=new Lt),s.ownerDocument=i,s.nodeType){case dt:var a=e.attributes,l=s.attributes=new en,u=a.length;l._ownerElement=s;for(var f=0;f<u;f++)s.setAttributeNode(Ua(i,a.item(f),!0));break;case Wi:t=!0}if(t)for(var m=e.firstChild;m;)s.appendChild(Ua(i,m,t)),m=m.nextSibling;return s}function xd(i,e,t){i[e]=t}try{if(Object.defineProperty){let i=function(e){switch(e.nodeType){case dt:case Rt:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(i(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};Object.defineProperty(Xi.prototype,"length",{get:function(){return xo(this),this.$$length}}),Object.defineProperty(ne.prototype,"textContent",{get:function(){return i(this)},set:function(e){switch(this.nodeType){case dt:case Rt:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),xd=function(e,t,s){e["$$"+t]=s}}}catch{}Zt.DocumentType=wn;Zt.DOMException=Se;Zt.DOMImplementation=hd;Zt.Element=yi;Zt.Node=ne;Zt.NodeList=Lt;Zt.XMLSerializer=_d;var kn={},Sd={};(function(i){var e=Ft.freeze;i.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),i.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
20
+ `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),i.entityMap=i.HTML_ENTITIES})(Sd);var jo={},Qs=Ft.NAMESPACE,Va=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,ju=new RegExp("[\\-\\.0-9"+Va.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Iu=new RegExp("^"+Va.source+ju.source+"*(?::"+Va.source+ju.source+"*)?$"),js=0,$t=1,Ai=2,Is=3,wi=4,Di=5,Ps=6,Hr=7;function Yi(i,e){this.message=i,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Yi)}Yi.prototype=new Error;Yi.prototype.name=Yi.name;function Cd(){}Cd.prototype={parse:function(i,e,t){var s=this.domBuilder;s.startDocument(),Ed(e,e={}),l1(i,e,t,s,this.errorHandler),s.endDocument()}};function l1(i,e,t,s,r){function n(ee){if(ee>65535){ee-=65536;var be=55296+(ee>>10),Dt=56320+(ee&1023);return String.fromCharCode(be,Dt)}else return String.fromCharCode(ee)}function a(ee){var be=ee.slice(1,-1);return Object.hasOwnProperty.call(t,be)?t[be]:be.charAt(0)==="#"?n(parseInt(be.substr(1).replace("x","0x"))):(r.error("entity not found:"+ee),ee)}function l(ee){if(ee>y){var be=i.substring(y,ee).replace(/&#?\w+;/g,a);T&&u(y),s.characters(be,0,ee-y),y=ee}}function u(ee,be){for(;ee>=m&&(be=v.exec(i));)f=be.index,m=f+be[0].length,T.lineNumber++;T.columnNumber=ee-f+1}for(var f=0,m=0,v=/.*(?:\r\n?|\n)|.*$/g,T=s.locator,E=[{currentNSMap:e}],A={},y=0;;){try{var k=i.indexOf("<",y);if(k<0){if(!i.substr(y).match(/^\s*$/)){var w=s.doc,I=w.createTextNode(i.substr(y));w.appendChild(I),s.currentElement=I}return}switch(k>y&&l(k),i.charAt(k+1)){case"/":var J=i.indexOf(">",k+3),j=i.substring(k+2,J).replace(/[ \t\n\r]+$/g,""),L=E.pop();J<0?(j=i.substring(k+2).replace(/[\s<].*/,""),r.error("end tag name: "+j+" is not complete:"+L.tagName),J=k+1+j.length):j.match(/\s</)&&(j=j.replace(/[\s<].*/,""),r.error("end tag name: "+j+" maybe not complete"),J=k+1+j.length);var O=L.localNSMap,F=L.tagName==j,B=F||L.tagName&&L.tagName.toLowerCase()==j.toLowerCase();if(B){if(s.endElement(L.uri,L.localName,j),O)for(var U in O)Object.prototype.hasOwnProperty.call(O,U)&&s.endPrefixMapping(U);F||r.fatalError("end tag name: "+j+" is not match the current start tagName:"+L.tagName)}else E.push(L);J++;break;case"?":T&&u(k),J=f1(i,k,s);break;case"!":T&&u(k),J=h1(i,k,s,r);break;default:T&&u(k);var X=new Ad,ae=E[E.length-1].currentNSMap,J=u1(i,k,X,ae,a,r),le=X.length;if(!X.closed&&d1(i,J,X.tagName,A)&&(X.closed=!0,t.nbsp||r.warning("unclosed xml attribute")),T&&le){for(var z=Pu(T,{}),Z=0;Z<le;Z++){var Re=X[Z];u(Re.offset),Re.locator=Pu(T,{})}s.locator=z,Lu(X,s,ae)&&E.push(X),s.locator=T}else Lu(X,s,ae)&&E.push(X);Qs.isHTML(X.uri)&&!X.closed?J=c1(i,J,X.tagName,a,s):J++}}catch(ee){if(ee instanceof Yi)throw ee;r.error("element parse error: "+ee),J=-1}J>y?y=J:l(Math.max(k,y)+1)}}function Pu(i,e){return e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber,e}function u1(i,e,t,s,r,n){function a(T,E,A){t.attributeNames.hasOwnProperty(T)&&n.fatalError("Attribute "+T+" redefined"),t.addValue(T,E.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),A)}for(var l,u,f=++e,m=js;;){var v=i.charAt(f);switch(v){case"=":if(m===$t)l=i.slice(e,f),m=Is;else if(m===Ai)m=Is;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(m===Is||m===$t)if(m===$t&&(n.warning('attribute value must after "="'),l=i.slice(e,f)),e=f+1,f=i.indexOf(v,e),f>0)u=i.slice(e,f),a(l,u,e-1),m=Di;else throw new Error("attribute value no end '"+v+"' match");else if(m==wi)u=i.slice(e,f),a(l,u,e),n.warning('attribute "'+l+'" missed start quot('+v+")!!"),e=f+1,m=Di;else throw new Error('attribute value must after "="');break;case"/":switch(m){case js:t.setTagName(i.slice(e,f));case Di:case Ps:case Hr:m=Hr,t.closed=!0;case wi:case $t:break;case Ai:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return n.error("unexpected end of input"),m==js&&t.setTagName(i.slice(e,f)),f;case">":switch(m){case js:t.setTagName(i.slice(e,f));case Di:case Ps:case Hr:break;case wi:case $t:u=i.slice(e,f),u.slice(-1)==="/"&&(t.closed=!0,u=u.slice(0,-1));case Ai:m===Ai&&(u=l),m==wi?(n.warning('attribute "'+u+'" missed quot(")!'),a(l,u,e)):((!Qs.isHTML(s[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),a(u,u,e));break;case Is:throw new Error("attribute value missed!!")}return f;case"€":v=" ";default:if(v<=" ")switch(m){case js:t.setTagName(i.slice(e,f)),m=Ps;break;case $t:l=i.slice(e,f),m=Ai;break;case wi:var u=i.slice(e,f);n.warning('attribute "'+u+'" missed quot(")!!'),a(l,u,e);case Di:m=Ps;break}else switch(m){case Ai:t.tagName,(!Qs.isHTML(s[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),a(l,l,e),e=f,m=$t;break;case Di:n.warning('attribute space is required"'+l+'"!!');case Ps:m=$t,e=f;break;case Is:m=wi,e=f;break;case Hr:throw new Error("elements closed character '/' and '>' must be connected to")}}f++}}function Lu(i,e,t){for(var s=i.tagName,r=null,v=i.length;v--;){var n=i[v],a=n.qName,l=n.value,T=a.indexOf(":");if(T>0)var u=n.prefix=a.slice(0,T),f=a.slice(T+1),m=u==="xmlns"&&f;else f=a,u=null,m=a==="xmlns"&&"";n.localName=f,m!==!1&&(r==null&&(r={},Ed(t,t={})),t[m]=r[m]=l,n.uri=Qs.XMLNS,e.startPrefixMapping(m,l))}for(var v=i.length;v--;){n=i[v];var u=n.prefix;u&&(u==="xml"&&(n.uri=Qs.XML),u!=="xmlns"&&(n.uri=t[u||""]))}var T=s.indexOf(":");T>0?(u=i.prefix=s.slice(0,T),f=i.localName=s.slice(T+1)):(u=null,f=i.localName=s);var E=i.uri=t[u||""];if(e.startElement(E,f,s,i),i.closed){if(e.endElement(E,f,s),r)for(u in r)Object.prototype.hasOwnProperty.call(r,u)&&e.endPrefixMapping(u)}else return i.currentNSMap=t,i.localNSMap=r,!0}function c1(i,e,t,s,r){if(/^(?:script|textarea)$/i.test(t)){var n=i.indexOf("</"+t+">",e),a=i.substring(e+1,n);if(/[&<]/.test(a))return/^script$/i.test(t)?(r.characters(a,0,a.length),n):(a=a.replace(/&#?\w+;/g,s),r.characters(a,0,a.length),n)}return e+1}function d1(i,e,t,s){var r=s[t];return r==null&&(r=i.lastIndexOf("</"+t+">"),r<e&&(r=i.lastIndexOf("</"+t)),s[t]=r),r<e}function Ed(i,e){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}function h1(i,e,t,s){var r=i.charAt(e+2);switch(r){case"-":if(i.charAt(e+3)==="-"){var n=i.indexOf("-->",e+4);return n>e?(t.comment(i,e+4,n-e-4),n+3):(s.error("Unclosed comment"),-1)}else return-1;default:if(i.substr(e+3,6)=="CDATA["){var n=i.indexOf("]]>",e+9);return t.startCDATA(),t.characters(i,e+9,n-e-9),t.endCDATA(),n+3}var a=p1(i,e),l=a.length;if(l>1&&/!doctype/i.test(a[0][0])){var u=a[1][0],f=!1,m=!1;l>3&&(/^public$/i.test(a[2][0])?(f=a[3][0],m=l>4&&a[4][0]):/^system$/i.test(a[2][0])&&(m=a[3][0]));var v=a[l-1];return t.startDTD(u,f,m),t.endDTD(),v.index+v[0].length}}return-1}function f1(i,e,t){var s=i.indexOf("?>",e);if(s){var r=i.substring(e,s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,t.processingInstruction(r[1],r[2]),s+2):-1}return-1}function Ad(){this.attributeNames={}}Ad.prototype={setTagName:function(i){if(!Iu.test(i))throw new Error("invalid tagName:"+i);this.tagName=i},addValue:function(i,e,t){if(!Iu.test(i))throw new Error("invalid attribute:"+i);this.attributeNames[i]=this.length,this[this.length++]={qName:i,value:e,offset:t}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};function p1(i,e){var t,s=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=e,r.exec(i);t=r.exec(i);)if(s.push(t),t[1])return s}jo.XMLReader=Cd;jo.ParseError=Yi;var m1=Ft,g1=Zt,Ou=Sd,wd=jo,v1=g1.DOMImplementation,Mu=m1.NAMESPACE,y1=wd.ParseError,_1=wd.XMLReader;function Dd(i){return i.replace(/\r[\n\u0085]/g,`
21
21
  `).replace(/[\r\u0085\u2028]/g,`
22
- `)}function Pd(i){this.options=i||{locator:{}}}Pd.prototype.parseFromString=function(i,e){var t=this.options,s=new A1,r=t.domBuilder||new or,n=t.errorHandler,a=t.locator,l=t.xmlns||{},u=/\/x?html?$/.test(e),f=u?Ru.HTML_ENTITIES:Ru.XML_ENTITIES;a&&r.setDocumentLocator(a),s.errorHandler=w1(n,r,a),s.domBuilder=t.domBuilder||r,u&&(l[""]=Nu.HTML),l.xml=l.xml||Nu.XML;var m=t.normalizeLineEndings||Id;return i&&typeof i=="string"?s.parse(m(i),l,f):s.errorHandler.error("invalid doc source"),r.doc};function w1(i,e,t){if(!i){if(e instanceof or)return e;i=e}var s={},r=i instanceof Function;t=t||{};function n(a){var l=i[a];!l&&r&&(l=i.length==2?function(u){i(a,u)}:i),s[a]=l&&function(u){l("[xmldom "+a+"] "+u+za(t))}||function(){}}return n("warning"),n("error"),n("fatalError"),s}function or(){this.cdata=!1}function ki(i,e){e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber}or.prototype={startDocument:function(){this.doc=new C1().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(i,e,t,s){var r=this.doc,n=r.createElementNS(i,t||e),a=s.length;zr(this,n),this.currentElement=n,this.locator&&ki(this.locator,n);for(var l=0;l<a;l++){var i=s.getURI(l),u=s.getValue(l),t=s.getQName(l),f=r.createAttributeNS(i,t);this.locator&&ki(s.getLocator(l),f),f.value=f.nodeValue=u,n.setAttributeNode(f)}},endElement:function(i,e,t){var s=this.currentElement;s.tagName,this.currentElement=s.parentNode},startPrefixMapping:function(i,e){},endPrefixMapping:function(i){},processingInstruction:function(i,e){var t=this.doc.createProcessingInstruction(i,e);this.locator&&ki(this.locator,t),zr(this,t)},ignorableWhitespace:function(i,e,t){},characters:function(i,e,t){if(i=Bu.apply(this,arguments),i){if(this.cdata)var s=this.doc.createCDATASection(i);else var s=this.doc.createTextNode(i);this.currentElement?this.currentElement.appendChild(s):/^\s*$/.test(i)&&this.doc.appendChild(s),this.locator&&ki(this.locator,s)}},skippedEntity:function(i){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(i){(this.locator=i)&&(i.lineNumber=0)},comment:function(i,e,t){i=Bu.apply(this,arguments);var s=this.doc.createComment(i);this.locator&&ki(this.locator,s),zr(this,s)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(i,e,t){var s=this.doc.implementation;if(s&&s.createDocumentType){var r=s.createDocumentType(i,e,t);this.locator&&ki(this.locator,r),zr(this,r),this.doc.doctype=r}},warning:function(i){console.warn("[xmldom warning] "+i,za(this.locator))},error:function(i){console.error("[xmldom error] "+i,za(this.locator))},fatalError:function(i){throw new E1(i,this.locator)}};function za(i){if(i)return`
23
- @`+(i.systemId||"")+"#[line:"+i.lineNumber+",col:"+i.columnNumber+"]"}function Bu(i,e,t){return typeof i=="string"?i.substr(e,t):i.length>=e+t||e?new java.lang.String(i,e,t)+"":i}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(i){or.prototype[i]=function(){return null}});function zr(i,e){i.currentElement?i.currentElement.appendChild(e):i.doc.appendChild(e)}In.__DOMHandler=or;In.normalizeLineEndings=Id;In.DOMParser=Pd;var D1=In.DOMParser;/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const Fu=i=>!!i&&typeof i=="object",we=(...i)=>i.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(s=>{Array.isArray(e[s])&&Array.isArray(t[s])?e[s]=e[s].concat(t[s]):Fu(e[s])&&Fu(t[s])?e[s]=we(e[s],t[s]):e[s]=t[s]}),e),{}),Ld=i=>Object.keys(i).map(e=>i[e]),k1=(i,e)=>{const t=[];for(let s=i;s<e;s++)t.push(s);return t},Ki=i=>i.reduce((e,t)=>e.concat(t),[]),Od=i=>{if(!i.length)return[];const e=[];for(let t=0;t<i.length;t++)e.push(i[t]);return e},j1=(i,e)=>i.reduce((t,s,r)=>(s[e]&&t.push(r),t),[]),I1=(i,e)=>Ld(i.reduce((t,s)=>(s.forEach(r=>{t[e(r)]=r}),t),{}));var Qi={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const Js=({baseUrl:i="",source:e="",range:t="",indexRange:s=""})=>{const r={uri:e,resolvedUri:Dn(i||"",e)};if(t||s){const a=(t||s).split("-");let l=S.BigInt?S.BigInt(a[0]):parseInt(a[0],10),u=S.BigInt?S.BigInt(a[1]):parseInt(a[1],10);l<Number.MAX_SAFE_INTEGER&&typeof l=="bigint"&&(l=Number(l)),u<Number.MAX_SAFE_INTEGER&&typeof u=="bigint"&&(u=Number(u));let f;typeof u=="bigint"||typeof l=="bigint"?f=S.BigInt(u)-S.BigInt(l)+S.BigInt(1):f=u-l+1,typeof f=="bigint"&&f<Number.MAX_SAFE_INTEGER&&(f=Number(f)),r.byterange={length:f,offset:l}}return r},P1=i=>{let e;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=S.BigInt(i.offset)+S.BigInt(i.length)-S.BigInt(1):e=i.offset+i.length-1,`${i.offset}-${e}`},Uu=i=>(i&&typeof i!="number"&&(i=parseInt(i,10)),isNaN(i)?null:i),L1={static(i){const{duration:e,timescale:t=1,sourceDuration:s,periodDuration:r}=i,n=Uu(i.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:s/a}},dynamic(i){const{NOW:e,clientOffset:t,availabilityStartTime:s,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:l=0,timeShiftBufferDepth:u=1/0}=i,f=Uu(i.endNumber),m=(e+t)/1e3,v=s+a,E=m+l-v,A=Math.ceil(E*r/n),y=Math.floor((m-v-u)*r/n),k=Math.floor((m-v)*r/n);return{start:Math.max(0,y),end:typeof f=="number"?f:Math.min(A,k)}}},O1=i=>e=>{const{duration:t,timescale:s=1,periodStart:r,startNumber:n=1}=i;return{number:n+e,duration:t/s,timeline:r,time:e*t}},Lo=i=>{const{type:e,duration:t,timescale:s=1,periodDuration:r,sourceDuration:n}=i,{start:a,end:l}=L1[e](i),u=k1(a,l).map(O1(i));if(e==="static"){const f=u.length-1,m=typeof r=="number"?r:n;u[f].duration=m-t/s*f}return u},Md=i=>{const{baseUrl:e,initialization:t={},sourceDuration:s,indexRange:r="",periodStart:n,presentationTime:a,number:l=0,duration:u}=i;if(!e)throw new Error(Qi.NO_BASE_URL);const f=Js({baseUrl:e,source:t.sourceURL,range:t.range}),m=Js({baseUrl:e,source:e,indexRange:r});if(m.map=f,u){const v=Lo(i);v.length&&(m.duration=v[0].duration,m.timeline=v[0].timeline)}else s&&(m.duration=s,m.timeline=n);return m.presentationTime=a||n,m.number=l,[m]},Oo=(i,e,t)=>{const s=i.sidx.map?i.sidx.map:null,r=i.sidx.duration,n=i.timeline||0,a=i.sidx.byterange,l=a.offset+a.length,u=e.timescale,f=e.references.filter(k=>k.referenceType!==1),m=[],v=i.endList?"static":"dynamic",T=i.sidx.timeline;let E=T,A=i.mediaSequence||0,y;typeof e.firstOffset=="bigint"?y=S.BigInt(l)+e.firstOffset:y=l+e.firstOffset;for(let k=0;k<f.length;k++){const w=e.references[k],I=w.referencedSize,j=w.subsegmentDuration;let L;typeof y=="bigint"?L=y+S.BigInt(I)-S.BigInt(1):L=y+I-1;const O=`${y}-${L}`,B=Md({baseUrl:t,timescale:u,timeline:n,periodStart:T,presentationTime:E,number:A,duration:j,sourceDuration:r,indexRange:O,type:v})[0];s&&(B.map=s),m.push(B),typeof y=="bigint"?y+=S.BigInt(I):y+=I,E+=j/u,A++}return i.segments=m,i},M1=["AUDIO","SUBTITLES"],R1=1/60,Rd=i=>I1(i,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),N1=(i,e)=>{for(let t=0;t<i.length;t++)if(i[t].attributes.NAME===e)return i[t];return null},Vu=i=>{let e=[];return e1(i,M1,(t,s,r,n)=>{e=e.concat(t.playlists||[])}),e},Hu=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e,i.segments.forEach((t,s)=>{t.number=i.mediaSequence+s})},B1=({oldPlaylists:i,newPlaylists:e,timelineStarts:t})=>{e.forEach(s=>{s.discontinuitySequence=t.findIndex(function({timeline:u}){return u===s.timeline});const r=N1(i,s.attributes.NAME);if(!r||s.sidx)return;const n=s.segments[0],a=r.segments.findIndex(function(u){return Math.abs(u.presentationTime-n.presentationTime)<R1});if(a===-1){Hu({playlist:s,mediaSequence:r.mediaSequence+r.segments.length}),s.segments[0].discontinuity=!0,s.discontinuityStarts.unshift(0),(!r.segments.length&&s.timeline>r.timeline||r.segments.length&&s.timeline>r.segments[r.segments.length-1].timeline)&&s.discontinuitySequence--;return}r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,s.discontinuityStarts.unshift(0),s.discontinuitySequence--),Hu({playlist:s,mediaSequence:r.segments[a].number})})},F1=({oldManifest:i,newManifest:e})=>{const t=i.playlists.concat(Vu(i)),s=e.playlists.concat(Vu(e));return e.timelineStarts=Rd([i.timelineStarts,e.timelineStarts]),B1({oldPlaylists:t,newPlaylists:s,timelineStarts:e.timelineStarts}),e},Pn=i=>i&&i.uri+"-"+P1(i.byterange),Ea=i=>{const e=i.reduce(function(s,r){return s[r.attributes.baseUrl]||(s[r.attributes.baseUrl]=[]),s[r.attributes.baseUrl].push(r),s},{});let t=[];return Object.values(e).forEach(s=>{const r=Ld(s.reduce((n,a)=>{const l=a.attributes.id+(a.attributes.lang||"");return n[l]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[l].segments.push(...a.segments)),a.attributes.contentProtection&&(n[l].attributes.contentProtection=a.attributes.contentProtection)):(n[l]=a,n[l].attributes.timelineStarts=[]),n[l].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(s=>(s.discontinuityStarts=j1(s.segments||[],"discontinuity"),s))},Mo=(i,e)=>{const t=Pn(i.sidx),s=t&&e[t]&&e[t].sidx;return s&&Oo(i,s,i.sidx.resolvedUri),i},U1=(i,e={})=>{if(!Object.keys(e).length)return i;for(const t in i)i[t]=Mo(i[t],e);return i},V1=({attributes:i,segments:e,sidx:t,mediaSequence:s,discontinuitySequence:r,discontinuityStarts:n},a)=>{const l={attributes:{NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:i.timelineStarts,mediaSequence:s,segments:e};return i.contentProtection&&(l.contentProtection=i.contentProtection),i.serviceLocation&&(l.attributes.serviceLocation=i.serviceLocation),t&&(l.sidx=t),a&&(l.attributes.AUDIO="audio",l.attributes.SUBTITLES="subs"),l},H1=({attributes:i,segments:e,mediaSequence:t,discontinuityStarts:s,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);const n={NAME:i.id,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1};i.codecs&&(n.CODECS=i.codecs);const a={attributes:n,uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:s,discontinuitySequence:r,mediaSequence:t,segments:e};return i.serviceLocation&&(a.attributes.serviceLocation=i.serviceLocation),a},q1=(i,e={},t=!1)=>{let s;const r=i.reduce((n,a)=>{const l=a.attributes.role&&a.attributes.role.value||"",u=a.attributes.lang||"";let f=a.attributes.label||"main";if(u&&!a.attributes.label){const v=l?` (${l})`:"";f=`${a.attributes.lang}${v}`}n[f]||(n[f]={language:u,autoselect:!0,default:l==="main",playlists:[],uri:""});const m=Mo(V1(a,t),e);return n[f].playlists.push(m),typeof s>"u"&&l==="main"&&(s=a,s.default=!0),n},{});if(!s){const n=Object.keys(r)[0];r[n].default=!0}return r},z1=(i,e={})=>i.reduce((t,s)=>{const r=s.attributes.label||s.attributes.lang||"text",n=s.attributes.lang||"und";return t[r]||(t[r]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(Mo(H1(s),e)),t},{}),$1=i=>i.reduce((e,t)=>(t&&t.forEach(s=>{const{channel:r,language:n}=s;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},s.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=s.aspectRatio),s.hasOwnProperty("easyReader")&&(e[n].easyReader=s.easyReader),s.hasOwnProperty("3D")&&(e[n]["3D"]=s["3D"])}),e),{}),G1=({attributes:i,segments:e,sidx:t,discontinuityStarts:s})=>{const r={attributes:{NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuityStarts:s,timelineStarts:i.timelineStarts,segments:e};return i.frameRate&&(r.attributes["FRAME-RATE"]=i.frameRate),i.contentProtection&&(r.contentProtection=i.contentProtection),i.serviceLocation&&(r.attributes.serviceLocation=i.serviceLocation),t&&(r.sidx=t),r},W1=({attributes:i})=>i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video",X1=({attributes:i})=>i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio",Y1=({attributes:i})=>i.mimeType==="text/vtt"||i.contentType==="text",K1=(i,e)=>{i.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:s}){return s===t.timeline}),t.segments&&t.segments.forEach((s,r)=>{s.number=r})})},qu=i=>i?Object.keys(i).reduce((e,t)=>{const s=i[t];return e.concat(s.playlists)},[]):[],Q1=({dashPlaylists:i,locations:e,contentSteering:t,sidxMapping:s={},previousManifest:r,eventStream:n})=>{if(!i.length)return{};const{sourceDuration:a,type:l,suggestedPresentationDelay:u,minimumUpdatePeriod:f}=i[0].attributes,m=Ea(i.filter(W1)).map(G1),v=Ea(i.filter(X1)),T=Ea(i.filter(Y1)),E=i.map(L=>L.attributes.captionServices).filter(Boolean),A={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:U1(m,s)};f>=0&&(A.minimumUpdatePeriod=f*1e3),e&&(A.locations=e),t&&(A.contentSteering=t),l==="dynamic"&&(A.suggestedPresentationDelay=u),n&&n.length>0&&(A.eventStream=n);const y=A.playlists.length===0,k=v.length?q1(v,s,y):null,w=T.length?z1(T,s):null,I=m.concat(qu(k),qu(w)),j=I.map(({timelineStarts:L})=>L);return A.timelineStarts=Rd(j),K1(I,A.timelineStarts),k&&(A.mediaGroups.AUDIO.audio=k),w&&(A.mediaGroups.SUBTITLES.subs=w),E.length&&(A.mediaGroups["CLOSED-CAPTIONS"].cc=$1(E)),r?F1({oldManifest:r,newManifest:A}):A},J1=(i,e,t)=>{const{NOW:s,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:l=0,minimumUpdatePeriod:u=0}=i,f=(s+r)/1e3,m=n+l,T=f+u-m;return Math.ceil((T*a-e)/t)},Nd=(i,e)=>{const{type:t,minimumUpdatePeriod:s=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:l=1,periodStart:u}=i,f=[];let m=-1;for(let v=0;v<e.length;v++){const T=e[v],E=T.d,A=T.r||0,y=T.t||0;m<0&&(m=y),y&&y>m&&(m=y);let k;if(A<0){const j=v+1;j===e.length?t==="dynamic"&&s>0&&r.indexOf("$Number$")>0?k=J1(i,m,E):k=(n*a-m)/E:k=(e[j].t-m)/E}else k=A+1;const w=l+f.length+k;let I=l+f.length;for(;I<w;)f.push({number:I,duration:E/a,time:m,timeline:u}),m+=E,I++}return f},Z1=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,e2=i=>(e,t,s,r)=>{if(e==="$$")return"$";if(typeof i[t]>"u")return e;const n=""+i[t];return t==="RepresentationID"||(s?r=parseInt(r,10):r=1,n.length>=r)?n:`${new Array(r-n.length+1).join("0")}${n}`},zu=(i,e)=>i.replace(Z1,e2(e)),t2=(i,e)=>!i.duration&&!e?[{number:i.startNumber||1,duration:i.sourceDuration,time:0,timeline:i.periodStart}]:i.duration?Lo(i):Nd(i,e),i2=(i,e)=>{const t={RepresentationID:i.id,Bandwidth:i.bandwidth||0},{initialization:s={sourceURL:"",range:""}}=i,r=Js({baseUrl:i.baseUrl,source:zu(s.sourceURL,t),range:s.range});return t2(i,e).map(a=>{t.Number=a.number,t.Time=a.time;const l=zu(i.media||"",t),u=i.timescale||1,f=i.presentationTimeOffset||0,m=i.periodStart+(a.time-f)/u;return{uri:l,timeline:a.timeline,duration:a.duration,resolvedUri:Dn(i.baseUrl||"",l),map:r,number:a.number,presentationTime:m}})},s2=(i,e)=>{const{baseUrl:t,initialization:s={}}=i,r=Js({baseUrl:t,source:s.sourceURL,range:s.range}),n=Js({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},r2=(i,e)=>{const{duration:t,segmentUrls:s=[],periodStart:r}=i;if(!t&&!e||t&&e)throw new Error(Qi.SEGMENT_TIME_UNSPECIFIED);const n=s.map(u=>s2(i,u));let a;return t&&(a=Lo(i)),e&&(a=Nd(i,e)),a.map((u,f)=>{if(n[f]){const m=n[f],v=i.timescale||1,T=i.presentationTimeOffset||0;return m.timeline=u.timeline,m.duration=u.duration,m.number=u.number,m.presentationTime=r+(u.time-T)/v,m}}).filter(u=>u)},n2=({attributes:i,segmentInfo:e})=>{let t,s;e.template?(s=i2,t=we(i,e.template)):e.base?(s=Md,t=we(i,e.base)):e.list&&(s=r2,t=we(i,e.list));const r={attributes:i};if(!s)return r;const n=s(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:l=1}=t;t.duration=a/l}else n.length?t.duration=n.reduce((a,l)=>Math.max(a,Math.ceil(l.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},a2=i=>i.map(n2),me=(i,e)=>Od(i.childNodes).filter(({tagName:t})=>t===e),lr=i=>i.textContent.trim(),o2=i=>parseFloat(i.split("/").reduce((e,t)=>e/t)),ji=i=>{const l=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(i);if(!l)return 0;const[u,f,m,v,T,E]=l.slice(1);return parseFloat(u||0)*31536e3+parseFloat(f||0)*2592e3+parseFloat(m||0)*86400+parseFloat(v||0)*3600+parseFloat(T||0)*60+parseFloat(E||0)},l2=i=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(i)&&(i+="Z"),Date.parse(i)),$u={mediaPresentationDuration(i){return ji(i)},availabilityStartTime(i){return l2(i)/1e3},minimumUpdatePeriod(i){return ji(i)},suggestedPresentationDelay(i){return ji(i)},type(i){return i},timeShiftBufferDepth(i){return ji(i)},start(i){return ji(i)},width(i){return parseInt(i,10)},height(i){return parseInt(i,10)},bandwidth(i){return parseInt(i,10)},frameRate(i){return o2(i)},startNumber(i){return parseInt(i,10)},timescale(i){return parseInt(i,10)},presentationTimeOffset(i){return parseInt(i,10)},duration(i){const e=parseInt(i,10);return isNaN(e)?ji(i):e},d(i){return parseInt(i,10)},t(i){return parseInt(i,10)},r(i){return parseInt(i,10)},presentationTime(i){return parseInt(i,10)},DEFAULT(i){return i}},Ce=i=>i&&i.attributes?Od(i.attributes).reduce((e,t)=>{const s=$u[t.name]||$u.DEFAULT;return e[t.name]=s(t.value),e},{}):{},u2={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},Ln=(i,e)=>e.length?Ki(i.map(function(t){return e.map(function(s){const r=lr(s),n=Dn(t.baseUrl,r),a=we(Ce(s),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):i,Ro=i=>{const e=me(i,"SegmentTemplate")[0],t=me(i,"SegmentList")[0],s=t&&me(t,"SegmentURL").map(v=>we({tag:"SegmentURL"},Ce(v))),r=me(i,"SegmentBase")[0],n=t||e,a=n&&me(n,"SegmentTimeline")[0],l=t||r||e,u=l&&me(l,"Initialization")[0],f=e&&Ce(e);f&&u?f.initialization=u&&Ce(u):f&&f.initialization&&(f.initialization={sourceURL:f.initialization});const m={template:f,segmentTimeline:a&&me(a,"S").map(v=>Ce(v)),list:t&&we(Ce(t),{segmentUrls:s,initialization:Ce(u)}),base:r&&we(Ce(r),{initialization:Ce(u)})};return Object.keys(m).forEach(v=>{m[v]||delete m[v]}),m},c2=(i,e,t)=>s=>{const r=me(s,"BaseURL"),n=Ln(e,r),a=we(i,Ce(s)),l=Ro(s);return n.map(u=>({segmentInfo:we(t,l),attributes:we(a,u)}))},d2=i=>i.reduce((e,t)=>{const s=Ce(t);s.schemeIdUri&&(s.schemeIdUri=s.schemeIdUri.toLowerCase());const r=u2[s.schemeIdUri];if(r){e[r]={attributes:s};const n=me(t,"cenc:pssh")[0];if(n){const a=lr(n);e[r].pssh=a&&Jc(a)}}return e},{}),h2=i=>{if(i.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{let s,r;return r=t,/^CC\d=/.test(t)?[s,r]=t.split("="):/^CC\d$/.test(t)&&(s=t),{channel:s,language:r}});if(i.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{const s={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[r,n=""]=t.split("=");s.channel=r,s.language=t,n.split(",").forEach(a=>{const[l,u]=a.split(":");l==="lang"?s.language=u:l==="er"?s.easyReader=Number(u):l==="war"?s.aspectRatio=Number(u):l==="3D"&&(s["3D"]=Number(u))})}else s.language=t;return s.channel&&(s.channel="SERVICE"+s.channel),s})},f2=i=>Ki(me(i.node,"EventStream").map(e=>{const t=Ce(e),s=t.schemeIdUri;return me(e,"Event").map(r=>{const n=Ce(r),a=n.presentationTime||0,l=t.timescale||1,u=n.duration||0,f=a/l+i.attributes.start;return{schemeIdUri:s,value:t.value,id:n.id,start:f,end:f+u/l,messageData:lr(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),p2=(i,e,t)=>s=>{const r=Ce(s),n=Ln(e,me(s,"BaseURL")),a=me(s,"Role")[0],l={role:Ce(a)};let u=we(i,r,l);const f=me(s,"Accessibility")[0],m=h2(Ce(f));m&&(u=we(u,{captionServices:m}));const v=me(s,"Label")[0];if(v&&v.childNodes.length){const k=v.childNodes[0].nodeValue.trim();u=we(u,{label:k})}const T=d2(me(s,"ContentProtection"));Object.keys(T).length&&(u=we(u,{contentProtection:T}));const E=Ro(s),A=me(s,"Representation"),y=we(t,E);return Ki(A.map(c2(u,n,y)))},m2=(i,e)=>(t,s)=>{const r=Ln(e,me(t.node,"BaseURL")),n=we(i,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=me(t.node,"AdaptationSet"),l=Ro(t.node);return Ki(a.map(p2(n,r,l)))},g2=(i,e)=>{if(i.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!i.length)return null;const t=we({serverURL:lr(i[0])},Ce(i[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},v2=({attributes:i,priorPeriodAttributes:e,mpdType:t})=>typeof i.start=="number"?i.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,y2=(i,e={})=>{const{manifestUri:t="",NOW:s=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=me(i,"Period");if(!a.length)throw new Error(Qi.INVALID_NUMBER_OF_PERIOD);const l=me(i,"Location"),u=Ce(i),f=Ln([{baseUrl:t}],me(i,"BaseURL")),m=me(i,"ContentSteering");u.type=u.type||"static",u.sourceDuration=u.mediaPresentationDuration||0,u.NOW=s,u.clientOffset=r,l.length&&(u.locations=l.map(lr));const v=[];return a.forEach((T,E)=>{const A=Ce(T),y=v[E-1];A.start=v2({attributes:A,priorPeriodAttributes:y?y.attributes:null,mpdType:u.type}),v.push({node:T,attributes:A})}),{locations:u.locations,contentSteeringInfo:g2(m,n),representationInfo:Ki(v.map(m2(u,f))),eventStream:Ki(v.map(f2))}},Bd=i=>{if(i==="")throw new Error(Qi.DASH_EMPTY_MANIFEST);const e=new D1;let t,s;try{t=e.parseFromString(i,"application/xml"),s=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!s||s&&s.getElementsByTagName("parsererror").length>0)throw new Error(Qi.DASH_INVALID_XML);return s},_2=i=>{const e=me(i,"UTCTiming")[0];if(!e)return null;const t=Ce(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(Qi.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},b2=(i,e={})=>{const t=y2(Bd(i),e),s=a2(t.representationInfo);return Q1({dashPlaylists:s,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},T2=i=>_2(Bd(i));var x2=Math.pow(2,32),S2=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t;return e.getBigUint64?(t=e.getBigUint64(0),t<Number.MAX_SAFE_INTEGER?Number(t):t):e.getUint32(0)*x2+e.getUint32(4)},C2={getUint64:S2},Gu=C2.getUint64,E2=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t={version:i[0],flags:new Uint8Array(i.subarray(1,4)),references:[],referenceId:e.getUint32(4),timescale:e.getUint32(8)},s=12;t.version===0?(t.earliestPresentationTime=e.getUint32(s),t.firstOffset=e.getUint32(s+4),s+=8):(t.earliestPresentationTime=Gu(i.subarray(s)),t.firstOffset=Gu(i.subarray(s+8)),s+=16),s+=2;var r=e.getUint16(s);for(s+=2;r>0;s+=12,r--)t.references.push({referenceType:(i[s]&128)>>>7,referencedSize:e.getUint32(s)&2147483647,subsegmentDuration:e.getUint32(s+4),startsWithSap:!!(i[s+8]&128),sapType:(i[s+8]&112)>>>4,sapDeltaTime:e.getUint32(s+8)&268435455});return t},A2=E2;const w2=sr(A2);var D2=G([73,68,51]),k2=function(e,t){t===void 0&&(t=0),e=G(e);var s=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(s&16)>>4;return n?r+20:r+10},Fs=function i(e,t){return t===void 0&&(t=0),e=G(e),e.length-t<10||!pe(e,D2,{offset:t})?t:(t+=k2(e,t),i(e,t))},Wu=function(e){return typeof e=="string"?sd(e):e},j2=function(e){return Array.isArray(e)?e.map(function(t){return Wu(t)}):[Wu(e)]},I2=function i(e,t,s){s===void 0&&(s=!1),t=j2(t),e=G(e);var r=[];if(!t.length)return r;for(var n=0;n<e.length;){var a=(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0,l=e.subarray(n+4,n+8);if(a===0)break;var u=n+a;if(u>e.length){if(s)break;u=e.length}var f=e.subarray(n+8,u);pe(l,t[0])&&(t.length===1?r.push(f):r.push.apply(r,i(f,t.slice(1),s))),n=u}return r},$r={EBML:G([26,69,223,163]),DocType:G([66,130]),Segment:G([24,83,128,103]),SegmentInfo:G([21,73,169,102]),Tracks:G([22,84,174,107]),Track:G([174]),TrackNumber:G([215]),DefaultDuration:G([35,227,131]),TrackEntry:G([174]),TrackType:G([131]),FlagDefault:G([136]),CodecID:G([134]),CodecPrivate:G([99,162]),VideoTrack:G([224]),AudioTrack:G([225]),Cluster:G([31,67,182,117]),Timestamp:G([231]),TimestampScale:G([42,215,177]),BlockGroup:G([160]),BlockDuration:G([155]),Block:G([161]),SimpleBlock:G([163])},$a=[128,64,32,16,8,4,2,1],P2=function(e){for(var t=1,s=0;s<$a.length&&!(e&$a[s]);s++)t++;return t},an=function(e,t,s,r){s===void 0&&(s=!0),r===void 0&&(r=!1);var n=P2(e[t]),a=e.subarray(t,t+n);return s&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=$a[n-1]),{length:n,value:Qg(a,{signed:r}),bytes:a}},Xu=function i(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return i(t)}):typeof e=="number"?Jg(e):e},L2=function(e){return Array.isArray(e)?e.map(function(t){return Xu(t)}):[Xu(e)]},O2=function i(e,t,s){if(s>=t.length)return t.length;var r=an(t,s,!1);if(pe(e.bytes,r.bytes))return s;var n=an(t,s+r.length);return i(e,t,s+n.length+n.value+r.length)},Yu=function i(e,t){t=L2(t),e=G(e);var s=[];if(!t.length)return s;for(var r=0;r<e.length;){var n=an(e,r,!1),a=an(e,r+n.length),l=r+n.length+a.length;a.value===127&&(a.value=O2(n,e,l),a.value!==e.length&&(a.value-=l));var u=l+a.value>e.length?e.length:l+a.value,f=e.subarray(l,u);pe(t[0],n.bytes)&&(t.length===1?s.push(f):s=s.concat(i(f,t.slice(1))));var m=n.length+a.length+f.length;r+=m}return s},M2=G([0,0,0,1]),R2=G([0,0,1]),N2=G([0,0,3]),B2=function(e){for(var t=[],s=1;s<e.length-2;)pe(e.subarray(s,s+3),N2)&&(t.push(s+2),s++),s++;if(t.length===0)return e;var r=e.length-t.length,n=new Uint8Array(r),a=0;for(s=0;s<r;a++,s++)a===t[0]&&(a++,t.shift()),n[s]=e[a];return n},Fd=function(e,t,s,r){e=G(e),s=[].concat(s);for(var n=0,a,l=0;n<e.length&&(l<r||a);){var u=void 0;if(pe(e.subarray(n),M2)?u=4:pe(e.subarray(n),R2)&&(u=3),!u){n++;continue}if(l++,a)return B2(e.subarray(a,n));var f=void 0;t==="h264"?f=e[n+u]&31:t==="h265"&&(f=e[n+u]>>1&63),s.indexOf(f)!==-1&&(a=n+u),n+=u+(t==="h264"?1:2)}return e.subarray(0,0)},F2=function(e,t,s){return Fd(e,"h264",t,s)},U2=function(e,t,s){return Fd(e,"h265",t,s)},Be={webm:G([119,101,98,109]),matroska:G([109,97,116,114,111,115,107,97]),flac:G([102,76,97,67]),ogg:G([79,103,103,83]),ac3:G([11,119]),riff:G([82,73,70,70]),avi:G([65,86,73]),wav:G([87,65,86,69]),"3gp":G([102,116,121,112,51,103]),mp4:G([102,116,121,112]),fmp4:G([115,116,121,112]),mov:G([102,116,121,112,113,116]),moov:G([109,111,111,118]),moof:G([109,111,111,102])},Ji={aac:function(e){var t=Fs(e);return pe(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Fs(e);return pe(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=Yu(e,[$r.EBML,$r.DocType])[0];return pe(t,Be.webm)},mkv:function(e){var t=Yu(e,[$r.EBML,$r.DocType])[0];return pe(t,Be.matroska)},mp4:function(e){if(Ji["3gp"](e)||Ji.mov(e))return!1;if(pe(e,Be.mp4,{offset:4})||pe(e,Be.fmp4,{offset:4})||pe(e,Be.moof,{offset:4})||pe(e,Be.moov,{offset:4}))return!0},mov:function(e){return pe(e,Be.mov,{offset:4})},"3gp":function(e){return pe(e,Be["3gp"],{offset:4})},ac3:function(e){var t=Fs(e);return pe(e,Be.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+188<e.length&&t<188;){if(e[t]===71&&e[t+188]===71)return!0;t+=1}return!1},flac:function(e){var t=Fs(e);return pe(e,Be.flac,{offset:t})},ogg:function(e){return pe(e,Be.ogg)},avi:function(e){return pe(e,Be.riff)&&pe(e,Be.avi,{offset:8})},wav:function(e){return pe(e,Be.riff)&&pe(e,Be.wav,{offset:8})},h264:function(e){return F2(e,7,3).length},h265:function(e){return U2(e,[32,33],3).length}},Ga=Object.keys(Ji).filter(function(i){return i!=="ts"&&i!=="h264"&&i!=="h265"}).concat(["ts","h264","h265"]);Ga.forEach(function(i){var e=Ji[i];Ji[i]=function(t){return e(G(t))}});var V2=Ji,No=function(e){e=G(e);for(var t=0;t<Ga.length;t++){var s=Ga[t];if(V2[s](e))return s}return""},H2=function(e){return I2(e,["moof"]).length>0},di={};/**
22
+ `)}function kd(i){this.options=i||{locator:{}}}kd.prototype.parseFromString=function(i,e){var t=this.options,s=new _1,r=t.domBuilder||new ar,n=t.errorHandler,a=t.locator,l=t.xmlns||{},u=/\/x?html?$/.test(e),f=u?Ou.HTML_ENTITIES:Ou.XML_ENTITIES;a&&r.setDocumentLocator(a),s.errorHandler=b1(n,r,a),s.domBuilder=t.domBuilder||r,u&&(l[""]=Mu.HTML),l.xml=l.xml||Mu.XML;var m=t.normalizeLineEndings||Dd;return i&&typeof i=="string"?s.parse(m(i),l,f):s.errorHandler.error("invalid doc source"),r.doc};function b1(i,e,t){if(!i){if(e instanceof ar)return e;i=e}var s={},r=i instanceof Function;t=t||{};function n(a){var l=i[a];!l&&r&&(l=i.length==2?function(u){i(a,u)}:i),s[a]=l&&function(u){l("[xmldom "+a+"] "+u+Ha(t))}||function(){}}return n("warning"),n("error"),n("fatalError"),s}function ar(){this.cdata=!1}function ki(i,e){e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber}ar.prototype={startDocument:function(){this.doc=new v1().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(i,e,t,s){var r=this.doc,n=r.createElementNS(i,t||e),a=s.length;qr(this,n),this.currentElement=n,this.locator&&ki(this.locator,n);for(var l=0;l<a;l++){var i=s.getURI(l),u=s.getValue(l),t=s.getQName(l),f=r.createAttributeNS(i,t);this.locator&&ki(s.getLocator(l),f),f.value=f.nodeValue=u,n.setAttributeNode(f)}},endElement:function(i,e,t){var s=this.currentElement;s.tagName,this.currentElement=s.parentNode},startPrefixMapping:function(i,e){},endPrefixMapping:function(i){},processingInstruction:function(i,e){var t=this.doc.createProcessingInstruction(i,e);this.locator&&ki(this.locator,t),qr(this,t)},ignorableWhitespace:function(i,e,t){},characters:function(i,e,t){if(i=Ru.apply(this,arguments),i){if(this.cdata)var s=this.doc.createCDATASection(i);else var s=this.doc.createTextNode(i);this.currentElement?this.currentElement.appendChild(s):/^\s*$/.test(i)&&this.doc.appendChild(s),this.locator&&ki(this.locator,s)}},skippedEntity:function(i){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(i){(this.locator=i)&&(i.lineNumber=0)},comment:function(i,e,t){i=Ru.apply(this,arguments);var s=this.doc.createComment(i);this.locator&&ki(this.locator,s),qr(this,s)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(i,e,t){var s=this.doc.implementation;if(s&&s.createDocumentType){var r=s.createDocumentType(i,e,t);this.locator&&ki(this.locator,r),qr(this,r),this.doc.doctype=r}},warning:function(i){console.warn("[xmldom warning] "+i,Ha(this.locator))},error:function(i){console.error("[xmldom error] "+i,Ha(this.locator))},fatalError:function(i){throw new y1(i,this.locator)}};function Ha(i){if(i)return`
23
+ @`+(i.systemId||"")+"#[line:"+i.lineNumber+",col:"+i.columnNumber+"]"}function Ru(i,e,t){return typeof i=="string"?i.substr(e,t):i.length>=e+t||e?new java.lang.String(i,e,t)+"":i}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(i){ar.prototype[i]=function(){return null}});function qr(i,e){i.currentElement?i.currentElement.appendChild(e):i.doc.appendChild(e)}kn.__DOMHandler=ar;kn.normalizeLineEndings=Dd;kn.DOMParser=kd;var T1=kn.DOMParser;/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const Nu=i=>!!i&&typeof i=="object",De=(...i)=>i.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(s=>{Array.isArray(e[s])&&Array.isArray(t[s])?e[s]=e[s].concat(t[s]):Nu(e[s])&&Nu(t[s])?e[s]=De(e[s],t[s]):e[s]=t[s]}),e),{}),jd=i=>Object.keys(i).map(e=>i[e]),x1=(i,e)=>{const t=[];for(let s=i;s<e;s++)t.push(s);return t},Ki=i=>i.reduce((e,t)=>e.concat(t),[]),Id=i=>{if(!i.length)return[];const e=[];for(let t=0;t<i.length;t++)e.push(i[t]);return e},S1=(i,e)=>i.reduce((t,s,r)=>(s[e]&&t.push(r),t),[]),C1=(i,e)=>jd(i.reduce((t,s)=>(s.forEach(r=>{t[e(r)]=r}),t),{}));var Qi={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const Js=({baseUrl:i="",source:e="",range:t="",indexRange:s=""})=>{const r={uri:e,resolvedUri:An(i||"",e)};if(t||s){const a=(t||s).split("-");let l=S.BigInt?S.BigInt(a[0]):parseInt(a[0],10),u=S.BigInt?S.BigInt(a[1]):parseInt(a[1],10);l<Number.MAX_SAFE_INTEGER&&typeof l=="bigint"&&(l=Number(l)),u<Number.MAX_SAFE_INTEGER&&typeof u=="bigint"&&(u=Number(u));let f;typeof u=="bigint"||typeof l=="bigint"?f=S.BigInt(u)-S.BigInt(l)+S.BigInt(1):f=u-l+1,typeof f=="bigint"&&f<Number.MAX_SAFE_INTEGER&&(f=Number(f)),r.byterange={length:f,offset:l}}return r},E1=i=>{let e;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=S.BigInt(i.offset)+S.BigInt(i.length)-S.BigInt(1):e=i.offset+i.length-1,`${i.offset}-${e}`},Bu=i=>(i&&typeof i!="number"&&(i=parseInt(i,10)),isNaN(i)?null:i),A1={static(i){const{duration:e,timescale:t=1,sourceDuration:s,periodDuration:r}=i,n=Bu(i.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:s/a}},dynamic(i){const{NOW:e,clientOffset:t,availabilityStartTime:s,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:l=0,timeShiftBufferDepth:u=1/0}=i,f=Bu(i.endNumber),m=(e+t)/1e3,v=s+a,E=m+l-v,A=Math.ceil(E*r/n),y=Math.floor((m-v-u)*r/n),k=Math.floor((m-v)*r/n);return{start:Math.max(0,y),end:typeof f=="number"?f:Math.min(A,k)}}},w1=i=>e=>{const{duration:t,timescale:s=1,periodStart:r,startNumber:n=1}=i;return{number:n+e,duration:t/s,timeline:r,time:e*t}},Io=i=>{const{type:e,duration:t,timescale:s=1,periodDuration:r,sourceDuration:n}=i,{start:a,end:l}=A1[e](i),u=x1(a,l).map(w1(i));if(e==="static"){const f=u.length-1,m=typeof r=="number"?r:n;u[f].duration=m-t/s*f}return u},Pd=i=>{const{baseUrl:e,initialization:t={},sourceDuration:s,indexRange:r="",periodStart:n,presentationTime:a,number:l=0,duration:u}=i;if(!e)throw new Error(Qi.NO_BASE_URL);const f=Js({baseUrl:e,source:t.sourceURL,range:t.range}),m=Js({baseUrl:e,source:e,indexRange:r});if(m.map=f,u){const v=Io(i);v.length&&(m.duration=v[0].duration,m.timeline=v[0].timeline)}else s&&(m.duration=s,m.timeline=n);return m.presentationTime=a||n,m.number=l,[m]},Po=(i,e,t)=>{const s=i.sidx.map?i.sidx.map:null,r=i.sidx.duration,n=i.timeline||0,a=i.sidx.byterange,l=a.offset+a.length,u=e.timescale,f=e.references.filter(k=>k.referenceType!==1),m=[],v=i.endList?"static":"dynamic",T=i.sidx.timeline;let E=T,A=i.mediaSequence||0,y;typeof e.firstOffset=="bigint"?y=S.BigInt(l)+e.firstOffset:y=l+e.firstOffset;for(let k=0;k<f.length;k++){const w=e.references[k],I=w.referencedSize,j=w.subsegmentDuration;let L;typeof y=="bigint"?L=y+S.BigInt(I)-S.BigInt(1):L=y+I-1;const O=`${y}-${L}`,B=Pd({baseUrl:t,timescale:u,timeline:n,periodStart:T,presentationTime:E,number:A,duration:j,sourceDuration:r,indexRange:O,type:v})[0];s&&(B.map=s),m.push(B),typeof y=="bigint"?y+=S.BigInt(I):y+=I,E+=j/u,A++}return i.segments=m,i},D1=["AUDIO","SUBTITLES"],k1=1/60,Ld=i=>C1(i,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),j1=(i,e)=>{for(let t=0;t<i.length;t++)if(i[t].attributes.NAME===e)return i[t];return null},Fu=i=>{let e=[];return Wg(i,D1,(t,s,r,n)=>{e=e.concat(t.playlists||[])}),e},Uu=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e,i.segments.forEach((t,s)=>{t.number=i.mediaSequence+s})},I1=({oldPlaylists:i,newPlaylists:e,timelineStarts:t})=>{e.forEach(s=>{s.discontinuitySequence=t.findIndex(function({timeline:u}){return u===s.timeline});const r=j1(i,s.attributes.NAME);if(!r||s.sidx)return;const n=s.segments[0],a=r.segments.findIndex(function(u){return Math.abs(u.presentationTime-n.presentationTime)<k1});if(a===-1){Uu({playlist:s,mediaSequence:r.mediaSequence+r.segments.length}),s.segments[0].discontinuity=!0,s.discontinuityStarts.unshift(0),(!r.segments.length&&s.timeline>r.timeline||r.segments.length&&s.timeline>r.segments[r.segments.length-1].timeline)&&s.discontinuitySequence--;return}r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,s.discontinuityStarts.unshift(0),s.discontinuitySequence--),Uu({playlist:s,mediaSequence:r.segments[a].number})})},P1=({oldManifest:i,newManifest:e})=>{const t=i.playlists.concat(Fu(i)),s=e.playlists.concat(Fu(e));return e.timelineStarts=Ld([i.timelineStarts,e.timelineStarts]),I1({oldPlaylists:t,newPlaylists:s,timelineStarts:e.timelineStarts}),e},jn=i=>i&&i.uri+"-"+E1(i.byterange),Sa=i=>{const e=i.reduce(function(s,r){return s[r.attributes.baseUrl]||(s[r.attributes.baseUrl]=[]),s[r.attributes.baseUrl].push(r),s},{});let t=[];return Object.values(e).forEach(s=>{const r=jd(s.reduce((n,a)=>{const l=a.attributes.id+(a.attributes.lang||"");return n[l]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[l].segments.push(...a.segments)),a.attributes.contentProtection&&(n[l].attributes.contentProtection=a.attributes.contentProtection)):(n[l]=a,n[l].attributes.timelineStarts=[]),n[l].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(s=>(s.discontinuityStarts=S1(s.segments||[],"discontinuity"),s))},Lo=(i,e)=>{const t=jn(i.sidx),s=t&&e[t]&&e[t].sidx;return s&&Po(i,s,i.sidx.resolvedUri),i},L1=(i,e={})=>{if(!Object.keys(e).length)return i;for(const t in i)i[t]=Lo(i[t],e);return i},O1=({attributes:i,segments:e,sidx:t,mediaSequence:s,discontinuitySequence:r,discontinuityStarts:n},a)=>{const l={attributes:{NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:i.timelineStarts,mediaSequence:s,segments:e};return i.contentProtection&&(l.contentProtection=i.contentProtection),i.serviceLocation&&(l.attributes.serviceLocation=i.serviceLocation),t&&(l.sidx=t),a&&(l.attributes.AUDIO="audio",l.attributes.SUBTITLES="subs"),l},M1=({attributes:i,segments:e,mediaSequence:t,discontinuityStarts:s,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);const n={NAME:i.id,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1};i.codecs&&(n.CODECS=i.codecs);const a={attributes:n,uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:s,discontinuitySequence:r,mediaSequence:t,segments:e};return i.serviceLocation&&(a.attributes.serviceLocation=i.serviceLocation),a},R1=(i,e={},t=!1)=>{let s;const r=i.reduce((n,a)=>{const l=a.attributes.role&&a.attributes.role.value||"",u=a.attributes.lang||"";let f=a.attributes.label||"main";if(u&&!a.attributes.label){const v=l?` (${l})`:"";f=`${a.attributes.lang}${v}`}n[f]||(n[f]={language:u,autoselect:!0,default:l==="main",playlists:[],uri:""});const m=Lo(O1(a,t),e);return n[f].playlists.push(m),typeof s>"u"&&l==="main"&&(s=a,s.default=!0),n},{});if(!s){const n=Object.keys(r)[0];r[n].default=!0}return r},N1=(i,e={})=>i.reduce((t,s)=>{const r=s.attributes.label||s.attributes.lang||"text",n=s.attributes.lang||"und";return t[r]||(t[r]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(Lo(M1(s),e)),t},{}),B1=i=>i.reduce((e,t)=>(t&&t.forEach(s=>{const{channel:r,language:n}=s;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},s.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=s.aspectRatio),s.hasOwnProperty("easyReader")&&(e[n].easyReader=s.easyReader),s.hasOwnProperty("3D")&&(e[n]["3D"]=s["3D"])}),e),{}),F1=({attributes:i,segments:e,sidx:t,discontinuityStarts:s})=>{const r={attributes:{NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuityStarts:s,timelineStarts:i.timelineStarts,segments:e};return i.frameRate&&(r.attributes["FRAME-RATE"]=i.frameRate),i.contentProtection&&(r.contentProtection=i.contentProtection),i.serviceLocation&&(r.attributes.serviceLocation=i.serviceLocation),t&&(r.sidx=t),r},U1=({attributes:i})=>i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video",V1=({attributes:i})=>i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio",H1=({attributes:i})=>i.mimeType==="text/vtt"||i.contentType==="text",q1=(i,e)=>{i.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:s}){return s===t.timeline}),t.segments&&t.segments.forEach((s,r)=>{s.number=r})})},Vu=i=>i?Object.keys(i).reduce((e,t)=>{const s=i[t];return e.concat(s.playlists)},[]):[],z1=({dashPlaylists:i,locations:e,contentSteering:t,sidxMapping:s={},previousManifest:r,eventStream:n})=>{if(!i.length)return{};const{sourceDuration:a,type:l,suggestedPresentationDelay:u,minimumUpdatePeriod:f}=i[0].attributes,m=Sa(i.filter(U1)).map(F1),v=Sa(i.filter(V1)),T=Sa(i.filter(H1)),E=i.map(L=>L.attributes.captionServices).filter(Boolean),A={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:L1(m,s)};f>=0&&(A.minimumUpdatePeriod=f*1e3),e&&(A.locations=e),t&&(A.contentSteering=t),l==="dynamic"&&(A.suggestedPresentationDelay=u),n&&n.length>0&&(A.eventStream=n);const y=A.playlists.length===0,k=v.length?R1(v,s,y):null,w=T.length?N1(T,s):null,I=m.concat(Vu(k),Vu(w)),j=I.map(({timelineStarts:L})=>L);return A.timelineStarts=Ld(j),q1(I,A.timelineStarts),k&&(A.mediaGroups.AUDIO.audio=k),w&&(A.mediaGroups.SUBTITLES.subs=w),E.length&&(A.mediaGroups["CLOSED-CAPTIONS"].cc=B1(E)),r?P1({oldManifest:r,newManifest:A}):A},$1=(i,e,t)=>{const{NOW:s,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:l=0,minimumUpdatePeriod:u=0}=i,f=(s+r)/1e3,m=n+l,T=f+u-m;return Math.ceil((T*a-e)/t)},Od=(i,e)=>{const{type:t,minimumUpdatePeriod:s=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:l=1,periodStart:u}=i,f=[];let m=-1;for(let v=0;v<e.length;v++){const T=e[v],E=T.d,A=T.r||0,y=T.t||0;m<0&&(m=y),y&&y>m&&(m=y);let k;if(A<0){const j=v+1;j===e.length?t==="dynamic"&&s>0&&r.indexOf("$Number$")>0?k=$1(i,m,E):k=(n*a-m)/E:k=(e[j].t-m)/E}else k=A+1;const w=l+f.length+k;let I=l+f.length;for(;I<w;)f.push({number:I,duration:E/a,time:m,timeline:u}),m+=E,I++}return f},G1=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,W1=i=>(e,t,s,r)=>{if(e==="$$")return"$";if(typeof i[t]>"u")return e;const n=""+i[t];return t==="RepresentationID"||(s?r=parseInt(r,10):r=1,n.length>=r)?n:`${new Array(r-n.length+1).join("0")}${n}`},Hu=(i,e)=>i.replace(G1,W1(e)),X1=(i,e)=>!i.duration&&!e?[{number:i.startNumber||1,duration:i.sourceDuration,time:0,timeline:i.periodStart}]:i.duration?Io(i):Od(i,e),Y1=(i,e)=>{const t={RepresentationID:i.id,Bandwidth:i.bandwidth||0},{initialization:s={sourceURL:"",range:""}}=i,r=Js({baseUrl:i.baseUrl,source:Hu(s.sourceURL,t),range:s.range});return X1(i,e).map(a=>{t.Number=a.number,t.Time=a.time;const l=Hu(i.media||"",t),u=i.timescale||1,f=i.presentationTimeOffset||0,m=i.periodStart+(a.time-f)/u;return{uri:l,timeline:a.timeline,duration:a.duration,resolvedUri:An(i.baseUrl||"",l),map:r,number:a.number,presentationTime:m}})},K1=(i,e)=>{const{baseUrl:t,initialization:s={}}=i,r=Js({baseUrl:t,source:s.sourceURL,range:s.range}),n=Js({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},Q1=(i,e)=>{const{duration:t,segmentUrls:s=[],periodStart:r}=i;if(!t&&!e||t&&e)throw new Error(Qi.SEGMENT_TIME_UNSPECIFIED);const n=s.map(u=>K1(i,u));let a;return t&&(a=Io(i)),e&&(a=Od(i,e)),a.map((u,f)=>{if(n[f]){const m=n[f],v=i.timescale||1,T=i.presentationTimeOffset||0;return m.timeline=u.timeline,m.duration=u.duration,m.number=u.number,m.presentationTime=r+(u.time-T)/v,m}}).filter(u=>u)},J1=({attributes:i,segmentInfo:e})=>{let t,s;e.template?(s=Y1,t=De(i,e.template)):e.base?(s=Pd,t=De(i,e.base)):e.list&&(s=Q1,t=De(i,e.list));const r={attributes:i};if(!s)return r;const n=s(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:l=1}=t;t.duration=a/l}else n.length?t.duration=n.reduce((a,l)=>Math.max(a,Math.ceil(l.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},Z1=i=>i.map(J1),me=(i,e)=>Id(i.childNodes).filter(({tagName:t})=>t===e),or=i=>i.textContent.trim(),e2=i=>parseFloat(i.split("/").reduce((e,t)=>e/t)),ji=i=>{const l=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(i);if(!l)return 0;const[u,f,m,v,T,E]=l.slice(1);return parseFloat(u||0)*31536e3+parseFloat(f||0)*2592e3+parseFloat(m||0)*86400+parseFloat(v||0)*3600+parseFloat(T||0)*60+parseFloat(E||0)},t2=i=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(i)&&(i+="Z"),Date.parse(i)),qu={mediaPresentationDuration(i){return ji(i)},availabilityStartTime(i){return t2(i)/1e3},minimumUpdatePeriod(i){return ji(i)},suggestedPresentationDelay(i){return ji(i)},type(i){return i},timeShiftBufferDepth(i){return ji(i)},start(i){return ji(i)},width(i){return parseInt(i,10)},height(i){return parseInt(i,10)},bandwidth(i){return parseInt(i,10)},frameRate(i){return e2(i)},startNumber(i){return parseInt(i,10)},timescale(i){return parseInt(i,10)},presentationTimeOffset(i){return parseInt(i,10)},duration(i){const e=parseInt(i,10);return isNaN(e)?ji(i):e},d(i){return parseInt(i,10)},t(i){return parseInt(i,10)},r(i){return parseInt(i,10)},presentationTime(i){return parseInt(i,10)},DEFAULT(i){return i}},Ee=i=>i&&i.attributes?Id(i.attributes).reduce((e,t)=>{const s=qu[t.name]||qu.DEFAULT;return e[t.name]=s(t.value),e},{}):{},i2={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},In=(i,e)=>e.length?Ki(i.map(function(t){return e.map(function(s){const r=or(s),n=An(t.baseUrl,r),a=De(Ee(s),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):i,Oo=i=>{const e=me(i,"SegmentTemplate")[0],t=me(i,"SegmentList")[0],s=t&&me(t,"SegmentURL").map(v=>De({tag:"SegmentURL"},Ee(v))),r=me(i,"SegmentBase")[0],n=t||e,a=n&&me(n,"SegmentTimeline")[0],l=t||r||e,u=l&&me(l,"Initialization")[0],f=e&&Ee(e);f&&u?f.initialization=u&&Ee(u):f&&f.initialization&&(f.initialization={sourceURL:f.initialization});const m={template:f,segmentTimeline:a&&me(a,"S").map(v=>Ee(v)),list:t&&De(Ee(t),{segmentUrls:s,initialization:Ee(u)}),base:r&&De(Ee(r),{initialization:Ee(u)})};return Object.keys(m).forEach(v=>{m[v]||delete m[v]}),m},s2=(i,e,t)=>s=>{const r=me(s,"BaseURL"),n=In(e,r),a=De(i,Ee(s)),l=Oo(s);return n.map(u=>({segmentInfo:De(t,l),attributes:De(a,u)}))},r2=i=>i.reduce((e,t)=>{const s=Ee(t);s.schemeIdUri&&(s.schemeIdUri=s.schemeIdUri.toLowerCase());const r=i2[s.schemeIdUri];if(r){e[r]={attributes:s};const n=me(t,"cenc:pssh")[0];if(n){const a=or(n);e[r].pssh=a&&Yc(a)}}return e},{}),n2=i=>{if(i.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{let s,r;return r=t,/^CC\d=/.test(t)?[s,r]=t.split("="):/^CC\d$/.test(t)&&(s=t),{channel:s,language:r}});if(i.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{const s={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[r,n=""]=t.split("=");s.channel=r,s.language=t,n.split(",").forEach(a=>{const[l,u]=a.split(":");l==="lang"?s.language=u:l==="er"?s.easyReader=Number(u):l==="war"?s.aspectRatio=Number(u):l==="3D"&&(s["3D"]=Number(u))})}else s.language=t;return s.channel&&(s.channel="SERVICE"+s.channel),s})},a2=i=>Ki(me(i.node,"EventStream").map(e=>{const t=Ee(e),s=t.schemeIdUri;return me(e,"Event").map(r=>{const n=Ee(r),a=n.presentationTime||0,l=t.timescale||1,u=n.duration||0,f=a/l+i.attributes.start;return{schemeIdUri:s,value:t.value,id:n.id,start:f,end:f+u/l,messageData:or(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),o2=(i,e,t)=>s=>{const r=Ee(s),n=In(e,me(s,"BaseURL")),a=me(s,"Role")[0],l={role:Ee(a)};let u=De(i,r,l);const f=me(s,"Accessibility")[0],m=n2(Ee(f));m&&(u=De(u,{captionServices:m}));const v=me(s,"Label")[0];if(v&&v.childNodes.length){const k=v.childNodes[0].nodeValue.trim();u=De(u,{label:k})}const T=r2(me(s,"ContentProtection"));Object.keys(T).length&&(u=De(u,{contentProtection:T}));const E=Oo(s),A=me(s,"Representation"),y=De(t,E);return Ki(A.map(s2(u,n,y)))},l2=(i,e)=>(t,s)=>{const r=In(e,me(t.node,"BaseURL")),n=De(i,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=me(t.node,"AdaptationSet"),l=Oo(t.node);return Ki(a.map(o2(n,r,l)))},u2=(i,e)=>{if(i.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!i.length)return null;const t=De({serverURL:or(i[0])},Ee(i[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},c2=({attributes:i,priorPeriodAttributes:e,mpdType:t})=>typeof i.start=="number"?i.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,d2=(i,e={})=>{const{manifestUri:t="",NOW:s=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=me(i,"Period");if(!a.length)throw new Error(Qi.INVALID_NUMBER_OF_PERIOD);const l=me(i,"Location"),u=Ee(i),f=In([{baseUrl:t}],me(i,"BaseURL")),m=me(i,"ContentSteering");u.type=u.type||"static",u.sourceDuration=u.mediaPresentationDuration||0,u.NOW=s,u.clientOffset=r,l.length&&(u.locations=l.map(or));const v=[];return a.forEach((T,E)=>{const A=Ee(T),y=v[E-1];A.start=c2({attributes:A,priorPeriodAttributes:y?y.attributes:null,mpdType:u.type}),v.push({node:T,attributes:A})}),{locations:u.locations,contentSteeringInfo:u2(m,n),representationInfo:Ki(v.map(l2(u,f))),eventStream:Ki(v.map(a2))}},Md=i=>{if(i==="")throw new Error(Qi.DASH_EMPTY_MANIFEST);const e=new T1;let t,s;try{t=e.parseFromString(i,"application/xml"),s=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!s||s&&s.getElementsByTagName("parsererror").length>0)throw new Error(Qi.DASH_INVALID_XML);return s},h2=i=>{const e=me(i,"UTCTiming")[0];if(!e)return null;const t=Ee(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(Qi.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},f2=(i,e={})=>{const t=d2(Md(i),e),s=Z1(t.representationInfo);return z1({dashPlaylists:s,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},p2=i=>h2(Md(i));var m2=Math.pow(2,32),g2=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t;return e.getBigUint64?(t=e.getBigUint64(0),t<Number.MAX_SAFE_INTEGER?Number(t):t):e.getUint32(0)*m2+e.getUint32(4)},v2={getUint64:g2},zu=v2.getUint64,y2=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t={version:i[0],flags:new Uint8Array(i.subarray(1,4)),references:[],referenceId:e.getUint32(4),timescale:e.getUint32(8)},s=12;t.version===0?(t.earliestPresentationTime=e.getUint32(s),t.firstOffset=e.getUint32(s+4),s+=8):(t.earliestPresentationTime=zu(i.subarray(s)),t.firstOffset=zu(i.subarray(s+8)),s+=16),s+=2;var r=e.getUint16(s);for(s+=2;r>0;s+=12,r--)t.references.push({referenceType:(i[s]&128)>>>7,referencedSize:e.getUint32(s)&2147483647,subsegmentDuration:e.getUint32(s+4),startsWithSap:!!(i[s+8]&128),sapType:(i[s+8]&112)>>>4,sapDeltaTime:e.getUint32(s+8)&268435455});return t},_2=y2;const b2=Ce.getDefaultExportFromCjs(_2);var T2=G([73,68,51]),x2=function(e,t){t===void 0&&(t=0),e=G(e);var s=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(s&16)>>4;return n?r+20:r+10},Fs=function i(e,t){return t===void 0&&(t=0),e=G(e),e.length-t<10||!pe(e,T2,{offset:t})?t:(t+=x2(e,t),i(e,t))},$u=function(e){return typeof e=="string"?ed(e):e},S2=function(e){return Array.isArray(e)?e.map(function(t){return $u(t)}):[$u(e)]},C2=function i(e,t,s){s===void 0&&(s=!1),t=S2(t),e=G(e);var r=[];if(!t.length)return r;for(var n=0;n<e.length;){var a=(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0,l=e.subarray(n+4,n+8);if(a===0)break;var u=n+a;if(u>e.length){if(s)break;u=e.length}var f=e.subarray(n+8,u);pe(l,t[0])&&(t.length===1?r.push(f):r.push.apply(r,i(f,t.slice(1),s))),n=u}return r},zr={EBML:G([26,69,223,163]),DocType:G([66,130]),Segment:G([24,83,128,103]),SegmentInfo:G([21,73,169,102]),Tracks:G([22,84,174,107]),Track:G([174]),TrackNumber:G([215]),DefaultDuration:G([35,227,131]),TrackEntry:G([174]),TrackType:G([131]),FlagDefault:G([136]),CodecID:G([134]),CodecPrivate:G([99,162]),VideoTrack:G([224]),AudioTrack:G([225]),Cluster:G([31,67,182,117]),Timestamp:G([231]),TimestampScale:G([42,215,177]),BlockGroup:G([160]),BlockDuration:G([155]),Block:G([161]),SimpleBlock:G([163])},qa=[128,64,32,16,8,4,2,1],E2=function(e){for(var t=1,s=0;s<qa.length&&!(e&qa[s]);s++)t++;return t},rn=function(e,t,s,r){s===void 0&&(s=!0),r===void 0&&(r=!1);var n=E2(e[t]),a=e.subarray(t,t+n);return s&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=qa[n-1]),{length:n,value:zg(a,{signed:r}),bytes:a}},Gu=function i(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return i(t)}):typeof e=="number"?$g(e):e},A2=function(e){return Array.isArray(e)?e.map(function(t){return Gu(t)}):[Gu(e)]},w2=function i(e,t,s){if(s>=t.length)return t.length;var r=rn(t,s,!1);if(pe(e.bytes,r.bytes))return s;var n=rn(t,s+r.length);return i(e,t,s+n.length+n.value+r.length)},Wu=function i(e,t){t=A2(t),e=G(e);var s=[];if(!t.length)return s;for(var r=0;r<e.length;){var n=rn(e,r,!1),a=rn(e,r+n.length),l=r+n.length+a.length;a.value===127&&(a.value=w2(n,e,l),a.value!==e.length&&(a.value-=l));var u=l+a.value>e.length?e.length:l+a.value,f=e.subarray(l,u);pe(t[0],n.bytes)&&(t.length===1?s.push(f):s=s.concat(i(f,t.slice(1))));var m=n.length+a.length+f.length;r+=m}return s},D2=G([0,0,0,1]),k2=G([0,0,1]),j2=G([0,0,3]),I2=function(e){for(var t=[],s=1;s<e.length-2;)pe(e.subarray(s,s+3),j2)&&(t.push(s+2),s++),s++;if(t.length===0)return e;var r=e.length-t.length,n=new Uint8Array(r),a=0;for(s=0;s<r;a++,s++)a===t[0]&&(a++,t.shift()),n[s]=e[a];return n},Rd=function(e,t,s,r){e=G(e),s=[].concat(s);for(var n=0,a,l=0;n<e.length&&(l<r||a);){var u=void 0;if(pe(e.subarray(n),D2)?u=4:pe(e.subarray(n),k2)&&(u=3),!u){n++;continue}if(l++,a)return I2(e.subarray(a,n));var f=void 0;t==="h264"?f=e[n+u]&31:t==="h265"&&(f=e[n+u]>>1&63),s.indexOf(f)!==-1&&(a=n+u),n+=u+(t==="h264"?1:2)}return e.subarray(0,0)},P2=function(e,t,s){return Rd(e,"h264",t,s)},L2=function(e,t,s){return Rd(e,"h265",t,s)},Fe={webm:G([119,101,98,109]),matroska:G([109,97,116,114,111,115,107,97]),flac:G([102,76,97,67]),ogg:G([79,103,103,83]),ac3:G([11,119]),riff:G([82,73,70,70]),avi:G([65,86,73]),wav:G([87,65,86,69]),"3gp":G([102,116,121,112,51,103]),mp4:G([102,116,121,112]),fmp4:G([115,116,121,112]),mov:G([102,116,121,112,113,116]),moov:G([109,111,111,118]),moof:G([109,111,111,102])},Ji={aac:function(e){var t=Fs(e);return pe(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Fs(e);return pe(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=Wu(e,[zr.EBML,zr.DocType])[0];return pe(t,Fe.webm)},mkv:function(e){var t=Wu(e,[zr.EBML,zr.DocType])[0];return pe(t,Fe.matroska)},mp4:function(e){if(Ji["3gp"](e)||Ji.mov(e))return!1;if(pe(e,Fe.mp4,{offset:4})||pe(e,Fe.fmp4,{offset:4})||pe(e,Fe.moof,{offset:4})||pe(e,Fe.moov,{offset:4}))return!0},mov:function(e){return pe(e,Fe.mov,{offset:4})},"3gp":function(e){return pe(e,Fe["3gp"],{offset:4})},ac3:function(e){var t=Fs(e);return pe(e,Fe.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+188<e.length&&t<188;){if(e[t]===71&&e[t+188]===71)return!0;t+=1}return!1},flac:function(e){var t=Fs(e);return pe(e,Fe.flac,{offset:t})},ogg:function(e){return pe(e,Fe.ogg)},avi:function(e){return pe(e,Fe.riff)&&pe(e,Fe.avi,{offset:8})},wav:function(e){return pe(e,Fe.riff)&&pe(e,Fe.wav,{offset:8})},h264:function(e){return P2(e,7,3).length},h265:function(e){return L2(e,[32,33],3).length}},za=Object.keys(Ji).filter(function(i){return i!=="ts"&&i!=="h264"&&i!=="h265"}).concat(["ts","h264","h265"]);za.forEach(function(i){var e=Ji[i];Ji[i]=function(t){return e(G(t))}});var O2=Ji,Mo=function(e){e=G(e);for(var t=0;t<za.length;t++){var s=za[t];if(O2[s](e))return s}return""},M2=function(e){return C2(e,["moof"]).length>0},di={};/**
24
24
  * @license
25
25
  * Video.js 8.23.3 <http://videojs.com/>
26
26
  * Copyright Brightcove, Inc. <https://www.brightcove.com/>
@@ -30,7 +30,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
30
30
  * Includes vtt.js <https://github.com/mozilla/vtt.js>
31
31
  * Available under Apache License Version 2.0
32
32
  * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
33
- */var Wa="8.23.3";const It={},Qt=function(i,e){return It[i]=It[i]||[],e&&(It[i]=It[i].concat(e)),It[i]},q2=function(i,e){Qt(i,e)},Ud=function(i,e){const t=Qt(i).indexOf(e);return t<=-1?!1:(It[i]=It[i].slice(),It[i].splice(t,1),!0)},z2=function(i,e){Qt(i,[].concat(e).map(t=>{const s=(...r)=>(Ud(i,s),t(...r));return s}))},on={prefixed:!0},Kr=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],Ku=Kr[0];let Us;for(let i=0;i<Kr.length;i++)if(Kr[i][1]in V){Us=Kr[i];break}if(Us){for(let i=0;i<Us.length;i++)on[Ku[i]]=Us[i];on.prefixed=Us[0]!==Ku[0]}let qe=[];const $2=(i,e,t)=>(s,r,n)=>{const a=e.levels[r],l=new RegExp(`^(${a})$`);let u=i;if(s!=="log"&&n.unshift(s.toUpperCase()+":"),t&&(u=`%c${i}`,n.unshift(t)),n.unshift(u+":"),qe){qe.push([].concat(n));const m=qe.length-1e3;qe.splice(0,m>0?m:0)}if(!S.console)return;let f=S.console[s];!f&&s==="debug"&&(f=S.console.info||S.console.log),!(!f||!a||!l.test(s))&&f[Array.isArray(n)?"apply":"call"](S.console,n)};function Xa(i,e=":",t=""){let s="info",r;function n(...a){r("log",s,a)}return r=$2(i,n,t),n.createLogger=(a,l,u)=>{const f=l!==void 0?l:e,m=u!==void 0?u:t,v=`${i} ${f} ${a}`;return Xa(v,f,m)},n.createNewLogger=(a,l,u)=>Xa(a,l,u),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);s=a}return s},n.history=()=>qe?[].concat(qe):[],n.history.filter=a=>(qe||[]).filter(l=>new RegExp(`.*${a}.*`).test(l[0])),n.history.clear=()=>{qe&&(qe.length=0)},n.history.disable=()=>{qe!==null&&(qe.length=0,qe=null)},n.history.enable=()=>{qe===null&&(qe=[])},n.error=(...a)=>r("error",s,a),n.warn=(...a)=>r("warn",s,a),n.debug=(...a)=>r("debug",s,a),n}const Q=Xa("VIDEOJS"),Vd=Q.createLogger,G2=Object.prototype.toString,Hd=function(i){return Et(i)?Object.keys(i):[]};function Ni(i,e){Hd(i).forEach(t=>e(i[t],t))}function qd(i,e,t=0){return Hd(i).reduce((s,r)=>e(s,i[r],r),t)}function Et(i){return!!i&&typeof i=="object"}function Zi(i){return Et(i)&&G2.call(i)==="[object Object]"&&i.constructor===Object}function oe(...i){const e={};return i.forEach(t=>{t&&Ni(t,(s,r)=>{if(!Zi(s)){e[r]=s;return}Zi(e[r])||(e[r]={}),e[r]=oe(e[r],s)})}),e}function zd(i={}){const e=[];for(const t in i)if(i.hasOwnProperty(t)){const s=i[t];e.push(s)}return e}function On(i,e,t,s=!0){const r=a=>Object.defineProperty(i,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return s&&(n.set=r),Object.defineProperty(i,e,n)}var W2=Object.freeze({__proto__:null,each:Ni,reduce:qd,isObject:Et,isPlain:Zi,merge:oe,values:zd,defineLazyProperty:On});let Bo=!1,$d=null,ht=!1,Gd,Wd=!1,Bi=!1,Fi=!1,At=!1,Fo=null,Mn=null;const X2=!!(S.cast&&S.cast.framework&&S.cast.framework.CastReceiverContext);let Xd=null,ln=!1,Rn=!1,un=!1,Nn=!1,cn=!1,dn=!1,hn=!1;const Zs=!!(ns()&&("ontouchstart"in S||S.navigator.maxTouchPoints||S.DocumentTouch&&S.document instanceof S.DocumentTouch)),Gt=S.navigator&&S.navigator.userAgentData;Gt&&Gt.platform&&Gt.brands&&(ht=Gt.platform==="Android",Bi=!!Gt.brands.find(i=>i.brand==="Microsoft Edge"),Fi=!!Gt.brands.find(i=>i.brand==="Chromium"),At=!Bi&&Fi,Fo=Mn=(Gt.brands.find(i=>i.brand==="Chromium")||{}).version||null,Rn=Gt.platform==="Windows");if(!Fi){const i=S.navigator&&S.navigator.userAgent||"";Bo=/iPod/i.test(i),$d=function(){const e=i.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),ht=/Android/i.test(i),Gd=function(){const e=i.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),s=e[2]&&parseFloat(e[2]);return t&&s?parseFloat(e[1]+"."+e[2]):t||null}(),Wd=/Firefox/i.test(i),Bi=/Edg/i.test(i),Fi=/Chrome/i.test(i)||/CriOS/i.test(i),At=!Bi&&Fi,Fo=Mn=function(){const e=i.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Xd=function(){const e=/MSIE\s(\d+)\.\d/.exec(i);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(i)&&/rv:11.0/.test(i)&&(t=11),t}(),cn=/Tizen/i.test(i),dn=/Web0S/i.test(i),hn=cn||dn,ln=/Safari/i.test(i)&&!At&&!ht&&!Bi&&!hn,Rn=/Windows/i.test(i),un=/iPad/i.test(i)||ln&&Zs&&!/iPhone/i.test(i),Nn=/iPhone/i.test(i)&&!un}const Ie=Nn||un||Bo,Bn=(ln||Ie)&&!At;var Yd=Object.freeze({__proto__:null,get IS_IPOD(){return Bo},get IOS_VERSION(){return $d},get IS_ANDROID(){return ht},get ANDROID_VERSION(){return Gd},get IS_FIREFOX(){return Wd},get IS_EDGE(){return Bi},get IS_CHROMIUM(){return Fi},get IS_CHROME(){return At},get CHROMIUM_VERSION(){return Fo},get CHROME_VERSION(){return Mn},IS_CHROMECAST_RECEIVER:X2,get IE_VERSION(){return Xd},get IS_SAFARI(){return ln},get IS_WINDOWS(){return Rn},get IS_IPAD(){return un},get IS_IPHONE(){return Nn},get IS_TIZEN(){return cn},get IS_WEBOS(){return dn},get IS_SMART_TV(){return hn},TOUCH_ENABLED:Zs,IS_IOS:Ie,IS_ANY_SAFARI:Bn});function Qu(i){return typeof i=="string"&&!!i.trim()}function Y2(i){if(i.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function ns(){return V===S.document}function as(i){return Et(i)&&i.nodeType===1}function Kd(){try{return S.parent!==S.self}catch{return!0}}function Qd(i){return function(e,t){if(!Qu(e))return V[i](null);Qu(t)&&(t=V.querySelector(t));const s=as(t)?t:V;return s[i]&&s[i](e)}}function W(i="div",e={},t={},s){const r=V.createElement(i);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?ei(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),s&&Uo(r,s),r}function ei(i,e){return typeof i.textContent>"u"?i.innerText=e:i.textContent=e,i}function Ya(i,e){e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}function zs(i,e){return Y2(e),i.classList.contains(e)}function pi(i,...e){return i.classList.add(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i}function Fn(i,...e){return i?(i.classList.remove(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i):(Q.warn("removeClass was called with an element that doesn't exist"),null)}function Jd(i,e,t){return typeof t=="function"&&(t=t(i,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(s=>i.classList.toggle(s,t)),i}function Zd(i,e){Object.getOwnPropertyNames(e).forEach(function(t){const s=e[t];s===null||typeof s>"u"||s===!1?i.removeAttribute(t):i.setAttribute(t,s===!0?"":s)})}function Yt(i){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(i&&i.attributes&&i.attributes.length>0){const s=i.attributes;for(let r=s.length-1;r>=0;r--){const n=s[r].name;let a=s[r].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function eh(i,e){return i.getAttribute(e)}function es(i,e,t){i.setAttribute(e,t)}function Un(i,e){i.removeAttribute(e)}function th(){V.body.focus(),V.onselectstart=function(){return!1}}function ih(){V.onselectstart=function(){return!0}}function ts(i){if(i&&i.getBoundingClientRect&&i.parentNode){const e=i.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(s=>{e[s]!==void 0&&(t[s]=e[s])}),t.height||(t.height=parseFloat(is(i,"height"))),t.width||(t.width=parseFloat(is(i,"width"))),t}}function er(i){if(!i||i&&!i.offsetParent)return{left:0,top:0,width:0,height:0};const e=i.offsetWidth,t=i.offsetHeight;let s=0,r=0;for(;i.offsetParent&&i!==V[on.fullscreenElement];)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return{left:s,top:r,width:e,height:t}}function Vn(i,e){const t={x:0,y:0};if(Ie){let m=i;for(;m&&m.nodeName.toLowerCase()!=="html";){const v=is(m,"transform");if(/^matrix/.test(v)){const T=v.slice(7,-1).split(/,\s/).map(Number);t.x+=T[4],t.y+=T[5]}else if(/^matrix3d/.test(v)){const T=v.slice(9,-1).split(/,\s/).map(Number);t.x+=T[12],t.y+=T[13]}if(m.assignedSlot&&m.assignedSlot.parentElement&&S.WebKitCSSMatrix){const T=S.getComputedStyle(m.assignedSlot.parentElement).transform,E=new S.WebKitCSSMatrix(T);t.x+=E.m41,t.y+=E.m42}m=m.parentNode||m.host}}const s={},r=er(e.target),n=er(i),a=n.width,l=n.height;let u=e.offsetY-(n.top-r.top),f=e.offsetX-(n.left-r.left);return e.changedTouches&&(f=e.changedTouches[0].pageX-n.left,u=e.changedTouches[0].pageY+n.top,Ie&&(f-=t.x,u-=t.y)),s.y=1-Math.max(0,Math.min(1,u/l)),s.x=Math.max(0,Math.min(1,f/a)),s}function sh(i){return Et(i)&&i.nodeType===3}function Hn(i){for(;i.firstChild;)i.removeChild(i.firstChild);return i}function rh(i){return typeof i=="function"&&(i=i()),(Array.isArray(i)?i:[i]).map(e=>{if(typeof e=="function"&&(e=e()),as(e)||sh(e))return e;if(typeof e=="string"&&/\S/.test(e))return V.createTextNode(e)}).filter(e=>e)}function Uo(i,e){return rh(e).forEach(t=>i.appendChild(t)),i}function nh(i,e){return Uo(Hn(i),e)}function tr(i){return i.button===void 0&&i.buttons===void 0||i.button===0&&i.buttons===void 0||i.type==="mouseup"&&i.button===0&&i.buttons===0||i.type==="mousedown"&&i.button===0&&i.buttons===0?!0:!(i.button!==0||i.buttons!==1)}const Jt=Qd("querySelector"),ah=Qd("querySelectorAll");function is(i,e){if(!i||!e)return"";if(typeof S.getComputedStyle=="function"){let t;try{t=S.getComputedStyle(i)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function oh(i){[...V.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),s=V.createElement("style");s.textContent=t,i.document.head.appendChild(s)}catch{const s=V.createElement("link");s.rel="stylesheet",s.type=e.type,s.media=e.media.mediaText,s.href=e.href,i.document.head.appendChild(s)}})}var lh=Object.freeze({__proto__:null,isReal:ns,isEl:as,isInFrame:Kd,createEl:W,textContent:ei,prependTo:Ya,hasClass:zs,addClass:pi,removeClass:Fn,toggleClass:Jd,setAttributes:Zd,getAttributes:Yt,getAttribute:eh,setAttribute:es,removeAttribute:Un,blockTextSelection:th,unblockTextSelection:ih,getBoundingClientRect:ts,findPosition:er,getPointerPosition:Vn,isTextNode:sh,emptyEl:Hn,normalizeContent:rh,appendContent:Uo,insertContent:nh,isSingleLeftClick:tr,$:Jt,$$:ah,computedStyle:is,copyStyleSheetsToWindow:oh});let uh=!1,Ka;const K2=function(){if(Ka.options.autoSetup===!1)return;const i=Array.prototype.slice.call(V.getElementsByTagName("video")),e=Array.prototype.slice.call(V.getElementsByTagName("audio")),t=Array.prototype.slice.call(V.getElementsByTagName("video-js")),s=i.concat(e,t);if(s&&s.length>0)for(let r=0,n=s.length;r<n;r++){const a=s[r];if(a&&a.getAttribute)a.player===void 0&&a.getAttribute("data-setup")!==null&&Ka(a);else{Qa(1);break}}else uh||Qa(1)};function Qa(i,e){ns()&&(e&&(Ka=e),S.setTimeout(K2,i))}function Ja(){uh=!0,S.removeEventListener("load",Ja)}ns()&&(V.readyState==="complete"?Ja():S.addEventListener("load",Ja));const ch=function(i){const e=V.createElement("style");return e.className=i,e},dh=function(i,e){i.styleSheet?i.styleSheet.cssText=e:i.textContent=e};var Ve=new WeakMap;const Q2=3;let J2=Q2;function rt(){return J2++}function Ju(i,e){if(!Ve.has(i))return;const t=Ve.get(i);t.handlers[e].length===0&&(delete t.handlers[e],i.removeEventListener?i.removeEventListener(e,t.dispatcher,!1):i.detachEvent&&i.detachEvent("on"+e,t.dispatcher)),Object.getOwnPropertyNames(t.handlers).length<=0&&(delete t.handlers,delete t.dispatcher,delete t.disabled),Object.getOwnPropertyNames(t).length===0&&Ve.delete(i)}function Vo(i,e,t,s){t.forEach(function(r){i(e,r,s)})}function qn(i){if(i.fixed_)return i;function e(){return!0}function t(){return!1}if(!i||!i.isPropagationStopped||!i.isImmediatePropagationStopped){const s=i||S.event;i={};const r=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const n in s)r.includes(n)||n==="returnValue"&&s.preventDefault||(i[n]=s[n]);if(i.target||(i.target=i.srcElement||V),i.relatedTarget||(i.relatedTarget=i.fromElement===i.target?i.toElement:i.fromElement),i.preventDefault=function(){s.preventDefault&&s.preventDefault(),i.returnValue=!1,s.returnValue=!1,i.defaultPrevented=!0},i.defaultPrevented=!1,i.stopPropagation=function(){s.stopPropagation&&s.stopPropagation(),i.cancelBubble=!0,s.cancelBubble=!0,i.isPropagationStopped=e},i.isPropagationStopped=t,i.stopImmediatePropagation=function(){s.stopImmediatePropagation&&s.stopImmediatePropagation(),i.isImmediatePropagationStopped=e,i.stopPropagation()},i.isImmediatePropagationStopped=t,i.clientX!==null&&i.clientX!==void 0){const n=V.documentElement,a=V.body;i.pageX=i.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0),i.pageY=i.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}i.which=i.charCode||i.keyCode,i.button!==null&&i.button!==void 0&&(i.button=i.button&1?0:i.button&4?1:i.button&2?2:0)}return i.fixed_=!0,i}let Gr;const Z2=function(){if(typeof Gr!="boolean"){Gr=!1;try{const i=Object.defineProperty({},"passive",{get(){Gr=!0}});S.addEventListener("test",null,i),S.removeEventListener("test",null,i)}catch{}}return Gr},ev=["touchstart","touchmove"];function et(i,e,t){if(Array.isArray(e))return Vo(et,i,e,t);Ve.has(i)||Ve.set(i,{});const s=Ve.get(i);if(s.handlers||(s.handlers={}),s.handlers[e]||(s.handlers[e]=[]),t.guid||(t.guid=rt()),s.handlers[e].push(t),s.dispatcher||(s.disabled=!1,s.dispatcher=function(r,n){if(s.disabled)return;r=qn(r);const a=s.handlers[r.type];if(a){const l=a.slice(0);for(let u=0,f=l.length;u<f&&!r.isImmediatePropagationStopped();u++)try{l[u].call(i,r,n)}catch(m){Q.error(m)}}}),s.handlers[e].length===1)if(i.addEventListener){let r=!1;Z2()&&ev.indexOf(e)>-1&&(r={passive:!0}),i.addEventListener(e,s.dispatcher,r)}else i.attachEvent&&i.attachEvent("on"+e,s.dispatcher)}function Pe(i,e,t){if(!Ve.has(i))return;const s=Ve.get(i);if(!s.handlers)return;if(Array.isArray(e))return Vo(Pe,i,e,t);const r=function(a,l){s.handlers[l]=[],Ju(a,l)};if(e===void 0){for(const a in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},a)&&r(i,a);return}const n=s.handlers[e];if(n){if(!t){r(i,e);return}if(t.guid)for(let a=0;a<n.length;a++)n[a].guid===t.guid&&n.splice(a--,1);Ju(i,e)}}function os(i,e,t){const s=Ve.has(i)?Ve.get(i):{},r=i.parentNode||i.ownerDocument;if(typeof e=="string"?e={type:e,target:i}:e.target||(e.target=i),e=qn(e),s.dispatcher&&s.dispatcher.call(i,e,t),r&&!e.isPropagationStopped()&&e.bubbles===!0)os.call(null,r,e,t);else if(!r&&!e.defaultPrevented&&e.target&&e.target[e.type]){Ve.has(e.target)||Ve.set(e.target,{});const n=Ve.get(e.target);e.target[e.type]&&(n.disabled=!0,typeof e.target[e.type]=="function"&&e.target[e.type](),n.disabled=!1)}return!e.defaultPrevented}function zn(i,e,t){if(Array.isArray(e))return Vo(zn,i,e,t);const s=function(){Pe(i,e,s),t.apply(this,arguments)};s.guid=t.guid=t.guid||rt(),et(i,e,s)}function Ho(i,e,t){const s=function(){Pe(i,e,s),t.apply(this,arguments)};s.guid=t.guid=t.guid||rt(),et(i,e,s)}var tv=Object.freeze({__proto__:null,fixEvent:qn,on:et,off:Pe,trigger:os,one:zn,any:Ho});const nt=30,ce=function(i,e,t){e.guid||(e.guid=rt());const s=e.bind(i);return s.guid=t?t+"_"+e.guid:e.guid,s},wt=function(i,e){let t=S.performance.now();return function(...r){const n=S.performance.now();n-t>=e&&(i(...r),t=n)}},hh=function(i,e,t,s=S){let r;const n=()=>{s.clearTimeout(r),r=null},a=function(){const l=this,u=arguments;let f=function(){r=null,f=null,t||i.apply(l,u)};!r&&t&&i.apply(l,u),s.clearTimeout(r),r=s.setTimeout(f,e)};return a.cancel=n,a};var iv=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:nt,bind_:ce,throttle:wt,debounce:hh});let Ls;class tt{on(e,t){const s=this.addEventListener;this.addEventListener=()=>{},et(this,e,t),this.addEventListener=s}off(e,t){Pe(this,e,t)}one(e,t){const s=this.addEventListener;this.addEventListener=()=>{},zn(this,e,t),this.addEventListener=s}any(e,t){const s=this.addEventListener;this.addEventListener=()=>{},Ho(this,e,t),this.addEventListener=s}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=qn(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),os(this,e)}queueTrigger(e){Ls||(Ls=new Map);const t=e.type||e;let s=Ls.get(this);s||(s=new Map,Ls.set(this,s));const r=s.get(t);s.delete(t),S.clearTimeout(r);const n=S.setTimeout(()=>{s.delete(t),s.size===0&&(s=null,Ls.delete(this)),this.trigger(e)},0);s.set(t,n)}}tt.prototype.allowedEvents_={};tt.prototype.addEventListener=tt.prototype.on;tt.prototype.removeEventListener=tt.prototype.off;tt.prototype.dispatchEvent=tt.prototype.trigger;const $n=i=>typeof i.name=="function"?i.name():typeof i.name=="string"?i.name:i.name_?i.name_:i.constructor&&i.constructor.name?i.constructor.name:typeof i,Ot=i=>i instanceof tt||!!i.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof i[e]=="function"),sv=(i,e)=>{Ot(i)?e():(i.eventedCallbacks||(i.eventedCallbacks=[]),i.eventedCallbacks.push(e))},Za=i=>typeof i=="string"&&/\S/.test(i)||Array.isArray(i)&&!!i.length,fn=(i,e,t)=>{if(!i||!i.nodeName&&!Ot(i))throw new Error(`Invalid target for ${$n(e)}#${t}; must be a DOM node or evented object.`)},fh=(i,e,t)=>{if(!Za(i))throw new Error(`Invalid event type for ${$n(e)}#${t}; must be a non-empty string or array.`)},ph=(i,e,t)=>{if(typeof i!="function")throw new Error(`Invalid listener for ${$n(e)}#${t}; must be a function.`)},Aa=(i,e,t)=>{const s=e.length<3||e[0]===i||e[0]===i.eventBusEl_;let r,n,a;return s?(r=i.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(r=e[0],n=e[1],a=e[2]),fn(r,i,t),fh(n,i,t),ph(a,i,t),a=ce(i,a),{isTargetingSelf:s,target:r,type:n,listener:a}},li=(i,e,t,s)=>{fn(i,i,e),i.nodeName?tv[e](i,t,s):i[e](t,s)},rv={on(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Aa(this,i,"on");if(li(t,"on",s,r),!e){const n=()=>this.off(t,s,r);n.guid=r.guid;const a=()=>this.off("dispose",n);a.guid=r.guid,li(this,"on","dispose",n),li(t,"on","dispose",a)}},one(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Aa(this,i,"one");if(e)li(t,"one",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,li(t,"one",s,n)}},any(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Aa(this,i,"any");if(e)li(t,"any",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,li(t,"any",s,n)}},off(i,e,t){if(!i||Za(i))Pe(this.eventBusEl_,i,e);else{const s=i,r=e;fn(s,this,"off"),fh(r,this,"off"),ph(t,this,"off"),t=ce(this,t),this.off("dispose",t),s.nodeName?(Pe(s,r,t),Pe(s,"dispose",t)):Ot(s)&&(s.off(r,t),s.off("dispose",t))}},trigger(i,e){fn(this.eventBusEl_,this,"trigger");const t=i&&typeof i!="string"?i.type:i;if(!Za(t))throw new Error(`Invalid event type for ${$n(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return os(this.eventBusEl_,i,e)}};function qo(i,e={}){const{eventBusKey:t}=e;if(t){if(!i[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);i.eventBusEl_=i[t]}else i.eventBusEl_=W("span",{className:"vjs-event-bus"});return Object.assign(i,rv),i.eventedCallbacks&&i.eventedCallbacks.forEach(s=>{s()}),i.on("dispose",()=>{i.off(),[i,i.el_,i.eventBusEl_].forEach(function(s){s&&Ve.has(s)&&Ve.delete(s)}),S.setTimeout(()=>{i.eventBusEl_=null},0)}),i}const nv={state:{},setState(i){typeof i=="function"&&(i=i());let e;return Ni(i,(t,s)=>{this.state[s]!==t&&(e=e||{},e[s]={from:this.state[s],to:t}),this.state[s]=t}),e&&Ot(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function mh(i,e){return Object.assign(i,nv),i.state=Object.assign({},i.state,e),typeof i.handleStateChanged=="function"&&Ot(i)&&i.on("statechanged",i.handleStateChanged),i}const $s=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toLowerCase())},ye=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},gh=function(i,e){return ye(i)===ye(e)};var av=Object.freeze({__proto__:null,toLowerCase:$s,toTitleCase:ye,titleCaseEquals:gh});class R{constructor(e,t,s){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=oe({},this.options_),t=this.options_=oe(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${rt()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&(qo(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),mh(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(s),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=oe(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,s){return W(e,t,s)}localize(e,t,s=e){const r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],l=r&&r.split("-")[0],u=n&&n[l];let f=s;return a&&a[e]?f=a[e]:u&&u[e]&&(f=u[e]),t&&(f=f.replace(/\{(\d+)\}/g,function(m,v){const T=t[v-1];let E=T;return typeof T>"u"&&(E=m),E})),f}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((s,r)=>s.concat(r),[]);let t=this;for(let s=0;s<e.length;s++)if(t=t.getChild(e[s]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const s="http://www.w3.org/2000/svg",r=W("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=V.createElementNS(s,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const a=V.createElementNS(s,"use");return n.appendChild(a),a.setAttributeNS(null,"href",`#vjs-icon-${e}`),r.appendChild(n),this.iconIsSet_?t.replaceChild(r,t.querySelector(".vjs-icon-placeholder")):t.appendChild(r),this.iconIsSet_=!0,r}addChild(e,t={},s=this.children_.length){let r,n;if(typeof e=="string"){n=ye(e);const a=t.componentClass||n;t.name=n;const l=R.getComponent(a);if(!l)throw new Error(`Component ${a} does not exist`);if(typeof l!="function")return null;r=new l(this.player_||this,t)}else r=e;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(s,0,r),r.parentComponent_=this,typeof r.id=="function"&&(this.childIndex_[r.id()]=r),n=n||r.name&&ye(r.name()),n&&(this.childNameIndex_[n]=r,this.childNameIndex_[$s(n)]=r),typeof r.el=="function"&&r.el()){let a=null;this.children_[s+1]&&(this.children_[s+1].el_?a=this.children_[s+1].el_:as(this.children_[s+1])&&(a=this.children_[s+1])),this.contentEl().insertBefore(r.el(),a)}return r}removeChild(e){if(typeof e=="string"&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let r=this.children_.length-1;r>=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[ye(e.name())]=null,this.childNameIndex_[$s(e.name())]=null;const s=e.el();s&&s.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,s=a=>{const l=a.name;let u=a.opts;if(t[l]!==void 0&&(u=t[l]),u===!1)return;u===!0&&(u={}),u.playerOptions=this.options_.playerOptions;const f=this.addChild(l,u);f&&(this[l]=f)};let r;const n=R.getComponent("Tech");Array.isArray(e)?r=e:r=Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(l){return typeof l=="string"?a===l:a===l.name})})).map(a=>{let l,u;return typeof a=="string"?(l=a,u=e[l]||this.options_[l]||{}):(l=a.name,u=a),{name:l,opts:u}}).filter(a=>{const l=R.getComponent(a.opts.componentClass||ye(a.name));return l&&!n.isTech(l)}).forEach(s)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return Jt(e,t||this.contentEl())}$$(e,t){return ah(e,t||this.contentEl())}hasClass(e){return zs(this.el_,e)}addClass(...e){pi(this.el_,...e)}removeClass(...e){Fn(this.el_,...e)}toggleClass(e,t){Jd(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return eh(this.el_,e)}setAttribute(e,t){es(this.el_,e,t)}removeAttribute(e){Un(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,s){if(t!==void 0){(t===null||t!==t)&&(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:t==="auto"?this.el_.style[e]="":this.el_.style[e]=t+"px",s||this.trigger("componentresize");return}if(!this.el_)return 0;const r=this.el_.style[e],n=r.indexOf("px");return parseInt(n!==-1?r.slice(0,n):this.el_["offset"+ye(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=is(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const s=`offset${ye(e)}`;t=this.el_[s]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},s={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:t,center:s}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const s=10,r=200;let n;this.on("touchstart",function(l){l.touches.length===1&&(t={pageX:l.touches[0].pageX,pageY:l.touches[0].pageY},e=S.performance.now(),n=!0)}),this.on("touchmove",function(l){if(l.touches.length>1)n=!1;else if(t){const u=l.touches[0].pageX-t.pageX,f=l.touches[0].pageY-t.pageY;Math.sqrt(u*u+f*f)>s&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(l){t=null,n===!0&&S.performance.now()-e<r&&(l.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=ce(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const s=function(r){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",s),this.on("touchcancel",s)}setTimeout(e,t){var s;return e=ce(this,e),this.clearTimersOnDispose_(),s=S.setTimeout(()=>{this.setTimeoutIds_.has(s)&&this.setTimeoutIds_.delete(s),e()},t),this.setTimeoutIds_.add(s),s}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),S.clearTimeout(e)),e}setInterval(e,t){e=ce(this,e),this.clearTimersOnDispose_();const s=S.setInterval(e,t);return this.setIntervalIds_.add(s),s}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),S.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=ce(this,e),t=S.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=ce(this,t);const s=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,s),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),S.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((s,r)=>this[t](r))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(n){const a=S.getComputedStyle(n,null),l=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(l)}function s(n){return!(!t(n.parentElement)||!t(n)||n.style.opacity==="0"||S.getComputedStyle(n).height==="0px"||S.getComputedStyle(n).width==="0px")}function r(n){if(n.offsetWidth+n.offsetHeight+n.getBoundingClientRect().height+n.getBoundingClientRect().width===0)return!1;const a={x:n.getBoundingClientRect().left+n.offsetWidth/2,y:n.getBoundingClientRect().top+n.offsetHeight/2};if(a.x<0||a.x>(V.documentElement.clientWidth||S.innerWidth)||a.y<0||a.y>(V.documentElement.clientHeight||S.innerHeight))return!1;let l=V.elementFromPoint(a.x,a.y);for(;l;){if(l===n)return!0;if(l.parentNode)l=l.parentNode;else return!1}}return e||(e=this.el()),!!(r(e)&&s(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const s=R.getComponent("Tech"),r=s&&s.isTech(t),n=R===t||R.prototype.isPrototypeOf(t.prototype);if(r||!n){let l;throw r?l="techs must be registered using Tech.registerTech()":l="must be a Component subclass",new Error(`Illegal component, "${e}"; ${l}.`)}e=ye(e),R.components_||(R.components_={});const a=R.getComponent("Player");if(e==="Player"&&a&&a.players){const l=a.players,u=Object.keys(l);if(l&&u.length>0){for(let f=0;f<u.length;f++)if(l[u[f]]!==null)throw new Error("Can not register Player component after player has been created.")}}return R.components_[e]=t,R.components_[$s(e)]=t,t}static getComponent(e){if(!(!e||!R.components_))return R.components_[e]}}R.registerComponent("Component",R);function ov(i,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${i}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function Zu(i,e,t,s){return ov(i,s,t.length-1),t[s][e]}function wa(i){let e;return i===void 0||i.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:i.length,start:Zu.bind(null,"start",0,i),end:Zu.bind(null,"end",1,i)},S.Symbol&&S.Symbol.iterator&&(e[S.Symbol.iterator]=()=>(i||[]).values()),e}function dt(i,e){return Array.isArray(i)?wa(i):i===void 0||e===void 0?wa():wa([[i,e]])}const vh=function(i,e){i=i<0?0:i;let t=Math.floor(i%60),s=Math.floor(i/60%60),r=Math.floor(i/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(r=s=t="-"),r=r>0||a>0?r+":":"",s=((r||n>=10)&&s<10?"0"+s:s)+":",t=t<10?"0"+t:t,r+s+t};let zo=vh;function yh(i){zo=i}function _h(){zo=vh}function _i(i,e=i){return zo(i,e)}var lv=Object.freeze({__proto__:null,createTimeRanges:dt,createTimeRange:dt,setFormatTime:yh,resetFormatTime:_h,formatTime:_i});function bh(i,e){let t=0,s,r;if(!e)return 0;(!i||!i.length)&&(i=dt(0,0));for(let n=0;n<i.length;n++)s=i.start(n),r=i.end(n),r>e&&(r=e),t+=r-s;return t/e}function ve(i){if(i instanceof ve)return i;typeof i=="number"?this.code=i:typeof i=="string"?this.message=i:Et(i)&&(typeof i.code=="number"&&(this.code=i.code),Object.assign(this,i)),this.message||(this.message=ve.defaultMessages[this.code]||"")}ve.prototype.code=0;ve.prototype.message="";ve.prototype.status=null;ve.prototype.metadata=null;ve.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];ve.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};ve.MEDIA_ERR_CUSTOM=0;ve.prototype.MEDIA_ERR_CUSTOM=0;ve.MEDIA_ERR_ABORTED=1;ve.prototype.MEDIA_ERR_ABORTED=1;ve.MEDIA_ERR_NETWORK=2;ve.prototype.MEDIA_ERR_NETWORK=2;ve.MEDIA_ERR_DECODE=3;ve.prototype.MEDIA_ERR_DECODE=3;ve.MEDIA_ERR_SRC_NOT_SUPPORTED=4;ve.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;ve.MEDIA_ERR_ENCRYPTED=5;ve.prototype.MEDIA_ERR_ENCRYPTED=5;function Gs(i){return i!=null&&typeof i.then=="function"}function _t(i){Gs(i)&&i.then(null,e=>{})}const eo=function(i){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,s,r)=>(i[s]&&(t[s]=i[s]),t),{cues:i.cues&&Array.prototype.map.call(i.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},uv=function(i){const e=i.$$("track"),t=Array.prototype.map.call(e,r=>r.track);return Array.prototype.map.call(e,function(r){const n=eo(r.track);return r.src&&(n.src=r.src),n}).concat(Array.prototype.filter.call(i.textTracks(),function(r){return t.indexOf(r)===-1}).map(eo))},cv=function(i,e){return i.forEach(function(t){const s=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>s.addCue(r))}),e.textTracks()};var to={textTracksToJson:uv,jsonToTextTracks:cv,trackToJson:eo};const Da="vjs-modal-dialog";class ls extends R{constructor(e,t){super(e,t),this.handleKeyDown_=s=>this.handleKeyDown(s),this.close_=s=>this.close(s),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=W("div",{className:`${Da}-content`},{role:"document"}),this.descEl_=W("p",{className:`${Da}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),ei(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Da} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let s=this.getChild("closeButton");if(t&&!s){const r=this.contentEl_;this.contentEl_=this.el_,s=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(s,"close",this.close_)}!t&&s&&(this.off(s,"close",this.close_),this.removeChild(s),s.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),s=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,s.removeChild(t),this.empty(),nh(t,e),this.trigger("modalfill"),r?s.insertBefore(t,r):s.appendChild(t);const n=this.getChild("closeButton");n&&s.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),Hn(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=V.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const t=this.focusableEls_(),s=this.el_.querySelector(":focus");let r;for(let n=0;n<t.length;n++)if(s===t[n]){r=n;break}V.activeElement===this.el_&&(r=0),e.shiftKey&&r===0?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&r===t.length-1&&(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,t=>(t instanceof S.HTMLAnchorElement||t instanceof S.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof S.HTMLInputElement||t instanceof S.HTMLSelectElement||t instanceof S.HTMLTextAreaElement||t instanceof S.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof S.HTMLIFrameElement||t instanceof S.HTMLObjectElement||t instanceof S.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}ls.prototype.options_={pauseOnOpen:!0,temporary:!0};R.registerComponent("ModalDialog",ls);class bi extends tt{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},Ot(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let s=0,r=this.length;s<r;s++)if(this[s]===e){t=this[s],t.off&&t.off(),this.tracks_.splice(s,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let s=0,r=this.length;s<r;s++){const n=this[s];if(n.id===e){t=n;break}}return t}}bi.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const i in bi.prototype.allowedEvents_)bi.prototype["on"+i]=null;const ka=function(i,e){for(let t=0;t<i.length;t++)!Object.keys(i[t]).length||e.id===i[t].id||(i[t].enabled=!1)};class Th extends bi{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){ka(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&ka(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,ka(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const ja=function(i,e){for(let t=0;t<i.length;t++)!Object.keys(i[t]).length||e.id===i[t].id||(i[t].selected=!1)};class xh extends bi{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){ja(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set(){}})}addTrack(e){e.selected&&ja(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,ja(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class $o extends bi{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map(e=>e.toJSON())}}class dv{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,s=e.length;t<s;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),this.trackElements_.indexOf(e)===-1&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let s=0,r=this.trackElements_.length;s<r;s++)if(e===this.trackElements_[s].track){t=this.trackElements_[s];break}return t}removeTrackElement_(e){for(let t=0,s=this.trackElements_.length;t<s;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&typeof this.trackElements_[t].track.off=="function"&&this.trackElements_[t].track.off(),typeof this.trackElements_[t].off=="function"&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}}class pn{constructor(e){pn.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let s=0;const r=e.length;this.cues_=e,this.length_=e.length;const n=function(a){""+a in this||Object.defineProperty(this,""+a,{get(){return this.cues_[a]}})};if(t<r)for(s=t;s<r;s++)n.call(this,s)}getCueById(e){let t=null;for(let s=0,r=this.length;s<r;s++){const n=this[s];if(n.id===e){t=n;break}}return t}}const hv={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},fv={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},pv={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},ec={disabled:"disabled",hidden:"hidden",showing:"showing"};class Go extends tt{constructor(e={}){super();const t={id:e.id||"vjs_track_"+rt(),kind:e.kind||"",language:e.language||""};let s=e.label||"";for(const r in t)Object.defineProperty(this,r,{get(){return t[r]},set(){}});Object.defineProperty(this,"label",{get(){return s},set(r){r!==s&&(s=r,this.trigger("labelchange"))}})}}const Wo=function(i){return new URL(i,V.baseURI)},Sh=function(i){return new URL(i,V.baseURI).href},Xo=function(i){if(typeof i=="string"){const t=i.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():""}return""},Gn=function(i,e=S.location){return Wo(i).origin!==e.origin};var mv=Object.freeze({__proto__:null,parseUrl:Wo,getAbsoluteURL:Sh,getFileExtension:Xo,isCrossOrigin:Gn});const tc=function(i,e){const t=new S.WebVTT.Parser(S,S.vttjs,S.WebVTT.StringDecoder()),s=[];t.oncue=function(r){e.addCue(r)},t.onparsingerror=function(r){s.push(r)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(i),s.length>0&&(S.console&&S.console.groupCollapsed&&S.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),s.forEach(r=>Q.error(r)),S.console&&S.console.groupEnd&&S.console.groupEnd()),t.flush()},ic=function(i,e){const t={uri:i},s=Gn(i);s&&(t.cors=s);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),Xc(t,ce(this,function(n,a,l){if(n)return Q.error(n,a);e.loaded_=!0,typeof S.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],u=>{if(u.type==="vttjserror"){Q.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return tc(l,e)}):tc(l,e)}))};class ur extends Go{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=oe(e,{kind:pv[e.kind]||"subtitles",language:e.language||e.srclang||""});let s=ec[t.mode]||"disabled";const r=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(s="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new pn(this.cues_),a=new pn(this.activeCues_);let l=!1;this.timeupdateHandler=ce(this,function(f={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1),f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const u=()=>{this.stopTracking()};this.tech_.one("dispose",u),s!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return s},set(f){ec[f]&&s!==f&&(s=f,!this.preload_&&s!=="disabled"&&this.cues.length===0&&ic(this.src,this),this.stopTracking(),s!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const f=this.tech_.currentTime(),m=[];for(let v=0,T=this.cues.length;v<T;v++){const E=this.cues[v];E.startTime<=f&&E.endTime>=f&&m.push(E)}if(l=!1,m.length!==this.activeCues_.length)l=!0;else for(let v=0;v<m.length;v++)this.activeCues_.indexOf(m[v])===-1&&(l=!0);return this.activeCues_=m,a.setCues_(this.activeCues_),a},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||t.kind!=="subtitles"&&t.kind!=="captions")&&ic(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new S.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const r in e)r in t||(t[r]=e[r]);t.id=e.id,t.originalCue_=e}const s=this.tech_.textTracks();for(let r=0;r<s.length;r++)s[r]!==this&&s[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}toJSON(){return to.trackToJson(this)}removeCue(e){let t=this.cues_.length;for(;t--;){const s=this.cues_[t];if(s===e||s.originalCue_&&s.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}ur.prototype.allowedEvents_={cuechange:"cuechange"};class Ch extends Go{constructor(e={}){const t=oe(e,{kind:fv[e.kind]||""});super(t);let s=!1;Object.defineProperty(this,"enabled",{get(){return s},set(r){typeof r!="boolean"||r===s||(s=r,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class Eh extends Go{constructor(e={}){const t=oe(e,{kind:hv[e.kind]||""});super(t);let s=!1;Object.defineProperty(this,"selected",{get(){return s},set(r){typeof r!="boolean"||r===s||(s=r,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class Bt extends tt{constructor(e={}){super();let t;const s=new ur(e);this.kind=s.kind,this.src=s.src,this.srclang=s.language,this.label=s.label,this.default=s.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return s}}}),t=Bt.NONE,s.addEventListener("loadeddata",()=>{t=Bt.LOADED,this.trigger({type:"load",target:this})})}}Bt.prototype.allowedEvents_={load:"load"};Bt.NONE=0;Bt.LOADING=1;Bt.LOADED=2;Bt.ERROR=3;const st={audio:{ListClass:Th,TrackClass:Ch,capitalName:"Audio"},video:{ListClass:xh,TrackClass:Eh,capitalName:"Video"},text:{ListClass:$o,TrackClass:ur,capitalName:"Text"}};Object.keys(st).forEach(function(i){st[i].getterName=`${i}Tracks`,st[i].privateName=`${i}Tracks_`});const ss={remoteText:{ListClass:$o,TrackClass:ur,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:dv,TrackClass:Bt,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Fe=Object.assign({},st,ss);ss.names=Object.keys(ss);st.names=Object.keys(st);Fe.names=[].concat(ss.names).concat(st.names);function gv(i,e,t,s,r={}){const n=i.textTracks();r.kind=e,t&&(r.label=t),s&&(r.language=s),r.tech=i;const a=new Fe.text.TrackClass(r);return n.addTrack(a),a}class Y extends R{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=s=>this.onDurationChange(s),this.trackProgress_=s=>this.trackProgress(s),this.trackCurrentTime_=s=>this.trackCurrentTime(s),this.stopTrackingCurrentTime_=s=>this.stopTrackingCurrentTime(s),this.disposeSourceHandler_=s=>this.disposeSourceHandler(s),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),Fe.names.forEach(s=>{const r=Fe[s];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(s=>{e[`native${s}Tracks`]===!1&&(this[`featuresNative${s}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new Fe.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(ce(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return dt(0,0)}bufferedPercent(){return bh(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(st.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const s=this[`${t}Tracks`]()||[];let r=s.length;for(;r--;){const n=s[r];t==="text"&&this.removeRemoteTextTrack(n),s.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const s=e[t];this.removeRemoteTextTrack(s)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new ve(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?dt(0,0):dt()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){st.names.forEach(e=>{const t=st[e],s=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",s),r.addEventListener("addtrack",s),this.on("dispose",()=>{r.removeEventListener("removetrack",s),r.removeEventListener("addtrack",s)})})}addWebVttScript_(){if(!S.WebVTT)if(V.body.contains(this.el())){if(!this.options_["vtt.js"]&&Zi(bu)&&Object.keys(bu).length>0){this.trigger("vttjsloaded");return}const e=V.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),S.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),s=l=>e.addTrack(l.track),r=l=>e.removeTrack(l.track);t.on("addtrack",s),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let l=0;l<e.length;l++){const u=e[l];u.removeEventListener("cuechange",n),u.mode==="showing"&&u.addEventListener("cuechange",n)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",function(){t.off("addtrack",s),t.off("removetrack",r),e.removeEventListener("change",a),e.removeEventListener("addtrack",a),e.removeEventListener("removetrack",a);for(let l=0;l<e.length;l++)e[l].removeEventListener("cuechange",n)})}addTextTrack(e,t,s){if(!e)throw new Error("TextTrack kind is required but was not provided");return gv(this,e,t,s)}createRemoteTextTrack(e){const t=oe(e,{tech:this});return new ss.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const s=this.createRemoteTextTrack(e);return typeof t!="boolean"&&(t=!1),this.remoteTextTrackEls().addTrackElement_(s),this.remoteTextTracks().addTrack(s.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(s.track)),s}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=rt();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return Y.canPlayType(e.type)}static isTech(e){return e.prototype instanceof Y||e instanceof Y||e===Y}static registerTech(e,t){if(Y.techs_||(Y.techs_={}),!Y.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!Y.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!Y.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=ye(e),Y.techs_[e]=t,Y.techs_[$s(e)]=t,e!=="Tech"&&Y.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(Y.techs_&&Y.techs_[e])return Y.techs_[e];if(e=ye(e),S&&S.videojs&&S.videojs[e])return Q.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),S.videojs[e]}}}Fe.names.forEach(function(i){const e=Fe[i];Y.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});Y.prototype.featuresVolumeControl=!0;Y.prototype.featuresMuteControl=!0;Y.prototype.featuresFullscreenResize=!1;Y.prototype.featuresPlaybackRate=!1;Y.prototype.featuresProgressEvents=!1;Y.prototype.featuresSourceset=!1;Y.prototype.featuresTimeupdateEvents=!1;Y.prototype.featuresNativeTextTracks=!1;Y.prototype.featuresVideoFrameCallback=!1;Y.withSourceHandlers=function(i){i.registerSourceHandler=function(t,s){let r=i.sourceHandlers;r||(r=i.sourceHandlers=[]),s===void 0&&(s=r.length),r.splice(s,0,t)},i.canPlayType=function(t){const s=i.sourceHandlers||[];let r;for(let n=0;n<s.length;n++)if(r=s[n].canPlayType(t),r)return r;return""},i.selectSourceHandler=function(t,s){const r=i.sourceHandlers||[];let n;for(let a=0;a<r.length;a++)if(n=r[a].canHandleSource(t,s),n)return r[a];return null},i.canPlaySource=function(t,s){const r=i.selectSourceHandler(t,s);return r?r.canHandleSource(t,s):""},["seekable","seeking","duration"].forEach(function(t){const s=this[t];typeof s=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):s.apply(this,arguments)})},i.prototype),i.prototype.setSource=function(t){let s=i.selectSourceHandler(t,this.options_);s||(i.nativeSourceHandler?s=i.nativeSourceHandler:Q.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),s!==i.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=s.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},i.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}};R.registerComponent("Tech",Y);Y.registerTech("Tech",Y);Y.defaultTechOrder_=[];const mi={},mn={},gn={};function vv(i,e){mi[i]=mi[i]||[],mi[i].push(e)}function yv(i,e,t){i.setTimeout(()=>ui(e,mi[e.type],t,i),1)}function _v(i,e){i.forEach(t=>t.setTech&&t.setTech(e))}function bv(i,e,t){return i.reduceRight(Yo(t),e[t]())}function Tv(i,e,t,s){return e[t](i.reduce(Yo(t),s))}function sc(i,e,t,s=null){const r="call"+ye(t),n=i.reduce(Yo(r),s),a=n===gn,l=a?null:e[t](n);return Cv(i,t,l,a),l}const xv={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Sv={setCurrentTime:1,setMuted:1,setVolume:1},rc={play:1,pause:1};function Yo(i){return(e,t)=>e===gn?gn:t[i]?t[i](e):e}function Cv(i,e,t,s){for(let r=i.length-1;r>=0;r--){const n=i[r];n[e]&&n[e](s,t)}}function Ev(i){mn.hasOwnProperty(i.id())&&delete mn[i.id()]}function Av(i,e){const t=mn[i.id()];let s=null;if(t==null)return s=e(i),mn[i.id()]=[[e,s]],s;for(let r=0;r<t.length;r++){const[n,a]=t[r];n===e&&(s=a)}return s===null&&(s=e(i),t.push([e,s])),s}function ui(i={},e=[],t,s,r=[],n=!1){const[a,...l]=e;if(typeof a=="string")ui(i,mi[a],t,s,r,n);else if(a){const u=Av(s,a);if(!u.setSource)return r.push(u),ui(i,l,t,s,r,n);u.setSource(Object.assign({},i),function(f,m){if(f)return ui(i,l,t,s,r,n);r.push(u),ui(m,i.type===m.type?l:mi[m.type],t,s,r,n)})}else l.length?ui(i,l,t,s,r,n):n?t(i,r):ui(i,mi["*"],t,s,r,!0)}const wv={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},vn=function(i=""){const e=Xo(i);return wv[e.toLowerCase()]||""},Dv=(i,e)=>{if(!e)return"";if(i.cache_.source.src===e&&i.cache_.source.type)return i.cache_.source.type;const t=i.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const s=i.$$("source");for(let r=0;r<s.length;r++){const n=s[r];if(n.type&&n.src&&n.src===e)return n.type}return vn(e)},Ah=function(i){if(Array.isArray(i)){let e=[];i.forEach(function(t){t=Ah(t),Array.isArray(t)?e=e.concat(t):Et(t)&&e.push(t)}),i=e}else typeof i=="string"&&i.trim()?i=[nc({src:i})]:Et(i)&&typeof i.src=="string"&&i.src&&i.src.trim()?i=[nc(i)]:i=[];return i};function nc(i){if(!i.type){const e=vn(i.src);e&&(i.type=e)}return i}var kv=`<svg xmlns="http://www.w3.org/2000/svg">
33
+ */var $a="8.23.3";const It={},Qt=function(i,e){return It[i]=It[i]||[],e&&(It[i]=It[i].concat(e)),It[i]},R2=function(i,e){Qt(i,e)},Nd=function(i,e){const t=Qt(i).indexOf(e);return t<=-1?!1:(It[i]=It[i].slice(),It[i].splice(t,1),!0)},N2=function(i,e){Qt(i,[].concat(e).map(t=>{const s=(...r)=>(Nd(i,s),t(...r));return s}))},nn={prefixed:!0},Yr=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],Xu=Yr[0];let Us;for(let i=0;i<Yr.length;i++)if(Yr[i][1]in V){Us=Yr[i];break}if(Us){for(let i=0;i<Us.length;i++)nn[Xu[i]]=Us[i];nn.prefixed=Us[0]!==Xu[0]}let ze=[];const B2=(i,e,t)=>(s,r,n)=>{const a=e.levels[r],l=new RegExp(`^(${a})$`);let u=i;if(s!=="log"&&n.unshift(s.toUpperCase()+":"),t&&(u=`%c${i}`,n.unshift(t)),n.unshift(u+":"),ze){ze.push([].concat(n));const m=ze.length-1e3;ze.splice(0,m>0?m:0)}if(!S.console)return;let f=S.console[s];!f&&s==="debug"&&(f=S.console.info||S.console.log),!(!f||!a||!l.test(s))&&f[Array.isArray(n)?"apply":"call"](S.console,n)};function Ga(i,e=":",t=""){let s="info",r;function n(...a){r("log",s,a)}return r=B2(i,n,t),n.createLogger=(a,l,u)=>{const f=l!==void 0?l:e,m=u!==void 0?u:t,v=`${i} ${f} ${a}`;return Ga(v,f,m)},n.createNewLogger=(a,l,u)=>Ga(a,l,u),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);s=a}return s},n.history=()=>ze?[].concat(ze):[],n.history.filter=a=>(ze||[]).filter(l=>new RegExp(`.*${a}.*`).test(l[0])),n.history.clear=()=>{ze&&(ze.length=0)},n.history.disable=()=>{ze!==null&&(ze.length=0,ze=null)},n.history.enable=()=>{ze===null&&(ze=[])},n.error=(...a)=>r("error",s,a),n.warn=(...a)=>r("warn",s,a),n.debug=(...a)=>r("debug",s,a),n}const Q=Ga("VIDEOJS"),Bd=Q.createLogger,F2=Object.prototype.toString,Fd=function(i){return Et(i)?Object.keys(i):[]};function Ni(i,e){Fd(i).forEach(t=>e(i[t],t))}function Ud(i,e,t=0){return Fd(i).reduce((s,r)=>e(s,i[r],r),t)}function Et(i){return!!i&&typeof i=="object"}function Zi(i){return Et(i)&&F2.call(i)==="[object Object]"&&i.constructor===Object}function oe(...i){const e={};return i.forEach(t=>{t&&Ni(t,(s,r)=>{if(!Zi(s)){e[r]=s;return}Zi(e[r])||(e[r]={}),e[r]=oe(e[r],s)})}),e}function Vd(i={}){const e=[];for(const t in i)if(i.hasOwnProperty(t)){const s=i[t];e.push(s)}return e}function Pn(i,e,t,s=!0){const r=a=>Object.defineProperty(i,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return s&&(n.set=r),Object.defineProperty(i,e,n)}var U2=Object.freeze({__proto__:null,each:Ni,reduce:Ud,isObject:Et,isPlain:Zi,merge:oe,values:Vd,defineLazyProperty:Pn});let Ro=!1,Hd=null,ft=!1,qd,zd=!1,Bi=!1,Fi=!1,At=!1,No=null,Ln=null;const V2=!!(S.cast&&S.cast.framework&&S.cast.framework.CastReceiverContext);let $d=null,an=!1,On=!1,on=!1,Mn=!1,ln=!1,un=!1,cn=!1;const Zs=!!(ns()&&("ontouchstart"in S||S.navigator.maxTouchPoints||S.DocumentTouch&&S.document instanceof S.DocumentTouch)),Gt=S.navigator&&S.navigator.userAgentData;Gt&&Gt.platform&&Gt.brands&&(ft=Gt.platform==="Android",Bi=!!Gt.brands.find(i=>i.brand==="Microsoft Edge"),Fi=!!Gt.brands.find(i=>i.brand==="Chromium"),At=!Bi&&Fi,No=Ln=(Gt.brands.find(i=>i.brand==="Chromium")||{}).version||null,On=Gt.platform==="Windows");if(!Fi){const i=S.navigator&&S.navigator.userAgent||"";Ro=/iPod/i.test(i),Hd=function(){const e=i.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),ft=/Android/i.test(i),qd=function(){const e=i.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),s=e[2]&&parseFloat(e[2]);return t&&s?parseFloat(e[1]+"."+e[2]):t||null}(),zd=/Firefox/i.test(i),Bi=/Edg/i.test(i),Fi=/Chrome/i.test(i)||/CriOS/i.test(i),At=!Bi&&Fi,No=Ln=function(){const e=i.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),$d=function(){const e=/MSIE\s(\d+)\.\d/.exec(i);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(i)&&/rv:11.0/.test(i)&&(t=11),t}(),ln=/Tizen/i.test(i),un=/Web0S/i.test(i),cn=ln||un,an=/Safari/i.test(i)&&!At&&!ft&&!Bi&&!cn,On=/Windows/i.test(i),on=/iPad/i.test(i)||an&&Zs&&!/iPhone/i.test(i),Mn=/iPhone/i.test(i)&&!on}const Pe=Mn||on||Ro,Rn=(an||Pe)&&!At;var Gd=Object.freeze({__proto__:null,get IS_IPOD(){return Ro},get IOS_VERSION(){return Hd},get IS_ANDROID(){return ft},get ANDROID_VERSION(){return qd},get IS_FIREFOX(){return zd},get IS_EDGE(){return Bi},get IS_CHROMIUM(){return Fi},get IS_CHROME(){return At},get CHROMIUM_VERSION(){return No},get CHROME_VERSION(){return Ln},IS_CHROMECAST_RECEIVER:V2,get IE_VERSION(){return $d},get IS_SAFARI(){return an},get IS_WINDOWS(){return On},get IS_IPAD(){return on},get IS_IPHONE(){return Mn},get IS_TIZEN(){return ln},get IS_WEBOS(){return un},get IS_SMART_TV(){return cn},TOUCH_ENABLED:Zs,IS_IOS:Pe,IS_ANY_SAFARI:Rn});function Yu(i){return typeof i=="string"&&!!i.trim()}function H2(i){if(i.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function ns(){return V===S.document}function as(i){return Et(i)&&i.nodeType===1}function Wd(){try{return S.parent!==S.self}catch{return!0}}function Xd(i){return function(e,t){if(!Yu(e))return V[i](null);Yu(t)&&(t=V.querySelector(t));const s=as(t)?t:V;return s[i]&&s[i](e)}}function W(i="div",e={},t={},s){const r=V.createElement(i);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?ei(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),s&&Bo(r,s),r}function ei(i,e){return typeof i.textContent>"u"?i.innerText=e:i.textContent=e,i}function Wa(i,e){e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}function zs(i,e){return H2(e),i.classList.contains(e)}function pi(i,...e){return i.classList.add(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i}function Nn(i,...e){return i?(i.classList.remove(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i):(Q.warn("removeClass was called with an element that doesn't exist"),null)}function Yd(i,e,t){return typeof t=="function"&&(t=t(i,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(s=>i.classList.toggle(s,t)),i}function Kd(i,e){Object.getOwnPropertyNames(e).forEach(function(t){const s=e[t];s===null||typeof s>"u"||s===!1?i.removeAttribute(t):i.setAttribute(t,s===!0?"":s)})}function Yt(i){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(i&&i.attributes&&i.attributes.length>0){const s=i.attributes;for(let r=s.length-1;r>=0;r--){const n=s[r].name;let a=s[r].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function Qd(i,e){return i.getAttribute(e)}function es(i,e,t){i.setAttribute(e,t)}function Bn(i,e){i.removeAttribute(e)}function Jd(){V.body.focus(),V.onselectstart=function(){return!1}}function Zd(){V.onselectstart=function(){return!0}}function ts(i){if(i&&i.getBoundingClientRect&&i.parentNode){const e=i.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(s=>{e[s]!==void 0&&(t[s]=e[s])}),t.height||(t.height=parseFloat(is(i,"height"))),t.width||(t.width=parseFloat(is(i,"width"))),t}}function er(i){if(!i||i&&!i.offsetParent)return{left:0,top:0,width:0,height:0};const e=i.offsetWidth,t=i.offsetHeight;let s=0,r=0;for(;i.offsetParent&&i!==V[nn.fullscreenElement];)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return{left:s,top:r,width:e,height:t}}function Fn(i,e){const t={x:0,y:0};if(Pe){let m=i;for(;m&&m.nodeName.toLowerCase()!=="html";){const v=is(m,"transform");if(/^matrix/.test(v)){const T=v.slice(7,-1).split(/,\s/).map(Number);t.x+=T[4],t.y+=T[5]}else if(/^matrix3d/.test(v)){const T=v.slice(9,-1).split(/,\s/).map(Number);t.x+=T[12],t.y+=T[13]}if(m.assignedSlot&&m.assignedSlot.parentElement&&S.WebKitCSSMatrix){const T=S.getComputedStyle(m.assignedSlot.parentElement).transform,E=new S.WebKitCSSMatrix(T);t.x+=E.m41,t.y+=E.m42}m=m.parentNode||m.host}}const s={},r=er(e.target),n=er(i),a=n.width,l=n.height;let u=e.offsetY-(n.top-r.top),f=e.offsetX-(n.left-r.left);return e.changedTouches&&(f=e.changedTouches[0].pageX-n.left,u=e.changedTouches[0].pageY+n.top,Pe&&(f-=t.x,u-=t.y)),s.y=1-Math.max(0,Math.min(1,u/l)),s.x=Math.max(0,Math.min(1,f/a)),s}function eh(i){return Et(i)&&i.nodeType===3}function Un(i){for(;i.firstChild;)i.removeChild(i.firstChild);return i}function th(i){return typeof i=="function"&&(i=i()),(Array.isArray(i)?i:[i]).map(e=>{if(typeof e=="function"&&(e=e()),as(e)||eh(e))return e;if(typeof e=="string"&&/\S/.test(e))return V.createTextNode(e)}).filter(e=>e)}function Bo(i,e){return th(e).forEach(t=>i.appendChild(t)),i}function ih(i,e){return Bo(Un(i),e)}function tr(i){return i.button===void 0&&i.buttons===void 0||i.button===0&&i.buttons===void 0||i.type==="mouseup"&&i.button===0&&i.buttons===0||i.type==="mousedown"&&i.button===0&&i.buttons===0?!0:!(i.button!==0||i.buttons!==1)}const Jt=Xd("querySelector"),sh=Xd("querySelectorAll");function is(i,e){if(!i||!e)return"";if(typeof S.getComputedStyle=="function"){let t;try{t=S.getComputedStyle(i)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function rh(i){[...V.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),s=V.createElement("style");s.textContent=t,i.document.head.appendChild(s)}catch{const s=V.createElement("link");s.rel="stylesheet",s.type=e.type,s.media=e.media.mediaText,s.href=e.href,i.document.head.appendChild(s)}})}var nh=Object.freeze({__proto__:null,isReal:ns,isEl:as,isInFrame:Wd,createEl:W,textContent:ei,prependTo:Wa,hasClass:zs,addClass:pi,removeClass:Nn,toggleClass:Yd,setAttributes:Kd,getAttributes:Yt,getAttribute:Qd,setAttribute:es,removeAttribute:Bn,blockTextSelection:Jd,unblockTextSelection:Zd,getBoundingClientRect:ts,findPosition:er,getPointerPosition:Fn,isTextNode:eh,emptyEl:Un,normalizeContent:th,appendContent:Bo,insertContent:ih,isSingleLeftClick:tr,$:Jt,$$:sh,computedStyle:is,copyStyleSheetsToWindow:rh});let ah=!1,Xa;const q2=function(){if(Xa.options.autoSetup===!1)return;const i=Array.prototype.slice.call(V.getElementsByTagName("video")),e=Array.prototype.slice.call(V.getElementsByTagName("audio")),t=Array.prototype.slice.call(V.getElementsByTagName("video-js")),s=i.concat(e,t);if(s&&s.length>0)for(let r=0,n=s.length;r<n;r++){const a=s[r];if(a&&a.getAttribute)a.player===void 0&&a.getAttribute("data-setup")!==null&&Xa(a);else{Ya(1);break}}else ah||Ya(1)};function Ya(i,e){ns()&&(e&&(Xa=e),S.setTimeout(q2,i))}function Ka(){ah=!0,S.removeEventListener("load",Ka)}ns()&&(V.readyState==="complete"?Ka():S.addEventListener("load",Ka));const oh=function(i){const e=V.createElement("style");return e.className=i,e},lh=function(i,e){i.styleSheet?i.styleSheet.cssText=e:i.textContent=e};var He=new WeakMap;const z2=3;let $2=z2;function nt(){return $2++}function Ku(i,e){if(!He.has(i))return;const t=He.get(i);t.handlers[e].length===0&&(delete t.handlers[e],i.removeEventListener?i.removeEventListener(e,t.dispatcher,!1):i.detachEvent&&i.detachEvent("on"+e,t.dispatcher)),Object.getOwnPropertyNames(t.handlers).length<=0&&(delete t.handlers,delete t.dispatcher,delete t.disabled),Object.getOwnPropertyNames(t).length===0&&He.delete(i)}function Fo(i,e,t,s){t.forEach(function(r){i(e,r,s)})}function Vn(i){if(i.fixed_)return i;function e(){return!0}function t(){return!1}if(!i||!i.isPropagationStopped||!i.isImmediatePropagationStopped){const s=i||S.event;i={};const r=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const n in s)r.includes(n)||n==="returnValue"&&s.preventDefault||(i[n]=s[n]);if(i.target||(i.target=i.srcElement||V),i.relatedTarget||(i.relatedTarget=i.fromElement===i.target?i.toElement:i.fromElement),i.preventDefault=function(){s.preventDefault&&s.preventDefault(),i.returnValue=!1,s.returnValue=!1,i.defaultPrevented=!0},i.defaultPrevented=!1,i.stopPropagation=function(){s.stopPropagation&&s.stopPropagation(),i.cancelBubble=!0,s.cancelBubble=!0,i.isPropagationStopped=e},i.isPropagationStopped=t,i.stopImmediatePropagation=function(){s.stopImmediatePropagation&&s.stopImmediatePropagation(),i.isImmediatePropagationStopped=e,i.stopPropagation()},i.isImmediatePropagationStopped=t,i.clientX!==null&&i.clientX!==void 0){const n=V.documentElement,a=V.body;i.pageX=i.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0),i.pageY=i.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}i.which=i.charCode||i.keyCode,i.button!==null&&i.button!==void 0&&(i.button=i.button&1?0:i.button&4?1:i.button&2?2:0)}return i.fixed_=!0,i}let $r;const G2=function(){if(typeof $r!="boolean"){$r=!1;try{const i=Object.defineProperty({},"passive",{get(){$r=!0}});S.addEventListener("test",null,i),S.removeEventListener("test",null,i)}catch{}}return $r},W2=["touchstart","touchmove"];function tt(i,e,t){if(Array.isArray(e))return Fo(tt,i,e,t);He.has(i)||He.set(i,{});const s=He.get(i);if(s.handlers||(s.handlers={}),s.handlers[e]||(s.handlers[e]=[]),t.guid||(t.guid=nt()),s.handlers[e].push(t),s.dispatcher||(s.disabled=!1,s.dispatcher=function(r,n){if(s.disabled)return;r=Vn(r);const a=s.handlers[r.type];if(a){const l=a.slice(0);for(let u=0,f=l.length;u<f&&!r.isImmediatePropagationStopped();u++)try{l[u].call(i,r,n)}catch(m){Q.error(m)}}}),s.handlers[e].length===1)if(i.addEventListener){let r=!1;G2()&&W2.indexOf(e)>-1&&(r={passive:!0}),i.addEventListener(e,s.dispatcher,r)}else i.attachEvent&&i.attachEvent("on"+e,s.dispatcher)}function Le(i,e,t){if(!He.has(i))return;const s=He.get(i);if(!s.handlers)return;if(Array.isArray(e))return Fo(Le,i,e,t);const r=function(a,l){s.handlers[l]=[],Ku(a,l)};if(e===void 0){for(const a in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},a)&&r(i,a);return}const n=s.handlers[e];if(n){if(!t){r(i,e);return}if(t.guid)for(let a=0;a<n.length;a++)n[a].guid===t.guid&&n.splice(a--,1);Ku(i,e)}}function os(i,e,t){const s=He.has(i)?He.get(i):{},r=i.parentNode||i.ownerDocument;if(typeof e=="string"?e={type:e,target:i}:e.target||(e.target=i),e=Vn(e),s.dispatcher&&s.dispatcher.call(i,e,t),r&&!e.isPropagationStopped()&&e.bubbles===!0)os.call(null,r,e,t);else if(!r&&!e.defaultPrevented&&e.target&&e.target[e.type]){He.has(e.target)||He.set(e.target,{});const n=He.get(e.target);e.target[e.type]&&(n.disabled=!0,typeof e.target[e.type]=="function"&&e.target[e.type](),n.disabled=!1)}return!e.defaultPrevented}function Hn(i,e,t){if(Array.isArray(e))return Fo(Hn,i,e,t);const s=function(){Le(i,e,s),t.apply(this,arguments)};s.guid=t.guid=t.guid||nt(),tt(i,e,s)}function Uo(i,e,t){const s=function(){Le(i,e,s),t.apply(this,arguments)};s.guid=t.guid=t.guid||nt(),tt(i,e,s)}var X2=Object.freeze({__proto__:null,fixEvent:Vn,on:tt,off:Le,trigger:os,one:Hn,any:Uo});const at=30,ce=function(i,e,t){e.guid||(e.guid=nt());const s=e.bind(i);return s.guid=t?t+"_"+e.guid:e.guid,s},wt=function(i,e){let t=S.performance.now();return function(...r){const n=S.performance.now();n-t>=e&&(i(...r),t=n)}},uh=function(i,e,t,s=S){let r;const n=()=>{s.clearTimeout(r),r=null},a=function(){const l=this,u=arguments;let f=function(){r=null,f=null,t||i.apply(l,u)};!r&&t&&i.apply(l,u),s.clearTimeout(r),r=s.setTimeout(f,e)};return a.cancel=n,a};var Y2=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:at,bind_:ce,throttle:wt,debounce:uh});let Ls;class it{on(e,t){const s=this.addEventListener;this.addEventListener=()=>{},tt(this,e,t),this.addEventListener=s}off(e,t){Le(this,e,t)}one(e,t){const s=this.addEventListener;this.addEventListener=()=>{},Hn(this,e,t),this.addEventListener=s}any(e,t){const s=this.addEventListener;this.addEventListener=()=>{},Uo(this,e,t),this.addEventListener=s}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=Vn(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),os(this,e)}queueTrigger(e){Ls||(Ls=new Map);const t=e.type||e;let s=Ls.get(this);s||(s=new Map,Ls.set(this,s));const r=s.get(t);s.delete(t),S.clearTimeout(r);const n=S.setTimeout(()=>{s.delete(t),s.size===0&&(s=null,Ls.delete(this)),this.trigger(e)},0);s.set(t,n)}}it.prototype.allowedEvents_={};it.prototype.addEventListener=it.prototype.on;it.prototype.removeEventListener=it.prototype.off;it.prototype.dispatchEvent=it.prototype.trigger;const qn=i=>typeof i.name=="function"?i.name():typeof i.name=="string"?i.name:i.name_?i.name_:i.constructor&&i.constructor.name?i.constructor.name:typeof i,Ot=i=>i instanceof it||!!i.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof i[e]=="function"),K2=(i,e)=>{Ot(i)?e():(i.eventedCallbacks||(i.eventedCallbacks=[]),i.eventedCallbacks.push(e))},Qa=i=>typeof i=="string"&&/\S/.test(i)||Array.isArray(i)&&!!i.length,dn=(i,e,t)=>{if(!i||!i.nodeName&&!Ot(i))throw new Error(`Invalid target for ${qn(e)}#${t}; must be a DOM node or evented object.`)},ch=(i,e,t)=>{if(!Qa(i))throw new Error(`Invalid event type for ${qn(e)}#${t}; must be a non-empty string or array.`)},dh=(i,e,t)=>{if(typeof i!="function")throw new Error(`Invalid listener for ${qn(e)}#${t}; must be a function.`)},Ca=(i,e,t)=>{const s=e.length<3||e[0]===i||e[0]===i.eventBusEl_;let r,n,a;return s?(r=i.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(r=e[0],n=e[1],a=e[2]),dn(r,i,t),ch(n,i,t),dh(a,i,t),a=ce(i,a),{isTargetingSelf:s,target:r,type:n,listener:a}},li=(i,e,t,s)=>{dn(i,i,e),i.nodeName?X2[e](i,t,s):i[e](t,s)},Q2={on(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Ca(this,i,"on");if(li(t,"on",s,r),!e){const n=()=>this.off(t,s,r);n.guid=r.guid;const a=()=>this.off("dispose",n);a.guid=r.guid,li(this,"on","dispose",n),li(t,"on","dispose",a)}},one(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Ca(this,i,"one");if(e)li(t,"one",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,li(t,"one",s,n)}},any(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Ca(this,i,"any");if(e)li(t,"any",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,li(t,"any",s,n)}},off(i,e,t){if(!i||Qa(i))Le(this.eventBusEl_,i,e);else{const s=i,r=e;dn(s,this,"off"),ch(r,this,"off"),dh(t,this,"off"),t=ce(this,t),this.off("dispose",t),s.nodeName?(Le(s,r,t),Le(s,"dispose",t)):Ot(s)&&(s.off(r,t),s.off("dispose",t))}},trigger(i,e){dn(this.eventBusEl_,this,"trigger");const t=i&&typeof i!="string"?i.type:i;if(!Qa(t))throw new Error(`Invalid event type for ${qn(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return os(this.eventBusEl_,i,e)}};function Vo(i,e={}){const{eventBusKey:t}=e;if(t){if(!i[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);i.eventBusEl_=i[t]}else i.eventBusEl_=W("span",{className:"vjs-event-bus"});return Object.assign(i,Q2),i.eventedCallbacks&&i.eventedCallbacks.forEach(s=>{s()}),i.on("dispose",()=>{i.off(),[i,i.el_,i.eventBusEl_].forEach(function(s){s&&He.has(s)&&He.delete(s)}),S.setTimeout(()=>{i.eventBusEl_=null},0)}),i}const J2={state:{},setState(i){typeof i=="function"&&(i=i());let e;return Ni(i,(t,s)=>{this.state[s]!==t&&(e=e||{},e[s]={from:this.state[s],to:t}),this.state[s]=t}),e&&Ot(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function hh(i,e){return Object.assign(i,J2),i.state=Object.assign({},i.state,e),typeof i.handleStateChanged=="function"&&Ot(i)&&i.on("statechanged",i.handleStateChanged),i}const $s=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toLowerCase())},ye=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},fh=function(i,e){return ye(i)===ye(e)};var Z2=Object.freeze({__proto__:null,toLowerCase:$s,toTitleCase:ye,titleCaseEquals:fh});class R{constructor(e,t,s){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=oe({},this.options_),t=this.options_=oe(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${nt()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&(Vo(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),hh(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(s),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=oe(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,s){return W(e,t,s)}localize(e,t,s=e){const r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],l=r&&r.split("-")[0],u=n&&n[l];let f=s;return a&&a[e]?f=a[e]:u&&u[e]&&(f=u[e]),t&&(f=f.replace(/\{(\d+)\}/g,function(m,v){const T=t[v-1];let E=T;return typeof T>"u"&&(E=m),E})),f}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((s,r)=>s.concat(r),[]);let t=this;for(let s=0;s<e.length;s++)if(t=t.getChild(e[s]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const s="http://www.w3.org/2000/svg",r=W("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=V.createElementNS(s,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const a=V.createElementNS(s,"use");return n.appendChild(a),a.setAttributeNS(null,"href",`#vjs-icon-${e}`),r.appendChild(n),this.iconIsSet_?t.replaceChild(r,t.querySelector(".vjs-icon-placeholder")):t.appendChild(r),this.iconIsSet_=!0,r}addChild(e,t={},s=this.children_.length){let r,n;if(typeof e=="string"){n=ye(e);const a=t.componentClass||n;t.name=n;const l=R.getComponent(a);if(!l)throw new Error(`Component ${a} does not exist`);if(typeof l!="function")return null;r=new l(this.player_||this,t)}else r=e;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(s,0,r),r.parentComponent_=this,typeof r.id=="function"&&(this.childIndex_[r.id()]=r),n=n||r.name&&ye(r.name()),n&&(this.childNameIndex_[n]=r,this.childNameIndex_[$s(n)]=r),typeof r.el=="function"&&r.el()){let a=null;this.children_[s+1]&&(this.children_[s+1].el_?a=this.children_[s+1].el_:as(this.children_[s+1])&&(a=this.children_[s+1])),this.contentEl().insertBefore(r.el(),a)}return r}removeChild(e){if(typeof e=="string"&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let r=this.children_.length-1;r>=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[ye(e.name())]=null,this.childNameIndex_[$s(e.name())]=null;const s=e.el();s&&s.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,s=a=>{const l=a.name;let u=a.opts;if(t[l]!==void 0&&(u=t[l]),u===!1)return;u===!0&&(u={}),u.playerOptions=this.options_.playerOptions;const f=this.addChild(l,u);f&&(this[l]=f)};let r;const n=R.getComponent("Tech");Array.isArray(e)?r=e:r=Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(l){return typeof l=="string"?a===l:a===l.name})})).map(a=>{let l,u;return typeof a=="string"?(l=a,u=e[l]||this.options_[l]||{}):(l=a.name,u=a),{name:l,opts:u}}).filter(a=>{const l=R.getComponent(a.opts.componentClass||ye(a.name));return l&&!n.isTech(l)}).forEach(s)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return Jt(e,t||this.contentEl())}$$(e,t){return sh(e,t||this.contentEl())}hasClass(e){return zs(this.el_,e)}addClass(...e){pi(this.el_,...e)}removeClass(...e){Nn(this.el_,...e)}toggleClass(e,t){Yd(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return Qd(this.el_,e)}setAttribute(e,t){es(this.el_,e,t)}removeAttribute(e){Bn(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,s){if(t!==void 0){(t===null||t!==t)&&(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:t==="auto"?this.el_.style[e]="":this.el_.style[e]=t+"px",s||this.trigger("componentresize");return}if(!this.el_)return 0;const r=this.el_.style[e],n=r.indexOf("px");return parseInt(n!==-1?r.slice(0,n):this.el_["offset"+ye(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=is(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const s=`offset${ye(e)}`;t=this.el_[s]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},s={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:t,center:s}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const s=10,r=200;let n;this.on("touchstart",function(l){l.touches.length===1&&(t={pageX:l.touches[0].pageX,pageY:l.touches[0].pageY},e=S.performance.now(),n=!0)}),this.on("touchmove",function(l){if(l.touches.length>1)n=!1;else if(t){const u=l.touches[0].pageX-t.pageX,f=l.touches[0].pageY-t.pageY;Math.sqrt(u*u+f*f)>s&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(l){t=null,n===!0&&S.performance.now()-e<r&&(l.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=ce(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const s=function(r){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",s),this.on("touchcancel",s)}setTimeout(e,t){var s;return e=ce(this,e),this.clearTimersOnDispose_(),s=S.setTimeout(()=>{this.setTimeoutIds_.has(s)&&this.setTimeoutIds_.delete(s),e()},t),this.setTimeoutIds_.add(s),s}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),S.clearTimeout(e)),e}setInterval(e,t){e=ce(this,e),this.clearTimersOnDispose_();const s=S.setInterval(e,t);return this.setIntervalIds_.add(s),s}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),S.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=ce(this,e),t=S.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=ce(this,t);const s=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,s),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),S.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((s,r)=>this[t](r))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(n){const a=S.getComputedStyle(n,null),l=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(l)}function s(n){return!(!t(n.parentElement)||!t(n)||n.style.opacity==="0"||S.getComputedStyle(n).height==="0px"||S.getComputedStyle(n).width==="0px")}function r(n){if(n.offsetWidth+n.offsetHeight+n.getBoundingClientRect().height+n.getBoundingClientRect().width===0)return!1;const a={x:n.getBoundingClientRect().left+n.offsetWidth/2,y:n.getBoundingClientRect().top+n.offsetHeight/2};if(a.x<0||a.x>(V.documentElement.clientWidth||S.innerWidth)||a.y<0||a.y>(V.documentElement.clientHeight||S.innerHeight))return!1;let l=V.elementFromPoint(a.x,a.y);for(;l;){if(l===n)return!0;if(l.parentNode)l=l.parentNode;else return!1}}return e||(e=this.el()),!!(r(e)&&s(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const s=R.getComponent("Tech"),r=s&&s.isTech(t),n=R===t||R.prototype.isPrototypeOf(t.prototype);if(r||!n){let l;throw r?l="techs must be registered using Tech.registerTech()":l="must be a Component subclass",new Error(`Illegal component, "${e}"; ${l}.`)}e=ye(e),R.components_||(R.components_={});const a=R.getComponent("Player");if(e==="Player"&&a&&a.players){const l=a.players,u=Object.keys(l);if(l&&u.length>0){for(let f=0;f<u.length;f++)if(l[u[f]]!==null)throw new Error("Can not register Player component after player has been created.")}}return R.components_[e]=t,R.components_[$s(e)]=t,t}static getComponent(e){if(!(!e||!R.components_))return R.components_[e]}}R.registerComponent("Component",R);function ev(i,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${i}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function Qu(i,e,t,s){return ev(i,s,t.length-1),t[s][e]}function Ea(i){let e;return i===void 0||i.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:i.length,start:Qu.bind(null,"start",0,i),end:Qu.bind(null,"end",1,i)},S.Symbol&&S.Symbol.iterator&&(e[S.Symbol.iterator]=()=>(i||[]).values()),e}function ht(i,e){return Array.isArray(i)?Ea(i):i===void 0||e===void 0?Ea():Ea([[i,e]])}const ph=function(i,e){i=i<0?0:i;let t=Math.floor(i%60),s=Math.floor(i/60%60),r=Math.floor(i/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(r=s=t="-"),r=r>0||a>0?r+":":"",s=((r||n>=10)&&s<10?"0"+s:s)+":",t=t<10?"0"+t:t,r+s+t};let Ho=ph;function mh(i){Ho=i}function gh(){Ho=ph}function _i(i,e=i){return Ho(i,e)}var tv=Object.freeze({__proto__:null,createTimeRanges:ht,createTimeRange:ht,setFormatTime:mh,resetFormatTime:gh,formatTime:_i});function vh(i,e){let t=0,s,r;if(!e)return 0;(!i||!i.length)&&(i=ht(0,0));for(let n=0;n<i.length;n++)s=i.start(n),r=i.end(n),r>e&&(r=e),t+=r-s;return t/e}function ve(i){if(i instanceof ve)return i;typeof i=="number"?this.code=i:typeof i=="string"?this.message=i:Et(i)&&(typeof i.code=="number"&&(this.code=i.code),Object.assign(this,i)),this.message||(this.message=ve.defaultMessages[this.code]||"")}ve.prototype.code=0;ve.prototype.message="";ve.prototype.status=null;ve.prototype.metadata=null;ve.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];ve.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};ve.MEDIA_ERR_CUSTOM=0;ve.prototype.MEDIA_ERR_CUSTOM=0;ve.MEDIA_ERR_ABORTED=1;ve.prototype.MEDIA_ERR_ABORTED=1;ve.MEDIA_ERR_NETWORK=2;ve.prototype.MEDIA_ERR_NETWORK=2;ve.MEDIA_ERR_DECODE=3;ve.prototype.MEDIA_ERR_DECODE=3;ve.MEDIA_ERR_SRC_NOT_SUPPORTED=4;ve.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;ve.MEDIA_ERR_ENCRYPTED=5;ve.prototype.MEDIA_ERR_ENCRYPTED=5;function Gs(i){return i!=null&&typeof i.then=="function"}function _t(i){Gs(i)&&i.then(null,e=>{})}const Ja=function(i){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,s,r)=>(i[s]&&(t[s]=i[s]),t),{cues:i.cues&&Array.prototype.map.call(i.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},iv=function(i){const e=i.$$("track"),t=Array.prototype.map.call(e,r=>r.track);return Array.prototype.map.call(e,function(r){const n=Ja(r.track);return r.src&&(n.src=r.src),n}).concat(Array.prototype.filter.call(i.textTracks(),function(r){return t.indexOf(r)===-1}).map(Ja))},sv=function(i,e){return i.forEach(function(t){const s=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>s.addCue(r))}),e.textTracks()};var Za={textTracksToJson:iv,jsonToTextTracks:sv,trackToJson:Ja};const Aa="vjs-modal-dialog";class ls extends R{constructor(e,t){super(e,t),this.handleKeyDown_=s=>this.handleKeyDown(s),this.close_=s=>this.close(s),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=W("div",{className:`${Aa}-content`},{role:"document"}),this.descEl_=W("p",{className:`${Aa}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),ei(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Aa} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let s=this.getChild("closeButton");if(t&&!s){const r=this.contentEl_;this.contentEl_=this.el_,s=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(s,"close",this.close_)}!t&&s&&(this.off(s,"close",this.close_),this.removeChild(s),s.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),s=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,s.removeChild(t),this.empty(),ih(t,e),this.trigger("modalfill"),r?s.insertBefore(t,r):s.appendChild(t);const n=this.getChild("closeButton");n&&s.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),Un(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=V.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const t=this.focusableEls_(),s=this.el_.querySelector(":focus");let r;for(let n=0;n<t.length;n++)if(s===t[n]){r=n;break}V.activeElement===this.el_&&(r=0),e.shiftKey&&r===0?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&r===t.length-1&&(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,t=>(t instanceof S.HTMLAnchorElement||t instanceof S.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof S.HTMLInputElement||t instanceof S.HTMLSelectElement||t instanceof S.HTMLTextAreaElement||t instanceof S.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof S.HTMLIFrameElement||t instanceof S.HTMLObjectElement||t instanceof S.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}ls.prototype.options_={pauseOnOpen:!0,temporary:!0};R.registerComponent("ModalDialog",ls);class bi extends it{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},Ot(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let s=0,r=this.length;s<r;s++)if(this[s]===e){t=this[s],t.off&&t.off(),this.tracks_.splice(s,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let s=0,r=this.length;s<r;s++){const n=this[s];if(n.id===e){t=n;break}}return t}}bi.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const i in bi.prototype.allowedEvents_)bi.prototype["on"+i]=null;const wa=function(i,e){for(let t=0;t<i.length;t++)!Object.keys(i[t]).length||e.id===i[t].id||(i[t].enabled=!1)};class yh extends bi{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){wa(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&wa(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,wa(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const Da=function(i,e){for(let t=0;t<i.length;t++)!Object.keys(i[t]).length||e.id===i[t].id||(i[t].selected=!1)};class _h extends bi{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Da(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set(){}})}addTrack(e){e.selected&&Da(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Da(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class qo extends bi{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map(e=>e.toJSON())}}class rv{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,s=e.length;t<s;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),this.trackElements_.indexOf(e)===-1&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let s=0,r=this.trackElements_.length;s<r;s++)if(e===this.trackElements_[s].track){t=this.trackElements_[s];break}return t}removeTrackElement_(e){for(let t=0,s=this.trackElements_.length;t<s;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&typeof this.trackElements_[t].track.off=="function"&&this.trackElements_[t].track.off(),typeof this.trackElements_[t].off=="function"&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}}class hn{constructor(e){hn.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let s=0;const r=e.length;this.cues_=e,this.length_=e.length;const n=function(a){""+a in this||Object.defineProperty(this,""+a,{get(){return this.cues_[a]}})};if(t<r)for(s=t;s<r;s++)n.call(this,s)}getCueById(e){let t=null;for(let s=0,r=this.length;s<r;s++){const n=this[s];if(n.id===e){t=n;break}}return t}}const nv={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},av={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},ov={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Ju={disabled:"disabled",hidden:"hidden",showing:"showing"};class zo extends it{constructor(e={}){super();const t={id:e.id||"vjs_track_"+nt(),kind:e.kind||"",language:e.language||""};let s=e.label||"";for(const r in t)Object.defineProperty(this,r,{get(){return t[r]},set(){}});Object.defineProperty(this,"label",{get(){return s},set(r){r!==s&&(s=r,this.trigger("labelchange"))}})}}const $o=function(i){return new URL(i,V.baseURI)},bh=function(i){return new URL(i,V.baseURI).href},Go=function(i){if(typeof i=="string"){const t=i.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():""}return""},zn=function(i,e=S.location){return $o(i).origin!==e.origin};var lv=Object.freeze({__proto__:null,parseUrl:$o,getAbsoluteURL:bh,getFileExtension:Go,isCrossOrigin:zn});const Zu=function(i,e){const t=new S.WebVTT.Parser(S,S.vttjs,S.WebVTT.StringDecoder()),s=[];t.oncue=function(r){e.addCue(r)},t.onparsingerror=function(r){s.push(r)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(i),s.length>0&&(S.console&&S.console.groupCollapsed&&S.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),s.forEach(r=>Q.error(r)),S.console&&S.console.groupEnd&&S.console.groupEnd()),t.flush()},ec=function(i,e){const t={uri:i},s=zn(i);s&&(t.cors=s);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),$c(t,ce(this,function(n,a,l){if(n)return Q.error(n,a);e.loaded_=!0,typeof S.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],u=>{if(u.type==="vttjserror"){Q.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return Zu(l,e)}):Zu(l,e)}))};class lr extends zo{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=oe(e,{kind:ov[e.kind]||"subtitles",language:e.language||e.srclang||""});let s=Ju[t.mode]||"disabled";const r=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(s="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new hn(this.cues_),a=new hn(this.activeCues_);let l=!1;this.timeupdateHandler=ce(this,function(f={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1),f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const u=()=>{this.stopTracking()};this.tech_.one("dispose",u),s!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return s},set(f){Ju[f]&&s!==f&&(s=f,!this.preload_&&s!=="disabled"&&this.cues.length===0&&ec(this.src,this),this.stopTracking(),s!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const f=this.tech_.currentTime(),m=[];for(let v=0,T=this.cues.length;v<T;v++){const E=this.cues[v];E.startTime<=f&&E.endTime>=f&&m.push(E)}if(l=!1,m.length!==this.activeCues_.length)l=!0;else for(let v=0;v<m.length;v++)this.activeCues_.indexOf(m[v])===-1&&(l=!0);return this.activeCues_=m,a.setCues_(this.activeCues_),a},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||t.kind!=="subtitles"&&t.kind!=="captions")&&ec(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new S.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const r in e)r in t||(t[r]=e[r]);t.id=e.id,t.originalCue_=e}const s=this.tech_.textTracks();for(let r=0;r<s.length;r++)s[r]!==this&&s[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}toJSON(){return Za.trackToJson(this)}removeCue(e){let t=this.cues_.length;for(;t--;){const s=this.cues_[t];if(s===e||s.originalCue_&&s.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}lr.prototype.allowedEvents_={cuechange:"cuechange"};class Th extends zo{constructor(e={}){const t=oe(e,{kind:av[e.kind]||""});super(t);let s=!1;Object.defineProperty(this,"enabled",{get(){return s},set(r){typeof r!="boolean"||r===s||(s=r,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class xh extends zo{constructor(e={}){const t=oe(e,{kind:nv[e.kind]||""});super(t);let s=!1;Object.defineProperty(this,"selected",{get(){return s},set(r){typeof r!="boolean"||r===s||(s=r,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class Bt extends it{constructor(e={}){super();let t;const s=new lr(e);this.kind=s.kind,this.src=s.src,this.srclang=s.language,this.label=s.label,this.default=s.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return s}}}),t=Bt.NONE,s.addEventListener("loadeddata",()=>{t=Bt.LOADED,this.trigger({type:"load",target:this})})}}Bt.prototype.allowedEvents_={load:"load"};Bt.NONE=0;Bt.LOADING=1;Bt.LOADED=2;Bt.ERROR=3;const rt={audio:{ListClass:yh,TrackClass:Th,capitalName:"Audio"},video:{ListClass:_h,TrackClass:xh,capitalName:"Video"},text:{ListClass:qo,TrackClass:lr,capitalName:"Text"}};Object.keys(rt).forEach(function(i){rt[i].getterName=`${i}Tracks`,rt[i].privateName=`${i}Tracks_`});const ss={remoteText:{ListClass:qo,TrackClass:lr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:rv,TrackClass:Bt,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Ue=Object.assign({},rt,ss);ss.names=Object.keys(ss);rt.names=Object.keys(rt);Ue.names=[].concat(ss.names).concat(rt.names);function uv(i,e,t,s,r={}){const n=i.textTracks();r.kind=e,t&&(r.label=t),s&&(r.language=s),r.tech=i;const a=new Ue.text.TrackClass(r);return n.addTrack(a),a}class Y extends R{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=s=>this.onDurationChange(s),this.trackProgress_=s=>this.trackProgress(s),this.trackCurrentTime_=s=>this.trackCurrentTime(s),this.stopTrackingCurrentTime_=s=>this.stopTrackingCurrentTime(s),this.disposeSourceHandler_=s=>this.disposeSourceHandler(s),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),Ue.names.forEach(s=>{const r=Ue[s];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(s=>{e[`native${s}Tracks`]===!1&&(this[`featuresNative${s}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new Ue.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(ce(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return ht(0,0)}bufferedPercent(){return vh(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(rt.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const s=this[`${t}Tracks`]()||[];let r=s.length;for(;r--;){const n=s[r];t==="text"&&this.removeRemoteTextTrack(n),s.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const s=e[t];this.removeRemoteTextTrack(s)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new ve(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?ht(0,0):ht()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){rt.names.forEach(e=>{const t=rt[e],s=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",s),r.addEventListener("addtrack",s),this.on("dispose",()=>{r.removeEventListener("removetrack",s),r.removeEventListener("addtrack",s)})})}addWebVttScript_(){if(!S.WebVTT)if(V.body.contains(this.el())){if(!this.options_["vtt.js"]&&Zi(yu)&&Object.keys(yu).length>0){this.trigger("vttjsloaded");return}const e=V.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),S.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),s=l=>e.addTrack(l.track),r=l=>e.removeTrack(l.track);t.on("addtrack",s),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let l=0;l<e.length;l++){const u=e[l];u.removeEventListener("cuechange",n),u.mode==="showing"&&u.addEventListener("cuechange",n)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",function(){t.off("addtrack",s),t.off("removetrack",r),e.removeEventListener("change",a),e.removeEventListener("addtrack",a),e.removeEventListener("removetrack",a);for(let l=0;l<e.length;l++)e[l].removeEventListener("cuechange",n)})}addTextTrack(e,t,s){if(!e)throw new Error("TextTrack kind is required but was not provided");return uv(this,e,t,s)}createRemoteTextTrack(e){const t=oe(e,{tech:this});return new ss.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const s=this.createRemoteTextTrack(e);return typeof t!="boolean"&&(t=!1),this.remoteTextTrackEls().addTrackElement_(s),this.remoteTextTracks().addTrack(s.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(s.track)),s}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=nt();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return Y.canPlayType(e.type)}static isTech(e){return e.prototype instanceof Y||e instanceof Y||e===Y}static registerTech(e,t){if(Y.techs_||(Y.techs_={}),!Y.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!Y.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!Y.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=ye(e),Y.techs_[e]=t,Y.techs_[$s(e)]=t,e!=="Tech"&&Y.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(Y.techs_&&Y.techs_[e])return Y.techs_[e];if(e=ye(e),S&&S.videojs&&S.videojs[e])return Q.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),S.videojs[e]}}}Ue.names.forEach(function(i){const e=Ue[i];Y.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});Y.prototype.featuresVolumeControl=!0;Y.prototype.featuresMuteControl=!0;Y.prototype.featuresFullscreenResize=!1;Y.prototype.featuresPlaybackRate=!1;Y.prototype.featuresProgressEvents=!1;Y.prototype.featuresSourceset=!1;Y.prototype.featuresTimeupdateEvents=!1;Y.prototype.featuresNativeTextTracks=!1;Y.prototype.featuresVideoFrameCallback=!1;Y.withSourceHandlers=function(i){i.registerSourceHandler=function(t,s){let r=i.sourceHandlers;r||(r=i.sourceHandlers=[]),s===void 0&&(s=r.length),r.splice(s,0,t)},i.canPlayType=function(t){const s=i.sourceHandlers||[];let r;for(let n=0;n<s.length;n++)if(r=s[n].canPlayType(t),r)return r;return""},i.selectSourceHandler=function(t,s){const r=i.sourceHandlers||[];let n;for(let a=0;a<r.length;a++)if(n=r[a].canHandleSource(t,s),n)return r[a];return null},i.canPlaySource=function(t,s){const r=i.selectSourceHandler(t,s);return r?r.canHandleSource(t,s):""},["seekable","seeking","duration"].forEach(function(t){const s=this[t];typeof s=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):s.apply(this,arguments)})},i.prototype),i.prototype.setSource=function(t){let s=i.selectSourceHandler(t,this.options_);s||(i.nativeSourceHandler?s=i.nativeSourceHandler:Q.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),s!==i.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=s.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},i.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}};R.registerComponent("Tech",Y);Y.registerTech("Tech",Y);Y.defaultTechOrder_=[];const mi={},fn={},pn={};function cv(i,e){mi[i]=mi[i]||[],mi[i].push(e)}function dv(i,e,t){i.setTimeout(()=>ui(e,mi[e.type],t,i),1)}function hv(i,e){i.forEach(t=>t.setTech&&t.setTech(e))}function fv(i,e,t){return i.reduceRight(Wo(t),e[t]())}function pv(i,e,t,s){return e[t](i.reduce(Wo(t),s))}function tc(i,e,t,s=null){const r="call"+ye(t),n=i.reduce(Wo(r),s),a=n===pn,l=a?null:e[t](n);return vv(i,t,l,a),l}const mv={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},gv={setCurrentTime:1,setMuted:1,setVolume:1},ic={play:1,pause:1};function Wo(i){return(e,t)=>e===pn?pn:t[i]?t[i](e):e}function vv(i,e,t,s){for(let r=i.length-1;r>=0;r--){const n=i[r];n[e]&&n[e](s,t)}}function yv(i){fn.hasOwnProperty(i.id())&&delete fn[i.id()]}function _v(i,e){const t=fn[i.id()];let s=null;if(t==null)return s=e(i),fn[i.id()]=[[e,s]],s;for(let r=0;r<t.length;r++){const[n,a]=t[r];n===e&&(s=a)}return s===null&&(s=e(i),t.push([e,s])),s}function ui(i={},e=[],t,s,r=[],n=!1){const[a,...l]=e;if(typeof a=="string")ui(i,mi[a],t,s,r,n);else if(a){const u=_v(s,a);if(!u.setSource)return r.push(u),ui(i,l,t,s,r,n);u.setSource(Object.assign({},i),function(f,m){if(f)return ui(i,l,t,s,r,n);r.push(u),ui(m,i.type===m.type?l:mi[m.type],t,s,r,n)})}else l.length?ui(i,l,t,s,r,n):n?t(i,r):ui(i,mi["*"],t,s,r,!0)}const bv={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},mn=function(i=""){const e=Go(i);return bv[e.toLowerCase()]||""},Tv=(i,e)=>{if(!e)return"";if(i.cache_.source.src===e&&i.cache_.source.type)return i.cache_.source.type;const t=i.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const s=i.$$("source");for(let r=0;r<s.length;r++){const n=s[r];if(n.type&&n.src&&n.src===e)return n.type}return mn(e)},Sh=function(i){if(Array.isArray(i)){let e=[];i.forEach(function(t){t=Sh(t),Array.isArray(t)?e=e.concat(t):Et(t)&&e.push(t)}),i=e}else typeof i=="string"&&i.trim()?i=[sc({src:i})]:Et(i)&&typeof i.src=="string"&&i.src&&i.src.trim()?i=[sc(i)]:i=[];return i};function sc(i){if(!i.type){const e=mn(i.src);e&&(i.type=e)}return i}var xv=`<svg xmlns="http://www.w3.org/2000/svg">
34
34
  <defs>
35
35
  <symbol viewBox="0 0 48 48" id="vjs-icon-play">
36
36
  <path d="M16 10v28l22-14z"></path>
@@ -172,8 +172,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
172
172
  <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>
173
173
  </symbol>
174
174
  </defs>
175
- </svg>`;const ac=cn?10009:dn?461:8,Ii={codes:{play:415,pause:19,ff:417,rw:412,back:ac},names:{415:"play",19:"pause",417:"ff",412:"rw",[ac]:"back"},isEventKey(i,e){return e=e.toLowerCase(),!!(this.names[i.keyCode]&&this.names[i.keyCode]===e)},getEventName(i){if(this.names[i.keyCode])return this.names[i.keyCode];if(this.codes[i.code]){const e=this.codes[i.code];return this.names[e]}return null}},oc=5;class jv extends tt{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const s=t.key.substring(5).toLowerCase();this.move(s)}else if(Ii.isEventKey(t,"play")||Ii.isEventKey(t,"pause")||Ii.isEventKey(t,"ff")||Ii.isEventKey(t,"rw")){t.preventDefault();const s=Ii.getEventName(t);this.performMediaAction_(s)}else Ii.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+oc);break;case"rw":this.userSeek_(this.player_.currentTime()-oc);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let s=null;const r=this.getCurrentComponent(e.target);t&&(s=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!s||!t)&&(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function s(r){for(const n of r)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&s(n.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_"))if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())){t.push(r);return}else r.hasOwnProperty("children_")&&r.children_.length>0?s(r.children_):r.hasOwnProperty("items")&&r.items.length>0?s(r.items):this.findSuitableDOMChild(r)&&t.push(r);if(r.name_==="ErrorDisplay"&&r.opened_){const n=r.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((l,u)=>{t.push({name:()=>"ModalButton"+(u+1),el:()=>l,getPositions:()=>{const f=l.getBoundingClientRect(),m={x:f.x,y:f.y,width:f.width,height:f.height,top:f.top,right:f.right,bottom:f.bottom,left:f.left},v={x:f.left+f.width/2,y:f.top+f.height/2,width:0,height:0,top:f.top+f.height/2,right:f.left+f.width/2,bottom:f.top+f.height/2,left:f.left+f.width/2};return{boundingClientRect:m,center:v}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:f=>!0,focus:()=>l.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(s){if(e.getIsFocusable(s)&&e.getIsAvailableToBeFocused(s))return s;for(let r=0;r<s.children.length;r++){const n=s.children[r],a=t(n);if(a)return a}return null}return e.el()?t(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||document.activeElement;if(this.focusableComponents.length){for(const s of this.focusableComponents)if(s.el()===t)return s}}add(e){const t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name()){this.focusableComponents.splice(t,1),this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents});return}}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const s=t.getPositions(),r=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(s.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(s.center,r,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,s){let r=1/0,n=null;for(const a of t){const l=a.getPositions().center,u=this.calculateDistance_(e,l,s);u<r&&(r=u,n=a)}return n}isInDirection_(e,t,s){switch(s){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name()){this.focus(this.focusableComponents[e]);return}}else this.focus(this.updateFocusableComponents()[0])}focus(e){typeof e=="object"&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,s){const r=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);let a;switch(s){case"right":case"left":a=r+n*100;break;case"up":a=n*2+r*.5;break;case"down":a=n*5+r;break;default:a=r+n}return a}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents())if(t.constructor.name==="TextTrackSelect"){e.focus(t);break}}}class Iv extends R{constructor(e,t,s){const r=oe({createEl:!1},t);if(super(e,r,s),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,a=t.playerOptions.techOrder;n<a.length;n++){const l=ye(a[n]);let u=Y.getTech(l);if(l||(u=R.getComponent(l)),u&&u.isSupported()){e.loadTech_(l);break}}else e.src(t.playerOptions.sources)}}R.registerComponent("MediaLoader",Iv);class Wn extends R{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=s=>this.handleMouseOver(s),this.handleMouseOut_=s=>this.handleMouseOut(s),this.handleClick_=s=>this.handleClick(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.emitTapEvents(),this.enable()}createEl(e="div",t={},s={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&Q.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),s=Object.assign({role:"button"},s),this.tabIndex_=t.tabIndex;const r=W(e,t,s);return this.player_.options_.experimentalSvgIcons||r.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=W("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const s=this.localize(e);this.controlText_=e,ei(this.controlTextEl_,s),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",s)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}R.registerComponent("ClickableComponent",Wn);class io extends Wn{constructor(e,t){super(e,t),this.update(),this.update_=s=>this.update(s),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return W("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(W("picture",{className:"vjs-poster",tabIndex:-1},{},W("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?_t(this.player_.play()):this.player_.pause())}}io.prototype.crossorigin=io.prototype.crossOrigin;R.registerComponent("PosterImage",io);const it="#222",lc="#ccc",Pv={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Ia(i,e){let t;if(i.length===4)t=i[1]+i[1]+i[2]+i[2]+i[3]+i[3];else if(i.length===7)t=i.slice(1);else throw new Error("Invalid color code provided, "+i+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function gt(i,e,t){try{i.style[e]=t}catch{return}}function uc(i){return i?`${i}px`:""}class Lv extends R{constructor(e,t,s){super(e,t,s);const r=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("useractive",r),e.on("userinactive",r),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(ce(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=S.screen.orientation||S,l=S.screen.orientation?"change":"orientationchange";a.addEventListener(l,n),e.on("dispose",()=>a.removeEventListener(l,n));const u=this.options_.playerOptions.tracks||[];for(let f=0;f<u.length;f++)this.player_.addRemoteTextTrack(u[f],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),s=this.player_.cache_.selectedLanguage;let r,n,a;for(let l=0;l<t.length;l++){const u=t[l];s&&s.enabled&&s.language&&s.language===u.language&&u.kind in e?u.kind===s.kind?a=u:a||(a=u):s&&!s.enabled?(a=null,r=null,n=null):u.default&&(u.kind==="descriptions"&&!r?r=u:u.kind in e&&!n&&(n=u))}a?a.mode="showing":n?n.mode="showing":r&&(r.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){typeof S.WebVTT=="function"&&S.WebVTT.processCues(S,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const a=[];for(let l=0;l<e.length;++l){const u=e[l];u.mode==="showing"&&a.push(u)}this.updateForTrack(a);return}let s=null,r=null,n=e.length;for(;n--;){const a=e[n];a.mode==="showing"&&(a.kind==="descriptions"?s=a:r=a)}if(r?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(r)):s&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(s)),!S.CSS.supports("inset","10px")){const a=this.el_,l=a.querySelectorAll(".vjs-text-track-cue"),u=this.player_.controlBar.el_.getBoundingClientRect().height,f=this.player_.el_.getBoundingClientRect().height;a.style="",gt(a,"position","relative"),gt(a,"height",f-u+"px"),gt(a,"top","unset"),hn?gt(a,"bottom",f+"px"):gt(a,"bottom","0px"),l.length>0&&l.forEach(m=>{if(m.style.inset){const v=m.style.inset.split(" ");v.length===3&&Object.assign(m.style,{top:v[0],right:v[1],bottom:v[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!S.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),s=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(s-r)>.1&&(s>r?n=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),gt(this.el_,"insetInline",uc(n)),gt(this.el_,"insetBlock",uc(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),s=e.activeCues;let r=s.length;for(;r--;){const n=s[r];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&gt(a.firstChild,"color",Ia(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&gt(a.firstChild,"backgroundColor",Ia(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?gt(a,"backgroundColor",Ia(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${it}, 2px 2px 4px ${it}, 2px 2px 5px ${it}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${it}, 2px 2px ${it}, 3px 3px ${it}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${lc}, 0 1px ${lc}, -1px -1px ${it}, 0 -1px ${it}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${it}, 0 0 4px ${it}, 0 0 4px ${it}, 0 0 4px ${it}`)),t.fontPercent&&t.fontPercent!==1){const l=S.parseFloat(a.style.fontSize);a.style.fontSize=l*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=Pv[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof S.WebVTT!="function"||e.every(s=>!s.activeCues))return;const t=[];for(let s=0;s<e.length;++s){const r=e[s];for(let n=0;n<r.activeCues.length;++n)t.push(r.activeCues[n])}S.WebVTT.processCues(S,t,this.el_);for(let s=0;s<e.length;++s){const r=e[s];for(let n=0;n<r.activeCues.length;++n){const a=r.activeCues[n].displayState;pi(a,"vjs-text-track-cue","vjs-text-track-cue-"+(r.language?r.language:s)),r.language&&es(a,"lang",r.language)}this.player_.textTrackSettings&&this.updateDisplayState(r)}}}R.registerComponent("TextTrackDisplay",Lv);class Ov extends R{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),s=W("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),r=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(s),r}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}R.registerComponent("LoadingSpinner",Ov);class Le extends Wn{createEl(e,t={},s={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),s=Object.assign({type:"button"},s);const r=W(e,t,s);return this.player_.options_.experimentalSvgIcons||r.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){const s=this.constructor.name;return Q.warn(`Adding an actionable (user controllable) child to a Button (${s}) is not supported; use a ClickableComponent instead.`),R.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(e.key===" "||e.key==="Enter"){e.stopPropagation();return}super.handleKeyDown(e)}}R.registerComponent("Button",Le);class wh extends Le{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",s=>this.handleMouseDown(s))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(e.type==="tap"||this.mouseused_&&"clientX"in e&&"clientY"in e){_t(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const s=this.player_.getChild("controlBar"),r=s&&s.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}const n=()=>r.focus();Gs(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}wh.prototype.controlText_="Play Video";R.registerComponent("BigPlayButton",wh);class Mv extends Le{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}R.registerComponent("CloseButton",Mv);class Dh extends Le{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",s=>this.handlePlay(s)),this.on(e,"pause",s=>this.handlePause(s)),t.replay&&this.on(e,"ended",s=>this.handleEnded(s))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?_t(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}Dh.prototype.controlText_="Play";R.registerComponent("PlayToggle",Dh);class us extends R{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],s=>this.update(s)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),s=W("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(s),this.contentEl_=W("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=_i(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,Q.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=V.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}us.prototype.labelText_="Time";us.prototype.controlText_="Time";R.registerComponent("TimeDisplay",us);class Ko extends us{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():e&&e.target&&typeof e.target.pendingSeekTime=="function"?t=e.target.pendingSeekTime():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Ko.prototype.labelText_="Current Time";Ko.prototype.controlText_="Current Time";R.registerComponent("CurrentTimeDisplay",Ko);class Qo extends us{constructor(e,t){super(e,t);const s=r=>this.updateContent(r);this.on(e,"durationchange",s),this.on(e,"loadstart",s),this.on(e,"loadedmetadata",s)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}Qo.prototype.labelText_="Duration";Qo.prototype.controlText_="Duration";R.registerComponent("DurationDisplay",Qo);class Rv extends R{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),s=super.createEl("span",{textContent:"/"});return t.appendChild(s),e.appendChild(t),e}}R.registerComponent("TimeDivider",Rv);class Jo extends us{constructor(e,t){super(e,t),this.on(e,"durationchange",s=>this.updateContent(s))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(W("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}}Jo.prototype.labelText_="Remaining Time";Jo.prototype.controlText_="Remaining Time";R.registerComponent("RemainingTimeDisplay",Jo);class Nv extends R{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",s=>this.updateShowing(s))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=W("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(W("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(V.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}R.registerComponent("LiveDisplay",Nv);class kh extends Le{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=s=>this.updateLiveEdgeStatus(s),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=W("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}kh.prototype.controlText_="Seek to live, currently playing live";R.registerComponent("SeekToLive",kh);function cr(i,e,t){return i=Number(i),Math.min(t,Math.max(e,isNaN(i)?e:i))}var Bv=Object.freeze({__proto__:null,clamp:cr});class Zo extends R{constructor(e,t){super(e,t),this.handleMouseDown_=s=>this.handleMouseDown(s),this.handleMouseUp_=s=>this.handleMouseUp(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.handleClick_=s=>this.handleClick(s),this.handleMouseMove_=s=>this.handleMouseMove(s),this.update_=s=>this.update(s),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},s={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),s=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},s),super.createEl(e,t,s)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!At&&e.preventDefault(),th(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;ih(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(cr(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Vn(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,s=t&&t.enabled,r=t&&t.horizontalSeek;s?r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),super.handleKeyDown(e)):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}R.registerComponent("Slider",Zo);const Pa=(i,e)=>cr(i/e*100,0,100).toFixed(2)+"%";class Fv extends R{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",s=>this.update(s))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=W("span",{className:"vjs-control-text"}),s=W("span",{textContent:this.localize("Loaded")}),r=V.createTextNode(": ");return this.percentageEl_=W("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(s),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,s=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,l=Pa(n,r);this.percent_!==l&&(this.el_.style.width=l,ei(this.percentageEl_,l),this.percent_=l);for(let u=0;u<s.length;u++){const f=s.start(u),m=s.end(u);let v=a[u];v||(v=this.el_.appendChild(W()),a[u]=v),!(v.dataset.start===f&&v.dataset.end===m)&&(v.dataset.start=f,v.dataset.end=m,v.style.left=Pa(f,n),v.style.width=Pa(m-f,n))}for(let u=a.length;u>s.length;u--)this.el_.removeChild(a[u-1]);a.length=s.length})}}R.registerComponent("LoadProgressBar",Fv);class Uv extends R{constructor(e,t){super(e,t),this.update=wt(ce(this,this.update),nt)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,s){const r=er(this.el_),n=ts(this.player_.el()),a=e.width*t;if(!n||!r)return;let l=e.left-n.left+a,u=e.width-a+(n.right-e.right);u||(u=e.width-a,l=a);let f=r.width/2;l<f?f+=f-l:u<f&&(f=u),f<0?f=0:f>r.width&&(f=r.width),f=Math.round(f),this.el_.style.right=`-${f}px`,this.write(s)}write(e){ei(this.el_,e)}updateTime(e,t,s,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const l=this.player_.liveTracker.liveWindow(),u=l-t*l;n=(u<1?"":"-")+_i(u,l)}else n=_i(s,a);this.update(e,t,n),r&&r()})}}R.registerComponent("TimeTooltip",Uv);class el extends R{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=wt(ce(this,this.update),nt)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t,s){const r=this.getChild("timeTooltip");if(!r)return;const n=s&&s.target&&typeof s.target.pendingSeekTime=="function"?s.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(e,t,n)}}el.prototype.options_={children:[]};!Ie&&!ht&&el.prototype.options_.children.push("timeTooltip");R.registerComponent("PlayProgressBar",el);class jh extends R{constructor(e,t){super(e,t),this.update=wt(ce(this,this.update),nt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const s=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,s,()=>{this.el_.style.left=`${e.width*t}px`})}}jh.prototype.options_={children:["timeTooltip"]};R.registerComponent("MouseTimeDisplay",jh);class Xn extends Zo{constructor(e,t){t=oe(Xn.prototype.options_,t),t.children=[...t.children];const s=e.options_.disableSeekWhileScrubbingOnMobile&&(Ie||ht)||e.options_.disableSeekWhileScrubbingOnSTV;(!Ie&&!ht||s)&&t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbing_=s,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=ce(this,this.update),this.update=wt(this.update_,nt),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in V&&"visibilityState"in V&&this.on(V,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){V.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,nt))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(V.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const s=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let n=this.player_.duration();r&&r.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==s||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[_i(s,n),_i(n,n)],"{1} of {2}")),this.currentTime_=s,this.duration_=n),this.bar&&this.bar.update(ts(this.el()),this.getProgress(),e)}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}pendingSeekTime(e){if(e!==void 0)if(e!==null){const t=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(e,t))}else this.pendingSeekTime_=null;return this.pendingSeekTime_}getPercent(){if(this.pendingSeekTime()!==null)return this.pendingSeekTime()/this.player_.duration();const e=this.getCurrentTime_();let t;const s=this.player_.liveTracker;return s&&s.isLive()?(t=(e-s.seekableStart())/s.liveWindow(),s.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){tr(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!tr(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let s;const r=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())s=r*this.player_.duration(),s===this.player_.duration()&&(s=s-.1);else{if(r>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),l=n.liveCurrentTime();if(s=a+r*n.liveWindow(),s>=l&&(s=l),s<=a&&(s=a+.1),s===1/0)return}this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(s):this.userSeek_(s),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?_t(this.player_.play()):this.update_()}handlePendingSeek_(e){this.player_.paused()||this.player_.pause();const t=this.pendingSeekTime()!==null?this.pendingSeekTime():this.player_.currentTime();this.pendingSeekTime(t+e),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}stepForward(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const s=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*s):this.userSeek_(this.player_.duration()*s)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in V&&"visibilityState"in V&&this.off(V,"visibilitychange",this.toggleVisibility_),super.dispose()}}Xn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12};R.registerComponent("SeekBar",Xn);class Ih extends R{constructor(e,t){super(e,t),this.handleMouseMove=wt(ce(this,this.handleMouseMove),nt),this.throttledHandleMouseSeek=wt(ce(this,this.handleMouseSeek),nt),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.handleMouseDownHandler_=s=>this.handleMouseDown(s),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const s=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!s&&!r)return;const n=t.el(),a=er(n);let l=Vn(n,e).x;l=cr(l,0,1),r&&r.update(a,l),s&&s.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&_t(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,s=this.getChild("seekBar");s&&s.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}Ih.prototype.options_={children:["seekBar"]};R.registerComponent("ProgressControl",Ih);class Ph extends Le{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],s=>this.handlePictureInPictureChange(s)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],s=>this.handlePictureInPictureEnabledChange(s)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){V.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in S?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof V.exitPictureInPicture=="function"&&super.show()}}Ph.prototype.controlText_="Picture-in-Picture";R.registerComponent("PictureInPictureToggle",Ph);class Lh extends Le{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",s=>this.handleFullscreenChange(s)),V[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}Lh.prototype.controlText_="Fullscreen";R.registerComponent("FullscreenToggle",Lh);const Vv=function(i,e){e.tech_&&!e.tech_.featuresVolumeControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class Hv extends R{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}R.registerComponent("VolumeLevel",Hv);class qv extends R{constructor(e,t){super(e,t),this.update=wt(ce(this,this.update),nt)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,s,r){if(!s){const n=ts(this.el_),a=ts(this.player_.el()),l=e.width*t;if(!a||!n)return;const u=e.left-a.left+l,f=e.width-l+(a.right-e.right);let m=n.width/2;u<m?m+=m-u:f<m&&(m=f),m<0?m=0:m>n.width&&(m=n.width),this.el_.style.right=`-${m}px`}this.write(`${r}%`)}write(e){ei(this.el_,e)}updateVolume(e,t,s,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,s,r.toFixed(0)),n&&n()})}}R.registerComponent("VolumeLevelTooltip",qv);class Oh extends R{constructor(e,t){super(e,t),this.update=wt(ce(this,this.update),nt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,s){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,s,r,()=>{s?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}Oh.prototype.options_={children:["volumeLevelTooltip"]};R.registerComponent("MouseVolumeLevelDisplay",Oh);class Yn extends Zo{constructor(e,t){super(e,t),this.on("slideractive",s=>this.updateLastVolume_(s)),this.on(e,"volumechange",s=>this.updateARIAAttributes(s)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){tr(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const s=this.el(),r=ts(s),n=this.vertical();let a=Vn(s,e);a=n?a.y:a.x,a=cr(a,0,1),t.update(r,a,n)}tr(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Yn.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!Ie&&!ht&&Yn.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Yn.prototype.playerEvent="volumechange";R.registerComponent("VolumeBar",Yn);class Mh extends R{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||Zi(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),Vv(this,e),this.throttledHandleMouseMove=wt(ce(this,this.handleMouseMove),nt),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.on("mousedown",s=>this.handleMouseDown(s)),this.on("touchstart",s=>this.handleMouseDown(s)),this.on("mousemove",s=>this.handleMouseMove(s)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}Mh.prototype.options_={children:["volumeBar"]};R.registerComponent("VolumeControl",Mh);const zv=function(i,e){e.tech_&&!e.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class Rh extends Le{constructor(e,t){super(e,t),zv(this,e),this.on(e,["loadstart","volumechange"],s=>this.update(s))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),s=this.player_.lastVolume_();if(t===0){const r=s<.1?.1:s;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),Ie&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Fn(this.el_,[0,1,2,3].reduce((s,r)=>s+`${r?" ":""}vjs-vol-${r}`,"")),pi(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}Rh.prototype.controlText_="Mute";R.registerComponent("MuteToggle",Rh);class Nh extends R{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||Zi(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=s=>this.handleKeyPress(s),this.on(e,["loadstart"],s=>this.volumePanelState_(s)),this.on(this.muteToggle,"keyup",s=>this.handleKeyPress(s)),this.on(this.volumeControl,"keyup",s=>this.handleVolumeControlKeyUp(s)),this.on("keydown",s=>this.handleKeyPress(s)),this.on("mouseover",s=>this.handleMouseOver(s)),this.on("mouseout",s=>this.handleMouseOut(s)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),et(V,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Pe(V,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Nh.prototype.options_={children:["muteToggle","volumeControl"]};R.registerComponent("VolumePanel",Nh);class Bh extends Le{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()?s.seekableEnd():this.player_.duration();let n;t+this.skipTime<=r?n=t+this.skipTime:n=r,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Bh.prototype.controlText_="Skip Forward";R.registerComponent("SkipForward",Bh);class Fh extends Le{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()&&s.seekableStart();let n;r&&t-this.skipTime<=r?n=r:t>=this.skipTime?n=t-this.skipTime:n=0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Fh.prototype.controlText_="Skip Backward";R.registerComponent("SkipBackward",Fh);class Uh extends R{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",s=>this.handleKeyDown(s)),this.boundHandleBlur_=s=>this.handleBlur(s),this.boundHandleTapClick_=s=>this.handleTapClick(s)}addEventListenerForItem(e){e instanceof R&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof R&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=W(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),et(t,"click",function(s){s.preventDefault(),s.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||V.activeElement;if(!this.children().some(s=>s.el()===t)){const s=this.menuButton_;s&&s.buttonPressed_&&t!==s.el().firstChild&&s.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const s=t.filter(r=>r.el()===e.target)[0];if(!s)return;s.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}R.registerComponent("Menu",Uh);class tl extends R{constructor(e,t={}){super(e,t),this.menuButton_=new Le(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const s=Le.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+s,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),et(V,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new Uh(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=W("li",{className:"vjs-menu-title",textContent:ye(this.options_.title),tabIndex:-1}),s=new R(this.player_,{el:t});e.addItem(s)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";const t=Le.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),Pe(V,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){e.key==="Escape"||e.key==="Tab"?(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus())):(e.key==="Up"||e.key==="Down"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(e.key==="Escape"||e.key==="Tab")&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(e.key==="Escape"||e.key==="Tab")&&(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Ie&&Kd())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}R.registerComponent("MenuButton",tl);class il extends tl{constructor(e,t){const s=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!s)return;const r=ce(this,this.update);s.addEventListener("removetrack",r),s.addEventListener("addtrack",r),s.addEventListener("labelchange",r),this.player_.on("ready",r),this.player_.on("dispose",function(){s.removeEventListener("removetrack",r),s.removeEventListener("addtrack",r),s.removeEventListener("labelchange",r)})}}R.registerComponent("TrackButton",il);class dr extends Wn{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,s){this.nonIconControl=!0;const r=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),s),n=W("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(n):r.replaceChild(n,r.querySelector(".vjs-icon-placeholder")),r}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}R.registerComponent("MenuItem",dr);class hr extends dr{constructor(e,t){const s=t.track,r=e.textTracks();t.label=s.label||s.language||"Unknown",t.selected=s.mode==="showing",super(e,t),this.track=s,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const n=(...l)=>{this.handleTracksChange.apply(this,l)},a=(...l)=>{this.handleSelectedLanguageChange.apply(this,l)};if(e.on(["loadstart","texttrackchange"],n),r.addEventListener("change",n),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),r.removeEventListener("change",n),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let l;this.on(["tap","click"],function(){if(typeof S.Event!="object")try{l=new S.Event("change")}catch{}l||(l=V.createEvent("Event"),l.initEvent("change",!0,!0)),r.dispatchEvent(l)})}this.handleTracksChange()}handleClick(e){const t=this.track,s=this.player_.textTracks();if(super.handleClick(e),!!s)for(let r=0;r<s.length;r++){const n=s[r];this.kinds.indexOf(n.kind)!==-1&&(n===t?n.mode!=="showing"&&(n.mode="showing"):n.mode!=="disabled"&&(n.mode="disabled"))}}handleTracksChange(e){const t=this.track.mode==="showing";t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if(this.track.mode==="showing"){const t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}R.registerComponent("TextTrackMenuItem",hr);class Vh extends hr{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let s=!0;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(this.options_.kinds.indexOf(a.kind)>-1&&a.mode==="showing"){s=!1;break}}s!==this.isSelected_&&this.selected(s)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let s=!0;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&a.mode==="showing"){s=!1;break}}s&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}R.registerComponent("OffTextTrackMenuItem",Vh);class cs extends il{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=hr){let s;this.label_&&(s=`${this.label_} off`),e.push(new Vh(this.player_,{kinds:this.kinds_,kind:this.kind_,label:s})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<r.length;n++){const a=r[n];if(this.kinds_.indexOf(a.kind)>-1){const l=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});l.addClass(`vjs-${a.kind}-menu-item`),e.push(l)}}return e}}R.registerComponent("TextTrackButton",cs);class Hh extends dr{constructor(e,t){const s=t.track,r=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=n&&n<r.endTime,super(e,t),this.track=s,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}R.registerComponent("ChaptersTrackMenuItem",Hh);class sl extends cs{constructor(e,t,s){super(e,t,s),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const s=e[t];if(s.kind===this.kind_)return s}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(ye(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let s=0,r=t.length;s<r;s++){const n=t[s],a=new Hh(this.player_,{track:this.track_,cue:n});e.push(a)}return e}}sl.prototype.kind_="chapters";sl.prototype.controlText_="Chapters";R.registerComponent("ChaptersButton",sl);class rl extends cs{constructor(e,t,s){super(e,t,s),this.setIcon("audio-description");const r=e.textTracks(),n=ce(this,this.handleTracksChange);r.addEventListener("change",n),this.on("dispose",function(){r.removeEventListener("change",n)})}handleTracksChange(e){const t=this.player().textTracks();let s=!1;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(a.kind!==this.kind_&&a.mode==="showing"){s=!0;break}}s?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}rl.prototype.kind_="descriptions";rl.prototype.controlText_="Descriptions";R.registerComponent("DescriptionsButton",rl);class nl extends cs{constructor(e,t,s){super(e,t,s),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}nl.prototype.kind_="subtitles";nl.prototype.controlText_="Subtitles";R.registerComponent("SubtitlesButton",nl);class al extends hr{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}R.registerComponent("CaptionSettingsMenuItem",al);class ol extends cs{constructor(e,t,s){super(e,t,s),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new al(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}ol.prototype.kind_="captions";ol.prototype.controlText_="Captions";R.registerComponent("CaptionsButton",ol);class qh extends hr{createEl(e,t,s){const r=super.createEl(e,t,s),n=r.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",r):n.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(W("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}}R.registerComponent("SubsCapsMenuItem",qh);class ll extends cs{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(ye(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new al(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,qh),e}}ll.prototype.kinds_=["captions","subtitles"];ll.prototype.controlText_="Subtitles";R.registerComponent("SubsCapsButton",ll);class zh extends dr{constructor(e,t){const s=t.track,r=e.audioTracks();t.label=s.label||s.language||"Unknown",t.selected=s.enabled,super(e,t),this.track=s,this.addClass(`vjs-${s.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",n),this.on("dispose",()=>{r.removeEventListener("change",n)})}createEl(e,t,s){const r=super.createEl(e,t,s),n=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(W("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let s=0;s<t.length;s++){const r=t[s];r!==this.track&&(r.enabled=r===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}R.registerComponent("AudioTrackMenuItem",zh);class $h extends il{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let s=0;s<t.length;s++){const r=t[s];e.push(new zh(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}}$h.prototype.controlText_="Audio Track";R.registerComponent("AudioTrackButton",$h);class ul extends dr{constructor(e,t){const s=t.rate,r=parseFloat(s,10);t.label=s,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=s,this.rate=r,this.on(e,"ratechange",n=>this.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}ul.prototype.contentElType="button";R.registerComponent("PlaybackRateMenuItem",ul);class Gh extends tl{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",s=>this.updateVisibility(s)),this.on(e,"ratechange",s=>this.updateLabel(s)),this.on(e,"playbackrateschange",s=>this.handlePlaybackRateschange(s))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=W("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let s=e.length-1;s>=0;s--)t.push(new ul(this.player(),{rate:e[s]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}Gh.prototype.controlText_="Playback Rate";R.registerComponent("PlaybackRateMenuButton",Gh);class Wh extends R{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},s={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,s)}}R.registerComponent("Spacer",Wh);class $v extends Wh{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}R.registerComponent("CustomControlSpacer",$v);class Xh extends R{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Xh.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};R.registerComponent("ControlBar",Xh);class Yh extends ls{constructor(e,t){super(e,t),this.on(e,"error",s=>{this.open(s)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Yh.prototype.options_=Object.assign({},ls.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});R.registerComponent("ErrorDisplay",Yh);class Kh extends R{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),W("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const s=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${rt()}`)+"-"+t[1].replace(/\W+/g,""),r=W("option",{id:s,value:this.localize(t[0]),textContent:this.localize(t[1])});return r.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${s}`),r}))}}R.registerComponent("TextTrackSelect",Kh);class gi extends R{constructor(e,t={}){super(e,t);const s=W("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(s);const r=this.options_.selects;for(const n of r){const a=this.options_.selectConfigs[n],l=a.className,u=a.id.replace("%s",this.options_.id_);let f=null;const m=`vjs_select_${rt()}`;if(this.options_.type==="colors"){f=W("span",{className:l});const T=W("label",{id:u,className:"vjs-label",textContent:this.localize(a.label)});T.setAttribute("for",m),f.appendChild(T)}const v=new Kh(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:m,labelId:u});this.addChild(v),this.options_.type==="colors"&&(f.appendChild(v.el()),this.el().appendChild(f))}}createEl(){return W("fieldset",{className:this.options_.className})}}R.registerComponent("TextTrackFieldset",gi);class Qh extends R{constructor(e,t={}){super(e,t);const s=this.options_.textTrackComponentid,r=new gi(e,{id_:s,legendId:`captions-text-legend-${s}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const n=new gi(e,{id_:s,legendId:`captions-background-${s}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const a=new gi(e,{id_:s,legendId:`captions-window-${s}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return W("div",{className:"vjs-track-settings-colors"})}}R.registerComponent("TextTrackSettingsColors",Qh);class Jh extends R{constructor(e,t={}){super(e,t);const s=this.options_.textTrackComponentid,r=new gi(e,{id_:s,legendId:`captions-font-size-${s}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const n=new gi(e,{id_:s,legendId:`captions-edge-style-${s}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const a=new gi(e,{id_:s,legendId:`captions-font-family-${s}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return W("div",{className:"vjs-track-settings-font"})}}R.registerComponent("TextTrackSettingsFont",Jh);class Zh extends R{constructor(e,t={}){super(e,t);const s=new Le(e,{controlText:this.localize("restore all settings to the default values"),className:"vjs-default-button"});s.el().classList.remove("vjs-control","vjs-button"),s.el().textContent=this.localize("Reset"),this.addChild(s);const r=this.localize("Done"),n=new Le(e,{controlText:r,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=r,this.addChild(n)}createEl(){return W("div",{className:"vjs-track-settings-controls"})}}R.registerComponent("TrackSettingsControls",Zh);const La="vjs-text-track-settings",cc=["#000","Black"],dc=["#00F","Blue"],hc=["#0FF","Cyan"],fc=["#0F0","Green"],pc=["#F0F","Magenta"],mc=["#F00","Red"],gc=["#FFF","White"],vc=["#FF0","Yellow"],Oa=["1","Opaque"],Ma=["0.5","Semi-Transparent"],yc=["0","Transparent"],Kt={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[cc,gc,mc,fc,dc,vc,pc,hc],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Oa,Ma,yc],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[gc,cc,mc,fc,dc,vc,pc,hc],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:i=>i==="1.00"?null:Number(i)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Oa,Ma],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[yc,Ma,Oa],className:"vjs-window-opacity vjs-opacity"}};Kt.windowColor.options=Kt.backgroundColor.options;function ef(i,e){if(e&&(i=e(i)),i&&i!=="none")return i}function Gv(i,e){const t=i.options[i.options.selectedIndex].value;return ef(t,e)}function Wv(i,e,t){if(e){for(let s=0;s<i.options.length;s++)if(ef(i.options[s].value,t)===e){i.selectedIndex=s;break}}}class Xv extends ls{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=W("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),t.persistTextTrackSettings===void 0&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){const t=new Qh(e,{textTrackComponentid:this.id_,selectConfigs:Kt,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const s=new Jh(e,{textTrackComponentid:this.id_,selectConfigs:Kt,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(s);const r=new Zh(e);this.addChild(r)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),Ni(Kt,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return qd(Kt,(e,t,s)=>{const r=Gv(this.$(t.selector),t.parser);return r!==void 0&&(e[s]=r),e},{})}setValues(e){Ni(Kt,(t,s)=>{Wv(this.$(t.selector),e[s],t.parser)})}setDefaults(){Ni(Kt,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(S.localStorage.getItem(La))}catch(t){Q.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?S.localStorage.setItem(La,JSON.stringify(e)):S.localStorage.removeItem(La)}catch(t){Q.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}R.registerComponent("TextTrackSettings",Xv);class Yv extends R{constructor(e,t){let s=t.ResizeObserver||S.ResizeObserver;t.ResizeObserver===null&&(s=!1);const r=oe({createEl:!s,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||S.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=hh(()=>{this.resizeHandler()},100,!1,this),s?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const n=this.debouncedHandler_;let a=this.unloadListener_=function(){Pe(this,"resize",n),Pe(this,"unload",a),a=null};et(this.el_.contentWindow,"unload",a),et(this.el_.contentWindow,"resize",n)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}R.registerComponent("ResizeManager",Yv);const Kv={trackingThreshold:20,liveTolerance:15};class Qv extends R{constructor(e,t){const s=oe(Kv,t,{createEl:!1});super(e,s),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=r=>this.handlePlay(r),this.handleFirstTimeupdate_=r=>this.handleFirstTimeupdate(r),this.handleSeeked_=r=>this.handleSeeked(r),this.seekToLiveEdge_=r=>this.seekToLiveEdge(r),this.reset_(),this.on(this.player_,"durationchange",r=>this.handleDurationchange(r)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(S.performance.now().toFixed(4)),s=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+s;const r=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-n)>this.options_.liveTolerance;(!this.timeupdateSeen_||r===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,nt),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.end(s));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.start(s));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}R.registerComponent("LiveTracker",Qv);class Jv extends R{constructor(e,t){super(e,t),this.on("statechanged",s=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:W("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${rt()}`}),description:W("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${rt()}`})},W("div",{className:"vjs-title-bar"},{},zd(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,s={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const n=this.state[r],a=this.els[r],l=s[r];Hn(a),n&&ei(a,n),t&&(t.removeAttribute(l),n&&t.setAttribute(l,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}R.registerComponent("TitleBar",Jv);const Zv={initialDisplay:4e3,position:[],takeFocus:!1};class ey extends Le{constructor(e,t){t=oe(Zv,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],s=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=W("button",{},{type:"button",class:this.buildCSSClass()},W("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}R.registerComponent("TransientButton",ey);const so=i=>{const e=i.el();if(e.hasAttribute("src"))return i.triggerSourceset(e.src),!0;const t=i.$$("source"),s=[];let r="";if(!t.length)return!1;for(let n=0;n<t.length;n++){const a=t[n].src;a&&s.indexOf(a)===-1&&s.push(a)}return s.length?(s.length===1&&(r=s[0]),i.triggerSourceset(r),!0):!1},ty=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(i){const e=V.createElement(this.nodeName.toLowerCase());e.innerHTML=i;const t=V.createDocumentFragment();for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);return this.innerText="",S.Element.prototype.appendChild.call(this,t),this.innerHTML}}),tf=(i,e)=>{let t={};for(let s=0;s<i.length&&(t=Object.getOwnPropertyDescriptor(i[s],e),!(t&&t.set&&t.get));s++);return t.enumerable=!0,t.configurable=!0,t},iy=i=>tf([i.el(),S.HTMLMediaElement.prototype,S.Element.prototype,ty],"innerHTML"),_c=function(i){const e=i.el();if(e.resetSourceWatch_)return;const t={},s=iy(i),r=n=>(...a)=>{const l=n.apply(e,a);return so(i),l};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",oe(s,{set:r(s.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",s)},i.one("sourceset",e.resetSourceWatch_)},sy=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Sh(S.Element.prototype.getAttribute.call(this,"src")):""},set(i){return S.Element.prototype.setAttribute.call(this,"src",i),i}}),ry=i=>tf([i.el(),S.HTMLMediaElement.prototype,sy],"src"),ny=function(i){if(!i.featuresSourceset)return;const e=i.el();if(e.resetSourceset_)return;const t=ry(i),s=e.setAttribute,r=e.load;Object.defineProperty(e,"src",oe(t,{set:n=>{const a=t.set.call(e,n);return i.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const l=s.call(e,n,a);return/src/i.test(n)&&i.triggerSourceset(e.src),l},e.load=()=>{const n=r.call(e);return so(i)||(i.triggerSourceset(""),_c(i)),n},e.currentSrc?i.triggerSourceset(e.currentSrc):so(i)||_c(i),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=s,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class q extends Y{constructor(e,t){super(e,t);const s=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",s&&(this.el_.currentSrc!==s.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(s):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const l=[];for(;a--;){const u=n[a];u.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(u),this.remoteTextTracks().addTrack(u.track),this.textTracks().addTrack(u.track),!r&&!this.el_.hasAttribute("crossorigin")&&Gn(u.src)&&(r=!0)):l.push(u))}for(let u=0;u<l.length;u++)this.el_.removeChild(l[u])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&Q.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
176
- This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(Zs||Nn)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),q.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){ny(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const s=()=>{t=[];for(let n=0;n<e.length;n++){const a=e[n];a.kind==="metadata"&&t.push({track:a,storedMode:a.mode})}};s(),e.addEventListener("change",s),this.on("dispose",()=>e.removeEventListener("change",s));const r=()=>{for(let n=0;n<t.length;n++){const a=t[n];a.track.mode==="disabled"&&a.track.mode!==a.storedMode&&(a.track.mode=a.storedMode)}e.removeEventListener("change",r)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",s),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",s),e.addEventListener("change",s),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const s=e.toLowerCase();this[`${s}TracksListeners_`]&&Object.keys(this[`${s}TracksListeners_`]).forEach(r=>{this.el()[`${s}Tracks`].removeEventListener(r,this[`${s}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${s}TracksListeners_`]=null,this.proxyNativeTracksForType_(s)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=st[e],s=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!s||!s.addEventListener)return;const n={change:l=>{const u={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(u),e==="text"&&this[ss.remoteText.getterName]().trigger(u)},addtrack(l){r.addTrack(l.track)},removetrack(l){r.removeTrack(l.track)}},a=function(){const l=[];for(let u=0;u<r.length;u++){let f=!1;for(let m=0;m<s.length;m++)if(s[m]===r[u]){f=!0;break}f||l.push(r[u])}for(;l.length;)r.removeTrack(l.shift())};this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach(l=>{const u=n[l];s.addEventListener(l,u),this.on("dispose",f=>s.removeEventListener(l,u))}),this.on("loadstart",a),this.on("dispose",l=>this.off("loadstart",a))}proxyNativeTracks_(){st.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const s=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(s,e),q.disposeMediaElement(e),e=s}else{e=V.createElement("video");const s=this.options_.tag&&Yt(this.options_.tag),r=oe({},s);(!Zs||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,Zd(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&es(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let s=0;s<t.length;s++){const r=t[s],n=this.options_[r];typeof n<"u"&&(n?es(e,r,r):Un(e,r),e[r]=n)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let s=!1;const r=function(){s=!0};this.on("loadstart",r);const n=function(){s||this.trigger("loadstart")};this.on("loadedmetadata",n),this.ready(function(){this.off("loadstart",r),this.off("loadedmetadata",n),s||this.trigger("loadstart")});return}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(s){this.trigger(s)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Bn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){Q(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&ht&&At&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)_t(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return Q.error("Invalid source URL."),!1;const s={src:e};t&&(s.type=t);const r=W("source",{},s);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return Q.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const s of t)if(s.src===e)return this.el_.removeChild(s),!0;return Q.warn(`No matching source element found with src: ${e}`),!1}reset(){q.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,s){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,s):super.addTextTrack(e,t,s)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=V.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const s=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(s),s}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let s=t.length;for(;s--;)(e===t[s]||e===t[s].track)&&this.el().removeChild(t[s])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),S.performance&&(e.creationTime=S.performance.now()),e}}On(q,"TEST_VID",function(){if(!ns())return;const i=V.createElement("video"),e=V.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",i.appendChild(e),i});q.isSupported=function(){try{q.TEST_VID.volume=.5}catch{return!1}return!!(q.TEST_VID&&q.TEST_VID.canPlayType)};q.canPlayType=function(i){return q.TEST_VID.canPlayType(i)};q.canPlaySource=function(i,e){return q.canPlayType(i.type)};q.canControlVolume=function(){try{const i=q.TEST_VID.volume;q.TEST_VID.volume=i/2+.1;const e=i!==q.TEST_VID.volume;return e&&Ie?(S.setTimeout(()=>{q&&q.prototype&&(q.prototype.featuresVolumeControl=i!==q.TEST_VID.volume)}),!1):e}catch{return!1}};q.canMuteVolume=function(){try{const i=q.TEST_VID.muted;return q.TEST_VID.muted=!i,q.TEST_VID.muted?es(q.TEST_VID,"muted","muted"):Un(q.TEST_VID,"muted","muted"),i!==q.TEST_VID.muted}catch{return!1}};q.canControlPlaybackRate=function(){if(ht&&At&&Mn<58)return!1;try{const i=q.TEST_VID.playbackRate;return q.TEST_VID.playbackRate=i/2+.1,i!==q.TEST_VID.playbackRate}catch{return!1}};q.canOverrideAttributes=function(){try{const i=()=>{};Object.defineProperty(V.createElement("video"),"src",{get:i,set:i}),Object.defineProperty(V.createElement("audio"),"src",{get:i,set:i}),Object.defineProperty(V.createElement("video"),"innerHTML",{get:i,set:i}),Object.defineProperty(V.createElement("audio"),"innerHTML",{get:i,set:i})}catch{return!1}return!0};q.supportsNativeTextTracks=function(){return Bn||Ie&&At};q.supportsNativeVideoTracks=function(){return!!(q.TEST_VID&&q.TEST_VID.videoTracks)};q.supportsNativeAudioTracks=function(){return!!(q.TEST_VID&&q.TEST_VID.audioTracks)};q.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([i,e]){On(q.prototype,i,()=>q[e](),!0)});q.prototype.featuresVolumeControl=q.canControlVolume();q.prototype.movingMediaElementInDOM=!Ie;q.prototype.featuresFullscreenResize=!0;q.prototype.featuresProgressEvents=!0;q.prototype.featuresTimeupdateEvents=!0;q.prototype.featuresVideoFrameCallback=!!(q.TEST_VID&&q.TEST_VID.requestVideoFrameCallback);q.disposeMediaElement=function(i){if(i){for(i.parentNode&&i.parentNode.removeChild(i);i.hasChildNodes();)i.removeChild(i.firstChild);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()}};q.resetMediaElement=function(i){if(!i)return;const e=i.querySelectorAll("source");let t=e.length;for(;t--;)i.removeChild(e[t]);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(i){q.prototype[i]=function(){return this.el_[i]||this.el_.hasAttribute(i)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(i){q.prototype["set"+ye(i)]=function(e){this.el_[i]=e,e?this.el_.setAttribute(i,i):this.el_.removeAttribute(i)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(i){q.prototype[i]=function(){return this.el_[i]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(i){q.prototype["set"+ye(i)]=function(e){this.el_[i]=e}});["pause","load","play"].forEach(function(i){q.prototype[i]=function(){return this.el_[i]()}});Y.withSourceHandlers(q);q.nativeSourceHandler={};q.nativeSourceHandler.canPlayType=function(i){try{return q.TEST_VID.canPlayType(i)}catch{return""}};q.nativeSourceHandler.canHandleSource=function(i,e){if(i.type)return q.nativeSourceHandler.canPlayType(i.type);if(i.src){const t=Xo(i.src);return q.nativeSourceHandler.canPlayType(`video/${t}`)}return""};q.nativeSourceHandler.handleSource=function(i,e,t){e.setSrc(i.src)};q.nativeSourceHandler.dispose=function(){};q.registerSourceHandler(q.nativeSourceHandler);Y.registerTech("Html5",q);const sf=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ra={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},ro=["tiny","xsmall","small","medium","large","xlarge","huge"],Qr={};ro.forEach(i=>{const e=i.charAt(0)==="x"?`x-${i.substring(1)}`:i;Qr[i]=`vjs-layout-${e}`});const ay={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class te extends R{constructor(e,t,s){if(e.id=e.id||t.id||`vjs_video_${rt()}`,t=Object.assign(te.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,s),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=Vd(this.id_),this.fsApi_=on,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&Yt(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(l){a[l.toLowerCase()]=t.languages[l]}),this.languages_=a}else this.languages_=te.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),qo(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(et(V,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=oe(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const l=new S.DOMParser().parseFromString(kv,"image/svg+xml");if(l.querySelector("parsererror"))Q.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const f=l.documentElement;f.style.display="none",this.el_.appendChild(f),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new jv(this),this.addClass("vjs-spatial-navigation-enabled")),Zs&&this.addClass("vjs-touch-enabled"),Ie||this.addClass("vjs-workinghover"),te.players[this.id_]=this;const n=Wa.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),Pe(V,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Pe(V,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),te.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),Ev(this),Fe.names.forEach(e=>{const t=Fe[e],s=this[t.getterName]();s&&s.off&&s.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,s=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";s?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl("div"));const n=Yt(e);if(r){for(t=this.el_=e,e=this.tag=V.createElement("video");t.children.length;)e.appendChild(t.firstChild);zs(t,"video-js")||pi(t,"video-js"),t.appendChild(e),s=this.playerElIngest_=t,Object.keys(t).forEach(u=>{try{e[u]=t[u]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",At&&Rn&&(e.setAttribute("role","application"),n.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(u){r&&u==="class"||t.setAttribute(u,n[u]),r&&e.setAttribute(u,n[u])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(u=>Yd[u]).map(u=>"vjs-device-"+u.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),S.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=ch("vjs-styles-dimensions");const u=Jt(".vjs-styles-defaults"),f=Jt("head");f.insertBefore(this.styleEl_,u?u.nextSibling:f.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const l=e.getElementsByTagName("a");for(let u=0;u<l.length;u++){const f=l.item(u);pi(f,"vjs-hidden"),f.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!s&&e.parentNode.insertBefore(t,e),Ya(e,t),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t}crossOrigin(e){if(typeof e>"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){Q.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const s=e+"_";if(t===void 0)return this[s]||0;if(t===""||t==="auto"){this[s]=void 0,this.updateStyleEl_();return}const r=parseFloat(t);if(isNaN(r)){Q.error(`Improper value "${t}" supplied for for ${e}`);return}this[s]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,Ot(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),sv(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(S.VIDEOJS_NO_DYNAMIC_STYLE===!0){const l=typeof this.width_=="number"?this.width_:this.options_.width,u=typeof this.height_=="number"?this.height_:this.options_.height,f=this.tech_&&this.tech_.el();f&&(l>=0&&(f.width=l),u>=0&&(f.height=u));return}let e,t,s,r;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?s=this.aspectRatio_:this.videoWidth()>0?s=this.videoWidth()+":"+this.videoHeight():s="16:9";const n=s.split(":"),a=n[1]/n[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*a,/^[^a-zA-Z]/.test(this.id())?r="dimensions-"+this.id():r=this.id()+"-dimensions",this.addClass(r),dh(this.styleEl_,`
175
+ </svg>`;const rc=ln?10009:un?461:8,Ii={codes:{play:415,pause:19,ff:417,rw:412,back:rc},names:{415:"play",19:"pause",417:"ff",412:"rw",[rc]:"back"},isEventKey(i,e){return e=e.toLowerCase(),!!(this.names[i.keyCode]&&this.names[i.keyCode]===e)},getEventName(i){if(this.names[i.keyCode])return this.names[i.keyCode];if(this.codes[i.code]){const e=this.codes[i.code];return this.names[e]}return null}},nc=5;class Sv extends it{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const s=t.key.substring(5).toLowerCase();this.move(s)}else if(Ii.isEventKey(t,"play")||Ii.isEventKey(t,"pause")||Ii.isEventKey(t,"ff")||Ii.isEventKey(t,"rw")){t.preventDefault();const s=Ii.getEventName(t);this.performMediaAction_(s)}else Ii.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+nc);break;case"rw":this.userSeek_(this.player_.currentTime()-nc);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let s=null;const r=this.getCurrentComponent(e.target);t&&(s=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!s||!t)&&(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function s(r){for(const n of r)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&s(n.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_"))if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())){t.push(r);return}else r.hasOwnProperty("children_")&&r.children_.length>0?s(r.children_):r.hasOwnProperty("items")&&r.items.length>0?s(r.items):this.findSuitableDOMChild(r)&&t.push(r);if(r.name_==="ErrorDisplay"&&r.opened_){const n=r.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((l,u)=>{t.push({name:()=>"ModalButton"+(u+1),el:()=>l,getPositions:()=>{const f=l.getBoundingClientRect(),m={x:f.x,y:f.y,width:f.width,height:f.height,top:f.top,right:f.right,bottom:f.bottom,left:f.left},v={x:f.left+f.width/2,y:f.top+f.height/2,width:0,height:0,top:f.top+f.height/2,right:f.left+f.width/2,bottom:f.top+f.height/2,left:f.left+f.width/2};return{boundingClientRect:m,center:v}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:f=>!0,focus:()=>l.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(s){if(e.getIsFocusable(s)&&e.getIsAvailableToBeFocused(s))return s;for(let r=0;r<s.children.length;r++){const n=s.children[r],a=t(n);if(a)return a}return null}return e.el()?t(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||document.activeElement;if(this.focusableComponents.length){for(const s of this.focusableComponents)if(s.el()===t)return s}}add(e){const t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name()){this.focusableComponents.splice(t,1),this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents});return}}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const s=t.getPositions(),r=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(s.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(s.center,r,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,s){let r=1/0,n=null;for(const a of t){const l=a.getPositions().center,u=this.calculateDistance_(e,l,s);u<r&&(r=u,n=a)}return n}isInDirection_(e,t,s){switch(s){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name()){this.focus(this.focusableComponents[e]);return}}else this.focus(this.updateFocusableComponents()[0])}focus(e){typeof e=="object"&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,s){const r=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);let a;switch(s){case"right":case"left":a=r+n*100;break;case"up":a=n*2+r*.5;break;case"down":a=n*5+r;break;default:a=r+n}return a}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents())if(t.constructor.name==="TextTrackSelect"){e.focus(t);break}}}class Cv extends R{constructor(e,t,s){const r=oe({createEl:!1},t);if(super(e,r,s),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,a=t.playerOptions.techOrder;n<a.length;n++){const l=ye(a[n]);let u=Y.getTech(l);if(l||(u=R.getComponent(l)),u&&u.isSupported()){e.loadTech_(l);break}}else e.src(t.playerOptions.sources)}}R.registerComponent("MediaLoader",Cv);class $n extends R{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=s=>this.handleMouseOver(s),this.handleMouseOut_=s=>this.handleMouseOut(s),this.handleClick_=s=>this.handleClick(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.emitTapEvents(),this.enable()}createEl(e="div",t={},s={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&Q.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),s=Object.assign({role:"button"},s),this.tabIndex_=t.tabIndex;const r=W(e,t,s);return this.player_.options_.experimentalSvgIcons||r.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=W("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const s=this.localize(e);this.controlText_=e,ei(this.controlTextEl_,s),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",s)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}R.registerComponent("ClickableComponent",$n);class eo extends $n{constructor(e,t){super(e,t),this.update(),this.update_=s=>this.update(s),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return W("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(W("picture",{className:"vjs-poster",tabIndex:-1},{},W("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?_t(this.player_.play()):this.player_.pause())}}eo.prototype.crossorigin=eo.prototype.crossOrigin;R.registerComponent("PosterImage",eo);const st="#222",ac="#ccc",Ev={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function ka(i,e){let t;if(i.length===4)t=i[1]+i[1]+i[2]+i[2]+i[3]+i[3];else if(i.length===7)t=i.slice(1);else throw new Error("Invalid color code provided, "+i+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function gt(i,e,t){try{i.style[e]=t}catch{return}}function oc(i){return i?`${i}px`:""}class Av extends R{constructor(e,t,s){super(e,t,s);const r=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("useractive",r),e.on("userinactive",r),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(ce(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=S.screen.orientation||S,l=S.screen.orientation?"change":"orientationchange";a.addEventListener(l,n),e.on("dispose",()=>a.removeEventListener(l,n));const u=this.options_.playerOptions.tracks||[];for(let f=0;f<u.length;f++)this.player_.addRemoteTextTrack(u[f],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),s=this.player_.cache_.selectedLanguage;let r,n,a;for(let l=0;l<t.length;l++){const u=t[l];s&&s.enabled&&s.language&&s.language===u.language&&u.kind in e?u.kind===s.kind?a=u:a||(a=u):s&&!s.enabled?(a=null,r=null,n=null):u.default&&(u.kind==="descriptions"&&!r?r=u:u.kind in e&&!n&&(n=u))}a?a.mode="showing":n?n.mode="showing":r&&(r.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){typeof S.WebVTT=="function"&&S.WebVTT.processCues(S,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const a=[];for(let l=0;l<e.length;++l){const u=e[l];u.mode==="showing"&&a.push(u)}this.updateForTrack(a);return}let s=null,r=null,n=e.length;for(;n--;){const a=e[n];a.mode==="showing"&&(a.kind==="descriptions"?s=a:r=a)}if(r?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(r)):s&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(s)),!S.CSS.supports("inset","10px")){const a=this.el_,l=a.querySelectorAll(".vjs-text-track-cue"),u=this.player_.controlBar.el_.getBoundingClientRect().height,f=this.player_.el_.getBoundingClientRect().height;a.style="",gt(a,"position","relative"),gt(a,"height",f-u+"px"),gt(a,"top","unset"),cn?gt(a,"bottom",f+"px"):gt(a,"bottom","0px"),l.length>0&&l.forEach(m=>{if(m.style.inset){const v=m.style.inset.split(" ");v.length===3&&Object.assign(m.style,{top:v[0],right:v[1],bottom:v[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!S.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),s=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(s-r)>.1&&(s>r?n=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),gt(this.el_,"insetInline",oc(n)),gt(this.el_,"insetBlock",oc(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),s=e.activeCues;let r=s.length;for(;r--;){const n=s[r];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&gt(a.firstChild,"color",ka(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&gt(a.firstChild,"backgroundColor",ka(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?gt(a,"backgroundColor",ka(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${st}, 2px 2px 4px ${st}, 2px 2px 5px ${st}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${st}, 2px 2px ${st}, 3px 3px ${st}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${ac}, 0 1px ${ac}, -1px -1px ${st}, 0 -1px ${st}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${st}, 0 0 4px ${st}, 0 0 4px ${st}, 0 0 4px ${st}`)),t.fontPercent&&t.fontPercent!==1){const l=S.parseFloat(a.style.fontSize);a.style.fontSize=l*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=Ev[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof S.WebVTT!="function"||e.every(s=>!s.activeCues))return;const t=[];for(let s=0;s<e.length;++s){const r=e[s];for(let n=0;n<r.activeCues.length;++n)t.push(r.activeCues[n])}S.WebVTT.processCues(S,t,this.el_);for(let s=0;s<e.length;++s){const r=e[s];for(let n=0;n<r.activeCues.length;++n){const a=r.activeCues[n].displayState;pi(a,"vjs-text-track-cue","vjs-text-track-cue-"+(r.language?r.language:s)),r.language&&es(a,"lang",r.language)}this.player_.textTrackSettings&&this.updateDisplayState(r)}}}R.registerComponent("TextTrackDisplay",Av);class wv extends R{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),s=W("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),r=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(s),r}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}R.registerComponent("LoadingSpinner",wv);class Oe extends $n{createEl(e,t={},s={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),s=Object.assign({type:"button"},s);const r=W(e,t,s);return this.player_.options_.experimentalSvgIcons||r.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){const s=this.constructor.name;return Q.warn(`Adding an actionable (user controllable) child to a Button (${s}) is not supported; use a ClickableComponent instead.`),R.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(e.key===" "||e.key==="Enter"){e.stopPropagation();return}super.handleKeyDown(e)}}R.registerComponent("Button",Oe);class Ch extends Oe{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",s=>this.handleMouseDown(s))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(e.type==="tap"||this.mouseused_&&"clientX"in e&&"clientY"in e){_t(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const s=this.player_.getChild("controlBar"),r=s&&s.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}const n=()=>r.focus();Gs(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Ch.prototype.controlText_="Play Video";R.registerComponent("BigPlayButton",Ch);class Dv extends Oe{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}R.registerComponent("CloseButton",Dv);class Eh extends Oe{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",s=>this.handlePlay(s)),this.on(e,"pause",s=>this.handlePause(s)),t.replay&&this.on(e,"ended",s=>this.handleEnded(s))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?_t(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}Eh.prototype.controlText_="Play";R.registerComponent("PlayToggle",Eh);class us extends R{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],s=>this.update(s)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),s=W("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(s),this.contentEl_=W("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=_i(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,Q.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=V.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}us.prototype.labelText_="Time";us.prototype.controlText_="Time";R.registerComponent("TimeDisplay",us);class Xo extends us{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():e&&e.target&&typeof e.target.pendingSeekTime=="function"?t=e.target.pendingSeekTime():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Xo.prototype.labelText_="Current Time";Xo.prototype.controlText_="Current Time";R.registerComponent("CurrentTimeDisplay",Xo);class Yo extends us{constructor(e,t){super(e,t);const s=r=>this.updateContent(r);this.on(e,"durationchange",s),this.on(e,"loadstart",s),this.on(e,"loadedmetadata",s)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}Yo.prototype.labelText_="Duration";Yo.prototype.controlText_="Duration";R.registerComponent("DurationDisplay",Yo);class kv extends R{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),s=super.createEl("span",{textContent:"/"});return t.appendChild(s),e.appendChild(t),e}}R.registerComponent("TimeDivider",kv);class Ko extends us{constructor(e,t){super(e,t),this.on(e,"durationchange",s=>this.updateContent(s))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(W("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}}Ko.prototype.labelText_="Remaining Time";Ko.prototype.controlText_="Remaining Time";R.registerComponent("RemainingTimeDisplay",Ko);class jv extends R{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",s=>this.updateShowing(s))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=W("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(W("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(V.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}R.registerComponent("LiveDisplay",jv);class Ah extends Oe{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=s=>this.updateLiveEdgeStatus(s),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=W("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}Ah.prototype.controlText_="Seek to live, currently playing live";R.registerComponent("SeekToLive",Ah);function ur(i,e,t){return i=Number(i),Math.min(t,Math.max(e,isNaN(i)?e:i))}var Iv=Object.freeze({__proto__:null,clamp:ur});class Qo extends R{constructor(e,t){super(e,t),this.handleMouseDown_=s=>this.handleMouseDown(s),this.handleMouseUp_=s=>this.handleMouseUp(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.handleClick_=s=>this.handleClick(s),this.handleMouseMove_=s=>this.handleMouseMove(s),this.update_=s=>this.update(s),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},s={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),s=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},s),super.createEl(e,t,s)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!At&&e.preventDefault(),Jd(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;Zd(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(ur(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Fn(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,s=t&&t.enabled,r=t&&t.horizontalSeek;s?r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),super.handleKeyDown(e)):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}R.registerComponent("Slider",Qo);const ja=(i,e)=>ur(i/e*100,0,100).toFixed(2)+"%";class Pv extends R{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",s=>this.update(s))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=W("span",{className:"vjs-control-text"}),s=W("span",{textContent:this.localize("Loaded")}),r=V.createTextNode(": ");return this.percentageEl_=W("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(s),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,s=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,l=ja(n,r);this.percent_!==l&&(this.el_.style.width=l,ei(this.percentageEl_,l),this.percent_=l);for(let u=0;u<s.length;u++){const f=s.start(u),m=s.end(u);let v=a[u];v||(v=this.el_.appendChild(W()),a[u]=v),!(v.dataset.start===f&&v.dataset.end===m)&&(v.dataset.start=f,v.dataset.end=m,v.style.left=ja(f,n),v.style.width=ja(m-f,n))}for(let u=a.length;u>s.length;u--)this.el_.removeChild(a[u-1]);a.length=s.length})}}R.registerComponent("LoadProgressBar",Pv);class Lv extends R{constructor(e,t){super(e,t),this.update=wt(ce(this,this.update),at)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,s){const r=er(this.el_),n=ts(this.player_.el()),a=e.width*t;if(!n||!r)return;let l=e.left-n.left+a,u=e.width-a+(n.right-e.right);u||(u=e.width-a,l=a);let f=r.width/2;l<f?f+=f-l:u<f&&(f=u),f<0?f=0:f>r.width&&(f=r.width),f=Math.round(f),this.el_.style.right=`-${f}px`,this.write(s)}write(e){ei(this.el_,e)}updateTime(e,t,s,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const l=this.player_.liveTracker.liveWindow(),u=l-t*l;n=(u<1?"":"-")+_i(u,l)}else n=_i(s,a);this.update(e,t,n),r&&r()})}}R.registerComponent("TimeTooltip",Lv);class Jo extends R{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=wt(ce(this,this.update),at)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t,s){const r=this.getChild("timeTooltip");if(!r)return;const n=s&&s.target&&typeof s.target.pendingSeekTime=="function"?s.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(e,t,n)}}Jo.prototype.options_={children:[]};!Pe&&!ft&&Jo.prototype.options_.children.push("timeTooltip");R.registerComponent("PlayProgressBar",Jo);class wh extends R{constructor(e,t){super(e,t),this.update=wt(ce(this,this.update),at)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const s=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,s,()=>{this.el_.style.left=`${e.width*t}px`})}}wh.prototype.options_={children:["timeTooltip"]};R.registerComponent("MouseTimeDisplay",wh);class Gn extends Qo{constructor(e,t){t=oe(Gn.prototype.options_,t),t.children=[...t.children];const s=e.options_.disableSeekWhileScrubbingOnMobile&&(Pe||ft)||e.options_.disableSeekWhileScrubbingOnSTV;(!Pe&&!ft||s)&&t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbing_=s,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=ce(this,this.update),this.update=wt(this.update_,at),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in V&&"visibilityState"in V&&this.on(V,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){V.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,at))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(V.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const s=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let n=this.player_.duration();r&&r.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==s||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[_i(s,n),_i(n,n)],"{1} of {2}")),this.currentTime_=s,this.duration_=n),this.bar&&this.bar.update(ts(this.el()),this.getProgress(),e)}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}pendingSeekTime(e){if(e!==void 0)if(e!==null){const t=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(e,t))}else this.pendingSeekTime_=null;return this.pendingSeekTime_}getPercent(){if(this.pendingSeekTime()!==null)return this.pendingSeekTime()/this.player_.duration();const e=this.getCurrentTime_();let t;const s=this.player_.liveTracker;return s&&s.isLive()?(t=(e-s.seekableStart())/s.liveWindow(),s.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){tr(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!tr(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let s;const r=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())s=r*this.player_.duration(),s===this.player_.duration()&&(s=s-.1);else{if(r>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),l=n.liveCurrentTime();if(s=a+r*n.liveWindow(),s>=l&&(s=l),s<=a&&(s=a+.1),s===1/0)return}this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(s):this.userSeek_(s),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?_t(this.player_.play()):this.update_()}handlePendingSeek_(e){this.player_.paused()||this.player_.pause();const t=this.pendingSeekTime()!==null?this.pendingSeekTime():this.player_.currentTime();this.pendingSeekTime(t+e),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}stepForward(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const s=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*s):this.userSeek_(this.player_.duration()*s)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in V&&"visibilityState"in V&&this.off(V,"visibilitychange",this.toggleVisibility_),super.dispose()}}Gn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12};R.registerComponent("SeekBar",Gn);class Dh extends R{constructor(e,t){super(e,t),this.handleMouseMove=wt(ce(this,this.handleMouseMove),at),this.throttledHandleMouseSeek=wt(ce(this,this.handleMouseSeek),at),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.handleMouseDownHandler_=s=>this.handleMouseDown(s),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const s=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!s&&!r)return;const n=t.el(),a=er(n);let l=Fn(n,e).x;l=ur(l,0,1),r&&r.update(a,l),s&&s.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&_t(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,s=this.getChild("seekBar");s&&s.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}Dh.prototype.options_={children:["seekBar"]};R.registerComponent("ProgressControl",Dh);class kh extends Oe{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],s=>this.handlePictureInPictureChange(s)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],s=>this.handlePictureInPictureEnabledChange(s)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){V.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in S?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof V.exitPictureInPicture=="function"&&super.show()}}kh.prototype.controlText_="Picture-in-Picture";R.registerComponent("PictureInPictureToggle",kh);class jh extends Oe{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",s=>this.handleFullscreenChange(s)),V[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}jh.prototype.controlText_="Fullscreen";R.registerComponent("FullscreenToggle",jh);const Ov=function(i,e){e.tech_&&!e.tech_.featuresVolumeControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class Mv extends R{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}R.registerComponent("VolumeLevel",Mv);class Rv extends R{constructor(e,t){super(e,t),this.update=wt(ce(this,this.update),at)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,s,r){if(!s){const n=ts(this.el_),a=ts(this.player_.el()),l=e.width*t;if(!a||!n)return;const u=e.left-a.left+l,f=e.width-l+(a.right-e.right);let m=n.width/2;u<m?m+=m-u:f<m&&(m=f),m<0?m=0:m>n.width&&(m=n.width),this.el_.style.right=`-${m}px`}this.write(`${r}%`)}write(e){ei(this.el_,e)}updateVolume(e,t,s,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,s,r.toFixed(0)),n&&n()})}}R.registerComponent("VolumeLevelTooltip",Rv);class Ih extends R{constructor(e,t){super(e,t),this.update=wt(ce(this,this.update),at)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,s){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,s,r,()=>{s?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}Ih.prototype.options_={children:["volumeLevelTooltip"]};R.registerComponent("MouseVolumeLevelDisplay",Ih);class Wn extends Qo{constructor(e,t){super(e,t),this.on("slideractive",s=>this.updateLastVolume_(s)),this.on(e,"volumechange",s=>this.updateARIAAttributes(s)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){tr(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const s=this.el(),r=ts(s),n=this.vertical();let a=Fn(s,e);a=n?a.y:a.x,a=ur(a,0,1),t.update(r,a,n)}tr(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Wn.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!Pe&&!ft&&Wn.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Wn.prototype.playerEvent="volumechange";R.registerComponent("VolumeBar",Wn);class Ph extends R{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||Zi(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),Ov(this,e),this.throttledHandleMouseMove=wt(ce(this,this.handleMouseMove),at),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.on("mousedown",s=>this.handleMouseDown(s)),this.on("touchstart",s=>this.handleMouseDown(s)),this.on("mousemove",s=>this.handleMouseMove(s)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}Ph.prototype.options_={children:["volumeBar"]};R.registerComponent("VolumeControl",Ph);const Nv=function(i,e){e.tech_&&!e.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class Lh extends Oe{constructor(e,t){super(e,t),Nv(this,e),this.on(e,["loadstart","volumechange"],s=>this.update(s))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),s=this.player_.lastVolume_();if(t===0){const r=s<.1?.1:s;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),Pe&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Nn(this.el_,[0,1,2,3].reduce((s,r)=>s+`${r?" ":""}vjs-vol-${r}`,"")),pi(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}Lh.prototype.controlText_="Mute";R.registerComponent("MuteToggle",Lh);class Oh extends R{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||Zi(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=s=>this.handleKeyPress(s),this.on(e,["loadstart"],s=>this.volumePanelState_(s)),this.on(this.muteToggle,"keyup",s=>this.handleKeyPress(s)),this.on(this.volumeControl,"keyup",s=>this.handleVolumeControlKeyUp(s)),this.on("keydown",s=>this.handleKeyPress(s)),this.on("mouseover",s=>this.handleMouseOver(s)),this.on("mouseout",s=>this.handleMouseOut(s)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),tt(V,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Le(V,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Oh.prototype.options_={children:["muteToggle","volumeControl"]};R.registerComponent("VolumePanel",Oh);class Mh extends Oe{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()?s.seekableEnd():this.player_.duration();let n;t+this.skipTime<=r?n=t+this.skipTime:n=r,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Mh.prototype.controlText_="Skip Forward";R.registerComponent("SkipForward",Mh);class Rh extends Oe{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()&&s.seekableStart();let n;r&&t-this.skipTime<=r?n=r:t>=this.skipTime?n=t-this.skipTime:n=0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Rh.prototype.controlText_="Skip Backward";R.registerComponent("SkipBackward",Rh);class Nh extends R{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",s=>this.handleKeyDown(s)),this.boundHandleBlur_=s=>this.handleBlur(s),this.boundHandleTapClick_=s=>this.handleTapClick(s)}addEventListenerForItem(e){e instanceof R&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof R&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=W(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),tt(t,"click",function(s){s.preventDefault(),s.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||V.activeElement;if(!this.children().some(s=>s.el()===t)){const s=this.menuButton_;s&&s.buttonPressed_&&t!==s.el().firstChild&&s.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const s=t.filter(r=>r.el()===e.target)[0];if(!s)return;s.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}R.registerComponent("Menu",Nh);class Zo extends R{constructor(e,t={}){super(e,t),this.menuButton_=new Oe(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const s=Oe.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+s,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),tt(V,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new Nh(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=W("li",{className:"vjs-menu-title",textContent:ye(this.options_.title),tabIndex:-1}),s=new R(this.player_,{el:t});e.addItem(s)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";const t=Oe.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),Le(V,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){e.key==="Escape"||e.key==="Tab"?(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus())):(e.key==="Up"||e.key==="Down"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(e.key==="Escape"||e.key==="Tab")&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(e.key==="Escape"||e.key==="Tab")&&(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Pe&&Wd())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}R.registerComponent("MenuButton",Zo);class el extends Zo{constructor(e,t){const s=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!s)return;const r=ce(this,this.update);s.addEventListener("removetrack",r),s.addEventListener("addtrack",r),s.addEventListener("labelchange",r),this.player_.on("ready",r),this.player_.on("dispose",function(){s.removeEventListener("removetrack",r),s.removeEventListener("addtrack",r),s.removeEventListener("labelchange",r)})}}R.registerComponent("TrackButton",el);class cr extends $n{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,s){this.nonIconControl=!0;const r=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),s),n=W("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(n):r.replaceChild(n,r.querySelector(".vjs-icon-placeholder")),r}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}R.registerComponent("MenuItem",cr);class dr extends cr{constructor(e,t){const s=t.track,r=e.textTracks();t.label=s.label||s.language||"Unknown",t.selected=s.mode==="showing",super(e,t),this.track=s,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const n=(...l)=>{this.handleTracksChange.apply(this,l)},a=(...l)=>{this.handleSelectedLanguageChange.apply(this,l)};if(e.on(["loadstart","texttrackchange"],n),r.addEventListener("change",n),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),r.removeEventListener("change",n),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let l;this.on(["tap","click"],function(){if(typeof S.Event!="object")try{l=new S.Event("change")}catch{}l||(l=V.createEvent("Event"),l.initEvent("change",!0,!0)),r.dispatchEvent(l)})}this.handleTracksChange()}handleClick(e){const t=this.track,s=this.player_.textTracks();if(super.handleClick(e),!!s)for(let r=0;r<s.length;r++){const n=s[r];this.kinds.indexOf(n.kind)!==-1&&(n===t?n.mode!=="showing"&&(n.mode="showing"):n.mode!=="disabled"&&(n.mode="disabled"))}}handleTracksChange(e){const t=this.track.mode==="showing";t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if(this.track.mode==="showing"){const t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}R.registerComponent("TextTrackMenuItem",dr);class Bh extends dr{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let s=!0;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(this.options_.kinds.indexOf(a.kind)>-1&&a.mode==="showing"){s=!1;break}}s!==this.isSelected_&&this.selected(s)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let s=!0;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&a.mode==="showing"){s=!1;break}}s&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}R.registerComponent("OffTextTrackMenuItem",Bh);class cs extends el{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=dr){let s;this.label_&&(s=`${this.label_} off`),e.push(new Bh(this.player_,{kinds:this.kinds_,kind:this.kind_,label:s})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<r.length;n++){const a=r[n];if(this.kinds_.indexOf(a.kind)>-1){const l=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});l.addClass(`vjs-${a.kind}-menu-item`),e.push(l)}}return e}}R.registerComponent("TextTrackButton",cs);class Fh extends cr{constructor(e,t){const s=t.track,r=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=n&&n<r.endTime,super(e,t),this.track=s,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}R.registerComponent("ChaptersTrackMenuItem",Fh);class tl extends cs{constructor(e,t,s){super(e,t,s),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const s=e[t];if(s.kind===this.kind_)return s}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(ye(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let s=0,r=t.length;s<r;s++){const n=t[s],a=new Fh(this.player_,{track:this.track_,cue:n});e.push(a)}return e}}tl.prototype.kind_="chapters";tl.prototype.controlText_="Chapters";R.registerComponent("ChaptersButton",tl);class il extends cs{constructor(e,t,s){super(e,t,s),this.setIcon("audio-description");const r=e.textTracks(),n=ce(this,this.handleTracksChange);r.addEventListener("change",n),this.on("dispose",function(){r.removeEventListener("change",n)})}handleTracksChange(e){const t=this.player().textTracks();let s=!1;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(a.kind!==this.kind_&&a.mode==="showing"){s=!0;break}}s?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}il.prototype.kind_="descriptions";il.prototype.controlText_="Descriptions";R.registerComponent("DescriptionsButton",il);class sl extends cs{constructor(e,t,s){super(e,t,s),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}sl.prototype.kind_="subtitles";sl.prototype.controlText_="Subtitles";R.registerComponent("SubtitlesButton",sl);class rl extends dr{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}R.registerComponent("CaptionSettingsMenuItem",rl);class nl extends cs{constructor(e,t,s){super(e,t,s),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new rl(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}nl.prototype.kind_="captions";nl.prototype.controlText_="Captions";R.registerComponent("CaptionsButton",nl);class Uh extends dr{createEl(e,t,s){const r=super.createEl(e,t,s),n=r.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",r):n.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(W("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}}R.registerComponent("SubsCapsMenuItem",Uh);class al extends cs{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(ye(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new rl(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Uh),e}}al.prototype.kinds_=["captions","subtitles"];al.prototype.controlText_="Subtitles";R.registerComponent("SubsCapsButton",al);class Vh extends cr{constructor(e,t){const s=t.track,r=e.audioTracks();t.label=s.label||s.language||"Unknown",t.selected=s.enabled,super(e,t),this.track=s,this.addClass(`vjs-${s.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",n),this.on("dispose",()=>{r.removeEventListener("change",n)})}createEl(e,t,s){const r=super.createEl(e,t,s),n=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(W("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let s=0;s<t.length;s++){const r=t[s];r!==this.track&&(r.enabled=r===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}R.registerComponent("AudioTrackMenuItem",Vh);class Hh extends el{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let s=0;s<t.length;s++){const r=t[s];e.push(new Vh(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}}Hh.prototype.controlText_="Audio Track";R.registerComponent("AudioTrackButton",Hh);class ol extends cr{constructor(e,t){const s=t.rate,r=parseFloat(s,10);t.label=s,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=s,this.rate=r,this.on(e,"ratechange",n=>this.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}ol.prototype.contentElType="button";R.registerComponent("PlaybackRateMenuItem",ol);class qh extends Zo{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",s=>this.updateVisibility(s)),this.on(e,"ratechange",s=>this.updateLabel(s)),this.on(e,"playbackrateschange",s=>this.handlePlaybackRateschange(s))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=W("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let s=e.length-1;s>=0;s--)t.push(new ol(this.player(),{rate:e[s]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}qh.prototype.controlText_="Playback Rate";R.registerComponent("PlaybackRateMenuButton",qh);class zh extends R{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},s={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,s)}}R.registerComponent("Spacer",zh);class Bv extends zh{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}R.registerComponent("CustomControlSpacer",Bv);class $h extends R{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}$h.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};R.registerComponent("ControlBar",$h);class Gh extends ls{constructor(e,t){super(e,t),this.on(e,"error",s=>{this.open(s)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Gh.prototype.options_=Object.assign({},ls.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});R.registerComponent("ErrorDisplay",Gh);class Wh extends R{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),W("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const s=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${nt()}`)+"-"+t[1].replace(/\W+/g,""),r=W("option",{id:s,value:this.localize(t[0]),textContent:this.localize(t[1])});return r.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${s}`),r}))}}R.registerComponent("TextTrackSelect",Wh);class gi extends R{constructor(e,t={}){super(e,t);const s=W("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(s);const r=this.options_.selects;for(const n of r){const a=this.options_.selectConfigs[n],l=a.className,u=a.id.replace("%s",this.options_.id_);let f=null;const m=`vjs_select_${nt()}`;if(this.options_.type==="colors"){f=W("span",{className:l});const T=W("label",{id:u,className:"vjs-label",textContent:this.localize(a.label)});T.setAttribute("for",m),f.appendChild(T)}const v=new Wh(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:m,labelId:u});this.addChild(v),this.options_.type==="colors"&&(f.appendChild(v.el()),this.el().appendChild(f))}}createEl(){return W("fieldset",{className:this.options_.className})}}R.registerComponent("TextTrackFieldset",gi);class Xh extends R{constructor(e,t={}){super(e,t);const s=this.options_.textTrackComponentid,r=new gi(e,{id_:s,legendId:`captions-text-legend-${s}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const n=new gi(e,{id_:s,legendId:`captions-background-${s}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const a=new gi(e,{id_:s,legendId:`captions-window-${s}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return W("div",{className:"vjs-track-settings-colors"})}}R.registerComponent("TextTrackSettingsColors",Xh);class Yh extends R{constructor(e,t={}){super(e,t);const s=this.options_.textTrackComponentid,r=new gi(e,{id_:s,legendId:`captions-font-size-${s}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const n=new gi(e,{id_:s,legendId:`captions-edge-style-${s}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const a=new gi(e,{id_:s,legendId:`captions-font-family-${s}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return W("div",{className:"vjs-track-settings-font"})}}R.registerComponent("TextTrackSettingsFont",Yh);class Kh extends R{constructor(e,t={}){super(e,t);const s=new Oe(e,{controlText:this.localize("restore all settings to the default values"),className:"vjs-default-button"});s.el().classList.remove("vjs-control","vjs-button"),s.el().textContent=this.localize("Reset"),this.addChild(s);const r=this.localize("Done"),n=new Oe(e,{controlText:r,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=r,this.addChild(n)}createEl(){return W("div",{className:"vjs-track-settings-controls"})}}R.registerComponent("TrackSettingsControls",Kh);const Ia="vjs-text-track-settings",lc=["#000","Black"],uc=["#00F","Blue"],cc=["#0FF","Cyan"],dc=["#0F0","Green"],hc=["#F0F","Magenta"],fc=["#F00","Red"],pc=["#FFF","White"],mc=["#FF0","Yellow"],Pa=["1","Opaque"],La=["0.5","Semi-Transparent"],gc=["0","Transparent"],Kt={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[lc,pc,fc,dc,uc,mc,hc,cc],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Pa,La,gc],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[pc,lc,fc,dc,uc,mc,hc,cc],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:i=>i==="1.00"?null:Number(i)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Pa,La],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[gc,La,Pa],className:"vjs-window-opacity vjs-opacity"}};Kt.windowColor.options=Kt.backgroundColor.options;function Qh(i,e){if(e&&(i=e(i)),i&&i!=="none")return i}function Fv(i,e){const t=i.options[i.options.selectedIndex].value;return Qh(t,e)}function Uv(i,e,t){if(e){for(let s=0;s<i.options.length;s++)if(Qh(i.options[s].value,t)===e){i.selectedIndex=s;break}}}class Vv extends ls{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=W("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),t.persistTextTrackSettings===void 0&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){const t=new Xh(e,{textTrackComponentid:this.id_,selectConfigs:Kt,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const s=new Yh(e,{textTrackComponentid:this.id_,selectConfigs:Kt,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(s);const r=new Kh(e);this.addChild(r)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),Ni(Kt,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return Ud(Kt,(e,t,s)=>{const r=Fv(this.$(t.selector),t.parser);return r!==void 0&&(e[s]=r),e},{})}setValues(e){Ni(Kt,(t,s)=>{Uv(this.$(t.selector),e[s],t.parser)})}setDefaults(){Ni(Kt,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(S.localStorage.getItem(Ia))}catch(t){Q.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?S.localStorage.setItem(Ia,JSON.stringify(e)):S.localStorage.removeItem(Ia)}catch(t){Q.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}R.registerComponent("TextTrackSettings",Vv);class Hv extends R{constructor(e,t){let s=t.ResizeObserver||S.ResizeObserver;t.ResizeObserver===null&&(s=!1);const r=oe({createEl:!s,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||S.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=uh(()=>{this.resizeHandler()},100,!1,this),s?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const n=this.debouncedHandler_;let a=this.unloadListener_=function(){Le(this,"resize",n),Le(this,"unload",a),a=null};tt(this.el_.contentWindow,"unload",a),tt(this.el_.contentWindow,"resize",n)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}R.registerComponent("ResizeManager",Hv);const qv={trackingThreshold:20,liveTolerance:15};class zv extends R{constructor(e,t){const s=oe(qv,t,{createEl:!1});super(e,s),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=r=>this.handlePlay(r),this.handleFirstTimeupdate_=r=>this.handleFirstTimeupdate(r),this.handleSeeked_=r=>this.handleSeeked(r),this.seekToLiveEdge_=r=>this.seekToLiveEdge(r),this.reset_(),this.on(this.player_,"durationchange",r=>this.handleDurationchange(r)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(S.performance.now().toFixed(4)),s=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+s;const r=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-n)>this.options_.liveTolerance;(!this.timeupdateSeen_||r===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,at),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.end(s));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.start(s));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}R.registerComponent("LiveTracker",zv);class $v extends R{constructor(e,t){super(e,t),this.on("statechanged",s=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:W("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${nt()}`}),description:W("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${nt()}`})},W("div",{className:"vjs-title-bar"},{},Vd(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,s={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const n=this.state[r],a=this.els[r],l=s[r];Un(a),n&&ei(a,n),t&&(t.removeAttribute(l),n&&t.setAttribute(l,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}R.registerComponent("TitleBar",$v);const Gv={initialDisplay:4e3,position:[],takeFocus:!1};class Wv extends Oe{constructor(e,t){t=oe(Gv,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],s=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=W("button",{},{type:"button",class:this.buildCSSClass()},W("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}R.registerComponent("TransientButton",Wv);const to=i=>{const e=i.el();if(e.hasAttribute("src"))return i.triggerSourceset(e.src),!0;const t=i.$$("source"),s=[];let r="";if(!t.length)return!1;for(let n=0;n<t.length;n++){const a=t[n].src;a&&s.indexOf(a)===-1&&s.push(a)}return s.length?(s.length===1&&(r=s[0]),i.triggerSourceset(r),!0):!1},Xv=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(i){const e=V.createElement(this.nodeName.toLowerCase());e.innerHTML=i;const t=V.createDocumentFragment();for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);return this.innerText="",S.Element.prototype.appendChild.call(this,t),this.innerHTML}}),Jh=(i,e)=>{let t={};for(let s=0;s<i.length&&(t=Object.getOwnPropertyDescriptor(i[s],e),!(t&&t.set&&t.get));s++);return t.enumerable=!0,t.configurable=!0,t},Yv=i=>Jh([i.el(),S.HTMLMediaElement.prototype,S.Element.prototype,Xv],"innerHTML"),vc=function(i){const e=i.el();if(e.resetSourceWatch_)return;const t={},s=Yv(i),r=n=>(...a)=>{const l=n.apply(e,a);return to(i),l};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",oe(s,{set:r(s.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",s)},i.one("sourceset",e.resetSourceWatch_)},Kv=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?bh(S.Element.prototype.getAttribute.call(this,"src")):""},set(i){return S.Element.prototype.setAttribute.call(this,"src",i),i}}),Qv=i=>Jh([i.el(),S.HTMLMediaElement.prototype,Kv],"src"),Jv=function(i){if(!i.featuresSourceset)return;const e=i.el();if(e.resetSourceset_)return;const t=Qv(i),s=e.setAttribute,r=e.load;Object.defineProperty(e,"src",oe(t,{set:n=>{const a=t.set.call(e,n);return i.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const l=s.call(e,n,a);return/src/i.test(n)&&i.triggerSourceset(e.src),l},e.load=()=>{const n=r.call(e);return to(i)||(i.triggerSourceset(""),vc(i)),n},e.currentSrc?i.triggerSourceset(e.currentSrc):to(i)||vc(i),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=s,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class q extends Y{constructor(e,t){super(e,t);const s=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",s&&(this.el_.currentSrc!==s.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(s):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const l=[];for(;a--;){const u=n[a];u.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(u),this.remoteTextTracks().addTrack(u.track),this.textTracks().addTrack(u.track),!r&&!this.el_.hasAttribute("crossorigin")&&zn(u.src)&&(r=!0)):l.push(u))}for(let u=0;u<l.length;u++)this.el_.removeChild(l[u])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&Q.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
176
+ This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(Zs||Mn)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),q.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){Jv(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const s=()=>{t=[];for(let n=0;n<e.length;n++){const a=e[n];a.kind==="metadata"&&t.push({track:a,storedMode:a.mode})}};s(),e.addEventListener("change",s),this.on("dispose",()=>e.removeEventListener("change",s));const r=()=>{for(let n=0;n<t.length;n++){const a=t[n];a.track.mode==="disabled"&&a.track.mode!==a.storedMode&&(a.track.mode=a.storedMode)}e.removeEventListener("change",r)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",s),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",s),e.addEventListener("change",s),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const s=e.toLowerCase();this[`${s}TracksListeners_`]&&Object.keys(this[`${s}TracksListeners_`]).forEach(r=>{this.el()[`${s}Tracks`].removeEventListener(r,this[`${s}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${s}TracksListeners_`]=null,this.proxyNativeTracksForType_(s)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=rt[e],s=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!s||!s.addEventListener)return;const n={change:l=>{const u={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(u),e==="text"&&this[ss.remoteText.getterName]().trigger(u)},addtrack(l){r.addTrack(l.track)},removetrack(l){r.removeTrack(l.track)}},a=function(){const l=[];for(let u=0;u<r.length;u++){let f=!1;for(let m=0;m<s.length;m++)if(s[m]===r[u]){f=!0;break}f||l.push(r[u])}for(;l.length;)r.removeTrack(l.shift())};this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach(l=>{const u=n[l];s.addEventListener(l,u),this.on("dispose",f=>s.removeEventListener(l,u))}),this.on("loadstart",a),this.on("dispose",l=>this.off("loadstart",a))}proxyNativeTracks_(){rt.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const s=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(s,e),q.disposeMediaElement(e),e=s}else{e=V.createElement("video");const s=this.options_.tag&&Yt(this.options_.tag),r=oe({},s);(!Zs||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,Kd(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&es(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let s=0;s<t.length;s++){const r=t[s],n=this.options_[r];typeof n<"u"&&(n?es(e,r,r):Bn(e,r),e[r]=n)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let s=!1;const r=function(){s=!0};this.on("loadstart",r);const n=function(){s||this.trigger("loadstart")};this.on("loadedmetadata",n),this.ready(function(){this.off("loadstart",r),this.off("loadedmetadata",n),s||this.trigger("loadstart")});return}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(s){this.trigger(s)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Rn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){Q(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&ft&&At&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)_t(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return Q.error("Invalid source URL."),!1;const s={src:e};t&&(s.type=t);const r=W("source",{},s);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return Q.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const s of t)if(s.src===e)return this.el_.removeChild(s),!0;return Q.warn(`No matching source element found with src: ${e}`),!1}reset(){q.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,s){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,s):super.addTextTrack(e,t,s)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=V.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const s=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(s),s}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let s=t.length;for(;s--;)(e===t[s]||e===t[s].track)&&this.el().removeChild(t[s])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),S.performance&&(e.creationTime=S.performance.now()),e}}Pn(q,"TEST_VID",function(){if(!ns())return;const i=V.createElement("video"),e=V.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",i.appendChild(e),i});q.isSupported=function(){try{q.TEST_VID.volume=.5}catch{return!1}return!!(q.TEST_VID&&q.TEST_VID.canPlayType)};q.canPlayType=function(i){return q.TEST_VID.canPlayType(i)};q.canPlaySource=function(i,e){return q.canPlayType(i.type)};q.canControlVolume=function(){try{const i=q.TEST_VID.volume;q.TEST_VID.volume=i/2+.1;const e=i!==q.TEST_VID.volume;return e&&Pe?(S.setTimeout(()=>{q&&q.prototype&&(q.prototype.featuresVolumeControl=i!==q.TEST_VID.volume)}),!1):e}catch{return!1}};q.canMuteVolume=function(){try{const i=q.TEST_VID.muted;return q.TEST_VID.muted=!i,q.TEST_VID.muted?es(q.TEST_VID,"muted","muted"):Bn(q.TEST_VID,"muted","muted"),i!==q.TEST_VID.muted}catch{return!1}};q.canControlPlaybackRate=function(){if(ft&&At&&Ln<58)return!1;try{const i=q.TEST_VID.playbackRate;return q.TEST_VID.playbackRate=i/2+.1,i!==q.TEST_VID.playbackRate}catch{return!1}};q.canOverrideAttributes=function(){try{const i=()=>{};Object.defineProperty(V.createElement("video"),"src",{get:i,set:i}),Object.defineProperty(V.createElement("audio"),"src",{get:i,set:i}),Object.defineProperty(V.createElement("video"),"innerHTML",{get:i,set:i}),Object.defineProperty(V.createElement("audio"),"innerHTML",{get:i,set:i})}catch{return!1}return!0};q.supportsNativeTextTracks=function(){return Rn||Pe&&At};q.supportsNativeVideoTracks=function(){return!!(q.TEST_VID&&q.TEST_VID.videoTracks)};q.supportsNativeAudioTracks=function(){return!!(q.TEST_VID&&q.TEST_VID.audioTracks)};q.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([i,e]){Pn(q.prototype,i,()=>q[e](),!0)});q.prototype.featuresVolumeControl=q.canControlVolume();q.prototype.movingMediaElementInDOM=!Pe;q.prototype.featuresFullscreenResize=!0;q.prototype.featuresProgressEvents=!0;q.prototype.featuresTimeupdateEvents=!0;q.prototype.featuresVideoFrameCallback=!!(q.TEST_VID&&q.TEST_VID.requestVideoFrameCallback);q.disposeMediaElement=function(i){if(i){for(i.parentNode&&i.parentNode.removeChild(i);i.hasChildNodes();)i.removeChild(i.firstChild);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()}};q.resetMediaElement=function(i){if(!i)return;const e=i.querySelectorAll("source");let t=e.length;for(;t--;)i.removeChild(e[t]);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(i){q.prototype[i]=function(){return this.el_[i]||this.el_.hasAttribute(i)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(i){q.prototype["set"+ye(i)]=function(e){this.el_[i]=e,e?this.el_.setAttribute(i,i):this.el_.removeAttribute(i)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(i){q.prototype[i]=function(){return this.el_[i]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(i){q.prototype["set"+ye(i)]=function(e){this.el_[i]=e}});["pause","load","play"].forEach(function(i){q.prototype[i]=function(){return this.el_[i]()}});Y.withSourceHandlers(q);q.nativeSourceHandler={};q.nativeSourceHandler.canPlayType=function(i){try{return q.TEST_VID.canPlayType(i)}catch{return""}};q.nativeSourceHandler.canHandleSource=function(i,e){if(i.type)return q.nativeSourceHandler.canPlayType(i.type);if(i.src){const t=Go(i.src);return q.nativeSourceHandler.canPlayType(`video/${t}`)}return""};q.nativeSourceHandler.handleSource=function(i,e,t){e.setSrc(i.src)};q.nativeSourceHandler.dispose=function(){};q.registerSourceHandler(q.nativeSourceHandler);Y.registerTech("Html5",q);const Zh=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Oa={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},io=["tiny","xsmall","small","medium","large","xlarge","huge"],Kr={};io.forEach(i=>{const e=i.charAt(0)==="x"?`x-${i.substring(1)}`:i;Kr[i]=`vjs-layout-${e}`});const Zv={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class te extends R{constructor(e,t,s){if(e.id=e.id||t.id||`vjs_video_${nt()}`,t=Object.assign(te.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,s),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=Bd(this.id_),this.fsApi_=nn,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&Yt(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(l){a[l.toLowerCase()]=t.languages[l]}),this.languages_=a}else this.languages_=te.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),Vo(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(tt(V,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=oe(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const l=new S.DOMParser().parseFromString(xv,"image/svg+xml");if(l.querySelector("parsererror"))Q.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const f=l.documentElement;f.style.display="none",this.el_.appendChild(f),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new Sv(this),this.addClass("vjs-spatial-navigation-enabled")),Zs&&this.addClass("vjs-touch-enabled"),Pe||this.addClass("vjs-workinghover"),te.players[this.id_]=this;const n=$a.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),Le(V,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Le(V,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),te.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),yv(this),Ue.names.forEach(e=>{const t=Ue[e],s=this[t.getterName]();s&&s.off&&s.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,s=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";s?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl("div"));const n=Yt(e);if(r){for(t=this.el_=e,e=this.tag=V.createElement("video");t.children.length;)e.appendChild(t.firstChild);zs(t,"video-js")||pi(t,"video-js"),t.appendChild(e),s=this.playerElIngest_=t,Object.keys(t).forEach(u=>{try{e[u]=t[u]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",At&&On&&(e.setAttribute("role","application"),n.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(u){r&&u==="class"||t.setAttribute(u,n[u]),r&&e.setAttribute(u,n[u])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(u=>Gd[u]).map(u=>"vjs-device-"+u.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),S.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=oh("vjs-styles-dimensions");const u=Jt(".vjs-styles-defaults"),f=Jt("head");f.insertBefore(this.styleEl_,u?u.nextSibling:f.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const l=e.getElementsByTagName("a");for(let u=0;u<l.length;u++){const f=l.item(u);pi(f,"vjs-hidden"),f.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!s&&e.parentNode.insertBefore(t,e),Wa(e,t),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t}crossOrigin(e){if(typeof e>"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){Q.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const s=e+"_";if(t===void 0)return this[s]||0;if(t===""||t==="auto"){this[s]=void 0,this.updateStyleEl_();return}const r=parseFloat(t);if(isNaN(r)){Q.error(`Improper value "${t}" supplied for for ${e}`);return}this[s]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,Ot(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),K2(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(S.VIDEOJS_NO_DYNAMIC_STYLE===!0){const l=typeof this.width_=="number"?this.width_:this.options_.width,u=typeof this.height_=="number"?this.height_:this.options_.height,f=this.tech_&&this.tech_.el();f&&(l>=0&&(f.width=l),u>=0&&(f.height=u));return}let e,t,s,r;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?s=this.aspectRatio_:this.videoWidth()>0?s=this.videoWidth()+":"+this.videoHeight():s="16:9";const n=s.split(":"),a=n[1]/n[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*a,/^[^a-zA-Z]/.test(this.id())?r="dimensions-"+this.id():r=this.id()+"-dimensions",this.addClass(r),lh(this.styleEl_,`
177
177
  .${r} {
178
178
  width: ${e}px;
179
179
  height: ${t}px;
@@ -182,9 +182,9 @@ This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNati
182
182
  .${r}.vjs-fluid:not(.vjs-audio-only-mode) {
183
183
  padding-top: ${a*100}%;
184
184
  }
185
- `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const s=ye(e),r=e.charAt(0).toLowerCase()+e.slice(1);s!=="Html5"&&this.tag&&(Y.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=s,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};Fe.names.forEach(u=>{const f=Fe[u];a[f.getterName]=this[f.privateName]}),Object.assign(a,this.options_[s]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const l=Y.getTech(e);if(!l)throw new Error(`No Tech named '${s}' exists! '${s}' should be registered using videojs.registerTech()'`);this.tech_=new l(a),this.tech_.ready(ce(this,this.handleTechReady_),!0),to.jsonToTextTracks(this.textTracksJson_||[],this.tech_),sf.forEach(u=>{this.on(this.tech_,u,f=>this[`handleTech${ye(u)}_`](f))}),Object.keys(Ra).forEach(u=>{this.on(this.tech_,u,f=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Ra[u]}_`].bind(this),event:f});return}this[`handleTech${Ra[u]}_`](f)})}),this.on(this.tech_,"loadstart",u=>this.handleTechLoadStart_(u)),this.on(this.tech_,"sourceset",u=>this.handleTechSourceset_(u)),this.on(this.tech_,"waiting",u=>this.handleTechWaiting_(u)),this.on(this.tech_,"ended",u=>this.handleTechEnded_(u)),this.on(this.tech_,"seeking",u=>this.handleTechSeeking_(u)),this.on(this.tech_,"play",u=>this.handleTechPlay_(u)),this.on(this.tech_,"pause",u=>this.handleTechPause_(u)),this.on(this.tech_,"durationchange",u=>this.handleTechDurationChange_(u)),this.on(this.tech_,"fullscreenchange",(u,f)=>this.handleTechFullscreenChange_(u,f)),this.on(this.tech_,"fullscreenerror",(u,f)=>this.handleTechFullscreenError_(u,f)),this.on(this.tech_,"enterpictureinpicture",u=>this.handleTechEnterPictureInPicture_(u)),this.on(this.tech_,"leavepictureinpicture",u=>this.handleTechLeavePictureInPicture_(u)),this.on(this.tech_,"error",u=>this.handleTechError_(u)),this.on(this.tech_,"posterchange",u=>this.handleTechPosterChange_(u)),this.on(this.tech_,"textdata",u=>this.handleTechTextData_(u)),this.on(this.tech_,"ratechange",u=>this.handleTechRateChange_(u)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(s!=="Html5"||!this.tag)&&Ya(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){Fe.names.forEach(e=>{const t=Fe[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=to.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&Q.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
185
+ `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const s=ye(e),r=e.charAt(0).toLowerCase()+e.slice(1);s!=="Html5"&&this.tag&&(Y.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=s,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};Ue.names.forEach(u=>{const f=Ue[u];a[f.getterName]=this[f.privateName]}),Object.assign(a,this.options_[s]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const l=Y.getTech(e);if(!l)throw new Error(`No Tech named '${s}' exists! '${s}' should be registered using videojs.registerTech()'`);this.tech_=new l(a),this.tech_.ready(ce(this,this.handleTechReady_),!0),Za.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Zh.forEach(u=>{this.on(this.tech_,u,f=>this[`handleTech${ye(u)}_`](f))}),Object.keys(Oa).forEach(u=>{this.on(this.tech_,u,f=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Oa[u]}_`].bind(this),event:f});return}this[`handleTech${Oa[u]}_`](f)})}),this.on(this.tech_,"loadstart",u=>this.handleTechLoadStart_(u)),this.on(this.tech_,"sourceset",u=>this.handleTechSourceset_(u)),this.on(this.tech_,"waiting",u=>this.handleTechWaiting_(u)),this.on(this.tech_,"ended",u=>this.handleTechEnded_(u)),this.on(this.tech_,"seeking",u=>this.handleTechSeeking_(u)),this.on(this.tech_,"play",u=>this.handleTechPlay_(u)),this.on(this.tech_,"pause",u=>this.handleTechPause_(u)),this.on(this.tech_,"durationchange",u=>this.handleTechDurationChange_(u)),this.on(this.tech_,"fullscreenchange",(u,f)=>this.handleTechFullscreenChange_(u,f)),this.on(this.tech_,"fullscreenerror",(u,f)=>this.handleTechFullscreenError_(u,f)),this.on(this.tech_,"enterpictureinpicture",u=>this.handleTechEnterPictureInPicture_(u)),this.on(this.tech_,"leavepictureinpicture",u=>this.handleTechLeavePictureInPicture_(u)),this.on(this.tech_,"error",u=>this.handleTechError_(u)),this.on(this.tech_,"posterchange",u=>this.handleTechPosterChange_(u)),this.on(this.tech_,"textdata",u=>this.handleTechTextData_(u)),this.on(this.tech_,"ratechange",u=>this.handleTechRateChange_(u)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(s!=="Html5"||!this.tag)&&Wa(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){Ue.names.forEach(e=>{const t=Ue[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=Za.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&Q.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
186
186
  See https://github.com/videojs/video.js/issues/2617 for more info.
187
- `),this.tech_}version(){return{"video.js":Wa}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const n=()=>{this.muted(r)};this.playTerminatedQueue_.push(n);const a=this.play();if(Gs(a))return a.catch(l=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${l||""}`)})};let s;if(e==="any"&&!this.muted()?(s=this.play(),Gs(s)&&(s=s.catch(t))):e==="muted"&&!this.muted()?s=t():s=this.play(),!!Gs(s))return s.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,s="";typeof t!="string"&&(t=e.src,s=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!s&&(s=Dv(this,t)),this.cache_.source=oe({},e,{src:t,type:s});const r=this.cache_.sources.filter(u=>u.src&&u.src===t),n=[],a=this.$$("source"),l=[];for(let u=0;u<a.length;u++){const f=Yt(a[u]);n.push(f),f.src&&f.src===t&&l.push(f.src)}l.length&&!r.length?this.cache_.sources=n:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=n=>this.updateSourceCaches_(n);const s=this.currentSource().src,r=e.src;s&&!/^blob:/.test(s)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==s)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?_t(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),s=>s.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!V.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const s=this.el();let r=V[this.fsApi_.fullscreenElement]===s;!r&&s.matches&&(r=s.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in Sv)return Tv(this.middleware_,this.tech_,e,t);if(e in rc)return sc(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(s){throw Q(s),s}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in xv)return bv(this.middleware_,this.tech_,e);if(e in rc)return sc(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(Q(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(Q(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(Q(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=_t){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),s=!!(Bn||Ie);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=a=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&s&&this.load();return}const r=this.techGet_("play");s&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(s){s(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||dt(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=dt(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=dt(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return bh(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let s=e.end(e.length-1);return s>t&&(s=t),s}volume(e){let t;if(e!==void 0){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((s,r)=>{function n(){t.off("fullscreenerror",l),t.off("fullscreenchange",a)}function a(){n(),s()}function l(f,m){n(),r(m)}t.one("fullscreenchange",a),t.one("fullscreenerror",l);const u=t.requestFullscreenHelper_(e);u&&(u.then(n,n),u.then(s,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const s=this.el_[this.fsApi_.requestFullscreen](t);return s&&s.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),s}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,s)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){r(),t()}function a(u,f){r(),s(f)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const l=e.exitFullscreenHelper_();l&&(l.then(r,r),l.then(t,s))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=V[this.fsApi_.exitFullscreen]();return e&&_t(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=V.documentElement.style.overflow,et(V,"keydown",this.boundFullWindowOnEscKey_),V.documentElement.style.overflow="hidden",pi(V.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Pe(V,"keydown",this.boundFullWindowOnEscKey_),V.documentElement.style.overflow=this.docOrigOverflow,Fn(V.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&S.documentPictureInPicture){const e=V.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(W("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),S.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(oh(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",s=>{const r=s.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in V&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(S.documentPictureInPicture&&S.documentPictureInPicture.window)return S.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in V)return V.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(r=>{const n=r.tagName.toLowerCase();if(r.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return n==="input"?a.indexOf(r.type)===-1:["textarea"].indexOf(n)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:s=a=>e.key.toLowerCase()==="f",muteKey:r=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(s.call(this,e)){e.preventDefault(),e.stopPropagation();const a=R.getComponent("FullscreenToggle");V[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),R.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),R.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let s=0,r=this.options_.techOrder;s<r.length;s++){const n=r[s];let a=Y.getTech(n);if(a||(a=R.getComponent(n)),!a){Q.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`);continue}if(a.isSupported()&&(t=a.canPlayType(e),t))return t}return""}selectSource(e){const t=this.options_.techOrder.map(l=>[l,Y.getTech(l)]).filter(([l,u])=>u?u.isSupported():(Q.error(`The "${l}" tech is undefined. Skipped browser support check for that tech.`),!1)),s=function(l,u,f){let m;return l.some(v=>u.some(T=>{if(m=f(v,T),m)return!0})),m};let r;const n=l=>(u,f)=>l(f,u),a=([l,u],f)=>{if(u.canPlaySource(f,this.options_[l.toLowerCase()]))return{source:f,tech:l}};return this.options_.sourceOrder?r=s(e,t,n(a)):r=s(t,e,a),r||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const s=Ah(e);if(!s.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=s),this.updateSourceCaches_(s[0]),yv(this,s[0],(r,n)=>{if(this.middleware_=n,t||(this.cache_.sources=s),this.updateSourceCaches_(r),this.src_(r)){if(s.length>1)return this.handleSrc_(s.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}_v(n,this.tech_)}),s.length>1){const r=()=>{this.error(null),this.handleSrc_(s.slice(1),!0)},n=()=>{this.off("error",r)};this.one("error",r),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",n)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?gh(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,t){return this.tech_?this.tech_.addSourceElement(e,t):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();_t(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),Ot(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:s,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=s||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t>"u"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(Qt("beforeerror").forEach(t=>{const s=t(this,e);if(!(Et(s)&&!Array.isArray(s)||typeof s=="string"||typeof s=="number"||s===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=s}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new ve(e),this.addClass("vjs-error"),Q.error(`(CODE:${this.error_.code} ${ve.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),Qt("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,s;const r=ce(this,this.reportUserActivity),n=function(v){(v.screenX!==t||v.screenY!==s)&&(t=v.screenX,s=v.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},l=function(v){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",l),this.on("mouseleave",l);const u=this.getChild("controlBar");u&&!Ie&&!ht&&(u.on("mouseenter",function(v){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),u.on("mouseleave",function(v){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let f;const m=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(f);const v=this.options_.inactivityTimeout;v<=0||(f=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},v))};this.setInterval(m,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),s=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=s,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(s),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,s){if(this.tech_)return this.tech_.addTextTrack(e,t,s)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Ot(this)&&this.trigger("languagechange"))}languages(){return oe(te.prototype.options_.languages,this.languages_)}toJSON(){const e=oe(this.options_),t=e.tracks;e.tracks=[];for(let s=0;s<t.length;s++){let r=t[s];r=oe(r),r.player=void 0,e.tracks[s]=r}return e}createModal(e,t){t=t||{},t.content=e||"";const s=new ls(this,t);return this.addChild(s),s.on("dispose",()=>{this.removeChild(s)}),s.open(),s}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let s=0;s<ro.length;s++){const r=ro[s],n=this.breakpoints_[r];if(t<=n){if(e===r)return;e&&this.removeClass(Qr[e]),this.addClass(Qr[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return e===void 0?Object.assign(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=Object.assign({},ay,e),this.updateCurrentBreakpoint_(),Object.assign(this.breakpoints_))}responsive(e){if(e===void 0)return this.responsive_;e=!!e;const t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Qr[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const s=this.crossOrigin();this.reset(),this.cache_.media=oe(e);const{artist:r,artwork:n,description:a,poster:l,src:u,textTracks:f,title:m}=this.cache_.media;!n&&l&&(this.cache_.media.artwork=[{src:l,type:vn(l)}]),s&&this.crossOrigin(s),u&&this.src(u),l&&this.poster(l),Array.isArray(f)&&f.forEach(v=>this.addRemoteTextTrack(v,!1)),this.titleBar&&this.titleBar.update({title:m,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),s=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),r={src:t,textTracks:s};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:vn(r.poster)}]),r}return oe(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},s=Yt(e),r=s["data-setup"];if(zs(e,"vjs-fill")&&(s.fill=!0),zs(e,"vjs-fluid")&&(s.fluid=!0),r!==null)try{Object.assign(s,JSON.parse(r||"{}"))}catch(n){Q.error("data-setup",n)}if(Object.assign(t,s),e.hasChildNodes()){const n=e.childNodes;for(let a=0,l=n.length;a<l;a++){const u=n[a],f=u.nodeName.toLowerCase();f==="source"?t.sources.push(Yt(u)):f==="track"&&t.tracks.push(Yt(u))}}return t}debug(e){if(e===void 0)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(e===void 0)return this.cache_.playbackRates;Array.isArray(e)&&e.every(t=>typeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}te.prototype.videoTracks=()=>{};te.prototype.audioTracks=()=>{};te.prototype.textTracks=()=>{};te.prototype.remoteTextTracks=()=>{};te.prototype.remoteTextTrackEls=()=>{};Fe.names.forEach(function(i){const e=Fe[i];te.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});te.prototype.crossorigin=te.prototype.crossOrigin;te.players={};const Os=S.navigator;te.prototype.options_={techOrder:Y.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Os&&(Os.languages&&Os.languages[0]||Os.userLanguage||Os.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1};sf.forEach(function(i){te.prototype[`handleTech${ye(i)}_`]=function(){return this.trigger(i)}});R.registerComponent("Player",te);const yn="plugin",Ui="activePlugins_",Oi={},_n=i=>Oi.hasOwnProperty(i),Jr=i=>_n(i)?Oi[i]:void 0,rf=(i,e)=>{i[Ui]=i[Ui]||{},i[Ui][e]=!0},bn=(i,e,t)=>{const s=(t?"before":"")+"pluginsetup";i.trigger(s,e),i.trigger(s+":"+e.name,e)},oy=function(i,e){const t=function(){bn(this,{name:i,plugin:e,instance:null},!0);const s=e.apply(this,arguments);return rf(this,i),bn(this,{name:i,plugin:e,instance:s}),s};return Object.keys(e).forEach(function(s){t[s]=e[s]}),t},bc=(i,e)=>(e.prototype.name=i,function(...t){bn(this,{name:i,plugin:e,instance:null},!0);const s=new e(this,...t);return this[i]=()=>s,bn(this,s.getEventHash()),s});class We{constructor(e){if(this.constructor===We)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),qo(this),delete this.trigger,mh(this,this.constructor.defaultState),rf(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return os(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Ui][e]=!1,this.player=this.state=null,t[e]=bc(e,Oi[e])}static isBasic(e){const t=typeof e=="string"?Jr(e):e;return typeof t=="function"&&!We.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(_n(e))Q.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(te.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return Oi[e]=t,e!==yn&&(We.isBasic(t)?te.prototype[e]=oy(e,t):te.prototype[e]=bc(e,t)),t}static deregisterPlugin(e){if(e===yn)throw new Error("Cannot de-register base plugin.");_n(e)&&(delete Oi[e],delete te.prototype[e])}static getPlugins(e=Object.keys(Oi)){let t;return e.forEach(s=>{const r=Jr(s);r&&(t=t||{},t[s]=r)}),t}static getPluginVersion(e){const t=Jr(e);return t&&t.VERSION||""}}We.getPlugin=Jr;We.BASE_PLUGIN_NAME=yn;We.registerPlugin(yn,We);te.prototype.usingPlugin=function(i){return!!this[Ui]&&this[Ui][i]===!0};te.prototype.hasPlugin=function(i){return!!_n(i)};function ly(i,e){let t=!1;return function(...s){return t||Q.warn(i),t=!0,e.apply(this,s)}}function pt(i,e,t,s){return ly(`${e} is deprecated and will be removed in ${i}.0; please use ${t} instead.`,s)}var uy={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const nf=i=>i.indexOf("#")===0?i.slice(1):i;function P(i,e,t){let s=P.getPlayer(i);if(s)return e&&Q.warn(`Player "${i}" is already initialised. Options will not be applied.`),t&&s.ready(t),s;const r=typeof i=="string"?Jt("#"+nf(i)):i;if(!as(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof S.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!a.contains(r))&&Q.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),Qt("beforesetup").forEach(u=>{const f=u(r,oe(e));if(!Et(f)||Array.isArray(f)){Q.error("please return an object in beforesetup hooks");return}e=oe(e,f)});const l=R.getComponent("Player");return s=new l(r,e,t),Qt("setup").forEach(u=>u(s)),s}P.hooks_=It;P.hooks=Qt;P.hook=q2;P.hookOnce=z2;P.removeHook=Ud;if(S.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&ns()){let i=Jt(".vjs-styles-defaults");if(!i){i=ch("vjs-styles-defaults");const e=Jt("head");e&&e.insertBefore(i,e.firstChild),dh(i,`
187
+ `),this.tech_}version(){return{"video.js":$a}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const n=()=>{this.muted(r)};this.playTerminatedQueue_.push(n);const a=this.play();if(Gs(a))return a.catch(l=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${l||""}`)})};let s;if(e==="any"&&!this.muted()?(s=this.play(),Gs(s)&&(s=s.catch(t))):e==="muted"&&!this.muted()?s=t():s=this.play(),!!Gs(s))return s.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,s="";typeof t!="string"&&(t=e.src,s=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!s&&(s=Tv(this,t)),this.cache_.source=oe({},e,{src:t,type:s});const r=this.cache_.sources.filter(u=>u.src&&u.src===t),n=[],a=this.$$("source"),l=[];for(let u=0;u<a.length;u++){const f=Yt(a[u]);n.push(f),f.src&&f.src===t&&l.push(f.src)}l.length&&!r.length?this.cache_.sources=n:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=n=>this.updateSourceCaches_(n);const s=this.currentSource().src,r=e.src;s&&!/^blob:/.test(s)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==s)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?_t(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),s=>s.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!V.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const s=this.el();let r=V[this.fsApi_.fullscreenElement]===s;!r&&s.matches&&(r=s.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in gv)return pv(this.middleware_,this.tech_,e,t);if(e in ic)return tc(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(s){throw Q(s),s}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in mv)return fv(this.middleware_,this.tech_,e);if(e in ic)return tc(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(Q(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(Q(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(Q(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=_t){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),s=!!(Rn||Pe);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=a=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&s&&this.load();return}const r=this.techGet_("play");s&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(s){s(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||ht(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=ht(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=ht(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return vh(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let s=e.end(e.length-1);return s>t&&(s=t),s}volume(e){let t;if(e!==void 0){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((s,r)=>{function n(){t.off("fullscreenerror",l),t.off("fullscreenchange",a)}function a(){n(),s()}function l(f,m){n(),r(m)}t.one("fullscreenchange",a),t.one("fullscreenerror",l);const u=t.requestFullscreenHelper_(e);u&&(u.then(n,n),u.then(s,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const s=this.el_[this.fsApi_.requestFullscreen](t);return s&&s.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),s}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,s)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){r(),t()}function a(u,f){r(),s(f)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const l=e.exitFullscreenHelper_();l&&(l.then(r,r),l.then(t,s))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=V[this.fsApi_.exitFullscreen]();return e&&_t(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=V.documentElement.style.overflow,tt(V,"keydown",this.boundFullWindowOnEscKey_),V.documentElement.style.overflow="hidden",pi(V.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Le(V,"keydown",this.boundFullWindowOnEscKey_),V.documentElement.style.overflow=this.docOrigOverflow,Nn(V.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&S.documentPictureInPicture){const e=V.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(W("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),S.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(rh(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",s=>{const r=s.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in V&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(S.documentPictureInPicture&&S.documentPictureInPicture.window)return S.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in V)return V.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(r=>{const n=r.tagName.toLowerCase();if(r.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return n==="input"?a.indexOf(r.type)===-1:["textarea"].indexOf(n)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:s=a=>e.key.toLowerCase()==="f",muteKey:r=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(s.call(this,e)){e.preventDefault(),e.stopPropagation();const a=R.getComponent("FullscreenToggle");V[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),R.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),R.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let s=0,r=this.options_.techOrder;s<r.length;s++){const n=r[s];let a=Y.getTech(n);if(a||(a=R.getComponent(n)),!a){Q.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`);continue}if(a.isSupported()&&(t=a.canPlayType(e),t))return t}return""}selectSource(e){const t=this.options_.techOrder.map(l=>[l,Y.getTech(l)]).filter(([l,u])=>u?u.isSupported():(Q.error(`The "${l}" tech is undefined. Skipped browser support check for that tech.`),!1)),s=function(l,u,f){let m;return l.some(v=>u.some(T=>{if(m=f(v,T),m)return!0})),m};let r;const n=l=>(u,f)=>l(f,u),a=([l,u],f)=>{if(u.canPlaySource(f,this.options_[l.toLowerCase()]))return{source:f,tech:l}};return this.options_.sourceOrder?r=s(e,t,n(a)):r=s(t,e,a),r||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const s=Sh(e);if(!s.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=s),this.updateSourceCaches_(s[0]),dv(this,s[0],(r,n)=>{if(this.middleware_=n,t||(this.cache_.sources=s),this.updateSourceCaches_(r),this.src_(r)){if(s.length>1)return this.handleSrc_(s.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}hv(n,this.tech_)}),s.length>1){const r=()=>{this.error(null),this.handleSrc_(s.slice(1),!0)},n=()=>{this.off("error",r)};this.one("error",r),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",n)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?fh(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,t){return this.tech_?this.tech_.addSourceElement(e,t):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();_t(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),Ot(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:s,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=s||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t>"u"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(Qt("beforeerror").forEach(t=>{const s=t(this,e);if(!(Et(s)&&!Array.isArray(s)||typeof s=="string"||typeof s=="number"||s===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=s}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new ve(e),this.addClass("vjs-error"),Q.error(`(CODE:${this.error_.code} ${ve.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),Qt("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,s;const r=ce(this,this.reportUserActivity),n=function(v){(v.screenX!==t||v.screenY!==s)&&(t=v.screenX,s=v.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},l=function(v){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",l),this.on("mouseleave",l);const u=this.getChild("controlBar");u&&!Pe&&!ft&&(u.on("mouseenter",function(v){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),u.on("mouseleave",function(v){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let f;const m=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(f);const v=this.options_.inactivityTimeout;v<=0||(f=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},v))};this.setInterval(m,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),s=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=s,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(s),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,s){if(this.tech_)return this.tech_.addTextTrack(e,t,s)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Ot(this)&&this.trigger("languagechange"))}languages(){return oe(te.prototype.options_.languages,this.languages_)}toJSON(){const e=oe(this.options_),t=e.tracks;e.tracks=[];for(let s=0;s<t.length;s++){let r=t[s];r=oe(r),r.player=void 0,e.tracks[s]=r}return e}createModal(e,t){t=t||{},t.content=e||"";const s=new ls(this,t);return this.addChild(s),s.on("dispose",()=>{this.removeChild(s)}),s.open(),s}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let s=0;s<io.length;s++){const r=io[s],n=this.breakpoints_[r];if(t<=n){if(e===r)return;e&&this.removeClass(Kr[e]),this.addClass(Kr[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return e===void 0?Object.assign(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=Object.assign({},Zv,e),this.updateCurrentBreakpoint_(),Object.assign(this.breakpoints_))}responsive(e){if(e===void 0)return this.responsive_;e=!!e;const t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Kr[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const s=this.crossOrigin();this.reset(),this.cache_.media=oe(e);const{artist:r,artwork:n,description:a,poster:l,src:u,textTracks:f,title:m}=this.cache_.media;!n&&l&&(this.cache_.media.artwork=[{src:l,type:mn(l)}]),s&&this.crossOrigin(s),u&&this.src(u),l&&this.poster(l),Array.isArray(f)&&f.forEach(v=>this.addRemoteTextTrack(v,!1)),this.titleBar&&this.titleBar.update({title:m,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),s=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),r={src:t,textTracks:s};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:mn(r.poster)}]),r}return oe(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},s=Yt(e),r=s["data-setup"];if(zs(e,"vjs-fill")&&(s.fill=!0),zs(e,"vjs-fluid")&&(s.fluid=!0),r!==null)try{Object.assign(s,JSON.parse(r||"{}"))}catch(n){Q.error("data-setup",n)}if(Object.assign(t,s),e.hasChildNodes()){const n=e.childNodes;for(let a=0,l=n.length;a<l;a++){const u=n[a],f=u.nodeName.toLowerCase();f==="source"?t.sources.push(Yt(u)):f==="track"&&t.tracks.push(Yt(u))}}return t}debug(e){if(e===void 0)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(e===void 0)return this.cache_.playbackRates;Array.isArray(e)&&e.every(t=>typeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}te.prototype.videoTracks=()=>{};te.prototype.audioTracks=()=>{};te.prototype.textTracks=()=>{};te.prototype.remoteTextTracks=()=>{};te.prototype.remoteTextTrackEls=()=>{};Ue.names.forEach(function(i){const e=Ue[i];te.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});te.prototype.crossorigin=te.prototype.crossOrigin;te.players={};const Os=S.navigator;te.prototype.options_={techOrder:Y.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Os&&(Os.languages&&Os.languages[0]||Os.userLanguage||Os.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1};Zh.forEach(function(i){te.prototype[`handleTech${ye(i)}_`]=function(){return this.trigger(i)}});R.registerComponent("Player",te);const gn="plugin",Ui="activePlugins_",Oi={},vn=i=>Oi.hasOwnProperty(i),Qr=i=>vn(i)?Oi[i]:void 0,ef=(i,e)=>{i[Ui]=i[Ui]||{},i[Ui][e]=!0},yn=(i,e,t)=>{const s=(t?"before":"")+"pluginsetup";i.trigger(s,e),i.trigger(s+":"+e.name,e)},ey=function(i,e){const t=function(){yn(this,{name:i,plugin:e,instance:null},!0);const s=e.apply(this,arguments);return ef(this,i),yn(this,{name:i,plugin:e,instance:s}),s};return Object.keys(e).forEach(function(s){t[s]=e[s]}),t},yc=(i,e)=>(e.prototype.name=i,function(...t){yn(this,{name:i,plugin:e,instance:null},!0);const s=new e(this,...t);return this[i]=()=>s,yn(this,s.getEventHash()),s});class Xe{constructor(e){if(this.constructor===Xe)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),Vo(this),delete this.trigger,hh(this,this.constructor.defaultState),ef(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return os(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Ui][e]=!1,this.player=this.state=null,t[e]=yc(e,Oi[e])}static isBasic(e){const t=typeof e=="string"?Qr(e):e;return typeof t=="function"&&!Xe.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(vn(e))Q.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(te.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return Oi[e]=t,e!==gn&&(Xe.isBasic(t)?te.prototype[e]=ey(e,t):te.prototype[e]=yc(e,t)),t}static deregisterPlugin(e){if(e===gn)throw new Error("Cannot de-register base plugin.");vn(e)&&(delete Oi[e],delete te.prototype[e])}static getPlugins(e=Object.keys(Oi)){let t;return e.forEach(s=>{const r=Qr(s);r&&(t=t||{},t[s]=r)}),t}static getPluginVersion(e){const t=Qr(e);return t&&t.VERSION||""}}Xe.getPlugin=Qr;Xe.BASE_PLUGIN_NAME=gn;Xe.registerPlugin(gn,Xe);te.prototype.usingPlugin=function(i){return!!this[Ui]&&this[Ui][i]===!0};te.prototype.hasPlugin=function(i){return!!vn(i)};function ty(i,e){let t=!1;return function(...s){return t||Q.warn(i),t=!0,e.apply(this,s)}}function pt(i,e,t,s){return ty(`${e} is deprecated and will be removed in ${i}.0; please use ${t} instead.`,s)}var iy={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const tf=i=>i.indexOf("#")===0?i.slice(1):i;function P(i,e,t){let s=P.getPlayer(i);if(s)return e&&Q.warn(`Player "${i}" is already initialised. Options will not be applied.`),t&&s.ready(t),s;const r=typeof i=="string"?Jt("#"+tf(i)):i;if(!as(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof S.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!a.contains(r))&&Q.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),Qt("beforesetup").forEach(u=>{const f=u(r,oe(e));if(!Et(f)||Array.isArray(f)){Q.error("please return an object in beforesetup hooks");return}e=oe(e,f)});const l=R.getComponent("Player");return s=new l(r,e,t),Qt("setup").forEach(u=>u(s)),s}P.hooks_=It;P.hooks=Qt;P.hook=R2;P.hookOnce=N2;P.removeHook=Nd;if(S.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&ns()){let i=Jt(".vjs-styles-defaults");if(!i){i=oh("vjs-styles-defaults");const e=Jt("head");e&&e.insertBefore(i,e.firstChild),lh(i,`
188
188
  .video-js {
189
189
  width: 300px;
190
190
  height: 150px;
@@ -193,30 +193,30 @@ See https://github.com/videojs/video.js/issues/2617 for more info.
193
193
  .vjs-fluid:not(.vjs-audio-only-mode) {
194
194
  padding-top: 56.25%
195
195
  }
196
- `)}}Qa(1,P);P.VERSION=Wa;P.options=te.prototype.options_;P.getPlayers=()=>te.players;P.getPlayer=i=>{const e=te.players;let t;if(typeof i=="string"){const s=nf(i),r=e[s];if(r)return r;t=Jt("#"+s)}else t=i;if(as(t)){const{player:s,playerId:r}=t;if(s||e[r])return s||e[r]}};P.getAllPlayers=()=>Object.keys(te.players).map(i=>te.players[i]).filter(Boolean);P.players=te.players;P.getComponent=R.getComponent;P.registerComponent=(i,e)=>(Y.isTech(e)&&Q.warn(`The ${i} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),R.registerComponent.call(R,i,e));P.getTech=Y.getTech;P.registerTech=Y.registerTech;P.use=vv;Object.defineProperty(P,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(P.middleware,"TERMINATOR",{value:gn,writeable:!1,enumerable:!0});P.browser=Yd;P.obj=W2;P.mergeOptions=pt(9,"videojs.mergeOptions","videojs.obj.merge",oe);P.defineLazyProperty=pt(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",On);P.bind=pt(9,"videojs.bind","native Function.prototype.bind",ce);P.registerPlugin=We.registerPlugin;P.deregisterPlugin=We.deregisterPlugin;P.plugin=(i,e)=>(Q.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),We.registerPlugin(i,e));P.getPlugins=We.getPlugins;P.getPlugin=We.getPlugin;P.getPluginVersion=We.getPluginVersion;P.addLanguage=function(i,e){return i=(""+i).toLowerCase(),P.options.languages=oe(P.options.languages,{[i]:e}),P.options.languages[i]};P.log=Q;P.createLogger=Vd;P.time=lv;P.createTimeRange=pt(9,"videojs.createTimeRange","videojs.time.createTimeRanges",dt);P.createTimeRanges=pt(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",dt);P.formatTime=pt(9,"videojs.formatTime","videojs.time.formatTime",_i);P.setFormatTime=pt(9,"videojs.setFormatTime","videojs.time.setFormatTime",yh);P.resetFormatTime=pt(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",_h);P.parseUrl=pt(9,"videojs.parseUrl","videojs.url.parseUrl",Wo);P.isCrossOrigin=pt(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Gn);P.EventTarget=tt;P.any=Ho;P.on=et;P.one=zn;P.off=Pe;P.trigger=os;P.xhr=Xc;P.TrackList=bi;P.TextTrack=ur;P.TextTrackList=$o;P.AudioTrack=Ch;P.AudioTrackList=Th;P.VideoTrack=Eh;P.VideoTrackList=xh;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(i=>{P[i]=function(){return Q.warn(`videojs.${i}() is deprecated; use videojs.dom.${i}() instead`),lh[i].apply(null,arguments)}});P.computedStyle=pt(9,"videojs.computedStyle","videojs.dom.computedStyle",is);P.dom=lh;P.fn=iv;P.num=Bv;P.str=av;P.url=mv;P.Error=uy;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class cy{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(s){t.enabled_(s)}}),t}}class Tn extends P.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const s=this.levels_.length;return t=new cy(e),""+s in this||Object.defineProperty(this,s,{get(){return this.levels_[s]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let s=0,r=this.length;s<r;s++)if(this[s]===e){t=this.levels_.splice(s,1)[0],this.selectedIndex_===s?this.selectedIndex_=-1:this.selectedIndex_>s&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,s=this.length;t<s;t++){const r=this[t];if(r.id===e)return r}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}Tn.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const i in Tn.prototype.allowedEvents_)Tn.prototype["on"+i]=null;var af="4.1.0";const dy=function(i,e){const t=i.qualityLevels,s=new Tn,r=function(){s.dispose(),i.qualityLevels=t,i.off("dispose",r)};return i.on("dispose",r),i.qualityLevels=()=>s,i.qualityLevels.VERSION=af,s},of=function(i){return dy(this,P.obj.merge({},i))};P.registerPlugin("qualityLevels",of);of.VERSION=af;/*! @name @videojs/http-streaming @version 3.17.0 @license Apache-2.0 */const $e=Dn,xn=(i,e)=>e&&e.responseURL&&i!==e.responseURL?e.responseURL:i,at=i=>P.log.debug?P.log.debug.bind(P,"VHS:",`${i} >`):function(){};function ie(...i){const e=P.obj||P;return(e.merge||e.mergeOptions).apply(e,i)}function De(...i){const e=P.time||P;return(e.createTimeRanges||e.createTimeRanges).apply(e,i)}function hy(i){if(i.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges:
196
+ `)}}Ya(1,P);P.VERSION=$a;P.options=te.prototype.options_;P.getPlayers=()=>te.players;P.getPlayer=i=>{const e=te.players;let t;if(typeof i=="string"){const s=tf(i),r=e[s];if(r)return r;t=Jt("#"+s)}else t=i;if(as(t)){const{player:s,playerId:r}=t;if(s||e[r])return s||e[r]}};P.getAllPlayers=()=>Object.keys(te.players).map(i=>te.players[i]).filter(Boolean);P.players=te.players;P.getComponent=R.getComponent;P.registerComponent=(i,e)=>(Y.isTech(e)&&Q.warn(`The ${i} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),R.registerComponent.call(R,i,e));P.getTech=Y.getTech;P.registerTech=Y.registerTech;P.use=cv;Object.defineProperty(P,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(P.middleware,"TERMINATOR",{value:pn,writeable:!1,enumerable:!0});P.browser=Gd;P.obj=U2;P.mergeOptions=pt(9,"videojs.mergeOptions","videojs.obj.merge",oe);P.defineLazyProperty=pt(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Pn);P.bind=pt(9,"videojs.bind","native Function.prototype.bind",ce);P.registerPlugin=Xe.registerPlugin;P.deregisterPlugin=Xe.deregisterPlugin;P.plugin=(i,e)=>(Q.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Xe.registerPlugin(i,e));P.getPlugins=Xe.getPlugins;P.getPlugin=Xe.getPlugin;P.getPluginVersion=Xe.getPluginVersion;P.addLanguage=function(i,e){return i=(""+i).toLowerCase(),P.options.languages=oe(P.options.languages,{[i]:e}),P.options.languages[i]};P.log=Q;P.createLogger=Bd;P.time=tv;P.createTimeRange=pt(9,"videojs.createTimeRange","videojs.time.createTimeRanges",ht);P.createTimeRanges=pt(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",ht);P.formatTime=pt(9,"videojs.formatTime","videojs.time.formatTime",_i);P.setFormatTime=pt(9,"videojs.setFormatTime","videojs.time.setFormatTime",mh);P.resetFormatTime=pt(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",gh);P.parseUrl=pt(9,"videojs.parseUrl","videojs.url.parseUrl",$o);P.isCrossOrigin=pt(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",zn);P.EventTarget=it;P.any=Uo;P.on=tt;P.one=Hn;P.off=Le;P.trigger=os;P.xhr=$c;P.TrackList=bi;P.TextTrack=lr;P.TextTrackList=qo;P.AudioTrack=Th;P.AudioTrackList=yh;P.VideoTrack=xh;P.VideoTrackList=_h;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(i=>{P[i]=function(){return Q.warn(`videojs.${i}() is deprecated; use videojs.dom.${i}() instead`),nh[i].apply(null,arguments)}});P.computedStyle=pt(9,"videojs.computedStyle","videojs.dom.computedStyle",is);P.dom=nh;P.fn=Y2;P.num=Iv;P.str=Z2;P.url=lv;P.Error=iy;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class sy{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(s){t.enabled_(s)}}),t}}class _n extends P.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const s=this.levels_.length;return t=new sy(e),""+s in this||Object.defineProperty(this,s,{get(){return this.levels_[s]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let s=0,r=this.length;s<r;s++)if(this[s]===e){t=this.levels_.splice(s,1)[0],this.selectedIndex_===s?this.selectedIndex_=-1:this.selectedIndex_>s&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,s=this.length;t<s;t++){const r=this[t];if(r.id===e)return r}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}_n.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const i in _n.prototype.allowedEvents_)_n.prototype["on"+i]=null;var sf="4.1.0";const ry=function(i,e){const t=i.qualityLevels,s=new _n,r=function(){s.dispose(),i.qualityLevels=t,i.off("dispose",r)};return i.on("dispose",r),i.qualityLevels=()=>s,i.qualityLevels.VERSION=sf,s},rf=function(i){return ry(this,P.obj.merge({},i))};P.registerPlugin("qualityLevels",rf);rf.VERSION=sf;/*! @name @videojs/http-streaming @version 3.17.0 @license Apache-2.0 */const Ge=An,bn=(i,e)=>e&&e.responseURL&&i!==e.responseURL?e.responseURL:i,ot=i=>P.log.debug?P.log.debug.bind(P,"VHS:",`${i} >`):function(){};function ie(...i){const e=P.obj||P;return(e.merge||e.mergeOptions).apply(e,i)}function ke(...i){const e=P.time||P;return(e.createTimeRanges||e.createTimeRanges).apply(e,i)}function ny(i){if(i.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges:
197
197
  `;for(let t=0;t<i.length;t++){const s=i.start(t),r=i.end(t);e+=`${s} --> ${r}. Duration (${r-s})
198
- `}return e}const bt=1/30,Tt=bt*3,lf=function(i,e){const t=[];let s;if(i&&i.length)for(s=0;s<i.length;s++)e(i.start(s),i.end(s))&&t.push([i.start(s),i.end(s)]);return De(t)},Mi=function(i,e){return lf(i,function(t,s){return t-Tt<=e&&s+Tt>=e})},Wr=function(i,e){return lf(i,function(t){return t-bt>=e})},fy=function(i){if(i.length<2)return De();const e=[];for(let t=1;t<i.length;t++){const s=i.end(t-1),r=i.start(t);e.push([s,r])}return De(e)},py=function(i,e){let t=null,s=null,r=0;const n=[],a=[];if(!i||!i.length||!e||!e.length)return De();let l=i.length;for(;l--;)n.push({time:i.start(l),type:"start"}),n.push({time:i.end(l),type:"end"});for(l=e.length;l--;)n.push({time:e.start(l),type:"start"}),n.push({time:e.end(l),type:"end"});for(n.sort(function(u,f){return u.time-f.time}),l=0;l<n.length;l++)n[l].type==="start"?(r++,r===2&&(t=n[l].time)):n[l].type==="end"&&(r--,r===1&&(s=n[l].time)),t!==null&&s!==null&&(a.push([t,s]),t=null,s=null);return De(a)},uf=i=>{const e=[];if(!i||!i.length)return"";for(let t=0;t<i.length;t++)e.push(i.start(t)+" => "+i.end(t));return e.join(", ")},my=function(i,e,t=1){return((i.length?i.end(i.length-1):0)-e)/t},hi=i=>{const e=[];for(let t=0;t<i.length;t++)e.push({start:i.start(t),end:i.end(t)});return e},gy=function(i,e){if(i===e)return!1;if(!i&&e||!e&&i||i.length!==e.length)return!0;for(let t=0;t<i.length;t++)if(i.start(t)!==e.start(t)||i.end(t)!==e.end(t))return!0;return!1},Na=function(i){if(!(!i||!i.length||!i.end))return i.end(i.length-1)},cl=function(i,e){let t=0;if(!i||!i.length)return t;for(let s=0;s<i.length;s++){const r=i.start(s),n=i.end(s);if(!(e>n)){if(e>r&&e<=n){t+=n-e;continue}t+=n-r}}return t},dl=(i,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(s){t+=s.duration}),(e.preloadHints||[]).forEach(function(s){s.type==="PART"&&(t+=i.partTargetDuration)}),t},no=i=>(i.segments||[]).reduce((e,t,s)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:s,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:s,partIndex:null,segment:t,part:null}),e),[]),cf=i=>{const e=i.segments&&i.segments.length&&i.segments[i.segments.length-1];return e&&e.parts||[]},df=({preloadSegment:i})=>{if(!i)return;const{parts:e,preloadHints:t}=i;let s=(t||[]).reduce((r,n)=>r+(n.type==="PART"?1:0),0);return s+=e&&e.length?e.length:0,s},hf=(i,e)=>{if(e.endList)return 0;if(i&&i.suggestedPresentationDelay)return i.suggestedPresentationDelay;const t=cf(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},vy=function(i,e){let t=0,s=e-i.mediaSequence,r=i.segments[s];if(r){if(typeof r.start<"u")return{result:r.start,precise:!0};if(typeof r.end<"u")return{result:r.end-r.duration,precise:!0}}for(;s--;){if(r=i.segments[s],typeof r.end<"u")return{result:t+r.end,precise:!0};if(t+=dl(i,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},yy=function(i,e){let t=0,s,r=e-i.mediaSequence;for(;r<i.segments.length;r++){if(s=i.segments[r],typeof s.start<"u")return{result:s.start-t,precise:!0};if(t+=dl(i,s),typeof s.end<"u")return{result:s.end-t,precise:!0}}return{result:-1,precise:!1}},ff=function(i,e,t){if(typeof e>"u"&&(e=i.mediaSequence+i.segments.length),e<i.mediaSequence)return 0;const s=vy(i,e);if(s.precise)return s.result;const r=yy(i,e);return r.precise?r.result:s.result+t},pf=function(i,e,t){if(!i)return 0;if(typeof t!="number"&&(t=0),typeof e>"u"){if(i.totalDuration)return i.totalDuration;if(!i.endList)return S.Infinity}return ff(i,e,t)},Ws=function({defaultDuration:i,durationList:e,startIndex:t,endIndex:s}){let r=0;if(t>s&&([t,s]=[s,t]),t<0){for(let n=t;n<Math.min(0,s);n++)r+=i;t=0}for(let n=t;n<s;n++)r+=e[n].duration;return r},mf=function(i,e,t,s){if(!i||!i.segments)return null;if(i.endList)return pf(i);if(e===null)return null;e=e||0;let r=ff(i,i.mediaSequence+i.segments.length,e);return t&&(s=typeof s=="number"?s:hf(null,i),r-=s),Math.max(0,r)},_y=function(i,e,t){const r=e||0;let n=mf(i,e,!0,t);return n===null?De():(n<r&&(n=r),De(r,n))},by=function({playlist:i,currentTime:e,startingSegmentIndex:t,startingPartIndex:s,startTime:r,exactManifestTimings:n}){let a=e-r;const l=no(i);let u=0;for(let f=0;f<l.length;f++){const m=l[f];if(t===m.segmentIndex&&!(typeof s=="number"&&typeof m.partIndex=="number"&&s!==m.partIndex)){u=f;break}}if(a<0){if(u>0)for(let f=u-1;f>=0;f--){const m=l[f];if(a+=m.duration,n){if(a<0)continue}else if(a+bt<=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r-Ws({defaultDuration:i.targetDuration,durationList:l,startIndex:u,endIndex:f})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e}}if(u<0){for(let f=u;f<0;f++)if(a-=i.targetDuration,a<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e};u=0}for(let f=u;f<l.length;f++){const m=l[f];a-=m.duration;const v=m.duration>bt,T=a===0,E=v&&a+bt>=0;if(!((T||E)&&f!==l.length-1)){if(n){if(a>0)continue}else if(a-bt>=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r+Ws({defaultDuration:i.targetDuration,durationList:l,startIndex:u,endIndex:f})}}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:e}},gf=function(i){return i.excludeUntil&&i.excludeUntil>Date.now()},hl=function(i){return i.excludeUntil&&i.excludeUntil===1/0},Kn=function(i){const e=gf(i);return!i.disabled&&!e},Ty=function(i){return i.disabled},xy=function(i){for(let e=0;e<i.segments.length;e++)if(i.segments[e].key)return!0;return!1},vf=function(i,e){return e.attributes&&e.attributes[i]},Sy=function(i,e,t,s=0){return vf("BANDWIDTH",t)?(i*t.attributes.BANDWIDTH-s*8)/e:NaN},ao=(i,e)=>{if(i.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return i.playlists.filter(s=>Kn(s)?(s.attributes.BANDWIDTH||0)<t:!1).length===0},fl=(i,e)=>!i&&!e||!i&&e||i&&!e?!1:!!(i===e||i.id&&e.id&&i.id===e.id||i.resolvedUri&&e.resolvedUri&&i.resolvedUri===e.resolvedUri||i.uri&&e.uri&&i.uri===e.uri),Tc=function(i,e){const t=i&&i.mediaGroups&&i.mediaGroups.AUDIO||{};let s=!1;for(const r in t){for(const n in t[r])if(s=e(t[r][n]),s)break;if(s)break}return!!s},fr=i=>{if(!i||!i.playlists||!i.playlists.length)return Tc(i,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;e<i.playlists.length;e++){const t=i.playlists[e],s=t.attributes&&t.attributes.CODECS;if(!(s&&s.split(",").every(n=>ed(n))||Tc(i,n=>fl(t,n))))return!1}return!0};var Ge={liveEdgeDelay:hf,duration:pf,seekable:_y,getMediaInfoForTime:by,isEnabled:Kn,isDisabled:Ty,isExcluded:gf,isIncompatible:hl,playlistEnd:mf,isAes:xy,hasAttribute:vf,estimateSegmentRequestTime:Sy,isLowestEnabledRendition:ao,isAudioOnly:fr,playlistMatch:fl,segmentDurationWithParts:dl};const{log:yf}=P,Vi=(i,e)=>`${i}-${e}`,_f=(i,e,t)=>`placeholder-uri-${i}-${e}-${t}`,Cy=({onwarn:i,oninfo:e,manifestString:t,customTagParsers:s=[],customTagMappers:r=[],llhls:n})=>{const a=new Vg;i&&a.on("warn",i),e&&a.on("info",e),s.forEach(f=>a.addParser(f)),r.forEach(f=>a.addTagMapper(f)),a.push(t),a.end();const l=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(f){l.hasOwnProperty(f)&&delete l[f]}),l.segments&&l.segments.forEach(function(f){["parts","preloadHints"].forEach(function(m){f.hasOwnProperty(m)&&delete f[m]})})),!l.targetDuration){let f=10;l.segments&&l.segments.length&&(f=l.segments.reduce((m,v)=>Math.max(m,v.duration),0)),i&&i({message:`manifest has no targetDuration defaulting to ${f}`}),l.targetDuration=f}const u=cf(l);if(u.length&&!l.partTargetDuration){const f=u.reduce((m,v)=>Math.max(m,v.duration),0);i&&(i({message:`manifest has no partTargetDuration defaulting to ${f}`}),yf.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),l.partTargetDuration=f}return l},ds=(i,e)=>{i.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(i.mediaGroups[t])for(const s in i.mediaGroups[t])for(const r in i.mediaGroups[t][s]){const n=i.mediaGroups[t][s][r];e(n,t,s,r)}})},bf=({playlist:i,uri:e,id:t})=>{i.id=t,i.playlistErrors_=0,e&&(i.uri=e),i.attributes=i.attributes||{}},Ey=i=>{let e=i.playlists.length;for(;e--;){const t=i.playlists[e];bf({playlist:t,id:Vi(e,t.uri)}),t.resolvedUri=$e(i.uri,t.uri),i.playlists[t.id]=t,i.playlists[t.uri]=t,t.attributes.BANDWIDTH||yf.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},Ay=i=>{ds(i,e=>{e.uri&&(e.resolvedUri=$e(i.uri,e.uri))})},wy=(i,e)=>{const t=Vi(0,e),s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:S.location.href,resolvedUri:S.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return s.playlists[t]=s.playlists[0],s.playlists[e]=s.playlists[0],s},Tf=(i,e,t=_f)=>{i.uri=e;for(let r=0;r<i.playlists.length;r++)if(!i.playlists[r].uri){const n=`placeholder-uri-${r}`;i.playlists[r].uri=n}const s=fr(i);ds(i,(r,n,a,l)=>{if(!r.playlists||!r.playlists.length){if(s&&n==="AUDIO"&&!r.uri)for(let u=0;u<i.playlists.length;u++){const f=i.playlists[u];if(f.attributes&&f.attributes.AUDIO&&f.attributes.AUDIO===a)return}r.playlists=[_e({},r)]}r.playlists.forEach(function(u,f){const m=t(n,a,l,u),v=Vi(f,m);u.uri?u.resolvedUri=u.resolvedUri||$e(i.uri,u.uri):(u.uri=f===0?m:v,u.resolvedUri=u.uri),u.id=u.id||v,u.attributes=u.attributes||{},i.playlists[u.id]=u,i.playlists[u.uri]=u})}),Ey(i),Ay(i)};class xc{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(this.offset_!==null||!e.length)return;const[t]=e;t.programDateTime!==void 0&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,s=t.startDate.getTime();this.trimProcessedDateRanges_(s),this.pendingDateRanges_=e.reduce((r,n)=>(r.set(n.id,n),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((s,r)=>{if(!this.processedDateRanges_.has(r)&&(s.startTime=s.startDate.getTime()/1e3-this.offset_,s.processDateRange=()=>this.processDateRange(s),t.push(s),!!s.class))if(e[s.class]){const n=e[s.class].push(s);s.classListIndex=n-1}else e[s.class]=[s],s.classListIndex=0});for(const s of t){const r=e[s.class]||[];s.endDate?s.endTime=s.endDate.getTime()/1e3-this.offset_:s.endOnNext&&r[s.classListIndex+1]?s.endTime=r[s.classListIndex+1].startTime:s.duration?s.endTime=s.startTime+s.duration:s.plannedDuration?s.endTime=s.startTime+s.plannedDuration:s.endTime=s.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((s,r)=>{s.startDate.getTime()<e&&this.processedDateRanges_.delete(r)})}}const xf=22,vi=({requestType:i,request:e,error:t,parseFailure:s})=>{const r=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:i},l=r&&!n||s;if(t&&n)a.error=_e({},t),a.errorType=P.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=P.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=P.Error.NetworkRequestTimeout;else if(l){const u=s?P.Error.NetworkBodyParserFailed:P.Error.NetworkBadStatus;a.errorType=u,a.status=e.status,a.headers=e.headers}return a},Dy=at("CodecUtils"),Sf=function(i){const e=i.attributes||{};if(e.CODECS)return vt(e.CODECS)},Cf=(i,e)=>{const t=e.attributes||{};return i&&i.mediaGroups&&i.mediaGroups.AUDIO&&t.AUDIO&&i.mediaGroups.AUDIO[t.AUDIO]},ky=(i,e)=>{if(!Cf(i,e))return!0;const t=e.attributes||{},s=i.mediaGroups.AUDIO[t.AUDIO];for(const r in s)if(!s[r].uri&&!s[r].playlists)return!0;return!1},ir=function(i){const e={};return i.forEach(({mediaType:t,type:s,details:r})=>{e[t]=e[t]||[],e[t].push(Zc(`${s}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){Dy(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},Sc=function(i){let e=0;return i.audio&&e++,i.video&&e++,e},Xs=function(i,e){const t=e.attributes||{},s=ir(Sf(e)||[]);if(Cf(i,e)&&!s.audio&&!ky(i,e)){const r=ir(qg(i,t.AUDIO)||[]);r.audio&&(s.audio=r.audio)}return s},{EventTarget:jy}=P,Iy=(i,e)=>{if(e.endList||!e.serverControl)return i;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:s}=e;let r=e.mediaSequence+e.segments.length;if(s){const n=s.parts||[],a=df(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const s=new S.URL(i);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&s.searchParams.set(r,t[r])}),i=s.toString()}return i},Py=(i,e)=>{if(!i)return e;const t=ie(i,e);if(i.preloadHints&&!e.preloadHints&&delete t.preloadHints,i.parts&&!e.parts)delete t.parts;else if(i.parts&&e.parts)for(let s=0;s<e.parts.length;s++)i.parts&&i.parts[s]&&(t.parts[s]=ie(i.parts[s],e.parts[s]));return!i.skipped&&e.skipped&&(t.skipped=!1),i.preload&&!e.preload&&(t.preload=!1),t},Ly=(i,e,t)=>{const s=i.slice(),r=e.slice();t=t||0;const n=[];let a;for(let l=0;l<r.length;l++){const u=s[l+t],f=r[l];u?(a=u.map||a,n.push(Py(u,f))):(a&&!f.map&&(f.map=a),n.push(f))}return n},Ef=(i,e)=>{!i.resolvedUri&&i.uri&&(i.resolvedUri=$e(e,i.uri)),i.key&&!i.key.resolvedUri&&(i.key.resolvedUri=$e(e,i.key.uri)),i.map&&!i.map.resolvedUri&&(i.map.resolvedUri=$e(e,i.map.uri)),i.map&&i.map.key&&!i.map.key.resolvedUri&&(i.map.key.resolvedUri=$e(e,i.map.key.uri)),i.parts&&i.parts.length&&i.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=$e(e,t.uri))}),i.preloadHints&&i.preloadHints.length&&i.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=$e(e,t.uri))})},Af=function(i){const e=i.segments||[],t=i.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let s=0;s<t.preloadHints.length;s++)if(t.preloadHints[s].type==="MAP")return e}t.duration=i.targetDuration,t.preload=!0,e.push(t)}return e},wf=(i,e)=>i===e||i.segments&&e.segments&&i.segments.length===e.segments.length&&i.endList===e.endList&&i.mediaSequence===e.mediaSequence&&i.preloadSegment===e.preloadSegment,oo=(i,e,t=wf)=>{const s=ie(i,{}),r=s.playlists[e.id];if(!r||t(r,e))return null;e.segments=Af(e);const n=ie(r,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a<e.skip.skippedSegments;a++)e.segments.unshift({skipped:!0})}n.segments=Ly(r.segments,e.segments,e.mediaSequence-r.mediaSequence)}n.segments.forEach(a=>{Ef(a,n.resolvedUri)});for(let a=0;a<s.playlists.length;a++)s.playlists[a].id===e.id&&(s.playlists[a]=n);return s.playlists[e.id]=n,s.playlists[e.uri]=n,ds(i,(a,l,u,f)=>{if(a.playlists)for(let m=0;m<a.playlists.length;m++)e.id===a.playlists[m].id&&(a.playlists[m]=n)}),s},lo=(i,e)=>{const t=i.segments||[],s=t[t.length-1],r=s&&s.parts&&s.parts[s.parts.length-1],n=r&&r.duration||s&&s.duration;return e&&n?n*1e3:(i.partTargetDuration||i.targetDuration||10)*500},Cc=(i,e,t)=>{if(!i)return;const s=[];return i.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:l}=r.attributes;s.push({id:r.id,bandwidth:n,resolution:a,codecs:l})}),{type:e,isLive:t,renditions:s}};class Ri extends jy{constructor(e,t,s={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=at("PlaylistLoader");const{withCredentials:r=!1}=s;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=s.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new xc,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=$e(this.main.uri,e.uri);this.llhls&&(t=Iy(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(s,r)=>{if(this.request){if(s)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,s){const{uri:r,id:n}=t;this.request=null,s&&(this.state=s),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:vi({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{const s=Cy({onwarn:({message:r})=>this.logger_(`m3u8-parser warn for ${e}: ${r}`),oninfo:({message:r})=>this.logger_(`m3u8-parser info for ${e}: ${r}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return!s.playlists||!s.playlists.length||this.excludeAudioOnlyVariants(s.playlists),s}catch(s){this.error=s,this.error.metadata={errorType:P.Error.StreamingHlsPlaylistParserError,error:s}}}excludeAudioOnlyVariants(e){const t=s=>{const r=s.attributes||{},{width:n,height:a}=r.RESOLUTION||{};if(n&&a)return!0;const l=Sf(s)||[];return!!ir(l).video};e.some(t)&&e.forEach(s=>{t(s)||(s.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:t,url:s,id:r}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:s}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:s,manifestString:e});a.lastRequest=Date.now(),bf({playlist:a,uri:s,id:r});const l=oo(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,l?(this.main=l,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(lo(this.media(),!!l)),n.parsedPlaylist=Cc(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),S.clearTimeout(this.mediaUpdateTimeout),S.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new xc,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(S.clearTimeout(this.finalRenditionTimeout),t){const l=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=S.setTimeout(this.media.bind(this,e,!1),l);return}const s=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(lo(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(l,u)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=xn(e.resolvedUri,u),l)return this.playlistRequestError(this.request,e,s);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:u.responseText,url:e.uri,id:e.id}),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(S.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(S.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const s=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=S.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},s);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(S.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=S.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=S.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,s)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:s.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:s.responseText,code:2,metadata:vi({requestType:s.requestType,request:s,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=xn(this.src,s),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:s.responseText,url:this.src});e.parsedPlaylist=Cc(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,Tf(this.main,this.srcUri()),e.playlists.forEach(s=>{s.segments=Af(s),s.segments.forEach(r=>{Ef(r,s.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||S.location.href;this.main=wy(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const s=this.main,r=e.ID;let n=s.playlists.length;for(;n--;){const a=s.playlists[n];if(a.attributes["PATHWAY-ID"]===r){const l=a.resolvedUri,u=a.id;if(t){const f=this.createCloneURI_(a.resolvedUri,e),m=Vi(r,f),v=this.createCloneAttributes_(r,a.attributes),T=this.createClonePlaylist_(a,m,e,v);s.playlists[n]=T,s.playlists[m]=T,s.playlists[f]=T}else s.playlists.splice(n,1);delete s.playlists[u],delete s.playlists[l]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const s=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!s.mediaGroups[n]||!s.mediaGroups[n][r])){for(const a in s.mediaGroups[n])if(a===r){for(const l in s.mediaGroups[n][a])s.mediaGroups[n][a][l].playlists.forEach((f,m)=>{const v=s.playlists[f.id],T=v.id,E=v.resolvedUri;delete s.playlists[T],delete s.playlists[E]});delete s.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const s=this.main,r=s.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=Vi(e.ID,n),l=this.createCloneAttributes_(e.ID,t.attributes),u=this.createClonePlaylist_(t,a,e,l);s.playlists[r]=u,s.playlists[a]=u,s.playlists[n]=u,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,s=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!r.mediaGroups[n]||r.mediaGroups[n][t]))for(const a in r.mediaGroups[n]){if(a===s)r.mediaGroups[n][t]={};else continue;for(const l in r.mediaGroups[n][a]){const u=r.mediaGroups[n][a][l];r.mediaGroups[n][t][l]=_e({},u);const f=r.mediaGroups[n][t][l],m=this.createCloneURI_(u.resolvedUri,e);f.resolvedUri=m,f.uri=m,f.playlists=[],u.playlists.forEach((v,T)=>{const E=r.playlists[v.id],A=_f(n,t,l),y=Vi(t,A);if(E&&!r.playlists[y]){const k=this.createClonePlaylist_(E,y,e),w=k.resolvedUri;r.playlists[y]=k,r.playlists[w]=k}f.playlists[T]=this.createClonePlaylist_(v,y,e)})}}})}createClonePlaylist_(e,t,s,r){const n=this.createCloneURI_(e.resolvedUri,s),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),ie(e,a)}createCloneURI_(e,t){const s=new URL(e);s.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))s.searchParams.set(n,r[n]);return s.href}createCloneAttributes_(e,t){const s={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(s[r]=e)}),s}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const uo=function(i,e,t,s){const r=i.responseType==="arraybuffer"?i.response:i.responseText;!e&&r&&(i.responseTime=Date.now(),i.roundTripTime=i.responseTime-i.requestTime,i.bytesReceived=r.byteLength||r.length,i.bandwidth||(i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3))),t.headers&&(i.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(i.timedout=!0),!e&&!i.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(i&&(r||i.responseText)))),s(e,i)},Oy=(i,e)=>{if(!i||!i.size)return;let t=e;return i.forEach(s=>{t=s(t)}),t},My=(i,e,t,s)=>{!i||!i.size||i.forEach(r=>{r(e,t,s)})},Df=function(){const i=function e(t,s){t=ie({timeout:45e3},t);const r=e.beforeRequest||P.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||P.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||P.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(P.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const l=P.Vhs.xhr.original===!0?P.xhr:P.Vhs.xhr,u=Oy(n,t);n.delete(r);const f=l(u||t,function(v,T){return My(a,f,v,T),uo(f,v,T,s)}),m=f.abort;return f.abort=function(){return f.aborted=!0,m.apply(f,arguments)},f.uri=t.uri,f.requestType=t.requestType,f.requestTime=Date.now(),f};return i.original=!0,i},Ry=function(i){let e;const t=i.offset;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=S.BigInt(i.offset)+S.BigInt(i.length)-S.BigInt(1):e=i.offset+i.length-1,"bytes="+t+"-"+e},co=function(i){const e={};return i.byterange&&(e.Range=Ry(i.byterange)),e},Ny=function(i,e){return i.start(e)+"-"+i.end(e)},By=function(i,e){const t=i.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},Fy=function(i){return i>=32&&i<126?String.fromCharCode(i):"."},kf=function(i){const e={};return Object.keys(i).forEach(t=>{const s=i[t];id(s)?e[t]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:e[t]=s}),e},Sn=function(i){const e=i.byterange||{length:1/0,offset:0};return[e.length,e.offset,i.resolvedUri].join(",")},jf=function(i){return i.resolvedUri},If=i=>{const e=Array.prototype.slice.call(i),t=16;let s="",r,n;for(let a=0;a<e.length/t;a++)r=e.slice(a*t,a*t+t).map(By).join(""),n=e.slice(a*t,a*t+t).map(Fy).join(""),s+=r+" "+n+`
199
- `;return s},Uy=({bytes:i})=>If(i),Vy=i=>{let e="",t;for(t=0;t<i.length;t++)e+=Ny(i,t)+" ";return e};var Hy=Object.freeze({__proto__:null,createTransferableMessage:kf,initSegmentId:Sn,segmentKeyId:jf,hexDump:If,tagDump:Uy,textRanges:Vy});const Pf=.25,qy=(i,e)=>{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,r=e.videoTimingInfo.transmuxedPresentationStart+t,n=i-r;return new Date(e.dateTimeObject.getTime()+n*1e3)},zy=i=>i.transmuxedPresentationEnd-i.transmuxedPresentationStart-i.transmuxerPrependedSeconds,$y=(i,e)=>{let t;try{t=new Date(i)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let s=e.segments[0];if(t<new Date(s.dateTimeObject))return null;for(let u=0;u<e.segments.length-1;u++){s=e.segments[u];const f=new Date(e.segments[u+1].dateTimeObject);if(t<f)break}const r=e.segments[e.segments.length-1],n=r.dateTimeObject,a=r.videoTimingInfo?zy(r.videoTimingInfo):r.duration+r.duration*Pf,l=new Date(n.getTime()+a*1e3);return t>l?null:(t>new Date(n)&&(s=r),{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:Ge.duration(e,e.mediaSequence+e.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"})},Gy=(i,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,s;for(let n=0;n<e.segments.length&&(s=e.segments[n],t=s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationEnd:t+s.duration,!(i<=t));n++);const r=e.segments[e.segments.length-1];if(r.videoTimingInfo&&r.videoTimingInfo.transmuxedPresentationEnd<i)return null;if(i>t){if(i>t+r.duration*Pf)return null;s=r}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:t-s.duration,type:s.videoTimingInfo?"accurate":"estimate"}},Wy=(i,e)=>{let t,s;try{t=new Date(i),s=new Date(e)}catch{}const r=t.getTime();return(s.getTime()-r)/1e3},Xy=i=>{if(!i.segments||i.segments.length===0)return!1;for(let e=0;e<i.segments.length;e++)if(!i.segments[e].dateTimeObject)return!1;return!0},Yy=({playlist:i,time:e=void 0,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");if(!i||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const s=Gy(e,i);if(!s)return t({message:"valid programTime was not found"});if(s.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});const r={mediaSeconds:e},n=qy(e,s.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},Lf=({programTime:i,playlist:e,retryCount:t=2,seekTo:s,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof i>"u"||!e||!s)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!Xy(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const l=$y(i,e);if(!l)return a({message:`${i} was not found in the stream`});const u=l.segment,f=Wy(u.dateTimeObject,i);if(l.type==="estimate"){if(t===0)return a({message:`${i} is not buffered yet. Try again`});s(l.estimatedStart+f),n.one("seeked",()=>{Lf({programTime:i,playlist:e,retryCount:t-1,seekTo:s,pauseAfterSeek:r,tech:n,callback:a})});return}const m=u.start+f,v=()=>a(null,n.currentTime());n.one("seeked",v),r&&n.pause(),s(m)},Ba=(i,e)=>{if(i.readyState===4)return e()},Ky=(i,e,t,s)=>{let r=[],n,a=!1;const l=function(v,T,E,A){return T.abort(),a=!0,t(v,T,E,A)},u=function(v,T){if(a)return;if(v)return v.metadata=vi({requestType:s,request:T,error:v}),l(v,T,"",r);const E=T.responseText.substring(r&&r.byteLength||0,T.responseText.length);if(r=Zg(r,sd(E,!0)),n=n||Fs(r),r.length<10||n&&r.length<n+2)return Ba(T,()=>l(v,T,"",r));const A=No(r);return A==="ts"&&r.length<188?Ba(T,()=>l(v,T,"",r)):!A&&r.length<376?Ba(T,()=>l(v,T,"",r)):l(null,T,A,r)},m=e({uri:i,beforeSend(v){v.overrideMimeType("text/plain; charset=x-user-defined"),v.addEventListener("progress",function({total:T,loaded:E}){return uo(v,null,{statusCode:v.status},u)})}},function(v,T){return uo(m,v,T,u)});return m},{EventTarget:Qy}=P,Ec=function(i,e){if(!wf(i,e)||i.sidx&&e.sidx&&(i.sidx.offset!==e.sidx.offset||i.sidx.length!==e.sidx.length))return!1;if(!i.sidx&&e.sidx||i.sidx&&!e.sidx||i.segments&&!e.segments||!i.segments&&e.segments)return!1;if(!i.segments&&!e.segments)return!0;for(let t=0;t<i.segments.length;t++){const s=i.segments[t],r=e.segments[t];if(s.uri!==r.uri)return!1;if(!s.byterange&&!r.byterange)continue;const n=s.byterange,a=r.byterange;if(n&&!a||!n&&a||n.offset!==a.offset||n.length!==a.length)return!1}return!0},Jy=(i,e,t,s)=>{const r=s.attributes.NAME||t;return`placeholder-uri-${i}-${e}-${r}`},Zy=({mainXml:i,srcUrl:e,clientOffset:t,sidxMapping:s,previousManifest:r})=>{const n=b2(i,{manifestUri:e,clientOffset:t,sidxMapping:s,previousManifest:r});return Tf(n,e,Jy),n},e_=(i,e)=>{ds(i,(t,s,r,n)=>{(!e.mediaGroups[s][r]||!(n in e.mediaGroups[s][r]))&&delete i.mediaGroups[s][r][n]})},t_=(i,e,t)=>{let s=!0,r=ie(i,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n<e.playlists.length;n++){const a=e.playlists[n];if(a.sidx){const u=Pn(a.sidx);t&&t[u]&&t[u].sidx&&Oo(a,t[u].sidx,a.sidx.resolvedUri)}const l=oo(r,a,Ec);l&&(r=l,s=!1)}return ds(e,(n,a,l,u)=>{if(n.playlists&&n.playlists.length){const f=n.playlists[0].id,m=oo(r,n.playlists[0],Ec);m&&(r=m,u in r.mediaGroups[a][l]||(r.mediaGroups[a][l][u]=n),r.mediaGroups[a][l][u].playlists[0]=r.playlists[f],s=!1)}}),e_(r,e),e.minimumUpdatePeriod!==i.minimumUpdatePeriod&&(s=!1),s?null:r},i_=(i,e)=>(!i.map&&!e.map||!!(i.map&&e.map&&i.map.byterange.offset===e.map.byterange.offset&&i.map.byterange.length===e.map.byterange.length))&&i.uri===e.uri&&i.byterange.offset===e.byterange.offset&&i.byterange.length===e.byterange.length,Ac=(i,e)=>{const t={};for(const s in i){const n=i[s].sidx;if(n){const a=Pn(n);if(!e[a])break;const l=e[a].sidxInfo;i_(l,n)&&(t[a]=e[a])}}return t},s_=(i,e)=>{let s=Ac(i.playlists,e);return ds(i,(r,n,a,l)=>{if(r.playlists&&r.playlists.length){const u=r.playlists;s=ie(s,Ac(u,e))}}),s};class ho extends Qy{constructor(e,t,s={},r){super(),this.isPaused_=!0,this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:n=!1}=s;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=s.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=at("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,s){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},s&&(this.state=s),this.trigger("error"),!0}addSidxSegments_(e,t,s){const r=e.sidx&&Pn(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){S.clearTimeout(this.mediaRequest_),this.mediaRequest_=S.setTimeout(()=>s(!1),0);return}const n=xn(e.sidx.resolvedUri),a=(u,f)=>{if(this.requestErrored_(u,f,t))return;const m=this.mainPlaylistLoader_.sidxMapping_,{requestType:v}=f;let T;try{T=w2(G(f.response).subarray(8))}catch(E){E.metadata=vi({requestType:v,request:f,parseFailure:!0}),this.requestErrored_(E,f,t);return}return m[r]={sidxInfo:e.sidx,sidx:T},Oo(e,T,e.sidx.resolvedUri),s(!0)},l="dash-sidx";this.request=Ky(n,this.vhs_.xhr,(u,f,m,v)=>{if(u)return a(u,f);if(!m||m!=="mp4"){const A=m||"unknown";return a({status:f.status,message:`Unsupported ${A} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},f)}const{offset:T,length:E}=e.sidx.byterange;if(v.length>=E+T)return a(u,{response:v.subarray(T,T+E),status:f.status,uri:f.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:co({byterange:e.sidx.byterange})},a)},l)}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},S.clearTimeout(this.minimumUpdatePeriodTimeout_),S.clearTimeout(this.mediaRequest_),S.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const s=!this.media_||e.id!==this.media_.id;if(s&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,s&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}s&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,S.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),S.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(S.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,S.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const s=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=S.setTimeout(()=>this.load(),s);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){S.clearTimeout(this.mediaRequest_),this.mediaRequest_=S.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(s,r)=>{if(s){const{requestType:a}=r;s.metadata=vi({requestType:a,request:r,error:s})}if(this.requestErrored_(s,r)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});const n=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=xn(this.mainPlaylistLoader_.srcUrl,r),n){this.handleMain_(),this.syncClientServerClock_(()=>e(r,n));return}return e(r,n)})}syncClientServerClock_(e){const t=T2(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:$e(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(s,r)=>{if(!this.request)return;if(s){const{requestType:a}=r;return this.error.metadata=vi({requestType:a,request:r,error:s}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;t.method==="HEAD"?!r.responseHeaders||!r.responseHeaders.date?n=this.mainLoaded_:n=Date.parse(r.responseHeaders.date):n=Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){S.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let s;try{s=Zy({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(n){this.error=n,this.error.metadata={errorType:P.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(s=t_(e,s,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=s||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||s&&s.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(s),s){const{duration:n,endList:a}=s,l=[];s.playlists.forEach(f=>{l.push({id:f.id,bandwidth:f.attributes.BANDWIDTH,resolution:f.attributes.RESOLUTION,codecs:f.attributes.CODECS})});const u={duration:n,isLive:!a,renditions:l};t.parsedManifest=u,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!s}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(S.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=S.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=s_(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,s=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,s=!this.media_||this.media_!==t[e];if(s?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=S.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},lo(this.media(),!!s)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(s=>({cueTime:s.start,frames:[{data:s.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var Ae={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const r_=i=>{const e=new Uint8Array(new ArrayBuffer(i.length));for(let t=0;t<i.length;t++)e[t]=i.charCodeAt(t);return e.buffer},Of=function(i){return i.on=i.addEventListener,i.off=i.removeEventListener,i},n_=function(i){try{return URL.createObjectURL(new Blob([i],{type:"application/javascript"}))}catch{const t=new BlobBuilder;return t.append(i),URL.createObjectURL(t.getBlob())}},Mf=function(i){return function(){const e=n_(i),t=Of(new Worker(e));t.objURL=e;const s=t.terminate;return t.on=t.addEventListener,t.off=t.removeEventListener,t.terminate=function(){return URL.revokeObjectURL(e),s.call(this)},t}},Rf=function(i){return`var browserWorkerPolyFill = ${Of.toString()};
198
+ `}return e}const bt=1/30,Tt=bt*3,nf=function(i,e){const t=[];let s;if(i&&i.length)for(s=0;s<i.length;s++)e(i.start(s),i.end(s))&&t.push([i.start(s),i.end(s)]);return ke(t)},Mi=function(i,e){return nf(i,function(t,s){return t-Tt<=e&&s+Tt>=e})},Gr=function(i,e){return nf(i,function(t){return t-bt>=e})},ay=function(i){if(i.length<2)return ke();const e=[];for(let t=1;t<i.length;t++){const s=i.end(t-1),r=i.start(t);e.push([s,r])}return ke(e)},oy=function(i,e){let t=null,s=null,r=0;const n=[],a=[];if(!i||!i.length||!e||!e.length)return ke();let l=i.length;for(;l--;)n.push({time:i.start(l),type:"start"}),n.push({time:i.end(l),type:"end"});for(l=e.length;l--;)n.push({time:e.start(l),type:"start"}),n.push({time:e.end(l),type:"end"});for(n.sort(function(u,f){return u.time-f.time}),l=0;l<n.length;l++)n[l].type==="start"?(r++,r===2&&(t=n[l].time)):n[l].type==="end"&&(r--,r===1&&(s=n[l].time)),t!==null&&s!==null&&(a.push([t,s]),t=null,s=null);return ke(a)},af=i=>{const e=[];if(!i||!i.length)return"";for(let t=0;t<i.length;t++)e.push(i.start(t)+" => "+i.end(t));return e.join(", ")},ly=function(i,e,t=1){return((i.length?i.end(i.length-1):0)-e)/t},hi=i=>{const e=[];for(let t=0;t<i.length;t++)e.push({start:i.start(t),end:i.end(t)});return e},uy=function(i,e){if(i===e)return!1;if(!i&&e||!e&&i||i.length!==e.length)return!0;for(let t=0;t<i.length;t++)if(i.start(t)!==e.start(t)||i.end(t)!==e.end(t))return!0;return!1},Ma=function(i){if(!(!i||!i.length||!i.end))return i.end(i.length-1)},ll=function(i,e){let t=0;if(!i||!i.length)return t;for(let s=0;s<i.length;s++){const r=i.start(s),n=i.end(s);if(!(e>n)){if(e>r&&e<=n){t+=n-e;continue}t+=n-r}}return t},ul=(i,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(s){t+=s.duration}),(e.preloadHints||[]).forEach(function(s){s.type==="PART"&&(t+=i.partTargetDuration)}),t},so=i=>(i.segments||[]).reduce((e,t,s)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:s,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:s,partIndex:null,segment:t,part:null}),e),[]),of=i=>{const e=i.segments&&i.segments.length&&i.segments[i.segments.length-1];return e&&e.parts||[]},lf=({preloadSegment:i})=>{if(!i)return;const{parts:e,preloadHints:t}=i;let s=(t||[]).reduce((r,n)=>r+(n.type==="PART"?1:0),0);return s+=e&&e.length?e.length:0,s},uf=(i,e)=>{if(e.endList)return 0;if(i&&i.suggestedPresentationDelay)return i.suggestedPresentationDelay;const t=of(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},cy=function(i,e){let t=0,s=e-i.mediaSequence,r=i.segments[s];if(r){if(typeof r.start<"u")return{result:r.start,precise:!0};if(typeof r.end<"u")return{result:r.end-r.duration,precise:!0}}for(;s--;){if(r=i.segments[s],typeof r.end<"u")return{result:t+r.end,precise:!0};if(t+=ul(i,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},dy=function(i,e){let t=0,s,r=e-i.mediaSequence;for(;r<i.segments.length;r++){if(s=i.segments[r],typeof s.start<"u")return{result:s.start-t,precise:!0};if(t+=ul(i,s),typeof s.end<"u")return{result:s.end-t,precise:!0}}return{result:-1,precise:!1}},cf=function(i,e,t){if(typeof e>"u"&&(e=i.mediaSequence+i.segments.length),e<i.mediaSequence)return 0;const s=cy(i,e);if(s.precise)return s.result;const r=dy(i,e);return r.precise?r.result:s.result+t},df=function(i,e,t){if(!i)return 0;if(typeof t!="number"&&(t=0),typeof e>"u"){if(i.totalDuration)return i.totalDuration;if(!i.endList)return S.Infinity}return cf(i,e,t)},Ws=function({defaultDuration:i,durationList:e,startIndex:t,endIndex:s}){let r=0;if(t>s&&([t,s]=[s,t]),t<0){for(let n=t;n<Math.min(0,s);n++)r+=i;t=0}for(let n=t;n<s;n++)r+=e[n].duration;return r},hf=function(i,e,t,s){if(!i||!i.segments)return null;if(i.endList)return df(i);if(e===null)return null;e=e||0;let r=cf(i,i.mediaSequence+i.segments.length,e);return t&&(s=typeof s=="number"?s:uf(null,i),r-=s),Math.max(0,r)},hy=function(i,e,t){const r=e||0;let n=hf(i,e,!0,t);return n===null?ke():(n<r&&(n=r),ke(r,n))},fy=function({playlist:i,currentTime:e,startingSegmentIndex:t,startingPartIndex:s,startTime:r,exactManifestTimings:n}){let a=e-r;const l=so(i);let u=0;for(let f=0;f<l.length;f++){const m=l[f];if(t===m.segmentIndex&&!(typeof s=="number"&&typeof m.partIndex=="number"&&s!==m.partIndex)){u=f;break}}if(a<0){if(u>0)for(let f=u-1;f>=0;f--){const m=l[f];if(a+=m.duration,n){if(a<0)continue}else if(a+bt<=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r-Ws({defaultDuration:i.targetDuration,durationList:l,startIndex:u,endIndex:f})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e}}if(u<0){for(let f=u;f<0;f++)if(a-=i.targetDuration,a<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e};u=0}for(let f=u;f<l.length;f++){const m=l[f];a-=m.duration;const v=m.duration>bt,T=a===0,E=v&&a+bt>=0;if(!((T||E)&&f!==l.length-1)){if(n){if(a>0)continue}else if(a-bt>=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r+Ws({defaultDuration:i.targetDuration,durationList:l,startIndex:u,endIndex:f})}}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:e}},ff=function(i){return i.excludeUntil&&i.excludeUntil>Date.now()},cl=function(i){return i.excludeUntil&&i.excludeUntil===1/0},Xn=function(i){const e=ff(i);return!i.disabled&&!e},py=function(i){return i.disabled},my=function(i){for(let e=0;e<i.segments.length;e++)if(i.segments[e].key)return!0;return!1},pf=function(i,e){return e.attributes&&e.attributes[i]},gy=function(i,e,t,s=0){return pf("BANDWIDTH",t)?(i*t.attributes.BANDWIDTH-s*8)/e:NaN},ro=(i,e)=>{if(i.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return i.playlists.filter(s=>Xn(s)?(s.attributes.BANDWIDTH||0)<t:!1).length===0},dl=(i,e)=>!i&&!e||!i&&e||i&&!e?!1:!!(i===e||i.id&&e.id&&i.id===e.id||i.resolvedUri&&e.resolvedUri&&i.resolvedUri===e.resolvedUri||i.uri&&e.uri&&i.uri===e.uri),_c=function(i,e){const t=i&&i.mediaGroups&&i.mediaGroups.AUDIO||{};let s=!1;for(const r in t){for(const n in t[r])if(s=e(t[r][n]),s)break;if(s)break}return!!s},hr=i=>{if(!i||!i.playlists||!i.playlists.length)return _c(i,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;e<i.playlists.length;e++){const t=i.playlists[e],s=t.attributes&&t.attributes.CODECS;if(!(s&&s.split(",").every(n=>Qc(n))||_c(i,n=>dl(t,n))))return!1}return!0};var We={liveEdgeDelay:uf,duration:df,seekable:hy,getMediaInfoForTime:fy,isEnabled:Xn,isDisabled:py,isExcluded:ff,isIncompatible:cl,playlistEnd:hf,isAes:my,hasAttribute:pf,estimateSegmentRequestTime:gy,isLowestEnabledRendition:ro,isAudioOnly:hr,playlistMatch:dl,segmentDurationWithParts:ul};const{log:mf}=P,Vi=(i,e)=>`${i}-${e}`,gf=(i,e,t)=>`placeholder-uri-${i}-${e}-${t}`,vy=({onwarn:i,oninfo:e,manifestString:t,customTagParsers:s=[],customTagMappers:r=[],llhls:n})=>{const a=new Og;i&&a.on("warn",i),e&&a.on("info",e),s.forEach(f=>a.addParser(f)),r.forEach(f=>a.addTagMapper(f)),a.push(t),a.end();const l=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(f){l.hasOwnProperty(f)&&delete l[f]}),l.segments&&l.segments.forEach(function(f){["parts","preloadHints"].forEach(function(m){f.hasOwnProperty(m)&&delete f[m]})})),!l.targetDuration){let f=10;l.segments&&l.segments.length&&(f=l.segments.reduce((m,v)=>Math.max(m,v.duration),0)),i&&i({message:`manifest has no targetDuration defaulting to ${f}`}),l.targetDuration=f}const u=of(l);if(u.length&&!l.partTargetDuration){const f=u.reduce((m,v)=>Math.max(m,v.duration),0);i&&(i({message:`manifest has no partTargetDuration defaulting to ${f}`}),mf.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),l.partTargetDuration=f}return l},ds=(i,e)=>{i.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(i.mediaGroups[t])for(const s in i.mediaGroups[t])for(const r in i.mediaGroups[t][s]){const n=i.mediaGroups[t][s][r];e(n,t,s,r)}})},vf=({playlist:i,uri:e,id:t})=>{i.id=t,i.playlistErrors_=0,e&&(i.uri=e),i.attributes=i.attributes||{}},yy=i=>{let e=i.playlists.length;for(;e--;){const t=i.playlists[e];vf({playlist:t,id:Vi(e,t.uri)}),t.resolvedUri=Ge(i.uri,t.uri),i.playlists[t.id]=t,i.playlists[t.uri]=t,t.attributes.BANDWIDTH||mf.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},_y=i=>{ds(i,e=>{e.uri&&(e.resolvedUri=Ge(i.uri,e.uri))})},by=(i,e)=>{const t=Vi(0,e),s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:S.location.href,resolvedUri:S.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return s.playlists[t]=s.playlists[0],s.playlists[e]=s.playlists[0],s},yf=(i,e,t=gf)=>{i.uri=e;for(let r=0;r<i.playlists.length;r++)if(!i.playlists[r].uri){const n=`placeholder-uri-${r}`;i.playlists[r].uri=n}const s=hr(i);ds(i,(r,n,a,l)=>{if(!r.playlists||!r.playlists.length){if(s&&n==="AUDIO"&&!r.uri)for(let u=0;u<i.playlists.length;u++){const f=i.playlists[u];if(f.attributes&&f.attributes.AUDIO&&f.attributes.AUDIO===a)return}r.playlists=[_e({},r)]}r.playlists.forEach(function(u,f){const m=t(n,a,l,u),v=Vi(f,m);u.uri?u.resolvedUri=u.resolvedUri||Ge(i.uri,u.uri):(u.uri=f===0?m:v,u.resolvedUri=u.uri),u.id=u.id||v,u.attributes=u.attributes||{},i.playlists[u.id]=u,i.playlists[u.uri]=u})}),yy(i),_y(i)};class bc{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(this.offset_!==null||!e.length)return;const[t]=e;t.programDateTime!==void 0&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,s=t.startDate.getTime();this.trimProcessedDateRanges_(s),this.pendingDateRanges_=e.reduce((r,n)=>(r.set(n.id,n),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((s,r)=>{if(!this.processedDateRanges_.has(r)&&(s.startTime=s.startDate.getTime()/1e3-this.offset_,s.processDateRange=()=>this.processDateRange(s),t.push(s),!!s.class))if(e[s.class]){const n=e[s.class].push(s);s.classListIndex=n-1}else e[s.class]=[s],s.classListIndex=0});for(const s of t){const r=e[s.class]||[];s.endDate?s.endTime=s.endDate.getTime()/1e3-this.offset_:s.endOnNext&&r[s.classListIndex+1]?s.endTime=r[s.classListIndex+1].startTime:s.duration?s.endTime=s.startTime+s.duration:s.plannedDuration?s.endTime=s.startTime+s.plannedDuration:s.endTime=s.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((s,r)=>{s.startDate.getTime()<e&&this.processedDateRanges_.delete(r)})}}const _f=22,vi=({requestType:i,request:e,error:t,parseFailure:s})=>{const r=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:i},l=r&&!n||s;if(t&&n)a.error=_e({},t),a.errorType=P.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=P.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=P.Error.NetworkRequestTimeout;else if(l){const u=s?P.Error.NetworkBodyParserFailed:P.Error.NetworkBadStatus;a.errorType=u,a.status=e.status,a.headers=e.headers}return a},Ty=ot("CodecUtils"),bf=function(i){const e=i.attributes||{};if(e.CODECS)return vt(e.CODECS)},Tf=(i,e)=>{const t=e.attributes||{};return i&&i.mediaGroups&&i.mediaGroups.AUDIO&&t.AUDIO&&i.mediaGroups.AUDIO[t.AUDIO]},xy=(i,e)=>{if(!Tf(i,e))return!0;const t=e.attributes||{},s=i.mediaGroups.AUDIO[t.AUDIO];for(const r in s)if(!s[r].uri&&!s[r].playlists)return!0;return!1},ir=function(i){const e={};return i.forEach(({mediaType:t,type:s,details:r})=>{e[t]=e[t]||[],e[t].push(Kc(`${s}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){Ty(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},Tc=function(i){let e=0;return i.audio&&e++,i.video&&e++,e},Xs=function(i,e){const t=e.attributes||{},s=ir(bf(e)||[]);if(Tf(i,e)&&!s.audio&&!xy(i,e)){const r=ir(Rg(i,t.AUDIO)||[]);r.audio&&(s.audio=r.audio)}return s},{EventTarget:Sy}=P,Cy=(i,e)=>{if(e.endList||!e.serverControl)return i;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:s}=e;let r=e.mediaSequence+e.segments.length;if(s){const n=s.parts||[],a=lf(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const s=new S.URL(i);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&s.searchParams.set(r,t[r])}),i=s.toString()}return i},Ey=(i,e)=>{if(!i)return e;const t=ie(i,e);if(i.preloadHints&&!e.preloadHints&&delete t.preloadHints,i.parts&&!e.parts)delete t.parts;else if(i.parts&&e.parts)for(let s=0;s<e.parts.length;s++)i.parts&&i.parts[s]&&(t.parts[s]=ie(i.parts[s],e.parts[s]));return!i.skipped&&e.skipped&&(t.skipped=!1),i.preload&&!e.preload&&(t.preload=!1),t},Ay=(i,e,t)=>{const s=i.slice(),r=e.slice();t=t||0;const n=[];let a;for(let l=0;l<r.length;l++){const u=s[l+t],f=r[l];u?(a=u.map||a,n.push(Ey(u,f))):(a&&!f.map&&(f.map=a),n.push(f))}return n},xf=(i,e)=>{!i.resolvedUri&&i.uri&&(i.resolvedUri=Ge(e,i.uri)),i.key&&!i.key.resolvedUri&&(i.key.resolvedUri=Ge(e,i.key.uri)),i.map&&!i.map.resolvedUri&&(i.map.resolvedUri=Ge(e,i.map.uri)),i.map&&i.map.key&&!i.map.key.resolvedUri&&(i.map.key.resolvedUri=Ge(e,i.map.key.uri)),i.parts&&i.parts.length&&i.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=Ge(e,t.uri))}),i.preloadHints&&i.preloadHints.length&&i.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=Ge(e,t.uri))})},Sf=function(i){const e=i.segments||[],t=i.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let s=0;s<t.preloadHints.length;s++)if(t.preloadHints[s].type==="MAP")return e}t.duration=i.targetDuration,t.preload=!0,e.push(t)}return e},Cf=(i,e)=>i===e||i.segments&&e.segments&&i.segments.length===e.segments.length&&i.endList===e.endList&&i.mediaSequence===e.mediaSequence&&i.preloadSegment===e.preloadSegment,no=(i,e,t=Cf)=>{const s=ie(i,{}),r=s.playlists[e.id];if(!r||t(r,e))return null;e.segments=Sf(e);const n=ie(r,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a<e.skip.skippedSegments;a++)e.segments.unshift({skipped:!0})}n.segments=Ay(r.segments,e.segments,e.mediaSequence-r.mediaSequence)}n.segments.forEach(a=>{xf(a,n.resolvedUri)});for(let a=0;a<s.playlists.length;a++)s.playlists[a].id===e.id&&(s.playlists[a]=n);return s.playlists[e.id]=n,s.playlists[e.uri]=n,ds(i,(a,l,u,f)=>{if(a.playlists)for(let m=0;m<a.playlists.length;m++)e.id===a.playlists[m].id&&(a.playlists[m]=n)}),s},ao=(i,e)=>{const t=i.segments||[],s=t[t.length-1],r=s&&s.parts&&s.parts[s.parts.length-1],n=r&&r.duration||s&&s.duration;return e&&n?n*1e3:(i.partTargetDuration||i.targetDuration||10)*500},xc=(i,e,t)=>{if(!i)return;const s=[];return i.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:l}=r.attributes;s.push({id:r.id,bandwidth:n,resolution:a,codecs:l})}),{type:e,isLive:t,renditions:s}};class Ri extends Sy{constructor(e,t,s={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=ot("PlaylistLoader");const{withCredentials:r=!1}=s;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=s.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new bc,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=Ge(this.main.uri,e.uri);this.llhls&&(t=Cy(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(s,r)=>{if(this.request){if(s)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,s){const{uri:r,id:n}=t;this.request=null,s&&(this.state=s),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:vi({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{const s=vy({onwarn:({message:r})=>this.logger_(`m3u8-parser warn for ${e}: ${r}`),oninfo:({message:r})=>this.logger_(`m3u8-parser info for ${e}: ${r}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return!s.playlists||!s.playlists.length||this.excludeAudioOnlyVariants(s.playlists),s}catch(s){this.error=s,this.error.metadata={errorType:P.Error.StreamingHlsPlaylistParserError,error:s}}}excludeAudioOnlyVariants(e){const t=s=>{const r=s.attributes||{},{width:n,height:a}=r.RESOLUTION||{};if(n&&a)return!0;const l=bf(s)||[];return!!ir(l).video};e.some(t)&&e.forEach(s=>{t(s)||(s.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:t,url:s,id:r}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:s}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:s,manifestString:e});a.lastRequest=Date.now(),vf({playlist:a,uri:s,id:r});const l=no(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,l?(this.main=l,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(ao(this.media(),!!l)),n.parsedPlaylist=xc(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),S.clearTimeout(this.mediaUpdateTimeout),S.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new bc,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(S.clearTimeout(this.finalRenditionTimeout),t){const l=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=S.setTimeout(this.media.bind(this,e,!1),l);return}const s=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(ao(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(l,u)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=bn(e.resolvedUri,u),l)return this.playlistRequestError(this.request,e,s);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:u.responseText,url:e.uri,id:e.id}),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(S.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(S.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const s=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=S.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},s);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(S.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=S.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=S.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,s)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:s.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:s.responseText,code:2,metadata:vi({requestType:s.requestType,request:s,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=bn(this.src,s),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:s.responseText,url:this.src});e.parsedPlaylist=xc(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,yf(this.main,this.srcUri()),e.playlists.forEach(s=>{s.segments=Sf(s),s.segments.forEach(r=>{xf(r,s.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||S.location.href;this.main=by(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const s=this.main,r=e.ID;let n=s.playlists.length;for(;n--;){const a=s.playlists[n];if(a.attributes["PATHWAY-ID"]===r){const l=a.resolvedUri,u=a.id;if(t){const f=this.createCloneURI_(a.resolvedUri,e),m=Vi(r,f),v=this.createCloneAttributes_(r,a.attributes),T=this.createClonePlaylist_(a,m,e,v);s.playlists[n]=T,s.playlists[m]=T,s.playlists[f]=T}else s.playlists.splice(n,1);delete s.playlists[u],delete s.playlists[l]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const s=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!s.mediaGroups[n]||!s.mediaGroups[n][r])){for(const a in s.mediaGroups[n])if(a===r){for(const l in s.mediaGroups[n][a])s.mediaGroups[n][a][l].playlists.forEach((f,m)=>{const v=s.playlists[f.id],T=v.id,E=v.resolvedUri;delete s.playlists[T],delete s.playlists[E]});delete s.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const s=this.main,r=s.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=Vi(e.ID,n),l=this.createCloneAttributes_(e.ID,t.attributes),u=this.createClonePlaylist_(t,a,e,l);s.playlists[r]=u,s.playlists[a]=u,s.playlists[n]=u,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,s=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!r.mediaGroups[n]||r.mediaGroups[n][t]))for(const a in r.mediaGroups[n]){if(a===s)r.mediaGroups[n][t]={};else continue;for(const l in r.mediaGroups[n][a]){const u=r.mediaGroups[n][a][l];r.mediaGroups[n][t][l]=_e({},u);const f=r.mediaGroups[n][t][l],m=this.createCloneURI_(u.resolvedUri,e);f.resolvedUri=m,f.uri=m,f.playlists=[],u.playlists.forEach((v,T)=>{const E=r.playlists[v.id],A=gf(n,t,l),y=Vi(t,A);if(E&&!r.playlists[y]){const k=this.createClonePlaylist_(E,y,e),w=k.resolvedUri;r.playlists[y]=k,r.playlists[w]=k}f.playlists[T]=this.createClonePlaylist_(v,y,e)})}}})}createClonePlaylist_(e,t,s,r){const n=this.createCloneURI_(e.resolvedUri,s),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),ie(e,a)}createCloneURI_(e,t){const s=new URL(e);s.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))s.searchParams.set(n,r[n]);return s.href}createCloneAttributes_(e,t){const s={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(s[r]=e)}),s}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const oo=function(i,e,t,s){const r=i.responseType==="arraybuffer"?i.response:i.responseText;!e&&r&&(i.responseTime=Date.now(),i.roundTripTime=i.responseTime-i.requestTime,i.bytesReceived=r.byteLength||r.length,i.bandwidth||(i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3))),t.headers&&(i.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(i.timedout=!0),!e&&!i.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(i&&(r||i.responseText)))),s(e,i)},wy=(i,e)=>{if(!i||!i.size)return;let t=e;return i.forEach(s=>{t=s(t)}),t},Dy=(i,e,t,s)=>{!i||!i.size||i.forEach(r=>{r(e,t,s)})},Ef=function(){const i=function e(t,s){t=ie({timeout:45e3},t);const r=e.beforeRequest||P.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||P.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||P.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(P.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const l=P.Vhs.xhr.original===!0?P.xhr:P.Vhs.xhr,u=wy(n,t);n.delete(r);const f=l(u||t,function(v,T){return Dy(a,f,v,T),oo(f,v,T,s)}),m=f.abort;return f.abort=function(){return f.aborted=!0,m.apply(f,arguments)},f.uri=t.uri,f.requestType=t.requestType,f.requestTime=Date.now(),f};return i.original=!0,i},ky=function(i){let e;const t=i.offset;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=S.BigInt(i.offset)+S.BigInt(i.length)-S.BigInt(1):e=i.offset+i.length-1,"bytes="+t+"-"+e},lo=function(i){const e={};return i.byterange&&(e.Range=ky(i.byterange)),e},jy=function(i,e){return i.start(e)+"-"+i.end(e)},Iy=function(i,e){const t=i.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},Py=function(i){return i>=32&&i<126?String.fromCharCode(i):"."},Af=function(i){const e={};return Object.keys(i).forEach(t=>{const s=i[t];Zc(s)?e[t]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:e[t]=s}),e},Tn=function(i){const e=i.byterange||{length:1/0,offset:0};return[e.length,e.offset,i.resolvedUri].join(",")},wf=function(i){return i.resolvedUri},Df=i=>{const e=Array.prototype.slice.call(i),t=16;let s="",r,n;for(let a=0;a<e.length/t;a++)r=e.slice(a*t,a*t+t).map(Iy).join(""),n=e.slice(a*t,a*t+t).map(Py).join(""),s+=r+" "+n+`
199
+ `;return s},Ly=({bytes:i})=>Df(i),Oy=i=>{let e="",t;for(t=0;t<i.length;t++)e+=jy(i,t)+" ";return e};var My=Object.freeze({__proto__:null,createTransferableMessage:Af,initSegmentId:Tn,segmentKeyId:wf,hexDump:Df,tagDump:Ly,textRanges:Oy});const kf=.25,Ry=(i,e)=>{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,r=e.videoTimingInfo.transmuxedPresentationStart+t,n=i-r;return new Date(e.dateTimeObject.getTime()+n*1e3)},Ny=i=>i.transmuxedPresentationEnd-i.transmuxedPresentationStart-i.transmuxerPrependedSeconds,By=(i,e)=>{let t;try{t=new Date(i)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let s=e.segments[0];if(t<new Date(s.dateTimeObject))return null;for(let u=0;u<e.segments.length-1;u++){s=e.segments[u];const f=new Date(e.segments[u+1].dateTimeObject);if(t<f)break}const r=e.segments[e.segments.length-1],n=r.dateTimeObject,a=r.videoTimingInfo?Ny(r.videoTimingInfo):r.duration+r.duration*kf,l=new Date(n.getTime()+a*1e3);return t>l?null:(t>new Date(n)&&(s=r),{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:We.duration(e,e.mediaSequence+e.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"})},Fy=(i,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,s;for(let n=0;n<e.segments.length&&(s=e.segments[n],t=s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationEnd:t+s.duration,!(i<=t));n++);const r=e.segments[e.segments.length-1];if(r.videoTimingInfo&&r.videoTimingInfo.transmuxedPresentationEnd<i)return null;if(i>t){if(i>t+r.duration*kf)return null;s=r}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:t-s.duration,type:s.videoTimingInfo?"accurate":"estimate"}},Uy=(i,e)=>{let t,s;try{t=new Date(i),s=new Date(e)}catch{}const r=t.getTime();return(s.getTime()-r)/1e3},Vy=i=>{if(!i.segments||i.segments.length===0)return!1;for(let e=0;e<i.segments.length;e++)if(!i.segments[e].dateTimeObject)return!1;return!0},Hy=({playlist:i,time:e=void 0,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");if(!i||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const s=Fy(e,i);if(!s)return t({message:"valid programTime was not found"});if(s.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});const r={mediaSeconds:e},n=Ry(e,s.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},jf=({programTime:i,playlist:e,retryCount:t=2,seekTo:s,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof i>"u"||!e||!s)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!Vy(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const l=By(i,e);if(!l)return a({message:`${i} was not found in the stream`});const u=l.segment,f=Uy(u.dateTimeObject,i);if(l.type==="estimate"){if(t===0)return a({message:`${i} is not buffered yet. Try again`});s(l.estimatedStart+f),n.one("seeked",()=>{jf({programTime:i,playlist:e,retryCount:t-1,seekTo:s,pauseAfterSeek:r,tech:n,callback:a})});return}const m=u.start+f,v=()=>a(null,n.currentTime());n.one("seeked",v),r&&n.pause(),s(m)},Ra=(i,e)=>{if(i.readyState===4)return e()},qy=(i,e,t,s)=>{let r=[],n,a=!1;const l=function(v,T,E,A){return T.abort(),a=!0,t(v,T,E,A)},u=function(v,T){if(a)return;if(v)return v.metadata=vi({requestType:s,request:T,error:v}),l(v,T,"",r);const E=T.responseText.substring(r&&r.byteLength||0,T.responseText.length);if(r=Gg(r,ed(E,!0)),n=n||Fs(r),r.length<10||n&&r.length<n+2)return Ra(T,()=>l(v,T,"",r));const A=Mo(r);return A==="ts"&&r.length<188?Ra(T,()=>l(v,T,"",r)):!A&&r.length<376?Ra(T,()=>l(v,T,"",r)):l(null,T,A,r)},m=e({uri:i,beforeSend(v){v.overrideMimeType("text/plain; charset=x-user-defined"),v.addEventListener("progress",function({total:T,loaded:E}){return oo(v,null,{statusCode:v.status},u)})}},function(v,T){return oo(m,v,T,u)});return m},{EventTarget:zy}=P,Sc=function(i,e){if(!Cf(i,e)||i.sidx&&e.sidx&&(i.sidx.offset!==e.sidx.offset||i.sidx.length!==e.sidx.length))return!1;if(!i.sidx&&e.sidx||i.sidx&&!e.sidx||i.segments&&!e.segments||!i.segments&&e.segments)return!1;if(!i.segments&&!e.segments)return!0;for(let t=0;t<i.segments.length;t++){const s=i.segments[t],r=e.segments[t];if(s.uri!==r.uri)return!1;if(!s.byterange&&!r.byterange)continue;const n=s.byterange,a=r.byterange;if(n&&!a||!n&&a||n.offset!==a.offset||n.length!==a.length)return!1}return!0},$y=(i,e,t,s)=>{const r=s.attributes.NAME||t;return`placeholder-uri-${i}-${e}-${r}`},Gy=({mainXml:i,srcUrl:e,clientOffset:t,sidxMapping:s,previousManifest:r})=>{const n=f2(i,{manifestUri:e,clientOffset:t,sidxMapping:s,previousManifest:r});return yf(n,e,$y),n},Wy=(i,e)=>{ds(i,(t,s,r,n)=>{(!e.mediaGroups[s][r]||!(n in e.mediaGroups[s][r]))&&delete i.mediaGroups[s][r][n]})},Xy=(i,e,t)=>{let s=!0,r=ie(i,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n<e.playlists.length;n++){const a=e.playlists[n];if(a.sidx){const u=jn(a.sidx);t&&t[u]&&t[u].sidx&&Po(a,t[u].sidx,a.sidx.resolvedUri)}const l=no(r,a,Sc);l&&(r=l,s=!1)}return ds(e,(n,a,l,u)=>{if(n.playlists&&n.playlists.length){const f=n.playlists[0].id,m=no(r,n.playlists[0],Sc);m&&(r=m,u in r.mediaGroups[a][l]||(r.mediaGroups[a][l][u]=n),r.mediaGroups[a][l][u].playlists[0]=r.playlists[f],s=!1)}}),Wy(r,e),e.minimumUpdatePeriod!==i.minimumUpdatePeriod&&(s=!1),s?null:r},Yy=(i,e)=>(!i.map&&!e.map||!!(i.map&&e.map&&i.map.byterange.offset===e.map.byterange.offset&&i.map.byterange.length===e.map.byterange.length))&&i.uri===e.uri&&i.byterange.offset===e.byterange.offset&&i.byterange.length===e.byterange.length,Cc=(i,e)=>{const t={};for(const s in i){const n=i[s].sidx;if(n){const a=jn(n);if(!e[a])break;const l=e[a].sidxInfo;Yy(l,n)&&(t[a]=e[a])}}return t},Ky=(i,e)=>{let s=Cc(i.playlists,e);return ds(i,(r,n,a,l)=>{if(r.playlists&&r.playlists.length){const u=r.playlists;s=ie(s,Cc(u,e))}}),s};class uo extends zy{constructor(e,t,s={},r){super(),this.isPaused_=!0,this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:n=!1}=s;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=s.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=ot("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,s){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},s&&(this.state=s),this.trigger("error"),!0}addSidxSegments_(e,t,s){const r=e.sidx&&jn(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){S.clearTimeout(this.mediaRequest_),this.mediaRequest_=S.setTimeout(()=>s(!1),0);return}const n=bn(e.sidx.resolvedUri),a=(u,f)=>{if(this.requestErrored_(u,f,t))return;const m=this.mainPlaylistLoader_.sidxMapping_,{requestType:v}=f;let T;try{T=b2(G(f.response).subarray(8))}catch(E){E.metadata=vi({requestType:v,request:f,parseFailure:!0}),this.requestErrored_(E,f,t);return}return m[r]={sidxInfo:e.sidx,sidx:T},Po(e,T,e.sidx.resolvedUri),s(!0)},l="dash-sidx";this.request=qy(n,this.vhs_.xhr,(u,f,m,v)=>{if(u)return a(u,f);if(!m||m!=="mp4"){const A=m||"unknown";return a({status:f.status,message:`Unsupported ${A} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},f)}const{offset:T,length:E}=e.sidx.byterange;if(v.length>=E+T)return a(u,{response:v.subarray(T,T+E),status:f.status,uri:f.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:lo({byterange:e.sidx.byterange})},a)},l)}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},S.clearTimeout(this.minimumUpdatePeriodTimeout_),S.clearTimeout(this.mediaRequest_),S.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const s=!this.media_||e.id!==this.media_.id;if(s&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,s&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}s&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,S.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),S.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(S.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,S.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const s=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=S.setTimeout(()=>this.load(),s);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){S.clearTimeout(this.mediaRequest_),this.mediaRequest_=S.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(s,r)=>{if(s){const{requestType:a}=r;s.metadata=vi({requestType:a,request:r,error:s})}if(this.requestErrored_(s,r)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});const n=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=bn(this.mainPlaylistLoader_.srcUrl,r),n){this.handleMain_(),this.syncClientServerClock_(()=>e(r,n));return}return e(r,n)})}syncClientServerClock_(e){const t=p2(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:Ge(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(s,r)=>{if(!this.request)return;if(s){const{requestType:a}=r;return this.error.metadata=vi({requestType:a,request:r,error:s}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;t.method==="HEAD"?!r.responseHeaders||!r.responseHeaders.date?n=this.mainLoaded_:n=Date.parse(r.responseHeaders.date):n=Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){S.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let s;try{s=Gy({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(n){this.error=n,this.error.metadata={errorType:P.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(s=Xy(e,s,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=s||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||s&&s.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(s),s){const{duration:n,endList:a}=s,l=[];s.playlists.forEach(f=>{l.push({id:f.id,bandwidth:f.attributes.BANDWIDTH,resolution:f.attributes.RESOLUTION,codecs:f.attributes.CODECS})});const u={duration:n,isLive:!a,renditions:l};t.parsedManifest=u,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!s}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(S.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=S.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=Ky(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,s=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,s=!this.media_||this.media_!==t[e];if(s?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=S.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},ao(this.media(),!!s)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(s=>({cueTime:s.start,frames:[{data:s.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var we={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const Qy=i=>{const e=new Uint8Array(new ArrayBuffer(i.length));for(let t=0;t<i.length;t++)e[t]=i.charCodeAt(t);return e.buffer},If=function(i){return i.on=i.addEventListener,i.off=i.removeEventListener,i},Jy=function(i){try{return URL.createObjectURL(new Blob([i],{type:"application/javascript"}))}catch{const t=new BlobBuilder;return t.append(i),URL.createObjectURL(t.getBlob())}},Pf=function(i){return function(){const e=Jy(i),t=If(new Worker(e));t.objURL=e;const s=t.terminate;return t.on=t.addEventListener,t.off=t.removeEventListener,t.terminate=function(){return URL.revokeObjectURL(e),s.call(this)},t}},Lf=function(i){return`var browserWorkerPolyFill = ${If.toString()};
200
200
  browserWorkerPolyFill(self);
201
- `+i},Nf=function(i){return i.toString().replace(/^function.+?{/,"").slice(0,-1)},a_=Rf(Nf(function(){var i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=function(){this.init=function(){var o={};this.on=function(c,h){o[c]||(o[c]=[]),o[c]=o[c].concat(h)},this.off=function(c,h){var d;return o[c]?(d=o[c].indexOf(h),o[c]=o[c].slice(),o[c].splice(d,1),d>-1):!1},this.trigger=function(c){var h,d,p,g;if(h=o[c],!!h)if(arguments.length===2)for(p=h.length,d=0;d<p;++d)h[d].call(this,arguments[1]);else{for(g=[],d=arguments.length,d=1;d<arguments.length;++d)g.push(arguments[d]);for(p=h.length,d=0;d<p;++d)h[d].apply(this,g)}},this.dispose=function(){o={}}}};e.prototype.pipe=function(o){return this.on("data",function(c){o.push(c)}),this.on("done",function(c){o.flush(c)}),this.on("partialdone",function(c){o.partialFlush(c)}),this.on("endedtimeline",function(c){o.endTimeline(c)}),this.on("reset",function(c){o.reset(c)}),o},e.prototype.push=function(o){this.trigger("data",o)},e.prototype.flush=function(o){this.trigger("done",o)},e.prototype.partialFlush=function(o){this.trigger("partialdone",o)},e.prototype.endTimeline=function(o){this.trigger("endedtimeline",o)},e.prototype.reset=function(o){this.trigger("reset",o)};var t=e,s=Math.pow(2,32),r=function(o){var c=new DataView(o.buffer,o.byteOffset,o.byteLength),h;return c.getBigUint64?(h=c.getBigUint64(0),h<Number.MAX_SAFE_INTEGER?Number(h):h):c.getUint32(0)*s+c.getUint32(4)},n={getUint64:r,MAX_UINT32:s},a=n.MAX_UINT32,l,u,f,m,v,T,E,A,y,k,w,I,j,L,O,F,B,U,X,ae,J,le,z,Z,Me,ee,be,Dt,ti,ii,si,ri,pr,gl,vl,yl;(function(){var o;if(z={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},!(typeof Uint8Array>"u")){for(o in z)z.hasOwnProperty(o)&&(z[o]=[o.charCodeAt(0),o.charCodeAt(1),o.charCodeAt(2),o.charCodeAt(3)]);Z=new Uint8Array([105,115,111,109]),ee=new Uint8Array([97,118,99,49]),Me=new Uint8Array([0,0,0,1]),be=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),Dt=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),ti={video:be,audio:Dt},ri=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),si=new Uint8Array([0,0,0,0,0,0,0,0]),pr=new Uint8Array([0,0,0,0,0,0,0,0]),gl=pr,vl=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),yl=pr,ii=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),l=function(o){var c=[],h=0,d,p,g;for(d=1;d<arguments.length;d++)c.push(arguments[d]);for(d=c.length;d--;)h+=c[d].byteLength;for(p=new Uint8Array(h+8),g=new DataView(p.buffer,p.byteOffset,p.byteLength),g.setUint32(0,p.byteLength),p.set(o,4),d=0,h=8;d<c.length;d++)p.set(c[d],h),h+=c[d].byteLength;return p},u=function(){return l(z.dinf,l(z.dref,ri))},f=function(o){return l(z.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,o.audioobjecttype<<3|o.samplingfrequencyindex>>>1,o.samplingfrequencyindex<<7|o.channelcount<<3,6,1,2]))},m=function(){return l(z.ftyp,Z,Me,Z,ee)},F=function(o){return l(z.hdlr,ti[o])},v=function(o){return l(z.mdat,o)},O=function(o){var c=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,o.duration>>>24&255,o.duration>>>16&255,o.duration>>>8&255,o.duration&255,85,196,0,0]);return o.samplerate&&(c[12]=o.samplerate>>>24&255,c[13]=o.samplerate>>>16&255,c[14]=o.samplerate>>>8&255,c[15]=o.samplerate&255),l(z.mdhd,c)},L=function(o){return l(z.mdia,O(o),F(o.type),E(o))},T=function(o){return l(z.mfhd,new Uint8Array([0,0,0,0,(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&255]))},E=function(o){return l(z.minf,o.type==="video"?l(z.vmhd,ii):l(z.smhd,si),u(),U(o))},A=function(o,c){for(var h=[],d=c.length;d--;)h[d]=ae(c[d]);return l.apply(null,[z.moof,T(o)].concat(h))},y=function(o){for(var c=o.length,h=[];c--;)h[c]=I(o[c]);return l.apply(null,[z.moov,w(4294967295)].concat(h).concat(k(o)))},k=function(o){for(var c=o.length,h=[];c--;)h[c]=J(o[c]);return l.apply(null,[z.mvex].concat(h))},w=function(o){var c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return l(z.mvhd,c)},B=function(o){var c=o.samples||[],h=new Uint8Array(4+c.length),d,p;for(p=0;p<c.length;p++)d=c[p].flags,h[p+4]=d.dependsOn<<4|d.isDependedOn<<2|d.hasRedundancy;return l(z.sdtp,h)},U=function(o){return l(z.stbl,X(o),l(z.stts,yl),l(z.stsc,gl),l(z.stsz,vl),l(z.stco,pr))},function(){var o,c;X=function(h){return l(z.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),h.type==="video"?o(h):c(h))},o=function(h){var d=h.sps||[],p=h.pps||[],g=[],_=[],b,x;for(b=0;b<d.length;b++)g.push((d[b].byteLength&65280)>>>8),g.push(d[b].byteLength&255),g=g.concat(Array.prototype.slice.call(d[b]));for(b=0;b<p.length;b++)_.push((p[b].byteLength&65280)>>>8),_.push(p[b].byteLength&255),_=_.concat(Array.prototype.slice.call(p[b]));if(x=[z.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(h.width&65280)>>8,h.width&255,(h.height&65280)>>8,h.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),l(z.avcC,new Uint8Array([1,h.profileIdc,h.profileCompatibility,h.levelIdc,255].concat([d.length],g,[p.length],_))),l(z.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],h.sarRatio){var C=h.sarRatio[0],D=h.sarRatio[1];x.push(l(z.pasp,new Uint8Array([(C&4278190080)>>24,(C&16711680)>>16,(C&65280)>>8,C&255,(D&4278190080)>>24,(D&16711680)>>16,(D&65280)>>8,D&255])))}return l.apply(null,x)},c=function(h){return l(z.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(h.channelcount&65280)>>8,h.channelcount&255,(h.samplesize&65280)>>8,h.samplesize&255,0,0,0,0,(h.samplerate&65280)>>8,h.samplerate&255,0,0]),f(h))}}(),j=function(o){var c=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,0,(o.duration&4278190080)>>24,(o.duration&16711680)>>16,(o.duration&65280)>>8,o.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(o.width&65280)>>8,o.width&255,0,0,(o.height&65280)>>8,o.height&255,0,0]);return l(z.tkhd,c)},ae=function(o){var c,h,d,p,g,_,b;return c=l(z.tfhd,new Uint8Array([0,0,0,58,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),_=Math.floor(o.baseMediaDecodeTime/a),b=Math.floor(o.baseMediaDecodeTime%a),h=l(z.tfdt,new Uint8Array([1,0,0,0,_>>>24&255,_>>>16&255,_>>>8&255,_&255,b>>>24&255,b>>>16&255,b>>>8&255,b&255])),g=92,o.type==="audio"?(d=le(o,g),l(z.traf,c,h,d)):(p=B(o),d=le(o,p.length+g),l(z.traf,c,h,d,p))},I=function(o){return o.duration=o.duration||4294967295,l(z.trak,j(o),L(o))},J=function(o){var c=new Uint8Array([0,0,0,0,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return o.type!=="video"&&(c[c.length-1]=0),l(z.trex,c)},function(){var o,c,h;h=function(d,p){var g=0,_=0,b=0,x=0;return d.length&&(d[0].duration!==void 0&&(g=1),d[0].size!==void 0&&(_=2),d[0].flags!==void 0&&(b=4),d[0].compositionTimeOffset!==void 0&&(x=8)),[0,0,g|_|b|x,1,(d.length&4278190080)>>>24,(d.length&16711680)>>>16,(d.length&65280)>>>8,d.length&255,(p&4278190080)>>>24,(p&16711680)>>>16,(p&65280)>>>8,p&255]},c=function(d,p){var g,_,b,x,C,D;for(x=d.samples||[],p+=20+16*x.length,b=h(x,p),_=new Uint8Array(b.length+x.length*16),_.set(b),g=b.length,D=0;D<x.length;D++)C=x[D],_[g++]=(C.duration&4278190080)>>>24,_[g++]=(C.duration&16711680)>>>16,_[g++]=(C.duration&65280)>>>8,_[g++]=C.duration&255,_[g++]=(C.size&4278190080)>>>24,_[g++]=(C.size&16711680)>>>16,_[g++]=(C.size&65280)>>>8,_[g++]=C.size&255,_[g++]=C.flags.isLeading<<2|C.flags.dependsOn,_[g++]=C.flags.isDependedOn<<6|C.flags.hasRedundancy<<4|C.flags.paddingValue<<1|C.flags.isNonSyncSample,_[g++]=C.flags.degradationPriority&61440,_[g++]=C.flags.degradationPriority&15,_[g++]=(C.compositionTimeOffset&4278190080)>>>24,_[g++]=(C.compositionTimeOffset&16711680)>>>16,_[g++]=(C.compositionTimeOffset&65280)>>>8,_[g++]=C.compositionTimeOffset&255;return l(z.trun,_)},o=function(d,p){var g,_,b,x,C,D;for(x=d.samples||[],p+=20+8*x.length,b=h(x,p),g=new Uint8Array(b.length+x.length*8),g.set(b),_=b.length,D=0;D<x.length;D++)C=x[D],g[_++]=(C.duration&4278190080)>>>24,g[_++]=(C.duration&16711680)>>>16,g[_++]=(C.duration&65280)>>>8,g[_++]=C.duration&255,g[_++]=(C.size&4278190080)>>>24,g[_++]=(C.size&16711680)>>>16,g[_++]=(C.size&65280)>>>8,g[_++]=C.size&255;return l(z.trun,g)},le=function(d,p){return d.type==="audio"?o(d,p):c(d,p)}}();var cp={ftyp:m,mdat:v,moof:A,moov:y,initSegment:function(o){var c=m(),h=y(o),d;return d=new Uint8Array(c.byteLength+h.byteLength),d.set(c),d.set(h,c.byteLength),d}},dp=function(o){var c,h,d=[],p=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,d.byteLength=0,c=0;c<o.length;c++)h=o[c],h.nalUnitType==="access_unit_delimiter_rbsp"?(d.length&&(d.duration=h.dts-d.dts,p.byteLength+=d.byteLength,p.nalCount+=d.length,p.duration+=d.duration,p.push(d)),d=[h],d.byteLength=h.data.byteLength,d.pts=h.pts,d.dts=h.dts):(h.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(d.keyFrame=!0),d.duration=h.dts-d.dts,d.byteLength+=h.data.byteLength,d.push(h));return p.length&&(!d.duration||d.duration<=0)&&(d.duration=p[p.length-1].duration),p.byteLength+=d.byteLength,p.nalCount+=d.length,p.duration+=d.duration,p.push(d),p},hp=function(o){var c,h,d=[],p=[];for(d.byteLength=0,d.nalCount=0,d.duration=0,d.pts=o[0].pts,d.dts=o[0].dts,p.byteLength=0,p.nalCount=0,p.duration=0,p.pts=o[0].pts,p.dts=o[0].dts,c=0;c<o.length;c++)h=o[c],h.keyFrame?(d.length&&(p.push(d),p.byteLength+=d.byteLength,p.nalCount+=d.nalCount,p.duration+=d.duration),d=[h],d.nalCount=h.length,d.byteLength=h.byteLength,d.pts=h.pts,d.dts=h.dts,d.duration=h.duration):(d.duration+=h.duration,d.nalCount+=h.length,d.byteLength+=h.byteLength,d.push(h));return p.length&&d.duration<=0&&(d.duration=p[p.length-1].duration),p.byteLength+=d.byteLength,p.nalCount+=d.nalCount,p.duration+=d.duration,p.push(d),p},fp=function(o){var c;return!o[0][0].keyFrame&&o.length>1&&(c=o.shift(),o.byteLength-=c.byteLength,o.nalCount-=c.nalCount,o[0][0].dts=c.dts,o[0][0].pts=c.pts,o[0][0].duration+=c.duration),o},pp=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},_l=function(o,c){var h=pp();return h.dataOffset=c,h.compositionTimeOffset=o.pts-o.dts,h.duration=o.duration,h.size=4*o.length,h.size+=o.byteLength,o.keyFrame&&(h.flags.dependsOn=2,h.flags.isNonSyncSample=0),h},mp=function(o,c){var h,d,p,g,_,b=c||0,x=[];for(h=0;h<o.length;h++)for(g=o[h],d=0;d<g.length;d++)_=g[d],p=_l(_,b),b+=p.size,x.push(p);return x},gp=function(o){var c,h,d,p,g,_,b=0,x=o.byteLength,C=o.nalCount,D=x+4*C,M=new Uint8Array(D),H=new DataView(M.buffer);for(c=0;c<o.length;c++)for(p=o[c],h=0;h<p.length;h++)for(g=p[h],d=0;d<g.length;d++)_=g[d],H.setUint32(b,_.data.byteLength),b+=4,M.set(_.data,b),b+=_.data.byteLength;return M},vp=function(o,c){var h,d=c||0,p=[];return h=_l(o,d),p.push(h),p},yp=function(o){var c,h,d=0,p=o.byteLength,g=o.length,_=p+4*g,b=new Uint8Array(_),x=new DataView(b.buffer);for(c=0;c<o.length;c++)h=o[c],x.setUint32(d,h.data.byteLength),d+=4,b.set(h.data,d),d+=h.data.byteLength;return b},_p={groupNalsIntoFrames:dp,groupFramesIntoGops:hp,extendFirstKeyFrame:fp,generateSampleTable:mp,concatenateNalData:gp,generateSampleTableForFrame:vp,concatenateNalDataForFrame:yp},Ut=[33,16,5,32,164,27],Qn=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],se=function(o){for(var c=[];o--;)c.push(0);return c},bp=function(o){return Object.keys(o).reduce(function(c,h){return c[h]=new Uint8Array(o[h].reduce(function(d,p){return d.concat(p)},[])),c},{})},Jn,Tp=function(){if(!Jn){var o={96e3:[Ut,[227,64],se(154),[56]],88200:[Ut,[231],se(170),[56]],64e3:[Ut,[248,192],se(240),[56]],48e3:[Ut,[255,192],se(268),[55,148,128],se(54),[112]],44100:[Ut,[255,192],se(268),[55,163,128],se(84),[112]],32e3:[Ut,[255,192],se(268),[55,234],se(226),[112]],24e3:[Ut,[255,192],se(268),[55,255,128],se(268),[111,112],se(126),[224]],16e3:[Ut,[255,192],se(268),[55,255,128],se(268),[111,255],se(269),[223,108],se(195),[1,192]],12e3:[Qn,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,253,128],se(259),[56]],11025:[Qn,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,255,192],se(268),[55,175,128],se(108),[112]],8e3:[Qn,se(268),[3,121,16],se(47),[7]]};Jn=bp(o)}return Jn},Zn=9e4,ea,ta,mr,ia,bl,Tl,xl;ea=function(o){return o*Zn},ta=function(o,c){return o*c},mr=function(o){return o/Zn},ia=function(o,c){return o/c},bl=function(o,c){return ea(ia(o,c))},Tl=function(o,c){return ta(mr(o),c)},xl=function(o,c,h){return mr(h?o:o-c)};var de={ONE_SECOND_IN_TS:Zn,secondsToVideoTs:ea,secondsToAudioTs:ta,videoTsToSeconds:mr,audioTsToSeconds:ia,audioTsToVideoTs:bl,videoTsToAudioTs:Tl,metadataTsToSeconds:xl},xp=Tp,gr=de,Sp=function(o){var c,h,d=0;for(c=0;c<o.length;c++)h=o[c],d+=h.data.byteLength;return d},Cp=function(o,c,h,d){var p,g=0,_=0,b=0,x=0,C,D,M;if(c.length&&(p=gr.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),g=Math.ceil(gr.ONE_SECOND_IN_TS/(o.samplerate/1024)),h&&d&&(_=p-Math.max(h,d),b=Math.floor(_/g),x=b*g),!(b<1||x>gr.ONE_SECOND_IN_TS/2))){for(C=xp()[o.samplerate],C||(C=c[0].data),D=0;D<b;D++)M=c[0],c.splice(0,0,{data:C,dts:M.dts-g,pts:M.pts-g});return o.baseMediaDecodeTime-=Math.floor(gr.videoTsToAudioTs(x,o.samplerate)),x}},Ep=function(o,c,h){return c.minSegmentDts>=h?o:(c.minSegmentDts=1/0,o.filter(function(d){return d.dts>=h?(c.minSegmentDts=Math.min(c.minSegmentDts,d.dts),c.minSegmentPts=c.minSegmentDts,!0):!1}))},Ap=function(o){var c,h,d=[];for(c=0;c<o.length;c++)h=o[c],d.push({size:h.data.byteLength,duration:1024});return d},wp=function(o){var c,h,d=0,p=new Uint8Array(Sp(o));for(c=0;c<o.length;c++)h=o[c],p.set(h.data,d),d+=h.data.byteLength;return p},Dp={prefixWithSilence:Cp,trimAdtsFramesByEarliestDts:Ep,generateSampleTable:Ap,concatenateFrameData:wp},kp=de.ONE_SECOND_IN_TS,jp=function(o,c){typeof c.pts=="number"&&(o.timelineStartInfo.pts===void 0&&(o.timelineStartInfo.pts=c.pts),o.minSegmentPts===void 0?o.minSegmentPts=c.pts:o.minSegmentPts=Math.min(o.minSegmentPts,c.pts),o.maxSegmentPts===void 0?o.maxSegmentPts=c.pts:o.maxSegmentPts=Math.max(o.maxSegmentPts,c.pts)),typeof c.dts=="number"&&(o.timelineStartInfo.dts===void 0&&(o.timelineStartInfo.dts=c.dts),o.minSegmentDts===void 0?o.minSegmentDts=c.dts:o.minSegmentDts=Math.min(o.minSegmentDts,c.dts),o.maxSegmentDts===void 0?o.maxSegmentDts=c.dts:o.maxSegmentDts=Math.max(o.maxSegmentDts,c.dts))},Ip=function(o){delete o.minSegmentDts,delete o.maxSegmentDts,delete o.minSegmentPts,delete o.maxSegmentPts},Pp=function(o,c){var h,d,p=o.minSegmentDts;return c||(p-=o.timelineStartInfo.dts),h=o.timelineStartInfo.baseMediaDecodeTime,h+=p,h=Math.max(0,h),o.type==="audio"&&(d=o.samplerate/kp,h*=d,h=Math.floor(h)),h},Lp={clearDtsInfo:Ip,calculateTrackBaseMediaDecodeTime:Pp,collectDtsInfo:jp},Sl=4,Op=128,Mp=function(o){for(var c=0,h={payloadType:-1,payloadSize:0},d=0,p=0;c<o.byteLength&&o[c]!==Op;){for(;o[c]===255;)d+=255,c++;for(d+=o[c++];o[c]===255;)p+=255,c++;if(p+=o[c++],!h.payload&&d===Sl){var g=String.fromCharCode(o[c+3],o[c+4],o[c+5],o[c+6]);if(g==="GA94"){h.payloadType=d,h.payloadSize=p,h.payload=o.subarray(c,c+p);break}else h.payload=void 0}c+=p,d=0,p=0}return h},Rp=function(o){return o.payload[0]!==181||(o.payload[1]<<8|o.payload[2])!==49||String.fromCharCode(o.payload[3],o.payload[4],o.payload[5],o.payload[6])!=="GA94"||o.payload[7]!==3?null:o.payload.subarray(8,o.payload.length-1)},Np=function(o,c){var h=[],d,p,g,_;if(!(c[0]&64))return h;for(p=c[0]&31,d=0;d<p;d++)g=d*3,_={type:c[g+2]&3,pts:o},c[g+2]&4&&(_.ccData=c[g+3]<<8|c[g+4],h.push(_));return h},Bp=function(o){for(var c=o.byteLength,h=[],d=1,p,g;d<c-2;)o[d]===0&&o[d+1]===0&&o[d+2]===3?(h.push(d+2),d+=2):d++;if(h.length===0)return o;p=c-h.length,g=new Uint8Array(p);var _=0;for(d=0;d<p;_++,d++)_===h[0]&&(_++,h.shift()),g[d]=o[_];return g},Cl={parseSei:Mp,parseUserData:Rp,parseCaptionPackets:Np,discardEmulationPreventionBytes:Bp,USER_DATA_REGISTERED_ITU_T_T35:Sl},sa=t,vr=Cl,He=function(o){o=o||{},He.prototype.init.call(this),this.parse708captions_=typeof o.parse708captions=="boolean"?o.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new fe(0,0),new fe(0,1),new fe(1,0),new fe(1,1)],this.parse708captions_&&(this.cc708Stream_=new ue({captionServices:o.captionServices})),this.reset(),this.ccStreams_.forEach(function(c){c.on("data",this.trigger.bind(this,"data")),c.on("partialdone",this.trigger.bind(this,"partialdone")),c.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};He.prototype=new sa,He.prototype.push=function(o){var c,h,d;if(o.nalUnitType==="sei_rbsp"&&(c=vr.parseSei(o.escapedRBSP),!!c.payload&&c.payloadType===vr.USER_DATA_REGISTERED_ITU_T_T35&&(h=vr.parseUserData(c),!!h))){if(o.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(o.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}d=vr.parseCaptionPackets(o.pts,h),this.captionPackets_=this.captionPackets_.concat(d),this.latestDts_!==o.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=o.dts}},He.prototype.flushCCStreams=function(o){this.ccStreams_.forEach(function(c){return o==="flush"?c.flush():c.partialFlush()},this)},He.prototype.flushStream=function(o){if(!this.captionPackets_.length){this.flushCCStreams(o);return}this.captionPackets_.forEach(function(c,h){c.presortIndex=h}),this.captionPackets_.sort(function(c,h){return c.pts===h.pts?c.presortIndex-h.presortIndex:c.pts-h.pts}),this.captionPackets_.forEach(function(c){c.type<2?this.dispatchCea608Packet(c):this.dispatchCea708Packet(c)},this),this.captionPackets_.length=0,this.flushCCStreams(o)},He.prototype.flush=function(){return this.flushStream("flush")},He.prototype.partialFlush=function(){return this.flushStream("partialFlush")},He.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(o){o.reset()})},He.prototype.dispatchCea608Packet=function(o){this.setsTextOrXDSActive(o)?this.activeCea608Channel_[o.type]=null:this.setsChannel1Active(o)?this.activeCea608Channel_[o.type]=0:this.setsChannel2Active(o)&&(this.activeCea608Channel_[o.type]=1),this.activeCea608Channel_[o.type]!==null&&this.ccStreams_[(o.type<<1)+this.activeCea608Channel_[o.type]].push(o)},He.prototype.setsChannel1Active=function(o){return(o.ccData&30720)===4096},He.prototype.setsChannel2Active=function(o){return(o.ccData&30720)===6144},He.prototype.setsTextOrXDSActive=function(o){return(o.ccData&28928)===256||(o.ccData&30974)===4138||(o.ccData&30974)===6186},He.prototype.dispatchCea708Packet=function(o){this.parse708captions_&&this.cc708Stream_.push(o)};var Fp={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},Up=function(o){var c=Fp[o]||o;return o&4096&&o===c?"":String.fromCharCode(c)},yr=function(o){return 32<=o&&o<=127||160<=o&&o<=255},kt=function(o){this.windowNum=o,this.reset()};kt.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},kt.prototype.getText=function(){return this.rows.join(`
202
- `)},kt.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},kt.prototype.newLine=function(o){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(o),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},kt.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},kt.prototype.addText=function(o){this.rows[this.rowIdx]+=o},kt.prototype.backspace=function(){if(!this.isEmpty()){var o=this.rows[this.rowIdx];this.rows[this.rowIdx]=o.substr(0,o.length-1)}};var _r=function(o,c,h){this.serviceNum=o,this.text="",this.currentWindow=new kt(-1),this.windows=[],this.stream=h,typeof c=="string"&&this.createTextDecoder(c)};_r.prototype.init=function(o,c){this.startPts=o;for(var h=0;h<8;h++)this.windows[h]=new kt(h),typeof c=="function"&&(this.windows[h].beforeRowOverflow=c)},_r.prototype.setCurrentWindow=function(o){this.currentWindow=this.windows[o]},_r.prototype.createTextDecoder=function(o){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(o)}catch(c){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+o+" encoding. "+c})}};var ue=function(o){o=o||{},ue.prototype.init.call(this);var c=this,h=o.captionServices||{},d={},p;Object.keys(h).forEach(g=>{p=h[g],/^SERVICE/.test(g)&&(d[g]=p.encoding)}),this.serviceEncodings=d,this.current708Packet=null,this.services={},this.push=function(g){g.type===3?(c.new708Packet(),c.add708Bytes(g)):(c.current708Packet===null&&c.new708Packet(),c.add708Bytes(g))}};ue.prototype=new sa,ue.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ue.prototype.add708Bytes=function(o){var c=o.ccData,h=c>>>8,d=c&255;this.current708Packet.ptsVals.push(o.pts),this.current708Packet.data.push(h),this.current708Packet.data.push(d)},ue.prototype.push708Packet=function(){var o=this.current708Packet,c=o.data,h=null,d=null,p=0,g=c[p++];for(o.seq=g>>6,o.sizeCode=g&63;p<c.length;p++)g=c[p++],h=g>>5,d=g&31,h===7&&d>0&&(g=c[p++],h=g),this.pushServiceBlock(h,p,d),d>0&&(p+=d-1)},ue.prototype.pushServiceBlock=function(o,c,h){var d,p=c,g=this.current708Packet.data,_=this.services[o];for(_||(_=this.initService(o,p));p<c+h&&p<g.length;p++)d=g[p],yr(d)?p=this.handleText(p,_):d===24?p=this.multiByteCharacter(p,_):d===16?p=this.extendedCommands(p,_):128<=d&&d<=135?p=this.setCurrentWindow(p,_):152<=d&&d<=159?p=this.defineWindow(p,_):d===136?p=this.clearWindows(p,_):d===140?p=this.deleteWindows(p,_):d===137?p=this.displayWindows(p,_):d===138?p=this.hideWindows(p,_):d===139?p=this.toggleWindows(p,_):d===151?p=this.setWindowAttributes(p,_):d===144?p=this.setPenAttributes(p,_):d===145?p=this.setPenColor(p,_):d===146?p=this.setPenLocation(p,_):d===143?_=this.reset(p,_):d===8?_.currentWindow.backspace():d===12?_.currentWindow.clearText():d===13?_.currentWindow.pendingNewLine=!0:d===14?_.currentWindow.clearText():d===141&&p++},ue.prototype.extendedCommands=function(o,c){var h=this.current708Packet.data,d=h[++o];return yr(d)&&(o=this.handleText(o,c,{isExtended:!0})),o},ue.prototype.getPts=function(o){return this.current708Packet.ptsVals[Math.floor(o/2)]},ue.prototype.initService=function(o,c){var d="SERVICE"+o,h=this,d,p;return d in this.serviceEncodings&&(p=this.serviceEncodings[d]),this.services[o]=new _r(o,p,h),this.services[o].init(this.getPts(c),function(g){h.flushDisplayed(g,h.services[o])}),this.services[o]},ue.prototype.handleText=function(o,c,h){var d=h&&h.isExtended,p=h&&h.isMultiByte,g=this.current708Packet.data,_=d?4096:0,b=g[o],x=g[o+1],C=c.currentWindow,D,M;function H(N){return N.map($=>("0"+($&255).toString(16)).slice(-2)).join("")}if(p?(M=[b,x],o++):M=[b],c.textDecoder_&&!d)D=c.textDecoder_.decode(new Uint8Array(M));else if(p){const N=H(M);D=String.fromCharCode(parseInt(N,16))}else D=Up(_|b);return C.pendingNewLine&&!C.isEmpty()&&C.newLine(this.getPts(o)),C.pendingNewLine=!1,C.addText(D),o},ue.prototype.multiByteCharacter=function(o,c){var h=this.current708Packet.data,d=h[o+1],p=h[o+2];return yr(d)&&yr(p)&&(o=this.handleText(++o,c,{isMultiByte:!0})),o},ue.prototype.setCurrentWindow=function(o,c){var h=this.current708Packet.data,d=h[o],p=d&7;return c.setCurrentWindow(p),o},ue.prototype.defineWindow=function(o,c){var h=this.current708Packet.data,d=h[o],p=d&7;c.setCurrentWindow(p);var g=c.currentWindow;return d=h[++o],g.visible=(d&32)>>5,g.rowLock=(d&16)>>4,g.columnLock=(d&8)>>3,g.priority=d&7,d=h[++o],g.relativePositioning=(d&128)>>7,g.anchorVertical=d&127,d=h[++o],g.anchorHorizontal=d,d=h[++o],g.anchorPoint=(d&240)>>4,g.rowCount=d&15,d=h[++o],g.columnCount=d&63,d=h[++o],g.windowStyle=(d&56)>>3,g.penStyle=d&7,g.virtualRowCount=g.rowCount+1,o},ue.prototype.setWindowAttributes=function(o,c){var h=this.current708Packet.data,d=h[o],p=c.currentWindow.winAttr;return d=h[++o],p.fillOpacity=(d&192)>>6,p.fillRed=(d&48)>>4,p.fillGreen=(d&12)>>2,p.fillBlue=d&3,d=h[++o],p.borderType=(d&192)>>6,p.borderRed=(d&48)>>4,p.borderGreen=(d&12)>>2,p.borderBlue=d&3,d=h[++o],p.borderType+=(d&128)>>5,p.wordWrap=(d&64)>>6,p.printDirection=(d&48)>>4,p.scrollDirection=(d&12)>>2,p.justify=d&3,d=h[++o],p.effectSpeed=(d&240)>>4,p.effectDirection=(d&12)>>2,p.displayEffect=d&3,o},ue.prototype.flushDisplayed=function(o,c){for(var h=[],d=0;d<8;d++)c.windows[d].visible&&!c.windows[d].isEmpty()&&h.push(c.windows[d].getText());c.endPts=o,c.text=h.join(`
201
+ `+i},Of=function(i){return i.toString().replace(/^function.+?{/,"").slice(0,-1)},Zy=Lf(Of(function(){var i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=function(){this.init=function(){var o={};this.on=function(c,h){o[c]||(o[c]=[]),o[c]=o[c].concat(h)},this.off=function(c,h){var d;return o[c]?(d=o[c].indexOf(h),o[c]=o[c].slice(),o[c].splice(d,1),d>-1):!1},this.trigger=function(c){var h,d,p,g;if(h=o[c],!!h)if(arguments.length===2)for(p=h.length,d=0;d<p;++d)h[d].call(this,arguments[1]);else{for(g=[],d=arguments.length,d=1;d<arguments.length;++d)g.push(arguments[d]);for(p=h.length,d=0;d<p;++d)h[d].apply(this,g)}},this.dispose=function(){o={}}}};e.prototype.pipe=function(o){return this.on("data",function(c){o.push(c)}),this.on("done",function(c){o.flush(c)}),this.on("partialdone",function(c){o.partialFlush(c)}),this.on("endedtimeline",function(c){o.endTimeline(c)}),this.on("reset",function(c){o.reset(c)}),o},e.prototype.push=function(o){this.trigger("data",o)},e.prototype.flush=function(o){this.trigger("done",o)},e.prototype.partialFlush=function(o){this.trigger("partialdone",o)},e.prototype.endTimeline=function(o){this.trigger("endedtimeline",o)},e.prototype.reset=function(o){this.trigger("reset",o)};var t=e,s=Math.pow(2,32),r=function(o){var c=new DataView(o.buffer,o.byteOffset,o.byteLength),h;return c.getBigUint64?(h=c.getBigUint64(0),h<Number.MAX_SAFE_INTEGER?Number(h):h):c.getUint32(0)*s+c.getUint32(4)},n={getUint64:r,MAX_UINT32:s},a=n.MAX_UINT32,l,u,f,m,v,T,E,A,y,k,w,I,j,L,O,F,B,U,X,ae,J,le,z,Z,Re,ee,be,Dt,ti,ii,si,ri,fr,pl,ml,gl;(function(){var o;if(z={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},!(typeof Uint8Array>"u")){for(o in z)z.hasOwnProperty(o)&&(z[o]=[o.charCodeAt(0),o.charCodeAt(1),o.charCodeAt(2),o.charCodeAt(3)]);Z=new Uint8Array([105,115,111,109]),ee=new Uint8Array([97,118,99,49]),Re=new Uint8Array([0,0,0,1]),be=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),Dt=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),ti={video:be,audio:Dt},ri=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),si=new Uint8Array([0,0,0,0,0,0,0,0]),fr=new Uint8Array([0,0,0,0,0,0,0,0]),pl=fr,ml=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),gl=fr,ii=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),l=function(o){var c=[],h=0,d,p,g;for(d=1;d<arguments.length;d++)c.push(arguments[d]);for(d=c.length;d--;)h+=c[d].byteLength;for(p=new Uint8Array(h+8),g=new DataView(p.buffer,p.byteOffset,p.byteLength),g.setUint32(0,p.byteLength),p.set(o,4),d=0,h=8;d<c.length;d++)p.set(c[d],h),h+=c[d].byteLength;return p},u=function(){return l(z.dinf,l(z.dref,ri))},f=function(o){return l(z.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,o.audioobjecttype<<3|o.samplingfrequencyindex>>>1,o.samplingfrequencyindex<<7|o.channelcount<<3,6,1,2]))},m=function(){return l(z.ftyp,Z,Re,Z,ee)},F=function(o){return l(z.hdlr,ti[o])},v=function(o){return l(z.mdat,o)},O=function(o){var c=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,o.duration>>>24&255,o.duration>>>16&255,o.duration>>>8&255,o.duration&255,85,196,0,0]);return o.samplerate&&(c[12]=o.samplerate>>>24&255,c[13]=o.samplerate>>>16&255,c[14]=o.samplerate>>>8&255,c[15]=o.samplerate&255),l(z.mdhd,c)},L=function(o){return l(z.mdia,O(o),F(o.type),E(o))},T=function(o){return l(z.mfhd,new Uint8Array([0,0,0,0,(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&255]))},E=function(o){return l(z.minf,o.type==="video"?l(z.vmhd,ii):l(z.smhd,si),u(),U(o))},A=function(o,c){for(var h=[],d=c.length;d--;)h[d]=ae(c[d]);return l.apply(null,[z.moof,T(o)].concat(h))},y=function(o){for(var c=o.length,h=[];c--;)h[c]=I(o[c]);return l.apply(null,[z.moov,w(4294967295)].concat(h).concat(k(o)))},k=function(o){for(var c=o.length,h=[];c--;)h[c]=J(o[c]);return l.apply(null,[z.mvex].concat(h))},w=function(o){var c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return l(z.mvhd,c)},B=function(o){var c=o.samples||[],h=new Uint8Array(4+c.length),d,p;for(p=0;p<c.length;p++)d=c[p].flags,h[p+4]=d.dependsOn<<4|d.isDependedOn<<2|d.hasRedundancy;return l(z.sdtp,h)},U=function(o){return l(z.stbl,X(o),l(z.stts,gl),l(z.stsc,pl),l(z.stsz,ml),l(z.stco,fr))},function(){var o,c;X=function(h){return l(z.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),h.type==="video"?o(h):c(h))},o=function(h){var d=h.sps||[],p=h.pps||[],g=[],_=[],b,x;for(b=0;b<d.length;b++)g.push((d[b].byteLength&65280)>>>8),g.push(d[b].byteLength&255),g=g.concat(Array.prototype.slice.call(d[b]));for(b=0;b<p.length;b++)_.push((p[b].byteLength&65280)>>>8),_.push(p[b].byteLength&255),_=_.concat(Array.prototype.slice.call(p[b]));if(x=[z.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(h.width&65280)>>8,h.width&255,(h.height&65280)>>8,h.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),l(z.avcC,new Uint8Array([1,h.profileIdc,h.profileCompatibility,h.levelIdc,255].concat([d.length],g,[p.length],_))),l(z.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],h.sarRatio){var C=h.sarRatio[0],D=h.sarRatio[1];x.push(l(z.pasp,new Uint8Array([(C&4278190080)>>24,(C&16711680)>>16,(C&65280)>>8,C&255,(D&4278190080)>>24,(D&16711680)>>16,(D&65280)>>8,D&255])))}return l.apply(null,x)},c=function(h){return l(z.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(h.channelcount&65280)>>8,h.channelcount&255,(h.samplesize&65280)>>8,h.samplesize&255,0,0,0,0,(h.samplerate&65280)>>8,h.samplerate&255,0,0]),f(h))}}(),j=function(o){var c=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,0,(o.duration&4278190080)>>24,(o.duration&16711680)>>16,(o.duration&65280)>>8,o.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(o.width&65280)>>8,o.width&255,0,0,(o.height&65280)>>8,o.height&255,0,0]);return l(z.tkhd,c)},ae=function(o){var c,h,d,p,g,_,b;return c=l(z.tfhd,new Uint8Array([0,0,0,58,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),_=Math.floor(o.baseMediaDecodeTime/a),b=Math.floor(o.baseMediaDecodeTime%a),h=l(z.tfdt,new Uint8Array([1,0,0,0,_>>>24&255,_>>>16&255,_>>>8&255,_&255,b>>>24&255,b>>>16&255,b>>>8&255,b&255])),g=92,o.type==="audio"?(d=le(o,g),l(z.traf,c,h,d)):(p=B(o),d=le(o,p.length+g),l(z.traf,c,h,d,p))},I=function(o){return o.duration=o.duration||4294967295,l(z.trak,j(o),L(o))},J=function(o){var c=new Uint8Array([0,0,0,0,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return o.type!=="video"&&(c[c.length-1]=0),l(z.trex,c)},function(){var o,c,h;h=function(d,p){var g=0,_=0,b=0,x=0;return d.length&&(d[0].duration!==void 0&&(g=1),d[0].size!==void 0&&(_=2),d[0].flags!==void 0&&(b=4),d[0].compositionTimeOffset!==void 0&&(x=8)),[0,0,g|_|b|x,1,(d.length&4278190080)>>>24,(d.length&16711680)>>>16,(d.length&65280)>>>8,d.length&255,(p&4278190080)>>>24,(p&16711680)>>>16,(p&65280)>>>8,p&255]},c=function(d,p){var g,_,b,x,C,D;for(x=d.samples||[],p+=20+16*x.length,b=h(x,p),_=new Uint8Array(b.length+x.length*16),_.set(b),g=b.length,D=0;D<x.length;D++)C=x[D],_[g++]=(C.duration&4278190080)>>>24,_[g++]=(C.duration&16711680)>>>16,_[g++]=(C.duration&65280)>>>8,_[g++]=C.duration&255,_[g++]=(C.size&4278190080)>>>24,_[g++]=(C.size&16711680)>>>16,_[g++]=(C.size&65280)>>>8,_[g++]=C.size&255,_[g++]=C.flags.isLeading<<2|C.flags.dependsOn,_[g++]=C.flags.isDependedOn<<6|C.flags.hasRedundancy<<4|C.flags.paddingValue<<1|C.flags.isNonSyncSample,_[g++]=C.flags.degradationPriority&61440,_[g++]=C.flags.degradationPriority&15,_[g++]=(C.compositionTimeOffset&4278190080)>>>24,_[g++]=(C.compositionTimeOffset&16711680)>>>16,_[g++]=(C.compositionTimeOffset&65280)>>>8,_[g++]=C.compositionTimeOffset&255;return l(z.trun,_)},o=function(d,p){var g,_,b,x,C,D;for(x=d.samples||[],p+=20+8*x.length,b=h(x,p),g=new Uint8Array(b.length+x.length*8),g.set(b),_=b.length,D=0;D<x.length;D++)C=x[D],g[_++]=(C.duration&4278190080)>>>24,g[_++]=(C.duration&16711680)>>>16,g[_++]=(C.duration&65280)>>>8,g[_++]=C.duration&255,g[_++]=(C.size&4278190080)>>>24,g[_++]=(C.size&16711680)>>>16,g[_++]=(C.size&65280)>>>8,g[_++]=C.size&255;return l(z.trun,g)},le=function(d,p){return d.type==="audio"?o(d,p):c(d,p)}}();var op={ftyp:m,mdat:v,moof:A,moov:y,initSegment:function(o){var c=m(),h=y(o),d;return d=new Uint8Array(c.byteLength+h.byteLength),d.set(c),d.set(h,c.byteLength),d}},lp=function(o){var c,h,d=[],p=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,d.byteLength=0,c=0;c<o.length;c++)h=o[c],h.nalUnitType==="access_unit_delimiter_rbsp"?(d.length&&(d.duration=h.dts-d.dts,p.byteLength+=d.byteLength,p.nalCount+=d.length,p.duration+=d.duration,p.push(d)),d=[h],d.byteLength=h.data.byteLength,d.pts=h.pts,d.dts=h.dts):(h.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(d.keyFrame=!0),d.duration=h.dts-d.dts,d.byteLength+=h.data.byteLength,d.push(h));return p.length&&(!d.duration||d.duration<=0)&&(d.duration=p[p.length-1].duration),p.byteLength+=d.byteLength,p.nalCount+=d.length,p.duration+=d.duration,p.push(d),p},up=function(o){var c,h,d=[],p=[];for(d.byteLength=0,d.nalCount=0,d.duration=0,d.pts=o[0].pts,d.dts=o[0].dts,p.byteLength=0,p.nalCount=0,p.duration=0,p.pts=o[0].pts,p.dts=o[0].dts,c=0;c<o.length;c++)h=o[c],h.keyFrame?(d.length&&(p.push(d),p.byteLength+=d.byteLength,p.nalCount+=d.nalCount,p.duration+=d.duration),d=[h],d.nalCount=h.length,d.byteLength=h.byteLength,d.pts=h.pts,d.dts=h.dts,d.duration=h.duration):(d.duration+=h.duration,d.nalCount+=h.length,d.byteLength+=h.byteLength,d.push(h));return p.length&&d.duration<=0&&(d.duration=p[p.length-1].duration),p.byteLength+=d.byteLength,p.nalCount+=d.nalCount,p.duration+=d.duration,p.push(d),p},cp=function(o){var c;return!o[0][0].keyFrame&&o.length>1&&(c=o.shift(),o.byteLength-=c.byteLength,o.nalCount-=c.nalCount,o[0][0].dts=c.dts,o[0][0].pts=c.pts,o[0][0].duration+=c.duration),o},dp=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},vl=function(o,c){var h=dp();return h.dataOffset=c,h.compositionTimeOffset=o.pts-o.dts,h.duration=o.duration,h.size=4*o.length,h.size+=o.byteLength,o.keyFrame&&(h.flags.dependsOn=2,h.flags.isNonSyncSample=0),h},hp=function(o,c){var h,d,p,g,_,b=c||0,x=[];for(h=0;h<o.length;h++)for(g=o[h],d=0;d<g.length;d++)_=g[d],p=vl(_,b),b+=p.size,x.push(p);return x},fp=function(o){var c,h,d,p,g,_,b=0,x=o.byteLength,C=o.nalCount,D=x+4*C,M=new Uint8Array(D),H=new DataView(M.buffer);for(c=0;c<o.length;c++)for(p=o[c],h=0;h<p.length;h++)for(g=p[h],d=0;d<g.length;d++)_=g[d],H.setUint32(b,_.data.byteLength),b+=4,M.set(_.data,b),b+=_.data.byteLength;return M},pp=function(o,c){var h,d=c||0,p=[];return h=vl(o,d),p.push(h),p},mp=function(o){var c,h,d=0,p=o.byteLength,g=o.length,_=p+4*g,b=new Uint8Array(_),x=new DataView(b.buffer);for(c=0;c<o.length;c++)h=o[c],x.setUint32(d,h.data.byteLength),d+=4,b.set(h.data,d),d+=h.data.byteLength;return b},gp={groupNalsIntoFrames:lp,groupFramesIntoGops:up,extendFirstKeyFrame:cp,generateSampleTable:hp,concatenateNalData:fp,generateSampleTableForFrame:pp,concatenateNalDataForFrame:mp},Ut=[33,16,5,32,164,27],Yn=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],se=function(o){for(var c=[];o--;)c.push(0);return c},vp=function(o){return Object.keys(o).reduce(function(c,h){return c[h]=new Uint8Array(o[h].reduce(function(d,p){return d.concat(p)},[])),c},{})},Kn,yp=function(){if(!Kn){var o={96e3:[Ut,[227,64],se(154),[56]],88200:[Ut,[231],se(170),[56]],64e3:[Ut,[248,192],se(240),[56]],48e3:[Ut,[255,192],se(268),[55,148,128],se(54),[112]],44100:[Ut,[255,192],se(268),[55,163,128],se(84),[112]],32e3:[Ut,[255,192],se(268),[55,234],se(226),[112]],24e3:[Ut,[255,192],se(268),[55,255,128],se(268),[111,112],se(126),[224]],16e3:[Ut,[255,192],se(268),[55,255,128],se(268),[111,255],se(269),[223,108],se(195),[1,192]],12e3:[Yn,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,253,128],se(259),[56]],11025:[Yn,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,255,192],se(268),[55,175,128],se(108),[112]],8e3:[Yn,se(268),[3,121,16],se(47),[7]]};Kn=vp(o)}return Kn},Qn=9e4,Jn,Zn,pr,ea,yl,_l,bl;Jn=function(o){return o*Qn},Zn=function(o,c){return o*c},pr=function(o){return o/Qn},ea=function(o,c){return o/c},yl=function(o,c){return Jn(ea(o,c))},_l=function(o,c){return Zn(pr(o),c)},bl=function(o,c,h){return pr(h?o:o-c)};var de={ONE_SECOND_IN_TS:Qn,secondsToVideoTs:Jn,secondsToAudioTs:Zn,videoTsToSeconds:pr,audioTsToSeconds:ea,audioTsToVideoTs:yl,videoTsToAudioTs:_l,metadataTsToSeconds:bl},_p=yp,mr=de,bp=function(o){var c,h,d=0;for(c=0;c<o.length;c++)h=o[c],d+=h.data.byteLength;return d},Tp=function(o,c,h,d){var p,g=0,_=0,b=0,x=0,C,D,M;if(c.length&&(p=mr.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),g=Math.ceil(mr.ONE_SECOND_IN_TS/(o.samplerate/1024)),h&&d&&(_=p-Math.max(h,d),b=Math.floor(_/g),x=b*g),!(b<1||x>mr.ONE_SECOND_IN_TS/2))){for(C=_p()[o.samplerate],C||(C=c[0].data),D=0;D<b;D++)M=c[0],c.splice(0,0,{data:C,dts:M.dts-g,pts:M.pts-g});return o.baseMediaDecodeTime-=Math.floor(mr.videoTsToAudioTs(x,o.samplerate)),x}},xp=function(o,c,h){return c.minSegmentDts>=h?o:(c.minSegmentDts=1/0,o.filter(function(d){return d.dts>=h?(c.minSegmentDts=Math.min(c.minSegmentDts,d.dts),c.minSegmentPts=c.minSegmentDts,!0):!1}))},Sp=function(o){var c,h,d=[];for(c=0;c<o.length;c++)h=o[c],d.push({size:h.data.byteLength,duration:1024});return d},Cp=function(o){var c,h,d=0,p=new Uint8Array(bp(o));for(c=0;c<o.length;c++)h=o[c],p.set(h.data,d),d+=h.data.byteLength;return p},Ep={prefixWithSilence:Tp,trimAdtsFramesByEarliestDts:xp,generateSampleTable:Sp,concatenateFrameData:Cp},Ap=de.ONE_SECOND_IN_TS,wp=function(o,c){typeof c.pts=="number"&&(o.timelineStartInfo.pts===void 0&&(o.timelineStartInfo.pts=c.pts),o.minSegmentPts===void 0?o.minSegmentPts=c.pts:o.minSegmentPts=Math.min(o.minSegmentPts,c.pts),o.maxSegmentPts===void 0?o.maxSegmentPts=c.pts:o.maxSegmentPts=Math.max(o.maxSegmentPts,c.pts)),typeof c.dts=="number"&&(o.timelineStartInfo.dts===void 0&&(o.timelineStartInfo.dts=c.dts),o.minSegmentDts===void 0?o.minSegmentDts=c.dts:o.minSegmentDts=Math.min(o.minSegmentDts,c.dts),o.maxSegmentDts===void 0?o.maxSegmentDts=c.dts:o.maxSegmentDts=Math.max(o.maxSegmentDts,c.dts))},Dp=function(o){delete o.minSegmentDts,delete o.maxSegmentDts,delete o.minSegmentPts,delete o.maxSegmentPts},kp=function(o,c){var h,d,p=o.minSegmentDts;return c||(p-=o.timelineStartInfo.dts),h=o.timelineStartInfo.baseMediaDecodeTime,h+=p,h=Math.max(0,h),o.type==="audio"&&(d=o.samplerate/Ap,h*=d,h=Math.floor(h)),h},jp={clearDtsInfo:Dp,calculateTrackBaseMediaDecodeTime:kp,collectDtsInfo:wp},Tl=4,Ip=128,Pp=function(o){for(var c=0,h={payloadType:-1,payloadSize:0},d=0,p=0;c<o.byteLength&&o[c]!==Ip;){for(;o[c]===255;)d+=255,c++;for(d+=o[c++];o[c]===255;)p+=255,c++;if(p+=o[c++],!h.payload&&d===Tl){var g=String.fromCharCode(o[c+3],o[c+4],o[c+5],o[c+6]);if(g==="GA94"){h.payloadType=d,h.payloadSize=p,h.payload=o.subarray(c,c+p);break}else h.payload=void 0}c+=p,d=0,p=0}return h},Lp=function(o){return o.payload[0]!==181||(o.payload[1]<<8|o.payload[2])!==49||String.fromCharCode(o.payload[3],o.payload[4],o.payload[5],o.payload[6])!=="GA94"||o.payload[7]!==3?null:o.payload.subarray(8,o.payload.length-1)},Op=function(o,c){var h=[],d,p,g,_;if(!(c[0]&64))return h;for(p=c[0]&31,d=0;d<p;d++)g=d*3,_={type:c[g+2]&3,pts:o},c[g+2]&4&&(_.ccData=c[g+3]<<8|c[g+4],h.push(_));return h},Mp=function(o){for(var c=o.byteLength,h=[],d=1,p,g;d<c-2;)o[d]===0&&o[d+1]===0&&o[d+2]===3?(h.push(d+2),d+=2):d++;if(h.length===0)return o;p=c-h.length,g=new Uint8Array(p);var _=0;for(d=0;d<p;_++,d++)_===h[0]&&(_++,h.shift()),g[d]=o[_];return g},xl={parseSei:Pp,parseUserData:Lp,parseCaptionPackets:Op,discardEmulationPreventionBytes:Mp,USER_DATA_REGISTERED_ITU_T_T35:Tl},ta=t,gr=xl,qe=function(o){o=o||{},qe.prototype.init.call(this),this.parse708captions_=typeof o.parse708captions=="boolean"?o.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new fe(0,0),new fe(0,1),new fe(1,0),new fe(1,1)],this.parse708captions_&&(this.cc708Stream_=new ue({captionServices:o.captionServices})),this.reset(),this.ccStreams_.forEach(function(c){c.on("data",this.trigger.bind(this,"data")),c.on("partialdone",this.trigger.bind(this,"partialdone")),c.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};qe.prototype=new ta,qe.prototype.push=function(o){var c,h,d;if(o.nalUnitType==="sei_rbsp"&&(c=gr.parseSei(o.escapedRBSP),!!c.payload&&c.payloadType===gr.USER_DATA_REGISTERED_ITU_T_T35&&(h=gr.parseUserData(c),!!h))){if(o.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(o.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}d=gr.parseCaptionPackets(o.pts,h),this.captionPackets_=this.captionPackets_.concat(d),this.latestDts_!==o.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=o.dts}},qe.prototype.flushCCStreams=function(o){this.ccStreams_.forEach(function(c){return o==="flush"?c.flush():c.partialFlush()},this)},qe.prototype.flushStream=function(o){if(!this.captionPackets_.length){this.flushCCStreams(o);return}this.captionPackets_.forEach(function(c,h){c.presortIndex=h}),this.captionPackets_.sort(function(c,h){return c.pts===h.pts?c.presortIndex-h.presortIndex:c.pts-h.pts}),this.captionPackets_.forEach(function(c){c.type<2?this.dispatchCea608Packet(c):this.dispatchCea708Packet(c)},this),this.captionPackets_.length=0,this.flushCCStreams(o)},qe.prototype.flush=function(){return this.flushStream("flush")},qe.prototype.partialFlush=function(){return this.flushStream("partialFlush")},qe.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(o){o.reset()})},qe.prototype.dispatchCea608Packet=function(o){this.setsTextOrXDSActive(o)?this.activeCea608Channel_[o.type]=null:this.setsChannel1Active(o)?this.activeCea608Channel_[o.type]=0:this.setsChannel2Active(o)&&(this.activeCea608Channel_[o.type]=1),this.activeCea608Channel_[o.type]!==null&&this.ccStreams_[(o.type<<1)+this.activeCea608Channel_[o.type]].push(o)},qe.prototype.setsChannel1Active=function(o){return(o.ccData&30720)===4096},qe.prototype.setsChannel2Active=function(o){return(o.ccData&30720)===6144},qe.prototype.setsTextOrXDSActive=function(o){return(o.ccData&28928)===256||(o.ccData&30974)===4138||(o.ccData&30974)===6186},qe.prototype.dispatchCea708Packet=function(o){this.parse708captions_&&this.cc708Stream_.push(o)};var Rp={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},Np=function(o){var c=Rp[o]||o;return o&4096&&o===c?"":String.fromCharCode(c)},vr=function(o){return 32<=o&&o<=127||160<=o&&o<=255},kt=function(o){this.windowNum=o,this.reset()};kt.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},kt.prototype.getText=function(){return this.rows.join(`
202
+ `)},kt.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},kt.prototype.newLine=function(o){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(o),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},kt.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},kt.prototype.addText=function(o){this.rows[this.rowIdx]+=o},kt.prototype.backspace=function(){if(!this.isEmpty()){var o=this.rows[this.rowIdx];this.rows[this.rowIdx]=o.substr(0,o.length-1)}};var yr=function(o,c,h){this.serviceNum=o,this.text="",this.currentWindow=new kt(-1),this.windows=[],this.stream=h,typeof c=="string"&&this.createTextDecoder(c)};yr.prototype.init=function(o,c){this.startPts=o;for(var h=0;h<8;h++)this.windows[h]=new kt(h),typeof c=="function"&&(this.windows[h].beforeRowOverflow=c)},yr.prototype.setCurrentWindow=function(o){this.currentWindow=this.windows[o]},yr.prototype.createTextDecoder=function(o){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(o)}catch(c){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+o+" encoding. "+c})}};var ue=function(o){o=o||{},ue.prototype.init.call(this);var c=this,h=o.captionServices||{},d={},p;Object.keys(h).forEach(g=>{p=h[g],/^SERVICE/.test(g)&&(d[g]=p.encoding)}),this.serviceEncodings=d,this.current708Packet=null,this.services={},this.push=function(g){g.type===3?(c.new708Packet(),c.add708Bytes(g)):(c.current708Packet===null&&c.new708Packet(),c.add708Bytes(g))}};ue.prototype=new ta,ue.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ue.prototype.add708Bytes=function(o){var c=o.ccData,h=c>>>8,d=c&255;this.current708Packet.ptsVals.push(o.pts),this.current708Packet.data.push(h),this.current708Packet.data.push(d)},ue.prototype.push708Packet=function(){var o=this.current708Packet,c=o.data,h=null,d=null,p=0,g=c[p++];for(o.seq=g>>6,o.sizeCode=g&63;p<c.length;p++)g=c[p++],h=g>>5,d=g&31,h===7&&d>0&&(g=c[p++],h=g),this.pushServiceBlock(h,p,d),d>0&&(p+=d-1)},ue.prototype.pushServiceBlock=function(o,c,h){var d,p=c,g=this.current708Packet.data,_=this.services[o];for(_||(_=this.initService(o,p));p<c+h&&p<g.length;p++)d=g[p],vr(d)?p=this.handleText(p,_):d===24?p=this.multiByteCharacter(p,_):d===16?p=this.extendedCommands(p,_):128<=d&&d<=135?p=this.setCurrentWindow(p,_):152<=d&&d<=159?p=this.defineWindow(p,_):d===136?p=this.clearWindows(p,_):d===140?p=this.deleteWindows(p,_):d===137?p=this.displayWindows(p,_):d===138?p=this.hideWindows(p,_):d===139?p=this.toggleWindows(p,_):d===151?p=this.setWindowAttributes(p,_):d===144?p=this.setPenAttributes(p,_):d===145?p=this.setPenColor(p,_):d===146?p=this.setPenLocation(p,_):d===143?_=this.reset(p,_):d===8?_.currentWindow.backspace():d===12?_.currentWindow.clearText():d===13?_.currentWindow.pendingNewLine=!0:d===14?_.currentWindow.clearText():d===141&&p++},ue.prototype.extendedCommands=function(o,c){var h=this.current708Packet.data,d=h[++o];return vr(d)&&(o=this.handleText(o,c,{isExtended:!0})),o},ue.prototype.getPts=function(o){return this.current708Packet.ptsVals[Math.floor(o/2)]},ue.prototype.initService=function(o,c){var d="SERVICE"+o,h=this,d,p;return d in this.serviceEncodings&&(p=this.serviceEncodings[d]),this.services[o]=new yr(o,p,h),this.services[o].init(this.getPts(c),function(g){h.flushDisplayed(g,h.services[o])}),this.services[o]},ue.prototype.handleText=function(o,c,h){var d=h&&h.isExtended,p=h&&h.isMultiByte,g=this.current708Packet.data,_=d?4096:0,b=g[o],x=g[o+1],C=c.currentWindow,D,M;function H(N){return N.map($=>("0"+($&255).toString(16)).slice(-2)).join("")}if(p?(M=[b,x],o++):M=[b],c.textDecoder_&&!d)D=c.textDecoder_.decode(new Uint8Array(M));else if(p){const N=H(M);D=String.fromCharCode(parseInt(N,16))}else D=Np(_|b);return C.pendingNewLine&&!C.isEmpty()&&C.newLine(this.getPts(o)),C.pendingNewLine=!1,C.addText(D),o},ue.prototype.multiByteCharacter=function(o,c){var h=this.current708Packet.data,d=h[o+1],p=h[o+2];return vr(d)&&vr(p)&&(o=this.handleText(++o,c,{isMultiByte:!0})),o},ue.prototype.setCurrentWindow=function(o,c){var h=this.current708Packet.data,d=h[o],p=d&7;return c.setCurrentWindow(p),o},ue.prototype.defineWindow=function(o,c){var h=this.current708Packet.data,d=h[o],p=d&7;c.setCurrentWindow(p);var g=c.currentWindow;return d=h[++o],g.visible=(d&32)>>5,g.rowLock=(d&16)>>4,g.columnLock=(d&8)>>3,g.priority=d&7,d=h[++o],g.relativePositioning=(d&128)>>7,g.anchorVertical=d&127,d=h[++o],g.anchorHorizontal=d,d=h[++o],g.anchorPoint=(d&240)>>4,g.rowCount=d&15,d=h[++o],g.columnCount=d&63,d=h[++o],g.windowStyle=(d&56)>>3,g.penStyle=d&7,g.virtualRowCount=g.rowCount+1,o},ue.prototype.setWindowAttributes=function(o,c){var h=this.current708Packet.data,d=h[o],p=c.currentWindow.winAttr;return d=h[++o],p.fillOpacity=(d&192)>>6,p.fillRed=(d&48)>>4,p.fillGreen=(d&12)>>2,p.fillBlue=d&3,d=h[++o],p.borderType=(d&192)>>6,p.borderRed=(d&48)>>4,p.borderGreen=(d&12)>>2,p.borderBlue=d&3,d=h[++o],p.borderType+=(d&128)>>5,p.wordWrap=(d&64)>>6,p.printDirection=(d&48)>>4,p.scrollDirection=(d&12)>>2,p.justify=d&3,d=h[++o],p.effectSpeed=(d&240)>>4,p.effectDirection=(d&12)>>2,p.displayEffect=d&3,o},ue.prototype.flushDisplayed=function(o,c){for(var h=[],d=0;d<8;d++)c.windows[d].visible&&!c.windows[d].isEmpty()&&h.push(c.windows[d].getText());c.endPts=o,c.text=h.join(`
203
203
 
204
- `),this.pushCaption(c),c.startPts=o},ue.prototype.pushCaption=function(o){o.text!==""&&(this.trigger("data",{startPts:o.startPts,endPts:o.endPts,text:o.text,stream:"cc708_"+o.serviceNum}),o.text="",o.startPts=o.endPts)},ue.prototype.displayWindows=function(o,c){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<<g&&(c.windows[g].visible=1);return o},ue.prototype.hideWindows=function(o,c){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<<g&&(c.windows[g].visible=0);return o},ue.prototype.toggleWindows=function(o,c){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<<g&&(c.windows[g].visible^=1);return o},ue.prototype.clearWindows=function(o,c){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<<g&&c.windows[g].clearText();return o},ue.prototype.deleteWindows=function(o,c){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<<g&&c.windows[g].reset();return o},ue.prototype.setPenAttributes=function(o,c){var h=this.current708Packet.data,d=h[o],p=c.currentWindow.penAttr;return d=h[++o],p.textTag=(d&240)>>4,p.offset=(d&12)>>2,p.penSize=d&3,d=h[++o],p.italics=(d&128)>>7,p.underline=(d&64)>>6,p.edgeType=(d&56)>>3,p.fontStyle=d&7,o},ue.prototype.setPenColor=function(o,c){var h=this.current708Packet.data,d=h[o],p=c.currentWindow.penColor;return d=h[++o],p.fgOpacity=(d&192)>>6,p.fgRed=(d&48)>>4,p.fgGreen=(d&12)>>2,p.fgBlue=d&3,d=h[++o],p.bgOpacity=(d&192)>>6,p.bgRed=(d&48)>>4,p.bgGreen=(d&12)>>2,p.bgBlue=d&3,d=h[++o],p.edgeRed=(d&48)>>4,p.edgeGreen=(d&12)>>2,p.edgeBlue=d&3,o},ue.prototype.setPenLocation=function(o,c){var h=this.current708Packet.data,d=h[o],p=c.currentWindow.penLoc;return c.currentWindow.pendingNewLine=!0,d=h[++o],p.row=d&15,d=h[++o],p.column=d&63,o},ue.prototype.reset=function(o,c){var h=this.getPts(o);return this.flushDisplayed(h,c),this.initService(c.serviceNum,o)};var Vp={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},br=function(o){return o===null?"":(o=Vp[o]||o,String.fromCharCode(o))},Tr=14,Hp=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],ni=function(){for(var o=[],c=Tr+1;c--;)o.push({text:"",indent:0,offset:0});return o},fe=function(o,c){fe.prototype.init.call(this),this.field_=o||0,this.dataChannel_=c||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(h){var d,p,g,_,b;if(d=h.ccData&32639,d===this.lastControlCode_){this.lastControlCode_=null;return}if((d&61440)===4096?this.lastControlCode_=d:d!==this.PADDING_&&(this.lastControlCode_=null),g=d>>>8,_=d&255,d!==this.PADDING_)if(d===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(d===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(h.pts),this.flushDisplayed(h.pts),p=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=p,this.startPts_=h.pts;else if(d===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(h.pts);else if(d===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(h.pts);else if(d===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(h.pts);else if(d===this.CARRIAGE_RETURN_)this.clearFormatting(h.pts),this.flushDisplayed(h.pts),this.shiftRowsUp_(),this.startPts_=h.pts;else if(d===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(d===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(h.pts),this.displayed_=ni();else if(d===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=ni();else if(d===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(h.pts),this.displayed_=ni()),this.mode_="paintOn",this.startPts_=h.pts;else if(this.isSpecialCharacter(g,_))g=(g&3)<<8,b=br(g|_),this[this.mode_](h.pts,b),this.column_++;else if(this.isExtCharacter(g,_))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),g=(g&3)<<8,b=br(g|_),this[this.mode_](h.pts,b),this.column_++;else if(this.isMidRowCode(g,_))this.clearFormatting(h.pts),this[this.mode_](h.pts," "),this.column_++,(_&14)===14&&this.addFormatting(h.pts,["i"]),(_&1)===1&&this.addFormatting(h.pts,["u"]);else if(this.isOffsetControlCode(g,_)){const C=_&3;this.nonDisplayed_[this.row_].offset=C,this.column_+=C}else if(this.isPAC(g,_)){var x=Hp.indexOf(d&7968);if(this.mode_==="rollUp"&&(x-this.rollUpRows_+1<0&&(x=this.rollUpRows_-1),this.setRollUp(h.pts,x)),x!==this.row_&&x>=0&&x<=14&&(this.clearFormatting(h.pts),this.row_=x),_&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(h.pts,["u"]),(d&16)===16){const C=(d&14)>>1;this.column_=C*4,this.nonDisplayed_[this.row_].indent+=C}this.isColorPAC(_)&&(_&14)===14&&this.addFormatting(h.pts,["i"])}else this.isNormalChar(g)&&(_===0&&(_=null),b=br(g),b+=br(_),this[this.mode_](h.pts,b),this.column_+=b.length)}};fe.prototype=new sa,fe.prototype.flushDisplayed=function(o){const c=d=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+d+"."})},h=[];this.displayed_.forEach((d,p)=>{if(d&&d.text&&d.text.length){try{d.text=d.text.trim()}catch{c(p)}d.text.length&&h.push({text:d.text,line:p+1,position:10+Math.min(70,d.indent*10)+d.offset*2.5})}else d==null&&c(p)}),h.length&&this.trigger("data",{startPts:this.startPts_,endPts:o,content:h,stream:this.name_})},fe.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=ni(),this.nonDisplayed_=ni(),this.lastControlCode_=null,this.column_=0,this.row_=Tr,this.rollUpRows_=2,this.formatting_=[]},fe.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},fe.prototype.isSpecialCharacter=function(o,c){return o===this.EXT_&&c>=48&&c<=63},fe.prototype.isExtCharacter=function(o,c){return(o===this.EXT_+1||o===this.EXT_+2)&&c>=32&&c<=63},fe.prototype.isMidRowCode=function(o,c){return o===this.EXT_&&c>=32&&c<=47},fe.prototype.isOffsetControlCode=function(o,c){return o===this.OFFSET_&&c>=33&&c<=35},fe.prototype.isPAC=function(o,c){return o>=this.BASE_&&o<this.BASE_+8&&c>=64&&c<=127},fe.prototype.isColorPAC=function(o){return o>=64&&o<=79||o>=96&&o<=127},fe.prototype.isNormalChar=function(o){return o>=32&&o<=127},fe.prototype.setRollUp=function(o,c){if(this.mode_!=="rollUp"&&(this.row_=Tr,this.mode_="rollUp",this.flushDisplayed(o),this.nonDisplayed_=ni(),this.displayed_=ni()),c!==void 0&&c!==this.row_)for(var h=0;h<this.rollUpRows_;h++)this.displayed_[c-h]=this.displayed_[this.row_-h],this.displayed_[this.row_-h]={text:"",indent:0,offset:0};c===void 0&&(c=this.row_),this.topRow_=c-this.rollUpRows_+1},fe.prototype.addFormatting=function(o,c){this.formatting_=this.formatting_.concat(c);var h=c.reduce(function(d,p){return d+"<"+p+">"},"");this[this.mode_](o,h)},fe.prototype.clearFormatting=function(o){if(this.formatting_.length){var c=this.formatting_.reverse().reduce(function(h,d){return h+"</"+d+">"},"");this.formatting_=[],this[this.mode_](o,c)}},fe.prototype.popOn=function(o,c){var h=this.nonDisplayed_[this.row_].text;h+=c,this.nonDisplayed_[this.row_].text=h},fe.prototype.rollUp=function(o,c){var h=this.displayed_[this.row_].text;h+=c,this.displayed_[this.row_].text=h},fe.prototype.shiftRowsUp_=function(){var o;for(o=0;o<this.topRow_;o++)this.displayed_[o]={text:"",indent:0,offset:0};for(o=this.row_+1;o<Tr+1;o++)this.displayed_[o]={text:"",indent:0,offset:0};for(o=this.topRow_;o<this.row_;o++)this.displayed_[o]=this.displayed_[o+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},fe.prototype.paintOn=function(o,c){var h=this.displayed_[this.row_].text;h+=c,this.displayed_[this.row_].text=h};var El={CaptionStream:He,Cea608Stream:fe,Cea708Stream:ue},xr={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},qp=t,zp=8589934592,$p=4294967296,Al="shared",ra=function(o,c){var h=1;for(o>c&&(h=-1);Math.abs(c-o)>$p;)o+=h*zp;return o},na=function(o){var c,h;na.prototype.init.call(this),this.type_=o||Al,this.push=function(d){if(d.type==="metadata"){this.trigger("data",d);return}this.type_!==Al&&d.type!==this.type_||(h===void 0&&(h=d.dts),d.dts=ra(d.dts,h),d.pts=ra(d.pts,h),c=d.dts,this.trigger("data",d))},this.flush=function(){h=c,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){h=void 0,c=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};na.prototype=new qp;var wl={TimestampRolloverStream:na,handleRollover:ra},Gp=(o,c,h)=>{if(!o)return-1;for(var d=h;d<o.length;d++)if(o[d]===c)return d;return-1},Wp={typedArrayIndexOf:Gp},Sr=Wp.typedArrayIndexOf,Cr={Utf8:3},Dl=function(o,c,h){var d,p="";for(d=c;d<h;d++)p+="%"+("00"+o[d].toString(16)).slice(-2);return p},fs=function(o,c,h){return decodeURIComponent(Dl(o,c,h))},ps=function(o,c,h){return unescape(Dl(o,c,h))},ms=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},gs={APIC:function(o){var c=1,h,d,p="-->";o.data[0]===Cr.Utf8&&(h=Sr(o.data,0,c),!(h<0)&&(o.mimeType=ps(o.data,c,h),c=h+1,o.pictureType=o.data[c],c++,d=Sr(o.data,0,c),!(d<0)&&(o.description=fs(o.data,c,d),c=d+1,o.mimeType===p?o.url=ps(o.data,c,o.data.length):o.pictureData=o.data.subarray(c,o.data.length))))},"T*":function(o){o.data[0]===Cr.Utf8&&(o.value=fs(o.data,1,o.data.length).replace(/\0*$/,""),o.values=o.value.split("\0"))},TXXX:function(o){var c;o.data[0]===Cr.Utf8&&(c=Sr(o.data,0,1),c!==-1&&(o.description=fs(o.data,1,c),o.value=fs(o.data,c+1,o.data.length).replace(/\0*$/,""),o.data=o.value))},"W*":function(o){o.url=ps(o.data,0,o.data.length).replace(/\0.*$/,"")},WXXX:function(o){var c;o.data[0]===Cr.Utf8&&(c=Sr(o.data,0,1),c!==-1&&(o.description=fs(o.data,1,c),o.url=ps(o.data,c+1,o.data.length).replace(/\0.*$/,"")))},PRIV:function(o){var c;for(c=0;c<o.data.length;c++)if(o.data[c]===0){o.owner=ps(o.data,0,c);break}o.privateData=o.data.subarray(c+1),o.data=o.privateData}},Xp=function(o){var c,h,d=10,p=0,g=[];if(!(o.length<10||o[0]!==73||o[1]!==68||o[2]!==51)){p=ms(o.subarray(6,10)),p+=10;var _=o[5]&64;_&&(d+=4,d+=ms(o.subarray(10,14)),p-=ms(o.subarray(16,20)));do{if(c=ms(o.subarray(d+4,d+8)),c<1)break;h=String.fromCharCode(o[d],o[d+1],o[d+2],o[d+3]);var b={id:h,data:o.subarray(d+10,d+c+10)};b.key=b.id,gs[b.id]?gs[b.id](b):b.id[0]==="T"?gs["T*"](b):b.id[0]==="W"&&gs["W*"](b),g.push(b),d+=10,d+=c}while(d<p);return g}},kl={parseId3Frames:Xp,parseSyncSafeInteger:ms,frameParsers:gs},Yp=t,Kp=xr,Vt=kl,Er;Er=function(o){var c={descriptor:o&&o.descriptor},h=0,d=[],p=0,g;if(Er.prototype.init.call(this),this.dispatchType=Kp.METADATA_STREAM_TYPE.toString(16),c.descriptor)for(g=0;g<c.descriptor.length;g++)this.dispatchType+=("00"+c.descriptor[g].toString(16)).slice(-2);this.push=function(_){var b,x,C,D,M,H;if(_.type==="timed-metadata"){if(_.dataAlignmentIndicator&&(p=0,d.length=0),d.length===0&&(_.data.length<10||_.data[0]!==73||_.data[1]!==68||_.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(d.push(_),p+=_.data.byteLength,d.length===1&&(h=Vt.parseSyncSafeInteger(_.data.subarray(6,10)),h+=10),!(p<h)){for(b={data:new Uint8Array(h),frames:[],pts:d[0].pts,dts:d[0].dts},M=0;M<h;)b.data.set(d[0].data.subarray(0,h-M),M),M+=d[0].data.byteLength,p-=d[0].data.byteLength,d.shift();x=10,b.data[5]&64&&(x+=4,x+=Vt.parseSyncSafeInteger(b.data.subarray(10,14)),h-=Vt.parseSyncSafeInteger(b.data.subarray(16,20)));do{if(C=Vt.parseSyncSafeInteger(b.data.subarray(x+4,x+8)),C<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(H=String.fromCharCode(b.data[x],b.data[x+1],b.data[x+2],b.data[x+3]),D={id:H,data:b.data.subarray(x+10,x+C+10)},D.key=D.id,Vt.frameParsers[D.id]?Vt.frameParsers[D.id](D):D.id[0]==="T"?Vt.frameParsers["T*"](D):D.id[0]==="W"&&Vt.frameParsers["W*"](D),D.owner==="com.apple.streaming.transportStreamTimestamp"){var N=D.data,$=(N[3]&1)<<30|N[4]<<22|N[5]<<14|N[6]<<6|N[7]>>>2;$*=4,$+=N[7]&3,D.timeStamp=$,b.pts===void 0&&b.dts===void 0&&(b.pts=D.timeStamp,b.dts=D.timeStamp),this.trigger("timestamp",D)}b.frames.push(D),x+=10,x+=C}while(x<h);this.trigger("data",b)}}}},Er.prototype=new Yp;var Qp=Er,aa=t,oa=El,ot=xr,Jp=wl.TimestampRolloverStream,Ar,vs,wr,Si=188,la=71;Ar=function(){var o=new Uint8Array(Si),c=0;Ar.prototype.init.call(this),this.push=function(h){var d=0,p=Si,g;for(c?(g=new Uint8Array(h.byteLength+c),g.set(o.subarray(0,c)),g.set(h,c),c=0):g=h;p<g.byteLength;){if(g[d]===la&&g[p]===la){this.trigger("data",g.subarray(d,p)),d+=Si,p+=Si;continue}d++,p++}d<g.byteLength&&(o.set(g.subarray(d),0),c=g.byteLength-d)},this.flush=function(){c===Si&&o[0]===la&&(this.trigger("data",o),c=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){c=0,this.trigger("reset")}},Ar.prototype=new aa,vs=function(){var o,c,h,d;vs.prototype.init.call(this),d=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,o=function(p,g){var _=0;g.payloadUnitStartIndicator&&(_+=p[_]+1),g.type==="pat"?c(p.subarray(_),g):h(p.subarray(_),g)},c=function(p,g){g.section_number=p[7],g.last_section_number=p[8],d.pmtPid=(p[10]&31)<<8|p[11],g.pmtPid=d.pmtPid},h=function(p,g){var _,b,x,C;if(p[5]&1){for(d.programMapTable={video:null,audio:null,"timed-metadata":{}},_=(p[1]&15)<<8|p[2],b=3+_-4,x=(p[10]&15)<<8|p[11],C=12+x;C<b;){var D=p[C],M=(p[C+1]&31)<<8|p[C+2];D===ot.H264_STREAM_TYPE&&d.programMapTable.video===null?d.programMapTable.video=M:D===ot.ADTS_STREAM_TYPE&&d.programMapTable.audio===null?d.programMapTable.audio=M:D===ot.METADATA_STREAM_TYPE&&(d.programMapTable["timed-metadata"][M]=D),C+=((p[C+3]&15)<<8|p[C+4])+5}g.programMapTable=d.programMapTable}},this.push=function(p){var g={},_=4;if(g.payloadUnitStartIndicator=!!(p[1]&64),g.pid=p[1]&31,g.pid<<=8,g.pid|=p[2],(p[3]&48)>>>4>1&&(_+=p[_]+1),g.pid===0)g.type="pat",o(p.subarray(_),g),this.trigger("data",g);else if(g.pid===this.pmtPid)for(g.type="pmt",o(p.subarray(_),g),this.trigger("data",g);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([p,_,g]):this.processPes_(p,_,g)},this.processPes_=function(p,g,_){_.pid===this.programMapTable.video?_.streamType=ot.H264_STREAM_TYPE:_.pid===this.programMapTable.audio?_.streamType=ot.ADTS_STREAM_TYPE:_.streamType=this.programMapTable["timed-metadata"][_.pid],_.type="pes",_.data=p.subarray(g),this.trigger("data",_)}},vs.prototype=new aa,vs.STREAM_TYPES={h264:27,adts:15},wr=function(){var o=this,c=!1,h={data:[],size:0},d={data:[],size:0},p={data:[],size:0},g,_=function(x,C){var D;const M=x[0]<<16|x[1]<<8|x[2];C.data=new Uint8Array,M===1&&(C.packetLength=6+(x[4]<<8|x[5]),C.dataAlignmentIndicator=(x[6]&4)!==0,D=x[7],D&192&&(C.pts=(x[9]&14)<<27|(x[10]&255)<<20|(x[11]&254)<<12|(x[12]&255)<<5|(x[13]&254)>>>3,C.pts*=4,C.pts+=(x[13]&6)>>>1,C.dts=C.pts,D&64&&(C.dts=(x[14]&14)<<27|(x[15]&255)<<20|(x[16]&254)<<12|(x[17]&255)<<5|(x[18]&254)>>>3,C.dts*=4,C.dts+=(x[18]&6)>>>1)),C.data=x.subarray(9+x[8]))},b=function(x,C,D){var M=new Uint8Array(x.size),H={type:C},N=0,$=0,K=!1,Ee;if(!(!x.data.length||x.size<9)){for(H.trackId=x.data[0].pid,N=0;N<x.data.length;N++)Ee=x.data[N],M.set(Ee.data,$),$+=Ee.data.byteLength;_(M,H),K=C==="video"||H.packetLength<=x.size,(D||K)&&(x.size=0,x.data.length=0),K&&o.trigger("data",H)}};wr.prototype.init.call(this),this.push=function(x){({pat:function(){},pes:function(){var C,D;switch(x.streamType){case ot.H264_STREAM_TYPE:C=h,D="video";break;case ot.ADTS_STREAM_TYPE:C=d,D="audio";break;case ot.METADATA_STREAM_TYPE:C=p,D="timed-metadata";break;default:return}x.payloadUnitStartIndicator&&b(C,D,!0),C.data.push(x),C.size+=x.data.byteLength},pmt:function(){var C={type:"metadata",tracks:[]};g=x.programMapTable,g.video!==null&&C.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.video,codec:"avc",type:"video"}),g.audio!==null&&C.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.audio,codec:"adts",type:"audio"}),c=!0,o.trigger("data",C)}})[x.type]()},this.reset=function(){h.size=0,h.data.length=0,d.size=0,d.data.length=0,this.trigger("reset")},this.flushStreams_=function(){b(h,"video"),b(d,"audio"),b(p,"timed-metadata")},this.flush=function(){if(!c&&g){var x={type:"metadata",tracks:[]};g.video!==null&&x.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.video,codec:"avc",type:"video"}),g.audio!==null&&x.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.audio,codec:"adts",type:"audio"}),o.trigger("data",x)}c=!1,this.flushStreams_(),this.trigger("done")}},wr.prototype=new aa;var jl={PAT_PID:0,MP2T_PACKET_LENGTH:Si,TransportPacketStream:Ar,TransportParseStream:vs,ElementaryStream:wr,TimestampRolloverStream:Jp,CaptionStream:oa.CaptionStream,Cea608Stream:oa.Cea608Stream,Cea708Stream:oa.Cea708Stream,MetadataStream:Qp};for(var ua in ot)ot.hasOwnProperty(ua)&&(jl[ua]=ot[ua]);var Zp=jl,em=t,tm=de.ONE_SECOND_IN_TS,Dr,Il=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Dr=function(o){var c,h=0;Dr.prototype.init.call(this),this.skipWarn_=function(d,p){this.trigger("log",{level:"warn",message:`adts skiping bytes ${d} to ${p} in frame ${h} outside syncword`})},this.push=function(d){var p=0,g,_,b,x,C;if(o||(h=0),d.type==="audio"){c&&c.length?(b=c,c=new Uint8Array(b.byteLength+d.data.byteLength),c.set(b),c.set(d.data,b.byteLength)):c=d.data;for(var D;p+7<c.length;){if(c[p]!==255||(c[p+1]&246)!==240){typeof D!="number"&&(D=p),p++;continue}if(typeof D=="number"&&(this.skipWarn_(D,p),D=null),_=(~c[p+1]&1)*2,g=(c[p+3]&3)<<11|c[p+4]<<3|(c[p+5]&224)>>5,x=((c[p+6]&3)+1)*1024,C=x*tm/Il[(c[p+2]&60)>>>2],c.byteLength-p<g)break;this.trigger("data",{pts:d.pts+h*C,dts:d.dts+h*C,sampleCount:x,audioobjecttype:(c[p+2]>>>6&3)+1,channelcount:(c[p+2]&1)<<2|(c[p+3]&192)>>>6,samplerate:Il[(c[p+2]&60)>>>2],samplingfrequencyindex:(c[p+2]&60)>>>2,samplesize:16,data:c.subarray(p+7+_,p+g)}),h++,p+=g}typeof D=="number"&&(this.skipWarn_(D,p),D=null),c=c.subarray(p)}},this.flush=function(){h=0,this.trigger("done")},this.reset=function(){c=void 0,this.trigger("reset")},this.endTimeline=function(){c=void 0,this.trigger("endedtimeline")}},Dr.prototype=new em;var im=Dr,Pl;Pl=function(o){var c=o.byteLength,h=0,d=0;this.length=function(){return 8*c},this.bitsAvailable=function(){return 8*c+d},this.loadWord=function(){var p=o.byteLength-c,g=new Uint8Array(4),_=Math.min(4,c);if(_===0)throw new Error("no bytes available");g.set(o.subarray(p,p+_)),h=new DataView(g.buffer).getUint32(0),d=_*8,c-=_},this.skipBits=function(p){var g;d>p?(h<<=p,d-=p):(p-=d,g=Math.floor(p/8),p-=g*8,c-=g,this.loadWord(),h<<=p,d-=p)},this.readBits=function(p){var g=Math.min(d,p),_=h>>>32-g;return d-=g,d>0?h<<=g:c>0&&this.loadWord(),g=p-g,g>0?_<<g|this.readBits(g):_},this.skipLeadingZeros=function(){var p;for(p=0;p<d;++p)if(h&2147483648>>>p)return h<<=p,d-=p,p;return this.loadWord(),p+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var p=this.skipLeadingZeros();return this.readBits(p+1)-1},this.readExpGolomb=function(){var p=this.readUnsignedExpGolomb();return 1&p?1+p>>>1:-1*(p>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var sm=Pl,Ll=t,rm=sm,kr,jr,Ol;jr=function(){var o=0,c,h;jr.prototype.init.call(this),this.push=function(d){var p;h?(p=new Uint8Array(h.byteLength+d.data.byteLength),p.set(h),p.set(d.data,h.byteLength),h=p):h=d.data;for(var g=h.byteLength;o<g-3;o++)if(h[o+2]===1){c=o+5;break}for(;c<g;)switch(h[c]){case 0:if(h[c-1]!==0){c+=2;break}else if(h[c-2]!==0){c++;break}o+3!==c-2&&this.trigger("data",h.subarray(o+3,c-2));do c++;while(h[c]!==1&&c<g);o=c-2,c+=3;break;case 1:if(h[c-1]!==0||h[c-2]!==0){c+=3;break}this.trigger("data",h.subarray(o+3,c-2)),o=c-2,c+=3;break;default:c+=3;break}h=h.subarray(o),c-=o,o=0},this.reset=function(){h=null,o=0,this.trigger("reset")},this.flush=function(){h&&h.byteLength>3&&this.trigger("data",h.subarray(o+3)),h=null,o=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},jr.prototype=new Ll,Ol={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},kr=function(){var o=new jr,c,h,d,p,g,_,b;kr.prototype.init.call(this),c=this,this.push=function(x){x.type==="video"&&(h=x.trackId,d=x.pts,p=x.dts,o.push(x))},o.on("data",function(x){var C={trackId:h,pts:d,dts:p,data:x,nalUnitTypeCode:x[0]&31};switch(C.nalUnitTypeCode){case 5:C.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:C.nalUnitType="sei_rbsp",C.escapedRBSP=g(x.subarray(1));break;case 7:C.nalUnitType="seq_parameter_set_rbsp",C.escapedRBSP=g(x.subarray(1)),C.config=_(C.escapedRBSP);break;case 8:C.nalUnitType="pic_parameter_set_rbsp";break;case 9:C.nalUnitType="access_unit_delimiter_rbsp";break}c.trigger("data",C)}),o.on("done",function(){c.trigger("done")}),o.on("partialdone",function(){c.trigger("partialdone")}),o.on("reset",function(){c.trigger("reset")}),o.on("endedtimeline",function(){c.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},b=function(x,C){var D=8,M=8,H,N;for(H=0;H<x;H++)M!==0&&(N=C.readExpGolomb(),M=(D+N+256)%256),D=M===0?D:M},g=function(x){for(var C=x.byteLength,D=[],M=1,H,N;M<C-2;)x[M]===0&&x[M+1]===0&&x[M+2]===3?(D.push(M+2),M+=2):M++;if(D.length===0)return x;H=C-D.length,N=new Uint8Array(H);var $=0;for(M=0;M<H;$++,M++)$===D[0]&&($++,D.shift()),N[M]=x[$];return N},_=function(x){var C=0,D=0,M=0,H=0,N,$,K,Ee,Ke,qt,Cs,Es,As,ws,Hr,he=[1,1],Ds,ut;if(N=new rm(x),$=N.readUnsignedByte(),Ee=N.readUnsignedByte(),K=N.readUnsignedByte(),N.skipUnsignedExpGolomb(),Ol[$]&&(Ke=N.readUnsignedExpGolomb(),Ke===3&&N.skipBits(1),N.skipUnsignedExpGolomb(),N.skipUnsignedExpGolomb(),N.skipBits(1),N.readBoolean()))for(Hr=Ke!==3?8:12,ut=0;ut<Hr;ut++)N.readBoolean()&&(ut<6?b(16,N):b(64,N));if(N.skipUnsignedExpGolomb(),qt=N.readUnsignedExpGolomb(),qt===0)N.readUnsignedExpGolomb();else if(qt===1)for(N.skipBits(1),N.skipExpGolomb(),N.skipExpGolomb(),Cs=N.readUnsignedExpGolomb(),ut=0;ut<Cs;ut++)N.skipExpGolomb();if(N.skipUnsignedExpGolomb(),N.skipBits(1),Es=N.readUnsignedExpGolomb(),As=N.readUnsignedExpGolomb(),ws=N.readBits(1),ws===0&&N.skipBits(1),N.skipBits(1),N.readBoolean()&&(C=N.readUnsignedExpGolomb(),D=N.readUnsignedExpGolomb(),M=N.readUnsignedExpGolomb(),H=N.readUnsignedExpGolomb()),N.readBoolean()&&N.readBoolean()){switch(Ds=N.readUnsignedByte(),Ds){case 1:he=[1,1];break;case 2:he=[12,11];break;case 3:he=[10,11];break;case 4:he=[16,11];break;case 5:he=[40,33];break;case 6:he=[24,11];break;case 7:he=[20,11];break;case 8:he=[32,11];break;case 9:he=[80,33];break;case 10:he=[18,11];break;case 11:he=[15,11];break;case 12:he=[64,33];break;case 13:he=[160,99];break;case 14:he=[4,3];break;case 15:he=[3,2];break;case 16:he=[2,1];break;case 255:{he=[N.readUnsignedByte()<<8|N.readUnsignedByte(),N.readUnsignedByte()<<8|N.readUnsignedByte()];break}}he&&he[0]/he[1]}return{profileIdc:$,levelIdc:K,profileCompatibility:Ee,width:(Es+1)*16-C*2-D*2,height:(2-ws)*(As+1)*16-M*2-H*2,sarRatio:he}}},kr.prototype=new Ll;var nm={H264Stream:kr},am=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Ml=function(o,c){var h=o[c+6]<<21|o[c+7]<<14|o[c+8]<<7|o[c+9],d=o[c+5],p=(d&16)>>4;return h=h>=0?h:0,p?h+20:h+10},Rl=function(o,c){return o.length-c<10||o[c]!==73||o[c+1]!==68||o[c+2]!==51?c:(c+=Ml(o,c),Rl(o,c))},om=function(o){var c=Rl(o,0);return o.length>=c+2&&(o[c]&255)===255&&(o[c+1]&240)===240&&(o[c+1]&22)===16},Nl=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},lm=function(o,c,h){var d,p="";for(d=c;d<h;d++)p+="%"+("00"+o[d].toString(16)).slice(-2);return p},um=function(o,c,h){return unescape(lm(o,c,h))},cm=function(o,c){var h=(o[c+5]&224)>>5,d=o[c+4]<<3,p=o[c+3]&6144;return p|d|h},dm=function(o,c){return o[c]===73&&o[c+1]===68&&o[c+2]===51?"timed-metadata":o[c]&!0&&(o[c+1]&240)===240?"audio":null},hm=function(o){for(var c=0;c+5<o.length;){if(o[c]!==255||(o[c+1]&246)!==240){c++;continue}return am[(o[c+2]&60)>>>2]}return null},fm=function(o){var c,h,d,p;c=10,o[5]&64&&(c+=4,c+=Nl(o.subarray(10,14)));do{if(h=Nl(o.subarray(c+4,c+8)),h<1)return null;if(p=String.fromCharCode(o[c],o[c+1],o[c+2],o[c+3]),p==="PRIV"){d=o.subarray(c+10,c+h+10);for(var g=0;g<d.byteLength;g++)if(d[g]===0){var _=um(d,0,g);if(_==="com.apple.streaming.transportStreamTimestamp"){var b=d.subarray(g+1),x=(b[3]&1)<<30|b[4]<<22|b[5]<<14|b[6]<<6|b[7]>>>2;return x*=4,x+=b[7]&3,x}break}}c+=10,c+=h}while(c<o.byteLength);return null},ca={isLikelyAacData:om,parseId3TagSize:Ml,parseAdtsSize:cm,parseType:dm,parseSampleRate:hm,parseAacTimestamp:fm},pm=t,Bl=ca,Ir;Ir=function(){var o=new Uint8Array,c=0;Ir.prototype.init.call(this),this.setTimestamp=function(h){c=h},this.push=function(h){var d=0,p=0,g,_,b,x;for(o.length?(x=o.length,o=new Uint8Array(h.byteLength+x),o.set(o.subarray(0,x)),o.set(h,x)):o=h;o.length-p>=3;){if(o[p]===73&&o[p+1]===68&&o[p+2]===51){if(o.length-p<10||(d=Bl.parseId3TagSize(o,p),p+d>o.length))break;_={type:"timed-metadata",data:o.subarray(p,p+d)},this.trigger("data",_),p+=d;continue}else if((o[p]&255)===255&&(o[p+1]&240)===240){if(o.length-p<7||(d=Bl.parseAdtsSize(o,p),p+d>o.length))break;b={type:"audio",data:o.subarray(p,p+d),pts:c,dts:c},this.trigger("data",b),p+=d;continue}p++}g=o.length-p,g>0?o=o.subarray(p):o=new Uint8Array},this.reset=function(){o=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){o=new Uint8Array,this.trigger("endedtimeline")}},Ir.prototype=new pm;var mm=Ir,gm=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],vm=gm,ym=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],_m=ym,Pr=t,ys=cp,_s=_p,Lr=Dp,lt=Lp,jt=Zp,Or=de,Fl=im,bm=nm.H264Stream,Tm=mm,xm=ca.isLikelyAacData,Sm=de.ONE_SECOND_IN_TS,Ul=vm,Vl=_m,Mr,bs,Rr,ai,Cm=function(o,c){c.stream=o,this.trigger("log",c)},Hl=function(o,c){for(var h=Object.keys(c),d=0;d<h.length;d++){var p=h[d];p==="headOfPipeline"||!c[p].on||c[p].on("log",Cm.bind(o,p))}},ql=function(o,c){var h;if(o.length!==c.length)return!1;for(h=0;h<o.length;h++)if(o[h]!==c[h])return!1;return!0},zl=function(o,c,h,d,p,g){var _=h-c,b=d-c,x=p-h;return{start:{dts:o,pts:o+_},end:{dts:o+b,pts:o+x},prependedContentDuration:g,baseMediaDecodeTime:o}};bs=function(o,c){var h=[],d,p=0,g=0,_=1/0;c=c||{},d=c.firstSequenceNumber||0,bs.prototype.init.call(this),this.push=function(b){lt.collectDtsInfo(o,b),o&&Ul.forEach(function(x){o[x]=b[x]}),h.push(b)},this.setEarliestDts=function(b){p=b},this.setVideoBaseMediaDecodeTime=function(b){_=b},this.setAudioAppendStart=function(b){g=b},this.flush=function(){var b,x,C,D,M,H,N;if(h.length===0){this.trigger("done","AudioSegmentStream");return}b=Lr.trimAdtsFramesByEarliestDts(h,o,p),o.baseMediaDecodeTime=lt.calculateTrackBaseMediaDecodeTime(o,c.keepOriginalTimestamps),N=Lr.prefixWithSilence(o,b,g,_),o.samples=Lr.generateSampleTable(b),C=ys.mdat(Lr.concatenateFrameData(b)),h=[],x=ys.moof(d,[o]),D=new Uint8Array(x.byteLength+C.byteLength),d++,D.set(x),D.set(C,x.byteLength),lt.clearDtsInfo(o),M=Math.ceil(Sm*1024/o.samplerate),b.length&&(H=b.length*M,this.trigger("segmentTimingInfo",zl(Or.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),b[0].dts,b[0].pts,b[0].dts+H,b[0].pts+H,N||0)),this.trigger("timingInfo",{start:b[0].pts,end:b[0].pts+H})),this.trigger("data",{track:o,boxes:D}),this.trigger("done","AudioSegmentStream")},this.reset=function(){lt.clearDtsInfo(o),h=[],this.trigger("reset")}},bs.prototype=new Pr,Mr=function(o,c){var h,d=[],p=[],g,_;c=c||{},h=c.firstSequenceNumber||0,Mr.prototype.init.call(this),delete o.minPTS,this.gopCache_=[],this.push=function(b){lt.collectDtsInfo(o,b),b.nalUnitType==="seq_parameter_set_rbsp"&&!g&&(g=b.config,o.sps=[b.data],Vl.forEach(function(x){o[x]=g[x]},this)),b.nalUnitType==="pic_parameter_set_rbsp"&&!_&&(_=b.data,o.pps=[b.data]),d.push(b)},this.flush=function(){for(var b,x,C,D,M,H,N=0,$,K;d.length&&d[0].nalUnitType!=="access_unit_delimiter_rbsp";)d.shift();if(d.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(b=_s.groupNalsIntoFrames(d),C=_s.groupFramesIntoGops(b),C[0][0].keyFrame||(x=this.getGopForFusion_(d[0],o),x?(N=x.duration,C.unshift(x),C.byteLength+=x.byteLength,C.nalCount+=x.nalCount,C.pts=x.pts,C.dts=x.dts,C.duration+=x.duration):C=_s.extendFirstKeyFrame(C)),p.length){var Ee;if(c.alignGopsAtEnd?Ee=this.alignGopsAtEnd_(C):Ee=this.alignGopsAtStart_(C),!Ee){this.gopCache_.unshift({gop:C.pop(),pps:o.pps,sps:o.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),d=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}lt.clearDtsInfo(o),C=Ee}lt.collectDtsInfo(o,C),o.samples=_s.generateSampleTable(C),M=ys.mdat(_s.concatenateNalData(C)),o.baseMediaDecodeTime=lt.calculateTrackBaseMediaDecodeTime(o,c.keepOriginalTimestamps),this.trigger("processedGopsInfo",C.map(function(Ke){return{pts:Ke.pts,dts:Ke.dts,byteLength:Ke.byteLength}})),$=C[0],K=C[C.length-1],this.trigger("segmentTimingInfo",zl(o.baseMediaDecodeTime,$.dts,$.pts,K.dts+K.duration,K.pts+K.duration,N)),this.trigger("timingInfo",{start:C[0].pts,end:C[C.length-1].pts+C[C.length-1].duration}),this.gopCache_.unshift({gop:C.pop(),pps:o.pps,sps:o.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),d=[],this.trigger("baseMediaDecodeTime",o.baseMediaDecodeTime),this.trigger("timelineStartInfo",o.timelineStartInfo),D=ys.moof(h,[o]),H=new Uint8Array(D.byteLength+M.byteLength),h++,H.set(D),H.set(M,D.byteLength),this.trigger("data",{track:o,boxes:H}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),d=[],this.gopCache_.length=0,p.length=0,this.trigger("reset")},this.resetStream_=function(){lt.clearDtsInfo(o),g=void 0,_=void 0},this.getGopForFusion_=function(b){var x=45e3,C=1/0,D,M,H,N,$;for($=0;$<this.gopCache_.length;$++)N=this.gopCache_[$],H=N.gop,!(!(o.pps&&ql(o.pps[0],N.pps[0]))||!(o.sps&&ql(o.sps[0],N.sps[0])))&&(H.dts<o.timelineStartInfo.dts||(D=b.dts-H.dts-H.duration,D>=-1e4&&D<=x&&(!M||C>D)&&(M=N,C=D)));return M?M.gop:null},this.alignGopsAtStart_=function(b){var x,C,D,M,H,N,$,K;for(H=b.byteLength,N=b.nalCount,$=b.duration,x=C=0;x<p.length&&C<b.length&&(D=p[x],M=b[C],D.pts!==M.pts);){if(M.pts>D.pts){x++;continue}C++,H-=M.byteLength,N-=M.nalCount,$-=M.duration}return C===0?b:C===b.length?null:(K=b.slice(C),K.byteLength=H,K.duration=$,K.nalCount=N,K.pts=K[0].pts,K.dts=K[0].dts,K)},this.alignGopsAtEnd_=function(b){var x,C,D,M,H,N;for(x=p.length-1,C=b.length-1,H=null,N=!1;x>=0&&C>=0;){if(D=p[x],M=b[C],D.pts===M.pts){N=!0;break}if(D.pts>M.pts){x--;continue}x===p.length-1&&(H=C),C--}if(!N&&H===null)return null;var $;if(N?$=C:$=H,$===0)return b;var K=b.slice($),Ee=K.reduce(function(Ke,qt){return Ke.byteLength+=qt.byteLength,Ke.duration+=qt.duration,Ke.nalCount+=qt.nalCount,Ke},{byteLength:0,duration:0,nalCount:0});return K.byteLength=Ee.byteLength,K.duration=Ee.duration,K.nalCount=Ee.nalCount,K.pts=K[0].pts,K.dts=K[0].dts,K},this.alignGopsWith=function(b){p=b}},Mr.prototype=new Pr,ai=function(o,c){this.numberOfTracks=0,this.metadataStream=c,o=o||{},typeof o.remux<"u"?this.remuxTracks=!!o.remux:this.remuxTracks=!0,typeof o.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=o.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,ai.prototype.init.call(this),this.push=function(h){if(h.content||h.text)return this.pendingCaptions.push(h);if(h.frames)return this.pendingMetadata.push(h);this.pendingTracks.push(h.track),this.pendingBytes+=h.boxes.byteLength,h.track.type==="video"&&(this.videoTrack=h.track,this.pendingBoxes.push(h.boxes)),h.track.type==="audio"&&(this.audioTrack=h.track,this.pendingBoxes.unshift(h.boxes))}},ai.prototype=new Pr,ai.prototype.flush=function(o){var c=0,h={captions:[],captionStreams:{},metadata:[],info:{}},d,p,g,_=0,b;if(this.pendingTracks.length<this.numberOfTracks){if(o!=="VideoSegmentStream"&&o!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(_=this.videoTrack.timelineStartInfo.pts,Vl.forEach(function(x){h.info[x]=this.videoTrack[x]},this)):this.audioTrack&&(_=this.audioTrack.timelineStartInfo.pts,Ul.forEach(function(x){h.info[x]=this.audioTrack[x]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?h.type=this.pendingTracks[0].type:h.type="combined",this.emittedTracks+=this.pendingTracks.length,g=ys.initSegment(this.pendingTracks),h.initSegment=new Uint8Array(g.byteLength),h.initSegment.set(g),h.data=new Uint8Array(this.pendingBytes),b=0;b<this.pendingBoxes.length;b++)h.data.set(this.pendingBoxes[b],c),c+=this.pendingBoxes[b].byteLength;for(b=0;b<this.pendingCaptions.length;b++)d=this.pendingCaptions[b],d.startTime=Or.metadataTsToSeconds(d.startPts,_,this.keepOriginalTimestamps),d.endTime=Or.metadataTsToSeconds(d.endPts,_,this.keepOriginalTimestamps),h.captionStreams[d.stream]=!0,h.captions.push(d);for(b=0;b<this.pendingMetadata.length;b++)p=this.pendingMetadata[b],p.cueTime=Or.metadataTsToSeconds(p.pts,_,this.keepOriginalTimestamps),h.metadata.push(p);for(h.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",h),b=0;b<h.captions.length;b++)d=h.captions[b],this.trigger("caption",d);for(b=0;b<h.metadata.length;b++)p=h.metadata[b],this.trigger("id3Frame",p)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},ai.prototype.setRemux=function(o){this.remuxTracks=o},Rr=function(o){var c=this,h=!0,d,p;Rr.prototype.init.call(this),o=o||{},this.baseMediaDecodeTime=o.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="aac",g.metadataStream=new jt.MetadataStream,g.aacStream=new Tm,g.audioTimestampRolloverStream=new jt.TimestampRolloverStream("audio"),g.timedMetadataTimestampRolloverStream=new jt.TimestampRolloverStream("timed-metadata"),g.adtsStream=new Fl,g.coalesceStream=new ai(o,g.metadataStream),g.headOfPipeline=g.aacStream,g.aacStream.pipe(g.audioTimestampRolloverStream).pipe(g.adtsStream),g.aacStream.pipe(g.timedMetadataTimestampRolloverStream).pipe(g.metadataStream).pipe(g.coalesceStream),g.metadataStream.on("timestamp",function(_){g.aacStream.setTimestamp(_.timeStamp)}),g.aacStream.on("data",function(_){_.type!=="timed-metadata"&&_.type!=="audio"||g.audioSegmentStream||(p=p||{timelineStartInfo:{baseMediaDecodeTime:c.baseMediaDecodeTime},codec:"adts",type:"audio"},g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new bs(p,o),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d}))}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),Hl(this,g)},this.setupTsPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="ts",g.metadataStream=new jt.MetadataStream,g.packetStream=new jt.TransportPacketStream,g.parseStream=new jt.TransportParseStream,g.elementaryStream=new jt.ElementaryStream,g.timestampRolloverStream=new jt.TimestampRolloverStream,g.adtsStream=new Fl,g.h264Stream=new bm,g.captionStream=new jt.CaptionStream(o),g.coalesceStream=new ai(o,g.metadataStream),g.headOfPipeline=g.packetStream,g.packetStream.pipe(g.parseStream).pipe(g.elementaryStream).pipe(g.timestampRolloverStream),g.timestampRolloverStream.pipe(g.h264Stream),g.timestampRolloverStream.pipe(g.adtsStream),g.timestampRolloverStream.pipe(g.metadataStream).pipe(g.coalesceStream),g.h264Stream.pipe(g.captionStream).pipe(g.coalesceStream),g.elementaryStream.on("data",function(_){var b;if(_.type==="metadata"){for(b=_.tracks.length;b--;)!d&&_.tracks[b].type==="video"?(d=_.tracks[b],d.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime):!p&&_.tracks[b].type==="audio"&&(p=_.tracks[b],p.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime);d&&!g.videoSegmentStream&&(g.coalesceStream.numberOfTracks++,g.videoSegmentStream=new Mr(d,o),g.videoSegmentStream.on("log",c.getLogTrigger_("videoSegmentStream")),g.videoSegmentStream.on("timelineStartInfo",function(x){p&&!o.keepOriginalTimestamps&&(p.timelineStartInfo=x,g.audioSegmentStream.setEarliestDts(x.dts-c.baseMediaDecodeTime))}),g.videoSegmentStream.on("processedGopsInfo",c.trigger.bind(c,"gopInfo")),g.videoSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"videoSegmentTimingInfo")),g.videoSegmentStream.on("baseMediaDecodeTime",function(x){p&&g.audioSegmentStream.setVideoBaseMediaDecodeTime(x)}),g.videoSegmentStream.on("timingInfo",c.trigger.bind(c,"videoTimingInfo")),g.h264Stream.pipe(g.videoSegmentStream).pipe(g.coalesceStream)),p&&!g.audioSegmentStream&&(g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new bs(p,o),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.audioSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"audioSegmentTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream)),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d})}}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("id3Frame",function(_){_.dispatchType=g.metadataStream.dispatchType,c.trigger("id3Frame",_)}),g.coalesceStream.on("caption",this.trigger.bind(this,"caption")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),Hl(this,g)},this.setBaseMediaDecodeTime=function(g){var _=this.transmuxPipeline_;o.keepOriginalTimestamps||(this.baseMediaDecodeTime=g),p&&(p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,lt.clearDtsInfo(p),_.audioTimestampRolloverStream&&_.audioTimestampRolloverStream.discontinuity()),d&&(_.videoSegmentStream&&(_.videoSegmentStream.gopCache_=[]),d.timelineStartInfo.dts=void 0,d.timelineStartInfo.pts=void 0,lt.clearDtsInfo(d),_.captionStream.reset()),_.timestampRolloverStream&&_.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(g){p&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(g)},this.setRemux=function(g){var _=this.transmuxPipeline_;o.remux=g,_&&_.coalesceStream&&_.coalesceStream.setRemux(g)},this.alignGopsWith=function(g){d&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(g)},this.getLogTrigger_=function(g){var _=this;return function(b){b.stream=g,_.trigger("log",b)}},this.push=function(g){if(h){var _=xm(g);_&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!_&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),h=!1}this.transmuxPipeline_.headOfPipeline.push(g)},this.flush=function(){h=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Rr.prototype=new Pr;var Em={Transmuxer:Rr},Am=function(o){return o>>>0},wm=function(o){return("00"+o.toString(16)).slice(-2)},Nr={toUnsigned:Am,toHexString:wm},Dm=function(o){var c="";return c+=String.fromCharCode(o[0]),c+=String.fromCharCode(o[1]),c+=String.fromCharCode(o[2]),c+=String.fromCharCode(o[3]),c},$l=Dm,km=Nr.toUnsigned,jm=$l,Gl=function(o,c){var h=[],d,p,g,_,b;if(!c.length)return null;for(d=0;d<o.byteLength;)p=km(o[d]<<24|o[d+1]<<16|o[d+2]<<8|o[d+3]),g=jm(o.subarray(d+4,d+8)),_=p>1?d+p:o.byteLength,g===c[0]&&(c.length===1?h.push(o.subarray(d+8,_)):(b=Gl(o.subarray(d+8,_),c.slice(1)),b.length&&(h=h.concat(b)))),d=_;return h},da=Gl,Im=Nr.toUnsigned,Pm=n.getUint64,Lm=function(o){var c={version:o[0],flags:new Uint8Array(o.subarray(1,4))};return c.version===1?c.baseMediaDecodeTime=Pm(o.subarray(4)):c.baseMediaDecodeTime=Im(o[4]<<24|o[5]<<16|o[6]<<8|o[7]),c},ha=Lm,Om=function(o){var c=new DataView(o.buffer,o.byteOffset,o.byteLength),h={version:o[0],flags:new Uint8Array(o.subarray(1,4)),trackId:c.getUint32(4)},d=h.flags[2]&1,p=h.flags[2]&2,g=h.flags[2]&8,_=h.flags[2]&16,b=h.flags[2]&32,x=h.flags[0]&65536,C=h.flags[0]&131072,D;return D=8,d&&(D+=4,h.baseDataOffset=c.getUint32(12),D+=4),p&&(h.sampleDescriptionIndex=c.getUint32(D),D+=4),g&&(h.defaultSampleDuration=c.getUint32(D),D+=4),_&&(h.defaultSampleSize=c.getUint32(D),D+=4),b&&(h.defaultSampleFlags=c.getUint32(D)),x&&(h.durationIsEmpty=!0),!d&&C&&(h.baseDataOffsetIsMoof=!0),h},Wl=Om,Mm=function(o){return{isLeading:(o[0]&12)>>>2,dependsOn:o[0]&3,isDependedOn:(o[1]&192)>>>6,hasRedundancy:(o[1]&48)>>>4,paddingValue:(o[1]&14)>>>1,isNonSyncSample:o[1]&1,degradationPriority:o[2]<<8|o[3]}},Rm=Mm,Xl=Rm,Nm=function(o){var c={version:o[0],flags:new Uint8Array(o.subarray(1,4)),samples:[]},h=new DataView(o.buffer,o.byteOffset,o.byteLength),d=c.flags[2]&1,p=c.flags[2]&4,g=c.flags[1]&1,_=c.flags[1]&2,b=c.flags[1]&4,x=c.flags[1]&8,C=h.getUint32(4),D=8,M;for(d&&(c.dataOffset=h.getInt32(D),D+=4),p&&C&&(M={flags:Xl(o.subarray(D,D+4))},D+=4,g&&(M.duration=h.getUint32(D),D+=4),_&&(M.size=h.getUint32(D),D+=4),x&&(c.version===1?M.compositionTimeOffset=h.getInt32(D):M.compositionTimeOffset=h.getUint32(D),D+=4),c.samples.push(M),C--);C--;)M={},g&&(M.duration=h.getUint32(D),D+=4),_&&(M.size=h.getUint32(D),D+=4),b&&(M.flags=Xl(o.subarray(D,D+4)),D+=4),x&&(c.version===1?M.compositionTimeOffset=h.getInt32(D):M.compositionTimeOffset=h.getUint32(D),D+=4),c.samples.push(M);return c},Yl=Nm,Kl={tfdt:ha,trun:Yl},Ql={parseTfdt:Kl.tfdt,parseTrun:Kl.trun},Bm=function(o){for(var c=0,h=String.fromCharCode(o[c]),d="";h!=="\0";)d+=h,c++,h=String.fromCharCode(o[c]);return d+=h,d},Fm={uint8ToCString:Bm},Br=Fm.uint8ToCString,Um=n.getUint64,Vm=function(o){var c=4,h=o[0],d,p,g,_,b,x,C,D;if(h===0){d=Br(o.subarray(c)),c+=d.length,p=Br(o.subarray(c)),c+=p.length;var M=new DataView(o.buffer);g=M.getUint32(c),c+=4,b=M.getUint32(c),c+=4,x=M.getUint32(c),c+=4,C=M.getUint32(c),c+=4}else if(h===1){var M=new DataView(o.buffer);g=M.getUint32(c),c+=4,_=Um(o.subarray(c)),c+=8,x=M.getUint32(c),c+=4,C=M.getUint32(c),c+=4,d=Br(o.subarray(c)),c+=d.length,p=Br(o.subarray(c)),c+=p.length}D=new Uint8Array(o.subarray(c,o.byteLength));var H={scheme_id_uri:d,value:p,timescale:g||1,presentation_time:_,presentation_time_delta:b,event_duration:x,id:C,message_data:D};return qm(h,H)?H:void 0},Hm=function(o,c,h,d){return o||o===0?o/c:d+h/c},qm=function(o,c){var h=c.scheme_id_uri!=="\0",d=o===0&&Jl(c.presentation_time_delta)&&h,p=o===1&&Jl(c.presentation_time)&&h;return!(o>1)&&d||p},Jl=function(o){return o!==void 0||o!==null},zm={parseEmsgBox:Vm,scaleTime:Hm},Ts;typeof window<"u"?Ts=window:typeof i<"u"?Ts=i:typeof self<"u"?Ts=self:Ts={};var Zl=Ts,Fr=Nr.toUnsigned,xs=Nr.toHexString,Te=da,Ci=$l,fa=zm,$m=Wl,Gm=Yl,Wm=ha,Xm=n.getUint64,eu,tu,iu,su,ru,pa,nu,ma=Zl,Ym=kl.parseId3Frames;eu=function(o){var c={},h=Te(o,["moov","trak"]);return h.reduce(function(d,p){var g,_,b,x,C;return g=Te(p,["tkhd"])[0],!g||(_=g[0],b=_===0?12:20,x=Fr(g[b]<<24|g[b+1]<<16|g[b+2]<<8|g[b+3]),C=Te(p,["mdia","mdhd"])[0],!C)?null:(_=C[0],b=_===0?12:20,d[x]=Fr(C[b]<<24|C[b+1]<<16|C[b+2]<<8|C[b+3]),d)},c)},tu=function(o,c){var h;h=Te(c,["moof","traf"]);var d=h.reduce(function(p,g){var _=Te(g,["tfhd"])[0],b=Fr(_[4]<<24|_[5]<<16|_[6]<<8|_[7]),x=o[b]||9e4,C=Te(g,["tfdt"])[0],D=new DataView(C.buffer,C.byteOffset,C.byteLength),M;C[0]===1?M=Xm(C.subarray(4,12)):M=D.getUint32(4);let H;return typeof M=="bigint"?H=M/ma.BigInt(x):typeof M=="number"&&!isNaN(M)&&(H=M/x),H<Number.MAX_SAFE_INTEGER&&(H=Number(H)),H<p&&(p=H),p},1/0);return typeof d=="bigint"||isFinite(d)?d:0},iu=function(o,c){var h=Te(c,["moof","traf"]),d=0,p=0,g;if(h&&h.length){var _=Te(h[0],["tfhd"])[0],b=Te(h[0],["trun"])[0],x=Te(h[0],["tfdt"])[0];if(_){var C=$m(_);g=C.trackId}if(x){var D=Wm(x);d=D.baseMediaDecodeTime}if(b){var M=Gm(b);M.samples&&M.samples.length&&(p=M.samples[0].compositionTimeOffset||0)}}var H=o[g]||9e4;typeof d=="bigint"&&(p=ma.BigInt(p),H=ma.BigInt(H));var N=(d+p)/H;return typeof N=="bigint"&&N<Number.MAX_SAFE_INTEGER&&(N=Number(N)),N},su=function(o){var c=Te(o,["moov","trak"]),h=[];return c.forEach(function(d){var p=Te(d,["mdia","hdlr"]),g=Te(d,["tkhd"]);p.forEach(function(_,b){var x=Ci(_.subarray(8,12)),C=g[b],D,M,H;x==="vide"&&(D=new DataView(C.buffer,C.byteOffset,C.byteLength),M=D.getUint8(0),H=M===0?D.getUint32(12):D.getUint32(20),h.push(H))})}),h},pa=function(o){var c=o[0],h=c===0?12:20;return Fr(o[h]<<24|o[h+1]<<16|o[h+2]<<8|o[h+3])},ru=function(o){var c=Te(o,["moov","trak"]),h=[];return c.forEach(function(d){var p={},g=Te(d,["tkhd"])[0],_,b;g&&(_=new DataView(g.buffer,g.byteOffset,g.byteLength),b=_.getUint8(0),p.id=b===0?_.getUint32(12):_.getUint32(20));var x=Te(d,["mdia","hdlr"])[0];if(x){var C=Ci(x.subarray(8,12));C==="vide"?p.type="video":C==="soun"?p.type="audio":p.type=C}var D=Te(d,["mdia","minf","stbl","stsd"])[0];if(D){var M=D.subarray(8);p.codec=Ci(M.subarray(4,8));var H=Te(M,[p.codec])[0],N,$;H&&(/^[asm]vc[1-9]$/i.test(p.codec)?(N=H.subarray(78),$=Ci(N.subarray(4,8)),$==="avcC"&&N.length>11?(p.codec+=".",p.codec+=xs(N[9]),p.codec+=xs(N[10]),p.codec+=xs(N[11])):p.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(p.codec)?(N=H.subarray(28),$=Ci(N.subarray(4,8)),$==="esds"&&N.length>20&&N[19]!==0?(p.codec+="."+xs(N[19]),p.codec+="."+xs(N[20]>>>2&63).replace(/^0/,"")):p.codec="mp4a.40.2"):p.codec=p.codec.toLowerCase())}var K=Te(d,["mdia","mdhd"])[0];K&&(p.timescale=pa(K)),h.push(p)}),h},nu=function(o,c=0){var h=Te(o,["emsg"]);return h.map(d=>{var p=fa.parseEmsgBox(new Uint8Array(d)),g=Ym(p.message_data);return{cueTime:fa.scaleTime(p.presentation_time,p.timescale,p.presentation_time_delta,c),duration:fa.scaleTime(p.event_duration,p.timescale),frames:g}})};var Ss={findBox:Te,parseType:Ci,timescale:eu,startTime:tu,compositionStartTime:iu,videoTrackIds:su,tracks:ru,getTimescaleFromMediaHeader:pa,getEmsgID3:nu};const{parseTrun:Km}=Ql,{findBox:au}=Ss;var ou=Zl,Qm=function(o){var c=au(o,["moof","traf"]),h=au(o,["mdat"]),d=[];return h.forEach(function(p,g){var _=c[g];d.push({mdat:p,traf:_})}),d},Jm=function(o,c,h){var d=c,p=h.defaultSampleDuration||0,g=h.defaultSampleSize||0,_=h.trackId,b=[];return o.forEach(function(x){var C=Km(x),D=C.samples;D.forEach(function(M){M.duration===void 0&&(M.duration=p),M.size===void 0&&(M.size=g),M.trackId=_,M.dts=d,M.compositionTimeOffset===void 0&&(M.compositionTimeOffset=0),typeof d=="bigint"?(M.pts=d+ou.BigInt(M.compositionTimeOffset),d+=ou.BigInt(M.duration)):(M.pts=d+M.compositionTimeOffset,d+=M.duration)}),b=b.concat(D)}),b},lu={getMdatTrafPairs:Qm,parseSamples:Jm},Zm=Cl.discardEmulationPreventionBytes,e0=El.CaptionStream,ga=da,t0=ha,i0=Wl,{getMdatTrafPairs:s0,parseSamples:r0}=lu,n0=function(o,c){for(var h=o,d=0;d<c.length;d++){var p=c[d];if(h<p.size)return p;h-=p.size}return null},a0=function(o,c,h){var d=new DataView(o.buffer,o.byteOffset,o.byteLength),p={logs:[],seiNals:[]},g,_,b,x;for(_=0;_+4<o.length;_+=b)if(b=d.getUint32(_),_+=4,!(b<=0))switch(o[_]&31){case 6:var C=o.subarray(_+1,_+1+b),D=n0(_,c);if(g={nalUnitType:"sei_rbsp",size:b,data:C,escapedRBSP:Zm(C),trackId:h},D)g.pts=D.pts,g.dts=D.dts,x=D;else if(x)g.pts=x.pts,g.dts=x.dts;else{p.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+_+" for trackId "+h+". See mux.js#223."});break}p.seiNals.push(g);break}return p},o0=function(o,c){var h={},d=s0(o);return d.forEach(function(p){var g=p.mdat,_=p.traf,b=ga(_,["tfhd"]),x=i0(b[0]),C=x.trackId,D=ga(_,["tfdt"]),M=D.length>0?t0(D[0]).baseMediaDecodeTime:0,H=ga(_,["trun"]),N,$;c===C&&H.length>0&&(N=r0(H,M,x),$=a0(g,N,C),h[C]||(h[C]={seiNals:[],logs:[]}),h[C].seiNals=h[C].seiNals.concat($.seiNals),h[C].logs=h[C].logs.concat($.logs))}),h},l0=function(o,c,h){var d;if(c===null)return null;d=o0(o,c);var p=d[c]||{};return{seiNals:p.seiNals,logs:p.logs,timescale:h}},u0=function(){var o=!1,c,h,d,p,g,_;this.isInitialized=function(){return o},this.init=function(b){c=new e0,o=!0,_=b?b.isPartial:!1,c.on("data",function(x){x.startTime=x.startPts/p,x.endTime=x.endPts/p,g.captions.push(x),g.captionStreams[x.stream]=!0}),c.on("log",function(x){g.logs.push(x)})},this.isNewInit=function(b,x){return b&&b.length===0||x&&typeof x=="object"&&Object.keys(x).length===0?!1:d!==b[0]||p!==x[d]},this.parse=function(b,x,C){var D;if(this.isInitialized()){if(!x||!C)return null;if(this.isNewInit(x,C))d=x[0],p=C[d];else if(d===null||!p)return h.push(b),null}else return null;for(;h.length>0;){var M=h.shift();this.parse(M,x,C)}return D=l0(b,d,p),D&&D.logs&&(g.logs=g.logs.concat(D.logs)),D===null||!D.seiNals?g.logs.length?{logs:g.logs,captions:[],captionStreams:[]}:null:(this.pushNals(D.seiNals),this.flushStream(),g)},this.pushNals=function(b){if(!this.isInitialized()||!b||b.length===0)return null;b.forEach(function(x){c.push(x)})},this.flushStream=function(){if(!this.isInitialized())return null;_?c.partialFlush():c.flush()},this.clearParsedCaptions=function(){g.captions=[],g.captionStreams={},g.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;c.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){h=[],d=null,p=null,g?this.clearParsedCaptions():g={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},c0=u0;const{parseTfdt:d0}=Ql,Ht=da,{getTimescaleFromMediaHeader:h0}=Ss,{parseSamples:f0,getMdatTrafPairs:p0}=lu;var uu=function(){let o=9e4;this.init=function(c){const h=Ht(c,["moov","trak","mdia","mdhd"])[0];h&&(o=h0(h))},this.parseSegment=function(c){const h=[],d=p0(c);let p=0;return d.forEach(function(g){const _=g.mdat,b=g.traf,x=Ht(b,["tfdt"])[0],C=Ht(b,["tfhd"])[0],D=Ht(b,["trun"]);if(x&&(p=d0(x).baseMediaDecodeTime),D.length&&C){const M=f0(D,p,C);let H=0;M.forEach(function(N){const $="utf-8",K=new TextDecoder($),Ee=_.slice(H,H+N.size);if(Ht(Ee,["vtte"])[0]){H+=N.size;return}Ht(Ee,["vttc"]).forEach(function(Cs){const Es=Ht(Cs,["payl"])[0],As=Ht(Cs,["sttg"])[0],ws=N.pts/o,Hr=(N.pts+N.duration)/o;let he,Ds;if(Es)try{he=K.decode(Es)}catch(ut){console.error(ut)}if(As)try{Ds=K.decode(As)}catch(ut){console.error(ut)}N.duration&&he&&h.push({cueText:he,start:ws,end:Hr,settings:Ds})}),H+=N.size})}}),h}},va=xr,cu=function(o){var c=o[1]&31;return c<<=8,c|=o[2],c},Ur=function(o){return!!(o[1]&64)},Vr=function(o){var c=0;return(o[3]&48)>>>4>1&&(c+=o[4]+1),c},m0=function(o,c){var h=cu(o);return h===0?"pat":h===c?"pmt":c?"pes":null},g0=function(o){var c=Ur(o),h=4+Vr(o);return c&&(h+=o[h]+1),(o[h+10]&31)<<8|o[h+11]},v0=function(o){var c={},h=Ur(o),d=4+Vr(o);if(h&&(d+=o[d]+1),!!(o[d+5]&1)){var p,g,_;p=(o[d+1]&15)<<8|o[d+2],g=3+p-4,_=(o[d+10]&15)<<8|o[d+11];for(var b=12+_;b<g;){var x=d+b;c[(o[x+1]&31)<<8|o[x+2]]=o[x],b+=((o[x+3]&15)<<8|o[x+4])+5}return c}},y0=function(o,c){var h=cu(o),d=c[h];switch(d){case va.H264_STREAM_TYPE:return"video";case va.ADTS_STREAM_TYPE:return"audio";case va.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},_0=function(o){var c=Ur(o);if(!c)return null;var h=4+Vr(o);if(h>=o.byteLength)return null;var d=null,p;return p=o[h+7],p&192&&(d={},d.pts=(o[h+9]&14)<<27|(o[h+10]&255)<<20|(o[h+11]&254)<<12|(o[h+12]&255)<<5|(o[h+13]&254)>>>3,d.pts*=4,d.pts+=(o[h+13]&6)>>>1,d.dts=d.pts,p&64&&(d.dts=(o[h+14]&14)<<27|(o[h+15]&255)<<20|(o[h+16]&254)<<12|(o[h+17]&255)<<5|(o[h+18]&254)>>>3,d.dts*=4,d.dts+=(o[h+18]&6)>>>1)),d},ya=function(o){switch(o){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},b0=function(o){for(var c=4+Vr(o),h=o.subarray(c),d=0,p=0,g=!1,_;p<h.byteLength-3;p++)if(h[p+2]===1){d=p+5;break}for(;d<h.byteLength;)switch(h[d]){case 0:if(h[d-1]!==0){d+=2;break}else if(h[d-2]!==0){d++;break}p+3!==d-2&&(_=ya(h[p+3]&31),_==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0));do d++;while(h[d]!==1&&d<h.length);p=d-2,d+=3;break;case 1:if(h[d-1]!==0||h[d-2]!==0){d+=3;break}_=ya(h[p+3]&31),_==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0),p=d-2,d+=3;break;default:d+=3;break}return h=h.subarray(p),d-=p,p=0,h&&h.byteLength>3&&(_=ya(h[p+3]&31),_==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0)),g},T0={parseType:m0,parsePat:g0,parsePmt:v0,parsePayloadUnitStartIndicator:Ur,parsePesType:y0,parsePesTime:_0,videoPacketContainsKeyFrame:b0},du=xr,Ei=wl.handleRollover,re={};re.ts=T0,re.aac=ca;var oi=de.ONE_SECOND_IN_TS,Re=188,mt=71,x0=function(o,c){for(var h=0,d=Re,p,g;d<o.byteLength;){if(o[h]===mt&&o[d]===mt){switch(p=o.subarray(h,d),g=re.ts.parseType(p,c.pid),g){case"pat":c.pid=re.ts.parsePat(p);break;case"pmt":var _=re.ts.parsePmt(p);c.table=c.table||{},Object.keys(_).forEach(function(b){c.table[b]=_[b]});break}h+=Re,d+=Re;continue}h++,d++}},hu=function(o,c,h){for(var d=0,p=Re,g,_,b,x,C,D=!1;p<=o.byteLength;){if(o[d]===mt&&(o[p]===mt||p===o.byteLength)){switch(g=o.subarray(d,p),_=re.ts.parseType(g,c.pid),_){case"pes":b=re.ts.parsePesType(g,c.table),x=re.ts.parsePayloadUnitStartIndicator(g),b==="audio"&&x&&(C=re.ts.parsePesTime(g),C&&(C.type="audio",h.audio.push(C),D=!0));break}if(D)break;d+=Re,p+=Re;continue}d++,p++}for(p=o.byteLength,d=p-Re,D=!1;d>=0;){if(o[d]===mt&&(o[p]===mt||p===o.byteLength)){switch(g=o.subarray(d,p),_=re.ts.parseType(g,c.pid),_){case"pes":b=re.ts.parsePesType(g,c.table),x=re.ts.parsePayloadUnitStartIndicator(g),b==="audio"&&x&&(C=re.ts.parsePesTime(g),C&&(C.type="audio",h.audio.push(C),D=!0));break}if(D)break;d-=Re,p-=Re;continue}d--,p--}},S0=function(o,c,h){for(var d=0,p=Re,g,_,b,x,C,D,M,H,N=!1,$={data:[],size:0};p<o.byteLength;){if(o[d]===mt&&o[p]===mt){switch(g=o.subarray(d,p),_=re.ts.parseType(g,c.pid),_){case"pes":if(b=re.ts.parsePesType(g,c.table),x=re.ts.parsePayloadUnitStartIndicator(g),b==="video"&&(x&&!N&&(C=re.ts.parsePesTime(g),C&&(C.type="video",h.video.push(C),N=!0)),!h.firstKeyFrame)){if(x&&$.size!==0){for(D=new Uint8Array($.size),M=0;$.data.length;)H=$.data.shift(),D.set(H,M),M+=H.byteLength;if(re.ts.videoPacketContainsKeyFrame(D)){var K=re.ts.parsePesTime(D);K?(h.firstKeyFrame=K,h.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}$.size=0}$.data.push(g),$.size+=g.byteLength}break}if(N&&h.firstKeyFrame)break;d+=Re,p+=Re;continue}d++,p++}for(p=o.byteLength,d=p-Re,N=!1;d>=0;){if(o[d]===mt&&o[p]===mt){switch(g=o.subarray(d,p),_=re.ts.parseType(g,c.pid),_){case"pes":b=re.ts.parsePesType(g,c.table),x=re.ts.parsePayloadUnitStartIndicator(g),b==="video"&&x&&(C=re.ts.parsePesTime(g),C&&(C.type="video",h.video.push(C),N=!0));break}if(N)break;d-=Re,p-=Re;continue}d--,p--}},C0=function(o,c){if(o.audio&&o.audio.length){var h=c;(typeof h>"u"||isNaN(h))&&(h=o.audio[0].dts),o.audio.forEach(function(g){g.dts=Ei(g.dts,h),g.pts=Ei(g.pts,h),g.dtsTime=g.dts/oi,g.ptsTime=g.pts/oi})}if(o.video&&o.video.length){var d=c;if((typeof d>"u"||isNaN(d))&&(d=o.video[0].dts),o.video.forEach(function(g){g.dts=Ei(g.dts,d),g.pts=Ei(g.pts,d),g.dtsTime=g.dts/oi,g.ptsTime=g.pts/oi}),o.firstKeyFrame){var p=o.firstKeyFrame;p.dts=Ei(p.dts,d),p.pts=Ei(p.pts,d),p.dtsTime=p.dts/oi,p.ptsTime=p.pts/oi}}},E0=function(o){for(var c=!1,h=0,d=null,p=null,g=0,_=0,b;o.length-_>=3;){var x=re.aac.parseType(o,_);switch(x){case"timed-metadata":if(o.length-_<10){c=!0;break}if(g=re.aac.parseId3TagSize(o,_),g>o.length){c=!0;break}p===null&&(b=o.subarray(_,_+g),p=re.aac.parseAacTimestamp(b)),_+=g;break;case"audio":if(o.length-_<7){c=!0;break}if(g=re.aac.parseAdtsSize(o,_),g>o.length){c=!0;break}d===null&&(b=o.subarray(_,_+g),d=re.aac.parseSampleRate(b)),h++,_+=g;break;default:_++;break}if(c)return null}if(d===null||p===null)return null;var C=oi/d,D={audio:[{type:"audio",dts:p,pts:p},{type:"audio",dts:p+h*1024*C,pts:p+h*1024*C}]};return D},A0=function(o){var c={pid:null,table:null},h={};x0(o,c);for(var d in c.table)if(c.table.hasOwnProperty(d)){var p=c.table[d];switch(p){case du.H264_STREAM_TYPE:h.video=[],S0(o,c,h),h.video.length===0&&delete h.video;break;case du.ADTS_STREAM_TYPE:h.audio=[],hu(o,c,h),h.audio.length===0&&delete h.audio;break}}return h},w0=function(o,c){var h=re.aac.isLikelyAacData(o),d;return h?d=E0(o):d=A0(o),!d||!d.audio&&!d.video?null:(C0(d,c),d)},D0={inspect:w0,parseAudioPes_:hu};const k0=function(o,c){c.on("data",function(h){const d=h.initSegment;h.initSegment={data:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength};const p=h.data;h.data=p.buffer,o.postMessage({action:"data",segment:h,byteOffset:p.byteOffset,byteLength:p.byteLength},[h.data])}),c.on("done",function(h){o.postMessage({action:"done"})}),c.on("gopInfo",function(h){o.postMessage({action:"gopInfo",gopInfo:h})}),c.on("videoSegmentTimingInfo",function(h){const d={start:{decode:de.videoTsToSeconds(h.start.dts),presentation:de.videoTsToSeconds(h.start.pts)},end:{decode:de.videoTsToSeconds(h.end.dts),presentation:de.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:de.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(d.prependedContentDuration=de.videoTsToSeconds(h.prependedContentDuration)),o.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:d})}),c.on("audioSegmentTimingInfo",function(h){const d={start:{decode:de.videoTsToSeconds(h.start.dts),presentation:de.videoTsToSeconds(h.start.pts)},end:{decode:de.videoTsToSeconds(h.end.dts),presentation:de.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:de.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(d.prependedContentDuration=de.videoTsToSeconds(h.prependedContentDuration)),o.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:d})}),c.on("id3Frame",function(h){o.postMessage({action:"id3Frame",id3Frame:h})}),c.on("caption",function(h){o.postMessage({action:"caption",caption:h})}),c.on("trackinfo",function(h){o.postMessage({action:"trackinfo",trackInfo:h})}),c.on("audioTimingInfo",function(h){o.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:de.videoTsToSeconds(h.start),end:de.videoTsToSeconds(h.end)}})}),c.on("videoTimingInfo",function(h){o.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:de.videoTsToSeconds(h.start),end:de.videoTsToSeconds(h.end)}})}),c.on("log",function(h){o.postMessage({action:"log",log:h})})};class fu{constructor(c,h){this.options=h||{},this.self=c,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Em.Transmuxer(this.options),k0(this.self,this.transmuxer)}pushMp4Captions(c){this.captionParser||(this.captionParser=new c0,this.captionParser.init());const h=new Uint8Array(c.data,c.byteOffset,c.byteLength),d=this.captionParser.parse(h,c.trackIds,c.timescales);this.self.postMessage({action:"mp4Captions",captions:d&&d.captions||[],logs:d&&d.logs||[],data:h.buffer},[h.buffer])}initMp4WebVttParser(c){this.webVttParser||(this.webVttParser=new uu);const h=new Uint8Array(c.data,c.byteOffset,c.byteLength);this.webVttParser.init(h)}getMp4WebVttText(c){this.webVttParser||(this.webVttParser=new uu);const h=new Uint8Array(c.data,c.byteOffset,c.byteLength),d=this.webVttParser.parseSegment(h);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:d||[],data:h.buffer},[h.buffer])}probeMp4StartTime({timescales:c,data:h}){const d=Ss.startTime(c,h);this.self.postMessage({action:"probeMp4StartTime",startTime:d,data:h},[h.buffer])}probeMp4Tracks({data:c}){const h=Ss.tracks(c);this.self.postMessage({action:"probeMp4Tracks",tracks:h,data:c},[c.buffer])}probeEmsgID3({data:c,offset:h}){const d=Ss.getEmsgID3(c,h);this.self.postMessage({action:"probeEmsgID3",id3Frames:d,emsgData:c},[c.buffer])}probeTs({data:c,baseStartTime:h}){const d=typeof h=="number"&&!isNaN(h)?h*de.ONE_SECOND_IN_TS:void 0,p=D0.inspect(c,d);let g=null;p&&(g={hasVideo:p.video&&p.video.length===2||!1,hasAudio:p.audio&&p.audio.length===2||!1},g.hasVideo&&(g.videoStart=p.video[0].ptsTime),g.hasAudio&&(g.audioStart=p.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:g,data:c},[c.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(c){const h=new Uint8Array(c.data,c.byteOffset,c.byteLength);this.transmuxer.push(h)}reset(){this.transmuxer.reset()}setTimestampOffset(c){const h=c.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(de.secondsToVideoTs(h)))}setAudioAppendStart(c){this.transmuxer.setAudioAppendStart(Math.ceil(de.secondsToVideoTs(c.appendStart)))}setRemux(c){this.transmuxer.setRemux(c.remux)}flush(c){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(c){this.transmuxer.alignGopsWith(c.gopsToAlignWith.slice())}}self.onmessage=function(o){if(o.data.action==="init"&&o.data.options){this.messageHandlers=new fu(self,o.data.options);return}this.messageHandlers||(this.messageHandlers=new fu(self)),o.data&&o.data.action&&o.data.action!=="init"&&this.messageHandlers[o.data.action]&&this.messageHandlers[o.data.action](o.data)}}));var o_=Mf(a_);const l_=(i,e,t)=>{const{type:s,initSegment:r,captions:n,captionStreams:a,metadata:l,videoFrameDtsTime:u,videoFramePtsTime:f}=i.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:l});const m=i.data.segment.boxes||{data:i.data.segment.data},v={type:s,data:new Uint8Array(m.data,m.data.byteOffset,m.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof u<"u"&&(v.videoFrameDtsTime=u),typeof f<"u"&&(v.videoFramePtsTime=f),t(v)},u_=({transmuxedData:i,callback:e})=>{i.buffer=[],e(i)},c_=(i,e)=>{e.gopInfo=i.data.gopInfo},Bf=i=>{const{transmuxer:e,bytes:t,audioAppendStart:s,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:l,onAudioTimingInfo:u,onVideoTimingInfo:f,onVideoSegmentTimingInfo:m,onAudioSegmentTimingInfo:v,onId3:T,onCaptions:E,onDone:A,onEndedTimeline:y,onTransmuxerLog:k,isEndOfTimeline:w,segment:I,triggerSegmentEventFn:j}=i,L={buffer:[]};let O=w;const F=U=>{e.currentTransmux===i&&(U.data.action==="data"&&l_(U,L,a),U.data.action==="trackinfo"&&l(U.data.trackInfo),U.data.action==="gopInfo"&&c_(U,L),U.data.action==="audioTimingInfo"&&u(U.data.audioTimingInfo),U.data.action==="videoTimingInfo"&&f(U.data.videoTimingInfo),U.data.action==="videoSegmentTimingInfo"&&m(U.data.videoSegmentTimingInfo),U.data.action==="audioSegmentTimingInfo"&&v(U.data.audioSegmentTimingInfo),U.data.action==="id3Frame"&&T([U.data.id3Frame],U.data.id3Frame.dispatchType),U.data.action==="caption"&&E(U.data.caption),U.data.action==="endedtimeline"&&(O=!1,y()),U.data.action==="log"&&k(U.data.log),U.data.type==="transmuxed"&&(O||(e.onmessage=null,u_({transmuxedData:L,callback:A}),Ff(e))))},B=()=>{const U={message:"Received an error message from the transmuxer worker",metadata:{errorType:P.Error.StreamingFailedToTransmuxSegment,segmentInfo:ci({segment:I})}};A(null,U)};if(e.onmessage=F,e.onerror=B,s&&e.postMessage({action:"setAudioAppendStart",appendStart:s}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const U=t instanceof ArrayBuffer?t:t.buffer,X=t instanceof ArrayBuffer?0:t.byteOffset;j({type:"segmenttransmuxingstart",segment:I}),e.postMessage({action:"push",data:U,byteOffset:X,byteLength:t.byteLength},[U])}w&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Ff=i=>{i.currentTransmux=null,i.transmuxQueue.length&&(i.currentTransmux=i.transmuxQueue.shift(),typeof i.currentTransmux=="function"?i.currentTransmux():Bf(i.currentTransmux))},wc=(i,e)=>{i.postMessage({action:e}),Ff(i)},Uf=(i,e)=>{if(!e.currentTransmux){e.currentTransmux=i,wc(e,i);return}e.transmuxQueue.push(wc.bind(null,e,i))},d_=i=>{Uf("reset",i)},h_=i=>{Uf("endTimeline",i)},Vf=i=>{if(!i.transmuxer.currentTransmux){i.transmuxer.currentTransmux=i,Bf(i);return}i.transmuxer.transmuxQueue.push(i)},f_=i=>{const e=new o_;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:i}),e};var Fa={reset:d_,endTimeline:h_,transmux:Vf,createTransmuxer:f_};const Hi=function(i){const e=i.transmuxer,t=i.endAction||i.action,s=i.callback,r=_e({},i,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,i.byteOffset||0,i.byteLength||a.data.data.byteLength),i.data&&(i.data=a.data.data)),s(a.data))};if(e.addEventListener("message",n),i.data){const a=i.data instanceof ArrayBuffer;r.byteOffset=a?0:i.data.byteOffset,r.byteLength=i.data.byteLength;const l=[a?i.data:i.data.buffer];e.postMessage(r,l)}else e.postMessage(r)},xt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Hf="wvtt",fo=i=>{i.forEach(e=>{e.abort()})},p_=i=>({bandwidth:i.bandwidth,bytesReceived:i.bytesReceived||0,roundTripTime:i.roundTripTime||0}),m_=i=>{const e=i.target,s={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return s.bytesReceived=i.loaded,s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3),s},pl=(i,e)=>{const{requestType:t}=e,s=vi({requestType:t,request:e,error:i});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:xt.TIMEOUT,xhr:e,metadata:s}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:xt.ABORTED,xhr:e,metadata:s}:i?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:xt.FAILURE,xhr:e,metadata:s}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:xt.FAILURE,xhr:e,metadata:s}:null},Dc=(i,e,t,s)=>(r,n)=>{const a=n.response,l=pl(r,n);if(l)return t(l,i);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:xt.FAILURE,xhr:n},i);const u=new DataView(a),f=new Uint32Array([u.getUint32(0),u.getUint32(4),u.getUint32(8),u.getUint32(12)]);for(let v=0;v<e.length;v++)e[v].bytes=f;const m={uri:n.uri};return s({type:"segmentkeyloadcomplete",segment:i,keyInfo:m}),t(null,i)},g_=(i,e)=>{e===Hf&&i.transmuxer.postMessage({action:"initMp4WebVttParser",data:i.map.bytes})},v_=(i,e,t)=>{e===Hf&&Hi({action:"getMp4WebVttText",data:i.bytes,transmuxer:i.transmuxer,callback:({data:s,mp4VttCues:r})=>{i.bytes=s,t(null,i,{mp4VttCues:r})}})},qf=(i,e)=>{const t=No(i.map.bytes);if(t!=="mp4"){const s=i.map.resolvedUri||i.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${s}`,code:xt.FAILURE,metadata:{mediaType:r}})}Hi({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:({tracks:s,data:r})=>(i.map.bytes=r,s.forEach(function(n){i.map.tracks=i.map.tracks||{},!i.map.tracks[n.type]&&(i.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(i.map.timescales=i.map.timescales||{},i.map.timescales[n.id]=n.timescale),n.type==="text"&&g_(i,n.codec))}),e(null))})},y_=({segment:i,finishProcessingFn:e,triggerSegmentEventFn:t})=>(s,r)=>{const n=pl(s,r);if(n)return e(n,i);const a=new Uint8Array(r.response);if(t({type:"segmentloaded",segment:i}),i.map.key)return i.map.encryptedBytes=a,e(null,i);i.map.bytes=a,qf(i,function(l){if(l)return l.xhr=r,l.status=r.status,e(l,i);e(null,i)})},__=({segment:i,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:s})=>(r,n)=>{const a=pl(r,n);if(a)return e(a,i);s({type:"segmentloaded",segment:i});const l=t==="arraybuffer"||!n.responseText?n.response:r_(n.responseText.substring(i.lastReachedChar||0));return i.stats=p_(n),i.key?i.encryptedBytes=new Uint8Array(l):i.bytes=new Uint8Array(l),e(null,i)},b_=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m,doneFn:v,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{const A=i.map&&i.map.tracks||{},y=!!(A.audio&&A.video);let k=s.bind(null,i,"audio","start");const w=s.bind(null,i,"audio","end");let I=s.bind(null,i,"video","start");const j=s.bind(null,i,"video","end"),L=()=>Vf({bytes:e,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:y,onData:O=>{O.type=O.type==="combined"?"video":O.type,m(i,O)},onTrackInfo:O=>{t&&(y&&(O.isMuxed=!0),t(i,O))},onAudioTimingInfo:O=>{k&&typeof O.start<"u"&&(k(O.start),k=null),w&&typeof O.end<"u"&&w(O.end)},onVideoTimingInfo:O=>{I&&typeof O.start<"u"&&(I(O.start),I=null),j&&typeof O.end<"u"&&j(O.end)},onVideoSegmentTimingInfo:O=>{const F={pts:{start:O.start.presentation,end:O.end.presentation},dts:{start:O.start.decode,end:O.end.decode}};E({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:F}),r(O)},onAudioSegmentTimingInfo:O=>{const F={pts:{start:O.start.pts,end:O.end.pts},dts:{start:O.start.dts,end:O.end.dts}};E({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:F}),n(O)},onId3:(O,F)=>{a(i,O,F)},onCaptions:O=>{l(i,[O])},isEndOfTimeline:u,onEndedTimeline:()=>{f()},onTransmuxerLog:T,onDone:(O,F)=>{v&&(O.type=O.type==="combined"?"video":O.type,E({type:"segmenttransmuxingcomplete",segment:i}),v(F,i,O))},segment:i,triggerSegmentEventFn:E});Hi({action:"probeTs",transmuxer:i.transmuxer,data:e,baseStartTime:i.baseStartTime,callback:O=>{i.bytes=e=O.data;const F=O.result;F&&(t(i,{hasAudio:F.hasAudio,hasVideo:F.hasVideo,isMuxed:y}),t=null),L()}})},zf=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m,doneFn:v,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{let A=new Uint8Array(e);if(H2(A)){i.isFmp4=!0;const{tracks:y}=i.map;if(y.text&&(!y.audio||!y.video)){m(i,{data:A,type:"text"}),v_(i,y.text.codec,v);return}const w={isFmp4:!0,hasVideo:!!y.video,hasAudio:!!y.audio};y.audio&&y.audio.codec&&y.audio.codec!=="enca"&&(w.audioCodec=y.audio.codec),y.video&&y.video.codec&&y.video.codec!=="encv"&&(w.videoCodec=y.video.codec),y.video&&y.audio&&(w.isMuxed=!0),t(i,w);const I=(j,L)=>{m(i,{data:A,type:w.hasAudio&&!w.isMuxed?"audio":"video"}),L&&L.length&&a(i,L),j&&j.length&&l(i,j),v(null,i,{})};Hi({action:"probeMp4StartTime",timescales:i.map.timescales,data:A,transmuxer:i.transmuxer,callback:({data:j,startTime:L})=>{e=j.buffer,i.bytes=A=j,w.hasAudio&&!w.isMuxed&&s(i,"audio","start",L),w.hasVideo&&s(i,"video","start",L),Hi({action:"probeEmsgID3",data:A,transmuxer:i.transmuxer,offset:L,callback:({emsgData:O,id3Frames:F})=>{if(e=O.buffer,i.bytes=A=O,!y.video||!O.byteLength||!i.transmuxer){I(void 0,F);return}Hi({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:A,timescales:i.map.timescales,trackIds:[y.video.id],callback:B=>{e=B.data.buffer,i.bytes=A=B.data,B.logs.forEach(function(U){T(ie(U,{stream:"mp4CaptionParser"}))}),I(B.captions,F)}})}})}});return}if(!i.transmuxer){v(null,i,{});return}if(typeof i.container>"u"&&(i.container=No(A)),i.container!=="ts"&&i.container!=="aac"){t(i,{hasAudio:!1,hasVideo:!1}),v(null,i,{});return}b_({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m,doneFn:v,onTransmuxerLog:T,triggerSegmentEventFn:E})},$f=function({id:i,key:e,encryptedBytes:t,decryptionWorker:s,segment:r,doneFn:n},a){const l=f=>{if(f.data.source===i){s.removeEventListener("message",l);const m=f.data.decrypted;a(new Uint8Array(m.bytes,m.byteOffset,m.byteLength))}};s.onerror=()=>{const f="An error occurred in the decryption worker",m=ci({segment:r}),v={message:f,metadata:{error:new Error(f),errorType:P.Error.StreamingFailedToDecryptSegment,segmentInfo:m,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};n(v,r)},s.addEventListener("message",l);let u;e.bytes.slice?u=e.bytes.slice():u=new Uint32Array(Array.prototype.slice.call(e.bytes)),s.postMessage(kf({source:i,encrypted:t,key:u,iv:e.iv}),[t.buffer,u.buffer])},T_=({decryptionWorker:i,segment:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m,doneFn:v,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{E({type:"segmentdecryptionstart"}),$f({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:i,segment:e,doneFn:v},A=>{e.bytes=A,E({type:"segmentdecryptioncomplete",segment:e}),zf({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m,doneFn:v,onTransmuxerLog:T,triggerSegmentEventFn:E})})},x_=({activeXhrs:i,decryptionWorker:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m,doneFn:v,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{let A=0,y=!1;return(k,w)=>{if(!y){if(k)return y=!0,fo(i),v(k,w);if(A+=1,A===i.length){const I=function(){if(w.encryptedBytes)return T_({decryptionWorker:e,segment:w,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m,doneFn:v,onTransmuxerLog:T,triggerSegmentEventFn:E});zf({segment:w,bytes:w.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m,doneFn:v,onTransmuxerLog:T,triggerSegmentEventFn:E})};if(w.endOfAllRequests=Date.now(),w.map&&w.map.encryptedBytes&&!w.map.bytes)return E({type:"segmentdecryptionstart",segment:w}),$f({decryptionWorker:e,id:w.requestId+"-init",encryptedBytes:w.map.encryptedBytes,key:w.map.key,segment:w,doneFn:v},j=>{w.map.bytes=j,E({type:"segmentdecryptioncomplete",segment:w}),qf(w,L=>{if(L)return fo(i),v(L,w);I()})});I()}}}},S_=({loadendState:i,abortFn:e})=>t=>{t.target.aborted&&e&&!i.calledAbortFn&&(e(),i.calledAbortFn=!0)},C_=({segment:i,progressFn:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m})=>v=>{if(!v.target.aborted)return i.stats=ie(i.stats,m_(v)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),e(v,i)},E_=({xhr:i,xhrOptions:e,decryptionWorker:t,segment:s,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:v,isEndOfTimeline:T,endedTimelineFn:E,dataFn:A,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:w})=>{const I=[],j=x_({activeXhrs:I,decryptionWorker:t,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:v,isEndOfTimeline:T,endedTimelineFn:E,dataFn:A,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:w});if(s.key&&!s.key.bytes){const U=[s.key];s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&U.push(s.map.key);const X=ie(e,{uri:s.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),ae=Dc(s,U,j,w),J={uri:s.key.resolvedUri};w({type:"segmentkeyloadstart",segment:s,keyInfo:J});const le=i(X,ae);I.push(le)}if(s.map&&!s.map.bytes){if(s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri)){const le=ie(e,{uri:s.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),z=Dc(s,[s.map.key],j,w),Z={uri:s.map.key.resolvedUri};w({type:"segmentkeyloadstart",segment:s,keyInfo:Z});const Me=i(le,z);I.push(Me)}const X=ie(e,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:co(s.map),requestType:"segment-media-initialization"}),ae=y_({segment:s,finishProcessingFn:j,triggerSegmentEventFn:w});w({type:"segmentloadstart",segment:s});const J=i(X,ae);I.push(J)}const L=ie(e,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:co(s),requestType:"segment"}),O=__({segment:s,finishProcessingFn:j,responseType:L.responseType,triggerSegmentEventFn:w});w({type:"segmentloadstart",segment:s});const F=i(L,O);F.addEventListener("progress",C_({segment:s,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:v,isEndOfTimeline:T,endedTimelineFn:E,dataFn:A})),I.push(F);const B={};return I.forEach(U=>{U.addEventListener("loadend",S_({loadendState:B,abortFn:r}))}),()=>fo(I)},Xr=at("PlaylistSelector"),kc=function(i){if(!i||!i.playlist)return;const e=i.playlist;return JSON.stringify({id:e.id,bandwidth:i.bandwidth,width:i.width,height:i.height,codecs:e.attributes&&e.attributes.CODECS||""})},qi=function(i,e){if(!i)return"";const t=S.getComputedStyle(i);return t?t[e]:""},zi=function(i,e){const t=i.slice();i.sort(function(s,r){const n=e(s,r);return n===0?t.indexOf(s)-t.indexOf(r):n})},ml=function(i,e){let t,s;return i.attributes.BANDWIDTH&&(t=i.attributes.BANDWIDTH),t=t||S.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(s=e.attributes.BANDWIDTH),s=s||S.Number.MAX_VALUE,t-s},A_=function(i,e){let t,s;return i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(t=i.attributes.RESOLUTION.width),t=t||S.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(s=e.attributes.RESOLUTION.width),s=s||S.Number.MAX_VALUE,t===s&&i.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?i.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-s};let Gf=function(i){const{main:e,bandwidth:t,playerWidth:s,playerHeight:r,playerObjectFit:n,limitRenditionByPlayerDimensions:a,playlistController:l}=i;if(!e)return;const u={bandwidth:t,width:s,height:r,limitRenditionByPlayerDimensions:a};let f=e.playlists;Ge.isAudioOnly(e)&&(f=l.getAudioTrackPlaylists_(),u.audioOnly=!0);let m=f.map(B=>{let U;const X=B.attributes&&B.attributes.RESOLUTION&&B.attributes.RESOLUTION.width,ae=B.attributes&&B.attributes.RESOLUTION&&B.attributes.RESOLUTION.height;return U=B.attributes&&B.attributes.BANDWIDTH,U=U||S.Number.MAX_VALUE,{bandwidth:U,width:X,height:ae,playlist:B}});zi(m,(B,U)=>B.bandwidth-U.bandwidth),m=m.filter(B=>!Ge.isIncompatible(B.playlist));let v=m.filter(B=>Ge.isEnabled(B.playlist));v.length||(v=m.filter(B=>!Ge.isDisabled(B.playlist)));const T=v.filter(B=>B.bandwidth*Ae.BANDWIDTH_VARIANCE<t);let E=T[T.length-1];const A=T.filter(B=>B.bandwidth===E.bandwidth)[0];if(a===!1){const B=A||v[0]||m[0];if(B&&B.playlist){let U="sortedPlaylistReps";return A&&(U="bandwidthBestRep"),v[0]&&(U="enabledPlaylistReps"),Xr(`choosing ${kc(B)} using ${U} with options`,u),B.playlist}return Xr("could not choose a playlist with options",u),null}const y=T.filter(B=>B.width&&B.height);zi(y,(B,U)=>B.width-U.width);const k=y.filter(B=>B.width===s&&B.height===r);E=k[k.length-1];const w=k.filter(B=>B.bandwidth===E.bandwidth)[0];let I,j,L;w||(I=y.filter(B=>n==="cover"?B.width>s&&B.height>r:B.width>s||B.height>r),j=I.filter(B=>B.width===I[0].width&&B.height===I[0].height),E=j[j.length-1],L=j.filter(B=>B.bandwidth===E.bandwidth)[0]);let O;if(l.leastPixelDiffSelector){const B=y.map(U=>(U.pixelDiff=Math.abs(U.width-s)+Math.abs(U.height-r),U));zi(B,(U,X)=>U.pixelDiff===X.pixelDiff?X.bandwidth-U.bandwidth:U.pixelDiff-X.pixelDiff),O=B[0]}const F=O||L||w||A||v[0]||m[0];if(F&&F.playlist){let B="sortedPlaylistReps";return O?B="leastPixelDiffRep":L?B="resolutionPlusOneRep":w?B="resolutionBestRep":A?B="bandwidthBestRep":v[0]&&(B="enabledPlaylistReps"),Xr(`choosing ${kc(F)} using ${B} with options`,u),F.playlist}return Xr("could not choose a playlist with options",u),null};const jc=function(){let i=this.useDevicePixelRatio&&S.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),Gf({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(qi(this.tech_.el(),"width"),10)*i,playerHeight:parseInt(qi(this.tech_.el(),"height"),10)*i,playerObjectFit:this.usePlayerObjectFit?qi(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},w_=function(i){let e=-1,t=-1;if(i<0||i>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let s=this.useDevicePixelRatio&&S.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=i*this.systemBandwidth+(1-i)*e,t=this.systemBandwidth),Gf({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(qi(this.tech_.el(),"width"),10)*s,playerHeight:parseInt(qi(this.tech_.el(),"height"),10)*s,playerObjectFit:this.usePlayerObjectFit?qi(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},D_=function(i){const{main:e,currentTime:t,bandwidth:s,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:l,syncController:u}=i,f=e.playlists.filter(A=>!Ge.isIncompatible(A));let m=f.filter(Ge.isEnabled);m.length||(m=f.filter(A=>!Ge.isDisabled(A)));const T=m.filter(Ge.hasAttribute.bind(null,"BANDWIDTH")).map(A=>{const k=u.getSyncPoint(A,r,l,t)?1:2,I=Ge.estimateSegmentRequestTime(n,s,A)*k-a;return{playlist:A,rebufferingImpact:I}}),E=T.filter(A=>A.rebufferingImpact<=0);return zi(E,(A,y)=>ml(y.playlist,A.playlist)),E.length?E[0]:(zi(T,(A,y)=>A.rebufferingImpact-y.rebufferingImpact),T[0]||null)},k_=function(){const i=this.playlists.main.playlists.filter(Ge.isEnabled);return zi(i,(t,s)=>ml(t,s)),i.filter(t=>!!Xs(this.playlists.main,t).video)[0]||null},j_=i=>{let e=0,t;return i.bytes&&(t=new Uint8Array(i.bytes),i.segments.forEach(s=>{t.set(s,e),e+=s.byteLength})),t};function Wf(i){try{return new URL(i).pathname.split("/").slice(-2).join("/")}catch{return""}}const I_=function(i,e,t){if(!i[t]){e.trigger({type:"usage",name:"vhs-608"});let s=t;/^cc708_/.test(t)&&(s="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(s);if(r)i[t]=r;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,l=t,u=!1;const f=n[s];f&&(a=f.label,l=f.language,u=f.default),i[t]=e.addRemoteTextTrack({kind:"captions",id:s,default:u,label:a,language:l},!1).track}}},P_=function({inbandTextTracks:i,captionArray:e,timestampOffset:t}){if(!e)return;const s=S.WebKitDataCue||S.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const l=new s(r.startTime+t,r.endTime+t,a.text);l.line=a.line,l.align="left",l.position=a.position,l.positionAlign="line-left",i[n].addCue(l)}):i[n].addCue(new s(r.startTime+t,r.endTime+t,r.text))})},L_=function(i){Object.defineProperties(i.frame,{id:{get(){return P.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key}},value:{get(){return P.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data}},privateData:{get(){return P.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data}}})},O_=({inbandTextTracks:i,metadataArray:e,timestampOffset:t,videoDuration:s})=>{if(!e)return;const r=S.WebKitDataCue||S.VTTCue,n=i.metadataTrack_;if(!n||(e.forEach(m=>{const v=m.cueTime+t;typeof v!="number"||S.isNaN(v)||v<0||!(v<1/0)||!m.frames||!m.frames.length||m.frames.forEach(T=>{const E=new r(v,v,T.value||T.url||T.data||"");E.frame=T,E.value=T,L_(E),n.addCue(E)})}),!n.cues||!n.cues.length))return;const a=n.cues,l=[];for(let m=0;m<a.length;m++)a[m]&&l.push(a[m]);const u=l.reduce((m,v)=>{const T=m[v.startTime]||[];return T.push(v),m[v.startTime]=T,m},{}),f=Object.keys(u).sort((m,v)=>Number(m)-Number(v));f.forEach((m,v)=>{const T=u[m],E=isFinite(s)?s:m,A=Number(f[v+1])||E;T.forEach(y=>{y.endTime=A})})},M_={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},R_=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),N_=({inbandTextTracks:i,dateRanges:e})=>{const t=i.metadataTrack_;if(!t)return;const s=S.WebKitDataCue||S.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(R_.has(n))continue;const a=new s(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:M_[n],data:r[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},Ic=(i,e,t)=>{i.metadataTrack_||(i.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,P.browser.IS_ANY_SAFARI||(i.metadataTrack_.inBandMetadataTrackDispatchType=e))},Vs=function(i,e,t){let s,r;if(t&&t.cues)for(s=t.cues.length;s--;)r=t.cues[s],r.startTime>=i&&r.endTime<=e&&t.removeCue(r)},B_=function(i){const e=i.cues;if(!e)return;const t={};for(let s=e.length-1;s>=0;s--){const r=e[s],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?i.removeCue(r):t[n]=r}},F_=(i,e,t)=>{if(typeof e>"u"||e===null||!i.length)return[];const s=Math.ceil((e-t+3)*di.ONE_SECOND_IN_TS);let r;for(r=0;r<i.length&&!(i[r].pts>s);r++);return i.slice(r)},U_=(i,e,t)=>{if(!e.length)return i;if(t)return e.slice();const s=e[0].pts;let r=0;for(r;r<i.length&&!(i[r].pts>=s);r++);return i.slice(0,r).concat(e)},V_=(i,e,t,s)=>{const r=Math.ceil((e-s)*di.ONE_SECOND_IN_TS),n=Math.ceil((t-s)*di.ONE_SECOND_IN_TS),a=i.slice();let l=i.length;for(;l--&&!(i[l].pts<=n););if(l===-1)return a;let u=l+1;for(;u--&&!(i[u].pts<=r););return u=Math.max(u,0),a.splice(u,l-u+1),a},H_=function(i,e){if(!i&&!e||!i&&e||i&&!e)return!1;if(i===e)return!0;const t=Object.keys(i).sort(),s=Object.keys(e).sort();if(t.length!==s.length)return!1;for(let r=0;r<t.length;r++){const n=t[r];if(n!==s[r]||i[n]!==e[n])return!1}return!0},q_=function(i,e,t){e=e||[];const s=[];let r=0;for(let n=0;n<e.length;n++){const a=e[n];if(i===a.timeline&&(s.push(n),r+=a.duration,r>t))return n}return s.length===0?0:s[s.length-1]},Ms=1,z_=500,Pc=i=>typeof i=="number"&&isFinite(i),Yr=1/60,$_=(i,e,t)=>i!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,G_=(i,e,t)=>{let s=e-Ae.BACK_BUFFER_LENGTH;i.length&&(s=Math.max(s,i.start(0)));const r=e-t;return Math.min(r,s)},Pi=i=>{const{startOfSegment:e,duration:t,segment:s,part:r,playlist:{mediaSequence:n,id:a,segments:l=[]},mediaIndex:u,partIndex:f,timeline:m}=i,v=l.length-1;let T="mediaIndex/partIndex increment";i.getMediaInfoForTime?T=`getMediaInfoForTime (${i.getMediaInfoForTime})`:i.isSyncRequest&&(T="getSyncSegmentCandidate (isSyncRequest)"),i.independent&&(T+=` with independent ${i.independent}`);const E=typeof f=="number",A=i.segment.uri?"segment":"pre-segment",y=E?df({preloadSegment:s})-1:0;return`${A} [${n+u}/${n+v}]`+(E?` part [${f}/${y}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(E?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${m}] selected by [${T}] playlist [${a}]`},Lc=i=>`${i}TimingInfo`,W_=({segmentTimeline:i,currentTimeline:e,startOfSegment:t,buffered:s,overrideCheck:r})=>!r&&i===e?null:i<e?t:s.length?s.end(s.length-1):t,po=({timelineChangeController:i,currentTimeline:e,segmentTimeline:t,loaderType:s,audioDisabled:r})=>{if(e===t)return!1;if(s==="audio"){const n=i.lastTimelineChange({type:"main"});return!n||n.to!==t}if(s==="main"&&r){const n=i.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},X_=i=>{if(!i)return!1;const e=i.pendingTimelineChange({type:"audio"}),t=i.pendingTimelineChange({type:"main"}),s=e&&t,r=s&&e.to!==t.to;return!!(s&&e.from!==-1&&t.from!==-1&&r)},Y_=i=>{const e=i.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=i.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},Wt=i=>{const e=i.pendingSegment_;if(!e)return;if(po({timelineChangeController:i.timelineChangeController_,currentTimeline:i.currentTimeline_,segmentTimeline:e.timeline,loaderType:i.loaderType_,audioDisabled:i.audioDisabled_})&&X_(i.timelineChangeController_)){if(Y_(i)){i.timelineChangeController_.trigger("audioTimelineBehind");return}i.timelineChangeController_.trigger("fixBadTimelineChange")}},K_=i=>{let e=0;return["video","audio"].forEach(function(t){const s=i[`${t}TimingInfo`];if(!s)return;const{start:r,end:n}=s;let a;typeof r=="bigint"||typeof n=="bigint"?a=S.BigInt(n)-S.BigInt(r):typeof r=="number"&&typeof n=="number"&&(a=n-r),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),e},Oc=({segmentDuration:i,maxDuration:e})=>i?Math.round(i)>e+bt:!1,Q_=(i,e)=>{if(e!=="hls")return null;const t=K_({audioTimingInfo:i.audioTimingInfo,videoTimingInfo:i.videoTimingInfo});if(!t)return null;const s=i.playlist.targetDuration,r=Oc({segmentDuration:t,maxDuration:s*2}),n=Oc({segmentDuration:t,maxDuration:s}),a=`Segment with index ${i.mediaIndex} from playlist ${i.playlist.id} has a duration of ${t} when the reported duration is ${i.duration} and the target duration is ${s}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||n?{severity:r?"warn":"info",message:a}:null},ci=({type:i,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),s=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:i||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:t,isMediaInitialization:s}};class mo extends P.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=at(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(s){s!==this.state_&&(this.logger_(`${this.state_} -> ${s}`),this.state_=s,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wt(this)}),this.sourceUpdater_.on("codecschange",s=>{this.trigger(_e({type:"codecschange"},s))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wt(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",s=>{this.trigger(_e({type:"timelinechange"},s)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Wt(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wt(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return Fa.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&S.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null),this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,S.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&Fa.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return De();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:s,isMuxed:r}=e;if(s&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(s)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const s=Sn(e);let r=this.initSegments_[s];return t&&!r&&e.bytes&&(this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const s=jf(e);let r=this.keyCache_[s];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[s]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;const s=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(s&&(s.id?n=s.id:s.uri&&(n=s.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:
204
+ `),this.pushCaption(c),c.startPts=o},ue.prototype.pushCaption=function(o){o.text!==""&&(this.trigger("data",{startPts:o.startPts,endPts:o.endPts,text:o.text,stream:"cc708_"+o.serviceNum}),o.text="",o.startPts=o.endPts)},ue.prototype.displayWindows=function(o,c){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<<g&&(c.windows[g].visible=1);return o},ue.prototype.hideWindows=function(o,c){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<<g&&(c.windows[g].visible=0);return o},ue.prototype.toggleWindows=function(o,c){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<<g&&(c.windows[g].visible^=1);return o},ue.prototype.clearWindows=function(o,c){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<<g&&c.windows[g].clearText();return o},ue.prototype.deleteWindows=function(o,c){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<<g&&c.windows[g].reset();return o},ue.prototype.setPenAttributes=function(o,c){var h=this.current708Packet.data,d=h[o],p=c.currentWindow.penAttr;return d=h[++o],p.textTag=(d&240)>>4,p.offset=(d&12)>>2,p.penSize=d&3,d=h[++o],p.italics=(d&128)>>7,p.underline=(d&64)>>6,p.edgeType=(d&56)>>3,p.fontStyle=d&7,o},ue.prototype.setPenColor=function(o,c){var h=this.current708Packet.data,d=h[o],p=c.currentWindow.penColor;return d=h[++o],p.fgOpacity=(d&192)>>6,p.fgRed=(d&48)>>4,p.fgGreen=(d&12)>>2,p.fgBlue=d&3,d=h[++o],p.bgOpacity=(d&192)>>6,p.bgRed=(d&48)>>4,p.bgGreen=(d&12)>>2,p.bgBlue=d&3,d=h[++o],p.edgeRed=(d&48)>>4,p.edgeGreen=(d&12)>>2,p.edgeBlue=d&3,o},ue.prototype.setPenLocation=function(o,c){var h=this.current708Packet.data,d=h[o],p=c.currentWindow.penLoc;return c.currentWindow.pendingNewLine=!0,d=h[++o],p.row=d&15,d=h[++o],p.column=d&63,o},ue.prototype.reset=function(o,c){var h=this.getPts(o);return this.flushDisplayed(h,c),this.initService(c.serviceNum,o)};var Bp={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},_r=function(o){return o===null?"":(o=Bp[o]||o,String.fromCharCode(o))},br=14,Fp=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],ni=function(){for(var o=[],c=br+1;c--;)o.push({text:"",indent:0,offset:0});return o},fe=function(o,c){fe.prototype.init.call(this),this.field_=o||0,this.dataChannel_=c||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(h){var d,p,g,_,b;if(d=h.ccData&32639,d===this.lastControlCode_){this.lastControlCode_=null;return}if((d&61440)===4096?this.lastControlCode_=d:d!==this.PADDING_&&(this.lastControlCode_=null),g=d>>>8,_=d&255,d!==this.PADDING_)if(d===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(d===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(h.pts),this.flushDisplayed(h.pts),p=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=p,this.startPts_=h.pts;else if(d===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(h.pts);else if(d===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(h.pts);else if(d===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(h.pts);else if(d===this.CARRIAGE_RETURN_)this.clearFormatting(h.pts),this.flushDisplayed(h.pts),this.shiftRowsUp_(),this.startPts_=h.pts;else if(d===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(d===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(h.pts),this.displayed_=ni();else if(d===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=ni();else if(d===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(h.pts),this.displayed_=ni()),this.mode_="paintOn",this.startPts_=h.pts;else if(this.isSpecialCharacter(g,_))g=(g&3)<<8,b=_r(g|_),this[this.mode_](h.pts,b),this.column_++;else if(this.isExtCharacter(g,_))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),g=(g&3)<<8,b=_r(g|_),this[this.mode_](h.pts,b),this.column_++;else if(this.isMidRowCode(g,_))this.clearFormatting(h.pts),this[this.mode_](h.pts," "),this.column_++,(_&14)===14&&this.addFormatting(h.pts,["i"]),(_&1)===1&&this.addFormatting(h.pts,["u"]);else if(this.isOffsetControlCode(g,_)){const C=_&3;this.nonDisplayed_[this.row_].offset=C,this.column_+=C}else if(this.isPAC(g,_)){var x=Fp.indexOf(d&7968);if(this.mode_==="rollUp"&&(x-this.rollUpRows_+1<0&&(x=this.rollUpRows_-1),this.setRollUp(h.pts,x)),x!==this.row_&&x>=0&&x<=14&&(this.clearFormatting(h.pts),this.row_=x),_&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(h.pts,["u"]),(d&16)===16){const C=(d&14)>>1;this.column_=C*4,this.nonDisplayed_[this.row_].indent+=C}this.isColorPAC(_)&&(_&14)===14&&this.addFormatting(h.pts,["i"])}else this.isNormalChar(g)&&(_===0&&(_=null),b=_r(g),b+=_r(_),this[this.mode_](h.pts,b),this.column_+=b.length)}};fe.prototype=new ta,fe.prototype.flushDisplayed=function(o){const c=d=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+d+"."})},h=[];this.displayed_.forEach((d,p)=>{if(d&&d.text&&d.text.length){try{d.text=d.text.trim()}catch{c(p)}d.text.length&&h.push({text:d.text,line:p+1,position:10+Math.min(70,d.indent*10)+d.offset*2.5})}else d==null&&c(p)}),h.length&&this.trigger("data",{startPts:this.startPts_,endPts:o,content:h,stream:this.name_})},fe.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=ni(),this.nonDisplayed_=ni(),this.lastControlCode_=null,this.column_=0,this.row_=br,this.rollUpRows_=2,this.formatting_=[]},fe.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},fe.prototype.isSpecialCharacter=function(o,c){return o===this.EXT_&&c>=48&&c<=63},fe.prototype.isExtCharacter=function(o,c){return(o===this.EXT_+1||o===this.EXT_+2)&&c>=32&&c<=63},fe.prototype.isMidRowCode=function(o,c){return o===this.EXT_&&c>=32&&c<=47},fe.prototype.isOffsetControlCode=function(o,c){return o===this.OFFSET_&&c>=33&&c<=35},fe.prototype.isPAC=function(o,c){return o>=this.BASE_&&o<this.BASE_+8&&c>=64&&c<=127},fe.prototype.isColorPAC=function(o){return o>=64&&o<=79||o>=96&&o<=127},fe.prototype.isNormalChar=function(o){return o>=32&&o<=127},fe.prototype.setRollUp=function(o,c){if(this.mode_!=="rollUp"&&(this.row_=br,this.mode_="rollUp",this.flushDisplayed(o),this.nonDisplayed_=ni(),this.displayed_=ni()),c!==void 0&&c!==this.row_)for(var h=0;h<this.rollUpRows_;h++)this.displayed_[c-h]=this.displayed_[this.row_-h],this.displayed_[this.row_-h]={text:"",indent:0,offset:0};c===void 0&&(c=this.row_),this.topRow_=c-this.rollUpRows_+1},fe.prototype.addFormatting=function(o,c){this.formatting_=this.formatting_.concat(c);var h=c.reduce(function(d,p){return d+"<"+p+">"},"");this[this.mode_](o,h)},fe.prototype.clearFormatting=function(o){if(this.formatting_.length){var c=this.formatting_.reverse().reduce(function(h,d){return h+"</"+d+">"},"");this.formatting_=[],this[this.mode_](o,c)}},fe.prototype.popOn=function(o,c){var h=this.nonDisplayed_[this.row_].text;h+=c,this.nonDisplayed_[this.row_].text=h},fe.prototype.rollUp=function(o,c){var h=this.displayed_[this.row_].text;h+=c,this.displayed_[this.row_].text=h},fe.prototype.shiftRowsUp_=function(){var o;for(o=0;o<this.topRow_;o++)this.displayed_[o]={text:"",indent:0,offset:0};for(o=this.row_+1;o<br+1;o++)this.displayed_[o]={text:"",indent:0,offset:0};for(o=this.topRow_;o<this.row_;o++)this.displayed_[o]=this.displayed_[o+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},fe.prototype.paintOn=function(o,c){var h=this.displayed_[this.row_].text;h+=c,this.displayed_[this.row_].text=h};var Sl={CaptionStream:qe,Cea608Stream:fe,Cea708Stream:ue},Tr={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Up=t,Vp=8589934592,Hp=4294967296,Cl="shared",ia=function(o,c){var h=1;for(o>c&&(h=-1);Math.abs(c-o)>Hp;)o+=h*Vp;return o},sa=function(o){var c,h;sa.prototype.init.call(this),this.type_=o||Cl,this.push=function(d){if(d.type==="metadata"){this.trigger("data",d);return}this.type_!==Cl&&d.type!==this.type_||(h===void 0&&(h=d.dts),d.dts=ia(d.dts,h),d.pts=ia(d.pts,h),c=d.dts,this.trigger("data",d))},this.flush=function(){h=c,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){h=void 0,c=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};sa.prototype=new Up;var El={TimestampRolloverStream:sa,handleRollover:ia},qp=(o,c,h)=>{if(!o)return-1;for(var d=h;d<o.length;d++)if(o[d]===c)return d;return-1},zp={typedArrayIndexOf:qp},xr=zp.typedArrayIndexOf,Sr={Utf8:3},Al=function(o,c,h){var d,p="";for(d=c;d<h;d++)p+="%"+("00"+o[d].toString(16)).slice(-2);return p},fs=function(o,c,h){return decodeURIComponent(Al(o,c,h))},ps=function(o,c,h){return unescape(Al(o,c,h))},ms=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},gs={APIC:function(o){var c=1,h,d,p="-->";o.data[0]===Sr.Utf8&&(h=xr(o.data,0,c),!(h<0)&&(o.mimeType=ps(o.data,c,h),c=h+1,o.pictureType=o.data[c],c++,d=xr(o.data,0,c),!(d<0)&&(o.description=fs(o.data,c,d),c=d+1,o.mimeType===p?o.url=ps(o.data,c,o.data.length):o.pictureData=o.data.subarray(c,o.data.length))))},"T*":function(o){o.data[0]===Sr.Utf8&&(o.value=fs(o.data,1,o.data.length).replace(/\0*$/,""),o.values=o.value.split("\0"))},TXXX:function(o){var c;o.data[0]===Sr.Utf8&&(c=xr(o.data,0,1),c!==-1&&(o.description=fs(o.data,1,c),o.value=fs(o.data,c+1,o.data.length).replace(/\0*$/,""),o.data=o.value))},"W*":function(o){o.url=ps(o.data,0,o.data.length).replace(/\0.*$/,"")},WXXX:function(o){var c;o.data[0]===Sr.Utf8&&(c=xr(o.data,0,1),c!==-1&&(o.description=fs(o.data,1,c),o.url=ps(o.data,c+1,o.data.length).replace(/\0.*$/,"")))},PRIV:function(o){var c;for(c=0;c<o.data.length;c++)if(o.data[c]===0){o.owner=ps(o.data,0,c);break}o.privateData=o.data.subarray(c+1),o.data=o.privateData}},$p=function(o){var c,h,d=10,p=0,g=[];if(!(o.length<10||o[0]!==73||o[1]!==68||o[2]!==51)){p=ms(o.subarray(6,10)),p+=10;var _=o[5]&64;_&&(d+=4,d+=ms(o.subarray(10,14)),p-=ms(o.subarray(16,20)));do{if(c=ms(o.subarray(d+4,d+8)),c<1)break;h=String.fromCharCode(o[d],o[d+1],o[d+2],o[d+3]);var b={id:h,data:o.subarray(d+10,d+c+10)};b.key=b.id,gs[b.id]?gs[b.id](b):b.id[0]==="T"?gs["T*"](b):b.id[0]==="W"&&gs["W*"](b),g.push(b),d+=10,d+=c}while(d<p);return g}},wl={parseId3Frames:$p,parseSyncSafeInteger:ms,frameParsers:gs},Gp=t,Wp=Tr,Vt=wl,Cr;Cr=function(o){var c={descriptor:o&&o.descriptor},h=0,d=[],p=0,g;if(Cr.prototype.init.call(this),this.dispatchType=Wp.METADATA_STREAM_TYPE.toString(16),c.descriptor)for(g=0;g<c.descriptor.length;g++)this.dispatchType+=("00"+c.descriptor[g].toString(16)).slice(-2);this.push=function(_){var b,x,C,D,M,H;if(_.type==="timed-metadata"){if(_.dataAlignmentIndicator&&(p=0,d.length=0),d.length===0&&(_.data.length<10||_.data[0]!==73||_.data[1]!==68||_.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(d.push(_),p+=_.data.byteLength,d.length===1&&(h=Vt.parseSyncSafeInteger(_.data.subarray(6,10)),h+=10),!(p<h)){for(b={data:new Uint8Array(h),frames:[],pts:d[0].pts,dts:d[0].dts},M=0;M<h;)b.data.set(d[0].data.subarray(0,h-M),M),M+=d[0].data.byteLength,p-=d[0].data.byteLength,d.shift();x=10,b.data[5]&64&&(x+=4,x+=Vt.parseSyncSafeInteger(b.data.subarray(10,14)),h-=Vt.parseSyncSafeInteger(b.data.subarray(16,20)));do{if(C=Vt.parseSyncSafeInteger(b.data.subarray(x+4,x+8)),C<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(H=String.fromCharCode(b.data[x],b.data[x+1],b.data[x+2],b.data[x+3]),D={id:H,data:b.data.subarray(x+10,x+C+10)},D.key=D.id,Vt.frameParsers[D.id]?Vt.frameParsers[D.id](D):D.id[0]==="T"?Vt.frameParsers["T*"](D):D.id[0]==="W"&&Vt.frameParsers["W*"](D),D.owner==="com.apple.streaming.transportStreamTimestamp"){var N=D.data,$=(N[3]&1)<<30|N[4]<<22|N[5]<<14|N[6]<<6|N[7]>>>2;$*=4,$+=N[7]&3,D.timeStamp=$,b.pts===void 0&&b.dts===void 0&&(b.pts=D.timeStamp,b.dts=D.timeStamp),this.trigger("timestamp",D)}b.frames.push(D),x+=10,x+=C}while(x<h);this.trigger("data",b)}}}},Cr.prototype=new Gp;var Xp=Cr,ra=t,na=Sl,lt=Tr,Yp=El.TimestampRolloverStream,Er,vs,Ar,Si=188,aa=71;Er=function(){var o=new Uint8Array(Si),c=0;Er.prototype.init.call(this),this.push=function(h){var d=0,p=Si,g;for(c?(g=new Uint8Array(h.byteLength+c),g.set(o.subarray(0,c)),g.set(h,c),c=0):g=h;p<g.byteLength;){if(g[d]===aa&&g[p]===aa){this.trigger("data",g.subarray(d,p)),d+=Si,p+=Si;continue}d++,p++}d<g.byteLength&&(o.set(g.subarray(d),0),c=g.byteLength-d)},this.flush=function(){c===Si&&o[0]===aa&&(this.trigger("data",o),c=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){c=0,this.trigger("reset")}},Er.prototype=new ra,vs=function(){var o,c,h,d;vs.prototype.init.call(this),d=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,o=function(p,g){var _=0;g.payloadUnitStartIndicator&&(_+=p[_]+1),g.type==="pat"?c(p.subarray(_),g):h(p.subarray(_),g)},c=function(p,g){g.section_number=p[7],g.last_section_number=p[8],d.pmtPid=(p[10]&31)<<8|p[11],g.pmtPid=d.pmtPid},h=function(p,g){var _,b,x,C;if(p[5]&1){for(d.programMapTable={video:null,audio:null,"timed-metadata":{}},_=(p[1]&15)<<8|p[2],b=3+_-4,x=(p[10]&15)<<8|p[11],C=12+x;C<b;){var D=p[C],M=(p[C+1]&31)<<8|p[C+2];D===lt.H264_STREAM_TYPE&&d.programMapTable.video===null?d.programMapTable.video=M:D===lt.ADTS_STREAM_TYPE&&d.programMapTable.audio===null?d.programMapTable.audio=M:D===lt.METADATA_STREAM_TYPE&&(d.programMapTable["timed-metadata"][M]=D),C+=((p[C+3]&15)<<8|p[C+4])+5}g.programMapTable=d.programMapTable}},this.push=function(p){var g={},_=4;if(g.payloadUnitStartIndicator=!!(p[1]&64),g.pid=p[1]&31,g.pid<<=8,g.pid|=p[2],(p[3]&48)>>>4>1&&(_+=p[_]+1),g.pid===0)g.type="pat",o(p.subarray(_),g),this.trigger("data",g);else if(g.pid===this.pmtPid)for(g.type="pmt",o(p.subarray(_),g),this.trigger("data",g);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([p,_,g]):this.processPes_(p,_,g)},this.processPes_=function(p,g,_){_.pid===this.programMapTable.video?_.streamType=lt.H264_STREAM_TYPE:_.pid===this.programMapTable.audio?_.streamType=lt.ADTS_STREAM_TYPE:_.streamType=this.programMapTable["timed-metadata"][_.pid],_.type="pes",_.data=p.subarray(g),this.trigger("data",_)}},vs.prototype=new ra,vs.STREAM_TYPES={h264:27,adts:15},Ar=function(){var o=this,c=!1,h={data:[],size:0},d={data:[],size:0},p={data:[],size:0},g,_=function(x,C){var D;const M=x[0]<<16|x[1]<<8|x[2];C.data=new Uint8Array,M===1&&(C.packetLength=6+(x[4]<<8|x[5]),C.dataAlignmentIndicator=(x[6]&4)!==0,D=x[7],D&192&&(C.pts=(x[9]&14)<<27|(x[10]&255)<<20|(x[11]&254)<<12|(x[12]&255)<<5|(x[13]&254)>>>3,C.pts*=4,C.pts+=(x[13]&6)>>>1,C.dts=C.pts,D&64&&(C.dts=(x[14]&14)<<27|(x[15]&255)<<20|(x[16]&254)<<12|(x[17]&255)<<5|(x[18]&254)>>>3,C.dts*=4,C.dts+=(x[18]&6)>>>1)),C.data=x.subarray(9+x[8]))},b=function(x,C,D){var M=new Uint8Array(x.size),H={type:C},N=0,$=0,K=!1,Ae;if(!(!x.data.length||x.size<9)){for(H.trackId=x.data[0].pid,N=0;N<x.data.length;N++)Ae=x.data[N],M.set(Ae.data,$),$+=Ae.data.byteLength;_(M,H),K=C==="video"||H.packetLength<=x.size,(D||K)&&(x.size=0,x.data.length=0),K&&o.trigger("data",H)}};Ar.prototype.init.call(this),this.push=function(x){({pat:function(){},pes:function(){var C,D;switch(x.streamType){case lt.H264_STREAM_TYPE:C=h,D="video";break;case lt.ADTS_STREAM_TYPE:C=d,D="audio";break;case lt.METADATA_STREAM_TYPE:C=p,D="timed-metadata";break;default:return}x.payloadUnitStartIndicator&&b(C,D,!0),C.data.push(x),C.size+=x.data.byteLength},pmt:function(){var C={type:"metadata",tracks:[]};g=x.programMapTable,g.video!==null&&C.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.video,codec:"avc",type:"video"}),g.audio!==null&&C.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.audio,codec:"adts",type:"audio"}),c=!0,o.trigger("data",C)}})[x.type]()},this.reset=function(){h.size=0,h.data.length=0,d.size=0,d.data.length=0,this.trigger("reset")},this.flushStreams_=function(){b(h,"video"),b(d,"audio"),b(p,"timed-metadata")},this.flush=function(){if(!c&&g){var x={type:"metadata",tracks:[]};g.video!==null&&x.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.video,codec:"avc",type:"video"}),g.audio!==null&&x.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.audio,codec:"adts",type:"audio"}),o.trigger("data",x)}c=!1,this.flushStreams_(),this.trigger("done")}},Ar.prototype=new ra;var Dl={PAT_PID:0,MP2T_PACKET_LENGTH:Si,TransportPacketStream:Er,TransportParseStream:vs,ElementaryStream:Ar,TimestampRolloverStream:Yp,CaptionStream:na.CaptionStream,Cea608Stream:na.Cea608Stream,Cea708Stream:na.Cea708Stream,MetadataStream:Xp};for(var oa in lt)lt.hasOwnProperty(oa)&&(Dl[oa]=lt[oa]);var Kp=Dl,Qp=t,Jp=de.ONE_SECOND_IN_TS,wr,kl=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];wr=function(o){var c,h=0;wr.prototype.init.call(this),this.skipWarn_=function(d,p){this.trigger("log",{level:"warn",message:`adts skiping bytes ${d} to ${p} in frame ${h} outside syncword`})},this.push=function(d){var p=0,g,_,b,x,C;if(o||(h=0),d.type==="audio"){c&&c.length?(b=c,c=new Uint8Array(b.byteLength+d.data.byteLength),c.set(b),c.set(d.data,b.byteLength)):c=d.data;for(var D;p+7<c.length;){if(c[p]!==255||(c[p+1]&246)!==240){typeof D!="number"&&(D=p),p++;continue}if(typeof D=="number"&&(this.skipWarn_(D,p),D=null),_=(~c[p+1]&1)*2,g=(c[p+3]&3)<<11|c[p+4]<<3|(c[p+5]&224)>>5,x=((c[p+6]&3)+1)*1024,C=x*Jp/kl[(c[p+2]&60)>>>2],c.byteLength-p<g)break;this.trigger("data",{pts:d.pts+h*C,dts:d.dts+h*C,sampleCount:x,audioobjecttype:(c[p+2]>>>6&3)+1,channelcount:(c[p+2]&1)<<2|(c[p+3]&192)>>>6,samplerate:kl[(c[p+2]&60)>>>2],samplingfrequencyindex:(c[p+2]&60)>>>2,samplesize:16,data:c.subarray(p+7+_,p+g)}),h++,p+=g}typeof D=="number"&&(this.skipWarn_(D,p),D=null),c=c.subarray(p)}},this.flush=function(){h=0,this.trigger("done")},this.reset=function(){c=void 0,this.trigger("reset")},this.endTimeline=function(){c=void 0,this.trigger("endedtimeline")}},wr.prototype=new Qp;var Zp=wr,jl;jl=function(o){var c=o.byteLength,h=0,d=0;this.length=function(){return 8*c},this.bitsAvailable=function(){return 8*c+d},this.loadWord=function(){var p=o.byteLength-c,g=new Uint8Array(4),_=Math.min(4,c);if(_===0)throw new Error("no bytes available");g.set(o.subarray(p,p+_)),h=new DataView(g.buffer).getUint32(0),d=_*8,c-=_},this.skipBits=function(p){var g;d>p?(h<<=p,d-=p):(p-=d,g=Math.floor(p/8),p-=g*8,c-=g,this.loadWord(),h<<=p,d-=p)},this.readBits=function(p){var g=Math.min(d,p),_=h>>>32-g;return d-=g,d>0?h<<=g:c>0&&this.loadWord(),g=p-g,g>0?_<<g|this.readBits(g):_},this.skipLeadingZeros=function(){var p;for(p=0;p<d;++p)if(h&2147483648>>>p)return h<<=p,d-=p,p;return this.loadWord(),p+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var p=this.skipLeadingZeros();return this.readBits(p+1)-1},this.readExpGolomb=function(){var p=this.readUnsignedExpGolomb();return 1&p?1+p>>>1:-1*(p>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var em=jl,Il=t,tm=em,Dr,kr,Pl;kr=function(){var o=0,c,h;kr.prototype.init.call(this),this.push=function(d){var p;h?(p=new Uint8Array(h.byteLength+d.data.byteLength),p.set(h),p.set(d.data,h.byteLength),h=p):h=d.data;for(var g=h.byteLength;o<g-3;o++)if(h[o+2]===1){c=o+5;break}for(;c<g;)switch(h[c]){case 0:if(h[c-1]!==0){c+=2;break}else if(h[c-2]!==0){c++;break}o+3!==c-2&&this.trigger("data",h.subarray(o+3,c-2));do c++;while(h[c]!==1&&c<g);o=c-2,c+=3;break;case 1:if(h[c-1]!==0||h[c-2]!==0){c+=3;break}this.trigger("data",h.subarray(o+3,c-2)),o=c-2,c+=3;break;default:c+=3;break}h=h.subarray(o),c-=o,o=0},this.reset=function(){h=null,o=0,this.trigger("reset")},this.flush=function(){h&&h.byteLength>3&&this.trigger("data",h.subarray(o+3)),h=null,o=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},kr.prototype=new Il,Pl={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Dr=function(){var o=new kr,c,h,d,p,g,_,b;Dr.prototype.init.call(this),c=this,this.push=function(x){x.type==="video"&&(h=x.trackId,d=x.pts,p=x.dts,o.push(x))},o.on("data",function(x){var C={trackId:h,pts:d,dts:p,data:x,nalUnitTypeCode:x[0]&31};switch(C.nalUnitTypeCode){case 5:C.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:C.nalUnitType="sei_rbsp",C.escapedRBSP=g(x.subarray(1));break;case 7:C.nalUnitType="seq_parameter_set_rbsp",C.escapedRBSP=g(x.subarray(1)),C.config=_(C.escapedRBSP);break;case 8:C.nalUnitType="pic_parameter_set_rbsp";break;case 9:C.nalUnitType="access_unit_delimiter_rbsp";break}c.trigger("data",C)}),o.on("done",function(){c.trigger("done")}),o.on("partialdone",function(){c.trigger("partialdone")}),o.on("reset",function(){c.trigger("reset")}),o.on("endedtimeline",function(){c.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},b=function(x,C){var D=8,M=8,H,N;for(H=0;H<x;H++)M!==0&&(N=C.readExpGolomb(),M=(D+N+256)%256),D=M===0?D:M},g=function(x){for(var C=x.byteLength,D=[],M=1,H,N;M<C-2;)x[M]===0&&x[M+1]===0&&x[M+2]===3?(D.push(M+2),M+=2):M++;if(D.length===0)return x;H=C-D.length,N=new Uint8Array(H);var $=0;for(M=0;M<H;$++,M++)$===D[0]&&($++,D.shift()),N[M]=x[$];return N},_=function(x){var C=0,D=0,M=0,H=0,N,$,K,Ae,Qe,qt,Cs,Es,As,ws,Vr,he=[1,1],Ds,ct;if(N=new tm(x),$=N.readUnsignedByte(),Ae=N.readUnsignedByte(),K=N.readUnsignedByte(),N.skipUnsignedExpGolomb(),Pl[$]&&(Qe=N.readUnsignedExpGolomb(),Qe===3&&N.skipBits(1),N.skipUnsignedExpGolomb(),N.skipUnsignedExpGolomb(),N.skipBits(1),N.readBoolean()))for(Vr=Qe!==3?8:12,ct=0;ct<Vr;ct++)N.readBoolean()&&(ct<6?b(16,N):b(64,N));if(N.skipUnsignedExpGolomb(),qt=N.readUnsignedExpGolomb(),qt===0)N.readUnsignedExpGolomb();else if(qt===1)for(N.skipBits(1),N.skipExpGolomb(),N.skipExpGolomb(),Cs=N.readUnsignedExpGolomb(),ct=0;ct<Cs;ct++)N.skipExpGolomb();if(N.skipUnsignedExpGolomb(),N.skipBits(1),Es=N.readUnsignedExpGolomb(),As=N.readUnsignedExpGolomb(),ws=N.readBits(1),ws===0&&N.skipBits(1),N.skipBits(1),N.readBoolean()&&(C=N.readUnsignedExpGolomb(),D=N.readUnsignedExpGolomb(),M=N.readUnsignedExpGolomb(),H=N.readUnsignedExpGolomb()),N.readBoolean()&&N.readBoolean()){switch(Ds=N.readUnsignedByte(),Ds){case 1:he=[1,1];break;case 2:he=[12,11];break;case 3:he=[10,11];break;case 4:he=[16,11];break;case 5:he=[40,33];break;case 6:he=[24,11];break;case 7:he=[20,11];break;case 8:he=[32,11];break;case 9:he=[80,33];break;case 10:he=[18,11];break;case 11:he=[15,11];break;case 12:he=[64,33];break;case 13:he=[160,99];break;case 14:he=[4,3];break;case 15:he=[3,2];break;case 16:he=[2,1];break;case 255:{he=[N.readUnsignedByte()<<8|N.readUnsignedByte(),N.readUnsignedByte()<<8|N.readUnsignedByte()];break}}he&&he[0]/he[1]}return{profileIdc:$,levelIdc:K,profileCompatibility:Ae,width:(Es+1)*16-C*2-D*2,height:(2-ws)*(As+1)*16-M*2-H*2,sarRatio:he}}},Dr.prototype=new Il;var im={H264Stream:Dr},sm=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Ll=function(o,c){var h=o[c+6]<<21|o[c+7]<<14|o[c+8]<<7|o[c+9],d=o[c+5],p=(d&16)>>4;return h=h>=0?h:0,p?h+20:h+10},Ol=function(o,c){return o.length-c<10||o[c]!==73||o[c+1]!==68||o[c+2]!==51?c:(c+=Ll(o,c),Ol(o,c))},rm=function(o){var c=Ol(o,0);return o.length>=c+2&&(o[c]&255)===255&&(o[c+1]&240)===240&&(o[c+1]&22)===16},Ml=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},nm=function(o,c,h){var d,p="";for(d=c;d<h;d++)p+="%"+("00"+o[d].toString(16)).slice(-2);return p},am=function(o,c,h){return unescape(nm(o,c,h))},om=function(o,c){var h=(o[c+5]&224)>>5,d=o[c+4]<<3,p=o[c+3]&6144;return p|d|h},lm=function(o,c){return o[c]===73&&o[c+1]===68&&o[c+2]===51?"timed-metadata":o[c]&!0&&(o[c+1]&240)===240?"audio":null},um=function(o){for(var c=0;c+5<o.length;){if(o[c]!==255||(o[c+1]&246)!==240){c++;continue}return sm[(o[c+2]&60)>>>2]}return null},cm=function(o){var c,h,d,p;c=10,o[5]&64&&(c+=4,c+=Ml(o.subarray(10,14)));do{if(h=Ml(o.subarray(c+4,c+8)),h<1)return null;if(p=String.fromCharCode(o[c],o[c+1],o[c+2],o[c+3]),p==="PRIV"){d=o.subarray(c+10,c+h+10);for(var g=0;g<d.byteLength;g++)if(d[g]===0){var _=am(d,0,g);if(_==="com.apple.streaming.transportStreamTimestamp"){var b=d.subarray(g+1),x=(b[3]&1)<<30|b[4]<<22|b[5]<<14|b[6]<<6|b[7]>>>2;return x*=4,x+=b[7]&3,x}break}}c+=10,c+=h}while(c<o.byteLength);return null},la={isLikelyAacData:rm,parseId3TagSize:Ll,parseAdtsSize:om,parseType:lm,parseSampleRate:um,parseAacTimestamp:cm},dm=t,Rl=la,jr;jr=function(){var o=new Uint8Array,c=0;jr.prototype.init.call(this),this.setTimestamp=function(h){c=h},this.push=function(h){var d=0,p=0,g,_,b,x;for(o.length?(x=o.length,o=new Uint8Array(h.byteLength+x),o.set(o.subarray(0,x)),o.set(h,x)):o=h;o.length-p>=3;){if(o[p]===73&&o[p+1]===68&&o[p+2]===51){if(o.length-p<10||(d=Rl.parseId3TagSize(o,p),p+d>o.length))break;_={type:"timed-metadata",data:o.subarray(p,p+d)},this.trigger("data",_),p+=d;continue}else if((o[p]&255)===255&&(o[p+1]&240)===240){if(o.length-p<7||(d=Rl.parseAdtsSize(o,p),p+d>o.length))break;b={type:"audio",data:o.subarray(p,p+d),pts:c,dts:c},this.trigger("data",b),p+=d;continue}p++}g=o.length-p,g>0?o=o.subarray(p):o=new Uint8Array},this.reset=function(){o=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){o=new Uint8Array,this.trigger("endedtimeline")}},jr.prototype=new dm;var hm=jr,fm=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],pm=fm,mm=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],gm=mm,Ir=t,ys=op,_s=gp,Pr=Ep,ut=jp,jt=Kp,Lr=de,Nl=Zp,vm=im.H264Stream,ym=hm,_m=la.isLikelyAacData,bm=de.ONE_SECOND_IN_TS,Bl=pm,Fl=gm,Or,bs,Mr,ai,Tm=function(o,c){c.stream=o,this.trigger("log",c)},Ul=function(o,c){for(var h=Object.keys(c),d=0;d<h.length;d++){var p=h[d];p==="headOfPipeline"||!c[p].on||c[p].on("log",Tm.bind(o,p))}},Vl=function(o,c){var h;if(o.length!==c.length)return!1;for(h=0;h<o.length;h++)if(o[h]!==c[h])return!1;return!0},Hl=function(o,c,h,d,p,g){var _=h-c,b=d-c,x=p-h;return{start:{dts:o,pts:o+_},end:{dts:o+b,pts:o+x},prependedContentDuration:g,baseMediaDecodeTime:o}};bs=function(o,c){var h=[],d,p=0,g=0,_=1/0;c=c||{},d=c.firstSequenceNumber||0,bs.prototype.init.call(this),this.push=function(b){ut.collectDtsInfo(o,b),o&&Bl.forEach(function(x){o[x]=b[x]}),h.push(b)},this.setEarliestDts=function(b){p=b},this.setVideoBaseMediaDecodeTime=function(b){_=b},this.setAudioAppendStart=function(b){g=b},this.flush=function(){var b,x,C,D,M,H,N;if(h.length===0){this.trigger("done","AudioSegmentStream");return}b=Pr.trimAdtsFramesByEarliestDts(h,o,p),o.baseMediaDecodeTime=ut.calculateTrackBaseMediaDecodeTime(o,c.keepOriginalTimestamps),N=Pr.prefixWithSilence(o,b,g,_),o.samples=Pr.generateSampleTable(b),C=ys.mdat(Pr.concatenateFrameData(b)),h=[],x=ys.moof(d,[o]),D=new Uint8Array(x.byteLength+C.byteLength),d++,D.set(x),D.set(C,x.byteLength),ut.clearDtsInfo(o),M=Math.ceil(bm*1024/o.samplerate),b.length&&(H=b.length*M,this.trigger("segmentTimingInfo",Hl(Lr.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),b[0].dts,b[0].pts,b[0].dts+H,b[0].pts+H,N||0)),this.trigger("timingInfo",{start:b[0].pts,end:b[0].pts+H})),this.trigger("data",{track:o,boxes:D}),this.trigger("done","AudioSegmentStream")},this.reset=function(){ut.clearDtsInfo(o),h=[],this.trigger("reset")}},bs.prototype=new Ir,Or=function(o,c){var h,d=[],p=[],g,_;c=c||{},h=c.firstSequenceNumber||0,Or.prototype.init.call(this),delete o.minPTS,this.gopCache_=[],this.push=function(b){ut.collectDtsInfo(o,b),b.nalUnitType==="seq_parameter_set_rbsp"&&!g&&(g=b.config,o.sps=[b.data],Fl.forEach(function(x){o[x]=g[x]},this)),b.nalUnitType==="pic_parameter_set_rbsp"&&!_&&(_=b.data,o.pps=[b.data]),d.push(b)},this.flush=function(){for(var b,x,C,D,M,H,N=0,$,K;d.length&&d[0].nalUnitType!=="access_unit_delimiter_rbsp";)d.shift();if(d.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(b=_s.groupNalsIntoFrames(d),C=_s.groupFramesIntoGops(b),C[0][0].keyFrame||(x=this.getGopForFusion_(d[0],o),x?(N=x.duration,C.unshift(x),C.byteLength+=x.byteLength,C.nalCount+=x.nalCount,C.pts=x.pts,C.dts=x.dts,C.duration+=x.duration):C=_s.extendFirstKeyFrame(C)),p.length){var Ae;if(c.alignGopsAtEnd?Ae=this.alignGopsAtEnd_(C):Ae=this.alignGopsAtStart_(C),!Ae){this.gopCache_.unshift({gop:C.pop(),pps:o.pps,sps:o.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),d=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}ut.clearDtsInfo(o),C=Ae}ut.collectDtsInfo(o,C),o.samples=_s.generateSampleTable(C),M=ys.mdat(_s.concatenateNalData(C)),o.baseMediaDecodeTime=ut.calculateTrackBaseMediaDecodeTime(o,c.keepOriginalTimestamps),this.trigger("processedGopsInfo",C.map(function(Qe){return{pts:Qe.pts,dts:Qe.dts,byteLength:Qe.byteLength}})),$=C[0],K=C[C.length-1],this.trigger("segmentTimingInfo",Hl(o.baseMediaDecodeTime,$.dts,$.pts,K.dts+K.duration,K.pts+K.duration,N)),this.trigger("timingInfo",{start:C[0].pts,end:C[C.length-1].pts+C[C.length-1].duration}),this.gopCache_.unshift({gop:C.pop(),pps:o.pps,sps:o.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),d=[],this.trigger("baseMediaDecodeTime",o.baseMediaDecodeTime),this.trigger("timelineStartInfo",o.timelineStartInfo),D=ys.moof(h,[o]),H=new Uint8Array(D.byteLength+M.byteLength),h++,H.set(D),H.set(M,D.byteLength),this.trigger("data",{track:o,boxes:H}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),d=[],this.gopCache_.length=0,p.length=0,this.trigger("reset")},this.resetStream_=function(){ut.clearDtsInfo(o),g=void 0,_=void 0},this.getGopForFusion_=function(b){var x=45e3,C=1/0,D,M,H,N,$;for($=0;$<this.gopCache_.length;$++)N=this.gopCache_[$],H=N.gop,!(!(o.pps&&Vl(o.pps[0],N.pps[0]))||!(o.sps&&Vl(o.sps[0],N.sps[0])))&&(H.dts<o.timelineStartInfo.dts||(D=b.dts-H.dts-H.duration,D>=-1e4&&D<=x&&(!M||C>D)&&(M=N,C=D)));return M?M.gop:null},this.alignGopsAtStart_=function(b){var x,C,D,M,H,N,$,K;for(H=b.byteLength,N=b.nalCount,$=b.duration,x=C=0;x<p.length&&C<b.length&&(D=p[x],M=b[C],D.pts!==M.pts);){if(M.pts>D.pts){x++;continue}C++,H-=M.byteLength,N-=M.nalCount,$-=M.duration}return C===0?b:C===b.length?null:(K=b.slice(C),K.byteLength=H,K.duration=$,K.nalCount=N,K.pts=K[0].pts,K.dts=K[0].dts,K)},this.alignGopsAtEnd_=function(b){var x,C,D,M,H,N;for(x=p.length-1,C=b.length-1,H=null,N=!1;x>=0&&C>=0;){if(D=p[x],M=b[C],D.pts===M.pts){N=!0;break}if(D.pts>M.pts){x--;continue}x===p.length-1&&(H=C),C--}if(!N&&H===null)return null;var $;if(N?$=C:$=H,$===0)return b;var K=b.slice($),Ae=K.reduce(function(Qe,qt){return Qe.byteLength+=qt.byteLength,Qe.duration+=qt.duration,Qe.nalCount+=qt.nalCount,Qe},{byteLength:0,duration:0,nalCount:0});return K.byteLength=Ae.byteLength,K.duration=Ae.duration,K.nalCount=Ae.nalCount,K.pts=K[0].pts,K.dts=K[0].dts,K},this.alignGopsWith=function(b){p=b}},Or.prototype=new Ir,ai=function(o,c){this.numberOfTracks=0,this.metadataStream=c,o=o||{},typeof o.remux<"u"?this.remuxTracks=!!o.remux:this.remuxTracks=!0,typeof o.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=o.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,ai.prototype.init.call(this),this.push=function(h){if(h.content||h.text)return this.pendingCaptions.push(h);if(h.frames)return this.pendingMetadata.push(h);this.pendingTracks.push(h.track),this.pendingBytes+=h.boxes.byteLength,h.track.type==="video"&&(this.videoTrack=h.track,this.pendingBoxes.push(h.boxes)),h.track.type==="audio"&&(this.audioTrack=h.track,this.pendingBoxes.unshift(h.boxes))}},ai.prototype=new Ir,ai.prototype.flush=function(o){var c=0,h={captions:[],captionStreams:{},metadata:[],info:{}},d,p,g,_=0,b;if(this.pendingTracks.length<this.numberOfTracks){if(o!=="VideoSegmentStream"&&o!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(_=this.videoTrack.timelineStartInfo.pts,Fl.forEach(function(x){h.info[x]=this.videoTrack[x]},this)):this.audioTrack&&(_=this.audioTrack.timelineStartInfo.pts,Bl.forEach(function(x){h.info[x]=this.audioTrack[x]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?h.type=this.pendingTracks[0].type:h.type="combined",this.emittedTracks+=this.pendingTracks.length,g=ys.initSegment(this.pendingTracks),h.initSegment=new Uint8Array(g.byteLength),h.initSegment.set(g),h.data=new Uint8Array(this.pendingBytes),b=0;b<this.pendingBoxes.length;b++)h.data.set(this.pendingBoxes[b],c),c+=this.pendingBoxes[b].byteLength;for(b=0;b<this.pendingCaptions.length;b++)d=this.pendingCaptions[b],d.startTime=Lr.metadataTsToSeconds(d.startPts,_,this.keepOriginalTimestamps),d.endTime=Lr.metadataTsToSeconds(d.endPts,_,this.keepOriginalTimestamps),h.captionStreams[d.stream]=!0,h.captions.push(d);for(b=0;b<this.pendingMetadata.length;b++)p=this.pendingMetadata[b],p.cueTime=Lr.metadataTsToSeconds(p.pts,_,this.keepOriginalTimestamps),h.metadata.push(p);for(h.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",h),b=0;b<h.captions.length;b++)d=h.captions[b],this.trigger("caption",d);for(b=0;b<h.metadata.length;b++)p=h.metadata[b],this.trigger("id3Frame",p)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},ai.prototype.setRemux=function(o){this.remuxTracks=o},Mr=function(o){var c=this,h=!0,d,p;Mr.prototype.init.call(this),o=o||{},this.baseMediaDecodeTime=o.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="aac",g.metadataStream=new jt.MetadataStream,g.aacStream=new ym,g.audioTimestampRolloverStream=new jt.TimestampRolloverStream("audio"),g.timedMetadataTimestampRolloverStream=new jt.TimestampRolloverStream("timed-metadata"),g.adtsStream=new Nl,g.coalesceStream=new ai(o,g.metadataStream),g.headOfPipeline=g.aacStream,g.aacStream.pipe(g.audioTimestampRolloverStream).pipe(g.adtsStream),g.aacStream.pipe(g.timedMetadataTimestampRolloverStream).pipe(g.metadataStream).pipe(g.coalesceStream),g.metadataStream.on("timestamp",function(_){g.aacStream.setTimestamp(_.timeStamp)}),g.aacStream.on("data",function(_){_.type!=="timed-metadata"&&_.type!=="audio"||g.audioSegmentStream||(p=p||{timelineStartInfo:{baseMediaDecodeTime:c.baseMediaDecodeTime},codec:"adts",type:"audio"},g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new bs(p,o),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d}))}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),Ul(this,g)},this.setupTsPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="ts",g.metadataStream=new jt.MetadataStream,g.packetStream=new jt.TransportPacketStream,g.parseStream=new jt.TransportParseStream,g.elementaryStream=new jt.ElementaryStream,g.timestampRolloverStream=new jt.TimestampRolloverStream,g.adtsStream=new Nl,g.h264Stream=new vm,g.captionStream=new jt.CaptionStream(o),g.coalesceStream=new ai(o,g.metadataStream),g.headOfPipeline=g.packetStream,g.packetStream.pipe(g.parseStream).pipe(g.elementaryStream).pipe(g.timestampRolloverStream),g.timestampRolloverStream.pipe(g.h264Stream),g.timestampRolloverStream.pipe(g.adtsStream),g.timestampRolloverStream.pipe(g.metadataStream).pipe(g.coalesceStream),g.h264Stream.pipe(g.captionStream).pipe(g.coalesceStream),g.elementaryStream.on("data",function(_){var b;if(_.type==="metadata"){for(b=_.tracks.length;b--;)!d&&_.tracks[b].type==="video"?(d=_.tracks[b],d.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime):!p&&_.tracks[b].type==="audio"&&(p=_.tracks[b],p.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime);d&&!g.videoSegmentStream&&(g.coalesceStream.numberOfTracks++,g.videoSegmentStream=new Or(d,o),g.videoSegmentStream.on("log",c.getLogTrigger_("videoSegmentStream")),g.videoSegmentStream.on("timelineStartInfo",function(x){p&&!o.keepOriginalTimestamps&&(p.timelineStartInfo=x,g.audioSegmentStream.setEarliestDts(x.dts-c.baseMediaDecodeTime))}),g.videoSegmentStream.on("processedGopsInfo",c.trigger.bind(c,"gopInfo")),g.videoSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"videoSegmentTimingInfo")),g.videoSegmentStream.on("baseMediaDecodeTime",function(x){p&&g.audioSegmentStream.setVideoBaseMediaDecodeTime(x)}),g.videoSegmentStream.on("timingInfo",c.trigger.bind(c,"videoTimingInfo")),g.h264Stream.pipe(g.videoSegmentStream).pipe(g.coalesceStream)),p&&!g.audioSegmentStream&&(g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new bs(p,o),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.audioSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"audioSegmentTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream)),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d})}}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("id3Frame",function(_){_.dispatchType=g.metadataStream.dispatchType,c.trigger("id3Frame",_)}),g.coalesceStream.on("caption",this.trigger.bind(this,"caption")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),Ul(this,g)},this.setBaseMediaDecodeTime=function(g){var _=this.transmuxPipeline_;o.keepOriginalTimestamps||(this.baseMediaDecodeTime=g),p&&(p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,ut.clearDtsInfo(p),_.audioTimestampRolloverStream&&_.audioTimestampRolloverStream.discontinuity()),d&&(_.videoSegmentStream&&(_.videoSegmentStream.gopCache_=[]),d.timelineStartInfo.dts=void 0,d.timelineStartInfo.pts=void 0,ut.clearDtsInfo(d),_.captionStream.reset()),_.timestampRolloverStream&&_.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(g){p&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(g)},this.setRemux=function(g){var _=this.transmuxPipeline_;o.remux=g,_&&_.coalesceStream&&_.coalesceStream.setRemux(g)},this.alignGopsWith=function(g){d&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(g)},this.getLogTrigger_=function(g){var _=this;return function(b){b.stream=g,_.trigger("log",b)}},this.push=function(g){if(h){var _=_m(g);_&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!_&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),h=!1}this.transmuxPipeline_.headOfPipeline.push(g)},this.flush=function(){h=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Mr.prototype=new Ir;var xm={Transmuxer:Mr},Sm=function(o){return o>>>0},Cm=function(o){return("00"+o.toString(16)).slice(-2)},Rr={toUnsigned:Sm,toHexString:Cm},Em=function(o){var c="";return c+=String.fromCharCode(o[0]),c+=String.fromCharCode(o[1]),c+=String.fromCharCode(o[2]),c+=String.fromCharCode(o[3]),c},ql=Em,Am=Rr.toUnsigned,wm=ql,zl=function(o,c){var h=[],d,p,g,_,b;if(!c.length)return null;for(d=0;d<o.byteLength;)p=Am(o[d]<<24|o[d+1]<<16|o[d+2]<<8|o[d+3]),g=wm(o.subarray(d+4,d+8)),_=p>1?d+p:o.byteLength,g===c[0]&&(c.length===1?h.push(o.subarray(d+8,_)):(b=zl(o.subarray(d+8,_),c.slice(1)),b.length&&(h=h.concat(b)))),d=_;return h},ua=zl,Dm=Rr.toUnsigned,km=n.getUint64,jm=function(o){var c={version:o[0],flags:new Uint8Array(o.subarray(1,4))};return c.version===1?c.baseMediaDecodeTime=km(o.subarray(4)):c.baseMediaDecodeTime=Dm(o[4]<<24|o[5]<<16|o[6]<<8|o[7]),c},ca=jm,Im=function(o){var c=new DataView(o.buffer,o.byteOffset,o.byteLength),h={version:o[0],flags:new Uint8Array(o.subarray(1,4)),trackId:c.getUint32(4)},d=h.flags[2]&1,p=h.flags[2]&2,g=h.flags[2]&8,_=h.flags[2]&16,b=h.flags[2]&32,x=h.flags[0]&65536,C=h.flags[0]&131072,D;return D=8,d&&(D+=4,h.baseDataOffset=c.getUint32(12),D+=4),p&&(h.sampleDescriptionIndex=c.getUint32(D),D+=4),g&&(h.defaultSampleDuration=c.getUint32(D),D+=4),_&&(h.defaultSampleSize=c.getUint32(D),D+=4),b&&(h.defaultSampleFlags=c.getUint32(D)),x&&(h.durationIsEmpty=!0),!d&&C&&(h.baseDataOffsetIsMoof=!0),h},$l=Im,Pm=function(o){return{isLeading:(o[0]&12)>>>2,dependsOn:o[0]&3,isDependedOn:(o[1]&192)>>>6,hasRedundancy:(o[1]&48)>>>4,paddingValue:(o[1]&14)>>>1,isNonSyncSample:o[1]&1,degradationPriority:o[2]<<8|o[3]}},Lm=Pm,Gl=Lm,Om=function(o){var c={version:o[0],flags:new Uint8Array(o.subarray(1,4)),samples:[]},h=new DataView(o.buffer,o.byteOffset,o.byteLength),d=c.flags[2]&1,p=c.flags[2]&4,g=c.flags[1]&1,_=c.flags[1]&2,b=c.flags[1]&4,x=c.flags[1]&8,C=h.getUint32(4),D=8,M;for(d&&(c.dataOffset=h.getInt32(D),D+=4),p&&C&&(M={flags:Gl(o.subarray(D,D+4))},D+=4,g&&(M.duration=h.getUint32(D),D+=4),_&&(M.size=h.getUint32(D),D+=4),x&&(c.version===1?M.compositionTimeOffset=h.getInt32(D):M.compositionTimeOffset=h.getUint32(D),D+=4),c.samples.push(M),C--);C--;)M={},g&&(M.duration=h.getUint32(D),D+=4),_&&(M.size=h.getUint32(D),D+=4),b&&(M.flags=Gl(o.subarray(D,D+4)),D+=4),x&&(c.version===1?M.compositionTimeOffset=h.getInt32(D):M.compositionTimeOffset=h.getUint32(D),D+=4),c.samples.push(M);return c},Wl=Om,Xl={tfdt:ca,trun:Wl},Yl={parseTfdt:Xl.tfdt,parseTrun:Xl.trun},Mm=function(o){for(var c=0,h=String.fromCharCode(o[c]),d="";h!=="\0";)d+=h,c++,h=String.fromCharCode(o[c]);return d+=h,d},Rm={uint8ToCString:Mm},Nr=Rm.uint8ToCString,Nm=n.getUint64,Bm=function(o){var c=4,h=o[0],d,p,g,_,b,x,C,D;if(h===0){d=Nr(o.subarray(c)),c+=d.length,p=Nr(o.subarray(c)),c+=p.length;var M=new DataView(o.buffer);g=M.getUint32(c),c+=4,b=M.getUint32(c),c+=4,x=M.getUint32(c),c+=4,C=M.getUint32(c),c+=4}else if(h===1){var M=new DataView(o.buffer);g=M.getUint32(c),c+=4,_=Nm(o.subarray(c)),c+=8,x=M.getUint32(c),c+=4,C=M.getUint32(c),c+=4,d=Nr(o.subarray(c)),c+=d.length,p=Nr(o.subarray(c)),c+=p.length}D=new Uint8Array(o.subarray(c,o.byteLength));var H={scheme_id_uri:d,value:p,timescale:g||1,presentation_time:_,presentation_time_delta:b,event_duration:x,id:C,message_data:D};return Um(h,H)?H:void 0},Fm=function(o,c,h,d){return o||o===0?o/c:d+h/c},Um=function(o,c){var h=c.scheme_id_uri!=="\0",d=o===0&&Kl(c.presentation_time_delta)&&h,p=o===1&&Kl(c.presentation_time)&&h;return!(o>1)&&d||p},Kl=function(o){return o!==void 0||o!==null},Vm={parseEmsgBox:Bm,scaleTime:Fm},Ts;typeof window<"u"?Ts=window:typeof i<"u"?Ts=i:typeof self<"u"?Ts=self:Ts={};var Ql=Ts,Br=Rr.toUnsigned,xs=Rr.toHexString,Te=ua,Ci=ql,da=Vm,Hm=$l,qm=Wl,zm=ca,$m=n.getUint64,Jl,Zl,eu,tu,iu,ha,su,fa=Ql,Gm=wl.parseId3Frames;Jl=function(o){var c={},h=Te(o,["moov","trak"]);return h.reduce(function(d,p){var g,_,b,x,C;return g=Te(p,["tkhd"])[0],!g||(_=g[0],b=_===0?12:20,x=Br(g[b]<<24|g[b+1]<<16|g[b+2]<<8|g[b+3]),C=Te(p,["mdia","mdhd"])[0],!C)?null:(_=C[0],b=_===0?12:20,d[x]=Br(C[b]<<24|C[b+1]<<16|C[b+2]<<8|C[b+3]),d)},c)},Zl=function(o,c){var h;h=Te(c,["moof","traf"]);var d=h.reduce(function(p,g){var _=Te(g,["tfhd"])[0],b=Br(_[4]<<24|_[5]<<16|_[6]<<8|_[7]),x=o[b]||9e4,C=Te(g,["tfdt"])[0],D=new DataView(C.buffer,C.byteOffset,C.byteLength),M;C[0]===1?M=$m(C.subarray(4,12)):M=D.getUint32(4);let H;return typeof M=="bigint"?H=M/fa.BigInt(x):typeof M=="number"&&!isNaN(M)&&(H=M/x),H<Number.MAX_SAFE_INTEGER&&(H=Number(H)),H<p&&(p=H),p},1/0);return typeof d=="bigint"||isFinite(d)?d:0},eu=function(o,c){var h=Te(c,["moof","traf"]),d=0,p=0,g;if(h&&h.length){var _=Te(h[0],["tfhd"])[0],b=Te(h[0],["trun"])[0],x=Te(h[0],["tfdt"])[0];if(_){var C=Hm(_);g=C.trackId}if(x){var D=zm(x);d=D.baseMediaDecodeTime}if(b){var M=qm(b);M.samples&&M.samples.length&&(p=M.samples[0].compositionTimeOffset||0)}}var H=o[g]||9e4;typeof d=="bigint"&&(p=fa.BigInt(p),H=fa.BigInt(H));var N=(d+p)/H;return typeof N=="bigint"&&N<Number.MAX_SAFE_INTEGER&&(N=Number(N)),N},tu=function(o){var c=Te(o,["moov","trak"]),h=[];return c.forEach(function(d){var p=Te(d,["mdia","hdlr"]),g=Te(d,["tkhd"]);p.forEach(function(_,b){var x=Ci(_.subarray(8,12)),C=g[b],D,M,H;x==="vide"&&(D=new DataView(C.buffer,C.byteOffset,C.byteLength),M=D.getUint8(0),H=M===0?D.getUint32(12):D.getUint32(20),h.push(H))})}),h},ha=function(o){var c=o[0],h=c===0?12:20;return Br(o[h]<<24|o[h+1]<<16|o[h+2]<<8|o[h+3])},iu=function(o){var c=Te(o,["moov","trak"]),h=[];return c.forEach(function(d){var p={},g=Te(d,["tkhd"])[0],_,b;g&&(_=new DataView(g.buffer,g.byteOffset,g.byteLength),b=_.getUint8(0),p.id=b===0?_.getUint32(12):_.getUint32(20));var x=Te(d,["mdia","hdlr"])[0];if(x){var C=Ci(x.subarray(8,12));C==="vide"?p.type="video":C==="soun"?p.type="audio":p.type=C}var D=Te(d,["mdia","minf","stbl","stsd"])[0];if(D){var M=D.subarray(8);p.codec=Ci(M.subarray(4,8));var H=Te(M,[p.codec])[0],N,$;H&&(/^[asm]vc[1-9]$/i.test(p.codec)?(N=H.subarray(78),$=Ci(N.subarray(4,8)),$==="avcC"&&N.length>11?(p.codec+=".",p.codec+=xs(N[9]),p.codec+=xs(N[10]),p.codec+=xs(N[11])):p.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(p.codec)?(N=H.subarray(28),$=Ci(N.subarray(4,8)),$==="esds"&&N.length>20&&N[19]!==0?(p.codec+="."+xs(N[19]),p.codec+="."+xs(N[20]>>>2&63).replace(/^0/,"")):p.codec="mp4a.40.2"):p.codec=p.codec.toLowerCase())}var K=Te(d,["mdia","mdhd"])[0];K&&(p.timescale=ha(K)),h.push(p)}),h},su=function(o,c=0){var h=Te(o,["emsg"]);return h.map(d=>{var p=da.parseEmsgBox(new Uint8Array(d)),g=Gm(p.message_data);return{cueTime:da.scaleTime(p.presentation_time,p.timescale,p.presentation_time_delta,c),duration:da.scaleTime(p.event_duration,p.timescale),frames:g}})};var Ss={findBox:Te,parseType:Ci,timescale:Jl,startTime:Zl,compositionStartTime:eu,videoTrackIds:tu,tracks:iu,getTimescaleFromMediaHeader:ha,getEmsgID3:su};const{parseTrun:Wm}=Yl,{findBox:ru}=Ss;var nu=Ql,Xm=function(o){var c=ru(o,["moof","traf"]),h=ru(o,["mdat"]),d=[];return h.forEach(function(p,g){var _=c[g];d.push({mdat:p,traf:_})}),d},Ym=function(o,c,h){var d=c,p=h.defaultSampleDuration||0,g=h.defaultSampleSize||0,_=h.trackId,b=[];return o.forEach(function(x){var C=Wm(x),D=C.samples;D.forEach(function(M){M.duration===void 0&&(M.duration=p),M.size===void 0&&(M.size=g),M.trackId=_,M.dts=d,M.compositionTimeOffset===void 0&&(M.compositionTimeOffset=0),typeof d=="bigint"?(M.pts=d+nu.BigInt(M.compositionTimeOffset),d+=nu.BigInt(M.duration)):(M.pts=d+M.compositionTimeOffset,d+=M.duration)}),b=b.concat(D)}),b},au={getMdatTrafPairs:Xm,parseSamples:Ym},Km=xl.discardEmulationPreventionBytes,Qm=Sl.CaptionStream,pa=ua,Jm=ca,Zm=$l,{getMdatTrafPairs:e0,parseSamples:t0}=au,i0=function(o,c){for(var h=o,d=0;d<c.length;d++){var p=c[d];if(h<p.size)return p;h-=p.size}return null},s0=function(o,c,h){var d=new DataView(o.buffer,o.byteOffset,o.byteLength),p={logs:[],seiNals:[]},g,_,b,x;for(_=0;_+4<o.length;_+=b)if(b=d.getUint32(_),_+=4,!(b<=0))switch(o[_]&31){case 6:var C=o.subarray(_+1,_+1+b),D=i0(_,c);if(g={nalUnitType:"sei_rbsp",size:b,data:C,escapedRBSP:Km(C),trackId:h},D)g.pts=D.pts,g.dts=D.dts,x=D;else if(x)g.pts=x.pts,g.dts=x.dts;else{p.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+_+" for trackId "+h+". See mux.js#223."});break}p.seiNals.push(g);break}return p},r0=function(o,c){var h={},d=e0(o);return d.forEach(function(p){var g=p.mdat,_=p.traf,b=pa(_,["tfhd"]),x=Zm(b[0]),C=x.trackId,D=pa(_,["tfdt"]),M=D.length>0?Jm(D[0]).baseMediaDecodeTime:0,H=pa(_,["trun"]),N,$;c===C&&H.length>0&&(N=t0(H,M,x),$=s0(g,N,C),h[C]||(h[C]={seiNals:[],logs:[]}),h[C].seiNals=h[C].seiNals.concat($.seiNals),h[C].logs=h[C].logs.concat($.logs))}),h},n0=function(o,c,h){var d;if(c===null)return null;d=r0(o,c);var p=d[c]||{};return{seiNals:p.seiNals,logs:p.logs,timescale:h}},a0=function(){var o=!1,c,h,d,p,g,_;this.isInitialized=function(){return o},this.init=function(b){c=new Qm,o=!0,_=b?b.isPartial:!1,c.on("data",function(x){x.startTime=x.startPts/p,x.endTime=x.endPts/p,g.captions.push(x),g.captionStreams[x.stream]=!0}),c.on("log",function(x){g.logs.push(x)})},this.isNewInit=function(b,x){return b&&b.length===0||x&&typeof x=="object"&&Object.keys(x).length===0?!1:d!==b[0]||p!==x[d]},this.parse=function(b,x,C){var D;if(this.isInitialized()){if(!x||!C)return null;if(this.isNewInit(x,C))d=x[0],p=C[d];else if(d===null||!p)return h.push(b),null}else return null;for(;h.length>0;){var M=h.shift();this.parse(M,x,C)}return D=n0(b,d,p),D&&D.logs&&(g.logs=g.logs.concat(D.logs)),D===null||!D.seiNals?g.logs.length?{logs:g.logs,captions:[],captionStreams:[]}:null:(this.pushNals(D.seiNals),this.flushStream(),g)},this.pushNals=function(b){if(!this.isInitialized()||!b||b.length===0)return null;b.forEach(function(x){c.push(x)})},this.flushStream=function(){if(!this.isInitialized())return null;_?c.partialFlush():c.flush()},this.clearParsedCaptions=function(){g.captions=[],g.captionStreams={},g.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;c.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){h=[],d=null,p=null,g?this.clearParsedCaptions():g={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},o0=a0;const{parseTfdt:l0}=Yl,Ht=ua,{getTimescaleFromMediaHeader:u0}=Ss,{parseSamples:c0,getMdatTrafPairs:d0}=au;var ou=function(){let o=9e4;this.init=function(c){const h=Ht(c,["moov","trak","mdia","mdhd"])[0];h&&(o=u0(h))},this.parseSegment=function(c){const h=[],d=d0(c);let p=0;return d.forEach(function(g){const _=g.mdat,b=g.traf,x=Ht(b,["tfdt"])[0],C=Ht(b,["tfhd"])[0],D=Ht(b,["trun"]);if(x&&(p=l0(x).baseMediaDecodeTime),D.length&&C){const M=c0(D,p,C);let H=0;M.forEach(function(N){const $="utf-8",K=new TextDecoder($),Ae=_.slice(H,H+N.size);if(Ht(Ae,["vtte"])[0]){H+=N.size;return}Ht(Ae,["vttc"]).forEach(function(Cs){const Es=Ht(Cs,["payl"])[0],As=Ht(Cs,["sttg"])[0],ws=N.pts/o,Vr=(N.pts+N.duration)/o;let he,Ds;if(Es)try{he=K.decode(Es)}catch(ct){console.error(ct)}if(As)try{Ds=K.decode(As)}catch(ct){console.error(ct)}N.duration&&he&&h.push({cueText:he,start:ws,end:Vr,settings:Ds})}),H+=N.size})}}),h}},ma=Tr,lu=function(o){var c=o[1]&31;return c<<=8,c|=o[2],c},Fr=function(o){return!!(o[1]&64)},Ur=function(o){var c=0;return(o[3]&48)>>>4>1&&(c+=o[4]+1),c},h0=function(o,c){var h=lu(o);return h===0?"pat":h===c?"pmt":c?"pes":null},f0=function(o){var c=Fr(o),h=4+Ur(o);return c&&(h+=o[h]+1),(o[h+10]&31)<<8|o[h+11]},p0=function(o){var c={},h=Fr(o),d=4+Ur(o);if(h&&(d+=o[d]+1),!!(o[d+5]&1)){var p,g,_;p=(o[d+1]&15)<<8|o[d+2],g=3+p-4,_=(o[d+10]&15)<<8|o[d+11];for(var b=12+_;b<g;){var x=d+b;c[(o[x+1]&31)<<8|o[x+2]]=o[x],b+=((o[x+3]&15)<<8|o[x+4])+5}return c}},m0=function(o,c){var h=lu(o),d=c[h];switch(d){case ma.H264_STREAM_TYPE:return"video";case ma.ADTS_STREAM_TYPE:return"audio";case ma.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},g0=function(o){var c=Fr(o);if(!c)return null;var h=4+Ur(o);if(h>=o.byteLength)return null;var d=null,p;return p=o[h+7],p&192&&(d={},d.pts=(o[h+9]&14)<<27|(o[h+10]&255)<<20|(o[h+11]&254)<<12|(o[h+12]&255)<<5|(o[h+13]&254)>>>3,d.pts*=4,d.pts+=(o[h+13]&6)>>>1,d.dts=d.pts,p&64&&(d.dts=(o[h+14]&14)<<27|(o[h+15]&255)<<20|(o[h+16]&254)<<12|(o[h+17]&255)<<5|(o[h+18]&254)>>>3,d.dts*=4,d.dts+=(o[h+18]&6)>>>1)),d},ga=function(o){switch(o){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},v0=function(o){for(var c=4+Ur(o),h=o.subarray(c),d=0,p=0,g=!1,_;p<h.byteLength-3;p++)if(h[p+2]===1){d=p+5;break}for(;d<h.byteLength;)switch(h[d]){case 0:if(h[d-1]!==0){d+=2;break}else if(h[d-2]!==0){d++;break}p+3!==d-2&&(_=ga(h[p+3]&31),_==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0));do d++;while(h[d]!==1&&d<h.length);p=d-2,d+=3;break;case 1:if(h[d-1]!==0||h[d-2]!==0){d+=3;break}_=ga(h[p+3]&31),_==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0),p=d-2,d+=3;break;default:d+=3;break}return h=h.subarray(p),d-=p,p=0,h&&h.byteLength>3&&(_=ga(h[p+3]&31),_==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0)),g},y0={parseType:h0,parsePat:f0,parsePmt:p0,parsePayloadUnitStartIndicator:Fr,parsePesType:m0,parsePesTime:g0,videoPacketContainsKeyFrame:v0},uu=Tr,Ei=El.handleRollover,re={};re.ts=y0,re.aac=la;var oi=de.ONE_SECOND_IN_TS,Ne=188,mt=71,_0=function(o,c){for(var h=0,d=Ne,p,g;d<o.byteLength;){if(o[h]===mt&&o[d]===mt){switch(p=o.subarray(h,d),g=re.ts.parseType(p,c.pid),g){case"pat":c.pid=re.ts.parsePat(p);break;case"pmt":var _=re.ts.parsePmt(p);c.table=c.table||{},Object.keys(_).forEach(function(b){c.table[b]=_[b]});break}h+=Ne,d+=Ne;continue}h++,d++}},cu=function(o,c,h){for(var d=0,p=Ne,g,_,b,x,C,D=!1;p<=o.byteLength;){if(o[d]===mt&&(o[p]===mt||p===o.byteLength)){switch(g=o.subarray(d,p),_=re.ts.parseType(g,c.pid),_){case"pes":b=re.ts.parsePesType(g,c.table),x=re.ts.parsePayloadUnitStartIndicator(g),b==="audio"&&x&&(C=re.ts.parsePesTime(g),C&&(C.type="audio",h.audio.push(C),D=!0));break}if(D)break;d+=Ne,p+=Ne;continue}d++,p++}for(p=o.byteLength,d=p-Ne,D=!1;d>=0;){if(o[d]===mt&&(o[p]===mt||p===o.byteLength)){switch(g=o.subarray(d,p),_=re.ts.parseType(g,c.pid),_){case"pes":b=re.ts.parsePesType(g,c.table),x=re.ts.parsePayloadUnitStartIndicator(g),b==="audio"&&x&&(C=re.ts.parsePesTime(g),C&&(C.type="audio",h.audio.push(C),D=!0));break}if(D)break;d-=Ne,p-=Ne;continue}d--,p--}},b0=function(o,c,h){for(var d=0,p=Ne,g,_,b,x,C,D,M,H,N=!1,$={data:[],size:0};p<o.byteLength;){if(o[d]===mt&&o[p]===mt){switch(g=o.subarray(d,p),_=re.ts.parseType(g,c.pid),_){case"pes":if(b=re.ts.parsePesType(g,c.table),x=re.ts.parsePayloadUnitStartIndicator(g),b==="video"&&(x&&!N&&(C=re.ts.parsePesTime(g),C&&(C.type="video",h.video.push(C),N=!0)),!h.firstKeyFrame)){if(x&&$.size!==0){for(D=new Uint8Array($.size),M=0;$.data.length;)H=$.data.shift(),D.set(H,M),M+=H.byteLength;if(re.ts.videoPacketContainsKeyFrame(D)){var K=re.ts.parsePesTime(D);K?(h.firstKeyFrame=K,h.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}$.size=0}$.data.push(g),$.size+=g.byteLength}break}if(N&&h.firstKeyFrame)break;d+=Ne,p+=Ne;continue}d++,p++}for(p=o.byteLength,d=p-Ne,N=!1;d>=0;){if(o[d]===mt&&o[p]===mt){switch(g=o.subarray(d,p),_=re.ts.parseType(g,c.pid),_){case"pes":b=re.ts.parsePesType(g,c.table),x=re.ts.parsePayloadUnitStartIndicator(g),b==="video"&&x&&(C=re.ts.parsePesTime(g),C&&(C.type="video",h.video.push(C),N=!0));break}if(N)break;d-=Ne,p-=Ne;continue}d--,p--}},T0=function(o,c){if(o.audio&&o.audio.length){var h=c;(typeof h>"u"||isNaN(h))&&(h=o.audio[0].dts),o.audio.forEach(function(g){g.dts=Ei(g.dts,h),g.pts=Ei(g.pts,h),g.dtsTime=g.dts/oi,g.ptsTime=g.pts/oi})}if(o.video&&o.video.length){var d=c;if((typeof d>"u"||isNaN(d))&&(d=o.video[0].dts),o.video.forEach(function(g){g.dts=Ei(g.dts,d),g.pts=Ei(g.pts,d),g.dtsTime=g.dts/oi,g.ptsTime=g.pts/oi}),o.firstKeyFrame){var p=o.firstKeyFrame;p.dts=Ei(p.dts,d),p.pts=Ei(p.pts,d),p.dtsTime=p.dts/oi,p.ptsTime=p.pts/oi}}},x0=function(o){for(var c=!1,h=0,d=null,p=null,g=0,_=0,b;o.length-_>=3;){var x=re.aac.parseType(o,_);switch(x){case"timed-metadata":if(o.length-_<10){c=!0;break}if(g=re.aac.parseId3TagSize(o,_),g>o.length){c=!0;break}p===null&&(b=o.subarray(_,_+g),p=re.aac.parseAacTimestamp(b)),_+=g;break;case"audio":if(o.length-_<7){c=!0;break}if(g=re.aac.parseAdtsSize(o,_),g>o.length){c=!0;break}d===null&&(b=o.subarray(_,_+g),d=re.aac.parseSampleRate(b)),h++,_+=g;break;default:_++;break}if(c)return null}if(d===null||p===null)return null;var C=oi/d,D={audio:[{type:"audio",dts:p,pts:p},{type:"audio",dts:p+h*1024*C,pts:p+h*1024*C}]};return D},S0=function(o){var c={pid:null,table:null},h={};_0(o,c);for(var d in c.table)if(c.table.hasOwnProperty(d)){var p=c.table[d];switch(p){case uu.H264_STREAM_TYPE:h.video=[],b0(o,c,h),h.video.length===0&&delete h.video;break;case uu.ADTS_STREAM_TYPE:h.audio=[],cu(o,c,h),h.audio.length===0&&delete h.audio;break}}return h},C0=function(o,c){var h=re.aac.isLikelyAacData(o),d;return h?d=x0(o):d=S0(o),!d||!d.audio&&!d.video?null:(T0(d,c),d)},E0={inspect:C0,parseAudioPes_:cu};const A0=function(o,c){c.on("data",function(h){const d=h.initSegment;h.initSegment={data:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength};const p=h.data;h.data=p.buffer,o.postMessage({action:"data",segment:h,byteOffset:p.byteOffset,byteLength:p.byteLength},[h.data])}),c.on("done",function(h){o.postMessage({action:"done"})}),c.on("gopInfo",function(h){o.postMessage({action:"gopInfo",gopInfo:h})}),c.on("videoSegmentTimingInfo",function(h){const d={start:{decode:de.videoTsToSeconds(h.start.dts),presentation:de.videoTsToSeconds(h.start.pts)},end:{decode:de.videoTsToSeconds(h.end.dts),presentation:de.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:de.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(d.prependedContentDuration=de.videoTsToSeconds(h.prependedContentDuration)),o.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:d})}),c.on("audioSegmentTimingInfo",function(h){const d={start:{decode:de.videoTsToSeconds(h.start.dts),presentation:de.videoTsToSeconds(h.start.pts)},end:{decode:de.videoTsToSeconds(h.end.dts),presentation:de.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:de.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(d.prependedContentDuration=de.videoTsToSeconds(h.prependedContentDuration)),o.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:d})}),c.on("id3Frame",function(h){o.postMessage({action:"id3Frame",id3Frame:h})}),c.on("caption",function(h){o.postMessage({action:"caption",caption:h})}),c.on("trackinfo",function(h){o.postMessage({action:"trackinfo",trackInfo:h})}),c.on("audioTimingInfo",function(h){o.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:de.videoTsToSeconds(h.start),end:de.videoTsToSeconds(h.end)}})}),c.on("videoTimingInfo",function(h){o.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:de.videoTsToSeconds(h.start),end:de.videoTsToSeconds(h.end)}})}),c.on("log",function(h){o.postMessage({action:"log",log:h})})};class du{constructor(c,h){this.options=h||{},this.self=c,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new xm.Transmuxer(this.options),A0(this.self,this.transmuxer)}pushMp4Captions(c){this.captionParser||(this.captionParser=new o0,this.captionParser.init());const h=new Uint8Array(c.data,c.byteOffset,c.byteLength),d=this.captionParser.parse(h,c.trackIds,c.timescales);this.self.postMessage({action:"mp4Captions",captions:d&&d.captions||[],logs:d&&d.logs||[],data:h.buffer},[h.buffer])}initMp4WebVttParser(c){this.webVttParser||(this.webVttParser=new ou);const h=new Uint8Array(c.data,c.byteOffset,c.byteLength);this.webVttParser.init(h)}getMp4WebVttText(c){this.webVttParser||(this.webVttParser=new ou);const h=new Uint8Array(c.data,c.byteOffset,c.byteLength),d=this.webVttParser.parseSegment(h);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:d||[],data:h.buffer},[h.buffer])}probeMp4StartTime({timescales:c,data:h}){const d=Ss.startTime(c,h);this.self.postMessage({action:"probeMp4StartTime",startTime:d,data:h},[h.buffer])}probeMp4Tracks({data:c}){const h=Ss.tracks(c);this.self.postMessage({action:"probeMp4Tracks",tracks:h,data:c},[c.buffer])}probeEmsgID3({data:c,offset:h}){const d=Ss.getEmsgID3(c,h);this.self.postMessage({action:"probeEmsgID3",id3Frames:d,emsgData:c},[c.buffer])}probeTs({data:c,baseStartTime:h}){const d=typeof h=="number"&&!isNaN(h)?h*de.ONE_SECOND_IN_TS:void 0,p=E0.inspect(c,d);let g=null;p&&(g={hasVideo:p.video&&p.video.length===2||!1,hasAudio:p.audio&&p.audio.length===2||!1},g.hasVideo&&(g.videoStart=p.video[0].ptsTime),g.hasAudio&&(g.audioStart=p.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:g,data:c},[c.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(c){const h=new Uint8Array(c.data,c.byteOffset,c.byteLength);this.transmuxer.push(h)}reset(){this.transmuxer.reset()}setTimestampOffset(c){const h=c.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(de.secondsToVideoTs(h)))}setAudioAppendStart(c){this.transmuxer.setAudioAppendStart(Math.ceil(de.secondsToVideoTs(c.appendStart)))}setRemux(c){this.transmuxer.setRemux(c.remux)}flush(c){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(c){this.transmuxer.alignGopsWith(c.gopsToAlignWith.slice())}}self.onmessage=function(o){if(o.data.action==="init"&&o.data.options){this.messageHandlers=new du(self,o.data.options);return}this.messageHandlers||(this.messageHandlers=new du(self)),o.data&&o.data.action&&o.data.action!=="init"&&this.messageHandlers[o.data.action]&&this.messageHandlers[o.data.action](o.data)}}));var e_=Pf(Zy);const t_=(i,e,t)=>{const{type:s,initSegment:r,captions:n,captionStreams:a,metadata:l,videoFrameDtsTime:u,videoFramePtsTime:f}=i.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:l});const m=i.data.segment.boxes||{data:i.data.segment.data},v={type:s,data:new Uint8Array(m.data,m.data.byteOffset,m.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof u<"u"&&(v.videoFrameDtsTime=u),typeof f<"u"&&(v.videoFramePtsTime=f),t(v)},i_=({transmuxedData:i,callback:e})=>{i.buffer=[],e(i)},s_=(i,e)=>{e.gopInfo=i.data.gopInfo},Mf=i=>{const{transmuxer:e,bytes:t,audioAppendStart:s,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:l,onAudioTimingInfo:u,onVideoTimingInfo:f,onVideoSegmentTimingInfo:m,onAudioSegmentTimingInfo:v,onId3:T,onCaptions:E,onDone:A,onEndedTimeline:y,onTransmuxerLog:k,isEndOfTimeline:w,segment:I,triggerSegmentEventFn:j}=i,L={buffer:[]};let O=w;const F=U=>{e.currentTransmux===i&&(U.data.action==="data"&&t_(U,L,a),U.data.action==="trackinfo"&&l(U.data.trackInfo),U.data.action==="gopInfo"&&s_(U,L),U.data.action==="audioTimingInfo"&&u(U.data.audioTimingInfo),U.data.action==="videoTimingInfo"&&f(U.data.videoTimingInfo),U.data.action==="videoSegmentTimingInfo"&&m(U.data.videoSegmentTimingInfo),U.data.action==="audioSegmentTimingInfo"&&v(U.data.audioSegmentTimingInfo),U.data.action==="id3Frame"&&T([U.data.id3Frame],U.data.id3Frame.dispatchType),U.data.action==="caption"&&E(U.data.caption),U.data.action==="endedtimeline"&&(O=!1,y()),U.data.action==="log"&&k(U.data.log),U.data.type==="transmuxed"&&(O||(e.onmessage=null,i_({transmuxedData:L,callback:A}),Rf(e))))},B=()=>{const U={message:"Received an error message from the transmuxer worker",metadata:{errorType:P.Error.StreamingFailedToTransmuxSegment,segmentInfo:ci({segment:I})}};A(null,U)};if(e.onmessage=F,e.onerror=B,s&&e.postMessage({action:"setAudioAppendStart",appendStart:s}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const U=t instanceof ArrayBuffer?t:t.buffer,X=t instanceof ArrayBuffer?0:t.byteOffset;j({type:"segmenttransmuxingstart",segment:I}),e.postMessage({action:"push",data:U,byteOffset:X,byteLength:t.byteLength},[U])}w&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Rf=i=>{i.currentTransmux=null,i.transmuxQueue.length&&(i.currentTransmux=i.transmuxQueue.shift(),typeof i.currentTransmux=="function"?i.currentTransmux():Mf(i.currentTransmux))},Ec=(i,e)=>{i.postMessage({action:e}),Rf(i)},Nf=(i,e)=>{if(!e.currentTransmux){e.currentTransmux=i,Ec(e,i);return}e.transmuxQueue.push(Ec.bind(null,e,i))},r_=i=>{Nf("reset",i)},n_=i=>{Nf("endTimeline",i)},Bf=i=>{if(!i.transmuxer.currentTransmux){i.transmuxer.currentTransmux=i,Mf(i);return}i.transmuxer.transmuxQueue.push(i)},a_=i=>{const e=new e_;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:i}),e};var Na={reset:r_,endTimeline:n_,transmux:Bf,createTransmuxer:a_};const Hi=function(i){const e=i.transmuxer,t=i.endAction||i.action,s=i.callback,r=_e({},i,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,i.byteOffset||0,i.byteLength||a.data.data.byteLength),i.data&&(i.data=a.data.data)),s(a.data))};if(e.addEventListener("message",n),i.data){const a=i.data instanceof ArrayBuffer;r.byteOffset=a?0:i.data.byteOffset,r.byteLength=i.data.byteLength;const l=[a?i.data:i.data.buffer];e.postMessage(r,l)}else e.postMessage(r)},xt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Ff="wvtt",co=i=>{i.forEach(e=>{e.abort()})},o_=i=>({bandwidth:i.bandwidth,bytesReceived:i.bytesReceived||0,roundTripTime:i.roundTripTime||0}),l_=i=>{const e=i.target,s={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return s.bytesReceived=i.loaded,s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3),s},hl=(i,e)=>{const{requestType:t}=e,s=vi({requestType:t,request:e,error:i});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:xt.TIMEOUT,xhr:e,metadata:s}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:xt.ABORTED,xhr:e,metadata:s}:i?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:xt.FAILURE,xhr:e,metadata:s}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:xt.FAILURE,xhr:e,metadata:s}:null},Ac=(i,e,t,s)=>(r,n)=>{const a=n.response,l=hl(r,n);if(l)return t(l,i);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:xt.FAILURE,xhr:n},i);const u=new DataView(a),f=new Uint32Array([u.getUint32(0),u.getUint32(4),u.getUint32(8),u.getUint32(12)]);for(let v=0;v<e.length;v++)e[v].bytes=f;const m={uri:n.uri};return s({type:"segmentkeyloadcomplete",segment:i,keyInfo:m}),t(null,i)},u_=(i,e)=>{e===Ff&&i.transmuxer.postMessage({action:"initMp4WebVttParser",data:i.map.bytes})},c_=(i,e,t)=>{e===Ff&&Hi({action:"getMp4WebVttText",data:i.bytes,transmuxer:i.transmuxer,callback:({data:s,mp4VttCues:r})=>{i.bytes=s,t(null,i,{mp4VttCues:r})}})},Uf=(i,e)=>{const t=Mo(i.map.bytes);if(t!=="mp4"){const s=i.map.resolvedUri||i.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${s}`,code:xt.FAILURE,metadata:{mediaType:r}})}Hi({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:({tracks:s,data:r})=>(i.map.bytes=r,s.forEach(function(n){i.map.tracks=i.map.tracks||{},!i.map.tracks[n.type]&&(i.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(i.map.timescales=i.map.timescales||{},i.map.timescales[n.id]=n.timescale),n.type==="text"&&u_(i,n.codec))}),e(null))})},d_=({segment:i,finishProcessingFn:e,triggerSegmentEventFn:t})=>(s,r)=>{const n=hl(s,r);if(n)return e(n,i);const a=new Uint8Array(r.response);if(t({type:"segmentloaded",segment:i}),i.map.key)return i.map.encryptedBytes=a,e(null,i);i.map.bytes=a,Uf(i,function(l){if(l)return l.xhr=r,l.status=r.status,e(l,i);e(null,i)})},h_=({segment:i,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:s})=>(r,n)=>{const a=hl(r,n);if(a)return e(a,i);s({type:"segmentloaded",segment:i});const l=t==="arraybuffer"||!n.responseText?n.response:Qy(n.responseText.substring(i.lastReachedChar||0));return i.stats=o_(n),i.key?i.encryptedBytes=new Uint8Array(l):i.bytes=new Uint8Array(l),e(null,i)},f_=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m,doneFn:v,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{const A=i.map&&i.map.tracks||{},y=!!(A.audio&&A.video);let k=s.bind(null,i,"audio","start");const w=s.bind(null,i,"audio","end");let I=s.bind(null,i,"video","start");const j=s.bind(null,i,"video","end"),L=()=>Bf({bytes:e,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:y,onData:O=>{O.type=O.type==="combined"?"video":O.type,m(i,O)},onTrackInfo:O=>{t&&(y&&(O.isMuxed=!0),t(i,O))},onAudioTimingInfo:O=>{k&&typeof O.start<"u"&&(k(O.start),k=null),w&&typeof O.end<"u"&&w(O.end)},onVideoTimingInfo:O=>{I&&typeof O.start<"u"&&(I(O.start),I=null),j&&typeof O.end<"u"&&j(O.end)},onVideoSegmentTimingInfo:O=>{const F={pts:{start:O.start.presentation,end:O.end.presentation},dts:{start:O.start.decode,end:O.end.decode}};E({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:F}),r(O)},onAudioSegmentTimingInfo:O=>{const F={pts:{start:O.start.pts,end:O.end.pts},dts:{start:O.start.dts,end:O.end.dts}};E({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:F}),n(O)},onId3:(O,F)=>{a(i,O,F)},onCaptions:O=>{l(i,[O])},isEndOfTimeline:u,onEndedTimeline:()=>{f()},onTransmuxerLog:T,onDone:(O,F)=>{v&&(O.type=O.type==="combined"?"video":O.type,E({type:"segmenttransmuxingcomplete",segment:i}),v(F,i,O))},segment:i,triggerSegmentEventFn:E});Hi({action:"probeTs",transmuxer:i.transmuxer,data:e,baseStartTime:i.baseStartTime,callback:O=>{i.bytes=e=O.data;const F=O.result;F&&(t(i,{hasAudio:F.hasAudio,hasVideo:F.hasVideo,isMuxed:y}),t=null),L()}})},Vf=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m,doneFn:v,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{let A=new Uint8Array(e);if(M2(A)){i.isFmp4=!0;const{tracks:y}=i.map;if(y.text&&(!y.audio||!y.video)){m(i,{data:A,type:"text"}),c_(i,y.text.codec,v);return}const w={isFmp4:!0,hasVideo:!!y.video,hasAudio:!!y.audio};y.audio&&y.audio.codec&&y.audio.codec!=="enca"&&(w.audioCodec=y.audio.codec),y.video&&y.video.codec&&y.video.codec!=="encv"&&(w.videoCodec=y.video.codec),y.video&&y.audio&&(w.isMuxed=!0),t(i,w);const I=(j,L)=>{m(i,{data:A,type:w.hasAudio&&!w.isMuxed?"audio":"video"}),L&&L.length&&a(i,L),j&&j.length&&l(i,j),v(null,i,{})};Hi({action:"probeMp4StartTime",timescales:i.map.timescales,data:A,transmuxer:i.transmuxer,callback:({data:j,startTime:L})=>{e=j.buffer,i.bytes=A=j,w.hasAudio&&!w.isMuxed&&s(i,"audio","start",L),w.hasVideo&&s(i,"video","start",L),Hi({action:"probeEmsgID3",data:A,transmuxer:i.transmuxer,offset:L,callback:({emsgData:O,id3Frames:F})=>{if(e=O.buffer,i.bytes=A=O,!y.video||!O.byteLength||!i.transmuxer){I(void 0,F);return}Hi({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:A,timescales:i.map.timescales,trackIds:[y.video.id],callback:B=>{e=B.data.buffer,i.bytes=A=B.data,B.logs.forEach(function(U){T(ie(U,{stream:"mp4CaptionParser"}))}),I(B.captions,F)}})}})}});return}if(!i.transmuxer){v(null,i,{});return}if(typeof i.container>"u"&&(i.container=Mo(A)),i.container!=="ts"&&i.container!=="aac"){t(i,{hasAudio:!1,hasVideo:!1}),v(null,i,{});return}f_({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m,doneFn:v,onTransmuxerLog:T,triggerSegmentEventFn:E})},Hf=function({id:i,key:e,encryptedBytes:t,decryptionWorker:s,segment:r,doneFn:n},a){const l=f=>{if(f.data.source===i){s.removeEventListener("message",l);const m=f.data.decrypted;a(new Uint8Array(m.bytes,m.byteOffset,m.byteLength))}};s.onerror=()=>{const f="An error occurred in the decryption worker",m=ci({segment:r}),v={message:f,metadata:{error:new Error(f),errorType:P.Error.StreamingFailedToDecryptSegment,segmentInfo:m,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};n(v,r)},s.addEventListener("message",l);let u;e.bytes.slice?u=e.bytes.slice():u=new Uint32Array(Array.prototype.slice.call(e.bytes)),s.postMessage(Af({source:i,encrypted:t,key:u,iv:e.iv}),[t.buffer,u.buffer])},p_=({decryptionWorker:i,segment:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m,doneFn:v,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{E({type:"segmentdecryptionstart"}),Hf({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:i,segment:e,doneFn:v},A=>{e.bytes=A,E({type:"segmentdecryptioncomplete",segment:e}),Vf({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m,doneFn:v,onTransmuxerLog:T,triggerSegmentEventFn:E})})},m_=({activeXhrs:i,decryptionWorker:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m,doneFn:v,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{let A=0,y=!1;return(k,w)=>{if(!y){if(k)return y=!0,co(i),v(k,w);if(A+=1,A===i.length){const I=function(){if(w.encryptedBytes)return p_({decryptionWorker:e,segment:w,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m,doneFn:v,onTransmuxerLog:T,triggerSegmentEventFn:E});Vf({segment:w,bytes:w.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m,doneFn:v,onTransmuxerLog:T,triggerSegmentEventFn:E})};if(w.endOfAllRequests=Date.now(),w.map&&w.map.encryptedBytes&&!w.map.bytes)return E({type:"segmentdecryptionstart",segment:w}),Hf({decryptionWorker:e,id:w.requestId+"-init",encryptedBytes:w.map.encryptedBytes,key:w.map.key,segment:w,doneFn:v},j=>{w.map.bytes=j,E({type:"segmentdecryptioncomplete",segment:w}),Uf(w,L=>{if(L)return co(i),v(L,w);I()})});I()}}}},g_=({loadendState:i,abortFn:e})=>t=>{t.target.aborted&&e&&!i.calledAbortFn&&(e(),i.calledAbortFn=!0)},v_=({segment:i,progressFn:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:f,dataFn:m})=>v=>{if(!v.target.aborted)return i.stats=ie(i.stats,l_(v)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),e(v,i)},y_=({xhr:i,xhrOptions:e,decryptionWorker:t,segment:s,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:v,isEndOfTimeline:T,endedTimelineFn:E,dataFn:A,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:w})=>{const I=[],j=m_({activeXhrs:I,decryptionWorker:t,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:v,isEndOfTimeline:T,endedTimelineFn:E,dataFn:A,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:w});if(s.key&&!s.key.bytes){const U=[s.key];s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&U.push(s.map.key);const X=ie(e,{uri:s.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),ae=Ac(s,U,j,w),J={uri:s.key.resolvedUri};w({type:"segmentkeyloadstart",segment:s,keyInfo:J});const le=i(X,ae);I.push(le)}if(s.map&&!s.map.bytes){if(s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri)){const le=ie(e,{uri:s.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),z=Ac(s,[s.map.key],j,w),Z={uri:s.map.key.resolvedUri};w({type:"segmentkeyloadstart",segment:s,keyInfo:Z});const Re=i(le,z);I.push(Re)}const X=ie(e,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:lo(s.map),requestType:"segment-media-initialization"}),ae=d_({segment:s,finishProcessingFn:j,triggerSegmentEventFn:w});w({type:"segmentloadstart",segment:s});const J=i(X,ae);I.push(J)}const L=ie(e,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:lo(s),requestType:"segment"}),O=h_({segment:s,finishProcessingFn:j,responseType:L.responseType,triggerSegmentEventFn:w});w({type:"segmentloadstart",segment:s});const F=i(L,O);F.addEventListener("progress",v_({segment:s,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:v,isEndOfTimeline:T,endedTimelineFn:E,dataFn:A})),I.push(F);const B={};return I.forEach(U=>{U.addEventListener("loadend",g_({loadendState:B,abortFn:r}))}),()=>co(I)},Wr=ot("PlaylistSelector"),wc=function(i){if(!i||!i.playlist)return;const e=i.playlist;return JSON.stringify({id:e.id,bandwidth:i.bandwidth,width:i.width,height:i.height,codecs:e.attributes&&e.attributes.CODECS||""})},qi=function(i,e){if(!i)return"";const t=S.getComputedStyle(i);return t?t[e]:""},zi=function(i,e){const t=i.slice();i.sort(function(s,r){const n=e(s,r);return n===0?t.indexOf(s)-t.indexOf(r):n})},fl=function(i,e){let t,s;return i.attributes.BANDWIDTH&&(t=i.attributes.BANDWIDTH),t=t||S.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(s=e.attributes.BANDWIDTH),s=s||S.Number.MAX_VALUE,t-s},__=function(i,e){let t,s;return i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(t=i.attributes.RESOLUTION.width),t=t||S.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(s=e.attributes.RESOLUTION.width),s=s||S.Number.MAX_VALUE,t===s&&i.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?i.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-s};let qf=function(i){const{main:e,bandwidth:t,playerWidth:s,playerHeight:r,playerObjectFit:n,limitRenditionByPlayerDimensions:a,playlistController:l}=i;if(!e)return;const u={bandwidth:t,width:s,height:r,limitRenditionByPlayerDimensions:a};let f=e.playlists;We.isAudioOnly(e)&&(f=l.getAudioTrackPlaylists_(),u.audioOnly=!0);let m=f.map(B=>{let U;const X=B.attributes&&B.attributes.RESOLUTION&&B.attributes.RESOLUTION.width,ae=B.attributes&&B.attributes.RESOLUTION&&B.attributes.RESOLUTION.height;return U=B.attributes&&B.attributes.BANDWIDTH,U=U||S.Number.MAX_VALUE,{bandwidth:U,width:X,height:ae,playlist:B}});zi(m,(B,U)=>B.bandwidth-U.bandwidth),m=m.filter(B=>!We.isIncompatible(B.playlist));let v=m.filter(B=>We.isEnabled(B.playlist));v.length||(v=m.filter(B=>!We.isDisabled(B.playlist)));const T=v.filter(B=>B.bandwidth*we.BANDWIDTH_VARIANCE<t);let E=T[T.length-1];const A=T.filter(B=>B.bandwidth===E.bandwidth)[0];if(a===!1){const B=A||v[0]||m[0];if(B&&B.playlist){let U="sortedPlaylistReps";return A&&(U="bandwidthBestRep"),v[0]&&(U="enabledPlaylistReps"),Wr(`choosing ${wc(B)} using ${U} with options`,u),B.playlist}return Wr("could not choose a playlist with options",u),null}const y=T.filter(B=>B.width&&B.height);zi(y,(B,U)=>B.width-U.width);const k=y.filter(B=>B.width===s&&B.height===r);E=k[k.length-1];const w=k.filter(B=>B.bandwidth===E.bandwidth)[0];let I,j,L;w||(I=y.filter(B=>n==="cover"?B.width>s&&B.height>r:B.width>s||B.height>r),j=I.filter(B=>B.width===I[0].width&&B.height===I[0].height),E=j[j.length-1],L=j.filter(B=>B.bandwidth===E.bandwidth)[0]);let O;if(l.leastPixelDiffSelector){const B=y.map(U=>(U.pixelDiff=Math.abs(U.width-s)+Math.abs(U.height-r),U));zi(B,(U,X)=>U.pixelDiff===X.pixelDiff?X.bandwidth-U.bandwidth:U.pixelDiff-X.pixelDiff),O=B[0]}const F=O||L||w||A||v[0]||m[0];if(F&&F.playlist){let B="sortedPlaylistReps";return O?B="leastPixelDiffRep":L?B="resolutionPlusOneRep":w?B="resolutionBestRep":A?B="bandwidthBestRep":v[0]&&(B="enabledPlaylistReps"),Wr(`choosing ${wc(F)} using ${B} with options`,u),F.playlist}return Wr("could not choose a playlist with options",u),null};const Dc=function(){let i=this.useDevicePixelRatio&&S.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),qf({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(qi(this.tech_.el(),"width"),10)*i,playerHeight:parseInt(qi(this.tech_.el(),"height"),10)*i,playerObjectFit:this.usePlayerObjectFit?qi(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},b_=function(i){let e=-1,t=-1;if(i<0||i>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let s=this.useDevicePixelRatio&&S.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=i*this.systemBandwidth+(1-i)*e,t=this.systemBandwidth),qf({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(qi(this.tech_.el(),"width"),10)*s,playerHeight:parseInt(qi(this.tech_.el(),"height"),10)*s,playerObjectFit:this.usePlayerObjectFit?qi(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},T_=function(i){const{main:e,currentTime:t,bandwidth:s,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:l,syncController:u}=i,f=e.playlists.filter(A=>!We.isIncompatible(A));let m=f.filter(We.isEnabled);m.length||(m=f.filter(A=>!We.isDisabled(A)));const T=m.filter(We.hasAttribute.bind(null,"BANDWIDTH")).map(A=>{const k=u.getSyncPoint(A,r,l,t)?1:2,I=We.estimateSegmentRequestTime(n,s,A)*k-a;return{playlist:A,rebufferingImpact:I}}),E=T.filter(A=>A.rebufferingImpact<=0);return zi(E,(A,y)=>fl(y.playlist,A.playlist)),E.length?E[0]:(zi(T,(A,y)=>A.rebufferingImpact-y.rebufferingImpact),T[0]||null)},x_=function(){const i=this.playlists.main.playlists.filter(We.isEnabled);return zi(i,(t,s)=>fl(t,s)),i.filter(t=>!!Xs(this.playlists.main,t).video)[0]||null},S_=i=>{let e=0,t;return i.bytes&&(t=new Uint8Array(i.bytes),i.segments.forEach(s=>{t.set(s,e),e+=s.byteLength})),t};function zf(i){try{return new URL(i).pathname.split("/").slice(-2).join("/")}catch{return""}}const C_=function(i,e,t){if(!i[t]){e.trigger({type:"usage",name:"vhs-608"});let s=t;/^cc708_/.test(t)&&(s="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(s);if(r)i[t]=r;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,l=t,u=!1;const f=n[s];f&&(a=f.label,l=f.language,u=f.default),i[t]=e.addRemoteTextTrack({kind:"captions",id:s,default:u,label:a,language:l},!1).track}}},E_=function({inbandTextTracks:i,captionArray:e,timestampOffset:t}){if(!e)return;const s=S.WebKitDataCue||S.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const l=new s(r.startTime+t,r.endTime+t,a.text);l.line=a.line,l.align="left",l.position=a.position,l.positionAlign="line-left",i[n].addCue(l)}):i[n].addCue(new s(r.startTime+t,r.endTime+t,r.text))})},A_=function(i){Object.defineProperties(i.frame,{id:{get(){return P.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key}},value:{get(){return P.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data}},privateData:{get(){return P.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data}}})},w_=({inbandTextTracks:i,metadataArray:e,timestampOffset:t,videoDuration:s})=>{if(!e)return;const r=S.WebKitDataCue||S.VTTCue,n=i.metadataTrack_;if(!n||(e.forEach(m=>{const v=m.cueTime+t;typeof v!="number"||S.isNaN(v)||v<0||!(v<1/0)||!m.frames||!m.frames.length||m.frames.forEach(T=>{const E=new r(v,v,T.value||T.url||T.data||"");E.frame=T,E.value=T,A_(E),n.addCue(E)})}),!n.cues||!n.cues.length))return;const a=n.cues,l=[];for(let m=0;m<a.length;m++)a[m]&&l.push(a[m]);const u=l.reduce((m,v)=>{const T=m[v.startTime]||[];return T.push(v),m[v.startTime]=T,m},{}),f=Object.keys(u).sort((m,v)=>Number(m)-Number(v));f.forEach((m,v)=>{const T=u[m],E=isFinite(s)?s:m,A=Number(f[v+1])||E;T.forEach(y=>{y.endTime=A})})},D_={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},k_=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),j_=({inbandTextTracks:i,dateRanges:e})=>{const t=i.metadataTrack_;if(!t)return;const s=S.WebKitDataCue||S.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(k_.has(n))continue;const a=new s(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:D_[n],data:r[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},kc=(i,e,t)=>{i.metadataTrack_||(i.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,P.browser.IS_ANY_SAFARI||(i.metadataTrack_.inBandMetadataTrackDispatchType=e))},Vs=function(i,e,t){let s,r;if(t&&t.cues)for(s=t.cues.length;s--;)r=t.cues[s],r.startTime>=i&&r.endTime<=e&&t.removeCue(r)},I_=function(i){const e=i.cues;if(!e)return;const t={};for(let s=e.length-1;s>=0;s--){const r=e[s],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?i.removeCue(r):t[n]=r}},P_=(i,e,t)=>{if(typeof e>"u"||e===null||!i.length)return[];const s=Math.ceil((e-t+3)*di.ONE_SECOND_IN_TS);let r;for(r=0;r<i.length&&!(i[r].pts>s);r++);return i.slice(r)},L_=(i,e,t)=>{if(!e.length)return i;if(t)return e.slice();const s=e[0].pts;let r=0;for(r;r<i.length&&!(i[r].pts>=s);r++);return i.slice(0,r).concat(e)},O_=(i,e,t,s)=>{const r=Math.ceil((e-s)*di.ONE_SECOND_IN_TS),n=Math.ceil((t-s)*di.ONE_SECOND_IN_TS),a=i.slice();let l=i.length;for(;l--&&!(i[l].pts<=n););if(l===-1)return a;let u=l+1;for(;u--&&!(i[u].pts<=r););return u=Math.max(u,0),a.splice(u,l-u+1),a},M_=function(i,e){if(!i&&!e||!i&&e||i&&!e)return!1;if(i===e)return!0;const t=Object.keys(i).sort(),s=Object.keys(e).sort();if(t.length!==s.length)return!1;for(let r=0;r<t.length;r++){const n=t[r];if(n!==s[r]||i[n]!==e[n])return!1}return!0},R_=function(i,e,t){e=e||[];const s=[];let r=0;for(let n=0;n<e.length;n++){const a=e[n];if(i===a.timeline&&(s.push(n),r+=a.duration,r>t))return n}return s.length===0?0:s[s.length-1]},Ms=1,N_=500,jc=i=>typeof i=="number"&&isFinite(i),Xr=1/60,B_=(i,e,t)=>i!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,F_=(i,e,t)=>{let s=e-we.BACK_BUFFER_LENGTH;i.length&&(s=Math.max(s,i.start(0)));const r=e-t;return Math.min(r,s)},Pi=i=>{const{startOfSegment:e,duration:t,segment:s,part:r,playlist:{mediaSequence:n,id:a,segments:l=[]},mediaIndex:u,partIndex:f,timeline:m}=i,v=l.length-1;let T="mediaIndex/partIndex increment";i.getMediaInfoForTime?T=`getMediaInfoForTime (${i.getMediaInfoForTime})`:i.isSyncRequest&&(T="getSyncSegmentCandidate (isSyncRequest)"),i.independent&&(T+=` with independent ${i.independent}`);const E=typeof f=="number",A=i.segment.uri?"segment":"pre-segment",y=E?lf({preloadSegment:s})-1:0;return`${A} [${n+u}/${n+v}]`+(E?` part [${f}/${y}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(E?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${m}] selected by [${T}] playlist [${a}]`},Ic=i=>`${i}TimingInfo`,U_=({segmentTimeline:i,currentTimeline:e,startOfSegment:t,buffered:s,overrideCheck:r})=>!r&&i===e?null:i<e?t:s.length?s.end(s.length-1):t,ho=({timelineChangeController:i,currentTimeline:e,segmentTimeline:t,loaderType:s,audioDisabled:r})=>{if(e===t)return!1;if(s==="audio"){const n=i.lastTimelineChange({type:"main"});return!n||n.to!==t}if(s==="main"&&r){const n=i.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},V_=i=>{if(!i)return!1;const e=i.pendingTimelineChange({type:"audio"}),t=i.pendingTimelineChange({type:"main"}),s=e&&t,r=s&&e.to!==t.to;return!!(s&&e.from!==-1&&t.from!==-1&&r)},H_=i=>{const e=i.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=i.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},Wt=i=>{const e=i.pendingSegment_;if(!e)return;if(ho({timelineChangeController:i.timelineChangeController_,currentTimeline:i.currentTimeline_,segmentTimeline:e.timeline,loaderType:i.loaderType_,audioDisabled:i.audioDisabled_})&&V_(i.timelineChangeController_)){if(H_(i)){i.timelineChangeController_.trigger("audioTimelineBehind");return}i.timelineChangeController_.trigger("fixBadTimelineChange")}},q_=i=>{let e=0;return["video","audio"].forEach(function(t){const s=i[`${t}TimingInfo`];if(!s)return;const{start:r,end:n}=s;let a;typeof r=="bigint"||typeof n=="bigint"?a=S.BigInt(n)-S.BigInt(r):typeof r=="number"&&typeof n=="number"&&(a=n-r),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),e},Pc=({segmentDuration:i,maxDuration:e})=>i?Math.round(i)>e+bt:!1,z_=(i,e)=>{if(e!=="hls")return null;const t=q_({audioTimingInfo:i.audioTimingInfo,videoTimingInfo:i.videoTimingInfo});if(!t)return null;const s=i.playlist.targetDuration,r=Pc({segmentDuration:t,maxDuration:s*2}),n=Pc({segmentDuration:t,maxDuration:s}),a=`Segment with index ${i.mediaIndex} from playlist ${i.playlist.id} has a duration of ${t} when the reported duration is ${i.duration} and the target duration is ${s}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||n?{severity:r?"warn":"info",message:a}:null},ci=({type:i,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),s=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:i||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:t,isMediaInitialization:s}};class fo extends P.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=ot(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(s){s!==this.state_&&(this.logger_(`${this.state_} -> ${s}`),this.state_=s,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wt(this)}),this.sourceUpdater_.on("codecschange",s=>{this.trigger(_e({type:"codecschange"},s))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wt(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",s=>{this.trigger(_e({type:"timelinechange"},s)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Wt(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wt(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return Na.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&S.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null),this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,S.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&Na.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return ke();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:s,isMuxed:r}=e;if(s&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(s)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const s=Tn(e);let r=this.initSegments_[s];return t&&!r&&e.bytes&&(this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const s=wf(e);let r=this.keyCache_[s];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[s]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;const s=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(s&&(s.id?n=s.id:s.uri&&(n=s.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:
205
205
  currentTime: ${this.currentTime_()}
206
- bufferedEnd: ${Na(this.buffered_())}
207
- `,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!s||s.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-s.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const l=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!l.parts||!l.parts.length||!l.parts[this.partIndex])){const u=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=u}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(s,e)}pause(){this.checkBufferTimeout_&&(S.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&Fa.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,s=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const a=()=>{n--,n===0&&s()};(r||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=V_(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const l in this.inbandTextTracks_)Vs(e,t,this.inbandTextTracks_[l]);Vs(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&S.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=S.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&S.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=S.setTimeout(this.monitorBufferTick_.bind(this),z_)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:ci({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,s=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!r||!r.parts||s+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=Na(e)||0,s=cl(e,this.currentTime_()),r=!this.hasPlayed_()&&s>=1,n=s>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const l={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(l.isSyncRequest)l.mediaIndex=q_(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${l.mediaIndex}`);else if(this.mediaIndex!==null){const T=a[this.mediaIndex],E=typeof this.partIndex=="number"?this.partIndex:-1;l.startOfSegment=T.end?T.end:t,T.parts&&T.parts[E+1]?(l.mediaIndex=this.mediaIndex,l.partIndex=E+1):l.mediaIndex=this.mediaIndex+1}else{let T,E,A;const y=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:
206
+ bufferedEnd: ${Ma(this.buffered_())}
207
+ `,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!s||s.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-s.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const l=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!l.parts||!l.parts.length||!l.parts[this.partIndex])){const u=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=u}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(s,e)}pause(){this.checkBufferTimeout_&&(S.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&Na.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,s=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const a=()=>{n--,n===0&&s()};(r||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=O_(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const l in this.inbandTextTracks_)Vs(e,t,this.inbandTextTracks_[l]);Vs(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&S.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=S.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&S.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=S.setTimeout(this.monitorBufferTick_.bind(this),N_)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:ci({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,s=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!r||!r.parts||s+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=Ma(e)||0,s=ll(e,this.currentTime_()),r=!this.hasPlayed_()&&s>=1,n=s>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const l={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(l.isSyncRequest)l.mediaIndex=R_(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${l.mediaIndex}`);else if(this.mediaIndex!==null){const T=a[this.mediaIndex],E=typeof this.partIndex=="number"?this.partIndex:-1;l.startOfSegment=T.end?T.end:t,T.parts&&T.parts[E+1]?(l.mediaIndex=this.mediaIndex,l.partIndex=E+1):l.mediaIndex=this.mediaIndex+1}else{let T,E,A;const y=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:
208
208
  For TargetTime: ${y}.
209
209
  CurrentTime: ${this.currentTime_()}
210
210
  BufferedEnd: ${t}
211
211
  Fetch At Buffer: ${this.fetchAtBuffer_}
212
- `,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const k=this.getSyncInfoFromMediaSequenceSync_(y);if(!k){const w="No sync info found while using media sequence sync";return this.error({message:w,metadata:{errorType:P.Error.StreamingFailedToSelectNextSegment,error:new Error(w)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${k.start} --> ${k.end})`),T=k.segmentIndex,E=k.partIndex,A=k.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const k=Ge.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:y,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});T=k.segmentIndex,E=k.partIndex,A=k.startTime}l.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${y}`:`currentTime ${y}`,l.mediaIndex=T,l.startOfSegment=A,l.partIndex=E,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${l.mediaIndex} `)}const u=a[l.mediaIndex];let f=u&&typeof l.partIndex=="number"&&u.parts&&u.parts[l.partIndex];if(!u||typeof l.partIndex=="number"&&!f)return null;typeof l.partIndex!="number"&&u.parts&&(l.partIndex=0,f=u.parts[0]);const m=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!s&&f&&!m&&!f.independent)if(l.partIndex===0){const T=a[l.mediaIndex-1],E=T.parts&&T.parts.length&&T.parts[T.parts.length-1];E&&E.independent&&(l.mediaIndex-=1,l.partIndex=T.parts.length-1,l.independent="previous segment")}else u.parts[l.partIndex-1].independent&&(l.partIndex-=1,l.independent="previous part");const v=this.mediaSource_&&this.mediaSource_.readyState==="ended";return l.mediaIndex>=a.length-1&&v&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,l.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(l))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const s=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!s)return null;if(!s.isAppended)return s;const r=this.mediaSequenceSync_.getSyncInfoForTime(s.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:s,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:l,forceTimestampOffset:u,getMediaInfoForTime:f}=e,m=s.segments[r],v=typeof l=="number"&&m.parts[l],T={requestId:"segment-loader-"+Math.random(),uri:v&&v.resolvedUri||m.resolvedUri,mediaIndex:r,partIndex:v?l:null,isSyncRequest:a,startOfSegment:n,playlist:s,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:m.timeline,duration:v&&v.duration||m.duration,segment:m,part:v,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:f,independent:t},E=typeof u<"u"?u:this.isPendingTimestampOffset_;T.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:m.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:E});const A=Na(this.sourceUpdater_.audioBuffered());return typeof A=="number"&&(T.audioAppendStart=A-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(T.gopsToAlignWith=F_(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),T}timestampOffsetForSegment_(e){return W_(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),s=e.bandwidth,r=this.pendingSegment_.duration,n=Ge.estimateSegmentRequestTime(r,s,this.playlist_,e.bytesReceived),a=my(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const l=D_({main:this.vhs_.playlists.main,currentTime:t,bandwidth:s,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!l)return;const f=n-a-l.rebufferingImpact;let m=.5;a<=bt&&(m=1),!(!l.playlist||l.playlist.uri===this.playlist_.uri||f<m)&&(this.bandwidth=l.playlist.attributes.BANDWIDTH*Ae.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${Pi(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:s,hasVideo:r}=t,n={segmentInfo:ci({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:s,hasVideo:r}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},H_(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wt(this))))}handleTimingInfo_(e,t,s,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,a=Lc(t);n[a]=n[a]||{},n[a][s]=r,this.logger_(`timinginfo: ${t} - ${s} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wt(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(t.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}const r=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),n={};t.forEach(a=>{n[a.stream]=n[a.stream]||{startTime:1/0,captions:[],endTime:0};const l=n[a.stream];l.startTime=Math.min(l.startTime,a.startTime+r),l.endTime=Math.max(l.endTime,a.endTime+r),l.captions.push(a)}),Object.keys(n).forEach(a=>{const{startTime:l,endTime:u,captions:f}=n[a],m=this.inbandTextTracks_;this.logger_(`adding cues from ${l} -> ${u} for ${a}`),I_(m,this.vhs_.tech_,a),Vs(l,u,m[a]),P_({captionArray:f,inbandTextTracks:m,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,s){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,s));return}this.addMetadataToTextTrack(s,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!po({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:s,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo||s&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||po({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){Wt(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const s=this.pendingSegment_;if(this.setTimeMapping_(s.timeline),this.updateMediaSecondsLoaded_(s.part||s.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),s.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),s.isFmp4=e.isFmp4,s.timingInfo=s.timingInfo||{},s.isFmp4)this.trigger("fmp4"),s.timingInfo.start=s[Lc(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=s.videoTimingInfo.start),s.timingInfo.start=this.trueSegmentStart_({currentStart:s.timingInfo.start,playlist:s.playlist,mediaIndex:s.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:s.videoTimingInfo,audioTimingInfo:s.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(s,t.type),this.updateSourceBufferTimestampOffset_(s),s.isSyncRequest){this.updateTimingInfoEnd_(s),this.syncController_.saveSegmentTimingInfo({segmentInfo:s,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==s.mediaIndex||r.partIndex!==s.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}s.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(s,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:s,playlist:r}){if(s){const n=Sn(s);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(s,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+hi(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+hi(a).join(", "));const l=n.length?n.start(0):0,u=n.length?n.end(n.length-1):0,f=a.length?a.start(0):0,m=a.length?a.end(a.length-1):0;if(u-l<=Ms&&m-f<=Ms){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${s.byteLength}, audio buffer: ${hi(n).join(", ")}, video buffer: ${hi(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:s}));const T=this.currentTime_()-Ms;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${T}`),this.remove(0,T,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Ms}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=S.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Ms*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:s},r){if(r){if(r.code===xf){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${s.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:P.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:s,data:r,bytes:n}){if(!n){const l=[r];let u=r.byteLength;s&&(l.unshift(s),u+=s.byteLength),n=j_({bytes:u,segments:l})}const a={segmentInfo:ci({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,s){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=s.prependedContentDuration||0,r[n].transmuxedPresentationStart=s.start.presentation,r[n].transmuxedDecodeStart=s.start.decode,r[n].transmuxedPresentationEnd=s.end.presentation,r[n].transmuxedDecodeEnd=s.end.decode,r[n].baseMediaDecodeTime=s.baseMediaDecodeTime}appendData_(e,t){const{type:s,data:r}=t;if(!r||!r.byteLength||s==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:s,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:s,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){Wt(this),this.loadQueue_.push(()=>{const t=_e({},e,{forceTimestampOffset:!0});_e(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),s=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=s||r&&n;this.logger_(`Requesting
213
- ${Wf(e.uri)}
214
- ${Pi(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=E_({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:l,level:u,stream:f})=>{this.logger_(`${Pi(e)} logged from transmuxer stream ${f} as a ${u}: ${l}`)},triggerSegmentEventFn:({type:l,segment:u,keyInfo:f,trackInfo:m,timingInfo:v})=>{const E={segmentInfo:ci({segment:u})};f&&(E.keyInfo=f),m&&(E.trackInfo=m),v&&(E.timingInfo=v),this.trigger({type:l,metadata:E})}})}trimBackBuffer_(e){const t=G_(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,s=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:s?s.resolvedUri:t.resolvedUri,byterange:s?s.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:n},l=e.playlist.segments[e.mediaIndex-1];if(l&&l.timeline===t.timeline&&(l.videoTimingInfo?a.baseStartTime=l.videoTimingInfo.transmuxedDecodeEnd:l.audioTimingInfo&&(a.baseStartTime=l.audioTimingInfo.transmuxedDecodeEnd)),t.key){const u=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=u}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<Yr){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${Yr}`);return}const s={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:s}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,s){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,s));return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===xt.ABORTED)return;if(this.pause(),e.code===xt.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,s.gopInfo&&(this.gopBuffer_=U_(this.gopBuffer_,s.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);t!==null&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:s,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:n,useVideoTimingInfo:a,videoTimingInfo:l,audioTimingInfo:u}){if(typeof e<"u")return e;if(!a)return u.start;const f=t.segments[s-1];return s===0||!f||typeof f.start>"u"||f.end!==r+n?r:l.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:s,hasVideo:r,isMuxed:n}=t,a=this.loaderType_==="main"&&r,l=!this.audioDisabled_&&s&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}a&&e.waitingOnAppends++,l&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),l&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=$_(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:s}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:s.start:s.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),r=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;r&&(e.timingInfo.end=typeof r.end=="number"?r.end:r.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const u={segmentInfo:ci({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:u})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=Q_(e,this.sourceType_);if(t&&(t.severity==="warn"?P.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Pi(e)}`);return}this.logger_(`Appended ${Pi(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const s=e.segment,r=e.part,n=s.end&&this.currentTime_()-s.end>e.playlist.targetDuration*3,a=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${Pi(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<Yr){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${Yr}`);return}const t=this.throughput.rate,s=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/s*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,s=t.start,r=t.end;if(!Pc(s)||!Pc(r))return;Vs(s,r,this.segmentMetadataTrack_);const n=S.WebKitDataCue||S.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:s,end:r},l=JSON.stringify(a),u=new n(s,r,l);u.value=a,this.segmentMetadataTrack_.addCue(u)}}function Pt(){}const Xf=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},J_=["video","audio"],go=(i,e)=>{const t=e[`${i}Buffer`];return t&&t.updating||e.queuePending[i]},Z_=(i,e)=>{for(let t=0;t<e.length;t++){const s=e[t];if(s.type==="mediaSource")return null;if(s.type===i)return t}return null},$i=(i,e)=>{if(e.queue.length===0)return;let t=0,s=e.queue[t];if(s.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),s.action(e),s.doneFn&&s.doneFn(),$i("audio",e),$i("video",e));return}if(i!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||go(i,e))){if(s.type!==i){if(t=Z_(i,e.queue),t===null)return;s=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[i]=s,s.action(i,e),!s.doneFn){e.queuePending[i]=null,$i(i,e);return}}},Yf=(i,e)=>{const t=e[`${i}Buffer`],s=Xf(i);t&&(t.removeEventListener("updateend",e[`on${s}UpdateEnd_`]),t.removeEventListener("error",e[`on${s}Error_`]),e.codecs[i]=null,e[`${i}Buffer`]=null)},yt=(i,e)=>i&&e&&Array.prototype.indexOf.call(i.sourceBuffers,e)!==-1,Qe={appendBuffer:(i,e,t)=>(s,r)=>{const n=r[`${s}Buffer`];if(yt(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${i.length} bytes to ${s}Buffer`);try{n.appendBuffer(i)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===xf?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${s}Buffer`),r.queuePending[s]=null,t(a)}}},remove:(i,e)=>(t,s)=>{const r=s[`${t}Buffer`];if(yt(s.mediaSource,r)){s.logger_(`Removing ${i} to ${e} from ${t}Buffer`);try{r.remove(i,e)}catch{s.logger_(`Remove ${i} to ${e} from ${t}Buffer failed`)}}},timestampOffset:i=>(e,t)=>{const s=t[`${e}Buffer`];yt(t.mediaSource,s)&&(t.logger_(`Setting ${e}timestampOffset to ${i}`),s.timestampOffset=i)},callback:i=>(e,t)=>{i()},endOfStream:i=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${i||""})`);try{e.mediaSource.endOfStream(i)}catch(t){P.log.warn("Failed to call media source endOfStream",t)}}},duration:i=>e=>{e.logger_(`Setting mediaSource duration to ${i}`);try{e.mediaSource.duration=i}catch(t){P.log.warn("Failed to set media source duration",t)}},abort:()=>(i,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${i}Buffer`];if(yt(e.mediaSource,t)){e.logger_(`calling abort on ${i}Buffer`);try{t.abort()}catch(s){P.log.warn(`Failed to abort on ${i}Buffer`,s)}}},addSourceBuffer:(i,e)=>t=>{const s=Xf(i),r=Gi(e);t.logger_(`Adding ${i}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${s}UpdateEnd_`]),n.addEventListener("error",t[`on${s}Error_`]),t.codecs[i]=e,t[`${i}Buffer`]=n},removeSourceBuffer:i=>e=>{const t=e[`${i}Buffer`];if(Yf(i,e),!!yt(e.mediaSource,t)){e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(s){P.log.warn(`Failed to removeSourceBuffer ${i}Buffer`,s)}}},changeType:i=>(e,t)=>{const s=t[`${e}Buffer`],r=Gi(i);if(!yt(t.mediaSource,s))return;const n=i.substring(0,i.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const u={codecsChangeInfo:{from:a,to:i}};t.trigger({type:"codecschange",metadata:u}),t.logger_(`changing ${e}Buffer codec from ${a} to ${i}`);try{s.changeType(r),t.codecs[e]=i}catch(f){u.errorType=P.Error.StreamingCodecsChangeError,u.error=f,f.metadata=u,t.error_=f,t.trigger("error"),P.log.warn(`Failed to changeType on ${e}Buffer`,f)}}},Je=({type:i,sourceUpdater:e,action:t,doneFn:s,name:r})=>{e.queue.push({type:i,action:t,doneFn:s,name:r}),$i(i,e)},Mc=(i,e)=>t=>{const s=e[`${i}Buffered`](),r=hy(s);if(e.logger_(`received "updateend" event for ${i} Source Buffer: `,r),e.queuePending[i]){const n=e.queuePending[i].doneFn;e.queuePending[i]=null,n&&n(e[`${i}Error_`])}$i(i,e)};class Kf extends P.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>$i("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=at("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Mc("video",this),this.onAudioUpdateEnd_=Mc("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){Je({type:"mediaSource",sourceUpdater:this,action:Qe.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){Je({type:e,sourceUpdater:this,action:Qe.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){P.log.error("removeSourceBuffer is not supported!");return}Je({type:"mediaSource",sourceUpdater:this,action:Qe.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!P.browser.IS_FIREFOX&&S.MediaSource&&S.MediaSource.prototype&&typeof S.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return S.SourceBuffer&&S.SourceBuffer.prototype&&typeof S.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){P.log.error("changeType is not supported!");return}Je({type:e,sourceUpdater:this,action:Qe.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const s=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,s);this.canChangeType()&&this.changeType(t,s)})}appendBuffer(e,t){const{segmentInfo:s,type:r,bytes:n}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const a=t;if(Je({type:r,sourceUpdater:this,action:Qe.appendBuffer(n,s||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const l=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${l.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,l.forEach(u=>{this.appendBuffer.apply(this,u)})}}audioBuffered(){return yt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:De()}videoBuffered(){return yt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:De()}buffered(){const e=yt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=yt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():py(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Pt){Je({type:"mediaSource",sourceUpdater:this,action:Qe.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Pt){typeof e!="string"&&(e=void 0),Je({type:"mediaSource",sourceUpdater:this,action:Qe.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,s=Pt){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){s();return}Je({type:"audio",sourceUpdater:this,action:Qe.remove(e,t),doneFn:s,name:"remove"})}removeVideo(e,t,s=Pt){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){s();return}Je({type:"video",sourceUpdater:this,action:Qe.remove(e,t),doneFn:s,name:"remove"})}updating(){return!!(go("audio",this)||go("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Je({type:"audio",sourceUpdater:this,action:Qe.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(Je({type:"video",sourceUpdater:this,action:Qe.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Je({type:"audio",sourceUpdater:this,action:Qe.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Je({type:"video",sourceUpdater:this,action:Qe.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),J_.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Yf(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Rc=i=>decodeURIComponent(escape(String.fromCharCode.apply(null,i))),eb=i=>{const e=new Uint8Array(i);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},Nc=new Uint8Array(`
212
+ `,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const k=this.getSyncInfoFromMediaSequenceSync_(y);if(!k){const w="No sync info found while using media sequence sync";return this.error({message:w,metadata:{errorType:P.Error.StreamingFailedToSelectNextSegment,error:new Error(w)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${k.start} --> ${k.end})`),T=k.segmentIndex,E=k.partIndex,A=k.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const k=We.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:y,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});T=k.segmentIndex,E=k.partIndex,A=k.startTime}l.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${y}`:`currentTime ${y}`,l.mediaIndex=T,l.startOfSegment=A,l.partIndex=E,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${l.mediaIndex} `)}const u=a[l.mediaIndex];let f=u&&typeof l.partIndex=="number"&&u.parts&&u.parts[l.partIndex];if(!u||typeof l.partIndex=="number"&&!f)return null;typeof l.partIndex!="number"&&u.parts&&(l.partIndex=0,f=u.parts[0]);const m=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!s&&f&&!m&&!f.independent)if(l.partIndex===0){const T=a[l.mediaIndex-1],E=T.parts&&T.parts.length&&T.parts[T.parts.length-1];E&&E.independent&&(l.mediaIndex-=1,l.partIndex=T.parts.length-1,l.independent="previous segment")}else u.parts[l.partIndex-1].independent&&(l.partIndex-=1,l.independent="previous part");const v=this.mediaSource_&&this.mediaSource_.readyState==="ended";return l.mediaIndex>=a.length-1&&v&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,l.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(l))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const s=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!s)return null;if(!s.isAppended)return s;const r=this.mediaSequenceSync_.getSyncInfoForTime(s.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:s,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:l,forceTimestampOffset:u,getMediaInfoForTime:f}=e,m=s.segments[r],v=typeof l=="number"&&m.parts[l],T={requestId:"segment-loader-"+Math.random(),uri:v&&v.resolvedUri||m.resolvedUri,mediaIndex:r,partIndex:v?l:null,isSyncRequest:a,startOfSegment:n,playlist:s,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:m.timeline,duration:v&&v.duration||m.duration,segment:m,part:v,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:f,independent:t},E=typeof u<"u"?u:this.isPendingTimestampOffset_;T.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:m.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:E});const A=Ma(this.sourceUpdater_.audioBuffered());return typeof A=="number"&&(T.audioAppendStart=A-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(T.gopsToAlignWith=P_(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),T}timestampOffsetForSegment_(e){return U_(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),s=e.bandwidth,r=this.pendingSegment_.duration,n=We.estimateSegmentRequestTime(r,s,this.playlist_,e.bytesReceived),a=ly(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const l=T_({main:this.vhs_.playlists.main,currentTime:t,bandwidth:s,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!l)return;const f=n-a-l.rebufferingImpact;let m=.5;a<=bt&&(m=1),!(!l.playlist||l.playlist.uri===this.playlist_.uri||f<m)&&(this.bandwidth=l.playlist.attributes.BANDWIDTH*we.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${Pi(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:s,hasVideo:r}=t,n={segmentInfo:ci({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:s,hasVideo:r}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},M_(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wt(this))))}handleTimingInfo_(e,t,s,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,a=Ic(t);n[a]=n[a]||{},n[a][s]=r,this.logger_(`timinginfo: ${t} - ${s} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wt(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(t.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}const r=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),n={};t.forEach(a=>{n[a.stream]=n[a.stream]||{startTime:1/0,captions:[],endTime:0};const l=n[a.stream];l.startTime=Math.min(l.startTime,a.startTime+r),l.endTime=Math.max(l.endTime,a.endTime+r),l.captions.push(a)}),Object.keys(n).forEach(a=>{const{startTime:l,endTime:u,captions:f}=n[a],m=this.inbandTextTracks_;this.logger_(`adding cues from ${l} -> ${u} for ${a}`),C_(m,this.vhs_.tech_,a),Vs(l,u,m[a]),E_({captionArray:f,inbandTextTracks:m,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,s){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,s));return}this.addMetadataToTextTrack(s,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!ho({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:s,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo||s&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||ho({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){Wt(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const s=this.pendingSegment_;if(this.setTimeMapping_(s.timeline),this.updateMediaSecondsLoaded_(s.part||s.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),s.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),s.isFmp4=e.isFmp4,s.timingInfo=s.timingInfo||{},s.isFmp4)this.trigger("fmp4"),s.timingInfo.start=s[Ic(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=s.videoTimingInfo.start),s.timingInfo.start=this.trueSegmentStart_({currentStart:s.timingInfo.start,playlist:s.playlist,mediaIndex:s.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:s.videoTimingInfo,audioTimingInfo:s.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(s,t.type),this.updateSourceBufferTimestampOffset_(s),s.isSyncRequest){this.updateTimingInfoEnd_(s),this.syncController_.saveSegmentTimingInfo({segmentInfo:s,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==s.mediaIndex||r.partIndex!==s.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}s.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(s,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:s,playlist:r}){if(s){const n=Tn(s);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(s,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+hi(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+hi(a).join(", "));const l=n.length?n.start(0):0,u=n.length?n.end(n.length-1):0,f=a.length?a.start(0):0,m=a.length?a.end(a.length-1):0;if(u-l<=Ms&&m-f<=Ms){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${s.byteLength}, audio buffer: ${hi(n).join(", ")}, video buffer: ${hi(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:s}));const T=this.currentTime_()-Ms;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${T}`),this.remove(0,T,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Ms}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=S.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Ms*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:s},r){if(r){if(r.code===_f){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${s.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:P.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:s,data:r,bytes:n}){if(!n){const l=[r];let u=r.byteLength;s&&(l.unshift(s),u+=s.byteLength),n=S_({bytes:u,segments:l})}const a={segmentInfo:ci({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,s){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=s.prependedContentDuration||0,r[n].transmuxedPresentationStart=s.start.presentation,r[n].transmuxedDecodeStart=s.start.decode,r[n].transmuxedPresentationEnd=s.end.presentation,r[n].transmuxedDecodeEnd=s.end.decode,r[n].baseMediaDecodeTime=s.baseMediaDecodeTime}appendData_(e,t){const{type:s,data:r}=t;if(!r||!r.byteLength||s==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:s,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:s,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){Wt(this),this.loadQueue_.push(()=>{const t=_e({},e,{forceTimestampOffset:!0});_e(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),s=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=s||r&&n;this.logger_(`Requesting
213
+ ${zf(e.uri)}
214
+ ${Pi(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=y_({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:l,level:u,stream:f})=>{this.logger_(`${Pi(e)} logged from transmuxer stream ${f} as a ${u}: ${l}`)},triggerSegmentEventFn:({type:l,segment:u,keyInfo:f,trackInfo:m,timingInfo:v})=>{const E={segmentInfo:ci({segment:u})};f&&(E.keyInfo=f),m&&(E.trackInfo=m),v&&(E.timingInfo=v),this.trigger({type:l,metadata:E})}})}trimBackBuffer_(e){const t=F_(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,s=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:s?s.resolvedUri:t.resolvedUri,byterange:s?s.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:n},l=e.playlist.segments[e.mediaIndex-1];if(l&&l.timeline===t.timeline&&(l.videoTimingInfo?a.baseStartTime=l.videoTimingInfo.transmuxedDecodeEnd:l.audioTimingInfo&&(a.baseStartTime=l.audioTimingInfo.transmuxedDecodeEnd)),t.key){const u=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=u}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<Xr){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${Xr}`);return}const s={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:s}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,s){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,s));return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===xt.ABORTED)return;if(this.pause(),e.code===xt.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,s.gopInfo&&(this.gopBuffer_=L_(this.gopBuffer_,s.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);t!==null&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:s,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:n,useVideoTimingInfo:a,videoTimingInfo:l,audioTimingInfo:u}){if(typeof e<"u")return e;if(!a)return u.start;const f=t.segments[s-1];return s===0||!f||typeof f.start>"u"||f.end!==r+n?r:l.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:s,hasVideo:r,isMuxed:n}=t,a=this.loaderType_==="main"&&r,l=!this.audioDisabled_&&s&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}a&&e.waitingOnAppends++,l&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),l&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=B_(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:s}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:s.start:s.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),r=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;r&&(e.timingInfo.end=typeof r.end=="number"?r.end:r.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const u={segmentInfo:ci({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:u})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=z_(e,this.sourceType_);if(t&&(t.severity==="warn"?P.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Pi(e)}`);return}this.logger_(`Appended ${Pi(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const s=e.segment,r=e.part,n=s.end&&this.currentTime_()-s.end>e.playlist.targetDuration*3,a=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${Pi(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<Xr){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${Xr}`);return}const t=this.throughput.rate,s=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/s*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,s=t.start,r=t.end;if(!jc(s)||!jc(r))return;Vs(s,r,this.segmentMetadataTrack_);const n=S.WebKitDataCue||S.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:s,end:r},l=JSON.stringify(a),u=new n(s,r,l);u.value=a,this.segmentMetadataTrack_.addCue(u)}}function Pt(){}const $f=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},$_=["video","audio"],po=(i,e)=>{const t=e[`${i}Buffer`];return t&&t.updating||e.queuePending[i]},G_=(i,e)=>{for(let t=0;t<e.length;t++){const s=e[t];if(s.type==="mediaSource")return null;if(s.type===i)return t}return null},$i=(i,e)=>{if(e.queue.length===0)return;let t=0,s=e.queue[t];if(s.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),s.action(e),s.doneFn&&s.doneFn(),$i("audio",e),$i("video",e));return}if(i!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||po(i,e))){if(s.type!==i){if(t=G_(i,e.queue),t===null)return;s=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[i]=s,s.action(i,e),!s.doneFn){e.queuePending[i]=null,$i(i,e);return}}},Gf=(i,e)=>{const t=e[`${i}Buffer`],s=$f(i);t&&(t.removeEventListener("updateend",e[`on${s}UpdateEnd_`]),t.removeEventListener("error",e[`on${s}Error_`]),e.codecs[i]=null,e[`${i}Buffer`]=null)},yt=(i,e)=>i&&e&&Array.prototype.indexOf.call(i.sourceBuffers,e)!==-1,Je={appendBuffer:(i,e,t)=>(s,r)=>{const n=r[`${s}Buffer`];if(yt(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${i.length} bytes to ${s}Buffer`);try{n.appendBuffer(i)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===_f?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${s}Buffer`),r.queuePending[s]=null,t(a)}}},remove:(i,e)=>(t,s)=>{const r=s[`${t}Buffer`];if(yt(s.mediaSource,r)){s.logger_(`Removing ${i} to ${e} from ${t}Buffer`);try{r.remove(i,e)}catch{s.logger_(`Remove ${i} to ${e} from ${t}Buffer failed`)}}},timestampOffset:i=>(e,t)=>{const s=t[`${e}Buffer`];yt(t.mediaSource,s)&&(t.logger_(`Setting ${e}timestampOffset to ${i}`),s.timestampOffset=i)},callback:i=>(e,t)=>{i()},endOfStream:i=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${i||""})`);try{e.mediaSource.endOfStream(i)}catch(t){P.log.warn("Failed to call media source endOfStream",t)}}},duration:i=>e=>{e.logger_(`Setting mediaSource duration to ${i}`);try{e.mediaSource.duration=i}catch(t){P.log.warn("Failed to set media source duration",t)}},abort:()=>(i,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${i}Buffer`];if(yt(e.mediaSource,t)){e.logger_(`calling abort on ${i}Buffer`);try{t.abort()}catch(s){P.log.warn(`Failed to abort on ${i}Buffer`,s)}}},addSourceBuffer:(i,e)=>t=>{const s=$f(i),r=Gi(e);t.logger_(`Adding ${i}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${s}UpdateEnd_`]),n.addEventListener("error",t[`on${s}Error_`]),t.codecs[i]=e,t[`${i}Buffer`]=n},removeSourceBuffer:i=>e=>{const t=e[`${i}Buffer`];if(Gf(i,e),!!yt(e.mediaSource,t)){e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(s){P.log.warn(`Failed to removeSourceBuffer ${i}Buffer`,s)}}},changeType:i=>(e,t)=>{const s=t[`${e}Buffer`],r=Gi(i);if(!yt(t.mediaSource,s))return;const n=i.substring(0,i.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const u={codecsChangeInfo:{from:a,to:i}};t.trigger({type:"codecschange",metadata:u}),t.logger_(`changing ${e}Buffer codec from ${a} to ${i}`);try{s.changeType(r),t.codecs[e]=i}catch(f){u.errorType=P.Error.StreamingCodecsChangeError,u.error=f,f.metadata=u,t.error_=f,t.trigger("error"),P.log.warn(`Failed to changeType on ${e}Buffer`,f)}}},Ze=({type:i,sourceUpdater:e,action:t,doneFn:s,name:r})=>{e.queue.push({type:i,action:t,doneFn:s,name:r}),$i(i,e)},Lc=(i,e)=>t=>{const s=e[`${i}Buffered`](),r=ny(s);if(e.logger_(`received "updateend" event for ${i} Source Buffer: `,r),e.queuePending[i]){const n=e.queuePending[i].doneFn;e.queuePending[i]=null,n&&n(e[`${i}Error_`])}$i(i,e)};class Wf extends P.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>$i("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=ot("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Lc("video",this),this.onAudioUpdateEnd_=Lc("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){Ze({type:"mediaSource",sourceUpdater:this,action:Je.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){Ze({type:e,sourceUpdater:this,action:Je.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){P.log.error("removeSourceBuffer is not supported!");return}Ze({type:"mediaSource",sourceUpdater:this,action:Je.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!P.browser.IS_FIREFOX&&S.MediaSource&&S.MediaSource.prototype&&typeof S.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return S.SourceBuffer&&S.SourceBuffer.prototype&&typeof S.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){P.log.error("changeType is not supported!");return}Ze({type:e,sourceUpdater:this,action:Je.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const s=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,s);this.canChangeType()&&this.changeType(t,s)})}appendBuffer(e,t){const{segmentInfo:s,type:r,bytes:n}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const a=t;if(Ze({type:r,sourceUpdater:this,action:Je.appendBuffer(n,s||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const l=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${l.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,l.forEach(u=>{this.appendBuffer.apply(this,u)})}}audioBuffered(){return yt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:ke()}videoBuffered(){return yt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:ke()}buffered(){const e=yt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=yt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():oy(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Pt){Ze({type:"mediaSource",sourceUpdater:this,action:Je.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Pt){typeof e!="string"&&(e=void 0),Ze({type:"mediaSource",sourceUpdater:this,action:Je.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,s=Pt){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){s();return}Ze({type:"audio",sourceUpdater:this,action:Je.remove(e,t),doneFn:s,name:"remove"})}removeVideo(e,t,s=Pt){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){s();return}Ze({type:"video",sourceUpdater:this,action:Je.remove(e,t),doneFn:s,name:"remove"})}updating(){return!!(po("audio",this)||po("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Ze({type:"audio",sourceUpdater:this,action:Je.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(Ze({type:"video",sourceUpdater:this,action:Je.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Ze({type:"audio",sourceUpdater:this,action:Je.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Ze({type:"video",sourceUpdater:this,action:Je.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),$_.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Gf(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Oc=i=>decodeURIComponent(escape(String.fromCharCode.apply(null,i))),W_=i=>{const e=new Uint8Array(i);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},Mc=new Uint8Array(`
215
215
 
216
- `.split("").map(i=>i.charCodeAt(0)));class tb extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class ib extends mo{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return De();const e=this.subtitlesTrack_.cues,t=e[0].startTime,s=e[e.length-1].startTime;return De([[t,s]])}initSegmentForMap(e,t=!1){if(!e)return null;const s=Sn(e);let r=this.initSegments_[s];if(t&&!r&&e.bytes){const n=Nc.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(Nc,e.bytes.byteLength),this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){Vs(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,s){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===xt.TIMEOUT&&this.handleTimeout_(),e.code===xt.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const r=this.pendingSegment_,n=s.mp4VttCues&&s.mp4VttCues.length;n&&(r.mp4VttCues=s.mp4VttCues),this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof S.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,s),()=>this.stopForError({message:"Error loading vtt.js"}));return}a.requested=!0;try{this.parseVTTCues_(r)}catch(l){this.stopForError({message:l.message,metadata:{errorType:P.Error.StreamingVttParserError,error:l}});return}if(n||this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach(l=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new S.VTTCue(l.startTime,l.endTime,l.text):l)}),B_(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){const s=e&&e.type==="vtt",r=t&&t.type==="text";s&&r&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const t=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(s=>{const r=s.start+t,n=s.end+t,a=new S.VTTCue(r,n,s.cueText);s.settings&&s.settings.split(" ").forEach(l=>{const u=l.split(":"),f=u[0],m=u[1];a[f]=isNaN(m)?m:Number(m)}),e.cues.push(a)})}parseVTTCues_(e){let t,s=!1;if(typeof S.WebVTT!="function")throw new tb;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof S.TextDecoder=="function"?t=new S.TextDecoder("utf8"):(t=S.WebVTT.StringDecoder(),s=!0);const r=new S.WebVTT.Parser(S,S.vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{P.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;s&&(a=Rc(a)),r.parse(a)}let n=e.bytes;s&&(n=Rc(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,s){const r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:n,LOCAL:a}=e.timestampmap,u=n/di.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(f=>{const m=f.endTime-f.startTime,v=this.handleRollover_(f.startTime+u,t.time);f.startTime=Math.max(v,0),f.endTime=Math.max(v+m,0)}),!s.syncInfo){const f=e.cues[0].startTime,m=e.cues[e.cues.length-1].startTime;s.syncInfo={mediaSequence:s.mediaSequence+e.mediaIndex,time:Math.min(f,m-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let s=e*di.ONE_SECOND_IN_TS;const r=t*di.ONE_SECOND_IN_TS;let n;for(r<s?n=-8589934592:n=8589934592;Math.abs(s-r)>4294967296;)s+=n;return s/di.ONE_SECOND_IN_TS}}const sb=function(i,e){const t=i.cues;for(let s=0;s<t.length;s++){const r=t[s];if(e>=r.adStartTime&&e<=r.adEndTime)return r}return null},rb=function(i,e,t=0){if(!i.segments)return;let s=t,r;for(let n=0;n<i.segments.length;n++){const a=i.segments[n];if(r||(r=sb(e,s+a.duration/2)),r){if("cueIn"in a){r.endTime=s,r.adEndTime=s,s+=a.duration,r=null;continue}if(s<r.endTime){s+=a.duration;continue}r.endTime+=a.duration}else if("cueOut"in a&&(r=new S.VTTCue(s,s+a.duration,a.cueOut),r.adStartTime=s,r.adEndTime=s+parseFloat(a.cueOut),e.addCue(r)),"cueOutCont"in a){const[l,u]=a.cueOutCont.split("/").map(parseFloat);r=new S.VTTCue(s,s+a.duration,""),r.adStartTime=s-l,r.adEndTime=r.adStartTime+u,e.addCue(r)}s+=a.duration}};class Bc{constructor({start:e,end:t,segmentIndex:s,partIndex:r=null,appended:n=!1}){this.start_=e,this.end_=t,this.segmentIndex_=s,this.partIndex_=r,this.appended_=n}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class nb{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class Qf{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:s,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(s,r),!!this.isReliable_)return this.updateStorage_(r,s,this.calculateBaseTime_(s,r,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:s}of this.storage_.values())if(s.length){for(const r of s)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,s){const r=new Map;let n=`
217
- `,a=s,l=t;this.start_=a,e.forEach((u,f)=>{const m=this.storage_.get(l),v=a,T=v+u.duration,E=!!(m&&m.segmentSyncInfo&&m.segmentSyncInfo.isAppended),A=new Bc({start:v,end:T,appended:E,segmentIndex:f});u.syncInfo=A;let y=a;const k=(u.parts||[]).map((w,I)=>{const j=y,L=y+w.duration,O=!!(m&&m.partsSyncInfo&&m.partsSyncInfo[I]&&m.partsSyncInfo[I].isAppended),F=new Bc({start:j,end:L,appended:O,segmentIndex:f,partIndex:I});return y=L,n+=`Media Sequence: ${l}.${I} | Range: ${j} --> ${L} | Appended: ${O}
218
- `,w.syncInfo=F,F});r.set(l,new nb(A,k)),n+=`${Wf(u.resolvedUri)} | Media Sequence: ${l} | Range: ${v} --> ${T} | Appended: ${E}
219
- `,l++,a=T}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t,s){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const r=Math.min(...this.storage_.keys());if(e<r){const n=r-e;let a=this.storage_.get(r).segmentSyncInfo.start;for(let l=0;l<n;l++){const u=t[l];a-=u.duration}return a}return s}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class Fc extends Qf{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,s){if(!this.storage_.size){const r=this.parent_.getSyncInfoForMediaSequence(e);return r?r.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,s)}}const ab=86400,Ua=[{name:"VOD",run:(i,e,t,s,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(i,e,t,s,r,n)=>{const a=i.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const l=a.getSyncInfoForTime(r);return l?{time:l.start,partIndex:l.partIndex,segmentIndex:l.segmentIndex}:null}},{name:"ProgramDateTime",run:(i,e,t,s,r)=>{if(!Object.keys(i.timelineToDatetimeMappings).length)return null;let n=null,a=null;const l=no(e);r=r||0;for(let u=0;u<l.length;u++){const f=e.endList||r===0?u:l.length-(u+1),m=l[f],v=m.segment,T=i.timelineToDatetimeMappings[v.timeline];if(!T||!v.dateTimeObject)continue;let A=v.dateTimeObject.getTime()/1e3+T;if(v.parts&&typeof m.partIndex=="number")for(let k=0;k<m.partIndex;k++)A+=v.parts[k].duration;const y=Math.abs(r-A);if(a!==null&&(y===0||a<y))break;a=y,n={time:A,segmentIndex:m.segmentIndex,partIndex:m.partIndex}}return n}},{name:"Segment",run:(i,e,t,s,r)=>{let n=null,a=null;r=r||0;const l=no(e);for(let u=0;u<l.length;u++){const f=e.endList||r===0?u:l.length-(u+1),m=l[f],v=m.segment,T=m.part&&m.part.start||v&&v.start;if(v.timeline===s&&typeof T<"u"){const E=Math.abs(r-T);if(a!==null&&a<E)break;(!n||a===null||a>=E)&&(a=E,n={time:T,segmentIndex:m.segmentIndex,partIndex:m.partIndex})}}return n}},{name:"Discontinuity",run:(i,e,t,s,r)=>{let n=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let l=0;l<e.discontinuityStarts.length;l++){const u=e.discontinuityStarts[l],f=e.discontinuitySequence+l+1,m=i.discontinuities[f];if(m){const v=Math.abs(r-m.time);if(a!==null&&a<v)break;(!n||a===null||a>=v)&&(a=v,n={time:m.time,segmentIndex:u,partIndex:null})}}}return n}},{name:"Playlist",run:(i,e,t,s,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class ob extends P.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new Qf,s=new Fc(t),r=new Fc(t);this.mediaSequenceStorage_={main:t,audio:s,vtt:r},this.logger_=at("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,s,r,n){if(t!==1/0)return Ua.find(({name:u})=>u==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,s,r,n);if(!a.length)return null;for(const l of a){const{syncPoint:u,strategy:f}=l,{segmentIndex:m,time:v}=u;if(m<0)continue;const T=e.segments[m],E=v,A=E+T.duration;if(this.logger_(`Strategy: ${f}. Current time: ${r}. selected segment: ${m}. Time: [${E} -> ${A}]}`),r>=E&&r<A)return this.logger_("Found sync point with exact match: ",u),u}return this.selectSyncPoint_(a,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;const s=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!s.length)return null;const r=this.selectSyncPoint_(s,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Ws({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,s,r,n){const a=[];for(let l=0;l<Ua.length;l++){const u=Ua[l],f=u.run(this,e,t,s,r,n);f&&(f.strategy=u.name,a.push({strategy:u.name,syncPoint:f}))}return a}selectSyncPoint_(e,t){let s=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),n=e[0].strategy;for(let a=1;a<e.length;a++){const l=Math.abs(e[a].syncPoint[t.key]-t.value);l<r&&(r=l,s=e[a].syncPoint,n=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${n}]: [time:${s.time}, segmentIndex:${s.segmentIndex}`+(typeof s.partIndex=="number"?`,partIndex:${s.partIndex}`:"")+"]"),s}saveExpiredSegmentInfo(e,t){const s=t.mediaSequence-e.mediaSequence;if(s>ab){P.log.warn(`Not saving expired segment info. Media sequence gap ${s} is too large.`);return}for(let r=s-1;r>=0;r--){const n=e.segments[r];if(n&&typeof n.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],s=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-s}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const s=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;s&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,s){const r=e.segment,n=e.part;let a=this.timelines[e.timeline],l,u;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},s&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),l=e.startOfSegment,u=t.end+a.mapping;else if(a)l=t.start+a.mapping,u=t.end+a.mapping;else return!1;return n&&(n.start=l,n.end=u),(!r.start||l<r.start)&&(r.start=l),r.end=u,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,s=e.segment;if(s.discontinuity)this.discontinuities[s.timeline]={time:s.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){const n=t.discontinuityStarts[r],a=t.discontinuitySequence+r+1,l=n-e.mediaIndex,u=Math.abs(l);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>u){let f;l<0?f=s.start-Ws({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):f=s.end+Ws({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:f,accuracy:u}}}}dispose(){this.trigger("dispose"),this.off()}}class lb extends P.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:s}){return typeof t=="number"&&typeof s=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:s},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:s}){if(typeof t=="number"&&typeof s=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:s},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:s}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const ub=Rf(Nf(function(){var i=function(){function y(){this.listeners={}}var k=y.prototype;return k.on=function(I,j){this.listeners[I]||(this.listeners[I]=[]),this.listeners[I].push(j)},k.off=function(I,j){if(!this.listeners[I])return!1;var L=this.listeners[I].indexOf(j);return this.listeners[I]=this.listeners[I].slice(0),this.listeners[I].splice(L,1),L>-1},k.trigger=function(I){var j=this.listeners[I];if(j)if(arguments.length===2)for(var L=j.length,O=0;O<L;++O)j[O].call(this,arguments[1]);else for(var F=Array.prototype.slice.call(arguments,1),B=j.length,U=0;U<B;++U)j[U].apply(this,F)},k.dispose=function(){this.listeners={}},k.pipe=function(I){this.on("data",function(j){I.push(j)})},y}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(y){return y.subarray(0,y.byteLength-y[y.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */const t=function(){const y=[[[],[],[],[],[]],[[],[],[],[],[]]],k=y[0],w=y[1],I=k[4],j=w[4];let L,O,F;const B=[],U=[];let X,ae,J,le,z,Z;for(L=0;L<256;L++)U[(B[L]=L<<1^(L>>7)*283)^L]=L;for(O=F=0;!I[O];O^=X||1,F=U[F]||1)for(le=F^F<<1^F<<2^F<<3^F<<4,le=le>>8^le&255^99,I[O]=le,j[le]=O,J=B[ae=B[X=B[O]]],Z=J*16843009^ae*65537^X*257^O*16843008,z=B[le]*257^le*16843008,L=0;L<4;L++)k[L][O]=z=z<<24^z>>>8,w[L][le]=Z=Z<<24^Z>>>8;for(L=0;L<5;L++)k[L]=k[L].slice(0),w[L]=w[L].slice(0);return y};let s=null;class r{constructor(k){s||(s=t()),this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];let w,I,j;const L=this._tables[0][4],O=this._tables[1],F=k.length;let B=1;if(F!==4&&F!==6&&F!==8)throw new Error("Invalid aes key size");const U=k.slice(0),X=[];for(this._key=[U,X],w=F;w<4*F+28;w++)j=U[w-1],(w%F===0||F===8&&w%F===4)&&(j=L[j>>>24]<<24^L[j>>16&255]<<16^L[j>>8&255]<<8^L[j&255],w%F===0&&(j=j<<8^j>>>24^B<<24,B=B<<1^(B>>7)*283)),U[w]=U[w-F]^j;for(I=0;w;I++,w--)j=U[I&3?w:w-4],w<=4||I<4?X[I]=j:X[I]=O[0][L[j>>>24]]^O[1][L[j>>16&255]]^O[2][L[j>>8&255]]^O[3][L[j&255]]}decrypt(k,w,I,j,L,O){const F=this._key[1];let B=k^F[0],U=j^F[1],X=I^F[2],ae=w^F[3],J,le,z;const Z=F.length/4-2;let Me,ee=4;const be=this._tables[1],Dt=be[0],ti=be[1],ii=be[2],si=be[3],ri=be[4];for(Me=0;Me<Z;Me++)J=Dt[B>>>24]^ti[U>>16&255]^ii[X>>8&255]^si[ae&255]^F[ee],le=Dt[U>>>24]^ti[X>>16&255]^ii[ae>>8&255]^si[B&255]^F[ee+1],z=Dt[X>>>24]^ti[ae>>16&255]^ii[B>>8&255]^si[U&255]^F[ee+2],ae=Dt[ae>>>24]^ti[B>>16&255]^ii[U>>8&255]^si[X&255]^F[ee+3],ee+=4,B=J,U=le,X=z;for(Me=0;Me<4;Me++)L[(3&-Me)+O]=ri[B>>>24]<<24^ri[U>>16&255]<<16^ri[X>>8&255]<<8^ri[ae&255]^F[ee++],J=B,B=U,U=X,X=ae,ae=J}}class n extends i{constructor(){super(i),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(k){this.jobs.push(k),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(y){return y<<24|(y&65280)<<8|(y&16711680)>>8|y>>>24},l=function(y,k,w){const I=new Int32Array(y.buffer,y.byteOffset,y.byteLength>>2),j=new r(Array.prototype.slice.call(k)),L=new Uint8Array(y.byteLength),O=new Int32Array(L.buffer);let F,B,U,X,ae,J,le,z,Z;for(F=w[0],B=w[1],U=w[2],X=w[3],Z=0;Z<I.length;Z+=4)ae=a(I[Z]),J=a(I[Z+1]),le=a(I[Z+2]),z=a(I[Z+3]),j.decrypt(ae,J,le,z,O,Z),O[Z]=a(O[Z]^F),O[Z+1]=a(O[Z+1]^B),O[Z+2]=a(O[Z+2]^U),O[Z+3]=a(O[Z+3]^X),F=ae,B=J,U=le,X=z;return L};class u{constructor(k,w,I,j){const L=u.STEP,O=new Int32Array(k.buffer),F=new Uint8Array(k.byteLength);let B=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(O.subarray(B,B+L),w,I,F)),B=L;B<O.length;B+=L)I=new Uint32Array([a(O[B-4]),a(O[B-3]),a(O[B-2]),a(O[B-1])]),this.asyncStream_.push(this.decryptChunk_(O.subarray(B,B+L),w,I,F));this.asyncStream_.push(function(){j(null,e(F))})}static get STEP(){return 32e3}decryptChunk_(k,w,I,j){return function(){const L=l(k,w,I);j.set(L,k.byteOffset)}}}var f=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},m;typeof window<"u"?m=window:typeof f<"u"?m=f:typeof self<"u"?m=self:m={};var v=m,T=function(k){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(k):k&&k.buffer instanceof ArrayBuffer},E=v.BigInt||Number;E("0x1"),E("0x100"),E("0x10000"),E("0x1000000"),E("0x100000000"),E("0x10000000000"),E("0x1000000000000"),E("0x100000000000000"),E("0x10000000000000000"),function(){var y=new Uint16Array([65484]),k=new Uint8Array(y.buffer,y.byteOffset,y.byteLength);return k[0]===255?"big":k[0]===204?"little":"unknown"}();const A=function(y){const k={};return Object.keys(y).forEach(w=>{const I=y[w];T(I)?k[w]={bytes:I.buffer,byteOffset:I.byteOffset,byteLength:I.byteLength}:k[w]=I}),k};self.onmessage=function(y){const k=y.data,w=new Uint8Array(k.encrypted.bytes,k.encrypted.byteOffset,k.encrypted.byteLength),I=new Uint32Array(k.key.bytes,k.key.byteOffset,k.key.byteLength/4),j=new Uint32Array(k.iv.bytes,k.iv.byteOffset,k.iv.byteLength/4);new u(w,I,j,function(L,O){self.postMessage(A({source:k.source,decrypted:O}),[O.buffer])})}}));var cb=Mf(ub);const db=i=>{let e=i.default?"main":"alternative";return i.characteristics&&i.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},Jf=(i,e)=>{i.abort(),i.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},vo=(i,e)=>{e.activePlaylistLoader=i,i.load()},hb=(i,e)=>()=>{const{segmentLoaders:{[i]:t,main:s},mediaTypes:{[i]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),l=r.activePlaylistLoader,u=r.lastGroup_;if(!(a&&u&&a.id===u.id)&&(r.lastGroup_=a,r.lastTrack_=n,Jf(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){l&&s.resetEverything();return}t.resyncLoader(),vo(a.playlistLoader,r)}},fb=(i,e)=>()=>{const{segmentLoaders:{[i]:t},mediaTypes:{[i]:s}}=e;s.lastGroup_=null,t.abort(),t.pause()},pb=(i,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[i]:s,main:r},mediaTypes:{[i]:n}}=e,a=n.activeTrack(),l=n.getActiveGroup(),u=n.activePlaylistLoader,f=n.lastTrack_;if(!(f&&a&&f.id===a.id)&&(n.lastGroup_=l,n.lastTrack_=a,Jf(s,n),!!l)){if(l.isMainPlaylist){if(!a||!f||a.id===f.id)return;const m=e.vhs.playlistController_,v=m.selectPlaylist();if(m.media()===v)return;n.logger_(`track change. Switching main audio from ${f.id} to ${a.id}`),t.pause(),r.resetEverything(),m.fastQualityChange_(v);return}if(i==="AUDIO"){if(!l.playlistLoader){r.setAudio(!0),r.resetEverything();return}s.setAudio(!0),r.setAudio(!1)}if(u===l.playlistLoader){vo(l.playlistLoader,n);return}s.track&&s.track(a),s.resetEverything(),vo(l.playlistLoader,n)}},Cn={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:t},excludePlaylist:s}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(u=>u.default)[0]||n[0]).id,l=t.tracks[a];if(r===l){s({error:{message:"Problem encountered loading the default audio track."}});return}P.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const u in t.tracks)t.tracks[u].enabled=t.tracks[u]===l;t.onTrackChanged()},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:t}}=e;P.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const s=t.activeTrack();s&&(s.mode="disabled"),t.onTrackChanged()}},Uc={AUDIO:(i,e,t)=>{if(!e)return;const{tech:s,requestOptions:r,segmentLoaders:{[i]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!s.paused()||a.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",Cn[i](i,t))},SUBTITLES:(i,e,t)=>{const{tech:s,requestOptions:r,segmentLoaders:{[i]:n},mediaTypes:{[i]:a}}=t;e.on("loadedmetadata",()=>{const l=e.media();n.playlist(l,r),n.track(a.activeTrack()),(!s.paused()||l.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",Cn[i](i,t))}},mb={AUDIO:(i,e)=>{const{vhs:t,sourceType:s,segmentLoaders:{[i]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[i]:{groups:l,tracks:u,logger_:f}},mainPlaylistLoader:m}=e,v=fr(m.main);(!a[i]||Object.keys(a[i]).length===0)&&(a[i]={main:{default:{default:!0}}},v&&(a[i].main.default.playlists=m.main.playlists));for(const T in a[i]){l[T]||(l[T]=[]);for(const E in a[i][T]){let A=a[i][T][E],y;if(v?(f(`AUDIO group '${T}' label '${E}' is a main playlist`),A.isMainPlaylist=!0,y=null):s==="vhs-json"&&A.playlists?y=new Ri(A.playlists[0],t,n):A.resolvedUri?y=new Ri(A.resolvedUri,t,n):A.playlists&&s==="dash"?y=new ho(A.playlists[0],t,n,m):y=null,A=ie({id:E,playlistLoader:y},A),Uc[i](i,A.playlistLoader,e),l[T].push(A),typeof u[E]>"u"){const k=new P.AudioTrack({id:E,kind:db(A),enabled:!1,language:A.language,default:A.default,label:E});u[E]=k}}}r.on("error",Cn[i](i,e))},SUBTITLES:(i,e)=>{const{tech:t,vhs:s,sourceType:r,segmentLoaders:{[i]:n},requestOptions:a,main:{mediaGroups:l},mediaTypes:{[i]:{groups:u,tracks:f}},mainPlaylistLoader:m}=e;for(const v in l[i]){u[v]||(u[v]=[]);for(const T in l[i][v]){if(!s.options_.useForcedSubtitles&&l[i][v][T].forced)continue;let E=l[i][v][T],A;if(r==="hls")A=new Ri(E.resolvedUri,s,a);else if(r==="dash"){if(!E.playlists.filter(k=>k.excludeUntil!==1/0).length)return;A=new ho(E.playlists[0],s,a,m)}else r==="vhs-json"&&(A=new Ri(E.playlists?E.playlists[0]:E.resolvedUri,s,a));if(E=ie({id:T,playlistLoader:A},E),Uc[i](i,E.playlistLoader,e),u[v].push(E),typeof f[T]>"u"){const y=t.addRemoteTextTrack({id:T,kind:"subtitles",default:E.default&&E.autoselect,language:E.language,label:T},!1).track;f[T]=y}}}n.on("error",Cn[i](i,e))},"CLOSED-CAPTIONS":(i,e)=>{const{tech:t,main:{mediaGroups:s},mediaTypes:{[i]:{groups:r,tracks:n}}}=e;for(const a in s[i]){r[a]||(r[a]=[]);for(const l in s[i][a]){const u=s[i][a][l];if(!/^(?:CC|SERVICE)/.test(u.instreamId))continue;const f=t.options_.vhs&&t.options_.vhs.captionServices||{};let m={label:l,language:u.language,instreamId:u.instreamId,default:u.default&&u.autoselect};if(f[m.instreamId]&&(m=ie(m,f[m.instreamId])),m.default===void 0&&delete m.default,r[a].push(ie({id:l},u)),typeof n[l]>"u"){const v=t.addRemoteTextTrack({id:m.instreamId,kind:"captions",default:m.default,language:m.language,label:m.label},!1).track;n[l]=v}}}}},Zf=(i,e)=>{for(let t=0;t<i.length;t++)if(fl(e,i[t])||i[t].playlists&&Zf(i[t].playlists,e))return!0;return!1},gb=(i,e)=>t=>{const{mainPlaylistLoader:s,mediaTypes:{[i]:{groups:r}}}=e,n=s.media();if(!n)return null;let a=null;n.attributes[i]&&(a=r[n.attributes[i]]);const l=Object.keys(r);if(!a)if(i==="AUDIO"&&l.length>1&&fr(e.main))for(let u=0;u<l.length;u++){const f=r[l[u]];if(Zf(f,n)){a=f;break}}else r.main?a=r.main:l.length===1&&(a=r[l[0]]);return typeof t>"u"?a:t===null||!a?null:a.filter(u=>u.id===t.id)[0]||null},vb={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].enabled)return t[s];return null},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].mode==="showing"||t[s].mode==="hidden")return t[s];return null}},yb=(i,{mediaTypes:e})=>()=>{const t=e[i].activeTrack();return t?e[i].activeGroup(t):null},_b=i=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(f=>{mb[f](f,i)});const{mediaTypes:e,mainPlaylistLoader:t,tech:s,vhs:r,segmentLoaders:{["AUDIO"]:n,main:a}}=i;["AUDIO","SUBTITLES"].forEach(f=>{e[f].activeGroup=gb(f,i),e[f].activeTrack=vb[f](f,i),e[f].onGroupChanged=hb(f,i),e[f].onGroupChanging=fb(f,i),e[f].onTrackChanged=pb(f,i),e[f].getActiveGroup=yb(f,i)});const l=e.AUDIO.activeGroup();if(l){const f=(l.filter(v=>v.default)[0]||l[0]).id;e.AUDIO.tracks[f].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(f=>e[f].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(f=>e[f].onGroupChanging())});const u=()=>{e.AUDIO.onTrackChanged(),s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",u),s.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{s.audioTracks().removeEventListener("change",u),s.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),s.clearTracks("audio");for(const f in e.AUDIO.tracks)s.audioTracks().addTrack(e.AUDIO.tracks[f])},bb=()=>{const i={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{i[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Pt,activeTrack:Pt,getActiveGroup:Pt,onGroupChanged:Pt,onTrackChanged:Pt,lastTrack_:null,logger_:at(`MediaGroups[${e}]`)}}),i};class Vc{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=$e(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class Tb extends P.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new Vc,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=at("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const s=t.serverUri||t.serverURL;if(!s){this.logger_(`steering manifest URL is ${s}, cannot request steering manifest.`),this.trigger("error");return}if(s.startsWith("data:")){this.decodeDataUriManifest_(s.substring(s.indexOf(",")+1));return}this.steeringManifest.reloadUri=$e(e,s),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const s=e?t:this.getRequestURI(t);if(!s){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const r={contentSteeringInfo:{uri:s}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:s,requestType:"content-steering-manifest"},(n,a)=>{if(n){if(a.status===410){this.logger_(`manifest request 410 ${n}.`),this.logger_(`There will be no more content steering requests to ${s} this session.`),this.excludedSteeringManifestURLs.add(s);return}if(a.status===429){const f=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${f} seconds.`),this.startTTLTimeout_(parseInt(f,10));return}this.logger_(`manifest failed to load ${n}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:r});let l;try{l=JSON.parse(this.request_.responseText)}catch(f){const m={errorType:P.Error.StreamingContentSteeringParserError,error:f};this.trigger({type:"error",metadata:m})}this.assignSteeringProperties_(l);const u={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:u}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new S.URL(e),s=new S.URL(this.proxyServerUrl_);return s.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(s.toString())}decodeDataUriManifest_(e){const t=JSON.parse(S.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new S.URL(e),s=this.getPathway(),r=this.getBandwidth_();if(s){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,s)}if(r){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const s=(r=>{for(const n of r)if(this.availablePathways_.has(n))return n;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==s&&(this.currentPathway=s,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const s=this.setSteeringParams_(e);return t(s)?null:s}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=S.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){S.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new Vc}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&($e(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const xb=(i,e)=>{let t=null;return(...s)=>{clearTimeout(t),t=setTimeout(()=>{i.apply(null,s)},e)}},Sb=10;let Xt;const Cb=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Eb=function(i){return this.audioSegmentLoader_[i]+this.mainSegmentLoader_[i]},Ab=function({currentPlaylist:i,buffered:e,currentTime:t,nextPlaylist:s,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:l,log:u}){if(!s)return P.log.warn("We received no playlist to switch to. Please check your stream."),!1;const f=`allowing switch ${i&&i.id||"null"} -> ${s.id}`;if(!i)return u(`${f} as current playlist is not set`),!0;if(s.id===i.id)return!1;const m=!!Mi(e,t).length;if(!i.endList)return!m&&typeof i.partTargetDuration=="number"?(u(`not ${f} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(u(`${f} as current playlist is live`),!0);const v=cl(e,t),T=l?Ae.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ae.MAX_BUFFER_LOW_WATER_LINE;if(a<T)return u(`${f} as duration < max low water line (${a} < ${T})`),!0;const E=s.attributes.BANDWIDTH,A=i.attributes.BANDWIDTH;if(E<A&&(!l||v<n)){let y=`${f} as next bandwidth < current bandwidth (${E} < ${A})`;return l&&(y+=` and forwardBuffer < bufferHighWaterLine (${v} < ${n})`),u(y),!0}if((!l||E>A)&&v>=r){let y=`${f} as forwardBuffer >= bufferLowWaterLine (${v} >= ${r})`;return l&&(y+=` and next bandwidth > current bandwidth (${E} > ${A})`),u(y),!0}return u(`not ${f} as no switching criteria met`),!1};class wb extends P.EventTarget{constructor(e){super(),this.fastQualityChange_=xb(this.fastQualityChange_.bind(this),100);const{src:t,withCredentials:s,tech:r,bandwidth:n,externVhs:a,useCueTags:l,playlistExclusionDuration:u,enableLowInitialPlaylist:f,sourceType:m,cacheEncryptionKeys:v,bufferBasedABR:T,leastPixelDiffSelector:E,captionServices:A,experimentalUseMMS:y}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:k}=e;(k===null||typeof k>"u")&&(k=1/0),Xt=a,this.bufferBasedABR=!!T,this.leastPixelDiffSelector=!!E,this.withCredentials=s,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=m,this.useCueTags_=l,this.playlistExclusionDuration=u,this.maxPlaylistRetries=k,this.enableLowInitialPlaylist=f,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:s,maxPlaylistRetries:k,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=bb(),y&&S.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new S.ManagedMediaSource,this.usingManagedMediaSource_=!0,P.log("Using ManagedMediaSource")):S.MediaSource&&(this.mediaSource=new S.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=De(),this.hasPlayed_=!1,this.syncController_=new ob(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new cb,this.sourceUpdater_=new Kf(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new lb,this.keyStatusMap_=new Map;const w={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:A,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:v,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new ho(t,this.vhs_,ie(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Ri(t,this.vhs_,ie(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new mo(ie(w,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new mo(ie(w,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new ib(ie(w,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((L,O)=>{function F(){r.off("vttjserror",B),L()}function B(){r.off("vttjsloaded",F),O()}r.one("vttjsloaded",F),r.one("vttjserror",B),r.addWebVttScript_()})}),e);const I=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new Tb(this.vhs_.xhr,I),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),Cb.forEach(L=>{this[L+"_"]=Eb.bind(this,L)}),this.logger_=at("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const j=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(j,()=>{const L=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-L,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,s){const r=this.media(),n=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);const l={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:l}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,s)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],s=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(s&&r){const a=(s.length?s[0].playlists:s.playlists).filter(l=>l.attributes.serviceLocation===r);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=S.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(S.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const s=e.mediaGroups.AUDIO,r=Object.keys(s);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const l=s.main||r.length&&s[r[0]];for(const u in l)if(l[u].default){n={label:u};break}}if(!n)return t;const a=[];for(const l in s)if(s[l][n.label]){const u=s[l][n.label];if(u.playlists&&u.playlists.length)a.push.apply(a,u.playlists);else if(u.uri)a.push(u);else if(e.playlists.length)for(let f=0;f<e.playlists.length;f++){const m=e.playlists[f];m.attributes&&m.attributes.AUDIO&&m.attributes.AUDIO===l&&a.push(m)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const t=this.mainPlaylistLoader_.media(),s=t.targetDuration*1.5*1e3;ao(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=s,t.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),_b({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),t),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let s;if(this.enableLowInitialPlaylist&&(s=this.selectInitialPlaylist()),s||(s=this.selectPlaylist()),!s||!this.shouldSwitchToMedia_(s)||(this.initialMedia_=s,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}),this.mainPlaylistLoader_.on("error",()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const t=this.mainPlaylistLoader_.media(),s=t.targetDuration*1.5*1e3;ao(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=s,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(t)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(t=>{this.mainPlaylistLoader_.on(t,s=>{this.player_.trigger(_e({},s))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const s=e.mediaGroups||{};let r=!0;const n=Object.keys(s.AUDIO);for(const a in s.AUDIO)for(const l in s.AUDIO[a])s.AUDIO[a][l].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(s.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Xt.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(s.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,s=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return Ab({buffered:a,currentTime:s,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const s=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:s.playlist,error:s})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const s=this.audioSegmentLoader_.pendingSegment_;if(!s||!s.segment||!s.segment.syncInfo)return;const r=s.segment.syncInfo.end+.01;this.tech_.setCurrentTime(r)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",s=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:Sb}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const s=this.getCodecsOrExclude_();s&&this.sourceUpdater_.addOrChangeSourceBuffers(s)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(s=>{this.mainSegmentLoader_.on(s,r=>{this.player_.trigger(_e({},r))}),this.audioSegmentLoader_.on(s,r=>{this.player_.trigger(_e({},r))}),this.subtitleSegmentLoader_.on(s,r=>{this.player_.trigger(_e({},r))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const s=t.end(0);let r=s;if(e.start){const n=e.start.timeOffset;n<0?r=Math.max(s+n,t.start(0)):r=Math.min(s,n)}this.trigger("firstplay"),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();typeof e<"u"&&typeof e.then=="function"&&e.then(null,t=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const s=this.syncController_.getExpiredTime(e,this.duration());if(s===null)return!1;const r=Xt.Playlist.playlistEnd(e,s),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-n<=Tt;const l=a.end(a.length-1);return l-n<=Tt&&r-l<=Tt}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:s}){if(e=e||this.mainPlaylistLoader_.media(),s=s||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,n=r.filter(Kn),a=n.length===1&&n[0]===e;if(r.length===1&&s!==1/0)return P.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const A=this.pathwayAttribute_(e),y=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(A),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(A)},y);return}let E=!1;r.forEach(A=>{if(A===e)return;const y=A.excludeUntil;typeof y<"u"&&y!==1/0&&(E=!0,delete A.excludeUntil)}),E&&(P.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let l;e.playlistErrors_>this.maxPlaylistRetries?l=1/0:l=Date.now()+s*1e3,e.excludeUntil=l,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const u=this.selectPlaylist();if(!u){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const f=t.internal?this.logger_:P.log.warn,m=t.message?" "+t.message:"";f(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${m} Switching to playlist ${u.id}.`),u.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const v=u.targetDuration/2*1e3||5*1e3,T=typeof u.lastRequest=="number"&&Date.now()-u.lastRequest<=v;return this.switchMedia_(u,"exclude",a||T)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const s=[],r=e==="all";(r||e==="main")&&s.push(this.mainPlaylistLoader_);const n=[];(r||e==="audio")&&n.push("AUDIO"),(r||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const l=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;l&&s.push(l)}),["main","audio","subtitle"].forEach(a=>{const l=this[`${a}SegmentLoader_`];l&&(e===a||e==="all")&&s.push(l)}),s.forEach(a=>t.forEach(l=>{typeof a[l]=="function"&&a[l]()}))}setCurrentTime(e){const t=Mi(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Xt.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){const s=e.media();if(!s)return null;const r=this.syncController_.getMediaSequenceSync(t);if(r&&r.isReliable){const l=r.start,u=r.end;if(!isFinite(l)||!isFinite(u))return null;const f=Xt.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,s),m=Math.max(l,u-f);return De([[l,m]])}const n=this.syncController_.getExpiredTime(s,this.duration());if(n===null)return null;const a=Xt.Playlist.seekable(s,n,Xt.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,s));return a.length?a:null}computeFinalSeekable_(e,t){if(!t)return e;const s=e.start(0),r=e.end(0),n=t.start(0),a=t.end(0);return n>r||s>a?e:De([[Math.max(s,n),Math.min(r,a)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let t;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!t))return;const s=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||s&&s.length&&this.seekable_.length&&s.start(0)===this.seekable_.start(0)&&s.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${uf(this.seekable_)}]`);const r={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:r}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const r=this.seekable();if(!r.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<r.end(r.length-1))&&this.sourceUpdater_.setDuration(r.end(r.length-1));return}const t=this.tech_.buffered();let s=Xt.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(s=Math.max(s,t.end(t.length-1))),this.mediaSource.duration!==s&&this.sourceUpdater_.setDuration(s)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const s in t)t[s].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),s=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!s)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const s=Xs(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=s.video||e.main.videoCodec||$g),e.main.isMuxed&&(r.video+=`,${s.audio||e.main.audioCodec||Cu}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=s.audio||e.main.audioCodec||e.audio.audioCodec||Cu,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(f,m)=>f?qs(m,this.usingManagedMediaSource_):Sa(m),l={};let u;if(["video","audio"].forEach(function(f){if(r.hasOwnProperty(f)&&!a(e[f].isFmp4,r[f])){const m=e[f].isFmp4?"browser":"muxer";l[m]=l[m]||[],l[m].push(r[f]),f==="audio"&&(u=m)}}),n&&u&&t.attributes.AUDIO){const f=t.attributes.AUDIO;this.main().playlists.forEach(m=>{(m.attributes&&m.attributes.AUDIO)===f&&m!==t&&(m.excludeUntil=1/0)}),this.logger_(`excluding audio group ${f} as ${u} does not support codec(s): "${r.audio}"`)}if(Object.keys(l).length){const f=Object.keys(l).reduce((m,v)=>(m&&(m+=", "),m+=`${v} does not support codec(s): "${l[v].join(",")}"`,m),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:f},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const f=[];if(["video","audio"].forEach(m=>{const v=(vt(this.sourceUpdater_.codecs[m]||"")[0]||{}).type,T=(vt(r[m]||"")[0]||{}).type;v&&T&&v.toLowerCase()!==T.toLowerCase()&&f.push(`"${this.sourceUpdater_.codecs[m]}" -> "${r[m]}"`)}),f.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${f.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(s=>{const r=e[s];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=Xs(this.main,r),a=[];n.audio&&!Sa(n.audio)&&!qs(n.audio,this.usingManagedMediaSource_)&&a.push(`audio codec ${n.audio}`),n.video&&!Sa(n.video)&&!qs(n.video,this.usingManagedMediaSource_)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],s=this.main().playlists,r=ir(vt(e)),n=Sc(r),a=r.video&&vt(r.video)[0]||null,l=r.audio&&vt(r.audio)[0]||null;Object.keys(s).forEach(u=>{const f=s[u];if(t.indexOf(f.id)!==-1||f.excludeUntil===1/0)return;t.push(f.id);const m=[],v=Xs(this.mainPlaylistLoader_.main,f),T=Sc(v);if(!(!v.audio&&!v.video)){if(T!==n&&m.push(`codec count "${T}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const E=v.video&&vt(v.video)[0]||null,A=v.audio&&vt(v.audio)[0]||null;E&&a&&E.type.toLowerCase()!==a.type.toLowerCase()&&m.push(`video codec "${E.type}" !== "${a.type}"`),A&&l&&A.type.toLowerCase()!==l.type.toLowerCase()&&m.push(`audio codec "${A.type}" !== "${l.type}"`)}m.length&&(f.excludeUntil=1/0,this.logger_(`excluding ${f.id}: ${m.join(" && ")}`))}})}updateAdCues_(e){let t=0;const s=this.seekable();s.length&&(t=s.start(0)),rb(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Ae.GOAL_BUFFER_LENGTH,s=Ae.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Ae.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*s,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Ae.BUFFER_LOW_WATER_LINE,s=Ae.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Ae.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Ae.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*s,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return Ae.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){Ic(this.inbandTextTracks_,"com.apple.streaming",this.tech_),N_({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,s){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Ic(this.inbandTextTracks_,e,this.tech_),O_({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:s})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.contentSteeringController_.on(t,s=>{this.trigger(_e({},s))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const t=this.main();(this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||(()=>{const n=this.contentSteeringController_.getAvailablePathways(),a=[];for(const l of t.playlists){const u=l.attributes.serviceLocation;if(u&&(a.push(u),!n.has(u)))return!0}return!!(!a.length&&n.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const s=this.main().playlists,r=new Set;let n=!1;Object.keys(s).forEach(a=>{const l=s[a],u=this.pathwayAttribute_(l),f=u&&e!==u;l.excludeUntil===1/0&&l.lastExcludeReason_==="content-steering"&&!f&&(delete l.excludeUntil,delete l.lastExcludeReason_,n=!0);const v=!l.excludeUntil&&l.excludeUntil!==1/0;!r.has(l.id)&&f&&v&&(r.add(l.id),l.excludeUntil=1/0,l.lastExcludeReason_="content-steering",this.logger_(`excluding ${l.id} for ${l.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const l=this.mediaTypes_[a];if(l.activePlaylistLoader){const u=l.activePlaylistLoader.media_;u&&u.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,s=this.contentSteeringController_.currentPathwayClones,r=this.contentSteeringController_.nextPathwayClones;if(s&&s.size||r&&r.size){for(const[a,l]of s.entries())r.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(l),this.contentSteeringController_.excludePathway(a));for(const[a,l]of r.entries()){const u=s.get(a);if(!u){t.filter(m=>m.attributes["PATHWAY-ID"]===l["BASE-ID"]).forEach(m=>{this.mainPlaylistLoader_.addClonePathway(l,m)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(u,l)||(this.mainPlaylistLoader_.updateOrDeleteClone(l,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...r])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const s=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in s)if(s[n]!==r[n])return!1;for(const n in r)if(s[n]!==r[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=this.mainPlaylistLoader_.getKeyIdSet(s);!r||!r.size||r.forEach(n=>{const a="usable",l=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,u=s.lastExcludeReason_===t&&s.excludeUntil===1/0;l?l&&u&&(delete s.excludeUntil,delete s.lastExcludeReason_,this.logger_(`enabling playlist ${s.id} because key ID ${n} is ${a}`)):(s.excludeUntil!==1/0&&s.lastExcludeReason_!==t&&(s.excludeUntil=1/0,s.lastExcludeReason_=t,this.logger_(`excluding playlist ${s.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=s&&s.attributes&&s.attributes.RESOLUTION&&s.attributes.RESOLUTION.height<720,n=s.excludeUntil===1/0&&s.lastExcludeReason_===t;r&&n&&(delete s.excludeUntil,P.log.warn(`enabling non-HD playlist ${s.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=(typeof e=="string"?e:eb(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const Db=(i,e,t)=>s=>{const r=i.main.playlists[e],n=hl(r),a=Kn(r);if(typeof s>"u")return a;s?delete r.disabled:r.disabled=!0;const l={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return s!==a&&!n&&(s?(t(r),i.trigger({type:"renditionenabled",metadata:l})):i.trigger({type:"renditiondisabled",metadata:l})),s};class kb{constructor(e,t,s){const{playlistController_:r}=e,n=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Xs(r.main(),t),this.playlist=t,this.id=s,this.enabled=Db(e.playlists,t.id,n)}}const jb=function(i){i.representations=()=>{const e=i.playlistController_.main(),t=fr(e)?i.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(s=>!hl(s)).map((s,r)=>new kb(i,s,s.id)):[]}},Hc=["seeking","seeked","pause","playing","error"];class Ib extends P.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=at("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),s=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,l=["main","subtitle","audio"],u={};l.forEach(m=>{u[m]={reset:()=>this.resetSegmentDownloads_(m),updateend:()=>this.checkSegmentDownloads_(m)},a[`${m}SegmentLoader_`].on("appendsdone",u[m].updateend),a[`${m}SegmentLoader_`].on("playlistupdate",u[m].reset),this.tech_.on(["seeked","seeking"],u[m].reset)});const f=m=>{["main","audio"].forEach(v=>{a[`${v}SegmentLoader_`][m]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),f("off"))},this.clearSeekingAppendCheck_=()=>f("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),f("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(Hc,n),this.tech_.on("canplay",s),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(Hc,n),this.tech_.off("canplay",s),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),l.forEach(m=>{a[`${m}SegmentLoader_`].off("appendsdone",u[m].updateend),a[`${m}SegmentLoader_`].off("playlistupdate",u[m].reset),this.tech_.off(["seeked","seeking"],u[m].reset)}),this.checkCurrentTimeTimeout_&&S.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&S.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=S.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,s=t[`${e}SegmentLoader_`],r=s.buffered_(),n=gy(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){const a={bufferedRanges:r};t.trigger({type:"bufferedrangeschanged",metadata:a}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:s.playlist_&&s.playlist_.id,buffered:hi(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Tt>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(De([this.lastRecordedTime,e]));const s={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:s}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),s=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,s,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(r&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,s)){const A=t.start(0);n=A+(A===t.end(0)?0:Tt)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${s} with seekable range ${uf(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,l=this.tech_.buffered(),u=a.audioBuffer?a.audioBuffered():null,f=a.videoBuffer?a.videoBuffered():null,m=this.media(),v=m.partTargetDuration?m.partTargetDuration:(m.targetDuration-bt)*2,T=[u,f];for(let A=0;A<T.length;A++){if(!T[A])continue;if(cl(T[A],s)<v)return!1}const E=Wr(l,s);return E.length===0?!1:(n=E.start(0)+Tt,this.logger_(`Buffered region starts (${E.start(0)}) just beyond seek point (${s}). Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),s=Mi(t,e);if(s.length&&e+3<=s.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${s.start(0)} -> ${s.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const l=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${l}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(l),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const s=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:s.audioBuffered(),videoBuffered:s.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=Wr(r,t);return a.length>0?(this.logger_(`Stopped at ${t} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,s,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+Tt;const a=!s.endList,l=typeof s.partTargetDuration=="number";return a&&(l||r)&&(n=e.end(e.length-1)+s.targetDuration*3),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:s}){if(!e)return;let r;if(e.length&&t.length){const n=Mi(e,s-3),a=Mi(e,s),l=Mi(t,s);l.length&&!a.length&&n.length&&(r={start:n.end(0),end:l.end(0)})}else Wr(e,s).length||(r=this.gapFromVideoUnderflow_(e,s));return r?(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${s}`),!0):!1}skipTheGap_(e){const t=this.tech_.buffered(),s=this.tech_.currentTime(),r=Wr(t,s);if(this.resetTimeUpdate_(),r.length===0||s!==e)return;this.logger_("skipTheGap_:","currentTime:",s,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+bt);const n={gapInfo:{from:s,to:r.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const s=fy(e);for(let r=0;r<s.length;r++){const n=s.start(r),a=s.end(r);if(t-n<4&&t-n>2)return{start:n,end:a}}return null}}const Pb={errorInterval:30,getSource(i){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return i(t)}},ep=function(i,e){let t=0,s=0;const r=ie(Pb,e);i.ready(()=>{i.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){s&&i.currentTime(s)},a=function(m){m!=null&&(s=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",n),i.src(m),i.trigger({type:"usage",name:"vhs-error-reload"}),i.play())},l=function(){if(Date.now()-t<r.errorInterval*1e3){i.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!r.getSource||typeof r.getSource!="function"){P.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return t=Date.now(),r.getSource.call(i,a)},u=function(){i.off("loadedmetadata",n),i.off("error",l),i.off("dispose",u)},f=function(m){u(),ep(i,m)};i.on("error",l),i.on("dispose",u),i.reloadSourceOnError=f},Lb=function(i){ep(this,i)};var tp="3.17.0",Ob="7.1.0",Mb="1.3.1",Rb="7.2.0",Nb="4.0.2";const ge={PlaylistLoader:Ri,Playlist:Ge,utils:Hy,STANDARD_PLAYLIST_SELECTOR:jc,INITIAL_PLAYLIST_SELECTOR:k_,lastBandwidthSelector:jc,movingAverageBandwidthSelector:w_,comparePlaylistBandwidth:ml,comparePlaylistResolution:A_,xhr:Df()};Object.keys(Ae).forEach(i=>{Object.defineProperty(ge,i,{get(){return P.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),Ae[i]},set(e){if(P.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){P.log.warn(`value of Vhs.${i} must be greater than or equal to 0`);return}Ae[i]=e}})});const ip="videojs-vhs",sp=function(i,e){const t=e.media();let s=-1;for(let r=0;r<i.length;r++)if(i[r].id===t.id){s=r;break}i.selectedIndex_=s,i.trigger({selectedIndex:s,type:"change"})},Bb=function(i,e){e.representations().forEach(t=>{i.addQualityLevel(t)}),sp(i,e.playlists)};ge.canPlaySource=function(){return P.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const Fb=(i,e,t)=>{if(!i)return i;let s={};e&&e.attributes&&e.attributes.CODECS&&(s=ir(vt(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(s.audio=t.attributes.CODECS);const r=Gi(s.video),n=Gi(s.audio),a={};for(const l in i)a[l]={},n&&(a[l].audioContentType=n),r&&(a[l].videoContentType=r),e.contentProtection&&e.contentProtection[l]&&e.contentProtection[l].pssh&&(a[l].pssh=e.contentProtection[l].pssh),typeof i[l]=="string"&&(a[l].url=i[l]);return ie(i,a)},Ub=(i,e)=>i.reduce((t,s)=>{if(!s.contentProtection)return t;const r=e.reduce((n,a)=>{const l=s.contentProtection[a];return l&&l.pssh&&(n[a]={pssh:l.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),Vb=({player:i,sourceKeySystems:e,audioMedia:t,mainPlaylists:s})=>{if(!i.eme.initializeMediaKeys)return Promise.resolve();const r=t?s.concat([t]):s,n=Ub(r,Object.keys(e)),a=[],l=[];return n.forEach(u=>{l.push(new Promise((f,m)=>{i.tech_.one("keysessioncreated",f)})),a.push(new Promise((f,m)=>{i.eme.initializeMediaKeys({keySystems:u},v=>{if(v){m(v);return}f()})}))}),Promise.race([Promise.all(a),Promise.race(l)])},Hb=({player:i,sourceKeySystems:e,media:t,audioMedia:s})=>{const r=Fb(e,t,s);return r?(i.currentSource().keySystems=r,r&&!i.eme?(P.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},rp=()=>{if(!S.localStorage)return null;const i=S.localStorage.getItem(ip);if(!i)return null;try{return JSON.parse(i)}catch{return null}},qb=i=>{if(!S.localStorage)return!1;let e=rp();e=e?ie(e,i):i;try{S.localStorage.setItem(ip,JSON.stringify(e))}catch{return!1}return e},zb=i=>i.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(i.substring(i.indexOf(",")+1)):i,np=(i,e)=>{i._requestCallbackSet||(i._requestCallbackSet=new Set),i._requestCallbackSet.add(e)},ap=(i,e)=>{i._responseCallbackSet||(i._responseCallbackSet=new Set),i._responseCallbackSet.add(e)},op=(i,e)=>{i._requestCallbackSet&&(i._requestCallbackSet.delete(e),i._requestCallbackSet.size||delete i._requestCallbackSet)},lp=(i,e)=>{i._responseCallbackSet&&(i._responseCallbackSet.delete(e),i._responseCallbackSet.size||delete i._responseCallbackSet)};ge.supportsNativeHls=function(){if(!V||!V.createElement)return!1;const i=V.createElement("video");return P.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(i.canPlayType(t))}):!1}();ge.supportsNativeDash=function(){return!V||!V.createElement||!P.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(V.createElement("video").canPlayType("application/dash+xml"))}();ge.supportsTypeNatively=i=>i==="hls"?ge.supportsNativeHls:i==="dash"?ge.supportsNativeDash:!1;ge.isSupported=function(){return P.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};ge.xhr.onRequest=function(i){np(ge.xhr,i)};ge.xhr.onResponse=function(i){ap(ge.xhr,i)};ge.xhr.offRequest=function(i){op(ge.xhr,i)};ge.xhr.offResponse=function(i){lp(ge.xhr,i)};const $b=P.getComponent("Component");class up extends $b{constructor(e,t,s){if(super(t,s.vhs),typeof s.initialBandwidth=="number"&&(this.options_.bandwidth=s.initialBandwidth),this.logger_=at("VhsHandler"),t.options_&&t.options_.playerId){const r=P.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(V,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=V.fullscreenElement||V.webkitFullscreenElement||V.mozFullScreenElement||V.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=ie(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const s=rp();s&&s.bandwidth&&(this.options_.bandwidth=s.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),s&&s.throughput&&(this.options_.throughput=s.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Ae.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ae.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(s=>{typeof this.source_[s]<"u"&&(this.options_[s]=this.source_[s])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=zb(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=ge,this.options_.sourceType=td(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new wb(this.options_);const s=ie({liveRangeSafeTimeDelta:Tt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Ib(s),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=P.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});const r=this.options_.bufferBasedABR?ge.movingAverageBandwidthSelector(.55):ge.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=ge.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=S.navigator.connection||S.navigator.mozConnection||S.navigator.webkitConnection,l=1e7;if(this.options_.useNetworkInformationApi&&a){const u=a.downlink*1e3*1e3;u>=l&&n>=l?n=Math.max(n,u):n=u}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(n+a))},set(){P.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>hi(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>hi(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&qb({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{jb(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=S.URL.createObjectURL(this.playlistController_.mediaSource),(P.browser.IS_ANY_SAFARI||P.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),Vb({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=Hb({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",s=>{this.playlistController_.updatePlaylistByKeyStatus(s.keyId,s.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=P.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{Bb(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{sp(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":tp,"mux.js":Ob,"mpd-parser":Mb,"m3u8-parser":Rb,"aes-decrypter":Nb}}version(){return this.constructor.version()}canChangeType(){return Kf.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&S.URL.revokeObjectURL&&(S.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return Yy({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,s=!0,r=2){return Lf({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:s,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{np(this.xhr,e)},this.xhr.onResponse=e=>{ap(this.xhr,e)},this.xhr.offRequest=e=>{op(this.xhr,e)},this.xhr.offResponse=e=>{lp(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(s=>{this.playlistController_.on(s,r=>{this.player_.trigger(_e({},r))})}),t.forEach(s=>{this.playbackWatcher_.on(s,r=>{this.player_.trigger(_e({},r))})})}}const En={name:"videojs-http-streaming",VERSION:tp,canHandleSource(i,e={}){const t=ie(P.options,e);return!t.vhs.experimentalUseMMS&&!qs("avc1.4d400d,mp4a.40.2",!1)?!1:En.canPlayType(i.type,t)},handleSource(i,e,t={}){const s=ie(P.options,t);return e.vhs=new up(i,e,s),e.vhs.xhr=Df(),e.vhs.setupXhrHooks_(),e.vhs.src(i.src,i.type),e.vhs},canPlayType(i,e){const t=td(i);if(!t)return"";const s=En.getOverrideNative(e);return!ge.supportsTypeNatively(t)||s?"maybe":""},getOverrideNative(i={}){const{vhs:e={}}=i,t=!(P.browser.IS_ANY_SAFARI||P.browser.IS_IOS),{overrideNative:s=t}=e;return s}},Gb=()=>qs("avc1.4d400d,mp4a.40.2",!0);Gb()&&P.getTech("Html5").registerSourceHandler(En,0);P.VhsHandler=up;P.VhsSourceHandler=En;P.Vhs=ge;P.use||P.registerComponent("Vhs",ge);P.options.vhs=P.options.vhs||{};(!P.getPlugin||!P.getPlugin("reloadSourceOnError"))&&P.registerPlugin("reloadSourceOnError",Lb);var Wb=Object.defineProperty,hs=(i,e,t,s)=>{for(var r=void 0,n=i.length-1,a;n>=0;n--)(a=i[n])&&(r=a(e,t,r)||r);return r&&Wb(e,t,r),r};const Xb="0.5, 1, 1.5, 2";function Yb(i){const e=i.getChild("ControlBar"),t=e.getChild("CurrentTimeDisplay"),s=e.getChild("ProgressControl"),r=e.getChild("DurationDisplay"),n=e.getChild("TimeDivider");e.removeChild(s),e.removeChild(t),e.removeChild(n),e.removeChild(r),e.addChild(t,{},0),e.addChild(s,{},1),e.addChild(r,{},2)}class xi extends P0.Localized(ft.VividElement){constructor(){super(...arguments),this.autoplay=!1,this.loop=!1,this.playbackRates=Xb,this.skipBy=j0.MediaSkipBy.Ten}srcChanged(){this.#t()}autoplayChanged(){this._player&&this.#t()}skipByChanged(){this._player&&this.#t()}#e;connectedCallback(){super.connectedCallback(),this.#t()}disconnectedCallback(){super.connectedCallback(),this.#s()}#a(){const e=this.querySelectorAll("source");if(!(e.length===0&&!this.src))return this.src?[{src:this.src}]:Array.from(e).map(t=>({src:t.getAttribute("src"),type:t.getAttribute("type")}))}#o(){const e=this.#a(),t=parseInt(this.skipBy);return{languages:{current:this.locale.videoPlayer},sources:e,poster:this.poster,muted:this.autoplay,playbackRates:I0.getPlaybackRatesArray(this.playbackRates),controlBar:{skipButtons:{forward:t,backward:t},remainingTimeDisplay:{displayNegative:!1},volumePanel:{inline:!1}},textTrackSettings:!1,experimentalSvgIcons:!0,language:"current",fluid:!0,controls:!0,preload:"auto"}}get#i(){return this.shadowRoot.getElementById("no-sources")}#s(){this._player&&this._player.dispose()}#l(){this.#e=document.createElement("video");const e=this.querySelectorAll("track");for(let t=0;t<e.length;t++)this.#e.appendChild(e[t]);this.#e.setAttribute("crossorigin","anonymous"),this.#e.toggleAttribute("playsinline",!0),this.loop&&this.#e.setAttribute("loop",""),this.autoplay&&this.#e.setAttribute("autoplay",""),this.#r.appendChild(this.#e)}get#r(){return this.shadowRoot.querySelector(".control")}#n(e=!0){this.#i?.classList.toggle("vjs-hidden",e)}#u(e){this._player=P(this.#e,e),this.shadowRoot.querySelector("[lang]").removeAttribute("lang")}#c(){this._player.on("play",()=>this.$emit("play")),this._player.on("pause",()=>this.$emit("pause")),this._player.on("ended",()=>this.$emit("ended"))}#t(){this.#s();const e=this.#o();e.sources&&this.#r&&this.#i?(this.#n(),this.#l(),this.#u(e),Yb(this._player),this.#c()):this.#n(!1)}}hs([ft.attr],xi.prototype,"poster");hs([ft.attr],xi.prototype,"src");hs([ft.attr({mode:"boolean"})],xi.prototype,"autoplay");hs([ft.attr({mode:"boolean"})],xi.prototype,"loop");hs([ft.attr({attribute:"playback-rates",mode:"fromView"})],xi.prototype,"playbackRates");hs([ft.attr({attribute:"skip-by",mode:"fromView"})],xi.prototype,"skipBy");function Kb(){return ft.html`
216
+ `.split("").map(i=>i.charCodeAt(0)));class X_ extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Y_ extends fo{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return ke();const e=this.subtitlesTrack_.cues,t=e[0].startTime,s=e[e.length-1].startTime;return ke([[t,s]])}initSegmentForMap(e,t=!1){if(!e)return null;const s=Tn(e);let r=this.initSegments_[s];if(t&&!r&&e.bytes){const n=Mc.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(Mc,e.bytes.byteLength),this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){Vs(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,s){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===xt.TIMEOUT&&this.handleTimeout_(),e.code===xt.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const r=this.pendingSegment_,n=s.mp4VttCues&&s.mp4VttCues.length;n&&(r.mp4VttCues=s.mp4VttCues),this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof S.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,s),()=>this.stopForError({message:"Error loading vtt.js"}));return}a.requested=!0;try{this.parseVTTCues_(r)}catch(l){this.stopForError({message:l.message,metadata:{errorType:P.Error.StreamingVttParserError,error:l}});return}if(n||this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach(l=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new S.VTTCue(l.startTime,l.endTime,l.text):l)}),I_(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){const s=e&&e.type==="vtt",r=t&&t.type==="text";s&&r&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const t=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(s=>{const r=s.start+t,n=s.end+t,a=new S.VTTCue(r,n,s.cueText);s.settings&&s.settings.split(" ").forEach(l=>{const u=l.split(":"),f=u[0],m=u[1];a[f]=isNaN(m)?m:Number(m)}),e.cues.push(a)})}parseVTTCues_(e){let t,s=!1;if(typeof S.WebVTT!="function")throw new X_;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof S.TextDecoder=="function"?t=new S.TextDecoder("utf8"):(t=S.WebVTT.StringDecoder(),s=!0);const r=new S.WebVTT.Parser(S,S.vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{P.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;s&&(a=Oc(a)),r.parse(a)}let n=e.bytes;s&&(n=Oc(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,s){const r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:n,LOCAL:a}=e.timestampmap,u=n/di.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(f=>{const m=f.endTime-f.startTime,v=this.handleRollover_(f.startTime+u,t.time);f.startTime=Math.max(v,0),f.endTime=Math.max(v+m,0)}),!s.syncInfo){const f=e.cues[0].startTime,m=e.cues[e.cues.length-1].startTime;s.syncInfo={mediaSequence:s.mediaSequence+e.mediaIndex,time:Math.min(f,m-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let s=e*di.ONE_SECOND_IN_TS;const r=t*di.ONE_SECOND_IN_TS;let n;for(r<s?n=-8589934592:n=8589934592;Math.abs(s-r)>4294967296;)s+=n;return s/di.ONE_SECOND_IN_TS}}const K_=function(i,e){const t=i.cues;for(let s=0;s<t.length;s++){const r=t[s];if(e>=r.adStartTime&&e<=r.adEndTime)return r}return null},Q_=function(i,e,t=0){if(!i.segments)return;let s=t,r;for(let n=0;n<i.segments.length;n++){const a=i.segments[n];if(r||(r=K_(e,s+a.duration/2)),r){if("cueIn"in a){r.endTime=s,r.adEndTime=s,s+=a.duration,r=null;continue}if(s<r.endTime){s+=a.duration;continue}r.endTime+=a.duration}else if("cueOut"in a&&(r=new S.VTTCue(s,s+a.duration,a.cueOut),r.adStartTime=s,r.adEndTime=s+parseFloat(a.cueOut),e.addCue(r)),"cueOutCont"in a){const[l,u]=a.cueOutCont.split("/").map(parseFloat);r=new S.VTTCue(s,s+a.duration,""),r.adStartTime=s-l,r.adEndTime=r.adStartTime+u,e.addCue(r)}s+=a.duration}};class Rc{constructor({start:e,end:t,segmentIndex:s,partIndex:r=null,appended:n=!1}){this.start_=e,this.end_=t,this.segmentIndex_=s,this.partIndex_=r,this.appended_=n}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class J_{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class Xf{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:s,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(s,r),!!this.isReliable_)return this.updateStorage_(r,s,this.calculateBaseTime_(s,r,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:s}of this.storage_.values())if(s.length){for(const r of s)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,s){const r=new Map;let n=`
217
+ `,a=s,l=t;this.start_=a,e.forEach((u,f)=>{const m=this.storage_.get(l),v=a,T=v+u.duration,E=!!(m&&m.segmentSyncInfo&&m.segmentSyncInfo.isAppended),A=new Rc({start:v,end:T,appended:E,segmentIndex:f});u.syncInfo=A;let y=a;const k=(u.parts||[]).map((w,I)=>{const j=y,L=y+w.duration,O=!!(m&&m.partsSyncInfo&&m.partsSyncInfo[I]&&m.partsSyncInfo[I].isAppended),F=new Rc({start:j,end:L,appended:O,segmentIndex:f,partIndex:I});return y=L,n+=`Media Sequence: ${l}.${I} | Range: ${j} --> ${L} | Appended: ${O}
218
+ `,w.syncInfo=F,F});r.set(l,new J_(A,k)),n+=`${zf(u.resolvedUri)} | Media Sequence: ${l} | Range: ${v} --> ${T} | Appended: ${E}
219
+ `,l++,a=T}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t,s){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const r=Math.min(...this.storage_.keys());if(e<r){const n=r-e;let a=this.storage_.get(r).segmentSyncInfo.start;for(let l=0;l<n;l++){const u=t[l];a-=u.duration}return a}return s}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class Nc extends Xf{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,s){if(!this.storage_.size){const r=this.parent_.getSyncInfoForMediaSequence(e);return r?r.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,s)}}const Z_=86400,Ba=[{name:"VOD",run:(i,e,t,s,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(i,e,t,s,r,n)=>{const a=i.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const l=a.getSyncInfoForTime(r);return l?{time:l.start,partIndex:l.partIndex,segmentIndex:l.segmentIndex}:null}},{name:"ProgramDateTime",run:(i,e,t,s,r)=>{if(!Object.keys(i.timelineToDatetimeMappings).length)return null;let n=null,a=null;const l=so(e);r=r||0;for(let u=0;u<l.length;u++){const f=e.endList||r===0?u:l.length-(u+1),m=l[f],v=m.segment,T=i.timelineToDatetimeMappings[v.timeline];if(!T||!v.dateTimeObject)continue;let A=v.dateTimeObject.getTime()/1e3+T;if(v.parts&&typeof m.partIndex=="number")for(let k=0;k<m.partIndex;k++)A+=v.parts[k].duration;const y=Math.abs(r-A);if(a!==null&&(y===0||a<y))break;a=y,n={time:A,segmentIndex:m.segmentIndex,partIndex:m.partIndex}}return n}},{name:"Segment",run:(i,e,t,s,r)=>{let n=null,a=null;r=r||0;const l=so(e);for(let u=0;u<l.length;u++){const f=e.endList||r===0?u:l.length-(u+1),m=l[f],v=m.segment,T=m.part&&m.part.start||v&&v.start;if(v.timeline===s&&typeof T<"u"){const E=Math.abs(r-T);if(a!==null&&a<E)break;(!n||a===null||a>=E)&&(a=E,n={time:T,segmentIndex:m.segmentIndex,partIndex:m.partIndex})}}return n}},{name:"Discontinuity",run:(i,e,t,s,r)=>{let n=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let l=0;l<e.discontinuityStarts.length;l++){const u=e.discontinuityStarts[l],f=e.discontinuitySequence+l+1,m=i.discontinuities[f];if(m){const v=Math.abs(r-m.time);if(a!==null&&a<v)break;(!n||a===null||a>=v)&&(a=v,n={time:m.time,segmentIndex:u,partIndex:null})}}}return n}},{name:"Playlist",run:(i,e,t,s,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class eb extends P.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new Xf,s=new Nc(t),r=new Nc(t);this.mediaSequenceStorage_={main:t,audio:s,vtt:r},this.logger_=ot("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,s,r,n){if(t!==1/0)return Ba.find(({name:u})=>u==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,s,r,n);if(!a.length)return null;for(const l of a){const{syncPoint:u,strategy:f}=l,{segmentIndex:m,time:v}=u;if(m<0)continue;const T=e.segments[m],E=v,A=E+T.duration;if(this.logger_(`Strategy: ${f}. Current time: ${r}. selected segment: ${m}. Time: [${E} -> ${A}]}`),r>=E&&r<A)return this.logger_("Found sync point with exact match: ",u),u}return this.selectSyncPoint_(a,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;const s=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!s.length)return null;const r=this.selectSyncPoint_(s,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Ws({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,s,r,n){const a=[];for(let l=0;l<Ba.length;l++){const u=Ba[l],f=u.run(this,e,t,s,r,n);f&&(f.strategy=u.name,a.push({strategy:u.name,syncPoint:f}))}return a}selectSyncPoint_(e,t){let s=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),n=e[0].strategy;for(let a=1;a<e.length;a++){const l=Math.abs(e[a].syncPoint[t.key]-t.value);l<r&&(r=l,s=e[a].syncPoint,n=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${n}]: [time:${s.time}, segmentIndex:${s.segmentIndex}`+(typeof s.partIndex=="number"?`,partIndex:${s.partIndex}`:"")+"]"),s}saveExpiredSegmentInfo(e,t){const s=t.mediaSequence-e.mediaSequence;if(s>Z_){P.log.warn(`Not saving expired segment info. Media sequence gap ${s} is too large.`);return}for(let r=s-1;r>=0;r--){const n=e.segments[r];if(n&&typeof n.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],s=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-s}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const s=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;s&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,s){const r=e.segment,n=e.part;let a=this.timelines[e.timeline],l,u;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},s&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),l=e.startOfSegment,u=t.end+a.mapping;else if(a)l=t.start+a.mapping,u=t.end+a.mapping;else return!1;return n&&(n.start=l,n.end=u),(!r.start||l<r.start)&&(r.start=l),r.end=u,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,s=e.segment;if(s.discontinuity)this.discontinuities[s.timeline]={time:s.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){const n=t.discontinuityStarts[r],a=t.discontinuitySequence+r+1,l=n-e.mediaIndex,u=Math.abs(l);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>u){let f;l<0?f=s.start-Ws({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):f=s.end+Ws({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:f,accuracy:u}}}}dispose(){this.trigger("dispose"),this.off()}}class tb extends P.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:s}){return typeof t=="number"&&typeof s=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:s},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:s}){if(typeof t=="number"&&typeof s=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:s},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:s}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const ib=Lf(Of(function(){var i=function(){function y(){this.listeners={}}var k=y.prototype;return k.on=function(I,j){this.listeners[I]||(this.listeners[I]=[]),this.listeners[I].push(j)},k.off=function(I,j){if(!this.listeners[I])return!1;var L=this.listeners[I].indexOf(j);return this.listeners[I]=this.listeners[I].slice(0),this.listeners[I].splice(L,1),L>-1},k.trigger=function(I){var j=this.listeners[I];if(j)if(arguments.length===2)for(var L=j.length,O=0;O<L;++O)j[O].call(this,arguments[1]);else for(var F=Array.prototype.slice.call(arguments,1),B=j.length,U=0;U<B;++U)j[U].apply(this,F)},k.dispose=function(){this.listeners={}},k.pipe=function(I){this.on("data",function(j){I.push(j)})},y}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(y){return y.subarray(0,y.byteLength-y[y.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */const t=function(){const y=[[[],[],[],[],[]],[[],[],[],[],[]]],k=y[0],w=y[1],I=k[4],j=w[4];let L,O,F;const B=[],U=[];let X,ae,J,le,z,Z;for(L=0;L<256;L++)U[(B[L]=L<<1^(L>>7)*283)^L]=L;for(O=F=0;!I[O];O^=X||1,F=U[F]||1)for(le=F^F<<1^F<<2^F<<3^F<<4,le=le>>8^le&255^99,I[O]=le,j[le]=O,J=B[ae=B[X=B[O]]],Z=J*16843009^ae*65537^X*257^O*16843008,z=B[le]*257^le*16843008,L=0;L<4;L++)k[L][O]=z=z<<24^z>>>8,w[L][le]=Z=Z<<24^Z>>>8;for(L=0;L<5;L++)k[L]=k[L].slice(0),w[L]=w[L].slice(0);return y};let s=null;class r{constructor(k){s||(s=t()),this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];let w,I,j;const L=this._tables[0][4],O=this._tables[1],F=k.length;let B=1;if(F!==4&&F!==6&&F!==8)throw new Error("Invalid aes key size");const U=k.slice(0),X=[];for(this._key=[U,X],w=F;w<4*F+28;w++)j=U[w-1],(w%F===0||F===8&&w%F===4)&&(j=L[j>>>24]<<24^L[j>>16&255]<<16^L[j>>8&255]<<8^L[j&255],w%F===0&&(j=j<<8^j>>>24^B<<24,B=B<<1^(B>>7)*283)),U[w]=U[w-F]^j;for(I=0;w;I++,w--)j=U[I&3?w:w-4],w<=4||I<4?X[I]=j:X[I]=O[0][L[j>>>24]]^O[1][L[j>>16&255]]^O[2][L[j>>8&255]]^O[3][L[j&255]]}decrypt(k,w,I,j,L,O){const F=this._key[1];let B=k^F[0],U=j^F[1],X=I^F[2],ae=w^F[3],J,le,z;const Z=F.length/4-2;let Re,ee=4;const be=this._tables[1],Dt=be[0],ti=be[1],ii=be[2],si=be[3],ri=be[4];for(Re=0;Re<Z;Re++)J=Dt[B>>>24]^ti[U>>16&255]^ii[X>>8&255]^si[ae&255]^F[ee],le=Dt[U>>>24]^ti[X>>16&255]^ii[ae>>8&255]^si[B&255]^F[ee+1],z=Dt[X>>>24]^ti[ae>>16&255]^ii[B>>8&255]^si[U&255]^F[ee+2],ae=Dt[ae>>>24]^ti[B>>16&255]^ii[U>>8&255]^si[X&255]^F[ee+3],ee+=4,B=J,U=le,X=z;for(Re=0;Re<4;Re++)L[(3&-Re)+O]=ri[B>>>24]<<24^ri[U>>16&255]<<16^ri[X>>8&255]<<8^ri[ae&255]^F[ee++],J=B,B=U,U=X,X=ae,ae=J}}class n extends i{constructor(){super(i),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(k){this.jobs.push(k),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(y){return y<<24|(y&65280)<<8|(y&16711680)>>8|y>>>24},l=function(y,k,w){const I=new Int32Array(y.buffer,y.byteOffset,y.byteLength>>2),j=new r(Array.prototype.slice.call(k)),L=new Uint8Array(y.byteLength),O=new Int32Array(L.buffer);let F,B,U,X,ae,J,le,z,Z;for(F=w[0],B=w[1],U=w[2],X=w[3],Z=0;Z<I.length;Z+=4)ae=a(I[Z]),J=a(I[Z+1]),le=a(I[Z+2]),z=a(I[Z+3]),j.decrypt(ae,J,le,z,O,Z),O[Z]=a(O[Z]^F),O[Z+1]=a(O[Z+1]^B),O[Z+2]=a(O[Z+2]^U),O[Z+3]=a(O[Z+3]^X),F=ae,B=J,U=le,X=z;return L};class u{constructor(k,w,I,j){const L=u.STEP,O=new Int32Array(k.buffer),F=new Uint8Array(k.byteLength);let B=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(O.subarray(B,B+L),w,I,F)),B=L;B<O.length;B+=L)I=new Uint32Array([a(O[B-4]),a(O[B-3]),a(O[B-2]),a(O[B-1])]),this.asyncStream_.push(this.decryptChunk_(O.subarray(B,B+L),w,I,F));this.asyncStream_.push(function(){j(null,e(F))})}static get STEP(){return 32e3}decryptChunk_(k,w,I,j){return function(){const L=l(k,w,I);j.set(L,k.byteOffset)}}}var f=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},m;typeof window<"u"?m=window:typeof f<"u"?m=f:typeof self<"u"?m=self:m={};var v=m,T=function(k){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(k):k&&k.buffer instanceof ArrayBuffer},E=v.BigInt||Number;E("0x1"),E("0x100"),E("0x10000"),E("0x1000000"),E("0x100000000"),E("0x10000000000"),E("0x1000000000000"),E("0x100000000000000"),E("0x10000000000000000"),function(){var y=new Uint16Array([65484]),k=new Uint8Array(y.buffer,y.byteOffset,y.byteLength);return k[0]===255?"big":k[0]===204?"little":"unknown"}();const A=function(y){const k={};return Object.keys(y).forEach(w=>{const I=y[w];T(I)?k[w]={bytes:I.buffer,byteOffset:I.byteOffset,byteLength:I.byteLength}:k[w]=I}),k};self.onmessage=function(y){const k=y.data,w=new Uint8Array(k.encrypted.bytes,k.encrypted.byteOffset,k.encrypted.byteLength),I=new Uint32Array(k.key.bytes,k.key.byteOffset,k.key.byteLength/4),j=new Uint32Array(k.iv.bytes,k.iv.byteOffset,k.iv.byteLength/4);new u(w,I,j,function(L,O){self.postMessage(A({source:k.source,decrypted:O}),[O.buffer])})}}));var sb=Pf(ib);const rb=i=>{let e=i.default?"main":"alternative";return i.characteristics&&i.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},Yf=(i,e)=>{i.abort(),i.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},mo=(i,e)=>{e.activePlaylistLoader=i,i.load()},nb=(i,e)=>()=>{const{segmentLoaders:{[i]:t,main:s},mediaTypes:{[i]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),l=r.activePlaylistLoader,u=r.lastGroup_;if(!(a&&u&&a.id===u.id)&&(r.lastGroup_=a,r.lastTrack_=n,Yf(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){l&&s.resetEverything();return}t.resyncLoader(),mo(a.playlistLoader,r)}},ab=(i,e)=>()=>{const{segmentLoaders:{[i]:t},mediaTypes:{[i]:s}}=e;s.lastGroup_=null,t.abort(),t.pause()},ob=(i,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[i]:s,main:r},mediaTypes:{[i]:n}}=e,a=n.activeTrack(),l=n.getActiveGroup(),u=n.activePlaylistLoader,f=n.lastTrack_;if(!(f&&a&&f.id===a.id)&&(n.lastGroup_=l,n.lastTrack_=a,Yf(s,n),!!l)){if(l.isMainPlaylist){if(!a||!f||a.id===f.id)return;const m=e.vhs.playlistController_,v=m.selectPlaylist();if(m.media()===v)return;n.logger_(`track change. Switching main audio from ${f.id} to ${a.id}`),t.pause(),r.resetEverything(),m.fastQualityChange_(v);return}if(i==="AUDIO"){if(!l.playlistLoader){r.setAudio(!0),r.resetEverything();return}s.setAudio(!0),r.setAudio(!1)}if(u===l.playlistLoader){mo(l.playlistLoader,n);return}s.track&&s.track(a),s.resetEverything(),mo(l.playlistLoader,n)}},xn={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:t},excludePlaylist:s}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(u=>u.default)[0]||n[0]).id,l=t.tracks[a];if(r===l){s({error:{message:"Problem encountered loading the default audio track."}});return}P.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const u in t.tracks)t.tracks[u].enabled=t.tracks[u]===l;t.onTrackChanged()},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:t}}=e;P.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const s=t.activeTrack();s&&(s.mode="disabled"),t.onTrackChanged()}},Bc={AUDIO:(i,e,t)=>{if(!e)return;const{tech:s,requestOptions:r,segmentLoaders:{[i]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!s.paused()||a.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",xn[i](i,t))},SUBTITLES:(i,e,t)=>{const{tech:s,requestOptions:r,segmentLoaders:{[i]:n},mediaTypes:{[i]:a}}=t;e.on("loadedmetadata",()=>{const l=e.media();n.playlist(l,r),n.track(a.activeTrack()),(!s.paused()||l.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",xn[i](i,t))}},lb={AUDIO:(i,e)=>{const{vhs:t,sourceType:s,segmentLoaders:{[i]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[i]:{groups:l,tracks:u,logger_:f}},mainPlaylistLoader:m}=e,v=hr(m.main);(!a[i]||Object.keys(a[i]).length===0)&&(a[i]={main:{default:{default:!0}}},v&&(a[i].main.default.playlists=m.main.playlists));for(const T in a[i]){l[T]||(l[T]=[]);for(const E in a[i][T]){let A=a[i][T][E],y;if(v?(f(`AUDIO group '${T}' label '${E}' is a main playlist`),A.isMainPlaylist=!0,y=null):s==="vhs-json"&&A.playlists?y=new Ri(A.playlists[0],t,n):A.resolvedUri?y=new Ri(A.resolvedUri,t,n):A.playlists&&s==="dash"?y=new uo(A.playlists[0],t,n,m):y=null,A=ie({id:E,playlistLoader:y},A),Bc[i](i,A.playlistLoader,e),l[T].push(A),typeof u[E]>"u"){const k=new P.AudioTrack({id:E,kind:rb(A),enabled:!1,language:A.language,default:A.default,label:E});u[E]=k}}}r.on("error",xn[i](i,e))},SUBTITLES:(i,e)=>{const{tech:t,vhs:s,sourceType:r,segmentLoaders:{[i]:n},requestOptions:a,main:{mediaGroups:l},mediaTypes:{[i]:{groups:u,tracks:f}},mainPlaylistLoader:m}=e;for(const v in l[i]){u[v]||(u[v]=[]);for(const T in l[i][v]){if(!s.options_.useForcedSubtitles&&l[i][v][T].forced)continue;let E=l[i][v][T],A;if(r==="hls")A=new Ri(E.resolvedUri,s,a);else if(r==="dash"){if(!E.playlists.filter(k=>k.excludeUntil!==1/0).length)return;A=new uo(E.playlists[0],s,a,m)}else r==="vhs-json"&&(A=new Ri(E.playlists?E.playlists[0]:E.resolvedUri,s,a));if(E=ie({id:T,playlistLoader:A},E),Bc[i](i,E.playlistLoader,e),u[v].push(E),typeof f[T]>"u"){const y=t.addRemoteTextTrack({id:T,kind:"subtitles",default:E.default&&E.autoselect,language:E.language,label:T},!1).track;f[T]=y}}}n.on("error",xn[i](i,e))},"CLOSED-CAPTIONS":(i,e)=>{const{tech:t,main:{mediaGroups:s},mediaTypes:{[i]:{groups:r,tracks:n}}}=e;for(const a in s[i]){r[a]||(r[a]=[]);for(const l in s[i][a]){const u=s[i][a][l];if(!/^(?:CC|SERVICE)/.test(u.instreamId))continue;const f=t.options_.vhs&&t.options_.vhs.captionServices||{};let m={label:l,language:u.language,instreamId:u.instreamId,default:u.default&&u.autoselect};if(f[m.instreamId]&&(m=ie(m,f[m.instreamId])),m.default===void 0&&delete m.default,r[a].push(ie({id:l},u)),typeof n[l]>"u"){const v=t.addRemoteTextTrack({id:m.instreamId,kind:"captions",default:m.default,language:m.language,label:m.label},!1).track;n[l]=v}}}}},Kf=(i,e)=>{for(let t=0;t<i.length;t++)if(dl(e,i[t])||i[t].playlists&&Kf(i[t].playlists,e))return!0;return!1},ub=(i,e)=>t=>{const{mainPlaylistLoader:s,mediaTypes:{[i]:{groups:r}}}=e,n=s.media();if(!n)return null;let a=null;n.attributes[i]&&(a=r[n.attributes[i]]);const l=Object.keys(r);if(!a)if(i==="AUDIO"&&l.length>1&&hr(e.main))for(let u=0;u<l.length;u++){const f=r[l[u]];if(Kf(f,n)){a=f;break}}else r.main?a=r.main:l.length===1&&(a=r[l[0]]);return typeof t>"u"?a:t===null||!a?null:a.filter(u=>u.id===t.id)[0]||null},cb={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].enabled)return t[s];return null},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].mode==="showing"||t[s].mode==="hidden")return t[s];return null}},db=(i,{mediaTypes:e})=>()=>{const t=e[i].activeTrack();return t?e[i].activeGroup(t):null},hb=i=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(f=>{lb[f](f,i)});const{mediaTypes:e,mainPlaylistLoader:t,tech:s,vhs:r,segmentLoaders:{["AUDIO"]:n,main:a}}=i;["AUDIO","SUBTITLES"].forEach(f=>{e[f].activeGroup=ub(f,i),e[f].activeTrack=cb[f](f,i),e[f].onGroupChanged=nb(f,i),e[f].onGroupChanging=ab(f,i),e[f].onTrackChanged=ob(f,i),e[f].getActiveGroup=db(f,i)});const l=e.AUDIO.activeGroup();if(l){const f=(l.filter(v=>v.default)[0]||l[0]).id;e.AUDIO.tracks[f].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(f=>e[f].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(f=>e[f].onGroupChanging())});const u=()=>{e.AUDIO.onTrackChanged(),s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",u),s.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{s.audioTracks().removeEventListener("change",u),s.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),s.clearTracks("audio");for(const f in e.AUDIO.tracks)s.audioTracks().addTrack(e.AUDIO.tracks[f])},fb=()=>{const i={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{i[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Pt,activeTrack:Pt,getActiveGroup:Pt,onGroupChanged:Pt,onTrackChanged:Pt,lastTrack_:null,logger_:ot(`MediaGroups[${e}]`)}}),i};class Fc{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Ge(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class pb extends P.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new Fc,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=ot("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const s=t.serverUri||t.serverURL;if(!s){this.logger_(`steering manifest URL is ${s}, cannot request steering manifest.`),this.trigger("error");return}if(s.startsWith("data:")){this.decodeDataUriManifest_(s.substring(s.indexOf(",")+1));return}this.steeringManifest.reloadUri=Ge(e,s),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const s=e?t:this.getRequestURI(t);if(!s){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const r={contentSteeringInfo:{uri:s}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:s,requestType:"content-steering-manifest"},(n,a)=>{if(n){if(a.status===410){this.logger_(`manifest request 410 ${n}.`),this.logger_(`There will be no more content steering requests to ${s} this session.`),this.excludedSteeringManifestURLs.add(s);return}if(a.status===429){const f=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${f} seconds.`),this.startTTLTimeout_(parseInt(f,10));return}this.logger_(`manifest failed to load ${n}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:r});let l;try{l=JSON.parse(this.request_.responseText)}catch(f){const m={errorType:P.Error.StreamingContentSteeringParserError,error:f};this.trigger({type:"error",metadata:m})}this.assignSteeringProperties_(l);const u={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:u}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new S.URL(e),s=new S.URL(this.proxyServerUrl_);return s.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(s.toString())}decodeDataUriManifest_(e){const t=JSON.parse(S.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new S.URL(e),s=this.getPathway(),r=this.getBandwidth_();if(s){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,s)}if(r){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const s=(r=>{for(const n of r)if(this.availablePathways_.has(n))return n;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==s&&(this.currentPathway=s,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const s=this.setSteeringParams_(e);return t(s)?null:s}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=S.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){S.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new Fc}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(Ge(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const mb=(i,e)=>{let t=null;return(...s)=>{clearTimeout(t),t=setTimeout(()=>{i.apply(null,s)},e)}},gb=10;let Xt;const vb=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],yb=function(i){return this.audioSegmentLoader_[i]+this.mainSegmentLoader_[i]},_b=function({currentPlaylist:i,buffered:e,currentTime:t,nextPlaylist:s,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:l,log:u}){if(!s)return P.log.warn("We received no playlist to switch to. Please check your stream."),!1;const f=`allowing switch ${i&&i.id||"null"} -> ${s.id}`;if(!i)return u(`${f} as current playlist is not set`),!0;if(s.id===i.id)return!1;const m=!!Mi(e,t).length;if(!i.endList)return!m&&typeof i.partTargetDuration=="number"?(u(`not ${f} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(u(`${f} as current playlist is live`),!0);const v=ll(e,t),T=l?we.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:we.MAX_BUFFER_LOW_WATER_LINE;if(a<T)return u(`${f} as duration < max low water line (${a} < ${T})`),!0;const E=s.attributes.BANDWIDTH,A=i.attributes.BANDWIDTH;if(E<A&&(!l||v<n)){let y=`${f} as next bandwidth < current bandwidth (${E} < ${A})`;return l&&(y+=` and forwardBuffer < bufferHighWaterLine (${v} < ${n})`),u(y),!0}if((!l||E>A)&&v>=r){let y=`${f} as forwardBuffer >= bufferLowWaterLine (${v} >= ${r})`;return l&&(y+=` and next bandwidth > current bandwidth (${E} > ${A})`),u(y),!0}return u(`not ${f} as no switching criteria met`),!1};class bb extends P.EventTarget{constructor(e){super(),this.fastQualityChange_=mb(this.fastQualityChange_.bind(this),100);const{src:t,withCredentials:s,tech:r,bandwidth:n,externVhs:a,useCueTags:l,playlistExclusionDuration:u,enableLowInitialPlaylist:f,sourceType:m,cacheEncryptionKeys:v,bufferBasedABR:T,leastPixelDiffSelector:E,captionServices:A,experimentalUseMMS:y}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:k}=e;(k===null||typeof k>"u")&&(k=1/0),Xt=a,this.bufferBasedABR=!!T,this.leastPixelDiffSelector=!!E,this.withCredentials=s,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=m,this.useCueTags_=l,this.playlistExclusionDuration=u,this.maxPlaylistRetries=k,this.enableLowInitialPlaylist=f,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:s,maxPlaylistRetries:k,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=fb(),y&&S.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new S.ManagedMediaSource,this.usingManagedMediaSource_=!0,P.log("Using ManagedMediaSource")):S.MediaSource&&(this.mediaSource=new S.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=ke(),this.hasPlayed_=!1,this.syncController_=new eb(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new sb,this.sourceUpdater_=new Wf(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new tb,this.keyStatusMap_=new Map;const w={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:A,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:v,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new uo(t,this.vhs_,ie(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Ri(t,this.vhs_,ie(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new fo(ie(w,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new fo(ie(w,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Y_(ie(w,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((L,O)=>{function F(){r.off("vttjserror",B),L()}function B(){r.off("vttjsloaded",F),O()}r.one("vttjsloaded",F),r.one("vttjserror",B),r.addWebVttScript_()})}),e);const I=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new pb(this.vhs_.xhr,I),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),vb.forEach(L=>{this[L+"_"]=yb.bind(this,L)}),this.logger_=ot("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const j=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(j,()=>{const L=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-L,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,s){const r=this.media(),n=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);const l={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:l}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,s)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],s=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(s&&r){const a=(s.length?s[0].playlists:s.playlists).filter(l=>l.attributes.serviceLocation===r);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=S.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(S.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const s=e.mediaGroups.AUDIO,r=Object.keys(s);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const l=s.main||r.length&&s[r[0]];for(const u in l)if(l[u].default){n={label:u};break}}if(!n)return t;const a=[];for(const l in s)if(s[l][n.label]){const u=s[l][n.label];if(u.playlists&&u.playlists.length)a.push.apply(a,u.playlists);else if(u.uri)a.push(u);else if(e.playlists.length)for(let f=0;f<e.playlists.length;f++){const m=e.playlists[f];m.attributes&&m.attributes.AUDIO&&m.attributes.AUDIO===l&&a.push(m)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const t=this.mainPlaylistLoader_.media(),s=t.targetDuration*1.5*1e3;ro(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=s,t.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),hb({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),t),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let s;if(this.enableLowInitialPlaylist&&(s=this.selectInitialPlaylist()),s||(s=this.selectPlaylist()),!s||!this.shouldSwitchToMedia_(s)||(this.initialMedia_=s,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}),this.mainPlaylistLoader_.on("error",()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const t=this.mainPlaylistLoader_.media(),s=t.targetDuration*1.5*1e3;ro(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=s,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(t)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(t=>{this.mainPlaylistLoader_.on(t,s=>{this.player_.trigger(_e({},s))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const s=e.mediaGroups||{};let r=!0;const n=Object.keys(s.AUDIO);for(const a in s.AUDIO)for(const l in s.AUDIO[a])s.AUDIO[a][l].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(s.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Xt.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(s.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,s=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return _b({buffered:a,currentTime:s,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const s=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:s.playlist,error:s})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const s=this.audioSegmentLoader_.pendingSegment_;if(!s||!s.segment||!s.segment.syncInfo)return;const r=s.segment.syncInfo.end+.01;this.tech_.setCurrentTime(r)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",s=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:gb}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const s=this.getCodecsOrExclude_();s&&this.sourceUpdater_.addOrChangeSourceBuffers(s)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(s=>{this.mainSegmentLoader_.on(s,r=>{this.player_.trigger(_e({},r))}),this.audioSegmentLoader_.on(s,r=>{this.player_.trigger(_e({},r))}),this.subtitleSegmentLoader_.on(s,r=>{this.player_.trigger(_e({},r))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const s=t.end(0);let r=s;if(e.start){const n=e.start.timeOffset;n<0?r=Math.max(s+n,t.start(0)):r=Math.min(s,n)}this.trigger("firstplay"),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();typeof e<"u"&&typeof e.then=="function"&&e.then(null,t=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const s=this.syncController_.getExpiredTime(e,this.duration());if(s===null)return!1;const r=Xt.Playlist.playlistEnd(e,s),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-n<=Tt;const l=a.end(a.length-1);return l-n<=Tt&&r-l<=Tt}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:s}){if(e=e||this.mainPlaylistLoader_.media(),s=s||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,n=r.filter(Xn),a=n.length===1&&n[0]===e;if(r.length===1&&s!==1/0)return P.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const A=this.pathwayAttribute_(e),y=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(A),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(A)},y);return}let E=!1;r.forEach(A=>{if(A===e)return;const y=A.excludeUntil;typeof y<"u"&&y!==1/0&&(E=!0,delete A.excludeUntil)}),E&&(P.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let l;e.playlistErrors_>this.maxPlaylistRetries?l=1/0:l=Date.now()+s*1e3,e.excludeUntil=l,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const u=this.selectPlaylist();if(!u){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const f=t.internal?this.logger_:P.log.warn,m=t.message?" "+t.message:"";f(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${m} Switching to playlist ${u.id}.`),u.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const v=u.targetDuration/2*1e3||5*1e3,T=typeof u.lastRequest=="number"&&Date.now()-u.lastRequest<=v;return this.switchMedia_(u,"exclude",a||T)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const s=[],r=e==="all";(r||e==="main")&&s.push(this.mainPlaylistLoader_);const n=[];(r||e==="audio")&&n.push("AUDIO"),(r||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const l=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;l&&s.push(l)}),["main","audio","subtitle"].forEach(a=>{const l=this[`${a}SegmentLoader_`];l&&(e===a||e==="all")&&s.push(l)}),s.forEach(a=>t.forEach(l=>{typeof a[l]=="function"&&a[l]()}))}setCurrentTime(e){const t=Mi(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Xt.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){const s=e.media();if(!s)return null;const r=this.syncController_.getMediaSequenceSync(t);if(r&&r.isReliable){const l=r.start,u=r.end;if(!isFinite(l)||!isFinite(u))return null;const f=Xt.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,s),m=Math.max(l,u-f);return ke([[l,m]])}const n=this.syncController_.getExpiredTime(s,this.duration());if(n===null)return null;const a=Xt.Playlist.seekable(s,n,Xt.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,s));return a.length?a:null}computeFinalSeekable_(e,t){if(!t)return e;const s=e.start(0),r=e.end(0),n=t.start(0),a=t.end(0);return n>r||s>a?e:ke([[Math.max(s,n),Math.min(r,a)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let t;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!t))return;const s=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||s&&s.length&&this.seekable_.length&&s.start(0)===this.seekable_.start(0)&&s.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${af(this.seekable_)}]`);const r={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:r}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const r=this.seekable();if(!r.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<r.end(r.length-1))&&this.sourceUpdater_.setDuration(r.end(r.length-1));return}const t=this.tech_.buffered();let s=Xt.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(s=Math.max(s,t.end(t.length-1))),this.mediaSource.duration!==s&&this.sourceUpdater_.setDuration(s)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const s in t)t[s].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),s=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!s)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const s=Xs(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=s.video||e.main.videoCodec||Bg),e.main.isMuxed&&(r.video+=`,${s.audio||e.main.audioCodec||xu}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=s.audio||e.main.audioCodec||e.audio.audioCodec||xu,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(f,m)=>f?qs(m,this.usingManagedMediaSource_):Ta(m),l={};let u;if(["video","audio"].forEach(function(f){if(r.hasOwnProperty(f)&&!a(e[f].isFmp4,r[f])){const m=e[f].isFmp4?"browser":"muxer";l[m]=l[m]||[],l[m].push(r[f]),f==="audio"&&(u=m)}}),n&&u&&t.attributes.AUDIO){const f=t.attributes.AUDIO;this.main().playlists.forEach(m=>{(m.attributes&&m.attributes.AUDIO)===f&&m!==t&&(m.excludeUntil=1/0)}),this.logger_(`excluding audio group ${f} as ${u} does not support codec(s): "${r.audio}"`)}if(Object.keys(l).length){const f=Object.keys(l).reduce((m,v)=>(m&&(m+=", "),m+=`${v} does not support codec(s): "${l[v].join(",")}"`,m),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:f},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const f=[];if(["video","audio"].forEach(m=>{const v=(vt(this.sourceUpdater_.codecs[m]||"")[0]||{}).type,T=(vt(r[m]||"")[0]||{}).type;v&&T&&v.toLowerCase()!==T.toLowerCase()&&f.push(`"${this.sourceUpdater_.codecs[m]}" -> "${r[m]}"`)}),f.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${f.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(s=>{const r=e[s];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=Xs(this.main,r),a=[];n.audio&&!Ta(n.audio)&&!qs(n.audio,this.usingManagedMediaSource_)&&a.push(`audio codec ${n.audio}`),n.video&&!Ta(n.video)&&!qs(n.video,this.usingManagedMediaSource_)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],s=this.main().playlists,r=ir(vt(e)),n=Tc(r),a=r.video&&vt(r.video)[0]||null,l=r.audio&&vt(r.audio)[0]||null;Object.keys(s).forEach(u=>{const f=s[u];if(t.indexOf(f.id)!==-1||f.excludeUntil===1/0)return;t.push(f.id);const m=[],v=Xs(this.mainPlaylistLoader_.main,f),T=Tc(v);if(!(!v.audio&&!v.video)){if(T!==n&&m.push(`codec count "${T}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const E=v.video&&vt(v.video)[0]||null,A=v.audio&&vt(v.audio)[0]||null;E&&a&&E.type.toLowerCase()!==a.type.toLowerCase()&&m.push(`video codec "${E.type}" !== "${a.type}"`),A&&l&&A.type.toLowerCase()!==l.type.toLowerCase()&&m.push(`audio codec "${A.type}" !== "${l.type}"`)}m.length&&(f.excludeUntil=1/0,this.logger_(`excluding ${f.id}: ${m.join(" && ")}`))}})}updateAdCues_(e){let t=0;const s=this.seekable();s.length&&(t=s.start(0)),Q_(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=we.GOAL_BUFFER_LENGTH,s=we.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,we.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*s,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=we.BUFFER_LOW_WATER_LINE,s=we.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,we.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,we.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*s,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return we.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){kc(this.inbandTextTracks_,"com.apple.streaming",this.tech_),j_({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,s){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();kc(this.inbandTextTracks_,e,this.tech_),w_({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:s})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.contentSteeringController_.on(t,s=>{this.trigger(_e({},s))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const t=this.main();(this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||(()=>{const n=this.contentSteeringController_.getAvailablePathways(),a=[];for(const l of t.playlists){const u=l.attributes.serviceLocation;if(u&&(a.push(u),!n.has(u)))return!0}return!!(!a.length&&n.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const s=this.main().playlists,r=new Set;let n=!1;Object.keys(s).forEach(a=>{const l=s[a],u=this.pathwayAttribute_(l),f=u&&e!==u;l.excludeUntil===1/0&&l.lastExcludeReason_==="content-steering"&&!f&&(delete l.excludeUntil,delete l.lastExcludeReason_,n=!0);const v=!l.excludeUntil&&l.excludeUntil!==1/0;!r.has(l.id)&&f&&v&&(r.add(l.id),l.excludeUntil=1/0,l.lastExcludeReason_="content-steering",this.logger_(`excluding ${l.id} for ${l.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const l=this.mediaTypes_[a];if(l.activePlaylistLoader){const u=l.activePlaylistLoader.media_;u&&u.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,s=this.contentSteeringController_.currentPathwayClones,r=this.contentSteeringController_.nextPathwayClones;if(s&&s.size||r&&r.size){for(const[a,l]of s.entries())r.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(l),this.contentSteeringController_.excludePathway(a));for(const[a,l]of r.entries()){const u=s.get(a);if(!u){t.filter(m=>m.attributes["PATHWAY-ID"]===l["BASE-ID"]).forEach(m=>{this.mainPlaylistLoader_.addClonePathway(l,m)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(u,l)||(this.mainPlaylistLoader_.updateOrDeleteClone(l,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...r])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const s=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in s)if(s[n]!==r[n])return!1;for(const n in r)if(s[n]!==r[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=this.mainPlaylistLoader_.getKeyIdSet(s);!r||!r.size||r.forEach(n=>{const a="usable",l=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,u=s.lastExcludeReason_===t&&s.excludeUntil===1/0;l?l&&u&&(delete s.excludeUntil,delete s.lastExcludeReason_,this.logger_(`enabling playlist ${s.id} because key ID ${n} is ${a}`)):(s.excludeUntil!==1/0&&s.lastExcludeReason_!==t&&(s.excludeUntil=1/0,s.lastExcludeReason_=t,this.logger_(`excluding playlist ${s.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=s&&s.attributes&&s.attributes.RESOLUTION&&s.attributes.RESOLUTION.height<720,n=s.excludeUntil===1/0&&s.lastExcludeReason_===t;r&&n&&(delete s.excludeUntil,P.log.warn(`enabling non-HD playlist ${s.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=(typeof e=="string"?e:W_(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const Tb=(i,e,t)=>s=>{const r=i.main.playlists[e],n=cl(r),a=Xn(r);if(typeof s>"u")return a;s?delete r.disabled:r.disabled=!0;const l={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return s!==a&&!n&&(s?(t(r),i.trigger({type:"renditionenabled",metadata:l})):i.trigger({type:"renditiondisabled",metadata:l})),s};class xb{constructor(e,t,s){const{playlistController_:r}=e,n=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Xs(r.main(),t),this.playlist=t,this.id=s,this.enabled=Tb(e.playlists,t.id,n)}}const Sb=function(i){i.representations=()=>{const e=i.playlistController_.main(),t=hr(e)?i.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(s=>!cl(s)).map((s,r)=>new xb(i,s,s.id)):[]}},Uc=["seeking","seeked","pause","playing","error"];class Cb extends P.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=ot("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),s=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,l=["main","subtitle","audio"],u={};l.forEach(m=>{u[m]={reset:()=>this.resetSegmentDownloads_(m),updateend:()=>this.checkSegmentDownloads_(m)},a[`${m}SegmentLoader_`].on("appendsdone",u[m].updateend),a[`${m}SegmentLoader_`].on("playlistupdate",u[m].reset),this.tech_.on(["seeked","seeking"],u[m].reset)});const f=m=>{["main","audio"].forEach(v=>{a[`${v}SegmentLoader_`][m]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),f("off"))},this.clearSeekingAppendCheck_=()=>f("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),f("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(Uc,n),this.tech_.on("canplay",s),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(Uc,n),this.tech_.off("canplay",s),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),l.forEach(m=>{a[`${m}SegmentLoader_`].off("appendsdone",u[m].updateend),a[`${m}SegmentLoader_`].off("playlistupdate",u[m].reset),this.tech_.off(["seeked","seeking"],u[m].reset)}),this.checkCurrentTimeTimeout_&&S.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&S.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=S.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,s=t[`${e}SegmentLoader_`],r=s.buffered_(),n=uy(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){const a={bufferedRanges:r};t.trigger({type:"bufferedrangeschanged",metadata:a}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:s.playlist_&&s.playlist_.id,buffered:hi(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Tt>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(ke([this.lastRecordedTime,e]));const s={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:s}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),s=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,s,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(r&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,s)){const A=t.start(0);n=A+(A===t.end(0)?0:Tt)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${s} with seekable range ${af(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,l=this.tech_.buffered(),u=a.audioBuffer?a.audioBuffered():null,f=a.videoBuffer?a.videoBuffered():null,m=this.media(),v=m.partTargetDuration?m.partTargetDuration:(m.targetDuration-bt)*2,T=[u,f];for(let A=0;A<T.length;A++){if(!T[A])continue;if(ll(T[A],s)<v)return!1}const E=Gr(l,s);return E.length===0?!1:(n=E.start(0)+Tt,this.logger_(`Buffered region starts (${E.start(0)}) just beyond seek point (${s}). Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),s=Mi(t,e);if(s.length&&e+3<=s.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${s.start(0)} -> ${s.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const l=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${l}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(l),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const s=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:s.audioBuffered(),videoBuffered:s.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=Gr(r,t);return a.length>0?(this.logger_(`Stopped at ${t} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,s,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+Tt;const a=!s.endList,l=typeof s.partTargetDuration=="number";return a&&(l||r)&&(n=e.end(e.length-1)+s.targetDuration*3),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:s}){if(!e)return;let r;if(e.length&&t.length){const n=Mi(e,s-3),a=Mi(e,s),l=Mi(t,s);l.length&&!a.length&&n.length&&(r={start:n.end(0),end:l.end(0)})}else Gr(e,s).length||(r=this.gapFromVideoUnderflow_(e,s));return r?(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${s}`),!0):!1}skipTheGap_(e){const t=this.tech_.buffered(),s=this.tech_.currentTime(),r=Gr(t,s);if(this.resetTimeUpdate_(),r.length===0||s!==e)return;this.logger_("skipTheGap_:","currentTime:",s,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+bt);const n={gapInfo:{from:s,to:r.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const s=ay(e);for(let r=0;r<s.length;r++){const n=s.start(r),a=s.end(r);if(t-n<4&&t-n>2)return{start:n,end:a}}return null}}const Eb={errorInterval:30,getSource(i){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return i(t)}},Qf=function(i,e){let t=0,s=0;const r=ie(Eb,e);i.ready(()=>{i.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){s&&i.currentTime(s)},a=function(m){m!=null&&(s=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",n),i.src(m),i.trigger({type:"usage",name:"vhs-error-reload"}),i.play())},l=function(){if(Date.now()-t<r.errorInterval*1e3){i.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!r.getSource||typeof r.getSource!="function"){P.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return t=Date.now(),r.getSource.call(i,a)},u=function(){i.off("loadedmetadata",n),i.off("error",l),i.off("dispose",u)},f=function(m){u(),Qf(i,m)};i.on("error",l),i.on("dispose",u),i.reloadSourceOnError=f},Ab=function(i){Qf(this,i)};var Jf="3.17.0",wb="7.1.0",Db="1.3.1",kb="7.2.0",jb="4.0.2";const ge={PlaylistLoader:Ri,Playlist:We,utils:My,STANDARD_PLAYLIST_SELECTOR:Dc,INITIAL_PLAYLIST_SELECTOR:x_,lastBandwidthSelector:Dc,movingAverageBandwidthSelector:b_,comparePlaylistBandwidth:fl,comparePlaylistResolution:__,xhr:Ef()};Object.keys(we).forEach(i=>{Object.defineProperty(ge,i,{get(){return P.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),we[i]},set(e){if(P.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){P.log.warn(`value of Vhs.${i} must be greater than or equal to 0`);return}we[i]=e}})});const Zf="videojs-vhs",ep=function(i,e){const t=e.media();let s=-1;for(let r=0;r<i.length;r++)if(i[r].id===t.id){s=r;break}i.selectedIndex_=s,i.trigger({selectedIndex:s,type:"change"})},Ib=function(i,e){e.representations().forEach(t=>{i.addQualityLevel(t)}),ep(i,e.playlists)};ge.canPlaySource=function(){return P.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const Pb=(i,e,t)=>{if(!i)return i;let s={};e&&e.attributes&&e.attributes.CODECS&&(s=ir(vt(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(s.audio=t.attributes.CODECS);const r=Gi(s.video),n=Gi(s.audio),a={};for(const l in i)a[l]={},n&&(a[l].audioContentType=n),r&&(a[l].videoContentType=r),e.contentProtection&&e.contentProtection[l]&&e.contentProtection[l].pssh&&(a[l].pssh=e.contentProtection[l].pssh),typeof i[l]=="string"&&(a[l].url=i[l]);return ie(i,a)},Lb=(i,e)=>i.reduce((t,s)=>{if(!s.contentProtection)return t;const r=e.reduce((n,a)=>{const l=s.contentProtection[a];return l&&l.pssh&&(n[a]={pssh:l.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),Ob=({player:i,sourceKeySystems:e,audioMedia:t,mainPlaylists:s})=>{if(!i.eme.initializeMediaKeys)return Promise.resolve();const r=t?s.concat([t]):s,n=Lb(r,Object.keys(e)),a=[],l=[];return n.forEach(u=>{l.push(new Promise((f,m)=>{i.tech_.one("keysessioncreated",f)})),a.push(new Promise((f,m)=>{i.eme.initializeMediaKeys({keySystems:u},v=>{if(v){m(v);return}f()})}))}),Promise.race([Promise.all(a),Promise.race(l)])},Mb=({player:i,sourceKeySystems:e,media:t,audioMedia:s})=>{const r=Pb(e,t,s);return r?(i.currentSource().keySystems=r,r&&!i.eme?(P.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},tp=()=>{if(!S.localStorage)return null;const i=S.localStorage.getItem(Zf);if(!i)return null;try{return JSON.parse(i)}catch{return null}},Rb=i=>{if(!S.localStorage)return!1;let e=tp();e=e?ie(e,i):i;try{S.localStorage.setItem(Zf,JSON.stringify(e))}catch{return!1}return e},Nb=i=>i.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(i.substring(i.indexOf(",")+1)):i,ip=(i,e)=>{i._requestCallbackSet||(i._requestCallbackSet=new Set),i._requestCallbackSet.add(e)},sp=(i,e)=>{i._responseCallbackSet||(i._responseCallbackSet=new Set),i._responseCallbackSet.add(e)},rp=(i,e)=>{i._requestCallbackSet&&(i._requestCallbackSet.delete(e),i._requestCallbackSet.size||delete i._requestCallbackSet)},np=(i,e)=>{i._responseCallbackSet&&(i._responseCallbackSet.delete(e),i._responseCallbackSet.size||delete i._responseCallbackSet)};ge.supportsNativeHls=function(){if(!V||!V.createElement)return!1;const i=V.createElement("video");return P.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(i.canPlayType(t))}):!1}();ge.supportsNativeDash=function(){return!V||!V.createElement||!P.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(V.createElement("video").canPlayType("application/dash+xml"))}();ge.supportsTypeNatively=i=>i==="hls"?ge.supportsNativeHls:i==="dash"?ge.supportsNativeDash:!1;ge.isSupported=function(){return P.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};ge.xhr.onRequest=function(i){ip(ge.xhr,i)};ge.xhr.onResponse=function(i){sp(ge.xhr,i)};ge.xhr.offRequest=function(i){rp(ge.xhr,i)};ge.xhr.offResponse=function(i){np(ge.xhr,i)};const Bb=P.getComponent("Component");class ap extends Bb{constructor(e,t,s){if(super(t,s.vhs),typeof s.initialBandwidth=="number"&&(this.options_.bandwidth=s.initialBandwidth),this.logger_=ot("VhsHandler"),t.options_&&t.options_.playerId){const r=P.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(V,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=V.fullscreenElement||V.webkitFullscreenElement||V.mozFullScreenElement||V.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=ie(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const s=tp();s&&s.bandwidth&&(this.options_.bandwidth=s.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),s&&s.throughput&&(this.options_.throughput=s.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=we.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===we.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(s=>{typeof this.source_[s]<"u"&&(this.options_[s]=this.source_[s])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=Nb(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=ge,this.options_.sourceType=Jc(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new bb(this.options_);const s=ie({liveRangeSafeTimeDelta:Tt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Cb(s),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=P.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});const r=this.options_.bufferBasedABR?ge.movingAverageBandwidthSelector(.55):ge.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=ge.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=S.navigator.connection||S.navigator.mozConnection||S.navigator.webkitConnection,l=1e7;if(this.options_.useNetworkInformationApi&&a){const u=a.downlink*1e3*1e3;u>=l&&n>=l?n=Math.max(n,u):n=u}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(n+a))},set(){P.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>hi(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>hi(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&Rb({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{Sb(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=S.URL.createObjectURL(this.playlistController_.mediaSource),(P.browser.IS_ANY_SAFARI||P.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),Ob({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=Mb({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",s=>{this.playlistController_.updatePlaylistByKeyStatus(s.keyId,s.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=P.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{Ib(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{ep(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Jf,"mux.js":wb,"mpd-parser":Db,"m3u8-parser":kb,"aes-decrypter":jb}}version(){return this.constructor.version()}canChangeType(){return Wf.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&S.URL.revokeObjectURL&&(S.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return Hy({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,s=!0,r=2){return jf({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:s,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{ip(this.xhr,e)},this.xhr.onResponse=e=>{sp(this.xhr,e)},this.xhr.offRequest=e=>{rp(this.xhr,e)},this.xhr.offResponse=e=>{np(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(s=>{this.playlistController_.on(s,r=>{this.player_.trigger(_e({},r))})}),t.forEach(s=>{this.playbackWatcher_.on(s,r=>{this.player_.trigger(_e({},r))})})}}const Sn={name:"videojs-http-streaming",VERSION:Jf,canHandleSource(i,e={}){const t=ie(P.options,e);return!t.vhs.experimentalUseMMS&&!qs("avc1.4d400d,mp4a.40.2",!1)?!1:Sn.canPlayType(i.type,t)},handleSource(i,e,t={}){const s=ie(P.options,t);return e.vhs=new ap(i,e,s),e.vhs.xhr=Ef(),e.vhs.setupXhrHooks_(),e.vhs.src(i.src,i.type),e.vhs},canPlayType(i,e){const t=Jc(i);if(!t)return"";const s=Sn.getOverrideNative(e);return!ge.supportsTypeNatively(t)||s?"maybe":""},getOverrideNative(i={}){const{vhs:e={}}=i,t=!(P.browser.IS_ANY_SAFARI||P.browser.IS_IOS),{overrideNative:s=t}=e;return s}},Fb=()=>qs("avc1.4d400d,mp4a.40.2",!0);Fb()&&P.getTech("Html5").registerSourceHandler(Sn,0);P.VhsHandler=ap;P.VhsSourceHandler=Sn;P.Vhs=ge;P.use||P.registerComponent("Vhs",ge);P.options.vhs=P.options.vhs||{};(!P.getPlugin||!P.getPlugin("reloadSourceOnError"))&&P.registerPlugin("reloadSourceOnError",Ab);var Ub=Object.defineProperty,hs=(i,e,t,s)=>{for(var r=void 0,n=i.length-1,a;n>=0;n--)(a=i[n])&&(r=a(e,t,r)||r);return r&&Ub(e,t,r),r};const Vb="0.5, 1, 1.5, 2";function Hb(i){const e=i.getChild("ControlBar"),t=e.getChild("CurrentTimeDisplay"),s=e.getChild("ProgressControl"),r=e.getChild("DurationDisplay"),n=e.getChild("TimeDivider");e.removeChild(s),e.removeChild(t),e.removeChild(n),e.removeChild(r),e.addChild(t,{},0),e.addChild(s,{},1),e.addChild(r,{},2)}class xi extends k0.Localized(Ce.VividElement){constructor(){super(...arguments),this.autoplay=!1,this.loop=!1,this.playbackRates=Vb,this.skipBy=w0.MediaSkipBy.Ten}srcChanged(){this.#t()}autoplayChanged(){this._player&&this.#t()}skipByChanged(){this._player&&this.#t()}#e;connectedCallback(){super.connectedCallback(),this.#t()}disconnectedCallback(){super.connectedCallback(),this.#s()}#a(){const e=this.querySelectorAll("source");if(!(e.length===0&&!this.src))return this.src?[{src:this.src}]:Array.from(e).map(t=>({src:t.getAttribute("src"),type:t.getAttribute("type")}))}#o(){const e=this.#a(),t=parseInt(this.skipBy);return{languages:{current:this.locale.videoPlayer},sources:e,poster:this.poster,muted:this.autoplay,playbackRates:D0.getPlaybackRatesArray(this.playbackRates),controlBar:{skipButtons:{forward:t,backward:t},remainingTimeDisplay:{displayNegative:!1},volumePanel:{inline:!1}},textTrackSettings:!1,experimentalSvgIcons:!0,language:"current",fluid:!0,controls:!0,preload:"auto"}}get#i(){return this.shadowRoot.getElementById("no-sources")}#s(){this._player&&this._player.dispose()}#l(){this.#e=document.createElement("video");const e=this.querySelectorAll("track");for(let t=0;t<e.length;t++)this.#e.appendChild(e[t]);this.#e.setAttribute("crossorigin","anonymous"),this.#e.toggleAttribute("playsinline",!0),this.loop&&this.#e.setAttribute("loop",""),this.autoplay&&this.#e.setAttribute("autoplay",""),this.#r.appendChild(this.#e)}get#r(){return this.shadowRoot.querySelector(".control")}#n(e=!0){this.#i?.classList.toggle("vjs-hidden",e)}#u(e){this._player=P(this.#e,e),this.shadowRoot.querySelector("[lang]").removeAttribute("lang")}#c(){this._player.on("play",()=>this.$emit("play")),this._player.on("pause",()=>this.$emit("pause")),this._player.on("ended",()=>this.$emit("ended"))}#t(){this.#s();const e=this.#o();e.sources&&this.#r&&this.#i?(this.#n(),this.#l(),this.#u(e),Hb(this._player),this.#c()):this.#n(!1)}}hs([Ce.attr],xi.prototype,"poster");hs([Ce.attr],xi.prototype,"src");hs([Ce.attr({mode:"boolean"})],xi.prototype,"autoplay");hs([Ce.attr({mode:"boolean"})],xi.prototype,"loop");hs([Ce.attr({attribute:"playback-rates",mode:"fromView"})],xi.prototype,"playbackRates");hs([Ce.attr({attribute:"skip-by",mode:"fromView"})],xi.prototype,"skipBy");function qb(){return Ce.html`
220
220
  <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
221
221
  <defs>
222
222
  <symbol viewBox="0 0 24 24" id="vjs-icon-play">
@@ -523,9 +523,9 @@ ${Pi(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),
523
523
  </symbol>
524
524
  </defs>
525
525
  </svg>
526
- `}const Qb=i=>L0.classNames("control"),Jb=ft.html`
526
+ `}const zb=i=>j0.classNames("control"),$b=Ce.html`
527
527
  <div
528
- class="${Qb} video-js vjs-16-9 vjs-working-hover vjs-theme-vivid"
528
+ class="${zb} video-js vjs-16-9 vjs-working-hover vjs-theme-vivid"
529
529
  >
530
530
  <div id="no-sources" class="vjs-error-display vjs-modal-dialog vjs-hidden">
531
531
  <div class="vjs-modal-dialog-content">
@@ -533,6 +533,6 @@ ${Pi(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),
533
533
  </div>
534
534
  </div>
535
535
  <slot></slot>
536
- ${Kb()}
536
+ ${qb()}
537
537
  </div>
538
- `,Zb=ft.defineVividComponent("video-player",xi,Jb,[],{styles:O0}),eT=ft.createRegisterFunction(Zb);eT();
538
+ `,Gb=Ce.defineVividComponent("video-player",xi,$b,[],{styles:I0}),Wb=Ce.createRegisterFunction(Gb);Wb();