@vonage/vivid 5.15.1 → 5.16.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 (715) hide show
  1. package/accordion/definition.cjs +7 -207
  2. package/accordion/definition.js +2 -199
  3. package/accordion/index.cjs +4 -4
  4. package/accordion/index.js +93 -127
  5. package/accordion-item/definition.cjs +6 -146
  6. package/accordion-item/definition.js +2 -139
  7. package/accordion-item/index.cjs +1 -1
  8. package/accordion-item/index.js +6 -2
  9. package/action-group/definition.cjs +5 -69
  10. package/action-group/definition.js +1 -62
  11. package/action-group/index.cjs +4 -4
  12. package/action-group/index.js +16 -46
  13. package/alert/definition.cjs +6 -201
  14. package/alert/definition.js +2 -194
  15. package/alert/index.cjs +15 -15
  16. package/alert/index.js +90 -136
  17. package/audio-player/definition.cjs +6 -459
  18. package/audio-player/definition.js +2 -452
  19. package/audio-player/index.cjs +49 -49
  20. package/audio-player/index.js +234 -302
  21. package/avatar/definition.cjs +6 -117
  22. package/avatar/definition.js +2 -110
  23. package/avatar/index.cjs +14 -14
  24. package/avatar/index.js +44 -84
  25. package/badge/definition.cjs +6 -85
  26. package/badge/definition.js +2 -78
  27. package/badge/index.cjs +4 -4
  28. package/badge/index.js +21 -65
  29. package/banner/definition.cjs +6 -160
  30. package/banner/definition.js +2 -153
  31. package/banner/index.cjs +13 -13
  32. package/banner/index.js +76 -109
  33. package/breadcrumb/definition.cjs +5 -97
  34. package/breadcrumb/definition.js +1 -90
  35. package/breadcrumb/index.cjs +4 -4
  36. package/breadcrumb/index.js +33 -59
  37. package/breadcrumb-item/definition.cjs +7 -47
  38. package/breadcrumb-item/definition.js +3 -40
  39. package/breadcrumb-item/index.cjs +5 -5
  40. package/breadcrumb-item/index.js +20 -32
  41. package/bundled/affix.cjs +10 -10
  42. package/bundled/affix.js +44 -57
  43. package/bundled/anchored.cjs +3 -3
  44. package/bundled/anchored.js +47 -65
  45. package/bundled/aria.cjs +1 -1
  46. package/bundled/aria.js +6 -6
  47. package/bundled/attribute-binding-behaviour.cjs +1 -1
  48. package/bundled/attribute-binding-behaviour.js +17 -28
  49. package/bundled/base-color-picker.cjs +10 -10
  50. package/bundled/base-color-picker.js +115 -197
  51. package/bundled/base-progress.cjs +1 -1
  52. package/bundled/base-progress.js +29 -56
  53. package/bundled/breadcrumb-item.cjs +1 -1
  54. package/bundled/breadcrumb-item.js +11 -20
  55. package/bundled/button.cjs +1 -1
  56. package/bundled/button.js +65 -100
  57. package/bundled/calendar-event.cjs +1 -1
  58. package/bundled/calendar-event.js +11 -34
  59. package/bundled/calendar-picker.template.cjs +77 -77
  60. package/bundled/calendar-picker.template.js +2881 -3345
  61. package/bundled/char-count.cjs +7 -7
  62. package/bundled/char-count.js +31 -46
  63. package/bundled/children.cjs +1 -1
  64. package/bundled/children.js +27 -45
  65. package/bundled/class-names.cjs +1 -1
  66. package/bundled/class-names.js +8 -8
  67. package/bundled/data-grid.options.cjs +1 -1
  68. package/bundled/data-grid.options.js +22 -26
  69. package/bundled/decorate.cjs +1 -0
  70. package/bundled/decorate.js +9 -0
  71. package/bundled/definition.cjs +1 -39
  72. package/bundled/definition.js +5 -122
  73. package/bundled/definition10.cjs +27 -69
  74. package/bundled/definition10.js +173 -352
  75. package/bundled/definition11.cjs +19 -12
  76. package/bundled/definition11.js +77 -92
  77. package/bundled/definition12.cjs +11 -11
  78. package/bundled/definition12.js +122 -216
  79. package/bundled/definition13.cjs +18 -9
  80. package/bundled/definition13.js +76 -42
  81. package/bundled/definition14.cjs +10 -1
  82. package/bundled/definition14.js +28 -19
  83. package/bundled/definition15.cjs +73 -5
  84. package/bundled/definition15.js +194 -28
  85. package/bundled/definition16.cjs +5 -30
  86. package/bundled/definition16.js +16 -79
  87. package/bundled/definition17.cjs +13 -19
  88. package/bundled/definition17.js +81 -102
  89. package/bundled/definition18.cjs +12 -13
  90. package/bundled/definition18.js +67 -135
  91. package/bundled/definition19.cjs +48 -48
  92. package/bundled/definition19.js +365 -683
  93. package/bundled/definition2.cjs +8 -8
  94. package/bundled/definition2.js +79 -122
  95. package/bundled/definition20.cjs +5 -20
  96. package/bundled/definition20.js +11 -106
  97. package/bundled/definition21.cjs +20 -5
  98. package/bundled/definition21.js +57 -18
  99. package/bundled/definition22.cjs +16 -16
  100. package/bundled/definition22.js +79 -140
  101. package/bundled/definition3.cjs +1 -29
  102. package/bundled/definition3.js +183 -194
  103. package/bundled/definition4.cjs +39 -6
  104. package/bundled/definition4.js +71 -41
  105. package/bundled/definition5.cjs +30 -1
  106. package/bundled/definition5.js +48 -346
  107. package/bundled/definition6.cjs +28 -30
  108. package/bundled/definition6.js +110 -264
  109. package/bundled/definition7.cjs +6 -30
  110. package/bundled/definition7.js +22 -288
  111. package/bundled/definition8.cjs +13 -18
  112. package/bundled/definition8.js +150 -132
  113. package/bundled/definition9.cjs +29 -13
  114. package/bundled/definition9.js +157 -232
  115. package/bundled/delegates-aria.cjs +1 -1
  116. package/bundled/delegates-aria.js +56 -88
  117. package/bundled/dialog.cjs +1 -0
  118. package/bundled/dialog.js +6 -0
  119. package/bundled/divider.cjs +1 -1
  120. package/bundled/divider.js +16 -33
  121. package/bundled/dom.cjs +1 -1
  122. package/bundled/dom.js +5 -5
  123. package/bundled/enums.cjs +1 -1
  124. package/bundled/enums.js +16 -9
  125. package/bundled/floating-ui.dom.cjs +1 -1
  126. package/bundled/floating-ui.dom.js +953 -1238
  127. package/bundled/form-associated.cjs +1 -1
  128. package/bundled/form-associated.js +165 -318
  129. package/bundled/form-element.cjs +1 -1
  130. package/bundled/form-element.js +33 -55
  131. package/bundled/host-semantics.cjs +1 -1
  132. package/bundled/host-semantics.js +46 -69
  133. package/bundled/key-codes.cjs +1 -1
  134. package/bundled/key-codes.js +4 -16
  135. package/bundled/linkable.cjs +6 -6
  136. package/bundled/linkable.js +25 -45
  137. package/bundled/listbox.cjs +1 -1
  138. package/bundled/listbox.js +176 -351
  139. package/bundled/localized.cjs +1 -1
  140. package/bundled/localized.js +451 -564
  141. package/bundled/mixins.cjs +20 -20
  142. package/bundled/mixins.js +162 -210
  143. package/bundled/normalize.cjs +1 -1
  144. package/bundled/normalize.js +6 -6
  145. package/bundled/numbers.cjs +1 -1
  146. package/bundled/numbers.js +9 -11
  147. package/bundled/picker-field.template.cjs +23 -23
  148. package/bundled/picker-field.template.js +108 -171
  149. package/bundled/playbackRates.cjs +1 -1
  150. package/bundled/playbackRates.js +10 -10
  151. package/bundled/ref.cjs +1 -1
  152. package/bundled/ref.js +10 -14
  153. package/bundled/repeat.cjs +1 -1
  154. package/bundled/repeat.js +421 -552
  155. package/bundled/scrollIntoView.cjs +1 -1
  156. package/bundled/scrollIntoView.js +26 -29
  157. package/bundled/single-date-picker.cjs +1 -1
  158. package/bundled/single-date-picker.js +23 -38
  159. package/bundled/single-value-picker.cjs +1 -1
  160. package/bundled/single-value-picker.js +58 -86
  161. package/bundled/slider.template.cjs +13 -13
  162. package/bundled/slider.template.js +67 -78
  163. package/bundled/slottable-request.cjs +4 -4
  164. package/bundled/slottable-request.js +1937 -2904
  165. package/bundled/slotted.cjs +1 -1
  166. package/bundled/slotted.js +47 -97
  167. package/bundled/strings.cjs +1 -1
  168. package/bundled/strings.js +6 -6
  169. package/bundled/text-field.cjs +1 -1
  170. package/bundled/text-field.js +4 -4
  171. package/bundled/time-selection-picker.template.cjs +26 -26
  172. package/bundled/time-selection-picker.template.js +355 -552
  173. package/bundled/trapped-focus.cjs +1 -1
  174. package/bundled/trapped-focus.js +18 -25
  175. package/bundled/vivid-element.cjs +4 -5
  176. package/bundled/vivid-element.js +1781 -2806
  177. package/bundled/when.cjs +1 -1
  178. package/bundled/when.js +10 -10
  179. package/bundled/with-contextual-help.cjs +1 -1
  180. package/bundled/with-contextual-help.js +15 -31
  181. package/bundled/with-error-text.cjs +1 -1
  182. package/bundled/with-error-text.js +25 -38
  183. package/bundled/with-success-text.cjs +1 -1
  184. package/bundled/with-success-text.js +8 -15
  185. package/button/definition.cjs +6 -14
  186. package/button/definition.js +3 -4
  187. package/button/index.cjs +1 -1
  188. package/button/index.js +6 -2
  189. package/calendar/definition.cjs +5 -358
  190. package/calendar/definition.js +1 -351
  191. package/calendar/index.cjs +20 -20
  192. package/calendar/index.js +346 -401
  193. package/calendar-event/definition.cjs +6 -58
  194. package/calendar-event/definition.js +2 -51
  195. package/calendar-event/index.cjs +7 -7
  196. package/calendar-event/index.js +25 -41
  197. package/card/definition.cjs +6 -194
  198. package/card/definition.js +2 -187
  199. package/card/index.cjs +34 -34
  200. package/card/index.js +80 -133
  201. package/checkbox/definition.cjs +6 -209
  202. package/checkbox/definition.js +2 -202
  203. package/checkbox/index.cjs +1 -1
  204. package/checkbox/index.js +6 -2
  205. package/color-picker/definition.cjs +6 -1175
  206. package/color-picker/definition.js +2 -1168
  207. package/color-picker/index.cjs +94 -94
  208. package/color-picker/index.js +605 -737
  209. package/combobox/definition.cjs +6 -647
  210. package/combobox/definition.js +2 -640
  211. package/combobox/index.cjs +37 -37
  212. package/combobox/index.js +254 -458
  213. package/contextual-help/definition.cjs +6 -63
  214. package/contextual-help/definition.js +2 -56
  215. package/contextual-help/index.cjs +1 -1
  216. package/contextual-help/index.js +6 -2
  217. package/country/definition.cjs +6 -340
  218. package/country/definition.js +2 -333
  219. package/country/index.cjs +6 -6
  220. package/country/index.js +1209 -308
  221. package/custom-elements.json +513 -851
  222. package/data-grid/definition.cjs +10 -2350
  223. package/data-grid/definition.js +2 -2339
  224. package/data-grid/index.cjs +61 -61
  225. package/data-grid/index.js +642 -992
  226. package/date-picker/definition.cjs +6 -152
  227. package/date-picker/definition.js +2 -145
  228. package/date-picker/index.cjs +1 -1
  229. package/date-picker/index.js +66 -114
  230. package/date-range-picker/definition.cjs +6 -467
  231. package/date-range-picker/definition.js +2 -460
  232. package/date-range-picker/index.cjs +1 -1
  233. package/date-range-picker/index.js +218 -334
  234. package/date-time-picker/definition.cjs +6 -285
  235. package/date-time-picker/definition.js +2 -278
  236. package/date-time-picker/index.cjs +4 -4
  237. package/date-time-picker/index.js +116 -211
  238. package/dial-pad/definition.cjs +6 -460
  239. package/dial-pad/definition.js +2 -453
  240. package/dial-pad/index.cjs +42 -42
  241. package/dial-pad/index.js +195 -287
  242. package/dialog/definition.cjs +6 -349
  243. package/dialog/definition.js +2 -342
  244. package/dialog/index.cjs +28 -28
  245. package/dialog/index.js +148 -229
  246. package/divider/definition.cjs +6 -42
  247. package/divider/definition.js +2 -35
  248. package/divider/index.cjs +1 -1
  249. package/divider/index.js +5 -2
  250. package/elevation/definition.cjs +4 -11
  251. package/elevation/definition.js +2 -2
  252. package/elevation/index.cjs +1 -1
  253. package/elevation/index.js +5 -2
  254. package/empty-state/definition.cjs +6 -86
  255. package/empty-state/definition.js +2 -79
  256. package/empty-state/index.cjs +9 -9
  257. package/empty-state/index.js +28 -60
  258. package/fab/definition.cjs +6 -105
  259. package/fab/definition.js +2 -98
  260. package/fab/index.cjs +17 -17
  261. package/fab/index.js +46 -81
  262. package/file-picker/definition.cjs +6 -523
  263. package/file-picker/definition.js +2 -516
  264. package/file-picker/index.cjs +25 -25
  265. package/file-picker/index.js +246 -351
  266. package/header/definition.cjs +5 -78
  267. package/header/definition.js +1 -71
  268. package/header/index.cjs +5 -5
  269. package/header/index.js +28 -42
  270. package/icon/definition.cjs +5 -202
  271. package/icon/definition.js +1 -195
  272. package/icon/index.cjs +1 -1
  273. package/icon/index.js +5 -2
  274. package/index.cjs +350 -356
  275. package/index.js +79 -78
  276. package/layout/definition.cjs +5 -72
  277. package/layout/definition.js +1 -65
  278. package/layout/index.cjs +2 -2
  279. package/layout/index.js +10 -51
  280. package/lib/alert/alert.d.ts +0 -1
  281. package/lib/audio-player/audio-player.d.ts +0 -1
  282. package/lib/banner/banner.d.ts +0 -2
  283. package/lib/button/button.d.ts +0 -1
  284. package/lib/calendar/calendar.d.ts +0 -1
  285. package/lib/data-grid/data-grid-cell.d.ts +0 -3
  286. package/lib/data-grid/data-grid-row.d.ts +0 -3
  287. package/lib/data-grid/data-grid.d.ts +0 -1
  288. package/lib/fab/fab.d.ts +0 -1
  289. package/lib/file-picker/file-picker.d.ts +1 -1
  290. package/lib/icon/icon.d.ts +0 -1
  291. package/lib/option/option.d.ts +4 -0
  292. package/lib/pagination/pagination.d.ts +0 -4
  293. package/lib/popover/popover.d.ts +0 -5
  294. package/lib/split-button/split-button.d.ts +0 -2
  295. package/lib/tab/tab.d.ts +0 -2
  296. package/lib/tag/tag.d.ts +0 -2
  297. package/lib/toggletip/toggletip.d.ts +0 -1
  298. package/lib/tree-item/tree-item.d.ts +0 -2
  299. package/lib/tree-view/tree-view.d.ts +0 -1
  300. package/locales/de-DE.cjs +439 -549
  301. package/locales/de-DE.js +440 -547
  302. package/locales/en-GB.cjs +271 -382
  303. package/locales/en-GB.js +272 -380
  304. package/locales/en-US.cjs +2 -552
  305. package/locales/en-US.js +1 -549
  306. package/locales/ja-JP.cjs +432 -548
  307. package/locales/ja-JP.js +433 -546
  308. package/locales/zh-CN.cjs +433 -550
  309. package/locales/zh-CN.js +434 -548
  310. package/menu/definition.cjs +6 -393
  311. package/menu/definition.js +2 -386
  312. package/menu/index.cjs +1 -1
  313. package/menu/index.js +6 -2
  314. package/menu-item/definition.cjs +7 -14
  315. package/menu-item/definition.js +3 -3
  316. package/menu-item/index.cjs +1 -1
  317. package/menu-item/index.js +6 -2
  318. package/nav/definition.cjs +5 -27
  319. package/nav/definition.js +1 -20
  320. package/nav/index.cjs +3 -3
  321. package/nav/index.js +7 -10
  322. package/nav-disclosure/definition.cjs +6 -122
  323. package/nav-disclosure/definition.js +2 -115
  324. package/nav-disclosure/index.cjs +8 -8
  325. package/nav-disclosure/index.js +49 -86
  326. package/nav-item/definition.cjs +6 -79
  327. package/nav-item/definition.js +2 -72
  328. package/nav-item/index.cjs +2 -2
  329. package/nav-item/index.js +33 -58
  330. package/note/definition.cjs +6 -61
  331. package/note/definition.js +2 -54
  332. package/note/index.cjs +5 -5
  333. package/note/index.js +24 -38
  334. package/number-field/definition.cjs +6 -440
  335. package/number-field/definition.js +2 -433
  336. package/number-field/index.cjs +31 -31
  337. package/number-field/index.js +160 -328
  338. package/option/definition.cjs +6 -13
  339. package/option/definition.js +3 -3
  340. package/option/index.cjs +1 -1
  341. package/option/index.js +6 -2
  342. package/package.json +15 -16
  343. package/pagination/definition.cjs +6 -254
  344. package/pagination/definition.js +2 -247
  345. package/pagination/index.cjs +37 -37
  346. package/pagination/index.js +148 -186
  347. package/popover/definition.cjs +6 -356
  348. package/popover/definition.js +2 -349
  349. package/popover/index.cjs +16 -16
  350. package/popover/index.js +161 -239
  351. package/popup/definition.cjs +5 -13
  352. package/popup/definition.js +3 -4
  353. package/popup/index.cjs +1 -1
  354. package/popup/index.js +6 -2
  355. package/progress/definition.cjs +5 -87
  356. package/progress/definition.js +1 -80
  357. package/progress/index.cjs +9 -9
  358. package/progress/index.js +33 -55
  359. package/progress-ring/definition.cjs +5 -95
  360. package/progress-ring/definition.js +1 -88
  361. package/progress-ring/index.cjs +1 -1
  362. package/progress-ring/index.js +5 -2
  363. package/radio/definition.cjs +5 -227
  364. package/radio/definition.js +1 -220
  365. package/radio/index.cjs +1 -1
  366. package/radio/index.js +5 -2
  367. package/radio-group/definition.cjs +6 -361
  368. package/radio-group/definition.js +2 -354
  369. package/radio-group/index.cjs +10 -10
  370. package/radio-group/index.js +160 -242
  371. package/range-slider/definition.cjs +6 -632
  372. package/range-slider/definition.js +2 -625
  373. package/range-slider/index.cjs +41 -41
  374. package/range-slider/index.js +259 -429
  375. package/rich-text-editor/definition.cjs +32 -15694
  376. package/rich-text-editor/definition.js +2 -15661
  377. package/rich-text-editor/index.cjs +17 -17
  378. package/rich-text-editor/index.js +9061 -11464
  379. package/rich-text-view/definition.cjs +5 -171
  380. package/rich-text-view/definition.js +1 -164
  381. package/rich-text-view/index.cjs +1 -1
  382. package/rich-text-view/index.js +68 -102
  383. package/searchable-select/definition.cjs +5 -1401
  384. package/searchable-select/definition.js +2 -1395
  385. package/searchable-select/index.cjs +94 -94
  386. package/searchable-select/index.js +600 -1015
  387. package/select/definition.cjs +6 -1002
  388. package/select/definition.js +2 -995
  389. package/select/index.cjs +1 -1
  390. package/select/index.js +6 -2
  391. package/selectable-box/definition.cjs +6 -174
  392. package/selectable-box/definition.js +2 -167
  393. package/selectable-box/index.cjs +18 -18
  394. package/selectable-box/index.js +66 -127
  395. package/side-drawer/definition.cjs +5 -130
  396. package/side-drawer/definition.js +1 -123
  397. package/side-drawer/index.cjs +7 -7
  398. package/side-drawer/index.js +47 -89
  399. package/simple-color-picker/definition.cjs +6 -225
  400. package/simple-color-picker/definition.js +2 -218
  401. package/simple-color-picker/index.cjs +15 -15
  402. package/simple-color-picker/index.js +98 -135
  403. package/slider/definition.cjs +6 -499
  404. package/slider/definition.js +2 -492
  405. package/slider/index.cjs +1 -1
  406. package/slider/index.js +6 -2
  407. package/split-button/definition.cjs +6 -176
  408. package/split-button/definition.js +2 -169
  409. package/split-button/index.cjs +15 -15
  410. package/split-button/index.js +74 -135
  411. package/status/definition.cjs +6 -82
  412. package/status/definition.js +2 -75
  413. package/status/index.cjs +7 -7
  414. package/status/index.js +35 -52
  415. package/switch/definition.cjs +6 -148
  416. package/switch/definition.js +2 -141
  417. package/switch/index.cjs +8 -8
  418. package/switch/index.js +48 -92
  419. package/tab/definition.cjs +6 -127
  420. package/tab/definition.js +2 -120
  421. package/tab/index.cjs +1 -1
  422. package/tab/index.js +6 -2
  423. package/tab-panel/definition.cjs +5 -29
  424. package/tab-panel/definition.js +1 -22
  425. package/tab-panel/index.cjs +1 -1
  426. package/tab-panel/index.js +5 -2
  427. package/table/definition.cjs +15 -174
  428. package/table/definition.js +1 -157
  429. package/table/index.cjs +10 -10
  430. package/table/index.js +26 -82
  431. package/tabs/definition.cjs +7 -467
  432. package/tabs/definition.js +2 -459
  433. package/tabs/index.cjs +11 -11
  434. package/tabs/index.js +169 -296
  435. package/tag/definition.cjs +6 -176
  436. package/tag/definition.js +2 -169
  437. package/tag/index.cjs +26 -26
  438. package/tag/index.js +65 -126
  439. package/tag-group/definition.cjs +5 -40
  440. package/tag-group/definition.js +1 -33
  441. package/tag-group/index.cjs +4 -4
  442. package/tag-group/index.js +10 -21
  443. package/text-area/definition.cjs +6 -355
  444. package/text-area/definition.js +2 -348
  445. package/text-area/index.cjs +11 -11
  446. package/text-area/index.js +153 -260
  447. package/text-field/definition.cjs +6 -423
  448. package/text-field/definition.js +2 -416
  449. package/text-field/index.cjs +1 -1
  450. package/text-field/index.js +6 -2
  451. package/time-picker/definition.cjs +7 -43
  452. package/time-picker/definition.js +3 -36
  453. package/time-picker/index.cjs +1 -1
  454. package/time-picker/index.js +24 -29
  455. package/toggletip/definition.cjs +6 -159
  456. package/toggletip/definition.js +2 -152
  457. package/toggletip/index.cjs +1 -1
  458. package/toggletip/index.js +6 -2
  459. package/tooltip/definition.cjs +6 -139
  460. package/tooltip/definition.js +2 -132
  461. package/tooltip/index.cjs +1 -1
  462. package/tooltip/index.js +6 -2
  463. package/tree-item/definition.cjs +6 -13
  464. package/tree-item/definition.js +3 -3
  465. package/tree-item/index.cjs +1 -1
  466. package/tree-item/index.js +6 -2
  467. package/tree-view/definition.cjs +6 -302
  468. package/tree-view/definition.js +2 -295
  469. package/tree-view/index.cjs +11 -11
  470. package/tree-view/index.js +145 -174
  471. package/unbundled/affix.cjs +89 -62
  472. package/unbundled/affix.js +58 -55
  473. package/unbundled/anchored.cjs +87 -94
  474. package/unbundled/anchored.js +74 -90
  475. package/unbundled/attribute-binding-behaviour.cjs +37 -42
  476. package/unbundled/attribute-binding-behaviour.js +31 -40
  477. package/unbundled/base-color-picker.cjs +226 -275
  478. package/unbundled/base-color-picker.js +214 -272
  479. package/unbundled/base-progress.cjs +63 -78
  480. package/unbundled/base-progress.js +57 -76
  481. package/unbundled/breadcrumb-item.cjs +24 -28
  482. package/unbundled/breadcrumb-item.js +18 -26
  483. package/unbundled/button.cjs +115 -166
  484. package/unbundled/button.js +109 -164
  485. package/unbundled/calendar-event.cjs +28 -41
  486. package/unbundled/calendar-event.js +22 -39
  487. package/unbundled/calendar-picker.template.cjs +620 -783
  488. package/unbundled/calendar-picker.template.js +560 -772
  489. package/unbundled/char-count.cjs +50 -80
  490. package/unbundled/char-count.js +44 -78
  491. package/unbundled/chunk.cjs +50 -0
  492. package/unbundled/chunk.js +33 -0
  493. package/unbundled/data-grid.options.cjs +80 -29
  494. package/unbundled/data-grid.options.js +51 -23
  495. package/unbundled/decorate.cjs +14 -0
  496. package/unbundled/decorate.js +9 -0
  497. package/unbundled/definition.cjs +42 -405
  498. package/unbundled/definition.js +24 -399
  499. package/unbundled/definition10.cjs +253 -0
  500. package/unbundled/definition10.js +229 -0
  501. package/unbundled/definition11.cjs +397 -0
  502. package/unbundled/definition11.js +379 -0
  503. package/unbundled/definition12.cjs +317 -0
  504. package/unbundled/definition12.js +287 -0
  505. package/unbundled/definition13.cjs +328 -0
  506. package/unbundled/definition13.js +310 -0
  507. package/unbundled/definition14.cjs +406 -0
  508. package/unbundled/definition14.js +388 -0
  509. package/unbundled/definition15.cjs +107 -0
  510. package/unbundled/definition15.js +89 -0
  511. package/unbundled/definition16.cjs +63 -0
  512. package/unbundled/definition16.js +45 -0
  513. package/unbundled/definition17.cjs +151 -0
  514. package/unbundled/definition17.js +133 -0
  515. package/unbundled/definition18.cjs +47 -0
  516. package/unbundled/definition18.js +35 -0
  517. package/unbundled/definition19.cjs +98 -0
  518. package/unbundled/definition19.js +80 -0
  519. package/unbundled/definition2.cjs +180 -220
  520. package/unbundled/definition2.js +162 -215
  521. package/unbundled/definition20.cjs +56 -0
  522. package/unbundled/definition20.js +43 -0
  523. package/unbundled/definition21.cjs +305 -0
  524. package/unbundled/definition21.js +286 -0
  525. package/unbundled/definition22.cjs +174 -0
  526. package/unbundled/definition22.js +156 -0
  527. package/unbundled/definition23.cjs +161 -0
  528. package/unbundled/definition23.js +143 -0
  529. package/unbundled/definition24.cjs +1038 -0
  530. package/unbundled/definition24.js +1020 -0
  531. package/unbundled/definition25.cjs +360 -0
  532. package/unbundled/definition25.js +342 -0
  533. package/unbundled/definition26.cjs +137 -0
  534. package/unbundled/definition26.js +119 -0
  535. package/unbundled/definition27.cjs +235 -0
  536. package/unbundled/definition27.js +211 -0
  537. package/unbundled/definition28.cjs +546 -0
  538. package/unbundled/definition28.js +528 -0
  539. package/unbundled/definition29.cjs +157 -0
  540. package/unbundled/definition29.js +139 -0
  541. package/unbundled/definition3.cjs +131 -284
  542. package/unbundled/definition3.js +113 -279
  543. package/unbundled/definition30.cjs +75 -0
  544. package/unbundled/definition30.js +57 -0
  545. package/unbundled/definition31.cjs +1265 -0
  546. package/unbundled/definition31.js +1247 -0
  547. package/unbundled/definition32.cjs +1908 -0
  548. package/unbundled/definition32.js +1866 -0
  549. package/unbundled/definition33.cjs +261 -0
  550. package/unbundled/definition33.js +183 -0
  551. package/unbundled/definition34.cjs +46 -0
  552. package/unbundled/definition34.js +33 -0
  553. package/unbundled/definition35.cjs +152 -0
  554. package/unbundled/definition35.js +134 -0
  555. package/unbundled/definition36.cjs +426 -0
  556. package/unbundled/definition36.js +408 -0
  557. package/unbundled/definition37.cjs +243 -0
  558. package/unbundled/definition37.js +225 -0
  559. package/unbundled/definition38.cjs +409 -0
  560. package/unbundled/definition38.js +391 -0
  561. package/unbundled/definition39.cjs +298 -0
  562. package/unbundled/definition39.js +280 -0
  563. package/unbundled/definition4.cjs +186 -205
  564. package/unbundled/definition4.js +162 -200
  565. package/unbundled/definition40.cjs +81 -0
  566. package/unbundled/definition40.js +63 -0
  567. package/unbundled/definition41.cjs +100 -0
  568. package/unbundled/definition41.js +82 -0
  569. package/unbundled/definition42.cjs +457 -0
  570. package/unbundled/definition42.js +439 -0
  571. package/unbundled/definition43.cjs +86 -0
  572. package/unbundled/definition43.js +68 -0
  573. package/unbundled/definition44.cjs +60 -0
  574. package/unbundled/definition44.js +41 -0
  575. package/unbundled/definition45.cjs +124 -0
  576. package/unbundled/definition45.js +106 -0
  577. package/unbundled/definition46.cjs +85 -0
  578. package/unbundled/definition46.js +67 -0
  579. package/unbundled/definition47.cjs +52 -0
  580. package/unbundled/definition47.js +31 -0
  581. package/unbundled/definition48.cjs +69 -0
  582. package/unbundled/definition48.js +51 -0
  583. package/unbundled/definition49.cjs +377 -0
  584. package/unbundled/definition49.js +359 -0
  585. package/unbundled/definition5.cjs +69 -298
  586. package/unbundled/definition5.js +44 -293
  587. package/unbundled/definition50.cjs +246 -0
  588. package/unbundled/definition50.js +228 -0
  589. package/unbundled/definition51.cjs +337 -0
  590. package/unbundled/definition51.js +319 -0
  591. package/unbundled/definition52.cjs +86 -0
  592. package/unbundled/definition52.js +67 -0
  593. package/unbundled/definition53.cjs +193 -0
  594. package/unbundled/definition53.js +174 -0
  595. package/unbundled/definition54.cjs +297 -0
  596. package/unbundled/definition54.js +279 -0
  597. package/unbundled/definition55.cjs +510 -0
  598. package/unbundled/definition55.js +492 -0
  599. package/unbundled/definition56.cjs +12728 -0
  600. package/unbundled/definition56.js +12553 -0
  601. package/unbundled/definition57.cjs +837 -0
  602. package/unbundled/definition57.js +819 -0
  603. package/unbundled/definition58.cjs +146 -0
  604. package/unbundled/definition58.js +128 -0
  605. package/unbundled/definition59.cjs +1080 -0
  606. package/unbundled/definition59.js +1062 -0
  607. package/unbundled/definition6.cjs +88 -56
  608. package/unbundled/definition6.js +69 -52
  609. package/unbundled/definition60.cjs +149 -0
  610. package/unbundled/definition60.js +131 -0
  611. package/unbundled/definition61.cjs +116 -0
  612. package/unbundled/definition61.js +97 -0
  613. package/unbundled/definition62.cjs +213 -0
  614. package/unbundled/definition62.js +195 -0
  615. package/unbundled/definition63.cjs +159 -0
  616. package/unbundled/definition63.js +141 -0
  617. package/unbundled/definition64.cjs +86 -0
  618. package/unbundled/definition64.js +68 -0
  619. package/unbundled/definition65.cjs +126 -0
  620. package/unbundled/definition65.js +107 -0
  621. package/unbundled/definition66.cjs +49 -0
  622. package/unbundled/definition66.js +28 -0
  623. package/unbundled/definition67.cjs +119 -0
  624. package/unbundled/definition67.js +101 -0
  625. package/unbundled/definition68.cjs +374 -0
  626. package/unbundled/definition68.js +349 -0
  627. package/unbundled/definition69.cjs +57 -0
  628. package/unbundled/definition69.js +38 -0
  629. package/unbundled/definition7.cjs +190 -0
  630. package/unbundled/definition7.js +166 -0
  631. package/unbundled/definition70.cjs +155 -0
  632. package/unbundled/definition70.js +137 -0
  633. package/unbundled/definition71.cjs +302 -0
  634. package/unbundled/definition71.js +284 -0
  635. package/unbundled/definition72.cjs +49 -0
  636. package/unbundled/definition72.js +38 -0
  637. package/unbundled/definition73.cjs +171 -0
  638. package/unbundled/definition73.js +147 -0
  639. package/unbundled/definition74.cjs +232 -0
  640. package/unbundled/definition74.js +213 -0
  641. package/unbundled/definition75.cjs +52241 -0
  642. package/unbundled/definition75.js +52223 -0
  643. package/unbundled/definition8.cjs +63 -0
  644. package/unbundled/definition8.js +44 -0
  645. package/unbundled/definition9.cjs +183 -0
  646. package/unbundled/definition9.js +165 -0
  647. package/unbundled/delegates-aria.cjs +90 -131
  648. package/unbundled/delegates-aria.js +77 -127
  649. package/unbundled/dialog.cjs +15 -0
  650. package/unbundled/dialog.js +10 -0
  651. package/unbundled/divider.cjs +42 -50
  652. package/unbundled/divider.js +30 -47
  653. package/unbundled/en-US.cjs +447 -0
  654. package/unbundled/en-US.js +443 -0
  655. package/unbundled/enums.cjs +166 -107
  656. package/unbundled/enums.js +95 -94
  657. package/unbundled/form-associated.cjs +408 -463
  658. package/unbundled/form-associated.js +396 -460
  659. package/unbundled/form-element.cjs +74 -83
  660. package/unbundled/form-element.js +68 -81
  661. package/unbundled/host-semantics.cjs +70 -89
  662. package/unbundled/host-semantics.js +57 -85
  663. package/unbundled/key-codes.cjs +16 -10
  664. package/unbundled/key-codes.js +5 -7
  665. package/unbundled/linkable.cjs +35 -56
  666. package/unbundled/linkable.js +27 -52
  667. package/unbundled/listbox.cjs +363 -465
  668. package/unbundled/listbox.js +357 -463
  669. package/unbundled/localized.cjs +79 -74
  670. package/unbundled/localized.js +61 -70
  671. package/unbundled/mixins.cjs +222 -223
  672. package/unbundled/mixins.js +186 -211
  673. package/unbundled/picker-field.template.cjs +188 -217
  674. package/unbundled/picker-field.template.js +165 -208
  675. package/unbundled/playbackRates.cjs +18 -11
  676. package/unbundled/playbackRates.js +13 -9
  677. package/unbundled/scrollIntoView.cjs +38 -43
  678. package/unbundled/scrollIntoView.js +33 -41
  679. package/unbundled/single-date-picker.cjs +48 -45
  680. package/unbundled/single-date-picker.js +43 -43
  681. package/unbundled/single-value-picker.cjs +106 -114
  682. package/unbundled/single-value-picker.js +101 -112
  683. package/unbundled/slider.template.cjs +107 -73
  684. package/unbundled/slider.template.js +67 -62
  685. package/unbundled/slottable-request.cjs +3114 -3503
  686. package/unbundled/slottable-request.js +2995 -3484
  687. package/unbundled/text-field.cjs +9 -5
  688. package/unbundled/text-field.js +4 -3
  689. package/unbundled/time-selection-picker.template.cjs +611 -755
  690. package/unbundled/time-selection-picker.template.js +554 -742
  691. package/unbundled/trapped-focus.cjs +45 -35
  692. package/unbundled/trapped-focus.js +34 -32
  693. package/unbundled/vivid-element.cjs +281 -274
  694. package/unbundled/vivid-element.js +239 -266
  695. package/unbundled/with-contextual-help.cjs +35 -39
  696. package/unbundled/with-contextual-help.js +29 -37
  697. package/unbundled/with-error-text.cjs +45 -55
  698. package/unbundled/with-error-text.js +39 -53
  699. package/unbundled/with-success-text.cjs +18 -22
  700. package/unbundled/with-success-text.js +12 -20
  701. package/video-player/definition.cjs +5 -69835
  702. package/video-player/definition.js +1 -69828
  703. package/video-player/index.cjs +44 -39
  704. package/video-player/index.js +23517 -35507
  705. package/visually-hidden/definition.cjs +5 -30
  706. package/visually-hidden/definition.js +1 -23
  707. package/visually-hidden/index.cjs +1 -1
  708. package/visually-hidden/index.js +5 -2
  709. package/vivid.api.json +150 -1631
  710. package/bundled/index.cjs +0 -1
  711. package/bundled/index.js +0 -6
  712. package/unbundled/_commonjsHelpers.cjs +0 -40
  713. package/unbundled/_commonjsHelpers.js +0 -36
  714. package/unbundled/index.cjs +0 -11
  715. package/unbundled/index.js +0 -9
@@ -1,20 +1,20 @@
1
- "use strict";const Ve=require("../bundled/vivid-element.cjs"),Gp=require("../bundled/enums.cjs"),Wp=require("../bundled/playbackRates.cjs"),Xp=require("../bundled/localized.cjs"),Yp=require("../bundled/class-names.cjs"),Kp='.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(--focus-stroke-color, 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(--focus-stroke-color, 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(--focus-stroke-color, 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(--focus-stroke-color, 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(--focus-stroke-color, 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 la,Hl;function En(){if(Hl)return la;Hl=1;var s;return typeof window<"u"?s=window:typeof Ve.commonjsGlobal<"u"?s=Ve.commonjsGlobal:typeof self<"u"?s=self:s={},la=s,la}var Qp=En();const w=Ve.getDefaultExportFromCjs(Qp),Jp={},Zp=Object.freeze(Object.defineProperty({__proto__:null,default:Jp},Symbol.toStringTag,{value:"Module"})),em=Ve.getAugmentedNamespace(Zp);var ua,zl;function yc(){if(zl)return ua;zl=1;var s=typeof Ve.commonjsGlobal<"u"?Ve.commonjsGlobal:typeof window<"u"?window:{},e=em,t;return typeof document<"u"?t=document:(t=s["__GLOBAL_DOCUMENT_CACHE@4"],t||(t=s["__GLOBAL_DOCUMENT_CACHE@4"]=e)),ua=t,ua}var tm=yc();const se=Ve.getDefaultExportFromCjs(tm);var Xr={exports:{}},ca={exports:{}},$l;function im(){return $l||($l=1,(function(s){function e(){return s.exports=e=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var r=arguments[i];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},s.exports.__esModule=!0,s.exports.default=s.exports,e.apply(null,arguments)}s.exports=e,s.exports.__esModule=!0,s.exports.default=s.exports})(ca)),ca.exports}var da,Gl;function sm(){if(Gl)return da;Gl=1,da=e;var s=Object.prototype.toString;function e(t){if(!t)return!1;var i=s.call(t);return i==="[object Function]"||typeof t=="function"&&i!=="[object RegExp]"||typeof window<"u"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}return da}var ha,Wl;function rm(){if(Wl)return ha;Wl=1;function s(r,n){var a=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(a)return(a=a.call(r)).next.bind(a);if(Array.isArray(r)||(a=e(r))||n){a&&(r=a);var l=0;return function(){return l>=r.length?{done:!0}:{done:!1,value:r[l++]}}}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 e(r,n){if(r){if(typeof r=="string")return t(r,n);var a=Object.prototype.toString.call(r).slice(8,-1);if(a==="Object"&&r.constructor&&(a=r.constructor.name),a==="Map"||a==="Set")return Array.from(r);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return t(r,n)}}function t(r,n){(n==null||n>r.length)&&(n=r.length);for(var a=0,l=new Array(n);a<n;a++)l[a]=r[a];return l}var i=(function(){function r(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var n=r.prototype;return n.getIsEnabled=function(){return this.enabled_},n.enable=function(){this.enabled_=!0},n.disable=function(){this.enabled_=!1},n.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},n.addInterceptor=function(l,c){this.typeToInterceptorsMap_.has(l)||this.typeToInterceptorsMap_.set(l,new Set);var f=this.typeToInterceptorsMap_.get(l);return f.has(c)?!1:(f.add(c),!0)},n.removeInterceptor=function(l,c){var f=this.typeToInterceptorsMap_.get(l);return f&&f.has(c)?(f.delete(c),!0):!1},n.clearInterceptorsByType=function(l){var c=this.typeToInterceptorsMap_.get(l);return c?(this.typeToInterceptorsMap_.delete(l),this.typeToInterceptorsMap_.set(l,new Set),!0):!1},n.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},n.getForType=function(l){return this.typeToInterceptorsMap_.get(l)||new Set},n.execute=function(l,c){for(var f=this.getForType(l),g=s(f),y;!(y=g()).done;){var k=y.value;try{c=k(c)}catch{}}return c},r})();return ha=i,ha}var fa,Xl;function nm(){if(Xl)return fa;Xl=1;var s=(function(){function t(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var i=t.prototype;return i.getIsEnabled=function(){return this.enabled_},i.enable=function(){this.enabled_=!0},i.disable=function(){this.enabled_=!1},i.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},i.getMaxAttempts=function(){return this.maxAttempts_},i.setMaxAttempts=function(n){this.maxAttempts_=n},i.getDelayFactor=function(){return this.delayFactor_},i.setDelayFactor=function(n){this.delayFactor_=n},i.getFuzzFactor=function(){return this.fuzzFactor_},i.setFuzzFactor=function(n){this.fuzzFactor_=n},i.getInitialDelay=function(){return this.initialDelay_},i.setInitialDelay=function(n){this.initialDelay_=n},i.createRetry=function(n){var a=n===void 0?{}:n,l=a.maxAttempts,c=a.delayFactor,f=a.fuzzFactor,g=a.initialDelay;return new e({maxAttempts:l||this.maxAttempts_,delayFactor:c||this.delayFactor_,fuzzFactor:f||this.fuzzFactor_,initialDelay:g||this.initialDelay_})},t})(),e=(function(){function t(r){this.maxAttempts_=r.maxAttempts,this.delayFactor_=r.delayFactor,this.fuzzFactor_=r.fuzzFactor,this.currentDelay_=r.initialDelay,this.currentAttempt_=1}var i=t.prototype;return i.moveToNextAttempt=function(){this.currentAttempt_++;var n=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+n},i.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},i.getCurrentDelay=function(){return this.currentDelay_},i.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},i.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},i.getCurrentFuzzedDelay=function(){var n=this.getCurrentMinPossibleDelay(),a=this.getCurrentMaxPossibleDelay();return n+Math.random()*(a-n)},t})();return fa=s,fa}var pa,Yl;function am(){if(Yl)return pa;Yl=1;var s=En(),e=function(r,n){return n===void 0&&(n=!1),function(a,l,c){if(a){r(a);return}if(l.statusCode>=400&&l.statusCode<=599){var f=c;if(n)if(s.TextDecoder){var g=t(l.headers&&l.headers["content-type"]);try{f=new TextDecoder(g).decode(c)}catch{}}else f=String.fromCharCode.apply(null,new Uint8Array(c));r({cause:f});return}r(null,c)}};function t(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(r,n){var a=n.split("="),l=a[0],c=a[1];return l.trim()==="charset"?c.trim():r},"utf-8")}return pa=e,pa}var Kl;function om(){if(Kl)return Xr.exports;Kl=1;var s=En(),e=im(),t=sm(),i=rm(),r=nm();f.httpHandler=am(),f.requestInterceptorsStorage=new i,f.responseInterceptorsStorage=new i,f.retryManager=new r;var n=function(L){var _={};return L&&L.trim().split(`
3
- `).forEach(function(I){var N=I.indexOf(":"),R=I.slice(0,N).trim().toLowerCase(),P=I.slice(N+1).trim();typeof _[R]>"u"?_[R]=P:Array.isArray(_[R])?_[R].push(P):_[R]=[_[R],P]}),_};Xr.exports=f,Xr.exports.default=f,f.XMLHttpRequest=s.XMLHttpRequest||k,f.XDomainRequest="withCredentials"in new f.XMLHttpRequest?f.XMLHttpRequest:s.XDomainRequest,a(["get","put","post","patch","head","delete"],function(E){f[E==="delete"?"del":E]=function(L,_,I){return _=c(L,_,I),_.method=E.toUpperCase(),g(_)}});function a(E,L){for(var _=0;_<E.length;_++)L(E[_])}function l(E){for(var L in E)if(E.hasOwnProperty(L))return!1;return!0}function c(E,L,_){var I=E;return t(L)?(_=L,typeof E=="string"&&(I={uri:E})):I=e({},L,{uri:E}),I.callback=_,I}function f(E,L,_){return L=c(E,L,_),g(L)}function g(E){if(typeof E.callback>"u")throw new Error("callback argument missing");if(E.requestType&&f.requestInterceptorsStorage.getIsEnabled()){var L={uri:E.uri||E.url,headers:E.headers||{},body:E.body,metadata:E.metadata||{},retry:E.retry,timeout:E.timeout},_=f.requestInterceptorsStorage.execute(E.requestType,L);E.uri=_.uri,E.headers=_.headers,E.body=_.body,E.metadata=_.metadata,E.retry=_.retry,E.timeout=_.timeout}var I=!1,N=function(Z,J,te){I||(I=!0,E.callback(Z,J,te))};function R(){V.readyState===4&&!f.responseInterceptorsStorage.getIsEnabled()&&setTimeout(U,0)}function P(){var Y=void 0;if(V.response?Y=V.response:Y=V.responseText||y(V),Q)try{Y=JSON.parse(Y)}catch{}return Y}function $(Y){if(clearTimeout(ie),clearTimeout(E.retryTimeout),Y instanceof Error||(Y=new Error(""+(Y||"Unknown XMLHttpRequest Error"))),Y.statusCode=0,!G&&f.retryManager.getIsEnabled()&&E.retry&&E.retry.shouldRetry()){E.retryTimeout=setTimeout(function(){E.retry.moveToNextAttempt(),E.xhr=V,g(E)},E.retry.getCurrentFuzzedDelay());return}if(E.requestType&&f.responseInterceptorsStorage.getIsEnabled()){var Z={headers:re.headers||{},body:re.body,responseUrl:V.responseURL,responseType:V.responseType},J=f.responseInterceptorsStorage.execute(E.requestType,Z);re.body=J.body,re.headers=J.headers}return N(Y,re)}function U(){if(!G){var Y;clearTimeout(ie),clearTimeout(E.retryTimeout),E.useXDR&&V.status===void 0?Y=200:Y=V.status===1223?204:V.status;var Z=re,J=null;if(Y!==0?(Z={body:P(),statusCode:Y,method:C,headers:{},url:b,rawRequest:V},V.getAllResponseHeaders&&(Z.headers=n(V.getAllResponseHeaders()))):J=new Error("Internal XMLHttpRequest Error"),E.requestType&&f.responseInterceptorsStorage.getIsEnabled()){var te={headers:Z.headers||{},body:Z.body,responseUrl:V.responseURL,responseType:V.responseType},ee=f.responseInterceptorsStorage.execute(E.requestType,te);Z.body=ee.body,Z.headers=ee.headers}return N(J,Z,Z.body)}}var V=E.xhr||null;V||(E.cors||E.useXDR?V=new f.XDomainRequest:V=new f.XMLHttpRequest);var O,G,b=V.url=E.uri||E.url,C=V.method=E.method||"GET",F=E.body||E.data,z=V.headers=E.headers||{},H=!!E.sync,Q=!1,ie,re={body:void 0,headers:{},statusCode:0,method:C,url:b,rawRequest:V};if("json"in E&&E.json!==!1&&(Q=!0,z.accept||z.Accept||(z.Accept="application/json"),C!=="GET"&&C!=="HEAD"&&(z["content-type"]||z["Content-Type"]||(z["Content-Type"]="application/json"),F=JSON.stringify(E.json===!0?F:E.json))),V.onreadystatechange=R,V.onload=U,V.onerror=$,V.onprogress=function(){},V.onabort=function(){G=!0,clearTimeout(E.retryTimeout)},V.ontimeout=$,V.open(C,b,!H,E.username,E.password),H||(V.withCredentials=!!E.withCredentials),!H&&E.timeout>0&&(ie=setTimeout(function(){if(!G){G=!0,V.abort("timeout");var Y=new Error("XMLHttpRequest timeout");Y.code="ETIMEDOUT",$(Y)}},E.timeout)),V.setRequestHeader)for(O in z)z.hasOwnProperty(O)&&V.setRequestHeader(O,z[O]);else if(E.headers&&!l(E.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in E&&(V.responseType=E.responseType),"beforeSend"in E&&typeof E.beforeSend=="function"&&E.beforeSend(V),V.send(F||null),V}function y(E){try{if(E.responseType==="document")return E.responseXML;var L=E.responseXML&&E.responseXML.documentElement.nodeName==="parsererror";if(E.responseType===""&&!L)return E.responseXML}catch{}return null}function k(){}return Xr.exports}var lm=om();const _c=Ve.getDefaultExportFromCjs(lm);var ma={exports:{}},ga,Ql;function um(){if(Ql)return ga;Ql=1;var s=yc(),e=Object.create||(function(){function b(){}return function(C){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return b.prototype=C,new b}})();function t(b,C){this.name="ParsingError",this.code=b.code,this.message=C||b.message}t.prototype=e(Error.prototype),t.prototype.constructor=t,t.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function i(b){function C(z,H,Q,ie){return(z|0)*3600+(H|0)*60+(Q|0)+(ie|0)/1e3}var F=b.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return F?F[3]?C(F[1],F[2],F[3].replace(":",""),F[4]):F[1]>59?C(F[1],F[2],0,F[4]):C(0,F[1],F[2],F[4]):null}function r(){this.values=e(null)}r.prototype={set:function(b,C){!this.get(b)&&C!==""&&(this.values[b]=C)},get:function(b,C,F){return F?this.has(b)?this.values[b]:C[F]:this.has(b)?this.values[b]:C},has:function(b){return b in this.values},alt:function(b,C,F){for(var z=0;z<F.length;++z)if(C===F[z]){this.set(b,C);break}},integer:function(b,C){/^-?\d+$/.test(C)&&this.set(b,parseInt(C,10))},percent:function(b,C){return C.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(C=parseFloat(C),C>=0&&C<=100)?(this.set(b,C),!0):!1}};function n(b,C,F,z){var H=z?b.split(z):[b];for(var Q in H)if(typeof H[Q]=="string"){var ie=H[Q].split(F);if(ie.length===2){var re=ie[0].trim(),Y=ie[1].trim();C(re,Y)}}}function a(b,C,F){var z=b;function H(){var re=i(b);if(re===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+z);return b=b.replace(/^[^\sa-zA-Z-]+/,""),re}function Q(re,Y){var Z=new r;n(re,function(J,te){switch(J){case"region":for(var ee=F.length-1;ee>=0;ee--)if(F[ee].id===te){Z.set(J,F[ee].region);break}break;case"vertical":Z.alt(J,te,["rl","lr"]);break;case"line":var fe=te.split(","),me=fe[0];Z.integer(J,me),Z.percent(J,me)&&Z.set("snapToLines",!1),Z.alt(J,me,["auto"]),fe.length===2&&Z.alt("lineAlign",fe[1],["start","center","end"]);break;case"position":fe=te.split(","),Z.percent(J,fe[0]),fe.length===2&&Z.alt("positionAlign",fe[1],["start","center","end"]);break;case"size":Z.percent(J,te);break;case"align":Z.alt(J,te,["start","center","end","left","right"]);break}},/:/,/\s/),Y.region=Z.get("region",null),Y.vertical=Z.get("vertical","");try{Y.line=Z.get("line","auto")}catch{}Y.lineAlign=Z.get("lineAlign","start"),Y.snapToLines=Z.get("snapToLines",!0),Y.size=Z.get("size",100);try{Y.align=Z.get("align","center")}catch{Y.align=Z.get("align","middle")}try{Y.position=Z.get("position","auto")}catch{Y.position=Z.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},Y.align)}Y.positionAlign=Z.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},Y.align)}function ie(){b=b.replace(/^\s+/,"")}if(ie(),C.startTime=H(),ie(),b.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+z);b=b.substr(3),ie(),C.endTime=H(),ie(),Q(b,C)}var l=s.createElement&&s.createElement("textarea"),c={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},f={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)"},g={v:"title",lang:"lang"},y={rt:"ruby"};function k(b,C){function F(){if(!C)return null;function me(he){return C=C.substr(he.length),he}var ve=C.match(/^([^<]*)(<[^>]*>?)?/);return me(ve[1]?ve[1]:ve[2])}function z(me){return l.innerHTML=me,me=l.textContent,l.textContent="",me}function H(me,ve){return!y[ve.localName]||y[ve.localName]===me.localName}function Q(me,ve){var he=c[me];if(!he)return null;var Ke=b.document.createElement(he),Ze=g[me];return Ze&&ve&&(Ke[Ze]=ve.trim()),Ke}for(var ie=b.document.createElement("div"),re=ie,Y,Z=[];(Y=F())!==null;){if(Y[0]==="<"){if(Y[1]==="/"){Z.length&&Z[Z.length-1]===Y.substr(2).replace(">","")&&(Z.pop(),re=re.parentNode);continue}var J=i(Y.substr(1,Y.length-2)),te;if(J){te=b.document.createProcessingInstruction("timestamp",J),re.appendChild(te);continue}var ee=Y.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!ee||(te=Q(ee[1],ee[3]),!te)||!H(re,te))continue;if(ee[2]){var fe=ee[2].split(".");fe.forEach(function(me){var ve=/^bg_/.test(me),he=ve?me.slice(3):me;if(f.hasOwnProperty(he)){var Ke=ve?"background-color":"color",Ze=f[he];te.style[Ke]=Ze}}),te.className=fe.join(" ")}Z.push(ee[1]),re.appendChild(te),re=te;continue}re.appendChild(b.document.createTextNode(z(Y)))}return ie}var E=[[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 L(b){for(var C=0;C<E.length;C++){var F=E[C];if(b>=F[0]&&b<=F[1])return!0}return!1}function _(b){var C=[],F="",z;if(!b||!b.childNodes)return"ltr";function H(re,Y){for(var Z=Y.childNodes.length-1;Z>=0;Z--)re.push(Y.childNodes[Z])}function Q(re){if(!re||!re.length)return null;var Y=re.pop(),Z=Y.textContent||Y.innerText;if(Z){var J=Z.match(/^.*(\n|\r)/);return J?(re.length=0,J[0]):Z}if(Y.tagName==="ruby")return Q(re);if(Y.childNodes)return H(re,Y),Q(re)}for(H(C,b);F=Q(C);)for(var ie=0;ie<F.length;ie++)if(z=F.charCodeAt(ie),L(z))return"rtl";return"ltr"}function I(b){if(typeof b.line=="number"&&(b.snapToLines||b.line>=0&&b.line<=100))return b.line;if(!b.track||!b.track.textTrackList||!b.track.textTrackList.mediaElement)return-1;for(var C=b.track,F=C.textTrackList,z=0,H=0;H<F.length&&F[H]!==C;H++)F[H].mode==="showing"&&z++;return++z*-1}function N(){}N.prototype.applyStyles=function(b,C){C=C||this.div;for(var F in b)b.hasOwnProperty(F)&&(C.style[F]=b[F])},N.prototype.formatStyle=function(b,C){return b===0?0:b+C};function R(b,C,F){N.call(this),this.cue=C,this.cueDiv=k(b,C.text);var z={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:C.vertical===""?"horizontal-tb":C.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(z,this.cueDiv),this.div=b.document.createElement("div"),z={direction:_(this.cueDiv),writingMode:C.vertical===""?"horizontal-tb":C.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:C.align==="middle"?"center":C.align,font:F.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(z),this.div.appendChild(this.cueDiv);var H=0;switch(C.positionAlign){case"start":case"line-left":H=C.position;break;case"center":H=C.position-C.size/2;break;case"end":case"line-right":H=C.position-C.size;break}C.vertical===""?this.applyStyles({left:this.formatStyle(H,"%"),width:this.formatStyle(C.size,"%")}):this.applyStyles({top:this.formatStyle(H,"%"),height:this.formatStyle(C.size,"%")}),this.move=function(Q){this.applyStyles({top:this.formatStyle(Q.top,"px"),bottom:this.formatStyle(Q.bottom,"px"),left:this.formatStyle(Q.left,"px"),right:this.formatStyle(Q.right,"px"),height:this.formatStyle(Q.height,"px"),width:this.formatStyle(Q.width,"px")})}}R.prototype=e(N.prototype),R.prototype.constructor=R;function P(b){var C,F,z,H;if(b.div){F=b.div.offsetHeight,z=b.div.offsetWidth,H=b.div.offsetTop;var Q=(Q=b.div.childNodes)&&(Q=Q[0])&&Q.getClientRects&&Q.getClientRects();b=b.div.getBoundingClientRect(),C=Q?Math.max(Q[0]&&Q[0].height||0,b.height/Q.length):0}this.left=b.left,this.right=b.right,this.top=b.top||H,this.height=b.height||F,this.bottom=b.bottom||H+(b.height||F),this.width=b.width||z,this.lineHeight=C!==void 0?C:b.lineHeight}P.prototype.move=function(b,C){switch(C=C!==void 0?C:this.lineHeight,b){case"+x":this.left+=C,this.right+=C;break;case"-x":this.left-=C,this.right-=C;break;case"+y":this.top+=C,this.bottom+=C;break;case"-y":this.top-=C,this.bottom-=C;break}},P.prototype.overlaps=function(b){return this.left<b.right&&this.right>b.left&&this.top<b.bottom&&this.bottom>b.top},P.prototype.overlapsAny=function(b){for(var C=0;C<b.length;C++)if(this.overlaps(b[C]))return!0;return!1},P.prototype.within=function(b){return this.top>=b.top&&this.bottom<=b.bottom&&this.left>=b.left&&this.right<=b.right},P.prototype.overlapsOppositeAxis=function(b,C){switch(C){case"+x":return this.left<b.left;case"-x":return this.right>b.right;case"+y":return this.top<b.top;case"-y":return this.bottom>b.bottom}},P.prototype.intersectPercentage=function(b){var C=Math.max(0,Math.min(this.right,b.right)-Math.max(this.left,b.left)),F=Math.max(0,Math.min(this.bottom,b.bottom)-Math.max(this.top,b.top)),z=C*F;return z/(this.height*this.width)},P.prototype.toCSSCompatValues=function(b){return{top:this.top-b.top,bottom:b.bottom-this.bottom,left:this.left-b.left,right:b.right-this.right,height:this.height,width:this.width}},P.getSimpleBoxPosition=function(b){var C=b.div?b.div.offsetHeight:b.tagName?b.offsetHeight:0,F=b.div?b.div.offsetWidth:b.tagName?b.offsetWidth:0,z=b.div?b.div.offsetTop:b.tagName?b.offsetTop:0;b=b.div?b.div.getBoundingClientRect():b.tagName?b.getBoundingClientRect():b;var H={left:b.left,right:b.right,top:b.top||z,height:b.height||C,bottom:b.bottom||z+(b.height||C),width:b.width||F};return H};function $(b,C,F,z){function H(he,Ke){for(var Ze,qe=new P(he),et=1,xt=0;xt<Ke.length;xt++){for(;he.overlapsOppositeAxis(F,Ke[xt])||he.within(F)&&he.overlapsAny(z);)he.move(Ke[xt]);if(he.within(F))return he;var Qe=he.intersectPercentage(F);et>Qe&&(Ze=new P(he),et=Qe),he=new P(qe)}return Ze||qe}var Q=new P(C),ie=C.cue,re=I(ie),Y=[];if(ie.snapToLines){var Z;switch(ie.vertical){case"":Y=["+y","-y"],Z="height";break;case"rl":Y=["+x","-x"],Z="width";break;case"lr":Y=["-x","+x"],Z="width";break}var J=Q.lineHeight,te=J*Math.round(re),ee=F[Z]+J,fe=Y[0];Math.abs(te)>ee&&(te=te<0?-1:1,te*=Math.ceil(ee/J)*J),re<0&&(te+=ie.vertical===""?F.height:F.width,Y=Y.reverse()),Q.move(fe,te)}else{var me=Q.lineHeight/F.height*100;switch(ie.lineAlign){case"center":re-=me/2;break;case"end":re-=me;break}switch(ie.vertical){case"":C.applyStyles({top:C.formatStyle(re,"%")});break;case"rl":C.applyStyles({left:C.formatStyle(re,"%")});break;case"lr":C.applyStyles({right:C.formatStyle(re,"%")});break}Y=["+y","-x","+x","-y"],Q=new P(C)}var ve=H(Q,Y);C.move(ve.toCSSCompatValues(F))}function U(){}U.StringDecoder=function(){return{decode:function(b){if(!b)return"";if(typeof b!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(b))}}},U.convertCueToDOMTree=function(b,C){return!b||!C?null:k(b,C)};var V=.05,O="sans-serif",G="1.5%";return U.processCues=function(b,C,F){if(!b||!C||!F)return null;for(;F.firstChild;)F.removeChild(F.firstChild);var z=b.document.createElement("div");z.style.position="absolute",z.style.left="0",z.style.right="0",z.style.top="0",z.style.bottom="0",z.style.margin=G,F.appendChild(z);function H(J){for(var te=0;te<J.length;te++)if(J[te].hasBeenReset||!J[te].displayState)return!0;return!1}if(!H(C)){for(var Q=0;Q<C.length;Q++)z.appendChild(C[Q].displayState);return}var ie=[],re=P.getSimpleBoxPosition(z),Y=Math.round(re.height*V*100)/100,Z={font:Y+"px "+O};(function(){for(var J,te,ee=0;ee<C.length;ee++)te=C[ee],J=new R(b,te,Z),z.appendChild(J.div),$(b,J,re,ie),te.displayState=J.div,ie.push(P.getSimpleBoxPosition(J))})()},U.Parser=function(b,C,F){F||(F=C,C={}),C||(C={}),this.window=b,this.vttjs=C,this.state="INITIAL",this.buffer="",this.decoder=F||new TextDecoder("utf8"),this.regionList=[]},U.Parser.prototype={reportOrThrowError:function(b){if(b instanceof t)this.onparsingerror&&this.onparsingerror(b);else throw b},parse:function(b){var C=this;b&&(C.buffer+=C.decoder.decode(b,{stream:!0}));function F(){for(var J=C.buffer,te=0;te<J.length&&J[te]!=="\r"&&J[te]!==`
4
- `;)++te;var ee=J.substr(0,te);return J[te]==="\r"&&++te,J[te]===`
5
- `&&++te,C.buffer=J.substr(te),ee}function z(J){var te=new r;if(n(J,function(fe,me){switch(fe){case"id":te.set(fe,me);break;case"width":te.percent(fe,me);break;case"lines":te.integer(fe,me);break;case"regionanchor":case"viewportanchor":var ve=me.split(",");if(ve.length!==2)break;var he=new r;if(he.percent("x",ve[0]),he.percent("y",ve[1]),!he.has("x")||!he.has("y"))break;te.set(fe+"X",he.get("x")),te.set(fe+"Y",he.get("y"));break;case"scroll":te.alt(fe,me,["up"]);break}},/=/,/\s/),te.has("id")){var ee=new(C.vttjs.VTTRegion||C.window.VTTRegion);ee.width=te.get("width",100),ee.lines=te.get("lines",3),ee.regionAnchorX=te.get("regionanchorX",0),ee.regionAnchorY=te.get("regionanchorY",100),ee.viewportAnchorX=te.get("viewportanchorX",0),ee.viewportAnchorY=te.get("viewportanchorY",100),ee.scroll=te.get("scroll",""),C.onregion&&C.onregion(ee),C.regionList.push({id:te.get("id"),region:ee})}}function H(J){var te=new r;n(J,function(ee,fe){switch(ee){case"MPEGT":te.integer(ee+"S",fe);break;case"LOCA":te.set(ee+"L",i(fe));break}},/[^\d]:/,/,/),C.ontimestampmap&&C.ontimestampmap({MPEGTS:te.get("MPEGTS"),LOCAL:te.get("LOCAL")})}function Q(J){J.match(/X-TIMESTAMP-MAP/)?n(J,function(te,ee){te==="X-TIMESTAMP-MAP"&&H(ee)},/=/):n(J,function(te,ee){te==="Region"&&z(ee)},/:/)}try{var ie;if(C.state==="INITIAL"){if(!/\r\n|\n/.test(C.buffer))return this;ie=F();var re=ie.match(/^WEBVTT([ \t].*)?$/);if(!re||!re[0])throw new t(t.Errors.BadSignature);C.state="HEADER"}for(var Y=!1;C.buffer;){if(!/\r\n|\n/.test(C.buffer))return this;switch(Y?Y=!1:ie=F(),C.state){case"HEADER":/:/.test(ie)?Q(ie):ie||(C.state="ID");continue;case"NOTE":ie||(C.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(ie)){C.state="NOTE";break}if(!ie)continue;C.cue=new(C.vttjs.VTTCue||C.window.VTTCue)(0,0,"");try{C.cue.align="center"}catch{C.cue.align="middle"}if(C.state="CUE",ie.indexOf("-->")===-1){C.cue.id=ie;continue}case"CUE":try{a(ie,C.cue,C.regionList)}catch(J){C.reportOrThrowError(J),C.cue=null,C.state="BADCUE";continue}C.state="CUETEXT";continue;case"CUETEXT":var Z=ie.indexOf("-->")!==-1;if(!ie||Z&&(Y=!0)){C.oncue&&C.oncue(C.cue),C.cue=null,C.state="ID";continue}C.cue.text&&(C.cue.text+=`
6
- `),C.cue.text+=ie.replace(/\u2028/g,`
1
+ const e=require(`../bundled/localized.cjs`),t=require(`../bundled/vivid-element.cjs`),n=require(`../bundled/decorate.cjs`),r=require(`../bundled/class-names.cjs`),i=require(`../bundled/enums.cjs`),a=require(`../bundled/playbackRates.cjs`);var o=`.vjs-svg-icon{fill:currentColor;background-position:50%;background-repeat:no-repeat;width:1.8em;height:1.8em;display:inline-block}.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{width:100%;height:100%;position:absolute;top:0;left:0}.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-style:normal;font-weight:400}.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-style:normal;font-weight:400}.vjs-icon-play-circle:before{content:""}.vjs-icon-pause,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder{font-family:VideoJS;font-style:normal;font-weight:400}.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-style:normal;font-weight:400}.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-style:normal;font-weight:400}.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-style:normal;font-weight:400}.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-style:normal;font-weight:400}.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-style:normal;font-weight:400}.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-style:normal;font-weight:400}.vjs-icon-fullscreen-exit:before,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-spinner{font-family:VideoJS;font-style:normal;font-weight:400}.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-style:normal;font-weight:400}.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-style:normal;font-weight:400}.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-style:normal;font-weight:400}.vjs-icon-hd:before{content:""}.vjs-icon-chapters,.video-js .vjs-chapters-button .vjs-icon-placeholder{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-chapters:before,.video-js .vjs-chapters-button .vjs-icon-placeholder:before{content:""}.vjs-icon-downloading{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-downloading:before{content:""}.vjs-icon-file-download{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-file-download:before{content:""}.vjs-icon-file-download-done{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-file-download-done:before{content:""}.vjs-icon-file-download-off{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-file-download-off:before{content:""}.vjs-icon-share{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-share:before{content:""}.vjs-icon-cog{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-cog:before{content:""}.vjs-icon-square{font-family:VideoJS;font-style:normal;font-weight:400}.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-style:normal;font-weight:400}.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-style:normal;font-weight:400}.vjs-icon-circle-outline:before{content:""}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-circle-inner-circle:before{content:""}.vjs-icon-cancel,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-cancel:before,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before{content:""}.vjs-icon-repeat{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-repeat:before{content:""}.vjs-icon-replay,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder{font-family:VideoJS;font-style:normal;font-weight:400}.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-style:normal;font-weight:400}.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-style:normal;font-weight:400}.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-style:normal;font-weight:400}.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-style:normal;font-weight:400}.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-style:normal;font-weight:400}.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-style:normal;font-weight:400}.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-style:normal;font-weight:400}.vjs-icon-audio:before,.video-js .vjs-audio-button .vjs-icon-placeholder:before{content:""}.vjs-icon-next-item{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-next-item:before{content:""}.vjs-icon-previous-item{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-previous-item:before{content:""}.vjs-icon-shuffle{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-shuffle:before{content:""}.vjs-icon-cast{font-family:VideoJS;font-style:normal;font-weight:400}.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-style:normal;font-weight:400}.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-style:normal;font-weight:400}.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-style:normal;font-weight:400}.vjs-icon-facebook:before{content:""}.vjs-icon-linkedin{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-linkedin:before{content:""}.vjs-icon-twitter{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-twitter:before{content:""}.vjs-icon-tumblr{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-tumblr:before{content:""}.vjs-icon-pinterest{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-pinterest:before{content:""}.vjs-icon-audio-description,.video-js .vjs-descriptions-button .vjs-icon-placeholder{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-audio-description:before,.video-js .vjs-descriptions-button .vjs-icon-placeholder:before{content:""}.video-js{vertical-align:top;box-sizing:border-box;color:#fff;word-break:initial;background-color:#000;padding:0;font-family:Arial,Helvetica,sans-serif;font-size:10px;font-style:normal;font-weight:400;line-height:1;display:inline-block;position:relative}.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;margin:0;list-style-position:outside}.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.778%}.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{width:100%;height:100%;position:absolute;top:0;left:0}.video-js.vjs-audio-only-mode .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{height:100%;margin:0;padding:0}.vjs-full-window .video-js.vjs-fullscreen,body.vjs-pip-window .video-js{z-index:1000;position:fixed;inset:0;overflow:hidden}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js{display:block;width:100%!important;height:100%!important;padding-top:0!important}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-pip-container .vjs-pip-text{text-align:center;background-color:#000000b3;width:100%;padding:.5em;font-size:2em;position:absolute;bottom:10%}.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{font-size:1.4em;bottom:0}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{width:1px;height:1px;position:absolute;top:0;left:-9999px}.vjs-lock-showing{opacity:1!important;visibility:visible!important;display:block!important}.vjs-no-js{color:#fff;text-align:center;background-color:#000;width:300px;height:150px;margin:0 auto;padding:20px;font-family:Arial,Helvetica,sans-serif;font-size:18px}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{cursor:pointer;opacity:1;background-color:#2b333fb3;border:.06666em solid #fff;border-radius:.3em;width:3em;height:1.63332em;margin-top:-.81666em;margin-left:-1.5em;padding:0;font-size:3em;line-height:1.5em;transition:all .4s;display:block;position:absolute;top:50%;left:50%}.vjs-big-play-button .vjs-svg-icon{width:1em;height:1em;line-height:1;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.video-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus{background-color:#73859f80;border-color:#fff;transition:all}.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{color:inherit;font-size:inherit;line-height:inherit;text-transform:none;appearance:none;background:0 0;border:none;text-decoration:none;transition:none;display:inline-block}.video-js.vjs-spatial-navigation-enabled .vjs-button:focus{box-shadow:none;outline:.0625em solid #fff}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;z-index:2;height:3em;position:absolute;top:.5em;right:0}.video-js .vjs-modal-dialog{background:linear-gradient(#000c,#fff0);overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{z-index:1;padding:20px 24px;font-size:1.2em;line-height:1.5}.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{margin:0;padding:0;font-family:Arial,Helvetica,sans-serif;display:block;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{text-align:center;text-transform:lowercase;justify-content:center;margin:0;padding:.2em 0;font-size:1.2em;line-height:1.4em;list-style:none;display:flex}.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:#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{color:#2b333f;background-color:#fff}.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:0 0}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;cursor:default;margin:0 0 .3em;padding:0;font-size:1em;font-weight:700;line-height:2em}.vjs-menu-button-popup .vjs-menu{border-top-color:#2b333fb3;width:10em;height:0;margin-bottom:1.5em;display:none;position:absolute;bottom:0;left:-3em}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333fb3;width:100%;max-height:15em;position:absolute;bottom:1.5em}.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.22222em}.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;width:auto;height:100%;margin:0;padding:0;transition:all .4s;position:absolute;top:0;left:4em}.vjs-menu-button-inline:hover .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline.vjs-slider-active .vjs-menu{opacity:1;display:block}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{background-color:#2b333fb3;width:100%;height:3em;display:none;position:absolute;bottom:0;left:0;right:0}.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{visibility:visible;opacity:1;transition:visibility .1s,opacity .1s;display:flex}.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{text-align:center;flex:none;width:4em;height:100%;margin:0;padding:0;position:relative}.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:0 0 1em #fff}.video-js :not(.vjs-visible-text)>.vjs-control-text{clip:rect(0 0 0 0);border:0;width:1px;height:1px;padding:0;position:absolute;overflow:hidden}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;touch-action:none;flex:auto;align-items:center;min-width:4em;display:flex}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{align-items:center;display:flex}.video-js .vjs-progress-holder{flex:auto;height:.3em;transition:all .2s}.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.66667em}.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{width:0;height:100%;margin:0;padding:0;display:block;position:absolute}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{z-index:1;font-size:.9em;line-height:.35em;position:absolute;right:-.5em}.vjs-svg-icons-enabled .vjs-play-progress:before{content:none!important}.vjs-play-progress .vjs-svg-icon{pointer-events:none;z-index:1;width:.9em;height:.9em;line-height:.15em;position:absolute;top:-.35em;right:-.4em}.video-js .vjs-load-progress{background:#73859f80}.video-js .vjs-load-progress div{background:#73859fbf}.video-js .vjs-time-tooltip{color:#000;float:right;pointer-events:none;visibility:hidden;z-index:1;background-color:#fffc;border-radius:.3em;padding:6px 8px 8px;font-family:Arial,Helvetica,sans-serif;font-size:1em;position:absolute;top:-3.4em}.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{visibility:visible;font-size:.6em;display:block}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{z-index:1;background-color:#000;width:1px;height:100%;display:none;position:absolute}.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:#000c}.video-js .vjs-slider{cursor:pointer;-webkit-touch-callout:none;user-select:none;background-color:#73859f80;margin:0 .45em;padding:0;position:relative}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js.vjs-spatial-navigation-enabled .vjs-slider:focus{outline:.0625em solid #fff}.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;transition:visibility .1s,opacity .1s,height .1s,width .1s,left,top;position:relative}.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{transition:left;left:-3.5em}.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{width:3em;height:8em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s;left:-3000em}.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{background-color:#fff;position:absolute;bottom:0;left:0}.video-js .vjs-volume-level:before{z-index:1;font-size:.9em;position:absolute}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{z-index:1;top:-.5em;left:-.3em}.vjs-svg-icons-enabled .vjs-volume-level:before{content:none}.vjs-volume-level .vjs-svg-icon{pointer-events:none;z-index:1;width:.9em;height:.9em;position:absolute}.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{background-color:#2b333fb3;width:3em;height:8em;bottom:8em}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{color:#000;float:right;pointer-events:none;visibility:hidden;z-index:1;background-color:#fffc;border-radius:.3em;padding:6px 8px 8px;font-family:Arial,Helvetica,sans-serif;font-size:1em;position:absolute;top:-3.4em}.video-js .vjs-volume-control:hover .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip{visibility:visible;font-size:1em;display:block}.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip{top:-12px;left:1em}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{z-index:1;background-color:#000;width:100%;height:1px;display:none;position:absolute}.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:#000c}.vjs-poster{vertical-align:middle;cursor:pointer;height:100%;margin:0;padding:0;display:inline-block;position:absolute;inset:0}.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{object-fit:contain;width:100%;height:100%}.video-js .vjs-live-control{flex:auto;align-items:flex-start;font-size:1em;line-height:3em;display:flex}.video-js:not(.vjs-live) .vjs-live-control,.video-js.vjs-liveui .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{cursor:pointer;flex:none;align-items:center;width:auto;min-width:4em;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;display:inline-flex}.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{color:#888;margin-right:.5em}.vjs-svg-icons-enabled .vjs-seek-to-live-control{line-height:0}.vjs-seek-to-live-control .vjs-svg-icon{pointer-events:none;fill:#888;width:1em;height:1em}.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;width:auto;min-width:2em;padding-left:1em;padding-right:1em;font-size:1em;line-height:3em}.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider,.video-js .vjs-current-time,.video-js .vjs-duration{display:none}.vjs-time-divider{line-height:3em;display:none}.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{pointer-events:none;position:absolute;inset:0 0 3em}.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{text-align:center;margin-bottom:.1em;font-size:1.4em}.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{transform:translateY(-1.5em)}.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{width:100%;height:100%;position:absolute;top:0;left:0}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;text-align:center;font-size:1.5em;line-height:2}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{text-align:center;font-size:1.4em}.vjs-loading-spinner{opacity:.85;text-align:left;box-sizing:border-box;visibility:hidden;background-clip:padding-box;border:.6em solid #2b333fb3;border-radius:50%;width:5em;height:5em;display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{justify-content:center;align-items:center;animation:0s linear .3s forwards vjs-spinner-show;display:flex}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:before,.vjs-loading-spinner:after{content:"";box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:#fff #0000 #0000;position:absolute}.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:1.1s cubic-bezier(.6,.2,0,.8) infinite vjs-spinner-spin,1.1s linear infinite vjs-spinner-fade}.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;margin-bottom:-.1em;display:inline-block}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{content:"";font-family:VideoJS;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;margin-bottom:-.1em;display:inline-block}.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{content:" ";font-family:VideoJS;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{color:#fff;background-color:#2b333fbf;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{grid-template-rows:1fr;grid-template-columns:1fr 1fr;padding:20px 24px 0;display:grid}.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-bottom:.5em;margin-right:1em}.vjs-text-track-settings fieldset{border:none;margin:10px}.vjs-text-track-settings fieldset span{padding:0 .6em .8em;display:inline-block}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-size:1.2em;font-weight:700}.vjs-text-track-settings .vjs-label{margin:0 .5em .5em 0}.vjs-track-settings-controls button:focus,.vjs-track-settings-controls button:active{background-image:linear-gradient(#73859f 0%,#fff 12%);outline-width:medium;outline-style:solid}.vjs-track-settings-controls button:hover{color:#2b333fbf}.vjs-track-settings-controls button{color:#2b333f;cursor:pointer;background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f 100%);border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{pointer-events:none;background:linear-gradient(#000000e6 0%,#000000b3 60%,#0000 100%);width:100%;padding:.666em 1.333em 4em;font-size:1.2em;line-height:1.5;transition:opacity .1s;position:absolute;top:0}.vjs-error .vjs-title-bar{display:none}.vjs-title-bar-title,.vjs-title-bar-description{text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.vjs-title-bar-title{margin-bottom:.333em;font-weight:700}.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{cursor:pointer;opacity:1;background-color:#32323280;justify-content:center;align-items:center;height:3em;transition:opacity 1s;display:flex;position:absolute}.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{z-index:-1000;border:none;width:100%;height:100%;position:absolute;top:0;left:0}.js-focus-visible .video-js :focus:not(.focus-visible),.video-js :focus:not(:focus-visible){outline:none}:host{display:block}.vjs-theme-vivid{--focus-stroke-gap-color:transparent;color:#fff;font:var(--vvd-typography-base);border-radius:8px;position:relative;overflow:hidden;container-type:inline-size}.vjs-theme-vivid .vjs-big-play-button{background-color:#0d0d0dcc;border-radius:50%;justify-content:center;align-items:center;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(--focus-stroke-color,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{filter:none;inline-size:30px;margin-inline-start:2px;display:flex}.vjs-theme-vivid .vjs-poster,.vjs-theme-vivid .vjs-tech{border-radius:8px;overflow:hidden}.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{font:var(--vvd-typography-base);flex-direction:column;justify-content:center;min-inline-size:auto;padding:0;display:flex}.vjs-theme-vivid .vjs-time-divider{padding:0 4px}.vjs-theme-vivid .vjs-remaining-time{display:none}.vjs-theme-vivid .vjs-control-bar{background-color:#0d0d0dcc;border-radius:0 0 8px 8px;flex-wrap:wrap;column-gap:4px;block-size:44px;inline-size:calc(100% - 16px);margin:8px;padding:4px 4px 8px}.vjs-theme-vivid .vjs-control-bar:before{background-color:inherit;content:"";border-radius:8px 8px 0 0;block-size:32px;inline-size:100%;position:absolute;inset-block-start:-32px;inset-inline-start:0}.vjs-theme-vivid .vjs-button{aspect-ratio:1;color:inherit;font:var(--vvd-typography-base);border-radius:4px;flex-direction:column;justify-content:center;align-items:center;inline-size:32px;display:flex}.vjs-theme-vivid .vjs-button:focus-visible{box-shadow:0 0 0 4px color-mix(in srgb, var(--focus-stroke-color,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{filter:none;block-size:16px;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%);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{background-color:var(--scrollbar-fallback-track-color,var(--scrollbar-thumb-color));border:0;border-radius:4px}.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{color:#fff;font:var(--vvd-typography-base);text-align:left;justify-content:start;align-items:center;min-block-size:40px;padding:4px 8px}.vjs-theme-vivid .vjs-menu li:focus-visible{box-shadow:0 0 0 4px color-mix(in srgb, var(--focus-stroke-color,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{isolation:isolate;block-size:20px;inline-size:calc(100% - 80px);position:absolute;inset-block-start:-20px;inset-inline-start:40px}@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(--focus-stroke-color,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{block-size:auto;position:absolute;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(--focus-stroke-color,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;margin-block-end:16px;inset-block-end:-4px}.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;margin-block-end:16px;inset-block-end:-4px;inset-inline-start:-8px}.vjs-theme-vivid .vjs-audio-button .vjs-menu{margin-block-end:16px;inset-block-end:-4px}.vjs-theme-vivid .vjs-menu-button-popup .vjs-menu .vjs-menu-content{background:linear-gradient(#ffffff14,#ffffff14),#0d0d0d;flex-direction:column;gap:1px;padding-block:8px;display:flex;inset-block-end:20px}.vjs-theme-vivid .vjs-volume-panel{font:var(--vvd-typography-base);margin-inline-end:auto;inline-size:32px!important}.vjs-theme-vivid .vjs-volume-panel .vjs-volume-control{background:linear-gradient(#ffffff14,#ffffff14),#0d0d0d;border-radius:8px;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 (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}}`,s=e.r(((e,t)=>{t.exports=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{}})),c=e.r(((e,t)=>{t.exports={}})),l=e.r(((e,t)=>{var n=typeof global<`u`?global:typeof window<`u`?window:{},r=c(),i;typeof document<`u`?i=document:(i=n[`__GLOBAL_DOCUMENT_CACHE@4`],i||=n[`__GLOBAL_DOCUMENT_CACHE@4`]=r),t.exports=i})),u=e.r(((e,t)=>{function n(){return t.exports=n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t.exports.__esModule=!0,t.exports.default=t.exports,n.apply(null,arguments)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})),d=e.r(((e,t)=>{t.exports=r;var n=Object.prototype.toString;function r(e){if(!e)return!1;var t=n.call(e);return t===`[object Function]`||typeof e==`function`&&t!==`[object RegExp]`||typeof window<`u`&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}})),f=e.r(((e,t)=>{function n(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=r(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r(e,t){if(e){if(typeof e==`string`)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}}function i(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}t.exports=function(){function e(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},t.addInterceptor=function(e,t){this.typeToInterceptorsMap_.has(e)||this.typeToInterceptorsMap_.set(e,new Set);var n=this.typeToInterceptorsMap_.get(e);return n.has(t)?!1:(n.add(t),!0)},t.removeInterceptor=function(e,t){var n=this.typeToInterceptorsMap_.get(e);return n&&n.has(t)?(n.delete(t),!0):!1},t.clearInterceptorsByType=function(e){return this.typeToInterceptorsMap_.get(e)?(this.typeToInterceptorsMap_.delete(e),this.typeToInterceptorsMap_.set(e,new Set),!0):!1},t.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},t.getForType=function(e){return this.typeToInterceptorsMap_.get(e)||new Set},t.execute=function(e,t){for(var r=n(this.getForType(e)),i;!(i=r()).done;){var a=i.value;try{t=a(t)}catch{}}return t},e}()})),p=e.r(((e,t)=>{var n=function(){function e(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},t.getMaxAttempts=function(){return this.maxAttempts_},t.setMaxAttempts=function(e){this.maxAttempts_=e},t.getDelayFactor=function(){return this.delayFactor_},t.setDelayFactor=function(e){this.delayFactor_=e},t.getFuzzFactor=function(){return this.fuzzFactor_},t.setFuzzFactor=function(e){this.fuzzFactor_=e},t.getInitialDelay=function(){return this.initialDelay_},t.setInitialDelay=function(e){this.initialDelay_=e},t.createRetry=function(e){var t=e===void 0?{}:e,n=t.maxAttempts,i=t.delayFactor,a=t.fuzzFactor,o=t.initialDelay;return new r({maxAttempts:n||this.maxAttempts_,delayFactor:i||this.delayFactor_,fuzzFactor:a||this.fuzzFactor_,initialDelay:o||this.initialDelay_})},e}(),r=function(){function e(e){this.maxAttempts_=e.maxAttempts,this.delayFactor_=e.delayFactor,this.fuzzFactor_=e.fuzzFactor,this.currentDelay_=e.initialDelay,this.currentAttempt_=1}var t=e.prototype;return t.moveToNextAttempt=function(){this.currentAttempt_++;var e=this.currentDelay_*this.delayFactor_;this.currentDelay_+=e},t.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},t.getCurrentDelay=function(){return this.currentDelay_},t.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},t.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},t.getCurrentFuzzedDelay=function(){var e=this.getCurrentMinPossibleDelay(),t=this.getCurrentMaxPossibleDelay();return e+Math.random()*(t-e)},e}();t.exports=n})),m=e.r(((e,t)=>{var n=s(),r=function(e,t){return t===void 0&&(t=!1),function(r,a,o){if(r){e(r);return}if(a.statusCode>=400&&a.statusCode<=599){var s=o;if(t)if(n.TextDecoder){var c=i(a.headers&&a.headers[`content-type`]);try{s=new TextDecoder(c).decode(o)}catch{}}else s=String.fromCharCode.apply(null,new Uint8Array(o));e({cause:s});return}e(null,o)}};function i(e){return e===void 0&&(e=``),e.toLowerCase().split(`;`).reduce(function(e,t){var n=t.split(`=`),r=n[0],i=n[1];return r.trim()===`charset`?i.trim():e},`utf-8`)}t.exports=r})),h=e.r(((e,t)=>{var n=s(),r=u(),i=d(),a=f(),o=p();_.httpHandler=m(),_.requestInterceptorsStorage=new a,_.responseInterceptorsStorage=new a,_.retryManager=new o;var c=function(e){var t={};return e&&e.trim().split(`
3
+ `).forEach(function(e){var n=e.indexOf(`:`),r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}),t};t.exports=_,t.exports.default=_,_.XMLHttpRequest=n.XMLHttpRequest||b,_.XDomainRequest=`withCredentials`in new _.XMLHttpRequest?_.XMLHttpRequest:n.XDomainRequest,l([`get`,`put`,`post`,`patch`,`head`,`delete`],function(e){_[e===`delete`?`del`:e]=function(t,n,r){return n=g(t,n,r),n.method=e.toUpperCase(),v(n)}});function l(e,t){for(var n=0;n<e.length;n++)t(e[n])}function h(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function g(e,t,n){var a=e;return i(t)?(n=t,typeof e==`string`&&(a={uri:e})):a=r({},t,{uri:e}),a.callback=n,a}function _(e,t,n){return t=g(e,t,n),v(t)}function v(e){if(e.callback===void 0)throw Error(`callback argument missing`);if(e.requestType&&_.requestInterceptorsStorage.getIsEnabled()){var t={uri:e.uri||e.url,headers:e.headers||{},body:e.body,metadata:e.metadata||{},retry:e.retry,timeout:e.timeout},n=_.requestInterceptorsStorage.execute(e.requestType,t);e.uri=n.uri,e.headers=n.headers,e.body=n.body,e.metadata=n.metadata,e.retry=n.retry,e.timeout=n.timeout}var r=!1,i=function(t,n,i){r||(r=!0,e.callback(t,n,i))};function a(){u.readyState===4&&!_.responseInterceptorsStorage.getIsEnabled()&&setTimeout(l,0)}function o(){var e=void 0;if(e=u.response?u.response:u.responseText||y(u),S)try{e=JSON.parse(e)}catch{}return e}function s(t){if(clearTimeout(C),clearTimeout(e.retryTimeout),t instanceof Error||(t=Error(``+(t||`Unknown XMLHttpRequest Error`))),t.statusCode=0,!f&&_.retryManager.getIsEnabled()&&e.retry&&e.retry.shouldRetry()){e.retryTimeout=setTimeout(function(){e.retry.moveToNextAttempt(),e.xhr=u,v(e)},e.retry.getCurrentFuzzedDelay());return}if(e.requestType&&_.responseInterceptorsStorage.getIsEnabled()){var n={headers:w.headers||{},body:w.body,responseUrl:u.responseURL,responseType:u.responseType},r=_.responseInterceptorsStorage.execute(e.requestType,n);w.body=r.body,w.headers=r.headers}return i(t,w)}function l(){if(!f){var t;clearTimeout(C),clearTimeout(e.retryTimeout),t=e.useXDR&&u.status===void 0?200:u.status===1223?204:u.status;var n=w,r=null;if(t===0?r=Error(`Internal XMLHttpRequest Error`):(n={body:o(),statusCode:t,method:m,headers:{},url:p,rawRequest:u},u.getAllResponseHeaders&&(n.headers=c(u.getAllResponseHeaders()))),e.requestType&&_.responseInterceptorsStorage.getIsEnabled()){var a={headers:n.headers||{},body:n.body,responseUrl:u.responseURL,responseType:u.responseType},s=_.responseInterceptorsStorage.execute(e.requestType,a);n.body=s.body,n.headers=s.headers}return i(r,n,n.body)}}var u=e.xhr||null;u||=e.cors||e.useXDR?new _.XDomainRequest:new _.XMLHttpRequest;var d,f,p=u.url=e.uri||e.url,m=u.method=e.method||`GET`,g=e.body||e.data,b=u.headers=e.headers||{},x=!!e.sync,S=!1,C,w={body:void 0,headers:{},statusCode:0,method:m,url:p,rawRequest:u};if(`json`in e&&e.json!==!1&&(S=!0,b.accept||b.Accept||(b.Accept=`application/json`),m!==`GET`&&m!==`HEAD`&&(b[`content-type`]||b[`Content-Type`]||(b[`Content-Type`]=`application/json`),g=JSON.stringify(e.json===!0?g:e.json))),u.onreadystatechange=a,u.onload=l,u.onerror=s,u.onprogress=function(){},u.onabort=function(){f=!0,clearTimeout(e.retryTimeout)},u.ontimeout=s,u.open(m,p,!x,e.username,e.password),x||(u.withCredentials=!!e.withCredentials),!x&&e.timeout>0&&(C=setTimeout(function(){if(!f){f=!0,u.abort(`timeout`);var e=Error(`XMLHttpRequest timeout`);e.code=`ETIMEDOUT`,s(e)}},e.timeout)),u.setRequestHeader)for(d in b)b.hasOwnProperty(d)&&u.setRequestHeader(d,b[d]);else if(e.headers&&!h(e.headers))throw Error(`Headers cannot be set on an XDomainRequest object`);return`responseType`in e&&(u.responseType=e.responseType),`beforeSend`in e&&typeof e.beforeSend==`function`&&e.beforeSend(u),u.send(g||null),u}function y(e){try{if(e.responseType===`document`)return e.responseXML;var t=e.responseXML&&e.responseXML.documentElement.nodeName===`parsererror`;if(e.responseType===``&&!t)return e.responseXML}catch{}return null}function b(){}})),g=e.r(((e,t)=>{var n=l(),r=Object.create||(function(){function e(){}return function(t){if(arguments.length!==1)throw Error(`Object.create shim only accepts one parameter.`);return e.prototype=t,new e}})();function i(e,t){this.name=`ParsingError`,this.code=e.code,this.message=t||e.message}i.prototype=r(Error.prototype),i.prototype.constructor=i,i.Errors={BadSignature:{code:0,message:`Malformed WebVTT signature.`},BadTimeStamp:{code:1,message:`Malformed time stamp.`}};function a(e){function t(e,t,n,r){return(e|0)*3600+(t|0)*60+(n|0)+(r|0)/1e3}var n=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return n?n[3]?t(n[1],n[2],n[3].replace(`:`,``),n[4]):n[1]>59?t(n[1],n[2],0,n[4]):t(0,n[1],n[2],n[4]):null}function o(){this.values=r(null)}o.prototype={set:function(e,t){!this.get(e)&&t!==``&&(this.values[e]=t)},get:function(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,n){for(var r=0;r<n.length;++r)if(t===n[r]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t),t>=0&&t<=100)?(this.set(e,t),!0):!1}};function s(e,t,n,r){var i=r?e.split(r):[e];for(var a in i)if(typeof i[a]==`string`){var o=i[a].split(n);o.length===2&&t(o[0].trim(),o[1].trim())}}function c(e,t,n){var r=e;function c(){var t=a(e);if(t===null)throw new i(i.Errors.BadTimeStamp,`Malformed timestamp: `+r);return e=e.replace(/^[^\sa-zA-Z-]+/,``),t}function l(e,t){var r=new o;s(e,function(e,t){switch(e){case`region`:for(var i=n.length-1;i>=0;i--)if(n[i].id===t){r.set(e,n[i].region);break}break;case`vertical`:r.alt(e,t,[`rl`,`lr`]);break;case`line`:var a=t.split(`,`),o=a[0];r.integer(e,o),r.percent(e,o)&&r.set(`snapToLines`,!1),r.alt(e,o,[`auto`]),a.length===2&&r.alt(`lineAlign`,a[1],[`start`,`center`,`end`]);break;case`position`:a=t.split(`,`),r.percent(e,a[0]),a.length===2&&r.alt(`positionAlign`,a[1],[`start`,`center`,`end`]);break;case`size`:r.percent(e,t);break;case`align`:r.alt(e,t,[`start`,`center`,`end`,`left`,`right`]);break}},/:/,/\s/),t.region=r.get(`region`,null),t.vertical=r.get(`vertical`,``);try{t.line=r.get(`line`,`auto`)}catch{}t.lineAlign=r.get(`lineAlign`,`start`),t.snapToLines=r.get(`snapToLines`,!0),t.size=r.get(`size`,100);try{t.align=r.get(`align`,`center`)}catch{t.align=r.get(`align`,`middle`)}try{t.position=r.get(`position`,`auto`)}catch{t.position=r.get(`position`,{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=r.get(`positionAlign`,{start:`start`,left:`start`,center:`center`,middle:`center`,end:`end`,right:`end`},t.align)}function u(){e=e.replace(/^\s+/,``)}if(u(),t.startTime=c(),u(),e.substr(0,3)!==`-->`)throw new i(i.Errors.BadTimeStamp,`Malformed time stamp (time stamps must be separated by '-->'): `+r);e=e.substr(3),u(),t.endTime=c(),u(),l(e,t)}var u=n.createElement&&n.createElement(`textarea`),d={c:`span`,i:`i`,b:`b`,u:`u`,ruby:`ruby`,rt:`rt`,v:`span`,lang:`span`},f={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)`},p={v:`title`,lang:`lang`},m={rt:`ruby`};function h(e,t){function n(){if(!t)return null;function e(e){return t=t.substr(e.length),e}var n=t.match(/^([^<]*)(<[^>]*>?)?/);return e(n[1]?n[1]:n[2])}function r(e){return u.innerHTML=e,e=u.textContent,u.textContent=``,e}function i(e,t){return!m[t.localName]||m[t.localName]===e.localName}function o(t,n){var r=d[t];if(!r)return null;var i=e.document.createElement(r),a=p[t];return a&&n&&(i[a]=n.trim()),i}for(var s=e.document.createElement(`div`),c=s,l,h=[];(l=n())!==null;){if(l[0]===`<`){if(l[1]===`/`){h.length&&h[h.length-1]===l.substr(2).replace(`>`,``)&&(h.pop(),c=c.parentNode);continue}var g=a(l.substr(1,l.length-2)),_;if(g){_=e.document.createProcessingInstruction(`timestamp`,g),c.appendChild(_);continue}var v=l.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!v||(_=o(v[1],v[3]),!_)||!i(c,_))continue;if(v[2]){var y=v[2].split(`.`);y.forEach(function(e){var t=/^bg_/.test(e),n=t?e.slice(3):e;if(f.hasOwnProperty(n)){var r=t?`background-color`:`color`,i=f[n];_.style[r]=i}}),_.className=y.join(` `)}h.push(v[1]),c.appendChild(_),c=_;continue}c.appendChild(e.document.createTextNode(r(l)))}return s}var g=[[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 _(e){for(var t=0;t<g.length;t++){var n=g[t];if(e>=n[0]&&e<=n[1])return!0}return!1}function v(e){var t=[],n=``,r;if(!e||!e.childNodes)return`ltr`;function i(e,t){for(var n=t.childNodes.length-1;n>=0;n--)e.push(t.childNodes[n])}function a(e){if(!e||!e.length)return null;var t=e.pop(),n=t.textContent||t.innerText;if(n){var r=n.match(/^.*(\n|\r)/);return r?(e.length=0,r[0]):n}if(t.tagName===`ruby`)return a(e);if(t.childNodes)return i(e,t),a(e)}for(i(t,e);n=a(t);)for(var o=0;o<n.length;o++)if(r=n.charCodeAt(o),_(r))return`rtl`;return`ltr`}function y(e){if(typeof e.line==`number`&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,n=t.textTrackList,r=0,i=0;i<n.length&&n[i]!==t;i++)n[i].mode===`showing`&&r++;return++r*-1}function b(){}b.prototype.applyStyles=function(e,t){for(var n in t||=this.div,e)e.hasOwnProperty(n)&&(t.style[n]=e[n])},b.prototype.formatStyle=function(e,t){return e===0?0:e+t};function x(e,t,n){b.call(this),this.cue=t,this.cueDiv=h(e,t.text);var r={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:t.vertical===``?`horizontal-tb`:t.vertical===`lr`?`vertical-lr`:`vertical-rl`,unicodeBidi:`plaintext`};this.applyStyles(r,this.cueDiv),this.div=e.document.createElement(`div`),r={direction:v(this.cueDiv),writingMode:t.vertical===``?`horizontal-tb`:t.vertical===`lr`?`vertical-lr`:`vertical-rl`,unicodeBidi:`plaintext`,textAlign:t.align===`middle`?`center`:t.align,font:n.font,whiteSpace:`pre-line`,position:`absolute`},this.applyStyles(r),this.div.appendChild(this.cueDiv);var i=0;switch(t.positionAlign){case`start`:case`line-left`:i=t.position;break;case`center`:i=t.position-t.size/2;break;case`end`:case`line-right`:i=t.position-t.size;break}t.vertical===``?this.applyStyles({left:this.formatStyle(i,`%`),width:this.formatStyle(t.size,`%`)}):this.applyStyles({top:this.formatStyle(i,`%`),height:this.formatStyle(t.size,`%`)}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,`px`),bottom:this.formatStyle(e.bottom,`px`),left:this.formatStyle(e.left,`px`),right:this.formatStyle(e.right,`px`),height:this.formatStyle(e.height,`px`),width:this.formatStyle(e.width,`px`)})}}x.prototype=r(b.prototype),x.prototype.constructor=x;function S(e){var t,n,r,i;if(e.div){n=e.div.offsetHeight,r=e.div.offsetWidth,i=e.div.offsetTop;var a=(a=e.div.childNodes)&&(a=a[0])&&a.getClientRects&&a.getClientRects();e=e.div.getBoundingClientRect(),t=a?Math.max(a[0]&&a[0].height||0,e.height/a.length):0}this.left=e.left,this.right=e.right,this.top=e.top||i,this.height=e.height||n,this.bottom=e.bottom||i+(e.height||n),this.width=e.width||r,this.lineHeight=t===void 0?e.lineHeight:t}S.prototype.move=function(e,t){switch(t=t===void 0?this.lineHeight:t,e){case`+x`:this.left+=t,this.right+=t;break;case`-x`:this.left-=t,this.right-=t;break;case`+y`:this.top+=t,this.bottom+=t;break;case`-y`:this.top-=t,this.bottom-=t;break}},S.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},S.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},S.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},S.prototype.overlapsOppositeAxis=function(e,t){switch(t){case`+x`:return this.left<e.left;case`-x`:return this.right>e.right;case`+y`:return this.top<e.top;case`-y`:return this.bottom>e.bottom}},S.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},S.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},S.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,n=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e,{left:e.left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||n}};function C(e,t,n,r){function i(e,t){for(var i,a=new S(e),o=1,s=0;s<t.length;s++){for(;e.overlapsOppositeAxis(n,t[s])||e.within(n)&&e.overlapsAny(r);)e.move(t[s]);if(e.within(n))return e;var c=e.intersectPercentage(n);o>c&&(i=new S(e),o=c),e=new S(a)}return i||a}var a=new S(t),o=t.cue,s=y(o),c=[];if(o.snapToLines){var l;switch(o.vertical){case``:c=[`+y`,`-y`],l=`height`;break;case`rl`:c=[`+x`,`-x`],l=`width`;break;case`lr`:c=[`-x`,`+x`],l=`width`;break}var u=a.lineHeight,d=u*Math.round(s),f=n[l]+u,p=c[0];Math.abs(d)>f&&(d=d<0?-1:1,d*=Math.ceil(f/u)*u),s<0&&(d+=o.vertical===``?n.height:n.width,c=c.reverse()),a.move(p,d)}else{var m=a.lineHeight/n.height*100;switch(o.lineAlign){case`center`:s-=m/2;break;case`end`:s-=m;break}switch(o.vertical){case``:t.applyStyles({top:t.formatStyle(s,`%`)});break;case`rl`:t.applyStyles({left:t.formatStyle(s,`%`)});break;case`lr`:t.applyStyles({right:t.formatStyle(s,`%`)});break}c=[`+y`,`-x`,`+x`,`-y`],a=new S(t)}var h=i(a,c);t.move(h.toCSSCompatValues(n))}function w(){}w.StringDecoder=function(){return{decode:function(e){if(!e)return``;if(typeof e!=`string`)throw Error(`Error - expected string data.`);return decodeURIComponent(encodeURIComponent(e))}}},w.convertCueToDOMTree=function(e,t){return!e||!t?null:h(e,t)};var T=.05,E=`sans-serif`,ee=`1.5%`;w.processCues=function(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var r=e.document.createElement(`div`);r.style.position=`absolute`,r.style.left=`0`,r.style.right=`0`,r.style.top=`0`,r.style.bottom=`0`,r.style.margin=ee,n.appendChild(r);function i(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}if(!i(t)){for(var a=0;a<t.length;a++)r.appendChild(t[a].displayState);return}var o=[],s=S.getSimpleBoxPosition(r),c={font:Math.round(s.height*T*100)/100+`px `+E};(function(){for(var n,i,a=0;a<t.length;a++)i=t[a],n=new x(e,i,c),r.appendChild(n.div),C(e,n,s,o),i.displayState=n.div,o.push(S.getSimpleBoxPosition(n))})()},w.Parser=function(e,t,n){n||(n=t,t={}),t||={},this.window=e,this.vttjs=t,this.state=`INITIAL`,this.buffer=``,this.decoder=n||new TextDecoder(`utf8`),this.regionList=[]},w.Parser.prototype={reportOrThrowError:function(e){if(e instanceof i)this.onparsingerror&&this.onparsingerror(e);else throw e},parse:function(e){var t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function n(){for(var e=t.buffer,n=0;n<e.length&&e[n]!==`\r`&&e[n]!==`
4
+ `;)++n;var r=e.substr(0,n);return e[n]===`\r`&&++n,e[n]===`
5
+ `&&++n,t.buffer=e.substr(n),r}function r(e){var n=new o;if(s(e,function(e,t){switch(e){case`id`:n.set(e,t);break;case`width`:n.percent(e,t);break;case`lines`:n.integer(e,t);break;case`regionanchor`:case`viewportanchor`:var r=t.split(`,`);if(r.length!==2)break;var i=new o;if(i.percent(`x`,r[0]),i.percent(`y`,r[1]),!i.has(`x`)||!i.has(`y`))break;n.set(e+`X`,i.get(`x`)),n.set(e+`Y`,i.get(`y`));break;case`scroll`:n.alt(e,t,[`up`]);break}},/=/,/\s/),n.has(`id`)){var r=new(t.vttjs.VTTRegion||t.window.VTTRegion);r.width=n.get(`width`,100),r.lines=n.get(`lines`,3),r.regionAnchorX=n.get(`regionanchorX`,0),r.regionAnchorY=n.get(`regionanchorY`,100),r.viewportAnchorX=n.get(`viewportanchorX`,0),r.viewportAnchorY=n.get(`viewportanchorY`,100),r.scroll=n.get(`scroll`,``),t.onregion&&t.onregion(r),t.regionList.push({id:n.get(`id`),region:r})}}function l(e){var n=new o;s(e,function(e,t){switch(e){case`MPEGT`:n.integer(e+`S`,t);break;case`LOCA`:n.set(e+`L`,a(t));break}},/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:n.get(`MPEGTS`),LOCAL:n.get(`LOCAL`)})}function u(e){e.match(/X-TIMESTAMP-MAP/)?s(e,function(e,t){switch(e){case`X-TIMESTAMP-MAP`:l(t);break}},/=/):s(e,function(e,t){switch(e){case`Region`:r(t);break}},/:/)}try{var d;if(t.state===`INITIAL`){if(!/\r\n|\n/.test(t.buffer))return this;d=n();var f=d.match(/^WEBVTT([ \t].*)?$/);if(!f||!f[0])throw new i(i.Errors.BadSignature);t.state=`HEADER`}for(var p=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(p?p=!1:d=n(),t.state){case`HEADER`:/:/.test(d)?u(d):d||(t.state=`ID`);continue;case`NOTE`:d||(t.state=`ID`);continue;case`ID`:if(/^NOTE($|[ \t])/.test(d)){t.state=`NOTE`;break}if(!d)continue;t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,``);try{t.cue.align=`center`}catch{t.cue.align=`middle`}if(t.state=`CUE`,d.indexOf(`-->`)===-1){t.cue.id=d;continue}case`CUE`:try{c(d,t.cue,t.regionList)}catch(e){t.reportOrThrowError(e),t.cue=null,t.state=`BADCUE`;continue}t.state=`CUETEXT`;continue;case`CUETEXT`:var m=d.indexOf(`-->`)!==-1;if(!d||m&&(p=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state=`ID`;continue}t.cue.text&&(t.cue.text+=`
6
+ `),t.cue.text+=d.replace(/\u2028/g,`
7
7
  `).replace(/u2029/g,`
8
- `);continue;case"BADCUE":ie||(C.state="ID");continue}}}catch(J){C.reportOrThrowError(J),C.state==="CUETEXT"&&C.cue&&C.oncue&&C.oncue(C.cue),C.cue=null,C.state=C.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var b=this;try{if(b.buffer+=b.decoder.decode(),(b.cue||b.state==="HEADER")&&(b.buffer+=`
8
+ `);continue;case`BADCUE`:d||(t.state=`ID`);continue}}}catch(e){t.reportOrThrowError(e),t.state===`CUETEXT`&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state===`INITIAL`?`BADWEBVTT`:`BADCUE`}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||e.state===`HEADER`)&&(e.buffer+=`
9
9
 
10
- `,b.parse()),b.state==="INITIAL")throw new t(t.Errors.BadSignature)}catch(C){b.reportOrThrowError(C)}return b.onflush&&b.onflush(),this}},ga=U,ga}var va,Jl;function cm(){if(Jl)return va;Jl=1;var s="auto",e={"":1,lr:1,rl:1},t={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function i(a){if(typeof a!="string")return!1;var l=e[a.toLowerCase()];return l?a.toLowerCase():!1}function r(a){if(typeof a!="string")return!1;var l=t[a.toLowerCase()];return l?a.toLowerCase():!1}function n(a,l,c){this.hasBeenReset=!1;var f="",g=!1,y=a,k=l,E=c,L=null,_="",I=!0,N="auto",R="start",P="auto",$="auto",U=100,V="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return f},set:function(O){f=""+O}},pauseOnExit:{enumerable:!0,get:function(){return g},set:function(O){g=!!O}},startTime:{enumerable:!0,get:function(){return y},set:function(O){if(typeof O!="number")throw new TypeError("Start time must be set to a number.");y=O,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return k},set:function(O){if(typeof O!="number")throw new TypeError("End time must be set to a number.");k=O,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return E},set:function(O){E=""+O,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return L},set:function(O){L=O,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return _},set:function(O){var G=i(O);if(G===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");_=G,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return I},set:function(O){I=!!O,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return N},set:function(O){if(typeof O!="number"&&O!==s)throw new SyntaxError("Line: an invalid number or illegal string was specified.");N=O,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return R},set:function(O){var G=r(O);G?(R=G,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return P},set:function(O){if(O<0||O>100)throw new Error("Position must be between 0 and 100.");P=O,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return $},set:function(O){var G=r(O);G?($=G,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return U},set:function(O){if(O<0||O>100)throw new Error("Size must be between 0 and 100.");U=O,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return V},set:function(O){var G=r(O);if(!G)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");V=G,this.hasBeenReset=!0}}}),this.displayState=void 0}return n.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},va=n,va}var ya,Zl;function dm(){if(Zl)return ya;Zl=1;var s={"":!0,up:!0};function e(r){if(typeof r!="string")return!1;var n=s[r.toLowerCase()];return n?r.toLowerCase():!1}function t(r){return typeof r=="number"&&r>=0&&r<=100}function i(){var r=100,n=3,a=0,l=100,c=0,f=100,g="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return r},set:function(y){if(!t(y))throw new Error("Width must be between 0 and 100.");r=y}},lines:{enumerable:!0,get:function(){return n},set:function(y){if(typeof y!="number")throw new TypeError("Lines must be set to a number.");n=y}},regionAnchorY:{enumerable:!0,get:function(){return l},set:function(y){if(!t(y))throw new Error("RegionAnchorX must be between 0 and 100.");l=y}},regionAnchorX:{enumerable:!0,get:function(){return a},set:function(y){if(!t(y))throw new Error("RegionAnchorY must be between 0 and 100.");a=y}},viewportAnchorY:{enumerable:!0,get:function(){return f},set:function(y){if(!t(y))throw new Error("ViewportAnchorY must be between 0 and 100.");f=y}},viewportAnchorX:{enumerable:!0,get:function(){return c},set:function(y){if(!t(y))throw new Error("ViewportAnchorX must be between 0 and 100.");c=y}},scroll:{enumerable:!0,get:function(){return g},set:function(y){var k=e(y);k===!1?console.warn("Scroll: an invalid or illegal string was specified."):g=k}}})}return ya=i,ya}var eu;function hm(){if(eu)return ma.exports;eu=1;var s=En(),e=ma.exports={WebVTT:um(),VTTCue:cm(),VTTRegion:dm()};s.vttjs=e,s.WebVTT=e.WebVTT;var t=e.VTTCue,i=e.VTTRegion,r=s.VTTCue,n=s.VTTRegion;return e.shim=function(){s.VTTCue=t,s.VTTRegion=i},e.restore=function(){s.VTTCue=r,s.VTTRegion=n},s.VTTCue||e.shim(),ma.exports}var fm=hm();const tu=Ve.getDefaultExportFromCjs(fm);function Ue(){return Ue=Object.assign?Object.assign.bind():function(s){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(s[i]=t[i])}return s},Ue.apply(null,arguments)}var iu="https://example.com",An=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=w.location&&w.location.href||"");var i=/^\/\//.test(e),r=!w.location&&!/\/\//i.test(e);e=new w.URL(e,w.location||iu);var n=new URL(t,e);return r?n.href.slice(iu.length):i?n.href.slice(n.protocol.length):n.href},go=(function(){function s(){this.listeners={}}var e=s.prototype;return e.on=function(i,r){this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push(r)},e.off=function(i,r){if(!this.listeners[i])return!1;var n=this.listeners[i].indexOf(r);return this.listeners[i]=this.listeners[i].slice(0),this.listeners[i].splice(n,1),n>-1},e.trigger=function(i){var r=this.listeners[i];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),c=r.length,f=0;f<c;++f)r[f].apply(this,l)},e.dispose=function(){this.listeners={}},e.pipe=function(i){this.on("data",function(r){i.push(r)})},s})(),pm=function(e){return w.atob?w.atob(e):Buffer.from(e,"base64").toString("binary")};function bc(s){for(var e=pm(s),t=new Uint8Array(e.length),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}class mm extends go{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(`
10
+ `,e.parse()),e.state===`INITIAL`)throw new i(i.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},t.exports=w})),_=e.r(((e,t)=>{var n=`auto`,r={"":1,lr:1,rl:1},i={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function a(e){return typeof e==`string`&&r[e.toLowerCase()]?e.toLowerCase():!1}function o(e){return typeof e==`string`&&i[e.toLowerCase()]?e.toLowerCase():!1}function s(e,t,r){this.hasBeenReset=!1;var i=``,s=!1,c=e,l=t,u=r,d=null,f=``,p=!0,m=`auto`,h=`start`,g=`auto`,_=`auto`,v=100,y=`center`;Object.defineProperties(this,{id:{enumerable:!0,get:function(){return i},set:function(e){i=``+e}},pauseOnExit:{enumerable:!0,get:function(){return s},set:function(e){s=!!e}},startTime:{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`)throw TypeError(`Start time must be set to a number.`);c=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return l},set:function(e){if(typeof e!=`number`)throw TypeError(`End time must be set to a number.`);l=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return u},set:function(e){u=``+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return d},set:function(e){d=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return f},set:function(e){var t=a(e);if(t===!1)throw SyntaxError(`Vertical: an invalid or illegal direction string was specified.`);f=t,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return p},set:function(e){p=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return m},set:function(e){if(typeof e!=`number`&&e!==n)throw SyntaxError(`Line: an invalid number or illegal string was specified.`);m=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return h},set:function(e){var t=o(e);t?(h=t,this.hasBeenReset=!0):console.warn(`lineAlign: an invalid or illegal string was specified.`)}},position:{enumerable:!0,get:function(){return g},set:function(e){if(e<0||e>100)throw Error(`Position must be between 0 and 100.`);g=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return _},set:function(e){var t=o(e);t?(_=t,this.hasBeenReset=!0):console.warn(`positionAlign: an invalid or illegal string was specified.`)}},size:{enumerable:!0,get:function(){return v},set:function(e){if(e<0||e>100)throw Error(`Size must be between 0 and 100.`);v=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return y},set:function(e){var t=o(e);if(!t)throw SyntaxError(`align: an invalid or illegal alignment string was specified.`);y=t,this.hasBeenReset=!0}}}),this.displayState=void 0}s.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},t.exports=s})),v=e.r(((e,t)=>{var n={"":!0,up:!0};function r(e){return typeof e==`string`&&n[e.toLowerCase()]?e.toLowerCase():!1}function i(e){return typeof e==`number`&&e>=0&&e<=100}function a(){var e=100,t=3,n=0,a=100,o=0,s=100,c=``;Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!i(t))throw Error(`Width must be between 0 and 100.`);e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if(typeof e!=`number`)throw TypeError(`Lines must be set to a number.`);t=e}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!i(e))throw Error(`RegionAnchorX must be between 0 and 100.`);a=e}},regionAnchorX:{enumerable:!0,get:function(){return n},set:function(e){if(!i(e))throw Error(`RegionAnchorY must be between 0 and 100.`);n=e}},viewportAnchorY:{enumerable:!0,get:function(){return s},set:function(e){if(!i(e))throw Error(`ViewportAnchorY must be between 0 and 100.`);s=e}},viewportAnchorX:{enumerable:!0,get:function(){return o},set:function(e){if(!i(e))throw Error(`ViewportAnchorX must be between 0 and 100.`);o=e}},scroll:{enumerable:!0,get:function(){return c},set:function(e){var t=r(e);t===!1?console.warn(`Scroll: an invalid or illegal string was specified.`):c=t}}})}t.exports=a})),y=e.r(((e,t)=>{var n=s(),r=t.exports={WebVTT:g(),VTTCue:_(),VTTRegion:v()};n.vttjs=r,n.WebVTT=r.WebVTT;var i=r.VTTCue,a=r.VTTRegion,o=n.VTTCue,c=n.VTTRegion;r.shim=function(){n.VTTCue=i,n.VTTRegion=a},r.restore=function(){n.VTTCue=o,n.VTTRegion=c},n.VTTCue||r.shim()})),b=e.i(y()),x=e.i(h()),S=e.i(l()),C=e.i(s());function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w.apply(null,arguments)}var T=`https://example.com`,E=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=C.default.location&&C.default.location.href||``);var n=/^\/\//.test(e),r=!C.default.location&&!/\/\//i.test(e);e=new C.default.URL(e,C.default.location||T);var i=new URL(t,e);return r?i.href.slice(T.length):n?i.href.slice(i.protocol.length):i.href},ee=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(arguments.length===2)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,o=0;o<a;++o)t[o].apply(this,i)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on(`data`,function(t){e.push(t)})},e}(),D=function(e){return C.default.atob?C.default.atob(e):Buffer.from(e,`base64`).toString(`binary`)};function O(e){for(var t=D(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}var k=class extends ee{constructor(){super(),this.buffer=``}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(`
11
11
  `);t>-1;t=this.buffer.indexOf(`
12
- `))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const gm=" ",_a=function(s){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(s||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},vm=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},ot=function(s){const e={};if(!s)return e;const t=s.split(vm());let i=t.length,r;for(;i--;)t[i]!==""&&(r=/([^=]*)=(.*)/.exec(t[i]).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},su=s=>{const e=s.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};class ym extends go{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;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){i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),this.trigger("data",i);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(n),t){i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(n),t){i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(n),t){i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),this.trigger("data",i);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(n),t){i=Ue(_a(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",i);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(n),t){i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(n),t){if(i={type:"tag",tagType:"map"},t[1]){const a=ot(t[1]);a.URI&&(i.uri=a.URI),a.BYTERANGE&&(i.byterange=_a(a.BYTERANGE))}this.trigger("data",i);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(n),t){i={type:"tag",tagType:"stream-inf"},t[1]&&(i.attributes=ot(t[1]),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=su(i.attributes.RESOLUTION)),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))),this.trigger("data",i);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(n),t){i={type:"tag",tagType:"media"},t[1]&&(i.attributes=ot(t[1])),this.trigger("data",i);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){i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(n),t){i={type:"tag",tagType:"key"},t[1]&&(i.attributes=ot(t[1]),i.attributes.IV&&(i.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),this.trigger("data",i);return}if(t=/^#EXT-X-START:(.*)$/.exec(n),t){i={type:"tag",tagType:"start"},t[1]&&(i.attributes=ot(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),this.trigger("data",i);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(n),t){i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(n),t){i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(n),t){i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-SKIP:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"skip"},i.attributes=ot(t[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(gm)),this.trigger("data",i);return}if(t=/^#EXT-X-PART:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"part"},i.attributes=ot(t[1]),["DURATION"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=parseFloat(i.attributes[a]))}),["INDEPENDENT","GAP"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=/YES/.test(i.attributes[a]))}),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=_a(i.attributes.BYTERANGE)),this.trigger("data",i);return}if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"server-control"},i.attributes=ot(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=parseFloat(i.attributes[a]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=/YES/.test(i.attributes[a]))}),this.trigger("data",i);return}if(t=/^#EXT-X-PART-INF:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"part-inf"},i.attributes=ot(t[1]),["PART-TARGET"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=parseFloat(i.attributes[a]))}),this.trigger("data",i);return}if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"preload-hint"},i.attributes=ot(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(a){if(i.attributes.hasOwnProperty(a)){i.attributes[a]=parseInt(i.attributes[a],10);const l=a==="BYTERANGE-LENGTH"?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[l]=i.attributes[a],delete i.attributes[a]}}),this.trigger("data",i);return}if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"rendition-report"},i.attributes=ot(t[1]),["LAST-MSN","LAST-PART"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=parseInt(i.attributes[a],10))}),this.trigger("data",i);return}if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"daterange"},i.attributes=ot(t[1]),["ID","CLASS"].forEach(function(l){i.attributes.hasOwnProperty(l)&&(i.attributes[l]=String(i.attributes[l]))}),["START-DATE","END-DATE"].forEach(function(l){i.attributes.hasOwnProperty(l)&&(i.attributes[l]=new Date(i.attributes[l]))}),["DURATION","PLANNED-DURATION"].forEach(function(l){i.attributes.hasOwnProperty(l)&&(i.attributes[l]=parseFloat(i.attributes[l]))}),["END-ON-NEXT"].forEach(function(l){i.attributes.hasOwnProperty(l)&&(i.attributes[l]=/YES/i.test(i.attributes[l]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(l){i.attributes.hasOwnProperty(l)&&(i.attributes[l]=i.attributes[l].toString(16))});const a=/^X-([A-Z]+-)+[A-Z]+$/;for(const l in i.attributes){if(!a.test(l))continue;const c=/[0-9A-Fa-f]{6}/g.test(i.attributes[l]),f=/^\d+(\.\d+)?$/.test(i.attributes[l]);i.attributes[l]=c?i.attributes[l].toString(16):f?parseFloat(i.attributes[l]):String(i.attributes[l])}this.trigger("data",i);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){i={type:"tag",tagType:"content-steering"},i.attributes=ot(t[1]),this.trigger("data",i);return}if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(n),t){i={type:"tag",tagType:"i-frame-playlist"},i.attributes=ot(t[1]),i.attributes.URI&&(i.uri=i.attributes.URI),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=su(i.attributes.RESOLUTION)),i.attributes["AVERAGE-BANDWIDTH"]&&(i.attributes["AVERAGE-BANDWIDTH"]=parseInt(i.attributes["AVERAGE-BANDWIDTH"],10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),this.trigger("data",i);return}if(t=/^#EXT-X-DEFINE:(.*)$/.exec(n),t){i={type:"tag",tagType:"define"},i.attributes=ot(t[1]),this.trigger("data",i);return}this.trigger("data",{type:"tag",data:n.slice(4)})})}addParser({expression:e,customType:t,dataParser:i,segment:r}){typeof i!="function"&&(i=n=>n),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:i(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const i=r=>e.test(r)?t(r):r;this.tagMappers.push(i)}}const _m=s=>s.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),gi=function(s){const e={};return Object.keys(s).forEach(function(t){e[_m(t)]=s[t]}),e},ba=function(s){const{serverControl:e,targetDuration:t,partTargetDuration:i}=s;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",l=t&&t*3,c=i&&i*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),i&&!e.hasOwnProperty(a)&&(e[a]=i*3,this.trigger("info",{message:`${r} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[a]}).`})),i&&e[a]<c&&(this.trigger("warn",{message:`${r} clamping PART-HOLD-BACK (${e[a]}) to partTargetDuration * 2 (${c}).`}),e[a]=c)};class bm extends go{constructor(e={}){super(),this.lineStream=new mm,this.parseStream=new ym,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,i=[];let r={},n,a,l=!1;const c=function(){},f={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},g="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let y=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let k=0,E=0;const L={};this.on("end",()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&n&&(r.map=n),!r.key&&a&&(r.key=a),!r.timeline&&typeof y=="number"&&(r.timeline=y),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(_){let I,N;if(t.manifest.definitions){for(const R in t.manifest.definitions)if(_.uri&&(_.uri=_.uri.replace(`{$${R}}`,t.manifest.definitions[R])),_.attributes)for(const P in _.attributes)typeof _.attributes[P]=="string"&&(_.attributes[P]=_.attributes[P].replace(`{$${R}}`,t.manifest.definitions[R]))}({tag(){({version(){_.version&&(this.manifest.version=_.version)},"allow-cache"(){this.manifest.allowCache=_.allowed,"allowed"in _||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const R={};"length"in _&&(r.byterange=R,R.length=_.length,"offset"in _||(_.offset=k)),"offset"in _&&(r.byterange=R,R.offset=_.offset),k=R.offset+R.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"})),_.title&&(r.title=_.title),_.duration>0&&(r.duration=_.duration),_.duration===0&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(!_.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(_.attributes.METHOD==="NONE"){a=null;return}if(!_.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(_.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:_.attributes};return}if(_.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:_.attributes.URI};return}if(_.attributes.KEYFORMAT===g){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(_.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(_.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),_.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(_.attributes.KEYID&&_.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:_.attributes.KEYFORMAT,keyId:_.attributes.KEYID.substring(2)},pssh:bc(_.attributes.URI.split(",")[1])};return}_.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:_.attributes.METHOD||"AES-128",uri:_.attributes.URI},typeof _.attributes.IV<"u"&&(a.iv=_.attributes.IV)},"media-sequence"(){if(!isFinite(_.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+_.number});return}this.manifest.mediaSequence=_.number},"discontinuity-sequence"(){if(!isFinite(_.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+_.number});return}this.manifest.discontinuitySequence=_.number,y=_.number},"playlist-type"(){if(!/VOD|EVENT/.test(_.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+_.playlist});return}this.manifest.playlistType=_.playlistType},map(){n={},_.uri&&(n.uri=_.uri),_.byterange&&(n.byterange=_.byterange),a&&(n.key=a)},"stream-inf"(){if(this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||f,!_.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}r.attributes||(r.attributes={}),Ue(r.attributes,_.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||f,!(_.attributes&&_.attributes.TYPE&&_.attributes["GROUP-ID"]&&_.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const R=this.manifest.mediaGroups[_.attributes.TYPE];R[_.attributes["GROUP-ID"]]=R[_.attributes["GROUP-ID"]]||{},I=R[_.attributes["GROUP-ID"]],N={default:/yes/i.test(_.attributes.DEFAULT)},N.default?N.autoselect=!0:N.autoselect=/yes/i.test(_.attributes.AUTOSELECT),_.attributes.LANGUAGE&&(N.language=_.attributes.LANGUAGE),_.attributes.URI&&(N.uri=_.attributes.URI),_.attributes["INSTREAM-ID"]&&(N.instreamId=_.attributes["INSTREAM-ID"]),_.attributes.CHARACTERISTICS&&(N.characteristics=_.attributes.CHARACTERISTICS),_.attributes.FORCED&&(N.forced=/yes/i.test(_.attributes.FORCED)),I[_.attributes.NAME]=N},discontinuity(){y+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=_.dateTimeString,this.manifest.dateTimeObject=_.dateTimeObject),r.dateTimeString=_.dateTimeString,r.dateTimeObject=_.dateTimeObject;const{lastProgramDateTime:R}=this;this.lastProgramDateTime=new Date(_.dateTimeString).getTime(),R===null&&this.manifest.segments.reduceRight((P,$)=>($.programDateTime=P-$.duration*1e3,$.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(_.duration)||_.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+_.duration});return}this.manifest.targetDuration=_.duration,ba.call(this,this.manifest)},start(){if(!_.attributes||isNaN(_.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:_.attributes["TIME-OFFSET"],precise:_.attributes.PRECISE}},"cue-out"(){r.cueOut=_.data},"cue-out-cont"(){r.cueOutCont=_.data},"cue-in"(){r.cueIn=_.data},skip(){this.manifest.skip=gi(_.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",_.attributes,["SKIPPED-SEGMENTS"])},part(){l=!0;const R=this.manifest.segments.length,P=gi(_.attributes);r.parts=r.parts||[],r.parts.push(P),P.byterange&&(P.byterange.hasOwnProperty("offset")||(P.byterange.offset=E),E=P.byterange.offset+P.byterange.length);const $=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${$} for segment #${R}`,_.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((U,V)=>{U.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${V} lacks required attribute(s): LAST-PART`})})},"server-control"(){const R=this.manifest.serverControl=gi(_.attributes);R.hasOwnProperty("canBlockReload")||(R.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),ba.call(this,this.manifest),R.canSkipDateranges&&!R.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 R=this.manifest.segments.length,P=gi(_.attributes),$=P.type&&P.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(P),P.byterange&&(P.byterange.hasOwnProperty("offset")||(P.byterange.offset=$?E:0,$&&(E=P.byterange.offset+P.byterange.length)));const U=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${U} for segment #${R}`,_.attributes,["TYPE","URI"]),!!P.type)for(let V=0;V<r.preloadHints.length-1;V++){const O=r.preloadHints[V];O.type&&O.type===P.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${U} for segment #${R} has the same TYPE ${P.type} as preload hint #${V}`})}},"rendition-report"(){const R=gi(_.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(R);const P=this.manifest.renditionReports.length-1,$=["LAST-MSN","URI"];l&&$.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${P}`,_.attributes,$)},"part-inf"(){this.manifest.partInf=gi(_.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",_.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),ba.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(gi(_.attributes));const R=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${R}`,_.attributes,["ID","START-DATE"]);const P=this.manifest.dateRanges[R];P.endDate&&P.startDate&&new Date(P.endDate)<new Date(P.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),P.duration&&P.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),P.plannedDuration&&P.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const $=!!P.endOnNext;if($&&!P.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),$&&(P.duration||P.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),P.duration&&P.endDate){const V=P.startDate.getTime()+P.duration*1e3;this.manifest.dateRanges[R].endDate=new Date(V)}if(!L[P.id])L[P.id]=P;else{for(const V in L[P.id])if(P[V]&&JSON.stringify(L[P.id][V])!==JSON.stringify(P[V])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const U=this.manifest.dateRanges.findIndex(V=>V.id===P.id);this.manifest.dateRanges[U]=Ue(this.manifest.dateRanges[U],P),L[P.id]=Ue(L[P.id],P),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=gi(_.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",_.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const R=(P,$)=>{if(P in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${P}`});return}this.manifest.definitions[P]=$};if("QUERYPARAM"in _.attributes){if("NAME"in _.attributes||"IMPORT"in _.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const P=this.params.get(_.attributes.QUERYPARAM);if(!P){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${_.attributes.QUERYPARAM}`});return}R(_.attributes.QUERYPARAM,decodeURIComponent(P));return}if("NAME"in _.attributes){if("IMPORT"in _.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in _.attributes)||typeof _.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${_.attributes.NAME}`});return}R(_.attributes.NAME,_.attributes.VALUE);return}if("IMPORT"in _.attributes){if(!this.mainDefinitions[_.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${_.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}R(_.attributes.IMPORT,this.mainDefinitions[_.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:_.attributes,uri:_.uri,timeline:y}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",_.attributes,["BANDWIDTH","URI"])}}[_.tagType]||c).call(t)},uri(){r.uri=_.uri,i.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=y,n&&(r.map=n),E=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){_.segment?(r.custom=r.custom||{},r.custom[_.customType]=_.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[_.customType]=_.data)}})[_.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,i){const r=[];i.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(`
13
- `),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 Ni={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^/},Tm=["video","audio","text"],ru=["Video","Audio","Text"],Tc=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,i,r){var n=("00"+Number(i).toString(16)).slice(-2),a=("00"+Number(r).toString(16)).slice(-2);return"avc1."+n+"00"+a})},Ht=function(e){e===void 0&&(e="");var t=e.split(","),i=[];return t.forEach(function(r){r=r.trim();var n;Tm.forEach(function(a){var l=Ni[a].exec(r.toLowerCase());if(!(!l||l.length<=1)){n=a;var c=r.substring(0,l[1].length),f=r.replace(c,"");i.push({type:c,details:f,mediaType:a})}}),n||i.push({type:r,details:"",mediaType:"unknown"})}),i},xm=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var r in i){var n=i[r];if(n.default&&n.playlists)return Ht(n.playlists[0].attributes.CODECS)}return null},xc=function(e){return e===void 0&&(e=""),Ni.audio.test(e.trim().toLowerCase())},Sm=function(e){return e===void 0&&(e=""),Ni.text.test(e.trim().toLowerCase())},ds=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return Tc(n.trim())}),i="video";t.length===1&&xc(t[0])?i="audio":t.length===1&&Sm(t[0])&&(i="application");var r="mp4";return t.every(function(n){return Ni.mp4.test(n)})?r="mp4":t.every(function(n){return Ni.webm.test(n)})?r="webm":t.every(function(n){return Ni.ogg.test(n)})&&(r="ogg"),i+"/"+r+';codecs="'+e+'"'}},sr=function(e,t){return e===void 0&&(e=""),t===void 0&&(t=!1),w.MediaSource&&w.MediaSource.isTypeSupported&&w.MediaSource.isTypeSupported(ds(e))||t&&w.ManagedMediaSource&&w.ManagedMediaSource.isTypeSupported&&w.ManagedMediaSource.isTypeSupported(ds(e))||!1},Ta=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var i=0;i<ru.length;i++){var r=ru[i];if(Ni["muxer"+r].test(t))return!0}return!1})},nu="mp4a.40.2",Cm="avc1.4d400d",Em=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,Am=/^application\/dash\+xml/i,Sc=function(e){return Em.test(e)?"hls":Am.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},wm=function(e){return e.toString(2).length},Dm=function(e){return Math.ceil(wm(e)/8)},Cc=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},km=function(e){return Cc(e)},ue=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!km(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=w.BigInt||Number,qa=[Je("0x1"),Je("0x100"),Je("0x10000"),Je("0x1000000"),Je("0x100000000"),Je("0x10000000000"),Je("0x1000000000000"),Je("0x100000000000000"),Je("0x10000000000000000")];(function(){var s=new Uint16Array([65484]),e=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var jm=function(e,t){var i=t===void 0?{}:t,r=i.signed,n=r===void 0?!1:r,a=i.le,l=a===void 0?!1:a;e=ue(e);var c=l?"reduce":"reduceRight",f=e[c]?e[c]:Array.prototype[c],g=f.call(e,function(k,E,L){var _=l?L:Math.abs(L+1-e.length);return k+Je(E)*qa[_]},Je(0));if(n){var y=qa[e.length]/Je(2)-Je(1);g=Je(g),g>y&&(g-=y,g-=y,g-=Je(2))}return Number(g)},Im=function(e,t){var i={},r=i.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=Dm(e),l=new Uint8Array(new ArrayBuffer(a)),c=0;c<a;c++){var f=n?c:Math.abs(c+1-l.length);l[f]=Number(e/qa[c]&Je(255)),e<0&&(l[f]=Math.abs(~l[f]),l[f]-=c===0?1:2)}return l},Ec=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 i=new Uint8Array(e.length),r=0;r<e.length;r++)i[r]=e.charCodeAt(r);return i},Pm=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(t=t.filter(function(l){return l&&(l.byteLength||l.length)&&typeof l!="string"}),t.length<=1)return ue(t[0]);var r=t.reduce(function(l,c,f){return l+(c.byteLength||c.length)},0),n=new Uint8Array(r),a=0;return t.forEach(function(l){l=ue(l),n.set(l,a),a+=l.byteLength}),n},Le=function(e,t,i){var r=i===void 0?{}:i,n=r.offset,a=n===void 0?0:n,l=r.mask,c=l===void 0?[]:l;e=ue(e),t=ue(t);var f=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&f.call(t,function(g,y){var k=c[y]?c[y]&e[a+y]:e[a+y];return g===k})},Lm=function(e,t,i){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];i(l,r,n,a)}})},Ys={},ti={},Ii={},au;function wn(){if(au)return Ii;au=1;function s(n,a,l){if(l===void 0&&(l=Array.prototype),n&&typeof l.find=="function")return l.find.call(n,a);for(var c=0;c<n.length;c++)if(Object.prototype.hasOwnProperty.call(n,c)){var f=n[c];if(a.call(void 0,f,c,n))return f}}function e(n,a){return a===void 0&&(a=Object),a&&typeof a.freeze=="function"?a.freeze(n):n}function t(n,a){if(n===null||typeof n!="object")throw new TypeError("target is not an object");for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(n[l]=a[l]);return n}var i=e({HTML:"text/html",isHTML:function(n){return n===i.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),r=e({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(n){return n===r.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});return Ii.assign=t,Ii.find=s,Ii.freeze=e,Ii.MIME_TYPE=i,Ii.NAMESPACE=r,Ii}var ou;function Ac(){if(ou)return ti;ou=1;var s=wn(),e=s.find,t=s.NAMESPACE;function i(v){return v!==""}function r(v){return v?v.split(/[\t\n\f\r ]+/).filter(i):[]}function n(v,T){return v.hasOwnProperty(T)||(v[T]=!0),v}function a(v){if(!v)return[];var T=r(v);return Object.keys(T.reduce(n,{}))}function l(v){return function(T){return v&&v.indexOf(T)!==-1}}function c(v,T){for(var j in v)Object.prototype.hasOwnProperty.call(v,j)&&(T[j]=v[j])}function f(v,T){var j=v.prototype;if(!(j instanceof T)){let q=function(){};q.prototype=T.prototype,q=new q,c(j,q),v.prototype=j=q}j.constructor!=v&&(typeof v!="function"&&console.error("unknown Class:"+v),j.constructor=v)}var g={},y=g.ELEMENT_NODE=1,k=g.ATTRIBUTE_NODE=2,E=g.TEXT_NODE=3,L=g.CDATA_SECTION_NODE=4,_=g.ENTITY_REFERENCE_NODE=5,I=g.ENTITY_NODE=6,N=g.PROCESSING_INSTRUCTION_NODE=7,R=g.COMMENT_NODE=8,P=g.DOCUMENT_NODE=9,$=g.DOCUMENT_TYPE_NODE=10,U=g.DOCUMENT_FRAGMENT_NODE=11,V=g.NOTATION_NODE=12,O={},G={};O.INDEX_SIZE_ERR=(G[1]="Index size error",1),O.DOMSTRING_SIZE_ERR=(G[2]="DOMString size error",2);var b=O.HIERARCHY_REQUEST_ERR=(G[3]="Hierarchy request error",3);O.WRONG_DOCUMENT_ERR=(G[4]="Wrong document",4),O.INVALID_CHARACTER_ERR=(G[5]="Invalid character",5),O.NO_DATA_ALLOWED_ERR=(G[6]="No data allowed",6),O.NO_MODIFICATION_ALLOWED_ERR=(G[7]="No modification allowed",7);var C=O.NOT_FOUND_ERR=(G[8]="Not found",8);O.NOT_SUPPORTED_ERR=(G[9]="Not supported",9);var F=O.INUSE_ATTRIBUTE_ERR=(G[10]="Attribute in use",10);O.INVALID_STATE_ERR=(G[11]="Invalid state",11),O.SYNTAX_ERR=(G[12]="Syntax error",12),O.INVALID_MODIFICATION_ERR=(G[13]="Invalid modification",13),O.NAMESPACE_ERR=(G[14]="Invalid namespace",14),O.INVALID_ACCESS_ERR=(G[15]="Invalid access",15);function z(v,T){if(T instanceof Error)var j=T;else j=this,Error.call(this,G[v]),this.message=G[v],Error.captureStackTrace&&Error.captureStackTrace(this,z);return j.code=v,T&&(this.message=this.message+": "+T),j}z.prototype=Error.prototype,c(O,z);function H(){}H.prototype={length:0,item:function(v){return v>=0&&v<this.length?this[v]:null},toString:function(v,T){for(var j=[],q=0;q<this.length;q++)hi(this[q],j,v,T);return j.join("")},filter:function(v){return Array.prototype.filter.call(this,v)},indexOf:function(v){return Array.prototype.indexOf.call(this,v)}};function Q(v,T){this._node=v,this._refresh=T,ie(this)}function ie(v){var T=v._node._inc||v._node.ownerDocument._inc;if(v._inc!==T){var j=v._refresh(v._node);if(Sr(v,"length",j.length),!v.$$length||j.length<v.$$length)for(var q=j.length;q in v;q++)Object.prototype.hasOwnProperty.call(v,q)&&delete v[q];c(j,v),v._inc=T}}Q.prototype.item=function(v){return ie(this),this[v]||null},f(Q,H);function re(){}function Y(v,T){for(var j=v.length;j--;)if(v[j]===T)return j}function Z(v,T,j,q){if(q?T[Y(T,q)]=j:T[T.length++]=j,v){j.ownerElement=v;var ne=v.ownerDocument;ne&&(q&&Ke(ne,v,q),he(ne,v,j))}}function J(v,T,j){var q=Y(T,j);if(q>=0){for(var ne=T.length-1;q<ne;)T[q]=T[++q];if(T.length=ne,v){var de=v.ownerDocument;de&&(Ke(de,v,j),j.ownerElement=null)}}else throw new z(C,new Error(v.tagName+"@"+j))}re.prototype={length:0,item:H.prototype.item,getNamedItem:function(v){for(var T=this.length;T--;){var j=this[T];if(j.nodeName==v)return j}},setNamedItem:function(v){var T=v.ownerElement;if(T&&T!=this._ownerElement)throw new z(F);var j=this.getNamedItem(v.nodeName);return Z(this._ownerElement,this,v,j),j},setNamedItemNS:function(v){var T=v.ownerElement,j;if(T&&T!=this._ownerElement)throw new z(F);return j=this.getNamedItemNS(v.namespaceURI,v.localName),Z(this._ownerElement,this,v,j),j},removeNamedItem:function(v){var T=this.getNamedItem(v);return J(this._ownerElement,this,T),T},removeNamedItemNS:function(v,T){var j=this.getNamedItemNS(v,T);return J(this._ownerElement,this,j),j},getNamedItemNS:function(v,T){for(var j=this.length;j--;){var q=this[j];if(q.localName==T&&q.namespaceURI==v)return q}return null}};function te(){}te.prototype={hasFeature:function(v,T){return!0},createDocument:function(v,T,j){var q=new ve;if(q.implementation=this,q.childNodes=new H,q.doctype=j||null,j&&q.appendChild(j),T){var ne=q.createElementNS(v,T);q.appendChild(ne)}return q},createDocumentType:function(v,T,j){var q=new di;return q.name=v,q.nodeName=v,q.publicId=T||"",q.systemId=j||"",q}};function ee(){}ee.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(v,T){return St(this,v,T)},replaceChild:function(v,T){St(this,v,T,mt),T&&this.removeChild(T)},removeChild:function(v){return qe(this,v)},appendChild:function(v){return this.insertBefore(v,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(v){return Ps(this.ownerDocument||this,this,v)},normalize:function(){for(var v=this.firstChild;v;){var T=v.nextSibling;T&&T.nodeType==E&&v.nodeType==E?(this.removeChild(T),v.appendData(T.data)):(v.normalize(),v=T)}},isSupported:function(v,T){return this.ownerDocument.implementation.hasFeature(v,T)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(v){for(var T=this;T;){var j=T._nsMap;if(j){for(var q in j)if(Object.prototype.hasOwnProperty.call(j,q)&&j[q]===v)return q}T=T.nodeType==k?T.ownerDocument:T.parentNode}return null},lookupNamespaceURI:function(v){for(var T=this;T;){var j=T._nsMap;if(j&&Object.prototype.hasOwnProperty.call(j,v))return j[v];T=T.nodeType==k?T.ownerDocument:T.parentNode}return null},isDefaultNamespace:function(v){var T=this.lookupPrefix(v);return T==null}};function fe(v){return v=="<"&&"&lt;"||v==">"&&"&gt;"||v=="&"&&"&amp;"||v=='"'&&"&quot;"||"&#"+v.charCodeAt()+";"}c(g,ee),c(g,ee.prototype);function me(v,T){if(T(v))return!0;if(v=v.firstChild)do if(me(v,T))return!0;while(v=v.nextSibling)}function ve(){this.ownerDocument=this}function he(v,T,j){v&&v._inc++;var q=j.namespaceURI;q===t.XMLNS&&(T._nsMap[j.prefix?j.localName:""]=j.value)}function Ke(v,T,j,q){v&&v._inc++;var ne=j.namespaceURI;ne===t.XMLNS&&delete T._nsMap[j.prefix?j.localName:""]}function Ze(v,T,j){if(v&&v._inc){v._inc++;var q=T.childNodes;if(j)q[q.length++]=j;else{for(var ne=T.firstChild,de=0;ne;)q[de++]=ne,ne=ne.nextSibling;q.length=de,delete q[q.length]}}}function qe(v,T){var j=T.previousSibling,q=T.nextSibling;return j?j.nextSibling=q:v.firstChild=q,q?q.previousSibling=j:v.lastChild=j,T.parentNode=null,T.previousSibling=null,T.nextSibling=null,Ze(v.ownerDocument,v),T}function et(v){return v&&(v.nodeType===ee.DOCUMENT_NODE||v.nodeType===ee.DOCUMENT_FRAGMENT_NODE||v.nodeType===ee.ELEMENT_NODE)}function xt(v){return v&&(nt(v)||oi(v)||Qe(v)||v.nodeType===ee.DOCUMENT_FRAGMENT_NODE||v.nodeType===ee.COMMENT_NODE||v.nodeType===ee.PROCESSING_INSTRUCTION_NODE)}function Qe(v){return v&&v.nodeType===ee.DOCUMENT_TYPE_NODE}function nt(v){return v&&v.nodeType===ee.ELEMENT_NODE}function oi(v){return v&&v.nodeType===ee.TEXT_NODE}function $e(v,T){var j=v.childNodes||[];if(e(j,nt)||Qe(T))return!1;var q=e(j,Qe);return!(T&&q&&j.indexOf(q)>j.indexOf(T))}function li(v,T){var j=v.childNodes||[];function q(de){return nt(de)&&de!==T}if(e(j,q))return!1;var ne=e(j,Qe);return!(T&&ne&&j.indexOf(ne)>j.indexOf(T))}function ze(v,T,j){if(!et(v))throw new z(b,"Unexpected parent node type "+v.nodeType);if(j&&j.parentNode!==v)throw new z(C,"child not in parent");if(!xt(T)||Qe(T)&&v.nodeType!==ee.DOCUMENT_NODE)throw new z(b,"Unexpected node type "+T.nodeType+" for parent node type "+v.nodeType)}function $i(v,T,j){var q=v.childNodes||[],ne=T.childNodes||[];if(T.nodeType===ee.DOCUMENT_FRAGMENT_NODE){var de=ne.filter(nt);if(de.length>1||e(ne,oi))throw new z(b,"More than one element or text in fragment");if(de.length===1&&!$e(v,j))throw new z(b,"Element in fragment can not be inserted before doctype")}if(nt(T)&&!$e(v,j))throw new z(b,"Only one element can be added and only after doctype");if(Qe(T)){if(e(q,Qe))throw new z(b,"Only one doctype is allowed");var Ae=e(q,nt);if(j&&q.indexOf(Ae)<q.indexOf(j))throw new z(b,"Doctype can only be inserted before an element");if(!j&&Ae)throw new z(b,"Doctype can not be appended since element is present")}}function mt(v,T,j){var q=v.childNodes||[],ne=T.childNodes||[];if(T.nodeType===ee.DOCUMENT_FRAGMENT_NODE){var de=ne.filter(nt);if(de.length>1||e(ne,oi))throw new z(b,"More than one element or text in fragment");if(de.length===1&&!li(v,j))throw new z(b,"Element in fragment can not be inserted before doctype")}if(nt(T)&&!li(v,j))throw new z(b,"Only one element can be added and only after doctype");if(Qe(T)){if(e(q,function(gt){return Qe(gt)&&gt!==j}))throw new z(b,"Only one doctype is allowed");var Ae=e(q,nt);if(j&&q.indexOf(Ae)<q.indexOf(j))throw new z(b,"Doctype can only be inserted before an element")}}function St(v,T,j,q){ze(v,T,j),v.nodeType===ee.DOCUMENT_NODE&&(q||$i)(v,T,j);var ne=T.parentNode;if(ne&&ne.removeChild(T),T.nodeType===U){var de=T.firstChild;if(de==null)return T;var Ae=T.lastChild}else de=Ae=T;var tt=j?j.previousSibling:v.lastChild;de.previousSibling=tt,Ae.nextSibling=j,tt?tt.nextSibling=de:v.firstChild=de,j==null?v.lastChild=Ae:j.previousSibling=Ae;do{de.parentNode=v;var gt=v.ownerDocument||v;_e(de,gt)}while(de!==Ae&&(de=de.nextSibling));return Ze(v.ownerDocument||v,v),T.nodeType==U&&(T.firstChild=T.lastChild=null),T}function _e(v,T){if(v.ownerDocument!==T){if(v.ownerDocument=T,v.nodeType===y&&v.attributes)for(var j=0;j<v.attributes.length;j++){var q=v.attributes.item(j);q&&(q.ownerDocument=T)}for(var ne=v.firstChild;ne;)_e(ne,T),ne=ne.nextSibling}}function ke(v,T){T.parentNode&&T.parentNode.removeChild(T),T.parentNode=v,T.previousSibling=v.lastChild,T.nextSibling=null,T.previousSibling?T.previousSibling.nextSibling=T:v.firstChild=T,v.lastChild=T,Ze(v.ownerDocument,v,T);var j=v.ownerDocument||v;return _e(T,j),T}ve.prototype={nodeName:"#document",nodeType:P,doctype:null,documentElement:null,_inc:1,insertBefore:function(v,T){if(v.nodeType==U){for(var j=v.firstChild;j;){var q=j.nextSibling;this.insertBefore(j,T),j=q}return v}return St(this,v,T),_e(v,this),this.documentElement===null&&v.nodeType===y&&(this.documentElement=v),v},removeChild:function(v){return this.documentElement==v&&(this.documentElement=null),qe(this,v)},replaceChild:function(v,T){St(this,v,T,mt),_e(v,this),T&&this.removeChild(T),nt(v)&&(this.documentElement=v)},importNode:function(v,T){return xr(this,v,T)},getElementById:function(v){var T=null;return me(this.documentElement,function(j){if(j.nodeType==y&&j.getAttribute("id")==v)return T=j,!0}),T},getElementsByClassName:function(v){var T=a(v);return new Q(this,function(j){var q=[];return T.length>0&&me(j.documentElement,function(ne){if(ne!==j&&ne.nodeType===y){var de=ne.getAttribute("class");if(de){var Ae=v===de;if(!Ae){var tt=a(de);Ae=T.every(l(tt))}Ae&&q.push(ne)}}}),q})},createElement:function(v){var T=new Ie;T.ownerDocument=this,T.nodeName=v,T.tagName=v,T.localName=v,T.childNodes=new H;var j=T.attributes=new re;return j._ownerElement=T,T},createDocumentFragment:function(){var v=new Te;return v.ownerDocument=this,v.childNodes=new H,v},createTextNode:function(v){var T=new Ci;return T.ownerDocument=this,T.appendData(v),T},createComment:function(v){var T=new Ei;return T.ownerDocument=this,T.appendData(v),T},createCDATASection:function(v){var T=new ci;return T.ownerDocument=this,T.appendData(v),T},createProcessingInstruction:function(v,T){var j=new js;return j.ownerDocument=this,j.tagName=j.nodeName=j.target=v,j.nodeValue=j.data=T,j},createAttribute:function(v){var T=new ui;return T.ownerDocument=this,T.name=v,T.nodeName=v,T.localName=v,T.specified=!0,T},createEntityReference:function(v){var T=new Gi;return T.ownerDocument=this,T.nodeName=v,T},createElementNS:function(v,T){var j=new Ie,q=T.split(":"),ne=j.attributes=new re;return j.childNodes=new H,j.ownerDocument=this,j.nodeName=T,j.tagName=T,j.namespaceURI=v,q.length==2?(j.prefix=q[0],j.localName=q[1]):j.localName=T,ne._ownerElement=j,j},createAttributeNS:function(v,T){var j=new ui,q=T.split(":");return j.ownerDocument=this,j.nodeName=T,j.name=T,j.namespaceURI=v,j.specified=!0,q.length==2?(j.prefix=q[0],j.localName=q[1]):j.localName=T,j}},f(ve,ee);function Ie(){this._nsMap={}}Ie.prototype={nodeType:y,hasAttribute:function(v){return this.getAttributeNode(v)!=null},getAttribute:function(v){var T=this.getAttributeNode(v);return T&&T.value||""},getAttributeNode:function(v){return this.attributes.getNamedItem(v)},setAttribute:function(v,T){var j=this.ownerDocument.createAttribute(v);j.value=j.nodeValue=""+T,this.setAttributeNode(j)},removeAttribute:function(v){var T=this.getAttributeNode(v);T&&this.removeAttributeNode(T)},appendChild:function(v){return v.nodeType===U?this.insertBefore(v,null):ke(this,v)},setAttributeNode:function(v){return this.attributes.setNamedItem(v)},setAttributeNodeNS:function(v){return this.attributes.setNamedItemNS(v)},removeAttributeNode:function(v){return this.attributes.removeNamedItem(v.nodeName)},removeAttributeNS:function(v,T){var j=this.getAttributeNodeNS(v,T);j&&this.removeAttributeNode(j)},hasAttributeNS:function(v,T){return this.getAttributeNodeNS(v,T)!=null},getAttributeNS:function(v,T){var j=this.getAttributeNodeNS(v,T);return j&&j.value||""},setAttributeNS:function(v,T,j){var q=this.ownerDocument.createAttributeNS(v,T);q.value=q.nodeValue=""+j,this.setAttributeNode(q)},getAttributeNodeNS:function(v,T){return this.attributes.getNamedItemNS(v,T)},getElementsByTagName:function(v){return new Q(this,function(T){var j=[];return me(T,function(q){q!==T&&q.nodeType==y&&(v==="*"||q.tagName==v)&&j.push(q)}),j})},getElementsByTagNameNS:function(v,T){return new Q(this,function(j){var q=[];return me(j,function(ne){ne!==j&&ne.nodeType===y&&(v==="*"||ne.namespaceURI===v)&&(T==="*"||ne.localName==T)&&q.push(ne)}),q})}},ve.prototype.getElementsByTagName=Ie.prototype.getElementsByTagName,ve.prototype.getElementsByTagNameNS=Ie.prototype.getElementsByTagNameNS,f(Ie,ee);function ui(){}ui.prototype.nodeType=k,f(ui,ee);function Jt(){}Jt.prototype={data:"",substringData:function(v,T){return this.data.substring(v,v+T)},appendData:function(v){v=this.data+v,this.nodeValue=this.data=v,this.length=v.length},insertData:function(v,T){this.replaceData(v,0,T)},appendChild:function(v){throw new Error(G[b])},deleteData:function(v,T){this.replaceData(v,T,"")},replaceData:function(v,T,j){var q=this.data.substring(0,v),ne=this.data.substring(v+T);j=q+j+ne,this.nodeValue=this.data=j,this.length=j.length}},f(Jt,ee);function Ci(){}Ci.prototype={nodeName:"#text",nodeType:E,splitText:function(v){var T=this.data,j=T.substring(v);T=T.substring(0,v),this.data=this.nodeValue=T,this.length=T.length;var q=this.ownerDocument.createTextNode(j);return this.parentNode&&this.parentNode.insertBefore(q,this.nextSibling),q}},f(Ci,Jt);function Ei(){}Ei.prototype={nodeName:"#comment",nodeType:R},f(Ei,Jt);function ci(){}ci.prototype={nodeName:"#cdata-section",nodeType:L},f(ci,Jt);function di(){}di.prototype.nodeType=$,f(di,ee);function Ds(){}Ds.prototype.nodeType=V,f(Ds,ee);function ks(){}ks.prototype.nodeType=I,f(ks,ee);function Gi(){}Gi.prototype.nodeType=_,f(Gi,ee);function Te(){}Te.prototype.nodeName="#document-fragment",Te.prototype.nodeType=U,f(Te,ee);function js(){}js.prototype.nodeType=N,f(js,ee);function Ai(){}Ai.prototype.serializeToString=function(v,T,j){return br.call(v,T,j)},ee.prototype.toString=br;function br(v,T){var j=[],q=this.nodeType==9&&this.documentElement||this,ne=q.prefix,de=q.namespaceURI;if(de&&ne==null){var ne=q.lookupPrefix(de);if(ne==null)var Ae=[{namespace:de,prefix:null}]}return hi(this,j,v,T,Ae),j.join("")}function Tr(v,T,j){var q=v.prefix||"",ne=v.namespaceURI;if(!ne||q==="xml"&&ne===t.XML||ne===t.XMLNS)return!1;for(var de=j.length;de--;){var Ae=j[de];if(Ae.prefix===q)return Ae.namespace!==ne}return!0}function Is(v,T,j){v.push(" ",T,'="',j.replace(/[<>&"\t\n\r]/g,fe),'"')}function hi(v,T,j,q,ne){if(ne||(ne=[]),q)if(v=q(v),v){if(typeof v=="string"){T.push(v);return}}else return;switch(v.nodeType){case y:var de=v.attributes,Ae=de.length,we=v.firstChild,tt=v.tagName;j=t.isHTML(v.namespaceURI)||j;var gt=tt;if(!j&&!v.prefix&&v.namespaceURI){for(var Ft,Ct=0;Ct<de.length;Ct++)if(de.item(Ct).name==="xmlns"){Ft=de.item(Ct).value;break}if(!Ft)for(var Pt=ne.length-1;Pt>=0;Pt--){var Et=ne[Pt];if(Et.prefix===""&&Et.namespace===v.namespaceURI){Ft=Et.namespace;break}}if(Ft!==v.namespaceURI)for(var Pt=ne.length-1;Pt>=0;Pt--){var Et=ne[Pt];if(Et.namespace===v.namespaceURI){Et.prefix&&(gt=Et.prefix+":"+tt);break}}}T.push("<",gt);for(var Ne=0;Ne<Ae;Ne++){var At=de.item(Ne);At.prefix=="xmlns"?ne.push({prefix:At.localName,namespace:At.value}):At.nodeName=="xmlns"&&ne.push({prefix:"",namespace:At.value})}for(var Ne=0;Ne<Ae;Ne++){var At=de.item(Ne);if(Tr(At,j,ne)){var Zt=At.prefix||"",Ut=At.namespaceURI;Is(T,Zt?"xmlns:"+Zt:"xmlns",Ut),ne.push({prefix:Zt,namespace:Ut})}hi(At,T,j,q,ne)}if(tt===gt&&Tr(v,j,ne)){var Zt=v.prefix||"",Ut=v.namespaceURI;Is(T,Zt?"xmlns:"+Zt:"xmlns",Ut),ne.push({prefix:Zt,namespace:Ut})}if(we||j&&!/^(?:meta|link|img|br|hr|input)$/i.test(tt)){if(T.push(">"),j&&/^script$/i.test(tt))for(;we;)we.data?T.push(we.data):hi(we,T,j,q,ne.slice()),we=we.nextSibling;else for(;we;)hi(we,T,j,q,ne.slice()),we=we.nextSibling;T.push("</",gt,">")}else T.push("/>");return;case P:case U:for(var we=v.firstChild;we;)hi(we,T,j,q,ne.slice()),we=we.nextSibling;return;case k:return Is(T,v.name,v.value);case E:return T.push(v.data.replace(/[<&>]/g,fe));case L:return T.push("<![CDATA[",v.data,"]]>");case R:return T.push("<!--",v.data,"-->");case $:var wi=v.publicId,be=v.systemId;if(T.push("<!DOCTYPE ",v.name),wi)T.push(" PUBLIC ",wi),be&&be!="."&&T.push(" ",be),T.push(">");else if(be&&be!=".")T.push(" SYSTEM ",be,">");else{var Cr=v.internalSubset;Cr&&T.push(" [",Cr,"]"),T.push(">")}return;case N:return T.push("<?",v.target," ",v.data,"?>");case _:return T.push("&",v.nodeName,";");default:T.push("??",v.nodeName)}}function xr(v,T,j){var q;switch(T.nodeType){case y:q=T.cloneNode(!1),q.ownerDocument=v;case U:break;case k:j=!0;break}if(q||(q=T.cloneNode(!1)),q.ownerDocument=v,q.parentNode=null,j)for(var ne=T.firstChild;ne;)q.appendChild(xr(v,ne,j)),ne=ne.nextSibling;return q}function Ps(v,T,j){var q=new T.constructor;for(var ne in T)if(Object.prototype.hasOwnProperty.call(T,ne)){var de=T[ne];typeof de!="object"&&de!=q[ne]&&(q[ne]=de)}switch(T.childNodes&&(q.childNodes=new H),q.ownerDocument=v,q.nodeType){case y:var Ae=T.attributes,tt=q.attributes=new re,gt=Ae.length;tt._ownerElement=q;for(var Ft=0;Ft<gt;Ft++)q.setAttributeNode(Ps(v,Ae.item(Ft),!0));break;case k:j=!0}if(j)for(var Ct=T.firstChild;Ct;)q.appendChild(Ps(v,Ct,j)),Ct=Ct.nextSibling;return q}function Sr(v,T,j){v[T]=j}try{if(Object.defineProperty){let v=function(T){switch(T.nodeType){case y:case U:var j=[];for(T=T.firstChild;T;)T.nodeType!==7&&T.nodeType!==8&&j.push(v(T)),T=T.nextSibling;return j.join("");default:return T.nodeValue}};Object.defineProperty(Q.prototype,"length",{get:function(){return ie(this),this.$$length}}),Object.defineProperty(ee.prototype,"textContent",{get:function(){return v(this)},set:function(T){switch(this.nodeType){case y:case U:for(;this.firstChild;)this.removeChild(this.firstChild);(T||String(T))&&this.appendChild(this.ownerDocument.createTextNode(T));break;default:this.data=T,this.value=T,this.nodeValue=T}}}),Sr=function(T,j,q){T["$$"+j]=q}}}catch{}return ti.DocumentType=di,ti.DOMException=z,ti.DOMImplementation=te,ti.Element=Ie,ti.Node=ee,ti.NodeList=H,ti.XMLSerializer=Ai,ti}var Ks={},xa={},lu;function Om(){return lu||(lu=1,(function(s){var e=wn().freeze;s.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),s.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:`
14
- `,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:"‌"}),s.entityMap=s.HTML_ENTITIES})(xa)),xa}var Yr={},uu;function Mm(){if(uu)return Yr;uu=1;var s=wn().NAMESPACE,e=/[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]/,t=new RegExp("[\\-\\.0-9"+e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+e.source+t.source+"*(?::"+e.source+t.source+"*)?$"),r=0,n=1,a=2,l=3,c=4,f=5,g=6,y=7;function k(b,C){this.message=b,this.locator=C,Error.captureStackTrace&&Error.captureStackTrace(this,k)}k.prototype=new Error,k.prototype.name=k.name;function E(){}E.prototype={parse:function(b,C,F){var z=this.domBuilder;z.startDocument(),$(C,C={}),L(b,C,F,z,this.errorHandler),z.endDocument()}};function L(b,C,F,z,H){function Q(ke){if(ke>65535){ke-=65536;var Ie=55296+(ke>>10),ui=56320+(ke&1023);return String.fromCharCode(Ie,ui)}else return String.fromCharCode(ke)}function ie(ke){var Ie=ke.slice(1,-1);return Object.hasOwnProperty.call(F,Ie)?F[Ie]:Ie.charAt(0)==="#"?Q(parseInt(Ie.substr(1).replace("x","0x"))):(H.error("entity not found:"+ke),ke)}function re(ke){if(ke>ve){var Ie=b.substring(ve,ke).replace(/&#?\w+;/g,ie);ee&&Y(ve),z.characters(Ie,0,ke-ve),ve=ke}}function Y(ke,Ie){for(;ke>=J&&(Ie=te.exec(b));)Z=Ie.index,J=Z+Ie[0].length,ee.lineNumber++;ee.columnNumber=ke-Z+1}for(var Z=0,J=0,te=/.*(?:\r\n?|\n)|.*$/g,ee=z.locator,fe=[{currentNSMap:C}],me={},ve=0;;){try{var he=b.indexOf("<",ve);if(he<0){if(!b.substr(ve).match(/^\s*$/)){var Ke=z.doc,Ze=Ke.createTextNode(b.substr(ve));Ke.appendChild(Ze),z.currentElement=Ze}return}switch(he>ve&&re(he),b.charAt(he+1)){case"/":var ze=b.indexOf(">",he+3),qe=b.substring(he+2,ze).replace(/[ \t\n\r]+$/g,""),et=fe.pop();ze<0?(qe=b.substring(he+2).replace(/[\s<].*/,""),H.error("end tag name: "+qe+" is not complete:"+et.tagName),ze=he+1+qe.length):qe.match(/\s</)&&(qe=qe.replace(/[\s<].*/,""),H.error("end tag name: "+qe+" maybe not complete"),ze=he+1+qe.length);var xt=et.localNSMap,Qe=et.tagName==qe,nt=Qe||et.tagName&&et.tagName.toLowerCase()==qe.toLowerCase();if(nt){if(z.endElement(et.uri,et.localName,qe),xt)for(var oi in xt)Object.prototype.hasOwnProperty.call(xt,oi)&&z.endPrefixMapping(oi);Qe||H.fatalError("end tag name: "+qe+" is not match the current start tagName:"+et.tagName)}else fe.push(et);ze++;break;case"?":ee&&Y(he),ze=V(b,he,z);break;case"!":ee&&Y(he),ze=U(b,he,z,H);break;default:ee&&Y(he);var $e=new O,li=fe[fe.length-1].currentNSMap,ze=I(b,he,$e,li,ie,H),$i=$e.length;if(!$e.closed&&P(b,ze,$e.tagName,me)&&($e.closed=!0,F.nbsp||H.warning("unclosed xml attribute")),ee&&$i){for(var mt=_(ee,{}),St=0;St<$i;St++){var _e=$e[St];Y(_e.offset),_e.locator=_(ee,{})}z.locator=mt,N($e,z,li)&&fe.push($e),z.locator=ee}else N($e,z,li)&&fe.push($e);s.isHTML($e.uri)&&!$e.closed?ze=R(b,ze,$e.tagName,ie,z):ze++}}catch(ke){if(ke instanceof k)throw ke;H.error("element parse error: "+ke),ze=-1}ze>ve?ve=ze:re(Math.max(he,ve)+1)}}function _(b,C){return C.lineNumber=b.lineNumber,C.columnNumber=b.columnNumber,C}function I(b,C,F,z,H,Q){function ie(ee,fe,me){F.attributeNames.hasOwnProperty(ee)&&Q.fatalError("Attribute "+ee+" redefined"),F.addValue(ee,fe.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,H),me)}for(var re,Y,Z=++C,J=r;;){var te=b.charAt(Z);switch(te){case"=":if(J===n)re=b.slice(C,Z),J=l;else if(J===a)J=l;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(J===l||J===n)if(J===n&&(Q.warning('attribute value must after "="'),re=b.slice(C,Z)),C=Z+1,Z=b.indexOf(te,C),Z>0)Y=b.slice(C,Z),ie(re,Y,C-1),J=f;else throw new Error("attribute value no end '"+te+"' match");else if(J==c)Y=b.slice(C,Z),ie(re,Y,C),Q.warning('attribute "'+re+'" missed start quot('+te+")!!"),C=Z+1,J=f;else throw new Error('attribute value must after "="');break;case"/":switch(J){case r:F.setTagName(b.slice(C,Z));case f:case g:case y:J=y,F.closed=!0;case c:case n:break;case a:F.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return Q.error("unexpected end of input"),J==r&&F.setTagName(b.slice(C,Z)),Z;case">":switch(J){case r:F.setTagName(b.slice(C,Z));case f:case g:case y:break;case c:case n:Y=b.slice(C,Z),Y.slice(-1)==="/"&&(F.closed=!0,Y=Y.slice(0,-1));case a:J===a&&(Y=re),J==c?(Q.warning('attribute "'+Y+'" missed quot(")!'),ie(re,Y,C)):((!s.isHTML(z[""])||!Y.match(/^(?:disabled|checked|selected)$/i))&&Q.warning('attribute "'+Y+'" missed value!! "'+Y+'" instead!!'),ie(Y,Y,C));break;case l:throw new Error("attribute value missed!!")}return Z;case"€":te=" ";default:if(te<=" ")switch(J){case r:F.setTagName(b.slice(C,Z)),J=g;break;case n:re=b.slice(C,Z),J=a;break;case c:var Y=b.slice(C,Z);Q.warning('attribute "'+Y+'" missed quot(")!!'),ie(re,Y,C);case f:J=g;break}else switch(J){case a:F.tagName,(!s.isHTML(z[""])||!re.match(/^(?:disabled|checked|selected)$/i))&&Q.warning('attribute "'+re+'" missed value!! "'+re+'" instead2!!'),ie(re,re,C),C=Z,J=n;break;case f:Q.warning('attribute space is required"'+re+'"!!');case g:J=n,C=Z;break;case l:J=c,C=Z;break;case y:throw new Error("elements closed character '/' and '>' must be connected to")}}Z++}}function N(b,C,F){for(var z=b.tagName,H=null,te=b.length;te--;){var Q=b[te],ie=Q.qName,re=Q.value,ee=ie.indexOf(":");if(ee>0)var Y=Q.prefix=ie.slice(0,ee),Z=ie.slice(ee+1),J=Y==="xmlns"&&Z;else Z=ie,Y=null,J=ie==="xmlns"&&"";Q.localName=Z,J!==!1&&(H==null&&(H={},$(F,F={})),F[J]=H[J]=re,Q.uri=s.XMLNS,C.startPrefixMapping(J,re))}for(var te=b.length;te--;){Q=b[te];var Y=Q.prefix;Y&&(Y==="xml"&&(Q.uri=s.XML),Y!=="xmlns"&&(Q.uri=F[Y||""]))}var ee=z.indexOf(":");ee>0?(Y=b.prefix=z.slice(0,ee),Z=b.localName=z.slice(ee+1)):(Y=null,Z=b.localName=z);var fe=b.uri=F[Y||""];if(C.startElement(fe,Z,z,b),b.closed){if(C.endElement(fe,Z,z),H)for(Y in H)Object.prototype.hasOwnProperty.call(H,Y)&&C.endPrefixMapping(Y)}else return b.currentNSMap=F,b.localNSMap=H,!0}function R(b,C,F,z,H){if(/^(?:script|textarea)$/i.test(F)){var Q=b.indexOf("</"+F+">",C),ie=b.substring(C+1,Q);if(/[&<]/.test(ie))return/^script$/i.test(F)?(H.characters(ie,0,ie.length),Q):(ie=ie.replace(/&#?\w+;/g,z),H.characters(ie,0,ie.length),Q)}return C+1}function P(b,C,F,z){var H=z[F];return H==null&&(H=b.lastIndexOf("</"+F+">"),H<C&&(H=b.lastIndexOf("</"+F)),z[F]=H),H<C}function $(b,C){for(var F in b)Object.prototype.hasOwnProperty.call(b,F)&&(C[F]=b[F])}function U(b,C,F,z){var H=b.charAt(C+2);switch(H){case"-":if(b.charAt(C+3)==="-"){var Q=b.indexOf("-->",C+4);return Q>C?(F.comment(b,C+4,Q-C-4),Q+3):(z.error("Unclosed comment"),-1)}else return-1;default:if(b.substr(C+3,6)=="CDATA["){var Q=b.indexOf("]]>",C+9);return F.startCDATA(),F.characters(b,C+9,Q-C-9),F.endCDATA(),Q+3}var ie=G(b,C),re=ie.length;if(re>1&&/!doctype/i.test(ie[0][0])){var Y=ie[1][0],Z=!1,J=!1;re>3&&(/^public$/i.test(ie[2][0])?(Z=ie[3][0],J=re>4&&ie[4][0]):/^system$/i.test(ie[2][0])&&(J=ie[3][0]));var te=ie[re-1];return F.startDTD(Y,Z,J),F.endDTD(),te.index+te[0].length}}return-1}function V(b,C,F){var z=b.indexOf("?>",C);if(z){var H=b.substring(C,z).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return H?(H[0].length,F.processingInstruction(H[1],H[2]),z+2):-1}return-1}function O(){this.attributeNames={}}O.prototype={setTagName:function(b){if(!i.test(b))throw new Error("invalid tagName:"+b);this.tagName=b},addValue:function(b,C,F){if(!i.test(b))throw new Error("invalid attribute:"+b);this.attributeNames[b]=this.length,this[this.length++]={qName:b,value:C,offset:F}},length:0,getLocalName:function(b){return this[b].localName},getLocator:function(b){return this[b].locator},getQName:function(b){return this[b].qName},getURI:function(b){return this[b].uri},getValue:function(b){return this[b].value}};function G(b,C){var F,z=[],H=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(H.lastIndex=C,H.exec(b);F=H.exec(b);)if(z.push(F),F[1])return z}return Yr.XMLReader=E,Yr.ParseError=k,Yr}var cu;function Rm(){if(cu)return Ks;cu=1;var s=wn(),e=Ac(),t=Om(),i=Mm(),r=e.DOMImplementation,n=s.NAMESPACE,a=i.ParseError,l=i.XMLReader;function c(I){return I.replace(/\r[\n\u0085]/g,`
12
+ `))this.trigger(`data`,this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}},te=` `,ne=function(e){let t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||``),n={};return t[1]&&(n.length=parseInt(t[1],10)),t[2]&&(n.offset=parseInt(t[2],10)),n},re=function(){return RegExp(`(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))`)},ie=function(e){let t={};if(!e)return t;let n=e.split(re()),r=n.length,i;for(;r--;)n[r]!==``&&(i=/([^=]*)=(.*)/.exec(n[r]).slice(1),i[0]=i[0].replace(/^\s+|\s+$/g,``),i[1]=i[1].replace(/^\s+|\s+$/g,``),i[1]=i[1].replace(/^['"](.*)['"]$/g,`$1`),t[i[0]]=i[1]);return t},ae=e=>{let t=e.split(`x`),n={};return t[0]&&(n.width=parseInt(t[0],10)),t[1]&&(n.height=parseInt(t[1],10)),n},oe=class extends ee{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,n;if(e=e.trim(),e.length!==0){if(e[0]!==`#`){this.trigger(`data`,{type:`uri`,uri:e});return}this.tagMappers.reduce((t,n)=>{let r=n(e);return r===e?t:t.concat([r])},[e]).forEach(e=>{for(let t=0;t<this.customParsers.length;t++)if(this.customParsers[t].call(this,e))return;if(e.indexOf(`#EXT`)!==0){this.trigger(`data`,{type:`comment`,text:e.slice(1)});return}if(e=e.replace(`\r`,``),t=/^#EXTM3U/.exec(e),t){this.trigger(`data`,{type:`tag`,tagType:`m3u`});return}if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(e),t){n={type:`tag`,tagType:`inf`},t[1]&&(n.duration=parseFloat(t[1])),t[2]&&(n.title=t[2]),this.trigger(`data`,n);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(e),t){n={type:`tag`,tagType:`targetduration`},t[1]&&(n.duration=parseInt(t[1],10)),this.trigger(`data`,n);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(e),t){n={type:`tag`,tagType:`version`},t[1]&&(n.version=parseInt(t[1],10)),this.trigger(`data`,n);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t){n={type:`tag`,tagType:`media-sequence`},t[1]&&(n.number=parseInt(t[1],10)),this.trigger(`data`,n);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t){n={type:`tag`,tagType:`discontinuity-sequence`},t[1]&&(n.number=parseInt(t[1],10)),this.trigger(`data`,n);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e),t){n={type:`tag`,tagType:`playlist-type`},t[1]&&(n.playlistType=t[1]),this.trigger(`data`,n);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e),t){n=w(ne(t[1]),{type:`tag`,tagType:`byterange`}),this.trigger(`data`,n);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(e),t){n={type:`tag`,tagType:`allow-cache`},t[1]&&(n.allowed=!/NO/.test(t[1])),this.trigger(`data`,n);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(e),t){if(n={type:`tag`,tagType:`map`},t[1]){let e=ie(t[1]);e.URI&&(n.uri=e.URI),e.BYTERANGE&&(n.byterange=ne(e.BYTERANGE))}this.trigger(`data`,n);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e),t){n={type:`tag`,tagType:`stream-inf`},t[1]&&(n.attributes=ie(t[1]),n.attributes.RESOLUTION&&(n.attributes.RESOLUTION=ae(n.attributes.RESOLUTION)),n.attributes.BANDWIDTH&&(n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)),n.attributes[`FRAME-RATE`]&&(n.attributes[`FRAME-RATE`]=parseFloat(n.attributes[`FRAME-RATE`])),n.attributes[`PROGRAM-ID`]&&(n.attributes[`PROGRAM-ID`]=parseInt(n.attributes[`PROGRAM-ID`],10))),this.trigger(`data`,n);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(e),t){n={type:`tag`,tagType:`media`},t[1]&&(n.attributes=ie(t[1])),this.trigger(`data`,n);return}if(t=/^#EXT-X-ENDLIST/.exec(e),t){this.trigger(`data`,{type:`tag`,tagType:`endlist`});return}if(t=/^#EXT-X-DISCONTINUITY/.exec(e),t){this.trigger(`data`,{type:`tag`,tagType:`discontinuity`});return}if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e),t){n={type:`tag`,tagType:`program-date-time`},t[1]&&(n.dateTimeString=t[1],n.dateTimeObject=new Date(t[1])),this.trigger(`data`,n);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(e),t){n={type:`tag`,tagType:`key`},t[1]&&(n.attributes=ie(t[1]),n.attributes.IV&&(n.attributes.IV.substring(0,2).toLowerCase()===`0x`&&(n.attributes.IV=n.attributes.IV.substring(2)),n.attributes.IV=n.attributes.IV.match(/.{8}/g),n.attributes.IV[0]=parseInt(n.attributes.IV[0],16),n.attributes.IV[1]=parseInt(n.attributes.IV[1],16),n.attributes.IV[2]=parseInt(n.attributes.IV[2],16),n.attributes.IV[3]=parseInt(n.attributes.IV[3],16),n.attributes.IV=new Uint32Array(n.attributes.IV))),this.trigger(`data`,n);return}if(t=/^#EXT-X-START:(.*)$/.exec(e),t){n={type:`tag`,tagType:`start`},t[1]&&(n.attributes=ie(t[1]),n.attributes[`TIME-OFFSET`]=parseFloat(n.attributes[`TIME-OFFSET`]),n.attributes.PRECISE=/YES/.test(n.attributes.PRECISE)),this.trigger(`data`,n);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(e),t){n={type:`tag`,tagType:`cue-out-cont`},t[1]?n.data=t[1]:n.data=``,this.trigger(`data`,n);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(e),t){n={type:`tag`,tagType:`cue-out`},t[1]?n.data=t[1]:n.data=``,this.trigger(`data`,n);return}if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e),t){n={type:`tag`,tagType:`cue-in`},t[1]?n.data=t[1]:n.data=``,this.trigger(`data`,n);return}if(t=/^#EXT-X-SKIP:(.*)$/.exec(e),t&&t[1]){n={type:`tag`,tagType:`skip`},n.attributes=ie(t[1]),n.attributes.hasOwnProperty(`SKIPPED-SEGMENTS`)&&(n.attributes[`SKIPPED-SEGMENTS`]=parseInt(n.attributes[`SKIPPED-SEGMENTS`],10)),n.attributes.hasOwnProperty(`RECENTLY-REMOVED-DATERANGES`)&&(n.attributes[`RECENTLY-REMOVED-DATERANGES`]=n.attributes[`RECENTLY-REMOVED-DATERANGES`].split(te)),this.trigger(`data`,n);return}if(t=/^#EXT-X-PART:(.*)$/.exec(e),t&&t[1]){n={type:`tag`,tagType:`part`},n.attributes=ie(t[1]),[`DURATION`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))}),[`INDEPENDENT`,`GAP`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/.test(n.attributes[e]))}),n.attributes.hasOwnProperty(`BYTERANGE`)&&(n.attributes.byterange=ne(n.attributes.BYTERANGE)),this.trigger(`data`,n);return}if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e),t&&t[1]){n={type:`tag`,tagType:`server-control`},n.attributes=ie(t[1]),[`CAN-SKIP-UNTIL`,`PART-HOLD-BACK`,`HOLD-BACK`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))}),[`CAN-SKIP-DATERANGES`,`CAN-BLOCK-RELOAD`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/.test(n.attributes[e]))}),this.trigger(`data`,n);return}if(t=/^#EXT-X-PART-INF:(.*)$/.exec(e),t&&t[1]){n={type:`tag`,tagType:`part-inf`},n.attributes=ie(t[1]),[`PART-TARGET`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))}),this.trigger(`data`,n);return}if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e),t&&t[1]){n={type:`tag`,tagType:`preload-hint`},n.attributes=ie(t[1]),[`BYTERANGE-START`,`BYTERANGE-LENGTH`].forEach(function(e){if(n.attributes.hasOwnProperty(e)){n.attributes[e]=parseInt(n.attributes[e],10);let t=e===`BYTERANGE-LENGTH`?`length`:`offset`;n.attributes.byterange=n.attributes.byterange||{},n.attributes.byterange[t]=n.attributes[e],delete n.attributes[e]}}),this.trigger(`data`,n);return}if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e),t&&t[1]){n={type:`tag`,tagType:`rendition-report`},n.attributes=ie(t[1]),[`LAST-MSN`,`LAST-PART`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseInt(n.attributes[e],10))}),this.trigger(`data`,n);return}if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(e),t&&t[1]){n={type:`tag`,tagType:`daterange`},n.attributes=ie(t[1]),[`ID`,`CLASS`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=String(n.attributes[e]))}),[`START-DATE`,`END-DATE`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=new Date(n.attributes[e]))}),[`DURATION`,`PLANNED-DURATION`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))}),[`END-ON-NEXT`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/i.test(n.attributes[e]))}),[`SCTE35-CMD`,` SCTE35-OUT`,`SCTE35-IN`].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=n.attributes[e].toString(16))});let e=/^X-([A-Z]+-)+[A-Z]+$/;for(let t in n.attributes){if(!e.test(t))continue;let r=/[0-9A-Fa-f]{6}/g.test(n.attributes[t]),i=/^\d+(\.\d+)?$/.test(n.attributes[t]);n.attributes[t]=r?n.attributes[t].toString(16):i?parseFloat(n.attributes[t]):String(n.attributes[t])}this.trigger(`data`,n);return}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(e),t){this.trigger(`data`,{type:`tag`,tagType:`independent-segments`});return}if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(e),t){this.trigger(`data`,{type:`tag`,tagType:`i-frames-only`});return}if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(e),t){n={type:`tag`,tagType:`content-steering`},n.attributes=ie(t[1]),this.trigger(`data`,n);return}if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(e),t){n={type:`tag`,tagType:`i-frame-playlist`},n.attributes=ie(t[1]),n.attributes.URI&&(n.uri=n.attributes.URI),n.attributes.BANDWIDTH&&(n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)),n.attributes.RESOLUTION&&(n.attributes.RESOLUTION=ae(n.attributes.RESOLUTION)),n.attributes[`AVERAGE-BANDWIDTH`]&&(n.attributes[`AVERAGE-BANDWIDTH`]=parseInt(n.attributes[`AVERAGE-BANDWIDTH`],10)),n.attributes[`FRAME-RATE`]&&(n.attributes[`FRAME-RATE`]=parseFloat(n.attributes[`FRAME-RATE`])),this.trigger(`data`,n);return}if(t=/^#EXT-X-DEFINE:(.*)$/.exec(e),t){n={type:`tag`,tagType:`define`},n.attributes=ie(t[1]),this.trigger(`data`,n);return}this.trigger(`data`,{type:`tag`,data:e.slice(4)})})}}addParser({expression:e,customType:t,dataParser:n,segment:r}){typeof n!=`function`&&(n=e=>e),this.customParsers.push(i=>{if(e.exec(i))return this.trigger(`data`,{type:`custom`,data:n(i),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){this.tagMappers.push(n=>e.test(n)?t(n):n)}},se=e=>e.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),A=function(e){let t={};return Object.keys(e).forEach(function(n){t[se(n)]=e[n]}),t},ce=function(e){let{serverControl:t,targetDuration:n,partTargetDuration:r}=e;if(!t)return;let i=`#EXT-X-SERVER-CONTROL`,a=`holdBack`,o=`partHoldBack`,s=n&&n*3,c=r&&r*2;n&&!t.hasOwnProperty(a)&&(t[a]=s,this.trigger(`info`,{message:`${i} defaulting HOLD-BACK to targetDuration * 3 (${s}).`})),s&&t[a]<s&&(this.trigger(`warn`,{message:`${i} clamping HOLD-BACK (${t[a]}) to targetDuration * 3 (${s})`}),t[a]=s),r&&!t.hasOwnProperty(o)&&(t[o]=r*3,this.trigger(`info`,{message:`${i} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[o]}).`})),r&&t[o]<c&&(this.trigger(`warn`,{message:`${i} clamping PART-HOLD-BACK (${t[o]}) to partTargetDuration * 2 (${c}).`}),t[o]=c)},le=class extends ee{constructor(e={}){super(),this.lineStream=new k,this.parseStream=new oe,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,`https://a.com`).searchParams,this.lastProgramDateTime=null;let t=this,n=[],r={},i,a,o=!1,s=function(){},c={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},l=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let u=0,d=0,f={};this.on(`end`,()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&i&&(r.map=i),!r.key&&a&&(r.key=a),!r.timeline&&typeof l==`number`&&(r.timeline=l),this.manifest.preloadSegment=r)}),this.parseStream.on(`data`,function(e){let p,m;if(t.manifest.definitions){for(let n in t.manifest.definitions)if(e.uri&&=e.uri.replace(`{$${n}}`,t.manifest.definitions[n]),e.attributes)for(let r in e.attributes)typeof e.attributes[r]==`string`&&(e.attributes[r]=e.attributes[r].replace(`{$${n}}`,t.manifest.definitions[n]))}({tag(){({version(){e.version&&(this.manifest.version=e.version)},"allow-cache"(){this.manifest.allowCache=e.allowed,`allowed`in e||(this.trigger(`info`,{message:`defaulting allowCache to YES`}),this.manifest.allowCache=!0)},byterange(){let t={};`length`in e&&(r.byterange=t,t.length=e.length,`offset`in e||(e.offset=u)),`offset`in e&&(r.byterange=t,t.offset=e.offset),u=t.offset+t.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`})),e.title&&(r.title=e.title),e.duration>0&&(r.duration=e.duration),e.duration===0&&(r.duration=.01,this.trigger(`info`,{message:`updating zero segment duration to a small value`})),this.manifest.segments=n},key(){if(!e.attributes){this.trigger(`warn`,{message:`ignoring key declaration without attribute list`});return}if(e.attributes.METHOD===`NONE`){a=null;return}if(!e.attributes.URI){this.trigger(`warn`,{message:`ignoring key declaration without URI`});return}if(e.attributes.KEYFORMAT===`com.apple.streamingkeydelivery`){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection[`com.apple.fps.1_0`]={attributes:e.attributes};return}if(e.attributes.KEYFORMAT===`com.microsoft.playready`){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection[`com.microsoft.playready`]={uri:e.attributes.URI};return}if(e.attributes.KEYFORMAT===`urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed`){if([`SAMPLE-AES`,`SAMPLE-AES-CTR`,`SAMPLE-AES-CENC`].indexOf(e.attributes.METHOD)===-1){this.trigger(`warn`,{message:`invalid key method provided for Widevine`});return}if(e.attributes.METHOD===`SAMPLE-AES-CENC`&&this.trigger(`warn`,{message:`SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead`}),e.attributes.URI.substring(0,23)!==`data:text/plain;base64,`){this.trigger(`warn`,{message:`invalid key URI provided for Widevine`});return}if(!(e.attributes.KEYID&&e.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:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:O(e.attributes.URI.split(`,`)[1])};return}e.attributes.METHOD||this.trigger(`warn`,{message:`defaulting key method to AES-128`}),a={method:e.attributes.METHOD||`AES-128`,uri:e.attributes.URI},e.attributes.IV!==void 0&&(a.iv=e.attributes.IV)},"media-sequence"(){if(!isFinite(e.number)){this.trigger(`warn`,{message:`ignoring invalid media sequence: `+e.number});return}this.manifest.mediaSequence=e.number},"discontinuity-sequence"(){if(!isFinite(e.number)){this.trigger(`warn`,{message:`ignoring invalid discontinuity sequence: `+e.number});return}this.manifest.discontinuitySequence=e.number,l=e.number},"playlist-type"(){if(!/VOD|EVENT/.test(e.playlistType)){this.trigger(`warn`,{message:`ignoring unknown playlist type: `+e.playlist});return}this.manifest.playlistType=e.playlistType},map(){i={},e.uri&&(i.uri=e.uri),e.byterange&&(i.byterange=e.byterange),a&&(i.key=a)},"stream-inf"(){if(this.manifest.playlists=n,this.manifest.mediaGroups=this.manifest.mediaGroups||c,!e.attributes){this.trigger(`warn`,{message:`ignoring empty stream-inf attributes`});return}r.attributes||={},w(r.attributes,e.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||c,!(e.attributes&&e.attributes.TYPE&&e.attributes[`GROUP-ID`]&&e.attributes.NAME)){this.trigger(`warn`,{message:`ignoring incomplete or missing media group`});return}let t=this.manifest.mediaGroups[e.attributes.TYPE];t[e.attributes[`GROUP-ID`]]=t[e.attributes[`GROUP-ID`]]||{},p=t[e.attributes[`GROUP-ID`]],m={default:/yes/i.test(e.attributes.DEFAULT)},m.default?m.autoselect=!0:m.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(m.language=e.attributes.LANGUAGE),e.attributes.URI&&(m.uri=e.attributes.URI),e.attributes[`INSTREAM-ID`]&&(m.instreamId=e.attributes[`INSTREAM-ID`]),e.attributes.CHARACTERISTICS&&(m.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(m.forced=/yes/i.test(e.attributes.FORCED)),p[e.attributes.NAME]=m},discontinuity(){l+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(n.length)},"program-date-time"(){this.manifest.dateTimeString===void 0&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),r.dateTimeString=e.dateTimeString,r.dateTimeObject=e.dateTimeObject;let{lastProgramDateTime:t}=this;this.lastProgramDateTime=new Date(e.dateTimeString).getTime(),t===null&&this.manifest.segments.reduceRight((e,t)=>(t.programDateTime=e-t.duration*1e3,t.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(e.duration)||e.duration<0){this.trigger(`warn`,{message:`ignoring invalid target duration: `+e.duration});return}this.manifest.targetDuration=e.duration,ce.call(this,this.manifest)},start(){if(!e.attributes||isNaN(e.attributes[`TIME-OFFSET`])){this.trigger(`warn`,{message:`ignoring start declaration without appropriate attribute list`});return}this.manifest.start={timeOffset:e.attributes[`TIME-OFFSET`],precise:e.attributes.PRECISE}},"cue-out"(){r.cueOut=e.data},"cue-out-cont"(){r.cueOutCont=e.data},"cue-in"(){r.cueIn=e.data},skip(){this.manifest.skip=A(e.attributes),this.warnOnMissingAttributes_(`#EXT-X-SKIP`,e.attributes,[`SKIPPED-SEGMENTS`])},part(){o=!0;let t=this.manifest.segments.length,n=A(e.attributes);r.parts=r.parts||[],r.parts.push(n),n.byterange&&(n.byterange.hasOwnProperty(`offset`)||(n.byterange.offset=d),d=n.byterange.offset+n.byterange.length);let i=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${i} for segment #${t}`,e.attributes,[`URI`,`DURATION`]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((e,t)=>{e.hasOwnProperty(`lastPart`)||this.trigger(`warn`,{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})})},"server-control"(){let t=this.manifest.serverControl=A(e.attributes);t.hasOwnProperty(`canBlockReload`)||(t.canBlockReload=!1,this.trigger(`info`,{message:`#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false`})),ce.call(this,this.manifest),t.canSkipDateranges&&!t.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"(){let t=this.manifest.segments.length,n=A(e.attributes),i=n.type&&n.type===`PART`;r.preloadHints=r.preloadHints||[],r.preloadHints.push(n),n.byterange&&(n.byterange.hasOwnProperty(`offset`)||(n.byterange.offset=i?d:0,i&&(d=n.byterange.offset+n.byterange.length)));let a=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${a} for segment #${t}`,e.attributes,[`TYPE`,`URI`]),n.type)for(let e=0;e<r.preloadHints.length-1;e++){let i=r.preloadHints[e];i.type&&i.type===n.type&&this.trigger(`warn`,{message:`#EXT-X-PRELOAD-HINT #${a} for segment #${t} has the same TYPE ${n.type} as preload hint #${e}`})}},"rendition-report"(){let t=A(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);let n=this.manifest.renditionReports.length-1,r=[`LAST-MSN`,`URI`];o&&r.push(`LAST-PART`),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${n}`,e.attributes,r)},"part-inf"(){this.manifest.partInf=A(e.attributes),this.warnOnMissingAttributes_(`#EXT-X-PART-INF`,e.attributes,[`PART-TARGET`]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),ce.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(A(e.attributes));let t=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${t}`,e.attributes,[`ID`,`START-DATE`]);let n=this.manifest.dateRanges[t];n.endDate&&n.startDate&&new Date(n.endDate)<new Date(n.startDate)&&this.trigger(`warn`,{message:`EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE`}),n.duration&&n.duration<0&&this.trigger(`warn`,{message:`EXT-X-DATERANGE DURATION must not be negative`}),n.plannedDuration&&n.plannedDuration<0&&this.trigger(`warn`,{message:`EXT-X-DATERANGE PLANNED-DURATION must not be negative`});let r=!!n.endOnNext;if(r&&!n.class&&this.trigger(`warn`,{message:`EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute`}),r&&(n.duration||n.endDate)&&this.trigger(`warn`,{message:`EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes`}),n.duration&&n.endDate){let e=n.startDate.getTime()+n.duration*1e3;this.manifest.dateRanges[t].endDate=new Date(e)}if(!f[n.id])f[n.id]=n;else{for(let e in f[n.id])if(n[e]&&JSON.stringify(f[n.id][e])!==JSON.stringify(n[e])){this.trigger(`warn`,{message:`EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values`});break}let e=this.manifest.dateRanges.findIndex(e=>e.id===n.id);this.manifest.dateRanges[e]=w(this.manifest.dateRanges[e],n),f[n.id]=w(f[n.id],n),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=A(e.attributes),this.warnOnMissingAttributes_(`#EXT-X-CONTENT-STEERING`,e.attributes,[`SERVER-URI`])},define(){this.manifest.definitions=this.manifest.definitions||{};let t=(e,t)=>{if(e in this.manifest.definitions){this.trigger(`error`,{message:`EXT-X-DEFINE: Duplicate name ${e}`});return}this.manifest.definitions[e]=t};if(`QUERYPARAM`in e.attributes){if(`NAME`in e.attributes||`IMPORT`in e.attributes){this.trigger(`error`,{message:`EXT-X-DEFINE: Invalid attributes`});return}let n=this.params.get(e.attributes.QUERYPARAM);if(!n){this.trigger(`error`,{message:`EXT-X-DEFINE: No query param ${e.attributes.QUERYPARAM}`});return}t(e.attributes.QUERYPARAM,decodeURIComponent(n));return}if(`NAME`in e.attributes){if(`IMPORT`in e.attributes){this.trigger(`error`,{message:`EXT-X-DEFINE: Invalid attributes`});return}if(!(`VALUE`in e.attributes)||typeof e.attributes.VALUE!=`string`){this.trigger(`error`,{message:`EXT-X-DEFINE: No value for ${e.attributes.NAME}`});return}t(e.attributes.NAME,e.attributes.VALUE);return}if(`IMPORT`in e.attributes){if(!this.mainDefinitions[e.attributes.IMPORT]){this.trigger(`error`,{message:`EXT-X-DEFINE: No value ${e.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}t(e.attributes.IMPORT,this.mainDefinitions[e.attributes.IMPORT]);return}this.trigger(`error`,{message:`EXT-X-DEFINE: No attribute`})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:e.attributes,uri:e.uri,timeline:l}),this.warnOnMissingAttributes_(`#EXT-X-I-FRAME-STREAM-INF`,e.attributes,[`BANDWIDTH`,`URI`])}}[e.tagType]||s).call(t)},uri(){r.uri=e.uri,n.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=l,i&&(r.map=i),d=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){e.segment?(r.custom=r.custom||{},r.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger(`warn`,{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,n){let r=[];n.forEach(function(e){t.hasOwnProperty(e)||r.push(e)}),r.length&&this.trigger(`warn`,{message:`${e} lacks required attribute(s): ${r.join(`, `)}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(`
13
+ `),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)}},ue={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^/},de=[`video`,`audio`,`text`],fe=[`Video`,`Audio`,`Text`],pe=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,n){var r=(`00`+Number(t).toString(16)).slice(-2),i=(`00`+Number(n).toString(16)).slice(-2);return`avc1.`+r+`00`+i})},me=function(e){e===void 0&&(e=``);var t=e.split(`,`),n=[];return t.forEach(function(e){e=e.trim();var t;de.forEach(function(r){var i=ue[r].exec(e.toLowerCase());if(!(!i||i.length<=1)){t=r;var a=e.substring(0,i[1].length),o=e.replace(a,``);n.push({type:a,details:o,mediaType:r})}}),t||n.push({type:e,details:``,mediaType:`unknown`})}),n},he=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var n=e.mediaGroups.AUDIO[t];if(!n)return null;for(var r in n){var i=n[r];if(i.default&&i.playlists)return me(i.playlists[0].attributes.CODECS)}return null},ge=function(e){return e===void 0&&(e=``),ue.audio.test(e.trim().toLowerCase())},_e=function(e){return e===void 0&&(e=``),ue.text.test(e.trim().toLowerCase())},j=function(e){if(!(!e||typeof e!=`string`)){var t=e.toLowerCase().split(`,`).map(function(e){return pe(e.trim())}),n=`video`;t.length===1&&ge(t[0])?n=`audio`:t.length===1&&_e(t[0])&&(n=`application`);var r=`mp4`;return t.every(function(e){return ue.mp4.test(e)})?r=`mp4`:t.every(function(e){return ue.webm.test(e)})?r=`webm`:t.every(function(e){return ue.ogg.test(e)})&&(r=`ogg`),n+`/`+r+`;codecs="`+e+`"`}},ve=function(e,t){return e===void 0&&(e=``),t===void 0&&(t=!1),C.default.MediaSource&&C.default.MediaSource.isTypeSupported&&C.default.MediaSource.isTypeSupported(j(e))||t&&C.default.ManagedMediaSource&&C.default.ManagedMediaSource.isTypeSupported&&C.default.ManagedMediaSource.isTypeSupported(j(e))||!1},M=function(e){return e===void 0&&(e=``),e.toLowerCase().split(`,`).every(function(e){e=e.trim();for(var t=0;t<fe.length;t++)if(ue[`muxer`+fe[t]].test(e))return!0;return!1})},ye=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,be=/^application\/dash\+xml/i,xe=function(e){return ye.test(e)?`hls`:be.test(e)?`dash`:e===`application/vnd.videojs.vhs+json`?`vhs-json`:null},Se=function(e){return e.toString(2).length},Ce=function(e){return Math.ceil(Se(e)/8)},we=function(e){return ArrayBuffer.isView===`function`?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},Te=function(e){return we(e)},N=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!Te(e)&&!(e instanceof ArrayBuffer)&&(e=typeof e!=`number`||typeof e==`number`&&e!==e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},P=C.default.BigInt||Number,Ee=[P(`0x1`),P(`0x100`),P(`0x10000`),P(`0x1000000`),P(`0x100000000`),P(`0x10000000000`),P(`0x1000000000000`),P(`0x100000000000000`),P(`0x10000000000000000`)];(function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return t[0]===255?`big`:t[0]===204?`little`:`unknown`})();var De=function(e,t){var n=t===void 0?{}:t,r=n.signed,i=r===void 0?!1:r,a=n.le,o=a===void 0?!1:a;e=N(e);var s=o?`reduce`:`reduceRight`,c=(e[s]?e[s]:Array.prototype[s]).call(e,function(t,n,r){var i=o?r:Math.abs(r+1-e.length);return t+P(n)*Ee[i]},P(0));if(i){var l=Ee[e.length]/P(2)-P(1);c=P(c),c>l&&(c-=l,c-=l,c-=P(2))}return Number(c)},Oe=function(e,t){var n=(t===void 0?{}:t).le,r=n===void 0?!1:n;(typeof e!=`bigint`&&typeof e!=`number`||typeof e==`number`&&e!==e)&&(e=0),e=P(e);for(var i=Ce(e),a=new Uint8Array(new ArrayBuffer(i)),o=0;o<i;o++){var s=r?o:Math.abs(o+1-a.length);a[s]=Number(e/Ee[o]&P(255)),e<0&&(a[s]=Math.abs(~a[s]),a[s]-=o===0?1:2)}return a},ke=function(e){if(!e)return``;e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,N(e));try{return decodeURIComponent(escape(t))}catch{}return t},Ae=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 n=new Uint8Array(e.length),r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n},je=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t=t.filter(function(e){return e&&(e.byteLength||e.length)&&typeof e!=`string`}),t.length<=1)return N(t[0]);var r=t.reduce(function(e,t,n){return e+(t.byteLength||t.length)},0),i=new Uint8Array(r),a=0;return t.forEach(function(e){e=N(e),i.set(e,a),a+=e.byteLength}),i},F=function(e,t,n){var r=n===void 0?{}:n,i=r.offset,a=i===void 0?0:i,o=r.mask,s=o===void 0?[]:o;e=N(e),t=N(t);var c=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&c.call(t,function(t,n){return t===(s[n]?s[n]&e[a+n]:e[a+n])})},Me=function(e,t,n){t.forEach(function(t){for(var r in e.mediaGroups[t])for(var i in e.mediaGroups[t][r]){var a=e.mediaGroups[t][r][i];n(a,t,r,i)}})},Ne=e.r((e=>{function t(e,t,n){if(n===void 0&&(n=Array.prototype),e&&typeof n.find==`function`)return n.find.call(e,t);for(var r=0;r<e.length;r++)if(Object.prototype.hasOwnProperty.call(e,r)){var i=e[r];if(t.call(void 0,i,r,e))return i}}function n(e,t){return t===void 0&&(t=Object),t&&typeof t.freeze==`function`?t.freeze(e):e}function r(e,t){if(typeof e!=`object`||!e)throw TypeError(`target is not an object`);for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}var i=n({HTML:`text/html`,isHTML:function(e){return e===i.HTML},XML_APPLICATION:`application/xml`,XML_TEXT:`text/xml`,XML_XHTML_APPLICATION:`application/xhtml+xml`,XML_SVG_IMAGE:`image/svg+xml`}),a=n({HTML:`http://www.w3.org/1999/xhtml`,isHTML:function(e){return e===a.HTML},SVG:`http://www.w3.org/2000/svg`,XML:`http://www.w3.org/XML/1998/namespace`,XMLNS:`http://www.w3.org/2000/xmlns/`});e.assign=r,e.find=t,e.freeze=n,e.MIME_TYPE=i,e.NAMESPACE=a})),Pe=e.r((e=>{var t=Ne(),n=t.find,r=t.NAMESPACE;function i(e){return e!==``}function a(e){return e?e.split(/[\t\n\f\r ]+/).filter(i):[]}function o(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function s(e){if(!e)return[];var t=a(e);return Object.keys(t.reduce(o,{}))}function c(e){return function(t){return e&&e.indexOf(t)!==-1}}function l(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}function u(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,r=new r,l(n,r),e.prototype=n=r}n.constructor!=e&&(typeof e!=`function`&&console.error(`unknown Class:`+e),n.constructor=e)}var d={},f=d.ELEMENT_NODE=1,p=d.ATTRIBUTE_NODE=2,m=d.TEXT_NODE=3,h=d.CDATA_SECTION_NODE=4,g=d.ENTITY_REFERENCE_NODE=5,_=d.ENTITY_NODE=6,v=d.PROCESSING_INSTRUCTION_NODE=7,y=d.COMMENT_NODE=8,b=d.DOCUMENT_NODE=9,x=d.DOCUMENT_TYPE_NODE=10,S=d.DOCUMENT_FRAGMENT_NODE=11,C=d.NOTATION_NODE=12,w={},T={};w.INDEX_SIZE_ERR=(T[1]=`Index size error`,1),w.DOMSTRING_SIZE_ERR=(T[2]=`DOMString size error`,2);var E=w.HIERARCHY_REQUEST_ERR=(T[3]=`Hierarchy request error`,3);w.WRONG_DOCUMENT_ERR=(T[4]=`Wrong document`,4),w.INVALID_CHARACTER_ERR=(T[5]=`Invalid character`,5),w.NO_DATA_ALLOWED_ERR=(T[6]=`No data allowed`,6),w.NO_MODIFICATION_ALLOWED_ERR=(T[7]=`No modification allowed`,7);var ee=w.NOT_FOUND_ERR=(T[8]=`Not found`,8);w.NOT_SUPPORTED_ERR=(T[9]=`Not supported`,9);var D=w.INUSE_ATTRIBUTE_ERR=(T[10]=`Attribute in use`,10);w.INVALID_STATE_ERR=(T[11]=`Invalid state`,11),w.SYNTAX_ERR=(T[12]=`Syntax error`,12),w.INVALID_MODIFICATION_ERR=(T[13]=`Invalid modification`,13),w.NAMESPACE_ERR=(T[14]=`Invalid namespace`,14),w.INVALID_ACCESS_ERR=(T[15]=`Invalid access`,15);function O(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,T[e]),this.message=T[e],Error.captureStackTrace&&Error.captureStackTrace(this,O);return n.code=e,t&&(this.message=this.message+`: `+t),n}O.prototype=Error.prototype,l(w,O);function k(){}k.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t){for(var n=[],r=0;r<this.length;r++)I(this[r],n,e,t);return n.join(``)},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}};function te(e,t){this._node=e,this._refresh=t,ne(this)}function ne(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var n=e._refresh(e._node);if(Ve(e,`length`,n.length),!e.$$length||n.length<e.$$length)for(var r=n.length;r in e;r++)Object.prototype.hasOwnProperty.call(e,r)&&delete e[r];l(n,e),e._inc=t}}te.prototype.item=function(e){return ne(this),this[e]||null},u(te,k);function re(){}function ie(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function ae(e,t,n,r){if(r?t[ie(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&fe(i,e,r),de(i,e,n))}}function oe(e,t,n){var r=ie(t,n);if(r>=0){for(var i=t.length-1;r<i;)t[r]=t[++r];if(t.length=i,e){var a=e.ownerDocument;a&&(fe(a,e,n),n.ownerElement=null)}}else throw new O(ee,Error(e.tagName+`@`+n))}re.prototype={length:0,item:k.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var n=this[t];if(n.nodeName==e)return n}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new O(D);var n=this.getNamedItem(e.nodeName);return ae(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t=e.ownerElement,n;if(t&&t!=this._ownerElement)throw new O(D);return n=this.getNamedItemNS(e.namespaceURI,e.localName),ae(this._ownerElement,this,e,n),n},removeNamedItem:function(e){var t=this.getNamedItem(e);return oe(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return oe(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var r=this[n];if(r.localName==t&&r.namespaceURI==e)return r}return null}};function se(){}se.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var r=new ue;if(r.implementation=this,r.childNodes=new k,r.doctype=n||null,n&&r.appendChild(n),t){var i=r.createElementNS(e,t);r.appendChild(i)}return r},createDocumentType:function(e,t,n){var r=new Ae;return r.name=e,r.nodeName=e,r.publicId=t||``,r.systemId=n||``,r}};function A(){}A.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(e,t){return Ce(this,e,t)},replaceChild:function(e,t){Ce(this,e,t,Se),t&&this.removeChild(t)},removeChild:function(e){return me(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return L(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==m&&e.nodeType==m?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&n[r]===e)return r}t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&Object.prototype.hasOwnProperty.call(n,e))return n[e];t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return this.lookupPrefix(e)==null}};function ce(e){return e==`<`&&`&lt;`||e==`>`&&`&gt;`||e==`&`&&`&amp;`||e==`"`&&`&quot;`||`&#`+e.charCodeAt()+`;`}l(d,A),l(d,A.prototype);function le(e,t){if(t(e))return!0;if(e=e.firstChild)do if(le(e,t))return!0;while(e=e.nextSibling)}function ue(){this.ownerDocument=this}function de(e,t,n){e&&e._inc++,n.namespaceURI===r.XMLNS&&(t._nsMap[n.prefix?n.localName:``]=n.value)}function fe(e,t,n,i){e&&e._inc++,n.namespaceURI===r.XMLNS&&delete t._nsMap[n.prefix?n.localName:``]}function pe(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,a=0;i;)r[a++]=i,i=i.nextSibling;r.length=a,delete r[r.length]}}}function me(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,pe(e.ownerDocument,e),t}function he(e){return e&&(e.nodeType===A.DOCUMENT_NODE||e.nodeType===A.DOCUMENT_FRAGMENT_NODE||e.nodeType===A.ELEMENT_NODE)}function ge(e){return e&&(j(e)||ve(e)||_e(e)||e.nodeType===A.DOCUMENT_FRAGMENT_NODE||e.nodeType===A.COMMENT_NODE||e.nodeType===A.PROCESSING_INSTRUCTION_NODE)}function _e(e){return e&&e.nodeType===A.DOCUMENT_TYPE_NODE}function j(e){return e&&e.nodeType===A.ELEMENT_NODE}function ve(e){return e&&e.nodeType===A.TEXT_NODE}function M(e,t){var r=e.childNodes||[];if(n(r,j)||_e(t))return!1;var i=n(r,_e);return!(t&&i&&r.indexOf(i)>r.indexOf(t))}function ye(e,t){var r=e.childNodes||[];function i(e){return j(e)&&e!==t}if(n(r,i))return!1;var a=n(r,_e);return!(t&&a&&r.indexOf(a)>r.indexOf(t))}function be(e,t,n){if(!he(e))throw new O(E,`Unexpected parent node type `+e.nodeType);if(n&&n.parentNode!==e)throw new O(ee,`child not in parent`);if(!ge(t)||_e(t)&&e.nodeType!==A.DOCUMENT_NODE)throw new O(E,`Unexpected node type `+t.nodeType+` for parent node type `+e.nodeType)}function xe(e,t,r){var i=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===A.DOCUMENT_FRAGMENT_NODE){var o=a.filter(j);if(o.length>1||n(a,ve))throw new O(E,`More than one element or text in fragment`);if(o.length===1&&!M(e,r))throw new O(E,`Element in fragment can not be inserted before doctype`)}if(j(t)&&!M(e,r))throw new O(E,`Only one element can be added and only after doctype`);if(_e(t)){if(n(i,_e))throw new O(E,`Only one doctype is allowed`);var s=n(i,j);if(r&&i.indexOf(s)<i.indexOf(r))throw new O(E,`Doctype can only be inserted before an element`);if(!r&&s)throw new O(E,`Doctype can not be appended since element is present`)}}function Se(e,t,r){var i=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===A.DOCUMENT_FRAGMENT_NODE){var o=a.filter(j);if(o.length>1||n(a,ve))throw new O(E,`More than one element or text in fragment`);if(o.length===1&&!ye(e,r))throw new O(E,`Element in fragment can not be inserted before doctype`)}if(j(t)&&!ye(e,r))throw new O(E,`Only one element can be added and only after doctype`);if(_e(t)){function e(e){return _e(e)&&e!==r}if(n(i,e))throw new O(E,`Only one doctype is allowed`);var s=n(i,j);if(r&&i.indexOf(s)<i.indexOf(r))throw new O(E,`Doctype can only be inserted before an element`)}}function Ce(e,t,n,r){be(e,t,n),e.nodeType===A.DOCUMENT_NODE&&(r||xe)(e,t,n);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===S){var a=t.firstChild;if(a==null)return t;var o=t.lastChild}else a=o=t;var s=n?n.previousSibling:e.lastChild;a.previousSibling=s,o.nextSibling=n,s?s.nextSibling=a:e.firstChild=a,n==null?e.lastChild=o:n.previousSibling=o;do{a.parentNode=e;var c=e.ownerDocument||e;we(a,c)}while(a!==o&&(a=a.nextSibling));return pe(e.ownerDocument||e,e),t.nodeType==S&&(t.firstChild=t.lastChild=null),t}function we(e,t){if(e.ownerDocument!==t){if(e.ownerDocument=t,e.nodeType===f&&e.attributes)for(var n=0;n<e.attributes.length;n++){var r=e.attributes.item(n);r&&(r.ownerDocument=t)}for(var i=e.firstChild;i;)we(i,t),i=i.nextSibling}}function Te(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,pe(e.ownerDocument,e,t),we(t,e.ownerDocument||e),t}ue.prototype={nodeName:`#document`,nodeType:b,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==S){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return Ce(this,e,t),we(e,this),this.documentElement===null&&e.nodeType===f&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),me(this,e)},replaceChild:function(e,t){Ce(this,e,t,Se),we(e,this),t&&this.removeChild(t),j(e)&&(this.documentElement=e)},importNode:function(e,t){return Be(this,e,t)},getElementById:function(e){var t=null;return le(this.documentElement,function(n){if(n.nodeType==f&&n.getAttribute(`id`)==e)return t=n,!0}),t},getElementsByClassName:function(e){var t=s(e);return new te(this,function(n){var r=[];return t.length>0&&le(n.documentElement,function(i){if(i!==n&&i.nodeType===f){var a=i.getAttribute(`class`);if(a){var o=e===a;if(!o){var l=s(a);o=t.every(c(l))}o&&r.push(i)}}}),r})},createElement:function(e){var t=new N;t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new k;var n=t.attributes=new re;return n._ownerElement=t,t},createDocumentFragment:function(){var e=new Pe;return e.ownerDocument=this,e.childNodes=new k,e},createTextNode:function(e){var t=new De;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new Oe;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new ke;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new Fe;return n.ownerDocument=this,n.tagName=n.nodeName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new P;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new Me;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new N,r=t.split(`:`),i=n.attributes=new re;return n.childNodes=new k,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new P,r=t.split(`:`);return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},u(ue,A);function N(){this._nsMap={}}N.prototype={nodeType:f,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||``},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=``+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===S?this.insertBefore(e,null):Te(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||``},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=``+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new te(this,function(t){var n=[];return le(t,function(r){r!==t&&r.nodeType==f&&(e===`*`||r.tagName==e)&&n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new te(this,function(n){var r=[];return le(n,function(i){i!==n&&i.nodeType===f&&(e===`*`||i.namespaceURI===e)&&(t===`*`||i.localName==t)&&r.push(i)}),r})}},ue.prototype.getElementsByTagName=N.prototype.getElementsByTagName,ue.prototype.getElementsByTagNameNS=N.prototype.getElementsByTagNameNS,u(N,A);function P(){}P.prototype.nodeType=p,u(P,A);function Ee(){}Ee.prototype={data:``,substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw Error(T[E])},deleteData:function(e,t){this.replaceData(e,t,``)},replaceData:function(e,t,n){var r=this.data.substring(0,e),i=this.data.substring(e+t);n=r+n+i,this.nodeValue=this.data=n,this.length=n.length}},u(Ee,A);function De(){}De.prototype={nodeName:`#text`,nodeType:m,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},u(De,Ee);function Oe(){}Oe.prototype={nodeName:`#comment`,nodeType:y},u(Oe,Ee);function ke(){}ke.prototype={nodeName:`#cdata-section`,nodeType:h},u(ke,Ee);function Ae(){}Ae.prototype.nodeType=x,u(Ae,A);function je(){}je.prototype.nodeType=C,u(je,A);function F(){}F.prototype.nodeType=_,u(F,A);function Me(){}Me.prototype.nodeType=g,u(Me,A);function Pe(){}Pe.prototype.nodeName=`#document-fragment`,Pe.prototype.nodeType=S,u(Pe,A);function Fe(){}Fe.prototype.nodeType=v,u(Fe,A);function Ie(){}Ie.prototype.serializeToString=function(e,t,n){return Le.call(e,t,n)},A.prototype.toString=Le;function Le(e,t){var n=[],r=this.nodeType==9&&this.documentElement||this,i=r.prefix,a=r.namespaceURI;if(a&&i==null){var i=r.lookupPrefix(a);if(i==null)var o=[{namespace:a,prefix:null}]}return I(this,n,e,t,o),n.join(``)}function Re(e,t,n){var i=e.prefix||``,a=e.namespaceURI;if(!a||i===`xml`&&a===r.XML||a===r.XMLNS)return!1;for(var o=n.length;o--;){var s=n[o];if(s.prefix===i)return s.namespace!==a}return!0}function ze(e,t,n){e.push(` `,t,`="`,n.replace(/[<>&"\t\n\r]/g,ce),`"`)}function I(e,t,n,i,a){if(a||=[],i)if(e=i(e),e){if(typeof e==`string`){t.push(e);return}}else return;switch(e.nodeType){case f:var o=e.attributes,s=o.length,c=e.firstChild,l=e.tagName;n=r.isHTML(e.namespaceURI)||n;var u=l;if(!n&&!e.prefix&&e.namespaceURI){for(var d,_=0;_<o.length;_++)if(o.item(_).name===`xmlns`){d=o.item(_).value;break}if(!d)for(var C=a.length-1;C>=0;C--){var w=a[C];if(w.prefix===``&&w.namespace===e.namespaceURI){d=w.namespace;break}}if(d!==e.namespaceURI)for(var C=a.length-1;C>=0;C--){var w=a[C];if(w.namespace===e.namespaceURI){w.prefix&&(u=w.prefix+`:`+l);break}}}t.push(`<`,u);for(var T=0;T<s;T++){var E=o.item(T);E.prefix==`xmlns`?a.push({prefix:E.localName,namespace:E.value}):E.nodeName==`xmlns`&&a.push({prefix:``,namespace:E.value})}for(var T=0;T<s;T++){var E=o.item(T);if(Re(E,n,a)){var ee=E.prefix||``,D=E.namespaceURI;ze(t,ee?`xmlns:`+ee:`xmlns`,D),a.push({prefix:ee,namespace:D})}I(E,t,n,i,a)}if(l===u&&Re(e,n,a)){var ee=e.prefix||``,D=e.namespaceURI;ze(t,ee?`xmlns:`+ee:`xmlns`,D),a.push({prefix:ee,namespace:D})}if(c||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(l)){if(t.push(`>`),n&&/^script$/i.test(l))for(;c;)c.data?t.push(c.data):I(c,t,n,i,a.slice()),c=c.nextSibling;else for(;c;)I(c,t,n,i,a.slice()),c=c.nextSibling;t.push(`</`,u,`>`)}else t.push(`/>`);return;case b:case S:for(var c=e.firstChild;c;)I(c,t,n,i,a.slice()),c=c.nextSibling;return;case p:return ze(t,e.name,e.value);case m:return t.push(e.data.replace(/[<&>]/g,ce));case h:return t.push(`<![CDATA[`,e.data,`]]>`);case y:return t.push(`<!--`,e.data,`-->`);case x:var O=e.publicId,k=e.systemId;if(t.push(`<!DOCTYPE `,e.name),O)t.push(` PUBLIC `,O),k&&k!=`.`&&t.push(` `,k),t.push(`>`);else if(k&&k!=`.`)t.push(` SYSTEM `,k,`>`);else{var te=e.internalSubset;te&&t.push(` [`,te,`]`),t.push(`>`)}return;case v:return t.push(`<?`,e.target,` `,e.data,`?>`);case g:return t.push(`&`,e.nodeName,`;`);default:t.push(`??`,e.nodeName)}}function Be(e,t,n){var r;switch(t.nodeType){case f:r=t.cloneNode(!1),r.ownerDocument=e;case S:break;case p:n=!0;break}if(r||=t.cloneNode(!1),r.ownerDocument=e,r.parentNode=null,n)for(var i=t.firstChild;i;)r.appendChild(Be(e,i,n)),i=i.nextSibling;return r}function L(e,t,n){var r=new t.constructor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=t[i];typeof a!=`object`&&a!=r[i]&&(r[i]=a)}switch(t.childNodes&&(r.childNodes=new k),r.ownerDocument=e,r.nodeType){case f:var o=t.attributes,s=r.attributes=new re,c=o.length;s._ownerElement=r;for(var l=0;l<c;l++)r.setAttributeNode(L(e,o.item(l),!0));break;case p:n=!0}if(n)for(var u=t.firstChild;u;)r.appendChild(L(e,u,n)),u=u.nextSibling;return r}function Ve(e,t,n){e[t]=n}try{if(Object.defineProperty){Object.defineProperty(te.prototype,`length`,{get:function(){return ne(this),this.$$length}}),Object.defineProperty(A.prototype,`textContent`,{get:function(){return e(this)},set:function(e){switch(this.nodeType){case f:case S: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}}});function e(t){switch(t.nodeType){case f:case S:var n=[];for(t=t.firstChild;t;)t.nodeType!==7&&t.nodeType!==8&&n.push(e(t)),t=t.nextSibling;return n.join(``);default:return t.nodeValue}}Ve=function(e,t,n){e[`$$`+t]=n}}}catch{}e.DocumentType=Ae,e.DOMException=O,e.DOMImplementation=se,e.Element=N,e.Node=A,e.NodeList=k,e.XMLSerializer=Ie})),Fe=e.r((e=>{var t=Ne().freeze;e.XML_ENTITIES=t({amp:`&`,apos:`'`,gt:`>`,lt:`<`,quot:`"`}),e.HTML_ENTITIES=t({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:`\xA0`,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:`
14
+ `,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:`\xA0`,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:`‌`}),e.entityMap=e.HTML_ENTITIES})),Ie=e.r((e=>{var t=Ne().NAMESPACE,n=/[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]/,r=RegExp(`[\\-\\.0-9`+n.source.slice(1,-1)+`\\u00B7\\u0300-\\u036F\\u203F-\\u2040]`),i=RegExp(`^`+n.source+r.source+`*(?::`+n.source+r.source+`*)?$`),a=0,o=1,s=2,c=3,l=4,u=5,d=6,f=7;function p(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,p)}p.prototype=Error(),p.prototype.name=p.name;function m(){}m.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),x(t,t={}),h(e,t,n,r,this.errorHandler),r.endDocument()}};function h(e,n,r,i,a){function o(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}else return String.fromCharCode(e)}function s(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(r,t)?r[t]:t.charAt(0)===`#`?o(parseInt(t.substr(1).replace(`x`,`0x`))):(a.error(`entity not found:`+e),e)}function c(t){if(t>T){var n=e.substring(T,t).replace(/&#?\w+;/g,s);m&&l(T),i.characters(n,0,t-T),T=t}}function l(t,n){for(;t>=d&&(n=f.exec(e));)u=n.index,d=u+n[0].length,m.lineNumber++;m.columnNumber=t-u+1}for(var u=0,d=0,f=/.*(?:\r\n?|\n)|.*$/g,m=i.locator,h=[{currentNSMap:n}],x={},T=0;;){try{var E=e.indexOf(`<`,T);if(E<0){if(!e.substr(T).match(/^\s*$/)){var ee=i.doc,D=ee.createTextNode(e.substr(T));ee.appendChild(D),i.currentElement=D}return}switch(E>T&&c(E),e.charAt(E+1)){case`/`:var O=e.indexOf(`>`,E+3),k=e.substring(E+2,O).replace(/[ \t\n\r]+$/g,``),te=h.pop();O<0?(k=e.substring(E+2).replace(/[\s<].*/,``),a.error(`end tag name: `+k+` is not complete:`+te.tagName),O=E+1+k.length):k.match(/\s</)&&(k=k.replace(/[\s<].*/,``),a.error(`end tag name: `+k+` maybe not complete`),O=E+1+k.length);var ne=te.localNSMap,re=te.tagName==k;if(re||te.tagName&&te.tagName.toLowerCase()==k.toLowerCase()){if(i.endElement(te.uri,te.localName,k),ne)for(var ie in ne)Object.prototype.hasOwnProperty.call(ne,ie)&&i.endPrefixMapping(ie);re||a.fatalError(`end tag name: `+k+` is not match the current start tagName:`+te.tagName)}else h.push(te);O++;break;case`?`:m&&l(E),O=C(e,E,i);break;case`!`:m&&l(E),O=S(e,E,i,a);break;default:m&&l(E);var ae=new w,oe=h[h.length-1].currentNSMap,O=_(e,E,ae,oe,s,a),se=ae.length;if(!ae.closed&&b(e,O,ae.tagName,x)&&(ae.closed=!0,r.nbsp||a.warning(`unclosed xml attribute`)),m&&se){for(var A=g(m,{}),ce=0;ce<se;ce++){var le=ae[ce];l(le.offset),le.locator=g(m,{})}i.locator=A,v(ae,i,oe)&&h.push(ae),i.locator=m}else v(ae,i,oe)&&h.push(ae);t.isHTML(ae.uri)&&!ae.closed?O=y(e,O,ae.tagName,s,i):O++}}catch(e){if(e instanceof p)throw e;a.error(`element parse error: `+e),O=-1}O>T?T=O:c(Math.max(E,T)+1)}}function g(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function _(e,n,r,i,p,m){function h(e,t,n){r.attributeNames.hasOwnProperty(e)&&m.fatalError(`Attribute `+e+` redefined`),r.addValue(e,t.replace(/[\t\n\r]/g,` `).replace(/&#?\w+;/g,p),n)}for(var g,_,v=++n,y=a;;){var b=e.charAt(v);switch(b){case`=`:if(y===o)g=e.slice(n,v),y=c;else if(y===s)y=c;else throw Error(`attribute equal must after attrName`);break;case`'`:case`"`:if(y===c||y===o)if(y===o&&(m.warning(`attribute value must after "="`),g=e.slice(n,v)),n=v+1,v=e.indexOf(b,n),v>0)_=e.slice(n,v),h(g,_,n-1),y=u;else throw Error(`attribute value no end '`+b+`' match`);else if(y==l)_=e.slice(n,v),h(g,_,n),m.warning(`attribute "`+g+`" missed start quot(`+b+`)!!`),n=v+1,y=u;else throw Error(`attribute value must after "="`);break;case`/`:switch(y){case a:r.setTagName(e.slice(n,v));case u:case d:case f:y=f,r.closed=!0;case l:case o:break;case s:r.closed=!0;break;default:throw Error(`attribute invalid close char('/')`)}break;case``:return m.error(`unexpected end of input`),y==a&&r.setTagName(e.slice(n,v)),v;case`>`:switch(y){case a:r.setTagName(e.slice(n,v));case u:case d:case f:break;case l:case o:_=e.slice(n,v),_.slice(-1)===`/`&&(r.closed=!0,_=_.slice(0,-1));case s:y===s&&(_=g),y==l?(m.warning(`attribute "`+_+`" missed quot(")!`),h(g,_,n)):((!t.isHTML(i[``])||!_.match(/^(?:disabled|checked|selected)$/i))&&m.warning(`attribute "`+_+`" missed value!! "`+_+`" instead!!`),h(_,_,n));break;case c:throw Error(`attribute value missed!!`)}return v;case`€`:b=` `;default:if(b<=` `)switch(y){case a:r.setTagName(e.slice(n,v)),y=d;break;case o:g=e.slice(n,v),y=s;break;case l:var _=e.slice(n,v);m.warning(`attribute "`+_+`" missed quot(")!!`),h(g,_,n);case u:y=d;break}else switch(y){case s:r.tagName,(!t.isHTML(i[``])||!g.match(/^(?:disabled|checked|selected)$/i))&&m.warning(`attribute "`+g+`" missed value!! "`+g+`" instead2!!`),h(g,g,n),n=v,y=o;break;case u:m.warning(`attribute space is required"`+g+`"!!`);case d:y=o,n=v;break;case c:y=l,n=v;break;case f:throw Error(`elements closed character '/' and '>' must be connected to`)}}v++}}function v(e,n,r){for(var i=e.tagName,a=null,o=e.length;o--;){var s=e[o],c=s.qName,l=s.value,u=c.indexOf(`:`);if(u>0)var d=s.prefix=c.slice(0,u),f=c.slice(u+1),p=d===`xmlns`&&f;else f=c,d=null,p=c===`xmlns`&&``;s.localName=f,p!==!1&&(a??(a={},x(r,r={})),r[p]=a[p]=l,s.uri=t.XMLNS,n.startPrefixMapping(p,l))}for(var o=e.length;o--;){s=e[o];var d=s.prefix;d&&(d===`xml`&&(s.uri=t.XML),d!==`xmlns`&&(s.uri=r[d||``]))}var u=i.indexOf(`:`);u>0?(d=e.prefix=i.slice(0,u),f=e.localName=i.slice(u+1)):(d=null,f=e.localName=i);var m=e.uri=r[d||``];if(n.startElement(m,f,i,e),e.closed){if(n.endElement(m,f,i),a)for(d in a)Object.prototype.hasOwnProperty.call(a,d)&&n.endPrefixMapping(d)}else return e.currentNSMap=r,e.localNSMap=a,!0}function y(e,t,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var a=e.indexOf(`</`+n+`>`,t),o=e.substring(t+1,a);if(/[&<]/.test(o))return/^script$/i.test(n)?(i.characters(o,0,o.length),a):(o=o.replace(/&#?\w+;/g,r),i.characters(o,0,o.length),a)}return t+1}function b(e,t,n,r){var i=r[n];return i??(i=e.lastIndexOf(`</`+n+`>`),i<t&&(i=e.lastIndexOf(`</`+n)),r[n]=i),i<t}function x(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}function S(e,t,n,r){switch(e.charAt(t+2)){case`-`:if(e.charAt(t+3)===`-`){var i=e.indexOf(`-->`,t+4);return i>t?(n.comment(e,t+4,i-t-4),i+3):(r.error(`Unclosed comment`),-1)}else return-1;default:if(e.substr(t+3,6)==`CDATA[`){var i=e.indexOf(`]]>`,t+9);return n.startCDATA(),n.characters(e,t+9,i-t-9),n.endCDATA(),i+3}var a=T(e,t),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var s=a[1][0],c=!1,l=!1;o>3&&(/^public$/i.test(a[2][0])?(c=a[3][0],l=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(l=a[3][0]));var u=a[o-1];return n.startDTD(s,c,l),n.endDTD(),u.index+u[0].length}}return-1}function C(e,t,n){var r=e.indexOf(`?>`,t);if(r){var i=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(i[0].length,n.processingInstruction(i[1],i[2]),r+2):-1}return-1}function w(){this.attributeNames={}}w.prototype={setTagName:function(e){if(!i.test(e))throw Error(`invalid tagName:`+e);this.tagName=e},addValue:function(e,t,n){if(!i.test(e))throw Error(`invalid attribute:`+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function T(e,t){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(e);n=i.exec(e);)if(r.push(n),n[1])return r}e.XMLReader=m,e.ParseError=p})),Le=e.r((e=>{var t=Ne(),n=Pe(),r=Fe(),i=Ie(),a=n.DOMImplementation,o=t.NAMESPACE,s=i.ParseError,c=i.XMLReader;function l(e){return e.replace(/\r[\n\u0085]/g,`
15
15
  `).replace(/[\r\u0085\u2028]/g,`
16
- `)}function f(I){this.options=I||{locator:{}}}f.prototype.parseFromString=function(I,N){var R=this.options,P=new l,$=R.domBuilder||new y,U=R.errorHandler,V=R.locator,O=R.xmlns||{},G=/\/x?html?$/.test(N),b=G?t.HTML_ENTITIES:t.XML_ENTITIES;V&&$.setDocumentLocator(V),P.errorHandler=g(U,$,V),P.domBuilder=R.domBuilder||$,G&&(O[""]=n.HTML),O.xml=O.xml||n.XML;var C=R.normalizeLineEndings||c;return I&&typeof I=="string"?P.parse(C(I),O,b):P.errorHandler.error("invalid doc source"),$.doc};function g(I,N,R){if(!I){if(N instanceof y)return N;I=N}var P={},$=I instanceof Function;R=R||{};function U(V){var O=I[V];!O&&$&&(O=I.length==2?function(G){I(V,G)}:I),P[V]=O&&function(G){O("[xmldom "+V+"] "+G+E(R))}||function(){}}return U("warning"),U("error"),U("fatalError"),P}function y(){this.cdata=!1}function k(I,N){N.lineNumber=I.lineNumber,N.columnNumber=I.columnNumber}y.prototype={startDocument:function(){this.doc=new r().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(I,N,R,P){var $=this.doc,U=$.createElementNS(I,R||N),V=P.length;_(this,U),this.currentElement=U,this.locator&&k(this.locator,U);for(var O=0;O<V;O++){var I=P.getURI(O),G=P.getValue(O),R=P.getQName(O),b=$.createAttributeNS(I,R);this.locator&&k(P.getLocator(O),b),b.value=b.nodeValue=G,U.setAttributeNode(b)}},endElement:function(I,N,R){var P=this.currentElement;P.tagName,this.currentElement=P.parentNode},startPrefixMapping:function(I,N){},endPrefixMapping:function(I){},processingInstruction:function(I,N){var R=this.doc.createProcessingInstruction(I,N);this.locator&&k(this.locator,R),_(this,R)},ignorableWhitespace:function(I,N,R){},characters:function(I,N,R){if(I=L.apply(this,arguments),I){if(this.cdata)var P=this.doc.createCDATASection(I);else var P=this.doc.createTextNode(I);this.currentElement?this.currentElement.appendChild(P):/^\s*$/.test(I)&&this.doc.appendChild(P),this.locator&&k(this.locator,P)}},skippedEntity:function(I){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(I){(this.locator=I)&&(I.lineNumber=0)},comment:function(I,N,R){I=L.apply(this,arguments);var P=this.doc.createComment(I);this.locator&&k(this.locator,P),_(this,P)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(I,N,R){var P=this.doc.implementation;if(P&&P.createDocumentType){var $=P.createDocumentType(I,N,R);this.locator&&k(this.locator,$),_(this,$),this.doc.doctype=$}},warning:function(I){console.warn("[xmldom warning] "+I,E(this.locator))},error:function(I){console.error("[xmldom error] "+I,E(this.locator))},fatalError:function(I){throw new a(I,this.locator)}};function E(I){if(I)return`
17
- @`+(I.systemId||"")+"#[line:"+I.lineNumber+",col:"+I.columnNumber+"]"}function L(I,N,R){return typeof I=="string"?I.substr(N,R):I.length>=N+R||N?new java.lang.String(I,N,R)+"":I}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(I){y.prototype[I]=function(){return null}});function _(I,N){I.currentElement?I.currentElement.appendChild(N):I.doc.appendChild(N)}return Ks.__DOMHandler=y,Ks.normalizeLineEndings=c,Ks.DOMParser=f,Ks}var du;function Nm(){if(du)return Ys;du=1;var s=Ac();return Ys.DOMImplementation=s.DOMImplementation,Ys.XMLSerializer=s.XMLSerializer,Ys.DOMParser=Rm().DOMParser,Ys}var Bm=Nm();const hu=s=>!!s&&typeof s=="object",Xe=(...s)=>s.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):hu(e[i])&&hu(t[i])?e[i]=Xe(e[i],t[i]):e[i]=t[i]}),e),{}),wc=s=>Object.keys(s).map(e=>s[e]),Fm=(s,e)=>{const t=[];for(let i=s;i<e;i++)t.push(i);return t},hs=s=>s.reduce((e,t)=>e.concat(t),[]),Dc=s=>{if(!s.length)return[];const e=[];for(let t=0;t<s.length;t++)e.push(s[t]);return e},Um=(s,e)=>s.reduce((t,i,r)=>(i[e]&&t.push(r),t),[]),Vm=(s,e)=>wc(s.reduce((t,i)=>(i.forEach(r=>{t[e(r)]=r}),t),{}));var fs={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 ur=({baseUrl:s="",source:e="",range:t="",indexRange:i=""})=>{const r={uri:e,resolvedUri:An(s||"",e)};if(t||i){const a=(t||i).split("-");let l=w.BigInt?w.BigInt(a[0]):parseInt(a[0],10),c=w.BigInt?w.BigInt(a[1]):parseInt(a[1],10);l<Number.MAX_SAFE_INTEGER&&typeof l=="bigint"&&(l=Number(l)),c<Number.MAX_SAFE_INTEGER&&typeof c=="bigint"&&(c=Number(c));let f;typeof c=="bigint"||typeof l=="bigint"?f=w.BigInt(c)-w.BigInt(l)+w.BigInt(1):f=c-l+1,typeof f=="bigint"&&f<Number.MAX_SAFE_INTEGER&&(f=Number(f)),r.byterange={length:f,offset:l}}return r},qm=s=>{let e;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=w.BigInt(s.offset)+w.BigInt(s.length)-w.BigInt(1):e=s.offset+s.length-1,`${s.offset}-${e}`},fu=s=>(s&&typeof s!="number"&&(s=parseInt(s,10)),isNaN(s)?null:s),Hm={static(s){const{duration:e,timescale:t=1,sourceDuration:i,periodDuration:r}=s,n=fu(s.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:i/a}},dynamic(s){const{NOW:e,clientOffset:t,availabilityStartTime:i,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:l=0,timeShiftBufferDepth:c=1/0}=s,f=fu(s.endNumber),g=(e+t)/1e3,y=i+a,E=g+l-y,L=Math.ceil(E*r/n),_=Math.floor((g-y-c)*r/n),I=Math.floor((g-y)*r/n);return{start:Math.max(0,_),end:typeof f=="number"?f:Math.min(L,I)}}},zm=s=>e=>{const{duration:t,timescale:i=1,periodStart:r,startNumber:n=1}=s;return{number:n+e,duration:t/i,timeline:r,time:e*t}},vo=s=>{const{type:e,duration:t,timescale:i=1,periodDuration:r,sourceDuration:n}=s,{start:a,end:l}=Hm[e](s),c=Fm(a,l).map(zm(s));if(e==="static"){const f=c.length-1,g=typeof r=="number"?r:n;c[f].duration=g-t/i*f}return c},kc=s=>{const{baseUrl:e,initialization:t={},sourceDuration:i,indexRange:r="",periodStart:n,presentationTime:a,number:l=0,duration:c}=s;if(!e)throw new Error(fs.NO_BASE_URL);const f=ur({baseUrl:e,source:t.sourceURL,range:t.range}),g=ur({baseUrl:e,source:e,indexRange:r});if(g.map=f,c){const y=vo(s);y.length&&(g.duration=y[0].duration,g.timeline=y[0].timeline)}else i&&(g.duration=i,g.timeline=n);return g.presentationTime=a||n,g.number=l,[g]},yo=(s,e,t)=>{const i=s.sidx.map?s.sidx.map:null,r=s.sidx.duration,n=s.timeline||0,a=s.sidx.byterange,l=a.offset+a.length,c=e.timescale,f=e.references.filter(I=>I.referenceType!==1),g=[],y=s.endList?"static":"dynamic",k=s.sidx.timeline;let E=k,L=s.mediaSequence||0,_;typeof e.firstOffset=="bigint"?_=w.BigInt(l)+e.firstOffset:_=l+e.firstOffset;for(let I=0;I<f.length;I++){const N=e.references[I],R=N.referencedSize,P=N.subsegmentDuration;let $;typeof _=="bigint"?$=_+w.BigInt(R)-w.BigInt(1):$=_+R-1;const U=`${_}-${$}`,O=kc({baseUrl:t,timescale:c,timeline:n,periodStart:k,presentationTime:E,number:L,duration:P,sourceDuration:r,indexRange:U,type:y})[0];i&&(O.map=i),g.push(O),typeof _=="bigint"?_+=w.BigInt(R):_+=R,E+=P/c,L++}return s.segments=g,s},$m=["AUDIO","SUBTITLES"],Gm=1/60,jc=s=>Vm(s,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),Wm=(s,e)=>{for(let t=0;t<s.length;t++)if(s[t].attributes.NAME===e)return s[t];return null},pu=s=>{let e=[];return Lm(s,$m,(t,i,r,n)=>{e=e.concat(t.playlists||[])}),e},mu=({playlist:s,mediaSequence:e})=>{s.mediaSequence=e,s.segments.forEach((t,i)=>{t.number=s.mediaSequence+i})},Xm=({oldPlaylists:s,newPlaylists:e,timelineStarts:t})=>{e.forEach(i=>{i.discontinuitySequence=t.findIndex(function({timeline:c}){return c===i.timeline});const r=Wm(s,i.attributes.NAME);if(!r||i.sidx)return;const n=i.segments[0],a=r.segments.findIndex(function(c){return Math.abs(c.presentationTime-n.presentationTime)<Gm});if(a===-1){mu({playlist:i,mediaSequence:r.mediaSequence+r.segments.length}),i.segments[0].discontinuity=!0,i.discontinuityStarts.unshift(0),(!r.segments.length&&i.timeline>r.timeline||r.segments.length&&i.timeline>r.segments[r.segments.length-1].timeline)&&i.discontinuitySequence--;return}r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,i.discontinuityStarts.unshift(0),i.discontinuitySequence--),mu({playlist:i,mediaSequence:r.segments[a].number})})},Ym=({oldManifest:s,newManifest:e})=>{const t=s.playlists.concat(pu(s)),i=e.playlists.concat(pu(e));return e.timelineStarts=jc([s.timelineStarts,e.timelineStarts]),Xm({oldPlaylists:t,newPlaylists:i,timelineStarts:e.timelineStarts}),e},Dn=s=>s&&s.uri+"-"+qm(s.byterange),Sa=s=>{const e=s.reduce(function(i,r){return i[r.attributes.baseUrl]||(i[r.attributes.baseUrl]=[]),i[r.attributes.baseUrl].push(r),i},{});let t=[];return Object.values(e).forEach(i=>{const r=wc(i.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(i=>(i.discontinuityStarts=Um(i.segments||[],"discontinuity"),i))},_o=(s,e)=>{const t=Dn(s.sidx),i=t&&e[t]&&e[t].sidx;return i&&yo(s,i,s.sidx.resolvedUri),s},Km=(s,e={})=>{if(!Object.keys(e).length)return s;for(const t in s)s[t]=_o(s[t],e);return s},Qm=({attributes:s,segments:e,sidx:t,mediaSequence:i,discontinuitySequence:r,discontinuityStarts:n},a)=>{const l={attributes:{NAME:s.id,BANDWIDTH:s.bandwidth,CODECS:s.codecs,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:s.timelineStarts,mediaSequence:i,segments:e};return s.contentProtection&&(l.contentProtection=s.contentProtection),s.serviceLocation&&(l.attributes.serviceLocation=s.serviceLocation),t&&(l.sidx=t),a&&(l.attributes.AUDIO="audio",l.attributes.SUBTITLES="subs"),l},Jm=({attributes:s,segments:e,mediaSequence:t,discontinuityStarts:i,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:s.baseUrl,timeline:s.periodStart,resolvedUri:s.baseUrl||"",duration:s.sourceDuration,number:0}],s.duration=s.sourceDuration);const n={NAME:s.id,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1};s.codecs&&(n.CODECS=s.codecs);const a={attributes:n,uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,timelineStarts:s.timelineStarts,discontinuityStarts:i,discontinuitySequence:r,mediaSequence:t,segments:e};return s.serviceLocation&&(a.attributes.serviceLocation=s.serviceLocation),a},Zm=(s,e={},t=!1)=>{let i;const r=s.reduce((n,a)=>{const l=a.attributes.role&&a.attributes.role.value||"",c=a.attributes.lang||"";let f=a.attributes.label||"main";if(c&&!a.attributes.label){const y=l?` (${l})`:"";f=`${a.attributes.lang}${y}`}n[f]||(n[f]={language:c,autoselect:!0,default:l==="main",playlists:[],uri:""});const g=_o(Qm(a,t),e);return n[f].playlists.push(g),typeof i>"u"&&l==="main"&&(i=a,i.default=!0),n},{});if(!i){const n=Object.keys(r)[0];r[n].default=!0}return r},e0=(s,e={})=>s.reduce((t,i)=>{const r=i.attributes.label||i.attributes.lang||"text",n=i.attributes.lang||"und";return t[r]||(t[r]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(_o(Jm(i),e)),t},{}),t0=s=>s.reduce((e,t)=>(t&&t.forEach(i=>{const{channel:r,language:n}=i;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},i.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=i.aspectRatio),i.hasOwnProperty("easyReader")&&(e[n].easyReader=i.easyReader),i.hasOwnProperty("3D")&&(e[n]["3D"]=i["3D"])}),e),{}),i0=({attributes:s,segments:e,sidx:t,discontinuityStarts:i})=>{const r={attributes:{NAME:s.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:s.width,height:s.height},CODECS:s.codecs,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuityStarts:i,timelineStarts:s.timelineStarts,segments:e};return s.frameRate&&(r.attributes["FRAME-RATE"]=s.frameRate),s.contentProtection&&(r.contentProtection=s.contentProtection),s.serviceLocation&&(r.attributes.serviceLocation=s.serviceLocation),t&&(r.sidx=t),r},s0=({attributes:s})=>s.mimeType==="video/mp4"||s.mimeType==="video/webm"||s.contentType==="video",r0=({attributes:s})=>s.mimeType==="audio/mp4"||s.mimeType==="audio/webm"||s.contentType==="audio",n0=({attributes:s})=>s.mimeType==="text/vtt"||s.contentType==="text",a0=(s,e)=>{s.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:i}){return i===t.timeline}),t.segments&&t.segments.forEach((i,r)=>{i.number=r})})},gu=s=>s?Object.keys(s).reduce((e,t)=>{const i=s[t];return e.concat(i.playlists)},[]):[],o0=({dashPlaylists:s,locations:e,contentSteering:t,sidxMapping:i={},previousManifest:r,eventStream:n})=>{if(!s.length)return{};const{sourceDuration:a,type:l,suggestedPresentationDelay:c,minimumUpdatePeriod:f}=s[0].attributes,g=Sa(s.filter(s0)).map(i0),y=Sa(s.filter(r0)),k=Sa(s.filter(n0)),E=s.map($=>$.attributes.captionServices).filter(Boolean),L={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:Km(g,i)};f>=0&&(L.minimumUpdatePeriod=f*1e3),e&&(L.locations=e),t&&(L.contentSteering=t),l==="dynamic"&&(L.suggestedPresentationDelay=c),n&&n.length>0&&(L.eventStream=n);const _=L.playlists.length===0,I=y.length?Zm(y,i,_):null,N=k.length?e0(k,i):null,R=g.concat(gu(I),gu(N)),P=R.map(({timelineStarts:$})=>$);return L.timelineStarts=jc(P),a0(R,L.timelineStarts),I&&(L.mediaGroups.AUDIO.audio=I),N&&(L.mediaGroups.SUBTITLES.subs=N),E.length&&(L.mediaGroups["CLOSED-CAPTIONS"].cc=t0(E)),r?Ym({oldManifest:r,newManifest:L}):L},l0=(s,e,t)=>{const{NOW:i,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:l=0,minimumUpdatePeriod:c=0}=s,f=(i+r)/1e3,g=n+l,k=f+c-g;return Math.ceil((k*a-e)/t)},Ic=(s,e)=>{const{type:t,minimumUpdatePeriod:i=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:l=1,periodStart:c}=s,f=[];let g=-1;for(let y=0;y<e.length;y++){const k=e[y],E=k.d,L=k.r||0,_=k.t||0;g<0&&(g=_),_&&_>g&&(g=_);let I;if(L<0){const P=y+1;P===e.length?t==="dynamic"&&i>0&&r.indexOf("$Number$")>0?I=l0(s,g,E):I=(n*a-g)/E:I=(e[P].t-g)/E}else I=L+1;const N=l+f.length+I;let R=l+f.length;for(;R<N;)f.push({number:R,duration:E/a,time:g,timeline:c}),g+=E,R++}return f},u0=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,c0=s=>(e,t,i,r)=>{if(e==="$$")return"$";if(typeof s[t]>"u")return e;const n=""+s[t];return t==="RepresentationID"||(i?r=parseInt(r,10):r=1,n.length>=r)?n:`${new Array(r-n.length+1).join("0")}${n}`},vu=(s,e)=>s.replace(u0,c0(e)),d0=(s,e)=>!s.duration&&!e?[{number:s.startNumber||1,duration:s.sourceDuration,time:0,timeline:s.periodStart}]:s.duration?vo(s):Ic(s,e),h0=(s,e)=>{const t={RepresentationID:s.id,Bandwidth:s.bandwidth||0},{initialization:i={sourceURL:"",range:""}}=s,r=ur({baseUrl:s.baseUrl,source:vu(i.sourceURL,t),range:i.range});return d0(s,e).map(a=>{t.Number=a.number,t.Time=a.time;const l=vu(s.media||"",t),c=s.timescale||1,f=s.presentationTimeOffset||0,g=s.periodStart+(a.time-f)/c;return{uri:l,timeline:a.timeline,duration:a.duration,resolvedUri:An(s.baseUrl||"",l),map:r,number:a.number,presentationTime:g}})},f0=(s,e)=>{const{baseUrl:t,initialization:i={}}=s,r=ur({baseUrl:t,source:i.sourceURL,range:i.range}),n=ur({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},p0=(s,e)=>{const{duration:t,segmentUrls:i=[],periodStart:r}=s;if(!t&&!e||t&&e)throw new Error(fs.SEGMENT_TIME_UNSPECIFIED);const n=i.map(c=>f0(s,c));let a;return t&&(a=vo(s)),e&&(a=Ic(s,e)),a.map((c,f)=>{if(n[f]){const g=n[f],y=s.timescale||1,k=s.presentationTimeOffset||0;return g.timeline=c.timeline,g.duration=c.duration,g.number=c.number,g.presentationTime=r+(c.time-k)/y,g}}).filter(c=>c)},m0=({attributes:s,segmentInfo:e})=>{let t,i;e.template?(i=h0,t=Xe(s,e.template)):e.base?(i=kc,t=Xe(s,e.base)):e.list&&(i=p0,t=Xe(s,e.list));const r={attributes:s};if(!i)return r;const n=i(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},g0=s=>s.map(m0),Oe=(s,e)=>Dc(s.childNodes).filter(({tagName:t})=>t===e),pr=s=>s.textContent.trim(),v0=s=>parseFloat(s.split("/").reduce((e,t)=>e/t)),Ki=s=>{const l=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(s);if(!l)return 0;const[c,f,g,y,k,E]=l.slice(1);return parseFloat(c||0)*31536e3+parseFloat(f||0)*2592e3+parseFloat(g||0)*86400+parseFloat(y||0)*3600+parseFloat(k||0)*60+parseFloat(E||0)},y0=s=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(s)&&(s+="Z"),Date.parse(s)),yu={mediaPresentationDuration(s){return Ki(s)},availabilityStartTime(s){return y0(s)/1e3},minimumUpdatePeriod(s){return Ki(s)},suggestedPresentationDelay(s){return Ki(s)},type(s){return s},timeShiftBufferDepth(s){return Ki(s)},start(s){return Ki(s)},width(s){return parseInt(s,10)},height(s){return parseInt(s,10)},bandwidth(s){return parseInt(s,10)},frameRate(s){return v0(s)},startNumber(s){return parseInt(s,10)},timescale(s){return parseInt(s,10)},presentationTimeOffset(s){return parseInt(s,10)},duration(s){const e=parseInt(s,10);return isNaN(e)?Ki(s):e},d(s){return parseInt(s,10)},t(s){return parseInt(s,10)},r(s){return parseInt(s,10)},presentationTime(s){return parseInt(s,10)},DEFAULT(s){return s}},He=s=>s&&s.attributes?Dc(s.attributes).reduce((e,t)=>{const i=yu[t.name]||yu.DEFAULT;return e[t.name]=i(t.value),e},{}):{},_0={"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"},kn=(s,e)=>e.length?hs(s.map(function(t){return e.map(function(i){const r=pr(i),n=An(t.baseUrl,r),a=Xe(He(i),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):s,bo=s=>{const e=Oe(s,"SegmentTemplate")[0],t=Oe(s,"SegmentList")[0],i=t&&Oe(t,"SegmentURL").map(y=>Xe({tag:"SegmentURL"},He(y))),r=Oe(s,"SegmentBase")[0],n=t||e,a=n&&Oe(n,"SegmentTimeline")[0],l=t||r||e,c=l&&Oe(l,"Initialization")[0],f=e&&He(e);f&&c?f.initialization=c&&He(c):f&&f.initialization&&(f.initialization={sourceURL:f.initialization});const g={template:f,segmentTimeline:a&&Oe(a,"S").map(y=>He(y)),list:t&&Xe(He(t),{segmentUrls:i,initialization:He(c)}),base:r&&Xe(He(r),{initialization:He(c)})};return Object.keys(g).forEach(y=>{g[y]||delete g[y]}),g},b0=(s,e,t)=>i=>{const r=Oe(i,"BaseURL"),n=kn(e,r),a=Xe(s,He(i)),l=bo(i);return n.map(c=>({segmentInfo:Xe(t,l),attributes:Xe(a,c)}))},T0=s=>s.reduce((e,t)=>{const i=He(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const r=_0[i.schemeIdUri];if(r){e[r]={attributes:i};const n=Oe(t,"cenc:pssh")[0];if(n){const a=pr(n);e[r].pssh=a&&bc(a)}}return e},{}),x0=s=>{if(s.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(t=>{let i,r;return r=t,/^CC\d=/.test(t)?[i,r]=t.split("="):/^CC\d$/.test(t)&&(i=t),{channel:i,language:r}});if(s.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(t=>{const i={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[r,n=""]=t.split("=");i.channel=r,i.language=t,n.split(",").forEach(a=>{const[l,c]=a.split(":");l==="lang"?i.language=c:l==="er"?i.easyReader=Number(c):l==="war"?i.aspectRatio=Number(c):l==="3D"&&(i["3D"]=Number(c))})}else i.language=t;return i.channel&&(i.channel="SERVICE"+i.channel),i})},S0=s=>hs(Oe(s.node,"EventStream").map(e=>{const t=He(e),i=t.schemeIdUri;return Oe(e,"Event").map(r=>{const n=He(r),a=n.presentationTime||0,l=t.timescale||1,c=n.duration||0,f=a/l+s.attributes.start;return{schemeIdUri:i,value:t.value,id:n.id,start:f,end:f+c/l,messageData:pr(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),C0=(s,e,t)=>i=>{const r=He(i),n=kn(e,Oe(i,"BaseURL")),a=Oe(i,"Role")[0],l={role:He(a)};let c=Xe(s,r,l);const f=Oe(i,"Accessibility")[0],g=x0(He(f));g&&(c=Xe(c,{captionServices:g}));const y=Oe(i,"Label")[0];if(y&&y.childNodes.length){const I=y.childNodes[0].nodeValue.trim();c=Xe(c,{label:I})}const k=T0(Oe(i,"ContentProtection"));Object.keys(k).length&&(c=Xe(c,{contentProtection:k}));const E=bo(i),L=Oe(i,"Representation"),_=Xe(t,E);return hs(L.map(b0(c,n,_)))},E0=(s,e)=>(t,i)=>{const r=kn(e,Oe(t.node,"BaseURL")),n=Xe(s,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=Oe(t.node,"AdaptationSet"),l=bo(t.node);return hs(a.map(C0(n,r,l)))},A0=(s,e)=>{if(s.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!s.length)return null;const t=Xe({serverURL:pr(s[0])},He(s[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},w0=({attributes:s,priorPeriodAttributes:e,mpdType:t})=>typeof s.start=="number"?s.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,D0=(s,e={})=>{const{manifestUri:t="",NOW:i=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=Oe(s,"Period");if(!a.length)throw new Error(fs.INVALID_NUMBER_OF_PERIOD);const l=Oe(s,"Location"),c=He(s),f=kn([{baseUrl:t}],Oe(s,"BaseURL")),g=Oe(s,"ContentSteering");c.type=c.type||"static",c.sourceDuration=c.mediaPresentationDuration||0,c.NOW=i,c.clientOffset=r,l.length&&(c.locations=l.map(pr));const y=[];return a.forEach((k,E)=>{const L=He(k),_=y[E-1];L.start=w0({attributes:L,priorPeriodAttributes:_?_.attributes:null,mpdType:c.type}),y.push({node:k,attributes:L})}),{locations:c.locations,contentSteeringInfo:A0(g,n),representationInfo:hs(y.map(E0(c,f))),eventStream:hs(y.map(S0))}},Pc=s=>{if(s==="")throw new Error(fs.DASH_EMPTY_MANIFEST);const e=new Bm.DOMParser;let t,i;try{t=e.parseFromString(s,"application/xml"),i=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(fs.DASH_INVALID_XML);return i},k0=s=>{const e=Oe(s,"UTCTiming")[0];if(!e)return null;const t=He(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;default:throw new Error(fs.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},j0=(s,e={})=>{const t=D0(Pc(s),e),i=g0(t.representationInfo);return o0({dashPlaylists:i,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},I0=s=>k0(Pc(s));var Ca,_u;function P0(){if(_u)return Ca;_u=1;var s=Math.pow(2,32),e=function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r;return i.getBigUint64?(r=i.getBigUint64(0),r<Number.MAX_SAFE_INTEGER?Number(r):r):i.getUint32(0)*s+i.getUint32(4)};return Ca={getUint64:e,MAX_UINT32:s},Ca}var Ea,bu;function L0(){if(bu)return Ea;bu=1;var s=P0().getUint64,e=function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8)},n=12;r.version===0?(r.earliestPresentationTime=i.getUint32(n),r.firstOffset=i.getUint32(n+4),n+=8):(r.earliestPresentationTime=s(t.subarray(n)),r.firstOffset=s(t.subarray(n+8)),n+=16),n+=2;var a=i.getUint16(n);for(n+=2;a>0;n+=12,a--)r.references.push({referenceType:(t[n]&128)>>>7,referencedSize:i.getUint32(n)&2147483647,subsegmentDuration:i.getUint32(n+4),startsWithSap:!!(t[n+8]&128),sapType:(t[n+8]&112)>>>4,sapDeltaTime:i.getUint32(n+8)&268435455});return r};return Ea=e,Ea}var O0=L0();const M0=Ve.getDefaultExportFromCjs(O0);var R0=ue([73,68,51]),N0=function(e,t){t===void 0&&(t=0),e=ue(e);var i=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(i&16)>>4;return n?r+20:r+10},er=function s(e,t){return t===void 0&&(t=0),e=ue(e),e.length-t<10||!Le(e,R0,{offset:t})?t:(t+=N0(e,t),s(e,t))},Tu=function(e){return typeof e=="string"?Ec(e):e},B0=function(e){return Array.isArray(e)?e.map(function(t){return Tu(t)}):[Tu(e)]},F0=function s(e,t,i){i===void 0&&(i=!1),t=B0(t),e=ue(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 c=n+a;if(c>e.length){if(i)break;c=e.length}var f=e.subarray(n+8,c);Le(l,t[0])&&(t.length===1?r.push(f):r.push.apply(r,s(f,t.slice(1),i))),n=c}return r},Kr={EBML:ue([26,69,223,163]),DocType:ue([66,130]),Segment:ue([24,83,128,103]),SegmentInfo:ue([21,73,169,102]),Tracks:ue([22,84,174,107]),Track:ue([174]),TrackNumber:ue([215]),DefaultDuration:ue([35,227,131]),TrackEntry:ue([174]),TrackType:ue([131]),FlagDefault:ue([136]),CodecID:ue([134]),CodecPrivate:ue([99,162]),VideoTrack:ue([224]),AudioTrack:ue([225]),Cluster:ue([31,67,182,117]),Timestamp:ue([231]),TimestampScale:ue([42,215,177]),BlockGroup:ue([160]),BlockDuration:ue([155]),Block:ue([161]),SimpleBlock:ue([163])},Ha=[128,64,32,16,8,4,2,1],U0=function(e){for(var t=1,i=0;i<Ha.length&&!(e&Ha[i]);i++)t++;return t},nn=function(e,t,i,r){i===void 0&&(i=!0),r===void 0&&(r=!1);var n=U0(e[t]),a=e.subarray(t,t+n);return i&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=Ha[n-1]),{length:n,value:jm(a,{signed:r}),bytes:a}},xu=function s(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return s(t)}):typeof e=="number"?Im(e):e},V0=function(e){return Array.isArray(e)?e.map(function(t){return xu(t)}):[xu(e)]},q0=function s(e,t,i){if(i>=t.length)return t.length;var r=nn(t,i,!1);if(Le(e.bytes,r.bytes))return i;var n=nn(t,i+r.length);return s(e,t,i+n.length+n.value+r.length)},Su=function s(e,t){t=V0(t),e=ue(e);var i=[];if(!t.length)return i;for(var r=0;r<e.length;){var n=nn(e,r,!1),a=nn(e,r+n.length),l=r+n.length+a.length;a.value===127&&(a.value=q0(n,e,l),a.value!==e.length&&(a.value-=l));var c=l+a.value>e.length?e.length:l+a.value,f=e.subarray(l,c);Le(t[0],n.bytes)&&(t.length===1?i.push(f):i=i.concat(s(f,t.slice(1))));var g=n.length+a.length+f.length;r+=g}return i},H0=ue([0,0,0,1]),z0=ue([0,0,1]),$0=ue([0,0,3]),G0=function(e){for(var t=[],i=1;i<e.length-2;)Le(e.subarray(i,i+3),$0)&&(t.push(i+2),i++),i++;if(t.length===0)return e;var r=e.length-t.length,n=new Uint8Array(r),a=0;for(i=0;i<r;a++,i++)a===t[0]&&(a++,t.shift()),n[i]=e[a];return n},Lc=function(e,t,i,r){e=ue(e),i=[].concat(i);for(var n=0,a,l=0;n<e.length&&(l<r||a);){var c=void 0;if(Le(e.subarray(n),H0)?c=4:Le(e.subarray(n),z0)&&(c=3),!c){n++;continue}if(l++,a)return G0(e.subarray(a,n));var f=void 0;t==="h264"?f=e[n+c]&31:t==="h265"&&(f=e[n+c]>>1&63),i.indexOf(f)!==-1&&(a=n+c),n+=c+(t==="h264"?1:2)}return e.subarray(0,0)},W0=function(e,t,i){return Lc(e,"h264",t,i)},X0=function(e,t,i){return Lc(e,"h265",t,i)},lt={webm:ue([119,101,98,109]),matroska:ue([109,97,116,114,111,115,107,97]),flac:ue([102,76,97,67]),ogg:ue([79,103,103,83]),ac3:ue([11,119]),riff:ue([82,73,70,70]),avi:ue([65,86,73]),wav:ue([87,65,86,69]),"3gp":ue([102,116,121,112,51,103]),mp4:ue([102,116,121,112]),fmp4:ue([115,116,121,112]),mov:ue([102,116,121,112,113,116]),moov:ue([109,111,111,118]),moof:ue([109,111,111,102])},ps={aac:function(e){var t=er(e);return Le(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=er(e);return Le(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=Su(e,[Kr.EBML,Kr.DocType])[0];return Le(t,lt.webm)},mkv:function(e){var t=Su(e,[Kr.EBML,Kr.DocType])[0];return Le(t,lt.matroska)},mp4:function(e){if(ps["3gp"](e)||ps.mov(e))return!1;if(Le(e,lt.mp4,{offset:4})||Le(e,lt.fmp4,{offset:4})||Le(e,lt.moof,{offset:4})||Le(e,lt.moov,{offset:4}))return!0},mov:function(e){return Le(e,lt.mov,{offset:4})},"3gp":function(e){return Le(e,lt["3gp"],{offset:4})},ac3:function(e){var t=er(e);return Le(e,lt.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=er(e);return Le(e,lt.flac,{offset:t})},ogg:function(e){return Le(e,lt.ogg)},avi:function(e){return Le(e,lt.riff)&&Le(e,lt.avi,{offset:8})},wav:function(e){return Le(e,lt.riff)&&Le(e,lt.wav,{offset:8})},h264:function(e){return W0(e,7,3).length},h265:function(e){return X0(e,[32,33],3).length}},za=Object.keys(ps).filter(function(s){return s!=="ts"&&s!=="h264"&&s!=="h265"}).concat(["ts","h264","h265"]);za.forEach(function(s){var e=ps[s];ps[s]=function(t){return e(ue(t))}});var Y0=ps,To=function(e){e=ue(e);for(var t=0;t<za.length;t++){var i=za[t];if(Y0[i](e))return i}return""},K0=function(e){return F0(e,["moof"]).length>0},Aa,Cu;function Q0(){if(Cu)return Aa;Cu=1;var s=9e4,e,t,i,r,n,a,l;return e=function(c){return c*s},t=function(c,f){return c*f},i=function(c){return c/s},r=function(c,f){return c/f},n=function(c,f){return e(r(c,f))},a=function(c,f){return t(i(c),f)},l=function(c,f,g){return i(g?c:c-f)},Aa={ONE_SECOND_IN_TS:s,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:i,audioTsToSeconds:r,audioTsToVideoTs:n,videoTsToAudioTs:a,metadataTsToSeconds:l},Aa}var Mi=Q0();var $a="8.23.7";const si={},Ti=function(s,e){return si[s]=si[s]||[],e&&(si[s]=si[s].concat(e)),si[s]},J0=function(s,e){Ti(s,e)},Oc=function(s,e){const t=Ti(s).indexOf(e);return t<=-1?!1:(si[s]=si[s].slice(),si[s].splice(t,1),!0)},Z0=function(s,e){Ti(s,[].concat(e).map(t=>{const i=(...r)=>(Oc(s,i),t(...r));return i}))},an={prefixed:!0},tn=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],Eu=tn[0];let tr;for(let s=0;s<tn.length;s++)if(tn[s][1]in se){tr=tn[s];break}if(tr){for(let s=0;s<tr.length;s++)an[Eu[s]]=tr[s];an.prefixed=tr[0]!==Eu[0]}let dt=[];const eg=(s,e,t)=>(i,r,n)=>{const a=e.levels[r],l=new RegExp(`^(${a})$`);let c=s;if(i!=="log"&&n.unshift(i.toUpperCase()+":"),t&&(c=`%c${s}`,n.unshift(t)),n.unshift(c+":"),dt){dt.push([].concat(n));const g=dt.length-1e3;dt.splice(0,g>0?g:0)}if(!w.console)return;let f=w.console[i];!f&&i==="debug"&&(f=w.console.info||w.console.log),!(!f||!a||!l.test(i))&&f[Array.isArray(n)?"apply":"call"](w.console,n)};function Ga(s,e=":",t=""){let i="info",r;function n(...a){r("log",i,a)}return r=eg(s,n,t),n.createLogger=(a,l,c)=>{const f=l!==void 0?l:e,g=c!==void 0?c:t,y=`${s} ${f} ${a}`;return Ga(y,f,g)},n.createNewLogger=(a,l,c)=>Ga(a,l,c),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:i},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);i=a}return i},n.history=()=>dt?[].concat(dt):[],n.history.filter=a=>(dt||[]).filter(l=>new RegExp(`.*${a}.*`).test(l[0])),n.history.clear=()=>{dt&&(dt.length=0)},n.history.disable=()=>{dt!==null&&(dt.length=0,dt=null)},n.history.enable=()=>{dt===null&&(dt=[])},n.error=(...a)=>r("error",i,a),n.warn=(...a)=>r("warn",i,a),n.debug=(...a)=>r("debug",i,a),n}const ye=Ga("VIDEOJS"),Mc=ye.createLogger,tg=Object.prototype.toString,Rc=function(s){return Yt(s)?Object.keys(s):[]};function is(s,e){Rc(s).forEach(t=>e(s[t],t))}function Nc(s,e,t=0){return Rc(s).reduce((i,r)=>e(i,s[r],r),t)}function Yt(s){return!!s&&typeof s=="object"}function ms(s){return Yt(s)&&tg.call(s)==="[object Object]"&&s.constructor===Object}function Ee(...s){const e={};return s.forEach(t=>{t&&is(t,(i,r)=>{if(!ms(i)){e[r]=i;return}ms(e[r])||(e[r]={}),e[r]=Ee(e[r],i)})}),e}function Bc(s={}){const e=[];for(const t in s)if(s.hasOwnProperty(t)){const i=s[t];e.push(i)}return e}function jn(s,e,t,i=!0){const r=a=>Object.defineProperty(s,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return i&&(n.set=r),Object.defineProperty(s,e,n)}var ig=Object.freeze({__proto__:null,each:is,reduce:Nc,isObject:Yt,isPlain:ms,merge:Ee,values:Bc,defineLazyProperty:jn});let xo=!1,Fc=null,Nt=!1,Uc,Vc=!1,ss=!1,rs=!1,Kt=!1,So=null,In=null;const sg=!!(w.cast&&w.cast.framework&&w.cast.framework.CastReceiverContext);let qc=null,on=!1,Pn=!1,ln=!1,Ln=!1,un=!1,cn=!1,dn=!1;const cr=!!(bs()&&("ontouchstart"in w||w.navigator.maxTouchPoints||w.DocumentTouch&&w.document instanceof w.DocumentTouch)),vi=w.navigator&&w.navigator.userAgentData;vi&&vi.platform&&vi.brands&&(Nt=vi.platform==="Android",ss=!!vi.brands.find(s=>s.brand==="Microsoft Edge"),rs=!!vi.brands.find(s=>s.brand==="Chromium"),Kt=!ss&&rs,So=In=(vi.brands.find(s=>s.brand==="Chromium")||{}).version||null,Pn=vi.platform==="Windows");if(!rs){const s=w.navigator&&w.navigator.userAgent||"";xo=/iPod/i.test(s),Fc=(function(){const e=s.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null})(),Nt=/Android/i.test(s),Uc=(function(){const e=s.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null})(),Vc=/Firefox/i.test(s),ss=/Edg/i.test(s),rs=/Chrome/i.test(s)||/CriOS/i.test(s),Kt=!ss&&rs,So=In=(function(){const e=s.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null})(),qc=(function(){const e=/MSIE\s(\d+)\.\d/.exec(s);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(s)&&/rv:11.0/.test(s)&&(t=11),t})(),un=/Tizen/i.test(s),cn=/Web0S/i.test(s),dn=un||cn,on=/Safari/i.test(s)&&!Kt&&!Nt&&!ss&&!dn,Pn=/Windows/i.test(s),ln=/iPad/i.test(s)||on&&cr&&!/iPhone/i.test(s),Ln=/iPhone/i.test(s)&&!ln}const it=Ln||ln||xo,On=(on||it)&&!Kt;var Hc=Object.freeze({__proto__:null,get IS_IPOD(){return xo},get IOS_VERSION(){return Fc},get IS_ANDROID(){return Nt},get ANDROID_VERSION(){return Uc},get IS_FIREFOX(){return Vc},get IS_EDGE(){return ss},get IS_CHROMIUM(){return rs},get IS_CHROME(){return Kt},get CHROMIUM_VERSION(){return So},get CHROME_VERSION(){return In},IS_CHROMECAST_RECEIVER:sg,get IE_VERSION(){return qc},get IS_SAFARI(){return on},get IS_WINDOWS(){return Pn},get IS_IPAD(){return ln},get IS_IPHONE(){return Ln},get IS_TIZEN(){return un},get IS_WEBOS(){return cn},get IS_SMART_TV(){return dn},TOUCH_ENABLED:cr,IS_IOS:it,IS_ANY_SAFARI:On});function Au(s){return typeof s=="string"&&!!s.trim()}function rg(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function bs(){return se===w.document}function Ts(s){return Yt(s)&&s.nodeType===1}function zc(){try{return w.parent!==w.self}catch{return!0}}function $c(s){return function(e,t){if(!Au(e))return se[s](null);Au(t)&&(t=se.querySelector(t));const i=Ts(t)?t:se;return i[s]&&i[s](e)}}function ce(s="div",e={},t={},i){const r=se.createElement(s);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?Si(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),i&&Co(r,i),r}function Si(s,e){return typeof s.textContent>"u"?s.innerText=e:s.textContent=e,s}function Wa(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function rr(s,e){return rg(e),s.classList.contains(e)}function Bi(s,...e){return s.classList.add(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s}function Mn(s,...e){return s?(s.classList.remove(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s):(ye.warn("removeClass was called with an element that doesn't exist"),null)}function Gc(s,e,t){return typeof t=="function"&&(t=t(s,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(i=>s.classList.toggle(i,t)),s}function Wc(s,e){Object.getOwnPropertyNames(e).forEach(function(t){const i=e[t];i===null||typeof i>"u"||i===!1?s.removeAttribute(t):s.setAttribute(t,i===!0?"":i)})}function _i(s){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(s&&s.attributes&&s.attributes.length>0){const i=s.attributes;for(let r=i.length-1;r>=0;r--){const n=i[r].name;let a=i[r].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function Xc(s,e){return s.getAttribute(e)}function gs(s,e,t){s.setAttribute(e,t)}function Rn(s,e){s.removeAttribute(e)}function Yc(){se.body.focus(),se.onselectstart=function(){return!1}}function Kc(){se.onselectstart=function(){return!0}}function vs(s){if(s&&s.getBoundingClientRect&&s.parentNode){const e=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(i=>{e[i]!==void 0&&(t[i]=e[i])}),t.height||(t.height=parseFloat(ys(s,"height"))),t.width||(t.width=parseFloat(ys(s,"width"))),t}}function dr(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};const e=s.offsetWidth,t=s.offsetHeight;let i=0,r=0;for(;s.offsetParent&&s!==se[an.fullscreenElement];)i+=s.offsetLeft,r+=s.offsetTop,s=s.offsetParent;return{left:i,top:r,width:e,height:t}}function Nn(s,e){const t={x:0,y:0};if(it){let g=s;for(;g&&g.nodeName.toLowerCase()!=="html";){const y=ys(g,"transform");if(/^matrix/.test(y)){const k=y.slice(7,-1).split(/,\s/).map(Number);t.x+=k[4],t.y+=k[5]}else if(/^matrix3d/.test(y)){const k=y.slice(9,-1).split(/,\s/).map(Number);t.x+=k[12],t.y+=k[13]}if(g.assignedSlot&&g.assignedSlot.parentElement&&w.WebKitCSSMatrix){const k=w.getComputedStyle(g.assignedSlot.parentElement).transform,E=new w.WebKitCSSMatrix(k);t.x+=E.m41,t.y+=E.m42}g=g.parentNode||g.host}}const i={},r=dr(e.target),n=dr(s),a=n.width,l=n.height;let c=e.offsetY-(n.top-r.top),f=e.offsetX-(n.left-r.left);return e.changedTouches&&(f=e.changedTouches[0].pageX-n.left,c=e.changedTouches[0].pageY+n.top,it&&(f-=t.x,c-=t.y)),i.y=1-Math.max(0,Math.min(1,c/l)),i.x=Math.max(0,Math.min(1,f/a)),i}function Qc(s){return Yt(s)&&s.nodeType===3}function Bn(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function Jc(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(e=>{if(typeof e=="function"&&(e=e()),Ts(e)||Qc(e))return e;if(typeof e=="string"&&/\S/.test(e))return se.createTextNode(e)}).filter(e=>e)}function Co(s,e){return Jc(e).forEach(t=>s.appendChild(t)),s}function Zc(s,e){return Co(Bn(s),e)}function hr(s){return s.button===void 0&&s.buttons===void 0||s.button===0&&s.buttons===void 0||s.type==="mouseup"&&s.button===0&&s.buttons===0||s.type==="mousedown"&&s.button===0&&s.buttons===0?!0:!(s.button!==0||s.buttons!==1)}const xi=$c("querySelector"),ed=$c("querySelectorAll");function ys(s,e){if(!s||!e)return"";if(typeof w.getComputedStyle=="function"){let t;try{t=w.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function td(s){[...se.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),i=se.createElement("style");i.textContent=t,s.document.head.appendChild(i)}catch{const i=se.createElement("link");i.rel="stylesheet",i.type=e.type,i.media=e.media.mediaText,i.href=e.href,s.document.head.appendChild(i)}})}var id=Object.freeze({__proto__:null,isReal:bs,isEl:Ts,isInFrame:zc,createEl:ce,textContent:Si,prependTo:Wa,hasClass:rr,addClass:Bi,removeClass:Mn,toggleClass:Gc,setAttributes:Wc,getAttributes:_i,getAttribute:Xc,setAttribute:gs,removeAttribute:Rn,blockTextSelection:Yc,unblockTextSelection:Kc,getBoundingClientRect:vs,findPosition:dr,getPointerPosition:Nn,isTextNode:Qc,emptyEl:Bn,normalizeContent:Jc,appendContent:Co,insertContent:Zc,isSingleLeftClick:hr,$:xi,$$:ed,computedStyle:ys,copyStyleSheetsToWindow:td});let sd=!1,Xa;const ng=function(){if(Xa.options.autoSetup===!1)return;const s=Array.prototype.slice.call(se.getElementsByTagName("video")),e=Array.prototype.slice.call(se.getElementsByTagName("audio")),t=Array.prototype.slice.call(se.getElementsByTagName("video-js")),i=s.concat(e,t);if(i&&i.length>0)for(let r=0,n=i.length;r<n;r++){const a=i[r];if(a&&a.getAttribute)a.player===void 0&&a.getAttribute("data-setup")!==null&&Xa(a);else{Ya(1);break}}else sd||Ya(1)};function Ya(s,e){bs()&&(e&&(Xa=e),w.setTimeout(ng,s))}function Ka(){sd=!0,w.removeEventListener("load",Ka)}bs()&&(se.readyState==="complete"?Ka():w.addEventListener("load",Ka));const rd=function(s){const e=se.createElement("style");return e.className=s,e},nd=function(s,e){s.styleSheet?s.styleSheet.cssText=e:s.textContent=e};var ct=new WeakMap;const ag=3;let og=ag;function kt(){return og++}function wu(s,e){if(!ct.has(s))return;const t=ct.get(s);t.handlers[e].length===0&&(delete t.handlers[e],s.removeEventListener?s.removeEventListener(e,t.dispatcher,!1):s.detachEvent&&s.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&&ct.delete(s)}function Eo(s,e,t,i){t.forEach(function(r){s(e,r,i)})}function Fn(s){if(s.fixed_)return s;function e(){return!0}function t(){return!1}if(!s||!s.isPropagationStopped||!s.isImmediatePropagationStopped){const i=s||w.event;s={};const r=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const n in i)r.includes(n)||n==="returnValue"&&i.preventDefault||(s[n]=i[n]);if(s.target||(s.target=s.srcElement||se),s.relatedTarget||(s.relatedTarget=s.fromElement===s.target?s.toElement:s.fromElement),s.preventDefault=function(){i.preventDefault&&i.preventDefault(),s.returnValue=!1,i.returnValue=!1,s.defaultPrevented=!0},s.defaultPrevented=!1,s.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),s.cancelBubble=!0,i.cancelBubble=!0,s.isPropagationStopped=e},s.isPropagationStopped=t,s.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),s.isImmediatePropagationStopped=e,s.stopPropagation()},s.isImmediatePropagationStopped=t,s.clientX!==null&&s.clientX!==void 0){const n=se.documentElement,a=se.body;s.pageX=s.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0),s.pageY=s.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}s.which=s.charCode||s.keyCode,s.button!==null&&s.button!==void 0&&(s.button=s.button&1?0:s.button&4?1:s.button&2?2:0)}return s.fixed_=!0,s}let Qr;const lg=function(){if(typeof Qr!="boolean"){Qr=!1;try{const s=Object.defineProperty({},"passive",{get(){Qr=!0}});w.addEventListener("test",null,s),w.removeEventListener("test",null,s)}catch{}}return Qr},ug=["touchstart","touchmove"];function bt(s,e,t){if(Array.isArray(e))return Eo(bt,s,e,t);ct.has(s)||ct.set(s,{});const i=ct.get(s);if(i.handlers||(i.handlers={}),i.handlers[e]||(i.handlers[e]=[]),t.guid||(t.guid=kt()),i.handlers[e].push(t),i.dispatcher||(i.disabled=!1,i.dispatcher=function(r,n){if(i.disabled)return;r=Fn(r);const a=i.handlers[r.type];if(a){const l=a.slice(0);for(let c=0,f=l.length;c<f&&!r.isImmediatePropagationStopped();c++)try{l[c].call(s,r,n)}catch(g){ye.error(g)}}}),i.handlers[e].length===1)if(s.addEventListener){let r=!1;lg()&&ug.indexOf(e)>-1&&(r={passive:!0}),s.addEventListener(e,i.dispatcher,r)}else s.attachEvent&&s.attachEvent("on"+e,i.dispatcher)}function st(s,e,t){if(!ct.has(s))return;const i=ct.get(s);if(!i.handlers)return;if(Array.isArray(e))return Eo(st,s,e,t);const r=function(a,l){i.handlers[l]=[],wu(a,l)};if(e===void 0){for(const a in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},a)&&r(s,a);return}const n=i.handlers[e];if(n){if(!t){r(s,e);return}if(t.guid)for(let a=0;a<n.length;a++)n[a].guid===t.guid&&n.splice(a--,1);wu(s,e)}}function xs(s,e,t){const i=ct.has(s)?ct.get(s):{},r=s.parentNode||s.ownerDocument;if(typeof e=="string"?e={type:e,target:s}:e.target||(e.target=s),e=Fn(e),i.dispatcher&&i.dispatcher.call(s,e,t),r&&!e.isPropagationStopped()&&e.bubbles===!0)xs.call(null,r,e,t);else if(!r&&!e.defaultPrevented&&e.target&&e.target[e.type]){ct.has(e.target)||ct.set(e.target,{});const n=ct.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 Un(s,e,t){if(Array.isArray(e))return Eo(Un,s,e,t);const i=function(){st(s,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||kt(),bt(s,e,i)}function Ao(s,e,t){const i=function(){st(s,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||kt(),bt(s,e,i)}var cg=Object.freeze({__proto__:null,fixEvent:Fn,on:bt,off:st,trigger:xs,one:Un,any:Ao});const jt=30,De=function(s,e,t){e.guid||(e.guid=kt());const i=e.bind(s);return i.guid=t?t+"_"+e.guid:e.guid,i},Qt=function(s,e){let t=w.performance.now();return function(...r){const n=w.performance.now();n-t>=e&&(s(...r),t=n)}},ad=function(s,e,t,i=w){let r;const n=()=>{i.clearTimeout(r),r=null},a=function(){const l=this,c=arguments;let f=function(){r=null,f=null,t||s.apply(l,c)};!r&&t&&s.apply(l,c),i.clearTimeout(r),r=i.setTimeout(f,e)};return a.cancel=n,a};var dg=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:jt,bind_:De,throttle:Qt,debounce:ad});let Qs;class Tt{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},bt(this,e,t),this.addEventListener=i}off(e,t){st(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Un(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Ao(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=Fn(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),xs(this,e)}queueTrigger(e){Qs||(Qs=new Map);const t=e.type||e;let i=Qs.get(this);i||(i=new Map,Qs.set(this,i));const r=i.get(t);i.delete(t),w.clearTimeout(r);const n=w.setTimeout(()=>{i.delete(t),i.size===0&&(i=null,Qs.delete(this)),this.trigger(e)},0);i.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 Vn=s=>typeof s.name=="function"?s.name():typeof s.name=="string"?s.name:s.name_?s.name_:s.constructor&&s.constructor.name?s.constructor.name:typeof s,ni=s=>s instanceof Tt||!!s.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof s[e]=="function"),hg=(s,e)=>{ni(s)?e():(s.eventedCallbacks||(s.eventedCallbacks=[]),s.eventedCallbacks.push(e))},Qa=s=>typeof s=="string"&&/\S/.test(s)||Array.isArray(s)&&!!s.length,hn=(s,e,t)=>{if(!s||!s.nodeName&&!ni(s))throw new Error(`Invalid target for ${Vn(e)}#${t}; must be a DOM node or evented object.`)},od=(s,e,t)=>{if(!Qa(s))throw new Error(`Invalid event type for ${Vn(e)}#${t}; must be a non-empty string or array.`)},ld=(s,e,t)=>{if(typeof s!="function")throw new Error(`Invalid listener for ${Vn(e)}#${t}; must be a function.`)},wa=(s,e,t)=>{const i=e.length<3||e[0]===s||e[0]===s.eventBusEl_;let r,n,a;return i?(r=s.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(r=e[0],n=e[1],a=e[2]),hn(r,s,t),od(n,s,t),ld(a,s,t),a=De(s,a),{isTargetingSelf:i,target:r,type:n,listener:a}},Pi=(s,e,t,i)=>{hn(s,s,e),s.nodeName?cg[e](s,t,i):s[e](t,i)},fg={on(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=wa(this,s,"on");if(Pi(t,"on",i,r),!e){const n=()=>this.off(t,i,r);n.guid=r.guid;const a=()=>this.off("dispose",n);a.guid=r.guid,Pi(this,"on","dispose",n),Pi(t,"on","dispose",a)}},one(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=wa(this,s,"one");if(e)Pi(t,"one",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Pi(t,"one",i,n)}},any(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=wa(this,s,"any");if(e)Pi(t,"any",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Pi(t,"any",i,n)}},off(s,e,t){if(!s||Qa(s))st(this.eventBusEl_,s,e);else{const i=s,r=e;hn(i,this,"off"),od(r,this,"off"),ld(t,this,"off"),t=De(this,t),this.off("dispose",t),i.nodeName?(st(i,r,t),st(i,"dispose",t)):ni(i)&&(i.off(r,t),i.off("dispose",t))}},trigger(s,e){hn(this.eventBusEl_,this,"trigger");const t=s&&typeof s!="string"?s.type:s;if(!Qa(t))throw new Error(`Invalid event type for ${Vn(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return xs(this.eventBusEl_,s,e)}};function wo(s,e={}){const{eventBusKey:t}=e;if(t){if(!s[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);s.eventBusEl_=s[t]}else s.eventBusEl_=ce("span",{className:"vjs-event-bus"});return Object.assign(s,fg),s.eventedCallbacks&&s.eventedCallbacks.forEach(i=>{i()}),s.on("dispose",()=>{s.off(),[s,s.el_,s.eventBusEl_].forEach(function(i){i&&ct.has(i)&&ct.delete(i)}),w.setTimeout(()=>{s.eventBusEl_=null},0)}),s}const pg={state:{},setState(s){typeof s=="function"&&(s=s());let e;return is(s,(t,i)=>{this.state[i]!==t&&(e=e||{},e[i]={from:this.state[i],to:t}),this.state[i]=t}),e&&ni(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function ud(s,e){return Object.assign(s,pg),s.state=Object.assign({},s.state,e),typeof s.handleStateChanged=="function"&&ni(s)&&s.on("statechanged",s.handleStateChanged),s}const nr=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toLowerCase())},Be=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},cd=function(s,e){return Be(s)===Be(e)};var mg=Object.freeze({__proto__:null,toLowerCase:nr,toTitleCase:Be,titleCaseEquals:cd});class X{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Ee({},this.options_),t=this.options_=Ee(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_${kt()}`}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&&(wo(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),ud(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(i),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_=Ee(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return ce(e,t,i)}localize(e,t,i=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],c=n&&n[l];let f=i;return a&&a[e]?f=a[e]:c&&c[e]&&(f=c[e]),t&&(f=f.replace(/\{(\d+)\}/g,function(g,y){const k=t[y-1];let E=k;return typeof k>"u"&&(E=g),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((i,r)=>i.concat(r),[]);let t=this;for(let i=0;i<e.length;i++)if(t=t.getChild(e[i]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const i="http://www.w3.org/2000/svg",r=ce("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=se.createElementNS(i,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const a=se.createElementNS(i,"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={},i=this.children_.length){let r,n;if(typeof e=="string"){n=Be(e);const a=t.componentClass||n;t.name=n;const l=X.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(i,0,r),r.parentComponent_=this,typeof r.id=="function"&&(this.childIndex_[r.id()]=r),n=n||r.name&&Be(r.name()),n&&(this.childNameIndex_[n]=r,this.childNameIndex_[nr(n)]=r),typeof r.el=="function"&&r.el()){let a=null;this.children_[i+1]&&(this.children_[i+1].el_?a=this.children_[i+1].el_:Ts(this.children_[i+1])&&(a=this.children_[i+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_[Be(e.name())]=null,this.childNameIndex_[nr(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=a=>{const l=a.name;let c=a.opts;if(t[l]!==void 0&&(c=t[l]),c===!1)return;c===!0&&(c={}),c.playerOptions=this.options_.playerOptions;const f=this.addChild(l,c);f&&(this[l]=f)};let r;const n=X.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,c;return typeof a=="string"?(l=a,c=e[l]||this.options_[l]||{}):(l=a.name,c=a),{name:l,opts:c}}).filter(a=>{const l=X.getComponent(a.opts.componentClass||Be(a.name));return l&&!n.isTech(l)}).forEach(i)}}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 xi(e,t||this.contentEl())}$$(e,t){return ed(e,t||this.contentEl())}hasClass(e){return rr(this.el_,e)}addClass(...e){Bi(this.el_,...e)}removeClass(...e){Mn(this.el_,...e)}toggleClass(e,t){Gc(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 Xc(this.el_,e)}setAttribute(e,t){gs(this.el_,e,t)}removeAttribute(e){Rn(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,i){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",i||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"+Be(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=ys(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const i=`offset${Be(e)}`;t=this.el_[i]}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},i={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:i}}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 i=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=w.performance.now(),n=!0)}),this.on("touchmove",function(l){if(l.touches.length>1)n=!1;else if(t){const c=l.touches[0].pageX-t.pageX,f=l.touches[0].pageY-t.pageY;Math.sqrt(c*c+f*f)>i&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(l){t=null,n===!0&&w.performance.now()-e<r&&(l.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=De(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const i=function(r){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=De(this,e),this.clearTimersOnDispose_(),i=w.setTimeout(()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),w.clearTimeout(e)),e}setInterval(e,t){e=De(this,e),this.clearTimersOnDispose_();const i=w.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),w.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=De(this,e),t=w.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=De(this,t);const i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),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),w.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((i,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=w.getComputedStyle(n,null),l=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(l)}function i(n){return!(!t(n.parentElement)||!t(n)||n.style.opacity==="0"||w.getComputedStyle(n).height==="0px"||w.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>(se.documentElement.clientWidth||w.innerWidth)||a.y<0||a.y>(se.documentElement.clientHeight||w.innerHeight))return!1;let l=se.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)&&i(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 i=X.getComponent("Tech"),r=i&&i.isTech(t),n=X===t||X.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=Be(e),X.components_||(X.components_={});const a=X.getComponent("Player");if(e==="Player"&&a&&a.players){const l=a.players,c=Object.keys(l);if(l&&c.length>0){for(let f=0;f<c.length;f++)if(l[c[f]]!==null)throw new Error("Can not register Player component after player has been created.")}}return X.components_[e]=t,X.components_[nr(e)]=t,t}static getComponent(e){if(!(!e||!X.components_))return X.components_[e]}}X.registerComponent("Component",X);function gg(s,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${s}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function Du(s,e,t,i){return gg(s,i,t.length-1),t[i][e]}function Da(s){let e;return s===void 0||s.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:s.length,start:Du.bind(null,"start",0,s),end:Du.bind(null,"end",1,s)},w.Symbol&&w.Symbol.iterator&&(e[w.Symbol.iterator]=()=>(s||[]).values()),e}function Rt(s,e){return Array.isArray(s)?Da(s):s===void 0||e===void 0?Da():Da([[s,e]])}const dd=function(s,e){s=s<0?0:s;let t=Math.floor(s%60),i=Math.floor(s/60%60),r=Math.floor(s/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(s)||s===1/0)&&(r=i=t="-"),r=r>0||a>0?r+":":"",i=((r||n>=10)&&i<10?"0"+i:i)+":",t=t<10?"0"+t:t,r+i+t};let Do=dd;function hd(s){Do=s}function fd(){Do=dd}function qi(s,e=s){return Do(s,e)}var vg=Object.freeze({__proto__:null,createTimeRanges:Rt,createTimeRange:Rt,setFormatTime:hd,resetFormatTime:fd,formatTime:qi});function pd(s,e){let t=0,i,r;if(!e)return 0;(!s||!s.length)&&(s=Rt(0,0));for(let n=0;n<s.length;n++)i=s.start(n),r=s.end(n),r>e&&(r=e),t+=r-i;return t/e}function Re(s){if(s instanceof Re)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:Yt(s)&&(typeof s.code=="number"&&(this.code=s.code),Object.assign(this,s)),this.message||(this.message=Re.defaultMessages[this.code]||"")}Re.prototype.code=0;Re.prototype.message="";Re.prototype.status=null;Re.prototype.metadata=null;Re.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Re.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."};Re.MEDIA_ERR_CUSTOM=0;Re.prototype.MEDIA_ERR_CUSTOM=0;Re.MEDIA_ERR_ABORTED=1;Re.prototype.MEDIA_ERR_ABORTED=1;Re.MEDIA_ERR_NETWORK=2;Re.prototype.MEDIA_ERR_NETWORK=2;Re.MEDIA_ERR_DECODE=3;Re.prototype.MEDIA_ERR_DECODE=3;Re.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Re.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Re.MEDIA_ERR_ENCRYPTED=5;Re.prototype.MEDIA_ERR_ENCRYPTED=5;function ar(s){return s!=null&&typeof s.then=="function"}function $t(s){ar(s)&&s.then(null,e=>{})}const Ja=function(s){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,i,r)=>(s[i]&&(t[i]=s[i]),t),{cues:s.cues&&Array.prototype.map.call(s.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},yg=function(s){const e=s.$$("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(s.textTracks(),function(r){return t.indexOf(r)===-1}).map(Ja))},_g=function(s,e){return s.forEach(function(t){const i=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>i.addCue(r))}),e.textTracks()};var Za={textTracksToJson:yg,jsonToTextTracks:_g,trackToJson:Ja};const ka="vjs-modal-dialog";class Ss extends X{constructor(e,t){super(e,t),this.handleKeyDown_=i=>this.handleKeyDown(i),this.close_=i=>this.close(i),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=ce("div",{className:`${ka}-content`},{role:"document"}),this.descEl_=ce("p",{className:`${ka}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),Si(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`${ka} 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 i=this.getChild("closeButton");if(t&&!i){const r=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),Zc(t,e),this.trigger("modalfill"),r?i.insertBefore(t,r):i.appendChild(t);const n=this.getChild("closeButton");n&&i.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),Bn(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=se.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_(),i=this.el_.querySelector(":focus");let r;for(let n=0;n<t.length;n++)if(i===t[n]){r=n;break}se.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 w.HTMLAnchorElement||t instanceof w.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof w.HTMLInputElement||t instanceof w.HTMLSelectElement||t instanceof w.HTMLTextAreaElement||t instanceof w.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof w.HTMLIFrameElement||t instanceof w.HTMLObjectElement||t instanceof w.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}Ss.prototype.options_={pauseOnOpen:!0,temporary:!0};X.registerComponent("ModalDialog",Ss);class Hi extends Tt{constructor(e=[]){super(),this.tracks_=[];for(let t=0;t<e.length;t++)this.addTrack(e[t])}get length(){return this.tracks_.length}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})},ni(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,r=this.length;i<r;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,r=this.length;i<r;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}Hi.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const s in Hi.prototype.allowedEvents_)Hi.prototype["on"+s]=null;const ja=function(s,e){for(let t=0;t<s.length;t++)!Object.keys(s[t]).length||e.id===s[t].id||(s[t].enabled=!1)};class md extends Hi{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){ja(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&ja(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,ja(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 Ia=function(s,e){for(let t=0;t<s.length;t++)!Object.keys(s[t]).length||e.id===s[t].id||(s[t].selected=!1)};class gd extends Hi{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Ia(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&&Ia(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Ia(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 ko extends Hi{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 bg{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;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 i=0,r=this.trackElements_.length;i<r;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;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 fn{constructor(e){fn.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let i=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(i=t;i<r;i++)n.call(this,i)}getCueById(e){let t=null;for(let i=0,r=this.length;i<r;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}const Tg={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},xg={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Sg={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},ku={disabled:"disabled",hidden:"hidden",showing:"showing"};class jo extends Tt{constructor(e={}){super();const t={id:e.id||"vjs_track_"+kt(),kind:e.kind||"",language:e.language||""};let i=e.label||"";for(const r in t)Object.defineProperty(this,r,{get(){return t[r]},set(){}});Object.defineProperty(this,"label",{get(){return i},set(r){r!==i&&(i=r,this.trigger("labelchange"))}})}}const Io=function(s){return new URL(s,se.baseURI)},vd=function(s){return new URL(s,se.baseURI).href},Po=function(s){if(typeof s=="string"){const t=s.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():""}return""},qn=function(s,e=w.location){return Io(s).origin!==e.origin};var Cg=Object.freeze({__proto__:null,parseUrl:Io,getAbsoluteURL:vd,getFileExtension:Po,isCrossOrigin:qn});const ju=function(s,e){const t=new w.WebVTT.Parser(w,w.vttjs,w.WebVTT.StringDecoder()),i=[];t.oncue=function(r){e.addCue(r)},t.onparsingerror=function(r){i.push(r)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(s),i.length>0&&(w.console&&w.console.groupCollapsed&&w.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),i.forEach(r=>ye.error(r)),w.console&&w.console.groupEnd&&w.console.groupEnd()),t.flush()},Iu=function(s,e){const t={uri:s},i=qn(s);i&&(t.cors=i);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),_c(t,De(this,function(n,a,l){if(n)return ye.error(n,a);e.loaded_=!0,typeof w.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],c=>{if(c.type==="vttjserror"){ye.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return ju(l,e)}):ju(l,e)}))};class mr extends jo{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Ee(e,{kind:Sg[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=ku[t.mode]||"disabled";const r=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new fn(this.cues_),a=new fn(this.activeCues_);let l=!1;this.timeupdateHandler=De(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 c=()=>{this.stopTracking()};this.tech_.one("dispose",c),i!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return i},set(f){ku[f]&&i!==f&&(i=f,!this.preload_&&i!=="disabled"&&this.cues.length===0&&Iu(this.src,this),this.stopTracking(),i!=="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(),g=[];for(let y=0,k=this.cues.length;y<k;y++){const E=this.cues[y];E.startTime<=f&&E.endTime>=f&&g.push(E)}if(l=!1,g.length!==this.activeCues_.length)l=!0;else for(let y=0;y<g.length;y++)this.activeCues_.indexOf(g[y])===-1&&(l=!0);return this.activeCues_=g,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")&&Iu(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 w.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 i=this.tech_.textTracks();for(let r=0;r<i.length;r++)i[r]!==this&&i[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 i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}mr.prototype.allowedEvents_={cuechange:"cuechange"};class yd extends jo{constructor(e={}){const t=Ee(e,{kind:xg[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"enabled",{get(){return i},set(r){typeof r!="boolean"||r===i||(i=r,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class _d extends jo{constructor(e={}){const t=Ee(e,{kind:Tg[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get(){return i},set(r){typeof r!="boolean"||r===i||(i=r,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class ai extends Tt{constructor(e={}){super();let t;const i=new mr(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return i}}}),t=ai.NONE,i.addEventListener("loadeddata",()=>{t=ai.LOADED,this.trigger({type:"load",target:this})})}}ai.prototype.allowedEvents_={load:"load"};ai.NONE=0;ai.LOADING=1;ai.LOADED=2;ai.ERROR=3;const Dt={audio:{ListClass:md,TrackClass:yd,capitalName:"Audio"},video:{ListClass:gd,TrackClass:_d,capitalName:"Video"},text:{ListClass:ko,TrackClass:mr,capitalName:"Text"}};Object.keys(Dt).forEach(function(s){Dt[s].getterName=`${s}Tracks`,Dt[s].privateName=`${s}Tracks_`});const _s={remoteText:{ListClass:ko,TrackClass:mr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:bg,TrackClass:ai,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ut=Object.assign({},Dt,_s);_s.names=Object.keys(_s);Dt.names=Object.keys(Dt);ut.names=[].concat(_s.names).concat(Dt.names);function Eg(s,e,t,i,r={}){const n=s.textTracks();r.kind=e,t&&(r.label=t),i&&(r.language=i),r.tech=s;const a=new ut.text.TrackClass(r);return n.addTrack(a),a}class pe extends X{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=i=>this.onDurationChange(i),this.trackProgress_=i=>this.trackProgress(i),this.trackCurrentTime_=i=>this.trackCurrentTime(i),this.stopTrackingCurrentTime_=i=>this.stopTrackingCurrentTime(i),this.disposeSourceHandler_=i=>this.disposeSourceHandler(i),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),ut.names.forEach(i=>{const r=ut[i];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(i=>{e[`native${i}Tracks`]===!1&&(this[`featuresNative${i}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 ut.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(De(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 Rt(0,0)}bufferedPercent(){return pd(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(Dt.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const i=this[`${t}Tracks`]()||[];let r=i.length;for(;r--;){const n=i[r];t==="text"&&this.removeRemoteTextTrack(n),i.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new Re(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Rt(0,0):Rt()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){Dt.names.forEach(e=>{const t=Dt[e],i=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),this.on("dispose",()=>{r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!w.WebVTT)if(se.body.contains(this.el())){if(!this.options_["vtt.js"]&&ms(tu)&&Object.keys(tu).length>0){this.trigger("vttjsloaded");return}const e=se.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}),w.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=l=>e.addTrack(l.track),r=l=>e.removeTrack(l.track);t.on("addtrack",i),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let l=0;l<e.length;l++){const c=e[l];c.removeEventListener("cuechange",n),c.mode==="showing"&&c.addEventListener("cuechange",n)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",function(){t.off("addtrack",i),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,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return Eg(this,e,t,i)}createRemoteTextTrack(e){const t=Ee(e,{tech:this});return new _s.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const i=this.createRemoteTextTrack(e);return typeof t!="boolean"&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(i.track)),i}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=kt();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 pe.canPlayType(e.type)}static isTech(e){return e.prototype instanceof pe||e instanceof pe||e===pe}static registerTech(e,t){if(pe.techs_||(pe.techs_={}),!pe.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!pe.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!pe.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Be(e),pe.techs_[e]=t,pe.techs_[nr(e)]=t,e!=="Tech"&&pe.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(pe.techs_&&pe.techs_[e])return pe.techs_[e];if(e=Be(e),w&&w.videojs&&w.videojs[e])return ye.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),w.videojs[e]}}}ut.names.forEach(function(s){const e=ut[s];pe.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});pe.prototype.featuresVolumeControl=!0;pe.prototype.featuresMuteControl=!0;pe.prototype.featuresFullscreenResize=!1;pe.prototype.featuresPlaybackRate=!1;pe.prototype.featuresProgressEvents=!1;pe.prototype.featuresSourceset=!1;pe.prototype.featuresTimeupdateEvents=!1;pe.prototype.featuresNativeTextTracks=!1;pe.prototype.featuresVideoFrameCallback=!1;pe.withSourceHandlers=function(s){s.registerSourceHandler=function(t,i){let r=s.sourceHandlers;r||(r=s.sourceHandlers=[]),i===void 0&&(i=r.length),r.splice(i,0,t)},s.canPlayType=function(t){const i=s.sourceHandlers||[];let r;for(let n=0;n<i.length;n++)if(r=i[n].canPlayType(t),r)return r;return""},s.selectSourceHandler=function(t,i){const r=s.sourceHandlers||[];let n;for(let a=0;a<r.length;a++)if(n=r[a].canHandleSource(t,i),n)return r[a];return null},s.canPlaySource=function(t,i){const r=s.selectSourceHandler(t,i);return r?r.canHandleSource(t,i):""},["seekable","seeking","duration"].forEach(function(t){const i=this[t];typeof i=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):i.apply(this,arguments)})},s.prototype),s.prototype.setSource=function(t){let i=s.selectSourceHandler(t,this.options_);i||(s.nativeSourceHandler?i=s.nativeSourceHandler:ye.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==s.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},s.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)}};X.registerComponent("Tech",pe);pe.registerTech("Tech",pe);pe.defaultTechOrder_=[];const Fi={},pn={},mn={};function Ag(s,e){Fi[s]=Fi[s]||[],Fi[s].push(e)}function wg(s,e,t){s.setTimeout(()=>Li(e,Fi[e.type],t,s),1)}function Dg(s,e){s.forEach(t=>t.setTech&&t.setTech(e))}function kg(s,e,t){return s.reduceRight(Lo(t),e[t]())}function jg(s,e,t,i){return e[t](s.reduce(Lo(t),i))}function Pu(s,e,t,i=null){const r="call"+Be(t),n=s.reduce(Lo(r),i),a=n===mn,l=a?null:e[t](n);return Lg(s,t,l,a),l}const Ig={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Pg={setCurrentTime:1,setMuted:1,setVolume:1},Lu={play:1,pause:1};function Lo(s){return(e,t)=>e===mn?mn:t[s]?t[s](e):e}function Lg(s,e,t,i){for(let r=s.length-1;r>=0;r--){const n=s[r];n[e]&&n[e](i,t)}}function Og(s){pn.hasOwnProperty(s.id())&&delete pn[s.id()]}function Mg(s,e){const t=pn[s.id()];let i=null;if(t==null)return i=e(s),pn[s.id()]=[[e,i]],i;for(let r=0;r<t.length;r++){const[n,a]=t[r];n===e&&(i=a)}return i===null&&(i=e(s),t.push([e,i])),i}function Li(s={},e=[],t,i,r=[],n=!1){const[a,...l]=e;if(typeof a=="string")Li(s,Fi[a],t,i,r,n);else if(a){const c=Mg(i,a);if(!c.setSource)return r.push(c),Li(s,l,t,i,r,n);c.setSource(Object.assign({},s),function(f,g){if(f)return Li(s,l,t,i,r,n);r.push(c),Li(g,s.type===g.type?l:Fi[g.type],t,i,r,n)})}else l.length?Li(s,l,t,i,r,n):n?t(s,r):Li(s,Fi["*"],t,i,r,!0)}const Rg={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"},gn=function(s=""){const e=Po(s);return Rg[e.toLowerCase()]||""},Ng=(s,e)=>{if(!e)return"";if(s.cache_.source.src===e&&s.cache_.source.type)return s.cache_.source.type;const t=s.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const i=s.$$("source");for(let r=0;r<i.length;r++){const n=i[r];if(n.type&&n.src&&n.src===e)return n.type}return gn(e)},bd=function(s){if(Array.isArray(s)){let e=[];s.forEach(function(t){t=bd(t),Array.isArray(t)?e=e.concat(t):Yt(t)&&e.push(t)}),s=e}else typeof s=="string"&&s.trim()?s=[Ou({src:s})]:Yt(s)&&typeof s.src=="string"&&s.src&&s.src.trim()?s=[Ou(s)]:s=[];return s};function Ou(s){if(!s.type){const e=gn(s.src);e&&(s.type=e)}return s}var Bg=`<svg xmlns="http://www.w3.org/2000/svg">
16
+ `)}function u(e){this.options=e||{locator:{}}}u.prototype.parseFromString=function(e,t){var n=this.options,i=new c,a=n.domBuilder||new f,s=n.errorHandler,u=n.locator,p=n.xmlns||{},m=/\/x?html?$/.test(t),h=m?r.HTML_ENTITIES:r.XML_ENTITIES;u&&a.setDocumentLocator(u),i.errorHandler=d(s,a,u),i.domBuilder=n.domBuilder||a,m&&(p[``]=o.HTML),p.xml=p.xml||o.XML;var g=n.normalizeLineEndings||l;return e&&typeof e==`string`?i.parse(g(e),p,h):i.errorHandler.error(`invalid doc source`),a.doc};function d(e,t,n){if(!e){if(t instanceof f)return t;e=t}var r={},i=e instanceof Function;n||={};function a(t){var a=e[t];!a&&i&&(a=e.length==2?function(n){e(t,n)}:e),r[t]=a&&function(e){a(`[xmldom `+t+`] `+e+m(n))}||function(){}}return a(`warning`),a(`error`),a(`fatalError`),r}function f(){this.cdata=!1}function p(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}f.prototype={startDocument:function(){this.doc=new a().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var i=this.doc,a=i.createElementNS(e,n||t),o=r.length;g(this,a),this.currentElement=a,this.locator&&p(this.locator,a);for(var s=0;s<o;s++){var e=r.getURI(s),c=r.getValue(s),n=r.getQName(s),l=i.createAttributeNS(e,n);this.locator&&p(r.getLocator(s),l),l.value=l.nodeValue=c,a.setAttributeNode(l)}},endElement:function(e,t,n){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&p(this.locator,n),g(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=h.apply(this,arguments),e){if(this.cdata)var r=this.doc.createCDATASection(e);else var r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&p(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=h.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&p(this.locator,r),g(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(e,t,n);this.locator&&p(this.locator,i),g(this,i),this.doc.doctype=i}},warning:function(e){console.warn(`[xmldom warning] `+e,m(this.locator))},error:function(e){console.error(`[xmldom error] `+e,m(this.locator))},fatalError:function(e){throw new s(e,this.locator)}};function m(e){if(e)return`
17
+ @`+(e.systemId||``)+`#[line:`+e.lineNumber+`,col:`+e.columnNumber+`]`}function h(e,t,n){return typeof e==`string`?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+``:e}`endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl`.replace(/\w+/g,function(e){f.prototype[e]=function(){return null}});function g(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}e.__DOMHandler=f,e.normalizeLineEndings=l,e.DOMParser=u})),Re=e.r((e=>{var t=Pe();e.DOMImplementation=t.DOMImplementation,e.XMLSerializer=t.XMLSerializer,e.DOMParser=Le().DOMParser}))(),ze=e=>!!e&&typeof e==`object`,I=(...e)=>e.reduce((e,t)=>(typeof t==`object`&&Object.keys(t).forEach(n=>{Array.isArray(e[n])&&Array.isArray(t[n])?e[n]=e[n].concat(t[n]):ze(e[n])&&ze(t[n])?e[n]=I(e[n],t[n]):e[n]=t[n]}),e),{}),Be=e=>Object.keys(e).map(t=>e[t]),L=(e,t)=>{let n=[];for(let r=e;r<t;r++)n.push(r);return n},Ve=e=>e.reduce((e,t)=>e.concat(t),[]),He=e=>{if(!e.length)return[];let t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t},Ue=(e,t)=>e.reduce((e,n,r)=>(n[t]&&e.push(r),e),[]),We=(e,t)=>Be(e.reduce((e,n)=>(n.forEach(n=>{e[t(n)]=n}),e),{})),Ge={INVALID_NUMBER_OF_PERIOD:`INVALID_NUMBER_OF_PERIOD`,INVALID_NUMBER_OF_CONTENT_STEERING:`INVALID_NUMBER_OF_CONTENT_STEERING`,DASH_EMPTY_MANIFEST:`DASH_EMPTY_MANIFEST`,DASH_INVALID_XML:`DASH_INVALID_XML`,NO_BASE_URL:`NO_BASE_URL`,MISSING_SEGMENT_INFORMATION:`MISSING_SEGMENT_INFORMATION`,SEGMENT_TIME_UNSPECIFIED:`SEGMENT_TIME_UNSPECIFIED`,UNSUPPORTED_UTC_TIMING_SCHEME:`UNSUPPORTED_UTC_TIMING_SCHEME`},R=({baseUrl:e=``,source:t=``,range:n=``,indexRange:r=``})=>{let i={uri:t,resolvedUri:E(e||``,t)};if(n||r){let e=(n||r).split(`-`),t=C.default.BigInt?C.default.BigInt(e[0]):parseInt(e[0],10),a=C.default.BigInt?C.default.BigInt(e[1]):parseInt(e[1],10);t<2**53-1&&typeof t==`bigint`&&(t=Number(t)),a<2**53-1&&typeof a==`bigint`&&(a=Number(a));let o;o=typeof a==`bigint`||typeof t==`bigint`?C.default.BigInt(a)-C.default.BigInt(t)+C.default.BigInt(1):a-t+1,typeof o==`bigint`&&o<2**53-1&&(o=Number(o)),i.byterange={length:o,offset:t}}return i},Ke=e=>{let t;return t=typeof e.offset==`bigint`||typeof e.length==`bigint`?C.default.BigInt(e.offset)+C.default.BigInt(e.length)-C.default.BigInt(1):e.offset+e.length-1,`${e.offset}-${t}`},qe=e=>(e&&typeof e!=`number`&&(e=parseInt(e,10)),isNaN(e)?null:e),Je={static(e){let{duration:t,timescale:n=1,sourceDuration:r,periodDuration:i}=e,a=qe(e.endNumber),o=t/n;return typeof a==`number`?{start:0,end:a}:typeof i==`number`?{start:0,end:i/o}:{start:0,end:r/o}},dynamic(e){let{NOW:t,clientOffset:n,availabilityStartTime:r,timescale:i=1,duration:a,periodStart:o=0,minimumUpdatePeriod:s=0,timeShiftBufferDepth:c=1/0}=e,l=qe(e.endNumber),u=(t+n)/1e3,d=r+o,f=u+s-d,p=Math.ceil(f*i/a),m=Math.floor((u-d-c)*i/a),h=Math.floor((u-d)*i/a);return{start:Math.max(0,m),end:typeof l==`number`?l:Math.min(p,h)}}},Ye=e=>t=>{let{duration:n,timescale:r=1,periodStart:i,startNumber:a=1}=e;return{number:a+t,duration:n/r,timeline:i,time:t*n}},Xe=e=>{let{type:t,duration:n,timescale:r=1,periodDuration:i,sourceDuration:a}=e,{start:o,end:s}=Je[t](e),c=L(o,s).map(Ye(e));if(t===`static`){let e=c.length-1,t=typeof i==`number`?i:a;c[e].duration=t-n/r*e}return c},Ze=e=>{let{baseUrl:t,initialization:n={},sourceDuration:r,indexRange:i=``,periodStart:a,presentationTime:o,number:s=0,duration:c}=e;if(!t)throw Error(Ge.NO_BASE_URL);let l=R({baseUrl:t,source:n.sourceURL,range:n.range}),u=R({baseUrl:t,source:t,indexRange:i});if(u.map=l,c){let t=Xe(e);t.length&&(u.duration=t[0].duration,u.timeline=t[0].timeline)}else r&&(u.duration=r,u.timeline=a);return u.presentationTime=o||a,u.number=s,[u]},Qe=(e,t,n)=>{let r=e.sidx.map?e.sidx.map:null,i=e.sidx.duration,a=e.timeline||0,o=e.sidx.byterange,s=o.offset+o.length,c=t.timescale,l=t.references.filter(e=>e.referenceType!==1),u=[],d=e.endList?`static`:`dynamic`,f=e.sidx.timeline,p=f,m=e.mediaSequence||0,h;h=typeof t.firstOffset==`bigint`?C.default.BigInt(s)+t.firstOffset:s+t.firstOffset;for(let e=0;e<l.length;e++){let o=t.references[e],s=o.referencedSize,l=o.subsegmentDuration,g;g=typeof h==`bigint`?h+C.default.BigInt(s)-C.default.BigInt(1):h+s-1;let _=`${h}-${g}`,v=Ze({baseUrl:n,timescale:c,timeline:a,periodStart:f,presentationTime:p,number:m,duration:l,sourceDuration:i,indexRange:_,type:d})[0];r&&(v.map=r),u.push(v),typeof h==`bigint`?h+=C.default.BigInt(s):h+=s,p+=l/c,m++}return e.segments=u,e},$e=[`AUDIO`,`SUBTITLES`],et=1/60,tt=e=>We(e,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),nt=(e,t)=>{for(let n=0;n<e.length;n++)if(e[n].attributes.NAME===t)return e[n];return null},rt=e=>{let t=[];return Me(e,$e,(e,n,r,i)=>{t=t.concat(e.playlists||[])}),t},it=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach((t,n)=>{t.number=e.mediaSequence+n})},at=({oldPlaylists:e,newPlaylists:t,timelineStarts:n})=>{t.forEach(t=>{t.discontinuitySequence=n.findIndex(function({timeline:e}){return e===t.timeline});let r=nt(e,t.attributes.NAME);if(!r||t.sidx)return;let i=t.segments[0],a=r.segments.findIndex(function(e){return Math.abs(e.presentationTime-i.presentationTime)<et});if(a===-1){it({playlist:t,mediaSequence:r.mediaSequence+r.segments.length}),t.segments[0].discontinuity=!0,t.discontinuityStarts.unshift(0),(!r.segments.length&&t.timeline>r.timeline||r.segments.length&&t.timeline>r.segments[r.segments.length-1].timeline)&&t.discontinuitySequence--;return}r.segments[a].discontinuity&&!i.discontinuity&&(i.discontinuity=!0,t.discontinuityStarts.unshift(0),t.discontinuitySequence--),it({playlist:t,mediaSequence:r.segments[a].number})})},ot=({oldManifest:e,newManifest:t})=>{let n=e.playlists.concat(rt(e)),r=t.playlists.concat(rt(t));return t.timelineStarts=tt([e.timelineStarts,t.timelineStarts]),at({oldPlaylists:n,newPlaylists:r,timelineStarts:t.timelineStarts}),t},st=e=>e&&e.uri+`-`+Ke(e.byterange),ct=e=>{let t=e.reduce(function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e},{}),n=[];return Object.values(t).forEach(e=>{let t=Be(e.reduce((e,t)=>{let n=t.attributes.id+(t.attributes.lang||``);return e[n]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[n].segments.push(...t.segments)),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):(e[n]=t,e[n].attributes.timelineStarts=[]),e[n].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e},{}));n=n.concat(t)}),n.map(e=>(e.discontinuityStarts=Ue(e.segments||[],`discontinuity`),e))},lt=(e,t)=>{let n=st(e.sidx),r=n&&t[n]&&t[n].sidx;return r&&Qe(e,r,e.sidx.resolvedUri),e},ut=(e,t={})=>{if(!Object.keys(t).length)return e;for(let n in e)e[n]=lt(e[n],t);return e},dt=({attributes:e,segments:t,sidx:n,mediaSequence:r,discontinuitySequence:i,discontinuityStarts:a},o)=>{let s={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:``,endList:e.type===`static`,timeline:e.periodStart,resolvedUri:e.baseUrl||``,targetDuration:e.duration,discontinuitySequence:i,discontinuityStarts:a,timelineStarts:e.timelineStarts,mediaSequence:r,segments:t};return e.contentProtection&&(s.contentProtection=e.contentProtection),e.serviceLocation&&(s.attributes.serviceLocation=e.serviceLocation),n&&(s.sidx=n),o&&(s.attributes.AUDIO=`audio`,s.attributes.SUBTITLES=`subs`),s},ft=({attributes:e,segments:t,mediaSequence:n,discontinuityStarts:r,discontinuitySequence:i})=>{t===void 0&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||``,duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);let a={NAME:e.id,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1};e.codecs&&(a.CODECS=e.codecs);let o={attributes:a,uri:``,endList:e.type===`static`,timeline:e.periodStart,resolvedUri:e.baseUrl||``,targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:r,discontinuitySequence:i,mediaSequence:n,segments:t};return e.serviceLocation&&(o.attributes.serviceLocation=e.serviceLocation),o},pt=(e,t={},n=!1)=>{let r,i=e.reduce((e,i)=>{let a=i.attributes.role&&i.attributes.role.value||``,o=i.attributes.lang||``,s=i.attributes.label||`main`;if(o&&!i.attributes.label){let e=a?` (${a})`:``;s=`${i.attributes.lang}${e}`}e[s]||(e[s]={language:o,autoselect:!0,default:a===`main`,playlists:[],uri:``});let c=lt(dt(i,n),t);return e[s].playlists.push(c),r===void 0&&a===`main`&&(r=i,r.default=!0),e},{});if(!r){let e=Object.keys(i)[0];i[e].default=!0}return i},mt=(e,t={})=>e.reduce((e,n)=>{let r=n.attributes.label||n.attributes.lang||`text`,i=n.attributes.lang||`und`;return e[r]||(e[r]={language:i,default:!1,autoselect:!1,playlists:[],uri:``}),e[r].playlists.push(lt(ft(n),t)),e},{}),ht=e=>e.reduce((e,t)=>(t&&t.forEach(t=>{let{channel:n,language:r}=t;e[r]={autoselect:!1,default:!1,instreamId:n,language:r},t.hasOwnProperty(`aspectRatio`)&&(e[r].aspectRatio=t.aspectRatio),t.hasOwnProperty(`easyReader`)&&(e[r].easyReader=t.easyReader),t.hasOwnProperty(`3D`)&&(e[r][`3D`]=t[`3D`])}),e),{}),gt=({attributes:e,segments:t,sidx:n,discontinuityStarts:r})=>{let i={attributes:{NAME:e.id,AUDIO:`audio`,SUBTITLES:`subs`,RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:``,endList:e.type===`static`,timeline:e.periodStart,resolvedUri:e.baseUrl||``,targetDuration:e.duration,discontinuityStarts:r,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(i.attributes[`FRAME-RATE`]=e.frameRate),e.contentProtection&&(i.contentProtection=e.contentProtection),e.serviceLocation&&(i.attributes.serviceLocation=e.serviceLocation),n&&(i.sidx=n),i},_t=({attributes:e})=>e.mimeType===`video/mp4`||e.mimeType===`video/webm`||e.contentType===`video`,vt=({attributes:e})=>e.mimeType===`audio/mp4`||e.mimeType===`audio/webm`||e.contentType===`audio`,yt=({attributes:e})=>e.mimeType===`text/vtt`||e.contentType===`text`,bt=(e,t)=>{e.forEach(e=>{e.mediaSequence=0,e.discontinuitySequence=t.findIndex(function({timeline:t}){return t===e.timeline}),e.segments&&e.segments.forEach((e,t)=>{e.number=t})})},xt=e=>e?Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(r.playlists)},[]):[],St=({dashPlaylists:e,locations:t,contentSteering:n,sidxMapping:r={},previousManifest:i,eventStream:a})=>{if(!e.length)return{};let{sourceDuration:o,type:s,suggestedPresentationDelay:c,minimumUpdatePeriod:l}=e[0].attributes,u=ct(e.filter(_t)).map(gt),d=ct(e.filter(vt)),f=ct(e.filter(yt)),p=e.map(e=>e.attributes.captionServices).filter(Boolean),m={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:``,duration:o,playlists:ut(u,r)};l>=0&&(m.minimumUpdatePeriod=l*1e3),t&&(m.locations=t),n&&(m.contentSteering=n),s===`dynamic`&&(m.suggestedPresentationDelay=c),a&&a.length>0&&(m.eventStream=a);let h=m.playlists.length===0,g=d.length?pt(d,r,h):null,_=f.length?mt(f,r):null,v=u.concat(xt(g),xt(_));return m.timelineStarts=tt(v.map(({timelineStarts:e})=>e)),bt(v,m.timelineStarts),g&&(m.mediaGroups.AUDIO.audio=g),_&&(m.mediaGroups.SUBTITLES.subs=_),p.length&&(m.mediaGroups[`CLOSED-CAPTIONS`].cc=ht(p)),i?ot({oldManifest:i,newManifest:m}):m},Ct=(e,t,n)=>{let{NOW:r,clientOffset:i,availabilityStartTime:a,timescale:o=1,periodStart:s=0,minimumUpdatePeriod:c=0}=e,l=(r+i)/1e3,u=a+s,d=l+c-u;return Math.ceil((d*o-t)/n)},wt=(e,t)=>{let{type:n,minimumUpdatePeriod:r=0,media:i=``,sourceDuration:a,timescale:o=1,startNumber:s=1,periodStart:c}=e,l=[],u=-1;for(let d=0;d<t.length;d++){let f=t[d],p=f.d,m=f.r||0,h=f.t||0;u<0&&(u=h),h&&h>u&&(u=h);let g;if(m<0){let s=d+1;g=s===t.length?n===`dynamic`&&r>0&&i.indexOf(`$Number$`)>0?Ct(e,u,p):(a*o-u)/p:(t[s].t-u)/p}else g=m+1;let _=s+l.length+g,v=s+l.length;for(;v<_;)l.push({number:v,duration:p/o,time:u,timeline:c}),u+=p,v++}return l},Tt=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Et=e=>(t,n,r,i)=>{if(t===`$$`)return`$`;if(e[n]===void 0)return t;let a=``+e[n];return n===`RepresentationID`||(i=r?parseInt(i,10):1,a.length>=i)?a:`${Array(i-a.length+1).join(`0`)}${a}`},Dt=(e,t)=>e.replace(Tt,Et(t)),Ot=(e,t)=>!e.duration&&!t?[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]:e.duration?Xe(e):wt(e,t),kt=(e,t)=>{let n={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:r={sourceURL:``,range:``}}=e,i=R({baseUrl:e.baseUrl,source:Dt(r.sourceURL,n),range:r.range});return Ot(e,t).map(t=>{n.Number=t.number,n.Time=t.time;let r=Dt(e.media||``,n),a=e.timescale||1,o=e.presentationTimeOffset||0,s=e.periodStart+(t.time-o)/a;return{uri:r,timeline:t.timeline,duration:t.duration,resolvedUri:E(e.baseUrl||``,r),map:i,number:t.number,presentationTime:s}})},At=(e,t)=>{let{baseUrl:n,initialization:r={}}=e,i=R({baseUrl:n,source:r.sourceURL,range:r.range}),a=R({baseUrl:n,source:t.media,range:t.mediaRange});return a.map=i,a},jt=(e,t)=>{let{duration:n,segmentUrls:r=[],periodStart:i}=e;if(!n&&!t||n&&t)throw Error(Ge.SEGMENT_TIME_UNSPECIFIED);let a=r.map(t=>At(e,t)),o;return n&&(o=Xe(e)),t&&(o=wt(e,t)),o.map((t,n)=>{if(a[n]){let r=a[n],o=e.timescale||1,s=e.presentationTimeOffset||0;return r.timeline=t.timeline,r.duration=t.duration,r.number=t.number,r.presentationTime=i+(t.time-s)/o,r}}).filter(e=>e)},Mt=({attributes:e,segmentInfo:t})=>{let n,r;t.template?(r=kt,n=I(e,t.template)):t.base?(r=Ze,n=I(e,t.base)):t.list&&(r=jt,n=I(e,t.list));let i={attributes:e};if(!r)return i;let a=r(n,t.segmentTimeline);if(n.duration){let{duration:e,timescale:t=1}=n;n.duration=e/t}else a.length?n.duration=a.reduce((e,t)=>Math.max(e,Math.ceil(t.duration)),0):n.duration=0;return i.attributes=n,i.segments=a,t.base&&n.indexRange&&(i.sidx=a[0],i.segments=[]),i},Nt=e=>e.map(Mt),z=(e,t)=>He(e.childNodes).filter(({tagName:e})=>e===t),Pt=e=>e.textContent.trim(),Ft=e=>parseFloat(e.split(`/`).reduce((e,t)=>e/t)),It=e=>{let t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;let[n,r,i,a,o,s]=t.slice(1);return parseFloat(n||0)*31536e3+parseFloat(r||0)*2592e3+parseFloat(i||0)*86400+parseFloat(a||0)*3600+parseFloat(o||0)*60+parseFloat(s||0)},Lt=e=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+=`Z`),Date.parse(e)),Rt={mediaPresentationDuration(e){return It(e)},availabilityStartTime(e){return Lt(e)/1e3},minimumUpdatePeriod(e){return It(e)},suggestedPresentationDelay(e){return It(e)},type(e){return e},timeShiftBufferDepth(e){return It(e)},start(e){return It(e)},width(e){return parseInt(e,10)},height(e){return parseInt(e,10)},bandwidth(e){return parseInt(e,10)},frameRate(e){return Ft(e)},startNumber(e){return parseInt(e,10)},timescale(e){return parseInt(e,10)},presentationTimeOffset(e){return parseInt(e,10)},duration(e){let t=parseInt(e,10);return isNaN(t)?It(e):t},d(e){return parseInt(e,10)},t(e){return parseInt(e,10)},r(e){return parseInt(e,10)},presentationTime(e){return parseInt(e,10)},DEFAULT(e){return e}},zt=e=>e&&e.attributes?He(e.attributes).reduce((e,t)=>{let n=Rt[t.name]||Rt.DEFAULT;return e[t.name]=n(t.value),e},{}):{},Bt={"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`},Vt=(e,t)=>t.length?Ve(e.map(function(e){return t.map(function(t){let n=Pt(t),r=E(e.baseUrl,n),i=I(zt(t),{baseUrl:r});return r!==n&&!i.serviceLocation&&e.serviceLocation&&(i.serviceLocation=e.serviceLocation),i})})):e,Ht=e=>{let t=z(e,`SegmentTemplate`)[0],n=z(e,`SegmentList`)[0],r=n&&z(n,`SegmentURL`).map(e=>I({tag:`SegmentURL`},zt(e))),i=z(e,`SegmentBase`)[0],a=n||t,o=a&&z(a,`SegmentTimeline`)[0],s=n||i||t,c=s&&z(s,`Initialization`)[0],l=t&&zt(t);l&&c?l.initialization=c&&zt(c):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});let u={template:l,segmentTimeline:o&&z(o,`S`).map(e=>zt(e)),list:n&&I(zt(n),{segmentUrls:r,initialization:zt(c)}),base:i&&I(zt(i),{initialization:zt(c)})};return Object.keys(u).forEach(e=>{u[e]||delete u[e]}),u},Ut=(e,t,n)=>r=>{let i=Vt(t,z(r,`BaseURL`)),a=I(e,zt(r)),o=Ht(r);return i.map(e=>({segmentInfo:I(n,o),attributes:I(a,e)}))},Wt=e=>e.reduce((e,t)=>{let n=zt(t);n.schemeIdUri&&=n.schemeIdUri.toLowerCase();let r=Bt[n.schemeIdUri];if(r){e[r]={attributes:n};let i=z(t,`cenc:pssh`)[0];if(i){let t=Pt(i);e[r].pssh=t&&O(t)}}return e},{}),Gt=e=>{if(e.schemeIdUri===`urn:scte:dash:cc:cea-608:2015`)return(typeof e.value==`string`?e.value.split(`;`):[]).map(e=>{let t,n;return n=e,/^CC\d=/.test(e)?[t,n]=e.split(`=`):/^CC\d$/.test(e)&&(t=e),{channel:t,language:n}});if(e.schemeIdUri===`urn:scte:dash:cc:cea-708:2015`)return(typeof e.value==`string`?e.value.split(`;`):[]).map(e=>{let t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){let[n,r=``]=e.split(`=`);t.channel=n,t.language=e,r.split(`,`).forEach(e=>{let[n,r]=e.split(`:`);n===`lang`?t.language=r:n===`er`?t.easyReader=Number(r):n===`war`?t.aspectRatio=Number(r):n===`3D`&&(t[`3D`]=Number(r))})}else t.language=e;return t.channel&&=`SERVICE`+t.channel,t})},Kt=e=>Ve(z(e.node,`EventStream`).map(t=>{let n=zt(t),r=n.schemeIdUri;return z(t,`Event`).map(t=>{let i=zt(t),a=i.presentationTime||0,o=n.timescale||1,s=i.duration||0,c=a/o+e.attributes.start;return{schemeIdUri:r,value:n.value,id:i.id,start:c,end:c+s/o,messageData:Pt(t)||i.messageData,contentEncoding:n.contentEncoding,presentationTimeOffset:n.presentationTimeOffset||0}})})),qt=(e,t,n)=>r=>{let i=zt(r),a=Vt(t,z(r,`BaseURL`)),o=z(r,`Role`)[0],s=I(e,i,{role:zt(o)}),c=z(r,`Accessibility`)[0],l=Gt(zt(c));l&&(s=I(s,{captionServices:l}));let u=z(r,`Label`)[0];if(u&&u.childNodes.length){let e=u.childNodes[0].nodeValue.trim();s=I(s,{label:e})}let d=Wt(z(r,`ContentProtection`));Object.keys(d).length&&(s=I(s,{contentProtection:d}));let f=Ht(r),p=z(r,`Representation`),m=I(n,f);return Ve(p.map(Ut(s,a,m)))},Jt=(e,t)=>(n,r)=>{let i=Vt(t,z(n.node,`BaseURL`)),a=I(e,{periodStart:n.attributes.start});typeof n.attributes.duration==`number`&&(a.periodDuration=n.attributes.duration);let o=z(n.node,`AdaptationSet`),s=Ht(n.node);return Ve(o.map(qt(a,i,s)))},Yt=(e,t)=>{if(e.length>1&&t({type:`warn`,message:`The MPD manifest should contain no more than one ContentSteering tag`}),!e.length)return null;let n=I({serverURL:Pt(e[0])},zt(e[0]));return n.queryBeforeStart=n.queryBeforeStart===`true`,n},Xt=({attributes:e,priorPeriodAttributes:t,mpdType:n})=>typeof e.start==`number`?e.start:t&&typeof t.start==`number`&&typeof t.duration==`number`?t.start+t.duration:!t&&n===`static`?0:null,Zt=(e,t={})=>{let{manifestUri:n=``,NOW:r=Date.now(),clientOffset:i=0,eventHandler:a=function(){}}=t,o=z(e,`Period`);if(!o.length)throw Error(Ge.INVALID_NUMBER_OF_PERIOD);let s=z(e,`Location`),c=zt(e),l=Vt([{baseUrl:n}],z(e,`BaseURL`)),u=z(e,`ContentSteering`);c.type=c.type||`static`,c.sourceDuration=c.mediaPresentationDuration||0,c.NOW=r,c.clientOffset=i,s.length&&(c.locations=s.map(Pt));let d=[];return o.forEach((e,t)=>{let n=zt(e),r=d[t-1];n.start=Xt({attributes:n,priorPeriodAttributes:r?r.attributes:null,mpdType:c.type}),d.push({node:e,attributes:n})}),{locations:c.locations,contentSteeringInfo:Yt(u,a),representationInfo:Ve(d.map(Jt(c,l))),eventStream:Ve(d.map(Kt))}},Qt=e=>{if(e===``)throw Error(Ge.DASH_EMPTY_MANIFEST);let t=new Re.DOMParser,n,r;try{n=t.parseFromString(e,`application/xml`),r=n&&n.documentElement.tagName===`MPD`?n.documentElement:null}catch{}if(!r||r&&r.getElementsByTagName(`parsererror`).length>0)throw Error(Ge.DASH_INVALID_XML);return r},$t=e=>{let t=z(e,`UTCTiming`)[0];if(!t)return null;let n=zt(t);switch(n.schemeIdUri){case`urn:mpeg:dash:utc:http-head:2014`:case`urn:mpeg:dash:utc:http-head:2012`:n.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`:n.method=`GET`;break;case`urn:mpeg:dash:utc:direct:2014`:case`urn:mpeg:dash:utc:direct:2012`:n.method=`DIRECT`,n.value=Date.parse(n.value);break;default:throw Error(Ge.UNSUPPORTED_UTC_TIMING_SCHEME)}return n},en=(e,t={})=>{let n=Zt(Qt(e),t);return St({dashPlaylists:Nt(n.representationInfo),locations:n.locations,contentSteering:n.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:n.eventStream})},tn=e=>$t(Qt(e)),nn=e.r(((e,t)=>{var n=2**32;t.exports={getUint64:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),r;return t.getBigUint64?(r=t.getBigUint64(0),r<2**53-1?Number(r):r):t.getUint32(0)*n+t.getUint32(4)},MAX_UINT32:n}})),rn=e.r(((e,t)=>{var n=nn().getUint64;t.exports=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},i=12;r.version===0?(r.earliestPresentationTime=t.getUint32(i),r.firstOffset=t.getUint32(i+4),i+=8):(r.earliestPresentationTime=n(e.subarray(i)),r.firstOffset=n(e.subarray(i+8)),i+=16),i+=2;var a=t.getUint16(i);for(i+=2;a>0;i+=12,a--)r.references.push({referenceType:(e[i]&128)>>>7,referencedSize:t.getUint32(i)&2147483647,subsegmentDuration:t.getUint32(i+4),startsWithSap:!!(e[i+8]&128),sapType:(e[i+8]&112)>>>4,sapDeltaTime:t.getUint32(i+8)&268435455});return r}})),an=e.i(rn()),on=N([73,68,51]),sn=function(e,t){t===void 0&&(t=0),e=N(e);var n=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(n&16)>>4?r+20:r+10},cn=function e(t,n){return n===void 0&&(n=0),t=N(t),t.length-n<10||!F(t,on,{offset:n})?n:(n+=sn(t,n),e(t,n))},ln=function(e){return typeof e==`string`?Ae(e):e},un=function(e){return Array.isArray(e)?e.map(function(e){return ln(e)}):[ln(e)]},dn,fn=function(e){e=N(e);for(var t=[],n=0;e.length>n;){var r=e[n],i=0,a=0;a++;var o=e[a];for(a++;o&128;)i=(o&127)<<7,o=e[a],a++;i+=o&127;for(var s=0;s<dn.length;s++){var c=dn[s],l=c.id,u=c.parser;if(r===l){t.push(u(e.subarray(a,a+i)));break}}n+=i+a}return t};dn=[{id:3,parser:function(e){var t={tag:3,id:e[0]<<8|e[1],flags:e[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:``};if(t.flags&128&&(t.dependsOnEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.flags&64){var n=e[t.size];t.url=ke(e.subarray(t.size+1,t.size+1+n)),t.size+=n}return t.flags&32&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=fn(e.subarray(t.size))||[],t}},{id:4,parser:function(e){return{tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:fn(e.subarray(13))}}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var pn=function e(t,n,r){r===void 0&&(r=!1),n=un(n),t=N(t);var i=[];if(!n.length)return i;for(var a=0;a<t.length;){var o=(t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3])>>>0,s=t.subarray(a+4,a+8);if(o===0)break;var c=a+o;if(c>t.length){if(r)break;c=t.length}var l=t.subarray(a+8,c);F(s,n[0])&&(n.length===1?i.push(l):i.push.apply(i,e(l,n.slice(1),r))),a=c}return i},mn={EBML:N([26,69,223,163]),DocType:N([66,130]),Segment:N([24,83,128,103]),SegmentInfo:N([21,73,169,102]),Tracks:N([22,84,174,107]),Track:N([174]),TrackNumber:N([215]),DefaultDuration:N([35,227,131]),TrackEntry:N([174]),TrackType:N([131]),FlagDefault:N([136]),CodecID:N([134]),CodecPrivate:N([99,162]),VideoTrack:N([224]),AudioTrack:N([225]),Cluster:N([31,67,182,117]),Timestamp:N([231]),TimestampScale:N([42,215,177]),BlockGroup:N([160]),BlockDuration:N([155]),Block:N([161]),SimpleBlock:N([163])},hn=[128,64,32,16,8,4,2,1],gn=function(e){for(var t=1,n=0;n<hn.length&&!(e&hn[n]);n++)t++;return t},_n=function(e,t,n,r){n===void 0&&(n=!0),r===void 0&&(r=!1);var i=gn(e[t]),a=e.subarray(t,t+i);return n&&(a=Array.prototype.slice.call(e,t,t+i),a[0]^=hn[i-1]),{length:i,value:De(a,{signed:r}),bytes:a}},vn=function e(t){return typeof t==`string`?t.match(/.{1,2}/g).map(function(t){return e(t)}):typeof t==`number`?Oe(t):t},yn=function(e){return Array.isArray(e)?e.map(function(e){return vn(e)}):[vn(e)]},bn=function e(t,n,r){if(r>=n.length)return n.length;var i=_n(n,r,!1);if(F(t.bytes,i.bytes))return r;var a=_n(n,r+i.length);return e(t,n,r+a.length+a.value+i.length)},xn=function e(t,n){n=yn(n),t=N(t);var r=[];if(!n.length)return r;for(var i=0;i<t.length;){var a=_n(t,i,!1),o=_n(t,i+a.length),s=i+a.length+o.length;o.value===127&&(o.value=bn(a,t,s),o.value!==t.length&&(o.value-=s));var c=s+o.value>t.length?t.length:s+o.value,l=t.subarray(s,c);F(n[0],a.bytes)&&(n.length===1?r.push(l):r=r.concat(e(l,n.slice(1))));var u=a.length+o.length+l.length;i+=u}return r},Sn=N([0,0,0,1]),Cn=N([0,0,1]),wn=N([0,0,3]),Tn=function(e){for(var t=[],n=1;n<e.length-2;)F(e.subarray(n,n+3),wn)&&(t.push(n+2),n++),n++;if(t.length===0)return e;var r=e.length-t.length,i=new Uint8Array(r),a=0;for(n=0;n<r;a++,n++)a===t[0]&&(a++,t.shift()),i[n]=e[a];return i},En=function(e,t,n,r){r===void 0&&(r=1/0),e=N(e),n=[].concat(n);for(var i=0,a,o=0;i<e.length&&(o<r||a);){var s=void 0;if(F(e.subarray(i),Sn)?s=4:F(e.subarray(i),Cn)&&(s=3),!s){i++;continue}if(o++,a)return Tn(e.subarray(a,i));var c=void 0;t===`h264`?c=e[i+s]&31:t===`h265`&&(c=e[i+s]>>1&63),n.indexOf(c)!==-1&&(a=i+s),i+=s+(t===`h264`?1:2)}return e.subarray(0,0)},Dn=function(e,t,n){return En(e,`h264`,t,n)},On=function(e,t,n){return En(e,`h265`,t,n)},kn={webm:N([119,101,98,109]),matroska:N([109,97,116,114,111,115,107,97]),flac:N([102,76,97,67]),ogg:N([79,103,103,83]),ac3:N([11,119]),riff:N([82,73,70,70]),avi:N([65,86,73]),wav:N([87,65,86,69]),"3gp":N([102,116,121,112,51,103]),mp4:N([102,116,121,112]),fmp4:N([115,116,121,112]),mov:N([102,116,121,112,113,116]),moov:N([109,111,111,118]),moof:N([109,111,111,102])},An={aac:function(e){return F(e,[255,16],{offset:cn(e),mask:[255,22]})},mp3:function(e){return F(e,[255,2],{offset:cn(e),mask:[255,6]})},webm:function(e){var t=xn(e,[mn.EBML,mn.DocType])[0];return F(t,kn.webm)},mkv:function(e){var t=xn(e,[mn.EBML,mn.DocType])[0];return F(t,kn.matroska)},mp4:function(e){if(An[`3gp`](e)||An.mov(e))return!1;if(F(e,kn.mp4,{offset:4})||F(e,kn.fmp4,{offset:4})||F(e,kn.moof,{offset:4})||F(e,kn.moov,{offset:4}))return!0},mov:function(e){return F(e,kn.mov,{offset:4})},"3gp":function(e){return F(e,kn[`3gp`],{offset:4})},ac3:function(e){var t=cn(e);return F(e,kn.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=cn(e);return F(e,kn.flac,{offset:t})},ogg:function(e){return F(e,kn.ogg)},avi:function(e){return F(e,kn.riff)&&F(e,kn.avi,{offset:8})},wav:function(e){return F(e,kn.riff)&&F(e,kn.wav,{offset:8})},h264:function(e){return Dn(e,7,3).length},h265:function(e){return On(e,[32,33],3).length}},jn=Object.keys(An).filter(function(e){return e!==`ts`&&e!==`h264`&&e!==`h265`}).concat([`ts`,`h264`,`h265`]);jn.forEach(function(e){var t=An[e];An[e]=function(e){return t(N(e))}});var Mn=An,Nn=function(e){e=N(e);for(var t=0;t<jn.length;t++){var n=jn[t];if(Mn[n](e))return n}return``},Pn=function(e){return pn(e,[`moof`]).length>0},Fn=e.r(((e,t)=>{var n=9e4,r=function(e){return e*n},i=function(e,t){return e*t},a=function(e){return e/n},o=function(e,t){return e/t};t.exports={ONE_SECOND_IN_TS:n,secondsToVideoTs:r,secondsToAudioTs:i,videoTsToSeconds:a,audioTsToSeconds:o,audioTsToVideoTs:function(e,t){return r(o(e,t))},videoTsToAudioTs:function(e,t){return i(a(e),t)},metadataTsToSeconds:function(e,t,n){return a(n?e:e-t)}}}))(),In=`8.23.7`,Ln={},Rn=function(e,t){return Ln[e]=Ln[e]||[],t&&(Ln[e]=Ln[e].concat(t)),Ln[e]},zn=function(e,t){Rn(e,t)},Bn=function(e,t){let n=Rn(e).indexOf(t);return n<=-1?!1:(Ln[e]=Ln[e].slice(),Ln[e].splice(n,1),!0)},Vn=function(e,t){Rn(e,[].concat(t).map(t=>{let n=(...r)=>(Bn(e,n),t(...r));return n}))},Hn={prefixed:!0},Un=[[`requestFullscreen`,`exitFullscreen`,`fullscreenElement`,`fullscreenEnabled`,`fullscreenchange`,`fullscreenerror`,`fullscreen`],[`webkitRequestFullscreen`,`webkitExitFullscreen`,`webkitFullscreenElement`,`webkitFullscreenEnabled`,`webkitfullscreenchange`,`webkitfullscreenerror`,`-webkit-full-screen`]],Wn=Un[0],Gn;for(let e=0;e<Un.length;e++)if(Un[e][1]in S.default){Gn=Un[e];break}if(Gn){for(let e=0;e<Gn.length;e++)Hn[Wn[e]]=Gn[e];Hn.prefixed=Gn[0]!==Wn[0]}var Kn=[],qn=(e,t,n)=>(r,i,a)=>{let o=t.levels[i],s=RegExp(`^(${o})$`),c=e;if(r!==`log`&&a.unshift(r.toUpperCase()+`:`),n&&(c=`%c${e}`,a.unshift(n)),a.unshift(c+`:`),Kn){Kn.push([].concat(a));let e=Kn.length-1e3;Kn.splice(0,e>0?e:0)}if(!C.default.console)return;let l=C.default.console[r];!l&&r===`debug`&&(l=C.default.console.info||C.default.console.log),!(!l||!o||!s.test(r))&&l[Array.isArray(a)?`apply`:`call`](C.default.console,a)};function Jn(e,t=`:`,n=``){let r=`info`,i;function a(...e){i(`log`,r,e)}return i=qn(e,a,n),a.createLogger=(r,i,a)=>{let o=i===void 0?t:i,s=a===void 0?n:a;return Jn(`${e} ${o} ${r}`,o,s)},a.createNewLogger=(e,t,n)=>Jn(e,t,n),a.levels={all:`debug|log|warn|error`,off:``,debug:`debug|log|warn|error`,info:`log|warn|error`,warn:`warn|error`,error:`error`,DEFAULT:r},a.level=e=>{if(typeof e==`string`){if(!a.levels.hasOwnProperty(e))throw Error(`"${e}" in not a valid log level`);r=e}return r},a.history=()=>Kn?[].concat(Kn):[],a.history.filter=e=>(Kn||[]).filter(t=>RegExp(`.*${e}.*`).test(t[0])),a.history.clear=()=>{Kn&&(Kn.length=0)},a.history.disable=()=>{Kn!==null&&(Kn.length=0,Kn=null)},a.history.enable=()=>{Kn===null&&(Kn=[])},a.error=(...e)=>i(`error`,r,e),a.warn=(...e)=>i(`warn`,r,e),a.debug=(...e)=>i(`debug`,r,e),a}var B=Jn(`VIDEOJS`),Yn=B.createLogger,Xn=Object.prototype.toString,Zn=function(e){return $n(e)?Object.keys(e):[]};function Qn(e,t){Zn(e).forEach(n=>t(e[n],n))}function V(e,t,n=0){return Zn(e).reduce((n,r)=>t(n,e[r],r),n)}function $n(e){return!!e&&typeof e==`object`}function er(e){return $n(e)&&Xn.call(e)===`[object Object]`&&e.constructor===Object}function H(...e){let t={};return e.forEach(e=>{e&&Qn(e,(e,n)=>{if(!er(e)){t[n]=e;return}er(t[n])||(t[n]={}),t[n]=H(t[n],e)})}),t}function tr(e={}){let t=[];for(let n in e)if(e.hasOwnProperty(n)){let r=e[n];t.push(r)}return t}function nr(e,t,n,r=!0){let i=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0}),a={configurable:!0,enumerable:!0,get(){let e=n();return i(e),e}};return r&&(a.set=i),Object.defineProperty(e,t,a)}var rr=Object.freeze({__proto__:null,each:Qn,reduce:V,isObject:$n,isPlain:er,merge:H,values:tr,defineLazyProperty:nr}),ir=!1,ar=null,or=!1,sr,cr=!1,lr=!1,ur=!1,dr=!1,fr=null,pr=null,mr=!!(C.default.cast&&C.default.cast.framework&&C.default.cast.framework.CastReceiverContext),hr=null,gr=!1,_r=!1,vr=!1,yr=!1,br=!1,xr=!1,Sr=!1,Cr=!!(Ar()&&(`ontouchstart`in C.default||C.default.navigator.maxTouchPoints||C.default.DocumentTouch&&C.default.document instanceof C.default.DocumentTouch)),wr=C.default.navigator&&C.default.navigator.userAgentData;if(wr&&wr.platform&&wr.brands&&(or=wr.platform===`Android`,lr=!!wr.brands.find(e=>e.brand===`Microsoft Edge`),ur=!!wr.brands.find(e=>e.brand===`Chromium`),dr=!lr&&ur,fr=pr=(wr.brands.find(e=>e.brand===`Chromium`)||{}).version||null,_r=wr.platform===`Windows`),!ur){let e=C.default.navigator&&C.default.navigator.userAgent||``;ir=/iPod/i.test(e),ar=function(){let t=e.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),or=/Android/i.test(e),sr=function(){let t=e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;let n=t[1]&&parseFloat(t[1]),r=t[2]&&parseFloat(t[2]);return n&&r?parseFloat(t[1]+`.`+t[2]):n||null}(),cr=/Firefox/i.test(e),lr=/Edg/i.test(e),ur=/Chrome/i.test(e)||/CriOS/i.test(e),dr=!lr&&ur,fr=pr=function(){let t=e.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),hr=function(){let t=/MSIE\s(\d+)\.\d/.exec(e),n=t&&parseFloat(t[1]);return!n&&/Trident\/7.0/i.test(e)&&/rv:11.0/.test(e)&&(n=11),n}(),br=/Tizen/i.test(e),xr=/Web0S/i.test(e),Sr=br||xr,gr=/Safari/i.test(e)&&!dr&&!or&&!lr&&!Sr,_r=/Windows/i.test(e),vr=/iPad/i.test(e)||gr&&Cr&&!/iPhone/i.test(e),yr=/iPhone/i.test(e)&&!vr}var Tr=yr||vr||ir,Er=(gr||Tr)&&!dr,Dr=Object.freeze({__proto__:null,get IS_IPOD(){return ir},get IOS_VERSION(){return ar},get IS_ANDROID(){return or},get ANDROID_VERSION(){return sr},get IS_FIREFOX(){return cr},get IS_EDGE(){return lr},get IS_CHROMIUM(){return ur},get IS_CHROME(){return dr},get CHROMIUM_VERSION(){return fr},get CHROME_VERSION(){return pr},IS_CHROMECAST_RECEIVER:mr,get IE_VERSION(){return hr},get IS_SAFARI(){return gr},get IS_WINDOWS(){return _r},get IS_IPAD(){return vr},get IS_IPHONE(){return yr},get IS_TIZEN(){return br},get IS_WEBOS(){return xr},get IS_SMART_TV(){return Sr},TOUCH_ENABLED:Cr,IS_IOS:Tr,IS_ANY_SAFARI:Er});function Or(e){return typeof e==`string`&&!!e.trim()}function kr(e){if(e.indexOf(` `)>=0)throw Error(`class has illegal whitespace characters`)}function Ar(){return S.default===C.default.document}function jr(e){return $n(e)&&e.nodeType===1}function Mr(){try{return C.default.parent!==C.default.self}catch{return!0}}function Nr(e){return function(t,n){if(!Or(t))return S.default[e](null);Or(n)&&(n=S.default.querySelector(n));let r=jr(n)?n:S.default;return r[e]&&r[e](t)}}function U(e=`div`,t={},n={},r){let i=S.default.createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){let n=t[e];e===`textContent`?Pr(i,n):(i[e]!==n||e===`tabIndex`)&&(i[e]=n)}),Object.getOwnPropertyNames(n).forEach(function(e){i.setAttribute(e,n[e])}),r&&Qr(i,r),i}function Pr(e,t){return e.textContent===void 0?e.innerText=t:e.textContent=t,e}function Fr(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function Ir(e,t){return kr(t),e.classList.contains(t)}function Lr(e,...t){return e.classList.add(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e}function Rr(e,...t){return e?(e.classList.remove(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e):(B.warn(`removeClass was called with an element that doesn't exist`),null)}function zr(e,t,n){return typeof n==`function`&&(n=n(e,t)),typeof n!=`boolean`&&(n=void 0),t.split(/\s+/).forEach(t=>e.classList.toggle(t,n)),e}function Br(e,t){Object.getOwnPropertyNames(t).forEach(function(n){let r=t[n];r==null||r===!1?e.removeAttribute(n):e.setAttribute(n,r===!0?``:r)})}function Vr(e){let t={},n=[`autoplay`,`controls`,`playsinline`,`loop`,`muted`,`default`,`defaultMuted`];if(e&&e.attributes&&e.attributes.length>0){let r=e.attributes;for(let e=r.length-1;e>=0;e--){let i=r[e].name,a=r[e].value;n.includes(i)&&(a=a!==null),t[i]=a}}return t}function Hr(e,t){return e.getAttribute(t)}function Ur(e,t,n){e.setAttribute(t,n)}function Wr(e,t){e.removeAttribute(t)}function Gr(){S.default.body.focus(),S.default.onselectstart=function(){return!1}}function Kr(){S.default.onselectstart=function(){return!0}}function qr(e){if(e&&e.getBoundingClientRect&&e.parentNode){let t=e.getBoundingClientRect(),n={};return[`bottom`,`height`,`left`,`right`,`top`,`width`].forEach(e=>{t[e]!==void 0&&(n[e]=t[e])}),n.height||=parseFloat(ri(e,`height`)),n.width||=parseFloat(ri(e,`width`)),n}}function W(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};let t=e.offsetWidth,n=e.offsetHeight,r=0,i=0;for(;e.offsetParent&&e!==S.default[Hn.fullscreenElement];)r+=e.offsetLeft,i+=e.offsetTop,e=e.offsetParent;return{left:r,top:i,width:t,height:n}}function Jr(e,t){let n={x:0,y:0};if(Tr){let t=e;for(;t&&t.nodeName.toLowerCase()!==`html`;){let e=ri(t,`transform`);if(/^matrix/.test(e)){let t=e.slice(7,-1).split(/,\s/).map(Number);n.x+=t[4],n.y+=t[5]}else if(/^matrix3d/.test(e)){let t=e.slice(9,-1).split(/,\s/).map(Number);n.x+=t[12],n.y+=t[13]}if(t.assignedSlot&&t.assignedSlot.parentElement&&C.default.WebKitCSSMatrix){let e=C.default.getComputedStyle(t.assignedSlot.parentElement).transform,r=new C.default.WebKitCSSMatrix(e);n.x+=r.m41,n.y+=r.m42}t=t.parentNode||t.host}}let r={},i=W(t.target),a=W(e),o=a.width,s=a.height,c=t.offsetY-(a.top-i.top),l=t.offsetX-(a.left-i.left);return t.changedTouches&&(l=t.changedTouches[0].pageX-a.left,c=t.changedTouches[0].pageY+a.top,Tr&&(l-=n.x,c-=n.y)),r.y=1-Math.max(0,Math.min(1,c/s)),r.x=Math.max(0,Math.min(1,l/o)),r}function Yr(e){return $n(e)&&e.nodeType===3}function Xr(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function Zr(e){return typeof e==`function`&&(e=e()),(Array.isArray(e)?e:[e]).map(e=>{if(typeof e==`function`&&(e=e()),jr(e)||Yr(e))return e;if(typeof e==`string`&&/\S/.test(e))return S.default.createTextNode(e)}).filter(e=>e)}function Qr(e,t){return Zr(t).forEach(t=>e.appendChild(t)),e}function $r(e,t){return Qr(Xr(e),t)}function ei(e){return e.button===void 0&&e.buttons===void 0||e.button===0&&e.buttons===void 0||e.type===`mouseup`&&e.button===0&&e.buttons===0||e.type===`mousedown`&&e.button===0&&e.buttons===0?!0:!(e.button!==0||e.buttons!==1)}var ti=Nr(`querySelector`),ni=Nr(`querySelectorAll`);function ri(e,t){if(!e||!t)return``;if(typeof C.default.getComputedStyle==`function`){let n;try{n=C.default.getComputedStyle(e)}catch{return``}return n?n.getPropertyValue(t)||n[t]:``}return``}function ii(e){[...S.default.styleSheets].forEach(t=>{try{let n=[...t.cssRules].map(e=>e.cssText).join(``),r=S.default.createElement(`style`);r.textContent=n,e.document.head.appendChild(r)}catch{let n=S.default.createElement(`link`);n.rel=`stylesheet`,n.type=t.type,n.media=t.media.mediaText,n.href=t.href,e.document.head.appendChild(n)}})}var ai=Object.freeze({__proto__:null,isReal:Ar,isEl:jr,isInFrame:Mr,createEl:U,textContent:Pr,prependTo:Fr,hasClass:Ir,addClass:Lr,removeClass:Rr,toggleClass:zr,setAttributes:Br,getAttributes:Vr,getAttribute:Hr,setAttribute:Ur,removeAttribute:Wr,blockTextSelection:Gr,unblockTextSelection:Kr,getBoundingClientRect:qr,findPosition:W,getPointerPosition:Jr,isTextNode:Yr,emptyEl:Xr,normalizeContent:Zr,appendContent:Qr,insertContent:$r,isSingleLeftClick:ei,$:ti,$$:ni,computedStyle:ri,copyStyleSheetsToWindow:ii}),oi=!1,si,ci=function(){if(si.options.autoSetup===!1)return;let e=Array.prototype.slice.call(S.default.getElementsByTagName(`video`)),t=Array.prototype.slice.call(S.default.getElementsByTagName(`audio`)),n=Array.prototype.slice.call(S.default.getElementsByTagName(`video-js`)),r=e.concat(t,n);if(r&&r.length>0)for(let e=0,t=r.length;e<t;e++){let t=r[e];if(t&&t.getAttribute)t.player===void 0&&t.getAttribute(`data-setup`)!==null&&si(t);else{li(1);break}}else oi||li(1)};function li(e,t){Ar()&&(t&&(si=t),C.default.setTimeout(ci,e))}function ui(){oi=!0,C.default.removeEventListener(`load`,ui)}Ar()&&(S.default.readyState===`complete`?ui():C.default.addEventListener(`load`,ui));var di=function(e){let t=S.default.createElement(`style`);return t.className=e,t},fi=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},pi=new WeakMap,mi=3;function hi(){return mi++}function gi(e,t){if(!pi.has(e))return;let n=pi.get(e);n.handlers[t].length===0&&(delete n.handlers[t],e.removeEventListener?e.removeEventListener(t,n.dispatcher,!1):e.detachEvent&&e.detachEvent(`on`+t,n.dispatcher)),Object.getOwnPropertyNames(n.handlers).length<=0&&(delete n.handlers,delete n.dispatcher,delete n.disabled),Object.getOwnPropertyNames(n).length===0&&pi.delete(e)}function _i(e,t,n,r){n.forEach(function(n){e(t,n,r)})}function vi(e){if(e.fixed_)return e;function t(){return!0}function n(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){let r=e||C.default.event;e={};let i=[`layerX`,`layerY`,`keyLocation`,`path`,`webkitMovementX`,`webkitMovementY`,`mozPressure`,`mozInputSource`];for(let t in r)i.includes(t)||t===`returnValue`&&r.preventDefault||(e[t]=r[t]);if(e.target||=e.srcElement||S.default,e.relatedTarget||=e.fromElement===e.target?e.toElement:e.fromElement,e.preventDefault=function(){r.preventDefault&&r.preventDefault(),e.returnValue=!1,r.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),e.cancelBubble=!0,r.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=n,e.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=n,e.clientX!==null&&e.clientX!==void 0){let t=S.default.documentElement,n=S.default.body;e.pageX=e.clientX+(t&&t.scrollLeft||n&&n.scrollLeft||0)-(t&&t.clientLeft||n&&n.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||n&&n.scrollTop||0)-(t&&t.clientTop||n&&n.clientTop||0)}e.which=e.charCode||e.keyCode,e.button!==null&&e.button!==void 0&&(e.button=e.button&1?0:e.button&4?1:e.button&2?2:0)}return e.fixed_=!0,e}var yi,bi=function(){if(typeof yi!=`boolean`){yi=!1;try{let e=Object.defineProperty({},`passive`,{get(){yi=!0}});C.default.addEventListener(`test`,null,e),C.default.removeEventListener(`test`,null,e)}catch{}}return yi},xi=[`touchstart`,`touchmove`];function Si(e,t,n){if(Array.isArray(t))return _i(Si,e,t,n);pi.has(e)||pi.set(e,{});let r=pi.get(e);if(r.handlers||={},r.handlers[t]||(r.handlers[t]=[]),n.guid||=hi(),r.handlers[t].push(n),r.dispatcher||=(r.disabled=!1,function(t,n){if(r.disabled)return;t=vi(t);let i=r.handlers[t.type];if(i){let r=i.slice(0);for(let i=0,a=r.length;i<a&&!t.isImmediatePropagationStopped();i++)try{r[i].call(e,t,n)}catch(e){B.error(e)}}}),r.handlers[t].length===1)if(e.addEventListener){let n=!1;bi()&&xi.indexOf(t)>-1&&(n={passive:!0}),e.addEventListener(t,r.dispatcher,n)}else e.attachEvent&&e.attachEvent(`on`+t,r.dispatcher)}function Ci(e,t,n){if(!pi.has(e))return;let r=pi.get(e);if(!r.handlers)return;if(Array.isArray(t))return _i(Ci,e,t,n);let i=function(e,t){r.handlers[t]=[],gi(e,t)};if(t===void 0){for(let t in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},t)&&i(e,t);return}let a=r.handlers[t];if(a){if(!n){i(e,t);return}if(n.guid)for(let e=0;e<a.length;e++)a[e].guid===n.guid&&a.splice(e--,1);gi(e,t)}}function wi(e,t,n){let r=pi.has(e)?pi.get(e):{},i=e.parentNode||e.ownerDocument;if(typeof t==`string`?t={type:t,target:e}:t.target||=e,t=vi(t),r.dispatcher&&r.dispatcher.call(e,t,n),i&&!t.isPropagationStopped()&&t.bubbles===!0)wi.call(null,i,t,n);else if(!i&&!t.defaultPrevented&&t.target&&t.target[t.type]){pi.has(t.target)||pi.set(t.target,{});let e=pi.get(t.target);t.target[t.type]&&(e.disabled=!0,typeof t.target[t.type]==`function`&&t.target[t.type](),e.disabled=!1)}return!t.defaultPrevented}function Ti(e,t,n){if(Array.isArray(t))return _i(Ti,e,t,n);let r=function(){Ci(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||hi(),Si(e,t,r)}function Ei(e,t,n){let r=function(){Ci(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||hi(),Si(e,t,r)}var Di=Object.freeze({__proto__:null,fixEvent:vi,on:Si,off:Ci,trigger:wi,one:Ti,any:Ei}),Oi=30,G=function(e,t,n){t.guid||=hi();let r=t.bind(e);return r.guid=n?n+`_`+t.guid:t.guid,r},ki=function(e,t){let n=C.default.performance.now();return function(...r){let i=C.default.performance.now();i-n>=t&&(e(...r),n=i)}},Ai=function(e,t,n,r=C.default){let i,a=()=>{r.clearTimeout(i),i=null},o=function(){let a=this,o=arguments,s=function(){i=null,s=null,n||e.apply(a,o)};!i&&n&&e.apply(a,o),r.clearTimeout(i),i=r.setTimeout(s,t)};return o.cancel=a,o},ji=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Oi,bind_:G,throttle:ki,debounce:Ai}),Mi,Ni=class{on(e,t){let n=this.addEventListener;this.addEventListener=()=>{},Si(this,e,t),this.addEventListener=n}off(e,t){Ci(this,e,t)}one(e,t){let n=this.addEventListener;this.addEventListener=()=>{},Ti(this,e,t),this.addEventListener=n}any(e,t){let n=this.addEventListener;this.addEventListener=()=>{},Ei(this,e,t),this.addEventListener=n}trigger(e){let t=e.type||e;typeof e==`string`&&(e={type:t}),e=vi(e),this.allowedEvents_[t]&&this[`on`+t]&&this[`on`+t](e),wi(this,e)}queueTrigger(e){Mi||=new Map;let t=e.type||e,n=Mi.get(this);n||(n=new Map,Mi.set(this,n));let r=n.get(t);n.delete(t),C.default.clearTimeout(r);let i=C.default.setTimeout(()=>{n.delete(t),n.size===0&&(n=null,Mi.delete(this)),this.trigger(e)},0);n.set(t,i)}};Ni.prototype.allowedEvents_={},Ni.prototype.addEventListener=Ni.prototype.on,Ni.prototype.removeEventListener=Ni.prototype.off,Ni.prototype.dispatchEvent=Ni.prototype.trigger;var Pi=e=>typeof e.name==`function`?e.name():typeof e.name==`string`?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,Fi=e=>e instanceof Ni||!!e.eventBusEl_&&[`on`,`one`,`off`,`trigger`].every(t=>typeof e[t]==`function`),Ii=(e,t)=>{Fi(e)?t():(e.eventedCallbacks||=[],e.eventedCallbacks.push(t))},Li=e=>typeof e==`string`&&/\S/.test(e)||Array.isArray(e)&&!!e.length,Ri=(e,t,n)=>{if(!e||!e.nodeName&&!Fi(e))throw Error(`Invalid target for ${Pi(t)}#${n}; must be a DOM node or evented object.`)},zi=(e,t,n)=>{if(!Li(e))throw Error(`Invalid event type for ${Pi(t)}#${n}; must be a non-empty string or array.`)},Bi=(e,t,n)=>{if(typeof e!=`function`)throw Error(`Invalid listener for ${Pi(t)}#${n}; must be a function.`)},Vi=(e,t,n)=>{let r=t.length<3||t[0]===e||t[0]===e.eventBusEl_,i,a,o;return r?(i=e.eventBusEl_,t.length>=3&&t.shift(),[a,o]=t):(i=t[0],a=t[1],o=t[2]),Ri(i,e,n),zi(a,e,n),Bi(o,e,n),o=G(e,o),{isTargetingSelf:r,target:i,type:a,listener:o}},Hi=(e,t,n,r)=>{Ri(e,e,t),e.nodeName?Di[t](e,n,r):e[t](n,r)},Ui={on(...e){let{isTargetingSelf:t,target:n,type:r,listener:i}=Vi(this,e,`on`);if(Hi(n,`on`,r,i),!t){let e=()=>this.off(n,r,i);e.guid=i.guid;let t=()=>this.off(`dispose`,e);t.guid=i.guid,Hi(this,`on`,`dispose`,e),Hi(n,`on`,`dispose`,t)}},one(...e){let{isTargetingSelf:t,target:n,type:r,listener:i}=Vi(this,e,`one`);if(t)Hi(n,`one`,r,i);else{let e=(...t)=>{this.off(n,r,e),i.apply(null,t)};e.guid=i.guid,Hi(n,`one`,r,e)}},any(...e){let{isTargetingSelf:t,target:n,type:r,listener:i}=Vi(this,e,`any`);if(t)Hi(n,`any`,r,i);else{let e=(...t)=>{this.off(n,r,e),i.apply(null,t)};e.guid=i.guid,Hi(n,`any`,r,e)}},off(e,t,n){if(!e||Li(e))Ci(this.eventBusEl_,e,t);else{let r=e,i=t;Ri(r,this,`off`),zi(i,this,`off`),Bi(n,this,`off`),n=G(this,n),this.off(`dispose`,n),r.nodeName?(Ci(r,i,n),Ci(r,`dispose`,n)):Fi(r)&&(r.off(i,n),r.off(`dispose`,n))}},trigger(e,t){if(Ri(this.eventBusEl_,this,`trigger`),!Li(e&&typeof e!=`string`?e.type:e))throw Error(`Invalid event type for ${Pi(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return wi(this.eventBusEl_,e,t)}};function Wi(e,t={}){let{eventBusKey:n}=t;if(n){if(!e[n].nodeName)throw Error(`The eventBusKey "${n}" does not refer to an element.`);e.eventBusEl_=e[n]}else e.eventBusEl_=U(`span`,{className:`vjs-event-bus`});return Object.assign(e,Ui),e.eventedCallbacks&&e.eventedCallbacks.forEach(e=>{e()}),e.on(`dispose`,()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach(function(e){e&&pi.has(e)&&pi.delete(e)}),C.default.setTimeout(()=>{e.eventBusEl_=null},0)}),e}var Gi={state:{},setState(e){typeof e==`function`&&(e=e());let t;return Qn(e,(e,n)=>{this.state[n]!==e&&(t||={},t[n]={from:this.state[n],to:e}),this.state[n]=e}),t&&Fi(this)&&this.trigger({changes:t,type:`statechanged`}),t}};function Ki(e,t){return Object.assign(e,Gi),e.state=Object.assign({},e.state,t),typeof e.handleStateChanged==`function`&&Fi(e)&&e.on(`statechanged`,e.handleStateChanged),e}var qi=function(e){return typeof e==`string`?e.replace(/./,e=>e.toLowerCase()):e},Ji=function(e){return typeof e==`string`?e.replace(/./,e=>e.toUpperCase()):e},Yi=function(e,t){return Ji(e)===Ji(t)},Xi=Object.freeze({__proto__:null,toLowerCase:qi,toTitleCase:Ji,titleCaseEquals:Yi}),K=class e{constructor(e,t,n){!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=H({},this.options_),t=this.options_=H(this.options_,t),this.id_=t.id||t.el&&t.el.id,this.id_||=`${e&&e.id&&e.id()||`no_player`}_component_${hi()}`,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(e=>this.addClass(e)),[`on`,`off`,`one`,`any`,`trigger`].forEach(e=>{this[e]=void 0}),t.evented!==!1&&(Wi(this,{eventBusKey:this.el_?`el_`:null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,`languagechange`,this.handleLanguagechange)),Ki(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(n),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 e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].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_)),null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e&&(this.options_=H(this.options_,e)),this.options_}el(){return this.el_}createEl(e,t,n){return U(e,t,n)}localize(e,t,n=e){let r=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),a=i&&i[r],o=r&&r.split(`-`)[0],s=i&&i[o],c=n;return a&&a[e]?c=a[e]:s&&s[e]&&(c=s[e]),t&&(c=c.replace(/\{(\d+)\}/g,function(e,n){let r=t[n-1],i=r;return r===void 0&&(i=e),i})),c}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((e,t)=>e.concat(t),[]);let t=this;for(let n=0;n<e.length;n++)if(t=t.getChild(e[n]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;let n=`http://www.w3.org/2000/svg`,r=U(`span`,{className:`vjs-icon-placeholder vjs-svg-icon`},{"aria-hidden":`true`}),i=S.default.createElementNS(n,`svg`);i.setAttributeNS(null,`viewBox`,`0 0 512 512`);let a=S.default.createElementNS(n,`use`);return i.appendChild(a),a.setAttributeNS(null,`href`,`#vjs-icon-${e}`),r.appendChild(i),this.iconIsSet_?t.replaceChild(r,t.querySelector(`.vjs-icon-placeholder`)):t.appendChild(r),this.iconIsSet_=!0,r}addChild(t,n={},r=this.children_.length){let i,a;if(typeof t==`string`){a=Ji(t);let r=n.componentClass||a;n.name=a;let o=e.getComponent(r);if(!o)throw Error(`Component ${r} does not exist`);if(typeof o!=`function`)return null;i=new o(this.player_||this,n)}else i=t;if(i.parentComponent_&&i.parentComponent_.removeChild(i),this.children_.splice(r,0,i),i.parentComponent_=this,typeof i.id==`function`&&(this.childIndex_[i.id()]=i),a||=i.name&&Ji(i.name()),a&&(this.childNameIndex_[a]=i,this.childNameIndex_[qi(a)]=i),typeof i.el==`function`&&i.el()){let e=null;this.children_[r+1]&&(this.children_[r+1].el_?e=this.children_[r+1].el_:jr(this.children_[r+1])&&(e=this.children_[r+1])),this.contentEl().insertBefore(i.el(),e)}return i}removeChild(e){if(typeof e==`string`&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[Ji(e.name())]=null,this.childNameIndex_[qi(e.name())]=null;let n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){let t=this.options_.children;if(t){let n=this.options_,r=e=>{let t=e.name,r=e.opts;if(n[t]!==void 0&&(r=n[t]),r===!1)return;r===!0&&(r={}),r.playerOptions=this.options_.playerOptions;let i=this.addChild(t,r);i&&(this[t]=i)},i,a=e.getComponent(`Tech`);i=Array.isArray(t)?t:Object.keys(t),i.concat(Object.keys(this.options_).filter(function(e){return!i.some(function(t){return typeof t==`string`?e===t:e===t.name})})).map(e=>{let n,r;return typeof e==`string`?(n=e,r=t[n]||this.options_[n]||{}):(n=e.name,r=e),{name:n,opts:r}}).filter(t=>{let n=e.getComponent(t.opts.componentClass||Ji(t.name));return n&&!a.isTech(n)}).forEach(r)}}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(){let e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger(`ready`)},1)}$(e,t){return ti(e,t||this.contentEl())}$$(e,t){return ni(e,t||this.contentEl())}hasClass(e){return Ir(this.el_,e)}addClass(...e){Lr(this.el_,...e)}removeClass(...e){Rr(this.el_,...e)}toggleClass(e,t){zr(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 Hr(this.el_,e)}setAttribute(e,t){Ur(this.el_,e,t)}removeAttribute(e){Wr(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,n){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`,n||this.trigger(`componentresize`);return}if(!this.el_)return 0;let r=this.el_.style[e],i=r.indexOf(`px`);return parseInt(i===-1?this.el_[`offset`+Ji(e)]:r.slice(0,i),10)}currentDimension(e){let t=0;if(e!==`width`&&e!==`height`)throw Error(`currentDimension only accepts width or height value`);if(t=ri(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){let n=`offset${Ji(e)}`;t=this.el_[n]}return t}currentDimensions(){return{width:this.currentDimension(`width`),height:this.currentDimension(`height`)}}currentWidth(){return this.currentDimension(`width`)}currentHeight(){return this.currentDimension(`height`)}getPositions(){let e=this.el_.getBoundingClientRect();return{boundingClientRect:{x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},center:{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}}}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,n;this.on(`touchstart`,function(r){r.touches.length===1&&(t={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},e=C.default.performance.now(),n=!0)}),this.on(`touchmove`,function(e){if(e.touches.length>1)n=!1;else if(t){let r=e.touches[0].pageX-t.pageX,i=e.touches[0].pageY-t.pageY;Math.sqrt(r*r+i*i)>10&&(n=!1)}});let r=function(){n=!1};this.on(`touchleave`,r),this.on(`touchcancel`,r),this.on(`touchend`,function(r){t=null,n===!0&&C.default.performance.now()-e<200&&(r.preventDefault(),this.trigger(`tap`))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;let e=G(this.player(),this.player().reportUserActivity),t;this.on(`touchstart`,function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});let n=function(n){e(),this.clearInterval(t)};this.on(`touchmove`,e),this.on(`touchend`,n),this.on(`touchcancel`,n)}setTimeout(e,t){var n;return e=G(this,e),this.clearTimersOnDispose_(),n=C.default.setTimeout(()=>{this.setTimeoutIds_.has(n)&&this.setTimeoutIds_.delete(n),e()},t),this.setTimeoutIds_.add(n),n}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),C.default.clearTimeout(e)),e}setInterval(e,t){e=G(this,e),this.clearTimersOnDispose_();let n=C.default.setInterval(e,t);return this.setIntervalIds_.add(n),n}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),C.default.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=G(this,e),t=C.default.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=G(this,t);let n=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,n),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),C.default.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((e,n)=>this[t](n))}),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(e){let t=C.default.getComputedStyle(e,null),n=t.getPropertyValue(`visibility`);return t.getPropertyValue(`display`)!==`none`&&![`hidden`,`collapse`].includes(n)}function n(e){return!(!t(e.parentElement)||!t(e)||e.style.opacity===`0`||C.default.getComputedStyle(e).height===`0px`||C.default.getComputedStyle(e).width===`0px`)}function r(e){if(e.offsetWidth+e.offsetHeight+e.getBoundingClientRect().height+e.getBoundingClientRect().width===0)return!1;let t={x:e.getBoundingClientRect().left+e.offsetWidth/2,y:e.getBoundingClientRect().top+e.offsetHeight/2};if(t.x<0||t.x>(S.default.documentElement.clientWidth||C.default.innerWidth)||t.y<0||t.y>(S.default.documentElement.clientHeight||C.default.innerHeight))return!1;let n=S.default.elementFromPoint(t.x,t.y);for(;n;){if(n===e)return!0;if(n.parentNode)n=n.parentNode;else return!1}}return e||=this.el(),!!(r(e)&&n(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(t,n){if(typeof t!=`string`||!t)throw Error(`Illegal component name, "${t}"; must be a non-empty string.`);let r=e.getComponent(`Tech`),i=r&&r.isTech(n),a=e===n||e.prototype.isPrototypeOf(n.prototype);if(i||!a){let e;throw e=i?`techs must be registered using Tech.registerTech()`:`must be a Component subclass`,Error(`Illegal component, "${t}"; ${e}.`)}t=Ji(t),e.components_||={};let o=e.getComponent(`Player`);if(t===`Player`&&o&&o.players){let e=o.players,t=Object.keys(e);if(e&&t.length>0){for(let n=0;n<t.length;n++)if(e[t[n]]!==null)throw Error(`Can not register Player component after player has been created.`)}}return e.components_[t]=n,e.components_[qi(t)]=n,n}static getComponent(t){if(!(!t||!e.components_))return e.components_[t]}};K.registerComponent(`Component`,K);function Zi(e,t,n){if(typeof t!=`number`||t<0||t>n)throw Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${n}).`)}function Qi(e,t,n,r){return Zi(e,r,n.length-1),n[r][t]}function $i(e){let t;return t=e===void 0||e.length===0?{length:0,start(){throw Error(`This TimeRanges object is empty`)},end(){throw Error(`This TimeRanges object is empty`)}}:{length:e.length,start:Qi.bind(null,`start`,0,e),end:Qi.bind(null,`end`,1,e)},C.default.Symbol&&C.default.Symbol.iterator&&(t[C.default.Symbol.iterator]=()=>(e||[]).values()),t}function ea(e,t){return Array.isArray(e)?$i(e):e===void 0||t===void 0?$i():$i([[e,t]])}var ta=function(e,t){e=e<0?0:e;let n=Math.floor(e%60),r=Math.floor(e/60%60),i=Math.floor(e/3600),a=Math.floor(t/60%60),o=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(i=r=n=`-`),i=i>0||o>0?i+`:`:``,r=((i||a>=10)&&r<10?`0`+r:r)+`:`,n=n<10?`0`+n:n,i+r+n},na=ta;function ra(e){na=e}function ia(){na=ta}function aa(e,t=e){return na(e,t)}var oa=Object.freeze({__proto__:null,createTimeRanges:ea,createTimeRange:ea,setFormatTime:ra,resetFormatTime:ia,formatTime:aa});function sa(e,t){let n=0,r,i;if(!t)return 0;(!e||!e.length)&&(e=ea(0,0));for(let a=0;a<e.length;a++)r=e.start(a),i=e.end(a),i>t&&(i=t),n+=i-r;return n/t}function q(e){if(e instanceof q)return e;typeof e==`number`?this.code=e:typeof e==`string`?this.message=e:$n(e)&&(typeof e.code==`number`&&(this.code=e.code),Object.assign(this,e)),this.message||=q.defaultMessages[this.code]||``}q.prototype.code=0,q.prototype.message=``,q.prototype.status=null,q.prototype.metadata=null,q.errorTypes=[`MEDIA_ERR_CUSTOM`,`MEDIA_ERR_ABORTED`,`MEDIA_ERR_NETWORK`,`MEDIA_ERR_DECODE`,`MEDIA_ERR_SRC_NOT_SUPPORTED`,`MEDIA_ERR_ENCRYPTED`],q.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.`},q.MEDIA_ERR_CUSTOM=0,q.prototype.MEDIA_ERR_CUSTOM=0,q.MEDIA_ERR_ABORTED=1,q.prototype.MEDIA_ERR_ABORTED=1,q.MEDIA_ERR_NETWORK=2,q.prototype.MEDIA_ERR_NETWORK=2,q.MEDIA_ERR_DECODE=3,q.prototype.MEDIA_ERR_DECODE=3,q.MEDIA_ERR_SRC_NOT_SUPPORTED=4,q.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,q.MEDIA_ERR_ENCRYPTED=5,q.prototype.MEDIA_ERR_ENCRYPTED=5;function ca(e){return e!=null&&typeof e.then==`function`}function la(e){ca(e)&&e.then(null,e=>{})}var ua=function(e){return[`kind`,`label`,`language`,`id`,`inBandMetadataTrackDispatchType`,`mode`,`src`].reduce((t,n,r)=>(e[n]&&(t[n]=e[n]),t),{cues:e.cues&&Array.prototype.map.call(e.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})},da={textTracksToJson:function(e){let t=e.$$(`track`),n=Array.prototype.map.call(t,e=>e.track);return Array.prototype.map.call(t,function(e){let t=ua(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return n.indexOf(e)===-1}).map(ua))},jsonToTextTracks:function(e,t){return e.forEach(function(e){let n=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(e=>n.addCue(e))}),t.textTracks()},trackToJson:ua},fa=`vjs-modal-dialog`,pa=class extends K{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=U(`div`,{className:`${fa}-content`},{role:`document`}),this.descEl_=U(`p`,{className:`${fa}-description vjs-control-text`,id:this.el().getAttribute(`aria-describedby`)}),Pr(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`${fa} 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}let 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;let 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`){let t=this.closeable_=!!e,n=this.getChild(`closeButton`);if(t&&!n){let e=this.contentEl_;this.contentEl_=this.el_,n=this.addChild(`closeButton`,{controlText:`Close Modal Dialog`}),this.contentEl_=e,this.on(n,`close`,this.close_)}!t&&n&&(this.off(n,`close`,this.close_),this.removeChild(n),n.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){let t=this.contentEl(),n=t.parentNode,r=t.nextSibling;this.trigger(`beforemodalfill`),this.hasBeenFilled_=!0,n.removeChild(t),this.empty(),$r(t,e),this.trigger(`modalfill`),r?n.insertBefore(t,r):n.appendChild(t);let i=this.getChild(`closeButton`);i&&n.appendChild(i.el_),this.trigger(`aftermodalfill`)}empty(){this.trigger(`beforemodalempty`),Xr(this.contentEl()),this.trigger(`modalempty`)}content(e){return e!==void 0&&(this.content_=e),this.content_}conditionalFocus_(){let e=S.default.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&=(this.previouslyActiveEl_.focus(),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;let t=this.focusableEls_(),n=this.el_.querySelector(`:focus`),r;for(let e=0;e<t.length;e++)if(n===t[e]){r=e;break}S.default.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_(){let e=this.el_.querySelectorAll(`*`);return Array.prototype.filter.call(e,e=>(e instanceof C.default.HTMLAnchorElement||e instanceof C.default.HTMLAreaElement)&&e.hasAttribute(`href`)||(e instanceof C.default.HTMLInputElement||e instanceof C.default.HTMLSelectElement||e instanceof C.default.HTMLTextAreaElement||e instanceof C.default.HTMLButtonElement)&&!e.hasAttribute(`disabled`)||e instanceof C.default.HTMLIFrameElement||e instanceof C.default.HTMLObjectElement||e instanceof C.default.HTMLEmbedElement||e.hasAttribute(`tabindex`)&&e.getAttribute(`tabindex`)!==-1||e.hasAttribute(`contenteditable`))}};pa.prototype.options_={pauseOnOpen:!0,temporary:!0},K.registerComponent(`ModalDialog`,pa);var ma=class extends Ni{constructor(e=[]){super(),this.tracks_=[];for(let t=0;t<e.length;t++)this.addTrack(e[t])}get length(){return this.tracks_.length}addTrack(e){let 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})},Fi(e)&&e.addEventListener(`labelchange`,e.labelchange_)}removeTrack(e){let t;for(let n=0,r=this.length;n<r;n++)if(this[n]===e){t=this[n],t.off&&t.off(),this.tracks_.splice(n,1);break}t&&this.trigger({track:t,type:`removetrack`,target:this})}getTrackById(e){let t=null;for(let n=0,r=this.length;n<r;n++){let r=this[n];if(r.id===e){t=r;break}}return t}};ma.prototype.allowedEvents_={change:`change`,addtrack:`addtrack`,removetrack:`removetrack`,labelchange:`labelchange`};for(let e in ma.prototype.allowedEvents_)ma.prototype[`on`+e]=null;var ha=function(e,t){for(let n=0;n<e.length;n++)!Object.keys(e[n]).length||t.id===e[n].id||(e[n].enabled=!1)},ga=class extends ma{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){ha(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&ha(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,ha(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)}},_a=function(e,t){for(let n=0;n<e.length;n++)!Object.keys(e[n]).length||t.id===e[n].id||(e[n].selected=!1)},va=class extends ma{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){_a(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,`selectedIndex`,{get(){for(let e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set(){}})}addTrack(e){e.selected&&_a(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,_a(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)}},ya=class extends ma{addTrack(e){super.addTrack(e),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())}},ba=class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,`length`,{get(){return this.trackElements_.length}});for(let t=0,n=e.length;t<n;t++)this.addTrackElement_(e[t])}addTrackElement_(e){let 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 n=0,r=this.trackElements_.length;n<r;n++)if(e===this.trackElements_[n].track){t=this.trackElements_[n];break}return t}removeTrackElement_(e){for(let t=0,n=this.trackElements_.length;t<n;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}}},xa=class e{constructor(t){e.prototype.setCues_.call(this,t),Object.defineProperty(this,`length`,{get(){return this.length_}})}setCues_(e){let t=this.length||0,n=0,r=e.length;this.cues_=e,this.length_=e.length;let i=function(e){``+e in this||Object.defineProperty(this,``+e,{get(){return this.cues_[e]}})};if(t<r)for(n=t;n<r;n++)i.call(this,n)}getCueById(e){let t=null;for(let n=0,r=this.length;n<r;n++){let r=this[n];if(r.id===e){t=r;break}}return t}},Sa={alternative:`alternative`,captions:`captions`,main:`main`,sign:`sign`,subtitles:`subtitles`,commentary:`commentary`},Ca={alternative:`alternative`,descriptions:`descriptions`,main:`main`,"main-desc":`main-desc`,translation:`translation`,commentary:`commentary`},wa={subtitles:`subtitles`,captions:`captions`,descriptions:`descriptions`,chapters:`chapters`,metadata:`metadata`},Ta={disabled:`disabled`,hidden:`hidden`,showing:`showing`},Ea=class extends Ni{constructor(e={}){super();let t={id:e.id||`vjs_track_`+hi(),kind:e.kind||``,language:e.language||``},n=e.label||``;for(let e in t)Object.defineProperty(this,e,{get(){return t[e]},set(){}});Object.defineProperty(this,`label`,{get(){return n},set(e){e!==n&&(n=e,this.trigger(`labelchange`))}})}},Da=function(e){return new URL(e,S.default.baseURI)},Oa=function(e){return new URL(e,S.default.baseURI).href},ka=function(e){if(typeof e==`string`){let t=e.split(`?`)[0].replace(/\/+$/,``).match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():``}return``},Aa=function(e,t=C.default.location){return Da(e).origin!==t.origin},ja=Object.freeze({__proto__:null,parseUrl:Da,getAbsoluteURL:Oa,getFileExtension:ka,isCrossOrigin:Aa}),Ma=function(e,t){let n=new C.default.WebVTT.Parser(C.default,C.default.vttjs,C.default.WebVTT.StringDecoder()),r=[];n.oncue=function(e){t.addCue(e)},n.onparsingerror=function(e){r.push(e)},n.onflush=function(){t.trigger({type:`loadeddata`,target:t})},n.parse(e),r.length>0&&(C.default.console&&C.default.console.groupCollapsed&&C.default.console.groupCollapsed(`Text Track parsing errors for ${t.src}`),r.forEach(e=>B.error(e)),C.default.console&&C.default.console.groupEnd&&C.default.console.groupEnd()),n.flush()},Na=function(e,t){let n={uri:e},r=Aa(e);r&&(n.cors=r);let i=t.tech_.crossOrigin()===`use-credentials`;i&&(n.withCredentials=i),(0,x.default)(n,G(this,function(e,n,r){if(e)return B.error(e,n);t.loaded_=!0,typeof C.default.WebVTT==`function`?Ma(r,t):t.tech_&&t.tech_.any([`vttjsloaded`,`vttjserror`],e=>{if(e.type===`vttjserror`){B.error(`vttjs failed to load, stopping trying to process ${t.src}`);return}return Ma(r,t)})}))},Pa=class extends Ea{constructor(e={}){if(!e.tech)throw Error(`A tech was not provided.`);let t=H(e,{kind:wa[e.kind]||`subtitles`,language:e.language||e.srclang||``}),n=Ta[t.mode]||`disabled`,r=t.default;(t.kind===`metadata`||t.kind===`chapters`)&&(n=`hidden`),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;let i=new xa(this.cues_),a=new xa(this.activeCues_),o=!1;this.timeupdateHandler=G(this,function(e={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){e.type!==`timeupdate`&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,o&&=(this.trigger(`cuechange`),!1),e.type!==`timeupdate`&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}}),this.tech_.one(`dispose`,()=>{this.stopTracking()}),n!==`disabled`&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return n},set(e){Ta[e]&&n!==e&&(n=e,!this.preload_&&n!==`disabled`&&this.cues.length===0&&Na(this.src,this),this.stopTracking(),n!==`disabled`&&this.startTracking(),this.trigger(`modechange`))}},cues:{get(){return this.loaded_?i:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;let e=this.tech_.currentTime(),t=[];for(let n=0,r=this.cues.length;n<r;n++){let r=this.cues[n];r.startTime<=e&&r.endTime>=e&&t.push(r)}if(o=!1,t.length!==this.activeCues_.length)o=!0;else for(let e=0;e<t.length;e++)this.activeCues_.indexOf(t[e])===-1&&(o=!0);return this.activeCues_=t,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`)&&Na(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_),void 0),this.tech_.off(`timeupdate`,this.timeupdateHandler)}addCue(e){let t=e;if(!(`getCueAsHTML`in t)){t=new C.default.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(let n in e)n in t||(t[n]=e[n]);t.id=e.id,t.originalCue_=e}let n=this.tech_.textTracks();for(let e=0;e<n.length;e++)n[e]!==this&&n[e].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}toJSON(){return da.trackToJson(this)}removeCue(e){let t=this.cues_.length;for(;t--;){let n=this.cues_[t];if(n===e||n.originalCue_&&n.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}};Pa.prototype.allowedEvents_={cuechange:`cuechange`};var Fa=class extends Ea{constructor(e={}){let t=H(e,{kind:Ca[e.kind]||``});super(t);let n=!1;Object.defineProperty(this,`enabled`,{get(){return n},set(e){typeof e!=`boolean`||e===n||(n=e,this.trigger(`enabledchange`))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}},Ia=class extends Ea{constructor(e={}){let t=H(e,{kind:Sa[e.kind]||``});super(t);let n=!1;Object.defineProperty(this,`selected`,{get(){return n},set(e){typeof e!=`boolean`||e===n||(n=e,this.trigger(`selectedchange`))}}),t.selected&&(this.selected=t.selected)}},La=class e extends Ni{constructor(t={}){super();let n,r=new Pa(t);this.kind=r.kind,this.src=r.src,this.srclang=r.language,this.label=r.label,this.default=r.default,Object.defineProperties(this,{readyState:{get(){return n}},track:{get(){return r}}}),n=e.NONE,r.addEventListener(`loadeddata`,()=>{n=e.LOADED,this.trigger({type:`load`,target:this})})}};La.prototype.allowedEvents_={load:`load`},La.NONE=0,La.LOADING=1,La.LOADED=2,La.ERROR=3;var Ra={audio:{ListClass:ga,TrackClass:Fa,capitalName:`Audio`},video:{ListClass:va,TrackClass:Ia,capitalName:`Video`},text:{ListClass:ya,TrackClass:Pa,capitalName:`Text`}};Object.keys(Ra).forEach(function(e){Ra[e].getterName=`${e}Tracks`,Ra[e].privateName=`${e}Tracks_`});var za={remoteText:{ListClass:ya,TrackClass:Pa,capitalName:`RemoteText`,getterName:`remoteTextTracks`,privateName:`remoteTextTracks_`},remoteTextEl:{ListClass:ba,TrackClass:La,capitalName:`RemoteTextTrackEls`,getterName:`remoteTextTrackEls`,privateName:`remoteTextTrackEls_`}},Ba=Object.assign({},Ra,za);za.names=Object.keys(za),Ra.names=Object.keys(Ra),Ba.names=[].concat(za.names,Ra.names);function Va(e,t,n,r,i={}){let a=e.textTracks();i.kind=t,n&&(i.label=n),r&&(i.language=r),i.tech=e;let o=new Ba.text.TrackClass(i);return a.addTrack(o),o}var J=class e extends K{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on(`playing`,function(){this.hasStarted_=!0}),this.on(`loadstart`,function(){this.hasStarted_=!1}),Ba.names.forEach(t=>{let n=Ba[t];e&&e[n.getterName]&&(this[n.privateName]=e[n.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),[`Text`,`Audio`,`Video`].forEach(t=>{e[`native${t}Tracks`]===!1&&(this[`featuresNative${t}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 Ba.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(G(this,function(){let e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger(`progress`),this.bufferedPercent_=e,e===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return ea(0,0)}bufferedPercent(){return sa(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(Ra.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(e=>{let t=this[`${e}Tracks`]()||[],n=t.length;for(;n--;){let r=t[n];e===`text`&&this.removeRemoteTextTrack(r),t.removeTrack(r)}})}cleanupAutoTextTracks(){let e=this.autoRemoteTextTracks_||[],t=e.length;for(;t--;){let n=e[t];this.removeRemoteTextTrack(n)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new q(e),this.trigger(`error`)),this.error_}played(){return this.hasStarted_?ea(0,0):ea()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:`timeupdate`,target:this,manuallyTriggered:!0})}initTrackListeners(){Ra.names.forEach(e=>{let t=Ra[e],n=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener(`removetrack`,n),r.addEventListener(`addtrack`,n),this.on(`dispose`,()=>{r.removeEventListener(`removetrack`,n),r.removeEventListener(`addtrack`,n)})})}addWebVttScript_(){if(!C.default.WebVTT)if(S.default.body.contains(this.el())){if(!this.options_[`vtt.js`]&&er(b.default)&&Object.keys(b.default).length>0){this.trigger(`vttjsloaded`);return}let e=S.default.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}),C.default.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){let e=this.textTracks(),t=this.remoteTextTracks(),n=t=>e.addTrack(t.track),r=t=>e.removeTrack(t.track);t.on(`addtrack`,n),t.on(`removetrack`,r),this.addWebVttScript_();let i=()=>this.trigger(`texttrackchange`),a=()=>{i();for(let t=0;t<e.length;t++){let n=e[t];n.removeEventListener(`cuechange`,i),n.mode===`showing`&&n.addEventListener(`cuechange`,i)}};a(),e.addEventListener(`change`,a),e.addEventListener(`addtrack`,a),e.addEventListener(`removetrack`,a),this.on(`dispose`,function(){t.off(`addtrack`,n),t.off(`removetrack`,r),e.removeEventListener(`change`,a),e.removeEventListener(`addtrack`,a),e.removeEventListener(`removetrack`,a);for(let t=0;t<e.length;t++)e[t].removeEventListener(`cuechange`,i)})}addTextTrack(e,t,n){if(!e)throw Error(`TextTrack kind is required but was not provided`);return Va(this,e,t,n)}createRemoteTextTrack(e){let t=H(e,{tech:this});return new za.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){let n=this.createRemoteTextTrack(e);return typeof t!=`boolean`&&(t=!1),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(n.track)),n}removeRemoteTextTrack(e){let 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){let t=hi();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(t,n){return e.canPlayType(t.type)}static isTech(t){return t.prototype instanceof e||t instanceof e||t===e}static registerTech(t,n){if(e.techs_||={},!e.isTech(n))throw Error(`Tech ${t} must be a Tech`);if(!e.canPlayType)throw Error(`Techs must have a static canPlayType method on them`);if(!e.canPlaySource)throw Error(`Techs must have a static canPlaySource method on them`);return t=Ji(t),e.techs_[t]=n,e.techs_[qi(t)]=n,t!==`Tech`&&e.defaultTechOrder_.push(t),n}static getTech(t){if(t){if(e.techs_&&e.techs_[t])return e.techs_[t];if(t=Ji(t),C.default&&C.default.videojs&&C.default.videojs[t])return B.warn(`The ${t} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),C.default.videojs[t]}}};Ba.names.forEach(function(e){let t=Ba[e];J.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),J.prototype.featuresVolumeControl=!0,J.prototype.featuresMuteControl=!0,J.prototype.featuresFullscreenResize=!1,J.prototype.featuresPlaybackRate=!1,J.prototype.featuresProgressEvents=!1,J.prototype.featuresSourceset=!1,J.prototype.featuresTimeupdateEvents=!1,J.prototype.featuresNativeTextTracks=!1,J.prototype.featuresVideoFrameCallback=!1,J.withSourceHandlers=function(e){e.registerSourceHandler=function(t,n){let r=e.sourceHandlers;r||=e.sourceHandlers=[],n===void 0&&(n=r.length),r.splice(n,0,t)},e.canPlayType=function(t){let n=e.sourceHandlers||[],r;for(let e=0;e<n.length;e++)if(r=n[e].canPlayType(t),r)return r;return``},e.selectSourceHandler=function(t,n){let r=e.sourceHandlers||[],i;for(let e=0;e<r.length;e++)if(i=r[e].canHandleSource(t,n),i)return r[e];return null},e.canPlaySource=function(t,n){let r=e.selectSourceHandler(t,n);return r?r.canHandleSource(t,n):``},[`seekable`,`seeking`,`duration`].forEach(function(e){let t=this[e];typeof t==`function`&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})},e.prototype),e.prototype.setSource=function(t){let n=e.selectSourceHandler(t,this.options_);n||(e.nativeSourceHandler?n=e.nativeSourceHandler:B.error(`No source handler found for the current source.`)),this.disposeSourceHandler(),this.off(`dispose`,this.disposeSourceHandler_),n!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=n.handleSource(t,this,this.options_),this.one(`dispose`,this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&=(this.clearTracks([`audio`,`video`]),null),this.cleanupAutoTextTracks(),this.sourceHandler_&&=(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),null)}},K.registerComponent(`Tech`,J),J.registerTech(`Tech`,J),J.defaultTechOrder_=[];var Ha={},Ua={},Wa={};function Ga(e,t){Ha[e]=Ha[e]||[],Ha[e].push(t)}function Ka(e,t,n){e.setTimeout(()=>io(t,Ha[t.type],n,e),1)}function qa(e,t){e.forEach(e=>e.setTech&&e.setTech(t))}function Ja(e,t,n){return e.reduceRight(eo(n),t[n]())}function Ya(e,t,n,r){return t[n](e.reduce(eo(n),r))}function Xa(e,t,n,r=null){let i=`call`+Ji(n),a=e.reduce(eo(i),r),o=a===Wa,s=o?null:t[n](a);return to(e,n,s,o),s}var Za={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Qa={setCurrentTime:1,setMuted:1,setVolume:1},$a={play:1,pause:1};function eo(e){return(t,n)=>t===Wa?Wa:n[e]?n[e](t):t}function to(e,t,n,r){for(let i=e.length-1;i>=0;i--){let a=e[i];a[t]&&a[t](r,n)}}function no(e){Ua.hasOwnProperty(e.id())&&delete Ua[e.id()]}function ro(e,t){let n=Ua[e.id()],r=null;if(n==null)return r=t(e),Ua[e.id()]=[[t,r]],r;for(let e=0;e<n.length;e++){let[i,a]=n[e];i===t&&(r=a)}return r===null&&(r=t(e),n.push([t,r])),r}function io(e={},t=[],n,r,i=[],a=!1){let[o,...s]=t;if(typeof o==`string`)io(e,Ha[o],n,r,i,a);else if(o){let t=ro(r,o);if(!t.setSource)return i.push(t),io(e,s,n,r,i,a);t.setSource(Object.assign({},e),function(o,c){if(o)return io(e,s,n,r,i,a);i.push(t),io(c,e.type===c.type?s:Ha[c.type],n,r,i,a)})}else s.length?io(e,s,n,r,i,a):a?n(e,i):io(e,Ha[`*`],n,r,i,!0)}var ao={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`},oo=function(e=``){return ao[ka(e).toLowerCase()]||``},so=(e,t)=>{if(!t)return``;if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;let n=e.cache_.sources.filter(e=>e.src===t);if(n.length)return n[0].type;let r=e.$$(`source`);for(let e=0;e<r.length;e++){let n=r[e];if(n.type&&n.src&&n.src===t)return n.type}return oo(t)},co=function(e){if(Array.isArray(e)){let t=[];e.forEach(function(e){e=co(e),Array.isArray(e)?t=t.concat(e):$n(e)&&t.push(e)}),e=t}else e=typeof e==`string`&&e.trim()?[lo({src:e})]:$n(e)&&typeof e.src==`string`&&e.src&&e.src.trim()?[lo(e)]:[];return e};function lo(e){if(!e.type){let t=oo(e.src);t&&(e.type=t)}return e}var uo=`<svg xmlns="http://www.w3.org/2000/svg">
18
18
  <defs>
19
19
  <symbol viewBox="0 0 48 48" id="vjs-icon-play">
20
20
  <path d="M16 10v28l22-14z"></path>
@@ -156,8 +156,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
156
156
  <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>
157
157
  </symbol>
158
158
  </defs>
159
- </svg>`;const Mu=un?10009:cn?461:8,Qi={codes:{play:415,pause:19,ff:417,rw:412,back:Mu},names:{415:"play",19:"pause",417:"ff",412:"rw",[Mu]:"back"},isEventKey(s,e){return e=e.toLowerCase(),!!(this.names[s.keyCode]&&this.names[s.keyCode]===e)},getEventName(s){if(this.names[s.keyCode])return this.names[s.keyCode];if(this.codes[s.code]){const e=this.codes[s.code];return this.names[e]}return null}},Ru=5;class Fg 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 i=t.key.substring(5).toLowerCase();this.move(i)}else if(Qi.isEventKey(t,"play")||Qi.isEventKey(t,"pause")||Qi.isEventKey(t,"ff")||Qi.isEventKey(t,"rw")){t.preventDefault();const i=Qi.getEventName(t);this.performMediaAction_(i)}else Qi.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()+Ru);break;case"rw":this.userSeek_(this.player_.currentTime()-Ru);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 i=null;const r=this.getCurrentComponent(e.target);t&&(i=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!i||!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 i(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&&i(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?i(r.children_):r.hasOwnProperty("items")&&r.items.length>0?i(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,c)=>{t.push({name:()=>"ModalButton"+(c+1),el:()=>l,getPositions:()=>{const f=l.getBoundingClientRect(),g={x:f.x,y:f.y,width:f.width,height:f.height,top:f.top,right:f.right,bottom:f.bottom,left:f.left},y={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:g,center:y}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:f=>!0,focus:()=>l.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let r=0;r<i.children.length;r++){const n=i.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 i of this.focusableComponents)if(i.el()===t)return i}}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 i=t.getPositions(),r=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(i.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(i.center,r,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,i){let r=1/0,n=null;for(const a of t){const l=a.getPositions().center,c=this.calculateDistance_(e,l,i);c<r&&(r=c,n=a)}return n}isInDirection_(e,t,i){switch(i){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,i){const r=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);let a;switch(i){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 Ug extends X{constructor(e,t,i){const r=Ee({createEl:!1},t);if(super(e,r,i),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,a=t.playerOptions.techOrder;n<a.length;n++){const l=Be(a[n]);let c=pe.getTech(l);if(l||(c=X.getComponent(l)),c&&c.isSupported()){e.loadTech_(l);break}}else e.src(t.playerOptions.sources)}}X.registerComponent("MediaLoader",Ug);class Hn extends X{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=i=>this.handleMouseOver(i),this.handleMouseOut_=i=>this.handleMouseOut(i),this.handleClick_=i=>this.handleClick(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&ye.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const r=ce(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(ce("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=ce("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 i=this.localize(e);this.controlText_=e,Si(this.controlTextEl_,i),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",i)}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)}}X.registerComponent("ClickableComponent",Hn);class eo extends Hn{constructor(e,t){super(e,t),this.update(),this.update_=i=>this.update(i),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return ce("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(ce("picture",{className:"vjs-poster",tabIndex:-1},{},ce("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;X.registerComponent("PosterImage",eo);const wt="#222",Nu="#ccc",Vg={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 Pa(s,e){let t;if(s.length===4)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else if(s.length===7)t=s.slice(1);else throw new Error("Invalid color code provided, "+s+"; 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 qt(s,e,t){try{s.style[e]=t}catch{return}}function Bu(s){return s?`${s}px`:""}class qg extends X{constructor(e,t,i){super(e,t,i);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(De(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=w.screen.orientation||w,l=w.screen.orientation?"change":"orientationchange";a.addEventListener(l,n),e.on("dispose",()=>a.removeEventListener(l,n));const c=this.options_.playerOptions.tracks||[];for(let f=0;f<c.length;f++)this.player_.addRemoteTextTrack(c[f],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let r,n,a;for(let l=0;l<t.length;l++){const c=t[l];i&&i.enabled&&i.language&&i.language===c.language&&c.kind in e?c.kind===i.kind?a=c:a||(a=c):i&&!i.enabled?(a=null,r=null,n=null):c.default&&(c.kind==="descriptions"&&!r?r=c:c.kind in e&&!n&&(n=c))}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 w.WebVTT=="function"&&w.WebVTT.processCues(w,[],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 c=e[l];c.mode==="showing"&&a.push(c)}this.updateForTrack(a);return}let i=null,r=null,n=e.length;for(;n--;){const a=e[n];a.mode==="showing"&&(a.kind==="descriptions"?i=a:r=a)}if(r?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(r)):i&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i)),!(w.CSS!==void 0&&w.CSS.supports("inset","10px"))){const a=this.el_,l=a.querySelectorAll(".vjs-text-track-cue"),c=this.player_.controlBar.el_.getBoundingClientRect().height,f=this.player_.el_.getBoundingClientRect().height;a.style="",qt(a,"position","relative"),qt(a,"height",f-c+"px"),qt(a,"top","unset"),dn?qt(a,"bottom",f+"px"):qt(a,"bottom","0px"),l.length>0&&l.forEach(g=>{if(g.style.inset){const y=g.style.inset.split(" ");y.length===3&&Object.assign(g.style,{top:y[0],right:y[1],bottom:y[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!(w.CSS!==void 0&&w.CSS.supports("inset-inline: 10px")))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(i-r)>.1&&(i>r?n=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),qt(this.el_,"insetInline",Bu(n)),qt(this.el_,"insetBlock",Bu(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let r=i.length;for(;r--;){const n=i[r];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&qt(a.firstChild,"color",Pa(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&qt(a.firstChild,"backgroundColor",Pa(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?qt(a,"backgroundColor",Pa(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${wt}, 2px 2px 4px ${wt}, 2px 2px 5px ${wt}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${wt}, 2px 2px ${wt}, 3px 3px ${wt}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${Nu}, 0 1px ${Nu}, -1px -1px ${wt}, 0 -1px ${wt}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${wt}, 0 0 4px ${wt}, 0 0 4px ${wt}, 0 0 4px ${wt}`)),t.fontPercent&&t.fontPercent!==1){const l=w.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=Vg[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof w.WebVTT!="function"||e.every(i=>!i.activeCues))return;const t=[];for(let i=0;i<e.length;++i){const r=e[i];for(let n=0;n<r.activeCues.length;++n)t.push(r.activeCues[n])}w.WebVTT.processCues(w,t,this.el_);for(let i=0;i<e.length;++i){const r=e[i];for(let n=0;n<r.activeCues.length;++n){const a=r.activeCues[n].displayState;Bi(a,"vjs-text-track-cue","vjs-text-track-cue-"+(r.language?r.language:i)),r.language&&gs(a,"lang",r.language)}this.player_.textTrackSettings&&this.updateDisplayState(r)}}}X.registerComponent("TextTrackDisplay",qg);class Hg extends X{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),i=ce("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(i),r}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}X.registerComponent("LoadingSpinner",Hg);class rt extends Hn{createEl(e,t={},i={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i);const r=ce(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(ce("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){const i=this.constructor.name;return ye.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),X.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)}}X.registerComponent("Button",rt);class Td extends rt{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",i=>this.handleMouseDown(i))}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 i=this.player_.getChild("controlBar"),r=i&&i.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}const n=()=>r.focus();ar(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Td.prototype.controlText_="Play Video";X.registerComponent("BigPlayButton",Td);class zg extends rt{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)}}X.registerComponent("CloseButton",zg);class xd extends rt{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",i=>this.handlePlay(i)),this.on(e,"pause",i=>this.handlePause(i)),t.replay&&this.on(e,"ended",i=>this.handleEnded(i))}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))}}xd.prototype.controlText_="Play";X.registerComponent("PlayToggle",xd);class Cs extends X{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],i=>this.update(i)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=ce("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(i),this.contentEl_=ce("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=qi(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,ye.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_=se.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}Cs.prototype.labelText_="Time";Cs.prototype.controlText_="Time";X.registerComponent("TimeDisplay",Cs);class Oo extends Cs{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():e&&e.target&&typeof e.target.pendingSeekTime=="function"&&e.target.pendingSeekTime()!==null?t=e.target.pendingSeekTime():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Oo.prototype.labelText_="Current Time";Oo.prototype.controlText_="Current Time";X.registerComponent("CurrentTimeDisplay",Oo);class Mo extends Cs{constructor(e,t){super(e,t);const i=r=>this.updateContent(r);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}Mo.prototype.labelText_="Duration";Mo.prototype.controlText_="Duration";X.registerComponent("DurationDisplay",Mo);class $g extends X{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}}X.registerComponent("TimeDivider",$g);class Ro extends Cs{constructor(e,t){super(e,t),this.on(e,"durationchange",i=>this.updateContent(i))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(ce("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)}}Ro.prototype.labelText_="Remaining Time";Ro.prototype.controlText_="Remaining Time";X.registerComponent("RemainingTimeDisplay",Ro);class Gg extends X{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",i=>this.updateShowing(i))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ce("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ce("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(se.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()}}X.registerComponent("LiveDisplay",Gg);class Sd extends rt{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=i=>this.updateLiveEdgeStatus(i),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_=ce("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()}}Sd.prototype.controlText_="Seek to live, currently playing live";X.registerComponent("SeekToLive",Sd);function gr(s,e,t){return s=Number(s),Math.min(t,Math.max(e,isNaN(s)?e:s))}var Wg=Object.freeze({__proto__:null,clamp:gr});class No extends X{constructor(e,t){super(e,t),this.handleMouseDown_=i=>this.handleMouseDown(i),this.handleMouseUp_=i=>this.handleMouseUp(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.handleClick_=i=>this.handleClick(i),this.handleMouseMove_=i=>this.handleMouseMove(i),this.update_=i=>this.update(i),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={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!Kt&&e.preventDefault(),Yc(),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;Kc(),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(gr(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Nn(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,r=t&&t.horizontalSeek;i?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")}}X.registerComponent("Slider",No);const La=(s,e)=>gr(s/e*100,0,100).toFixed(2)+"%";class Xg extends X{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",i=>this.update(i))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=ce("span",{className:"vjs-control-text"}),i=ce("span",{textContent:this.localize("Loaded")}),r=se.createTextNode(": ");return this.percentageEl_=ce("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),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,i=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,l=La(n,r);this.percent_!==l&&(this.el_.style.width=l,Si(this.percentageEl_,l),this.percent_=l);for(let c=0;c<i.length;c++){const f=i.start(c),g=i.end(c);let y=a[c];y||(y=this.el_.appendChild(ce()),a[c]=y),!(y.dataset.start===f&&y.dataset.end===g)&&(y.dataset.start=f,y.dataset.end=g,y.style.left=La(f,n),y.style.width=La(g-f,n))}for(let c=a.length;c>i.length;c--)this.el_.removeChild(a[c-1]);a.length=i.length})}}X.registerComponent("LoadProgressBar",Xg);class Yg extends X{constructor(e,t){super(e,t),this.update=Qt(De(this,this.update),jt)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const r=dr(this.el_),n=vs(this.player_.el()),a=e.width*t;if(!n||!r)return;let l=e.left-n.left+a,c=e.width-a+(n.right-e.right);c||(c=e.width-a,l=a);let f=r.width/2;l<f?f+=f-l:c<f&&(f=c),f<0?f=0:f>r.width&&(f=r.width),f=Math.round(f),this.el_.style.right=`-${f}px`,this.write(i)}write(e){Si(this.el_,e)}updateTime(e,t,i,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(),c=l-t*l;n=(c<1?"":"-")+qi(c,l)}else n=qi(i,a);this.update(e,t,n),r&&r()})}}X.registerComponent("TimeTooltip",Yg);class Bo extends X{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=Qt(De(this,this.update),jt)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t,i){const r=this.getChild("timeTooltip");if(!r)return;const n=i&&i.target&&typeof i.target.pendingSeekTime=="function"?i.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(e,t,n)}}Bo.prototype.options_={children:[]};!it&&!Nt&&Bo.prototype.options_.children.push("timeTooltip");X.registerComponent("PlayProgressBar",Bo);class Cd extends X{constructor(e,t){super(e,t),this.update=Qt(De(this,this.update),jt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=`${e.width*t}px`})}}Cd.prototype.options_={children:["timeTooltip"]};X.registerComponent("MouseTimeDisplay",Cd);class zn extends No{constructor(e,t){t=Ee(zn.prototype.options_,t),t.children=[...t.children];const i=e.options_.disableSeekWhileScrubbingOnMobile&&(it||Nt)||e.options_.disableSeekWhileScrubbingOnSTV;(!it&&!Nt||i)&&t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbing_=i,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=De(this,this.update),this.update=Qt(this.update_,jt),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 se&&"visibilityState"in se&&this.on(se,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){se.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,jt))}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(se.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const i=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_!==i||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[qi(i,n),qi(n,n)],"{1} of {2}")),this.currentTime_=i,this.duration_=n),this.bar&&this.bar.update(vs(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 i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){hr(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!hr(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let i;const r=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())i=r*this.player_.duration(),i===this.player_.duration()&&(i=i-.1);else{if(r>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),l=n.liveCurrentTime();if(i=a+r*n.liveWindow(),i>=l&&(i=l),i<=a&&(i=a+.1),i===1/0)return}this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(i):this.userSeek_(i),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 i=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}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 se&&"visibilityState"in se&&this.off(se,"visibilitychange",this.toggleVisibility_),super.dispose()}}zn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12};X.registerComponent("SeekBar",zn);class Ed extends X{constructor(e,t){super(e,t),this.handleMouseMove=Qt(De(this,this.handleMouseMove),jt),this.throttledHandleMouseSeek=Qt(De(this,this.handleMouseSeek),jt),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.handleMouseDownHandler_=i=>this.handleMouseDown(i),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!i&&!r)return;const n=t.el(),a=dr(n);let l=Nn(n,e).x;l=gr(l,0,1),r&&r.update(a,l),i&&i.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,i=this.getChild("seekBar");i&&i.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()}}Ed.prototype.options_={children:["seekBar"]};X.registerComponent("ProgressControl",Ed);class Ad extends rt{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],i=>this.handlePictureInPictureChange(i)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],i=>this.handlePictureInPictureEnabledChange(i)),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(){se.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in w?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 se.exitPictureInPicture=="function"&&super.show()}}Ad.prototype.controlText_="Picture-in-Picture";X.registerComponent("PictureInPictureToggle",Ad);class wd extends rt{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",i=>this.handleFullscreenChange(i)),se[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()}}wd.prototype.controlText_="Fullscreen";X.registerComponent("FullscreenToggle",wd);const Kg=function(s,e){e.tech_&&!e.tech_.featuresVolumeControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};class Qg extends X{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}}X.registerComponent("VolumeLevel",Qg);class Jg extends X{constructor(e,t){super(e,t),this.update=Qt(De(this,this.update),jt)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,r){if(!i){const n=vs(this.el_),a=vs(this.player_.el()),l=e.width*t;if(!a||!n)return;const c=e.left-a.left+l,f=e.width-l+(a.right-e.right);let g=n.width/2;c<g?g+=g-c:f<g&&(g=f),g<0?g=0:g>n.width&&(g=n.width),this.el_.style.right=`-${g}px`}this.write(`${r}%`)}write(e){Si(this.el_,e)}updateVolume(e,t,i,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,r.toFixed(0)),n&&n()})}}X.registerComponent("VolumeLevelTooltip",Jg);class Dd extends X{constructor(e,t){super(e,t),this.update=Qt(De(this,this.update),jt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,r,()=>{i?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}Dd.prototype.options_={children:["volumeLevelTooltip"]};X.registerComponent("MouseVolumeLevelDisplay",Dd);class $n extends No{constructor(e,t){super(e,t),this.on("slideractive",i=>this.updateLastVolume_(i)),this.on(e,"volumechange",i=>this.updateARIAAttributes(i)),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){hr(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),r=vs(i),n=this.vertical();let a=Nn(i,e);a=n?a.y:a.x,a=gr(a,0,1),t.update(r,a,n)}hr(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)})}}$n.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!it&&!Nt&&$n.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");$n.prototype.playerEvent="volumechange";X.registerComponent("VolumeBar",$n);class kd extends X{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||ms(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),Kg(this,e),this.throttledHandleMouseMove=Qt(De(this,this.handleMouseMove),jt),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.on("mousedown",i=>this.handleMouseDown(i)),this.on("touchstart",i=>this.handleMouseDown(i)),this.on("mousemove",i=>this.handleMouseMove(i)),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)}}kd.prototype.options_={children:["volumeBar"]};X.registerComponent("VolumeControl",kd);const Zg=function(s,e){e.tech_&&!e.tech_.featuresMuteControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresMuteControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};class jd extends rt{constructor(e,t){super(e,t),Zg(this,e),this.on(e,["loadstart","volumechange"],i=>this.update(i))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(t===0){const r=i<.1?.1:i;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"),it&&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),Mn(this.el_,[0,1,2,3].reduce((i,r)=>i+`${r?" ":""}vjs-vol-${r}`,"")),Bi(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}jd.prototype.controlText_="Mute";X.registerComponent("MuteToggle",jd);class Id extends X{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||ms(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=i=>this.handleKeyPress(i),this.on(e,["loadstart"],i=>this.volumePanelState_(i)),this.on(this.muteToggle,"keyup",i=>this.handleKeyPress(i)),this.on(this.volumeControl,"keyup",i=>this.handleVolumeControlKeyUp(i)),this.on("keydown",i=>this.handleKeyPress(i)),this.on("mouseover",i=>this.handleMouseOver(i)),this.on("mouseout",i=>this.handleMouseOut(i)),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"),bt(se,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),st(se,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Id.prototype.options_={children:["muteToggle","volumeControl"]};X.registerComponent("VolumePanel",Id);class Pd extends rt{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(),i=this.player_.liveTracker,r=i&&i.isLive()?i.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]))}}Pd.prototype.controlText_="Skip Forward";X.registerComponent("SkipForward",Pd);class Ld extends rt{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(),i=this.player_.liveTracker,r=i&&i.isLive()&&i.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]))}}Ld.prototype.controlText_="Skip Backward";X.registerComponent("SkipBackward",Ld);class Od extends X{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",i=>this.handleKeyDown(i)),this.boundHandleBlur_=i=>this.handleBlur(i),this.boundHandleTapClick_=i=>this.handleTapClick(i)}addEventListenerForItem(e){e instanceof X&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof X&&(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_=ce(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_),bt(t,"click",function(i){i.preventDefault(),i.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||se.activeElement;if(!this.children().some(i=>i.el()===t)){const i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter(r=>r.el()===e.target)[0];if(!i)return;i.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())}}X.registerComponent("Menu",Od);class Fo extends X{constructor(e,t={}){super(e,t),this.menuButton_=new rt(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=rt.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,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(),bt(se,"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 Od(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=ce("li",{className:"vjs-menu-title",textContent:Be(this.options_.title),tabIndex:-1}),i=new X(this.player_,{el:t});e.addItem(i)}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){return super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";const t=rt.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"),st(se,"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"),it&&zc())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()}}X.registerComponent("MenuButton",Fo);class Uo extends Fo{constructor(e,t){const i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;const r=De(this,this.update);i.addEventListener("removetrack",r),i.addEventListener("addtrack",r),i.addEventListener("labelchange",r),this.player_.on("ready",r),this.player_.on("dispose",function(){i.removeEventListener("removetrack",r),i.removeEventListener("addtrack",r),i.removeEventListener("labelchange",r)})}}X.registerComponent("TrackButton",Uo);class vr extends Hn{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,i){this.nonIconControl=!0;const r=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i),n=ce("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))}}X.registerComponent("MenuItem",vr);class yr extends vr{constructor(e,t){const i=t.track,r=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected=i.mode==="showing",super(e,t),this.track=i,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 w.Event!="object")try{l=new w.Event("change")}catch{}l||(l=se.createEvent("Event"),l.initEvent("change",!0,!0)),r.dispatchEvent(l)})}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),!!i)for(let r=0;r<i.length;r++){const n=i[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()}}X.registerComponent("TextTrackMenuItem",yr);class Md extends yr{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 i=!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"){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!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"){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}X.registerComponent("OffTextTrackMenuItem",Md);class Es extends Uo{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=yr){let i;this.label_&&(i=`${this.label_} off`),e.push(new Md(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),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}}X.registerComponent("TextTrackButton",Es);class Rd extends vr{constructor(e,t){const i=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=i,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}X.registerComponent("ChaptersTrackMenuItem",Rd);class Vo extends Es{constructor(e,t,i){super(e,t,i),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 i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(Be(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 i=0,r=t.length;i<r;i++){const n=t[i],a=new Rd(this.player_,{track:this.track_,cue:n});e.push(a)}return e}}Vo.prototype.kind_="chapters";Vo.prototype.controlText_="Chapters";X.registerComponent("ChaptersButton",Vo);class qo extends Es{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");const r=e.textTracks(),n=De(this,this.handleTracksChange);r.addEventListener("change",n),this.on("dispose",function(){r.removeEventListener("change",n)})}handleTracksChange(e){const t=this.player().textTracks();let i=!1;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(a.kind!==this.kind_&&a.mode==="showing"){i=!0;break}}i?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}qo.prototype.kind_="descriptions";qo.prototype.controlText_="Descriptions";X.registerComponent("DescriptionsButton",qo);class Ho extends Es{constructor(e,t,i){super(e,t,i),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}Ho.prototype.kind_="subtitles";Ho.prototype.controlText_="Subtitles";X.registerComponent("SubtitlesButton",Ho);class zo extends yr{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()}}X.registerComponent("CaptionSettingsMenuItem",zo);class $o extends Es{constructor(e,t,i){super(e,t,i),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 zo(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}$o.prototype.kind_="captions";$o.prototype.controlText_="Captions";X.registerComponent("CaptionsButton",$o);class Nd extends yr{createEl(e,t,i){const r=super.createEl(e,t,i),n=r.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",r):n.appendChild(ce("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(ce("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}}X.registerComponent("SubsCapsMenuItem",Nd);class Go extends Es{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(Be(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 zo(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Nd),e}}Go.prototype.kinds_=["captions","subtitles"];Go.prototype.controlText_="Subtitles";X.registerComponent("SubsCapsButton",Go);class Bd extends vr{constructor(e,t){const i=t.track,r=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.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,i){const r=super.createEl(e,t,i),n=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(ce("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(ce("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 i=0;i<t.length;i++){const r=t[i];r!==this.track&&(r.enabled=r===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}X.registerComponent("AudioTrackMenuItem",Bd);class Fd extends Uo{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 i=0;i<t.length;i++){const r=t[i];e.push(new Bd(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}}Fd.prototype.controlText_="Audio Track";X.registerComponent("AudioTrackButton",Fd);class Wo extends vr{constructor(e,t){const i=t.rate,r=parseFloat(i,10);t.label=i,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,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)}}Wo.prototype.contentElType="button";X.registerComponent("PlaybackRateMenuItem",Wo);class Ud extends Fo{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",i=>this.updateVisibility(i)),this.on(e,"ratechange",i=>this.updateLabel(i)),this.on(e,"playbackrateschange",i=>this.handlePlaybackRateschange(i))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=ce("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 i=e.length-1;i>=0;i--)t.push(new Wo(this.player(),{rate:e[i]+"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")}}Ud.prototype.controlText_="Playback Rate";X.registerComponent("PlaybackRateMenuButton",Ud);class Vd extends X{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}X.registerComponent("Spacer",Vd);class e1 extends Vd{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}X.registerComponent("CustomControlSpacer",e1);class qd extends X{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}qd.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};X.registerComponent("ControlBar",qd);class Hd extends Ss{constructor(e,t){super(e,t),this.on(e,"error",i=>{this.open(i)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Hd.prototype.options_=Object.assign({},Ss.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});X.registerComponent("ErrorDisplay",Hd);class zd extends X{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(),ce("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const i=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${kt()}`)+"-"+t[1].replace(/\W+/g,""),r=ce("option",{id:i,value:this.localize(t[0]),textContent:this.localize(t[1])});return r.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${i}`),r}))}}X.registerComponent("TextTrackSelect",zd);class Ui extends X{constructor(e,t={}){super(e,t);const i=ce("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const r=this.options_.selects;for(const n of r){const a=this.options_.selectConfigs[n],l=a.className,c=a.id.replace("%s",this.options_.id_);let f=null;const g=`vjs_select_${kt()}`;if(this.options_.type==="colors"){f=ce("span",{className:l});const k=ce("label",{id:c,className:"vjs-label",textContent:this.localize(a.label)});k.setAttribute("for",g),f.appendChild(k)}const y=new zd(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:g,labelId:c});this.addChild(y),this.options_.type==="colors"&&(f.appendChild(y.el()),this.el().appendChild(f))}}createEl(){return ce("fieldset",{className:this.options_.className})}}X.registerComponent("TextTrackFieldset",Ui);class $d extends X{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Ui(e,{id_:i,legendId:`captions-text-legend-${i}`,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 Ui(e,{id_:i,legendId:`captions-background-${i}`,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 Ui(e,{id_:i,legendId:`captions-window-${i}`,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 ce("div",{className:"vjs-track-settings-colors"})}}X.registerComponent("TextTrackSettingsColors",$d);class Gd extends X{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Ui(e,{id_:i,legendId:`captions-font-size-${i}`,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 Ui(e,{id_:i,legendId:`captions-edge-style-${i}`,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 Ui(e,{id_:i,legendId:`captions-font-family-${i}`,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 ce("div",{className:"vjs-track-settings-font"})}}X.registerComponent("TextTrackSettingsFont",Gd);class Wd extends X{constructor(e,t={}){super(e,t);const i=new rt(e,{controlText:this.localize("restore all settings to the default values"),className:"vjs-default-button"});i.el().classList.remove("vjs-control","vjs-button"),i.el().textContent=this.localize("Reset"),this.addChild(i);const r=this.localize("Done"),n=new rt(e,{controlText:r,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=r,this.addChild(n)}createEl(){return ce("div",{className:"vjs-track-settings-controls"})}}X.registerComponent("TrackSettingsControls",Wd);const Oa="vjs-text-track-settings",Fu=["#000","Black"],Uu=["#00F","Blue"],Vu=["#0FF","Cyan"],qu=["#0F0","Green"],Hu=["#F0F","Magenta"],zu=["#F00","Red"],$u=["#FFF","White"],Gu=["#FF0","Yellow"],Ma=["1","Opaque"],Ra=["0.5","Semi-Transparent"],Wu=["0","Transparent"],bi={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Fu,$u,zu,qu,Uu,Gu,Hu,Vu],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Ma,Ra,Wu],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[$u,Fu,zu,qu,Uu,Gu,Hu,Vu],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:s=>s==="1.00"?null:Number(s)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Ma,Ra],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:[Wu,Ra,Ma],className:"vjs-window-opacity vjs-opacity"}};bi.windowColor.options=bi.backgroundColor.options;function Xd(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function t1(s,e){const t=s.options[s.options.selectedIndex].value;return Xd(t,e)}function i1(s,e,t){if(e){for(let i=0;i<s.options.length;i++)if(Xd(s.options[i].value,t)===e){s.selectedIndex=i;break}}}class s1 extends Ss{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=ce("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 $d(e,{textTrackComponentid:this.id_,selectConfigs:bi,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const i=new Gd(e,{textTrackComponentid:this.id_,selectConfigs:bi,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);const r=new Wd(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()}),is(bi,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 Nc(bi,(e,t,i)=>{const r=t1(this.$(t.selector),t.parser);return r!==void 0&&(e[i]=r),e},{})}setValues(e){is(bi,(t,i)=>{i1(this.$(t.selector),e[i],t.parser)})}setDefaults(){is(bi,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(w.localStorage.getItem(Oa))}catch(t){ye.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?w.localStorage.setItem(Oa,JSON.stringify(e)):w.localStorage.removeItem(Oa)}catch(t){ye.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}X.registerComponent("TextTrackSettings",s1);class r1 extends X{constructor(e,t){let i=t.ResizeObserver||w.ResizeObserver;t.ResizeObserver===null&&(i=!1);const r=Ee({createEl:!i,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||w.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=ad(()=>{this.resizeHandler()},100,!1,this),i?(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(){st(this,"resize",n),st(this,"unload",a),a=null};bt(this.el_.contentWindow,"unload",a),bt(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()}}X.registerComponent("ResizeManager",r1);const n1={trackingThreshold:20,liveTolerance:15};class a1 extends X{constructor(e,t){const i=Ee(n1,t,{createEl:!1});super(e,i),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(w.performance.now().toFixed(4)),i=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;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_,jt),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 i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));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()}}X.registerComponent("LiveTracker",a1);class o1 extends X{constructor(e,t){super(e,t),this.on("statechanged",i=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:ce("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${kt()}`}),description:ce("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${kt()}`})},ce("div",{className:"vjs-title-bar"},{},Bc(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const n=this.state[r],a=this.els[r],l=i[r];Bn(a),n&&Si(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}}X.registerComponent("TitleBar",o1);const l1={initialDisplay:4e3,position:[],takeFocus:!1};class u1 extends rt{constructor(e,t){t=Ee(l1,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],i=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=ce("button",{},{type:"button",class:this.buildCSSClass()},ce("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()}}X.registerComponent("TransientButton",u1);const to=s=>{const e=s.el();if(e.hasAttribute("src"))return s.triggerSourceset(e.src),!0;const t=s.$$("source"),i=[];let r="";if(!t.length)return!1;for(let n=0;n<t.length;n++){const a=t[n].src;a&&i.indexOf(a)===-1&&i.push(a)}return i.length?(i.length===1&&(r=i[0]),s.triggerSourceset(r),!0):!1},c1=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(s){const e=se.createElement(this.nodeName.toLowerCase());e.innerHTML=s;const t=se.createDocumentFragment();for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);return this.innerText="",w.Element.prototype.appendChild.call(this,t),this.innerHTML}}),Yd=(s,e)=>{let t={};for(let i=0;i<s.length&&(t=Object.getOwnPropertyDescriptor(s[i],e),!(t&&t.set&&t.get));i++);return t.enumerable=!0,t.configurable=!0,t},d1=s=>Yd([s.el(),w.HTMLMediaElement.prototype,w.Element.prototype,c1],"innerHTML"),Xu=function(s){const e=s.el();if(e.resetSourceWatch_)return;const t={},i=d1(s),r=n=>(...a)=>{const l=n.apply(e,a);return to(s),l};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",Ee(i,{set:r(i.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",i)},s.one("sourceset",e.resetSourceWatch_)},h1=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?vd(w.Element.prototype.getAttribute.call(this,"src")):""},set(s){return w.Element.prototype.setAttribute.call(this,"src",s),s}}),f1=s=>Yd([s.el(),w.HTMLMediaElement.prototype,h1],"src"),p1=function(s){if(!s.featuresSourceset)return;const e=s.el();if(e.resetSourceset_)return;const t=f1(s),i=e.setAttribute,r=e.load;Object.defineProperty(e,"src",Ee(t,{set:n=>{const a=t.set.call(e,n);return s.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const l=i.call(e,n,a);return/src/i.test(n)&&s.triggerSourceset(e.src),l},e.load=()=>{const n=r.call(e);return to(s)||(s.triggerSourceset(""),Xu(s)),n},e.currentSrc?s.triggerSourceset(e.currentSrc):to(s)||Xu(s),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=i,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class oe extends pe{constructor(e,t){super(e,t);const i=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",i&&(this.el_.currentSrc!==i.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(i):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 c=n[a];c.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(c),this.remoteTextTracks().addTrack(c.track),this.textTracks().addTrack(c.track),!r&&!this.el_.hasAttribute("crossorigin")&&qn(c.src)&&(r=!0)):l.push(c))}for(let c=0;c<l.length;c++)this.el_.removeChild(l[c])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&ye.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
160
- This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(cr||Ln)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),oe.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){p1(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const i=()=>{t=[];for(let n=0;n<e.length;n++){const a=e[n];a.kind==="metadata"&&t.push({track:a,storedMode:a.mode})}};i(),e.addEventListener("change",i),this.on("dispose",()=>e.removeEventListener("change",i));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",i),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(r=>{this.el()[`${i}Tracks`].removeEventListener(r,this[`${i}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=Dt[e],i=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const n={change:l=>{const c={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(c),e==="text"&&this[_s.remoteText.getterName]().trigger(c)},addtrack(l){r.addTrack(l.track)},removetrack(l){r.removeTrack(l.track)}},a=function(){const l=[];for(let c=0;c<r.length;c++){let f=!1;for(let g=0;g<i.length;g++)if(i[g]===r[c]){f=!0;break}f||l.push(r[c])}for(;l.length;)r.removeTrack(l.shift())};this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach(l=>{const c=n[l];i.addEventListener(l,c),this.on("dispose",f=>i.removeEventListener(l,c))}),this.on("loadstart",a),this.on("dispose",l=>this.off("loadstart",a))}proxyNativeTracks_(){Dt.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),oe.disposeMediaElement(e),e=i}else{e=se.createElement("video");const i=this.options_.tag&&_i(this.options_.tag),r=Ee({},i);(!cr||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,Wc(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&gs(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){const r=t[i],n=this.options_[r];typeof n<"u"&&(n?gs(e,r,r):Rn(e,r),e[r]=n)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let i=!1;const r=function(){i=!0};this.on("loadstart",r);const n=function(){i||this.trigger("loadstart")};this.on("loadedmetadata",n),this.ready(function(){this.off("loadstart",r),this.off("loadedmetadata",n),i||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(i){this.trigger(i)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&On?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){ye(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Nt&&Kt&&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 ye.error("Invalid source URL."),!1;const i={src:e};t&&(i.type=t);const r=ce("source",{},i);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return ye.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const i of t)if(i.src===e)return this.el_.removeChild(i),!0;return ye.warn(`No matching source element found with src: ${e}`),!1}reset(){oe.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=se.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 i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)(e===t[i]||e===t[i].track)&&this.el().removeChild(t[i])}}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),w.performance&&(e.creationTime=w.performance.now()),e}}jn(oe,"TEST_VID",function(){if(!bs())return;const s=se.createElement("video"),e=se.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s});oe.isSupported=function(){try{oe.TEST_VID.volume=.5}catch{return!1}return!!(oe.TEST_VID&&oe.TEST_VID.canPlayType)};oe.canPlayType=function(s){return oe.TEST_VID.canPlayType(s)};oe.canPlaySource=function(s,e){return oe.canPlayType(s.type)};oe.canControlVolume=function(){try{const s=oe.TEST_VID.volume;oe.TEST_VID.volume=s/2+.1;const e=s!==oe.TEST_VID.volume;return e&&it?(w.setTimeout(()=>{oe&&oe.prototype&&(oe.prototype.featuresVolumeControl=s!==oe.TEST_VID.volume)}),!1):e}catch{return!1}};oe.canMuteVolume=function(){try{const s=oe.TEST_VID.muted;return oe.TEST_VID.muted=!s,oe.TEST_VID.muted?gs(oe.TEST_VID,"muted","muted"):Rn(oe.TEST_VID,"muted","muted"),s!==oe.TEST_VID.muted}catch{return!1}};oe.canControlPlaybackRate=function(){if(Nt&&Kt&&In<58)return!1;try{const s=oe.TEST_VID.playbackRate;return oe.TEST_VID.playbackRate=s/2+.1,s!==oe.TEST_VID.playbackRate}catch{return!1}};oe.canOverrideAttributes=function(){try{const s=()=>{};Object.defineProperty(se.createElement("video"),"src",{get:s,set:s}),Object.defineProperty(se.createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(se.createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(se.createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0};oe.supportsNativeTextTracks=function(){return On||it&&Kt};oe.supportsNativeVideoTracks=function(){return!!(oe.TEST_VID&&oe.TEST_VID.videoTracks)};oe.supportsNativeAudioTracks=function(){return!!(oe.TEST_VID&&oe.TEST_VID.audioTracks)};oe.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([s,e]){jn(oe.prototype,s,()=>oe[e](),!0)});oe.prototype.featuresVolumeControl=oe.canControlVolume();oe.prototype.movingMediaElementInDOM=!it;oe.prototype.featuresFullscreenResize=!0;oe.prototype.featuresProgressEvents=!0;oe.prototype.featuresTimeupdateEvents=!0;oe.prototype.featuresVideoFrameCallback=!!(oe.TEST_VID&&oe.TEST_VID.requestVideoFrameCallback);oe.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch{}})()}};oe.resetMediaElement=function(s){if(!s)return;const e=s.querySelectorAll("source");let t=e.length;for(;t--;)s.removeChild(e[t]);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch{}})()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){oe.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){oe.prototype["set"+Be(s)]=function(e){this.el_[s]=e,e?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){oe.prototype[s]=function(){return this.el_[s]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){oe.prototype["set"+Be(s)]=function(e){this.el_[s]=e}});["pause","load","play"].forEach(function(s){oe.prototype[s]=function(){return this.el_[s]()}});pe.withSourceHandlers(oe);oe.nativeSourceHandler={};oe.nativeSourceHandler.canPlayType=function(s){try{return oe.TEST_VID.canPlayType(s)}catch{return""}};oe.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return oe.nativeSourceHandler.canPlayType(s.type);if(s.src){const t=Po(s.src);return oe.nativeSourceHandler.canPlayType(`video/${t}`)}return""};oe.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)};oe.nativeSourceHandler.dispose=function(){};oe.registerSourceHandler(oe.nativeSourceHandler);pe.registerTech("Html5",oe);const Kd=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Na={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},io=["tiny","xsmall","small","medium","large","xlarge","huge"],sn={};io.forEach(s=>{const e=s.charAt(0)==="x"?`x-${s.substring(1)}`:s;sn[s]=`vjs-layout-${e}`});const m1={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class xe extends X{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${kt()}`,t=Object.assign(xe.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,i),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=Mc(this.id_),this.fsApi_=an,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&&_i(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_=xe.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(),wo(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(bt(se,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=Ee(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 w.DOMParser().parseFromString(Bg,"image/svg+xml");if(l.querySelector("parsererror"))ye.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 Fg(this),this.addClass("vjs-spatial-navigation-enabled")),cr&&this.addClass("vjs-touch-enabled"),it||this.addClass("vjs-workinghover"),xe.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"),st(se,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),st(se,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),xe.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),Og(this),ut.names.forEach(e=>{const t=ut[e],i=this[t.getterName]();i&&i.off&&i.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,i=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";i?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl("div"));const n=_i(e);if(r){for(t=this.el_=e,e=this.tag=se.createElement("video");t.children.length;)e.appendChild(t.firstChild);rr(t,"video-js")||Bi(t,"video-js"),t.appendChild(e),i=this.playerElIngest_=t,Object.keys(t).forEach(c=>{try{e[c]=t[c]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",Kt&&Pn&&(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(c){r&&c==="class"||t.setAttribute(c,n[c]),r&&e.setAttribute(c,n[c])}),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(c=>Hc[c]).map(c=>"vjs-device-"+c.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),w.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=rd("vjs-styles-dimensions");const c=xi(".vjs-styles-defaults"),f=xi("head");f.insertBefore(this.styleEl_,c?c.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 c=0;c<l.length;c++){const f=l.item(c);Bi(f,"vjs-hidden"),f.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!i&&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"){ye.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 i=e+"_";if(t===void 0)return this[i]||0;if(t===""||t==="auto"){this[i]=void 0,this.updateStyleEl_();return}const r=parseFloat(t);if(isNaN(r)){ye.error(`Improper value "${t}" supplied for for ${e}`);return}this[i]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,ni(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),hg(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(w.VIDEOJS_NO_DYNAMIC_STYLE===!0){const l=typeof this.width_=="number"?this.width_:this.options_.width,c=typeof this.height_=="number"?this.height_:this.options_.height,f=this.tech_&&this.tech_.el();f&&(l>=0&&(f.width=l),c>=0&&(f.height=c));return}let e,t,i,r;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?i=this.aspectRatio_:this.videoWidth()>0?i=this.videoWidth()+":"+this.videoHeight():i="16:9";const n=i.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),nd(this.styleEl_,`
159
+ </svg>`,fo=br?10009:xr?461:8,po={codes:{play:415,pause:19,ff:417,rw:412,back:fo},names:{415:`play`,19:`pause`,417:`ff`,412:`rw`,[fo]:`back`},isEventKey(e,t){return t=t.toLowerCase(),!!(this.names[e.keyCode]&&this.names[e.keyCode]===t)},getEventName(e){if(this.names[e.keyCode])return this.names[e.keyCode];if(this.codes[e.code]){let t=this.codes[e.code];return this.names[t]}return null}},mo=5,ho=class extends Ni{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){let t=e.originalEvent?e.originalEvent:e;if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(t.key)){if(this.isPaused_)return;t.preventDefault();let e=t.key.substring(5).toLowerCase();this.move(e)}else if(po.isEventKey(t,`play`)||po.isEventKey(t,`pause`)||po.isEventKey(t,`ff`)||po.isEventKey(t,`rw`)){t.preventDefault();let e=po.getEventName(t);this.performMediaAction_(e)}else po.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()+mo);break;case`rw`:this.userSeek_(this.player_.currentTime()-mo);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){let t=e.relatedTarget,n=null,r=this.getCurrentComponent(e.target);t&&(n=!!t.closest(`.video-js`),t.classList.contains(`vjs-text-track-settings`)&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!n||!t)&&(r&&r.name()===`CloseButton`?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){let e=this.player_,t=[];function n(e){for(let r of e)r.hasOwnProperty(`el_`)&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())&&t.push(r),r.hasOwnProperty(`children_`)&&r.children_.length>0&&n(r.children_)}return e.children_.forEach(e=>{if(e.hasOwnProperty(`el_`))if(e.getIsFocusable&&e.getIsAvailableToBeFocused&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())){t.push(e);return}else e.hasOwnProperty(`children_`)&&e.children_.length>0?n(e.children_):e.hasOwnProperty(`items`)&&e.items.length>0?n(e.items):this.findSuitableDOMChild(e)&&t.push(e);if(e.name_===`ErrorDisplay`&&e.opened_){let n=e.el_.querySelector(`.vjs-errors-ok-button-container`);n&&n.querySelectorAll(`button`).forEach((e,n)=>{t.push({name:()=>`ModalButton`+(n+1),el:()=>e,getPositions:()=>{let t=e.getBoundingClientRect();return{boundingClientRect:{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left},center:{x:t.left+t.width/2,y:t.top+t.height/2,width:0,height:0,top:t.top+t.height/2,right:t.left+t.width/2,bottom:t.top+t.height/2,left:t.left+t.width/2}}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:e=>!0,focus:()=>e.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(n){if(e.getIsFocusable(n)&&e.getIsAvailableToBeFocused(n))return n;for(let e=0;e<n.children.length;e++){let r=n.children[e],i=t(r);if(i)return i}return null}return e.el()?t(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();let t=e||document.activeElement;if(this.focusableComponents.length){for(let e of this.focusableComponents)if(e.el()===t)return e}}add(e){let 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){let t=this.getCurrentComponent();if(!t)return;let n=t.getPositions(),r=this.focusableComponents.filter(r=>r!==t&&this.isInDirection_(n.boundingClientRect,r.getPositions().boundingClientRect,e)),i=this.findBestCandidate_(n.center,r,e);i?this.focus(i):this.trigger({type:`endOfFocusableComponents`,direction:e,focusedComponent:t})}findBestCandidate_(e,t,n){let r=1/0,i=null;for(let a of t){let t=a.getPositions().center,o=this.calculateDistance_(e,t,n);o<r&&(r=o,i=a)}return i}isInDirection_(e,t,n){switch(n){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,n){let r=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y),a;switch(n){case`right`:case`left`:a=r+i*100;break;case`up`:a=i*2+r*.5;break;case`down`:a=i*5+r;break;default:a=r+i}return a}searchForTrackSelect_(){let e=this;for(let t of e.updateFocusableComponents())if(t.constructor.name===`TextTrackSelect`){e.focus(t);break}}},go=class extends K{constructor(e,t,n){let r=H({createEl:!1},t);if(super(e,r,n),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,r=t.playerOptions.techOrder;n<r.length;n++){let t=Ji(r[n]),i=J.getTech(t);if(t||(i=K.getComponent(t)),i&&i.isSupported()){e.loadTech_(t);break}}else e.src(t.playerOptions.sources)}};K.registerComponent(`MediaLoader`,go);var _o=class extends K{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e=`div`,t={},n={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e===`button`&&B.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),n=Object.assign({role:`button`},n),this.tabIndex_=t.tabIndex;let r=U(e,t,n);return this.player_.options_.experimentalSvgIcons||r.appendChild(U(`span`,{className:`vjs-icon-placeholder`},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=U(`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`;let n=this.localize(e);this.controlText_=e,Pr(this.controlTextEl_,n),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute(`title`,n)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass(`vjs-disabled`),this.el_.setAttribute(`aria-disabled`,`false`),this.tabIndex_!==void 0&&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`),this.tabIndex_!==void 0&&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)}};K.registerComponent(`ClickableComponent`,_o);var vo=class extends _o{constructor(e,t){super(e,t),this.update(),this.update_=e=>this.update(e),e.on(`posterchange`,this.update_)}dispose(){this.player().off(`posterchange`,this.update_),super.dispose()}createEl(){return U(`div`,{className:`vjs-poster`})}crossOrigin(e){if(e===void 0)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){let 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(U(`picture`,{className:`vjs-poster`,tabIndex:-1},{},U(`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()?la(this.player_.play()):this.player_.pause())}};vo.prototype.crossorigin=vo.prototype.crossOrigin,K.registerComponent(`PosterImage`,vo);var yo=`#222`,bo=`#ccc`,xo={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 So(e,t){let n;if(e.length===4)n=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else if(e.length===7)n=e.slice(1);else throw Error(`Invalid color code provided, `+e+`; must be formatted as e.g. #f0e or #f604e2.`);return`rgba(`+parseInt(n.slice(0,2),16)+`,`+parseInt(n.slice(2,4),16)+`,`+parseInt(n.slice(4,6),16)+`,`+t+`)`}function Co(e,t,n){try{e.style[t]=n}catch{return}}function wo(e){return e?`${e}px`:``}var To=class extends K{constructor(e,t,n){super(e,t,n);let r=e=>this.updateDisplay(e),i=e=>{this.updateDisplayOverlay(),this.updateDisplay(e)};e.on(`loadstart`,e=>this.toggleDisplay(e)),e.on(`useractive`,r),e.on(`userinactive`,r),e.on(`texttrackchange`,r),e.on(`loadedmetadata`,e=>{this.updateDisplayOverlay(),this.preselectTrack(e)}),e.ready(G(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on(`fullscreenchange`,i),e.on(`playerresize`,i);let t=C.default.screen.orientation||C.default,n=C.default.screen.orientation?`change`:`orientationchange`;t.addEventListener(n,i),e.on(`dispose`,()=>t.removeEventListener(n,i));let r=this.options_.playerOptions.tracks||[];for(let e=0;e<r.length;e++)this.player_.addRemoteTextTrack(r[e],!0);this.preselectTrack()}))}preselectTrack(){let e={captions:1,subtitles:1},t=this.player_.textTracks(),n=this.player_.cache_.selectedLanguage,r,i,a;for(let o=0;o<t.length;o++){let s=t[o];n&&n.enabled&&n.language&&n.language===s.language&&s.kind in e?s.kind===n.kind?a=s:a||=s:n&&!n.enabled?(a=null,r=null,i=null):s.default&&(s.kind===`descriptions`&&!r?r=s:s.kind in e&&!i&&(i=s))}a?a.mode=`showing`:i?i.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 C.default.WebVTT==`function`&&C.default.WebVTT.processCues(C.default,[],this.el_)}updateDisplay(){let e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){let t=[];for(let n=0;n<e.length;++n){let r=e[n];r.mode===`showing`&&t.push(r)}this.updateForTrack(t);return}let n=null,r=null,i=e.length;for(;i--;){let t=e[i];t.mode===`showing`&&(t.kind===`descriptions`?n=t:r=t)}if(r?(this.getAttribute(`aria-live`)!==`off`&&this.setAttribute(`aria-live`,`off`),this.updateForTrack(r)):n&&(this.getAttribute(`aria-live`)!==`assertive`&&this.setAttribute(`aria-live`,`assertive`),this.updateForTrack(n)),!(C.default.CSS!==void 0&&C.default.CSS.supports(`inset`,`10px`))){let e=this.el_,t=e.querySelectorAll(`.vjs-text-track-cue`),n=this.player_.controlBar.el_.getBoundingClientRect().height,r=this.player_.el_.getBoundingClientRect().height;e.style=``,Co(e,`position`,`relative`),Co(e,`height`,r-n+`px`),Co(e,`top`,`unset`),Sr?Co(e,`bottom`,r+`px`):Co(e,`bottom`,`0px`),t.length>0&&t.forEach(e=>{if(e.style.inset){let t=e.style.inset.split(` `);t.length===3&&Object.assign(e.style,{top:t[0],right:t[1],bottom:t[2],left:`unset`})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!(C.default.CSS!==void 0&&C.default.CSS.supports(`inset-inline: 10px`)))return;let e=this.player_.currentWidth(),t=this.player_.currentHeight(),n=e/t,r=this.player_.videoWidth()/this.player_.videoHeight(),i=0,a=0;Math.abs(n-r)>.1&&(n>r?i=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),Co(this.el_,`insetInline`,wo(i)),Co(this.el_,`insetBlock`,wo(a))}updateDisplayState(e){let t=this.player_.textTrackSettings.getValues(),n=e.activeCues,r=n.length;for(;r--;){let e=n[r];if(!e)continue;let i=e.displayState;if(t.color&&(i.firstChild.style.color=t.color),t.textOpacity&&Co(i.firstChild,`color`,So(t.color||`#fff`,t.textOpacity)),t.backgroundColor&&(i.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Co(i.firstChild,`backgroundColor`,So(t.backgroundColor||`#000`,t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Co(i,`backgroundColor`,So(t.windowColor,t.windowOpacity)):i.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle===`dropshadow`?i.firstChild.style.textShadow=`2px 2px 3px ${yo}, 2px 2px 4px ${yo}, 2px 2px 5px ${yo}`:t.edgeStyle===`raised`?i.firstChild.style.textShadow=`1px 1px ${yo}, 2px 2px ${yo}, 3px 3px ${yo}`:t.edgeStyle===`depressed`?i.firstChild.style.textShadow=`1px 1px ${bo}, 0 1px ${bo}, -1px -1px ${yo}, 0 -1px ${yo}`:t.edgeStyle===`uniform`&&(i.firstChild.style.textShadow=`0 0 4px ${yo}, 0 0 4px ${yo}, 0 0 4px ${yo}, 0 0 4px ${yo}`)),t.fontPercent&&t.fontPercent!==1){let e=C.default.parseFloat(i.style.fontSize);i.style.fontSize=e*t.fontPercent+`px`,i.style.height=`auto`,i.style.top=`auto`}t.fontFamily&&t.fontFamily!==`default`&&(t.fontFamily===`small-caps`?i.firstChild.style.fontVariant=`small-caps`:i.firstChild.style.fontFamily=xo[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof C.default.WebVTT!=`function`||e.every(e=>!e.activeCues))return;let t=[];for(let n=0;n<e.length;++n){let r=e[n];for(let e=0;e<r.activeCues.length;++e)t.push(r.activeCues[e])}C.default.WebVTT.processCues(C.default,t,this.el_);for(let t=0;t<e.length;++t){let n=e[t];for(let e=0;e<n.activeCues.length;++e){let r=n.activeCues[e].displayState;Lr(r,`vjs-text-track-cue`,`vjs-text-track-cue-`+(n.language?n.language:t)),n.language&&Ur(r,`lang`,n.language)}this.player_.textTrackSettings&&this.updateDisplayState(n)}}};K.registerComponent(`TextTrackDisplay`,To);var Eo=class extends K{createEl(){let e=this.player_.isAudio(),t=this.localize(e?`Audio Player`:`Video Player`),n=U(`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(n),r}handleLanguagechange(){this.$(`.vjs-control-text`).textContent=this.localize(`{1} is loading.`,[this.player_.isAudio()?`Audio Player`:`Video Player`])}};K.registerComponent(`LoadingSpinner`,Eo);var Do=class extends _o{createEl(e,t={},n={}){e=`button`,t=Object.assign({className:this.buildCSSClass()},t),n=Object.assign({type:`button`},n);let r=U(e,t,n);return this.player_.options_.experimentalSvgIcons||r.appendChild(U(`span`,{className:`vjs-icon-placeholder`},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){let n=this.constructor.name;return B.warn(`Adding an actionable (user controllable) child to a Button (${n}) is not supported; use a ClickableComponent instead.`),K.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)}};K.registerComponent(`Button`,Do);var Oo=class extends Do{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon(`play`),this.on(`mousedown`,e=>this.handleMouseDown(e))}buildCSSClass(){return`vjs-big-play-button`}handleClick(e){let t=this.player_.play();if(e.type===`tap`||this.mouseused_&&`clientX`in e&&`clientY`in e){la(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}let n=this.player_.getChild(`controlBar`),r=n&&n.getChild(`playToggle`);if(!r){this.player_.tech(!0).focus();return}let i=()=>r.focus();ca(t)?t.then(i,()=>{}):this.setTimeout(i,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}};Oo.prototype.controlText_=`Play Video`,K.registerComponent(`BigPlayButton`,Oo);var ko=class extends Do{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)}};K.registerComponent(`CloseButton`,ko);var Ao=class extends Do{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon(`play`),this.on(e,`play`,e=>this.handlePlay(e)),this.on(e,`pause`,e=>this.handlePause(e)),t.replay&&this.on(e,`ended`,e=>this.handleEnded(e))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?la(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`,e=>this.handleSeeked(e))}};Ao.prototype.controlText_=`Play`,K.registerComponent(`PlayToggle`,Ao);var jo=class extends K{constructor(e,t){super(e,t),this.on(e,[`timeupdate`,`ended`,`seeking`],e=>this.update(e)),this.updateTextNode_()}createEl(){let e=this.buildCSSClass(),t=super.createEl(`div`,{className:`${e} vjs-time-control vjs-control`}),n=U(`span`,{className:`vjs-control-text`,textContent:`${this.localize(this.labelText_)}\u00a0`},{role:`presentation`});return t.appendChild(n),this.contentEl_=U(`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=aa(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame(`TimeDisplay#updateTextNode_`,()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,B.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_=S.default.createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}};jo.prototype.labelText_=`Time`,jo.prototype.controlText_=`Time`,K.registerComponent(`TimeDisplay`,jo);var Mo=class extends jo{buildCSSClass(){return`vjs-current-time`}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():e&&e.target&&typeof e.target.pendingSeekTime==`function`&&e.target.pendingSeekTime()!==null?e.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}};Mo.prototype.labelText_=`Current Time`,Mo.prototype.controlText_=`Current Time`,K.registerComponent(`CurrentTimeDisplay`,Mo);var No=class extends jo{constructor(e,t){super(e,t);let n=e=>this.updateContent(e);this.on(e,`durationchange`,n),this.on(e,`loadstart`,n),this.on(e,`loadedmetadata`,n)}buildCSSClass(){return`vjs-duration`}updateContent(e){let t=this.player_.duration();this.updateTextNode_(t)}};No.prototype.labelText_=`Duration`,No.prototype.controlText_=`Duration`,K.registerComponent(`DurationDisplay`,No);var Po=class extends K{createEl(){let e=super.createEl(`div`,{className:`vjs-time-control vjs-time-divider`},{"aria-hidden":!0}),t=super.createEl(`div`),n=super.createEl(`span`,{textContent:`/`});return t.appendChild(n),e.appendChild(t),e}};K.registerComponent(`TimeDivider`,Po);var Fo=class extends jo{constructor(e,t){super(e,t),this.on(e,`durationchange`,e=>this.updateContent(e))}buildCSSClass(){return`vjs-remaining-time`}createEl(){let e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(U(`span`,{},{"aria-hidden":!0},`-`),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!=`number`)return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}};Fo.prototype.labelText_=`Remaining Time`,Fo.prototype.controlText_=`Remaining Time`,K.registerComponent(`RemainingTimeDisplay`,Fo);var Io=class extends K{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),`durationchange`,e=>this.updateShowing(e))}createEl(){let e=super.createEl(`div`,{className:`vjs-live-control vjs-control`});return this.contentEl_=U(`div`,{className:`vjs-live-display`},{"aria-live":`off`}),this.contentEl_.appendChild(U(`span`,{className:`vjs-control-text`,textContent:`${this.localize(`Stream Type`)}\u00a0`})),this.contentEl_.appendChild(S.default.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()}};K.registerComponent(`LiveDisplay`,Io);var Lo=class extends Do{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,`liveedgechange`,this.updateLiveEdgeStatusHandler_))}createEl(){let e=super.createEl(`button`,{className:`vjs-seek-to-live-control vjs-control`});return this.setIcon(`circle`,e),this.textEl_=U(`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()}};Lo.prototype.controlText_=`Seek to live, currently playing live`,K.registerComponent(`SeekToLive`,Lo);function Ro(e,t,n){return e=Number(e),Math.min(n,Math.max(t,isNaN(e)?t:e))}var zo=Object.freeze({__proto__:null,clamp:Ro}),Bo=class extends K{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),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;let 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={},n={}){return t.className+=` vjs-slider`,t=Object.assign({tabIndex:0},t),n=Object.assign({role:`slider`,"aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},n),super.createEl(e,t,n)}handleMouseDown(e){let t=this.bar.el_.ownerDocument;e.type===`mousedown`&&e.preventDefault(),e.type===`touchstart`&&!dr&&e.preventDefault(),Gr(),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){let t=this.bar.el_.ownerDocument;Kr(),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;let e=this.getProgress();return e===this.progress_?e:(this.progress_=e,this.requestNamedAnimationFrame(`Slider#update`,()=>{let t=this.vertical()?`height`:`width`;this.bar.el().style[t]=(e*100).toFixed(2)+`%`}),e)}getProgress(){return Number(Ro(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){let t=Jr(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){let t=this.options_.playerOptions.spatialNavigation,n=t&&t.enabled,r=t&&t.horizontalSeek;n?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`)}};K.registerComponent(`Slider`,Bo);var Vo=(e,t)=>Ro(e/t*100,0,100).toFixed(2)+`%`,Ho=class extends K{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,`progress`,e=>this.update(e))}createEl(){let e=super.createEl(`div`,{className:`vjs-load-progress`}),t=U(`span`,{className:`vjs-control-text`}),n=U(`span`,{textContent:this.localize(`Loaded`)}),r=S.default.createTextNode(`: `);return this.percentageEl_=U(`span`,{className:`vjs-control-text-loaded-percentage`,textContent:`0%`}),e.appendChild(t),t.appendChild(n),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame(`LoadProgressBar#update`,()=>{let e=this.player_.liveTracker,t=this.player_.buffered(),n=e&&e.isLive()?e.seekableEnd():this.player_.duration(),r=this.player_.bufferedEnd(),i=this.partEls_,a=Vo(r,n);this.percent_!==a&&(this.el_.style.width=a,Pr(this.percentageEl_,a),this.percent_=a);for(let e=0;e<t.length;e++){let n=t.start(e),a=t.end(e),o=i[e];o||(o=this.el_.appendChild(U()),i[e]=o),!(o.dataset.start===n&&o.dataset.end===a)&&(o.dataset.start=n,o.dataset.end=a,o.style.left=Vo(n,r),o.style.width=Vo(a-n,r))}for(let e=i.length;e>t.length;e--)this.el_.removeChild(i[e-1]);i.length=t.length})}};K.registerComponent(`LoadProgressBar`,Ho);var Uo=class extends K{constructor(e,t){super(e,t),this.update=ki(G(this,this.update),Oi)}createEl(){return super.createEl(`div`,{className:`vjs-time-tooltip`},{"aria-hidden":`true`})}update(e,t,n){let r=W(this.el_),i=qr(this.player_.el()),a=e.width*t;if(!i||!r)return;let o=e.left-i.left+a,s=e.width-a+(i.right-e.right);s||(s=e.width-a,o=a);let c=r.width/2;o<c?c+=c-o:s<c&&(c=s),c<0?c=0:c>r.width&&(c=r.width),c=Math.round(c),this.el_.style.right=`-${c}px`,this.write(n)}write(e){Pr(this.el_,e)}updateTime(e,t,n,r){this.requestNamedAnimationFrame(`TimeTooltip#updateTime`,()=>{let i,a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){let e=this.player_.liveTracker.liveWindow(),n=e-t*e;i=(n<1?``:`-`)+aa(n,e)}else i=aa(n,a);this.update(e,t,i),r&&r()})}};K.registerComponent(`TimeTooltip`,Uo);var Wo=class extends K{constructor(e,t){super(e,t),this.setIcon(`circle`),this.update=ki(G(this,this.update),Oi)}createEl(){return super.createEl(`div`,{className:`vjs-play-progress vjs-slider-bar`},{"aria-hidden":`true`})}update(e,t,n){let r=this.getChild(`timeTooltip`);if(!r)return;let i=n&&n.target&&typeof n.target.pendingSeekTime==`function`?n.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(e,t,i)}};Wo.prototype.options_={children:[]},!Tr&&!or&&Wo.prototype.options_.children.push(`timeTooltip`),K.registerComponent(`PlayProgressBar`,Wo);var Go=class extends K{constructor(e,t){super(e,t),this.update=ki(G(this,this.update),Oi)}createEl(){return super.createEl(`div`,{className:`vjs-mouse-display`})}update(e,t){let n=t*this.player_.duration();this.getChild(`timeTooltip`).updateTime(e,t,n,()=>{this.el_.style.left=`${e.width*t}px`})}};Go.prototype.options_={children:[`timeTooltip`]},K.registerComponent(`MouseTimeDisplay`,Go);var Ko=class e extends Bo{constructor(t,n){n=H(e.prototype.options_,n),n.children=[...n.children];let r=t.options_.disableSeekWhileScrubbingOnMobile&&(Tr||or)||t.options_.disableSeekWhileScrubbingOnSTV;(!Tr&&!or||r)&&n.children.splice(1,0,`mouseTimeDisplay`),super(t,n),this.shouldDisableSeekWhileScrubbing_=r,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=G(this,this.update),this.update=ki(this.update_,Oi),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 S.default&&`visibilityState`in S.default&&this.on(S.default,`visibilitychange`,this.toggleVisibility_)}toggleVisibility_(e){S.default.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.setInterval(this.update,Oi)}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!==`ended`||(this.updateInterval&&=(this.clearInterval(this.updateInterval),null))}createEl(){return super.createEl(`div`,{className:`vjs-progress-holder`},{"aria-label":this.localize(`Progress Bar`)})}update(e){if(S.default.visibilityState===`hidden`)return;let t=super.update();return this.requestNamedAnimationFrame(`SeekBar#update`,()=>{let n=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker,i=this.player_.duration();r&&r.isLive()&&(i=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute(`aria-valuenow`,(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==n||this.duration_!==i)&&(this.el_.setAttribute(`aria-valuetext`,this.localize(`progress bar timing: currentTime={1} duration={2}`,[aa(n,i),aa(i,i)],`{1} of {2}`)),this.currentTime_=n,this.duration_=i),this.bar&&this.bar.update(qr(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){let 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();let e=this.getCurrentTime_(),t,n=this.player_.liveTracker;return n&&n.isLive()?(t=(e-n.seekableStart())/n.liveWindow(),n.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){ei(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!ei(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let n,r=this.calculateDistance(e),i=this.player_.liveTracker;if(!i||!i.isLive())n=r*this.player_.duration(),n===this.player_.duration()&&(n-=.1);else{if(r>=.99){i.seekToLiveEdge();return}let e=i.seekableStart(),t=i.liveCurrentTime();if(n=e+r*i.liveWindow(),n>=t&&(n=t),n<=e&&(n=e+.1),n===1/0)return}this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(n):this.userSeek_(n),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();let e=this.getChild(`mouseTimeDisplay`);e&&e.show()}disable(){super.disable();let 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?la(this.player_.play()):this.update_()}handlePendingSeek_(e){this.player_.paused()||this.player_.pause();let t=this.pendingSeekTime()===null?this.player_.currentTime():this.pendingSeekTime();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){let 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();let n=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}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 S.default&&`visibilityState`in S.default&&this.off(S.default,`visibilitychange`,this.toggleVisibility_),super.dispose()}};Ko.prototype.options_={children:[`loadProgressBar`,`playProgressBar`],barName:`playProgressBar`,stepSeconds:5,pageMultiplier:12},K.registerComponent(`SeekBar`,Ko);var qo=class extends K{constructor(e,t){super(e,t),this.handleMouseMove=ki(G(this,this.handleMouseMove),Oi),this.throttledHandleMouseSeek=ki(G(this,this.handleMouseSeek),Oi),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl(`div`,{className:`vjs-progress-control vjs-control`})}handleMouseMove(e){let t=this.getChild(`seekBar`);if(!t)return;let n=t.getChild(`playProgressBar`),r=t.getChild(`mouseTimeDisplay`);if(!n&&!r)return;let i=t.el(),a=W(i),o=Jr(i,e).x;o=Ro(o,0,1),r&&r.update(a,o),n&&n.update(a,t.getProgress())}handleMouseSeek(e){let 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())){let e=this.getChild(`seekBar`);this.player_.scrubbing(!1),e.videoWasPlaying&&la(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(){let 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){let t=this.el_.ownerDocument,n=this.getChild(`seekBar`);n&&n.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){let t=this.getChild(`seekBar`);t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}};qo.prototype.options_={children:[`seekBar`]},K.registerComponent(`ProgressControl`,qo);var Jo=class extends Do{constructor(e,t){super(e,t),this.setIcon(`picture-in-picture-enter`),this.on(e,[`enterpictureinpicture`,`leavepictureinpicture`],e=>this.handlePictureInPictureChange(e)),this.on(e,[`disablepictureinpicturechanged`,`loadedmetadata`],e=>this.handlePictureInPictureEnabledChange(e)),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(){S.default.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&`documentPictureInPicture`in C.default?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 S.default.exitPictureInPicture==`function`&&super.show()}};Jo.prototype.controlText_=`Picture-in-Picture`,K.registerComponent(`PictureInPictureToggle`,Jo);var Yo=class extends Do{constructor(e,t){super(e,t),this.setIcon(`fullscreen-enter`),this.on(e,`fullscreenchange`,e=>this.handleFullscreenChange(e)),S.default[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()}};Yo.prototype.controlText_=`Fullscreen`,K.registerComponent(`FullscreenToggle`,Yo);var Xo=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass(`vjs-hidden`),e.on(t,`loadstart`,function(){t.tech_.featuresVolumeControl?e.removeClass(`vjs-hidden`):e.addClass(`vjs-hidden`)})},Zo=class extends K{createEl(){let e=super.createEl(`div`,{className:`vjs-volume-level`});return this.setIcon(`circle`,e),e.appendChild(super.createEl(`span`,{className:`vjs-control-text`})),e}};K.registerComponent(`VolumeLevel`,Zo);var Qo=class extends K{constructor(e,t){super(e,t),this.update=ki(G(this,this.update),Oi)}createEl(){return super.createEl(`div`,{className:`vjs-volume-tooltip`},{"aria-hidden":`true`})}update(e,t,n,r){if(!n){let n=qr(this.el_),r=qr(this.player_.el()),i=e.width*t;if(!r||!n)return;let a=e.left-r.left+i,o=e.width-i+(r.right-e.right),s=n.width/2;a<s?s+=s-a:o<s&&(s=o),s<0?s=0:s>n.width&&(s=n.width),this.el_.style.right=`-${s}px`}this.write(`${r}%`)}write(e){Pr(this.el_,e)}updateVolume(e,t,n,r,i){this.requestNamedAnimationFrame(`VolumeLevelTooltip#updateVolume`,()=>{this.update(e,t,n,r.toFixed(0)),i&&i()})}};K.registerComponent(`VolumeLevelTooltip`,Qo);var $o=class extends K{constructor(e,t){super(e,t),this.update=ki(G(this,this.update),Oi)}createEl(){return super.createEl(`div`,{className:`vjs-mouse-display`})}update(e,t,n){let r=100*t;this.getChild(`volumeLevelTooltip`).updateVolume(e,t,n,r,()=>{n?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}};$o.prototype.options_={children:[`volumeLevelTooltip`]},K.registerComponent(`MouseVolumeLevelDisplay`,$o);var es=class extends Bo{constructor(e,t){super(e,t),this.on(`slideractive`,e=>this.updateLastVolume_(e)),this.on(e,`volumechange`,e=>this.updateARIAAttributes(e)),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){ei(e)&&super.handleMouseDown(e)}handleMouseMove(e){let t=this.getChild(`mouseVolumeLevelDisplay`);if(t){let n=this.el(),r=qr(n),i=this.vertical(),a=Jr(n,e);a=i?a.y:a.x,a=Ro(a,0,1),t.update(r,a,i)}ei(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){let 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_(){let e=this.player_.volume();this.one(`sliderinactive`,()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}};es.prototype.options_={children:[`volumeLevel`],barName:`volumeLevel`},!Tr&&!or&&es.prototype.options_.children.splice(0,0,`mouseVolumeLevelDisplay`),es.prototype.playerEvent=`volumechange`,K.registerComponent(`VolumeBar`,es);var ts=class extends K{constructor(e,t={}){t.vertical=t.vertical||!1,(t.volumeBar===void 0||er(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),Xo(this,e),this.throttledHandleMouseMove=ki(G(this,this.handleMouseMove),Oi),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on(`mousedown`,e=>this.handleMouseDown(e)),this.on(`touchstart`,e=>this.handleMouseDown(e)),this.on(`mousemove`,e=>this.handleMouseMove(e)),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){let 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){let 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)}};ts.prototype.options_={children:[`volumeBar`]},K.registerComponent(`VolumeControl`,ts);var ns=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass(`vjs-hidden`),e.on(t,`loadstart`,function(){t.tech_.featuresMuteControl?e.removeClass(`vjs-hidden`):e.addClass(`vjs-hidden`)})},rs=class extends Do{constructor(e,t){super(e,t),ns(this,e),this.on(e,[`loadstart`,`volumechange`],e=>this.update(e))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){let t=this.player_.volume(),n=this.player_.lastVolume_();if(t===0){let e=n<.1?.1:n;this.player_.volume(e),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){let e=this.player_.volume(),t=3;this.setIcon(`volume-high`),Tr&&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),Rr(this.el_,[0,1,2,3].reduce((e,t)=>e+`${t?` `:``}vjs-vol-${t}`,``)),Lr(this.el_,`vjs-vol-${t}`)}updateControlText_(){let e=this.player_.muted()||this.player_.volume()===0?`Unmute`:`Mute`;this.controlText()!==e&&this.controlText(e)}};rs.prototype.controlText_=`Mute`,K.registerComponent(`MuteToggle`,rs);var is=class extends K{constructor(e,t={}){t.inline===void 0?t.inline=!0:t.inline=t.inline,(t.volumeControl===void 0||er(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,[`loadstart`],e=>this.volumePanelState_(e)),this.on(this.muteToggle,`keyup`,e=>this.handleKeyPress(e)),this.on(this.volumeControl,`keyup`,e=>this.handleVolumeControlKeyUp(e)),this.on(`keydown`,e=>this.handleKeyPress(e)),this.on(`mouseover`,e=>this.handleMouseOver(e)),this.on(`mouseout`,e=>this.handleMouseOut(e)),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`),Si(S.default,`keyup`,this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass(`vjs-hover`),Ci(S.default,`keyup`,this.handleKeyPressHandler_)}handleKeyPress(e){e.key===`Escape`&&this.handleMouseOut()}};is.prototype.options_={children:[`muteToggle`,`volumeControl`]},K.registerComponent(`VolumePanel`,is);var as=class extends Do{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(){let 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;let t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()?n.seekableEnd():this.player_.duration(),i;i=t+this.skipTime<=r?t+this.skipTime:r,this.player_.currentTime(i)}handleLanguagechange(){this.controlText(this.localize(`Skip forward {1} seconds`,[this.skipTime]))}};as.prototype.controlText_=`Skip Forward`,K.registerComponent(`SkipForward`,as);var os=class extends Do{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(){let 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){let t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()&&n.seekableStart(),i;i=r&&t-this.skipTime<=r?r:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(i)}handleLanguagechange(){this.controlText(this.localize(`Skip backward {1} seconds`,[this.skipTime]))}};os.prototype.controlText_=`Skip Backward`,K.registerComponent(`SkipBackward`,os);var ss=class extends K{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on(`keydown`,e=>this.handleKeyDown(e)),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){e instanceof K&&(this.on(e,`blur`,this.boundHandleBlur_),this.on(e,[`tap`,`click`],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof K&&(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){let t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){this.contentEl_=U(this.options_.contentElType||`ul`,{className:`vjs-menu-content`}),this.contentEl_.setAttribute(`role`,`menu`);let e=super.createEl(`div`,{append:this.contentEl_,className:`vjs-menu`});return e.appendChild(this.contentEl_),Si(e,`click`,function(e){e.preventDefault(),e.stopImmediatePropagation()}),e}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){let t=e.relatedTarget||S.default.activeElement;if(!this.children().some(e=>e.el()===t)){let e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();let t=this.children();if(!Array.isArray(t))return;let n=t.filter(t=>t.el()===e.target)[0];if(!n)return;n.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){let 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())}};K.registerComponent(`Menu`,ss);var cs=class extends K{constructor(e,t={}){super(e,t),this.menuButton_=new Do(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute(`aria-haspopup`,`true`);let n=Do.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+` `+n,this.menuButton_.removeClass(`vjs-control`),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;let r=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,`tap`,r),this.on(this.menuButton_,`click`,r),this.on(this.menuButton_,`keydown`,e=>this.handleKeyDown(e)),this.on(this.menuButton_,`mouseenter`,()=>{this.addClass(`vjs-hover`),this.menu.show(),Si(S.default,`keyup`,this.handleMenuKeyUp_)}),this.on(`mouseleave`,e=>this.handleMouseLeave(e)),this.on(`keydown`,e=>this.handleSubmenuKeyDown(e))}update(){let 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(){let e=new ss(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){let t=U(`li`,{className:`vjs-menu-title`,textContent:Ji(this.options_.title),tabIndex:-1}),n=new K(this.player_,{el:t});e.addItem(n)}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){return super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e=`vjs-menu-button`;this.options_.inline===!0?e+=`-inline`:e+=`-popup`;let t=Do.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`),Ci(S.default,`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`),Tr&&Mr())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()}};K.registerComponent(`MenuButton`,cs);var ls=class extends cs{constructor(e,t){let n=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!n)return;let r=G(this,this.update);n.addEventListener(`removetrack`,r),n.addEventListener(`addtrack`,r),n.addEventListener(`labelchange`,r),this.player_.on(`ready`,r),this.player_.on(`dispose`,function(){n.removeEventListener(`removetrack`,r),n.removeEventListener(`addtrack`,r),n.removeEventListener(`labelchange`,r)})}};K.registerComponent(`TrackButton`,ls);var us=class extends _o{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,n){this.nonIconControl=!0;let r=super.createEl(`li`,Object.assign({className:`vjs-menu-item`,tabIndex:-1},t),n),i=U(`span`,{className:`vjs-menu-item-text`,textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(i):r.replaceChild(i,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))}};K.registerComponent(`MenuItem`,us);var ds=class extends us{constructor(e,t){let n=t.track,r=e.textTracks();t.label=n.label||n.language||`Unknown`,t.selected=n.mode===`showing`,super(e,t),this.track=n,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);let i=(...e)=>{this.handleTracksChange.apply(this,e)},a=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on([`loadstart`,`texttrackchange`],i),r.addEventListener(`change`,i),r.addEventListener(`selectedlanguagechange`,a),this.on(`dispose`,function(){e.off([`loadstart`,`texttrackchange`],i),r.removeEventListener(`change`,i),r.removeEventListener(`selectedlanguagechange`,a)}),r.onchange===void 0){let e;this.on([`tap`,`click`],function(){if(typeof C.default.Event!=`object`)try{e=new C.default.Event(`change`)}catch{}e||(e=S.default.createEvent(`Event`),e.initEvent(`change`,!0,!0)),r.dispatchEvent(e)})}this.handleTracksChange()}handleClick(e){let t=this.track,n=this.player_.textTracks();if(super.handleClick(e),n)for(let e=0;e<n.length;e++){let r=n[e];this.kinds.indexOf(r.kind)!==-1&&(r===t?r.mode!==`showing`&&(r.mode=`showing`):r.mode!==`disabled`&&(r.mode=`disabled`))}}handleTracksChange(e){let t=this.track.mode===`showing`;t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if(this.track.mode===`showing`){let e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.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()}};K.registerComponent(`TextTrackMenuItem`,ds);var fs=class extends ds{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:`disabled`},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){let t=this.player().textTracks(),n=!0;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(this.options_.kinds.indexOf(r.kind)>-1&&r.mode===`showing`){n=!1;break}}n!==this.isSelected_&&this.selected(n)}handleSelectedLanguageChange(e){let t=this.player().textTracks(),n=!0;for(let e=0,r=t.length;e<r;e++){let r=t[e];if([`captions`,`descriptions`,`subtitles`].indexOf(r.kind)>-1&&r.mode===`showing`){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(`.vjs-menu-item-text`).textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}};K.registerComponent(`OffTextTrackMenuItem`,fs);var ps=class extends ls{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=ds){let n;this.label_&&(n=`${this.label_} off`),e.push(new fs(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;let r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<r.length;n++){let i=r[n];if(this.kinds_.indexOf(i.kind)>-1){let n=new t(this.player_,{track:i,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});n.addClass(`vjs-${i.kind}-menu-item`),e.push(n)}}return e}};K.registerComponent(`TextTrackButton`,ps);var ms=class extends us{constructor(e,t){let n=t.track,r=t.cue,i=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=i&&i<r.endTime,super(e,t),this.track=n,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}};K.registerComponent(`ChaptersTrackMenuItem`,ms);var hs=class extends ps{constructor(e,t,n){super(e,t,n),this.setIcon(`chapters`),this.selectCurrentItem_=()=>{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.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;let t=this.findChaptersTrack();t===this.track_?(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update():(this.setTrack(t),super.update())}setTrack(e){if(this.track_!==e){if(this.updateHandler_||=this.update.bind(this),this.track_){let e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener(`load`,this.updateHandler_),this.track_.removeEventListener(`cuechange`,this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode=`hidden`;let e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener(`load`,this.updateHandler_),this.track_.addEventListener(`cuechange`,this.selectCurrentItem_)}}}findChaptersTrack(){let e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.kind===this.kind_)return n}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(Ji(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){let e=[];if(!this.track_)return e;let t=this.track_.cues;if(!t)return e;for(let n=0,r=t.length;n<r;n++){let r=t[n],i=new ms(this.player_,{track:this.track_,cue:r});e.push(i)}return e}};hs.prototype.kind_=`chapters`,hs.prototype.controlText_=`Chapters`,K.registerComponent(`ChaptersButton`,hs);var gs=class extends ps{constructor(e,t,n){super(e,t,n),this.setIcon(`audio-description`);let r=e.textTracks(),i=G(this,this.handleTracksChange);r.addEventListener(`change`,i),this.on(`dispose`,function(){r.removeEventListener(`change`,i)})}handleTracksChange(e){let t=this.player().textTracks(),n=!1;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(r.kind!==this.kind_&&r.mode===`showing`){n=!0;break}}n?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}};gs.prototype.kind_=`descriptions`,gs.prototype.controlText_=`Descriptions`,K.registerComponent(`DescriptionsButton`,gs);var _s=class extends ps{constructor(e,t,n){super(e,t,n),this.setIcon(`subtitles`)}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}};_s.prototype.kind_=`subtitles`,_s.prototype.controlText_=`Subtitles`,K.registerComponent(`SubtitlesButton`,_s);var vs=class extends ds{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()}};K.registerComponent(`CaptionSettingsMenuItem`,vs);var ys=class extends ps{constructor(e,t,n){super(e,t,n),this.setIcon(`captions`)}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild(`textTrackSettings`)&&(e.push(new vs(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}};ys.prototype.kind_=`captions`,ys.prototype.controlText_=`Captions`,K.registerComponent(`CaptionsButton`,ys);var bs=class extends ds{createEl(e,t,n){let r=super.createEl(e,t,n),i=r.querySelector(`.vjs-menu-item-text`);return this.options_.track.kind===`captions`&&(this.player_.options_.experimentalSvgIcons?this.setIcon(`captions`,r):i.appendChild(U(`span`,{className:`vjs-icon-placeholder`},{"aria-hidden":!0})),i.appendChild(U(`span`,{className:`vjs-control-text`,textContent:` ${this.localize(`Captions`)}`}))),r}};K.registerComponent(`SubsCapsMenuItem`,bs);var xs=class extends ps{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(Ji(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 vs(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,bs),e}};xs.prototype.kinds_=[`captions`,`subtitles`],xs.prototype.controlText_=`Subtitles`,K.registerComponent(`SubsCapsButton`,xs);var Ss=class extends us{constructor(e,t){let n=t.track,r=e.audioTracks();t.label=n.label||n.language||`Unknown`,t.selected=n.enabled,super(e,t),this.track=n,this.addClass(`vjs-${n.kind}-menu-item`);let i=(...e)=>{this.handleTracksChange.apply(this,e)};r.addEventListener(`change`,i),this.on(`dispose`,()=>{r.removeEventListener(`change`,i)})}createEl(e,t,n){let r=super.createEl(e,t,n),i=r.querySelector(`.vjs-menu-item-text`);return[`main-desc`,`descriptions`].indexOf(this.options_.track.kind)>=0&&(i.appendChild(U(`span`,{className:`vjs-icon-placeholder`},{"aria-hidden":!0})),i.appendChild(U(`span`,{className:`vjs-control-text`,textContent:` `+this.localize(`Descriptions`)}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){let e=this.player_.audioTracks();for(let t=0;t<e.length;t++){let n=e[t];n!==this.track&&(n.enabled=n===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}};K.registerComponent(`AudioTrackMenuItem`,Ss);var Cs=class extends ls{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;let t=this.player_.audioTracks();for(let n=0;n<t.length;n++){let r=t[n];e.push(new Ss(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}};Cs.prototype.controlText_=`Audio Track`,K.registerComponent(`AudioTrackButton`,Cs);var ws=class extends us{constructor(e,t){let n=t.rate,r=parseFloat(n,10);t.label=n,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=n,this.rate=r,this.on(e,`ratechange`,e=>this.update(e))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}};ws.prototype.contentElType=`button`,K.registerComponent(`PlaybackRateMenuItem`,ws);var Ts=class extends cs{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute(`aria-describedby`,this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,`loadstart`,e=>this.updateVisibility(e)),this.on(e,`ratechange`,e=>this.updateLabel(e)),this.on(e,`playbackrateschange`,e=>this.handlePlaybackRateschange(e))}createEl(){let e=super.createEl();return this.labelElId_=`vjs-playback-rate-value-label-`+this.id_,this.labelEl_=U(`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(){let e=this.playbackRates(),t=[];for(let n=e.length-1;n>=0;n--)t.push(new ws(this.player(),{rate:e[n]+`x`}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){let 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`)}};Ts.prototype.controlText_=`Playback Rate`,K.registerComponent(`PlaybackRateMenuButton`,Ts);var Es=class extends K{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e=`div`,t={},n={}){return t.className||=this.buildCSSClass(),super.createEl(e,t,n)}};K.registerComponent(`Spacer`,Es);var Ds=class extends Es{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl(`div`,{className:this.buildCSSClass(),textContent:`\xA0`})}};K.registerComponent(`CustomControlSpacer`,Ds);var Os=class extends K{createEl(){return super.createEl(`div`,{className:`vjs-control-bar`,dir:`ltr`})}};Os.prototype.options_={children:[`playToggle`,`skipBackward`,`skipForward`,`volumePanel`,`currentTimeDisplay`,`timeDivider`,`durationDisplay`,`progressControl`,`liveDisplay`,`seekToLive`,`remainingTimeDisplay`,`customControlSpacer`,`playbackRateMenuButton`,`chaptersButton`,`descriptionsButton`,`subsCapsButton`,`audioTrackButton`,`pictureInPictureToggle`,`fullscreenToggle`]},K.registerComponent(`ControlBar`,Os);var ks=class extends pa{constructor(e,t){super(e,t),this.on(e,`error`,e=>{this.open(e)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){let e=this.player().error();return e?this.localize(e.message):``}};ks.prototype.options_=Object.assign({},pa.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),K.registerComponent(`ErrorDisplay`,ks);var As=class extends K{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(),U(`select`,{id:this.options_.id},{},this.options_.SelectOptions.map(e=>{let t=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${hi()}`)+`-`+e[1].replace(/\W+/g,``),n=U(`option`,{id:t,value:this.localize(e[0]),textContent:this.localize(e[1])});return n.setAttribute(`aria-labelledby`,`${this.selectLabelledbyIds} ${t}`),n}))}};K.registerComponent(`TextTrackSelect`,As);var js=class extends K{constructor(e,t={}){super(e,t);let n=U(`legend`,{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(n);let r=this.options_.selects;for(let t of r){let n=this.options_.selectConfigs[t],r=n.className,i=n.id.replace(`%s`,this.options_.id_),a=null,o=`vjs_select_${hi()}`;if(this.options_.type===`colors`){a=U(`span`,{className:r});let e=U(`label`,{id:i,className:`vjs-label`,textContent:this.localize(n.label)});e.setAttribute(`for`,o),a.appendChild(e)}let s=new As(e,{SelectOptions:n.options,legendId:this.options_.legendId,id:o,labelId:i});this.addChild(s),this.options_.type===`colors`&&(a.appendChild(s.el()),this.el().appendChild(a))}}createEl(){return U(`fieldset`,{className:this.options_.className})}};K.registerComponent(`TextTrackFieldset`,js);var Ms=class extends K{constructor(e,t={}){super(e,t);let n=this.options_.textTrackComponentid,r=new js(e,{id_:n,legendId:`captions-text-legend-${n}`,legendText:this.localize(`Text`),className:`vjs-fg vjs-track-setting`,selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:`colors`});this.addChild(r);let i=new js(e,{id_:n,legendId:`captions-background-${n}`,legendText:this.localize(`Text Background`),className:`vjs-bg vjs-track-setting`,selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:`colors`});this.addChild(i);let a=new js(e,{id_:n,legendId:`captions-window-${n}`,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 U(`div`,{className:`vjs-track-settings-colors`})}};K.registerComponent(`TextTrackSettingsColors`,Ms);var Ns=class extends K{constructor(e,t={}){super(e,t);let n=this.options_.textTrackComponentid,r=new js(e,{id_:n,legendId:`captions-font-size-${n}`,legendText:`Font Size`,className:`vjs-font-percent vjs-track-setting`,selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:`font`});this.addChild(r);let i=new js(e,{id_:n,legendId:`captions-edge-style-${n}`,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(i);let a=new js(e,{id_:n,legendId:`captions-font-family-${n}`,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 U(`div`,{className:`vjs-track-settings-font`})}};K.registerComponent(`TextTrackSettingsFont`,Ns);var Ps=class extends K{constructor(e,t={}){super(e,t);let n=new Do(e,{controlText:this.localize(`restore all settings to the default values`),className:`vjs-default-button`});n.el().classList.remove(`vjs-control`,`vjs-button`),n.el().textContent=this.localize(`Reset`),this.addChild(n);let r=this.localize(`Done`),i=new Do(e,{controlText:r,className:`vjs-done-button`});i.el().classList.remove(`vjs-control`,`vjs-button`),i.el().textContent=r,this.addChild(i)}createEl(){return U(`div`,{className:`vjs-track-settings-controls`})}};K.registerComponent(`TrackSettingsControls`,Ps);var Fs=`vjs-text-track-settings`,Is=[`#000`,`Black`],Ls=[`#00F`,`Blue`],Rs=[`#0FF`,`Cyan`],zs=[`#0F0`,`Green`],Bs=[`#F0F`,`Magenta`],Vs=[`#F00`,`Red`],Hs=[`#FFF`,`White`],Us=[`#FF0`,`Yellow`],Ws=[`1`,`Opaque`],Gs=[`0.5`,`Semi-Transparent`],Ks=[`0`,`Transparent`],qs={backgroundColor:{selector:`.vjs-bg-color > select`,id:`captions-background-color-%s`,label:`Color`,options:[Is,Hs,Vs,zs,Ls,Us,Bs,Rs],className:`vjs-bg-color`},backgroundOpacity:{selector:`.vjs-bg-opacity > select`,id:`captions-background-opacity-%s`,label:`Opacity`,options:[Ws,Gs,Ks],className:`vjs-bg-opacity vjs-opacity`},color:{selector:`.vjs-text-color > select`,id:`captions-foreground-color-%s`,label:`Color`,options:[Hs,Is,Vs,zs,Ls,Us,Bs,Rs],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:e=>e===`1.00`?null:Number(e)},textOpacity:{selector:`.vjs-text-opacity > select`,id:`captions-foreground-opacity-%s`,label:`Opacity`,options:[Ws,Gs],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:[Ks,Gs,Ws],className:`vjs-window-opacity vjs-opacity`}};qs.windowColor.options=qs.backgroundColor.options;function Js(e,t){if(t&&(e=t(e)),e&&e!==`none`)return e}function Ys(e,t){let n=e.options[e.options.selectedIndex].value;return Js(n,t)}function Xs(e,t,n){if(t){for(let r=0;r<e.options.length;r++)if(Js(e.options[r].value,n)===t){e.selectedIndex=r;break}}}var Zs=class extends pa{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=U(`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){let t=new Ms(e,{textTrackComponentid:this.id_,selectConfigs:qs,fieldSets:[[`color`,`textOpacity`],[`backgroundColor`,`backgroundOpacity`],[`windowColor`,`windowOpacity`]]});this.addChild(t);let n=new Ns(e,{textTrackComponentid:this.id_,selectConfigs:qs,fieldSets:[[`fontPercent`],[`edgeStyle`],[`fontFamily`]]});this.addChild(n);let r=new Ps(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()}),Qn(qs,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 V(qs,(e,t,n)=>{let r=Ys(this.$(t.selector),t.parser);return r!==void 0&&(e[n]=r),e},{})}setValues(e){Qn(qs,(t,n)=>{Xs(this.$(t.selector),e[n],t.parser)})}setDefaults(){Qn(qs,e=>{let t=e.hasOwnProperty(`default`)?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(C.default.localStorage.getItem(Fs))}catch(e){B.warn(e)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;let e=this.getValues();try{Object.keys(e).length?C.default.localStorage.setItem(Fs,JSON.stringify(e)):C.default.localStorage.removeItem(Fs)}catch(e){B.warn(e)}}updateDisplay(){let e=this.player_.getChild(`textTrackDisplay`);e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}};K.registerComponent(`TextTrackSettings`,Zs);var Qs=class extends K{constructor(e,t){let n=t.ResizeObserver||C.default.ResizeObserver;t.ResizeObserver===null&&(n=!1);let r=H({createEl:!n,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||C.default.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=Ai(()=>{this.resizeHandler()},100,!1,this),n?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;let e=this.debouncedHandler_,t=this.unloadListener_=function(){Ci(this,`resize`,e),Ci(this,`unload`,t),t=null};Si(this.el_.contentWindow,`unload`,t),Si(this.el_.contentWindow,`resize`,e)},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()}};K.registerComponent(`ResizeManager`,Qs);var $s={trackingThreshold:20,liveTolerance:15},ec=class extends K{constructor(e,t){let n=H($s,t,{createEl:!1});super(e,n),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,`durationchange`,e=>this.handleDurationchange(e)),this.on(this.player_,`canplay`,()=>this.toggleTracking())}trackLive_(){let e=this.player_.seekable();if(!e||!e.length)return;let t=Number(C.default.performance.now().toFixed(4)),n=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+n;let r=this.liveCurrentTime(),i=this.player_.currentTime(),a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-i)>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.player_.hasStarted(),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Oi),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(){let 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(){let e=this.player_.seekable(),t=[],n=e?e.length:0;for(;n--;)t.push(e.end(n));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){let e=this.player_.seekable(),t=[],n=e?e.length:0;for(;n--;)t.push(e.start(n));return t.length?t.sort()[0]:0}liveWindow(){let 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(){let 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()}};K.registerComponent(`LiveTracker`,ec);var tc=class extends K{constructor(e,t){super(e,t),this.on(`statechanged`,e=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:U(`div`,{className:`vjs-title-bar-title`,id:`vjs-title-bar-title-${hi()}`}),description:U(`div`,{className:`vjs-title-bar-description`,id:`vjs-title-bar-description-${hi()}`})},U(`div`,{className:`vjs-title-bar`},{},tr(this.els))}updateDom_(){let e=this.player_.tech_,t=e&&e.el_,n={title:`aria-labelledby`,description:`aria-describedby`};[`title`,`description`].forEach(e=>{let r=this.state[e],i=this.els[e],a=n[e];Xr(i),r&&Pr(i,r),t&&(t.removeAttribute(a),r&&t.setAttribute(a,i.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){let e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute(`aria-labelledby`),t.removeAttribute(`aria-describedby`)),super.dispose(),this.els=null}};K.registerComponent(`TitleBar`,tc);var nc={initialDisplay:4e3,position:[],takeFocus:!1},rc=class extends Do{constructor(e,t){t=H(nc,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,[`useractive`,`userinactive`],e=>{this.removeClass(`force-display`)})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(` `)}`}createEl(){let e=U(`button`,{},{type:`button`,class:this.buildCSSClass()},U(`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()}};K.registerComponent(`TransientButton`,rc);var ic=e=>{let t=e.el();if(t.hasAttribute(`src`))return e.triggerSourceset(t.src),!0;let n=e.$$(`source`),r=[],i=``;if(!n.length)return!1;for(let e=0;e<n.length;e++){let t=n[e].src;t&&r.indexOf(t)===-1&&r.push(t)}return r.length?(r.length===1&&(i=r[0]),e.triggerSourceset(i),!0):!1},ac=Object.defineProperty({},`innerHTML`,{get(){return this.cloneNode(!0).innerHTML},set(e){let t=S.default.createElement(this.nodeName.toLowerCase());t.innerHTML=e;let n=S.default.createDocumentFragment();for(;t.childNodes.length;)n.appendChild(t.childNodes[0]);return this.innerText=``,C.default.Element.prototype.appendChild.call(this,n),this.innerHTML}}),oc=(e,t)=>{let n={};for(let r=0;r<e.length&&(n=Object.getOwnPropertyDescriptor(e[r],t),!(n&&n.set&&n.get));r++);return n.enumerable=!0,n.configurable=!0,n},sc=e=>oc([e.el(),C.default.HTMLMediaElement.prototype,C.default.Element.prototype,ac],`innerHTML`),cc=function(e){let t=e.el();if(t.resetSourceWatch_)return;let n={},r=sc(e),i=n=>(...r)=>{let i=n.apply(t,r);return ic(e),i};[`append`,`appendChild`,`insertAdjacentHTML`].forEach(e=>{t[e]&&(n[e]=t[e],t[e]=i(n[e]))}),Object.defineProperty(t,`innerHTML`,H(r,{set:i(r.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(n).forEach(e=>{t[e]=n[e]}),Object.defineProperty(t,`innerHTML`,r)},e.one(`sourceset`,t.resetSourceWatch_)},lc=Object.defineProperty({},`src`,{get(){return this.hasAttribute(`src`)?Oa(C.default.Element.prototype.getAttribute.call(this,`src`)):``},set(e){return C.default.Element.prototype.setAttribute.call(this,`src`,e),e}}),uc=e=>oc([e.el(),C.default.HTMLMediaElement.prototype,lc],`src`),dc=function(e){if(!e.featuresSourceset)return;let t=e.el();if(t.resetSourceset_)return;let n=uc(e),r=t.setAttribute,i=t.load;Object.defineProperty(t,`src`,H(n,{set:r=>{let i=n.set.call(t,r);return e.triggerSourceset(t.src),i}})),t.setAttribute=(n,i)=>{let a=r.call(t,n,i);return/src/i.test(n)&&e.triggerSourceset(t.src),a},t.load=()=>{let n=i.call(t);return ic(e)||(e.triggerSourceset(``),cc(e)),n},t.currentSrc?e.triggerSourceset(t.currentSrc):ic(e)||cc(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=i,t.setAttribute=r,Object.defineProperty(t,`src`,n),t.resetSourceWatch_&&t.resetSourceWatch_()}},Y=class e extends J{constructor(e,t){super(e,t);let n=e.source,r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName===`VIDEO`,n&&(this.el_.currentSrc!==n.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(n):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){let e=this.el_.childNodes,t=e.length,n=[];for(;t--;){let i=e[t];i.nodeName.toLowerCase()===`track`&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),this.textTracks().addTrack(i.track),!r&&!this.el_.hasAttribute(`crossorigin`)&&Aa(i.src)&&(r=!0)):n.push(i))}for(let e=0;e<n.length;e++)this.el_.removeChild(n[e])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&B.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
160
+ This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(Cr||yr)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),e.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){dc(this)}restoreMetadataTracksInIOSNativePlayer_(){let e=this.textTracks(),t,n=()=>{t=[];for(let n=0;n<e.length;n++){let r=e[n];r.kind===`metadata`&&t.push({track:r,storedMode:r.mode})}};n(),e.addEventListener(`change`,n),this.on(`dispose`,()=>e.removeEventListener(`change`,n));let r=()=>{for(let e=0;e<t.length;e++){let n=t[e];n.track.mode===`disabled`&&n.track.mode!==n.storedMode&&(n.track.mode=n.storedMode)}e.removeEventListener(`change`,r)};this.on(`webkitbeginfullscreen`,()=>{e.removeEventListener(`change`,n),e.removeEventListener(`change`,r),e.addEventListener(`change`,r)}),this.on(`webkitendfullscreen`,()=>{e.removeEventListener(`change`,n),e.addEventListener(`change`,n),e.removeEventListener(`change`,r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;let n=e.toLowerCase();this[`${n}TracksListeners_`]&&Object.keys(this[`${n}TracksListeners_`]).forEach(e=>{this.el()[`${n}Tracks`].removeEventListener(e,this[`${n}TracksListeners_`][e])}),this[`featuresNative${e}Tracks`]=!t,this[`${n}TracksListeners_`]=null,this.proxyNativeTracksForType_(n)}overrideNativeAudioTracks(e){this.overrideNative_(`Audio`,e)}overrideNativeVideoTracks(e){this.overrideNative_(`Video`,e)}proxyNativeTracksForType_(e){let t=Ra[e],n=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!n||!n.addEventListener)return;let i={change:t=>{let n={type:`change`,target:r,currentTarget:r,srcElement:r};r.trigger(n),e===`text`&&this[za.remoteText.getterName]().trigger(n)},addtrack(e){r.addTrack(e.track)},removetrack(e){r.removeTrack(e.track)}},a=function(){let e=[];for(let t=0;t<r.length;t++){let i=!1;for(let e=0;e<n.length;e++)if(n[e]===r[t]){i=!0;break}i||e.push(r[t])}for(;e.length;)r.removeTrack(e.shift())};this[t.getterName+`Listeners_`]=i,Object.keys(i).forEach(e=>{let t=i[e];n.addEventListener(e,t),this.on(`dispose`,r=>n.removeEventListener(e,t))}),this.on(`loadstart`,a),this.on(`dispose`,e=>this.off(`loadstart`,a))}proxyNativeTracks_(){Ra.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let t=this.options_.tag;if(!t||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(t){let n=t.cloneNode(!0);t.parentNode&&t.parentNode.insertBefore(n,t),e.disposeMediaElement(t),t=n}else{t=S.default.createElement(`video`);let e=H({},this.options_.tag&&Vr(this.options_.tag));(!Cr||this.options_.nativeControlsForTouch!==!0)&&delete e.controls,Br(t,Object.assign(e,{id:this.options_.techId,class:`vjs-tech`}))}t.playerId=this.options_.playerId}this.options_.preload!==void 0&&Ur(t,`preload`,this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(t.disablePictureInPicture=this.options_.disablePictureInPicture);let n=[`loop`,`muted`,`playsinline`,`autoplay`];for(let e=0;e<n.length;e++){let r=n[e],i=this.options_[r];i!==void 0&&(i?Ur(t,r,r):Wr(t,r),t[r]=i)}return t}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let e=!1,t=function(){e=!0};this.on(`loadstart`,t);let n=function(){e||this.trigger(`loadstart`)};this.on(`loadedmetadata`,n),this.ready(function(){this.off(`loadstart`,t),this.off(`loadedmetadata`,n),e||this.trigger(`loadstart`)});return}let 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(e){this.trigger(e)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Er?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){B(e,`Video is not ready. (Video.js)`)}}duration(){if(this.el_.duration===1/0&&or&&dr&&this.el_.currentTime===0){let 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;let 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(){let e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)la(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger(`fullscreenerror`,e)}},0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger(`fullscreenerror`,e)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger(`fullscreenerror`,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 B.error(`Invalid source URL.`),!1;let n={src:e};t&&(n.type=t);let r=U(`source`,{},n);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return B.error(`Source URL is required to remove the source element.`),!1;let t=this.el_.querySelectorAll(`source`);for(let n of t)if(n.src===e)return this.el_.removeChild(n),!0;return B.warn(`No matching source element found with src: ${e}`),!1}reset(){e.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,n):super.addTextTrack(e,t,n)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);let t=S.default.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){let n=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(n),n}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){let t=this.$$(`track`),n=t.length;for(;n--;)(e===t[n]||e===t[n].track)&&this.el().removeChild(t[n])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality==`function`)return this.el().getVideoPlaybackQuality();let e={};return this.el().webkitDroppedFrameCount!==void 0&&this.el().webkitDecodedFrameCount!==void 0&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),C.default.performance&&(e.creationTime=C.default.performance.now()),e}};nr(Y,`TEST_VID`,function(){if(!Ar())return;let e=S.default.createElement(`video`),t=S.default.createElement(`track`);return t.kind=`captions`,t.srclang=`en`,t.label=`English`,e.appendChild(t),e}),Y.isSupported=function(){try{Y.TEST_VID.volume=.5}catch{return!1}return!!(Y.TEST_VID&&Y.TEST_VID.canPlayType)},Y.canPlayType=function(e){return Y.TEST_VID.canPlayType(e)},Y.canPlaySource=function(e,t){return Y.canPlayType(e.type)},Y.canControlVolume=function(){try{let e=Y.TEST_VID.volume;Y.TEST_VID.volume=e/2+.1;let t=e!==Y.TEST_VID.volume;return t&&Tr?(C.default.setTimeout(()=>{Y&&Y.prototype&&(Y.prototype.featuresVolumeControl=e!==Y.TEST_VID.volume)}),!1):t}catch{return!1}},Y.canMuteVolume=function(){try{let e=Y.TEST_VID.muted;return Y.TEST_VID.muted=!e,Y.TEST_VID.muted?Ur(Y.TEST_VID,`muted`,`muted`):Wr(Y.TEST_VID,`muted`,`muted`),e!==Y.TEST_VID.muted}catch{return!1}},Y.canControlPlaybackRate=function(){if(or&&dr&&pr<58)return!1;try{let e=Y.TEST_VID.playbackRate;return Y.TEST_VID.playbackRate=e/2+.1,e!==Y.TEST_VID.playbackRate}catch{return!1}},Y.canOverrideAttributes=function(){try{let e=()=>{};Object.defineProperty(S.default.createElement(`video`),`src`,{get:e,set:e}),Object.defineProperty(S.default.createElement(`audio`),`src`,{get:e,set:e}),Object.defineProperty(S.default.createElement(`video`),`innerHTML`,{get:e,set:e}),Object.defineProperty(S.default.createElement(`audio`),`innerHTML`,{get:e,set:e})}catch{return!1}return!0},Y.supportsNativeTextTracks=function(){return Er||Tr&&dr},Y.supportsNativeVideoTracks=function(){return!!(Y.TEST_VID&&Y.TEST_VID.videoTracks)},Y.supportsNativeAudioTracks=function(){return!!(Y.TEST_VID&&Y.TEST_VID.audioTracks)},Y.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([e,t]){nr(Y.prototype,e,()=>Y[t](),!0)}),Y.prototype.featuresVolumeControl=Y.canControlVolume(),Y.prototype.movingMediaElementInDOM=!Tr,Y.prototype.featuresFullscreenResize=!0,Y.prototype.featuresProgressEvents=!0,Y.prototype.featuresTimeupdateEvents=!0,Y.prototype.featuresVideoFrameCallback=!!(Y.TEST_VID&&Y.TEST_VID.requestVideoFrameCallback),Y.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute(`src`),typeof e.load==`function`&&(function(){try{e.load()}catch{}})()}},Y.resetMediaElement=function(e){if(!e)return;let t=e.querySelectorAll(`source`),n=t.length;for(;n--;)e.removeChild(t[n]);e.removeAttribute(`src`),typeof e.load==`function`&&(function(){try{e.load()}catch{}})()},[`muted`,`defaultMuted`,`autoplay`,`controls`,`loop`,`playsinline`].forEach(function(e){Y.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),[`muted`,`defaultMuted`,`autoplay`,`loop`,`playsinline`].forEach(function(e){Y.prototype[`set`+Ji(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),[`paused`,`currentTime`,`buffered`,`volume`,`poster`,`preload`,`error`,`seeking`,`seekable`,`ended`,`playbackRate`,`defaultPlaybackRate`,`disablePictureInPicture`,`played`,`networkState`,`readyState`,`videoWidth`,`videoHeight`,`crossOrigin`].forEach(function(e){Y.prototype[e]=function(){return this.el_[e]}}),[`volume`,`src`,`poster`,`preload`,`playbackRate`,`defaultPlaybackRate`,`disablePictureInPicture`,`crossOrigin`].forEach(function(e){Y.prototype[`set`+Ji(e)]=function(t){this.el_[e]=t}}),[`pause`,`load`,`play`].forEach(function(e){Y.prototype[e]=function(){return this.el_[e]()}}),J.withSourceHandlers(Y),Y.nativeSourceHandler={},Y.nativeSourceHandler.canPlayType=function(e){try{return Y.TEST_VID.canPlayType(e)}catch{return``}},Y.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Y.nativeSourceHandler.canPlayType(e.type);if(e.src){let t=ka(e.src);return Y.nativeSourceHandler.canPlayType(`video/${t}`)}return``},Y.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},Y.nativeSourceHandler.dispose=function(){},Y.registerSourceHandler(Y.nativeSourceHandler),J.registerTech(`Html5`,Y);var fc=[`progress`,`abort`,`suspend`,`emptied`,`stalled`,`loadedmetadata`,`loadeddata`,`timeupdate`,`resize`,`volumechange`,`texttrackchange`],pc={canplay:`CanPlay`,canplaythrough:`CanPlayThrough`,playing:`Playing`,seeked:`Seeked`},mc=[`tiny`,`xsmall`,`small`,`medium`,`large`,`xlarge`,`huge`],hc={};mc.forEach(e=>{hc[e]=`vjs-layout-${e.charAt(0)===`x`?`x-${e.substring(1)}`:e}`});var gc={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},X=class e extends K{constructor(t,n,r){if(t.id=t.id||n.id||`vjs_video_${hi()}`,n=Object.assign(e.getTagSettings(t),n),n.initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language){let e=t.closest(`[lang]`);e&&(n.language=e.getAttribute(`lang`))}if(super(null,n,r),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.boundUpdatePlayerHeightOnAudioOnlyMode_=e=>this.updatePlayerHeightOnAudioOnlyMode_(e),this.isFullscreen_=!1,this.log=Yn(this.id_),this.fsApi_=Hn,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 Error(`No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?`);if(this.tag=t,this.tagAttributes=t&&Vr(t),this.language(this.options_.language),n.languages){let e={};Object.getOwnPropertyNames(n.languages).forEach(function(t){e[t.toLowerCase()]=n.languages[t]}),this.languages_=e}else this.languages_=e.prototype.options_.languages;this.resetCache_(),this.poster_=n.poster||``,this.controls_=!!n.controls,t.controls=!1,t.removeAttribute(`controls`),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],t.hasAttribute(`autoplay`)?this.autoplay(!0):this.autoplay(this.options_.autoplay),n.plugins&&Object.keys(n.plugins).forEach(e=>{if(typeof this[e]!=`function`)throw Error(`plugin "${e}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),Wi(this,{eventBusKey:`el_`}),this.fsApi_.requestFullscreen&&(Si(S.default,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on([`playerreset`,`resize`],this.boundUpdateStyleEl_);let i=H(this.options_);if(n.plugins&&Object.keys(n.plugins).forEach(e=>{this[e](n.plugins[e])}),n.debug&&this.debug(!0),this.options_.playerOptions=i,this.middleware_=[],this.playbackRates(n.playbackRates),n.experimentalSvgIcons){let e=new C.default.DOMParser().parseFromString(uo,`image/svg+xml`);if(e.querySelector(`parsererror`))B.warn(`Failed to load SVG Icons. Falling back to Font Icons.`),this.options_.experimentalSvgIcons=null;else{let t=e.documentElement;t.style.display=`none`,this.el_.appendChild(t),this.addClass(`vjs-svg-icons-enabled`)}}this.initChildren(),this.isAudio(t.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`),n.spatialNavigation&&n.spatialNavigation.enabled&&(this.spatialNavigation=new ho(this),this.addClass(`vjs-spatial-navigation-enabled`)),Cr&&this.addClass(`vjs-touch-enabled`),Tr||this.addClass(`vjs-workinghover`),e.players[this.id_]=this;let a=In.split(`.`)[0];this.addClass(`vjs-v${a}`),this.userActive(!0),this.reportUserActivity(),this.one(`play`,e=>this.listenForUserActivity_(e)),this.on(`keydown`,e=>this.handleKeyDown(e)),this.on(`languagechange`,e=>this.handleLanguagechange(e)),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`),Ci(S.default,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Ci(S.default,`keydown`,this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),e.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_&&=null,this.tag&&=null,no(this),Ba.names.forEach(e=>{let t=Ba[e],n=this[t.getterName]();n&&n.off&&n.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,n=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute(`data-vjs-player`),r=this.tag.tagName.toLowerCase()===`video-js`;n?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl(`div`));let i=Vr(e);if(r){for(t=this.el_=e,e=this.tag=S.default.createElement(`video`);t.children.length;)e.appendChild(t.firstChild);Ir(t,`video-js`)||Lr(t,`video-js`),t.appendChild(e),n=this.playerElIngest_=t,Object.keys(t).forEach(n=>{try{e[n]=t[n]}catch{}})}e.setAttribute(`tabindex`,`-1`),i.tabindex=`-1`,dr&&_r&&(e.setAttribute(`role`,`application`),i.role=`application`),e.removeAttribute(`width`),e.removeAttribute(`height`),`width`in i&&delete i.width,`height`in i&&delete i.height,Object.getOwnPropertyNames(i).forEach(function(n){r&&n===`class`||t.setAttribute(n,i[n]),r&&e.setAttribute(n,i[n])}),e.playerId=e.id,e.id+=`_html5_api`,e.className=`vjs-tech`,e.player=t.player=this,this.addClass(`vjs-paused`);let a=[`IS_SMART_TV`,`IS_TIZEN`,`IS_WEBOS`,`IS_ANDROID`,`IS_IPAD`,`IS_IPHONE`,`IS_CHROMECAST_RECEIVER`].filter(e=>Dr[e]).map(e=>`vjs-device-`+e.substring(3).toLowerCase().replace(/\_/g,`-`));if(this.addClass(...a),C.default.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=di(`vjs-styles-dimensions`);let e=ti(`.vjs-styles-defaults`),t=ti(`head`);t.insertBefore(this.styleEl_,e?e.nextSibling:t.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);let o=e.getElementsByTagName(`a`);for(let e=0;e<o.length;e++){let t=o.item(e);Lr(t,`vjs-hidden`),t.setAttribute(`hidden`,`hidden`)}return e.initNetworkState_=e.networkState,e.parentNode&&!n&&e.parentNode.insertBefore(t,e),Fr(e,t),this.children_.unshift(e),this.el_.setAttribute(`lang`,this.language_),this.el_.setAttribute(`translate`,`no`),this.el_=t,t}crossOrigin(e){if(e===void 0)return this.techGet_(`crossOrigin`);if(e!==null&&e!==`anonymous`&&e!==`use-credentials`){B.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){let n=e+`_`;if(t===void 0)return this[n]||0;if(t===``||t===`auto`){this[n]=void 0,this.updateStyleEl_();return}let r=parseFloat(t);if(isNaN(r)){B.error(`Improper value "${t}" supplied for for ${e}`);return}this[n]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,Fi(this)&&this.off([`playerreset`,`resize`],this.boundUpdateStyleEl_),e?(this.addClass(`vjs-fluid`),this.fill(!1),Ii(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 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(C.default.VIDEOJS_NO_DYNAMIC_STYLE===!0){let e=typeof this.width_==`number`?this.width_:this.options_.width,t=typeof this.height_==`number`?this.height_:this.options_.height,n=this.tech_&&this.tech_.el();n&&(e>=0&&(n.width=e),t>=0&&(n.height=t));return}let e,t,n,r;n=this.aspectRatio_!==void 0&&this.aspectRatio_!==`auto`?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+`:`+this.videoHeight():`16:9`;let i=n.split(`:`),a=i[1]/i[0];e=this.width_===void 0?this.height_===void 0?this.videoWidth()||300:this.height_/a:this.width_,t=this.height_===void 0?e*a:this.height_,r=/^[^a-zA-Z]/.test(this.id())?`dimensions-`+this.id():this.id()+`-dimensions`,this.addClass(r),fi(this.styleEl_,`
161
161
  .${r} {
162
162
  width: ${e}px;
163
163
  height: ${t}px;
@@ -166,9 +166,9 @@ This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNati
166
166
  .${r}.vjs-fluid:not(.vjs-audio-only-mode) {
167
167
  padding-top: ${a*100}%;
168
168
  }
169
- `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=Be(e),r=e.charAt(0).toLowerCase()+e.slice(1);i!=="Html5"&&this.tag&&(pe.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,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};ut.names.forEach(c=>{const f=ut[c];a[f.getterName]=this[f.privateName]}),Object.assign(a,this.options_[i]),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=pe.getTech(e);if(!l)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new l(a),this.tech_.ready(De(this,this.handleTechReady_),!0),Za.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Kd.forEach(c=>{this.on(this.tech_,c,f=>this[`handleTech${Be(c)}_`](f))}),Object.keys(Na).forEach(c=>{this.on(this.tech_,c,f=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Na[c]}_`].bind(this),event:f});return}this[`handleTech${Na[c]}_`](f)})}),this.on(this.tech_,"loadstart",c=>this.handleTechLoadStart_(c)),this.on(this.tech_,"sourceset",c=>this.handleTechSourceset_(c)),this.on(this.tech_,"waiting",c=>this.handleTechWaiting_(c)),this.on(this.tech_,"ended",c=>this.handleTechEnded_(c)),this.on(this.tech_,"seeking",c=>this.handleTechSeeking_(c)),this.on(this.tech_,"play",c=>this.handleTechPlay_(c)),this.on(this.tech_,"pause",c=>this.handleTechPause_(c)),this.on(this.tech_,"durationchange",c=>this.handleTechDurationChange_(c)),this.on(this.tech_,"fullscreenchange",(c,f)=>this.handleTechFullscreenChange_(c,f)),this.on(this.tech_,"fullscreenerror",(c,f)=>this.handleTechFullscreenError_(c,f)),this.on(this.tech_,"enterpictureinpicture",c=>this.handleTechEnterPictureInPicture_(c)),this.on(this.tech_,"leavepictureinpicture",c=>this.handleTechLeavePictureInPicture_(c)),this.on(this.tech_,"error",c=>this.handleTechError_(c)),this.on(this.tech_,"posterchange",c=>this.handleTechPosterChange_(c)),this.on(this.tech_,"textdata",c=>this.handleTechTextData_(c)),this.on(this.tech_,"ratechange",c=>this.handleTechRateChange_(c)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(i!=="Html5"||!this.tag)&&Wa(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){ut.names.forEach(e=>{const t=ut[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&&ye.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
169
+ `)}loadTech_(e,t){this.tech_&&this.unloadTech_();let n=Ji(e),r=e.charAt(0).toLowerCase()+e.slice(1);n!==`Html5`&&this.tag&&(J.getTech(`Html5`).disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;let i=this.autoplay();(typeof this.autoplay()==`string`||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(i=!1);let a={source:t,autoplay:i,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};Ba.names.forEach(e=>{let t=Ba[e];a[t.getterName]=this[t.privateName]}),Object.assign(a,this.options_[n]),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);let o=J.getTech(e);if(!o)throw Error(`No Tech named '${n}' exists! '${n}' should be registered using videojs.registerTech()'`);this.tech_=new o(a),this.tech_.ready(G(this,this.handleTechReady_),!0),da.jsonToTextTracks(this.textTracksJson_||[],this.tech_),fc.forEach(e=>{this.on(this.tech_,e,t=>this[`handleTech${Ji(e)}_`](t))}),Object.keys(pc).forEach(e=>{this.on(this.tech_,e,t=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${pc[e]}_`].bind(this),event:t});return}this[`handleTech${pc[e]}_`](t)})}),this.on(this.tech_,`loadstart`,e=>this.handleTechLoadStart_(e)),this.on(this.tech_,`sourceset`,e=>this.handleTechSourceset_(e)),this.on(this.tech_,`waiting`,e=>this.handleTechWaiting_(e)),this.on(this.tech_,`ended`,e=>this.handleTechEnded_(e)),this.on(this.tech_,`seeking`,e=>this.handleTechSeeking_(e)),this.on(this.tech_,`play`,e=>this.handleTechPlay_(e)),this.on(this.tech_,`pause`,e=>this.handleTechPause_(e)),this.on(this.tech_,`durationchange`,e=>this.handleTechDurationChange_(e)),this.on(this.tech_,`fullscreenchange`,(e,t)=>this.handleTechFullscreenChange_(e,t)),this.on(this.tech_,`fullscreenerror`,(e,t)=>this.handleTechFullscreenError_(e,t)),this.on(this.tech_,`enterpictureinpicture`,e=>this.handleTechEnterPictureInPicture_(e)),this.on(this.tech_,`leavepictureinpicture`,e=>this.handleTechLeavePictureInPicture_(e)),this.on(this.tech_,`error`,e=>this.handleTechError_(e)),this.on(this.tech_,`posterchange`,e=>this.handleTechPosterChange_(e)),this.on(this.tech_,`textdata`,e=>this.handleTechTextData_(e)),this.on(this.tech_,`ratechange`,e=>this.handleTechRateChange_(e)),this.on(this.tech_,`loadedmetadata`,this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_(`controls`)),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(n!==`Html5`||!this.tag)&&Fr(this.tech_.el(),this.el()),this.tag&&=(this.tag.player=null,null)}unloadTech_(){Ba.names.forEach(e=>{let t=Ba[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=da.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&&B.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
170
170
  See https://github.com/videojs/video.js/issues/2617 for more info.
171
- `),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(ar(a))return a.catch(l=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${l||""}`)})};let i;if(e==="any"&&!this.muted()?(i=this.play(),ar(i)&&(i=i.catch(t))):e==="muted"&&!this.muted()?i=t():i=this.play(),!!ar(i))return i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,i="";typeof t!="string"&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=Ng(this,t)),this.cache_.source=Ee({},e,{src:t,type:i});const r=this.cache_.sources.filter(c=>c.src&&c.src===t),n=[],a=this.$$("source"),l=[];for(let c=0;c<a.length;c++){const f=_i(a[c]);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 i=this.currentSource().src,r=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==i)&&(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"),i=>i.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()&&!se.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 i=this.el();let r=se[this.fsApi_.fullscreenElement]===i;!r&&i.matches&&(r=i.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 Pg)return jg(this.middleware_,this.tech_,e,t);if(e in Lu)return Pu(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw ye(i),i}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in Ig)return kg(this.middleware_,this.tech_,e);if(e in Lu)return Pu(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(ye(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(ye(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(ye(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())),i=!!(On||it);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&&i&&this.load();return}const r=this.techGet_("play");i&&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(i){i(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||Rt(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=Rt(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=Rt(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 pd(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}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((i,r)=>{function n(){t.off("fullscreenerror",l),t.off("fullscreenchange",a)}function a(){n(),i()}function l(f,g){n(),r(g)}t.one("fullscreenchange",a),t.one("fullscreenerror",l);const c=t.requestFullscreenHelper_(e);c&&(c.then(n,n),c.then(i,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 i=this.el_[this.fsApi_.requestFullscreen](t);return i&&i.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),i}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,i)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){r(),t()}function a(c,f){r(),i(f)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const l=e.exitFullscreenHelper_();l&&(l.then(r,r),l.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=se[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=se.documentElement.style.overflow,bt(se,"keydown",this.boundFullWindowOnEscKey_),se.documentElement.style.overflow="hidden",Bi(se.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,st(se,"keydown",this.boundFullWindowOnEscKey_),se.documentElement.style.overflow=this.docOrigOverflow,Mn(se.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&&w.documentPictureInPicture){const e=se.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(ce("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),w.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(td(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",i=>{const r=i.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in se&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(w.documentPictureInPicture&&w.documentPictureInPicture.window)return w.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in se)return se.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:i=a=>e.key.toLowerCase()==="f",muteKey:r=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const a=X.getComponent("FullscreenToggle");se[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),X.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),X.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,r=this.options_.techOrder;i<r.length;i++){const n=r[i];let a=pe.getTech(n);if(a||(a=X.getComponent(n)),!a){ye.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,pe.getTech(l)]).filter(([l,c])=>c?c.isSupported():(ye.error(`The "${l}" tech is undefined. Skipped browser support check for that tech.`),!1)),i=function(l,c,f){let g;return l.some(y=>c.some(k=>{if(g=f(y,k),g)return!0})),g};let r;const n=l=>(c,f)=>l(f,c),a=([l,c],f)=>{if(c.canPlaySource(f,this.options_[l.toLowerCase()]))return{source:f,tech:l}};return this.options_.sourceOrder?r=i(e,t,n(a)):r=i(t,e,a),r||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=bd(e);if(!i.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),wg(this,i[0],(r,n)=>{if(this.middleware_=n,t||(this.cache_.sources=i),this.updateSourceCaches_(r),this.src_(r)){if(i.length>1)return this.handleSrc_(i.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}Dg(n,this.tech_)}),i.length>1){const r=()=>{this.error(null),this.handleSrc_(i.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?cd(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}),ni(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=i||{};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(Ti("beforeerror").forEach(t=>{const i=t(this,e);if(!(Yt(i)&&!Array.isArray(i)||typeof i=="string"||typeof i=="number"||i===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=i}),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 Re(e),this.addClass("vjs-error"),ye.error(`(CODE:${this.error_.code} ${Re.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),Ti("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,i;const r=De(this,this.reportUserActivity),n=function(y){(y.screenX!==t||y.screenY!==i)&&(t=y.screenX,i=y.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},l=function(y){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",l),this.on("mouseleave",l);const c=this.getChild("controlBar");c&&!it&&!Nt&&(c.on("mouseenter",function(y){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),c.on("mouseleave",function(y){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let f;const g=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(f);const y=this.options_.inactivityTimeout;y<=0||(f=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},y))};this.setInterval(g,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"),i=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=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),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,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}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(),ni(this)&&this.trigger("languagechange"))}languages(){return Ee(xe.prototype.options_.languages,this.languages_)}toJSON(){const e=Ee(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let r=t[i];r=Ee(r),r.player=void 0,e.tracks[i]=r}return e}createModal(e,t){t=t||{},t.content=e||"";const i=new Ss(this,t);return this.addChild(i),i.on("dispose",()=>{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<io.length;i++){const r=io[i],n=this.breakpoints_[r];if(t<=n){if(e===r)return;e&&this.removeClass(sn[e]),this.addClass(sn[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({},m1,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 sn[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const i=this.crossOrigin();this.reset(),this.cache_.media=Ee(e);const{artist:r,artwork:n,description:a,poster:l,src:c,textTracks:f,title:g}=this.cache_.media;!n&&l&&(this.cache_.media.artwork=[{src:l,type:gn(l)}]),i&&this.crossOrigin(i),c&&this.src(c),l&&this.poster(l),Array.isArray(f)&&f.forEach(y=>this.addRemoteTextTrack(y,!1)),this.titleBar&&this.titleBar.update({title:g,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),i=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),r={src:t,textTracks:i};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:gn(r.poster)}]),r}return Ee(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=_i(e),r=i["data-setup"];if(rr(e,"vjs-fill")&&(i.fill=!0),rr(e,"vjs-fluid")&&(i.fluid=!0),r!==null)try{Object.assign(i,JSON.parse(r||"{}"))}catch(n){ye.error("data-setup",n)}if(Object.assign(t,i),e.hasChildNodes()){const n=e.childNodes;for(let a=0,l=n.length;a<l;a++){const c=n[a],f=c.nodeName.toLowerCase();f==="source"?t.sources.push(_i(c)):f==="track"&&t.tracks.push(_i(c))}}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"))}}xe.prototype.videoTracks=()=>{};xe.prototype.audioTracks=()=>{};xe.prototype.textTracks=()=>{};xe.prototype.remoteTextTracks=()=>{};xe.prototype.remoteTextTrackEls=()=>{};ut.names.forEach(function(s){const e=ut[s];xe.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});xe.prototype.crossorigin=xe.prototype.crossOrigin;xe.players={};const Js=w.navigator;xe.prototype.options_={techOrder:pe.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Js&&(Js.languages&&Js.languages[0]||Js.userLanguage||Js.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};Kd.forEach(function(s){xe.prototype[`handleTech${Be(s)}_`]=function(){return this.trigger(s)}});X.registerComponent("Player",xe);const vn="plugin",ns="activePlugins_",Zi={},yn=s=>Zi.hasOwnProperty(s),rn=s=>yn(s)?Zi[s]:void 0,Qd=(s,e)=>{s[ns]=s[ns]||{},s[ns][e]=!0},_n=(s,e,t)=>{const i=(t?"before":"")+"pluginsetup";s.trigger(i,e),s.trigger(i+":"+e.name,e)},g1=function(s,e){const t=function(){_n(this,{name:s,plugin:e,instance:null},!0);const i=e.apply(this,arguments);return Qd(this,s),_n(this,{name:s,plugin:e,instance:i}),i};return Object.keys(e).forEach(function(i){t[i]=e[i]}),t},Yu=(s,e)=>(e.prototype.name=s,function(...t){_n(this,{name:s,plugin:e,instance:null},!0);const i=new e(this,...t);return this[s]=()=>i,_n(this,i.getEventHash()),i});class pt{constructor(e){if(this.constructor===pt)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),wo(this),delete this.trigger,ud(this,this.constructor.defaultState),Qd(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 xs(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[ns][e]=!1,this.player=this.state=null,t[e]=Yu(e,Zi[e])}static isBasic(e){const t=typeof e=="string"?rn(e):e;return typeof t=="function"&&!pt.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(yn(e))ye.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(xe.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 Zi[e]=t,e!==vn&&(pt.isBasic(t)?xe.prototype[e]=g1(e,t):xe.prototype[e]=Yu(e,t)),t}static deregisterPlugin(e){if(e===vn)throw new Error("Cannot de-register base plugin.");yn(e)&&(delete Zi[e],delete xe.prototype[e])}static getPlugins(e=Object.keys(Zi)){let t;return e.forEach(i=>{const r=rn(i);r&&(t=t||{},t[i]=r)}),t}static getPluginVersion(e){const t=rn(e);return t&&t.VERSION||""}}pt.getPlugin=rn;pt.BASE_PLUGIN_NAME=vn;pt.registerPlugin(vn,pt);xe.prototype.usingPlugin=function(s){return!!this[ns]&&this[ns][s]===!0};xe.prototype.hasPlugin=function(s){return!!yn(s)};function v1(s,e){let t=!1;return function(...i){return t||ye.warn(s),t=!0,e.apply(this,i)}}function Bt(s,e,t,i){return v1(`${e} is deprecated and will be removed in ${s}.0; please use ${t} instead.`,i)}var y1={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 Jd=s=>s.indexOf("#")===0?s.slice(1):s;function B(s,e,t){let i=B.getPlayer(s);if(i)return e&&ye.warn(`Player "${s}" is already initialised. Options will not be applied.`),t&&i.ready(t),i;const r=typeof s=="string"?xi("#"+Jd(s)):s;if(!Ts(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof w.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!a.contains(r))&&ye.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)),Ti("beforesetup").forEach(c=>{const f=c(r,Ee(e));if(!Yt(f)||Array.isArray(f)){ye.error("please return an object in beforesetup hooks");return}e=Ee(e,f)});const l=X.getComponent("Player");return i=new l(r,e,t),Ti("setup").forEach(c=>c(i)),i}B.hooks_=si;B.hooks=Ti;B.hook=J0;B.hookOnce=Z0;B.removeHook=Oc;if(w.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&bs()){let s=xi(".vjs-styles-defaults");if(!s){s=rd("vjs-styles-defaults");const e=xi("head");e&&e.insertBefore(s,e.firstChild),nd(s,`
171
+ `),this.tech_}version(){return{"video.js":In}}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.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?`play`:this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!=`string`)return;let t=()=>{let e=this.muted();this.muted(!0);let t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);let n=this.play();if(ca(n))return n.catch(e=>{throw t(),Error(`Rejection at manualAutoplay. Restoring muted value. ${e||``}`)})},n;if(e===`any`&&!this.muted()?(n=this.play(),ca(n)&&(n=n.catch(t))):n=e===`muted`&&!this.muted()?t():this.play(),ca(n))return n.then(()=>{this.trigger({type:`autoplay-success`,autoplay:e})}).catch(()=>{this.trigger({type:`autoplay-failure`,autoplay:e})})}updateSourceCaches_(e=``){let t=e,n=``;typeof t!=`string`&&(t=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!n&&(n=so(this,t)),this.cache_.source=H({},e,{src:t,type:n});let r=this.cache_.sources.filter(e=>e.src&&e.src===t),i=[],a=this.$$(`source`),o=[];for(let e=0;e<a.length;e++){let n=Vr(a[e]);i.push(n),n.src&&n.src===t&&o.push(n.src)}o.length&&!r.length?this.cache_.sources=i:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e),n=this.currentSource().src,r=e.src;n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(t=()=>{}),t(r),e.src||this.tech_.any([`sourceset`,`loadstart`],e=>{if(e.type===`sourceset`)return;let t=this.techGet_(`currentSrc`);this.lastSource_.tech=t,this.updateSourceCaches_(t)})}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`);let 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()?la(this.play()):this.pause())}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(`.vjs-control-bar, .vjs-modal-dialog`),t=>t.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()&&!S.default.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){let t=e.target.player;if(t&&t!==this)return;let n=this.el(),r=S.default[this.fsApi_.fullscreenElement]===n;!r&&n.matches&&(r=n.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_(){let 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 Qa)return Ya(this.middleware_,this.tech_,e,t);if(e in $a)return Xa(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw B(e),e}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in Za)return Ja(this.middleware_,this.tech_,e);if(e in $a)return Xa(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(B(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name===`TypeError`?(B(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(B(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=la){this.playCallbacks_.push(e);let t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),n=!!(Er||Tr);if(this.waitToPlay_&&=(this.off([`ready`,`loadstart`],this.waitToPlay_),null),!this.isReady_||!t){this.waitToPlay_=e=>{this.play_()},this.one([`ready`,`loadstart`],this.waitToPlay_),!t&&n&&this.load();return}let r=this.techGet_(`play`);n&&this.hasClass(`vjs-ended`)&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){let e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})}runPlayCallbacks_(e){let t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e)})}pause(){this.techCall_(`pause`)}paused(){return this.techGet_(`paused`)!==!1}played(){return this.techGet_(`played`)||ea(0,0)}scrubbing(e){if(e===void 0)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?NaN:this.cache_.duration;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=ea(0,0)),e}seekable(){let e=this.techGet_(`seekable`);return(!e||!e.length)&&(e=ea(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 sa(this.buffered(),this.duration())}bufferedEnd(){let e=this.buffered(),t=this.duration(),n=e.end(e.length-1);return n>t&&(n=t),n}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){let 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();let t=this;return new Promise((n,r)=>{function i(){t.off(`fullscreenerror`,o),t.off(`fullscreenchange`,a)}function a(){i(),n()}function o(e,t){i(),r(t)}t.one(`fullscreenchange`,a),t.one(`fullscreenerror`,o);let s=t.requestFullscreenHelper_(e);s&&(s.then(i,i),s.then(n,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){let e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_(`enterFullScreen`):this.enterFullWindow()}exitFullscreen(){let e=this;return new Promise((t,n)=>{function r(){e.off(`fullscreenerror`,a),e.off(`fullscreenchange`,i)}function i(){r(),t()}function a(e,t){r(),n(t)}e.one(`fullscreenchange`,i),e.one(`fullscreenerror`,a);let o=e.exitFullscreenHelper_();o&&(o.then(r,r),o.then(t,n))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){let e=S.default[this.fsApi_.exitFullscreen]();return e&&la(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=S.default.documentElement.style.overflow,Si(S.default,`keydown`,this.boundFullWindowOnEscKey_),S.default.documentElement.style.overflow=`hidden`,Lr(S.default.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,Ci(S.default,`keydown`,this.boundFullWindowOnEscKey_),S.default.documentElement.style.overflow=this.docOrigOverflow,Rr(S.default.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&&C.default.documentPictureInPicture){let e=S.default.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(U(`p`,{className:`vjs-pip-text`},{},this.localize(`Playing in picture-in-picture`))),C.default.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(ii(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`,t=>{let n=t.target.querySelector(`.video-js`);e.parentNode.replaceChild(n,e),this.player_.isInPictureInPicture(!1),this.player_.trigger(`leavepictureinpicture`)}),t))}return`pictureInPictureEnabled`in S.default&&this.disablePictureInPicture()===!1?this.techGet_(`requestPictureInPicture`):Promise.reject(`No PiP mode is available`)}exitPictureInPicture(){if(C.default.documentPictureInPicture&&C.default.documentPictureInPicture.window)return C.default.documentPictureInPicture.window.close(),Promise.resolve();if(`pictureInPictureEnabled`in S.default)return S.default.exitPictureInPicture()}handleKeyDown(e){let{userActions:t}=this.options_;!t||!t.hotkeys||(e=>{let t=e.tagName.toLowerCase();return e.isContentEditable?!0:t===`input`?[`button`,`checkbox`,`hidden`,`radio`,`reset`,`submit`].indexOf(e.type)===-1:[`textarea`].indexOf(t)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys==`function`?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){let{fullscreenKey:t=t=>e.key.toLowerCase()===`f`,muteKey:n=t=>e.key.toLowerCase()===`m`,playPauseKey:r=t=>e.key.toLowerCase()===`k`||e.key.toLowerCase()===` `}=this.options_.userActions?this.options_.userActions.hotkeys:{};if(t.call(this,e)){e.preventDefault(),e.stopPropagation();let t=K.getComponent(`FullscreenToggle`);S.default[this.fsApi_.fullscreenEnabled]!==!1&&t.prototype.handleClick.call(this,e)}else n.call(this,e)?(e.preventDefault(),e.stopPropagation(),K.getComponent(`MuteToggle`).prototype.handleClick.call(this,e)):r.call(this,e)&&(e.preventDefault(),e.stopPropagation(),K.getComponent(`PlayToggle`).prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let n=0,r=this.options_.techOrder;n<r.length;n++){let i=r[n],a=J.getTech(i);if(a||=K.getComponent(i),!a){B.error(`The "${i}" tech is undefined. Skipped browser support check for that tech.`);continue}if(a.isSupported()&&(t=a.canPlayType(e),t))return t}return``}selectSource(e){let t=this.options_.techOrder.map(e=>[e,J.getTech(e)]).filter(([e,t])=>t?t.isSupported():(B.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1)),n=function(e,t,n){let r;return e.some(e=>t.some(t=>{if(r=n(e,t),r)return!0})),r},r,i=e=>(t,n)=>e(n,t),a=([e,t],n)=>{if(t.canPlaySource(n,this.options_[e.toLowerCase()]))return{source:n,tech:e}};return r=this.options_.sourceOrder?n(e,t,i(a)):n(t,e,a),r||!1}handleSrc_(e,t){if(e===void 0)return this.cache_.src||``;this.resetRetryOnError_&&this.resetRetryOnError_();let n=co(e);if(!n.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=n),this.updateSourceCaches_(n[0]),Ka(this,n[0],(e,r)=>{if(this.middleware_=r,t||(this.cache_.sources=n),this.updateSourceCaches_(e),this.src_(e)){if(n.length>1)return this.handleSrc_(n.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}qa(r,this.tech_)}),n.length>1){let e=()=>{this.error(null),this.handleSrc_(n.slice(1),!0)},t=()=>{this.off(`error`,e)};this.one(`error`,e),this.one(`playing`,t),this.resetRetryOnError_=()=>{this.off(`error`,e),this.off(`playing`,t)}}}src(e){return this.handleSrc_(e,!1)}src_(e){let t=this.selectSource([e]);return t?Yi(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(){this.paused()?this.doReset_():la(this.play().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}),Fi(this)&&this.trigger(`playerreset`)}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);let{currentTimeDisplay:e,durationDisplay:t,progressControl:n,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:i}=n||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),i&&(i.update(),i.loadProgressBar&&i.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger(`volumechange`)}currentSources(){let 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=t===void 0?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!==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){let 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(Rn(`beforeerror`).forEach(t=>{let n=t(this,e);if(!($n(n)&&!Array.isArray(n)||typeof n==`string`||typeof n==`number`||n===null)){this.log.error(`please return a value that MediaError expects in beforeerror hooks`);return}e=n}),this.options_.suppressNotSupportedError&&e&&e.code===4){let 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 q(e),this.addClass(`vjs-error`),B.error(`(CODE:${this.error_.code} ${q.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger(`error`),Rn(`error`).forEach(e=>e(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(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass(`vjs-user-active`),this.addClass(`vjs-user-inactive`),this.trigger(`userinactive`)}}listenForUserActivity_(){let e,t,n,r=G(this,this.reportUserActivity),i=function(e){(e.screenX!==t||e.screenY!==n)&&(t=e.screenX,n=e.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},o=function(t){r(),this.clearInterval(e)};this.on(`mousedown`,a),this.on(`mousemove`,i),this.on(`mouseup`,o),this.on(`mouseleave`,o);let s=this.getChild(`controlBar`);s&&!Tr&&!or&&(s.on(`mouseenter`,function(e){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),s.on(`mouseleave`,function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on(`keydown`,r),this.on(`keyup`,r);let c;this.setInterval(function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(c);let e=this.options_.inactivityTimeout;e<=0||(c=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e))},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.tech_&&this.tech_.featuresPlaybackRate?this.techGet_(`defaultPlaybackRate`):1:this.techCall_(`setDefaultPlaybackRate`,e)}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){let 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`);let e=this.children(),t=this.getChild(`ControlBar`),n=t&&t.currentHeight();e.forEach(e=>{e!==t&&e.el_&&!e.hasClass(`vjs-hidden`)&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=n,this.on(`playerresize`,this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(n),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){let e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).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,n){if(this.tech_)return this.tech_.addTextTrack(e,t,n)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(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(),Fi(this)&&this.trigger(`languagechange`))}languages(){return H(e.prototype.options_.languages,this.languages_)}toJSON(){let e=H(this.options_),t=e.tracks;e.tracks=[];for(let n=0;n<t.length;n++){let r=t[n];r=H(r),r.player=void 0,e.tracks[n]=r}return e}createModal(e,t){t||={},t.content=e||``;let n=new pa(this,t);return this.addChild(n),n.on(`dispose`,()=>{this.removeChild(n)}),n.open(),n}updateCurrentBreakpoint_(){if(!this.responsive())return;let e=this.currentBreakpoint(),t=this.currentWidth();for(let n=0;n<mc.length;n++){let r=mc[n];if(t<=this.breakpoints_[r]){if(e===r)return;e&&this.removeClass(hc[e]),this.addClass(hc[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){let 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({},gc,e),this.updateCurrentBreakpoint_(),Object.assign(this.breakpoints_))}responsive(e){if(e===void 0)return this.responsive_;e=!!e;let 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 hc[this.breakpoint_]||``}loadMedia(e,t){if(!e||typeof e!=`object`)return;let n=this.crossOrigin();this.reset(),this.cache_.media=H(e);let{artist:r,artwork:i,description:a,poster:o,src:s,textTracks:c,title:l}=this.cache_.media;!i&&o&&(this.cache_.media.artwork=[{src:o,type:oo(o)}]),n&&this.crossOrigin(n),s&&this.src(s),o&&this.poster(o),Array.isArray(c)&&c.forEach(e=>this.addRemoteTextTrack(e,!1)),this.titleBar&&this.titleBar.update({title:l,description:a||r||``}),this.ready(t)}getMedia(){if(!this.cache_.media){let e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:oo(t.poster)}]),t}return H(this.cache_.media)}static getTagSettings(e){let t={sources:[],tracks:[]},n=Vr(e),r=n[`data-setup`];if(Ir(e,`vjs-fill`)&&(n.fill=!0),Ir(e,`vjs-fluid`)&&(n.fluid=!0),r!==null)try{Object.assign(n,JSON.parse(r||`{}`))}catch(e){B.error(`data-setup`,e)}if(Object.assign(t,n),e.hasChildNodes()){let n=e.childNodes;for(let e=0,r=n.length;e<r;e++){let r=n[e],i=r.nodeName.toLowerCase();i===`source`?t.sources.push(Vr(r)):i===`track`&&t.tracks.push(Vr(r))}}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(e=>typeof e==`number`)&&(this.cache_.playbackRates=e,this.trigger(`playbackrateschange`))}};X.prototype.videoTracks=()=>{},X.prototype.audioTracks=()=>{},X.prototype.textTracks=()=>{},X.prototype.remoteTextTracks=()=>{},X.prototype.remoteTextTrackEls=()=>{},Ba.names.forEach(function(e){let t=Ba[e];X.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),X.prototype.crossorigin=X.prototype.crossOrigin,X.players={};var _c=C.default.navigator;X.prototype.options_={techOrder:J.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:[`mediaLoader`,`posterImage`,`titleBar`,`textTrackDisplay`,`loadingSpinner`,`bigPlayButton`,`liveTracker`,`controlBar`,`errorDisplay`,`textTrackSettings`,`resizeManager`],language:_c&&(_c.languages&&_c.languages[0]||_c.userLanguage||_c.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},fc.forEach(function(e){X.prototype[`handleTech${Ji(e)}_`]=function(){return this.trigger(e)}}),K.registerComponent(`Player`,X);var vc=`plugin`,yc=`activePlugins_`,bc={},xc=e=>bc.hasOwnProperty(e),Sc=e=>xc(e)?bc[e]:void 0,Cc=(e,t)=>{e[yc]=e[yc]||{},e[yc][t]=!0},wc=(e,t,n)=>{let r=(n?`before`:``)+`pluginsetup`;e.trigger(r,t),e.trigger(r+`:`+t.name,t)},Tc=function(e,t){let n=function(){wc(this,{name:e,plugin:t,instance:null},!0);let n=t.apply(this,arguments);return Cc(this,e),wc(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach(function(e){n[e]=t[e]}),n},Ec=(e,t)=>(t.prototype.name=e,function(...n){wc(this,{name:e,plugin:t,instance:null},!0);let r=new t(this,...n);return this[e]=()=>r,wc(this,r.getEventHash()),r}),Dc=class e{constructor(t){if(this.constructor===e)throw Error(`Plugin must be sub-classed; not directly instantiated.`);this.player=t,this.log||=this.player.log.createLogger(this.name),Wi(this),delete this.trigger,Ki(this,this.constructor.defaultState),Cc(t,this.name),this.dispose=this.dispose.bind(this),t.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 wi(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){let{name:e,player:t}=this;this.trigger(`dispose`),this.off(),t.off(`dispose`,this.dispose),t[yc][e]=!1,this.player=this.state=null,t[e]=Ec(e,bc[e])}static isBasic(t){let n=typeof t==`string`?Sc(t):t;return typeof n==`function`&&!e.prototype.isPrototypeOf(n.prototype)}static registerPlugin(t,n){if(typeof t!=`string`)throw Error(`Illegal plugin name, "${t}", must be a string, was ${typeof t}.`);if(xc(t))B.warn(`A plugin named "${t}" already exists. You may want to avoid re-registering plugins!`);else if(X.prototype.hasOwnProperty(t))throw Error(`Illegal plugin name, "${t}", cannot share a name with an existing player method!`);if(typeof n!=`function`)throw Error(`Illegal plugin for "${t}", must be a function, was ${typeof n}.`);return bc[t]=n,t!==vc&&(e.isBasic(n)?X.prototype[t]=Tc(t,n):X.prototype[t]=Ec(t,n)),n}static deregisterPlugin(e){if(e===vc)throw Error(`Cannot de-register base plugin.`);xc(e)&&(delete bc[e],delete X.prototype[e])}static getPlugins(e=Object.keys(bc)){let t;return e.forEach(e=>{let n=Sc(e);n&&(t||={},t[e]=n)}),t}static getPluginVersion(e){let t=Sc(e);return t&&t.VERSION||``}};Dc.getPlugin=Sc,Dc.BASE_PLUGIN_NAME=vc,Dc.registerPlugin(vc,Dc),X.prototype.usingPlugin=function(e){return!!this[yc]&&this[yc][e]===!0},X.prototype.hasPlugin=function(e){return!!xc(e)};function Oc(e,t){let n=!1;return function(...r){return n||B.warn(e),n=!0,t.apply(this,r)}}function kc(e,t,n,r){return Oc(`${t} is deprecated and will be removed in ${e}.0; please use ${n} instead.`,r)}var Ac={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`},jc=e=>e.indexOf(`#`)===0?e.slice(1):e;function Z(e,t,n){let r=Z.getPlayer(e);if(r)return t&&B.warn(`Player "${e}" is already initialised. Options will not be applied.`),n&&r.ready(n),r;let i=typeof e==`string`?ti(`#`+jc(e)):e;if(!jr(i))throw TypeError(`The element or ID supplied is not valid. (videojs)`);let a=`getRootNode`in i&&i.getRootNode()instanceof C.default.ShadowRoot?i.getRootNode():i.ownerDocument.body;return(!i.ownerDocument.defaultView||!a.contains(i))&&B.warn(`The element supplied is not included in the DOM`),t||={},t.restoreEl===!0&&(t.restoreEl=(i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute(`data-vjs-player`)?i.parentNode:i).cloneNode(!0)),Rn(`beforesetup`).forEach(e=>{let n=e(i,H(t));if(!$n(n)||Array.isArray(n)){B.error(`please return an object in beforesetup hooks`);return}t=H(t,n)}),r=new(K.getComponent(`Player`))(i,t,n),Rn(`setup`).forEach(e=>e(r)),r}if(Z.hooks_=Ln,Z.hooks=Rn,Z.hook=zn,Z.hookOnce=Vn,Z.removeHook=Bn,C.default.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Ar()){let e=ti(`.vjs-styles-defaults`);if(!e){e=di(`vjs-styles-defaults`);let t=ti(`head`);t&&t.insertBefore(e,t.firstChild),fi(e,`
172
172
  .video-js {
173
173
  width: 300px;
174
174
  height: 150px;
@@ -177,30 +177,35 @@ See https://github.com/videojs/video.js/issues/2617 for more info.
177
177
  .vjs-fluid:not(.vjs-audio-only-mode) {
178
178
  padding-top: 56.25%
179
179
  }
180
- `)}}Ya(1,B);B.VERSION=$a;B.options=xe.prototype.options_;B.getPlayers=()=>xe.players;B.getPlayer=s=>{const e=xe.players;let t;if(typeof s=="string"){const i=Jd(s),r=e[i];if(r)return r;t=xi("#"+i)}else t=s;if(Ts(t)){const{player:i,playerId:r}=t;if(i||e[r])return i||e[r]}};B.getAllPlayers=()=>Object.keys(xe.players).map(s=>xe.players[s]).filter(Boolean);B.players=xe.players;B.getComponent=X.getComponent;B.registerComponent=(s,e)=>(pe.isTech(e)&&ye.warn(`The ${s} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),X.registerComponent.call(X,s,e));B.getTech=pe.getTech;B.registerTech=pe.registerTech;B.use=Ag;Object.defineProperty(B,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(B.middleware,"TERMINATOR",{value:mn,writeable:!1,enumerable:!0});B.browser=Hc;B.obj=ig;B.mergeOptions=Bt(9,"videojs.mergeOptions","videojs.obj.merge",Ee);B.defineLazyProperty=Bt(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",jn);B.bind=Bt(9,"videojs.bind","native Function.prototype.bind",De);B.registerPlugin=pt.registerPlugin;B.deregisterPlugin=pt.deregisterPlugin;B.plugin=(s,e)=>(ye.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),pt.registerPlugin(s,e));B.getPlugins=pt.getPlugins;B.getPlugin=pt.getPlugin;B.getPluginVersion=pt.getPluginVersion;B.addLanguage=function(s,e){return s=(""+s).toLowerCase(),B.options.languages=Ee(B.options.languages,{[s]:e}),B.options.languages[s]};B.log=ye;B.createLogger=Mc;B.time=vg;B.createTimeRange=Bt(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Rt);B.createTimeRanges=Bt(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Rt);B.formatTime=Bt(9,"videojs.formatTime","videojs.time.formatTime",qi);B.setFormatTime=Bt(9,"videojs.setFormatTime","videojs.time.setFormatTime",hd);B.resetFormatTime=Bt(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",fd);B.parseUrl=Bt(9,"videojs.parseUrl","videojs.url.parseUrl",Io);B.isCrossOrigin=Bt(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",qn);B.EventTarget=Tt;B.any=Ao;B.on=bt;B.one=Un;B.off=st;B.trigger=xs;B.xhr=_c;B.TrackList=Hi;B.TextTrack=mr;B.TextTrackList=ko;B.AudioTrack=yd;B.AudioTrackList=md;B.VideoTrack=_d;B.VideoTrackList=gd;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(s=>{B[s]=function(){return ye.warn(`videojs.${s}() is deprecated; use videojs.dom.${s}() instead`),id[s].apply(null,arguments)}});B.computedStyle=Bt(9,"videojs.computedStyle","videojs.dom.computedStyle",ys);B.dom=id;B.fn=dg;B.num=Wg;B.str=mg;B.url=Cg;B.Error=y1;class _1{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(i){t.enabled_(i)}}),t}}class bn extends B.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 i=this.levels_.length;return t=new _1(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,r=this.length;i<r;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){const r=this[t];if(r.id===e)return r}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}bn.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const s in bn.prototype.allowedEvents_)bn.prototype["on"+s]=null;var Zd="4.1.0";const b1=function(s,e){const t=s.qualityLevels,i=new bn,r=function(){i.dispose(),s.qualityLevels=t,s.off("dispose",r)};return s.on("dispose",r),s.qualityLevels=()=>i,s.qualityLevels.VERSION=Zd,i},eh=function(s){return b1(this,B.obj.merge({},s))};B.registerPlugin("qualityLevels",eh);eh.VERSION=Zd;const ht=An,Tn=(s,e)=>e&&e.responseURL&&s!==e.responseURL?e.responseURL:s,It=s=>B.log.debug?B.log.debug.bind(B,"VHS:",`${s} >`):function(){};function Se(...s){const e=B.obj||B;return(e.merge||e.mergeOptions).apply(e,s)}function Ye(...s){const e=B.time||B;return(e.createTimeRanges||e.createTimeRanges).apply(e,s)}function T1(s){if(s.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges:
181
- `;for(let t=0;t<s.length;t++){const i=s.start(t),r=s.end(t);e+=`${i} --> ${r}. Duration (${r-i})
182
- `}return e}const Gt=1/30,Wt=Gt*3,th=function(s,e){const t=[];let i;if(s&&s.length)for(i=0;i<s.length;i++)e(s.start(i),s.end(i))&&t.push([s.start(i),s.end(i)]);return Ye(t)},es=function(s,e){return th(s,function(t,i){return t-Wt<=e&&i+Wt>=e})},Jr=function(s,e){return th(s,function(t){return t-Gt>=e})},x1=function(s){if(s.length<2)return Ye();const e=[];for(let t=1;t<s.length;t++){const i=s.end(t-1),r=s.start(t);e.push([i,r])}return Ye(e)},S1=function(s,e){let t=null,i=null,r=0;const n=[],a=[];if(!s||!s.length||!e||!e.length)return Ye();let l=s.length;for(;l--;)n.push({time:s.start(l),type:"start"}),n.push({time:s.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(c,f){return c.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&&(i=n[l].time)),t!==null&&i!==null&&(a.push([t,i]),t=null,i=null);return Ye(a)},ih=s=>{const e=[];if(!s||!s.length)return"";for(let t=0;t<s.length;t++)e.push(s.start(t)+" => "+s.end(t));return e.join(", ")},C1=function(s,e,t=1){return((s.length?s.end(s.length-1):0)-e)/t},Ri=s=>{const e=[];for(let t=0;t<s.length;t++)e.push({start:s.start(t),end:s.end(t)});return e},E1=function(s,e){if(s===e)return!1;if(!s&&e||!e&&s||s.length!==e.length)return!0;for(let t=0;t<s.length;t++)if(s.start(t)!==e.start(t)||s.end(t)!==e.end(t))return!0;return!1},Ba=function(s){if(!(!s||!s.length||!s.end))return s.end(s.length-1)},Xo=function(s,e){let t=0;if(!s||!s.length)return t;for(let i=0;i<s.length;i++){const r=s.start(i),n=s.end(i);if(!(e>n)){if(e>r&&e<=n){t+=n-e;continue}t+=n-r}}return t},Yo=(s,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(i){t+=i.duration}),(e.preloadHints||[]).forEach(function(i){i.type==="PART"&&(t+=s.partTargetDuration)}),t},so=s=>(s.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:i,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),sh=s=>{const e=s.segments&&s.segments.length&&s.segments[s.segments.length-1];return e&&e.parts||[]},rh=({preloadSegment:s})=>{if(!s)return;const{parts:e,preloadHints:t}=s;let i=(t||[]).reduce((r,n)=>r+(n.type==="PART"?1:0),0);return i+=e&&e.length?e.length:0,i},nh=(s,e)=>{if(e.endList)return 0;if(s&&s.suggestedPresentationDelay)return s.suggestedPresentationDelay;const t=sh(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},A1=function(s,e){let t=0,i=e-s.mediaSequence,r=s.segments[i];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(;i--;){if(r=s.segments[i],typeof r.end<"u")return{result:t+r.end,precise:!0};if(t+=Yo(s,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},w1=function(s,e){let t=0,i,r=e-s.mediaSequence;for(;r<s.segments.length;r++){if(i=s.segments[r],typeof i.start<"u")return{result:i.start-t,precise:!0};if(t+=Yo(s,i),typeof i.end<"u")return{result:i.end-t,precise:!0}}return{result:-1,precise:!1}},ah=function(s,e,t){if(typeof e>"u"&&(e=s.mediaSequence+s.segments.length),e<s.mediaSequence)return 0;const i=A1(s,e);if(i.precise)return i.result;const r=w1(s,e);return r.precise?r.result:i.result+t},oh=function(s,e,t){if(!s)return 0;if(typeof t!="number"&&(t=0),typeof e>"u"){if(s.totalDuration)return s.totalDuration;if(!s.endList)return w.Infinity}return ah(s,e,t)},or=function({defaultDuration:s,durationList:e,startIndex:t,endIndex:i}){let r=0;if(t>i&&([t,i]=[i,t]),t<0){for(let n=t;n<Math.min(0,i);n++)r+=s;t=0}for(let n=t;n<i;n++)r+=e[n].duration;return r},lh=function(s,e,t,i){if(!s||!s.segments)return null;if(s.endList)return oh(s);if(e===null)return null;e=e||0;let r=ah(s,s.mediaSequence+s.segments.length,e);return t&&(i=typeof i=="number"?i:nh(null,s),r-=i),Math.max(0,r)},D1=function(s,e,t){const r=e||0;let n=lh(s,e,!0,t);return n===null?Ye():(n<r&&(n=r),Ye(r,n))},k1=function({playlist:s,currentTime:e,startingSegmentIndex:t,startingPartIndex:i,startTime:r,exactManifestTimings:n}){let a=e-r;const l=so(s);let c=0;for(let f=0;f<l.length;f++){const g=l[f];if(t===g.segmentIndex&&!(typeof i=="number"&&typeof g.partIndex=="number"&&i!==g.partIndex)){c=f;break}}if(a<0){if(c>0)for(let f=c-1;f>=0;f--){const g=l[f];if(a+=g.duration,n){if(a<0)continue}else if(a+Gt<=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r-or({defaultDuration:s.targetDuration,durationList:l,startIndex:c,endIndex:f})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e}}if(c<0){for(let f=c;f<0;f++)if(a-=s.targetDuration,a<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e};c=0}for(let f=c;f<l.length;f++){const g=l[f];a-=g.duration;const y=g.duration>Gt,k=a===0,E=y&&a+Gt>=0;if(!((k||E)&&f!==l.length-1)){if(n){if(a>0)continue}else if(a-Gt>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r+or({defaultDuration:s.targetDuration,durationList:l,startIndex:c,endIndex:f})}}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:e}},uh=function(s){return s.excludeUntil&&s.excludeUntil>Date.now()},Ko=function(s){return s.excludeUntil&&s.excludeUntil===1/0},Gn=function(s){const e=uh(s);return!s.disabled&&!e},j1=function(s){return s.disabled},I1=function(s){for(let e=0;e<s.segments.length;e++)if(s.segments[e].key)return!0;return!1},ch=function(s,e){return e.attributes&&e.attributes[s]},P1=function(s,e,t,i=0){return ch("BANDWIDTH",t)?(s*t.attributes.BANDWIDTH-i*8)/e:NaN},ro=(s,e)=>{if(s.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return s.playlists.filter(i=>Gn(i)?(i.attributes.BANDWIDTH||0)<t:!1).length===0},Qo=(s,e)=>!s&&!e||!s&&e||s&&!e?!1:!!(s===e||s.id&&e.id&&s.id===e.id||s.resolvedUri&&e.resolvedUri&&s.resolvedUri===e.resolvedUri||s.uri&&e.uri&&s.uri===e.uri),Ku=function(s,e){const t=s&&s.mediaGroups&&s.mediaGroups.AUDIO||{};let i=!1;for(const r in t){for(const n in t[r])if(i=e(t[r][n]),i)break;if(i)break}return!!i},_r=s=>{if(!s||!s.playlists||!s.playlists.length)return Ku(s,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;e<s.playlists.length;e++){const t=s.playlists[e],i=t.attributes&&t.attributes.CODECS;if(!(i&&i.split(",").every(n=>xc(n))||Ku(s,n=>Qo(t,n))))return!1}return!0};var ft={liveEdgeDelay:nh,duration:oh,seekable:D1,getMediaInfoForTime:k1,isEnabled:Gn,isDisabled:j1,isExcluded:uh,isIncompatible:Ko,playlistEnd:lh,isAes:I1,hasAttribute:ch,estimateSegmentRequestTime:P1,isLowestEnabledRendition:ro,isAudioOnly:_r,playlistMatch:Qo,segmentDurationWithParts:Yo};const{log:dh}=B,as=(s,e)=>`${s}-${e}`,hh=(s,e,t)=>`placeholder-uri-${s}-${e}-${t}`,L1=({onwarn:s,oninfo:e,manifestString:t,customTagParsers:i=[],customTagMappers:r=[],llhls:n})=>{const a=new bm;s&&a.on("warn",s),e&&a.on("info",e),i.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(g){f.hasOwnProperty(g)&&delete f[g]})})),!l.targetDuration){let f=10;l.segments&&l.segments.length&&(f=l.segments.reduce((g,y)=>Math.max(g,y.duration),0)),s&&s({message:`manifest has no targetDuration defaulting to ${f}`}),l.targetDuration=f}const c=sh(l);if(c.length&&!l.partTargetDuration){const f=c.reduce((g,y)=>Math.max(g,y.duration),0);s&&(s({message:`manifest has no partTargetDuration defaulting to ${f}`}),dh.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},As=(s,e)=>{s.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(s.mediaGroups[t])for(const i in s.mediaGroups[t])for(const r in s.mediaGroups[t][i]){const n=s.mediaGroups[t][i][r];e(n,t,i,r)}})},fh=({playlist:s,uri:e,id:t})=>{s.id=t,s.playlistErrors_=0,e&&(s.uri=e),s.attributes=s.attributes||{}},O1=s=>{let e=s.playlists.length;for(;e--;){const t=s.playlists[e];fh({playlist:t,id:as(e,t.uri)}),t.resolvedUri=ht(s.uri,t.uri),s.playlists[t.id]=t,s.playlists[t.uri]=t,t.attributes.BANDWIDTH||dh.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},M1=s=>{As(s,e=>{e.uri&&(e.resolvedUri=ht(s.uri,e.uri))})},R1=(s,e)=>{const t=as(0,e),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:w.location.href,resolvedUri:w.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return i.playlists[t]=i.playlists[0],i.playlists[e]=i.playlists[0],i},ph=(s,e,t=hh)=>{s.uri=e;for(let r=0;r<s.playlists.length;r++)if(!s.playlists[r].uri){const n=`placeholder-uri-${r}`;s.playlists[r].uri=n}const i=_r(s);As(s,(r,n,a,l)=>{if(!r.playlists||!r.playlists.length){if(i&&n==="AUDIO"&&!r.uri)for(let c=0;c<s.playlists.length;c++){const f=s.playlists[c];if(f.attributes&&f.attributes.AUDIO&&f.attributes.AUDIO===a)return}r.playlists=[Ue({},r)]}r.playlists.forEach(function(c,f){const g=t(n,a,l,c),y=as(f,g);c.uri?c.resolvedUri=c.resolvedUri||ht(s.uri,c.uri):(c.uri=f===0?g:y,c.resolvedUri=c.uri),c.id=c.id||y,c.attributes=c.attributes||{},s.playlists[c.id]=c,s.playlists[c.uri]=c})}),O1(s),M1(s)};class Qu{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,i=t.startDate.getTime();this.trimProcessedDateRanges_(i),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((i,r)=>{if(!this.processedDateRanges_.has(r)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),!!i.class))if(e[i.class]){const n=e[i.class].push(i);i.classListIndex=n-1}else e[i.class]=[i],i.classListIndex=0});for(const i of t){const r=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&r[i.classListIndex+1]?i.endTime=r[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((i,r)=>{i.startDate.getTime()<e&&this.processedDateRanges_.delete(r)})}}const mh=22,Vi=({requestType:s,request:e,error:t,parseFailure:i})=>{const r=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:s},l=r&&!n||i;if(t&&n)a.error=Ue({},t),a.errorType=B.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=B.Error.NetworkRequestAborted;else if(e.timedout)a.errorType=B.Error.NetworkRequestTimeout;else if(l){const c=i?B.Error.NetworkBodyParserFailed:B.Error.NetworkBadStatus;a.errorType=c,a.status=e.status,a.headers=e.headers}return a},N1=It("CodecUtils"),gh=function(s){const e=s.attributes||{};if(e.CODECS)return Ht(e.CODECS)},vh=(s,e)=>{const t=e.attributes||{};return s&&s.mediaGroups&&s.mediaGroups.AUDIO&&t.AUDIO&&s.mediaGroups.AUDIO[t.AUDIO]},B1=(s,e)=>{if(!vh(s,e))return!0;const t=e.attributes||{},i=s.mediaGroups.AUDIO[t.AUDIO];for(const r in i)if(!i[r].uri&&!i[r].playlists)return!0;return!1},fr=function(s){const e={};return s.forEach(({mediaType:t,type:i,details:r})=>{e[t]=e[t]||[],e[t].push(Tc(`${i}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){N1(`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},Ju=function(s){let e=0;return s.audio&&e++,s.video&&e++,e},lr=function(s,e){const t=e.attributes||{},i=fr(gh(e)||[]);if(vh(s,e)&&!i.audio&&!B1(s,e)){const r=fr(xm(s,t.AUDIO)||[]);r.audio&&(i.audio=r.audio)}return i},{EventTarget:F1}=B,U1=(s,e)=>{if(e.endList||!e.serverControl)return s;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:i}=e;let r=e.mediaSequence+e.segments.length;if(i){const n=i.parts||[],a=rh(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 i=new w.URL(s);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&i.searchParams.set(r,t[r])}),s=i.toString()}return s},V1=(s,e)=>{if(!s)return e;const t=Se(s,e);if(s.preloadHints&&!e.preloadHints&&delete t.preloadHints,s.parts&&!e.parts)delete t.parts;else if(s.parts&&e.parts)for(let i=0;i<e.parts.length;i++)s.parts&&s.parts[i]&&(t.parts[i]=Se(s.parts[i],e.parts[i]));return!s.skipped&&e.skipped&&(t.skipped=!1),s.preload&&!e.preload&&(t.preload=!1),t},q1=(s,e,t)=>{const i=s.slice(),r=e.slice();t=t||0;const n=[];let a;for(let l=0;l<r.length;l++){const c=i[l+t],f=r[l];c?(a=c.map||a,n.push(V1(c,f))):(a&&!f.map&&(f.map=a),n.push(f))}return n},yh=(s,e)=>{!s.resolvedUri&&s.uri&&(s.resolvedUri=ht(e,s.uri)),s.key&&!s.key.resolvedUri&&(s.key.resolvedUri=ht(e,s.key.uri)),s.map&&!s.map.resolvedUri&&(s.map.resolvedUri=ht(e,s.map.uri)),s.map&&s.map.key&&!s.map.key.resolvedUri&&(s.map.key.resolvedUri=ht(e,s.map.key.uri)),s.parts&&s.parts.length&&s.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=ht(e,t.uri))}),s.preloadHints&&s.preloadHints.length&&s.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=ht(e,t.uri))})},_h=function(s){const e=s.segments||[],t=s.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let i=0;i<t.preloadHints.length;i++)if(t.preloadHints[i].type==="MAP")return e}t.duration=s.targetDuration,t.preload=!0,e.push(t)}return e},bh=(s,e)=>s===e||s.segments&&e.segments&&s.segments.length===e.segments.length&&s.endList===e.endList&&s.mediaSequence===e.mediaSequence&&s.preloadSegment===e.preloadSegment,no=(s,e,t=bh)=>{const i=Se(s,{}),r=i.playlists[e.id];if(!r||t(r,e))return null;e.segments=_h(e);const n=Se(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=q1(r.segments,e.segments,e.mediaSequence-r.mediaSequence)}n.segments.forEach(a=>{yh(a,n.resolvedUri)});for(let a=0;a<i.playlists.length;a++)i.playlists[a].id===e.id&&(i.playlists[a]=n);return i.playlists[e.id]=n,i.playlists[e.uri]=n,As(s,(a,l,c,f)=>{if(a.playlists)for(let g=0;g<a.playlists.length;g++)e.id===a.playlists[g].id&&(a.playlists[g]=n)}),i},ao=(s,e)=>{const t=s.segments||[],i=t[t.length-1],r=i&&i.parts&&i.parts[i.parts.length-1],n=r&&r.duration||i&&i.duration;return e&&n?n*1e3:(s.partTargetDuration||s.targetDuration||10)*500},Zu=(s,e,t)=>{if(!s)return;const i=[];return s.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:l}=r.attributes;i.push({id:r.id,bandwidth:n,resolution:a,codecs:l})}),{type:e,isLive:t,renditions:i}};class ts extends F1{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=It("PlaylistLoader");const{withCredentials:r=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new Qu,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=ht(this.main.uri,e.uri);this.llhls&&(t=U1(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(i,r)=>{if(this.request){if(i)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,i){const{uri:r,id:n}=t;this.request=null,i&&(this.state=i),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 i=L1({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!i.playlists||!i.playlists.length||this.excludeAudioOnlyVariants(i.playlists),i}catch(i){this.error=i,this.error.metadata={errorType:B.Error.StreamingHlsPlaylistParserError,error:i}}}excludeAudioOnlyVariants(e){const t=i=>{const r=i.attributes||{},{width:n,height:a}=r.RESOLUTION||{};if(n&&a)return!0;const l=gh(i)||[];return!!fr(l).video};e.some(t)&&e.forEach(i=>{t(i)||(i.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:t,url:i,id:r}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:i,manifestString:e});a.lastRequest=Date.now(),fh({playlist:a,uri:i,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=Zu(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),w.clearTimeout(this.mediaUpdateTimeout),w.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Qu,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(w.clearTimeout(this.finalRenditionTimeout),t){const l=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=w.setTimeout(this.media.bind(this,e,!1),l);return}const i=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"),i==="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,c)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Tn(e.resolvedUri,c),l)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:c.responseText,url:e.uri,id:e.id}),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(w.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&&(w.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const i=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=w.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},i);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(w.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=w.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=w.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,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:Vi({requestType:i.requestType,request:i,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=Tn(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=Zu(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,ph(this.main,this.srcUri()),e.playlists.forEach(i=>{i.segments=_h(i),i.segments.forEach(r=>{yh(r,i.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||w.location.href;this.main=R1(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,r=e.ID;let n=i.playlists.length;for(;n--;){const a=i.playlists[n];if(a.attributes["PATHWAY-ID"]===r){const l=a.resolvedUri,c=a.id;if(t){const f=this.createCloneURI_(a.resolvedUri,e),g=as(r,f),y=this.createCloneAttributes_(r,a.attributes),k=this.createClonePlaylist_(a,g,e,y);i.playlists[n]=k,i.playlists[g]=k,i.playlists[f]=k}else i.playlists.splice(n,1);delete i.playlists[c],delete i.playlists[l]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!i.mediaGroups[n]||!i.mediaGroups[n][r])){for(const a in i.mediaGroups[n])if(a===r){for(const l in i.mediaGroups[n][a])i.mediaGroups[n][a][l].playlists.forEach((f,g)=>{const y=i.playlists[f.id],k=y.id,E=y.resolvedUri;delete i.playlists[k],delete i.playlists[E]});delete i.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,r=i.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=as(e.ID,n),l=this.createCloneAttributes_(e.ID,t.attributes),c=this.createClonePlaylist_(t,a,e,l);i.playlists[r]=c,i.playlists[a]=c,i.playlists[n]=c,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=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===i)r.mediaGroups[n][t]={};else continue;for(const l in r.mediaGroups[n][a]){const c=r.mediaGroups[n][a][l];r.mediaGroups[n][t][l]=Ue({},c);const f=r.mediaGroups[n][t][l],g=this.createCloneURI_(c.resolvedUri,e);f.resolvedUri=g,f.uri=g,f.playlists=[],c.playlists.forEach((y,k)=>{const E=r.playlists[y.id],L=hh(n,t,l),_=as(t,L);if(E&&!r.playlists[_]){const I=this.createClonePlaylist_(E,_,e),N=I.resolvedUri;r.playlists[_]=I,r.playlists[N]=I}f.playlists[k]=this.createClonePlaylist_(y,_,e)})}}})}createClonePlaylist_(e,t,i,r){const n=this.createCloneURI_(e.resolvedUri,i),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),Se(e,a)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))i.searchParams.set(n,r[n]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(i[r]=e)}),i}getKeyIdSet(e){const t=new Set;if(!e||!e.contentProtection)return t;for(const i in e.contentProtection)if(e.contentProtection[i]&&e.contentProtection[i].attributes&&e.contentProtection[i].attributes.keyId){const r=e.contentProtection[i].attributes.keyId;t.add(r.toLowerCase())}return t}}const oo=function(s,e,t,i){const r=s.responseType==="arraybuffer"?s.response:s.responseText;!e&&r&&(s.responseTime=Date.now(),s.roundTripTime=s.responseTime-s.requestTime,s.bytesReceived=r.byteLength||r.length,s.bandwidth||(s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3))),t.headers&&(s.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(s.timedout=!0),!e&&!s.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(s&&(r||s.responseText)))),i(e,s)},H1=(s,e)=>{if(!s||!s.size)return;let t=e;return s.forEach(i=>{t=i(t)}),t},z1=(s,e,t,i)=>{!s||!s.size||s.forEach(r=>{r(e,t,i)})},Th=function(){const s=function e(t,i){t=Se({timeout:45e3},t);const r=e.beforeRequest||B.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||B.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||B.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(B.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const l=B.Vhs.xhr.original===!0?B.xhr:B.Vhs.xhr,c=H1(n,t);n.delete(r);const f=l(c||t,function(y,k){return z1(a,f,y,k),oo(f,y,k,i)}),g=f.abort;return f.abort=function(){return f.aborted=!0,g.apply(f,arguments)},f.uri=t.uri,f.requestType=t.requestType,f.requestTime=Date.now(),f};return s.original=!0,s},$1=function(s){let e;const t=s.offset;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=w.BigInt(s.offset)+w.BigInt(s.length)-w.BigInt(1):e=s.offset+s.length-1,"bytes="+t+"-"+e},lo=function(s){const e={};return s.byterange&&(e.Range=$1(s.byterange)),e},G1=function(s,e){return s.start(e)+"-"+s.end(e)},W1=function(s,e){const t=s.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},X1=function(s){return s>=32&&s<126?String.fromCharCode(s):"."},xh=function(s){const e={};return Object.keys(s).forEach(t=>{const i=s[t];Cc(i)?e[t]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:e[t]=i}),e},xn=function(s){const e=s.byterange||{length:1/0,offset:0};return[e.length,e.offset,s.resolvedUri].join(",")},Sh=function(s){return s.resolvedUri},Ch=s=>{const e=Array.prototype.slice.call(s),t=16;let i="",r,n;for(let a=0;a<e.length/t;a++)r=e.slice(a*t,a*t+t).map(W1).join(""),n=e.slice(a*t,a*t+t).map(X1).join(""),i+=r+" "+n+`
183
- `;return i},Y1=({bytes:s})=>Ch(s),K1=s=>{let e="",t;for(t=0;t<s.length;t++)e+=G1(s,t)+" ";return e};var Q1=Object.freeze({__proto__:null,createTransferableMessage:xh,initSegmentId:xn,segmentKeyId:Sh,hexDump:Ch,tagDump:Y1,textRanges:K1});const Eh=.25,J1=(s,e)=>{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,r=e.videoTimingInfo.transmuxedPresentationStart+t,n=s-r;return new Date(e.dateTimeObject.getTime()+n*1e3)},Z1=s=>s.transmuxedPresentationEnd-s.transmuxedPresentationStart-s.transmuxerPrependedSeconds,e2=(s,e)=>{let t;try{t=new Date(s)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let i=e.segments[0];if(t<new Date(i.dateTimeObject))return null;for(let c=0;c<e.segments.length-1;c++){i=e.segments[c];const f=new Date(e.segments[c+1].dateTimeObject);if(t<f)break}const r=e.segments[e.segments.length-1],n=r.dateTimeObject,a=r.videoTimingInfo?Z1(r.videoTimingInfo):r.duration+r.duration*Eh,l=new Date(n.getTime()+a*1e3);return t>l?null:(t>new Date(n)&&(i=r),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:ft.duration(e,e.mediaSequence+e.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},t2=(s,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,i;for(let n=0;n<e.segments.length&&(i=e.segments[n],t=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:t+i.duration,!(s<=t));n++);const r=e.segments[e.segments.length-1];if(r.videoTimingInfo&&r.videoTimingInfo.transmuxedPresentationEnd<s)return null;if(s>t){if(s>t+r.duration*Eh)return null;i=r}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:t-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},i2=(s,e)=>{let t,i;try{t=new Date(s),i=new Date(e)}catch{}const r=t.getTime();return(i.getTime()-r)/1e3},s2=s=>{if(!s.segments||s.segments.length===0)return!1;for(let e=0;e<s.segments.length;e++)if(!s.segments[e].dateTimeObject)return!1;return!0},r2=({playlist:s,time:e=void 0,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");if(!s||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const i=t2(e,s);if(!i)return t({message:"valid programTime was not found"});if(i.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:i.estimatedStart});const r={mediaSeconds:e},n=J1(e,i.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},Ah=({programTime:s,playlist:e,retryCount:t=2,seekTo:i,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof s>"u"||!e||!i)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(!s2(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const l=e2(s,e);if(!l)return a({message:`${s} was not found in the stream`});const c=l.segment,f=i2(c.dateTimeObject,s);if(l.type==="estimate"){if(t===0)return a({message:`${s} is not buffered yet. Try again`});i(l.estimatedStart+f),n.one("seeked",()=>{Ah({programTime:s,playlist:e,retryCount:t-1,seekTo:i,pauseAfterSeek:r,tech:n,callback:a})});return}const g=c.start+f,y=()=>a(null,n.currentTime());n.one("seeked",y),r&&n.pause(),i(g)},Fa=(s,e)=>{if(s.readyState===4)return e()},n2=(s,e,t,i)=>{let r=[],n,a=!1;const l=function(y,k,E,L){return k.abort(),a=!0,t(y,k,E,L)},c=function(y,k){if(a)return;if(y)return y.metadata=Vi({requestType:i,request:k,error:y}),l(y,k,"",r);const E=k.responseText.substring(r&&r.byteLength||0,k.responseText.length);if(r=Pm(r,Ec(E,!0)),n=n||er(r),r.length<10||n&&r.length<n+2)return Fa(k,()=>l(y,k,"",r));const L=To(r);return L==="ts"&&r.length<188?Fa(k,()=>l(y,k,"",r)):!L&&r.length<376?Fa(k,()=>l(y,k,"",r)):l(null,k,L,r)},g=e({uri:s,beforeSend(y){y.overrideMimeType("text/plain; charset=x-user-defined"),y.addEventListener("progress",function({total:k,loaded:E}){return oo(y,null,{statusCode:y.status},c)})}},function(y,k){return oo(g,y,k,c)});return g},{EventTarget:a2}=B,ec=function(s,e){if(!bh(s,e)||s.sidx&&e.sidx&&(s.sidx.offset!==e.sidx.offset||s.sidx.length!==e.sidx.length))return!1;if(!s.sidx&&e.sidx||s.sidx&&!e.sidx||s.segments&&!e.segments||!s.segments&&e.segments)return!1;if(!s.segments&&!e.segments)return!0;for(let t=0;t<s.segments.length;t++){const i=s.segments[t],r=e.segments[t];if(i.uri!==r.uri)return!1;if(!i.byterange&&!r.byterange)continue;const n=i.byterange,a=r.byterange;if(n&&!a||!n&&a||n.offset!==a.offset||n.length!==a.length)return!1}return!0},o2=(s,e,t,i)=>{const r=i.attributes.NAME||t;return`placeholder-uri-${s}-${e}-${r}`},l2=({mainXml:s,srcUrl:e,clientOffset:t,sidxMapping:i,previousManifest:r})=>{const n=j0(s,{manifestUri:e,clientOffset:t,sidxMapping:i,previousManifest:r});return ph(n,e,o2),n},u2=(s,e)=>{As(s,(t,i,r,n)=>{(!e.mediaGroups[i][r]||!(n in e.mediaGroups[i][r]))&&delete s.mediaGroups[i][r][n]})},c2=(s,e,t)=>{let i=!0,r=Se(s,{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 c=Dn(a.sidx);t&&t[c]&&t[c].sidx&&yo(a,t[c].sidx,a.sidx.resolvedUri)}const l=no(r,a,ec);l&&(r=l,i=!1)}return As(e,(n,a,l,c)=>{if(n.playlists&&n.playlists.length){const f=n.playlists[0].id,g=no(r,n.playlists[0],ec);g&&(r=g,c in r.mediaGroups[a][l]||(r.mediaGroups[a][l][c]=n),r.mediaGroups[a][l][c].playlists[0]=r.playlists[f],i=!1)}}),u2(r,e),e.minimumUpdatePeriod!==s.minimumUpdatePeriod&&(i=!1),i?null:r},d2=(s,e)=>(!s.map&&!e.map||!!(s.map&&e.map&&s.map.byterange.offset===e.map.byterange.offset&&s.map.byterange.length===e.map.byterange.length))&&s.uri===e.uri&&s.byterange.offset===e.byterange.offset&&s.byterange.length===e.byterange.length,tc=(s,e)=>{const t={};for(const i in s){const n=s[i].sidx;if(n){const a=Dn(n);if(!e[a])break;const l=e[a].sidxInfo;d2(l,n)&&(t[a]=e[a])}}return t},h2=(s,e)=>{let i=tc(s.playlists,e);return As(s,(r,n,a,l)=>{if(r.playlists&&r.playlists.length){const c=r.playlists;i=Se(i,tc(c,e))}}),i};class uo extends a2{constructor(e,t,i={},r){super(),this.isPaused_=!0,this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:n=!1}=i;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=i.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_=It("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,i){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},i&&(this.state=i),this.trigger("error"),!0}addSidxSegments_(e,t,i){const r=e.sidx&&Dn(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){w.clearTimeout(this.mediaRequest_),this.mediaRequest_=w.setTimeout(()=>i(!1),0);return}const n=Tn(e.sidx.resolvedUri),a=(c,f)=>{if(this.requestErrored_(c,f,t))return;const g=this.mainPlaylistLoader_.sidxMapping_,{requestType:y}=f;let k;try{k=M0(ue(f.response).subarray(8))}catch(E){E.metadata=Vi({requestType:y,request:f,parseFailure:!0}),this.requestErrored_(E,f,t);return}return g[r]={sidxInfo:e.sidx,sidx:k},yo(e,k,e.sidx.resolvedUri),i(!0)},l="dash-sidx";this.request=n2(n,this.vhs_.xhr,(c,f,g,y)=>{if(c)return a(c,f);if(!g||g!=="mp4"){const L=g||"unknown";return a({status:f.status,message:`Unsupported ${L} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},f)}const{offset:k,length:E}=e.sidx.byterange;if(y.length>=E+k)return a(c,{response:y.subarray(k,k+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_={},w.clearTimeout(this.minimumUpdatePeriodTimeout_),w.clearTimeout(this.mediaRequest_),w.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 i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,i&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}i&&(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,w.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(),w.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(w.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,w.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const i=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=w.setTimeout(()=>this.load(),i);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_){w.clearTimeout(this.mediaRequest_),this.mediaRequest_=w.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"},(i,r)=>{if(i){const{requestType:a}=r;i.metadata=Vi({requestType:a,request:r,error:i})}if(this.requestErrored_(i,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=Tn(this.mainPlaylistLoader_.srcUrl,r),n){this.handleMain_(),this.syncClientServerClock_(()=>e(r,n));return}return e(r,n)})}syncClientServerClock_(e){const t=I0(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:ht(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,r)=>{if(!this.request)return;if(i){const{requestType:a}=r;return this.error.metadata=Vi({requestType:a,request:r,error:i}),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_(){w.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let i;try{i=l2({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:B.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(i=c2(e,i,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=i||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(i),i){const{duration:n,endList:a}=i,l=[];i.playlists.forEach(f=>{l.push({id:f.id,bandwidth:f.attributes.BANDWIDTH,resolution:f.attributes.RESOLUTION,codecs:f.attributes.CODECS})});const c={duration:n,isLive:!a,renditions:l};t.parsedManifest=c,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!i}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(w.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_=w.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_=h2(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,i=>{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,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=w.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},ao(this.media(),!!i)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(i=>({cueTime:i.start,frames:[{data:i.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const r=e.contentProtection[i].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 f2=s=>{const e=new Uint8Array(new ArrayBuffer(s.length));for(let t=0;t<s.length;t++)e[t]=s.charCodeAt(t);return e.buffer},wh=function(s){return s.on=s.addEventListener,s.off=s.removeEventListener,s},p2=function(s){try{return URL.createObjectURL(new Blob([s],{type:"application/javascript"}))}catch{const t=new BlobBuilder;return t.append(s),URL.createObjectURL(t.getBlob())}},Dh=function(s){return function(){const e=p2(s),t=wh(new Worker(e));t.objURL=e;const i=t.terminate;return t.on=t.addEventListener,t.off=t.removeEventListener,t.terminate=function(){return URL.revokeObjectURL(e),i.call(this)},t}},kh=function(s){return`var browserWorkerPolyFill = ${wh.toString()};
184
- browserWorkerPolyFill(self);
185
- `+s},jh=function(s){return s.toString().replace(/^function.+?{/,"").slice(0,-1)},m2=kh(jh(function(){var s=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(u,h){o[u]||(o[u]=[]),o[u]=o[u].concat(h)},this.off=function(u,h){var d;return o[u]?(d=o[u].indexOf(h),o[u]=o[u].slice(),o[u].splice(d,1),d>-1):!1},this.trigger=function(u){var h,d,p,m;if(h=o[u],!!h)if(arguments.length===2)for(p=h.length,d=0;d<p;++d)h[d].call(this,arguments[1]);else{for(m=[],d=arguments.length,d=1;d<arguments.length;++d)m.push(arguments[d]);for(p=h.length,d=0;d<p;++d)h[d].apply(this,m)}},this.dispose=function(){o={}}}};e.prototype.pipe=function(o){return this.on("data",function(u){o.push(u)}),this.on("done",function(u){o.flush(u)}),this.on("partialdone",function(u){o.partialFlush(u)}),this.on("endedtimeline",function(u){o.endTimeline(u)}),this.on("reset",function(u){o.reset(u)}),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,i=Math.pow(2,32),r=function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),h;return u.getBigUint64?(h=u.getBigUint64(0),h<Number.MAX_SAFE_INTEGER?Number(h):h):u.getUint32(0)*i+u.getUint32(4)},n={getUint64:r,MAX_UINT32:i},a=n.MAX_UINT32,l,c,f,g,y,k,E,L,_,I,N,R,P,$,U,V,O,G,b,C,F,z,H,Q,ie,re,Y,Z,J,te,ee,fe,me,ve,he,Ke;(function(){var o;if(H={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 H)H.hasOwnProperty(o)&&(H[o]=[o.charCodeAt(0),o.charCodeAt(1),o.charCodeAt(2),o.charCodeAt(3)]);Q=new Uint8Array([105,115,111,109]),re=new Uint8Array([97,118,99,49]),ie=new Uint8Array([0,0,0,1]),Y=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]),Z=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]),J={video:Y,audio:Z},fe=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ee=new Uint8Array([0,0,0,0,0,0,0,0]),me=new Uint8Array([0,0,0,0,0,0,0,0]),ve=me,he=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Ke=me,te=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),l=function(o){var u=[],h=0,d,p,m;for(d=1;d<arguments.length;d++)u.push(arguments[d]);for(d=u.length;d--;)h+=u[d].byteLength;for(p=new Uint8Array(h+8),m=new DataView(p.buffer,p.byteOffset,p.byteLength),m.setUint32(0,p.byteLength),p.set(o,4),d=0,h=8;d<u.length;d++)p.set(u[d],h),h+=u[d].byteLength;return p},c=function(){return l(H.dinf,l(H.dref,fe))},f=function(o){return l(H.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]))},g=function(){return l(H.ftyp,Q,ie,Q,re)},V=function(o){return l(H.hdlr,J[o])},y=function(o){return l(H.mdat,o)},U=function(o){var u=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&&(u[12]=o.samplerate>>>24&255,u[13]=o.samplerate>>>16&255,u[14]=o.samplerate>>>8&255,u[15]=o.samplerate&255),l(H.mdhd,u)},$=function(o){return l(H.mdia,U(o),V(o.type),E(o))},k=function(o){return l(H.mfhd,new Uint8Array([0,0,0,0,(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&255]))},E=function(o){return l(H.minf,o.type==="video"?l(H.vmhd,te):l(H.smhd,ee),c(),G(o))},L=function(o,u){for(var h=[],d=u.length;d--;)h[d]=C(u[d]);return l.apply(null,[H.moof,k(o)].concat(h))},_=function(o){for(var u=o.length,h=[];u--;)h[u]=R(o[u]);return l.apply(null,[H.moov,N(4294967295)].concat(h).concat(I(o)))},I=function(o){for(var u=o.length,h=[];u--;)h[u]=F(o[u]);return l.apply(null,[H.mvex].concat(h))},N=function(o){var u=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(H.mvhd,u)},O=function(o){var u=o.samples||[],h=new Uint8Array(4+u.length),d,p;for(p=0;p<u.length;p++)d=u[p].flags,h[p+4]=d.dependsOn<<4|d.isDependedOn<<2|d.hasRedundancy;return l(H.sdtp,h)},G=function(o){return l(H.stbl,b(o),l(H.stts,Ke),l(H.stsc,ve),l(H.stsz,he),l(H.stco,me))},(function(){var o,u;b=function(h){return l(H.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),h.type==="video"?o(h):u(h))},o=function(h){var d=h.sps||[],p=h.pps||[],m=[],x=[],S,A;for(S=0;S<d.length;S++)m.push((d[S].byteLength&65280)>>>8),m.push(d[S].byteLength&255),m=m.concat(Array.prototype.slice.call(d[S]));for(S=0;S<p.length;S++)x.push((p[S].byteLength&65280)>>>8),x.push(p[S].byteLength&255),x=x.concat(Array.prototype.slice.call(p[S]));if(A=[H.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(H.avcC,new Uint8Array([1,h.profileIdc,h.profileCompatibility,h.levelIdc,255].concat([d.length],m,[p.length],x))),l(H.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],h.sarRatio){var D=h.sarRatio[0],M=h.sarRatio[1];A.push(l(H.pasp,new Uint8Array([(D&4278190080)>>24,(D&16711680)>>16,(D&65280)>>8,D&255,(M&4278190080)>>24,(M&16711680)>>16,(M&65280)>>8,M&255])))}return l.apply(null,A)},u=function(h){return l(H.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))}})(),P=function(o){var u=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(H.tkhd,u)},C=function(o){var u,h,d,p,m,x,S;return u=l(H.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])),x=Math.floor(o.baseMediaDecodeTime/a),S=Math.floor(o.baseMediaDecodeTime%a),h=l(H.tfdt,new Uint8Array([1,0,0,0,x>>>24&255,x>>>16&255,x>>>8&255,x&255,S>>>24&255,S>>>16&255,S>>>8&255,S&255])),m=92,o.type==="audio"?(d=z(o,m),l(H.traf,u,h,d)):(p=O(o),d=z(o,p.length+m),l(H.traf,u,h,d,p))},R=function(o){return o.duration=o.duration||4294967295,l(H.trak,P(o),$(o))},F=function(o){var u=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"&&(u[u.length-1]=0),l(H.trex,u)},(function(){var o,u,h;h=function(d,p){var m=0,x=0,S=0,A=0;return d.length&&(d[0].duration!==void 0&&(m=1),d[0].size!==void 0&&(x=2),d[0].flags!==void 0&&(S=4),d[0].compositionTimeOffset!==void 0&&(A=8)),[0,0,m|x|S|A,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]},u=function(d,p){var m,x,S,A,D,M;for(A=d.samples||[],p+=20+16*A.length,S=h(A,p),x=new Uint8Array(S.length+A.length*16),x.set(S),m=S.length,M=0;M<A.length;M++)D=A[M],x[m++]=(D.duration&4278190080)>>>24,x[m++]=(D.duration&16711680)>>>16,x[m++]=(D.duration&65280)>>>8,x[m++]=D.duration&255,x[m++]=(D.size&4278190080)>>>24,x[m++]=(D.size&16711680)>>>16,x[m++]=(D.size&65280)>>>8,x[m++]=D.size&255,x[m++]=D.flags.isLeading<<2|D.flags.dependsOn,x[m++]=D.flags.isDependedOn<<6|D.flags.hasRedundancy<<4|D.flags.paddingValue<<1|D.flags.isNonSyncSample,x[m++]=D.flags.degradationPriority&61440,x[m++]=D.flags.degradationPriority&15,x[m++]=(D.compositionTimeOffset&4278190080)>>>24,x[m++]=(D.compositionTimeOffset&16711680)>>>16,x[m++]=(D.compositionTimeOffset&65280)>>>8,x[m++]=D.compositionTimeOffset&255;return l(H.trun,x)},o=function(d,p){var m,x,S,A,D,M;for(A=d.samples||[],p+=20+8*A.length,S=h(A,p),m=new Uint8Array(S.length+A.length*8),m.set(S),x=S.length,M=0;M<A.length;M++)D=A[M],m[x++]=(D.duration&4278190080)>>>24,m[x++]=(D.duration&16711680)>>>16,m[x++]=(D.duration&65280)>>>8,m[x++]=D.duration&255,m[x++]=(D.size&4278190080)>>>24,m[x++]=(D.size&16711680)>>>16,m[x++]=(D.size&65280)>>>8,m[x++]=D.size&255;return l(H.trun,m)},z=function(d,p){return d.type==="audio"?o(d,p):u(d,p)}})();var Ze={ftyp:g,mdat:y,moof:L,moov:_,initSegment:function(o){var u=g(),h=_(o),d;return d=new Uint8Array(u.byteLength+h.byteLength),d.set(u),d.set(h,u.byteLength),d}},qe=function(o){var u,h,d=[],p=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,d.byteLength=0,u=0;u<o.length;u++)h=o[u],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},et=function(o){var u,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,u=0;u<o.length;u++)h=o[u],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},xt=function(o){var u;return!o[0][0].keyFrame&&o.length>1&&(u=o.shift(),o.byteLength-=u.byteLength,o.nalCount-=u.nalCount,o[0][0].dts=u.dts,o[0][0].pts=u.pts,o[0][0].duration+=u.duration),o},Qe=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},nt=function(o,u){var h=Qe();return h.dataOffset=u,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},oi=function(o,u){var h,d,p,m,x,S=u||0,A=[];for(h=0;h<o.length;h++)for(m=o[h],d=0;d<m.length;d++)x=m[d],p=nt(x,S),S+=p.size,A.push(p);return A},$e=function(o){var u,h,d,p,m,x,S=0,A=o.byteLength,D=o.nalCount,M=A+4*D,W=new Uint8Array(M),ae=new DataView(W.buffer);for(u=0;u<o.length;u++)for(p=o[u],h=0;h<p.length;h++)for(m=p[h],d=0;d<m.length;d++)x=m[d],ae.setUint32(S,x.data.byteLength),S+=4,W.set(x.data,S),S+=x.data.byteLength;return W},li=function(o,u){var h,d=u||0,p=[];return h=nt(o,d),p.push(h),p},ze=function(o){var u,h,d=0,p=o.byteLength,m=o.length,x=p+4*m,S=new Uint8Array(x),A=new DataView(S.buffer);for(u=0;u<o.length;u++)h=o[u],A.setUint32(d,h.data.byteLength),d+=4,S.set(h.data,d),d+=h.data.byteLength;return S},$i={groupNalsIntoFrames:qe,groupFramesIntoGops:et,extendFirstKeyFrame:xt,generateSampleTable:oi,concatenateNalData:$e,generateSampleTableForFrame:li,concatenateNalDataForFrame:ze},mt=[33,16,5,32,164,27],St=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],_e=function(o){for(var u=[];o--;)u.push(0);return u},ke=function(o){return Object.keys(o).reduce(function(u,h){return u[h]=new Uint8Array(o[h].reduce(function(d,p){return d.concat(p)},[])),u},{})},Ie,ui=function(){if(!Ie){var o={96e3:[mt,[227,64],_e(154),[56]],88200:[mt,[231],_e(170),[56]],64e3:[mt,[248,192],_e(240),[56]],48e3:[mt,[255,192],_e(268),[55,148,128],_e(54),[112]],44100:[mt,[255,192],_e(268),[55,163,128],_e(84),[112]],32e3:[mt,[255,192],_e(268),[55,234],_e(226),[112]],24e3:[mt,[255,192],_e(268),[55,255,128],_e(268),[111,112],_e(126),[224]],16e3:[mt,[255,192],_e(268),[55,255,128],_e(268),[111,255],_e(269),[223,108],_e(195),[1,192]],12e3:[St,_e(268),[3,127,248],_e(268),[6,255,240],_e(268),[13,255,224],_e(268),[27,253,128],_e(259),[56]],11025:[St,_e(268),[3,127,248],_e(268),[6,255,240],_e(268),[13,255,224],_e(268),[27,255,192],_e(268),[55,175,128],_e(108),[112]],8e3:[St,_e(268),[3,121,16],_e(47),[7]]};Ie=ke(o)}return Ie},Jt=9e4,Ci,Ei,ci,di,Ds,ks,Gi;Ci=function(o){return o*Jt},Ei=function(o,u){return o*u},ci=function(o){return o/Jt},di=function(o,u){return o/u},Ds=function(o,u){return Ci(di(o,u))},ks=function(o,u){return Ei(ci(o),u)},Gi=function(o,u,h){return ci(h?o:o-u)};var Te={ONE_SECOND_IN_TS:Jt,secondsToVideoTs:Ci,secondsToAudioTs:Ei,videoTsToSeconds:ci,audioTsToSeconds:di,audioTsToVideoTs:Ds,videoTsToAudioTs:ks,metadataTsToSeconds:Gi},js=ui,Ai=Te,br=function(o){var u,h,d=0;for(u=0;u<o.length;u++)h=o[u],d+=h.data.byteLength;return d},Tr=function(o,u,h,d){var p,m=0,x=0,S=0,A=0,D,M,W;if(u.length&&(p=Ai.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),m=Math.ceil(Ai.ONE_SECOND_IN_TS/(o.samplerate/1024)),h&&d&&(x=p-Math.max(h,d),S=Math.floor(x/m),A=S*m),!(S<1||A>Ai.ONE_SECOND_IN_TS/2))){for(D=js()[o.samplerate],D||(D=u[0].data),M=0;M<S;M++)W=u[0],u.splice(0,0,{data:D,dts:W.dts-m,pts:W.pts-m});return o.baseMediaDecodeTime-=Math.floor(Ai.videoTsToAudioTs(A,o.samplerate)),A}},Is=function(o,u,h){return u.minSegmentDts>=h?o:(u.minSegmentDts=1/0,o.filter(function(d){return d.dts>=h?(u.minSegmentDts=Math.min(u.minSegmentDts,d.dts),u.minSegmentPts=u.minSegmentDts,!0):!1}))},hi=function(o){var u,h,d=[];for(u=0;u<o.length;u++)h=o[u],d.push({size:h.data.byteLength,duration:1024});return d},xr=function(o){var u,h,d=0,p=new Uint8Array(br(o));for(u=0;u<o.length;u++)h=o[u],p.set(h.data,d),d+=h.data.byteLength;return p},Ps={prefixWithSilence:Tr,trimAdtsFramesByEarliestDts:Is,generateSampleTable:hi,concatenateFrameData:xr},Sr=Te.ONE_SECOND_IN_TS,v=function(o,u){typeof u.pts=="number"&&(o.timelineStartInfo.pts===void 0&&(o.timelineStartInfo.pts=u.pts),o.minSegmentPts===void 0?o.minSegmentPts=u.pts:o.minSegmentPts=Math.min(o.minSegmentPts,u.pts),o.maxSegmentPts===void 0?o.maxSegmentPts=u.pts:o.maxSegmentPts=Math.max(o.maxSegmentPts,u.pts)),typeof u.dts=="number"&&(o.timelineStartInfo.dts===void 0&&(o.timelineStartInfo.dts=u.dts),o.minSegmentDts===void 0?o.minSegmentDts=u.dts:o.minSegmentDts=Math.min(o.minSegmentDts,u.dts),o.maxSegmentDts===void 0?o.maxSegmentDts=u.dts:o.maxSegmentDts=Math.max(o.maxSegmentDts,u.dts))},T=function(o){delete o.minSegmentDts,delete o.maxSegmentDts,delete o.minSegmentPts,delete o.maxSegmentPts},j=function(o,u){var h,d,p=o.minSegmentDts;return u||(p-=o.timelineStartInfo.dts),h=o.timelineStartInfo.baseMediaDecodeTime,h+=p,h=Math.max(0,h),o.type==="audio"&&(d=o.samplerate/Sr,h*=d,h=Math.floor(h)),h},q={clearDtsInfo:T,calculateTrackBaseMediaDecodeTime:j,collectDtsInfo:v},ne=4,de=128,Ae=function(o){for(var u=0,h={payloadType:-1,payloadSize:0},d=0,p=0;u<o.byteLength&&o[u]!==de;){for(;o[u]===255;)d+=255,u++;for(d+=o[u++];o[u]===255;)p+=255,u++;if(p+=o[u++],!h.payload&&d===ne){var m=String.fromCharCode(o[u+3],o[u+4],o[u+5],o[u+6]);if(m==="GA94"){h.payloadType=d,h.payloadSize=p,h.payload=o.subarray(u,u+p);break}else h.payload=void 0}u+=p,d=0,p=0}return h},tt=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)},gt=function(o,u){var h=[],d,p,m,x;if(!(u[0]&64))return h;for(p=u[0]&31,d=0;d<p;d++)m=d*3,x={type:u[m+2]&3,pts:o},u[m+2]&4&&(x.ccData=u[m+3]<<8|u[m+4],h.push(x));return h},Ft=function(o){for(var u=o.byteLength,h=[],d=1,p,m;d<u-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=u-h.length,m=new Uint8Array(p);var x=0;for(d=0;d<p;x++,d++)x===h[0]&&(x++,h.shift()),m[d]=o[x];return m},Ct={parseSei:Ae,parseUserData:tt,parseCaptionPackets:gt,discardEmulationPreventionBytes:Ft,USER_DATA_REGISTERED_ITU_T_T35:ne},Pt=t,Et=Ct,Ne=function(o){o=o||{},Ne.prototype.init.call(this),this.parse708captions_=typeof o.parse708captions=="boolean"?o.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new Pe(0,0),new Pe(0,1),new Pe(1,0),new Pe(1,1)],this.parse708captions_&&(this.cc708Stream_=new be({captionServices:o.captionServices})),this.reset(),this.ccStreams_.forEach(function(u){u.on("data",this.trigger.bind(this,"data")),u.on("partialdone",this.trigger.bind(this,"partialdone")),u.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")))};Ne.prototype=new Pt,Ne.prototype.push=function(o){var u,h,d;if(o.nalUnitType==="sei_rbsp"&&(u=Et.parseSei(o.escapedRBSP),!!u.payload&&u.payloadType===Et.USER_DATA_REGISTERED_ITU_T_T35&&(h=Et.parseUserData(u),!!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=Et.parseCaptionPackets(o.pts,h),this.captionPackets_=this.captionPackets_.concat(d),this.latestDts_!==o.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=o.dts}},Ne.prototype.flushCCStreams=function(o){this.ccStreams_.forEach(function(u){return o==="flush"?u.flush():u.partialFlush()},this)},Ne.prototype.flushStream=function(o){if(!this.captionPackets_.length){this.flushCCStreams(o);return}this.captionPackets_.forEach(function(u,h){u.presortIndex=h}),this.captionPackets_.sort(function(u,h){return u.pts===h.pts?u.presortIndex-h.presortIndex:u.pts-h.pts}),this.captionPackets_.forEach(function(u){u.type<2?this.dispatchCea608Packet(u):this.dispatchCea708Packet(u)},this),this.captionPackets_.length=0,this.flushCCStreams(o)},Ne.prototype.flush=function(){return this.flushStream("flush")},Ne.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Ne.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(o){o.reset()})},Ne.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)},Ne.prototype.setsChannel1Active=function(o){return(o.ccData&30720)===4096},Ne.prototype.setsChannel2Active=function(o){return(o.ccData&30720)===6144},Ne.prototype.setsTextOrXDSActive=function(o){return(o.ccData&28928)===256||(o.ccData&30974)===4138||(o.ccData&30974)===6186},Ne.prototype.dispatchCea708Packet=function(o){this.parse708captions_&&this.cc708Stream_.push(o)};var At={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},Zt=function(o){var u=At[o]||o;return o&4096&&o===u?"":String.fromCharCode(u)},Ut=function(o){return 32<=o&&o<=127||160<=o&&o<=255},we=function(o){this.windowNum=o,this.reset()};we.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},we.prototype.getText=function(){return this.rows.join(`
186
- `)},we.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},we.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--},we.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},we.prototype.addText=function(o){this.rows[this.rowIdx]+=o},we.prototype.backspace=function(){if(!this.isEmpty()){var o=this.rows[this.rowIdx];this.rows[this.rowIdx]=o.substr(0,o.length-1)}};var wi=function(o,u,h){this.serviceNum=o,this.text="",this.currentWindow=new we(-1),this.windows=[],this.stream=h,typeof u=="string"&&this.createTextDecoder(u)};wi.prototype.init=function(o,u){this.startPts=o;for(var h=0;h<8;h++)this.windows[h]=new we(h),typeof u=="function"&&(this.windows[h].beforeRowOverflow=u)},wi.prototype.setCurrentWindow=function(o){this.currentWindow=this.windows[o]},wi.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(u){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+o+" encoding. "+u})}};var be=function(o){o=o||{},be.prototype.init.call(this);var u=this,h=o.captionServices||{},d={},p;Object.keys(h).forEach(m=>{p=h[m],/^SERVICE/.test(m)&&(d[m]=p.encoding)}),this.serviceEncodings=d,this.current708Packet=null,this.services={},this.push=function(m){m.type===3?(u.new708Packet(),u.add708Bytes(m)):(u.current708Packet===null&&u.new708Packet(),u.add708Bytes(m))}};be.prototype=new Pt,be.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},be.prototype.add708Bytes=function(o){var u=o.ccData,h=u>>>8,d=u&255;this.current708Packet.ptsVals.push(o.pts),this.current708Packet.data.push(h),this.current708Packet.data.push(d)},be.prototype.push708Packet=function(){var o=this.current708Packet,u=o.data,h=null,d=null,p=0,m=u[p++];for(o.seq=m>>6,o.sizeCode=m&63;p<u.length;p++)m=u[p++],h=m>>5,d=m&31,h===7&&d>0&&(m=u[p++],h=m),this.pushServiceBlock(h,p,d),d>0&&(p+=d-1)},be.prototype.pushServiceBlock=function(o,u,h){var d,p=u,m=this.current708Packet.data,x=this.services[o];for(x||(x=this.initService(o,p));p<u+h&&p<m.length;p++)d=m[p],Ut(d)?p=this.handleText(p,x):d===24?p=this.multiByteCharacter(p,x):d===16?p=this.extendedCommands(p,x):128<=d&&d<=135?p=this.setCurrentWindow(p,x):152<=d&&d<=159?p=this.defineWindow(p,x):d===136?p=this.clearWindows(p,x):d===140?p=this.deleteWindows(p,x):d===137?p=this.displayWindows(p,x):d===138?p=this.hideWindows(p,x):d===139?p=this.toggleWindows(p,x):d===151?p=this.setWindowAttributes(p,x):d===144?p=this.setPenAttributes(p,x):d===145?p=this.setPenColor(p,x):d===146?p=this.setPenLocation(p,x):d===143?x=this.reset(p,x):d===8?x.currentWindow.backspace():d===12?x.currentWindow.clearText():d===13?x.currentWindow.pendingNewLine=!0:d===14?x.currentWindow.clearText():d===141&&p++},be.prototype.extendedCommands=function(o,u){var h=this.current708Packet.data,d=h[++o];return Ut(d)&&(o=this.handleText(o,u,{isExtended:!0})),o},be.prototype.getPts=function(o){return this.current708Packet.ptsVals[Math.floor(o/2)]},be.prototype.initService=function(o,u){var d="SERVICE"+o,h=this,d,p;return d in this.serviceEncodings&&(p=this.serviceEncodings[d]),this.services[o]=new wi(o,p,h),this.services[o].init(this.getPts(u),function(m){h.flushDisplayed(m,h.services[o])}),this.services[o]},be.prototype.handleText=function(o,u,h){var d=h&&h.isExtended,p=h&&h.isMultiByte,m=this.current708Packet.data,x=d?4096:0,S=m[o],A=m[o+1],D=u.currentWindow,M,W;function ae(K){return K.map(le=>("0"+(le&255).toString(16)).slice(-2)).join("")}if(p?(W=[S,A],o++):W=[S],u.textDecoder_&&!d)M=u.textDecoder_.decode(new Uint8Array(W));else if(p){const K=ae(W);M=String.fromCharCode(parseInt(K,16))}else M=Zt(x|S);return D.pendingNewLine&&!D.isEmpty()&&D.newLine(this.getPts(o)),D.pendingNewLine=!1,D.addText(M),o},be.prototype.multiByteCharacter=function(o,u){var h=this.current708Packet.data,d=h[o+1],p=h[o+2];return Ut(d)&&Ut(p)&&(o=this.handleText(++o,u,{isMultiByte:!0})),o},be.prototype.setCurrentWindow=function(o,u){var h=this.current708Packet.data,d=h[o],p=d&7;return u.setCurrentWindow(p),o},be.prototype.defineWindow=function(o,u){var h=this.current708Packet.data,d=h[o],p=d&7;u.setCurrentWindow(p);var m=u.currentWindow;return d=h[++o],m.visible=(d&32)>>5,m.rowLock=(d&16)>>4,m.columnLock=(d&8)>>3,m.priority=d&7,d=h[++o],m.relativePositioning=(d&128)>>7,m.anchorVertical=d&127,d=h[++o],m.anchorHorizontal=d,d=h[++o],m.anchorPoint=(d&240)>>4,m.rowCount=d&15,d=h[++o],m.columnCount=d&63,d=h[++o],m.windowStyle=(d&56)>>3,m.penStyle=d&7,m.virtualRowCount=m.rowCount+1,o},be.prototype.setWindowAttributes=function(o,u){var h=this.current708Packet.data,d=h[o],p=u.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},be.prototype.flushDisplayed=function(o,u){for(var h=[],d=0;d<8;d++)u.windows[d].visible&&!u.windows[d].isEmpty()&&h.push(u.windows[d].getText());u.endPts=o,u.text=h.join(`
180
+ `)}}li(1,Z),Z.VERSION=In,Z.options=X.prototype.options_,Z.getPlayers=()=>X.players,Z.getPlayer=e=>{let t=X.players,n;if(typeof e==`string`){let r=jc(e),i=t[r];if(i)return i;n=ti(`#`+r)}else n=e;if(jr(n)){let{player:e,playerId:r}=n;if(e||t[r])return e||t[r]}},Z.getAllPlayers=()=>Object.keys(X.players).map(e=>X.players[e]).filter(Boolean),Z.players=X.players,Z.getComponent=K.getComponent,Z.registerComponent=(e,t)=>(J.isTech(t)&&B.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),K.registerComponent.call(K,e,t)),Z.getTech=J.getTech,Z.registerTech=J.registerTech,Z.use=Ga,Object.defineProperty(Z,`middleware`,{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Z.middleware,`TERMINATOR`,{value:Wa,writeable:!1,enumerable:!0}),Z.browser=Dr,Z.obj=rr,Z.mergeOptions=kc(9,`videojs.mergeOptions`,`videojs.obj.merge`,H),Z.defineLazyProperty=kc(9,`videojs.defineLazyProperty`,`videojs.obj.defineLazyProperty`,nr),Z.bind=kc(9,`videojs.bind`,`native Function.prototype.bind`,G),Z.registerPlugin=Dc.registerPlugin,Z.deregisterPlugin=Dc.deregisterPlugin,Z.plugin=(e,t)=>(B.warn(`videojs.plugin() is deprecated; use videojs.registerPlugin() instead`),Dc.registerPlugin(e,t)),Z.getPlugins=Dc.getPlugins,Z.getPlugin=Dc.getPlugin,Z.getPluginVersion=Dc.getPluginVersion,Z.addLanguage=function(e,t){return e=(``+e).toLowerCase(),Z.options.languages=H(Z.options.languages,{[e]:t}),Z.options.languages[e]},Z.log=B,Z.createLogger=Yn,Z.time=oa,Z.createTimeRange=kc(9,`videojs.createTimeRange`,`videojs.time.createTimeRanges`,ea),Z.createTimeRanges=kc(9,`videojs.createTimeRanges`,`videojs.time.createTimeRanges`,ea),Z.formatTime=kc(9,`videojs.formatTime`,`videojs.time.formatTime`,aa),Z.setFormatTime=kc(9,`videojs.setFormatTime`,`videojs.time.setFormatTime`,ra),Z.resetFormatTime=kc(9,`videojs.resetFormatTime`,`videojs.time.resetFormatTime`,ia),Z.parseUrl=kc(9,`videojs.parseUrl`,`videojs.url.parseUrl`,Da),Z.isCrossOrigin=kc(9,`videojs.isCrossOrigin`,`videojs.url.isCrossOrigin`,Aa),Z.EventTarget=Ni,Z.any=Ei,Z.on=Si,Z.one=Ti,Z.off=Ci,Z.trigger=wi,Z.xhr=x.default,Z.TrackList=ma,Z.TextTrack=Pa,Z.TextTrackList=ya,Z.AudioTrack=Fa,Z.AudioTrackList=ga,Z.VideoTrack=Ia,Z.VideoTrackList=va,[`isEl`,`isTextNode`,`createEl`,`hasClass`,`addClass`,`removeClass`,`toggleClass`,`setAttributes`,`getAttributes`,`emptyEl`,`appendContent`,`insertContent`].forEach(e=>{Z[e]=function(){return B.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),ai[e].apply(null,arguments)}}),Z.computedStyle=kc(9,`videojs.computedStyle`,`videojs.dom.computedStyle`,ri),Z.dom=ai,Z.fn=ji,Z.num=zo,Z.str=Xi,Z.url=ja,Z.Error=Ac;var Mc=class{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(e){t.enabled_(e)}}),t}},Nc=class extends Z.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;let n=this.levels_.length;return t=new Mc(e),``+n in this||Object.defineProperty(this,n,{get(){return this.levels_[n]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:`addqualitylevel`}),t}removeQualityLevel(e){let t=null;for(let n=0,r=this.length;n<r;n++)if(this[n]===e){t=this.levels_.splice(n,1)[0],this.selectedIndex_===n?this.selectedIndex_=-1:this.selectedIndex_>n&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:`removequalitylevel`}),t}getQualityLevelById(e){for(let t=0,n=this.length;t<n;t++){let n=this[t];if(n.id===e)return n}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}};Nc.prototype.allowedEvents_={change:`change`,addqualitylevel:`addqualitylevel`,removequalitylevel:`removequalitylevel`};for(let e in Nc.prototype.allowedEvents_)Nc.prototype[`on`+e]=null;var Pc=`4.1.0`,Fc=function(e,t){let n=e.qualityLevels,r=new Nc,i=function(){r.dispose(),e.qualityLevels=n,e.off(`dispose`,i)};return e.on(`dispose`,i),e.qualityLevels=()=>r,e.qualityLevels.VERSION=Pc,r},Ic=function(e){return Fc(this,Z.obj.merge({},e))};Z.registerPlugin(`qualityLevels`,Ic),Ic.VERSION=Pc;var Lc=E,Rc=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,zc=e=>Z.log.debug?Z.log.debug.bind(Z,`VHS:`,`${e} >`):function(){};function Q(...e){let t=Z.obj||Z;return(t.merge||t.mergeOptions).apply(t,e)}function Bc(...e){let t=Z.time||Z;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}function Vc(e){if(e.length===0)return`Buffered Ranges are empty`;let t=`Buffered Ranges:
181
+ `;for(let n=0;n<e.length;n++){let r=e.start(n),i=e.end(n);t+=`${r} --> ${i}. Duration (${i-r})\n`}return t}var Hc=1/30,Uc=Hc*3,Wc=function(e,t){let n=[],r;if(e&&e.length)for(r=0;r<e.length;r++)t(e.start(r),e.end(r))&&n.push([e.start(r),e.end(r)]);return Bc(n)},Gc=function(e,t){return Wc(e,function(e,n){return e-Uc<=t&&n+Uc>=t})},Kc=function(e,t){return Wc(e,function(e){return e-Hc>=t})},qc=function(e){if(e.length<2)return Bc();let t=[];for(let n=1;n<e.length;n++){let r=e.end(n-1),i=e.start(n);t.push([r,i])}return Bc(t)},Jc=function(e,t){let n=null,r=null,i=0,a=[],o=[];if(!e||!e.length||!t||!t.length)return Bc();let s=e.length;for(;s--;)a.push({time:e.start(s),type:`start`}),a.push({time:e.end(s),type:`end`});for(s=t.length;s--;)a.push({time:t.start(s),type:`start`}),a.push({time:t.end(s),type:`end`});for(a.sort(function(e,t){return e.time-t.time}),s=0;s<a.length;s++)a[s].type===`start`?(i++,i===2&&(n=a[s].time)):a[s].type===`end`&&(i--,i===1&&(r=a[s].time)),n!==null&&r!==null&&(o.push([n,r]),n=null,r=null);return Bc(o)},Yc=e=>{let t=[];if(!e||!e.length)return``;for(let n=0;n<e.length;n++)t.push(e.start(n)+` => `+e.end(n));return t.join(`, `)},Xc=function(e,t,n=1){return((e.length?e.end(e.length-1):0)-t)/n},Zc=e=>{let t=[];for(let n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t},Qc=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e||e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e.start(n)!==t.start(n)||e.end(n)!==t.end(n))return!0;return!1},$c=function(e){if(!(!e||!e.length||!e.end))return e.end(e.length-1)},el=function(e,t){let n=0;if(!e||!e.length)return n;for(let r=0;r<e.length;r++){let i=e.start(r),a=e.end(r);if(!(t>a)){if(t>i&&t<=a){n+=a-t;continue}n+=a-i}}return n},tl=(e,t)=>{if(!t.preload)return t.duration;let n=0;return(t.parts||[]).forEach(function(e){n+=e.duration}),(t.preloadHints||[]).forEach(function(t){t.type===`PART`&&(n+=e.partTargetDuration)}),n},nl=e=>(e.segments||[]).reduce((e,t,n)=>(t.parts?t.parts.forEach(function(r,i){e.push({duration:r.duration,segmentIndex:n,partIndex:i,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:n,partIndex:null,segment:t,part:null}),e),[]),rl=e=>{let t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},il=({preloadSegment:e})=>{if(!e)return;let{parts:t,preloadHints:n}=e,r=(n||[]).reduce((e,t)=>e+(t.type===`PART`?1:0),0);return r+=t&&t.length?t.length:0,r},al=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;let n=rl(t).length>0;return n&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:n&&t.partTargetDuration?t.partTargetDuration*3:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?t.targetDuration*3:0},ol=function(e,t){let n=0,r=t-e.mediaSequence,i=e.segments[r];if(i){if(i.start!==void 0)return{result:i.start,precise:!0};if(i.end!==void 0)return{result:i.end-i.duration,precise:!0}}for(;r--;){if(i=e.segments[r],i.end!==void 0)return{result:n+i.end,precise:!0};if(n+=tl(e,i),i.start!==void 0)return{result:n+i.start,precise:!0}}return{result:n,precise:!1}},sl=function(e,t){let n=0,r,i=t-e.mediaSequence;for(;i<e.segments.length;i++){if(r=e.segments[i],r.start!==void 0)return{result:r.start-n,precise:!0};if(n+=tl(e,r),r.end!==void 0)return{result:r.end-n,precise:!0}}return{result:-1,precise:!1}},cl=function(e,t,n){if(t===void 0&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;let r=ol(e,t);if(r.precise)return r.result;let i=sl(e,t);return i.precise?i.result:r.result+n},ll=function(e,t,n){if(!e)return 0;if(typeof n!=`number`&&(n=0),t===void 0){if(e.totalDuration)return e.totalDuration;if(!e.endList)return C.default.Infinity}return cl(e,t,n)},ul=function({defaultDuration:e,durationList:t,startIndex:n,endIndex:r}){let i=0;if(n>r&&([n,r]=[r,n]),n<0){for(let t=n;t<Math.min(0,r);t++)i+=e;n=0}for(let e=n;e<r;e++)i+=t[e].duration;return i},dl=function(e,t,n,r){if(!e||!e.segments)return null;if(e.endList)return ll(e);if(t===null)return null;t||=0;let i=cl(e,e.mediaSequence+e.segments.length,t);return n&&(r=typeof r==`number`?r:al(null,e),i-=r),Math.max(0,i)},fl=function(e,t,n){let r=t||0,i=dl(e,t,!0,n);return i===null?Bc():(i<r&&(i=r),Bc(r,i))},pl=function({playlist:e,currentTime:t,startingSegmentIndex:n,startingPartIndex:r,startTime:i,exactManifestTimings:a}){let o=t-i,s=nl(e),c=0;for(let e=0;e<s.length;e++){let t=s[e];if(n===t.segmentIndex&&!(typeof r==`number`&&typeof t.partIndex==`number`&&r!==t.partIndex)){c=e;break}}if(o<0){if(c>0)for(let t=c-1;t>=0;t--){let n=s[t];if(o+=n.duration,a){if(o<0)continue}else if(o+Hc<=0)continue;return{partIndex:n.partIndex,segmentIndex:n.segmentIndex,startTime:i-ul({defaultDuration:e.targetDuration,durationList:s,startIndex:c,endIndex:t})}}return{partIndex:s[0]&&s[0].partIndex||null,segmentIndex:s[0]&&s[0].segmentIndex||0,startTime:t}}if(c<0){for(let n=c;n<0;n++)if(o-=e.targetDuration,o<0)return{partIndex:s[0]&&s[0].partIndex||null,segmentIndex:s[0]&&s[0].segmentIndex||0,startTime:t};c=0}for(let t=c;t<s.length;t++){let n=s[t];o-=n.duration;let r=n.duration>Hc,l=o===0,u=r&&o+Hc>=0;if(!((l||u)&&t!==s.length-1)){if(a){if(o>0)continue}else if(o-Hc>=0)continue;return{partIndex:n.partIndex,segmentIndex:n.segmentIndex,startTime:i+ul({defaultDuration:e.targetDuration,durationList:s,startIndex:c,endIndex:t})}}}return{segmentIndex:s[s.length-1].segmentIndex,partIndex:s[s.length-1].partIndex,startTime:t}},ml=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},hl=function(e){return e.excludeUntil&&e.excludeUntil===1/0},gl=function(e){let t=ml(e);return!e.disabled&&!t},_l=function(e){return e.disabled},vl=function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},yl=function(e,t){return t.attributes&&t.attributes[e]},bl=function(e,t,n,r=0){return yl(`BANDWIDTH`,n)?(e*n.attributes.BANDWIDTH-r*8)/t:NaN},xl=(e,t)=>{if(e.playlists.length===1)return!0;let n=t.attributes.BANDWIDTH||Number.MAX_VALUE;return e.playlists.filter(e=>gl(e)?(e.attributes.BANDWIDTH||0)<n:!1).length===0},Sl=(e,t)=>!e&&!t||!e&&t||e&&!t?!1:!!(e===t||e.id&&t.id&&e.id===t.id||e.resolvedUri&&t.resolvedUri&&e.resolvedUri===t.resolvedUri||e.uri&&t.uri&&e.uri===t.uri),Cl=function(e,t){let n=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},r=!1;for(let e in n){for(let i in n[e])if(r=t(n[e][i]),r)break;if(r)break}return!!r},wl=e=>{if(!e||!e.playlists||!e.playlists.length)return Cl(e,e=>e.playlists&&e.playlists.length||e.uri);for(let t=0;t<e.playlists.length;t++){let n=e.playlists[t],r=n.attributes&&n.attributes.CODECS;if(!(r&&r.split(`,`).every(e=>ge(e)))&&!Cl(e,e=>Sl(n,e)))return!1}return!0},Tl={liveEdgeDelay:al,duration:ll,seekable:fl,getMediaInfoForTime:pl,isEnabled:gl,isDisabled:_l,isExcluded:ml,isIncompatible:hl,playlistEnd:dl,isAes:vl,hasAttribute:yl,estimateSegmentRequestTime:bl,isLowestEnabledRendition:xl,isAudioOnly:wl,playlistMatch:Sl,segmentDurationWithParts:tl},{log:El}=Z,Dl=(e,t)=>`${e}-${t}`,Ol=(e,t,n)=>`placeholder-uri-${e}-${t}-${n}`,kl=({onwarn:e,oninfo:t,manifestString:n,customTagParsers:r=[],customTagMappers:i=[],llhls:a})=>{let o=new le;e&&o.on(`warn`,e),t&&o.on(`info`,t),r.forEach(e=>o.addParser(e)),i.forEach(e=>o.addTagMapper(e)),o.push(n),o.end();let s=o.manifest;if(a||([`preloadSegment`,`skip`,`serverControl`,`renditionReports`,`partInf`,`partTargetDuration`].forEach(function(e){s.hasOwnProperty(e)&&delete s[e]}),s.segments&&s.segments.forEach(function(e){[`parts`,`preloadHints`].forEach(function(t){e.hasOwnProperty(t)&&delete e[t]})})),!s.targetDuration){let t=10;s.segments&&s.segments.length&&(t=s.segments.reduce((e,t)=>Math.max(e,t.duration),0)),e&&e({message:`manifest has no targetDuration defaulting to ${t}`}),s.targetDuration=t}let c=rl(s);if(c.length&&!s.partTargetDuration){let t=c.reduce((e,t)=>Math.max(e,t.duration),0);e&&(e({message:`manifest has no partTargetDuration defaulting to ${t}`}),El.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.`)),s.partTargetDuration=t}return s},Al=(e,t)=>{e.mediaGroups&&[`AUDIO`,`SUBTITLES`].forEach(n=>{if(e.mediaGroups[n])for(let r in e.mediaGroups[n])for(let i in e.mediaGroups[n][r]){let a=e.mediaGroups[n][r][i];t(a,n,r,i)}})},jl=({playlist:e,uri:t,id:n})=>{e.id=n,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},Ml=e=>{let t=e.playlists.length;for(;t--;){let n=e.playlists[t];jl({playlist:n,id:Dl(t,n.uri)}),n.resolvedUri=Lc(e.uri,n.uri),e.playlists[n.id]=n,e.playlists[n.uri]=n,n.attributes.BANDWIDTH||El.warn(`Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.`)}},Nl=e=>{Al(e,t=>{t.uri&&(t.resolvedUri=Lc(e.uri,t.uri))})},Pl=(e,t)=>{let n=Dl(0,t),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:C.default.location.href,resolvedUri:C.default.location.href,playlists:[{uri:t,id:n,resolvedUri:t,attributes:{}}]};return r.playlists[n]=r.playlists[0],r.playlists[t]=r.playlists[0],r},Fl=(e,t,n=Ol)=>{e.uri=t;for(let t=0;t<e.playlists.length;t++)if(!e.playlists[t].uri){let n=`placeholder-uri-${t}`;e.playlists[t].uri=n}let r=wl(e);Al(e,(t,i,a,o)=>{if(!t.playlists||!t.playlists.length){if(r&&i===`AUDIO`&&!t.uri)for(let t=0;t<e.playlists.length;t++){let n=e.playlists[t];if(n.attributes&&n.attributes.AUDIO&&n.attributes.AUDIO===a)return}t.playlists=[w({},t)]}t.playlists.forEach(function(t,r){let s=n(i,a,o,t),c=Dl(r,s);t.uri?t.resolvedUri=t.resolvedUri||Lc(e.uri,t.uri):(t.uri=r===0?s:c,t.resolvedUri=t.uri),t.id=t.id||c,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t})}),Ml(e),Nl(e)},Il=class{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(this.offset_!==null||!e.length)return;let[t]=e;t.programDateTime!==void 0&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;let[t]=e,n=t.startDate.getTime();this.trimProcessedDateRanges_(n),this.pendingDateRanges_=e.reduce((e,t)=>(e.set(t.id,t),e),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];let e={},t=[];this.pendingDateRanges_.forEach((n,r)=>{this.processedDateRanges_.has(r)||(n.startTime=n.startDate.getTime()/1e3-this.offset_,n.processDateRange=()=>this.processDateRange(n),t.push(n),n.class&&(e[n.class]?n.classListIndex=e[n.class].push(n)-1:(e[n.class]=[n],n.classListIndex=0)))});for(let n of t){let t=e[n.class]||[];n.endDate?n.endTime=n.endDate.getTime()/1e3-this.offset_:n.endOnNext&&t[n.classListIndex+1]?n.endTime=t[n.classListIndex+1].startTime:n.duration?n.endTime=n.startTime+n.duration:n.plannedDuration?n.endTime=n.startTime+n.plannedDuration:n.endTime=n.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((t,n)=>{t.startDate.getTime()<e&&this.processedDateRanges_.delete(n)})}},Ll=22,Rl=({requestType:e,request:t,error:n,parseFailure:r})=>{let i=t.status<200||t.status>299,a=t.status>=400&&t.status<=499,o={uri:t.uri,requestType:e},s=i&&!a||r;return n&&a?(o.error=w({},n),o.errorType=Z.Error.NetworkRequestFailed):t.aborted?o.errorType=Z.Error.NetworkRequestAborted:t.timedout?o.errorType=Z.Error.NetworkRequestTimeout:s&&(o.errorType=r?Z.Error.NetworkBodyParserFailed:Z.Error.NetworkBadStatus,o.status=t.status,o.headers=t.headers),o},zl=zc(`CodecUtils`),Bl=function(e){let t=e.attributes||{};if(t.CODECS)return me(t.CODECS)},Vl=(e,t)=>{let n=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&n.AUDIO&&e.mediaGroups.AUDIO[n.AUDIO]},Hl=(e,t)=>{if(!Vl(e,t))return!0;let n=t.attributes||{},r=e.mediaGroups.AUDIO[n.AUDIO];for(let e in r)if(!r[e].uri&&!r[e].playlists)return!0;return!1},Ul=function(e){let t={};return e.forEach(({mediaType:e,type:n,details:r})=>{t[e]=t[e]||[],t[e].push(pe(`${n}${r}`))}),Object.keys(t).forEach(function(e){if(t[e].length>1){zl(`multiple ${e} codecs found as attributes: ${t[e].join(`, `)}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),t[e]=null;return}t[e]=t[e][0]}),t},Wl=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},Gl=function(e,t){let n=t.attributes||{},r=Ul(Bl(t)||[]);if(Vl(e,t)&&!r.audio&&!Hl(e,t)){let t=Ul(he(e,n.AUDIO)||[]);t.audio&&(r.audio=t.audio)}return r},{EventTarget:Kl}=Z,ql=(e,t)=>{if(t.endList||!t.serverControl)return e;let n={};if(t.serverControl.canBlockReload){let{preloadSegment:e}=t,r=t.mediaSequence+t.segments.length;if(e){let i=e.parts||[],a=il(t)-1;a>-1&&a!==i.length-1&&(n._HLS_part=a),(a>-1||i.length)&&r--}n._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(n._HLS_skip=t.serverControl.canSkipDateranges?`v2`:`YES`),Object.keys(n).length){let t=new C.default.URL(e);[`_HLS_skip`,`_HLS_msn`,`_HLS_part`].forEach(function(e){n.hasOwnProperty(e)&&t.searchParams.set(e,n[e])}),e=t.toString()}return e},Jl=(e,t)=>{if(!e)return t;let n=Q(e,t);if(e.preloadHints&&!t.preloadHints&&delete n.preloadHints,e.parts&&!t.parts)delete n.parts;else if(e.parts&&t.parts)for(let r=0;r<t.parts.length;r++)e.parts&&e.parts[r]&&(n.parts[r]=Q(e.parts[r],t.parts[r]));return!e.skipped&&t.skipped&&(n.skipped=!1),e.preload&&!t.preload&&(n.preload=!1),n},Yl=(e,t,n)=>{let r=e.slice(),i=t.slice();n||=0;let a=[],o;for(let e=0;e<i.length;e++){let t=r[e+n],s=i[e];t?(o=t.map||o,a.push(Jl(t,s))):(o&&!s.map&&(s.map=o),a.push(s))}return a},Xl=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=Lc(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Lc(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Lc(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=Lc(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(e=>{e.resolvedUri||=Lc(t,e.uri)}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(e=>{e.resolvedUri||=Lc(t,e.uri)})},Zl=function(e){let t=e.segments||[],n=e.preloadSegment;if(n&&n.parts&&n.parts.length){if(n.preloadHints){for(let e=0;e<n.preloadHints.length;e++)if(n.preloadHints[e].type===`MAP`)return t}n.duration=e.targetDuration,n.preload=!0,t.push(n)}return t},Ql=(e,t)=>e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment,$l=(e,t,n=Ql)=>{let r=Q(e,{}),i=r.playlists[t.id];if(!i||n(i,t))return null;t.segments=Zl(t);let a=Q(i,t);if(a.preloadSegment&&!t.preloadSegment&&delete a.preloadSegment,i.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++)t.segments.unshift({skipped:!0})}a.segments=Yl(i.segments,t.segments,t.mediaSequence-i.mediaSequence)}a.segments.forEach(e=>{Xl(e,a.resolvedUri)});for(let e=0;e<r.playlists.length;e++)r.playlists[e].id===t.id&&(r.playlists[e]=a);return r.playlists[t.id]=a,r.playlists[t.uri]=a,Al(e,(e,n,r,i)=>{if(e.playlists)for(let n=0;n<e.playlists.length;n++)t.id===e.playlists[n].id&&(e.playlists[n]=a)}),r},eu=(e,t)=>{let n=e.segments||[],r=n[n.length-1],i=r&&r.parts&&r.parts[r.parts.length-1],a=i&&i.duration||r&&r.duration;return t&&a?a*1e3:(e.partTargetDuration||e.targetDuration||10)*500},tu=(e,t,n)=>{if(!e)return;let r=[];return e.forEach(e=>{if(!e.attributes)return;let{BANDWIDTH:t,RESOLUTION:n,CODECS:i}=e.attributes;r.push({id:e.id,bandwidth:t,resolution:n,codecs:i})}),{type:t,isLive:n,renditions:r}},nu=class extends Kl{constructor(e,t,n={}){if(super(),!e)throw Error(`A non-empty playlist URL or object is required`);this.logger_=zc(`PlaylistLoader`);let{withCredentials:r=!1}=n;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=n.addDateRangesToTextTrack;let i=t.options_;this.customTagParsers=i&&i.customTagParsers||[],this.customTagMappers=i&&i.customTagMappers||[],this.llhls=i&&i.llhls,this.dateRangesStorage_=new Il,this.state=`HAVE_NOTHING`,this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on(`mediaupdatetimeout`,this.handleMediaupdatetimeout_),this.on(`loadedplaylist`,this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){let e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);let t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!==`HAVE_METADATA`)return;let e=this.media(),t=Lc(this.main.uri,e.uri);this.llhls&&(t=ql(t,e)),this.state=`HAVE_CURRENT_METADATA`,this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:`hls-playlist`},(e,t)=>{if(this.request){if(e)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,n){let{uri:r,id:i}=t;this.request=null,n&&(this.state=n),this.error={playlist:this.main.playlists[i],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Rl({requestType:e.requestType,request:e,error:e.error})},this.trigger(`error`)}parseManifest_({url:e,manifestString:t}){try{let n=kl({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return!n.playlists||!n.playlists.length||this.excludeAudioOnlyVariants(n.playlists),n}catch(e){this.error=e,this.error.metadata={errorType:Z.Error.StreamingHlsPlaylistParserError,error:e}}}excludeAudioOnlyVariants(e){let t=e=>{let{width:t,height:n}=(e.attributes||{}).RESOLUTION||{};return t&&n?!0:!!Ul(Bl(e)||[]).video};e.some(t)&&e.forEach(e=>{t(e)||(e.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:t,url:n,id:r}){this.request=null,this.state=`HAVE_METADATA`;let i={playlistInfo:{type:`media`,uri:n}};this.trigger({type:`playlistparsestart`,metadata:i});let a=t||this.parseManifest_({url:n,manifestString:e});a.lastRequest=Date.now(),jl({playlist:a,uri:n,id:r});let o=$l(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,o?(this.main=o,this.media_=this.main.playlists[r]):this.trigger(`playlistunchanged`),this.updateMediaUpdateTimeout_(eu(this.media(),!!o)),i.parsedPlaylist=tu(this.main.playlists,i.playlistInfo.type,!this.media_.endList),this.trigger({type:`playlistparsecomplete`,metadata:i}),this.trigger(`loadedplaylist`)}dispose(){this.trigger(`dispose`),this.stopRequest(),C.default.clearTimeout(this.mediaUpdateTimeout),C.default.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Il,this.off()}stopRequest(){if(this.request){let 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 Error(`Cannot switch media playlist from `+this.state);if(typeof e==`string`){if(!this.main.playlists[e])throw Error(`Unknown playlist URI: `+e);e=this.main.playlists[e]}if(C.default.clearTimeout(this.finalRenditionTimeout),t){let t=(e.partTargetDuration||e.targetDuration)/2*1e3||5*1e3;this.finalRenditionTimeout=C.default.setTimeout(this.media.bind(this,e,!1),t);return}let n=this.state,r=!this.media_||e.id!==this.media_.id,i=this.main.playlists[e.id];if(i&&i.endList||e.endList&&e.segments.length){this.request&&=(this.request.onreadystatechange=null,this.request.abort(),null),this.state=`HAVE_METADATA`,this.media_=e,r&&(this.trigger(`mediachanging`),n===`HAVE_MAIN_MANIFEST`?this.trigger(`loadedmetadata`):this.trigger(`mediachange`));return}if(this.updateMediaUpdateTimeout_(eu(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;let 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`},(t,r)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Rc(e.resolvedUri,r),t)return this.playlistRequestError(this.request,e,n);this.trigger({type:`playlistrequestcomplete`,metadata:a}),this.haveMetadata({playlistString:r.responseText,url:e.uri,id:e.id}),n===`HAVE_MAIN_MANIFEST`?this.trigger(`loadedmetadata`):this.trigger(`mediachange`)}})}pause(){this.mediaUpdateTimeout&&=(C.default.clearTimeout(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&&=(C.default.clearTimeout(this.mediaUpdateTimeout),null);let t=this.media();if(e){let e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5*1e3;this.mediaUpdateTimeout=C.default.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},e);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger(`mediaupdatetimeout`):this.trigger(`loadedplaylist`)}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&=(C.default.clearTimeout(this.mediaUpdateTimeout),null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=C.default.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=C.default.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}let 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,n)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:n.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:n.responseText,code:2,metadata:Rl({requestType:n.requestType,request:n,error:t})},this.state===`HAVE_NOTHING`&&(this.started=!1),this.trigger(`error`);this.trigger({type:`playlistrequestcomplete`,metadata:e}),this.src=Rc(this.src,n),this.trigger({type:`playlistparsestart`,metadata:e});let r=this.parseManifest_({manifestString:n.responseText,url:this.src});e.parsedPlaylist=tu(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,Fl(this.main,this.srcUri()),e.playlists.forEach(e=>{e.segments=Zl(e),e.segments.forEach(t=>{Xl(t,e.resolvedUri)})}),this.trigger(`loadedplaylist`),this.request||this.media(this.main.playlists[0]);return}let t=this.srcUri()||C.default.location.href;this.main=Pl(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger(`loadedmetadata`)}updateOrDeleteClone(e,t){let n=this.main,r=e.ID,i=n.playlists.length;for(;i--;){let a=n.playlists[i];if(a.attributes[`PATHWAY-ID`]===r){let o=a.resolvedUri,s=a.id;if(t){let t=this.createCloneURI_(a.resolvedUri,e),o=Dl(r,t),s=this.createCloneAttributes_(r,a.attributes),c=this.createClonePlaylist_(a,o,e,s);n.playlists[i]=c,n.playlists[o]=c,n.playlists[t]=c}else n.playlists.splice(i,1);delete n.playlists[s],delete n.playlists[o]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){let n=this.main,r=e.ID;[`AUDIO`,`SUBTITLES`,`CLOSED-CAPTIONS`].forEach(e=>{if(!(!n.mediaGroups[e]||!n.mediaGroups[e][r])){for(let t in n.mediaGroups[e])if(t===r){for(let r in n.mediaGroups[e][t])n.mediaGroups[e][t][r].playlists.forEach((e,t)=>{let r=n.playlists[e.id],i=r.id,a=r.resolvedUri;delete n.playlists[i],delete n.playlists[a]});delete n.mediaGroups[e][t]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){let n=this.main,r=n.playlists.length,i=this.createCloneURI_(t.resolvedUri,e),a=Dl(e.ID,i),o=this.createCloneAttributes_(e.ID,t.attributes),s=this.createClonePlaylist_(t,a,e,o);n.playlists[r]=s,n.playlists[a]=s,n.playlists[i]=s,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){let t=e.ID,n=e[`BASE-ID`],r=this.main;[`AUDIO`,`SUBTITLES`,`CLOSED-CAPTIONS`].forEach(i=>{if(!(!r.mediaGroups[i]||r.mediaGroups[i][t]))for(let a in r.mediaGroups[i]){if(a===n)r.mediaGroups[i][t]={};else continue;for(let n in r.mediaGroups[i][a]){let o=r.mediaGroups[i][a][n];r.mediaGroups[i][t][n]=w({},o);let s=r.mediaGroups[i][t][n],c=this.createCloneURI_(o.resolvedUri,e);s.resolvedUri=c,s.uri=c,s.playlists=[],o.playlists.forEach((a,o)=>{let c=r.playlists[a.id],l=Dl(t,Ol(i,t,n));if(c&&!r.playlists[l]){let t=this.createClonePlaylist_(c,l,e),n=t.resolvedUri;r.playlists[l]=t,r.playlists[n]=t}s.playlists[o]=this.createClonePlaylist_(a,l,e)})}}})}createClonePlaylist_(e,t,n,r){let i=this.createCloneURI_(e.resolvedUri,n),a={resolvedUri:i,uri:i,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),Q(e,a)}createCloneURI_(e,t){let n=new URL(e);n.hostname=t[`URI-REPLACEMENT`].HOST;let r=t[`URI-REPLACEMENT`].PARAMS;for(let e of Object.keys(r))n.searchParams.set(e,r[e]);return n.href}createCloneAttributes_(e,t){let n={"PATHWAY-ID":e};return[`AUDIO`,`SUBTITLES`,`CLOSED-CAPTIONS`].forEach(r=>{t[r]&&(n[r]=e)}),n}getKeyIdSet(e){let t=new Set;if(!e||!e.contentProtection)return t;for(let n in e.contentProtection)if(e.contentProtection[n]&&e.contentProtection[n].attributes&&e.contentProtection[n].attributes.keyId){let r=e.contentProtection[n].attributes.keyId;t.add(r.toLowerCase())}return t}},ru=function(e,t,n,r){let i=e.responseType===`arraybuffer`?e.response:e.responseText;!t&&i&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=i.byteLength||i.length,e.bandwidth||=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3)),n.headers&&(e.responseHeaders=n.headers),t&&t.code===`ETIMEDOUT`&&(e.timedout=!0),!t&&!e.aborted&&n.statusCode!==200&&n.statusCode!==206&&n.statusCode!==0&&(t=Error(`XHR Failed with a response of: `+(e&&(i||e.responseText)))),r(t,e)},iu=(e,t)=>{if(!e||!e.size)return;let n=t;return e.forEach(e=>{n=e(n)}),n},au=(e,t,n,r)=>{!e||!e.size||e.forEach(e=>{e(t,n,r)})},ou=function(){let e=function e(t,n){t=Q({timeout:45e3},t);let r=e.beforeRequest||Z.Vhs.xhr.beforeRequest,i=e._requestCallbackSet||Z.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||Z.Vhs.xhr._responseCallbackSet;r&&typeof r==`function`&&(Z.log.warn(`beforeRequest is deprecated, use onRequest instead.`),i.add(r));let o=Z.Vhs.xhr.original===!0?Z.xhr:Z.Vhs.xhr,s=iu(i,t);i.delete(r);let c=o(s||t,function(e,t){return au(a,c,e,t),ru(c,e,t,n)}),l=c.abort;return c.abort=function(){return c.aborted=!0,l.apply(c,arguments)},c.uri=t.uri,c.requestType=t.requestType,c.requestTime=Date.now(),c};return e.original=!0,e},su=function(e){let t,n=e.offset;return t=typeof e.offset==`bigint`||typeof e.length==`bigint`?C.default.BigInt(e.offset)+C.default.BigInt(e.length)-C.default.BigInt(1):e.offset+e.length-1,`bytes=`+n+`-`+t},cu=function(e){let t={};return e.byterange&&(t.Range=su(e.byterange)),t},lu=function(e,t){return e.start(t)+`-`+e.end(t)},uu=function(e,t){let n=e.toString(16);return`00`.substring(0,2-n.length)+n+(t%2?` `:``)},du=function(e){return e>=32&&e<126?String.fromCharCode(e):`.`},fu=function(e){let t={};return Object.keys(e).forEach(n=>{let r=e[n];we(r)?t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[n]=r}),t},pu=function(e){let t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(`,`)},mu=function(e){return e.resolvedUri},hu=e=>{let t=Array.prototype.slice.call(e),n=``,r,i;for(let e=0;e<t.length/16;e++)r=t.slice(e*16,e*16+16).map(uu).join(``),i=t.slice(e*16,e*16+16).map(du).join(``),n+=r+` `+i+`
182
+ `;return n},gu=Object.freeze({__proto__:null,createTransferableMessage:fu,initSegmentId:pu,segmentKeyId:mu,hexDump:hu,tagDump:({bytes:e})=>hu(e),textRanges:e=>{let t=``,n;for(n=0;n<e.length;n++)t+=lu(e,n)+` `;return t}}),_u=.25,vu=(e,t)=>{if(!t.dateTimeObject)return null;let n=t.videoTimingInfo.transmuxerPrependedSeconds,r=e-(t.videoTimingInfo.transmuxedPresentationStart+n);return new Date(t.dateTimeObject.getTime()+r*1e3)},yu=e=>e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds,bu=(e,t)=>{let n;try{n=new Date(e)}catch{return null}if(!t||!t.segments||t.segments.length===0)return null;let r=t.segments[0];if(n<new Date(r.dateTimeObject))return null;for(let e=0;e<t.segments.length-1;e++){r=t.segments[e];let i=new Date(t.segments[e+1].dateTimeObject);if(n<i)break}let i=t.segments[t.segments.length-1],a=i.dateTimeObject,o=i.videoTimingInfo?yu(i.videoTimingInfo):i.duration+i.duration*_u,s=new Date(a.getTime()+o*1e3);return n>s?null:(n>new Date(a)&&(r=i),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:Tl.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?`accurate`:`estimate`})},xu=(e,t)=>{if(!t||!t.segments||t.segments.length===0)return null;let n=0,r;for(let i=0;i<t.segments.length&&(r=t.segments[i],n=r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationEnd:n+r.duration,!(e<=n));i++);let i=t.segments[t.segments.length-1];if(i.videoTimingInfo&&i.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>n){if(e>n+i.duration*_u)return null;r=i}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:n-r.duration,type:r.videoTimingInfo?`accurate`:`estimate`}},Su=(e,t)=>{let n,r;try{n=new Date(e),r=new Date(t)}catch{}let i=n.getTime();return(r.getTime()-i)/1e3},Cu=e=>{if(!e.segments||e.segments.length===0)return!1;for(let t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0},wu=({playlist:e,time:t=void 0,callback:n})=>{if(!n)throw Error(`getProgramTime: callback must be provided`);if(!e||t===void 0)return n({message:`getProgramTime: playlist and time must be provided`});let r=xu(t,e);if(!r)return n({message:`valid programTime was not found`});if(r.type===`estimate`)return n({message:`Accurate programTime could not be determined. Please seek to e.seekTime and try again`,seekTime:r.estimatedStart});let i={mediaSeconds:t},a=vu(t,r.segment);return a&&(i.programDateTime=a.toISOString()),n(null,i)},Tu=({programTime:e,playlist:t,retryCount:n=2,seekTo:r,pauseAfterSeek:i=!0,tech:a,callback:o})=>{if(!o)throw Error(`seekToProgramTime: callback must be provided`);if(e===void 0||!t||!r)return o({message:`seekToProgramTime: programTime, seekTo and playlist must be provided`});if(!t.endList&&!a.hasStarted_)return o({message:`player must be playing a live stream to start buffering`});if(!Cu(t))return o({message:`programDateTime tags must be provided in the manifest `+t.resolvedUri});let s=bu(e,t);if(!s)return o({message:`${e} was not found in the stream`});let c=s.segment,l=Su(c.dateTimeObject,e);if(s.type===`estimate`){if(n===0)return o({message:`${e} is not buffered yet. Try again`});r(s.estimatedStart+l),a.one(`seeked`,()=>{Tu({programTime:e,playlist:t,retryCount:n-1,seekTo:r,pauseAfterSeek:i,tech:a,callback:o})});return}let u=c.start+l;a.one(`seeked`,()=>o(null,a.currentTime())),i&&a.pause(),r(u)},Eu=(e,t)=>{if(e.readyState===4)return t()},Du=(e,t,n,r)=>{let i=[],a,o=!1,s=function(e,t,r,i){return t.abort(),o=!0,n(e,t,r,i)},c=function(e,t){if(o)return;if(e)return e.metadata=Rl({requestType:r,request:t,error:e}),s(e,t,``,i);let n=t.responseText.substring(i&&i.byteLength||0,t.responseText.length);if(i=je(i,Ae(n,!0)),a||=cn(i),i.length<10||a&&i.length<a+2)return Eu(t,()=>s(e,t,``,i));let c=Nn(i);return c===`ts`&&i.length<188||!c&&i.length<376?Eu(t,()=>s(e,t,``,i)):s(null,t,c,i)},l=t({uri:e,beforeSend(e){e.overrideMimeType(`text/plain; charset=x-user-defined`),e.addEventListener(`progress`,function({total:t,loaded:n}){return ru(e,null,{statusCode:e.status},c)})}},function(e,t){return ru(l,e,t,c)});return l},{EventTarget:Ou}=Z,ku=function(e,t){if(!Ql(e,t)||e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length)||!e.sidx&&t.sidx||e.sidx&&!t.sidx||e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let n=0;n<e.segments.length;n++){let r=e.segments[n],i=t.segments[n];if(r.uri!==i.uri)return!1;if(!r.byterange&&!i.byterange)continue;let a=r.byterange,o=i.byterange;if(a&&!o||!a&&o||a.offset!==o.offset||a.length!==o.length)return!1}return!0},Au=(e,t,n,r)=>`placeholder-uri-${e}-${t}-${r.attributes.NAME||n}`,ju=({mainXml:e,srcUrl:t,clientOffset:n,sidxMapping:r,previousManifest:i})=>{let a=en(e,{manifestUri:t,clientOffset:n,sidxMapping:r,previousManifest:i});return Fl(a,t,Au),a},Mu=(e,t)=>{Al(e,(n,r,i,a)=>{(!t.mediaGroups[r][i]||!(a in t.mediaGroups[r][i]))&&delete e.mediaGroups[r][i][a]})},Nu=(e,t,n)=>{let r=!0,i=Q(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e<t.playlists.length;e++){let a=t.playlists[e];if(a.sidx){let e=st(a.sidx);n&&n[e]&&n[e].sidx&&Qe(a,n[e].sidx,a.sidx.resolvedUri)}let o=$l(i,a,ku);o&&(i=o,r=!1)}return Al(t,(e,t,n,a)=>{if(e.playlists&&e.playlists.length){let o=e.playlists[0].id,s=$l(i,e.playlists[0],ku);s&&(i=s,a in i.mediaGroups[t][n]||(i.mediaGroups[t][n][a]=e),i.mediaGroups[t][n][a].playlists[0]=i.playlists[o],r=!1)}}),Mu(i,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(r=!1),r?null:i},Pu=(e,t)=>(!e.map&&!t.map||!!(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length,Fu=(e,t)=>{let n={};for(let r in e){let i=e[r].sidx;if(i){let e=st(i);if(!t[e])break;let r=t[e].sidxInfo;Pu(r,i)&&(n[e]=t[e])}}return n},Iu=(e,t)=>{let n=Fu(e.playlists,t);return Al(e,(e,r,i,a)=>{if(e.playlists&&e.playlists.length){let r=e.playlists;n=Q(n,Fu(r,t))}}),n},Lu=class extends Ou{constructor(e,t,n={},r){super(),this.isPaused_=!0,this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);let{withCredentials:i=!1}=n;if(this.vhs_=t,this.withCredentials=i,this.addMetadataToTextTrack=n.addMetadataToTextTrack,!e)throw 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_=zc(`DashPlaylistLoader`),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,n){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},n&&(this.state=n),this.trigger(`error`),!0}addSidxSegments_(e,t,n){let r=e.sidx&&st(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){C.default.clearTimeout(this.mediaRequest_),this.mediaRequest_=C.default.setTimeout(()=>n(!1),0);return}let i=Rc(e.sidx.resolvedUri),a=(i,a)=>{if(this.requestErrored_(i,a,t))return;let o=this.mainPlaylistLoader_.sidxMapping_,{requestType:s}=a,c;try{c=(0,an.default)(N(a.response).subarray(8))}catch(e){e.metadata=Rl({requestType:s,request:a,parseFailure:!0}),this.requestErrored_(e,a,t);return}return o[r]={sidxInfo:e.sidx,sidx:c},Qe(e,c,e.sidx.resolvedUri),n(!0)};this.request=Du(i,this.vhs_.xhr,(t,n,r,o)=>{if(t)return a(t,n);if(!r||r!==`mp4`){let t=r||`unknown`;return a({status:n.status,message:`Unsupported ${t} container type for sidx segment at URL: ${i}`,response:``,playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},n)}let{offset:s,length:c}=e.sidx.byterange;if(o.length>=c+s)return a(t,{response:o.subarray(s,s+c),status:n.status,uri:n.uri});this.request=this.vhs_.xhr({uri:i,responseType:`arraybuffer`,requestType:`dash-sidx`,headers:cu({byterange:e.sidx.byterange})},a)},`dash-sidx`)}dispose(){this.isPaused_=!0,this.trigger(`dispose`),this.stopRequest(),this.loadedPlaylists_={},C.default.clearTimeout(this.minimumUpdatePeriodTimeout_),C.default.clearTimeout(this.mediaRequest_),C.default.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){let e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state===`HAVE_NOTHING`)throw Error(`Cannot switch media playlist from `+this.state);let t=this.state;if(typeof e==`string`){if(!this.mainPlaylistLoader_.main.playlists[e])throw Error(`Unknown playlist URI: `+e);e=this.mainPlaylistLoader_.main.playlists[e]}let n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state=`HAVE_METADATA`,this.media_=e,n&&(this.trigger(`mediachanging`),this.trigger(`mediachange`));return}n&&(this.media_&&this.trigger(`mediachanging`),this.addSidxSegments_(e,t,n=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state=`HAVE_METADATA`,this.loadedPlaylists_[t.id]=t,C.default.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(),C.default.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(C.default.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state===`HAVE_NOTHING`&&(this.started=!1)}load(e){this.isPaused_=!1,C.default.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;let t=this.media();if(e){let e=t?t.targetDuration/2*1e3:5*1e3;this.mediaUpdateTimeout=C.default.setTimeout(()=>this.load(),e);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_){C.default.clearTimeout(this.mediaRequest_),this.mediaRequest_=C.default.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){let 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`},(n,r)=>{if(n){let{requestType:e}=r;n.metadata=Rl({requestType:e,request:r,error:n})}if(this.requestErrored_(n,r)){this.state===`HAVE_NOTHING`&&(this.started=!1);return}this.trigger({type:`manifestrequestcomplete`,metadata:t});let i=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=Rc(this.mainPlaylistLoader_.srcUrl,r),i){this.handleMain_(),this.syncClientServerClock_(()=>e(r,i));return}return e(r,i)})}syncClientServerClock_(e){let t=tn(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:Lc(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:`dash-clock-sync`},(n,r)=>{if(!this.request)return;if(n){let{requestType:t}=r;return this.error.metadata=Rl({requestType:t,request:r,error:n}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let i;i=t.method===`HEAD`?!r.responseHeaders||!r.responseHeaders.date?this.mainLoaded_:Date.parse(r.responseHeaders.date):Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=i-Date.now(),e()})}haveMain_(){this.state=`HAVE_MAIN_MANIFEST`,this.isMain_?this.trigger(`loadedplaylist`):this.media_||this.media(this.childPlaylist_)}handleMain_(){C.default.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;let e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:`manifestparsestart`,metadata:t});let n;try{n=ju({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(e){this.error=e,this.error.metadata={errorType:Z.Error.StreamingDashManifestParserError,error:e},this.trigger(`error`)}e&&(n=Nu(e,n,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=n||e;let r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||n&&n.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(n),n){let{duration:e,endList:r}=n,i=[];n.playlists.forEach(e=>{i.push({id:e.id,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS})}),t.parsedManifest={duration:e,isLive:!r,renditions:i},this.trigger({type:`manifestparsecomplete`,metadata:t})}return!!n}updateMinimumUpdatePeriodTimeout_(){let e=this.mainPlaylistLoader_;e.createMupOnMedia_&&=(e.off(`loadedmetadata`,e.createMupOnMedia_),null),e.minimumUpdatePeriodTimeout_&&=(C.default.clearTimeout(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){let t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=C.default.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger(`minimumUpdatePeriod`),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&=this.mainPlaylistLoader_.main.playlists[this.media_.id],this.mainPlaylistLoader_.sidxMapping_=Iu(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,e=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw Error(`refreshMedia_ must take a media id`);this.media_&&this.isMain_&&this.handleMain_();let t=this.mainPlaylistLoader_.main.playlists,n=!this.media_||this.media_!==t[e];if(n?this.media_=t[e]:this.trigger(`playlistunchanged`),!this.mediaUpdateTimeout){let e=()=>{this.media().endList||(this.mediaUpdateTimeout=C.default.setTimeout(()=>{this.trigger(`mediaupdatetimeout`),e()},eu(this.media(),!!n)))};e()}this.trigger(`loadedplaylist`)}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){let e=this.mainPlaylistLoader_.main.eventStream.map(e=>({cueTime:e.start,frames:[{data:e.messageData}]}));this.addMetadataToTextTrack(`EventStream`,e,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){let t=new Set;for(let n in e.contentProtection){let r=e.contentProtection[n].attributes[`cenc:default_KID`];r&&t.add(r.replace(/-/g,``).toLowerCase())}return t}}},Ru={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},zu=e=>{let t=new Uint8Array(new ArrayBuffer(e.length));for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer},Bu=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},Vu=function(e){try{return URL.createObjectURL(new Blob([e],{type:`application/javascript`}))}catch{let t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}},Hu=function(e){return function(){let t=Vu(e),n=Bu(new Worker(t));n.objURL=t;let r=n.terminate;return n.on=n.addEventListener,n.off=n.removeEventListener,n.terminate=function(){return URL.revokeObjectURL(t),r.call(this)},n}},Uu=function(e){return`var browserWorkerPolyFill = ${Bu.toString()};\nbrowserWorkerPolyFill(self);
183
+ `+e},Wu=function(e){return e.toString().replace(/^function.+?{/,``).slice(0,-1)},Gu=Hu(Uu(Wu(function(){var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},t=function(){this.init=function(){var e={};this.on=function(t,n){e[t]||(e[t]=[]),e[t]=e[t].concat(n)},this.off=function(t,n){var r;return e[t]?(r=e[t].indexOf(n),e[t]=e[t].slice(),e[t].splice(r,1),r>-1):!1},this.trigger=function(t){var n=e[t],r,i,a;if(n)if(arguments.length===2)for(i=n.length,r=0;r<i;++r)n[r].call(this,arguments[1]);else{for(a=[],r=arguments.length,r=1;r<arguments.length;++r)a.push(arguments[r]);for(i=n.length,r=0;r<i;++r)n[r].apply(this,a)}},this.dispose=function(){e={}}}};t.prototype.pipe=function(e){return this.on(`data`,function(t){e.push(t)}),this.on(`done`,function(t){e.flush(t)}),this.on(`partialdone`,function(t){e.partialFlush(t)}),this.on(`endedtimeline`,function(t){e.endTimeline(t)}),this.on(`reset`,function(t){e.reset(t)}),e},t.prototype.push=function(e){this.trigger(`data`,e)},t.prototype.flush=function(e){this.trigger(`done`,e)},t.prototype.partialFlush=function(e){this.trigger(`partialdone`,e)},t.prototype.endTimeline=function(e){this.trigger(`endedtimeline`,e)},t.prototype.reset=function(e){this.trigger(`reset`,e)};var n=t,r=2**32,i={getUint64:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n;return t.getBigUint64?(n=t.getBigUint64(0),n<2**53-1?Number(n):n):t.getUint32(0)*r+t.getUint32(4)},MAX_UINT32:r},a=i.MAX_UINT32,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,ee,D,O,k,te,ne,re,ie,ae,oe,se,A,ce,le,ue;(function(){var e;if(D={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(e in D)D.hasOwnProperty(e)&&(D[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);O=new Uint8Array([105,115,111,109]),te=new Uint8Array([97,118,99,49]),k=new Uint8Array([0,0,0,1]),ne=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]),re=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]),ie={video:ne,audio:re},se=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),oe=new Uint8Array([0,0,0,0,0,0,0,0]),A=new Uint8Array([0,0,0,0,0,0,0,0]),ce=A,le=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),ue=A,ae=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(e){var t=[],n=0,r,i,a;for(r=1;r<arguments.length;r++)t.push(arguments[r]);for(r=t.length;r--;)n+=t[r].byteLength;for(i=new Uint8Array(n+8),a=new DataView(i.buffer,i.byteOffset,i.byteLength),a.setUint32(0,i.byteLength),i.set(e,4),r=0,n=8;r<t.length;r++)i.set(t[r],n),n+=t[r].byteLength;return i},s=function(){return o(D.dinf,o(D.dref,se))},c=function(e){return o(D.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,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},l=function(){return o(D.ftyp,O,k,O,te)},x=function(e){return o(D.hdlr,ie[e])},u=function(e){return o(D.mdat,e)},b=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,e.duration&255,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=e.samplerate&255),o(D.mdhd,t)},y=function(e){return o(D.mdia,b(e),x(e.type),f(e))},d=function(e){return o(D.mfhd,new Uint8Array([0,0,0,0,(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255]))},f=function(e){return o(D.minf,e.type===`video`?o(D.vmhd,ae):o(D.smhd,oe),s(),C(e))},p=function(e,t){for(var n=[],r=t.length;r--;)n[r]=T(t[r]);return o.apply(null,[D.moof,d(e)].concat(n))},m=function(e){for(var t=e.length,n=[];t--;)n[t]=_(e[t]);return o.apply(null,[D.moov,g(4294967295)].concat(n,h(e)))},h=function(e){for(var t=e.length,n=[];t--;)n[t]=E(e[t]);return o.apply(null,[D.mvex].concat(n))},g=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&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 o(D.mvhd,t)},S=function(e){var t=e.samples||[],n=new Uint8Array(4+t.length),r,i;for(i=0;i<t.length;i++)r=t[i].flags,n[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return o(D.sdtp,n)},C=function(e){return o(D.stbl,w(e),o(D.stts,ue),o(D.stsc,ce),o(D.stsz,le),o(D.stco,A))},(function(){var e,t;w=function(n){return o(D.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),n.type===`video`?e(n):t(n))},e=function(e){var t=e.sps||[],n=e.pps||[],r=[],i=[],a,s;for(a=0;a<t.length;a++)r.push((t[a].byteLength&65280)>>>8),r.push(t[a].byteLength&255),r=r.concat(Array.prototype.slice.call(t[a]));for(a=0;a<n.length;a++)i.push((n[a].byteLength&65280)>>>8),i.push(n[a].byteLength&255),i=i.concat(Array.prototype.slice.call(n[a]));if(s=[D.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,(e.width&65280)>>8,e.width&255,(e.height&65280)>>8,e.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]),o(D.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255,t.length].concat(r,[n.length],i))),o(D.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var c=e.sarRatio[0],l=e.sarRatio[1];s.push(o(D.pasp,new Uint8Array([(c&4278190080)>>24,(c&16711680)>>16,(c&65280)>>8,c&255,(l&4278190080)>>24,(l&16711680)>>16,(l&65280)>>8,l&255])))}return o.apply(null,s)},t=function(e){return o(D.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(e.channelcount&65280)>>8,e.channelcount&255,(e.samplesize&65280)>>8,e.samplesize&255,0,0,0,0,(e.samplerate&65280)>>8,e.samplerate&255,0,0]),c(e))}})(),v=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,0,(e.duration&4278190080)>>24,(e.duration&16711680)>>16,(e.duration&65280)>>8,e.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,(e.width&65280)>>8,e.width&255,0,0,(e.height&65280)>>8,e.height&255,0,0]);return o(D.tkhd,t)},T=function(e){var t=o(D.tfhd,new Uint8Array([0,0,0,58,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),n,r,i,s,c=Math.floor(e.baseMediaDecodeTime/a),l=Math.floor(e.baseMediaDecodeTime%a);return n=o(D.tfdt,new Uint8Array([1,0,0,0,c>>>24&255,c>>>16&255,c>>>8&255,c&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255])),s=92,e.type===`audio`?(r=ee(e,s),o(D.traf,t,n,r)):(i=S(e),r=ee(e,i.length+s),o(D.traf,t,n,r,i))},_=function(e){return e.duration=e.duration||4294967295,o(D.trak,v(e),y(e))},E=function(e){var t=new Uint8Array([0,0,0,0,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.type!==`video`&&(t[t.length-1]=0),o(D.trex,t)},(function(){var e,t,n=function(e,t){var n=0,r=0,i=0,a=0;return e.length&&(e[0].duration!==void 0&&(n=1),e[0].size!==void 0&&(r=2),e[0].flags!==void 0&&(i=4),e[0].compositionTimeOffset!==void 0&&(a=8)),[0,0,n|r|i|a,1,(e.length&4278190080)>>>24,(e.length&16711680)>>>16,(e.length&65280)>>>8,e.length&255,(t&4278190080)>>>24,(t&16711680)>>>16,(t&65280)>>>8,t&255]};t=function(e,t){var r,i,a,s=e.samples||[],c,l;for(t+=20+16*s.length,a=n(s,t),i=new Uint8Array(a.length+s.length*16),i.set(a),r=a.length,l=0;l<s.length;l++)c=s[l],i[r++]=(c.duration&4278190080)>>>24,i[r++]=(c.duration&16711680)>>>16,i[r++]=(c.duration&65280)>>>8,i[r++]=c.duration&255,i[r++]=(c.size&4278190080)>>>24,i[r++]=(c.size&16711680)>>>16,i[r++]=(c.size&65280)>>>8,i[r++]=c.size&255,i[r++]=c.flags.isLeading<<2|c.flags.dependsOn,i[r++]=c.flags.isDependedOn<<6|c.flags.hasRedundancy<<4|c.flags.paddingValue<<1|c.flags.isNonSyncSample,i[r++]=c.flags.degradationPriority&61440,i[r++]=c.flags.degradationPriority&15,i[r++]=(c.compositionTimeOffset&4278190080)>>>24,i[r++]=(c.compositionTimeOffset&16711680)>>>16,i[r++]=(c.compositionTimeOffset&65280)>>>8,i[r++]=c.compositionTimeOffset&255;return o(D.trun,i)},e=function(e,t){var r,i,a,s=e.samples||[],c,l;for(t+=20+8*s.length,a=n(s,t),r=new Uint8Array(a.length+s.length*8),r.set(a),i=a.length,l=0;l<s.length;l++)c=s[l],r[i++]=(c.duration&4278190080)>>>24,r[i++]=(c.duration&16711680)>>>16,r[i++]=(c.duration&65280)>>>8,r[i++]=c.duration&255,r[i++]=(c.size&4278190080)>>>24,r[i++]=(c.size&16711680)>>>16,r[i++]=(c.size&65280)>>>8,r[i++]=c.size&255;return o(D.trun,r)},ee=function(n,r){return n.type===`audio`?e(n,r):t(n,r)}})();var de={ftyp:l,mdat:u,moof:p,moov:m,initSegment:function(e){var t=l(),n=m(e),r=new Uint8Array(t.byteLength+n.byteLength);return r.set(t),r.set(n,t.byteLength),r}},fe=function(e){var t,n,r=[],i=[];for(i.byteLength=0,i.nalCount=0,i.duration=0,r.byteLength=0,t=0;t<e.length;t++)n=e[t],n.nalUnitType===`access_unit_delimiter_rbsp`?(r.length&&(r.duration=n.dts-r.dts,i.byteLength+=r.byteLength,i.nalCount+=r.length,i.duration+=r.duration,i.push(r)),r=[n],r.byteLength=n.data.byteLength,r.pts=n.pts,r.dts=n.dts):(n.nalUnitType===`slice_layer_without_partitioning_rbsp_idr`&&(r.keyFrame=!0),r.duration=n.dts-r.dts,r.byteLength+=n.data.byteLength,r.push(n));return i.length&&(!r.duration||r.duration<=0)&&(r.duration=i[i.length-1].duration),i.byteLength+=r.byteLength,i.nalCount+=r.length,i.duration+=r.duration,i.push(r),i},pe=function(e){var t,n,r=[],i=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,i.byteLength=0,i.nalCount=0,i.duration=0,i.pts=e[0].pts,i.dts=e[0].dts,t=0;t<e.length;t++)n=e[t],n.keyFrame?(r.length&&(i.push(r),i.byteLength+=r.byteLength,i.nalCount+=r.nalCount,i.duration+=r.duration),r=[n],r.nalCount=n.length,r.byteLength=n.byteLength,r.pts=n.pts,r.dts=n.dts,r.duration=n.duration):(r.duration+=n.duration,r.nalCount+=n.length,r.byteLength+=n.byteLength,r.push(n));return i.length&&r.duration<=0&&(r.duration=i[i.length-1].duration),i.byteLength+=r.byteLength,i.nalCount+=r.nalCount,i.duration+=r.duration,i.push(r),i},me=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},he=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},ge=function(e,t){var n=he();return n.dataOffset=t,n.compositionTimeOffset=e.pts-e.dts,n.duration=e.duration,n.size=4*e.length,n.size+=e.byteLength,e.keyFrame&&(n.flags.dependsOn=2,n.flags.isNonSyncSample=0),n},_e={groupNalsIntoFrames:fe,groupFramesIntoGops:pe,extendFirstKeyFrame:me,generateSampleTable:function(e,t){var n,r,i,a,o,s=t||0,c=[];for(n=0;n<e.length;n++)for(a=e[n],r=0;r<a.length;r++)o=a[r],i=ge(o,s),s+=i.size,c.push(i);return c},concatenateNalData:function(e){var t,n,r,i,a,o,s=0,c=e.byteLength+4*e.nalCount,l=new Uint8Array(c),u=new DataView(l.buffer);for(t=0;t<e.length;t++)for(i=e[t],n=0;n<i.length;n++)for(a=i[n],r=0;r<a.length;r++)o=a[r],u.setUint32(s,o.data.byteLength),s+=4,l.set(o.data,s),s+=o.data.byteLength;return l},generateSampleTableForFrame:function(e,t){var n,r=t||0,i=[];return n=ge(e,r),i.push(n),i},concatenateNalDataForFrame:function(e){var t,n,r=0,i=e.byteLength+4*e.length,a=new Uint8Array(i),o=new DataView(a.buffer);for(t=0;t<e.length;t++)n=e[t],o.setUint32(r,n.data.byteLength),r+=4,a.set(n.data,r),r+=n.data.byteLength;return a}},j=[33,16,5,32,164,27],ve=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],M=function(e){for(var t=[];e--;)t.push(0);return t},ye=function(e){return Object.keys(e).reduce(function(t,n){return t[n]=new Uint8Array(e[n].reduce(function(e,t){return e.concat(t)},[])),t},{})},be,xe=function(){return be||=ye({96e3:[j,[227,64],M(154),[56]],88200:[j,[231],M(170),[56]],64e3:[j,[248,192],M(240),[56]],48e3:[j,[255,192],M(268),[55,148,128],M(54),[112]],44100:[j,[255,192],M(268),[55,163,128],M(84),[112]],32e3:[j,[255,192],M(268),[55,234],M(226),[112]],24e3:[j,[255,192],M(268),[55,255,128],M(268),[111,112],M(126),[224]],16e3:[j,[255,192],M(268),[55,255,128],M(268),[111,255],M(269),[223,108],M(195),[1,192]],12e3:[ve,M(268),[3,127,248],M(268),[6,255,240],M(268),[13,255,224],M(268),[27,253,128],M(259),[56]],11025:[ve,M(268),[3,127,248],M(268),[6,255,240],M(268),[13,255,224],M(268),[27,255,192],M(268),[55,175,128],M(108),[112]],8e3:[ve,M(268),[3,121,16],M(47),[7]]}),be},Se=9e4,Ce=function(e){return e*Se},we=function(e,t){return e*t},Te=function(e){return e/Se},N=function(e,t){return e/t},P={ONE_SECOND_IN_TS:Se,secondsToVideoTs:Ce,secondsToAudioTs:we,videoTsToSeconds:Te,audioTsToSeconds:N,audioTsToVideoTs:function(e,t){return Ce(N(e,t))},videoTsToAudioTs:function(e,t){return we(Te(e),t)},metadataTsToSeconds:function(e,t,n){return Te(n?e:e-t)}},Ee=xe,De=P,Oe=function(e){var t,n,r=0;for(t=0;t<e.length;t++)n=e[t],r+=n.data.byteLength;return r},ke={prefixWithSilence:function(e,t,n,r){var i,a=0,o=0,s=0,c=0,l,u,d;if(t.length&&(i=De.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),a=Math.ceil(De.ONE_SECOND_IN_TS/(e.samplerate/1024)),n&&r&&(o=i-Math.max(n,r),s=Math.floor(o/a),c=s*a),!(s<1||c>De.ONE_SECOND_IN_TS/2))){for(l=Ee()[e.samplerate],l||=t[0].data,u=0;u<s;u++)d=t[0],t.splice(0,0,{data:l,dts:d.dts-a,pts:d.pts-a});return e.baseMediaDecodeTime-=Math.floor(De.videoTsToAudioTs(c,e.samplerate)),c}},trimAdtsFramesByEarliestDts:function(e,t,n){return t.minSegmentDts>=n?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=n?(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0):!1}))},generateSampleTable:function(e){var t,n,r=[];for(t=0;t<e.length;t++)n=e[t],r.push({size:n.data.byteLength,duration:1024});return r},concatenateFrameData:function(e){var t,n,r=0,i=new Uint8Array(Oe(e));for(t=0;t<e.length;t++)n=e[t],i.set(n.data,r),r+=n.data.byteLength;return i}},Ae=P.ONE_SECOND_IN_TS,je={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(e,t){var n,r,i=e.minSegmentDts;return t||(i-=e.timelineStartInfo.dts),n=e.timelineStartInfo.baseMediaDecodeTime,n+=i,n=Math.max(0,n),e.type===`audio`&&(r=e.samplerate/Ae,n*=r,n=Math.floor(n)),n},collectDtsInfo:function(e,t){typeof t.pts==`number`&&(e.timelineStartInfo.pts===void 0&&(e.timelineStartInfo.pts=t.pts),e.minSegmentPts===void 0?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),e.maxSegmentPts===void 0?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),typeof t.dts==`number`&&(e.timelineStartInfo.dts===void 0&&(e.timelineStartInfo.dts=t.dts),e.minSegmentDts===void 0?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),e.maxSegmentDts===void 0?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))}},F=4,Me=128,Ne={parseSei:function(e){for(var t=0,n={payloadType:-1,payloadSize:0},r=0,i=0;t<e.byteLength&&e[t]!==Me;){for(;e[t]===255;)r+=255,t++;for(r+=e[t++];e[t]===255;)i+=255,t++;if(i+=e[t++],!n.payload&&r===F)if(String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])===`GA94`){n.payloadType=r,n.payloadSize=i,n.payload=e.subarray(t,t+i);break}else n.payload=void 0;t+=i,r=0,i=0}return n},parseUserData:function(e){return e.payload[0]!==181||(e.payload[1]<<8|e.payload[2])!=49||String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])!==`GA94`||e.payload[7]!==3?null:e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:function(e,t){var n=[],r,i,a,o;if(!(t[0]&64))return n;for(i=t[0]&31,r=0;r<i;r++)a=r*3,o={type:t[a+2]&3,pts:e},t[a+2]&4&&(o.ccData=t[a+3]<<8|t[a+4],n.push(o));return n},discardEmulationPreventionBytes:function(e){for(var t=e.byteLength,n=[],r=1,i,a;r<t-2;)e[r]===0&&e[r+1]===0&&e[r+2]===3?(n.push(r+2),r+=2):r++;if(n.length===0)return e;i=t-n.length,a=new Uint8Array(i);var o=0;for(r=0;r<i;o++,r++)o===n[0]&&(o++,n.shift()),a[r]=e[o];return a},USER_DATA_REGISTERED_ITU_T_T35:F},Pe=n,Fe=Ne,Ie=function(e){e||={},Ie.prototype.init.call(this),this.parse708captions_=typeof e.parse708captions==`boolean`?e.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new R(0,0),new R(0,1),new R(1,0),new R(1,1)],this.parse708captions_&&(this.cc708Stream_=new L({captionServices:e.captionServices})),this.reset(),this.ccStreams_.forEach(function(e){e.on(`data`,this.trigger.bind(this,`data`)),e.on(`partialdone`,this.trigger.bind(this,`partialdone`)),e.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`)))};Ie.prototype=new Pe,Ie.prototype.push=function(e){var t,n,r;if(e.nalUnitType===`sei_rbsp`&&(t=Fe.parseSei(e.escapedRBSP),t.payload&&t.payloadType===Fe.USER_DATA_REGISTERED_ITU_T_T35&&(n=Fe.parseUserData(t),n))){if(e.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}r=Fe.parseCaptionPackets(e.pts,n),this.captionPackets_=this.captionPackets_.concat(r),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},Ie.prototype.flushCCStreams=function(e){this.ccStreams_.forEach(function(t){return e===`flush`?t.flush():t.partialFlush()},this)},Ie.prototype.flushStream=function(e){if(!this.captionPackets_.length){this.flushCCStreams(e);return}this.captionPackets_.forEach(function(e,t){e.presortIndex=t}),this.captionPackets_.sort(function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts}),this.captionPackets_.forEach(function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)},this),this.captionPackets_.length=0,this.flushCCStreams(e)},Ie.prototype.flush=function(){return this.flushStream(`flush`)},Ie.prototype.partialFlush=function(){return this.flushStream(`partialFlush`)},Ie.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset()})},Ie.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),this.activeCea608Channel_[e.type]!==null&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},Ie.prototype.setsChannel1Active=function(e){return(e.ccData&30720)==4096},Ie.prototype.setsChannel2Active=function(e){return(e.ccData&30720)==6144},Ie.prototype.setsTextOrXDSActive=function(e){return(e.ccData&28928)==256||(e.ccData&30974)==4138||(e.ccData&30974)==6186},Ie.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var Le={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},Re=function(e){var t=Le[e]||e;return e&4096&&e===t?``:String.fromCharCode(t)},ze=function(e){return 32<=e&&e<=127||160<=e&&e<=255},I=function(e){this.windowNum=e,this.reset()};I.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},I.prototype.getText=function(){return this.rows.join(`
184
+ `)},I.prototype.clearText=function(){this.rows=[``],this.rowIdx=0},I.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow==`function`&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(``),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},I.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]===``:!1},I.prototype.addText=function(e){this.rows[this.rowIdx]+=e},I.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var Be=function(e,t,n){this.serviceNum=e,this.text=``,this.currentWindow=new I(-1),this.windows=[],this.stream=n,typeof t==`string`&&this.createTextDecoder(t)};Be.prototype.init=function(e,t){this.startPts=e;for(var n=0;n<8;n++)this.windows[n]=new I(n),typeof t==`function`&&(this.windows[n].beforeRowOverflow=t)},Be.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},Be.prototype.createTextDecoder=function(e){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(e)}catch(t){this.stream.trigger(`log`,{level:`warn`,message:`TextDecoder could not be created with `+e+` encoding. `+t})}};var L=function(e){e||={},L.prototype.init.call(this);var t=this,n=e.captionServices||{},r={},i;Object.keys(n).forEach(e=>{i=n[e],/^SERVICE/.test(e)&&(r[e]=i.encoding)}),this.serviceEncodings=r,this.current708Packet=null,this.services={},this.push=function(e){e.type===3?(t.new708Packet(),t.add708Bytes(e)):(t.current708Packet===null&&t.new708Packet(),t.add708Bytes(e))}};L.prototype=new Pe,L.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},L.prototype.add708Bytes=function(e){var t=e.ccData,n=t>>>8,r=t&255;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(n),this.current708Packet.data.push(r)},L.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,n=null,r=null,i=0,a=t[i++];for(e.seq=a>>6,e.sizeCode=a&63;i<t.length;i++)a=t[i++],n=a>>5,r=a&31,n===7&&r>0&&(a=t[i++],n=a),this.pushServiceBlock(n,i,r),r>0&&(i+=r-1)},L.prototype.pushServiceBlock=function(e,t,n){var r,i=t,a=this.current708Packet.data,o=this.services[e];for(o||=this.initService(e,i);i<t+n&&i<a.length;i++)r=a[i],ze(r)?i=this.handleText(i,o):r===24?i=this.multiByteCharacter(i,o):r===16?i=this.extendedCommands(i,o):128<=r&&r<=135?i=this.setCurrentWindow(i,o):152<=r&&r<=159?i=this.defineWindow(i,o):r===136?i=this.clearWindows(i,o):r===140?i=this.deleteWindows(i,o):r===137?i=this.displayWindows(i,o):r===138?i=this.hideWindows(i,o):r===139?i=this.toggleWindows(i,o):r===151?i=this.setWindowAttributes(i,o):r===144?i=this.setPenAttributes(i,o):r===145?i=this.setPenColor(i,o):r===146?i=this.setPenLocation(i,o):r===143?o=this.reset(i,o):r===8?o.currentWindow.backspace():r===12?o.currentWindow.clearText():r===13?o.currentWindow.pendingNewLine=!0:r===14?o.currentWindow.clearText():r===141&&i++},L.prototype.extendedCommands=function(e,t){var n=this.current708Packet.data[++e];return ze(n)&&(e=this.handleText(e,t,{isExtended:!0})),e},L.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},L.prototype.initService=function(e,t){var n=`SERVICE`+e,r=this,n,i;return n in this.serviceEncodings&&(i=this.serviceEncodings[n]),this.services[e]=new Be(e,i,r),this.services[e].init(this.getPts(t),function(t){r.flushDisplayed(t,r.services[e])}),this.services[e]},L.prototype.handleText=function(e,t,n){var r=n&&n.isExtended,i=n&&n.isMultiByte,a=this.current708Packet.data,o=r?4096:0,s=a[e],c=a[e+1],l=t.currentWindow,u,d;function f(e){return e.map(e=>(`0`+(e&255).toString(16)).slice(-2)).join(``)}if(i?(d=[s,c],e++):d=[s],t.textDecoder_&&!r)u=t.textDecoder_.decode(new Uint8Array(d));else if(i){let e=f(d);u=String.fromCharCode(parseInt(e,16))}else u=Re(o|s);return l.pendingNewLine&&!l.isEmpty()&&l.newLine(this.getPts(e)),l.pendingNewLine=!1,l.addText(u),e},L.prototype.multiByteCharacter=function(e,t){var n=this.current708Packet.data,r=n[e+1],i=n[e+2];return ze(r)&&ze(i)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},L.prototype.setCurrentWindow=function(e,t){var n=this.current708Packet.data[e]&7;return t.setCurrentWindow(n),e},L.prototype.defineWindow=function(e,t){var n=this.current708Packet.data,r=n[e],i=r&7;t.setCurrentWindow(i);var a=t.currentWindow;return r=n[++e],a.visible=(r&32)>>5,a.rowLock=(r&16)>>4,a.columnLock=(r&8)>>3,a.priority=r&7,r=n[++e],a.relativePositioning=(r&128)>>7,a.anchorVertical=r&127,r=n[++e],a.anchorHorizontal=r,r=n[++e],a.anchorPoint=(r&240)>>4,a.rowCount=r&15,r=n[++e],a.columnCount=r&63,r=n[++e],a.windowStyle=(r&56)>>3,a.penStyle=r&7,a.virtualRowCount=a.rowCount+1,e},L.prototype.setWindowAttributes=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.winAttr;return r=n[++e],i.fillOpacity=(r&192)>>6,i.fillRed=(r&48)>>4,i.fillGreen=(r&12)>>2,i.fillBlue=r&3,r=n[++e],i.borderType=(r&192)>>6,i.borderRed=(r&48)>>4,i.borderGreen=(r&12)>>2,i.borderBlue=r&3,r=n[++e],i.borderType+=(r&128)>>5,i.wordWrap=(r&64)>>6,i.printDirection=(r&48)>>4,i.scrollDirection=(r&12)>>2,i.justify=r&3,r=n[++e],i.effectSpeed=(r&240)>>4,i.effectDirection=(r&12)>>2,i.displayEffect=r&3,e},L.prototype.flushDisplayed=function(e,t){for(var n=[],r=0;r<8;r++)t.windows[r].visible&&!t.windows[r].isEmpty()&&n.push(t.windows[r].getText());t.endPts=e,t.text=n.join(`
187
185
 
188
- `),this.pushCaption(u),u.startPts=o},be.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)},be.prototype.displayWindows=function(o,u){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,u);for(var m=0;m<8;m++)d&1<<m&&(u.windows[m].visible=1);return o},be.prototype.hideWindows=function(o,u){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,u);for(var m=0;m<8;m++)d&1<<m&&(u.windows[m].visible=0);return o},be.prototype.toggleWindows=function(o,u){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,u);for(var m=0;m<8;m++)d&1<<m&&(u.windows[m].visible^=1);return o},be.prototype.clearWindows=function(o,u){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,u);for(var m=0;m<8;m++)d&1<<m&&u.windows[m].clearText();return o},be.prototype.deleteWindows=function(o,u){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,u);for(var m=0;m<8;m++)d&1<<m&&u.windows[m].reset();return o},be.prototype.setPenAttributes=function(o,u){var h=this.current708Packet.data,d=h[o],p=u.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},be.prototype.setPenColor=function(o,u){var h=this.current708Packet.data,d=h[o],p=u.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},be.prototype.setPenLocation=function(o,u){var h=this.current708Packet.data,d=h[o],p=u.currentWindow.penLoc;return u.currentWindow.pendingNewLine=!0,d=h[++o],p.row=d&15,d=h[++o],p.column=d&63,o},be.prototype.reset=function(o,u){var h=this.getPts(o);return this.flushDisplayed(h,u),this.initService(u.serviceNum,o)};var Cr={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},Er=function(o){return o===null?"":(o=Cr[o]||o,String.fromCharCode(o))},Ar=14,rf=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Di=function(){for(var o=[],u=Ar+1;u--;)o.push({text:"",indent:0,offset:0});return o},Pe=function(o,u){Pe.prototype.init.call(this),this.field_=o||0,this.dataChannel_=u||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(h){var d,p,m,x,S;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),m=d>>>8,x=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_=Di();else if(d===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Di();else if(d===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(h.pts),this.displayed_=Di()),this.mode_="paintOn",this.startPts_=h.pts;else if(this.isSpecialCharacter(m,x))m=(m&3)<<8,S=Er(m|x),this[this.mode_](h.pts,S),this.column_++;else if(this.isExtCharacter(m,x))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),m=(m&3)<<8,S=Er(m|x),this[this.mode_](h.pts,S),this.column_++;else if(this.isMidRowCode(m,x))this.clearFormatting(h.pts),this[this.mode_](h.pts," "),this.column_++,(x&14)===14&&this.addFormatting(h.pts,["i"]),(x&1)===1&&this.addFormatting(h.pts,["u"]);else if(this.isOffsetControlCode(m,x)){const D=x&3;this.nonDisplayed_[this.row_].offset=D,this.column_+=D}else if(this.isPAC(m,x)){var A=rf.indexOf(d&7968);if(this.mode_==="rollUp"&&(A-this.rollUpRows_+1<0&&(A=this.rollUpRows_-1),this.setRollUp(h.pts,A)),A!==this.row_&&A>=0&&A<=14&&(this.clearFormatting(h.pts),this.row_=A),x&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(h.pts,["u"]),(d&16)===16){const D=(d&14)>>1;this.column_=D*4,this.nonDisplayed_[this.row_].indent+=D}this.isColorPAC(x)&&(x&14)===14&&this.addFormatting(h.pts,["i"])}else this.isNormalChar(m)&&(x===0&&(x=null),S=Er(m),S+=Er(x),this[this.mode_](h.pts,S),this.column_+=S.length)}};Pe.prototype=new Pt,Pe.prototype.flushDisplayed=function(o){const u=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{u(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&&u(p)}),h.length&&this.trigger("data",{startPts:this.startPts_,endPts:o,content:h,stream:this.name_})},Pe.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Di(),this.nonDisplayed_=Di(),this.lastControlCode_=null,this.column_=0,this.row_=Ar,this.rollUpRows_=2,this.formatting_=[]},Pe.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},Pe.prototype.isSpecialCharacter=function(o,u){return o===this.EXT_&&u>=48&&u<=63},Pe.prototype.isExtCharacter=function(o,u){return(o===this.EXT_+1||o===this.EXT_+2)&&u>=32&&u<=63},Pe.prototype.isMidRowCode=function(o,u){return o===this.EXT_&&u>=32&&u<=47},Pe.prototype.isOffsetControlCode=function(o,u){return o===this.OFFSET_&&u>=33&&u<=35},Pe.prototype.isPAC=function(o,u){return o>=this.BASE_&&o<this.BASE_+8&&u>=64&&u<=127},Pe.prototype.isColorPAC=function(o){return o>=64&&o<=79||o>=96&&o<=127},Pe.prototype.isNormalChar=function(o){return o>=32&&o<=127},Pe.prototype.setRollUp=function(o,u){if(this.mode_!=="rollUp"&&(this.row_=Ar,this.mode_="rollUp",this.flushDisplayed(o),this.nonDisplayed_=Di(),this.displayed_=Di()),u!==void 0&&u!==this.row_)for(var h=0;h<this.rollUpRows_;h++)this.displayed_[u-h]=this.displayed_[this.row_-h],this.displayed_[this.row_-h]={text:"",indent:0,offset:0};u===void 0&&(u=this.row_),this.topRow_=u-this.rollUpRows_+1},Pe.prototype.addFormatting=function(o,u){this.formatting_=this.formatting_.concat(u);var h=u.reduce(function(d,p){return d+"<"+p+">"},"");this[this.mode_](o,h)},Pe.prototype.clearFormatting=function(o){if(this.formatting_.length){var u=this.formatting_.reverse().reduce(function(h,d){return h+"</"+d+">"},"");this.formatting_=[],this[this.mode_](o,u)}},Pe.prototype.popOn=function(o,u){var h=this.nonDisplayed_[this.row_].text;h+=u,this.nonDisplayed_[this.row_].text=h},Pe.prototype.rollUp=function(o,u){var h=this.displayed_[this.row_].text;h+=u,this.displayed_[this.row_].text=h},Pe.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<Ar+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}},Pe.prototype.paintOn=function(o,u){var h=this.displayed_[this.row_].text;h+=u,this.displayed_[this.row_].text=h};var el={CaptionStream:Ne,Cea608Stream:Pe,Cea708Stream:be},wr={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},nf=t,af=8589934592,of=4294967296,tl="shared",Wn=function(o,u){var h=1;for(o>u&&(h=-1);Math.abs(u-o)>of;)o+=h*af;return o},Xn=function(o){var u,h;Xn.prototype.init.call(this),this.type_=o||tl,this.push=function(d){if(d.type==="metadata"){this.trigger("data",d);return}this.type_!==tl&&d.type!==this.type_||(h===void 0&&(h=d.dts),d.dts=Wn(d.dts,h),d.pts=Wn(d.pts,h),u=d.dts,this.trigger("data",d))},this.flush=function(){h=u,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){h=void 0,u=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Xn.prototype=new nf;var il={TimestampRolloverStream:Xn,handleRollover:Wn},lf=(o,u,h)=>{if(!o)return-1;for(var d=h;d<o.length;d++)if(o[d]===u)return d;return-1},uf={typedArrayIndexOf:lf},Dr=uf.typedArrayIndexOf,kr={Utf8:3},sl=function(o,u,h){var d,p="";for(d=u;d<h;d++)p+="%"+("00"+o[d].toString(16)).slice(-2);return p},Ls=function(o,u,h){return decodeURIComponent(sl(o,u,h))},Os=function(o,u,h){return unescape(sl(o,u,h))},Ms=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},Rs={APIC:function(o){var u=1,h,d,p="-->";o.data[0]===kr.Utf8&&(h=Dr(o.data,0,u),!(h<0)&&(o.mimeType=Os(o.data,u,h),u=h+1,o.pictureType=o.data[u],u++,d=Dr(o.data,0,u),!(d<0)&&(o.description=Ls(o.data,u,d),u=d+1,o.mimeType===p?o.url=Os(o.data,u,o.data.length):o.pictureData=o.data.subarray(u,o.data.length))))},"T*":function(o){o.data[0]===kr.Utf8&&(o.value=Ls(o.data,1,o.data.length).replace(/\0*$/,""),o.values=o.value.split("\0"))},TXXX:function(o){var u;o.data[0]===kr.Utf8&&(u=Dr(o.data,0,1),u!==-1&&(o.description=Ls(o.data,1,u),o.value=Ls(o.data,u+1,o.data.length).replace(/\0*$/,""),o.data=o.value))},"W*":function(o){o.url=Os(o.data,0,o.data.length).replace(/\0.*$/,"")},WXXX:function(o){var u;o.data[0]===kr.Utf8&&(u=Dr(o.data,0,1),u!==-1&&(o.description=Ls(o.data,1,u),o.url=Os(o.data,u+1,o.data.length).replace(/\0.*$/,"")))},PRIV:function(o){var u;for(u=0;u<o.data.length;u++)if(o.data[u]===0){o.owner=Os(o.data,0,u);break}o.privateData=o.data.subarray(u+1),o.data=o.privateData}},cf=function(o){var u,h,d=10,p=0,m=[];if(!(o.length<10||o[0]!==73||o[1]!==68||o[2]!==51)){p=Ms(o.subarray(6,10)),p+=10;var x=o[5]&64;x&&(d+=4,d+=Ms(o.subarray(10,14)),p-=Ms(o.subarray(16,20)));do{if(u=Ms(o.subarray(d+4,d+8)),u<1)break;h=String.fromCharCode(o[d],o[d+1],o[d+2],o[d+3]);var S={id:h,data:o.subarray(d+10,d+u+10)};S.key=S.id,Rs[S.id]?Rs[S.id](S):S.id[0]==="T"?Rs["T*"](S):S.id[0]==="W"&&Rs["W*"](S),m.push(S),d+=10,d+=u}while(d<p);return m}},rl={parseId3Frames:cf,parseSyncSafeInteger:Ms,frameParsers:Rs},df=t,hf=wr,fi=rl,jr;jr=function(o){var u={descriptor:o&&o.descriptor},h=0,d=[],p=0,m;if(jr.prototype.init.call(this),this.dispatchType=hf.METADATA_STREAM_TYPE.toString(16),u.descriptor)for(m=0;m<u.descriptor.length;m++)this.dispatchType+=("00"+u.descriptor[m].toString(16)).slice(-2);this.push=function(x){var S,A,D,M,W,ae;if(x.type==="timed-metadata"){if(x.dataAlignmentIndicator&&(p=0,d.length=0),d.length===0&&(x.data.length<10||x.data[0]!==73||x.data[1]!==68||x.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(d.push(x),p+=x.data.byteLength,d.length===1&&(h=fi.parseSyncSafeInteger(x.data.subarray(6,10)),h+=10),!(p<h)){for(S={data:new Uint8Array(h),frames:[],pts:d[0].pts,dts:d[0].dts},W=0;W<h;)S.data.set(d[0].data.subarray(0,h-W),W),W+=d[0].data.byteLength,p-=d[0].data.byteLength,d.shift();A=10,S.data[5]&64&&(A+=4,A+=fi.parseSyncSafeInteger(S.data.subarray(10,14)),h-=fi.parseSyncSafeInteger(S.data.subarray(16,20)));do{if(D=fi.parseSyncSafeInteger(S.data.subarray(A+4,A+8)),D<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(ae=String.fromCharCode(S.data[A],S.data[A+1],S.data[A+2],S.data[A+3]),M={id:ae,data:S.data.subarray(A+10,A+D+10)},M.key=M.id,fi.frameParsers[M.id]?fi.frameParsers[M.id](M):M.id[0]==="T"?fi.frameParsers["T*"](M):M.id[0]==="W"&&fi.frameParsers["W*"](M),M.owner==="com.apple.streaming.transportStreamTimestamp"){var K=M.data,le=(K[3]&1)<<30|K[4]<<22|K[5]<<14|K[6]<<6|K[7]>>>2;le*=4,le+=K[7]&3,M.timeStamp=le,S.pts===void 0&&S.dts===void 0&&(S.pts=M.timeStamp,S.dts=M.timeStamp),this.trigger("timestamp",M)}S.frames.push(M),A+=10,A+=D}while(A<h);this.trigger("data",S)}}}},jr.prototype=new df;var ff=jr,Yn=t,Kn=el,Lt=wr,pf=il.TimestampRolloverStream,Ir,Ns,Pr,Wi=188,Qn=71;Ir=function(){var o=new Uint8Array(Wi),u=0;Ir.prototype.init.call(this),this.push=function(h){var d=0,p=Wi,m;for(u?(m=new Uint8Array(h.byteLength+u),m.set(o.subarray(0,u)),m.set(h,u),u=0):m=h;p<m.byteLength;){if(m[d]===Qn&&m[p]===Qn){this.trigger("data",m.subarray(d,p)),d+=Wi,p+=Wi;continue}d++,p++}d<m.byteLength&&(o.set(m.subarray(d),0),u=m.byteLength-d)},this.flush=function(){u===Wi&&o[0]===Qn&&(this.trigger("data",o),u=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){u=0,this.trigger("reset")}},Ir.prototype=new Yn,Ns=function(){var o,u,h,d;Ns.prototype.init.call(this),d=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,o=function(p,m){var x=0;m.payloadUnitStartIndicator&&(x+=p[x]+1),m.type==="pat"?u(p.subarray(x),m):h(p.subarray(x),m)},u=function(p,m){m.section_number=p[7],m.last_section_number=p[8],d.pmtPid=(p[10]&31)<<8|p[11],m.pmtPid=d.pmtPid},h=function(p,m){var x,S,A,D;if(p[5]&1){for(d.programMapTable={video:null,audio:null,"timed-metadata":{}},x=(p[1]&15)<<8|p[2],S=3+x-4,A=(p[10]&15)<<8|p[11],D=12+A;D<S;){var M=p[D],W=(p[D+1]&31)<<8|p[D+2];M===Lt.H264_STREAM_TYPE&&d.programMapTable.video===null?d.programMapTable.video=W:M===Lt.ADTS_STREAM_TYPE&&d.programMapTable.audio===null?d.programMapTable.audio=W:M===Lt.METADATA_STREAM_TYPE&&(d.programMapTable["timed-metadata"][W]=M),D+=((p[D+3]&15)<<8|p[D+4])+5}m.programMapTable=d.programMapTable}},this.push=function(p){var m={},x=4;if(m.payloadUnitStartIndicator=!!(p[1]&64),m.pid=p[1]&31,m.pid<<=8,m.pid|=p[2],(p[3]&48)>>>4>1&&(x+=p[x]+1),m.pid===0)m.type="pat",o(p.subarray(x),m),this.trigger("data",m);else if(m.pid===this.pmtPid)for(m.type="pmt",o(p.subarray(x),m),this.trigger("data",m);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([p,x,m]):this.processPes_(p,x,m)},this.processPes_=function(p,m,x){x.pid===this.programMapTable.video?x.streamType=Lt.H264_STREAM_TYPE:x.pid===this.programMapTable.audio?x.streamType=Lt.ADTS_STREAM_TYPE:x.streamType=this.programMapTable["timed-metadata"][x.pid],x.type="pes",x.data=p.subarray(m),this.trigger("data",x)}},Ns.prototype=new Yn,Ns.STREAM_TYPES={h264:27,adts:15},Pr=function(){var o=this,u=!1,h={data:[],size:0},d={data:[],size:0},p={data:[],size:0},m,x=function(A,D){var M;const W=A[0]<<16|A[1]<<8|A[2];D.data=new Uint8Array,W===1&&(D.packetLength=6+(A[4]<<8|A[5]),D.dataAlignmentIndicator=(A[6]&4)!==0,M=A[7],M&192&&(D.pts=(A[9]&14)<<27|(A[10]&255)<<20|(A[11]&254)<<12|(A[12]&255)<<5|(A[13]&254)>>>3,D.pts*=4,D.pts+=(A[13]&6)>>>1,D.dts=D.pts,M&64&&(D.dts=(A[14]&14)<<27|(A[15]&255)<<20|(A[16]&254)<<12|(A[17]&255)<<5|(A[18]&254)>>>3,D.dts*=4,D.dts+=(A[18]&6)>>>1)),D.data=A.subarray(9+A[8]))},S=function(A,D,M){var W=new Uint8Array(A.size),ae={type:D},K=0,le=0,ge=!1,Ge;if(!(!A.data.length||A.size<9)){for(ae.trackId=A.data[0].pid,K=0;K<A.data.length;K++)Ge=A.data[K],W.set(Ge.data,le),le+=Ge.data.byteLength;x(W,ae),ge=D==="video"||ae.packetLength<=A.size,(M||ge)&&(A.size=0,A.data.length=0),ge&&o.trigger("data",ae)}};Pr.prototype.init.call(this),this.push=function(A){({pat:function(){},pes:function(){var D,M;switch(A.streamType){case Lt.H264_STREAM_TYPE:D=h,M="video";break;case Lt.ADTS_STREAM_TYPE:D=d,M="audio";break;case Lt.METADATA_STREAM_TYPE:D=p,M="timed-metadata";break;default:return}A.payloadUnitStartIndicator&&S(D,M,!0),D.data.push(A),D.size+=A.data.byteLength},pmt:function(){var D={type:"metadata",tracks:[]};m=A.programMapTable,m.video!==null&&D.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.video,codec:"avc",type:"video"}),m.audio!==null&&D.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.audio,codec:"adts",type:"audio"}),u=!0,o.trigger("data",D)}})[A.type]()},this.reset=function(){h.size=0,h.data.length=0,d.size=0,d.data.length=0,this.trigger("reset")},this.flushStreams_=function(){S(h,"video"),S(d,"audio"),S(p,"timed-metadata")},this.flush=function(){if(!u&&m){var A={type:"metadata",tracks:[]};m.video!==null&&A.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.video,codec:"avc",type:"video"}),m.audio!==null&&A.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.audio,codec:"adts",type:"audio"}),o.trigger("data",A)}u=!1,this.flushStreams_(),this.trigger("done")}},Pr.prototype=new Yn;var nl={PAT_PID:0,MP2T_PACKET_LENGTH:Wi,TransportPacketStream:Ir,TransportParseStream:Ns,ElementaryStream:Pr,TimestampRolloverStream:pf,CaptionStream:Kn.CaptionStream,Cea608Stream:Kn.Cea608Stream,Cea708Stream:Kn.Cea708Stream,MetadataStream:ff};for(var Jn in Lt)Lt.hasOwnProperty(Jn)&&(nl[Jn]=Lt[Jn]);var mf=nl,gf=t,vf=Te.ONE_SECOND_IN_TS,Lr,al=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Lr=function(o){var u,h=0;Lr.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,m,x,S,A,D;if(o||(h=0),d.type==="audio"){u&&u.length?(S=u,u=new Uint8Array(S.byteLength+d.data.byteLength),u.set(S),u.set(d.data,S.byteLength)):u=d.data;for(var M;p+7<u.length;){if(u[p]!==255||(u[p+1]&246)!==240){typeof M!="number"&&(M=p),p++;continue}if(typeof M=="number"&&(this.skipWarn_(M,p),M=null),x=(~u[p+1]&1)*2,m=(u[p+3]&3)<<11|u[p+4]<<3|(u[p+5]&224)>>5,A=((u[p+6]&3)+1)*1024,D=A*vf/al[(u[p+2]&60)>>>2],u.byteLength-p<m)break;this.trigger("data",{pts:d.pts+h*D,dts:d.dts+h*D,sampleCount:A,audioobjecttype:(u[p+2]>>>6&3)+1,channelcount:(u[p+2]&1)<<2|(u[p+3]&192)>>>6,samplerate:al[(u[p+2]&60)>>>2],samplingfrequencyindex:(u[p+2]&60)>>>2,samplesize:16,data:u.subarray(p+7+x,p+m)}),h++,p+=m}typeof M=="number"&&(this.skipWarn_(M,p),M=null),u=u.subarray(p)}},this.flush=function(){h=0,this.trigger("done")},this.reset=function(){u=void 0,this.trigger("reset")},this.endTimeline=function(){u=void 0,this.trigger("endedtimeline")}},Lr.prototype=new gf;var yf=Lr,ol;ol=function(o){var u=o.byteLength,h=0,d=0;this.length=function(){return 8*u},this.bitsAvailable=function(){return 8*u+d},this.loadWord=function(){var p=o.byteLength-u,m=new Uint8Array(4),x=Math.min(4,u);if(x===0)throw new Error("no bytes available");m.set(o.subarray(p,p+x)),h=new DataView(m.buffer).getUint32(0),d=x*8,u-=x},this.skipBits=function(p){var m;d>p?(h<<=p,d-=p):(p-=d,m=Math.floor(p/8),p-=m*8,u-=m,this.loadWord(),h<<=p,d-=p)},this.readBits=function(p){var m=Math.min(d,p),x=h>>>32-m;return d-=m,d>0?h<<=m:u>0&&this.loadWord(),m=p-m,m>0?x<<m|this.readBits(m):x},this.skipLeadingZeros=function(){var p;for(p=0;p<d;++p)if((h&2147483648>>>p)!==0)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 _f=ol,ll=t,bf=_f,Or,Mr,ul;Mr=function(){var o=0,u,h;Mr.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 m=h.byteLength;o<m-3;o++)if(h[o+2]===1){u=o+5;break}for(;u<m;)switch(h[u]){case 0:if(h[u-1]!==0){u+=2;break}else if(h[u-2]!==0){u++;break}o+3!==u-2&&this.trigger("data",h.subarray(o+3,u-2));do u++;while(h[u]!==1&&u<m);o=u-2,u+=3;break;case 1:if(h[u-1]!==0||h[u-2]!==0){u+=3;break}this.trigger("data",h.subarray(o+3,u-2)),o=u-2,u+=3;break;default:u+=3;break}h=h.subarray(o),u-=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")}},Mr.prototype=new ll,ul={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Or=function(){var o=new Mr,u,h,d,p,m,x,S;Or.prototype.init.call(this),u=this,this.push=function(A){A.type==="video"&&(h=A.trackId,d=A.pts,p=A.dts,o.push(A))},o.on("data",function(A){var D={trackId:h,pts:d,dts:p,data:A,nalUnitTypeCode:A[0]&31};switch(D.nalUnitTypeCode){case 5:D.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:D.nalUnitType="sei_rbsp",D.escapedRBSP=m(A.subarray(1));break;case 7:D.nalUnitType="seq_parameter_set_rbsp",D.escapedRBSP=m(A.subarray(1)),D.config=x(D.escapedRBSP);break;case 8:D.nalUnitType="pic_parameter_set_rbsp";break;case 9:D.nalUnitType="access_unit_delimiter_rbsp";break}u.trigger("data",D)}),o.on("done",function(){u.trigger("done")}),o.on("partialdone",function(){u.trigger("partialdone")}),o.on("reset",function(){u.trigger("reset")}),o.on("endedtimeline",function(){u.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},S=function(A,D){var M=8,W=8,ae,K;for(ae=0;ae<A;ae++)W!==0&&(K=D.readExpGolomb(),W=(M+K+256)%256),M=W===0?M:W},m=function(A){for(var D=A.byteLength,M=[],W=1,ae,K;W<D-2;)A[W]===0&&A[W+1]===0&&A[W+2]===3?(M.push(W+2),W+=2):W++;if(M.length===0)return A;ae=D-M.length,K=new Uint8Array(ae);var le=0;for(W=0;W<ae;le++,W++)le===M[0]&&(le++,M.shift()),K[W]=A[le];return K},x=function(A){var D=0,M=0,W=0,ae=0,K,le,ge,Ge,vt,mi,zs,$s,Gs,Ws,Wr,je=[1,1],Xs,Mt;if(K=new bf(A),le=K.readUnsignedByte(),Ge=K.readUnsignedByte(),ge=K.readUnsignedByte(),K.skipUnsignedExpGolomb(),ul[le]&&(vt=K.readUnsignedExpGolomb(),vt===3&&K.skipBits(1),K.skipUnsignedExpGolomb(),K.skipUnsignedExpGolomb(),K.skipBits(1),K.readBoolean()))for(Wr=vt!==3?8:12,Mt=0;Mt<Wr;Mt++)K.readBoolean()&&(Mt<6?S(16,K):S(64,K));if(K.skipUnsignedExpGolomb(),mi=K.readUnsignedExpGolomb(),mi===0)K.readUnsignedExpGolomb();else if(mi===1)for(K.skipBits(1),K.skipExpGolomb(),K.skipExpGolomb(),zs=K.readUnsignedExpGolomb(),Mt=0;Mt<zs;Mt++)K.skipExpGolomb();if(K.skipUnsignedExpGolomb(),K.skipBits(1),$s=K.readUnsignedExpGolomb(),Gs=K.readUnsignedExpGolomb(),Ws=K.readBits(1),Ws===0&&K.skipBits(1),K.skipBits(1),K.readBoolean()&&(D=K.readUnsignedExpGolomb(),M=K.readUnsignedExpGolomb(),W=K.readUnsignedExpGolomb(),ae=K.readUnsignedExpGolomb()),K.readBoolean()&&K.readBoolean()){switch(Xs=K.readUnsignedByte(),Xs){case 1:je=[1,1];break;case 2:je=[12,11];break;case 3:je=[10,11];break;case 4:je=[16,11];break;case 5:je=[40,33];break;case 6:je=[24,11];break;case 7:je=[20,11];break;case 8:je=[32,11];break;case 9:je=[80,33];break;case 10:je=[18,11];break;case 11:je=[15,11];break;case 12:je=[64,33];break;case 13:je=[160,99];break;case 14:je=[4,3];break;case 15:je=[3,2];break;case 16:je=[2,1];break;case 255:{je=[K.readUnsignedByte()<<8|K.readUnsignedByte(),K.readUnsignedByte()<<8|K.readUnsignedByte()];break}}je&&je[0]/je[1]}return{profileIdc:le,levelIdc:ge,profileCompatibility:Ge,width:($s+1)*16-D*2-M*2,height:(2-Ws)*(Gs+1)*16-W*2-ae*2,sarRatio:je}}},Or.prototype=new ll;var Tf={H264Stream:Or},xf=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],cl=function(o,u){var h=o[u+6]<<21|o[u+7]<<14|o[u+8]<<7|o[u+9],d=o[u+5],p=(d&16)>>4;return h=h>=0?h:0,p?h+20:h+10},dl=function(o,u){return o.length-u<10||o[u]!==73||o[u+1]!==68||o[u+2]!==51?u:(u+=cl(o,u),dl(o,u))},Sf=function(o){var u=dl(o,0);return o.length>=u+2&&(o[u]&255)===255&&(o[u+1]&240)===240&&(o[u+1]&22)===16},hl=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},Cf=function(o,u,h){var d,p="";for(d=u;d<h;d++)p+="%"+("00"+o[d].toString(16)).slice(-2);return p},Ef=function(o,u,h){return unescape(Cf(o,u,h))},Af=function(o,u){var h=(o[u+5]&224)>>5,d=o[u+4]<<3,p=o[u+3]&6144;return p|d|h},wf=function(o,u){return o[u]===73&&o[u+1]===68&&o[u+2]===51?"timed-metadata":o[u]&!0&&(o[u+1]&240)===240?"audio":null},Df=function(o){for(var u=0;u+5<o.length;){if(o[u]!==255||(o[u+1]&246)!==240){u++;continue}return xf[(o[u+2]&60)>>>2]}return null},kf=function(o){var u,h,d,p;u=10,o[5]&64&&(u+=4,u+=hl(o.subarray(10,14)));do{if(h=hl(o.subarray(u+4,u+8)),h<1)return null;if(p=String.fromCharCode(o[u],o[u+1],o[u+2],o[u+3]),p==="PRIV"){d=o.subarray(u+10,u+h+10);for(var m=0;m<d.byteLength;m++)if(d[m]===0){var x=Ef(d,0,m);if(x==="com.apple.streaming.transportStreamTimestamp"){var S=d.subarray(m+1),A=(S[3]&1)<<30|S[4]<<22|S[5]<<14|S[6]<<6|S[7]>>>2;return A*=4,A+=S[7]&3,A}break}}u+=10,u+=h}while(u<o.byteLength);return null},Zn={isLikelyAacData:Sf,parseId3TagSize:cl,parseAdtsSize:Af,parseType:wf,parseSampleRate:Df,parseAacTimestamp:kf},jf=t,fl=Zn,Rr;Rr=function(){var o=new Uint8Array,u=0;Rr.prototype.init.call(this),this.setTimestamp=function(h){u=h},this.push=function(h){var d=0,p=0,m,x,S,A;for(o.length?(A=o.length,o=new Uint8Array(h.byteLength+A),o.set(o.subarray(0,A)),o.set(h,A)):o=h;o.length-p>=3;){if(o[p]===73&&o[p+1]===68&&o[p+2]===51){if(o.length-p<10||(d=fl.parseId3TagSize(o,p),p+d>o.length))break;x={type:"timed-metadata",data:o.subarray(p,p+d)},this.trigger("data",x),p+=d;continue}else if((o[p]&255)===255&&(o[p+1]&240)===240){if(o.length-p<7||(d=fl.parseAdtsSize(o,p),p+d>o.length))break;S={type:"audio",data:o.subarray(p,p+d),pts:u,dts:u},this.trigger("data",S),p+=d;continue}p++}m=o.length-p,m>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")}},Rr.prototype=new jf;var If=Rr,Pf=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Lf=Pf,Of=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Mf=Of,Nr=t,Bs=Ze,Fs=$i,Br=Ps,Ot=q,ei=mf,Fr=Te,pl=yf,Rf=Tf.H264Stream,Nf=If,Bf=Zn.isLikelyAacData,Ff=Te.ONE_SECOND_IN_TS,ml=Lf,gl=Mf,Ur,Us,Vr,ki,Uf=function(o,u){u.stream=o,this.trigger("log",u)},vl=function(o,u){for(var h=Object.keys(u),d=0;d<h.length;d++){var p=h[d];p==="headOfPipeline"||!u[p].on||u[p].on("log",Uf.bind(o,p))}},yl=function(o,u){var h;if(o.length!==u.length)return!1;for(h=0;h<o.length;h++)if(o[h]!==u[h])return!1;return!0},_l=function(o,u,h,d,p,m){var x=h-u,S=d-u,A=p-h;return{start:{dts:o,pts:o+x},end:{dts:o+S,pts:o+A},prependedContentDuration:m,baseMediaDecodeTime:o}};Us=function(o,u){var h=[],d,p=0,m=0,x=1/0;u=u||{},d=u.firstSequenceNumber||0,Us.prototype.init.call(this),this.push=function(S){Ot.collectDtsInfo(o,S),o&&ml.forEach(function(A){o[A]=S[A]}),h.push(S)},this.setEarliestDts=function(S){p=S},this.setVideoBaseMediaDecodeTime=function(S){x=S},this.setAudioAppendStart=function(S){m=S},this.flush=function(){var S,A,D,M,W,ae,K;if(h.length===0){this.trigger("done","AudioSegmentStream");return}S=Br.trimAdtsFramesByEarliestDts(h,o,p),o.baseMediaDecodeTime=Ot.calculateTrackBaseMediaDecodeTime(o,u.keepOriginalTimestamps),K=Br.prefixWithSilence(o,S,m,x),o.samples=Br.generateSampleTable(S),D=Bs.mdat(Br.concatenateFrameData(S)),h=[],A=Bs.moof(d,[o]),M=new Uint8Array(A.byteLength+D.byteLength),d++,M.set(A),M.set(D,A.byteLength),Ot.clearDtsInfo(o),W=Math.ceil(Ff*1024/o.samplerate),S.length&&(ae=S.length*W,this.trigger("segmentTimingInfo",_l(Fr.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),S[0].dts,S[0].pts,S[0].dts+ae,S[0].pts+ae,K||0)),this.trigger("timingInfo",{start:S[0].pts,end:S[0].pts+ae})),this.trigger("data",{track:o,boxes:M}),this.trigger("done","AudioSegmentStream")},this.reset=function(){Ot.clearDtsInfo(o),h=[],this.trigger("reset")}},Us.prototype=new Nr,Ur=function(o,u){var h,d=[],p=[],m,x;u=u||{},h=u.firstSequenceNumber||0,Ur.prototype.init.call(this),delete o.minPTS,this.gopCache_=[],this.push=function(S){Ot.collectDtsInfo(o,S),S.nalUnitType==="seq_parameter_set_rbsp"&&!m&&(m=S.config,o.sps=[S.data],gl.forEach(function(A){o[A]=m[A]},this)),S.nalUnitType==="pic_parameter_set_rbsp"&&!x&&(x=S.data,o.pps=[S.data]),d.push(S)},this.flush=function(){for(var S,A,D,M,W,ae,K=0,le,ge;d.length&&d[0].nalUnitType!=="access_unit_delimiter_rbsp";)d.shift();if(d.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(S=Fs.groupNalsIntoFrames(d),D=Fs.groupFramesIntoGops(S),D[0][0].keyFrame||(A=this.getGopForFusion_(d[0],o),A?(K=A.duration,D.unshift(A),D.byteLength+=A.byteLength,D.nalCount+=A.nalCount,D.pts=A.pts,D.dts=A.dts,D.duration+=A.duration):D=Fs.extendFirstKeyFrame(D)),p.length){var Ge;if(u.alignGopsAtEnd?Ge=this.alignGopsAtEnd_(D):Ge=this.alignGopsAtStart_(D),!Ge){this.gopCache_.unshift({gop:D.pop(),pps:o.pps,sps:o.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),d=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}Ot.clearDtsInfo(o),D=Ge}Ot.collectDtsInfo(o,D),o.samples=Fs.generateSampleTable(D),W=Bs.mdat(Fs.concatenateNalData(D)),o.baseMediaDecodeTime=Ot.calculateTrackBaseMediaDecodeTime(o,u.keepOriginalTimestamps),this.trigger("processedGopsInfo",D.map(function(vt){return{pts:vt.pts,dts:vt.dts,byteLength:vt.byteLength}})),le=D[0],ge=D[D.length-1],this.trigger("segmentTimingInfo",_l(o.baseMediaDecodeTime,le.dts,le.pts,ge.dts+ge.duration,ge.pts+ge.duration,K)),this.trigger("timingInfo",{start:D[0].pts,end:D[D.length-1].pts+D[D.length-1].duration}),this.gopCache_.unshift({gop:D.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),M=Bs.moof(h,[o]),ae=new Uint8Array(M.byteLength+W.byteLength),h++,ae.set(M),ae.set(W,M.byteLength),this.trigger("data",{track:o,boxes:ae}),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(){Ot.clearDtsInfo(o),m=void 0,x=void 0},this.getGopForFusion_=function(S){var A=45e3,D=1/0,M,W,ae,K,le;for(le=0;le<this.gopCache_.length;le++)K=this.gopCache_[le],ae=K.gop,!(!(o.pps&&yl(o.pps[0],K.pps[0]))||!(o.sps&&yl(o.sps[0],K.sps[0])))&&(ae.dts<o.timelineStartInfo.dts||(M=S.dts-ae.dts-ae.duration,M>=-1e4&&M<=A&&(!W||D>M)&&(W=K,D=M)));return W?W.gop:null},this.alignGopsAtStart_=function(S){var A,D,M,W,ae,K,le,ge;for(ae=S.byteLength,K=S.nalCount,le=S.duration,A=D=0;A<p.length&&D<S.length&&(M=p[A],W=S[D],M.pts!==W.pts);){if(W.pts>M.pts){A++;continue}D++,ae-=W.byteLength,K-=W.nalCount,le-=W.duration}return D===0?S:D===S.length?null:(ge=S.slice(D),ge.byteLength=ae,ge.duration=le,ge.nalCount=K,ge.pts=ge[0].pts,ge.dts=ge[0].dts,ge)},this.alignGopsAtEnd_=function(S){var A,D,M,W,ae,K;for(A=p.length-1,D=S.length-1,ae=null,K=!1;A>=0&&D>=0;){if(M=p[A],W=S[D],M.pts===W.pts){K=!0;break}if(M.pts>W.pts){A--;continue}A===p.length-1&&(ae=D),D--}if(!K&&ae===null)return null;var le;if(K?le=D:le=ae,le===0)return S;var ge=S.slice(le),Ge=ge.reduce(function(vt,mi){return vt.byteLength+=mi.byteLength,vt.duration+=mi.duration,vt.nalCount+=mi.nalCount,vt},{byteLength:0,duration:0,nalCount:0});return ge.byteLength=Ge.byteLength,ge.duration=Ge.duration,ge.nalCount=Ge.nalCount,ge.pts=ge[0].pts,ge.dts=ge[0].dts,ge},this.alignGopsWith=function(S){p=S}},Ur.prototype=new Nr,ki=function(o,u){this.numberOfTracks=0,this.metadataStream=u,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,ki.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))}},ki.prototype=new Nr,ki.prototype.flush=function(o){var u=0,h={captions:[],captionStreams:{},metadata:[],info:{}},d,p,m,x=0,S;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?(x=this.videoTrack.timelineStartInfo.pts,gl.forEach(function(A){h.info[A]=this.videoTrack[A]},this)):this.audioTrack&&(x=this.audioTrack.timelineStartInfo.pts,ml.forEach(function(A){h.info[A]=this.audioTrack[A]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?h.type=this.pendingTracks[0].type:h.type="combined",this.emittedTracks+=this.pendingTracks.length,m=Bs.initSegment(this.pendingTracks),h.initSegment=new Uint8Array(m.byteLength),h.initSegment.set(m),h.data=new Uint8Array(this.pendingBytes),S=0;S<this.pendingBoxes.length;S++)h.data.set(this.pendingBoxes[S],u),u+=this.pendingBoxes[S].byteLength;for(S=0;S<this.pendingCaptions.length;S++)d=this.pendingCaptions[S],d.startTime=Fr.metadataTsToSeconds(d.startPts,x,this.keepOriginalTimestamps),d.endTime=Fr.metadataTsToSeconds(d.endPts,x,this.keepOriginalTimestamps),h.captionStreams[d.stream]=!0,h.captions.push(d);for(S=0;S<this.pendingMetadata.length;S++)p=this.pendingMetadata[S],p.cueTime=Fr.metadataTsToSeconds(p.pts,x,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),S=0;S<h.captions.length;S++)d=h.captions[S],this.trigger("caption",d);for(S=0;S<h.metadata.length;S++)p=h.metadata[S],this.trigger("id3Frame",p)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},ki.prototype.setRemux=function(o){this.remuxTracks=o},Vr=function(o){var u=this,h=!0,d,p;Vr.prototype.init.call(this),o=o||{},this.baseMediaDecodeTime=o.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var m={};this.transmuxPipeline_=m,m.type="aac",m.metadataStream=new ei.MetadataStream,m.aacStream=new Nf,m.audioTimestampRolloverStream=new ei.TimestampRolloverStream("audio"),m.timedMetadataTimestampRolloverStream=new ei.TimestampRolloverStream("timed-metadata"),m.adtsStream=new pl,m.coalesceStream=new ki(o,m.metadataStream),m.headOfPipeline=m.aacStream,m.aacStream.pipe(m.audioTimestampRolloverStream).pipe(m.adtsStream),m.aacStream.pipe(m.timedMetadataTimestampRolloverStream).pipe(m.metadataStream).pipe(m.coalesceStream),m.metadataStream.on("timestamp",function(x){m.aacStream.setTimestamp(x.timeStamp)}),m.aacStream.on("data",function(x){x.type!=="timed-metadata"&&x.type!=="audio"||m.audioSegmentStream||(p=p||{timelineStartInfo:{baseMediaDecodeTime:u.baseMediaDecodeTime},codec:"adts",type:"audio"},m.coalesceStream.numberOfTracks++,m.audioSegmentStream=new Us(p,o),m.audioSegmentStream.on("log",u.getLogTrigger_("audioSegmentStream")),m.audioSegmentStream.on("timingInfo",u.trigger.bind(u,"audioTimingInfo")),m.adtsStream.pipe(m.audioSegmentStream).pipe(m.coalesceStream),u.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d}))}),m.coalesceStream.on("data",this.trigger.bind(this,"data")),m.coalesceStream.on("done",this.trigger.bind(this,"done")),vl(this,m)},this.setupTsPipeline=function(){var m={};this.transmuxPipeline_=m,m.type="ts",m.metadataStream=new ei.MetadataStream,m.packetStream=new ei.TransportPacketStream,m.parseStream=new ei.TransportParseStream,m.elementaryStream=new ei.ElementaryStream,m.timestampRolloverStream=new ei.TimestampRolloverStream,m.adtsStream=new pl,m.h264Stream=new Rf,m.captionStream=new ei.CaptionStream(o),m.coalesceStream=new ki(o,m.metadataStream),m.headOfPipeline=m.packetStream,m.packetStream.pipe(m.parseStream).pipe(m.elementaryStream).pipe(m.timestampRolloverStream),m.timestampRolloverStream.pipe(m.h264Stream),m.timestampRolloverStream.pipe(m.adtsStream),m.timestampRolloverStream.pipe(m.metadataStream).pipe(m.coalesceStream),m.h264Stream.pipe(m.captionStream).pipe(m.coalesceStream),m.elementaryStream.on("data",function(x){var S;if(x.type==="metadata"){for(S=x.tracks.length;S--;)!d&&x.tracks[S].type==="video"?(d=x.tracks[S],d.timelineStartInfo.baseMediaDecodeTime=u.baseMediaDecodeTime):!p&&x.tracks[S].type==="audio"&&(p=x.tracks[S],p.timelineStartInfo.baseMediaDecodeTime=u.baseMediaDecodeTime);d&&!m.videoSegmentStream&&(m.coalesceStream.numberOfTracks++,m.videoSegmentStream=new Ur(d,o),m.videoSegmentStream.on("log",u.getLogTrigger_("videoSegmentStream")),m.videoSegmentStream.on("timelineStartInfo",function(A){p&&!o.keepOriginalTimestamps&&(p.timelineStartInfo=A,m.audioSegmentStream.setEarliestDts(A.dts-u.baseMediaDecodeTime))}),m.videoSegmentStream.on("processedGopsInfo",u.trigger.bind(u,"gopInfo")),m.videoSegmentStream.on("segmentTimingInfo",u.trigger.bind(u,"videoSegmentTimingInfo")),m.videoSegmentStream.on("baseMediaDecodeTime",function(A){p&&m.audioSegmentStream.setVideoBaseMediaDecodeTime(A)}),m.videoSegmentStream.on("timingInfo",u.trigger.bind(u,"videoTimingInfo")),m.h264Stream.pipe(m.videoSegmentStream).pipe(m.coalesceStream)),p&&!m.audioSegmentStream&&(m.coalesceStream.numberOfTracks++,m.audioSegmentStream=new Us(p,o),m.audioSegmentStream.on("log",u.getLogTrigger_("audioSegmentStream")),m.audioSegmentStream.on("timingInfo",u.trigger.bind(u,"audioTimingInfo")),m.audioSegmentStream.on("segmentTimingInfo",u.trigger.bind(u,"audioSegmentTimingInfo")),m.adtsStream.pipe(m.audioSegmentStream).pipe(m.coalesceStream)),u.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d})}}),m.coalesceStream.on("data",this.trigger.bind(this,"data")),m.coalesceStream.on("id3Frame",function(x){x.dispatchType=m.metadataStream.dispatchType,u.trigger("id3Frame",x)}),m.coalesceStream.on("caption",this.trigger.bind(this,"caption")),m.coalesceStream.on("done",this.trigger.bind(this,"done")),vl(this,m)},this.setBaseMediaDecodeTime=function(m){var x=this.transmuxPipeline_;o.keepOriginalTimestamps||(this.baseMediaDecodeTime=m),p&&(p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,Ot.clearDtsInfo(p),x.audioTimestampRolloverStream&&x.audioTimestampRolloverStream.discontinuity()),d&&(x.videoSegmentStream&&(x.videoSegmentStream.gopCache_=[]),d.timelineStartInfo.dts=void 0,d.timelineStartInfo.pts=void 0,Ot.clearDtsInfo(d),x.captionStream.reset()),x.timestampRolloverStream&&x.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(m){p&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(m)},this.setRemux=function(m){var x=this.transmuxPipeline_;o.remux=m,x&&x.coalesceStream&&x.coalesceStream.setRemux(m)},this.alignGopsWith=function(m){d&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(m)},this.getLogTrigger_=function(m){var x=this;return function(S){S.stream=m,x.trigger("log",S)}},this.push=function(m){if(h){var x=Bf(m);x&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!x&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),h=!1}this.transmuxPipeline_.headOfPipeline.push(m)},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()}},Vr.prototype=new Nr;var Vf={Transmuxer:Vr},qf=function(o){return o>>>0},Hf=function(o){return("00"+o.toString(16)).slice(-2)},qr={toUnsigned:qf,toHexString:Hf},zf=function(o){var u="";return u+=String.fromCharCode(o[0]),u+=String.fromCharCode(o[1]),u+=String.fromCharCode(o[2]),u+=String.fromCharCode(o[3]),u},bl=zf,$f=qr.toUnsigned,Gf=bl,Tl=function(o,u){var h=[],d,p,m,x,S;if(!u.length)return null;for(d=0;d<o.byteLength;)p=$f(o[d]<<24|o[d+1]<<16|o[d+2]<<8|o[d+3]),m=Gf(o.subarray(d+4,d+8)),x=p>1?d+p:o.byteLength,m===u[0]&&(u.length===1?h.push(o.subarray(d+8,x)):(S=Tl(o.subarray(d+8,x),u.slice(1)),S.length&&(h=h.concat(S)))),d=x;return h},ea=Tl,Wf=qr.toUnsigned,Xf=n.getUint64,Yf=function(o){var u={version:o[0],flags:new Uint8Array(o.subarray(1,4))};return u.version===1?u.baseMediaDecodeTime=Xf(o.subarray(4)):u.baseMediaDecodeTime=Wf(o[4]<<24|o[5]<<16|o[6]<<8|o[7]),u},ta=Yf,Kf=function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),h={version:o[0],flags:new Uint8Array(o.subarray(1,4)),trackId:u.getUint32(4)},d=h.flags[2]&1,p=h.flags[2]&2,m=h.flags[2]&8,x=h.flags[2]&16,S=h.flags[2]&32,A=h.flags[0]&65536,D=h.flags[0]&131072,M;return M=8,d&&(M+=4,h.baseDataOffset=u.getUint32(12),M+=4),p&&(h.sampleDescriptionIndex=u.getUint32(M),M+=4),m&&(h.defaultSampleDuration=u.getUint32(M),M+=4),x&&(h.defaultSampleSize=u.getUint32(M),M+=4),S&&(h.defaultSampleFlags=u.getUint32(M)),A&&(h.durationIsEmpty=!0),!d&&D&&(h.baseDataOffsetIsMoof=!0),h},xl=Kf,Qf=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]}},Jf=Qf,Sl=Jf,Zf=function(o){var u={version:o[0],flags:new Uint8Array(o.subarray(1,4)),samples:[]},h=new DataView(o.buffer,o.byteOffset,o.byteLength),d=u.flags[2]&1,p=u.flags[2]&4,m=u.flags[1]&1,x=u.flags[1]&2,S=u.flags[1]&4,A=u.flags[1]&8,D=h.getUint32(4),M=8,W;for(d&&(u.dataOffset=h.getInt32(M),M+=4),p&&D&&(W={flags:Sl(o.subarray(M,M+4))},M+=4,m&&(W.duration=h.getUint32(M),M+=4),x&&(W.size=h.getUint32(M),M+=4),A&&(u.version===1?W.compositionTimeOffset=h.getInt32(M):W.compositionTimeOffset=h.getUint32(M),M+=4),u.samples.push(W),D--);D--;)W={},m&&(W.duration=h.getUint32(M),M+=4),x&&(W.size=h.getUint32(M),M+=4),S&&(W.flags=Sl(o.subarray(M,M+4)),M+=4),A&&(u.version===1?W.compositionTimeOffset=h.getInt32(M):W.compositionTimeOffset=h.getUint32(M),M+=4),u.samples.push(W);return u},Cl=Zf,El={tfdt:ta,trun:Cl},Al={parseTfdt:El.tfdt,parseTrun:El.trun},ep=function(o){for(var u=0,h=String.fromCharCode(o[u]),d="";h!=="\0";)d+=h,u++,h=String.fromCharCode(o[u]);return d+=h,d},tp={uint8ToCString:ep},Hr=tp.uint8ToCString,ip=n.getUint64,sp=function(o){var u=4,h=o[0],d,p,m,x,S,A,D,M;if(h===0){d=Hr(o.subarray(u)),u+=d.length,p=Hr(o.subarray(u)),u+=p.length;var W=new DataView(o.buffer);m=W.getUint32(u),u+=4,S=W.getUint32(u),u+=4,A=W.getUint32(u),u+=4,D=W.getUint32(u),u+=4}else if(h===1){var W=new DataView(o.buffer);m=W.getUint32(u),u+=4,x=ip(o.subarray(u)),u+=8,A=W.getUint32(u),u+=4,D=W.getUint32(u),u+=4,d=Hr(o.subarray(u)),u+=d.length,p=Hr(o.subarray(u)),u+=p.length}M=new Uint8Array(o.subarray(u,o.byteLength));var ae={scheme_id_uri:d,value:p,timescale:m||1,presentation_time:x,presentation_time_delta:S,event_duration:A,id:D,message_data:M};return np(h,ae)?ae:void 0},rp=function(o,u,h,d){return o||o===0?o/u:d+h/u},np=function(o,u){var h=u.scheme_id_uri!=="\0",d=o===0&&wl(u.presentation_time_delta)&&h,p=o===1&&wl(u.presentation_time)&&h;return!(o>1)&&d||p},wl=function(o){return o!==void 0||o!==null},ap={parseEmsgBox:sp,scaleTime:rp},Vs;typeof window<"u"?Vs=window:typeof s<"u"?Vs=s:typeof self<"u"?Vs=self:Vs={};var Dl=Vs,zr=qr.toUnsigned,qs=qr.toHexString,Fe=ea,Xi=bl,ia=ap,op=xl,lp=Cl,up=ta,cp=n.getUint64,kl,jl,Il,Pl,Ll,sa,Ol,ra=Dl,dp=rl.parseId3Frames;kl=function(o){var u={},h=Fe(o,["moov","trak"]);return h.reduce(function(d,p){var m,x,S,A,D;return m=Fe(p,["tkhd"])[0],!m||(x=m[0],S=x===0?12:20,A=zr(m[S]<<24|m[S+1]<<16|m[S+2]<<8|m[S+3]),D=Fe(p,["mdia","mdhd"])[0],!D)?null:(x=D[0],S=x===0?12:20,d[A]=zr(D[S]<<24|D[S+1]<<16|D[S+2]<<8|D[S+3]),d)},u)},jl=function(o,u){var h;h=Fe(u,["moof","traf"]);var d=h.reduce(function(p,m){var x=Fe(m,["tfhd"])[0],S=zr(x[4]<<24|x[5]<<16|x[6]<<8|x[7]),A=o[S]||9e4,D=Fe(m,["tfdt"])[0],M=new DataView(D.buffer,D.byteOffset,D.byteLength),W;D[0]===1?W=cp(D.subarray(4,12)):W=M.getUint32(4);let ae;return typeof W=="bigint"?ae=W/ra.BigInt(A):typeof W=="number"&&!isNaN(W)&&(ae=W/A),ae<Number.MAX_SAFE_INTEGER&&(ae=Number(ae)),ae<p&&(p=ae),p},1/0);return typeof d=="bigint"||isFinite(d)?d:0},Il=function(o,u){var h=Fe(u,["moof","traf"]),d=0,p=0,m;if(h&&h.length){var x=Fe(h[0],["tfhd"])[0],S=Fe(h[0],["trun"])[0],A=Fe(h[0],["tfdt"])[0];if(x){var D=op(x);m=D.trackId}if(A){var M=up(A);d=M.baseMediaDecodeTime}if(S){var W=lp(S);W.samples&&W.samples.length&&(p=W.samples[0].compositionTimeOffset||0)}}var ae=o[m]||9e4;typeof d=="bigint"&&(p=ra.BigInt(p),ae=ra.BigInt(ae));var K=(d+p)/ae;return typeof K=="bigint"&&K<Number.MAX_SAFE_INTEGER&&(K=Number(K)),K},Pl=function(o){var u=Fe(o,["moov","trak"]),h=[];return u.forEach(function(d){var p=Fe(d,["mdia","hdlr"]),m=Fe(d,["tkhd"]);p.forEach(function(x,S){var A=Xi(x.subarray(8,12)),D=m[S],M,W,ae;A==="vide"&&(M=new DataView(D.buffer,D.byteOffset,D.byteLength),W=M.getUint8(0),ae=W===0?M.getUint32(12):M.getUint32(20),h.push(ae))})}),h},sa=function(o){var u=o[0],h=u===0?12:20;return zr(o[h]<<24|o[h+1]<<16|o[h+2]<<8|o[h+3])},Ll=function(o){var u=Fe(o,["moov","trak"]),h=[];return u.forEach(function(d){var p={},m=Fe(d,["tkhd"])[0],x,S;m&&(x=new DataView(m.buffer,m.byteOffset,m.byteLength),S=x.getUint8(0),p.id=S===0?x.getUint32(12):x.getUint32(20));var A=Fe(d,["mdia","hdlr"])[0];if(A){var D=Xi(A.subarray(8,12));D==="vide"?p.type="video":D==="soun"?p.type="audio":p.type=D}var M=Fe(d,["mdia","minf","stbl","stsd"])[0];if(M){var W=M.subarray(8);p.codec=Xi(W.subarray(4,8));var ae=Fe(W,[p.codec])[0],K,le;ae&&(/^[asm]vc[1-9]$/i.test(p.codec)?(K=ae.subarray(78),le=Xi(K.subarray(4,8)),le==="avcC"&&K.length>11?(p.codec+=".",p.codec+=qs(K[9]),p.codec+=qs(K[10]),p.codec+=qs(K[11])):p.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(p.codec)?(K=ae.subarray(28),le=Xi(K.subarray(4,8)),le==="esds"&&K.length>20&&K[19]!==0?(p.codec+="."+qs(K[19]),p.codec+="."+qs(K[20]>>>2&63).replace(/^0/,"")):p.codec="mp4a.40.2"):p.codec=p.codec.toLowerCase())}var ge=Fe(d,["mdia","mdhd"])[0];ge&&(p.timescale=sa(ge)),h.push(p)}),h},Ol=function(o,u=0){var h=Fe(o,["emsg"]);return h.map(d=>{var p=ia.parseEmsgBox(new Uint8Array(d)),m=dp(p.message_data);return{cueTime:ia.scaleTime(p.presentation_time,p.timescale,p.presentation_time_delta,u),duration:ia.scaleTime(p.event_duration,p.timescale),frames:m}})};var Hs={findBox:Fe,parseType:Xi,timescale:kl,startTime:jl,compositionStartTime:Il,videoTrackIds:Pl,tracks:Ll,getTimescaleFromMediaHeader:sa,getEmsgID3:Ol};const{parseTrun:hp}=Al,{findBox:Ml}=Hs;var Rl=Dl,fp=function(o){var u=Ml(o,["moof","traf"]),h=Ml(o,["mdat"]),d=[];return h.forEach(function(p,m){var x=u[m];d.push({mdat:p,traf:x})}),d},pp=function(o,u,h){var d=u,p=h.defaultSampleDuration||0,m=h.defaultSampleSize||0,x=h.trackId,S=[];return o.forEach(function(A){var D=hp(A),M=D.samples;M.forEach(function(W){W.duration===void 0&&(W.duration=p),W.size===void 0&&(W.size=m),W.trackId=x,W.dts=d,W.compositionTimeOffset===void 0&&(W.compositionTimeOffset=0),typeof d=="bigint"?(W.pts=d+Rl.BigInt(W.compositionTimeOffset),d+=Rl.BigInt(W.duration)):(W.pts=d+W.compositionTimeOffset,d+=W.duration)}),S=S.concat(M)}),S},Nl={getMdatTrafPairs:fp,parseSamples:pp},mp=Ct.discardEmulationPreventionBytes,gp=el.CaptionStream,na=ea,vp=ta,yp=xl,{getMdatTrafPairs:_p,parseSamples:bp}=Nl,Tp=function(o,u){for(var h=o,d=0;d<u.length;d++){var p=u[d];if(h<p.size)return p;h-=p.size}return null},xp=function(o,u,h){var d=new DataView(o.buffer,o.byteOffset,o.byteLength),p={logs:[],seiNals:[]},m,x,S,A;for(x=0;x+4<o.length;x+=S)if(S=d.getUint32(x),x+=4,!(S<=0))switch(o[x]&31){case 6:var D=o.subarray(x+1,x+1+S),M=Tp(x,u);if(m={nalUnitType:"sei_rbsp",size:S,data:D,escapedRBSP:mp(D),trackId:h},M)m.pts=M.pts,m.dts=M.dts,A=M;else if(A)m.pts=A.pts,m.dts=A.dts;else{p.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+x+" for trackId "+h+". See mux.js#223."});break}p.seiNals.push(m);break}return p},Sp=function(o,u){var h={},d=_p(o);return d.forEach(function(p){var m=p.mdat,x=p.traf,S=na(x,["tfhd"]),A=yp(S[0]),D=A.trackId,M=na(x,["tfdt"]),W=M.length>0?vp(M[0]).baseMediaDecodeTime:0,ae=na(x,["trun"]),K,le;u===D&&ae.length>0&&(K=bp(ae,W,A),le=xp(m,K,D),h[D]||(h[D]={seiNals:[],logs:[]}),h[D].seiNals=h[D].seiNals.concat(le.seiNals),h[D].logs=h[D].logs.concat(le.logs))}),h},Cp=function(o,u,h){var d;if(u===null)return null;d=Sp(o,u);var p=d[u]||{};return{seiNals:p.seiNals,logs:p.logs,timescale:h}},Ep=function(){var o=!1,u,h,d,p,m,x;this.isInitialized=function(){return o},this.init=function(S){u=new gp,o=!0,x=S?S.isPartial:!1,u.on("data",function(A){A.startTime=A.startPts/p,A.endTime=A.endPts/p,m.captions.push(A),m.captionStreams[A.stream]=!0}),u.on("log",function(A){m.logs.push(A)})},this.isNewInit=function(S,A){return S&&S.length===0||A&&typeof A=="object"&&Object.keys(A).length===0?!1:d!==S[0]||p!==A[d]},this.parse=function(S,A,D){var M;if(this.isInitialized()){if(!A||!D)return null;if(this.isNewInit(A,D))d=A[0],p=D[d];else if(d===null||!p)return h.push(S),null}else return null;for(;h.length>0;){var W=h.shift();this.parse(W,A,D)}return M=Cp(S,d,p),M&&M.logs&&(m.logs=m.logs.concat(M.logs)),M===null||!M.seiNals?m.logs.length?{logs:m.logs,captions:[],captionStreams:[]}:null:(this.pushNals(M.seiNals),this.flushStream(),m)},this.pushNals=function(S){if(!this.isInitialized()||!S||S.length===0)return null;S.forEach(function(A){u.push(A)})},this.flushStream=function(){if(!this.isInitialized())return null;x?u.partialFlush():u.flush()},this.clearParsedCaptions=function(){m.captions=[],m.captionStreams={},m.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;u.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){h=[],d=null,p=null,m?this.clearParsedCaptions():m={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Ap=Ep;const{parseTfdt:wp}=Al,pi=ea,{getTimescaleFromMediaHeader:Dp}=Hs,{parseSamples:kp,getMdatTrafPairs:jp}=Nl;var Bl=function(){let o=9e4;this.init=function(u){const h=pi(u,["moov","trak","mdia","mdhd"])[0];h&&(o=Dp(h))},this.parseSegment=function(u){const h=[],d=jp(u);let p=0;return d.forEach(function(m){const x=m.mdat,S=m.traf,A=pi(S,["tfdt"])[0],D=pi(S,["tfhd"])[0],M=pi(S,["trun"]);if(A&&(p=wp(A).baseMediaDecodeTime),M.length&&D){const W=kp(M,p,D);let ae=0;W.forEach(function(K){const le="utf-8",ge=new TextDecoder(le),Ge=x.slice(ae,ae+K.size);if(pi(Ge,["vtte"])[0]){ae+=K.size;return}pi(Ge,["vttc"]).forEach(function(zs){const $s=pi(zs,["payl"])[0],Gs=pi(zs,["sttg"])[0],Ws=K.pts/o,Wr=(K.pts+K.duration)/o;let je,Xs;if($s)try{je=ge.decode($s)}catch(Mt){console.error(Mt)}if(Gs)try{Xs=ge.decode(Gs)}catch(Mt){console.error(Mt)}K.duration&&je&&h.push({cueText:je,start:Ws,end:Wr,settings:Xs})}),ae+=K.size})}}),h}},aa=wr,Fl=function(o){var u=o[1]&31;return u<<=8,u|=o[2],u},$r=function(o){return!!(o[1]&64)},Gr=function(o){var u=0;return(o[3]&48)>>>4>1&&(u+=o[4]+1),u},Ip=function(o,u){var h=Fl(o);return h===0?"pat":h===u?"pmt":u?"pes":null},Pp=function(o){var u=$r(o),h=4+Gr(o);return u&&(h+=o[h]+1),(o[h+10]&31)<<8|o[h+11]},Lp=function(o){var u={},h=$r(o),d=4+Gr(o);if(h&&(d+=o[d]+1),!!(o[d+5]&1)){var p,m,x;p=(o[d+1]&15)<<8|o[d+2],m=3+p-4,x=(o[d+10]&15)<<8|o[d+11];for(var S=12+x;S<m;){var A=d+S;u[(o[A+1]&31)<<8|o[A+2]]=o[A],S+=((o[A+3]&15)<<8|o[A+4])+5}return u}},Op=function(o,u){var h=Fl(o),d=u[h];switch(d){case aa.H264_STREAM_TYPE:return"video";case aa.ADTS_STREAM_TYPE:return"audio";case aa.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Mp=function(o){var u=$r(o);if(!u)return null;var h=4+Gr(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},oa=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}},Rp=function(o){for(var u=4+Gr(o),h=o.subarray(u),d=0,p=0,m=!1,x;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&&(x=oa(h[p+3]&31),x==="slice_layer_without_partitioning_rbsp_idr"&&(m=!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}x=oa(h[p+3]&31),x==="slice_layer_without_partitioning_rbsp_idr"&&(m=!0),p=d-2,d+=3;break;default:d+=3;break}return h=h.subarray(p),d-=p,p=0,h&&h.byteLength>3&&(x=oa(h[p+3]&31),x==="slice_layer_without_partitioning_rbsp_idr"&&(m=!0)),m},Np={parseType:Ip,parsePat:Pp,parsePmt:Lp,parsePayloadUnitStartIndicator:$r,parsePesType:Op,parsePesTime:Mp,videoPacketContainsKeyFrame:Rp},Ul=wr,Yi=il.handleRollover,Ce={};Ce.ts=Np,Ce.aac=Zn;var ji=Te.ONE_SECOND_IN_TS,at=188,Vt=71,Bp=function(o,u){for(var h=0,d=at,p,m;d<o.byteLength;){if(o[h]===Vt&&o[d]===Vt){switch(p=o.subarray(h,d),m=Ce.ts.parseType(p,u.pid),m){case"pat":u.pid=Ce.ts.parsePat(p);break;case"pmt":var x=Ce.ts.parsePmt(p);u.table=u.table||{},Object.keys(x).forEach(function(S){u.table[S]=x[S]});break}h+=at,d+=at;continue}h++,d++}},Vl=function(o,u,h){for(var d=0,p=at,m,x,S,A,D,M=!1;p<=o.byteLength;){if(o[d]===Vt&&(o[p]===Vt||p===o.byteLength)){if(m=o.subarray(d,p),x=Ce.ts.parseType(m,u.pid),x==="pes"&&(S=Ce.ts.parsePesType(m,u.table),A=Ce.ts.parsePayloadUnitStartIndicator(m),S==="audio"&&A&&(D=Ce.ts.parsePesTime(m),D&&(D.type="audio",h.audio.push(D),M=!0))),M)break;d+=at,p+=at;continue}d++,p++}for(p=o.byteLength,d=p-at,M=!1;d>=0;){if(o[d]===Vt&&(o[p]===Vt||p===o.byteLength)){if(m=o.subarray(d,p),x=Ce.ts.parseType(m,u.pid),x==="pes"&&(S=Ce.ts.parsePesType(m,u.table),A=Ce.ts.parsePayloadUnitStartIndicator(m),S==="audio"&&A&&(D=Ce.ts.parsePesTime(m),D&&(D.type="audio",h.audio.push(D),M=!0))),M)break;d-=at,p-=at;continue}d--,p--}},Fp=function(o,u,h){for(var d=0,p=at,m,x,S,A,D,M,W,ae,K=!1,le={data:[],size:0};p<o.byteLength;){if(o[d]===Vt&&o[p]===Vt){switch(m=o.subarray(d,p),x=Ce.ts.parseType(m,u.pid),x){case"pes":if(S=Ce.ts.parsePesType(m,u.table),A=Ce.ts.parsePayloadUnitStartIndicator(m),S==="video"&&(A&&!K&&(D=Ce.ts.parsePesTime(m),D&&(D.type="video",h.video.push(D),K=!0)),!h.firstKeyFrame)){if(A&&le.size!==0){for(M=new Uint8Array(le.size),W=0;le.data.length;)ae=le.data.shift(),M.set(ae,W),W+=ae.byteLength;if(Ce.ts.videoPacketContainsKeyFrame(M)){var ge=Ce.ts.parsePesTime(M);ge?(h.firstKeyFrame=ge,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.")}le.size=0}le.data.push(m),le.size+=m.byteLength}break}if(K&&h.firstKeyFrame)break;d+=at,p+=at;continue}d++,p++}for(p=o.byteLength,d=p-at,K=!1;d>=0;){if(o[d]===Vt&&o[p]===Vt){if(m=o.subarray(d,p),x=Ce.ts.parseType(m,u.pid),x==="pes"&&(S=Ce.ts.parsePesType(m,u.table),A=Ce.ts.parsePayloadUnitStartIndicator(m),S==="video"&&A&&(D=Ce.ts.parsePesTime(m),D&&(D.type="video",h.video.push(D),K=!0))),K)break;d-=at,p-=at;continue}d--,p--}},Up=function(o,u){if(o.audio&&o.audio.length){var h=u;(typeof h>"u"||isNaN(h))&&(h=o.audio[0].dts),o.audio.forEach(function(m){m.dts=Yi(m.dts,h),m.pts=Yi(m.pts,h),m.dtsTime=m.dts/ji,m.ptsTime=m.pts/ji})}if(o.video&&o.video.length){var d=u;if((typeof d>"u"||isNaN(d))&&(d=o.video[0].dts),o.video.forEach(function(m){m.dts=Yi(m.dts,d),m.pts=Yi(m.pts,d),m.dtsTime=m.dts/ji,m.ptsTime=m.pts/ji}),o.firstKeyFrame){var p=o.firstKeyFrame;p.dts=Yi(p.dts,d),p.pts=Yi(p.pts,d),p.dtsTime=p.dts/ji,p.ptsTime=p.pts/ji}}},Vp=function(o){for(var u=!1,h=0,d=null,p=null,m=0,x=0,S;o.length-x>=3;){var A=Ce.aac.parseType(o,x);switch(A){case"timed-metadata":if(o.length-x<10){u=!0;break}if(m=Ce.aac.parseId3TagSize(o,x),m>o.length){u=!0;break}p===null&&(S=o.subarray(x,x+m),p=Ce.aac.parseAacTimestamp(S)),x+=m;break;case"audio":if(o.length-x<7){u=!0;break}if(m=Ce.aac.parseAdtsSize(o,x),m>o.length){u=!0;break}d===null&&(S=o.subarray(x,x+m),d=Ce.aac.parseSampleRate(S)),h++,x+=m;break;default:x++;break}if(u)return null}if(d===null||p===null)return null;var D=ji/d,M={audio:[{type:"audio",dts:p,pts:p},{type:"audio",dts:p+h*1024*D,pts:p+h*1024*D}]};return M},qp=function(o){var u={pid:null,table:null},h={};Bp(o,u);for(var d in u.table)if(u.table.hasOwnProperty(d)){var p=u.table[d];switch(p){case Ul.H264_STREAM_TYPE:h.video=[],Fp(o,u,h),h.video.length===0&&delete h.video;break;case Ul.ADTS_STREAM_TYPE:h.audio=[],Vl(o,u,h),h.audio.length===0&&delete h.audio;break}}return h},Hp=function(o,u){var h=Ce.aac.isLikelyAacData(o),d;return h?d=Vp(o):d=qp(o),!d||!d.audio&&!d.video?null:(Up(d,u),d)},zp={inspect:Hp,parseAudioPes_:Vl};const $p=function(o,u){u.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])}),u.on("done",function(h){o.postMessage({action:"done"})}),u.on("gopInfo",function(h){o.postMessage({action:"gopInfo",gopInfo:h})}),u.on("videoSegmentTimingInfo",function(h){const d={start:{decode:Te.videoTsToSeconds(h.start.dts),presentation:Te.videoTsToSeconds(h.start.pts)},end:{decode:Te.videoTsToSeconds(h.end.dts),presentation:Te.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:Te.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(d.prependedContentDuration=Te.videoTsToSeconds(h.prependedContentDuration)),o.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:d})}),u.on("audioSegmentTimingInfo",function(h){const d={start:{decode:Te.videoTsToSeconds(h.start.dts),presentation:Te.videoTsToSeconds(h.start.pts)},end:{decode:Te.videoTsToSeconds(h.end.dts),presentation:Te.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:Te.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(d.prependedContentDuration=Te.videoTsToSeconds(h.prependedContentDuration)),o.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:d})}),u.on("id3Frame",function(h){o.postMessage({action:"id3Frame",id3Frame:h})}),u.on("caption",function(h){o.postMessage({action:"caption",caption:h})}),u.on("trackinfo",function(h){o.postMessage({action:"trackinfo",trackInfo:h})}),u.on("audioTimingInfo",function(h){o.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:Te.videoTsToSeconds(h.start),end:Te.videoTsToSeconds(h.end)}})}),u.on("videoTimingInfo",function(h){o.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:Te.videoTsToSeconds(h.start),end:Te.videoTsToSeconds(h.end)}})}),u.on("log",function(h){o.postMessage({action:"log",log:h})})};class ql{constructor(u,h){this.options=h||{},this.self=u,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Vf.Transmuxer(this.options),$p(this.self,this.transmuxer)}pushMp4Captions(u){this.captionParser||(this.captionParser=new Ap,this.captionParser.init());const h=new Uint8Array(u.data,u.byteOffset,u.byteLength),d=this.captionParser.parse(h,u.trackIds,u.timescales);this.self.postMessage({action:"mp4Captions",captions:d&&d.captions||[],logs:d&&d.logs||[],data:h.buffer},[h.buffer])}initMp4WebVttParser(u){this.webVttParser||(this.webVttParser=new Bl);const h=new Uint8Array(u.data,u.byteOffset,u.byteLength);this.webVttParser.init(h)}getMp4WebVttText(u){this.webVttParser||(this.webVttParser=new Bl);const h=new Uint8Array(u.data,u.byteOffset,u.byteLength),d=this.webVttParser.parseSegment(h);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:d||[],data:h.buffer},[h.buffer])}probeMp4StartTime({timescales:u,data:h}){const d=Hs.startTime(u,h);this.self.postMessage({action:"probeMp4StartTime",startTime:d,data:h},[h.buffer])}probeMp4Tracks({data:u}){const h=Hs.tracks(u);this.self.postMessage({action:"probeMp4Tracks",tracks:h,data:u},[u.buffer])}probeEmsgID3({data:u,offset:h}){const d=Hs.getEmsgID3(u,h);this.self.postMessage({action:"probeEmsgID3",id3Frames:d,emsgData:u},[u.buffer])}probeTs({data:u,baseStartTime:h}){const d=typeof h=="number"&&!isNaN(h)?h*Te.ONE_SECOND_IN_TS:void 0,p=zp.inspect(u,d);let m=null;p&&(m={hasVideo:p.video&&p.video.length===2||!1,hasAudio:p.audio&&p.audio.length===2||!1},m.hasVideo&&(m.videoStart=p.video[0].ptsTime),m.hasAudio&&(m.audioStart=p.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:m,data:u},[u.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(u){const h=new Uint8Array(u.data,u.byteOffset,u.byteLength);this.transmuxer.push(h)}reset(){this.transmuxer.reset()}setTimestampOffset(u){const h=u.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(Te.secondsToVideoTs(h)))}setAudioAppendStart(u){this.transmuxer.setAudioAppendStart(Math.ceil(Te.secondsToVideoTs(u.appendStart)))}setRemux(u){this.transmuxer.setRemux(u.remux)}flush(u){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(u){this.transmuxer.alignGopsWith(u.gopsToAlignWith.slice())}}self.onmessage=function(o){if(o.data.action==="init"&&o.data.options){this.messageHandlers=new ql(self,o.data.options);return}this.messageHandlers||(this.messageHandlers=new ql(self)),o.data&&o.data.action&&o.data.action!=="init"&&this.messageHandlers[o.data.action]&&this.messageHandlers[o.data.action](o.data)}}));var g2=Dh(m2);const v2=(s,e,t)=>{const{type:i,initSegment:r,captions:n,captionStreams:a,metadata:l,videoFrameDtsTime:c,videoFramePtsTime:f}=s.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:l});const g=s.data.segment.boxes||{data:s.data.segment.data},y={type:i,data:new Uint8Array(g.data,g.data.byteOffset,g.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof c<"u"&&(y.videoFrameDtsTime=c),typeof f<"u"&&(y.videoFramePtsTime=f),t(y)},y2=({transmuxedData:s,callback:e})=>{s.buffer=[],e(s)},_2=(s,e)=>{e.gopInfo=s.data.gopInfo},Ih=s=>{const{transmuxer:e,bytes:t,audioAppendStart:i,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:l,onAudioTimingInfo:c,onVideoTimingInfo:f,onVideoSegmentTimingInfo:g,onAudioSegmentTimingInfo:y,onId3:k,onCaptions:E,onDone:L,onEndedTimeline:_,onTransmuxerLog:I,isEndOfTimeline:N,segment:R,triggerSegmentEventFn:P}=s,$={buffer:[]};let U=N;const V=G=>{e.currentTransmux===s&&(G.data.action==="data"&&v2(G,$,a),G.data.action==="trackinfo"&&l(G.data.trackInfo),G.data.action==="gopInfo"&&_2(G,$),G.data.action==="audioTimingInfo"&&c(G.data.audioTimingInfo),G.data.action==="videoTimingInfo"&&f(G.data.videoTimingInfo),G.data.action==="videoSegmentTimingInfo"&&g(G.data.videoSegmentTimingInfo),G.data.action==="audioSegmentTimingInfo"&&y(G.data.audioSegmentTimingInfo),G.data.action==="id3Frame"&&k([G.data.id3Frame],G.data.id3Frame.dispatchType),G.data.action==="caption"&&E(G.data.caption),G.data.action==="endedtimeline"&&(U=!1,_()),G.data.action==="log"&&I(G.data.log),G.data.type==="transmuxed"&&(U||(e.onmessage=null,y2({transmuxedData:$,callback:L}),Ph(e))))},O=()=>{const G={message:"Received an error message from the transmuxer worker",metadata:{errorType:B.Error.StreamingFailedToTransmuxSegment,segmentInfo:Oi({segment:R})}};L(null,G)};if(e.onmessage=V,e.onerror=O,i&&e.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const G=t instanceof ArrayBuffer?t:t.buffer,b=t instanceof ArrayBuffer?0:t.byteOffset;P({type:"segmenttransmuxingstart",segment:R}),e.postMessage({action:"push",data:G,byteOffset:b,byteLength:t.byteLength},[G])}N&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Ph=s=>{s.currentTransmux=null,s.transmuxQueue.length&&(s.currentTransmux=s.transmuxQueue.shift(),typeof s.currentTransmux=="function"?s.currentTransmux():Ih(s.currentTransmux))},ic=(s,e)=>{s.postMessage({action:e}),Ph(s)},Lh=(s,e)=>{if(!e.currentTransmux){e.currentTransmux=s,ic(e,s);return}e.transmuxQueue.push(ic.bind(null,e,s))},b2=s=>{Lh("reset",s)},T2=s=>{Lh("endTimeline",s)},Oh=s=>{if(!s.transmuxer.currentTransmux){s.transmuxer.currentTransmux=s,Ih(s);return}s.transmuxer.transmuxQueue.push(s)},x2=s=>{const e=new g2;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:s}),e};var Ua={reset:b2,endTimeline:T2,transmux:Oh,createTransmuxer:x2};const os=function(s){const e=s.transmuxer,t=s.endAction||s.action,i=s.callback,r=Ue({},s,{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,s.byteOffset||0,s.byteLength||a.data.data.byteLength),s.data&&(s.data=a.data.data)),i(a.data))};if(e.addEventListener("message",n),s.data){const a=s.data instanceof ArrayBuffer;r.byteOffset=a?0:s.data.byteOffset,r.byteLength=s.data.byteLength;const l=[a?s.data:s.data.buffer];e.postMessage(r,l)}else e.postMessage(r)},Xt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Mh="wvtt",co=s=>{s.forEach(e=>{e.abort()})},S2=s=>({bandwidth:s.bandwidth,bytesReceived:s.bytesReceived||0,roundTripTime:s.roundTripTime||0}),C2=s=>{const e=s.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return i.bytesReceived=s.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i},Jo=(s,e)=>{const{requestType:t}=e,i=Vi({requestType:t,request:e,error:s});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Xt.TIMEOUT,xhr:e,metadata:i}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Xt.ABORTED,xhr:e,metadata:i}:s?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Xt.FAILURE,xhr:e,metadata:i}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Xt.FAILURE,xhr:e,metadata:i}:null},sc=(s,e,t,i)=>(r,n)=>{const a=n.response,l=Jo(r,n);if(l)return t(l,s);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Xt.FAILURE,xhr:n},s);const c=new DataView(a),f=new Uint32Array([c.getUint32(0),c.getUint32(4),c.getUint32(8),c.getUint32(12)]);for(let y=0;y<e.length;y++)e[y].bytes=f;const g={uri:n.uri};return i({type:"segmentkeyloadcomplete",segment:s,keyInfo:g}),t(null,s)},E2=(s,e)=>{e===Mh&&s.transmuxer.postMessage({action:"initMp4WebVttParser",data:s.map.bytes})},A2=(s,e,t)=>{e===Mh&&os({action:"getMp4WebVttText",data:s.bytes,transmuxer:s.transmuxer,callback:({data:i,mp4VttCues:r})=>{s.bytes=i,t(null,s,{mp4VttCues:r})}})},Rh=(s,e)=>{const t=To(s.map.bytes);if(t!=="mp4"){const i=s.map.resolvedUri||s.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${i}`,code:Xt.FAILURE,metadata:{mediaType:r}})}os({action:"probeMp4Tracks",data:s.map.bytes,transmuxer:s.transmuxer,callback:({tracks:i,data:r})=>(s.map.bytes=r,i.forEach(function(n){s.map.tracks=s.map.tracks||{},!s.map.tracks[n.type]&&(s.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(s.map.timescales=s.map.timescales||{},s.map.timescales[n.id]=n.timescale),n.type==="text"&&E2(s,n.codec))}),e(null))})},w2=({segment:s,finishProcessingFn:e,triggerSegmentEventFn:t})=>(i,r)=>{const n=Jo(i,r);if(n)return e(n,s);const a=new Uint8Array(r.response);if(t({type:"segmentloaded",segment:s}),s.map.key)return s.map.encryptedBytes=a,e(null,s);s.map.bytes=a,Rh(s,function(l){if(l)return l.xhr=r,l.status=r.status,e(l,s);e(null,s)})},D2=({segment:s,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:i})=>(r,n)=>{const a=Jo(r,n);if(a)return e(a,s);i({type:"segmentloaded",segment:s});const l=t==="arraybuffer"||!n.responseText?n.response:f2(n.responseText.substring(s.lastReachedChar||0));return s.stats=S2(n),s.key?s.encryptedBytes=new Uint8Array(l):s.bytes=new Uint8Array(l),e(null,s)},k2=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:E})=>{const L=s.map&&s.map.tracks||{},_=!!(L.audio&&L.video);let I=i.bind(null,s,"audio","start");const N=i.bind(null,s,"audio","end");let R=i.bind(null,s,"video","start");const P=i.bind(null,s,"video","end"),$=()=>Oh({bytes:e,transmuxer:s.transmuxer,audioAppendStart:s.audioAppendStart,gopsToAlignWith:s.gopsToAlignWith,remux:_,onData:U=>{U.type=U.type==="combined"?"video":U.type,g(s,U)},onTrackInfo:U=>{t&&(_&&(U.isMuxed=!0),t(s,U))},onAudioTimingInfo:U=>{I&&typeof U.start<"u"&&(I(U.start),I=null),N&&typeof U.end<"u"&&N(U.end)},onVideoTimingInfo:U=>{R&&typeof U.start<"u"&&(R(U.start),R=null),P&&typeof U.end<"u"&&P(U.end)},onVideoSegmentTimingInfo:U=>{const V={pts:{start:U.start.presentation,end:U.end.presentation},dts:{start:U.start.decode,end:U.end.decode}};E({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:V}),r(U)},onAudioSegmentTimingInfo:U=>{const V={pts:{start:U.start.pts,end:U.end.pts},dts:{start:U.start.dts,end:U.end.dts}};E({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:V}),n(U)},onId3:(U,V)=>{a(s,U,V)},onCaptions:U=>{l(s,[U])},isEndOfTimeline:c,onEndedTimeline:()=>{f()},onTransmuxerLog:k,onDone:(U,V)=>{y&&(U.type=U.type==="combined"?"video":U.type,E({type:"segmenttransmuxingcomplete",segment:s}),y(V,s,U))},segment:s,triggerSegmentEventFn:E});os({action:"probeTs",transmuxer:s.transmuxer,data:e,baseStartTime:s.baseStartTime,callback:U=>{s.bytes=e=U.data;const V=U.result;V&&(t(s,{hasAudio:V.hasAudio,hasVideo:V.hasVideo,isMuxed:_}),t=null),$()}})},Nh=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:E})=>{let L=new Uint8Array(e);if(K0(L)){s.isFmp4=!0;const{tracks:_}=s.map;if(_.text&&(!_.audio||!_.video)){g(s,{data:L,type:"text"}),A2(s,_.text.codec,y);return}const N={isFmp4:!0,hasVideo:!!_.video,hasAudio:!!_.audio};_.audio&&_.audio.codec&&_.audio.codec!=="enca"&&(N.audioCodec=_.audio.codec),_.video&&_.video.codec&&_.video.codec!=="encv"&&(N.videoCodec=_.video.codec),_.video&&_.audio&&(N.isMuxed=!0),t(s,N);const R=(P,$)=>{g(s,{data:L,type:N.hasAudio&&!N.isMuxed?"audio":"video"}),$&&$.length&&a(s,$),P&&P.length&&l(s,P),y(null,s,{})};os({action:"probeMp4StartTime",timescales:s.map.timescales,data:L,transmuxer:s.transmuxer,callback:({data:P,startTime:$})=>{e=P.buffer,s.bytes=L=P,N.hasAudio&&!N.isMuxed&&i(s,"audio","start",$),N.hasVideo&&i(s,"video","start",$),os({action:"probeEmsgID3",data:L,transmuxer:s.transmuxer,offset:$,callback:({emsgData:U,id3Frames:V})=>{if(e=U.buffer,s.bytes=L=U,!_.video||!U.byteLength||!s.transmuxer){R(void 0,V);return}os({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:s.transmuxer,data:L,timescales:s.map.timescales,trackIds:[_.video.id],callback:O=>{e=O.data.buffer,s.bytes=L=O.data,O.logs.forEach(function(G){k(Se(G,{stream:"mp4CaptionParser"}))}),R(O.captions,V)}})}})}});return}if(!s.transmuxer){y(null,s,{});return}if(typeof s.container>"u"&&(s.container=To(L)),s.container!=="ts"&&s.container!=="aac"){t(s,{hasAudio:!1,hasVideo:!1}),y(null,s,{});return}k2({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:E})},Bh=function({id:s,key:e,encryptedBytes:t,decryptionWorker:i,segment:r,doneFn:n},a){const l=f=>{if(f.data.source===s){i.removeEventListener("message",l);const g=f.data.decrypted;a(new Uint8Array(g.bytes,g.byteOffset,g.byteLength))}};i.onerror=()=>{const f="An error occurred in the decryption worker",g=Oi({segment:r}),y={message:f,metadata:{error:new Error(f),errorType:B.Error.StreamingFailedToDecryptSegment,segmentInfo:g,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};n(y,r)},i.addEventListener("message",l);let c;e.bytes.slice?c=e.bytes.slice():c=new Uint32Array(Array.prototype.slice.call(e.bytes)),i.postMessage(xh({source:s,encrypted:t,key:c,iv:e.iv}),[t.buffer,c.buffer])},j2=({decryptionWorker:s,segment:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:E})=>{E({type:"segmentdecryptionstart"}),Bh({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:s,segment:e,doneFn:y},L=>{e.bytes=L,E({type:"segmentdecryptioncomplete",segment:e}),Nh({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:E})})},I2=({activeXhrs:s,decryptionWorker:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:E})=>{let L=0,_=!1;return(I,N)=>{if(!_){if(I)return _=!0,co(s),y(I,N);if(L+=1,L===s.length){const R=function(){if(N.encryptedBytes)return j2({decryptionWorker:e,segment:N,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:E});Nh({segment:N,bytes:N.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:E})};if(N.endOfAllRequests=Date.now(),N.map&&N.map.encryptedBytes&&!N.map.bytes)return E({type:"segmentdecryptionstart",segment:N}),Bh({decryptionWorker:e,id:N.requestId+"-init",encryptedBytes:N.map.encryptedBytes,key:N.map.key,segment:N,doneFn:y},P=>{N.map.bytes=P,E({type:"segmentdecryptioncomplete",segment:N}),Rh(N,$=>{if($)return co(s),y($,N);R()})});R()}}}},P2=({loadendState:s,abortFn:e})=>t=>{t.target.aborted&&e&&!s.calledAbortFn&&(e(),s.calledAbortFn=!0)},L2=({segment:s,progressFn:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g})=>y=>{if(!y.target.aborted)return s.stats=Se(s.stats,C2(y)),!s.stats.firstBytesReceivedAt&&s.stats.bytesReceived&&(s.stats.firstBytesReceivedAt=Date.now()),e(y,s)},O2=({xhr:s,xhrOptions:e,decryptionWorker:t,segment:i,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:f,id3Fn:g,captionsFn:y,isEndOfTimeline:k,endedTimelineFn:E,dataFn:L,doneFn:_,onTransmuxerLog:I,triggerSegmentEventFn:N})=>{const R=[],P=I2({activeXhrs:R,decryptionWorker:t,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:f,id3Fn:g,captionsFn:y,isEndOfTimeline:k,endedTimelineFn:E,dataFn:L,doneFn:_,onTransmuxerLog:I,triggerSegmentEventFn:N});if(i.key&&!i.key.bytes){const G=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&G.push(i.map.key);const b=Se(e,{uri:i.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),C=sc(i,G,P,N),F={uri:i.key.resolvedUri};N({type:"segmentkeyloadstart",segment:i,keyInfo:F});const z=s(b,C);R.push(z)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){const z=Se(e,{uri:i.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),H=sc(i,[i.map.key],P,N),Q={uri:i.map.key.resolvedUri};N({type:"segmentkeyloadstart",segment:i,keyInfo:Q});const ie=s(z,H);R.push(ie)}const b=Se(e,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:lo(i.map),requestType:"segment-media-initialization"}),C=w2({segment:i,finishProcessingFn:P,triggerSegmentEventFn:N});N({type:"segmentloadstart",segment:i});const F=s(b,C);R.push(F)}const $=Se(e,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:lo(i),requestType:"segment"}),U=D2({segment:i,finishProcessingFn:P,responseType:$.responseType,triggerSegmentEventFn:N});N({type:"segmentloadstart",segment:i});const V=s($,U);V.addEventListener("progress",L2({segment:i,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:f,id3Fn:g,captionsFn:y,isEndOfTimeline:k,endedTimelineFn:E,dataFn:L})),R.push(V);const O={};return R.forEach(G=>{G.addEventListener("loadend",P2({loadendState:O,abortFn:r}))}),()=>co(R)},Zr=It("PlaylistSelector"),rc=function(s){if(!s||!s.playlist)return;const e=s.playlist;return JSON.stringify({id:e.id,bandwidth:s.bandwidth,width:s.width,height:s.height,codecs:e.attributes&&e.attributes.CODECS||""})},ls=function(s,e){if(!s)return"";const t=w.getComputedStyle(s);return t?t[e]:""},us=function(s,e){const t=s.slice();s.sort(function(i,r){const n=e(i,r);return n===0?t.indexOf(i)-t.indexOf(r):n})},Zo=function(s,e){let t,i;return s.attributes.BANDWIDTH&&(t=s.attributes.BANDWIDTH),t=t||w.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||w.Number.MAX_VALUE,t-i},M2=function(s,e){let t,i;return s.attributes.RESOLUTION&&s.attributes.RESOLUTION.width&&(t=s.attributes.RESOLUTION.width),t=t||w.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||w.Number.MAX_VALUE,t===i&&s.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?s.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-i};let Fh=function(s){const{main:e,bandwidth:t,playerWidth:i,playerHeight:r,playerObjectFit:n,limitRenditionByPlayerDimensions:a,playlistController:l}=s;if(!e)return;const c={bandwidth:t,width:i,height:r,limitRenditionByPlayerDimensions:a};let f=e.playlists;ft.isAudioOnly(e)&&(f=l.getAudioTrackPlaylists_(),c.audioOnly=!0);let g=f.map(O=>{let G;const b=O.attributes&&O.attributes.RESOLUTION&&O.attributes.RESOLUTION.width,C=O.attributes&&O.attributes.RESOLUTION&&O.attributes.RESOLUTION.height;return G=O.attributes&&O.attributes.BANDWIDTH,G=G||w.Number.MAX_VALUE,{bandwidth:G,width:b,height:C,playlist:O}});us(g,(O,G)=>O.bandwidth-G.bandwidth),g=g.filter(O=>!ft.isIncompatible(O.playlist));let y=g.filter(O=>ft.isEnabled(O.playlist));y.length||(y=g.filter(O=>!ft.isDisabled(O.playlist)));const k=y.filter(O=>O.bandwidth*We.BANDWIDTH_VARIANCE<t);let E=k[k.length-1];const L=k.filter(O=>O.bandwidth===E.bandwidth)[0];if(a===!1){const O=L||y[0]||g[0];if(O&&O.playlist){let G="sortedPlaylistReps";return L&&(G="bandwidthBestRep"),y[0]&&(G="enabledPlaylistReps"),Zr(`choosing ${rc(O)} using ${G} with options`,c),O.playlist}return Zr("could not choose a playlist with options",c),null}const _=k.filter(O=>O.width&&O.height);us(_,(O,G)=>O.width-G.width);const I=_.filter(O=>O.width===i&&O.height===r);E=I[I.length-1];const N=I.filter(O=>O.bandwidth===E.bandwidth)[0];let R,P,$;N||(R=_.filter(O=>n==="cover"?O.width>i&&O.height>r:O.width>i||O.height>r),P=R.filter(O=>O.width===R[0].width&&O.height===R[0].height),E=P[P.length-1],$=P.filter(O=>O.bandwidth===E.bandwidth)[0]);let U;if(l.leastPixelDiffSelector){const O=_.map(G=>(G.pixelDiff=Math.abs(G.width-i)+Math.abs(G.height-r),G));us(O,(G,b)=>G.pixelDiff===b.pixelDiff?b.bandwidth-G.bandwidth:G.pixelDiff-b.pixelDiff),U=O[0]}const V=U||$||N||L||y[0]||g[0];if(V&&V.playlist){let O="sortedPlaylistReps";return U?O="leastPixelDiffRep":$?O="resolutionPlusOneRep":N?O="resolutionBestRep":L?O="bandwidthBestRep":y[0]&&(O="enabledPlaylistReps"),Zr(`choosing ${rc(V)} using ${O} with options`,c),V.playlist}return Zr("could not choose a playlist with options",c),null};const nc=function(){let s=this.useDevicePixelRatio&&w.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),Fh({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(ls(this.tech_.el(),"width"),10)*s,playerHeight:parseInt(ls(this.tech_.el(),"height"),10)*s,playerObjectFit:this.usePlayerObjectFit?ls(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},R2=function(s){let e=-1,t=-1;if(s<0||s>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let i=this.useDevicePixelRatio&&w.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=s*this.systemBandwidth+(1-s)*e,t=this.systemBandwidth),Fh({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(ls(this.tech_.el(),"width"),10)*i,playerHeight:parseInt(ls(this.tech_.el(),"height"),10)*i,playerObjectFit:this.usePlayerObjectFit?ls(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},N2=function(s){const{main:e,currentTime:t,bandwidth:i,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:l,syncController:c}=s,f=e.playlists.filter(L=>!ft.isIncompatible(L));let g=f.filter(ft.isEnabled);g.length||(g=f.filter(L=>!ft.isDisabled(L)));const k=g.filter(ft.hasAttribute.bind(null,"BANDWIDTH")).map(L=>{const I=c.getSyncPoint(L,r,l,t)?1:2,R=ft.estimateSegmentRequestTime(n,i,L)*I-a;return{playlist:L,rebufferingImpact:R}}),E=k.filter(L=>L.rebufferingImpact<=0);return us(E,(L,_)=>Zo(_.playlist,L.playlist)),E.length?E[0]:(us(k,(L,_)=>L.rebufferingImpact-_.rebufferingImpact),k[0]||null)},B2=function(){const s=this.playlists.main.playlists.filter(ft.isEnabled);return us(s,(t,i)=>Zo(t,i)),s.filter(t=>!!lr(this.playlists.main,t).video)[0]||null},F2=s=>{let e=0,t;return s.bytes&&(t=new Uint8Array(s.bytes),s.segments.forEach(i=>{t.set(i,e),e+=i.byteLength})),t};function Uh(s){try{return new URL(s).pathname.split("/").slice(-2).join("/")}catch{return""}}const U2=function(s,e,t){if(!s[t]){e.trigger({type:"usage",name:"vhs-608"});let i=t;/^cc708_/.test(t)&&(i="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(i);if(r)s[t]=r;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,l=t,c=!1;const f=n[i];f&&(a=f.label,l=f.language,c=f.default),s[t]=e.addRemoteTextTrack({kind:"captions",id:i,default:c,label:a,language:l},!1).track}}},V2=function({inbandTextTracks:s,captionArray:e,timestampOffset:t}){if(!e)return;const i=w.WebKitDataCue||w.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const l=new i(r.startTime+t,r.endTime+t,a.text);l.line=a.line,l.align="left",l.position=a.position,l.positionAlign="line-left",s[n].addCue(l)}):s[n].addCue(new i(r.startTime+t,r.endTime+t,r.text))})},q2=function(s){Object.defineProperties(s.frame,{id:{get(){return B.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),s.value.key}},value:{get(){return B.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),s.value.data}},privateData:{get(){return B.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),s.value.data}}})},H2=({inbandTextTracks:s,metadataArray:e,timestampOffset:t,videoDuration:i})=>{if(!e)return;const r=w.WebKitDataCue||w.VTTCue,n=s.metadataTrack_;if(!n||(e.forEach(g=>{const y=g.cueTime+t;typeof y!="number"||w.isNaN(y)||y<0||!(y<1/0)||!g.frames||!g.frames.length||g.frames.forEach(k=>{const E=new r(y,y,k.value||k.url||k.data||"");E.frame=k,E.value=k,q2(E),n.addCue(E)})}),!n.cues||!n.cues.length))return;const a=n.cues,l=[];for(let g=0;g<a.length;g++)a[g]&&l.push(a[g]);const c=l.reduce((g,y)=>{const k=g[y.startTime]||[];return k.push(y),g[y.startTime]=k,g},{}),f=Object.keys(c).sort((g,y)=>Number(g)-Number(y));f.forEach((g,y)=>{const k=c[g],E=isFinite(i)?i:g,L=Number(f[y+1])||E;k.forEach(_=>{_.endTime=L})})},z2={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"},$2=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),G2=({inbandTextTracks:s,dateRanges:e})=>{const t=s.metadataTrack_;if(!t)return;const i=w.WebKitDataCue||w.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if($2.has(n))continue;const a=new i(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:z2[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()})},ac=(s,e,t)=>{s.metadataTrack_||(s.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,B.browser.IS_ANY_SAFARI||(s.metadataTrack_.inBandMetadataTrackDispatchType=e))},ir=function(s,e,t){let i,r;if(t&&t.cues)for(i=t.cues.length;i--;)r=t.cues[i],r.startTime>=s&&r.endTime<=e&&t.removeCue(r)},W2=function(s){const e=s.cues;if(!e)return;const t={};for(let i=e.length-1;i>=0;i--){const r=e[i],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?s.removeCue(r):t[n]=r}},X2=(s,e,t)=>{if(typeof e>"u"||e===null||!s.length)return[];const i=Math.ceil((e-t+3)*Mi.ONE_SECOND_IN_TS);let r;for(r=0;r<s.length&&!(s[r].pts>i);r++);return s.slice(r)},Y2=(s,e,t)=>{if(!e.length)return s;if(t)return e.slice();const i=e[0].pts;let r=0;for(r;r<s.length&&!(s[r].pts>=i);r++);return s.slice(0,r).concat(e)},K2=(s,e,t,i)=>{const r=Math.ceil((e-i)*Mi.ONE_SECOND_IN_TS),n=Math.ceil((t-i)*Mi.ONE_SECOND_IN_TS),a=s.slice();let l=s.length;for(;l--&&!(s[l].pts<=n););if(l===-1)return a;let c=l+1;for(;c--&&!(s[c].pts<=r););return c=Math.max(c,0),a.splice(c,l-c+1),a},Q2=function(s,e){if(!s&&!e||!s&&e||s&&!e)return!1;if(s===e)return!0;const t=Object.keys(s).sort(),i=Object.keys(e).sort();if(t.length!==i.length)return!1;for(let r=0;r<t.length;r++){const n=t[r];if(n!==i[r]||s[n]!==e[n])return!1}return!0},J2=function(s,e,t){e=e||[];const i=[];let r=0;for(let n=0;n<e.length;n++){const a=e[n];if(s===a.timeline&&(i.push(n),r+=a.duration,r>t))return n}return i.length===0?0:i[i.length-1]},Zs=1,Z2=500,oc=s=>typeof s=="number"&&isFinite(s),en=1/60,ev=(s,e,t)=>s!=="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,tv=(s,e,t)=>{let i=e-We.BACK_BUFFER_LENGTH;s.length&&(i=Math.max(i,s.start(0)));const r=e-t;return Math.min(r,i)},Ji=s=>{const{startOfSegment:e,duration:t,segment:i,part:r,playlist:{mediaSequence:n,id:a,segments:l=[]},mediaIndex:c,partIndex:f,timeline:g}=s,y=l.length-1;let k="mediaIndex/partIndex increment";s.getMediaInfoForTime?k=`getMediaInfoForTime (${s.getMediaInfoForTime})`:s.isSyncRequest&&(k="getSyncSegmentCandidate (isSyncRequest)"),s.independent&&(k+=` with independent ${s.independent}`);const E=typeof f=="number",L=s.segment.uri?"segment":"pre-segment",_=E?rh({preloadSegment:i})-1:0;return`${L} [${n+c}/${n+y}]`+(E?` part [${f}/${_}]`:"")+` segment start/end [${i.start} => ${i.end}]`+(E?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${g}] selected by [${k}] playlist [${a}]`},lc=s=>`${s}TimingInfo`,iv=({segmentTimeline:s,currentTimeline:e,startOfSegment:t,buffered:i,overrideCheck:r})=>!r&&s===e?null:s<e?t:i.length?i.end(i.length-1):t,ho=({timelineChangeController:s,currentTimeline:e,segmentTimeline:t,loaderType:i,audioDisabled:r})=>{if(e===t)return!1;if(i==="audio"){const n=s.lastTimelineChange({type:"main"});return!n||n.to!==t}if(i==="main"&&r){const n=s.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},sv=s=>{if(!s)return!1;const e=s.pendingTimelineChange({type:"audio"}),t=s.pendingTimelineChange({type:"main"}),i=e&&t,r=i&&e.to!==t.to;return!!(i&&e.from!==-1&&t.from!==-1&&r)},rv=s=>{const e=s.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=s.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},yi=s=>{const e=s.pendingSegment_;if(!e)return;if(ho({timelineChangeController:s.timelineChangeController_,currentTimeline:s.currentTimeline_,segmentTimeline:e.timeline,loaderType:s.loaderType_,audioDisabled:s.audioDisabled_})&&sv(s.timelineChangeController_)){if(rv(s)){s.timelineChangeController_.trigger("audioTimelineBehind");return}s.timelineChangeController_.trigger("fixBadTimelineChange")}},nv=s=>{let e=0;return["video","audio"].forEach(function(t){const i=s[`${t}TimingInfo`];if(!i)return;const{start:r,end:n}=i;let a;typeof r=="bigint"||typeof n=="bigint"?a=w.BigInt(n)-w.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},uc=({segmentDuration:s,maxDuration:e})=>s?Math.round(s)>e+Gt:!1,av=(s,e)=>{if(e!=="hls")return null;const t=nv({audioTimingInfo:s.audioTimingInfo,videoTimingInfo:s.videoTimingInfo});if(!t)return null;const i=s.playlist.targetDuration,r=uc({segmentDuration:t,maxDuration:i*2}),n=uc({segmentDuration:t,maxDuration:i}),a=`Segment with index ${s.mediaIndex} from playlist ${s.playlist.id} has a duration of ${t} when the reported duration is ${s.duration} and the target duration is ${i}. 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},Oi=({type:s,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),i=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:s||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:t,isMediaInitialization:i}};class fo extends B.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_=It(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(i){i!==this.state_&&(this.logger_(`${this.state_} -> ${i}`),this.state_=i,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():yi(this)}),this.sourceUpdater_.on("codecschange",i=>{this.trigger(Ue({type:"codecschange"},i))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():yi(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",i=>{this.trigger(Ue({type:"timelinechange"},i)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():yi(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():yi(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return Ua.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_&&w.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,w.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_&&Ua.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Ye();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:i,isMuxed:r}=e;if(i&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=xn(e);let r=this.initSegments_[i];return t&&!r&&e.bytes&&(this.initSegments_[i]=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 i=Sh(e);let r=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[i]=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 i=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(i&&(i.id?n=i.id:i.uri&&(n=i.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:
186
+ `),this.pushCaption(t),t.startPts=e},L.prototype.pushCaption=function(e){e.text!==``&&(this.trigger(`data`,{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:`cc708_`+e.serviceNum}),e.text=``,e.startPts=e.endPts)},L.prototype.displayWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&(t.windows[i].visible=1);return e},L.prototype.hideWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&(t.windows[i].visible=0);return e},L.prototype.toggleWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&(t.windows[i].visible^=1);return e},L.prototype.clearWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&t.windows[i].clearText();return e},L.prototype.deleteWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&t.windows[i].reset();return e},L.prototype.setPenAttributes=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.penAttr;return r=n[++e],i.textTag=(r&240)>>4,i.offset=(r&12)>>2,i.penSize=r&3,r=n[++e],i.italics=(r&128)>>7,i.underline=(r&64)>>6,i.edgeType=(r&56)>>3,i.fontStyle=r&7,e},L.prototype.setPenColor=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.penColor;return r=n[++e],i.fgOpacity=(r&192)>>6,i.fgRed=(r&48)>>4,i.fgGreen=(r&12)>>2,i.fgBlue=r&3,r=n[++e],i.bgOpacity=(r&192)>>6,i.bgRed=(r&48)>>4,i.bgGreen=(r&12)>>2,i.bgBlue=r&3,r=n[++e],i.edgeRed=(r&48)>>4,i.edgeGreen=(r&12)>>2,i.edgeBlue=r&3,e},L.prototype.setPenLocation=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,r=n[++e],i.row=r&15,r=n[++e],i.column=r&63,e},L.prototype.reset=function(e,t){var n=this.getPts(e);return this.flushDisplayed(n,t),this.initService(t.serviceNum,e)};var Ve={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},He=function(e){return e===null?``:(e=Ve[e]||e,String.fromCharCode(e))},Ue=14,We=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ge=function(){for(var e=[],t=Ue+1;t--;)e.push({text:``,indent:0,offset:0});return e},R=function(e,t){R.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_=`CC`+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(e){var t=e.ccData&32639,n,r,i,a;if(t===this.lastControlCode_){this.lastControlCode_=null;return}if((t&61440)==4096?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),r=t>>>8,i=t&255,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_=`popOn`;else if(t===this.END_OF_CAPTION_)this.mode_=`popOn`,this.clearFormatting(e.pts),this.flushDisplayed(e.pts),n=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=n,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===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(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Ge();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ge();else if(t===this.RESUME_DIRECT_CAPTIONING_)this.mode_!==`paintOn`&&(this.flushDisplayed(e.pts),this.displayed_=Ge()),this.mode_=`paintOn`,this.startPts_=e.pts;else if(this.isSpecialCharacter(r,i))r=(r&3)<<8,a=He(r|i),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(r,i))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),r=(r&3)<<8,a=He(r|i),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(r,i))this.clearFormatting(e.pts),this[this.mode_](e.pts,` `),this.column_++,(i&14)==14&&this.addFormatting(e.pts,[`i`]),(i&1)==1&&this.addFormatting(e.pts,[`u`]);else if(this.isOffsetControlCode(r,i)){let e=i&3;this.nonDisplayed_[this.row_].offset=e,this.column_+=e}else if(this.isPAC(r,i)){var o=We.indexOf(t&7968);if(this.mode_===`rollUp`&&(o-this.rollUpRows_+1<0&&(o=this.rollUpRows_-1),this.setRollUp(e.pts,o)),o!==this.row_&&o>=0&&o<=14&&(this.clearFormatting(e.pts),this.row_=o),i&1&&this.formatting_.indexOf(`u`)===-1&&this.addFormatting(e.pts,[`u`]),(t&16)==16){let e=(t&14)>>1;this.column_=e*4,this.nonDisplayed_[this.row_].indent+=e}this.isColorPAC(i)&&(i&14)==14&&this.addFormatting(e.pts,[`i`])}else this.isNormalChar(r)&&(i===0&&(i=null),a=He(r),a+=He(i),this[this.mode_](e.pts,a),this.column_+=a.length)}};R.prototype=new Pe,R.prototype.flushDisplayed=function(e){let t=e=>{this.trigger(`log`,{level:`warn`,message:`Skipping a malformed 608 caption at index `+e+`.`})},n=[];this.displayed_.forEach((e,r)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch{t(r)}e.text.length&&n.push({text:e.text,line:r+1,position:10+Math.min(70,e.indent*10)+e.offset*2.5})}else e??t(r)}),n.length&&this.trigger(`data`,{startPts:this.startPts_,endPts:e,content:n,stream:this.name_})},R.prototype.reset=function(){this.mode_=`popOn`,this.topRow_=0,this.startPts_=0,this.displayed_=Ge(),this.nonDisplayed_=Ge(),this.lastControlCode_=null,this.column_=0,this.row_=Ue,this.rollUpRows_=2,this.formatting_=[]},R.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},R.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},R.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},R.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},R.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},R.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},R.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},R.prototype.isNormalChar=function(e){return e>=32&&e<=127},R.prototype.setRollUp=function(e,t){if(this.mode_!==`rollUp`&&(this.row_=Ue,this.mode_=`rollUp`,this.flushDisplayed(e),this.nonDisplayed_=Ge(),this.displayed_=Ge()),t!==void 0&&t!==this.row_)for(var n=0;n<this.rollUpRows_;n++)this.displayed_[t-n]=this.displayed_[this.row_-n],this.displayed_[this.row_-n]={text:``,indent:0,offset:0};t===void 0&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},R.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var n=t.reduce(function(e,t){return e+`<`+t+`>`},``);this[this.mode_](e,n)},R.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce(function(e,t){return e+`</`+t+`>`},``);this.formatting_=[],this[this.mode_](e,t)}},R.prototype.popOn=function(e,t){var n=this.nonDisplayed_[this.row_].text;n+=t,this.nonDisplayed_[this.row_].text=n},R.prototype.rollUp=function(e,t){var n=this.displayed_[this.row_].text;n+=t,this.displayed_[this.row_].text=n},R.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]={text:``,indent:0,offset:0};for(e=this.row_+1;e<Ue+1;e++)this.displayed_[e]={text:``,indent:0,offset:0};for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]={text:``,indent:0,offset:0}},R.prototype.paintOn=function(e,t){var n=this.displayed_[this.row_].text;n+=t,this.displayed_[this.row_].text=n};var Ke={CaptionStream:Ie,Cea608Stream:R,Cea708Stream:L},qe={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Je=n,Ye=8589934592,Xe=4294967296,Ze=`shared`,Qe=function(e,t){var n=1;for(e>t&&(n=-1);Math.abs(t-e)>Xe;)e+=n*Ye;return e},$e=function(e){var t,n;$e.prototype.init.call(this),this.type_=e||Ze,this.push=function(e){if(e.type===`metadata`){this.trigger(`data`,e);return}this.type_!==Ze&&e.type!==this.type_||(n===void 0&&(n=e.dts),e.dts=Qe(e.dts,n),e.pts=Qe(e.pts,n),t=e.dts,this.trigger(`data`,e))},this.flush=function(){n=t,this.trigger(`done`)},this.endTimeline=function(){this.flush(),this.trigger(`endedtimeline`)},this.discontinuity=function(){n=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger(`reset`)}};$e.prototype=new Je;var et={TimestampRolloverStream:$e,handleRollover:Qe},tt={typedArrayIndexOf:(e,t,n)=>{if(!e)return-1;for(var r=n;r<e.length;r++)if(e[r]===t)return r;return-1}}.typedArrayIndexOf,nt={Iso88591:0,Utf16:1,Utf16be:2,Utf8:3},rt=function(e,t,n){var r,i=``;for(r=t;r<n;r++)i+=`%`+(`00`+e[r].toString(16)).slice(-2);return i},it=function(e,t,n){return decodeURIComponent(rt(e,t,n))},at=function(e,t,n){return unescape(rt(e,t,n))},ot=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},st={APIC:function(e){var t=1,n,r;e.data[0]===nt.Utf8&&(n=tt(e.data,0,t),!(n<0)&&(e.mimeType=at(e.data,t,n),t=n+1,e.pictureType=e.data[t],t++,r=tt(e.data,0,t),!(r<0)&&(e.description=it(e.data,t,r),t=r+1,e.mimeType===`-->`?e.url=at(e.data,t,e.data.length):e.pictureData=e.data.subarray(t,e.data.length))))},"T*":function(e){e.data[0]===nt.Utf8&&(e.value=it(e.data,1,e.data.length).replace(/\0*$/,``),e.values=e.value.split(`\0`))},TXXX:function(e){var t;e.data[0]===nt.Utf8&&(t=tt(e.data,0,1),t!==-1&&(e.description=it(e.data,1,t),e.value=it(e.data,t+1,e.data.length).replace(/\0*$/,``),e.data=e.value))},"W*":function(e){e.url=at(e.data,0,e.data.length).replace(/\0.*$/,``)},WXXX:function(e){var t;e.data[0]===nt.Utf8&&(t=tt(e.data,0,1),t!==-1&&(e.description=it(e.data,1,t),e.url=at(e.data,t+1,e.data.length).replace(/\0.*$/,``)))},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(e.data[t]===0){e.owner=at(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}},ct={parseId3Frames:function(e){var t,n,r=10,i=0,a=[];if(!(e.length<10||e[0]!==73||e[1]!==68||e[2]!==51)){i=ot(e.subarray(6,10)),i+=10,e[5]&64&&(r+=4,r+=ot(e.subarray(10,14)),i-=ot(e.subarray(16,20)));do{if(t=ot(e.subarray(r+4,r+8)),t<1)break;n=String.fromCharCode(e[r],e[r+1],e[r+2],e[r+3]);var o={id:n,data:e.subarray(r+10,r+t+10)};o.key=o.id,st[o.id]?st[o.id](o):o.id[0]===`T`?st[`T*`](o):o.id[0]===`W`&&st[`W*`](o),a.push(o),r+=10,r+=t}while(r<i);return a}},parseSyncSafeInteger:ot,frameParsers:st},lt=n,ut=qe,dt=ct,ft=function(e){var t={descriptor:e&&e.descriptor},n=0,r=[],i=0,a;if(ft.prototype.init.call(this),this.dispatchType=ut.METADATA_STREAM_TYPE.toString(16),t.descriptor)for(a=0;a<t.descriptor.length;a++)this.dispatchType+=(`00`+t.descriptor[a].toString(16)).slice(-2);this.push=function(e){var t,a,o,s,c,l;if(e.type===`timed-metadata`){if(e.dataAlignmentIndicator&&(i=0,r.length=0),r.length===0&&(e.data.length<10||e.data[0]!==73||e.data[1]!==68||e.data[2]!==51)){this.trigger(`log`,{level:`warn`,message:`Skipping unrecognized metadata packet`});return}if(r.push(e),i+=e.data.byteLength,r.length===1&&(n=dt.parseSyncSafeInteger(e.data.subarray(6,10)),n+=10),!(i<n)){for(t={data:new Uint8Array(n),frames:[],pts:r[0].pts,dts:r[0].dts},c=0;c<n;)t.data.set(r[0].data.subarray(0,n-c),c),c+=r[0].data.byteLength,i-=r[0].data.byteLength,r.shift();a=10,t.data[5]&64&&(a+=4,a+=dt.parseSyncSafeInteger(t.data.subarray(10,14)),n-=dt.parseSyncSafeInteger(t.data.subarray(16,20)));do{if(o=dt.parseSyncSafeInteger(t.data.subarray(a+4,a+8)),o<1){this.trigger(`log`,{level:`warn`,message:`Malformed ID3 frame encountered. Skipping remaining metadata parsing.`});break}if(l=String.fromCharCode(t.data[a],t.data[a+1],t.data[a+2],t.data[a+3]),s={id:l,data:t.data.subarray(a+10,a+o+10)},s.key=s.id,dt.frameParsers[s.id]?dt.frameParsers[s.id](s):s.id[0]===`T`?dt.frameParsers[`T*`](s):s.id[0]===`W`&&dt.frameParsers[`W*`](s),s.owner===`com.apple.streaming.transportStreamTimestamp`){var u=s.data,d=(u[3]&1)<<30|u[4]<<22|u[5]<<14|u[6]<<6|u[7]>>>2;d*=4,d+=u[7]&3,s.timeStamp=d,t.pts===void 0&&t.dts===void 0&&(t.pts=s.timeStamp,t.dts=s.timeStamp),this.trigger(`timestamp`,s)}t.frames.push(s),a+=10,a+=o}while(a<n);this.trigger(`data`,t)}}}};ft.prototype=new lt;var pt=ft,mt=n,ht=Ke,gt=qe,_t=et.TimestampRolloverStream,vt,yt,bt,xt=188,St=71;vt=function(){var e=new Uint8Array(xt),t=0;vt.prototype.init.call(this),this.push=function(n){var r=0,i=xt,a;for(t?(a=new Uint8Array(n.byteLength+t),a.set(e.subarray(0,t)),a.set(n,t),t=0):a=n;i<a.byteLength;){if(a[r]===St&&a[i]===St){this.trigger(`data`,a.subarray(r,i)),r+=xt,i+=xt;continue}r++,i++}r<a.byteLength&&(e.set(a.subarray(r),0),t=a.byteLength-r)},this.flush=function(){t===xt&&e[0]===St&&(this.trigger(`data`,e),t=0),this.trigger(`done`)},this.endTimeline=function(){this.flush(),this.trigger(`endedtimeline`)},this.reset=function(){t=0,this.trigger(`reset`)}},vt.prototype=new mt,yt=function(){var e,t,n,r;yt.prototype.init.call(this),r=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,r){var i=0;r.payloadUnitStartIndicator&&(i+=e[i]+1),r.type===`pat`?t(e.subarray(i),r):n(e.subarray(i),r)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],r.pmtPid=(e[10]&31)<<8|e[11],t.pmtPid=r.pmtPid},n=function(e,t){var n,i,a,o;if(e[5]&1){for(r.programMapTable={video:null,audio:null,"timed-metadata":{}},n=(e[1]&15)<<8|e[2],i=3+n-4,a=(e[10]&15)<<8|e[11],o=12+a;o<i;){var s=e[o],c=(e[o+1]&31)<<8|e[o+2];s===gt.H264_STREAM_TYPE&&r.programMapTable.video===null?r.programMapTable.video=c:s===gt.ADTS_STREAM_TYPE&&r.programMapTable.audio===null?r.programMapTable.audio=c:s===gt.METADATA_STREAM_TYPE&&(r.programMapTable[`timed-metadata`][c]=s),o+=((e[o+3]&15)<<8|e[o+4])+5}t.programMapTable=r.programMapTable}},this.push=function(t){var n={},r=4;if(n.payloadUnitStartIndicator=!!(t[1]&64),n.pid=t[1]&31,n.pid<<=8,n.pid|=t[2],(t[3]&48)>>>4>1&&(r+=t[r]+1),n.pid===0)n.type=`pat`,e(t.subarray(r),n),this.trigger(`data`,n);else if(n.pid===this.pmtPid)for(n.type=`pmt`,e(t.subarray(r),n),this.trigger(`data`,n);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([t,r,n]):this.processPes_(t,r,n)},this.processPes_=function(e,t,n){n.pid===this.programMapTable.video?n.streamType=gt.H264_STREAM_TYPE:n.pid===this.programMapTable.audio?n.streamType=gt.ADTS_STREAM_TYPE:n.streamType=this.programMapTable[`timed-metadata`][n.pid],n.type=`pes`,n.data=e.subarray(t),this.trigger(`data`,n)}},yt.prototype=new mt,yt.STREAM_TYPES={h264:27,adts:15},bt=function(){var e=this,t=!1,n={data:[],size:0},r={data:[],size:0},i={data:[],size:0},a,o=function(e,t){var n;let r=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,r===1&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=(e[6]&4)!=0,n=e[7],n&192&&(t.pts=(e[9]&14)<<27|(e[10]&255)<<20|(e[11]&254)<<12|(e[12]&255)<<5|(e[13]&254)>>>3,t.pts*=4,t.pts+=(e[13]&6)>>>1,t.dts=t.pts,n&64&&(t.dts=(e[14]&14)<<27|(e[15]&255)<<20|(e[16]&254)<<12|(e[17]&255)<<5|(e[18]&254)>>>3,t.dts*=4,t.dts+=(e[18]&6)>>>1)),t.data=e.subarray(9+e[8]))},s=function(t,n,r){var i=new Uint8Array(t.size),a={type:n},s=0,c=0,l=!1,u;if(!(!t.data.length||t.size<9)){for(a.trackId=t.data[0].pid,s=0;s<t.data.length;s++)u=t.data[s],i.set(u.data,c),c+=u.data.byteLength;o(i,a),l=n===`video`||a.packetLength<=t.size,(r||l)&&(t.size=0,t.data.length=0),l&&e.trigger(`data`,a)}};bt.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case gt.H264_STREAM_TYPE:e=n,t=`video`;break;case gt.ADTS_STREAM_TYPE:e=r,t=`audio`;break;case gt.METADATA_STREAM_TYPE:e=i,t=`timed-metadata`;break;default:return}o.payloadUnitStartIndicator&&s(e,t,!0),e.data.push(o),e.size+=o.data.byteLength},pmt:function(){var n={type:`metadata`,tracks:[]};a=o.programMapTable,a.video!==null&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+a.video,codec:`avc`,type:`video`}),a.audio!==null&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+a.audio,codec:`adts`,type:`audio`}),t=!0,e.trigger(`data`,n)}})[o.type]()},this.reset=function(){n.size=0,n.data.length=0,r.size=0,r.data.length=0,this.trigger(`reset`)},this.flushStreams_=function(){s(n,`video`),s(r,`audio`),s(i,`timed-metadata`)},this.flush=function(){if(!t&&a){var n={type:`metadata`,tracks:[]};a.video!==null&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+a.video,codec:`avc`,type:`video`}),a.audio!==null&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+a.audio,codec:`adts`,type:`audio`}),e.trigger(`data`,n)}t=!1,this.flushStreams_(),this.trigger(`done`)}},bt.prototype=new mt;var Ct={PAT_PID:0,MP2T_PACKET_LENGTH:xt,TransportPacketStream:vt,TransportParseStream:yt,ElementaryStream:bt,TimestampRolloverStream:_t,CaptionStream:ht.CaptionStream,Cea608Stream:ht.Cea608Stream,Cea708Stream:ht.Cea708Stream,MetadataStream:pt};for(var wt in gt)gt.hasOwnProperty(wt)&&(Ct[wt]=gt[wt]);var Tt=Ct,Et=n,Dt=P.ONE_SECOND_IN_TS,Ot,kt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Ot=function(e){var t,n=0;Ot.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger(`log`,{level:`warn`,message:`adts skiping bytes ${e} to ${t} in frame ${n} outside syncword`})},this.push=function(r){var i=0,a,o,s,c,l;if(e||(n=0),r.type===`audio`){t&&t.length?(s=t,t=new Uint8Array(s.byteLength+r.data.byteLength),t.set(s),t.set(r.data,s.byteLength)):t=r.data;for(var u;i+7<t.length;){if(t[i]!==255||(t[i+1]&246)!=240){typeof u!=`number`&&(u=i),i++;continue}if(typeof u==`number`&&(this.skipWarn_(u,i),u=null),o=(~t[i+1]&1)*2,a=(t[i+3]&3)<<11|t[i+4]<<3|(t[i+5]&224)>>5,c=((t[i+6]&3)+1)*1024,l=c*Dt/kt[(t[i+2]&60)>>>2],t.byteLength-i<a)break;this.trigger(`data`,{pts:r.pts+n*l,dts:r.dts+n*l,sampleCount:c,audioobjecttype:(t[i+2]>>>6&3)+1,channelcount:(t[i+2]&1)<<2|(t[i+3]&192)>>>6,samplerate:kt[(t[i+2]&60)>>>2],samplingfrequencyindex:(t[i+2]&60)>>>2,samplesize:16,data:t.subarray(i+7+o,i+a)}),n++,i+=a}typeof u==`number`&&(this.skipWarn_(u,i),u=null),t=t.subarray(i)}},this.flush=function(){n=0,this.trigger(`done`)},this.reset=function(){t=void 0,this.trigger(`reset`)},this.endTimeline=function(){t=void 0,this.trigger(`endedtimeline`)}},Ot.prototype=new Et;var At=Ot,jt=function(e){var t=e.byteLength,n=0,r=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+r},this.loadWord=function(){var i=e.byteLength-t,a=new Uint8Array(4),o=Math.min(4,t);if(o===0)throw Error(`no bytes available`);a.set(e.subarray(i,i+o)),n=new DataView(a.buffer).getUint32(0),r=o*8,t-=o},this.skipBits=function(e){var i;r>e?(n<<=e,r-=e):(e-=r,i=Math.floor(e/8),e-=i*8,t-=i,this.loadWord(),n<<=e,r-=e)},this.readBits=function(e){var i=Math.min(r,e),a=n>>>32-i;return r-=i,r>0?n<<=i:t>0&&this.loadWord(),i=e-i,i>0?a<<i|this.readBits(i):a},this.skipLeadingZeros=function(){var e;for(e=0;e<r;++e)if(n&2147483648>>>e)return n<<=e,r-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},Mt=n,Nt=jt,z,Pt=function(){var e=0,t,n;Pt.prototype.init.call(this),this.push=function(r){var i;n?(i=new Uint8Array(n.byteLength+r.data.byteLength),i.set(n),i.set(r.data,n.byteLength),n=i):n=r.data;for(var a=n.byteLength;e<a-3;e++)if(n[e+2]===1){t=e+5;break}for(;t<a;)switch(n[t]){case 0:if(n[t-1]!==0){t+=2;break}else if(n[t-2]!==0){t++;break}e+3!==t-2&&this.trigger(`data`,n.subarray(e+3,t-2));do t++;while(n[t]!==1&&t<a);e=t-2,t+=3;break;case 1:if(n[t-1]!==0||n[t-2]!==0){t+=3;break}this.trigger(`data`,n.subarray(e+3,t-2)),e=t-2,t+=3;break;default:t+=3;break}n=n.subarray(e),t-=e,e=0},this.reset=function(){n=null,e=0,this.trigger(`reset`)},this.flush=function(){n&&n.byteLength>3&&this.trigger(`data`,n.subarray(e+3)),n=null,e=0,this.trigger(`done`)},this.endTimeline=function(){this.flush(),this.trigger(`endedtimeline`)}},Ft;Pt.prototype=new Mt,Ft={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},z=function(){var e=new Pt,t,n,r,i,a,o,s;z.prototype.init.call(this),t=this,this.push=function(t){t.type===`video`&&(n=t.trackId,r=t.pts,i=t.dts,e.push(t))},e.on(`data`,function(e){var s={trackId:n,pts:r,dts:i,data:e,nalUnitTypeCode:e[0]&31};switch(s.nalUnitTypeCode){case 5:s.nalUnitType=`slice_layer_without_partitioning_rbsp_idr`;break;case 6:s.nalUnitType=`sei_rbsp`,s.escapedRBSP=a(e.subarray(1));break;case 7:s.nalUnitType=`seq_parameter_set_rbsp`,s.escapedRBSP=a(e.subarray(1)),s.config=o(s.escapedRBSP);break;case 8:s.nalUnitType=`pic_parameter_set_rbsp`;break;case 9:s.nalUnitType=`access_unit_delimiter_rbsp`;break}t.trigger(`data`,s)}),e.on(`done`,function(){t.trigger(`done`)}),e.on(`partialdone`,function(){t.trigger(`partialdone`)}),e.on(`reset`,function(){t.trigger(`reset`)}),e.on(`endedtimeline`,function(){t.trigger(`endedtimeline`)}),this.flush=function(){e.flush()},this.partialFlush=function(){e.partialFlush()},this.reset=function(){e.reset()},this.endTimeline=function(){e.endTimeline()},s=function(e,t){var n=8,r=8,i,a;for(i=0;i<e;i++)r!==0&&(a=t.readExpGolomb(),r=(n+a+256)%256),n=r===0?n:r},a=function(e){for(var t=e.byteLength,n=[],r=1,i,a;r<t-2;)e[r]===0&&e[r+1]===0&&e[r+2]===3?(n.push(r+2),r+=2):r++;if(n.length===0)return e;i=t-n.length,a=new Uint8Array(i);var o=0;for(r=0;r<i;o++,r++)o===n[0]&&(o++,n.shift()),a[r]=e[o];return a},o=function(e){var t=0,n=0,r=0,i=0,a,o,c,l,u,d,f,p,m,h,g,_=[1,1],v,y;if(a=new Nt(e),o=a.readUnsignedByte(),l=a.readUnsignedByte(),c=a.readUnsignedByte(),a.skipUnsignedExpGolomb(),Ft[o]&&(u=a.readUnsignedExpGolomb(),u===3&&a.skipBits(1),a.skipUnsignedExpGolomb(),a.skipUnsignedExpGolomb(),a.skipBits(1),a.readBoolean()))for(g=u===3?12:8,y=0;y<g;y++)a.readBoolean()&&s(y<6?16:64,a);if(a.skipUnsignedExpGolomb(),d=a.readUnsignedExpGolomb(),d===0)a.readUnsignedExpGolomb();else if(d===1)for(a.skipBits(1),a.skipExpGolomb(),a.skipExpGolomb(),f=a.readUnsignedExpGolomb(),y=0;y<f;y++)a.skipExpGolomb();if(a.skipUnsignedExpGolomb(),a.skipBits(1),p=a.readUnsignedExpGolomb(),m=a.readUnsignedExpGolomb(),h=a.readBits(1),h===0&&a.skipBits(1),a.skipBits(1),a.readBoolean()&&(t=a.readUnsignedExpGolomb(),n=a.readUnsignedExpGolomb(),r=a.readUnsignedExpGolomb(),i=a.readUnsignedExpGolomb()),a.readBoolean()&&a.readBoolean()){switch(v=a.readUnsignedByte(),v){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:_=[a.readUnsignedByte()<<8|a.readUnsignedByte(),a.readUnsignedByte()<<8|a.readUnsignedByte()];break}_&&_[0]/_[1]}return{profileIdc:o,levelIdc:c,profileCompatibility:l,width:(p+1)*16-t*2-n*2,height:(2-h)*(m+1)*16-r*2-i*2,sarRatio:_}}},z.prototype=new Mt;var It={H264Stream:z,NalByteStream:Pt},Lt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Rt=function(e,t){var n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],r=(e[t+5]&16)>>4;return n=n>=0?n:0,r?n+20:n+10},zt=function(e,t){return e.length-t<10||e[t]!==73||e[t+1]!==68||e[t+2]!==51?t:(t+=Rt(e,t),zt(e,t))},Bt=function(e){var t=zt(e,0);return e.length>=t+2&&(e[t]&255)==255&&(e[t+1]&240)==240&&(e[t+1]&22)==16},Vt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Ht=function(e,t,n){var r,i=``;for(r=t;r<n;r++)i+=`%`+(`00`+e[r].toString(16)).slice(-2);return i},Ut=function(e,t,n){return unescape(Ht(e,t,n))},Wt={isLikelyAacData:Bt,parseId3TagSize:Rt,parseAdtsSize:function(e,t){var n=(e[t+5]&224)>>5,r=e[t+4]<<3;return e[t+3]&6144|r|n},parseType:function(e,t){return e[t]===73&&e[t+1]===68&&e[t+2]===51?`timed-metadata`:e[t]&!0&&(e[t+1]&240)==240?`audio`:null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(e[t]!==255||(e[t+1]&246)!=240){t++;continue}return Lt[(e[t+2]&60)>>>2]}return null},parseAacTimestamp:function(e){var t=10,n,r,i;e[5]&64&&(t+=4,t+=Vt(e.subarray(10,14)));do{if(n=Vt(e.subarray(t+4,t+8)),n<1)return null;if(i=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]),i===`PRIV`){r=e.subarray(t+10,t+n+10);for(var a=0;a<r.byteLength;a++)if(r[a]===0){if(Ut(r,0,a)===`com.apple.streaming.transportStreamTimestamp`){var o=r.subarray(a+1),s=(o[3]&1)<<30|o[4]<<22|o[5]<<14|o[6]<<6|o[7]>>>2;return s*=4,s+=o[7]&3,s}break}}t+=10,t+=n}while(t<e.byteLength);return null}},Gt=n,Kt=Wt,qt=function(){var e=new Uint8Array,t=0;qt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(n){var r=0,i=0,a,o,s,c;for(e.length?(c=e.length,e=new Uint8Array(n.byteLength+c),e.set(e.subarray(0,c)),e.set(n,c)):e=n;e.length-i>=3;){if(e[i]===73&&e[i+1]===68&&e[i+2]===51){if(e.length-i<10||(r=Kt.parseId3TagSize(e,i),i+r>e.length))break;o={type:`timed-metadata`,data:e.subarray(i,i+r)},this.trigger(`data`,o),i+=r;continue}else if((e[i]&255)==255&&(e[i+1]&240)==240){if(e.length-i<7||(r=Kt.parseAdtsSize(e,i),i+r>e.length))break;s={type:`audio`,data:e.subarray(i,i+r),pts:t,dts:t},this.trigger(`data`,s),i+=r;continue}i++}a=e.length-i,e=a>0?e.subarray(i):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger(`reset`)},this.endTimeline=function(){e=new Uint8Array,this.trigger(`endedtimeline`)}};qt.prototype=new Gt;var Jt=qt,Yt=[`audioobjecttype`,`channelcount`,`samplerate`,`samplingfrequencyindex`,`samplesize`],Xt=[`width`,`height`,`profileIdc`,`levelIdc`,`profileCompatibility`,`sarRatio`],Zt=n,Qt=de,$t=_e,en=ke,tn=je,nn=Tt,rn=P,an=At,on=It.H264Stream,sn=Jt,cn=Wt.isLikelyAacData,ln=P.ONE_SECOND_IN_TS,un=Yt,dn=Xt,fn,pn,mn,hn,gn=function(e,t){t.stream=e,this.trigger(`log`,t)},_n=function(e,t){for(var n=Object.keys(t),r=0;r<n.length;r++){var i=n[r];i===`headOfPipeline`||!t[i].on||t[i].on(`log`,gn.bind(e,i))}},vn=function(e,t){var n;if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},yn=function(e,t,n,r,i,a){var o=n-t,s=r-t,c=i-n;return{start:{dts:e,pts:e+o},end:{dts:e+s,pts:e+c},prependedContentDuration:a,baseMediaDecodeTime:e}};pn=function(e,t){var n=[],r,i=0,a=0,o=1/0;t||={},r=t.firstSequenceNumber||0,pn.prototype.init.call(this),this.push=function(t){tn.collectDtsInfo(e,t),e&&un.forEach(function(n){e[n]=t[n]}),n.push(t)},this.setEarliestDts=function(e){i=e},this.setVideoBaseMediaDecodeTime=function(e){o=e},this.setAudioAppendStart=function(e){a=e},this.flush=function(){var s,c,l,u,d,f,p;if(n.length===0){this.trigger(`done`,`AudioSegmentStream`);return}s=en.trimAdtsFramesByEarliestDts(n,e,i),e.baseMediaDecodeTime=tn.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),p=en.prefixWithSilence(e,s,a,o),e.samples=en.generateSampleTable(s),l=Qt.mdat(en.concatenateFrameData(s)),n=[],c=Qt.moof(r,[e]),u=new Uint8Array(c.byteLength+l.byteLength),r++,u.set(c),u.set(l,c.byteLength),tn.clearDtsInfo(e),d=Math.ceil(ln*1024/e.samplerate),s.length&&(f=s.length*d,this.trigger(`segmentTimingInfo`,yn(rn.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),s[0].dts,s[0].pts,s[0].dts+f,s[0].pts+f,p||0)),this.trigger(`timingInfo`,{start:s[0].pts,end:s[0].pts+f})),this.trigger(`data`,{track:e,boxes:u}),this.trigger(`done`,`AudioSegmentStream`)},this.reset=function(){tn.clearDtsInfo(e),n=[],this.trigger(`reset`)}},pn.prototype=new Zt,fn=function(e,t){var n,r=[],i=[],a,o;t||={},n=t.firstSequenceNumber||0,fn.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){tn.collectDtsInfo(e,t),t.nalUnitType===`seq_parameter_set_rbsp`&&!a&&(a=t.config,e.sps=[t.data],dn.forEach(function(t){e[t]=a[t]},this)),t.nalUnitType===`pic_parameter_set_rbsp`&&!o&&(o=t.data,e.pps=[t.data]),r.push(t)},this.flush=function(){for(var a,o,s,c,l,u,d=0,f,p;r.length&&r[0].nalUnitType!==`access_unit_delimiter_rbsp`;)r.shift();if(r.length===0){this.resetStream_(),this.trigger(`done`,`VideoSegmentStream`);return}if(a=$t.groupNalsIntoFrames(r),s=$t.groupFramesIntoGops(a),s[0][0].keyFrame||(o=this.getGopForFusion_(r[0],e),o?(d=o.duration,s.unshift(o),s.byteLength+=o.byteLength,s.nalCount+=o.nalCount,s.pts=o.pts,s.dts=o.dts,s.duration+=o.duration):s=$t.extendFirstKeyFrame(s)),i.length){var m=t.alignGopsAtEnd?this.alignGopsAtEnd_(s):this.alignGopsAtStart_(s);if(!m){this.gopCache_.unshift({gop:s.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),r=[],this.resetStream_(),this.trigger(`done`,`VideoSegmentStream`);return}tn.clearDtsInfo(e),s=m}tn.collectDtsInfo(e,s),e.samples=$t.generateSampleTable(s),l=Qt.mdat($t.concatenateNalData(s)),e.baseMediaDecodeTime=tn.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger(`processedGopsInfo`,s.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}})),f=s[0],p=s[s.length-1],this.trigger(`segmentTimingInfo`,yn(e.baseMediaDecodeTime,f.dts,f.pts,p.dts+p.duration,p.pts+p.duration,d)),this.trigger(`timingInfo`,{start:s[0].pts,end:s[s.length-1].pts+s[s.length-1].duration}),this.gopCache_.unshift({gop:s.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),r=[],this.trigger(`baseMediaDecodeTime`,e.baseMediaDecodeTime),this.trigger(`timelineStartInfo`,e.timelineStartInfo),c=Qt.moof(n,[e]),u=new Uint8Array(c.byteLength+l.byteLength),n++,u.set(c),u.set(l,c.byteLength),this.trigger(`data`,{track:e,boxes:u}),this.resetStream_(),this.trigger(`done`,`VideoSegmentStream`)},this.reset=function(){this.resetStream_(),r=[],this.gopCache_.length=0,i.length=0,this.trigger(`reset`)},this.resetStream_=function(){tn.clearDtsInfo(e),a=void 0,o=void 0},this.getGopForFusion_=function(t){var n=45e3,r=1e4,i=1/0,a,o,s,c,l;for(l=0;l<this.gopCache_.length;l++)c=this.gopCache_[l],s=c.gop,!(!(e.pps&&vn(e.pps[0],c.pps[0]))||!(e.sps&&vn(e.sps[0],c.sps[0])))&&(s.dts<e.timelineStartInfo.dts||(a=t.dts-s.dts-s.duration,a>=-r&&a<=n&&(!o||i>a)&&(o=c,i=a)));return o?o.gop:null},this.alignGopsAtStart_=function(e){var t,n,r,a,o=e.byteLength,s=e.nalCount,c=e.duration,l;for(t=n=0;t<i.length&&n<e.length&&(r=i[t],a=e[n],r.pts!==a.pts);){if(a.pts>r.pts){t++;continue}n++,o-=a.byteLength,s-=a.nalCount,c-=a.duration}return n===0?e:n===e.length?null:(l=e.slice(n),l.byteLength=o,l.duration=c,l.nalCount=s,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){for(var t=i.length-1,n=e.length-1,r,a,o=null,s=!1;t>=0&&n>=0;){if(r=i[t],a=e[n],r.pts===a.pts){s=!0;break}if(r.pts>a.pts){t--;continue}t===i.length-1&&(o=n),n--}if(!s&&o===null)return null;var c=s?n:o;if(c===0)return e;var l=e.slice(c),u=l.reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e},{byteLength:0,duration:0,nalCount:0});return l.byteLength=u.byteLength,l.duration=u.duration,l.nalCount=u.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){i=e}},fn.prototype=new Zt,hn=function(e,t){this.numberOfTracks=0,this.metadataStream=t,e||={},e.remux===void 0?this.remuxTracks=!0:this.remuxTracks=!!e.remux,typeof e.keepOriginalTimestamps==`boolean`?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,hn.prototype.init.call(this),this.push=function(e){if(e.content||e.text)return this.pendingCaptions.push(e);if(e.frames)return this.pendingMetadata.push(e);this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,e.track.type===`video`&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),e.track.type===`audio`&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))}},hn.prototype=new Zt,hn.prototype.flush=function(e){var t=0,n={captions:[],captionStreams:{},metadata:[],info:{}},r,i,a,o=0,s;if(this.pendingTracks.length<this.numberOfTracks){if(e!==`VideoSegmentStream`&&e!==`AudioSegmentStream`||this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger(`done`),this.emittedTracks=0);return}}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,dn.forEach(function(e){n.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,un.forEach(function(e){n.info[e]=this.audioTrack[e]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?n.type=this.pendingTracks[0].type:n.type=`combined`,this.emittedTracks+=this.pendingTracks.length,a=Qt.initSegment(this.pendingTracks),n.initSegment=new Uint8Array(a.byteLength),n.initSegment.set(a),n.data=new Uint8Array(this.pendingBytes),s=0;s<this.pendingBoxes.length;s++)n.data.set(this.pendingBoxes[s],t),t+=this.pendingBoxes[s].byteLength;for(s=0;s<this.pendingCaptions.length;s++)r=this.pendingCaptions[s],r.startTime=rn.metadataTsToSeconds(r.startPts,o,this.keepOriginalTimestamps),r.endTime=rn.metadataTsToSeconds(r.endPts,o,this.keepOriginalTimestamps),n.captionStreams[r.stream]=!0,n.captions.push(r);for(s=0;s<this.pendingMetadata.length;s++)i=this.pendingMetadata[s],i.cueTime=rn.metadataTsToSeconds(i.pts,o,this.keepOriginalTimestamps),n.metadata.push(i);for(n.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`,n),s=0;s<n.captions.length;s++)r=n.captions[s],this.trigger(`caption`,r);for(s=0;s<n.metadata.length;s++)i=n.metadata[s],this.trigger(`id3Frame`,i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger(`done`),this.emittedTracks=0)},hn.prototype.setRemux=function(e){this.remuxTracks=e},mn=function(e){var t=this,n=!0,r,i;mn.prototype.init.call(this),e||={},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var n={};this.transmuxPipeline_=n,n.type=`aac`,n.metadataStream=new nn.MetadataStream,n.aacStream=new sn,n.audioTimestampRolloverStream=new nn.TimestampRolloverStream(`audio`),n.timedMetadataTimestampRolloverStream=new nn.TimestampRolloverStream(`timed-metadata`),n.adtsStream=new an,n.coalesceStream=new hn(e,n.metadataStream),n.headOfPipeline=n.aacStream,n.aacStream.pipe(n.audioTimestampRolloverStream).pipe(n.adtsStream),n.aacStream.pipe(n.timedMetadataTimestampRolloverStream).pipe(n.metadataStream).pipe(n.coalesceStream),n.metadataStream.on(`timestamp`,function(e){n.aacStream.setTimestamp(e.timeStamp)}),n.aacStream.on(`data`,function(a){a.type!==`timed-metadata`&&a.type!==`audio`||n.audioSegmentStream||(i||={timelineStartInfo:{baseMediaDecodeTime:t.baseMediaDecodeTime},codec:`adts`,type:`audio`},n.coalesceStream.numberOfTracks++,n.audioSegmentStream=new pn(i,e),n.audioSegmentStream.on(`log`,t.getLogTrigger_(`audioSegmentStream`)),n.audioSegmentStream.on(`timingInfo`,t.trigger.bind(t,`audioTimingInfo`)),n.adtsStream.pipe(n.audioSegmentStream).pipe(n.coalesceStream),t.trigger(`trackinfo`,{hasAudio:!!i,hasVideo:!!r}))}),n.coalesceStream.on(`data`,this.trigger.bind(this,`data`)),n.coalesceStream.on(`done`,this.trigger.bind(this,`done`)),_n(this,n)},this.setupTsPipeline=function(){var n={};this.transmuxPipeline_=n,n.type=`ts`,n.metadataStream=new nn.MetadataStream,n.packetStream=new nn.TransportPacketStream,n.parseStream=new nn.TransportParseStream,n.elementaryStream=new nn.ElementaryStream,n.timestampRolloverStream=new nn.TimestampRolloverStream,n.adtsStream=new an,n.h264Stream=new on,n.captionStream=new nn.CaptionStream(e),n.coalesceStream=new hn(e,n.metadataStream),n.headOfPipeline=n.packetStream,n.packetStream.pipe(n.parseStream).pipe(n.elementaryStream).pipe(n.timestampRolloverStream),n.timestampRolloverStream.pipe(n.h264Stream),n.timestampRolloverStream.pipe(n.adtsStream),n.timestampRolloverStream.pipe(n.metadataStream).pipe(n.coalesceStream),n.h264Stream.pipe(n.captionStream).pipe(n.coalesceStream),n.elementaryStream.on(`data`,function(a){var o;if(a.type===`metadata`){for(o=a.tracks.length;o--;)!r&&a.tracks[o].type===`video`?(r=a.tracks[o],r.timelineStartInfo.baseMediaDecodeTime=t.baseMediaDecodeTime):!i&&a.tracks[o].type===`audio`&&(i=a.tracks[o],i.timelineStartInfo.baseMediaDecodeTime=t.baseMediaDecodeTime);r&&!n.videoSegmentStream&&(n.coalesceStream.numberOfTracks++,n.videoSegmentStream=new fn(r,e),n.videoSegmentStream.on(`log`,t.getLogTrigger_(`videoSegmentStream`)),n.videoSegmentStream.on(`timelineStartInfo`,function(r){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=r,n.audioSegmentStream.setEarliestDts(r.dts-t.baseMediaDecodeTime))}),n.videoSegmentStream.on(`processedGopsInfo`,t.trigger.bind(t,`gopInfo`)),n.videoSegmentStream.on(`segmentTimingInfo`,t.trigger.bind(t,`videoSegmentTimingInfo`)),n.videoSegmentStream.on(`baseMediaDecodeTime`,function(e){i&&n.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),n.videoSegmentStream.on(`timingInfo`,t.trigger.bind(t,`videoTimingInfo`)),n.h264Stream.pipe(n.videoSegmentStream).pipe(n.coalesceStream)),i&&!n.audioSegmentStream&&(n.coalesceStream.numberOfTracks++,n.audioSegmentStream=new pn(i,e),n.audioSegmentStream.on(`log`,t.getLogTrigger_(`audioSegmentStream`)),n.audioSegmentStream.on(`timingInfo`,t.trigger.bind(t,`audioTimingInfo`)),n.audioSegmentStream.on(`segmentTimingInfo`,t.trigger.bind(t,`audioSegmentTimingInfo`)),n.adtsStream.pipe(n.audioSegmentStream).pipe(n.coalesceStream)),t.trigger(`trackinfo`,{hasAudio:!!i,hasVideo:!!r})}}),n.coalesceStream.on(`data`,this.trigger.bind(this,`data`)),n.coalesceStream.on(`id3Frame`,function(e){e.dispatchType=n.metadataStream.dispatchType,t.trigger(`id3Frame`,e)}),n.coalesceStream.on(`caption`,this.trigger.bind(this,`caption`)),n.coalesceStream.on(`done`,this.trigger.bind(this,`done`)),_n(this,n)},this.setBaseMediaDecodeTime=function(t){var n=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=t),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,tn.clearDtsInfo(i),n.audioTimestampRolloverStream&&n.audioTimestampRolloverStream.discontinuity()),r&&(n.videoSegmentStream&&(n.videoSegmentStream.gopCache_=[]),r.timelineStartInfo.dts=void 0,r.timelineStartInfo.pts=void 0,tn.clearDtsInfo(r),n.captionStream.reset()),n.timestampRolloverStream&&n.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var n=this.transmuxPipeline_;e.remux=t,n&&n.coalesceStream&&n.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){r&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(n){n.stream=e,t.trigger(`log`,n)}},this.push=function(e){if(n){var t=cn(e);t&&this.transmuxPipeline_.type!==`aac`?this.setupAacPipeline():!t&&this.transmuxPipeline_.type!==`ts`&&this.setupTsPipeline(),n=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){n=!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()}},mn.prototype=new Zt;var bn={Transmuxer:mn,VideoSegmentStream:fn,AudioSegmentStream:pn,AUDIO_PROPERTIES:un,VIDEO_PROPERTIES:dn,generateSegmentTimingInfo:yn},xn={toUnsigned:function(e){return e>>>0},toHexString:function(e){return(`00`+e.toString(16)).slice(-2)}},Sn=function(e){var t=``;return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3]),t},Cn=xn.toUnsigned,wn=Sn,Tn=function(e,t){var n=[],r,i,a,o,s;if(!t.length)return null;for(r=0;r<e.byteLength;)i=Cn(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]),a=wn(e.subarray(r+4,r+8)),o=i>1?r+i:e.byteLength,a===t[0]&&(t.length===1?n.push(e.subarray(r+8,o)):(s=Tn(e.subarray(r+8,o),t.slice(1)),s.length&&(n=n.concat(s)))),r=o;return n},En=Tn,Dn=xn.toUnsigned,On=i.getUint64,kn=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return t.version===1?t.baseMediaDecodeTime=On(e.subarray(4)):t.baseMediaDecodeTime=Dn(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},An=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4)},r=n.flags[2]&1,i=n.flags[2]&2,a=n.flags[2]&8,o=n.flags[2]&16,s=n.flags[2]&32,c=n.flags[0]&65536,l=n.flags[0]&131072,u=8;return r&&(u+=4,n.baseDataOffset=t.getUint32(12),u+=4),i&&(n.sampleDescriptionIndex=t.getUint32(u),u+=4),a&&(n.defaultSampleDuration=t.getUint32(u),u+=4),o&&(n.defaultSampleSize=t.getUint32(u),u+=4),s&&(n.defaultSampleFlags=t.getUint32(u)),c&&(n.durationIsEmpty=!0),!r&&l&&(n.baseDataOffsetIsMoof=!0),n},jn=i.getUint64,Mn=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},r=12;n.version===0?(n.earliestPresentationTime=t.getUint32(r),n.firstOffset=t.getUint32(r+4),r+=8):(n.earliestPresentationTime=jn(e.subarray(r)),n.firstOffset=jn(e.subarray(r+8)),r+=16),r+=2;var i=t.getUint16(r);for(r+=2;i>0;r+=12,i--)n.references.push({referenceType:(e[r]&128)>>>7,referencedSize:t.getUint32(r)&2147483647,subsegmentDuration:t.getUint32(r+4),startsWithSap:!!(e[r+8]&128),sapType:(e[r+8]&112)>>>4,sapDeltaTime:t.getUint32(r+8)&268435455});return n},Nn=function(e){return{isLeading:(e[0]&12)>>>2,dependsOn:e[0]&3,isDependedOn:(e[1]&192)>>>6,hasRedundancy:(e[1]&48)>>>4,paddingValue:(e[1]&14)>>>1,isNonSyncSample:e[1]&1,degradationPriority:e[2]<<8|e[3]}},Pn=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=t.flags[2]&1,i=t.flags[2]&4,a=t.flags[1]&1,o=t.flags[1]&2,s=t.flags[1]&4,c=t.flags[1]&8,l=n.getUint32(4),u=8,d;for(r&&(t.dataOffset=n.getInt32(u),u+=4),i&&l&&(d={flags:Nn(e.subarray(u,u+4))},u+=4,a&&(d.duration=n.getUint32(u),u+=4),o&&(d.size=n.getUint32(u),u+=4),c&&(t.version===1?d.compositionTimeOffset=n.getInt32(u):d.compositionTimeOffset=n.getUint32(u),u+=4),t.samples.push(d),l--);l--;)d={},a&&(d.duration=n.getUint32(u),u+=4),o&&(d.size=n.getUint32(u),u+=4),s&&(d.flags=Nn(e.subarray(u,u+4)),u+=4),c&&(t.version===1?d.compositionTimeOffset=n.getInt32(u):d.compositionTimeOffset=n.getUint32(u),u+=4),t.samples.push(d);return t},Fn=i.getUint64,In,Ln,Rn=function(e){return new Date(e*1e3-20828448e5)},zn=Sn,Bn=En,Vn=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=[],r,i;for(r=0;r+4<e.length;r+=i){if(i=t.getUint32(r),r+=4,i<=0){n.push(`<span style='color:red;'>MALFORMED DATA</span>`);continue}switch(e[r]&31){case 1:n.push(`slice_layer_without_partitioning_rbsp`);break;case 5:n.push(`slice_layer_without_partitioning_rbsp_idr`);break;case 6:n.push(`sei_rbsp`);break;case 7:n.push(`seq_parameter_set_rbsp`);break;case 8:n.push(`pic_parameter_set_rbsp`);break;case 9:n.push(`access_unit_delimiter_rbsp`);break;default:n.push(`UNKNOWN NAL - `+e[r]&31);break}}return n},Hn={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:In(e.subarray(78,e.byteLength))}},avcC:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:e[4]&3,sps:[],pps:[]},r=e[5]&31,i,a,o=6,s;for(s=0;s<r;s++)a=t.getUint16(o),o+=2,n.sps.push(new Uint8Array(e.subarray(o,o+a))),o+=a;for(i=e[o],o++,s=0;s<i;s++)a=t.getUint16(o),o+=2,n.pps.push(new Uint8Array(e.subarray(o,o+a))),o+=a;return n},btrt:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{bufferSizeDB:t.getUint32(0),maxBitrate:t.getUint32(4),avgBitrate:t.getUint32(8)}},edts:function(e){return{boxes:In(e)}},elst:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),edits:[]},r=t.getUint32(4),i;for(i=8;r;r--)n.version===0?(n.edits.push({segmentDuration:t.getUint32(i),mediaTime:t.getInt32(i+4),mediaRate:t.getUint16(i+8)+t.getUint16(i+10)/(256*256)}),i+=12):(n.edits.push({segmentDuration:Fn(e.subarray(i)),mediaTime:Fn(e.subarray(i+8)),mediaRate:t.getUint16(i+16)+t.getUint16(i+18)/(256*256)}),i+=20);return n},esds:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),esId:e[6]<<8|e[7],streamPriority:e[8]&31,decoderConfig:{objectProfileIndication:e[11],streamType:e[12]>>>2&63,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:e[26]>>>3&31,samplingFrequencyIndex:(e[26]&7)<<1|e[27]>>>7&1,channelConfiguration:e[27]>>>3&15}}}},ftyp:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={majorBrand:zn(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},r=8;r<e.byteLength;)n.compatibleBrands.push(zn(e.subarray(r,r+4))),r+=4;return n},dinf:function(e){return{boxes:In(e)}},dref:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),dataReferences:In(e.subarray(8))}},hdlr:function(e){var t={version:new DataView(e.buffer,e.byteOffset,e.byteLength).getUint8(0),flags:new Uint8Array(e.subarray(1,4)),handlerType:zn(e.subarray(8,12)),name:``},n=8;for(n=24;n<e.byteLength;n++){if(e[n]===0){n++;break}t.name+=String.fromCharCode(e[n])}return t.name=decodeURIComponent(escape(t.name)),t},mdat:function(e){return{byteLength:e.byteLength,nals:Vn(e)}},mdhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=4,r,i={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),language:``};return i.version===1?(n+=4,i.creationTime=Rn(t.getUint32(n)),n+=8,i.modificationTime=Rn(t.getUint32(n)),n+=4,i.timescale=t.getUint32(n),n+=8,i.duration=t.getUint32(n)):(i.creationTime=Rn(t.getUint32(n)),n+=4,i.modificationTime=Rn(t.getUint32(n)),n+=4,i.timescale=t.getUint32(n),n+=4,i.duration=t.getUint32(n)),n+=4,r=t.getUint16(n),i.language+=String.fromCharCode((r>>10)+96),i.language+=String.fromCharCode(((r&992)>>5)+96),i.language+=String.fromCharCode((r&31)+96),i},mdia:function(e){return{boxes:In(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:In(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};return e.byteLength>28&&(n.streamDescriptor=In(e.subarray(28))[0]),n},moof:function(e){return{boxes:In(e)}},moov:function(e){return{boxes:In(e)}},mvex:function(e){return{boxes:In(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=4,r={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return r.version===1?(n+=4,r.creationTime=Rn(t.getUint32(n)),n+=8,r.modificationTime=Rn(t.getUint32(n)),n+=4,r.timescale=t.getUint32(n),n+=8,r.duration=t.getUint32(n)):(r.creationTime=Rn(t.getUint32(n)),n+=4,r.modificationTime=Rn(t.getUint32(n)),n+=4,r.timescale=t.getUint32(n),n+=4,r.duration=t.getUint32(n)),n+=4,r.rate=t.getUint16(n)+t.getUint16(n+2)/16,n+=4,r.volume=t.getUint8(n)+t.getUint8(n+1)/8,n+=2,n+=2,n+=8,r.matrix=new Uint32Array(e.subarray(n,n+36)),n+=36,n+=24,r.nextTrackId=t.getUint32(n),r},pdin:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),rate:t.getUint32(4),initialDelay:t.getUint32(8)}},sdtp:function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n;for(n=4;n<e.byteLength;n++)t.samples.push({dependsOn:(e[n]&48)>>4,isDependedOn:(e[n]&12)>>2,hasRedundancy:e[n]&3});return t},sidx:Mn,smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:In(e)}},ctts:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),compositionOffsets:[]},r=t.getUint32(4),i;for(i=8;r;i+=8,r--)n.compositionOffsets.push({sampleCount:t.getUint32(i),sampleOffset:t[n.version===0?`getUint32`:`getInt32`](i+4)});return n},stss:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),syncSamples:[]},r=t.getUint32(4),i;for(i=8;r;i+=4,r--)n.syncSamples.push(t.getUint32(i));return n},stco:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},r=t.getUint32(4),i;for(i=8;r;i+=4,r--)n.chunkOffsets.push(t.getUint32(i));return n},stsc:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=t.getUint32(4),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]},i;for(i=8;n;i+=12,n--)r.sampleToChunks.push({firstChunk:t.getUint32(i),samplesPerChunk:t.getUint32(i+4),sampleDescriptionIndex:t.getUint32(i+8)});return r},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:In(e.subarray(8))}},stsz:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:t.getUint32(4),entries:[]},r;for(r=12;r<e.byteLength;r+=4)n.entries.push(t.getUint32(r));return n},stts:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),timeToSamples:[]},r=t.getUint32(4),i;for(i=8;r;i+=8,r--)n.timeToSamples.push({sampleCount:t.getUint32(i),sampleDelta:t.getUint32(i+4)});return n},styp:function(e){return Hn.ftyp(e)},tfdt:kn,tfhd:An,tkhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=4,r={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return r.version===1?(n+=4,r.creationTime=Rn(t.getUint32(n)),n+=8,r.modificationTime=Rn(t.getUint32(n)),n+=4,r.trackId=t.getUint32(n),n+=4,n+=8,r.duration=t.getUint32(n)):(r.creationTime=Rn(t.getUint32(n)),n+=4,r.modificationTime=Rn(t.getUint32(n)),n+=4,r.trackId=t.getUint32(n),n+=4,n+=4,r.duration=t.getUint32(n)),n+=4,n+=8,r.layer=t.getUint16(n),n+=2,r.alternateGroup=t.getUint16(n),n+=2,r.volume=t.getUint8(n)+t.getUint8(n+1)/8,n+=2,n+=2,r.matrix=new Uint32Array(e.subarray(n,n+36)),n+=36,r.width=t.getUint16(n)+t.getUint16(n+2)/65536,n+=4,r.height=t.getUint16(n)+t.getUint16(n+2)/65536,r},traf:function(e){return{boxes:In(e)}},trak:function(e){return{boxes:In(e)}},trex:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4),defaultSampleDescriptionIndex:t.getUint32(8),defaultSampleDuration:t.getUint32(12),defaultSampleSize:t.getUint32(16),sampleDependsOn:e[20]&3,sampleIsDependedOn:(e[21]&192)>>6,sampleHasRedundancy:(e[21]&48)>>4,samplePaddingValue:(e[21]&14)>>1,sampleIsDifferenceSample:!!(e[21]&1),sampleDegradationPriority:t.getUint16(22)}},trun:Pn,"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}};In=function(e){for(var t=0,n=[],r,i,a,o,s,c=new ArrayBuffer(e.length),l=new Uint8Array(c),u=0;u<e.length;++u)l[u]=e[u];for(r=new DataView(c);t<e.byteLength;)i=r.getUint32(t),a=zn(e.subarray(t+4,t+8)),o=i>1?t+i:e.byteLength,s=(Hn[a]||function(e){return{data:e}})(e.subarray(t+8,o)),s.size=i,s.type=a,n.push(s),t=o;return n},Ln=function(e,t){var n;return t||=0,n=Array(t*2+1).join(` `),e.map(function(e,r){return n+e.type+`
187
+ `+Object.keys(e).filter(function(e){return e!==`type`&&e!==`boxes`}).map(function(t){var r=n+` `+t+`: `,i=e[t];if(i instanceof Uint8Array||i instanceof Uint32Array){var a=Array.prototype.slice.call(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)).map(function(e){return` `+(`00`+e.toString(16)).slice(-2)}).join(``).match(/.{1,24}/g);return a?a.length===1?r+`<`+a.join(``).slice(1)+`>`:r+`<
188
+ `+a.map(function(e){return n+` `+e}).join(`
189
+ `)+`
190
+ `+n+` >`:r+`<>`}return r+JSON.stringify(i,null,2).split(`
191
+ `).map(function(e,t){return t===0?e:n+` `+e}).join(`
192
+ `)}).join(`
193
+ `)+(e.boxes?`
194
+ `+Ln(e.boxes,t+1):``)}).join(`
195
+ `)};var Un={inspect:In,textify:Ln,parseType:zn,findBox:Bn,parseTraf:Hn.traf,parseTfdt:Hn.tfdt,parseHdlr:Hn.hdlr,parseTfhd:Hn.tfhd,parseTrun:Hn.trun,parseSidx:Hn.sidx},Wn={uint8ToCString:function(e){for(var t=0,n=String.fromCharCode(e[t]),r=``;n!==`\0`;)r+=n,t++,n=String.fromCharCode(e[t]);return r+=n,r}}.uint8ToCString,Gn=i.getUint64,Kn=function(e){var t=4,n=e[0],r,i,a,o,s,c,l,u;if(n===0){r=Wn(e.subarray(t)),t+=r.length,i=Wn(e.subarray(t)),t+=i.length;var d=new DataView(e.buffer);a=d.getUint32(t),t+=4,s=d.getUint32(t),t+=4,c=d.getUint32(t),t+=4,l=d.getUint32(t),t+=4}else if(n===1){var d=new DataView(e.buffer);a=d.getUint32(t),t+=4,o=Gn(e.subarray(t)),t+=8,c=d.getUint32(t),t+=4,l=d.getUint32(t),t+=4,r=Wn(e.subarray(t)),t+=r.length,i=Wn(e.subarray(t)),t+=i.length}u=new Uint8Array(e.subarray(t,e.byteLength));var f={scheme_id_uri:r,value:i,timescale:a||1,presentation_time:o,presentation_time_delta:s,event_duration:c,id:l,message_data:u};return Jn(n,f)?f:void 0},qn=function(e,t,n,r){return e||e===0?e/t:r+n/t},Jn=function(e,t){var n=t.scheme_id_uri!==`\0`,r=e===0&&B(t.presentation_time_delta)&&n,i=e===1&&B(t.presentation_time)&&n;return!(e>1)&&r||i},B=function(e){return e!==void 0||e!==null},Yn={parseEmsgBox:Kn,scaleTime:qn},Xn=typeof window<`u`?window:e===void 0?typeof self<`u`?self:{}:e,Zn=xn.toUnsigned,Qn=xn.toHexString,V=En,$n=Sn,er=Yn,H=An,tr=Pn,nr=kn,rr=i.getUint64,ir,ar,or,sr,cr,lr,ur,dr=Xn,fr=ct.parseId3Frames;ir=function(e){return V(e,[`moov`,`trak`]).reduce(function(e,t){var n=V(t,[`tkhd`])[0],r,i,a,o;return!n||(r=n[0],i=r===0?12:20,a=Zn(n[i]<<24|n[i+1]<<16|n[i+2]<<8|n[i+3]),o=V(t,[`mdia`,`mdhd`])[0],!o)?null:(r=o[0],i=r===0?12:20,e[a]=Zn(o[i]<<24|o[i+1]<<16|o[i+2]<<8|o[i+3]),e)},{})},ar=function(e,t){var n=V(t,[`moof`,`traf`]).reduce(function(t,n){var r=V(n,[`tfhd`])[0],i=e[Zn(r[4]<<24|r[5]<<16|r[6]<<8|r[7])]||9e4,a=V(n,[`tfdt`])[0],o=new DataView(a.buffer,a.byteOffset,a.byteLength),s=a[0]===1?rr(a.subarray(4,12)):o.getUint32(4);let c;return typeof s==`bigint`?c=s/dr.BigInt(i):typeof s==`number`&&!isNaN(s)&&(c=s/i),c<2**53-1&&(c=Number(c)),c<t&&(t=c),t},1/0);return typeof n==`bigint`||isFinite(n)?n:0},or=function(e,t){var n=V(t,[`moof`,`traf`]),r=0,i=0,a;if(n&&n.length){var o=V(n[0],[`tfhd`])[0],s=V(n[0],[`trun`])[0],c=V(n[0],[`tfdt`])[0];if(o&&(a=H(o).trackId),c&&(r=nr(c).baseMediaDecodeTime),s){var l=tr(s);l.samples&&l.samples.length&&(i=l.samples[0].compositionTimeOffset||0)}}var u=e[a]||9e4;typeof r==`bigint`&&(i=dr.BigInt(i),u=dr.BigInt(u));var d=(r+i)/u;return typeof d==`bigint`&&d<2**53-1&&(d=Number(d)),d},sr=function(e){var t=V(e,[`moov`,`trak`]),n=[];return t.forEach(function(e){var t=V(e,[`mdia`,`hdlr`]),r=V(e,[`tkhd`]);t.forEach(function(e,t){var i=$n(e.subarray(8,12)),a=r[t],o,s,c;i===`vide`&&(o=new DataView(a.buffer,a.byteOffset,a.byteLength),s=o.getUint8(0),c=s===0?o.getUint32(12):o.getUint32(20),n.push(c))})}),n},lr=function(e){var t=e[0]===0?12:20;return Zn(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},cr=function(e){var t=V(e,[`moov`,`trak`]),n=[];return t.forEach(function(e){var t={},r=V(e,[`tkhd`])[0],i,a;r&&(i=new DataView(r.buffer,r.byteOffset,r.byteLength),a=i.getUint8(0),t.id=a===0?i.getUint32(12):i.getUint32(20));var o=V(e,[`mdia`,`hdlr`])[0];if(o){var s=$n(o.subarray(8,12));s===`vide`?t.type=`video`:s===`soun`?t.type=`audio`:t.type=s}var c=V(e,[`mdia`,`minf`,`stbl`,`stsd`])[0];if(c){var l=c.subarray(8);t.codec=$n(l.subarray(4,8));var u=V(l,[t.codec])[0],d,f;u&&(/^[asm]vc[1-9]$/i.test(t.codec)?(d=u.subarray(78),f=$n(d.subarray(4,8)),f===`avcC`&&d.length>11?(t.codec+=`.`,t.codec+=Qn(d[9]),t.codec+=Qn(d[10]),t.codec+=Qn(d[11])):t.codec=`avc1.4d400d`):/^mp4[a,v]$/i.test(t.codec)?(d=u.subarray(28),f=$n(d.subarray(4,8)),f===`esds`&&d.length>20&&d[19]!==0?(t.codec+=`.`+Qn(d[19]),t.codec+=`.`+Qn(d[20]>>>2&63).replace(/^0/,``)):t.codec=`mp4a.40.2`):t.codec=t.codec.toLowerCase())}var p=V(e,[`mdia`,`mdhd`])[0];p&&(t.timescale=lr(p)),n.push(t)}),n},ur=function(e,t=0){return V(e,[`emsg`]).map(e=>{var n=er.parseEmsgBox(new Uint8Array(e)),r=fr(n.message_data);return{cueTime:er.scaleTime(n.presentation_time,n.timescale,n.presentation_time_delta,t),duration:er.scaleTime(n.event_duration,n.timescale),frames:r}})};var pr={findBox:V,parseType:$n,timescale:ir,startTime:ar,compositionStartTime:or,videoTrackIds:sr,tracks:cr,getTimescaleFromMediaHeader:lr,getEmsgID3:ur};let{parseTrun:mr}=Un,{findBox:hr}=pr;var gr=Xn,_r={getMdatTrafPairs:function(e){var t=hr(e,[`moof`,`traf`]),n=hr(e,[`mdat`]),r=[];return n.forEach(function(e,n){var i=t[n];r.push({mdat:e,traf:i})}),r},parseSamples:function(e,t,n){var r=t,i=n.defaultSampleDuration||0,a=n.defaultSampleSize||0,o=n.trackId,s=[];return e.forEach(function(e){var t=mr(e).samples;t.forEach(function(e){e.duration===void 0&&(e.duration=i),e.size===void 0&&(e.size=a),e.trackId=o,e.dts=r,e.compositionTimeOffset===void 0&&(e.compositionTimeOffset=0),typeof r==`bigint`?(e.pts=r+gr.BigInt(e.compositionTimeOffset),r+=gr.BigInt(e.duration)):(e.pts=r+e.compositionTimeOffset,r+=e.duration)}),s=s.concat(t)}),s}},vr=Ne.discardEmulationPreventionBytes,yr=Ke.CaptionStream,br=En,xr=kn,Sr=An,{getMdatTrafPairs:Cr,parseSamples:wr}=_r,Tr=function(e,t){for(var n=e,r=0;r<t.length;r++){var i=t[r];if(n<i.size)return i;n-=i.size}return null},Er=function(e,t,n){var r=new DataView(e.buffer,e.byteOffset,e.byteLength),i={logs:[],seiNals:[]},a,o,s,c;for(o=0;o+4<e.length;o+=s)if(s=r.getUint32(o),o+=4,!(s<=0))switch(e[o]&31){case 6:var l=e.subarray(o+1,o+1+s),u=Tr(o,t);if(a={nalUnitType:`sei_rbsp`,size:s,data:l,escapedRBSP:vr(l),trackId:n},u)a.pts=u.pts,a.dts=u.dts,c=u;else if(c)a.pts=c.pts,a.dts=c.dts;else{i.logs.push({level:`warn`,message:`We've encountered a nal unit without data at `+o+` for trackId `+n+`. See mux.js#223.`});break}i.seiNals.push(a);break}return i},Dr=function(e,t){var n={};return Cr(e).forEach(function(e){var r=e.mdat,i=e.traf,a=Sr(br(i,[`tfhd`])[0]),o=a.trackId,s=br(i,[`tfdt`]),c=s.length>0?xr(s[0]).baseMediaDecodeTime:0,l=br(i,[`trun`]),u,d;t===o&&l.length>0&&(u=wr(l,c,a),d=Er(r,u,o),n[o]||(n[o]={seiNals:[],logs:[]}),n[o].seiNals=n[o].seiNals.concat(d.seiNals),n[o].logs=n[o].logs.concat(d.logs))}),n},Or=function(e,t,n){var r;if(t===null)return null;r=Dr(e,t);var i=r[t]||{};return{seiNals:i.seiNals,logs:i.logs,timescale:n}},kr=function(){var e=!1,t,n,r,i,a,o;this.isInitialized=function(){return e},this.init=function(n){t=new yr,e=!0,o=n?n.isPartial:!1,t.on(`data`,function(e){e.startTime=e.startPts/i,e.endTime=e.endPts/i,a.captions.push(e),a.captionStreams[e.stream]=!0}),t.on(`log`,function(e){a.logs.push(e)})},this.isNewInit=function(e,t){return e&&e.length===0||t&&typeof t==`object`&&Object.keys(t).length===0?!1:r!==e[0]||i!==t[r]},this.parse=function(e,t,o){var s;if(!this.isInitialized()||!t||!o)return null;if(this.isNewInit(t,o))r=t[0],i=o[r];else if(r===null||!i)return n.push(e),null;for(;n.length>0;){var c=n.shift();this.parse(c,t,o)}return s=Or(e,r,i),s&&s.logs&&(a.logs=a.logs.concat(s.logs)),s===null||!s.seiNals?a.logs.length?{logs:a.logs,captions:[],captionStreams:[]}:null:(this.pushNals(s.seiNals),this.flushStream(),a)},this.pushNals=function(e){if(!this.isInitialized()||!e||e.length===0)return null;e.forEach(function(e){t.push(e)})},this.flushStream=function(){if(!this.isInitialized())return null;o?t.partialFlush():t.flush()},this.clearParsedCaptions=function(){a.captions=[],a.captionStreams={},a.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;t.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){n=[],r=null,i=null,a?this.clearParsedCaptions():a={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()};let{parseTfdt:Ar}=Un,jr=En,{getTimescaleFromMediaHeader:Mr}=pr,{parseSamples:Nr,getMdatTrafPairs:U}=_r;var Pr=function(){let e=9e4;this.init=function(t){let n=jr(t,[`moov`,`trak`,`mdia`,`mdhd`])[0];n&&(e=Mr(n))},this.parseSegment=function(t){let n=[],r=U(t),i=0;return r.forEach(function(t){let r=t.mdat,a=t.traf,o=jr(a,[`tfdt`])[0],s=jr(a,[`tfhd`])[0],c=jr(a,[`trun`]);if(o&&(i=Ar(o).baseMediaDecodeTime),c.length&&s){let t=Nr(c,i,s),a=0;t.forEach(function(t){let i=new TextDecoder(`utf-8`),o=r.slice(a,a+t.size);if(jr(o,[`vtte`])[0]){a+=t.size;return}jr(o,[`vttc`]).forEach(function(r){let a=jr(r,[`payl`])[0],o=jr(r,[`sttg`])[0],s=t.pts/e,c=(t.pts+t.duration)/e,l,u;if(a)try{l=i.decode(a)}catch(e){console.error(e)}if(o)try{u=i.decode(o)}catch(e){console.error(e)}t.duration&&l&&n.push({cueText:l,start:s,end:c,settings:u})}),a+=t.size})}}),n}},Fr=qe,Ir=function(e){var t=e[1]&31;return t<<=8,t|=e[2],t},Lr=function(e){return!!(e[1]&64)},Rr=function(e){var t=0;return(e[3]&48)>>>4>1&&(t+=e[4]+1),t},zr=function(e,t){var n=Ir(e);return n===0?`pat`:n===t?`pmt`:t?`pes`:null},Br=function(e){var t=Lr(e),n=4+Rr(e);return t&&(n+=e[n]+1),(e[n+10]&31)<<8|e[n+11]},Vr=function(e){var t={},n=Lr(e),r=4+Rr(e);if(n&&(r+=e[r]+1),e[r+5]&1){for(var i=3+((e[r+1]&15)<<8|e[r+2])-4,a=12+((e[r+10]&15)<<8|e[r+11]);a<i;){var o=r+a;t[(e[o+1]&31)<<8|e[o+2]]=e[o],a+=((e[o+3]&15)<<8|e[o+4])+5}return t}},Hr=function(e,t){switch(t[Ir(e)]){case Fr.H264_STREAM_TYPE:return`video`;case Fr.ADTS_STREAM_TYPE:return`audio`;case Fr.METADATA_STREAM_TYPE:return`timed-metadata`;default:return null}},Ur=function(e){if(!Lr(e))return null;var t=4+Rr(e);if(t>=e.byteLength)return null;var n=null,r=e[t+7];return r&192&&(n={},n.pts=(e[t+9]&14)<<27|(e[t+10]&255)<<20|(e[t+11]&254)<<12|(e[t+12]&255)<<5|(e[t+13]&254)>>>3,n.pts*=4,n.pts+=(e[t+13]&6)>>>1,n.dts=n.pts,r&64&&(n.dts=(e[t+14]&14)<<27|(e[t+15]&255)<<20|(e[t+16]&254)<<12|(e[t+17]&255)<<5|(e[t+18]&254)>>>3,n.dts*=4,n.dts+=(e[t+18]&6)>>>1)),n},Wr=function(e){switch(e){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}},Gr={parseType:zr,parsePat:Br,parsePmt:Vr,parsePayloadUnitStartIndicator:Lr,parsePesType:Hr,parsePesTime:Ur,videoPacketContainsKeyFrame:function(e){for(var t=4+Rr(e),n=e.subarray(t),r=0,i=0,a=!1,o;i<n.byteLength-3;i++)if(n[i+2]===1){r=i+5;break}for(;r<n.byteLength;)switch(n[r]){case 0:if(n[r-1]!==0){r+=2;break}else if(n[r-2]!==0){r++;break}i+3!==r-2&&(o=Wr(n[i+3]&31),o===`slice_layer_without_partitioning_rbsp_idr`&&(a=!0));do r++;while(n[r]!==1&&r<n.length);i=r-2,r+=3;break;case 1:if(n[r-1]!==0||n[r-2]!==0){r+=3;break}o=Wr(n[i+3]&31),o===`slice_layer_without_partitioning_rbsp_idr`&&(a=!0),i=r-2,r+=3;break;default:r+=3;break}return n=n.subarray(i),r-=i,i=0,n&&n.byteLength>3&&(o=Wr(n[i+3]&31),o===`slice_layer_without_partitioning_rbsp_idr`&&(a=!0)),a}},Kr=qe,qr=et.handleRollover,W={};W.ts=Gr,W.aac=Wt;var Jr=P.ONE_SECOND_IN_TS,Yr=188,Xr=71,Zr=function(e,t){for(var n=0,r=Yr,i,a;r<e.byteLength;){if(e[n]===Xr&&e[r]===Xr){switch(i=e.subarray(n,r),a=W.ts.parseType(i,t.pid),a){case`pat`:t.pid=W.ts.parsePat(i);break;case`pmt`:var o=W.ts.parsePmt(i);t.table=t.table||{},Object.keys(o).forEach(function(e){t.table[e]=o[e]});break}n+=Yr,r+=Yr;continue}n++,r++}},Qr=function(e,t,n){for(var r=0,i=Yr,a,o,s,c,l,u=!1;i<=e.byteLength;){if(e[r]===Xr&&(e[i]===Xr||i===e.byteLength)){switch(a=e.subarray(r,i),o=W.ts.parseType(a,t.pid),o){case`pes`:s=W.ts.parsePesType(a,t.table),c=W.ts.parsePayloadUnitStartIndicator(a),s===`audio`&&c&&(l=W.ts.parsePesTime(a),l&&(l.type=`audio`,n.audio.push(l),u=!0));break}if(u)break;r+=Yr,i+=Yr;continue}r++,i++}for(i=e.byteLength,r=i-Yr,u=!1;r>=0;){if(e[r]===Xr&&(e[i]===Xr||i===e.byteLength)){switch(a=e.subarray(r,i),o=W.ts.parseType(a,t.pid),o){case`pes`:s=W.ts.parsePesType(a,t.table),c=W.ts.parsePayloadUnitStartIndicator(a),s===`audio`&&c&&(l=W.ts.parsePesTime(a),l&&(l.type=`audio`,n.audio.push(l),u=!0));break}if(u)break;r-=Yr,i-=Yr;continue}r--,i--}},$r=function(e,t,n){for(var r=0,i=Yr,a,o,s,c,l,u,d,f,p=!1,m={data:[],size:0};i<e.byteLength;){if(e[r]===Xr&&e[i]===Xr){switch(a=e.subarray(r,i),o=W.ts.parseType(a,t.pid),o){case`pes`:if(s=W.ts.parsePesType(a,t.table),c=W.ts.parsePayloadUnitStartIndicator(a),s===`video`&&(c&&!p&&(l=W.ts.parsePesTime(a),l&&(l.type=`video`,n.video.push(l),p=!0)),!n.firstKeyFrame)){if(c&&m.size!==0){for(u=new Uint8Array(m.size),d=0;m.data.length;)f=m.data.shift(),u.set(f,d),d+=f.byteLength;if(W.ts.videoPacketContainsKeyFrame(u)){var h=W.ts.parsePesTime(u);h?(n.firstKeyFrame=h,n.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.`)}m.size=0}m.data.push(a),m.size+=a.byteLength}break}if(p&&n.firstKeyFrame)break;r+=Yr,i+=Yr;continue}r++,i++}for(i=e.byteLength,r=i-Yr,p=!1;r>=0;){if(e[r]===Xr&&e[i]===Xr){switch(a=e.subarray(r,i),o=W.ts.parseType(a,t.pid),o){case`pes`:s=W.ts.parsePesType(a,t.table),c=W.ts.parsePayloadUnitStartIndicator(a),s===`video`&&c&&(l=W.ts.parsePesTime(a),l&&(l.type=`video`,n.video.push(l),p=!0));break}if(p)break;r-=Yr,i-=Yr;continue}r--,i--}},ei=function(e,t){if(e.audio&&e.audio.length){var n=t;(n===void 0||isNaN(n))&&(n=e.audio[0].dts),e.audio.forEach(function(e){e.dts=qr(e.dts,n),e.pts=qr(e.pts,n),e.dtsTime=e.dts/Jr,e.ptsTime=e.pts/Jr})}if(e.video&&e.video.length){var r=t;if((r===void 0||isNaN(r))&&(r=e.video[0].dts),e.video.forEach(function(e){e.dts=qr(e.dts,r),e.pts=qr(e.pts,r),e.dtsTime=e.dts/Jr,e.ptsTime=e.pts/Jr}),e.firstKeyFrame){var i=e.firstKeyFrame;i.dts=qr(i.dts,r),i.pts=qr(i.pts,r),i.dtsTime=i.dts/Jr,i.ptsTime=i.pts/Jr}}},ti=function(e){for(var t=!1,n=0,r=null,i=null,a=0,o=0,s;e.length-o>=3;){switch(W.aac.parseType(e,o)){case`timed-metadata`:if(e.length-o<10){t=!0;break}if(a=W.aac.parseId3TagSize(e,o),a>e.length){t=!0;break}i===null&&(s=e.subarray(o,o+a),i=W.aac.parseAacTimestamp(s)),o+=a;break;case`audio`:if(e.length-o<7){t=!0;break}if(a=W.aac.parseAdtsSize(e,o),a>e.length){t=!0;break}r===null&&(s=e.subarray(o,o+a),r=W.aac.parseSampleRate(s)),n++,o+=a;break;default:o++;break}if(t)return null}if(r===null||i===null)return null;var c=Jr/r;return{audio:[{type:`audio`,dts:i,pts:i},{type:`audio`,dts:i+n*1024*c,pts:i+n*1024*c}]}},ni=function(e){var t={pid:null,table:null},n={};for(var r in Zr(e,t),t.table)if(t.table.hasOwnProperty(r))switch(t.table[r]){case Kr.H264_STREAM_TYPE:n.video=[],$r(e,t,n),n.video.length===0&&delete n.video;break;case Kr.ADTS_STREAM_TYPE:n.audio=[],Qr(e,t,n),n.audio.length===0&&delete n.audio;break}return n},ri={inspect:function(e,t){var n=W.aac.isLikelyAacData(e)?ti(e):ni(e);return!n||!n.audio&&!n.video?null:(ei(n,t),n)},parseAudioPes_:Qr};let ii=function(e,t){t.on(`data`,function(t){let n=t.initSegment;t.initSegment={data:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength};let r=t.data;t.data=r.buffer,e.postMessage({action:`data`,segment:t,byteOffset:r.byteOffset,byteLength:r.byteLength},[t.data])}),t.on(`done`,function(t){e.postMessage({action:`done`})}),t.on(`gopInfo`,function(t){e.postMessage({action:`gopInfo`,gopInfo:t})}),t.on(`videoSegmentTimingInfo`,function(t){let n={start:{decode:P.videoTsToSeconds(t.start.dts),presentation:P.videoTsToSeconds(t.start.pts)},end:{decode:P.videoTsToSeconds(t.end.dts),presentation:P.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:P.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=P.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:`videoSegmentTimingInfo`,videoSegmentTimingInfo:n})}),t.on(`audioSegmentTimingInfo`,function(t){let n={start:{decode:P.videoTsToSeconds(t.start.dts),presentation:P.videoTsToSeconds(t.start.pts)},end:{decode:P.videoTsToSeconds(t.end.dts),presentation:P.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:P.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=P.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:`audioSegmentTimingInfo`,audioSegmentTimingInfo:n})}),t.on(`id3Frame`,function(t){e.postMessage({action:`id3Frame`,id3Frame:t})}),t.on(`caption`,function(t){e.postMessage({action:`caption`,caption:t})}),t.on(`trackinfo`,function(t){e.postMessage({action:`trackinfo`,trackInfo:t})}),t.on(`audioTimingInfo`,function(t){e.postMessage({action:`audioTimingInfo`,audioTimingInfo:{start:P.videoTsToSeconds(t.start),end:P.videoTsToSeconds(t.end)}})}),t.on(`videoTimingInfo`,function(t){e.postMessage({action:`videoTimingInfo`,videoTimingInfo:{start:P.videoTsToSeconds(t.start),end:P.videoTsToSeconds(t.end)}})}),t.on(`log`,function(t){e.postMessage({action:`log`,log:t})})};class ai{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new bn.Transmuxer(this.options),ii(this.self,this.transmuxer)}pushMp4Captions(e){this.captionParser||(this.captionParser=new kr,this.captionParser.init());let t=new Uint8Array(e.data,e.byteOffset,e.byteLength),n=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:`mp4Captions`,captions:n&&n.captions||[],logs:n&&n.logs||[],data:t.buffer},[t.buffer])}initMp4WebVttParser(e){this.webVttParser||=new Pr;let t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.webVttParser.init(t)}getMp4WebVttText(e){this.webVttParser||=new Pr;let t=new Uint8Array(e.data,e.byteOffset,e.byteLength),n=this.webVttParser.parseSegment(t);this.self.postMessage({action:`getMp4WebVttText`,mp4VttCues:n||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){let n=pr.startTime(e,t);this.self.postMessage({action:`probeMp4StartTime`,startTime:n,data:t},[t.buffer])}probeMp4Tracks({data:e}){let t=pr.tracks(e);this.self.postMessage({action:`probeMp4Tracks`,tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){let n=pr.getEmsgID3(e,t);this.self.postMessage({action:`probeEmsgID3`,id3Frames:n,emsgData:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){let n=typeof t==`number`&&!isNaN(t)?t*P.ONE_SECOND_IN_TS:void 0,r=ri.inspect(e,n),i=null;r&&(i={hasVideo:r.video&&r.video.length===2||!1,hasAudio:r.audio&&r.audio.length===2||!1},i.hasVideo&&(i.videoStart=r.video[0].ptsTime),i.hasAudio&&(i.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:`probeTs`,result:i,data:e},[e.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(e){let t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){let t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(P.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(P.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush(),self.postMessage({action:`done`,type:`transmuxed`})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:`endedtimeline`,type:`transmuxed`})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){if(e.data.action===`init`&&e.data.options){this.messageHandlers=new ai(self,e.data.options);return}this.messageHandlers||=new ai(self),e.data&&e.data.action&&e.data.action!==`init`&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data)}}))),Ku=(e,t,n)=>{let{type:r,initSegment:i,captions:a,captionStreams:o,metadata:s,videoFrameDtsTime:c,videoFramePtsTime:l}=e.data.segment;t.buffer.push({captions:a,captionStreams:o,metadata:s});let u=e.data.segment.boxes||{data:e.data.segment.data},d={type:r,data:new Uint8Array(u.data,u.data.byteOffset,u.data.byteLength),initSegment:new Uint8Array(i.data,i.byteOffset,i.byteLength)};c!==void 0&&(d.videoFrameDtsTime=c),l!==void 0&&(d.videoFramePtsTime=l),n(d)},qu=({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)},Ju=(e,t)=>{t.gopInfo=e.data.gopInfo},Yu=e=>{let{transmuxer:t,bytes:n,audioAppendStart:r,gopsToAlignWith:i,remux:a,onData:o,onTrackInfo:s,onAudioTimingInfo:c,onVideoTimingInfo:l,onVideoSegmentTimingInfo:u,onAudioSegmentTimingInfo:d,onId3:f,onCaptions:p,onDone:m,onEndedTimeline:h,onTransmuxerLog:g,isEndOfTimeline:_,segment:v,triggerSegmentEventFn:y}=e,b={buffer:[]},x=_;if(t.onmessage=n=>{t.currentTransmux===e&&(n.data.action===`data`&&Ku(n,b,o),n.data.action===`trackinfo`&&s(n.data.trackInfo),n.data.action===`gopInfo`&&Ju(n,b),n.data.action===`audioTimingInfo`&&c(n.data.audioTimingInfo),n.data.action===`videoTimingInfo`&&l(n.data.videoTimingInfo),n.data.action===`videoSegmentTimingInfo`&&u(n.data.videoSegmentTimingInfo),n.data.action===`audioSegmentTimingInfo`&&d(n.data.audioSegmentTimingInfo),n.data.action===`id3Frame`&&f([n.data.id3Frame],n.data.id3Frame.dispatchType),n.data.action===`caption`&&p(n.data.caption),n.data.action===`endedtimeline`&&(x=!1,h()),n.data.action===`log`&&g(n.data.log),n.data.type===`transmuxed`&&(x||(t.onmessage=null,qu({transmuxedData:b,callback:m}),Xu(t))))},t.onerror=()=>{m(null,{message:`Received an error message from the transmuxer worker`,metadata:{errorType:Z.Error.StreamingFailedToTransmuxSegment,segmentInfo:hf({segment:v})}})},r&&t.postMessage({action:`setAudioAppendStart`,appendStart:r}),Array.isArray(i)&&t.postMessage({action:`alignGopsWith`,gopsToAlignWith:i}),a!==void 0&&t.postMessage({action:`setRemux`,remux:a}),n.byteLength){let e=n instanceof ArrayBuffer?n:n.buffer,r=n instanceof ArrayBuffer?0:n.byteOffset;y({type:`segmenttransmuxingstart`,segment:v}),t.postMessage({action:`push`,data:e,byteOffset:r,byteLength:n.byteLength},[e])}_&&t.postMessage({action:`endTimeline`}),t.postMessage({action:`flush`})},Xu=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),typeof e.currentTransmux==`function`?e.currentTransmux():Yu(e.currentTransmux))},Zu=(e,t)=>{e.postMessage({action:t}),Xu(e)},Qu=(e,t)=>{if(!t.currentTransmux){t.currentTransmux=e,Zu(t,e);return}t.transmuxQueue.push(Zu.bind(null,t,e))},$u=e=>{Qu(`reset`,e)},ed=e=>{Qu(`endTimeline`,e)},td=e=>{if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e,Yu(e);return}e.transmuxer.transmuxQueue.push(e)},nd={reset:$u,endTimeline:ed,transmux:td,createTransmuxer:e=>{let t=new Gu;t.currentTransmux=null,t.transmuxQueue=[];let n=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,n.call(t)),t.postMessage({action:`init`,options:e}),t}},rd=function(e){let t=e.transmuxer,n=e.endAction||e.action,r=e.callback,i=w({},e,{endAction:null,transmuxer:null,callback:null}),a=i=>{i.data.action===n&&(t.removeEventListener(`message`,a),i.data.data&&(i.data.data=new Uint8Array(i.data.data,e.byteOffset||0,e.byteLength||i.data.data.byteLength),e.data&&=i.data.data),r(i.data))};if(t.addEventListener(`message`,a),e.data){let n=e.data instanceof ArrayBuffer;i.byteOffset=n?0:e.data.byteOffset,i.byteLength=e.data.byteLength;let r=[n?e.data:e.data.buffer];t.postMessage(i,r)}else t.postMessage(i)},id={FAILURE:2,TIMEOUT:-101,ABORTED:-102},ad=`wvtt`,od=e=>{e.forEach(e=>{e.abort()})},sd=e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}),cd=e=>{let t=e.target,n={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return n.bytesReceived=e.loaded,n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3),n},ld=(e,t)=>{let{requestType:n}=t,r=Rl({requestType:n,request:t,error:e});return t.timedout?{status:t.status,message:`HLS request timed-out at URL: `+t.uri,code:id.TIMEOUT,xhr:t,metadata:r}:t.aborted?{status:t.status,message:`HLS request aborted at URL: `+t.uri,code:id.ABORTED,xhr:t,metadata:r}:e?{status:t.status,message:`HLS request errored at URL: `+t.uri,code:id.FAILURE,xhr:t,metadata:r}:t.responseType===`arraybuffer`&&t.response.byteLength===0?{status:t.status,message:`Empty HLS response at URL: `+t.uri,code:id.FAILURE,xhr:t,metadata:r}:null},ud=(e,t,n,r)=>(i,a)=>{let o=a.response,s=ld(i,a);if(s)return n(s,e);if(o.byteLength!==16)return n({status:a.status,message:`Invalid HLS key at URL: `+a.uri,code:id.FAILURE,xhr:a},e);let c=new DataView(o),l=new Uint32Array([c.getUint32(0),c.getUint32(4),c.getUint32(8),c.getUint32(12)]);for(let e=0;e<t.length;e++)t[e].bytes=l;return r({type:`segmentkeyloadcomplete`,segment:e,keyInfo:{uri:a.uri}}),n(null,e)},dd=(e,t)=>{t===ad&&e.transmuxer.postMessage({action:`initMp4WebVttParser`,data:e.map.bytes})},fd=(e,t,n)=>{t===ad&&rd({action:`getMp4WebVttText`,data:e.bytes,transmuxer:e.transmuxer,callback:({data:t,mp4VttCues:r})=>{e.bytes=t,n(null,e,{mp4VttCues:r})}})},pd=(e,t)=>{let n=Nn(e.map.bytes);if(n!==`mp4`){let r=e.map.resolvedUri||e.map.uri,i=n||`unknown`;return t({internal:!0,message:`Found unsupported ${i} container for initialization segment at URL: ${r}`,code:id.FAILURE,metadata:{mediaType:i}})}rd({action:`probeMp4Tracks`,data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:n,data:r})=>(e.map.bytes=r,n.forEach(function(t){e.map.tracks=e.map.tracks||{},!e.map.tracks[t.type]&&(e.map.tracks[t.type]=t,typeof t.id==`number`&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale),t.type===`text`&&dd(e,t.codec))}),t(null))})},md=({segment:e,finishProcessingFn:t,triggerSegmentEventFn:n})=>(r,i)=>{let a=ld(r,i);if(a)return t(a,e);let o=new Uint8Array(i.response);if(n({type:`segmentloaded`,segment:e}),e.map.key)return e.map.encryptedBytes=o,t(null,e);e.map.bytes=o,pd(e,function(n){if(n)return n.xhr=i,n.status=i.status,t(n,e);t(null,e)})},hd=({segment:e,finishProcessingFn:t,responseType:n,triggerSegmentEventFn:r})=>(i,a)=>{let o=ld(i,a);if(o)return t(o,e);r({type:`segmentloaded`,segment:e});let s=n===`arraybuffer`||!a.responseText?a.response:zu(a.responseText.substring(e.lastReachedChar||0));return e.stats=sd(a),e.key?e.encryptedBytes=new Uint8Array(s):e.bytes=new Uint8Array(s),t(null,e)},gd=({segment:e,bytes:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:s,isEndOfTimeline:c,endedTimelineFn:l,dataFn:u,doneFn:d,onTransmuxerLog:f,triggerSegmentEventFn:p})=>{let m=e.map&&e.map.tracks||{},h=!!(m.audio&&m.video),g=r.bind(null,e,`audio`,`start`),_=r.bind(null,e,`audio`,`end`),v=r.bind(null,e,`video`,`start`),y=r.bind(null,e,`video`,`end`),b=()=>td({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:h,onData:t=>{t.type=t.type===`combined`?`video`:t.type,u(e,t)},onTrackInfo:t=>{n&&(h&&(t.isMuxed=!0),n(e,t))},onAudioTimingInfo:e=>{g&&e.start!==void 0&&(g(e.start),g=null),_&&e.end!==void 0&&_(e.end)},onVideoTimingInfo:e=>{v&&e.start!==void 0&&(v(e.start),v=null),y&&e.end!==void 0&&y(e.end)},onVideoSegmentTimingInfo:t=>{p({type:`segmenttransmuxingtiminginfoavailable`,segment:e,timingInfo:{pts:{start:t.start.presentation,end:t.end.presentation},dts:{start:t.start.decode,end:t.end.decode}}}),i(t)},onAudioSegmentTimingInfo:t=>{p({type:`segmenttransmuxingtiminginfoavailable`,segment:e,timingInfo:{pts:{start:t.start.pts,end:t.end.pts},dts:{start:t.start.dts,end:t.end.dts}}}),a(t)},onId3:(t,n)=>{o(e,t,n)},onCaptions:t=>{s(e,[t])},isEndOfTimeline:c,onEndedTimeline:()=>{l()},onTransmuxerLog:f,onDone:(t,n)=>{d&&(t.type=t.type===`combined`?`video`:t.type,p({type:`segmenttransmuxingcomplete`,segment:e}),d(n,e,t))},segment:e,triggerSegmentEventFn:p});rd({action:`probeTs`,transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:r=>{e.bytes=t=r.data;let i=r.result;i&&(n(e,{hasAudio:i.hasAudio,hasVideo:i.hasVideo,isMuxed:h}),n=null),b()}})},_d=({segment:e,bytes:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:s,isEndOfTimeline:c,endedTimelineFn:l,dataFn:u,doneFn:d,onTransmuxerLog:f,triggerSegmentEventFn:p})=>{let m=new Uint8Array(t);if(Pn(m)){e.isFmp4=!0;let{tracks:i}=e.map;if(i.text&&(!i.audio||!i.video)){u(e,{data:m,type:`text`}),fd(e,i.text.codec,d);return}let a={isFmp4:!0,hasVideo:!!i.video,hasAudio:!!i.audio};i.audio&&i.audio.codec&&i.audio.codec!==`enca`&&(a.audioCodec=i.audio.codec),i.video&&i.video.codec&&i.video.codec!==`encv`&&(a.videoCodec=i.video.codec),i.video&&i.audio&&(a.isMuxed=!0),n(e,a);let c=(t,n)=>{u(e,{data:m,type:a.hasAudio&&!a.isMuxed?`audio`:`video`}),n&&n.length&&o(e,n),t&&t.length&&s(e,t),d(null,e,{})};rd({action:`probeMp4StartTime`,timescales:e.map.timescales,data:m,transmuxer:e.transmuxer,callback:({data:n,startTime:o})=>{t=n.buffer,e.bytes=m=n,a.hasAudio&&!a.isMuxed&&r(e,`audio`,`start`,o),a.hasVideo&&r(e,`video`,`start`,o),rd({action:`probeEmsgID3`,data:m,transmuxer:e.transmuxer,offset:o,callback:({emsgData:n,id3Frames:r})=>{if(t=n.buffer,e.bytes=m=n,!i.video||!n.byteLength||!e.transmuxer){c(void 0,r);return}rd({action:`pushMp4Captions`,endAction:`mp4Captions`,transmuxer:e.transmuxer,data:m,timescales:e.map.timescales,trackIds:[i.video.id],callback:n=>{t=n.data.buffer,e.bytes=m=n.data,n.logs.forEach(function(e){f(Q(e,{stream:`mp4CaptionParser`}))}),c(n.captions,r)}})}})}});return}if(!e.transmuxer){d(null,e,{});return}if(e.container===void 0&&(e.container=Nn(m)),e.container!==`ts`&&e.container!==`aac`){n(e,{hasAudio:!1,hasVideo:!1}),d(null,e,{});return}gd({segment:e,bytes:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:s,isEndOfTimeline:c,endedTimelineFn:l,dataFn:u,doneFn:d,onTransmuxerLog:f,triggerSegmentEventFn:p})},vd=function({id:e,key:t,encryptedBytes:n,decryptionWorker:r,segment:i,doneFn:a},o){let s=t=>{if(t.data.source===e){r.removeEventListener(`message`,s);let e=t.data.decrypted;o(new Uint8Array(e.bytes,e.byteOffset,e.byteLength))}};r.onerror=()=>{let e=`An error occurred in the decryption worker`,t=hf({segment:i});a({message:e,metadata:{error:Error(e),errorType:Z.Error.StreamingFailedToDecryptSegment,segmentInfo:t,keyInfo:{uri:i.key.resolvedUri||i.map.key.resolvedUri}}},i)},r.addEventListener(`message`,s);let c;c=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),r.postMessage(fu({source:e,encrypted:n,key:c,iv:t.iv}),[n.buffer,c.buffer])},yd=({decryptionWorker:e,segment:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:s,isEndOfTimeline:c,endedTimelineFn:l,dataFn:u,doneFn:d,onTransmuxerLog:f,triggerSegmentEventFn:p})=>{p({type:`segmentdecryptionstart`}),vd({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e,segment:t,doneFn:d},e=>{t.bytes=e,p({type:`segmentdecryptioncomplete`,segment:t}),_d({segment:t,bytes:t.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:s,isEndOfTimeline:c,endedTimelineFn:l,dataFn:u,doneFn:d,onTransmuxerLog:f,triggerSegmentEventFn:p})})},bd=({activeXhrs:e,decryptionWorker:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:s,isEndOfTimeline:c,endedTimelineFn:l,dataFn:u,doneFn:d,onTransmuxerLog:f,triggerSegmentEventFn:p})=>{let m=0,h=!1;return(g,_)=>{if(!h){if(g)return h=!0,od(e),d(g,_);if(m+=1,m===e.length){let m=function(){if(_.encryptedBytes)return yd({decryptionWorker:t,segment:_,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:s,isEndOfTimeline:c,endedTimelineFn:l,dataFn:u,doneFn:d,onTransmuxerLog:f,triggerSegmentEventFn:p});_d({segment:_,bytes:_.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:s,isEndOfTimeline:c,endedTimelineFn:l,dataFn:u,doneFn:d,onTransmuxerLog:f,triggerSegmentEventFn:p})};if(_.endOfAllRequests=Date.now(),_.map&&_.map.encryptedBytes&&!_.map.bytes)return p({type:`segmentdecryptionstart`,segment:_}),vd({decryptionWorker:t,id:_.requestId+`-init`,encryptedBytes:_.map.encryptedBytes,key:_.map.key,segment:_,doneFn:d},t=>{_.map.bytes=t,p({type:`segmentdecryptioncomplete`,segment:_}),pd(_,t=>{if(t)return od(e),d(t,_);m()})});m()}}}},xd=({loadendState:e,abortFn:t})=>n=>{n.target.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)},Sd=({segment:e,progressFn:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:s,isEndOfTimeline:c,endedTimelineFn:l,dataFn:u})=>n=>{if(!n.target.aborted)return e.stats=Q(e.stats,cd(n)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(n,e)},Cd=({xhr:e,xhrOptions:t,decryptionWorker:n,segment:r,abortFn:i,progressFn:a,trackInfoFn:o,timingInfoFn:s,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:l,id3Fn:u,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:p,dataFn:m,doneFn:h,onTransmuxerLog:g,triggerSegmentEventFn:_})=>{let v=[],y=bd({activeXhrs:v,decryptionWorker:n,trackInfoFn:o,timingInfoFn:s,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:l,id3Fn:u,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:p,dataFn:m,doneFn:h,onTransmuxerLog:g,triggerSegmentEventFn:_});if(r.key&&!r.key.bytes){let n=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&n.push(r.map.key);let i=Q(t,{uri:r.key.resolvedUri,responseType:`arraybuffer`,requestType:`segment-key`}),a=ud(r,n,y,_);_({type:`segmentkeyloadstart`,segment:r,keyInfo:{uri:r.key.resolvedUri}});let o=e(i,a);v.push(o)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){let n=Q(t,{uri:r.map.key.resolvedUri,responseType:`arraybuffer`,requestType:`segment-key`}),i=ud(r,[r.map.key],y,_);_({type:`segmentkeyloadstart`,segment:r,keyInfo:{uri:r.map.key.resolvedUri}});let a=e(n,i);v.push(a)}let n=Q(t,{uri:r.map.resolvedUri,responseType:`arraybuffer`,headers:cu(r.map),requestType:`segment-media-initialization`}),i=md({segment:r,finishProcessingFn:y,triggerSegmentEventFn:_});_({type:`segmentloadstart`,segment:r});let a=e(n,i);v.push(a)}let b=Q(t,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:`arraybuffer`,headers:cu(r),requestType:`segment`}),x=hd({segment:r,finishProcessingFn:y,responseType:b.responseType,triggerSegmentEventFn:_});_({type:`segmentloadstart`,segment:r});let S=e(b,x);S.addEventListener(`progress`,Sd({segment:r,progressFn:a,trackInfoFn:o,timingInfoFn:s,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:l,id3Fn:u,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:p,dataFn:m})),v.push(S);let C={};return v.forEach(e=>{e.addEventListener(`loadend`,xd({loadendState:C,abortFn:i}))}),()=>od(v)},wd=zc(`PlaylistSelector`),Td=function(e){if(!e||!e.playlist)return;let t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||``})},Ed=function(e,t){if(!e)return``;let n=C.default.getComputedStyle(e);return n?n[t]:``},Dd=function(e,t){let n=e.slice();e.sort(function(e,r){let i=t(e,r);return i===0?n.indexOf(e)-n.indexOf(r):i})},Od=function(e,t){let n,r;return e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n||=C.default.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),r||=C.default.Number.MAX_VALUE,n-r},kd=function(e,t){let n,r;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n||=C.default.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),r||=C.default.Number.MAX_VALUE,n===r&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:n-r},Ad=function(e){let{main:t,bandwidth:n,playerWidth:r,playerHeight:i,playerObjectFit:a,limitRenditionByPlayerDimensions:o,playlistController:s}=e;if(!t)return;let c={bandwidth:n,width:r,height:i,limitRenditionByPlayerDimensions:o},l=t.playlists;Tl.isAudioOnly(t)&&(l=s.getAudioTrackPlaylists_(),c.audioOnly=!0);let u=l.map(e=>{let t,n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,r=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t||=C.default.Number.MAX_VALUE,{bandwidth:t,width:n,height:r,playlist:e}});Dd(u,(e,t)=>e.bandwidth-t.bandwidth),u=u.filter(e=>!Tl.isIncompatible(e.playlist));let d=u.filter(e=>Tl.isEnabled(e.playlist));d.length||(d=u.filter(e=>!Tl.isDisabled(e.playlist)));let f=d.filter(e=>e.bandwidth*Ru.BANDWIDTH_VARIANCE<n),p=f[f.length-1],m=f.filter(e=>e.bandwidth===p.bandwidth)[0];if(o===!1){let e=m||d[0]||u[0];if(e&&e.playlist){let t=`sortedPlaylistReps`;return m&&(t=`bandwidthBestRep`),d[0]&&(t=`enabledPlaylistReps`),wd(`choosing ${Td(e)} using ${t} with options`,c),e.playlist}return wd(`could not choose a playlist with options`,c),null}let h=f.filter(e=>e.width&&e.height);Dd(h,(e,t)=>e.width-t.width);let g=h.filter(e=>e.width===r&&e.height===i);p=g[g.length-1];let _=g.filter(e=>e.bandwidth===p.bandwidth)[0],v,y,b;_||(v=h.filter(e=>a===`cover`?e.width>r&&e.height>i:e.width>r||e.height>i),y=v.filter(e=>e.width===v[0].width&&e.height===v[0].height),p=y[y.length-1],b=y.filter(e=>e.bandwidth===p.bandwidth)[0]);let x;if(s.leastPixelDiffSelector){let e=h.map(e=>(e.pixelDiff=Math.abs(e.width-r)+Math.abs(e.height-i),e));Dd(e,(e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff),x=e[0]}let S=x||b||_||m||d[0]||u[0];if(S&&S.playlist){let e=`sortedPlaylistReps`;return x?e=`leastPixelDiffRep`:b?e=`resolutionPlusOneRep`:_?e=`resolutionBestRep`:m?e=`bandwidthBestRep`:d[0]&&(e=`enabledPlaylistReps`),wd(`choosing ${Td(S)} using ${e} with options`,c),S.playlist}return wd(`could not choose a playlist with options`,c),null},jd=function(){let e=this.useDevicePixelRatio&&C.default.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(e=this.customPixelRatio),Ad({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(Ed(this.tech_.el(),`width`),10)*e,playerHeight:parseInt(Ed(this.tech_.el(),`height`),10)*e,playerObjectFit:this.usePlayerObjectFit?Ed(this.tech_.el(),`objectFit`):``,limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},Md=function(e){let t=-1,n=-1;if(e<0||e>1)throw Error(`Moving average bandwidth decay must be between 0 and 1.`);return function(){let r=this.useDevicePixelRatio&&C.default.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(r=this.customPixelRatio),t<0&&(t=this.systemBandwidth,n=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==n&&(t=e*this.systemBandwidth+(1-e)*t,n=this.systemBandwidth),Ad({main:this.playlists.main,bandwidth:t,playerWidth:parseInt(Ed(this.tech_.el(),`width`),10)*r,playerHeight:parseInt(Ed(this.tech_.el(),`height`),10)*r,playerObjectFit:this.usePlayerObjectFit?Ed(this.tech_.el(),`objectFit`):``,limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},Nd=function(e){let{main:t,currentTime:n,bandwidth:r,duration:i,segmentDuration:a,timeUntilRebuffer:o,currentTimeline:s,syncController:c}=e,l=t.playlists.filter(e=>!Tl.isIncompatible(e)),u=l.filter(Tl.isEnabled);u.length||(u=l.filter(e=>!Tl.isDisabled(e)));let d=u.filter(Tl.hasAttribute.bind(null,`BANDWIDTH`)).map(e=>{let t=c.getSyncPoint(e,i,s,n)?1:2;return{playlist:e,rebufferingImpact:Tl.estimateSegmentRequestTime(a,r,e)*t-o}}),f=d.filter(e=>e.rebufferingImpact<=0);return Dd(f,(e,t)=>Od(t.playlist,e.playlist)),f.length?f[0]:(Dd(d,(e,t)=>e.rebufferingImpact-t.rebufferingImpact),d[0]||null)},Pd=function(){let e=this.playlists.main.playlists.filter(Tl.isEnabled);return Dd(e,(e,t)=>Od(e,t)),e.filter(e=>!!Gl(this.playlists.main,e).video)[0]||null},Fd=e=>{let t=0,n;return e.bytes&&(n=new Uint8Array(e.bytes),e.segments.forEach(e=>{n.set(e,t),t+=e.byteLength})),n};function Id(e){try{return new URL(e).pathname.split(`/`).slice(-2).join(`/`)}catch{return``}}var Ld=function(e,t,n){if(!e[n]){t.trigger({type:`usage`,name:`vhs-608`});let r=n;/^cc708_/.test(n)&&(r=`SERVICE`+n.split(`_`)[1]);let i=t.textTracks().getTrackById(r);if(i)e[n]=i;else{let i=t.options_.vhs&&t.options_.vhs.captionServices||{},a=n,o=n,s=!1,c=i[r];c&&(a=c.label,o=c.language,s=c.default),e[n]=t.addRemoteTextTrack({kind:`captions`,id:r,default:s,label:a,language:o},!1).track}}},Rd=function({inbandTextTracks:e,captionArray:t,timestampOffset:n}){if(!t)return;let r=C.default.WebKitDataCue||C.default.VTTCue;t.forEach(t=>{let i=t.stream;t.content?t.content.forEach(a=>{let o=new r(t.startTime+n,t.endTime+n,a.text);o.line=a.line,o.align=`left`,o.position=a.position,o.positionAlign=`line-left`,e[i].addCue(o)}):e[i].addCue(new r(t.startTime+n,t.endTime+n,t.text))})},zd=function(e){Object.defineProperties(e.frame,{id:{get(){return Z.log.warn(`cue.frame.id is deprecated. Use cue.value.key instead.`),e.value.key}},value:{get(){return Z.log.warn(`cue.frame.value is deprecated. Use cue.value.data instead.`),e.value.data}},privateData:{get(){return Z.log.warn(`cue.frame.privateData is deprecated. Use cue.value.data instead.`),e.value.data}}})},Bd=({inbandTextTracks:e,metadataArray:t,timestampOffset:n,videoDuration:r})=>{if(!t)return;let i=C.default.WebKitDataCue||C.default.VTTCue,a=e.metadataTrack_;if(!a||(t.forEach(e=>{let t=e.cueTime+n;typeof t!=`number`||C.default.isNaN(t)||t<0||!(t<1/0)||!e.frames||!e.frames.length||e.frames.forEach(e=>{let n=new i(t,t,e.value||e.url||e.data||``);n.frame=e,n.value=e,zd(n),a.addCue(n)})}),!a.cues||!a.cues.length))return;let o=a.cues,s=[];for(let e=0;e<o.length;e++)o[e]&&s.push(o[e]);let c=s.reduce((e,t)=>{let n=e[t.startTime]||[];return n.push(t),e[t.startTime]=n,e},{}),l=Object.keys(c).sort((e,t)=>Number(e)-Number(t));l.forEach((e,t)=>{let n=c[e],i=isFinite(r)?r:e,a=Number(l[t+1])||i;n.forEach(e=>{e.endTime=a})})},Vd={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`},Hd=new Set([`id`,`class`,`startDate`,`duration`,`endDate`,`endOnNext`,`startTime`,`endTime`,`processDateRange`]),Ud=({inbandTextTracks:e,dateRanges:t})=>{let n=e.metadataTrack_;if(!n)return;let r=C.default.WebKitDataCue||C.default.VTTCue;t.forEach(e=>{for(let t of Object.keys(e)){if(Hd.has(t))continue;let i=new r(e.startTime,e.endTime,``);i.id=e.id,i.type=`com.apple.quicktime.HLS`,i.value={key:Vd[t],data:e[t]},(t===`scte35Out`||t===`scte35In`)&&(i.value.data=new Uint8Array(i.value.data.match(/[\da-f]{2}/gi)).buffer),n.addCue(i)}e.processDateRange()})},Wd=(e,t,n)=>{e.metadataTrack_||(e.metadataTrack_=n.addRemoteTextTrack({kind:`metadata`,label:`Timed Metadata`},!1).track,Z.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},Gd=function(e,t,n){let r,i;if(n&&n.cues)for(r=n.cues.length;r--;)i=n.cues[r],i.startTime>=e&&i.endTime<=t&&n.removeCue(i)},Kd=function(e){let t=e.cues;if(!t)return;let n={};for(let r=t.length-1;r>=0;r--){let i=t[r],a=`${i.startTime}-${i.endTime}-${i.text}`;n[a]?e.removeCue(i):n[a]=i}},qd=(e,t,n)=>{if(t==null||!e.length)return[];let r=Math.ceil((t-n+3)*Fn.ONE_SECOND_IN_TS),i;for(i=0;i<e.length&&!(e[i].pts>r);i++);return e.slice(i)},Jd=(e,t,n)=>{if(!t.length)return e;if(n)return t.slice();let r=t[0].pts,i=0;for(;i<e.length&&!(e[i].pts>=r);i++);return e.slice(0,i).concat(t)},Yd=(e,t,n,r)=>{let i=Math.ceil((t-r)*Fn.ONE_SECOND_IN_TS),a=Math.ceil((n-r)*Fn.ONE_SECOND_IN_TS),o=e.slice(),s=e.length;for(;s--&&!(e[s].pts<=a););if(s===-1)return o;let c=s+1;for(;c--&&!(e[c].pts<=i););return c=Math.max(c,0),o.splice(c,s-c+1),o},Xd=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;let n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++){let a=n[i];if(a!==r[i]||e[a]!==t[a])return!1}return!0},Zd=function(e,t,n){t||=[];let r=[],i=0;for(let a=0;a<t.length;a++){let o=t[a];if(e===o.timeline&&(r.push(a),i+=o.duration,i>n))return a}return r.length===0?0:r[r.length-1]},Qd=1,$d=500,ef=e=>typeof e==`number`&&isFinite(e),tf=1/60,nf=(e,t,n)=>e!==`main`||!t||!n?null:!n.hasAudio&&!n.hasVideo?`Neither audio nor video found in segment.`:t.hasVideo&&!n.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.`:!t.hasVideo&&n.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,rf=(e,t,n)=>{let r=t-Ru.BACK_BUFFER_LENGTH;e.length&&(r=Math.max(r,e.start(0)));let i=t-n;return Math.min(i,r)},af=e=>{let{startOfSegment:t,duration:n,segment:r,part:i,playlist:{mediaSequence:a,id:o,segments:s=[]},mediaIndex:c,partIndex:l,timeline:u}=e,d=s.length-1,f=`mediaIndex/partIndex increment`;e.getMediaInfoForTime?f=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(f=`getSyncSegmentCandidate (isSyncRequest)`),e.independent&&(f+=` with independent ${e.independent}`);let p=typeof l==`number`,m=e.segment.uri?`segment`:`pre-segment`,h=p?il({preloadSegment:r})-1:0;return`${m} [${a+c}/${a+d}]`+(p?` part [${l}/${h}]`:``)+` segment start/end [${r.start} => ${r.end}]`+(p?` part start/end [${i.start} => ${i.end}]`:``)+` startOfSegment [${t}] duration [${n}] timeline [${u}] selected by [${f}] playlist [${o}]`},of=e=>`${e}TimingInfo`,sf=({segmentTimeline:e,currentTimeline:t,startOfSegment:n,buffered:r,overrideCheck:i})=>!i&&e===t?null:e<t?n:r.length?r.end(r.length-1):n,cf=({timelineChangeController:e,currentTimeline:t,segmentTimeline:n,loaderType:r,audioDisabled:i})=>{if(t===n)return!1;if(r===`audio`){let t=e.lastTimelineChange({type:`main`});return!t||t.to!==n}if(r===`main`&&i){let t=e.pendingTimelineChange({type:`audio`});return!(t&&t.to===n)}return!1},lf=e=>{if(!e)return!1;let t=e.pendingTimelineChange({type:`audio`}),n=e.pendingTimelineChange({type:`main`}),r=t&&n,i=r&&t.to!==n.to;return!!(r&&t.from!==-1&&n.from!==-1&&i)},uf=e=>{let t=e.timelineChangeController_.pendingTimelineChange({type:`audio`}),n=e.timelineChangeController_.pendingTimelineChange({type:`main`});return t&&n&&t.to<n.to},df=e=>{let t=e.pendingSegment_;if(t&&cf({timelineChangeController:e.timelineChangeController_,currentTimeline:e.currentTimeline_,segmentTimeline:t.timeline,loaderType:e.loaderType_,audioDisabled:e.audioDisabled_})&&lf(e.timelineChangeController_)){if(uf(e)){e.timelineChangeController_.trigger(`audioTimelineBehind`);return}e.timelineChangeController_.trigger(`fixBadTimelineChange`)}},ff=e=>{let t=0;return[`video`,`audio`].forEach(function(n){let r=e[`${n}TimingInfo`];if(!r)return;let{start:i,end:a}=r,o;typeof i==`bigint`||typeof a==`bigint`?o=C.default.BigInt(a)-C.default.BigInt(i):typeof i==`number`&&typeof a==`number`&&(o=a-i),o!==void 0&&o>t&&(t=o)}),typeof t==`bigint`&&t<2**53-1&&(t=Number(t)),t},pf=({segmentDuration:e,maxDuration:t})=>e?Math.round(e)>t+Hc:!1,mf=(e,t)=>{if(t!==`hls`)return null;let n=ff({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!n)return null;let r=e.playlist.targetDuration,i=pf({segmentDuration:n,maxDuration:r*2}),a=pf({segmentDuration:n,maxDuration:r}),o=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${n} when the reported duration is ${e.duration} and the target duration is ${r}. 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 i||a?{severity:i?`warn`:`info`,message:o}:null},hf=({type:e,segment:t})=>{if(!t)return;let n=!!(t.key||t.map&&t.map.ke),r=!!(t.map&&!t.map.bytes),i=t.startOfSegment===void 0?t.start:t.startOfSegment;return{type:e||t.type,uri:t.resolvedUri||t.uri,start:i,duration:t.duration,isEncrypted:n,isMediaInitialization:r}},gf=class extends Z.EventTarget{constructor(e,t={}){if(super(),!e)throw TypeError(`Initialization settings are required`);if(typeof e.currentTime!=`function`)throw TypeError(`No currentTime getter specified`);if(!e.mediaSource)throw 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_=zc(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,`state`,{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(`${this.state_} -> ${e}`),this.state_=e,this.trigger(`statechange`))}}),this.sourceUpdater_.on(`ready`,()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():df(this)}),this.sourceUpdater_.on(`codecschange`,e=>{this.trigger(w({type:`codecschange`},e))}),this.loaderType_===`main`&&this.timelineChangeController_.on(`pendingtimelinechange`,()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():df(this)}),this.loaderType_===`audio`&&this.timelineChangeController_.on(`timelinechange`,e=>{this.trigger(w({type:`timelinechange`},e)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():df(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():df(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return nd.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_&&C.default.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_&&=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,C.default.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 e!==void 0&&(this.logger_(`error occurred:`,e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&nd.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger(`ended`)}buffered_(){let e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Bc();if(this.loaderType_===`main`){let{hasAudio:t,hasVideo:n,isMuxed:r}=e;if(n&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(n)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;let n=pu(e),r=this.initSegments_[n];return t&&!r&&e.bytes&&(this.initSegments_[n]=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;let n=mu(e),r=this.keyCache_[n];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[n]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});let i={resolvedUri:(r||e).resolvedUri};return r&&(i.bytes=r.bytes),i}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;let n=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 i=null;if(n&&(n.id?i=n.id:n.uri&&(i=n.uri)),this.logger_(`playlist update [${i} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:
189
196
  currentTime: ${this.currentTime_()}
190
- bufferedEnd: ${Ba(this.buffered_())}
191
- `,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!i||i.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-i.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 c=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=c}}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(i,e)}pause(){this.checkBufferTimeout_&&(w.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_&&Ua.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,i=()=>{},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&&i()};(r||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=K2(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const l in this.inbandTextTracks_)ir(e,t,this.inbandTextTracks_[l]);ir(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&w.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=w.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&w.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=w.setTimeout(this.monitorBufferTick_.bind(this),Z2)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:Oi({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_,i=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||i+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=Ba(e)||0,i=Xo(e,this.currentTime_()),r=!this.hasPlayed_()&&i>=1,n=i>=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=J2(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 k=a[this.mediaIndex],E=typeof this.partIndex=="number"?this.partIndex:-1;l.startOfSegment=k.end?k.end:t,k.parts&&k.parts[E+1]?(l.mediaIndex=this.mediaIndex,l.partIndex=E+1):l.mediaIndex=this.mediaIndex+1}else{let k,E,L;const _=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:
192
- For TargetTime: ${_}.
197
+ bufferedEnd: ${$c(this.buffered_())}
198
+ `,this.mediaSequenceSync_.diagnostics)),this.trigger(`syncinfoupdate`),this.state===`INIT`&&this.couldBeginLoading_())return this.init_();if(!n||n.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration==`number`?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger(`playlistupdate`);return}let a=e.mediaSequence-n.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{let e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){let e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=e}}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(n,e)}pause(){this.checkBufferTimeout_&&=(C.default.clearTimeout(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_&&nd.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;let 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,n=()=>{},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 i=1,a=()=>{i--,i===0&&n()};(r||!this.audioDisabled_)&&(i++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_===`main`)&&(this.gopBuffer_=Yd(this.gopBuffer_,e,t,this.timeMapping_),i++,this.sourceUpdater_.removeVideo(e,t,a));for(let n in this.inbandTextTracks_)Gd(e,t,this.inbandTextTracks_[n]);Gd(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&C.default.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=C.default.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state===`READY`&&this.fillBuffer_(),this.checkBufferTimeout_&&C.default.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=C.default.setTimeout(this.monitorBufferTick_.bind(this),$d)}fillBuffer_(){if(this.sourceUpdater_.updating())return;let e=this.chooseNextRequest_();if(!e)return;let t={segmentInfo:hf({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_,n=this.partIndex){if(!t||!this.mediaSource_)return!1;let r=typeof e==`number`&&t.segments[e],i=e+1===t.segments.length,a=!r||!r.parts||n+1===r.parts.length;return t.endList&&this.mediaSource_.readyState===`open`&&i&&a}chooseNextRequest_(){let e=this.buffered_(),t=$c(e)||0,n=el(e,this.currentTime_()),r=!this.hasPlayed_()&&n>=1,i=n>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||i)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);let o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(o.isSyncRequest)o.mediaIndex=Zd(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(this.mediaIndex!==null){let e=a[this.mediaIndex],n=typeof this.partIndex==`number`?this.partIndex:-1;o.startOfSegment=e.end?e.end:t,e.parts&&e.parts[n+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=n+1):o.mediaIndex=this.mediaIndex+1}else{let e,n,r,i=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:
199
+ For TargetTime: ${i}.
193
200
  CurrentTime: ${this.currentTime_()}
194
201
  BufferedEnd: ${t}
195
202
  Fetch At Buffer: ${this.fetchAtBuffer_}
196
- `,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const I=this.getSyncInfoFromMediaSequenceSync_(_);if(!I){const N="No sync info found while using media sequence sync";return this.error({message:N,metadata:{errorType:B.Error.StreamingFailedToSelectNextSegment,error:new Error(N)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${I.start} --> ${I.end})`),k=I.segmentIndex,E=I.partIndex,L=I.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const I=ft.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:_,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});k=I.segmentIndex,E=I.partIndex,L=I.startTime}l.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${_}`:`currentTime ${_}`,l.mediaIndex=k,l.startOfSegment=L,l.partIndex=E,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${l.mediaIndex} `)}const c=a[l.mediaIndex];let f=c&&typeof l.partIndex=="number"&&c.parts&&c.parts[l.partIndex];if(!c||typeof l.partIndex=="number"&&!f)return null;typeof l.partIndex!="number"&&c.parts&&(l.partIndex=0,f=c.parts[0]);const g=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&f&&!g&&!f.independent)if(l.partIndex===0){const k=a[l.mediaIndex-1],E=k.parts&&k.parts.length&&k.parts[k.parts.length-1];E&&E.independent&&(l.mediaIndex-=1,l.partIndex=k.parts.length-1,l.independent="previous segment")}else c.parts[l.partIndex-1].independent&&(l.partIndex-=1,l.independent="previous part");const y=this.mediaSource_&&this.mediaSource_.readyState==="ended";return l.mediaIndex>=a.length-1&&y&&!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 i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const r=this.mediaSequenceSync_.getSyncInfoForTime(i.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:i,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:l,forceTimestampOffset:c,getMediaInfoForTime:f}=e,g=i.segments[r],y=typeof l=="number"&&g.parts[l],k={requestId:"segment-loader-"+Math.random(),uri:y&&y.resolvedUri||g.resolvedUri,mediaIndex:r,partIndex:y?l:null,isSyncRequest:a,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:g.timeline,duration:y&&y.duration||g.duration,segment:g,part:y,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:f,independent:t},E=typeof c<"u"?c:this.isPendingTimestampOffset_;k.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:g.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:E});const L=Ba(this.sourceUpdater_.audioBuffered());return typeof L=="number"&&(k.audioAppendStart=L-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(k.gopsToAlignWith=X2(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),k}timestampOffsetForSegment_(e){return iv(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_(),i=e.bandwidth,r=this.pendingSegment_.duration,n=ft.estimateSegmentRequestTime(r,i,this.playlist_,e.bytesReceived),a=C1(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const l=N2({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!l)return;const f=n-a-l.rebufferingImpact;let g=.5;a<=Gt&&(g=1),!(!l.playlist||l.playlist.uri===this.playlist_.uri||f<g)&&(this.bandwidth=l.playlist.attributes.BANDWIDTH*We.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${Ji(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:i,hasVideo:r}=t,n={segmentInfo:Oi({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:i,hasVideo:r}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},Q2(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_():yi(this))))}handleTimingInfo_(e,t,i,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,a=lc(t);n[a]=n[a]||{},n[a][i]=r,this.logger_(`timinginfo: ${t} - ${i} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():yi(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:c,captions:f}=n[a],g=this.inbandTextTracks_;this.logger_(`adding cues from ${l} -> ${c} for ${a}`),U2(g,this.vhs_.tech_,a),ir(l,c,g[a]),V2({captionArray:f,inbandTextTracks:g,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));return}this.addMetadataToTextTrack(i,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:i,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo||i&&!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_()){yi(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[lc(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==i.mediaIndex||r.partIndex!==i.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,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:i,playlist:r}){if(i){const n=xn(i);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(i,!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:i},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: "+Ri(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ri(a).join(", "));const l=n.length?n.start(0):0,c=n.length?n.end(n.length-1):0,f=a.length?a.start(0):0,g=a.length?a.end(a.length-1):0;if(c-l<=Zs&&g-f<=Zs){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Ri(n).join(", ")}, video buffer: ${Ri(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:i}));const k=this.currentTime_()-Zs;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${k}`),this.remove(0,k,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Zs}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=w.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Zs*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},r){if(r){if(r.code===mh){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:B.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:r,bytes:n}){if(!n){const l=[r];let c=r.byteLength;i&&(l.unshift(i),c+=i.byteLength),n=F2({bytes:c,segments:l})}const a={segmentInfo:Oi({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,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=i.prependedContentDuration||0,r[n].transmuxedPresentationStart=i.start.presentation,r[n].transmuxedDecodeStart=i.start.decode,r[n].transmuxedPresentationEnd=i.end.presentation,r[n].transmuxedDecodeEnd=i.end.decode,r[n].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:r}=t;if(!r||!r.byteLength||i==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,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_()){yi(this),this.loadQueue_.push(()=>{const t=Ue({},e,{forceTimestampOffset:!0});Ue(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),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=i||r&&n;this.logger_(`Requesting
197
- ${Uh(e.uri)}
198
- ${Ji(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=O2({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:c,stream:f})=>{this.logger_(`${Ji(e)} logged from transmuxer stream ${f} as a ${c}: ${l}`)},triggerSegmentEventFn:({type:l,segment:c,keyInfo:f,trackInfo:g,timingInfo:y})=>{const E={segmentInfo:Oi({segment:c})};f&&(E.keyInfo=f),g&&(E.trackInfo=g),y&&(E.timingInfo=y),this.trigger({type:l,metadata:E})}})}trimBackBuffer_(e){const t=tv(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.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 c=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=c}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<en){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${en}`);return}const i={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:i}),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,i){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));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,i.gopInfo&&(this.gopBuffer_=Y2(this.gopBuffer_,i.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:i,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:n,useVideoTimingInfo:a,videoTimingInfo:l,audioTimingInfo:c}){if(typeof e<"u")return e;if(!a)return c.start;const f=t.segments[i-1];return i===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:i,hasVideo:r,isMuxed:n}=t,a=this.loaderType_==="main"&&r,l=!this.audioDisabled_&&i&&!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=ev(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:i}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:i.start:i.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 c={segmentInfo:Oi({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:c})}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=av(e,this.sourceType_);if(t&&(t.severity==="warn"?B.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 ${Ji(e)}`);return}this.logger_(`Appended ${Ji(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 i=e.segment,r=e.part,n=i.end&&this.currentTime_()-i.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"} ${Ji(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<en){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${en}`);return}const t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,i=t.start,r=t.end;if(!oc(i)||!oc(r))return;ir(i,r,this.segmentMetadataTrack_);const n=w.WebKitDataCue||w.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:i,end:r},l=JSON.stringify(a),c=new n(i,r,l);c.value=a,this.segmentMetadataTrack_.addCue(c)}}function ri(){}const Vh=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},ov=["video","audio"],po=(s,e)=>{const t=e[`${s}Buffer`];return t&&t.updating||e.queuePending[s]},lv=(s,e)=>{for(let t=0;t<e.length;t++){const i=e[t];if(i.type==="mediaSource")return null;if(i.type===s)return t}return null},cs=(s,e)=>{if(e.queue.length===0)return;let t=0,i=e.queue[t];if(i.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),i.action(e),i.doneFn&&i.doneFn(),cs("audio",e),cs("video",e));return}if(s!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||po(s,e))){if(i.type!==s){if(t=lv(s,e.queue),t===null)return;i=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[s]=i,i.action(s,e),!i.doneFn){e.queuePending[s]=null,cs(s,e);return}}},qh=(s,e)=>{const t=e[`${s}Buffer`],i=Vh(s);t&&(t.removeEventListener("updateend",e[`on${i}UpdateEnd_`]),t.removeEventListener("error",e[`on${i}Error_`]),e.codecs[s]=null,e[`${s}Buffer`]=null)},zt=(s,e)=>s&&e&&Array.prototype.indexOf.call(s.sourceBuffers,e)!==-1,yt={appendBuffer:(s,e,t)=>(i,r)=>{const n=r[`${i}Buffer`];if(zt(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${s.length} bytes to ${i}Buffer`);try{n.appendBuffer(s)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===mh?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${i}Buffer`),r.queuePending[i]=null,t(a)}}},remove:(s,e)=>(t,i)=>{const r=i[`${t}Buffer`];if(zt(i.mediaSource,r)){i.logger_(`Removing ${s} to ${e} from ${t}Buffer`);try{r.remove(s,e)}catch{i.logger_(`Remove ${s} to ${e} from ${t}Buffer failed`)}}},timestampOffset:s=>(e,t)=>{const i=t[`${e}Buffer`];zt(t.mediaSource,i)&&(t.logger_(`Setting ${e}timestampOffset to ${s}`),i.timestampOffset=s)},callback:s=>(e,t)=>{s()},endOfStream:s=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${s||""})`);try{e.mediaSource.endOfStream(s)}catch(t){B.log.warn("Failed to call media source endOfStream",t)}}},duration:s=>e=>{e.logger_(`Setting mediaSource duration to ${s}`);try{e.mediaSource.duration=s}catch(t){B.log.warn("Failed to set media source duration",t)}},abort:()=>(s,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${s}Buffer`];if(zt(e.mediaSource,t)){e.logger_(`calling abort on ${s}Buffer`);try{t.abort()}catch(i){B.log.warn(`Failed to abort on ${s}Buffer`,i)}}},addSourceBuffer:(s,e)=>t=>{const i=Vh(s),r=ds(e);t.logger_(`Adding ${s}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${i}UpdateEnd_`]),n.addEventListener("error",t[`on${i}Error_`]),t.codecs[s]=e,t[`${s}Buffer`]=n},removeSourceBuffer:s=>e=>{const t=e[`${s}Buffer`];if(qh(s,e),!!zt(e.mediaSource,t)){e.logger_(`Removing ${s}Buffer with codec ${e.codecs[s]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(i){B.log.warn(`Failed to removeSourceBuffer ${s}Buffer`,i)}}},changeType:s=>(e,t)=>{const i=t[`${e}Buffer`],r=ds(s);if(!zt(t.mediaSource,i))return;const n=s.substring(0,s.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const c={codecsChangeInfo:{from:a,to:s}};t.trigger({type:"codecschange",metadata:c}),t.logger_(`changing ${e}Buffer codec from ${a} to ${s}`);try{i.changeType(r),t.codecs[e]=s}catch(f){c.errorType=B.Error.StreamingCodecsChangeError,c.error=f,f.metadata=c,t.error_=f,t.trigger("error"),B.log.warn(`Failed to changeType on ${e}Buffer`,f)}}},_t=({type:s,sourceUpdater:e,action:t,doneFn:i,name:r})=>{e.queue.push({type:s,action:t,doneFn:i,name:r}),cs(s,e)},cc=(s,e)=>t=>{const i=e[`${s}Buffered`](),r=T1(i);if(e.logger_(`received "updateend" event for ${s} Source Buffer: `,r),e.queuePending[s]){const n=e.queuePending[s].doneFn;e.queuePending[s]=null,n&&n(e[`${s}Error_`])}cs(s,e)};class Hh extends B.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>cs("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=It("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=cc("video",this),this.onAudioUpdateEnd_=cc("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){_t({type:"mediaSource",sourceUpdater:this,action:yt.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){_t({type:e,sourceUpdater:this,action:yt.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){B.log.error("removeSourceBuffer is not supported!");return}_t({type:"mediaSource",sourceUpdater:this,action:yt.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!B.browser.IS_FIREFOX&&w.MediaSource&&w.MediaSource.prototype&&typeof w.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return w.SourceBuffer&&w.SourceBuffer.prototype&&typeof w.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){B.log.error("changeType is not supported!");return}_t({type:e,sourceUpdater:this,action:yt.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 i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){const{segmentInfo:i,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(_t({type:r,sourceUpdater:this,action:yt.appendBuffer(n,i||{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(c=>{this.appendBuffer.apply(this,c)})}}audioBuffered(){return zt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Ye()}videoBuffered(){return zt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Ye()}buffered(){const e=zt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=zt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():S1(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=ri){_t({type:"mediaSource",sourceUpdater:this,action:yt.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=ri){typeof e!="string"&&(e=void 0),_t({type:"mediaSource",sourceUpdater:this,action:yt.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=ri){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}_t({type:"audio",sourceUpdater:this,action:yt.remove(e,t),doneFn:i,name:"remove"})}removeVideo(e,t,i=ri){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}_t({type:"video",sourceUpdater:this,action:yt.remove(e,t),doneFn:i,name:"remove"})}updating(){return!!(po("audio",this)||po("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(_t({type:"audio",sourceUpdater:this,action:yt.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(_t({type:"video",sourceUpdater:this,action:yt.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&_t({type:"audio",sourceUpdater:this,action:yt.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&_t({type:"video",sourceUpdater:this,action:yt.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),ov.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>qh(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const dc=s=>decodeURIComponent(escape(String.fromCharCode.apply(null,s))),uv=s=>{const e=new Uint8Array(s);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},hc=new Uint8Array(`
203
+ `,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){let t=this.getSyncInfoFromMediaSequenceSync_(i);if(!t){let e=`No sync info found while using media sequence sync`;return this.error({message:e,metadata:{errorType:Z.Error.StreamingFailedToSelectNextSegment,error:Error(e)}}),this.logger_(`chooseNextRequest_ - no sync info found using media sequence sync`),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${t.start} --> ${t.end})`),e=t.segmentIndex,n=t.partIndex,r=t.start}else{this.logger_(`chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.`);let t=Tl.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:i,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});e=t.segmentIndex,n=t.partIndex,r=t.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${i}`:`currentTime ${i}`,o.mediaIndex=e,o.startOfSegment=r,o.partIndex=n,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}let s=a[o.mediaIndex],c=s&&typeof o.partIndex==`number`&&s.parts&&s.parts[o.partIndex];if(!s||typeof o.partIndex==`number`&&!c)return null;typeof o.partIndex!=`number`&&s.parts&&(o.partIndex=0,c=s.parts[0]);let l=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!n&&c&&!l&&!c.independent)if(o.partIndex===0){let e=a[o.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(--o.mediaIndex,o.partIndex=e.parts.length-1,o.independent=`previous segment`)}else s.parts[o.partIndex-1].independent&&(--o.partIndex,o.independent=`previous part`);let u=this.mediaSource_&&this.mediaSource_.readyState===`ended`;return o.mediaIndex>=a.length-1&&u&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_(`choose next request. Force timestamp offset after loader resync`)),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;let t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);let n=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!n)return null;if(!n.isAppended)return n;let r=this.mediaSequenceSync_.getSyncInfoForTime(n.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){let{independent:t,playlist:n,mediaIndex:r,startOfSegment:i,isSyncRequest:a,partIndex:o,forceTimestampOffset:s,getMediaInfoForTime:c}=e,l=n.segments[r],u=typeof o==`number`&&l.parts[o],d={requestId:`segment-loader-`+Math.random(),uri:u&&u.resolvedUri||l.resolvedUri,mediaIndex:r,partIndex:u?o:null,isSyncRequest:a,startOfSegment:i,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:u&&u.duration||l.duration,segment:l,part:u,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:c,independent:t},f=s===void 0?this.isPendingTimestampOffset_:s;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:i,buffered:this.buffered_(),overrideCheck:f});let p=$c(this.sourceUpdater_.audioBuffered());return typeof p==`number`&&(d.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=qd(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d}timestampOffsetForSegment_(e){return sf(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;let t=this.currentTime_(),n=e.bandwidth,r=this.pendingSegment_.duration,i=Tl.estimateSegmentRequestTime(r,n,this.playlist_,e.bytesReceived),a=Xc(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(i<=a)return;let o=Nd({main:this.vhs_.playlists.main,currentTime:t,bandwidth:n,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;let s=i-a-o.rebufferingImpact,c=.5;a<=Hc&&(c=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||s<c)&&(this.bandwidth=o.playlist.attributes.BANDWIDTH*Ru.BANDWIDTH_VARIANCE+1,this.trigger(`earlyabort`))}handleAbort_(e){this.logger_(`Aborting ${af(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger(`progress`)}handleTrackInfo_(e,t){let{hasAudio:n,hasVideo:r}=t,i={segmentInfo:hf({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:n,hasVideo:r}};this.trigger({type:`segmenttransmuxingtrackinfoavailable`,metadata:i}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t||={},Xd(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_():df(this))))}handleTimingInfo_(e,t,n,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;let i=this.pendingSegment_,a=of(t);i[a]=i[a]||{},i[a][n]=r,this.logger_(`timinginfo: ${t} - ${n} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():df(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}let n=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),r={};t.forEach(e=>{r[e.stream]=r[e.stream]||{startTime:1/0,captions:[],endTime:0};let t=r[e.stream];t.startTime=Math.min(t.startTime,e.startTime+n),t.endTime=Math.max(t.endTime,e.endTime+n),t.captions.push(e)}),Object.keys(r).forEach(e=>{let{startTime:t,endTime:i,captions:a}=r[e],o=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${i} for ${e}`),Ld(o,this.vhs_.tech_,e),Gd(t,i,o[e]),Rd({captionArray:a,inbandTextTracks:o,timestampOffset:n})}),this.transmuxer_&&this.transmuxer_.postMessage({action:`clearParsedMp4Captions`})}handleId3_(e,t,n){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,n));return}this.addMetadataToTextTrack(n,t,this.duration_())}}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){let e=this.callQueue_;this.callQueue_=[],e.forEach(e=>e())}processLoadQueue_(){let e=this.loadQueue_;this.loadQueue_=[],e.forEach(e=>e())}hasEnoughInfoToLoad_(){if(this.loaderType_!==`audio`)return!0;let e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!cf({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;let e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;let{hasAudio:n,hasVideo:r,isMuxed:i}=t;return!(r&&!e.videoTimingInfo||n&&!this.audioDisabled_&&!i&&!e.audioTimingInfo||cf({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_()){df(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}let n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.part||n.segment),this.mediaSource_.readyState!==`closed`){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),n.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),n.isFmp4=e.isFmp4,n.timingInfo=n.timingInfo||{},n.isFmp4)this.trigger(`fmp4`),n.timingInfo.start=n[of(t.type)].start;else{let e=this.getCurrentMediaInfo_(),t=this.loaderType_===`main`&&e&&e.hasVideo,r;t&&(r=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:t,firstVideoFrameTimeForData:r,videoTimingInfo:n.videoTimingInfo,audioTimingInfo:n.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(n,t.type),this.updateSourceBufferTimestampOffset_(n),n.isSyncRequest){this.updateTimingInfoEnd_(n),this.syncController_.saveSegmentTimingInfo({segmentInfo:n,shouldSaveTimelineMapping:this.loaderType_===`main`});let e=this.chooseNextRequest_();if(e.mediaIndex!==n.mediaIndex||e.partIndex!==n.partIndex){this.logger_(`sync segment was incorrect, not appending`);return}this.logger_(`sync segment was correct, appending`)}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,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:n,playlist:r}){if(n){let e=pu(n);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=e}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n},r){let i=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();i.length>1&&this.logger_(`On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: `+Zc(i).join(`, `)),a.length>1&&this.logger_(`On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: `+Zc(a).join(`, `));let o=i.length?i.start(0):0,s=i.length?i.end(i.length-1):0,c=a.length?a.start(0):0,l=a.length?a.end(a.length-1):0;if(s-o<=Qd&&l-c<=Qd){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${n.byteLength}, audio buffer: ${Zc(i).join(`, `)}, video buffer: ${Zc(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:n}));let u=this.currentTime_()-Qd;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${u}`),this.remove(0,u,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Qd}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=C.default.setTimeout(()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, re-processing call queue`),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Qd*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:n},r){if(r){if(r.code===Ll){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n});return}this.logger_(`Received non QUOTA_EXCEEDED_ERR on append`,r),this.error({message:`${t} append of ${n.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:Z.Error.StreamingFailedToAppendSegment}}),this.trigger(`appenderror`)}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:n,data:r,bytes:i}){if(!i){let e=[r],t=r.byteLength;n&&(e.unshift(n),t+=n.byteLength),i=Fd({bytes:t,segments:e})}let a={segmentInfo:hf({type:this.loaderType_,segment:e})};this.trigger({type:`segmentappendstart`,metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:i},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:i}))}handleSegmentTimingInfo_(e,t,n){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;let r=this.pendingSegment_.segment,i=`${e}TimingInfo`;r[i]||(r[i]={}),r[i].transmuxerPrependedSeconds=n.prependedContentDuration||0,r[i].transmuxedPresentationStart=n.start.presentation,r[i].transmuxedDecodeStart=n.start.decode,r[i].transmuxedPresentationEnd=n.end.presentation,r[i].transmuxedDecodeEnd=n.end.decode,r[i].baseMediaDecodeTime=n.baseMediaDecodeTime}appendData_(e,t){let{type:n,data:r}=t;if(!r||!r.byteLength||n===`audio`&&this.audioDisabled_)return;let i=this.getInitSegmentAndUpdateState_({type:n,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:i,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_()){df(this),this.loadQueue_.push(()=>{let t=w({},e,{forceTimestampOffset:!0});w(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}));let t=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,i=e.timeline!==this.currentTimeline_&&e.timeline>0,a=n||r&&i;this.logger_(`Requesting
204
+ ${Id(e.uri)}
205
+ ${af(e)}`),t.map&&!t.map.bytes&&(this.logger_(`going to request init segment.`),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Cd({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:t,level:n,stream:r})=>{this.logger_(`${af(e)} logged from transmuxer stream ${r} as a ${n}: ${t}`)},triggerSegmentEventFn:({type:e,segment:t,keyInfo:n,trackInfo:r,timingInfo:i})=>{let a={segmentInfo:hf({segment:t})};n&&(a.keyInfo=n),r&&(a.trackInfo=r),i&&(a.timingInfo=i),this.trigger({type:e,metadata:a})}})}trimBackBuffer_(e){let t=rf(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){let t=e.segment,n=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,i=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:n?n.resolvedUri:t.resolvedUri,byterange:n?n.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:i},o=e.playlist.segments[e.mediaIndex-1];if(o&&o.timeline===t.timeline&&(o.videoTimingInfo?a.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(a.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),t.key){let n=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=n}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<tf){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${tf}`);return}let n={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:`bandwidthupdated`,metadata:n}),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,n){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,n));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===id.ABORTED)return;if(this.pause(),e.code===id.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger(`error`);return}let r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,n.gopInfo&&(this.gopBuffer_=Jd(this.gopBuffer_,n.gopInfo,this.safeAppend_)),this.state=`APPENDING`,this.trigger(`appending`),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){let 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:n,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:i,useVideoTimingInfo:a,videoTimingInfo:o,audioTimingInfo:s}){if(e!==void 0)return e;if(!a)return s.start;let c=t.segments[n-1];return n===0||!c||c.start===void 0||c.end!==r+i?r:o.start}waitForAppendsToComplete_(e){let 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}let{hasAudio:n,hasVideo:r,isMuxed:i}=t,a=this.loaderType_===`main`&&r,o=!this.audioDisabled_&&n&&!i;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++,o&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){let t=nf(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:n}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart==`number`?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart==`number`?t.transmuxedDecodeStart:n.start:n.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};let t=this.getMediaInfo_(),n=this.loaderType_===`main`&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;n&&(e.timingInfo.end=typeof n.end==`number`?n.end:n.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){let e={segmentInfo:hf({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:`appendsdone`,metadata:e})}if(!this.pendingSegment_){this.state=`READY`,this.paused()||this.monitorBuffer_();return}let 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`});let t=mf(e,this.sourceType_);if(t&&(t.severity===`warn`?Z.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 ${af(e)}`);return}this.logger_(`Appended ${af(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`);let n=e.segment,r=e.part,i=n.end&&this.currentTime_()-n.end>e.playlist.targetDuration*3,a=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(i||a){this.logger_(`bad ${i?`segment`:`part`} ${af(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<tf){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${tf}`);return}let t=this.throughput.rate,n=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/n*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;let t=e.segment,n=t.start,r=t.end;if(!ef(n)||!ef(r))return;Gd(n,r,this.segmentMetadataTrack_);let i=C.default.WebKitDataCue||C.default.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:n,end:r},o=new i(n,r,JSON.stringify(a));o.value=a,this.segmentMetadataTrack_.addCue(o)}};function _f(){}var vf=function(e){return typeof e==`string`?e.replace(/./,e=>e.toUpperCase()):e},yf=[`video`,`audio`],bf=(e,t)=>{let n=t[`${e}Buffer`];return n&&n.updating||t.queuePending[e]},xf=(e,t)=>{for(let n=0;n<t.length;n++){let r=t[n];if(r.type===`mediaSource`)return null;if(r.type===e)return n}return null},Sf=(e,t)=>{if(t.queue.length===0)return;let n=0,r=t.queue[n];if(r.type===`mediaSource`){!t.updating()&&t.mediaSource.readyState!==`closed`&&(t.queue.shift(),r.action(t),r.doneFn&&r.doneFn(),Sf(`audio`,t),Sf(`video`,t));return}if(e!==`mediaSource`&&!(!t.ready()||t.mediaSource.readyState===`closed`||bf(e,t))){if(r.type!==e){if(n=xf(e,t.queue),n===null)return;r=t.queue[n]}if(t.queue.splice(n,1),t.queuePending[e]=r,r.action(e,t),!r.doneFn){t.queuePending[e]=null,Sf(e,t);return}}},Cf=(e,t)=>{let n=t[`${e}Buffer`],r=vf(e);n&&(n.removeEventListener(`updateend`,t[`on${r}UpdateEnd_`]),n.removeEventListener(`error`,t[`on${r}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},wf=(e,t)=>e&&t&&Array.prototype.indexOf.call(e.sourceBuffers,t)!==-1,Tf={appendBuffer:(e,t,n)=>(r,i)=>{let a=i[`${r}Buffer`];if(wf(i.mediaSource,a)){i.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${r}Buffer`);try{a.appendBuffer(e)}catch(e){i.logger_(`Error with code ${e.code} `+(e.code===Ll?`(QUOTA_EXCEEDED_ERR) `:``)+`when appending segment ${t.mediaIndex} to ${r}Buffer`),i.queuePending[r]=null,n(e)}}},remove:(e,t)=>(n,r)=>{let i=r[`${n}Buffer`];if(wf(r.mediaSource,i)){r.logger_(`Removing ${e} to ${t} from ${n}Buffer`);try{i.remove(e,t)}catch{r.logger_(`Remove ${e} to ${t} from ${n}Buffer failed`)}}},timestampOffset:e=>(t,n)=>{let r=n[`${t}Buffer`];wf(n.mediaSource,r)&&(n.logger_(`Setting ${t}timestampOffset to ${e}`),r.timestampOffset=e)},callback:e=>(t,n)=>{e()},endOfStream:e=>t=>{if(t.mediaSource.readyState===`open`){t.logger_(`Calling mediaSource endOfStream(${e||``})`);try{t.mediaSource.endOfStream(e)}catch(e){Z.log.warn(`Failed to call media source endOfStream`,e)}}},duration:e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(e){Z.log.warn(`Failed to set media source duration`,e)}},abort:()=>(e,t)=>{if(t.mediaSource.readyState!==`open`)return;let n=t[`${e}Buffer`];if(wf(t.mediaSource,n)){t.logger_(`calling abort on ${e}Buffer`);try{n.abort()}catch(t){Z.log.warn(`Failed to abort on ${e}Buffer`,t)}}},addSourceBuffer:(e,t)=>n=>{let r=vf(e),i=j(t);n.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);let a=n.mediaSource.addSourceBuffer(i);a.addEventListener(`updateend`,n[`on${r}UpdateEnd_`]),a.addEventListener(`error`,n[`on${r}Error_`]),n.codecs[e]=t,n[`${e}Buffer`]=a},removeSourceBuffer:e=>t=>{let n=t[`${e}Buffer`];if(Cf(e,t),wf(t.mediaSource,n)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(n)}catch(t){Z.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t)}}},changeType:e=>(t,n)=>{let r=n[`${t}Buffer`],i=j(e);if(!wf(n.mediaSource,r))return;let a=e.substring(0,e.indexOf(`.`)),o=n.codecs[t];if(o.substring(0,o.indexOf(`.`))===a)return;let s={codecsChangeInfo:{from:o,to:e}};n.trigger({type:`codecschange`,metadata:s}),n.logger_(`changing ${t}Buffer codec from ${o} to ${e}`);try{r.changeType(i),n.codecs[t]=e}catch(e){s.errorType=Z.Error.StreamingCodecsChangeError,s.error=e,e.metadata=s,n.error_=e,n.trigger(`error`),Z.log.warn(`Failed to changeType on ${t}Buffer`,e)}}},Ef=({type:e,sourceUpdater:t,action:n,doneFn:r,name:i})=>{t.queue.push({type:e,action:n,doneFn:r,name:i}),Sf(e,t)},Df=(e,t)=>n=>{let r=Vc(t[`${e}Buffered`]());if(t.logger_(`received "updateend" event for ${e} Source Buffer: `,r),t.queuePending[e]){let n=t.queuePending[e].doneFn;t.queuePending[e]=null,n&&n(t[`${e}Error_`])}Sf(e,t)},Of=class extends Z.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Sf(`mediaSource`,this),this.mediaSource.addEventListener(`sourceopen`,this.sourceopenListener_),this.logger_=zc(`SourceUpdater`),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Df(`video`,this),this.onAudioUpdateEnd_=Df(`audio`,this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},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){Ef({type:`mediaSource`,sourceUpdater:this,action:Tf.addSourceBuffer(e,t),name:`addSourceBuffer`})}abort(e){Ef({type:e,sourceUpdater:this,action:Tf.abort(e),name:`abort`})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){Z.log.error(`removeSourceBuffer is not supported!`);return}Ef({type:`mediaSource`,sourceUpdater:this,action:Tf.removeSourceBuffer(e),name:`removeSourceBuffer`})}canRemoveSourceBuffer(){return!Z.browser.IS_FIREFOX&&C.default.MediaSource&&C.default.MediaSource.prototype&&typeof C.default.MediaSource.prototype.removeSourceBuffer==`function`}static canChangeType(){return C.default.SourceBuffer&&C.default.SourceBuffer.prototype&&typeof C.default.SourceBuffer.prototype.changeType==`function`}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){Z.log.error(`changeType is not supported!`);return}Ef({type:e,sourceUpdater:this,action:Tf.changeType(t),name:`changeType`})}addOrChangeSourceBuffers(e){if(!e||typeof e!=`object`||Object.keys(e).length===0)throw Error(`Cannot addOrChangeSourceBuffers to undefined codecs`);Object.keys(e).forEach(t=>{let n=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,n);this.canChangeType()&&this.changeType(t,n)})}appendBuffer(e,t){let{segmentInfo:n,type:r,bytes:i}=e;if(this.processedAppend_=!0,r===`audio`&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${i.length} until video append`);return}let a=t;if(Ef({type:r,sourceUpdater:this,action:Tf.appendBuffer(i,n||{mediaIndex:-1},a),doneFn:t,name:`appendBuffer`}),r===`video`){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;let e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach(e=>{this.appendBuffer.apply(this,e)})}}audioBuffered(){return wf(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Bc()}videoBuffered(){return wf(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Bc()}buffered(){let e=wf(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=wf(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():Jc(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=_f){Ef({type:`mediaSource`,sourceUpdater:this,action:Tf.duration(e),name:`duration`,doneFn:t})}endOfStream(e=null,t=_f){typeof e!=`string`&&(e=void 0),Ef({type:`mediaSource`,sourceUpdater:this,action:Tf.endOfStream(e),name:`endOfStream`,doneFn:t})}removeAudio(e,t,n=_f){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){n();return}Ef({type:`audio`,sourceUpdater:this,action:Tf.remove(e,t),doneFn:n,name:`remove`})}removeVideo(e,t,n=_f){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){n();return}Ef({type:`video`,sourceUpdater:this,action:Tf.remove(e,t),doneFn:n,name:`remove`})}updating(){return!!(bf(`audio`,this)||bf(`video`,this))}audioTimestampOffset(e){return e!==void 0&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Ef({type:`audio`,sourceUpdater:this,action:Tf.timestampOffset(e),name:`timestampOffset`}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return e!==void 0&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(Ef({type:`video`,sourceUpdater:this,action:Tf.timestampOffset(e),name:`timestampOffset`}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Ef({type:`audio`,sourceUpdater:this,action:Tf.callback(e),name:`callback`})}videoQueueCallback(e){this.videoBuffer&&Ef({type:`video`,sourceUpdater:this,action:Tf.callback(e),name:`callback`})}dispose(){this.trigger(`dispose`),yf.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Cf(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener(`sourceopen`,this.sourceopenListener_),this.off()}},kf=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),Af=e=>{let t=new Uint8Array(e);return Array.from(t).map(e=>e.toString(16).padStart(2,`0`)).join(``)},jf=new Uint8Array(`
199
206
 
200
- `.split("").map(s=>s.charCodeAt(0)));class cv extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class dv 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 Ye();const e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return Ye([[t,i]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=xn(e);let r=this.initSegments_[i];if(t&&!r&&e.bytes){const n=hc.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(hc,e.bytes.byteLength),this.initSegments_[i]=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){ir(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,i){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=i.mp4VttCues&&i.mp4VttCues.length;n&&(r.mp4VttCues=i.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 w.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));return}a.requested=!0;try{this.parseVTTCues_(r)}catch(l){this.stopForError({message:l.message,metadata:{errorType:B.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 w.VTTCue(l.startTime,l.endTime,l.text):l)}),W2(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){const i=e&&e.type==="vtt",r=t&&t.type==="text";i&&r&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const t=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(i=>{const r=i.start+t,n=i.end+t,a=new w.VTTCue(r,n,i.cueText);i.settings&&i.settings.split(" ").forEach(l=>{const c=l.split(":"),f=c[0],g=c[1];a[f]=isNaN(g)?g:Number(g)}),e.cues.push(a)})}parseVTTCues_(e){let t,i=!1;if(typeof w.WebVTT!="function")throw new cv;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof w.TextDecoder=="function"?t=new w.TextDecoder("utf8"):(t=w.WebVTT.StringDecoder(),i=!0);const r=new w.WebVTT.Parser(w,w.vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{B.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;i&&(a=dc(a)),r.parse(a)}let n=e.bytes;i&&(n=dc(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,i){const r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:n,LOCAL:a}=e.timestampmap,c=n/Mi.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(f=>{const g=f.endTime-f.startTime,y=this.handleRollover_(f.startTime+c,t.time);f.startTime=Math.max(y,0),f.endTime=Math.max(y+g,0)}),!i.syncInfo){const f=e.cues[0].startTime,g=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(f,g-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let i=e*Mi.ONE_SECOND_IN_TS;const r=t*Mi.ONE_SECOND_IN_TS;let n;for(r<i?n=-8589934592:n=8589934592;Math.abs(i-r)>4294967296;)i+=n;return i/Mi.ONE_SECOND_IN_TS}}const hv=function(s,e){const t=s.cues;for(let i=0;i<t.length;i++){const r=t[i];if(e>=r.adStartTime&&e<=r.adEndTime)return r}return null},fv=function(s,e,t=0){if(!s.segments)return;let i=t,r;for(let n=0;n<s.segments.length;n++){const a=s.segments[n];if(r||(r=hv(e,i+a.duration/2)),r){if("cueIn"in a){r.endTime=i,r.adEndTime=i,i+=a.duration,r=null;continue}if(i<r.endTime){i+=a.duration;continue}r.endTime+=a.duration}else if("cueOut"in a&&(r=new w.VTTCue(i,i+a.duration,a.cueOut),r.adStartTime=i,r.adEndTime=i+parseFloat(a.cueOut),e.addCue(r)),"cueOutCont"in a){const[l,c]=a.cueOutCont.split("/").map(parseFloat);r=new w.VTTCue(i,i+a.duration,""),r.adStartTime=i-l,r.adEndTime=r.adStartTime+c,e.addCue(r)}i+=a.duration}};class fc{constructor({start:e,end:t,segmentIndex:i,partIndex:r=null,appended:n=!1}){this.start_=e,this.end_=t,this.segmentIndex_=i,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 pv{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 zh{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:i,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(i,r),!!this.isReliable_)return this.updateStorage_(r,i,this.calculateBaseTime_(i,r,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const r of i)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,i){const r=new Map;let n=`
201
- `,a=i,l=t;this.start_=a,e.forEach((c,f)=>{const g=this.storage_.get(l),y=a,k=y+c.duration,E=!!(g&&g.segmentSyncInfo&&g.segmentSyncInfo.isAppended),L=new fc({start:y,end:k,appended:E,segmentIndex:f});c.syncInfo=L;let _=a;const I=(c.parts||[]).map((N,R)=>{const P=_,$=_+N.duration,U=!!(g&&g.partsSyncInfo&&g.partsSyncInfo[R]&&g.partsSyncInfo[R].isAppended),V=new fc({start:P,end:$,appended:U,segmentIndex:f,partIndex:R});return _=$,n+=`Media Sequence: ${l}.${R} | Range: ${P} --> ${$} | Appended: ${U}
202
- `,N.syncInfo=V,V});r.set(l,new pv(L,I)),n+=`${Uh(c.resolvedUri)} | Media Sequence: ${l} | Range: ${y} --> ${k} | Appended: ${E}
203
- `,l++,a=k}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t,i){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 c=t[l];a-=c.duration}return a}return i}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class pc extends zh{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,i){if(!this.storage_.size){const r=this.parent_.getSyncInfoForMediaSequence(e);return r?r.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,i)}}const mv=86400,Va=[{name:"VOD",run:(s,e,t,i,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(s,e,t,i,r,n)=>{const a=s.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:(s,e,t,i,r)=>{if(!Object.keys(s.timelineToDatetimeMappings).length)return null;let n=null,a=null;const l=so(e);r=r||0;for(let c=0;c<l.length;c++){const f=e.endList||r===0?c:l.length-(c+1),g=l[f],y=g.segment,k=s.timelineToDatetimeMappings[y.timeline];if(!k||!y.dateTimeObject)continue;let L=y.dateTimeObject.getTime()/1e3+k;if(y.parts&&typeof g.partIndex=="number")for(let I=0;I<g.partIndex;I++)L+=y.parts[I].duration;const _=Math.abs(r-L);if(a!==null&&(_===0||a<_))break;a=_,n={time:L,segmentIndex:g.segmentIndex,partIndex:g.partIndex}}return n}},{name:"Segment",run:(s,e,t,i,r)=>{let n=null,a=null;r=r||0;const l=so(e);for(let c=0;c<l.length;c++){const f=e.endList||r===0?c:l.length-(c+1),g=l[f],y=g.segment,k=g.part&&g.part.start||y&&y.start;if(y.timeline===i&&typeof k<"u"){const E=Math.abs(r-k);if(a!==null&&a<E)break;(!n||a===null||a>=E)&&(a=E,n={time:k,segmentIndex:g.segmentIndex,partIndex:g.partIndex})}}return n}},{name:"Discontinuity",run:(s,e,t,i,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 c=e.discontinuityStarts[l],f=e.discontinuitySequence+l+1,g=s.discontinuities[f];if(g){const y=Math.abs(r-g.time);if(a!==null&&a<y)break;(!n||a===null||a>=y)&&(a=y,n={time:g.time,segmentIndex:c,partIndex:null})}}}return n}},{name:"Playlist",run:(s,e,t,i,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class gv extends B.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new zh,i=new pc(t),r=new pc(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:r},this.logger_=It("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,r,n){if(t!==1/0)return Va.find(({name:c})=>c==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,i,r,n);if(!a.length)return null;for(const l of a){const{syncPoint:c,strategy:f}=l,{segmentIndex:g,time:y}=c;if(g<0)continue;const k=e.segments[g],E=y,L=E+k.duration;if(this.logger_(`Strategy: ${f}. Current time: ${r}. selected segment: ${g}. Time: [${E} -> ${L}]}`),r>=E&&r<L)return this.logger_("Found sync point with exact match: ",c),c}return this.selectSyncPoint_(a,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;const r=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+or({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,r,n){const a=[];for(let l=0;l<Va.length;l++){const c=Va[l],f=c.run(this,e,t,i,r,n);f&&(f.strategy=c.name,a.push({strategy:c.name,syncPoint:f}))}return a}selectSyncPoint_(e,t){let i=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,i=e[a].syncPoint,n=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${n}]: [time:${i.time}, segmentIndex:${i.segmentIndex}`+(typeof i.partIndex=="number"?`,partIndex:${i.partIndex}`:"")+"]"),i}saveExpiredSegmentInfo(e,t){const i=t.mediaSequence-e.mediaSequence;if(i>mv){B.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);return}for(let r=i-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],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;i&&(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,i){const r=e.segment,n=e.part;let a=this.timelines[e.timeline],l,c;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(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,c=t.end+a.mapping;else if(a)l=t.start+a.mapping,c=t.end+a.mapping;else return!1;return n&&(n.start=l,n.end=c),(!r.start||l<r.start)&&(r.start=l),r.end=c,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.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,c=Math.abs(l);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>c){let f;l<0?f=i.start-or({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):f=i.end+or({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:f,accuracy:c}}}}dispose(){this.trigger("dispose"),this.off()}}class vv extends B.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return typeof t=="number"&&typeof i=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if(typeof t=="number"&&typeof i=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const yv=kh(jh(function(){var s=(function(){function _(){this.listeners={}}var I=_.prototype;return I.on=function(R,P){this.listeners[R]||(this.listeners[R]=[]),this.listeners[R].push(P)},I.off=function(R,P){if(!this.listeners[R])return!1;var $=this.listeners[R].indexOf(P);return this.listeners[R]=this.listeners[R].slice(0),this.listeners[R].splice($,1),$>-1},I.trigger=function(R){var P=this.listeners[R];if(P)if(arguments.length===2)for(var $=P.length,U=0;U<$;++U)P[U].call(this,arguments[1]);else for(var V=Array.prototype.slice.call(arguments,1),O=P.length,G=0;G<O;++G)P[G].apply(this,V)},I.dispose=function(){this.listeners={}},I.pipe=function(R){this.on("data",function(P){R.push(P)})},_})();function e(_){return _.subarray(0,_.byteLength-_[_.byteLength-1])}const t=function(){const _=[[[],[],[],[],[]],[[],[],[],[],[]]],I=_[0],N=_[1],R=I[4],P=N[4];let $,U,V;const O=[],G=[];let b,C,F,z,H,Q;for($=0;$<256;$++)G[(O[$]=$<<1^($>>7)*283)^$]=$;for(U=V=0;!R[U];U^=b||1,V=G[V]||1)for(z=V^V<<1^V<<2^V<<3^V<<4,z=z>>8^z&255^99,R[U]=z,P[z]=U,F=O[C=O[b=O[U]]],Q=F*16843009^C*65537^b*257^U*16843008,H=O[z]*257^z*16843008,$=0;$<4;$++)I[$][U]=H=H<<24^H>>>8,N[$][z]=Q=Q<<24^Q>>>8;for($=0;$<5;$++)I[$]=I[$].slice(0),N[$]=N[$].slice(0);return _};let i=null;class r{constructor(I){i||(i=t()),this._tables=[[i[0][0].slice(),i[0][1].slice(),i[0][2].slice(),i[0][3].slice(),i[0][4].slice()],[i[1][0].slice(),i[1][1].slice(),i[1][2].slice(),i[1][3].slice(),i[1][4].slice()]];let N,R,P;const $=this._tables[0][4],U=this._tables[1],V=I.length;let O=1;if(V!==4&&V!==6&&V!==8)throw new Error("Invalid aes key size");const G=I.slice(0),b=[];for(this._key=[G,b],N=V;N<4*V+28;N++)P=G[N-1],(N%V===0||V===8&&N%V===4)&&(P=$[P>>>24]<<24^$[P>>16&255]<<16^$[P>>8&255]<<8^$[P&255],N%V===0&&(P=P<<8^P>>>24^O<<24,O=O<<1^(O>>7)*283)),G[N]=G[N-V]^P;for(R=0;N;R++,N--)P=G[R&3?N:N-4],N<=4||R<4?b[R]=P:b[R]=U[0][$[P>>>24]]^U[1][$[P>>16&255]]^U[2][$[P>>8&255]]^U[3][$[P&255]]}decrypt(I,N,R,P,$,U){const V=this._key[1];let O=I^V[0],G=P^V[1],b=R^V[2],C=N^V[3],F,z,H;const Q=V.length/4-2;let ie,re=4;const Y=this._tables[1],Z=Y[0],J=Y[1],te=Y[2],ee=Y[3],fe=Y[4];for(ie=0;ie<Q;ie++)F=Z[O>>>24]^J[G>>16&255]^te[b>>8&255]^ee[C&255]^V[re],z=Z[G>>>24]^J[b>>16&255]^te[C>>8&255]^ee[O&255]^V[re+1],H=Z[b>>>24]^J[C>>16&255]^te[O>>8&255]^ee[G&255]^V[re+2],C=Z[C>>>24]^J[O>>16&255]^te[G>>8&255]^ee[b&255]^V[re+3],re+=4,O=F,G=z,b=H;for(ie=0;ie<4;ie++)$[(3&-ie)+U]=fe[O>>>24]<<24^fe[G>>16&255]<<16^fe[b>>8&255]<<8^fe[C&255]^V[re++],F=O,O=G,G=b,b=C,C=F}}class n extends s{constructor(){super(s),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(I){this.jobs.push(I),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(_){return _<<24|(_&65280)<<8|(_&16711680)>>8|_>>>24},l=function(_,I,N){const R=new Int32Array(_.buffer,_.byteOffset,_.byteLength>>2),P=new r(Array.prototype.slice.call(I)),$=new Uint8Array(_.byteLength),U=new Int32Array($.buffer);let V,O,G,b,C,F,z,H,Q;for(V=N[0],O=N[1],G=N[2],b=N[3],Q=0;Q<R.length;Q+=4)C=a(R[Q]),F=a(R[Q+1]),z=a(R[Q+2]),H=a(R[Q+3]),P.decrypt(C,F,z,H,U,Q),U[Q]=a(U[Q]^V),U[Q+1]=a(U[Q+1]^O),U[Q+2]=a(U[Q+2]^G),U[Q+3]=a(U[Q+3]^b),V=C,O=F,G=z,b=H;return $};class c{constructor(I,N,R,P){const $=c.STEP,U=new Int32Array(I.buffer),V=new Uint8Array(I.byteLength);let O=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(U.subarray(O,O+$),N,R,V)),O=$;O<U.length;O+=$)R=new Uint32Array([a(U[O-4]),a(U[O-3]),a(U[O-2]),a(U[O-1])]),this.asyncStream_.push(this.decryptChunk_(U.subarray(O,O+$),N,R,V));this.asyncStream_.push(function(){P(null,e(V))})}static get STEP(){return 32e3}decryptChunk_(I,N,R,P){return function(){const $=l(I,N,R);P.set($,I.byteOffset)}}}var f=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},g;typeof window<"u"?g=window:typeof f<"u"?g=f:typeof self<"u"?g=self:g={};var y=g,k=function(I){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(I):I&&I.buffer instanceof ArrayBuffer},E=y.BigInt||Number;E("0x1"),E("0x100"),E("0x10000"),E("0x1000000"),E("0x100000000"),E("0x10000000000"),E("0x1000000000000"),E("0x100000000000000"),E("0x10000000000000000"),(function(){var _=new Uint16Array([65484]),I=new Uint8Array(_.buffer,_.byteOffset,_.byteLength);return I[0]===255?"big":I[0]===204?"little":"unknown"})();const L=function(_){const I={};return Object.keys(_).forEach(N=>{const R=_[N];k(R)?I[N]={bytes:R.buffer,byteOffset:R.byteOffset,byteLength:R.byteLength}:I[N]=R}),I};self.onmessage=function(_){const I=_.data,N=new Uint8Array(I.encrypted.bytes,I.encrypted.byteOffset,I.encrypted.byteLength),R=new Uint32Array(I.key.bytes,I.key.byteOffset,I.key.byteLength/4),P=new Uint32Array(I.iv.bytes,I.iv.byteOffset,I.iv.byteLength/4);new c(N,R,P,function($,U){self.postMessage(L({source:I.source,decrypted:U}),[U.buffer])})}}));var _v=Dh(yv);const bv=s=>{let e=s.default?"main":"alternative";return s.characteristics&&s.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},$h=(s,e)=>{s.abort(),s.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},mo=(s,e)=>{e.activePlaylistLoader=s,s.load()},Tv=(s,e)=>()=>{const{segmentLoaders:{[s]:t,main:i},mediaTypes:{[s]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),l=r.activePlaylistLoader,c=r.lastGroup_;if(!(a&&c&&a.id===c.id)&&(r.lastGroup_=a,r.lastTrack_=n,$h(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){l&&i.resetEverything();return}t.resyncLoader(),mo(a.playlistLoader,r)}},xv=(s,e)=>()=>{const{segmentLoaders:{[s]:t},mediaTypes:{[s]:i}}=e;i.lastGroup_=null,t.abort(),t.pause()},Sv=(s,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[s]:i,main:r},mediaTypes:{[s]:n}}=e,a=n.activeTrack(),l=n.getActiveGroup(),c=n.activePlaylistLoader,f=n.lastTrack_;if(!(f&&a&&f.id===a.id)&&(n.lastGroup_=l,n.lastTrack_=a,$h(i,n),!!l)){if(l.isMainPlaylist){if(!a||!f||a.id===f.id)return;const g=e.vhs.playlistController_,y=g.selectPlaylist();if(g.media()===y)return;n.logger_(`track change. Switching main audio from ${f.id} to ${a.id}`),t.pause(),r.resetEverything(),g.fastQualityChange_(y);return}if(s==="AUDIO"){if(!l.playlistLoader){r.setAudio(!0),r.resetEverything();return}i.setAudio(!0),r.setAudio(!1)}if(c===l.playlistLoader){mo(l.playlistLoader,n);return}i.track&&i.track(a),i.resetEverything(),mo(l.playlistLoader,n)}},Sn={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:t},excludePlaylist:i}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(c=>c.default)[0]||n[0]).id,l=t.tracks[a];if(r===l){i({error:{message:"Problem encountered loading the default audio track."}});return}B.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const c in t.tracks)t.tracks[c].enabled=t.tracks[c]===l;t.onTrackChanged()},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:t}}=e;B.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const i=t.activeTrack();i&&(i.mode="disabled"),t.onTrackChanged()}},mc={AUDIO:(s,e,t)=>{if(!e)return;const{tech:i,requestOptions:r,segmentLoaders:{[s]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!i.paused()||a.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),i.paused()||n.load()}),e.on("error",Sn[s](s,t))},SUBTITLES:(s,e,t)=>{const{tech:i,requestOptions:r,segmentLoaders:{[s]:n},mediaTypes:{[s]:a}}=t;e.on("loadedmetadata",()=>{const l=e.media();n.playlist(l,r),n.track(a.activeTrack()),(!i.paused()||l.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),i.paused()||n.load()}),e.on("error",Sn[s](s,t))}},Cv={AUDIO:(s,e)=>{const{vhs:t,sourceType:i,segmentLoaders:{[s]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[s]:{groups:l,tracks:c,logger_:f}},mainPlaylistLoader:g}=e,y=_r(g.main);(!a[s]||Object.keys(a[s]).length===0)&&(a[s]={main:{default:{default:!0}}},y&&(a[s].main.default.playlists=g.main.playlists));for(const k in a[s]){l[k]||(l[k]=[]);for(const E in a[s][k]){let L=a[s][k][E],_;if(y?(f(`AUDIO group '${k}' label '${E}' is a main playlist`),L.isMainPlaylist=!0,_=null):i==="vhs-json"&&L.playlists?_=new ts(L.playlists[0],t,n):L.resolvedUri?_=new ts(L.resolvedUri,t,n):L.playlists&&i==="dash"?_=new uo(L.playlists[0],t,n,g):_=null,L=Se({id:E,playlistLoader:_},L),mc[s](s,L.playlistLoader,e),l[k].push(L),typeof c[E]>"u"){const I=new B.AudioTrack({id:E,kind:bv(L),enabled:!1,language:L.language,default:L.default,label:E});c[E]=I}}}r.on("error",Sn[s](s,e))},SUBTITLES:(s,e)=>{const{tech:t,vhs:i,sourceType:r,segmentLoaders:{[s]:n},requestOptions:a,main:{mediaGroups:l},mediaTypes:{[s]:{groups:c,tracks:f}},mainPlaylistLoader:g}=e;for(const y in l[s]){c[y]||(c[y]=[]);for(const k in l[s][y]){if(!i.options_.useForcedSubtitles&&l[s][y][k].forced)continue;let E=l[s][y][k],L;if(r==="hls")L=new ts(E.resolvedUri,i,a);else if(r==="dash"){if(!E.playlists.filter(I=>I.excludeUntil!==1/0).length)return;L=new uo(E.playlists[0],i,a,g)}else r==="vhs-json"&&(L=new ts(E.playlists?E.playlists[0]:E.resolvedUri,i,a));if(E=Se({id:k,playlistLoader:L},E),mc[s](s,E.playlistLoader,e),c[y].push(E),typeof f[k]>"u"){const _=t.addRemoteTextTrack({id:k,kind:"subtitles",default:E.default&&E.autoselect,language:E.language,label:k},!1).track;f[k]=_}}}n.on("error",Sn[s](s,e))},"CLOSED-CAPTIONS":(s,e)=>{const{tech:t,main:{mediaGroups:i},mediaTypes:{[s]:{groups:r,tracks:n}}}=e;for(const a in i[s]){r[a]||(r[a]=[]);for(const l in i[s][a]){const c=i[s][a][l];if(!/^(?:CC|SERVICE)/.test(c.instreamId))continue;const f=t.options_.vhs&&t.options_.vhs.captionServices||{};let g={label:l,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(f[g.instreamId]&&(g=Se(g,f[g.instreamId])),g.default===void 0&&delete g.default,r[a].push(Se({id:l},c)),typeof n[l]>"u"){const y=t.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;n[l]=y}}}}},Gh=(s,e)=>{for(let t=0;t<s.length;t++)if(Qo(e,s[t])||s[t].playlists&&Gh(s[t].playlists,e))return!0;return!1},Ev=(s,e)=>t=>{const{mainPlaylistLoader:i,mediaTypes:{[s]:{groups:r}}}=e,n=i.media();if(!n)return null;let a=null;n.attributes[s]&&(a=r[n.attributes[s]]);const l=Object.keys(r);if(!a)if(s==="AUDIO"&&l.length>1&&_r(e.main))for(let c=0;c<l.length;c++){const f=r[l[c]];if(Gh(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(c=>c.id===t.id)[0]||null},Av={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].enabled)return t[i];return null},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].mode==="showing"||t[i].mode==="hidden")return t[i];return null}},wv=(s,{mediaTypes:e})=>()=>{const t=e[s].activeTrack();return t?e[s].activeGroup(t):null},Dv=s=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(f=>{Cv[f](f,s)});const{mediaTypes:e,mainPlaylistLoader:t,tech:i,vhs:r,segmentLoaders:{["AUDIO"]:n,main:a}}=s;["AUDIO","SUBTITLES"].forEach(f=>{e[f].activeGroup=Ev(f,s),e[f].activeTrack=Av[f](f,s),e[f].onGroupChanged=Tv(f,s),e[f].onGroupChanging=xv(f,s),e[f].onTrackChanged=Sv(f,s),e[f].getActiveGroup=wv(f,s)});const l=e.AUDIO.activeGroup();if(l){const f=(l.filter(y=>y.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 c=()=>{e.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"})};i.audioTracks().addEventListener("change",c),i.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{i.audioTracks().removeEventListener("change",c),i.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(const f in e.AUDIO.tracks)i.audioTracks().addTrack(e.AUDIO.tracks[f])},kv=()=>{const s={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{s[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:ri,activeTrack:ri,getActiveGroup:ri,onGroupChanged:ri,onTrackChanged:ri,lastTrack_:null,logger_:It(`MediaGroups[${e}]`)}}),s};class gc{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_=ht(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 jv extends B.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new gc,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_=It("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i){this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),this.trigger("error");return}if(i.startsWith("data:")){this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1));return}this.steeringManifest.reloadUri=ht(e,i),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 i=e?t:this.getRequestURI(t);if(!i){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const r={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:i,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 ${i} this session.`),this.excludedSteeringManifestURLs.add(i);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 g={errorType:B.Error.StreamingContentSteeringParserError,error:f};this.trigger({type:"error",metadata:g})}this.assignSteeringProperties_(l);const c={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:c}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new w.URL(e),i=new w.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(w.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new w.URL(e),i=this.getPathway(),r=this.getBandwidth_();if(i){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,i)}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 i=(r=>{for(const n of r)if(this.availablePathways_.has(n))return n;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==i&&(this.currentPathway=i,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 i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=w.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){w.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 gc}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&&(ht(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const Iv=(s,e)=>{let t=null;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{s.apply(null,i)},e)}},Pv=10;let ii;const Lv=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Ov=function(s){return this.audioSegmentLoader_[s]+this.mainSegmentLoader_[s]},Mv=function({currentPlaylist:s,buffered:e,currentTime:t,nextPlaylist:i,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:l,log:c}){if(!i)return B.log.warn("We received no playlist to switch to. Please check your stream."),!1;const f=`allowing switch ${s&&s.id||"null"} -> ${i.id}`;if(!s)return c(`${f} as current playlist is not set`),!0;if(i.id===s.id)return!1;const g=!!es(e,t).length;if(!s.endList)return!g&&typeof s.partTargetDuration=="number"?(c(`not ${f} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(c(`${f} as current playlist is live`),!0);const y=Xo(e,t),k=l?We.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:We.MAX_BUFFER_LOW_WATER_LINE;if(a<k)return c(`${f} as duration < max low water line (${a} < ${k})`),!0;const E=i.attributes.BANDWIDTH,L=s.attributes.BANDWIDTH;if(E<L&&(!l||y<n)){let _=`${f} as next bandwidth < current bandwidth (${E} < ${L})`;return l&&(_+=` and forwardBuffer < bufferHighWaterLine (${y} < ${n})`),c(_),!0}if((!l||E>L)&&y>=r){let _=`${f} as forwardBuffer >= bufferLowWaterLine (${y} >= ${r})`;return l&&(_+=` and next bandwidth > current bandwidth (${E} > ${L})`),c(_),!0}return c(`not ${f} as no switching criteria met`),!1};class Rv extends B.EventTarget{constructor(e){super(),this.fastQualityChange_=Iv(this.fastQualityChange_.bind(this),100);const{src:t,withCredentials:i,tech:r,bandwidth:n,externVhs:a,useCueTags:l,playlistExclusionDuration:c,enableLowInitialPlaylist:f,sourceType:g,cacheEncryptionKeys:y,bufferBasedABR:k,leastPixelDiffSelector:E,captionServices:L,experimentalUseMMS:_}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:I}=e;(I===null||typeof I>"u")&&(I=1/0),ii=a,this.bufferBasedABR=!!k,this.leastPixelDiffSelector=!!E,this.withCredentials=i,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=g,this.useCueTags_=l,this.playlistExclusionDuration=c,this.maxPlaylistRetries=I,this.enableLowInitialPlaylist=f,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:I,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=kv(),_&&w.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new w.ManagedMediaSource,this.usingManagedMediaSource_=!0,B.log("Using ManagedMediaSource")):w.MediaSource&&(this.mediaSource=new w.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_=Ye(),this.hasPlayed_=!1,this.syncController_=new gv(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new _v,this.sourceUpdater_=new Hh(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new vv,this.keyStatusMap_=new Map;const N={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:L,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:y,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new uo(t,this.vhs_,Se(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new ts(t,this.vhs_,Se(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new fo(Se(N,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new fo(Se(N,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new dv(Se(N,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise(($,U)=>{function V(){r.off("vttjserror",O),$()}function O(){r.off("vttjsloaded",V),U()}r.one("vttjsloaded",V),r.one("vttjserror",O),r.addWebVttScript_()})}),e);const R=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new jv(this.vhs_.xhr,R),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),Lv.forEach($=>{this[$+"_"]=Ov.bind(this,$)}),this.logger_=It("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 P=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(P,()=>{const $=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-$,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,i){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,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(i&&r){const a=(i.length?i[0].playlists:i.playlists).filter(l=>l.attributes.serviceLocation===r);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=w.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(w.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 i=e.mediaGroups.AUDIO,r=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const l=i.main||r.length&&i[r[0]];for(const c in l)if(l[c].default){n={label:c};break}}if(!n)return t;const a=[];for(const l in i)if(i[l][n.label]){const c=i[l][n.label];if(c.playlists&&c.playlists.length)a.push.apply(a,c.playlists);else if(c.uri)a.push(c);else if(e.playlists.length)for(let f=0;f<e.playlists.length;f++){const g=e.playlists[f];g.attributes&&g.attributes.AUDIO&&g.attributes.AUDIO===l&&a.push(g)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const t=this.mainPlaylistLoader_.media(),i=t.targetDuration*1.5*1e3;ro(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=i,t.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),Dv({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 i;if(this.enableLowInitialPlaylist&&(i=this.selectInitialPlaylist()),i||(i=this.selectPlaylist()),!i||!this.shouldSwitchToMedia_(i)||(this.initialMedia_=i,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(),i=t.targetDuration*1.5*1e3;ro(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=i,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,i=>{this.player_.trigger(Ue({},i))})})}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 i=e.mediaGroups||{};let r=!0;const n=Object.keys(i.AUDIO);for(const a in i.AUDIO)for(const l in i.AUDIO[a])i.AUDIO[a][l].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),ii.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(i.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_,i=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return Mv({buffered:a,currentTime:i,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 i=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:i.playlist,error:i})}),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 i=this.audioSegmentLoader_.pendingSegment_;if(!i||!i.segment||!i.segment.syncInfo)return;const r=i.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",i=>{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:Pv}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const i=this.getCodecsOrExclude_();i&&this.sourceUpdater_.addOrChangeSourceBuffers(i)};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(i=>{this.mainSegmentLoader_.on(i,r=>{this.player_.trigger(Ue({},r))}),this.audioSegmentLoader_.on(i,r=>{this.player_.trigger(Ue({},r))}),this.subtitleSegmentLoader_.on(i,r=>{this.player_.trigger(Ue({},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 i=t.end(0);let r=i;if(e.start){const n=e.start.timeOffset;if(n<0){const a=this.mainPlaylistLoader_.main,l=ii.Playlist.liveEdgeDelay(a,e),c=i+l;r=Math.max(Math.min(c+n,i),t.start(0))}else r=Math.min(i,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 i=this.syncController_.getExpiredTime(e,this.duration());if(i===null)return!1;const r=ii.Playlist.playlistEnd(e,i),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-n<=Wt;const l=a.end(a.length-1);return l-n<=Wt&&r-l<=Wt}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||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(Gn),a=n.length===1&&n[0]===e;if(r.length===1&&i!==1/0)return B.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 L=this.pathwayAttribute_(e),_=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(L),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(L)},_);return}let E=!1;r.forEach(L=>{if(L===e)return;const _=L.excludeUntil;typeof _<"u"&&_!==1/0&&(E=!0,delete L.excludeUntil)}),E&&(B.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()+i*1e3,e.excludeUntil=l,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const c=this.selectPlaylist();if(!c){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const f=t.internal?this.logger_:B.log.warn,g=t.message?" "+t.message:"";f(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${g} Switching to playlist ${c.id}.`),c.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),c.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const y=c.targetDuration/2*1e3||5*1e3,k=typeof c.lastRequest=="number"&&Date.now()-c.lastRequest<=y;return this.switchMedia_(c,"exclude",a||k)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],r=e==="all";(r||e==="main")&&i.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&&i.push(l)}),["main","audio","subtitle"].forEach(a=>{const l=this[`${a}SegmentLoader_`];l&&(e===a||e==="all")&&i.push(l)}),i.forEach(a=>t.forEach(l=>{typeof a[l]=="function"&&a[l]()}))}setCurrentTime(e){const t=es(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:ii.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){const i=e.media();if(!i)return null;const r=this.syncController_.getMediaSequenceSync(t);if(r&&r.isReliable){const l=r.start,c=r.end;if(!isFinite(l)||!isFinite(c))return null;const f=ii.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i),g=Math.max(l,c-f);return Ye([[l,g]])}const n=this.syncController_.getExpiredTime(i,this.duration());if(n===null)return null;const a=ii.Playlist.seekable(i,n,ii.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i));return a.length?a:null}computeFinalSeekable_(e,t){if(!t)return e;const i=e.start(0),r=e.end(0),n=t.start(0),a=t.end(0);return n>r||i>a?e:Ye([[Math.max(i,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 i=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||i&&i.length&&this.seekable_.length&&i.start(0)===this.seekable_.start(0)&&i.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${ih(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 i=ii.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}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 i in t)t[i].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_(),i=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=lr(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=i.video||e.main.videoCodec||Cm),e.main.isMuxed&&(r.video+=`,${i.audio||e.main.audioCodec||nu}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||nu,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,g)=>f?sr(g,this.usingManagedMediaSource_):Ta(g),l={};let c;if(["video","audio"].forEach(function(f){if(r.hasOwnProperty(f)&&!a(e[f].isFmp4,r[f])){const g=e[f].isFmp4?"browser":"muxer";l[g]=l[g]||[],l[g].push(r[f]),f==="audio"&&(c=g)}}),n&&c&&t.attributes.AUDIO){const f=t.attributes.AUDIO;this.main().playlists.forEach(g=>{(g.attributes&&g.attributes.AUDIO)===f&&g!==t&&(g.excludeUntil=1/0)}),this.logger_(`excluding audio group ${f} as ${c} does not support codec(s): "${r.audio}"`)}if(Object.keys(l).length){const f=Object.keys(l).reduce((g,y)=>(g&&(g+=", "),g+=`${y} does not support codec(s): "${l[y].join(",")}"`,g),"")+".";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(g=>{const y=(Ht(this.sourceUpdater_.codecs[g]||"")[0]||{}).type,k=(Ht(r[g]||"")[0]||{}).type;y&&k&&y.toLowerCase()!==k.toLowerCase()&&f.push(`"${this.sourceUpdater_.codecs[g]}" -> "${r[g]}"`)}),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(i=>{const r=e[i];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=lr(this.main,r),a=[];n.audio&&!Ta(n.audio)&&!sr(n.audio,this.usingManagedMediaSource_)&&a.push(`audio codec ${n.audio}`),n.video&&!Ta(n.video)&&!sr(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=[],i=this.main().playlists,r=fr(Ht(e)),n=Ju(r),a=r.video&&Ht(r.video)[0]||null,l=r.audio&&Ht(r.audio)[0]||null;Object.keys(i).forEach(c=>{const f=i[c];if(t.indexOf(f.id)!==-1||f.excludeUntil===1/0)return;t.push(f.id);const g=[],y=lr(this.mainPlaylistLoader_.main,f),k=Ju(y);if(!(!y.audio&&!y.video)){if(k!==n&&g.push(`codec count "${k}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const E=y.video&&Ht(y.video)[0]||null,L=y.audio&&Ht(y.audio)[0]||null;E&&a&&E.type.toLowerCase()!==a.type.toLowerCase()&&g.push(`video codec "${E.type}" !== "${a.type}"`),L&&l&&L.type.toLowerCase()!==l.type.toLowerCase()&&g.push(`audio codec "${L.type}" !== "${l.type}"`)}g.length&&(f.excludeUntil=1/0,this.logger_(`excluding ${f.id}: ${g.join(" && ")}`))}})}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),fv(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=We.GOAL_BUFFER_LENGTH,i=We.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,We.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=We.BUFFER_LOW_WATER_LINE,i=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*i,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return We.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){ac(this.inbandTextTracks_,"com.apple.streaming",this.tech_),G2({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();ac(this.inbandTextTracks_,e,this.tech_),H2({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:i})}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,i=>{this.trigger(Ue({},i))})}),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 c=l.attributes.serviceLocation;if(c&&(a.push(c),!n.has(c)))return!0}return!!(!a.length&&n.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const i=this.main().playlists,r=new Set;let n=!1;Object.keys(i).forEach(a=>{const l=i[a],c=this.pathwayAttribute_(l),f=c&&e!==c;l.excludeUntil===1/0&&l.lastExcludeReason_==="content-steering"&&!f&&(delete l.excludeUntil,delete l.lastExcludeReason_,n=!0);const y=!l.excludeUntil&&l.excludeUntil!==1/0;!r.has(l.id)&&f&&y&&(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 c=l.activePlaylistLoader.media_;c&&c.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,i=this.contentSteeringController_.currentPathwayClones,r=this.contentSteeringController_.nextPathwayClones;if(i&&i.size||r&&r.size){for(const[a,l]of i.entries())r.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(l),this.contentSteeringController_.excludePathway(a));for(const[a,l]of r.entries()){const c=i.get(a);if(!c){t.filter(g=>g.attributes["PATHWAY-ID"]===l["BASE-ID"]).forEach(g=>{this.mainPlaylistLoader_.addClonePathway(l,g)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(c,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 i=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in i)if(i[n]!==r[n])return!1;for(const n in r)if(i[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(i=>{const r=this.mainPlaylistLoader_.getKeyIdSet(i);!r||!r.size||r.forEach(n=>{const a="usable",l=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,c=i.lastExcludeReason_===t&&i.excludeUntil===1/0;l?l&&c&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${n} is ${a}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.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(i=>{const r=i&&i.attributes&&i.attributes.RESOLUTION&&i.attributes.RESOLUTION.height<720,n=i.excludeUntil===1/0&&i.lastExcludeReason_===t;r&&n&&(delete i.excludeUntil,B.log.warn(`enabling non-HD playlist ${i.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=(typeof e=="string"?e:uv(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 Nv=(s,e,t)=>i=>{const r=s.main.playlists[e],n=Ko(r),a=Gn(r);if(typeof i>"u")return a;i?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 i!==a&&!n&&(i?(t(r),s.trigger({type:"renditionenabled",metadata:l})):s.trigger({type:"renditiondisabled",metadata:l})),i};class Bv{constructor(e,t,i){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=lr(r.main(),t),this.playlist=t,this.id=i,this.enabled=Nv(e.playlists,t.id,n)}}const Fv=function(s){s.representations=()=>{const e=s.playlistController_.main(),t=_r(e)?s.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(i=>!Ko(i)).map((i,r)=>new Bv(s,i,i.id)):[]}},vc=["seeking","seeked","pause","playing","error"];class Uv extends B.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_=It("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,l=["main","subtitle","audio"],c={};l.forEach(g=>{c[g]={reset:()=>this.resetSegmentDownloads_(g),updateend:()=>this.checkSegmentDownloads_(g)},a[`${g}SegmentLoader_`].on("appendsdone",c[g].updateend),a[`${g}SegmentLoader_`].on("playlistupdate",c[g].reset),this.tech_.on(["seeked","seeking"],c[g].reset)});const f=g=>{["main","audio"].forEach(y=>{a[`${y}SegmentLoader_`][g]("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(vc,n),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(vc,n),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),l.forEach(g=>{a[`${g}SegmentLoader_`].off("appendsdone",c[g].updateend),a[`${g}SegmentLoader_`].off("playlistupdate",c[g].reset),this.tech_.off(["seeked","seeking"],c[g].reset)}),this.checkCurrentTimeTimeout_&&w.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&w.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=w.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_,i=t[`${e}SegmentLoader_`],r=i.buffered_(),n=E1(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:i.playlist_&&i.playlist_.id,buffered:Ri(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+Wt>=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(Ye([this.lastRecordedTime,e]));const i={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:i}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),i=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(r&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,i)){const L=t.start(0);n=L+(L===t.end(0)?0:Wt)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${i} with seekable range ${ih(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,l=this.tech_.buffered(),c=a.audioBuffer?a.audioBuffered():null,f=a.videoBuffer?a.videoBuffered():null,g=this.media(),y=g.partTargetDuration?g.partTargetDuration:(g.targetDuration-Gt)*2,k=[c,f];for(let L=0;L<k.length;L++){if(!k[L])continue;if(Xo(k[L],i)<y)return!1}const E=Jr(l,i);return E.length===0?!1:(n=E.start(0)+Wt,this.logger_(`Buffered region starts (${E.start(0)}) just beyond seek point (${i}). Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),i=es(t,e);if(i.length&&e+3<=i.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${i.start(0)} -> ${i.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 i=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=Jr(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,i,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+Wt;const a=!i.endList,l=typeof i.partTargetDuration=="number";return a&&(l||r)&&(n=e.end(e.length-1)+i.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:i}){if(!e)return;let r;if(e.length&&t.length){const n=es(e,i-3),a=es(e,i),l=es(t,i);l.length&&!a.length&&n.length&&(r={start:n.end(0),end:l.end(0)})}else Jr(e,i).length||(r=this.gapFromVideoUnderflow_(e,i));return r?(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${i}`),!0):!1}skipTheGap_(e){const t=this.tech_.buffered(),i=this.tech_.currentTime(),r=Jr(t,i);if(this.resetTimeUpdate_(),r.length===0||i!==e)return;this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+Gt);const n={gapInfo:{from:i,to:r.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const i=x1(e);for(let r=0;r<i.length;r++){const n=i.start(r),a=i.end(r);if(t-n<4&&t-n>2)return{start:n,end:a}}return null}}const Vv={errorInterval:30,getSource(s){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return s(t)}},Wh=function(s,e){let t=0,i=0;const r=Se(Vv,e);s.ready(()=>{s.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){i&&s.currentTime(i)},a=function(g){g!=null&&(i=s.duration()!==1/0&&s.currentTime()||0,s.one("loadedmetadata",n),s.src(g),s.trigger({type:"usage",name:"vhs-error-reload"}),s.play())},l=function(){if(Date.now()-t<r.errorInterval*1e3){s.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!r.getSource||typeof r.getSource!="function"){B.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return t=Date.now(),r.getSource.call(s,a)},c=function(){s.off("loadedmetadata",n),s.off("error",l),s.off("dispose",c)},f=function(g){c(),Wh(s,g)};s.on("error",l),s.on("dispose",c),s.reloadSourceOnError=f},qv=function(s){Wh(this,s)};var Xh="3.17.3",Hv="7.1.0",zv="1.3.1",$v="7.2.0",Gv="4.0.2";const Me={PlaylistLoader:ts,Playlist:ft,utils:Q1,STANDARD_PLAYLIST_SELECTOR:nc,INITIAL_PLAYLIST_SELECTOR:B2,lastBandwidthSelector:nc,movingAverageBandwidthSelector:R2,comparePlaylistBandwidth:Zo,comparePlaylistResolution:M2,xhr:Th()};Object.keys(We).forEach(s=>{Object.defineProperty(Me,s,{get(){return B.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),We[s]},set(e){if(B.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){B.log.warn(`value of Vhs.${s} must be greater than or equal to 0`);return}We[s]=e}})});const Yh="videojs-vhs",Kh=function(s,e){const t=e.media();let i=-1;for(let r=0;r<s.length;r++)if(s[r].id===t.id){i=r;break}s.selectedIndex_=i,s.trigger({selectedIndex:i,type:"change"})},Wv=function(s,e){e.representations().forEach(t=>{s.addQualityLevel(t)}),Kh(s,e.playlists)};Me.canPlaySource=function(){return B.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const Xv=(s,e,t)=>{if(!s)return s;let i={};e&&e.attributes&&e.attributes.CODECS&&(i=fr(Ht(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(i.audio=t.attributes.CODECS);const r=ds(i.video),n=ds(i.audio),a={};for(const l in s)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 s[l]=="string"&&(a[l].url=s[l]);return Se(s,a)},Yv=(s,e)=>s.reduce((t,i)=>{if(!i.contentProtection)return t;const r=e.reduce((n,a)=>{const l=i.contentProtection[a];return l&&l.pssh&&(n[a]={pssh:l.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),Kv=({player:s,sourceKeySystems:e,audioMedia:t,mainPlaylists:i})=>{if(!s.eme.initializeMediaKeys)return Promise.resolve();const r=t?i.concat([t]):i,n=Yv(r,Object.keys(e)),a=[],l=[];return n.forEach(c=>{l.push(new Promise((f,g)=>{s.tech_.one("keysessioncreated",f)})),a.push(new Promise((f,g)=>{s.eme.initializeMediaKeys({keySystems:c},y=>{if(y){g(y);return}f()})}))}),Promise.race([Promise.all(a),Promise.race(l)])},Qv=({player:s,sourceKeySystems:e,media:t,audioMedia:i})=>{const r=Xv(e,t,i);return r?(s.currentSource().keySystems=r,r&&!s.eme?(B.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},Qh=()=>{if(!w.localStorage)return null;const s=w.localStorage.getItem(Yh);if(!s)return null;try{return JSON.parse(s)}catch{return null}},Jv=s=>{if(!w.localStorage)return!1;let e=Qh();e=e?Se(e,s):s;try{w.localStorage.setItem(Yh,JSON.stringify(e))}catch{return!1}return e},Zv=s=>s.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(s.substring(s.indexOf(",")+1)):s,Jh=(s,e)=>{s._requestCallbackSet||(s._requestCallbackSet=new Set),s._requestCallbackSet.add(e)},Zh=(s,e)=>{s._responseCallbackSet||(s._responseCallbackSet=new Set),s._responseCallbackSet.add(e)},ef=(s,e)=>{s._requestCallbackSet&&(s._requestCallbackSet.delete(e),s._requestCallbackSet.size||delete s._requestCallbackSet)},tf=(s,e)=>{s._responseCallbackSet&&(s._responseCallbackSet.delete(e),s._responseCallbackSet.size||delete s._responseCallbackSet)};Me.supportsNativeHls=(function(){if(!se||!se.createElement)return!1;const s=se.createElement("video");return B.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(s.canPlayType(t))}):!1})();Me.supportsNativeDash=(function(){return!se||!se.createElement||!B.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(se.createElement("video").canPlayType("application/dash+xml"))})();Me.supportsTypeNatively=s=>s==="hls"?Me.supportsNativeHls:s==="dash"?Me.supportsNativeDash:!1;Me.isSupported=function(){return B.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};Me.xhr.onRequest=function(s){Jh(Me.xhr,s)};Me.xhr.onResponse=function(s){Zh(Me.xhr,s)};Me.xhr.offRequest=function(s){ef(Me.xhr,s)};Me.xhr.offResponse=function(s){tf(Me.xhr,s)};const ey=B.getComponent("Component");class sf extends ey{constructor(e,t,i){if(super(t,i.vhs),typeof i.initialBandwidth=="number"&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=It("VhsHandler"),t.options_&&t.options_.playerId){const r=B.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(se,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=se.fullscreenElement||se.webkitFullscreenElement||se.mozFullScreenElement||se.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_=Se(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 i=Qh();i&&i.bandwidth&&(this.options_.bandwidth=i.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),i&&i.throughput&&(this.options_.throughput=i.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(i=>{typeof this.source_[i]<"u"&&(this.options_[i]=this.source_[i])}),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=Zv(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Me,this.options_.sourceType=Sc(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new Rv(this.options_);const i=Se({liveRangeSafeTimeDelta:Wt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Uv(i),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=B.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?Me.movingAverageBandwidthSelector(.55):Me.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=Me.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=w.navigator.connection||w.navigator.mozConnection||w.navigator.webkitConnection,l=1e7;if(this.options_.useNetworkInformationApi&&a){const c=a.downlink*1e3*1e3;c>=l&&n>=l?n=Math.max(n,c):n=c}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(){B.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:()=>Ri(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:()=>Ri(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&&Jv({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{Fv(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_=w.URL.createObjectURL(this.playlistController_.mediaSource),(B.browser.IS_ANY_SAFARI||B.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"),Kv({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=Qv({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",i=>{this.playlistController_.updatePlaylistByKeyStatus(i.keyId,i.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=B.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{Wv(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{Kh(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Xh,"mux.js":Hv,"mpd-parser":zv,"m3u8-parser":$v,"aes-decrypter":Gv}}version(){return this.constructor.version()}canChangeType(){return Hh.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_&&w.URL.revokeObjectURL&&(w.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return r2({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,r=2){return Ah({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{Jh(this.xhr,e)},this.xhr.onResponse=e=>{Zh(this.xhr,e)},this.xhr.offRequest=e=>{ef(this.xhr,e)},this.xhr.offResponse=e=>{tf(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(i=>{this.playlistController_.on(i,r=>{this.player_.trigger(Ue({},r))})}),t.forEach(i=>{this.playbackWatcher_.on(i,r=>{this.player_.trigger(Ue({},r))})})}}const Cn={name:"videojs-http-streaming",VERSION:Xh,canHandleSource(s,e={}){const t=Se(B.options,e);return!t.vhs.experimentalUseMMS&&!sr("avc1.4d400d,mp4a.40.2",!1)?!1:Cn.canPlayType(s.type,t)},handleSource(s,e,t={}){const i=Se(B.options,t);return e.vhs=new sf(s,e,i),e.vhs.xhr=Th(),e.vhs.setupXhrHooks_(),e.vhs.src(s.src,s.type),e.vhs},canPlayType(s,e){const t=Sc(s);if(!t)return"";const i=Cn.getOverrideNative(e);return!Me.supportsTypeNatively(t)||i?"maybe":""},getOverrideNative(s={}){const{vhs:e={}}=s,t=!(B.browser.IS_ANY_SAFARI||B.browser.IS_IOS),{overrideNative:i=t}=e;return i}},ty=()=>sr("avc1.4d400d,mp4a.40.2",!0);ty()&&B.getTech("Html5").registerSourceHandler(Cn,0);B.VhsHandler=sf;B.VhsSourceHandler=Cn;B.Vhs=Me;B.use||B.registerComponent("Vhs",Me);B.options.vhs=B.options.vhs||{};(!B.getPlugin||!B.getPlugin("reloadSourceOnError"))&&B.registerPlugin("reloadSourceOnError",qv);var iy=Object.defineProperty,ws=(s,e,t,i)=>{for(var r=void 0,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=a(e,t,r)||r);return r&&iy(e,t,r),r};const sy="0.5, 1, 1.5, 2";function ry(s){const e=s.getChild("ControlBar"),t=e.getChild("CurrentTimeDisplay"),i=e.getChild("ProgressControl"),r=e.getChild("DurationDisplay"),n=e.getChild("TimeDivider");e.removeChild(i),e.removeChild(t),e.removeChild(n),e.removeChild(r),e.addChild(t,{},0),e.addChild(i,{},1),e.addChild(r,{},2)}class zi extends Xp.Localized(Ve.VividElement){constructor(){super(...arguments),this.autoplay=!1,this.loop=!1,this.playbackRates=sy,this.skipBy=Gp.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:Wp.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=B(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),ry(this._player),this.#c()):this.#n(!1)}}ws([Ve.attr],zi.prototype,"poster");ws([Ve.attr],zi.prototype,"src");ws([Ve.attr({mode:"boolean"})],zi.prototype,"autoplay");ws([Ve.attr({mode:"boolean"})],zi.prototype,"loop");ws([Ve.attr({attribute:"playback-rates",mode:"fromView"})],zi.prototype,"playbackRates");ws([Ve.attr({attribute:"skip-by",mode:"fromView"})],zi.prototype,"skipBy");function ny(){return Ve.html`
207
+ `.split(``).map(e=>e.charCodeAt(0))),Mf=class extends Error{constructor(){super(`Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.`)}},Nf=class extends gf{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 Bc();let e=this.subtitlesTrack_.cues,t=e[0].startTime,n=e[e.length-1].startTime;return Bc([[t,n]])}initSegmentForMap(e,t=!1){if(!e)return null;let n=pu(e),r=this.initSegments_[n];if(t&&!r&&e.bytes){let t=jf.byteLength+e.bytes.byteLength,i=new Uint8Array(t);i.set(e.bytes),i.set(jf,e.bytes.byteLength),this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:i}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state=`READY`,this.resetEverything(),this.monitorBuffer_()}track(e){return e===void 0?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state===`INIT`&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){Gd(e,t,this.subtitlesTrack_)}fillBuffer_(){let e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){this.syncController_.one(`timestampoffset`,()=>{this.state=`READY`,this.paused()||this.monitorBuffer_()}),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,n){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===id.TIMEOUT&&this.handleTimeout_(),e.code===id.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}let r=this.pendingSegment_,i=n.mp4VttCues&&n.mp4VttCues.length;i&&(r.mp4VttCues=n.mp4VttCues),this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state=`APPENDING`,this.trigger(`appending`);let a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof C.default.WebVTT!=`function`&&typeof this.loadVttJs==`function`){this.state=`WAITING_ON_VTTJS`,this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,n),()=>this.stopForError({message:`Error loading vtt.js`}));return}a.requested=!0;try{this.parseVTTCues_(r)}catch(e){this.stopForError({message:e.message,metadata:{errorType:Z.Error.StreamingVttParserError,error:e}});return}if(i||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(e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new C.default.VTTCue(e.startTime,e.endTime,e.text):e)}),Kd(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){let n=e&&e.type===`vtt`,r=t&&t.type===`text`;n&&r&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){let t=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(n=>{let r=n.start+t,i=n.end+t,a=new C.default.VTTCue(r,i,n.cueText);n.settings&&n.settings.split(` `).forEach(e=>{let t=e.split(`:`),n=t[0],r=t[1];a[n]=isNaN(r)?r:Number(r)}),e.cues.push(a)})}parseVTTCues_(e){let t,n=!1;if(typeof C.default.WebVTT!=`function`)throw new Mf;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof C.default.TextDecoder==`function`?t=new C.default.TextDecoder(`utf8`):(t=C.default.WebVTT.StringDecoder(),n=!0);let r=new C.default.WebVTT.Parser(C.default,C.default.vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=t=>{e.timestampmap=t},r.onparsingerror=e=>{Z.log.warn(`Error encountered when parsing cues: `+e.message)},e.segment.map){let t=e.segment.map.bytes;n&&(t=kf(t)),r.parse(t)}let i=e.bytes;n&&(i=kf(i)),r.parse(i),r.flush()}updateTimeMapping_(e,t,n){let r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}let{MPEGTS:i,LOCAL:a}=e.timestampmap,o=i/Fn.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(e=>{let n=e.endTime-e.startTime,r=this.handleRollover_(e.startTime+o,t.time);e.startTime=Math.max(r,0),e.endTime=Math.max(r+n,0)}),!n.syncInfo){let t=e.cues[0].startTime,i=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(t,i-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let n=e*Fn.ONE_SECOND_IN_TS,r=t*Fn.ONE_SECOND_IN_TS,i;for(i=r<n?-8589934592:8589934592;Math.abs(n-r)>4294967296;)n+=i;return n/Fn.ONE_SECOND_IN_TS}},Pf=function(e,t){let n=e.cues;for(let e=0;e<n.length;e++){let r=n[e];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null},Ff=function(e,t,n=0){if(!e.segments)return;let r=n,i;for(let n=0;n<e.segments.length;n++){let a=e.segments[n];if(i||=Pf(t,r+a.duration/2),i){if(`cueIn`in a){i.endTime=r,i.adEndTime=r,r+=a.duration,i=null;continue}if(r<i.endTime){r+=a.duration;continue}i.endTime+=a.duration}else if(`cueOut`in a&&(i=new C.default.VTTCue(r,r+a.duration,a.cueOut),i.adStartTime=r,i.adEndTime=r+parseFloat(a.cueOut),t.addCue(i)),`cueOutCont`in a){let[e,n]=a.cueOutCont.split(`/`).map(parseFloat);i=new C.default.VTTCue(r,r+a.duration,``),i.adStartTime=r-e,i.adEndTime=i.adStartTime+n,t.addCue(i)}r+=a.duration}},If=class{constructor({start:e,end:t,segmentIndex:n,partIndex:r=null,appended:i=!1}){this.start_=e,this.end_=t,this.segmentIndex_=n,this.partIndex_=r,this.appended_=i}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_}},Lf=class{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())}},Rf=class{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){let{mediaSequence:n,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(n,r),this.isReliable_)return this.updateStorage_(r,n,this.calculateBaseTime_(n,r,t))}getSyncInfoForTime(e){for(let{segmentSyncInfo:t,partsSyncInfo:n}of this.storage_.values())if(n.length){for(let t of n)if(t.isInRange(e))return t}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,n){let r=new Map,i=`
208
+ `,a=n,o=t;this.start_=a,e.forEach((e,t)=>{let n=this.storage_.get(o),s=a,c=s+e.duration,l=!!(n&&n.segmentSyncInfo&&n.segmentSyncInfo.isAppended),u=new If({start:s,end:c,appended:l,segmentIndex:t});e.syncInfo=u;let d=a,f=(e.parts||[]).map((e,r)=>{let a=d,s=d+e.duration,c=!!(n&&n.partsSyncInfo&&n.partsSyncInfo[r]&&n.partsSyncInfo[r].isAppended),l=new If({start:a,end:s,appended:c,segmentIndex:t,partIndex:r});return d=s,i+=`Media Sequence: ${o}.${r} | Range: ${a} --> ${s} | Appended: ${c}\n`,e.syncInfo=l,l});r.set(o,new Lf(u,f)),i+=`${Id(e.resolvedUri)} | Media Sequence: ${o} | Range: ${s} --> ${c} | Appended: ${l}\n`,o++,a=c}),this.end_=a,this.storage_=r,this.diagnostics_=i}calculateBaseTime_(e,t,n){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;let r=Math.min(...this.storage_.keys());if(e<r){let n=r-e,i=this.storage_.get(r).segmentSyncInfo.start;for(let e=0;e<n;e++){let n=t[e];i-=n.duration}return i}return n}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}},zf=class extends Rf{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,n){if(!this.storage_.size){let t=this.parent_.getSyncInfoForMediaSequence(e);return t?t.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,n)}},Bf=86400,Vf=[{name:`VOD`,run:(e,t,n,r,i)=>n===1/0?null:{time:0,segmentIndex:0,partIndex:null}},{name:`MediaSequence`,run:(e,t,n,r,i,a)=>{let o=e.getMediaSequenceSync(a);if(!o||!o.isReliable)return null;let s=o.getSyncInfoForTime(i);return s?{time:s.start,partIndex:s.partIndex,segmentIndex:s.segmentIndex}:null}},{name:`ProgramDateTime`,run:(e,t,n,r,i)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let a=null,o=null,s=nl(t);i||=0;for(let n=0;n<s.length;n++){let r=s[t.endList||i===0?n:s.length-(n+1)],c=r.segment,l=e.timelineToDatetimeMappings[c.timeline];if(!l||!c.dateTimeObject)continue;let u=c.dateTimeObject.getTime()/1e3+l;if(c.parts&&typeof r.partIndex==`number`)for(let e=0;e<r.partIndex;e++)u+=c.parts[e].duration;let d=Math.abs(i-u);if(o!==null&&(d===0||o<d))break;o=d,a={time:u,segmentIndex:r.segmentIndex,partIndex:r.partIndex}}return a}},{name:`Segment`,run:(e,t,n,r,i)=>{let a=null,o=null;i||=0;let s=nl(t);for(let e=0;e<s.length;e++){let n=s[t.endList||i===0?e:s.length-(e+1)],c=n.segment,l=n.part&&n.part.start||c&&c.start;if(c.timeline===r&&l!==void 0){let e=Math.abs(i-l);if(o!==null&&o<e)break;(!a||o===null||o>=e)&&(o=e,a={time:l,segmentIndex:n.segmentIndex,partIndex:n.partIndex})}}return a}},{name:`Discontinuity`,run:(e,t,n,r,i)=>{let a=null;if(i||=0,t.discontinuityStarts&&t.discontinuityStarts.length){let n=null;for(let r=0;r<t.discontinuityStarts.length;r++){let o=t.discontinuityStarts[r],s=t.discontinuitySequence+r+1,c=e.discontinuities[s];if(c){let e=Math.abs(i-c.time);if(n!==null&&n<e)break;(!a||n===null||n>=e)&&(n=e,a={time:c.time,segmentIndex:o,partIndex:null})}}}return a}},{name:`Playlist`,run:(e,t,n,r,i)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}],Hf=class extends Z.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};let t=new Rf;this.mediaSequenceStorage_={main:t,audio:new zf(t),vtt:new zf(t)},this.logger_=zc(`SyncController`)}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,n,r,i){if(t!==1/0)return Vf.find(({name:e})=>e===`VOD`).run(this,e,t);let a=this.runStrategies_(e,t,n,r,i);if(!a.length)return null;for(let t of a){let{syncPoint:n,strategy:i}=t,{segmentIndex:a,time:o}=n;if(a<0)continue;let s=e.segments[a],c=o,l=c+s.duration;if(this.logger_(`Strategy: ${i}. Current time: ${r}. selected segment: ${a}. Time: [${c} -> ${l}]}`),r>=c&&r<l)return this.logger_(`Found sync point with exact match: `,n),n}return this.selectSyncPoint_(a,{key:`time`,value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;let n=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!n.length)return null;let r=this.selectSyncPoint_(n,{key:`segmentIndex`,value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+ul({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,n,r,i){let a=[];for(let o=0;o<Vf.length;o++){let s=Vf[o],c=s.run(this,e,t,n,r,i);c&&(c.strategy=s.name,a.push({strategy:s.name,syncPoint:c}))}return a}selectSyncPoint_(e,t){let n=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),i=e[0].strategy;for(let a=1;a<e.length;a++){let o=Math.abs(e[a].syncPoint[t.key]-t.value);o<r&&(r=o,n=e[a].syncPoint,i=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${i}]: [time:${n.time}, segmentIndex:${n.segmentIndex}`+(typeof n.partIndex==`number`?`,partIndex:${n.partIndex}`:``)+`]`),n}saveExpiredSegmentInfo(e,t){let n=t.mediaSequence-e.mediaSequence;if(n>Bf){Z.log.warn(`Not saving expired segment info. Media sequence gap ${n} is too large.`);return}for(let r=n-1;r>=0;r--){let n=e.segments[r];if(n&&n.start!==void 0){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){let t=e.segments[0],n=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-n}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){let n=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;n&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));let i=r.dateTimeObject;r.discontinuity&&t&&i&&(this.timelineToDatetimeMappings[r.timeline]=-(i.getTime()/1e3))}timestampOffsetForTimeline(e){return this.timelines[e]===void 0?null:this.timelines[e].time}mappingForTimeline(e){return this.timelines[e]===void 0?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,n){let r=e.segment,i=e.part,a=this.timelines[e.timeline],o,s;if(typeof e.timestampOffset==`number`)a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},n&&(this.timelines[e.timeline]=a,this.trigger(`timestampoffset`),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,s=t.end+a.mapping;else if(a)o=t.start+a.mapping,s=t.end+a.mapping;else return!1;return i&&(i.start=o,i.end=s),(!r.start||o<r.start)&&(r.start=o),r.end=s,!0}saveDiscontinuitySyncInfo_(e){let t=e.playlist,n=e.segment;if(n.discontinuity)this.discontinuities[n.timeline]={time:n.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){let i=t.discontinuityStarts[r],a=t.discontinuitySequence+r+1,o=i-e.mediaIndex,s=Math.abs(o);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>s){let r;r=o<0?n.start-ul({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:i}):n.end+ul({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:i}),this.discontinuities[a]={time:r,accuracy:s}}}}dispose(){this.trigger(`dispose`),this.off()}},Uf=class extends Z.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger(`pendingtimelinechange`)}pendingTimelineChange({type:e,from:t,to:n}){return typeof t==`number`&&typeof n==`number`&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:n},this.trigger(`pendingtimelinechange`)),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:n}){if(typeof t==`number`&&typeof n==`number`){this.lastTimelineChanges_[e]={type:e,from:t,to:n},delete this.pendingTimelineChanges_[e];let r={timelineChangeInfo:{from:t,to:n}};this.trigger({type:`timelinechange`,metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger(`dispose`),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}},Wf=Hu(Uu(Wu(function(){var e=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(arguments.length===2)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,o=0;o<a;++o)t[o].apply(this,i)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on(`data`,function(t){e.push(t)})},e}();function t(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}let n=function(){let e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],n=e[1],r=t[4],i=n[4],a,o,s,c=[],l=[],u,d,f,p,m,h;for(a=0;a<256;a++)l[(c[a]=a<<1^(a>>7)*283)^a]=a;for(o=s=0;!r[o];o^=u||1,s=l[s]||1)for(p=s^s<<1^s<<2^s<<3^s<<4,p=p>>8^p&255^99,r[o]=p,i[p]=o,f=c[d=c[u=c[o]]],h=f*16843009^d*65537^u*257^o*16843008,m=c[p]*257^p*16843008,a=0;a<4;a++)t[a][o]=m=m<<24^m>>>8,n[a][p]=h=h<<24^h>>>8;for(a=0;a<5;a++)t[a]=t[a].slice(0),n[a]=n[a].slice(0);return e},r=null;class i{constructor(e){r||=n(),this._tables=[[r[0][0].slice(),r[0][1].slice(),r[0][2].slice(),r[0][3].slice(),r[0][4].slice()],[r[1][0].slice(),r[1][1].slice(),r[1][2].slice(),r[1][3].slice(),r[1][4].slice()]];let t,i,a,o=this._tables[0][4],s=this._tables[1],c=e.length,l=1;if(c!==4&&c!==6&&c!==8)throw Error(`Invalid aes key size`);let u=e.slice(0),d=[];for(this._key=[u,d],t=c;t<4*c+28;t++)a=u[t-1],(t%c===0||c===8&&t%c===4)&&(a=o[a>>>24]<<24^o[a>>16&255]<<16^o[a>>8&255]<<8^o[a&255],t%c===0&&(a=a<<8^a>>>24^l<<24,l=l<<1^(l>>7)*283)),u[t]=u[t-c]^a;for(i=0;t;i++,t--)a=u[i&3?t:t-4],t<=4||i<4?d[i]=a:d[i]=s[0][o[a>>>24]]^s[1][o[a>>16&255]]^s[2][o[a>>8&255]]^s[3][o[a&255]]}decrypt(e,t,n,r,i,a){let o=this._key[1],s=e^o[0],c=r^o[1],l=n^o[2],u=t^o[3],d,f,p,m=o.length/4-2,h,g=4,_=this._tables[1],v=_[0],y=_[1],b=_[2],x=_[3],S=_[4];for(h=0;h<m;h++)d=v[s>>>24]^y[c>>16&255]^b[l>>8&255]^x[u&255]^o[g],f=v[c>>>24]^y[l>>16&255]^b[u>>8&255]^x[s&255]^o[g+1],p=v[l>>>24]^y[u>>16&255]^b[s>>8&255]^x[c&255]^o[g+2],u=v[u>>>24]^y[s>>16&255]^b[c>>8&255]^x[l&255]^o[g+3],g+=4,s=d,c=f,l=p;for(h=0;h<4;h++)i[(3&-h)+a]=S[s>>>24]<<24^S[c>>16&255]<<16^S[l>>8&255]<<8^S[u&255]^o[g++],d=s,s=c,c=l,l=u,u=d}}class a extends e{constructor(){super(e),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(e){this.jobs.push(e),this.timeout_||=setTimeout(this.processJob_.bind(this),this.delay)}}let o=function(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24},s=function(e,t,n){let r=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),a=new i(Array.prototype.slice.call(t)),s=new Uint8Array(e.byteLength),c=new Int32Array(s.buffer),l,u,d,f,p,m,h,g,_;for(l=n[0],u=n[1],d=n[2],f=n[3],_=0;_<r.length;_+=4)p=o(r[_]),m=o(r[_+1]),h=o(r[_+2]),g=o(r[_+3]),a.decrypt(p,m,h,g,c,_),c[_]=o(c[_]^l),c[_+1]=o(c[_+1]^u),c[_+2]=o(c[_+2]^d),c[_+3]=o(c[_+3]^f),l=p,u=m,d=h,f=g;return s};class c{constructor(e,n,r,i){let s=c.STEP,l=new Int32Array(e.buffer),u=new Uint8Array(e.byteLength),d=0;for(this.asyncStream_=new a,this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+s),n,r,u)),d=s;d<l.length;d+=s)r=new Uint32Array([o(l[d-4]),o(l[d-3]),o(l[d-2]),o(l[d-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+s),n,r,u));this.asyncStream_.push(function(){i(null,t(u))})}static get STEP(){return 32e3}decryptChunk_(e,t,n,r){return function(){let i=s(e,t,n);r.set(i,e.byteOffset)}}}var l=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},u=typeof window<`u`?window:l===void 0?typeof self<`u`?self:{}:l,d=function(e){return ArrayBuffer.isView===`function`?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},f=u.BigInt||Number;f(`0x1`),f(`0x100`),f(`0x10000`),f(`0x1000000`),f(`0x100000000`),f(`0x10000000000`),f(`0x1000000000000`),f(`0x100000000000000`),f(`0x10000000000000000`),(function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return t[0]===255?`big`:t[0]===204?`little`:`unknown`})();let p=function(e){let t={};return Object.keys(e).forEach(n=>{let r=e[n];d(r)?t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[n]=r}),t};self.onmessage=function(e){let t=e.data;new c(new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4),function(e,n){self.postMessage(p({source:t.source,decrypted:n}),[n.buffer])})}}))),Gf=e=>{let t=e.default?`main`:`alternative`;return e.characteristics&&e.characteristics.indexOf(`public.accessibility.describes-video`)>=0&&(t=`main-desc`),t},Kf=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},qf=(e,t)=>{t.activePlaylistLoader=e,e.load()},Jf=(e,t)=>()=>{let{segmentLoaders:{[e]:n,main:r},mediaTypes:{[e]:i}}=t,a=i.activeTrack(),o=i.getActiveGroup(),s=i.activePlaylistLoader,c=i.lastGroup_;if(!(o&&c&&o.id===c.id)&&(i.lastGroup_=o,i.lastTrack_=a,Kf(n,i),!(!o||o.isMainPlaylist))){if(!o.playlistLoader){s&&r.resetEverything();return}n.resyncLoader(),qf(o.playlistLoader,i)}},Yf=(e,t)=>()=>{let{segmentLoaders:{[e]:n},mediaTypes:{[e]:r}}=t;r.lastGroup_=null,n.abort(),n.pause()},Xf=(e,t)=>()=>{let{mainPlaylistLoader:n,segmentLoaders:{[e]:r,main:i},mediaTypes:{[e]:a}}=t,o=a.activeTrack(),s=a.getActiveGroup(),c=a.activePlaylistLoader,l=a.lastTrack_;if(!(l&&o&&l.id===o.id)&&(a.lastGroup_=s,a.lastTrack_=o,Kf(r,a),s)){if(s.isMainPlaylist){if(!o||!l||o.id===l.id)return;let e=t.vhs.playlistController_,r=e.selectPlaylist();if(e.media()===r)return;a.logger_(`track change. Switching main audio from ${l.id} to ${o.id}`),n.pause(),i.resetEverything(),e.fastQualityChange_(r);return}if(e===`AUDIO`){if(!s.playlistLoader){i.setAudio(!0),i.resetEverything();return}r.setAudio(!0),i.setAudio(!1)}if(c===s.playlistLoader){qf(s.playlistLoader,a);return}r.track&&r.track(o),r.resetEverything(),qf(s.playlistLoader,a)}},Zf={AUDIO:(e,t)=>()=>{let{mediaTypes:{[e]:n},excludePlaylist:r}=t,i=n.activeTrack(),a=n.activeGroup(),o=(a.filter(e=>e.default)[0]||a[0]).id,s=n.tracks[o];if(i===s){r({error:{message:`Problem encountered loading the default audio track.`}});return}Z.log.warn(`Problem encountered loading the alternate audio track.Switching back to default.`);for(let e in n.tracks)n.tracks[e].enabled=n.tracks[e]===s;n.onTrackChanged()},SUBTITLES:(e,t)=>()=>{let{mediaTypes:{[e]:n}}=t;Z.log.warn(`Problem encountered loading the subtitle track.Disabling subtitle track.`);let r=n.activeTrack();r&&(r.mode=`disabled`),n.onTrackChanged()}},Qf={AUDIO:(e,t,n)=>{if(!t)return;let{tech:r,requestOptions:i,segmentLoaders:{[e]:a}}=n;t.on(`loadedmetadata`,()=>{let e=t.media();a.playlist(e,i),(!r.paused()||e.endList&&r.preload()!==`none`)&&a.load()}),t.on(`loadedplaylist`,()=>{a.playlist(t.media(),i),r.paused()||a.load()}),t.on(`error`,Zf[e](e,n))},SUBTITLES:(e,t,n)=>{let{tech:r,requestOptions:i,segmentLoaders:{[e]:a},mediaTypes:{[e]:o}}=n;t.on(`loadedmetadata`,()=>{let e=t.media();a.playlist(e,i),a.track(o.activeTrack()),(!r.paused()||e.endList&&r.preload()!==`none`)&&a.load()}),t.on(`loadedplaylist`,()=>{a.playlist(t.media(),i),r.paused()||a.load()}),t.on(`error`,Zf[e](e,n))}},$f={AUDIO:(e,t)=>{let{vhs:n,sourceType:r,segmentLoaders:{[e]:i},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:s,tracks:c,logger_:l}},mainPlaylistLoader:u}=t,d=wl(u.main);(!o[e]||Object.keys(o[e]).length===0)&&(o[e]={main:{default:{default:!0}}},d&&(o[e].main.default.playlists=u.main.playlists));for(let i in o[e]){s[i]||(s[i]=[]);for(let f in o[e][i]){let p=o[e][i][f],m;d?(l(`AUDIO group '${i}' label '${f}' is a main playlist`),p.isMainPlaylist=!0,m=null):m=r===`vhs-json`&&p.playlists?new nu(p.playlists[0],n,a):p.resolvedUri?new nu(p.resolvedUri,n,a):p.playlists&&r===`dash`?new Lu(p.playlists[0],n,a,u):null,p=Q({id:f,playlistLoader:m},p),Qf[e](e,p.playlistLoader,t),s[i].push(p),c[f]===void 0&&(c[f]=new Z.AudioTrack({id:f,kind:Gf(p),enabled:!1,language:p.language,default:p.default,label:f}))}}i.on(`error`,Zf[e](e,t))},SUBTITLES:(e,t)=>{let{tech:n,vhs:r,sourceType:i,segmentLoaders:{[e]:a},requestOptions:o,main:{mediaGroups:s},mediaTypes:{[e]:{groups:c,tracks:l}},mainPlaylistLoader:u}=t;for(let a in s[e]){c[a]||(c[a]=[]);for(let d in s[e][a]){if(!r.options_.useForcedSubtitles&&s[e][a][d].forced)continue;let f=s[e][a][d],p;if(i===`hls`)p=new nu(f.resolvedUri,r,o);else if(i===`dash`){if(!f.playlists.filter(e=>e.excludeUntil!==1/0).length)return;p=new Lu(f.playlists[0],r,o,u)}else i===`vhs-json`&&(p=new nu(f.playlists?f.playlists[0]:f.resolvedUri,r,o));f=Q({id:d,playlistLoader:p},f),Qf[e](e,f.playlistLoader,t),c[a].push(f),l[d]===void 0&&(l[d]=n.addRemoteTextTrack({id:d,kind:`subtitles`,default:f.default&&f.autoselect,language:f.language,label:d},!1).track)}}a.on(`error`,Zf[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{let{tech:n,main:{mediaGroups:r},mediaTypes:{[e]:{groups:i,tracks:a}}}=t;for(let t in r[e]){i[t]||(i[t]=[]);for(let o in r[e][t]){let s=r[e][t][o];if(!/^(?:CC|SERVICE)/.test(s.instreamId))continue;let c=n.options_.vhs&&n.options_.vhs.captionServices||{},l={label:o,language:s.language,instreamId:s.instreamId,default:s.default&&s.autoselect};c[l.instreamId]&&(l=Q(l,c[l.instreamId])),l.default===void 0&&delete l.default,i[t].push(Q({id:o},s)),a[o]===void 0&&(a[o]=n.addRemoteTextTrack({id:l.instreamId,kind:`captions`,default:l.default,language:l.language,label:l.label},!1).track)}}}},ep=(e,t)=>{for(let n=0;n<e.length;n++)if(Sl(t,e[n])||e[n].playlists&&ep(e[n].playlists,t))return!0;return!1},tp=(e,t)=>n=>{let{mainPlaylistLoader:r,mediaTypes:{[e]:{groups:i}}}=t,a=r.media();if(!a)return null;let o=null;a.attributes[e]&&(o=i[a.attributes[e]]);let s=Object.keys(i);if(!o)if(e===`AUDIO`&&s.length>1&&wl(t.main))for(let e=0;e<s.length;e++){let t=i[s[e]];if(ep(t,a)){o=t;break}}else i.main?o=i.main:s.length===1&&(o=i[s[0]]);return n===void 0?o:n===null||!o?null:o.filter(e=>e.id===n.id)[0]||null},np={AUDIO:(e,t)=>()=>{let{mediaTypes:{[e]:{tracks:n}}}=t;for(let e in n)if(n[e].enabled)return n[e];return null},SUBTITLES:(e,t)=>()=>{let{mediaTypes:{[e]:{tracks:n}}}=t;for(let e in n)if(n[e].mode===`showing`||n[e].mode===`hidden`)return n[e];return null}},rp=(e,{mediaTypes:t})=>()=>{let n=t[e].activeTrack();return n?t[e].activeGroup(n):null},ip=e=>{[`AUDIO`,`SUBTITLES`,`CLOSED-CAPTIONS`].forEach(t=>{$f[t](t,e)});let{mediaTypes:t,mainPlaylistLoader:n,tech:r,vhs:i,segmentLoaders:{AUDIO:a,main:o}}=e;[`AUDIO`,`SUBTITLES`].forEach(n=>{t[n].activeGroup=tp(n,e),t[n].activeTrack=np[n](n,e),t[n].onGroupChanged=Jf(n,e),t[n].onGroupChanging=Yf(n,e),t[n].onTrackChanged=Xf(n,e),t[n].getActiveGroup=rp(n,e)});let s=t.AUDIO.activeGroup();if(s){let e=(s.filter(e=>e.default)[0]||s[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(o.setAudio(!1),a.setAudio(!0)):o.setAudio(!0)}n.on(`mediachange`,()=>{[`AUDIO`,`SUBTITLES`].forEach(e=>t[e].onGroupChanged())}),n.on(`mediachanging`,()=>{[`AUDIO`,`SUBTITLES`].forEach(e=>t[e].onGroupChanging())});let c=()=>{t.AUDIO.onTrackChanged(),r.trigger({type:`usage`,name:`vhs-audio-change`})};r.audioTracks().addEventListener(`change`,c),r.remoteTextTracks().addEventListener(`change`,t.SUBTITLES.onTrackChanged),i.on(`dispose`,()=>{r.audioTracks().removeEventListener(`change`,c),r.remoteTextTracks().removeEventListener(`change`,t.SUBTITLES.onTrackChanged)}),r.clearTracks(`audio`);for(let e in t.AUDIO.tracks)r.audioTracks().addTrack(t.AUDIO.tracks[e])},ap=()=>{let e={};return[`AUDIO`,`SUBTITLES`,`CLOSED-CAPTIONS`].forEach(t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:_f,activeTrack:_f,getActiveGroup:_f,onGroupChanged:_f,onTrackChanged:_f,lastTrack_:null,logger_:zc(`MediaGroups[${t}]`)}}),e},op=class{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_=Lc(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(e=>[e.ID,e])))}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_}},sp=class extends Z.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new op,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_=zc(`Content Steering`),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?`HLS`:`DASH`;let n=t.serverUri||t.serverURL;if(!n){this.logger_(`steering manifest URL is ${n}, cannot request steering manifest.`),this.trigger(`error`);return}if(n.startsWith(`data:`)){this.decodeDataUriManifest_(n.substring(n.indexOf(`,`)+1));return}this.steeringManifest.reloadUri=Lc(e,n),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger(`content-steering`)}requestSteeringManifest(e){let t=this.steeringManifest.reloadUri;if(!t)return;let n=e?t:this.getRequestURI(t);if(!n){this.logger_(`No valid content steering manifest URIs. Stopping content steering.`),this.trigger(`error`),this.dispose();return}let r={contentSteeringInfo:{uri:n}};this.trigger({type:`contentsteeringloadstart`,metadata:r}),this.request_=this.xhr_({uri:n,requestType:`content-steering-manifest`},(e,t)=>{if(e){if(t.status===410){this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${n} this session.`),this.excludedSteeringManifestURLs.add(n);return}if(t.status===429){let n=t.responseHeaders[`retry-after`];this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${n} seconds.`),this.startTTLTimeout_(parseInt(n,10));return}this.logger_(`manifest failed to load ${e}.`),this.startTTLTimeout_();return}this.trigger({type:`contentsteeringloadcomplete`,metadata:r});let i;try{i=JSON.parse(this.request_.responseText)}catch(e){let t={errorType:Z.Error.StreamingContentSteeringParserError,error:e};this.trigger({type:`error`,metadata:t})}this.assignSteeringProperties_(i);let a={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:`contentsteeringparsed`,metadata:a}),this.startTTLTimeout_()})}setProxyServerUrl_(e){let t=new C.default.URL(e),n=new C.default.URL(this.proxyServerUrl_);return n.searchParams.set(`url`,encodeURI(t.toString())),this.setSteeringParams_(n.toString())}decodeDataUriManifest_(e){let t=JSON.parse(C.default.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){let t=new C.default.URL(e),n=this.getPathway(),r=this.getBandwidth_();if(n){let e=`_${this.manifestType_}_pathway`;t.searchParams.set(e,n)}if(r){let e=`_${this.manifestType_}_throughput`;t.searchParams.set(e,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());let t=(e=>{for(let t of e)if(this.availablePathways_.has(t))return t;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger(`content-steering`))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;let t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){let n=this.setProxyServerUrl_(e);if(!t(n))return n}let n=this.setSteeringParams_(e);return t(n)?null:n}startTTLTimeout_(e=this.steeringManifest.ttl){let t=e*1e3;this.ttlTimeout_=C.default.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){C.default.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 op}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&&(Lc(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}},cp=(e,t)=>{let n=null;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(null,r)},t)}},lp=10,up,dp=[`mediaRequests`,`mediaRequestsAborted`,`mediaRequestsTimedout`,`mediaRequestsErrored`,`mediaTransferDuration`,`mediaBytesTransferred`,`mediaAppends`],fp=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},pp=function({currentPlaylist:e,buffered:t,currentTime:n,nextPlaylist:r,bufferLowWaterLine:i,bufferHighWaterLine:a,duration:o,bufferBasedABR:s,log:c}){if(!r)return Z.log.warn(`We received no playlist to switch to. Please check your stream.`),!1;let l=`allowing switch ${e&&e.id||`null`} -> ${r.id}`;if(!e)return c(`${l} as current playlist is not set`),!0;if(r.id===e.id)return!1;let u=!!Gc(t,n).length;if(!e.endList)return!u&&typeof e.partTargetDuration==`number`?(c(`not ${l} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(c(`${l} as current playlist is live`),!0);let d=el(t,n),f=s?Ru.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ru.MAX_BUFFER_LOW_WATER_LINE;if(o<f)return c(`${l} as duration < max low water line (${o} < ${f})`),!0;let p=r.attributes.BANDWIDTH,m=e.attributes.BANDWIDTH;if(p<m&&(!s||d<a)){let e=`${l} as next bandwidth < current bandwidth (${p} < ${m})`;return s&&(e+=` and forwardBuffer < bufferHighWaterLine (${d} < ${a})`),c(e),!0}if((!s||p>m)&&d>=i){let e=`${l} as forwardBuffer >= bufferLowWaterLine (${d} >= ${i})`;return s&&(e+=` and next bandwidth > current bandwidth (${p} > ${m})`),c(e),!0}return c(`not ${l} as no switching criteria met`),!1},mp=class extends Z.EventTarget{constructor(e){super(),this.fastQualityChange_=cp(this.fastQualityChange_.bind(this),100);let{src:t,withCredentials:n,tech:r,bandwidth:i,externVhs:a,useCueTags:o,playlistExclusionDuration:s,enableLowInitialPlaylist:c,sourceType:l,cacheEncryptionKeys:u,bufferBasedABR:d,leastPixelDiffSelector:f,captionServices:p,experimentalUseMMS:m}=e;if(!t)throw Error(`A non-empty playlist URL or JSON manifest string is required`);let{maxPlaylistRetries:h}=e;h??=1/0,up=a,this.bufferBasedABR=!!d,this.leastPixelDiffSelector=!!f,this.withCredentials=n,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=l,this.useCueTags_=o,this.playlistExclusionDuration=s,this.maxPlaylistRetries=h,this.enableLowInitialPlaylist=c,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack(`metadata`,`ad-cues`),this.cueTagsTrack_.inBandMetadataTrackDispatchType=``),this.requestOptions_={withCredentials:n,maxPlaylistRetries:h,timeout:null},this.on(`error`,this.pauseLoading),this.mediaTypes_=ap(),m&&C.default.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new C.default.ManagedMediaSource,this.usingManagedMediaSource_=!0,Z.log(`Using ManagedMediaSource`)):C.default.MediaSource&&(this.mediaSource=new C.default.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_=Bc(),this.hasPlayed_=!1,this.syncController_=new Hf(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:`metadata`,label:`segment-metadata`},!1).track,this.segmentMetadataTrack_.mode=`hidden`,this.decrypter_=new Wf,this.sourceUpdater_=new Of(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Uf,this.keyStatusMap_=new Map;let g={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:p,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:i,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:u,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_===`dash`?new Lu(t,this.vhs_,Q(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new nu(t,this.vhs_,Q(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new gf(Q(g,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:`main`}),e),this.audioSegmentLoader_=new gf(Q(g,{loaderType:`audio`}),e),this.subtitleSegmentLoader_=new Nf(Q(g,{loaderType:`vtt`,featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((e,t)=>{function n(){r.off(`vttjserror`,i),e()}function i(){r.off(`vttjsloaded`,n),t()}r.one(`vttjsloaded`,n),r.one(`vttjserror`,i),r.addWebVttScript_()})}),e),this.contentSteeringController_=new sp(this.vhs_.xhr,()=>this.mainSegmentLoader_.bandwidth),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one(`loadedplaylist`,()=>this.startABRTimer_()),this.tech_.on(`pause`,()=>this.stopABRTimer_()),this.tech_.on(`play`,()=>this.startABRTimer_())),dp.forEach(e=>{this[e+`_`]=fp.bind(this,e)}),this.logger_=zc(`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;let _=this.tech_.preload()===`none`?`play`:`loadstart`;this.tech_.one(_,()=>{let e=Date.now();this.tech_.one(`loadeddata`,()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){let e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e=`abr`){let t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,n){let r=this.media(),i=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(i&&i!==a){this.logger_(`switch media ${i} -> ${a} from ${t}`);let n={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:`renditionselected`,metadata:n}),this.tech_.trigger({type:`usage`,name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,n)}switchMediaForDASHContentSteering_(){[`AUDIO`,`SUBTITLES`,`CLOSED-CAPTIONS`].forEach(e=>{let t=this.mediaTypes_[e],n=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(n&&r){let t=(n.length?n[0].playlists:n.playlists).filter(e=>e.attributes.serviceLocation===r);t.length&&this.mediaTypes_[e].activePlaylistLoader.media(t[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=C.default.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(C.default.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){let e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;let n=e.mediaGroups.AUDIO,r=Object.keys(n),i;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{let e=n.main||r.length&&n[r[0]];for(let t in e)if(e[t].default){i={label:t};break}}if(!i)return t;let a=[];for(let t in n)if(n[t][i.label]){let r=n[t][i.label];if(r.playlists&&r.playlists.length)a.push.apply(a,r.playlists);else if(r.uri)a.push(r);else if(e.playlists.length)for(let n=0;n<e.playlists.length;n++){let r=e.playlists[n];r.attributes&&r.attributes.AUDIO&&r.attributes.AUDIO===t&&a.push(r)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on(`loadedmetadata`,()=>{let e=this.mainPlaylistLoader_.media(),t=e.targetDuration*1.5*1e3;xl(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&this.tech_.preload()!==`none`&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),ip({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(),e),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 e=this.mainPlaylistLoader_.media();if(!e){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let t;if(this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||=this.selectPlaylist(),!t||!this.shouldSwitchToMedia_(t)||(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,`initial`),!(this.sourceType_===`vhs-json`&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on(`error`,()=>{let e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on(`mediachanging`,()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on(`mediachange`,()=>{let e=this.mainPlaylistLoader_.media(),t=e.targetDuration*1.5*1e3;xl(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.sourceType_===`dash`&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:`mediachange`,bubbles:!0})}),this.mainPlaylistLoader_.on(`playlistunchanged`,()=>{let e=this.mainPlaylistLoader_.media();e.lastExcludeReason_!==`playlist-unchanged`&&this.stuckAtPlaylistEnd_(e)&&(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(e=>{this.mainPlaylistLoader_.on(e,e=>{this.player_.trigger(w({},e))})})}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){let n=e.mediaGroups||{},r=!0,i=Object.keys(n.AUDIO);for(let e in n.AUDIO)for(let t in n.AUDIO[e])n.AUDIO[e][t].uri||(r=!1);r&&this.tech_.trigger({type:`usage`,name:`vhs-demuxed`}),Object.keys(n.SUBTITLES).length&&this.tech_.trigger({type:`usage`,name:`vhs-webvtt`}),up.Playlist.isAes(t)&&this.tech_.trigger({type:`usage`,name:`vhs-aes`}),i.length&&Object.keys(n.AUDIO[i[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){let t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),r=this.bufferLowWaterLine(),i=this.bufferHighWaterLine();return pp({buffered:this.tech_.buffered(),currentTime:n,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:i,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`,()=>{let e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),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`,()=>{let e=this.audioSegmentLoader_.pendingSegment_;if(!e||!e.segment||!e.segment.syncInfo)return;let t=e.segment.syncInfo.end+.01;this.tech_.setCurrentTime(t)}),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`,e=>{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:lp}))});let e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();let e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on(`trackinfo`,e),this.audioSegmentLoader_.on(`trackinfo`,e),this.mainSegmentLoader_.on(`fmp4`,()=>{this.triggeredFmp4Usage||=(this.tech_.trigger({type:`usage`,name:`vhs-fmp4`}),!0)}),this.audioSegmentLoader_.on(`fmp4`,()=>{this.triggeredFmp4Usage||=(this.tech_.trigger({type:`usage`,name:`vhs-fmp4`}),!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(e=>{this.mainSegmentLoader_.on(e,e=>{this.player_.trigger(w({},e))}),this.audioSegmentLoader_.on(e,e=>{this.player_.trigger(w({},e))}),this.subtitleSegmentLoader_.on(e,e=>{this.player_.trigger(w({},e))})})}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();let 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(){let e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){let t=this.seekable();if(!t.length)return!1;let n=t.end(0),r=n;if(e.start){let i=e.start.timeOffset;if(i<0){let a=this.mainPlaylistLoader_.main,o=n+up.Playlist.liveEdgeDelay(a,e);r=Math.max(Math.min(o+i,n),t.start(0))}else r=Math.min(n,i)}this.trigger(`firstplay`),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){let e=this.tech_.play();e!==void 0&&typeof e.then==`function`&&e.then(null,e=>{})}this.trigger(`sourceopen`)}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;let e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;let 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){let t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e&&=this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;let t=this.syncController_.getExpiredTime(e,this.duration());if(t===null)return!1;let n=up.Playlist.playlistEnd(e,t),r=this.tech_.currentTime(),i=this.tech_.buffered();if(!i.length)return n-r<=Uc;let a=i.end(i.length-1);return a-r<=Uc&&n-a<=Uc}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:n}){if(e||=this.mainPlaylistLoader_.media(),n=n||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState===`open`?this.sourceUpdater_.endOfStream(`network`):this.trigger(`error`);return}e.playlistErrors_++;let r=this.mainPlaylistLoader_.main.playlists,i=r.filter(gl),a=i.length===1&&i[0]===e;if(r.length===1&&n!==1/0)return Z.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){let t=this.pathwayAttribute_(e),n=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(t),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(t)},n);return}let t=!1;r.forEach(n=>{if(n===e)return;let r=n.excludeUntil;r!==void 0&&r!==1/0&&(t=!0,delete n.excludeUntil)}),t&&(Z.log.warn(`Removing other playlists from the exclusion list because the last rendition is about to be excluded.`),this.tech_.trigger(`retryplaylist`))}let o;o=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+n*1e3,e.excludeUntil=o,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger(`excludeplaylist`),this.tech_.trigger({type:`usage`,name:`vhs-rendition-excluded`});let s=this.selectPlaylist();if(!s){this.error=`Playback cannot continue. No available working or supported playlists.`,this.trigger(`error`);return}let c=t.internal?this.logger_:Z.log.warn,l=t.message?` `+t.message:``;c(`${t.internal?`Internal problem`:`Problem`} encountered with playlist ${e.id}.${l} Switching to playlist ${s.id}.`),s.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_(`audio`,[`abort`,`pause`]),s.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_(`subtitle`,[`abort`,`pause`]),this.delegateLoaders_(`main`,[`abort`,`pause`]);let u=s.targetDuration/2*1e3||5*1e3,d=typeof s.lastRequest==`number`&&Date.now()-s.lastRequest<=u;return this.switchMedia_(s,`exclude`,a||d)}pauseLoading(){this.delegateLoaders_(`all`,[`abort`,`pause`]),this.stopABRTimer_()}delegateLoaders_(e,t){let n=[],r=e===`all`;(r||e===`main`)&&n.push(this.mainPlaylistLoader_);let i=[];(r||e===`audio`)&&i.push(`AUDIO`),(r||e===`subtitle`)&&(i.push(`CLOSED-CAPTIONS`),i.push(`SUBTITLES`)),i.forEach(e=>{let t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)}),[`main`,`audio`,`subtitle`].forEach(t=>{let r=this[`${t}SegmentLoader_`];r&&(e===t||e===`all`)&&n.push(r)}),n.forEach(e=>t.forEach(t=>{typeof e[t]==`function`&&e[t]()}))}setCurrentTime(e){let t=Gc(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;let e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:up.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){let n=e.media();if(!n)return null;let r=this.syncController_.getMediaSequenceSync(t);if(r&&r.isReliable){let e=r.start,t=r.end;if(!isFinite(e)||!isFinite(t))return null;let i=up.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,n);return Bc([[e,Math.max(e,t-i)]])}let i=this.syncController_.getExpiredTime(n,this.duration());if(i===null)return null;let a=up.Playlist.seekable(n,i,up.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,n));return a.length?a:null}computeFinalSeekable_(e,t){if(!t)return e;let n=e.start(0),r=e.end(0),i=t.start(0),a=t.end(0);return i>r||n>a?e:Bc([[Math.max(n,i),Math.min(r,a)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;let 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;let n=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||n&&n.length&&this.seekable_.length&&n.start(0)===this.seekable_.start(0)&&n.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${Yc(this.seekable_)}]`);let 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_),null),this.mediaSource.readyState!==`open`){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener(`sourceopen`,this.updateDuration_);return}if(e){let e=this.seekable();if(!e.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1));return}let t=this.tech_.buffered(),n=up.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(n=Math.max(n,t.end(t.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}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=>{let t=this.mediaTypes_[e].groups;for(let e in t)t[e].forEach(e=>{e.playlistLoader&&e.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_(){let e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!n)}getCodecsOrExclude_(){let e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;let n=Gl(this.main(),t),r={},i=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=n.video||e.main.videoCodec||`avc1.4d400d`),e.main.isMuxed&&(r.video+=`,${n.audio||e.main.audioCodec||`mp4a.40.2`}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||i)&&(r.audio=n.audio||e.main.audioCodec||e.audio.audioCodec||`mp4a.40.2`,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}let a=(e,t)=>e?ve(t,this.usingManagedMediaSource_):M(t),o={},s;if([`video`,`audio`].forEach(function(t){if(r.hasOwnProperty(t)&&!a(e[t].isFmp4,r[t])){let n=e[t].isFmp4?`browser`:`muxer`;o[n]=o[n]||[],o[n].push(r[t]),t===`audio`&&(s=n)}}),i&&s&&t.attributes.AUDIO){let e=t.attributes.AUDIO;this.main().playlists.forEach(n=>{(n.attributes&&n.attributes.AUDIO)===e&&n!==t&&(n.excludeUntil=1/0)}),this.logger_(`excluding audio group ${e} as ${s} does not support codec(s): "${r.audio}"`)}if(Object.keys(o).length){let e=Object.keys(o).reduce((e,t)=>(e&&(e+=`, `),e+=`${t} does not support codec(s): "${o[t].join(`,`)}"`,e),``)+`.`;this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:e},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){let e=[];if([`video`,`audio`].forEach(t=>{let n=(me(this.sourceUpdater_.codecs[t]||``)[0]||{}).type,i=(me(r[t]||``)[0]||{}).type;n&&i&&n.toLowerCase()!==i.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${r[t]}"`)}),e.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${e.join(`, `)}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!==`open`||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;let e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);let t=[e.video,e.audio].filter(Boolean).join(`,`);this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){let e=this.main().playlists,t=[];Object.keys(e).forEach(n=>{let r=e[n];if(t.indexOf(r.id)!==-1)return;t.push(r.id);let i=Gl(this.main,r),a=[];i.audio&&!M(i.audio)&&!ve(i.audio,this.usingManagedMediaSource_)&&a.push(`audio codec ${i.audio}`),i.video&&!M(i.video)&&!ve(i.video,this.usingManagedMediaSource_)&&a.push(`video codec ${i.video}`),i.text&&i.text===`stpp.ttml.im1t`&&a.push(`text codec ${i.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(`, `)}`))})}excludeIncompatibleVariants_(e){let t=[],n=this.main().playlists,r=Ul(me(e)),i=Wl(r),a=r.video&&me(r.video)[0]||null,o=r.audio&&me(r.audio)[0]||null;Object.keys(n).forEach(e=>{let r=n[e];if(t.indexOf(r.id)!==-1||r.excludeUntil===1/0)return;t.push(r.id);let s=[],c=Gl(this.mainPlaylistLoader_.main,r),l=Wl(c);if(!(!c.audio&&!c.video)){if(l!==i&&s.push(`codec count "${l}" !== "${i}"`),!this.sourceUpdater_.canChangeType()){let e=c.video&&me(c.video)[0]||null,t=c.audio&&me(c.audio)[0]||null;e&&a&&e.type.toLowerCase()!==a.type.toLowerCase()&&s.push(`video codec "${e.type}" !== "${a.type}"`),t&&o&&t.type.toLowerCase()!==o.type.toLowerCase()&&s.push(`audio codec "${t.type}" !== "${o.type}"`)}s.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id}: ${s.join(` && `)}`))}})}updateAdCues_(e){let t=0,n=this.seekable();n.length&&(t=n.start(0)),Ff(e,this.cueTagsTrack_,t)}goalBufferLength(){let e=this.tech_.currentTime(),t=Ru.GOAL_BUFFER_LENGTH,n=Ru.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Ru.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*n,r)}bufferLowWaterLine(){let e=this.tech_.currentTime(),t=Ru.BUFFER_LOW_WATER_LINE,n=Ru.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Ru.MAX_BUFFER_LOW_WATER_LINE),i=Math.max(t,Ru.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*n,this.bufferBasedABR?i:r)}bufferHighWaterLine(){return Ru.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){Wd(this.inbandTextTracks_,`com.apple.streaming`,this.tech_),Ud({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,n){let r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Wd(this.inbandTextTracks_,e,this.tech_),Bd({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:n})}pathwayAttribute_(e){return e.attributes[`PATHWAY-ID`]||e.attributes.serviceLocation}initContentSteeringController_(){let e=this.main();if(e.contentSteering){for(let 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(e=>{this.contentSteeringController_.on(e,e=>{this.trigger(w({},e))})}),this.sourceType_===`dash`&&this.mainPlaylistLoader_.on(`loadedplaylist`,()=>{let e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{let t=this.contentSteeringController_.getAvailablePathways(),n=[];for(let r of e.playlists){let e=r.attributes.serviceLocation;if(e&&(n.push(e),!t.has(e)))return!0}return!!(!n.length&&t.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){let e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();let t=this.main().playlists,n=new Set,r=!1;Object.keys(t).forEach(i=>{let a=t[i],o=this.pathwayAttribute_(a),s=o&&e!==o;a.excludeUntil===1/0&&a.lastExcludeReason_===`content-steering`&&!s&&(delete a.excludeUntil,delete a.lastExcludeReason_,r=!0);let c=!a.excludeUntil&&a.excludeUntil!==1/0;!n.has(a.id)&&s&&c&&(n.add(a.id),a.excludeUntil=1/0,a.lastExcludeReason_=`content-steering`,this.logger_(`excluding ${a.id} for ${a.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_===`DASH`&&Object.keys(this.mediaTypes_).forEach(t=>{let n=this.mediaTypes_[t];if(n.activePlaylistLoader){let t=n.activePlaylistLoader.media_;t&&t.attributes.serviceLocation!==e&&(r=!0)}}),r&&this.changeSegmentPathway_()}handlePathwayClones_(){let e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,n=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||n&&n.size){for(let[e,r]of t.entries())n.get(e)||(this.mainPlaylistLoader_.updateOrDeleteClone(r),this.contentSteeringController_.excludePathway(e));for(let[r,i]of n.entries()){let n=t.get(r);if(!n){e.filter(e=>e.attributes[`PATHWAY-ID`]===i[`BASE-ID`]).forEach(e=>{this.mainPlaylistLoader_.addClonePathway(i,e)}),this.contentSteeringController_.addAvailablePathway(r);continue}this.equalPathwayClones_(n,i)||(this.mainPlaylistLoader_.updateOrDeleteClone(i,!0),this.contentSteeringController_.addAvailablePathway(r))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...n])))}}equalPathwayClones_(e,t){if(e[`BASE-ID`]!==t[`BASE-ID`]||e.ID!==t.ID||e[`URI-REPLACEMENT`].HOST!==t[`URI-REPLACEMENT`].HOST)return!1;let n=e[`URI-REPLACEMENT`].PARAMS,r=t[`URI-REPLACEMENT`].PARAMS;for(let e in n)if(n[e]!==r[e])return!1;for(let e in r)if(n[e]!==r[e])return!1;return!0}changeSegmentPathway_(){let 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,t=`non-usable`;this.mainPlaylistLoader_.main.playlists.forEach(n=>{let r=this.mainPlaylistLoader_.getKeyIdSet(n);!r||!r.size||r.forEach(r=>{let i=`usable`,a=this.keyStatusMap_.has(r)&&this.keyStatusMap_.get(r)===i,o=n.lastExcludeReason_===t&&n.excludeUntil===1/0;a?a&&o&&(delete n.excludeUntil,delete n.lastExcludeReason_,this.logger_(`enabling playlist ${n.id} because key ID ${r} is ${i}`)):(n.excludeUntil!==1/0&&n.lastExcludeReason_!==t&&(n.excludeUntil=1/0,n.lastExcludeReason_=t,this.logger_(`excluding playlist ${n.id} because the key ID ${r} doesn't exist in the keyStatusMap or is not ${i}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(e=>{let n=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,r=e.excludeUntil===1/0&&e.lastExcludeReason_===t;n&&r&&(delete e.excludeUntil,Z.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){let n=(typeof e==`string`?e:Af(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_()}},hp=(e,t,n)=>r=>{let i=e.main.playlists[t],a=hl(i),o=gl(i);if(r===void 0)return o;r?delete i.disabled:i.disabled=!0;let s={renditionInfo:{id:t,bandwidth:i.attributes.BANDWIDTH,resolution:i.attributes.RESOLUTION,codecs:i.attributes.CODECS},cause:`fast-quality`};return r!==o&&!a&&(r?(n(i),e.trigger({type:`renditionenabled`,metadata:s})):e.trigger({type:`renditiondisabled`,metadata:s})),r},gp=class{constructor(e,t,n){let{playlistController_:r}=e,i=r.fastQualityChange_.bind(r);if(t.attributes){let e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes[`FRAME-RATE`]}this.codecs=Gl(r.main(),t),this.playlist=t,this.id=n,this.enabled=hp(e.playlists,t.id,i)}},_p=function(e){e.representations=()=>{let t=e.playlistController_.main(),n=wl(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return n?n.filter(e=>!hl(e)).map((t,n)=>new gp(e,t,t.id)):[]}},vp=[`seeking`,`seeked`,`pause`,`playing`,`error`],yp=class extends Z.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_=zc(`PlaybackWatcher`),this.logger_(`initialize`);let t=()=>this.monitorCurrentTime_(),n=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),i=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=[`main`,`subtitle`,`audio`],s={};o.forEach(e=>{s[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},a[`${e}SegmentLoader_`].on(`appendsdone`,s[e].updateend),a[`${e}SegmentLoader_`].on(`playlistupdate`,s[e].reset),this.tech_.on([`seeked`,`seeking`],s[e].reset)});let c=e=>{[`main`,`audio`].forEach(t=>{a[`${t}SegmentLoader_`][e](`appended`,this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),c(`off`))},this.clearSeekingAppendCheck_=()=>c(`off`),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),c(`on`)},this.tech_.on(`seeked`,this.clearSeekingAppendCheck_),this.tech_.on(`seeking`,this.watchForBadSeeking_),this.tech_.on(`waiting`,r),this.tech_.on(vp,i),this.tech_.on(`canplay`,n),this.tech_.one(`play`,t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_(`dispose`),this.tech_.off(`waiting`,r),this.tech_.off(vp,i),this.tech_.off(`canplay`,n),this.tech_.off(`play`,t),this.tech_.off(`seeking`,this.watchForBadSeeking_),this.tech_.off(`seeked`,this.clearSeekingAppendCheck_),o.forEach(e=>{a[`${e}SegmentLoader_`].off(`appendsdone`,s[e].updateend),a[`${e}SegmentLoader_`].off(`playlistupdate`,s[e].reset),this.tech_.off([`seeked`,`seeking`],s[e].reset)}),this.checkCurrentTimeTimeout_&&C.default.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&C.default.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=C.default.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){let 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){let t=this.playlistController_,n=t[`${e}SegmentLoader_`],r=n.buffered_(),i=Qc(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,i){let n={bufferedRanges:r};t.trigger({type:`bufferedrangeschanged`,metadata:n}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:n.playlist_&&n.playlist_.id,buffered:Zc(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;let e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Uc>=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(Bc([this.lastRecordedTime,e]));let t={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:`playedrangeschanged`,metadata:t}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;let e=this.seekable(),t=this.tech_.currentTime(),n=this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow),r;if(n&&(r=e.end(e.length-1)),this.beforeSeekableWindow_(e,t)){let t=e.start(0);r=t+(t===e.end(0)?0:Uc)}if(r!==void 0)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${Yc(e)}. Seeking to ${r}.`),this.tech_.setCurrentTime(r),!0;let i=this.playlistController_.sourceUpdater_,a=this.tech_.buffered(),o=i.audioBuffer?i.audioBuffered():null,s=i.videoBuffer?i.videoBuffered():null,c=this.media(),l=c.partTargetDuration?c.partTargetDuration:(c.targetDuration-Hc)*2,u=[o,s];for(let e=0;e<u.length;e++)if(u[e]&&el(u[e],t)<l)return!1;let d=Kc(a,t);return d.length===0?!1:(r=d.start(0)+Uc,this.logger_(`Buffered region starts (${d.start(0)}) just beyond seek point (${t}). Seeking to ${r}.`),this.tech_.setCurrentTime(r),!0)}waiting_(){if(this.techWaiting_())return;let e=this.tech_.currentTime(),t=Gc(this.tech_.buffered(),e);if(t.length&&e+3<=t.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${t.start(0)} -> ${t.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:`usage`,name:`vhs-unknown-waiting`});return}}techWaiting_(){let e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){let n=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${n}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:`usage`,name:`vhs-live-resync`}),!0}let n=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:`usage`,name:`vhs-video-underflow`}),!0;let i=Kc(r,t);return i.length>0?(this.logger_(`Stopped at ${t} and seeking to ${i.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,n,r=!1){if(!e.length)return!1;let i=e.end(e.length-1)+Uc,a=!n.endList,o=typeof n.partTargetDuration==`number`;return a&&(o||r)&&(i=e.end(e.length-1)+n.targetDuration*3),t>i}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:n}){if(!e)return;let r;if(e.length&&t.length){let i=Gc(e,n-3),a=Gc(e,n),o=Gc(t,n);o.length&&!a.length&&i.length&&(r={start:i.end(0),end:o.end(0)})}else Kc(e,n).length||(r=this.gapFromVideoUnderflow_(e,n));return r?(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${n}`),!0):!1}skipTheGap_(e){let t=this.tech_.buffered(),n=this.tech_.currentTime(),r=Kc(t,n);if(this.resetTimeUpdate_(),r.length===0||n!==e)return;this.logger_(`skipTheGap_:`,`currentTime:`,n,`scheduled currentTime:`,e,`nextRange start:`,r.start(0)),this.tech_.setCurrentTime(r.start(0)+Hc);let i={gapInfo:{from:n,to:r.start(0)}};this.playlistController_.trigger({type:`gapjumped`,metadata:i}),this.tech_.trigger({type:`usage`,name:`vhs-gap-skip`})}gapFromVideoUnderflow_(e,t){let n=qc(e);for(let e=0;e<n.length;e++){let r=n.start(e),i=n.end(e);if(t-r<4&&t-r>2)return{start:r,end:i}}return null}},bp={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},xp=function(e,t){let n=0,r=0,i=Q(bp,t);e.ready(()=>{e.trigger({type:`usage`,name:`vhs-error-reload-initialized`})});let a=function(){r&&e.currentTime(r)},o=function(t){t!=null&&(r=e.duration()!==1/0&&e.currentTime()||0,e.one(`loadedmetadata`,a),e.src(t),e.trigger({type:`usage`,name:`vhs-error-reload`}),e.play())},s=function(){if(Date.now()-n<i.errorInterval*1e3){e.trigger({type:`usage`,name:`vhs-error-reload-canceled`});return}if(!i.getSource||typeof i.getSource!=`function`){Z.log.error(`ERROR: reloadSourceOnError - The option getSource must be a function!`);return}return n=Date.now(),i.getSource.call(e,o)},c=function(){e.off(`loadedmetadata`,a),e.off(`error`,s),e.off(`dispose`,c)};e.on(`error`,s),e.on(`dispose`,c),e.reloadSourceOnError=function(t){c(),xp(e,t)}},Sp=function(e){xp(this,e)},Cp=`3.17.3`,wp=`7.1.0`,Tp=`1.3.1`,Ep=`7.2.0`,Dp=`4.0.2`,$={PlaylistLoader:nu,Playlist:Tl,utils:gu,STANDARD_PLAYLIST_SELECTOR:jd,INITIAL_PLAYLIST_SELECTOR:Pd,lastBandwidthSelector:jd,movingAverageBandwidthSelector:Md,comparePlaylistBandwidth:Od,comparePlaylistResolution:kd,xhr:ou()};Object.keys(Ru).forEach(e=>{Object.defineProperty($,e,{get(){return Z.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),Ru[e]},set(t){if(Z.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),typeof t!=`number`||t<0){Z.log.warn(`value of Vhs.${e} must be greater than or equal to 0`);return}Ru[e]=t}})});var Op=`videojs-vhs`,kp=function(e,t){let n=t.media(),r=-1;for(let t=0;t<e.length;t++)if(e[t].id===n.id){r=t;break}e.selectedIndex_=r,e.trigger({selectedIndex:r,type:`change`})},Ap=function(e,t){t.representations().forEach(t=>{e.addQualityLevel(t)}),kp(e,t.playlists)};$.canPlaySource=function(){return Z.log.warn(`VHS is no longer a tech. Please remove it from your player's techOrder.`)};var jp=(e,t,n)=>{if(!e)return e;let r={};t&&t.attributes&&t.attributes.CODECS&&(r=Ul(me(t.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(r.audio=n.attributes.CODECS);let i=j(r.video),a=j(r.audio),o={};for(let n in e)o[n]={},a&&(o[n].audioContentType=a),i&&(o[n].videoContentType=i),t.contentProtection&&t.contentProtection[n]&&t.contentProtection[n].pssh&&(o[n].pssh=t.contentProtection[n].pssh),typeof e[n]==`string`&&(o[n].url=e[n]);return Q(e,o)},Mp=(e,t)=>e.reduce((e,n)=>{if(!n.contentProtection)return e;let r=t.reduce((e,t)=>{let r=n.contentProtection[t];return r&&r.pssh&&(e[t]={pssh:r.pssh}),e},{});return Object.keys(r).length&&e.push(r),e},[]),Np=({player:e,sourceKeySystems:t,audioMedia:n,mainPlaylists:r})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();let i=Mp(n?r.concat([n]):r,Object.keys(t)),a=[],o=[];return i.forEach(t=>{o.push(new Promise((t,n)=>{e.tech_.one(`keysessioncreated`,t)})),a.push(new Promise((n,r)=>{e.eme.initializeMediaKeys({keySystems:t},e=>{if(e){r(e);return}n()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},Pp=({player:e,sourceKeySystems:t,media:n,audioMedia:r})=>{let i=jp(t,n,r);return i?(e.currentSource().keySystems=i,i&&!e.eme?(Z.log.warn(`DRM encrypted source cannot be decrypted without a DRM plugin`),!1):!0):!1},Fp=()=>{if(!C.default.localStorage)return null;let e=C.default.localStorage.getItem(Op);if(!e)return null;try{return JSON.parse(e)}catch{return null}},Ip=e=>{if(!C.default.localStorage)return!1;let t=Fp();t=t?Q(t,e):e;try{C.default.localStorage.setItem(Op,JSON.stringify(t))}catch{return!1}return t},Lp=e=>e.toLowerCase().indexOf(`data:application/vnd.videojs.vhs+json,`)===0?JSON.parse(e.substring(e.indexOf(`,`)+1)):e,Rp=(e,t)=>{e._requestCallbackSet||=new Set,e._requestCallbackSet.add(t)},zp=(e,t)=>{e._responseCallbackSet||=new Set,e._responseCallbackSet.add(t)},Bp=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},Vp=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};$.supportsNativeHls=function(){if(!S.default||!S.default.createElement)return!1;let e=S.default.createElement(`video`);return Z.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(e.canPlayType(t))}):!1}(),$.supportsNativeDash=function(){return!S.default||!S.default.createElement||!Z.getTech(`Html5`).isSupported()?!1:/maybe|probably/i.test(S.default.createElement(`video`).canPlayType(`application/dash+xml`))}(),$.supportsTypeNatively=e=>e===`hls`?$.supportsNativeHls:e===`dash`?$.supportsNativeDash:!1,$.isSupported=function(){return Z.log.warn(`VHS is no longer a tech. Please remove it from your player's techOrder.`)},$.xhr.onRequest=function(e){Rp($.xhr,e)},$.xhr.onResponse=function(e){zp($.xhr,e)},$.xhr.offRequest=function(e){Bp($.xhr,e)},$.xhr.offResponse=function(e){Vp($.xhr,e)};var Hp=Z.getComponent(`Component`),Up=class extends Hp{constructor(e,t,n){if(super(t,n.vhs),typeof n.initialBandwidth==`number`&&(this.options_.bandwidth=n.initialBandwidth),this.logger_=zc(`VhsHandler`),t.options_&&t.options_.playerId&&(this.player_=Z.getPlayer(t.options_.playerId)),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 Error(`Overriding native VHS requires emulated tracks. See https://git.io/vMpjB`);this.on(S.default,[`fullscreenchange`,`webkitfullscreenchange`,`mozfullscreenchange`,`MSFullscreenChange`],e=>{let t=S.default.fullscreenElement||S.default.webkitFullscreenElement||S.default.mozFullScreenElement||S.default.msFullscreenElement;t&&t.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_=Q(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=this.source_.useBandwidthFromLocalStorage===void 0?this.options_.useBandwidthFromLocalStorage||!1:this.source_.useBandwidthFromLocalStorage,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi===void 0?!0:this.options_.useNetworkInformationApi,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){let e=Fp();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:`usage`,name:`vhs-bandwidth-from-local-storage`})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:`usage`,name:`vhs-throughput-from-local-storage`}))}typeof this.options_.bandwidth!=`number`&&(this.options_.bandwidth=Ru.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ru.INITIAL_BANDWIDTH,[`withCredentials`,`useDevicePixelRatio`,`usePlayerObjectFit`,`customPixelRatio`,`limitRenditionByPlayerDimensions`,`bandwidth`,`customTagParsers`,`customTagMappers`,`cacheEncryptionKeys`,`playlistSelector`,`initialPlaylistSelector`,`bufferBasedABR`,`liveRangeSafeTimeDelta`,`llhls`,`useForcedSubtitles`,`useNetworkInformationApi`,`useDtsForTimestampOffset`,`exactManifestTimings`,`leastPixelDiffSelector`].forEach(e=>{this.source_[e]!==void 0&&(this.options_[e]=this.source_[e])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;let 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=Lp(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=$,this.options_.sourceType=xe(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.options_.player_=this.player_,this.playlistController_=new mp(this.options_),this.playbackWatcher_=new yp(Q({liveRangeSafeTimeDelta:Uc},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_})),this.attachStreamingEventListeners_(),this.playlistController_.on(`error`,()=>{let e=Z.players[this.tech_.options_.playerId],t=this.playlistController_.error;typeof t==`object`&&!t.code?t.code=3:typeof t==`string`&&(t={message:t,code:3}),e.error(t)});let n=this.options_.bufferBasedABR?$.movingAverageBandwidthSelector(.55):$.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):n.bind(this),this.playlistController_.selectInitialPlaylist=$.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(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth,t=C.default.navigator.connection||C.default.navigator.mozConnection||C.default.navigator.webkitConnection,n=1e7;if(this.options_.useNetworkInformationApi&&t){let r=t.downlink*1e3*1e3;e=r>=n&&e>=n?Math.max(e,r):r}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){let e=1/(this.bandwidth||1),t;return t=this.throughput>0?1/this.throughput:0,Math.floor(1/(e+t))},set(){Z.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:()=>Zc(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:()=>Zc(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&&Ip({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on(`selectedinitialmedia`,()=>{_p(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_=C.default.URL.createObjectURL(this.playlistController_.mediaSource),(Z.browser.IS_ANY_SAFARI||Z.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_(){let e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_(`waiting for EME key session creation`),Np({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(e=>{this.logger_(`error while creating EME key session`,e),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_(){let e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=Pp({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on(`keystatuschange`,e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on(`waitingforkey`,this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){let e=Z.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on(`selectedinitialmedia`,()=>{Ap(this.qualityLevels_,this)}),this.playlists.on(`mediachange`,()=>{kp(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Cp,"mux.js":wp,"mpd-parser":Tp,"m3u8-parser":Ep,"aes-decrypter":Dp}}version(){return this.constructor.version()}canChangeType(){return Of.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_&&C.default.URL.revokeObjectURL&&(C.default.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off(`waitingforkey`,this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return wu({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,n=!0,r=2){return Tu({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{Rp(this.xhr,e)},this.xhr.onResponse=e=>{zp(this.xhr,e)},this.xhr.offRequest=e=>{Bp(this.xhr,e)},this.xhr.offResponse=e=>{Vp(this.xhr,e)},this.player_.trigger(`xhr-hooks-ready`)}attachStreamingEventListeners_(){[`seekablerangeschanged`,`bufferedrangeschanged`,`contentsteeringloadstart`,`contentsteeringloadcomplete`,`contentsteeringparsed`].forEach(e=>{this.playlistController_.on(e,e=>{this.player_.trigger(w({},e))})}),[`gapjumped`,`playedrangeschanged`].forEach(e=>{this.playbackWatcher_.on(e,e=>{this.player_.trigger(w({},e))})})}},Wp={name:`videojs-http-streaming`,VERSION:Cp,canHandleSource(e,t={}){let n=Q(Z.options,t);return!n.vhs.experimentalUseMMS&&!ve(`avc1.4d400d,mp4a.40.2`,!1)?!1:Wp.canPlayType(e.type,n)},handleSource(e,t,n={}){return t.vhs=new Up(e,t,Q(Z.options,n)),t.vhs.xhr=ou(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){let n=xe(e);if(!n)return``;let r=Wp.getOverrideNative(t);return!$.supportsTypeNatively(n)||r?`maybe`:``},getOverrideNative(e={}){let{vhs:t={}}=e,n=!(Z.browser.IS_ANY_SAFARI||Z.browser.IS_IOS),{overrideNative:r=n}=t;return r}};ve(`avc1.4d400d,mp4a.40.2`,!0)&&Z.getTech(`Html5`).registerSourceHandler(Wp,0),Z.VhsHandler=Up,Z.VhsSourceHandler=Wp,Z.Vhs=$,Z.use||Z.registerComponent(`Vhs`,$),Z.options.vhs=Z.options.vhs||{},(!Z.getPlugin||!Z.getPlugin(`reloadSourceOnError`))&&Z.registerPlugin(`reloadSourceOnError`,Sp);var Gp=`0.5, 1, 1.5, 2`;function Kp(e){let t=e.getChild(`ControlBar`),n=t.getChild(`CurrentTimeDisplay`),r=t.getChild(`ProgressControl`),i=t.getChild(`DurationDisplay`),a=t.getChild(`TimeDivider`);t.removeChild(r),t.removeChild(n),t.removeChild(a),t.removeChild(i),t.addChild(n,{},0),t.addChild(r,{},1),t.addChild(i,{},2)}var qp=class extends e.t(t.t){constructor(...e){super(...e),this.autoplay=!1,this.loop=!1,this.playbackRates=Gp,this.skipBy=i.r.Ten}srcChanged(){this.#u()}autoplayChanged(){this._player&&this.#u()}skipByChanged(){this._player&&this.#u()}#e;connectedCallback(){super.connectedCallback(),this.#u()}disconnectedCallback(){super.connectedCallback(),this.#i()}#t(){let e=this.querySelectorAll(`source`);if(!(e.length===0&&!this.src))return this.src?[{src:this.src}]:Array.from(e).map(e=>({src:e.getAttribute(`src`),type:e.getAttribute(`type`)}))}#n(){let e=this.#t(),t=parseInt(this.skipBy);return{languages:{current:this.locale.videoPlayer},sources:e,poster:this.poster,muted:this.autoplay,playbackRates:a.t(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#r(){return this.shadowRoot.getElementById(`no-sources`)}#i(){this._player&&this._player.dispose()}#a(){this.#e=document.createElement(`video`);let 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.#o.appendChild(this.#e)}get#o(){return this.shadowRoot.querySelector(`.control`)}#s(e=!0){this.#r?.classList.toggle(`vjs-hidden`,e)}#c(e){this._player=Z(this.#e,e),this.shadowRoot.querySelector(`[lang]`).removeAttribute(`lang`)}#l(){this._player.on(`play`,()=>this.$emit(`play`)),this._player.on(`pause`,()=>this.$emit(`pause`)),this._player.on(`ended`,()=>this.$emit(`ended`))}#u(){this.#i();let e=this.#n();e.sources&&this.#o&&this.#r?(this.#s(),this.#a(),this.#c(e),Kp(this._player),this.#l()):this.#s(!1)}};n.t([t.l],qp.prototype,`poster`,void 0),n.t([t.l],qp.prototype,`src`,void 0),n.t([t.l({mode:`boolean`})],qp.prototype,`autoplay`,void 0),n.t([t.l({mode:`boolean`})],qp.prototype,`loop`,void 0),n.t([t.l({attribute:`playback-rates`,mode:`fromView`})],qp.prototype,`playbackRates`,void 0),n.t([t.l({attribute:`skip-by`,mode:`fromView`})],qp.prototype,`skipBy`,void 0);function Jp(){return t.d`
204
209
  <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
205
210
  <defs>
206
211
  <symbol viewBox="0 0 24 24" id="vjs-icon-play">
@@ -507,9 +512,9 @@ ${Ji(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),
507
512
  </symbol>
508
513
  </defs>
509
514
  </svg>
510
- `}const ay=s=>Yp.classNames("control"),oy=Ve.html`
515
+ `}var Yp=t.d`
511
516
  <div
512
- class="${ay} video-js vjs-16-9 vjs-working-hover vjs-theme-vivid"
517
+ class="${e=>r.t(`control`)} video-js vjs-16-9 vjs-working-hover vjs-theme-vivid"
513
518
  >
514
519
  <div id="no-sources" class="vjs-error-display vjs-modal-dialog vjs-hidden">
515
520
  <div class="vjs-modal-dialog-content">
@@ -517,6 +522,6 @@ ${Ji(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),
517
522
  </div>
518
523
  </div>
519
524
  <slot></slot>
520
- ${ny()}
525
+ ${Jp()}
521
526
  </div>
522
- `,ly=Ve.defineVividComponent("video-player",zi,oy,[],{styles:Kp}),uy=Ve.createRegisterFunction(ly);uy();
527
+ `,Xp=t.o(`video-player`,qp,Yp,[],{styles:o});t.s(Xp)();