@x-edu/live-player 0.0.19 → 0.0.21

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 (302) hide show
  1. package/.browserslistrc +10 -10
  2. package/.eslintignore +8 -8
  3. package/.eslintrc.js +26 -26
  4. package/.gem-mine +11 -11
  5. package/.postcssrc.js +6 -6
  6. package/README.md +145 -145
  7. package/babel.config.js +33 -33
  8. package/dist/XEduLivePlayer.common.js +12161 -1154
  9. package/dist/XEduLivePlayerPre.common.js +12369 -1358
  10. package/doc/develop.md +23 -23
  11. package/gem-mine.config.js +86 -86
  12. package/jest.config.js +9 -9
  13. package/jsconfig.json +15 -15
  14. package/mock/helper.js +8 -8
  15. package/mock/index.js +34 -34
  16. package/package.json +99 -99
  17. package/public/3rd/ali-player/alipayercomponents-1.0.8.min.js +26 -26
  18. package/public/3rd/ali-player/aliplayer-hls-min.js +27 -27
  19. package/public/3rd/ali-player/aliplayer-min.js +1 -1
  20. package/public/3rd/im-web-push/index.umd.js +14 -14
  21. package/public/JsBridge.js +1602 -1602
  22. package/public/fish/editor/themes/default/css/ueditor.css +1905 -1905
  23. package/public/fish/editor/third-party/codemirror/codemirror.css +104 -104
  24. package/public/fish/editor/third-party/codemirror/codemirror.js +3581 -3581
  25. package/public/fish/editor/third-party/zeroclipboard/ZeroClipboard.js +1255 -1255
  26. package/public/fish/editor/ueditor.all.min.js +16 -16
  27. package/public/fish/editor/ueditor.config.js +467 -467
  28. package/public/fish/icon/umd-4.1.2.js +1 -1
  29. package/public/fish/video/videoplayer.min.css +6 -6
  30. package/public/fish/video/videoplayer.min.js +31 -31
  31. package/public/fish/video/zh-CN.js +82 -82
  32. package/public/icon/demo.css +539 -539
  33. package/public/icon/demo_index.html +2189 -2189
  34. package/public/icon/iconfont.css +363 -363
  35. package/public/icon/iconfont.json +618 -618
  36. package/public/index.html +50 -50
  37. package/script/image/readme.md +77 -77
  38. package/script/postcss.js +48 -48
  39. package/src/App.jsx +24 -24
  40. package/src/asset/img/course/playing.svg +21 -21
  41. package/src/asset/img/icon-course-white.svg +3 -3
  42. package/src/asset/img/icon-course.svg +3 -3
  43. package/src/asset/img/icon-eye-white.svg +4 -4
  44. package/src/asset/img/icon-eye.svg +4 -4
  45. package/src/asset/img/icon-school-white.svg +3 -3
  46. package/src/asset/img/icon-school.svg +3 -3
  47. package/src/asset/img/loading.svg +52 -52
  48. package/src/asset/img/video-play.svg +6 -6
  49. package/src/asset/style/background.less +19 -19
  50. package/src/asset/style/banner.less +36 -36
  51. package/src/asset/style/base.less +74 -74
  52. package/src/asset/style/index.less +114 -114
  53. package/src/asset/style/reset-theme.less +141 -141
  54. package/src/asset/style/theme/index.less +55 -55
  55. package/src/asset/style/theme/party/global.less +20 -20
  56. package/src/asset/style/theme/party/override.less +57 -57
  57. package/src/asset/style/theme/test/global.less +18 -18
  58. package/src/asset/style/theme/test/override.less +45 -45
  59. package/src/asset/style/variable.less +12 -12
  60. package/src/component/AliPlayer/index.jsx +49 -49
  61. package/src/component/Avatar/index.jsx +50 -50
  62. package/src/component/Empty/index.jsx +34 -34
  63. package/src/component/Empty/index.module.less +37 -37
  64. package/src/component/IMChatroom/component/status/403.jsx +13 -13
  65. package/src/component/IMChatroom/component/status/404.jsx +13 -13
  66. package/src/component/IMChatroom/component/status/Error.jsx +23 -23
  67. package/src/component/IMChatroom/component/status/Loading.jsx +5 -5
  68. package/src/component/IMChatroom/config/app/config.js +118 -118
  69. package/src/component/IMChatroom/config/app/index.js +60 -60
  70. package/src/component/IMChatroom/config/env.js +5 -5
  71. package/src/component/IMChatroom/config/index.js +3 -3
  72. package/src/component/IMChatroom/config/request/config/base.js +124 -124
  73. package/src/component/IMChatroom/config/request/config/chatroom.js +26 -26
  74. package/src/component/IMChatroom/config/request/config/imCoreApi.js +21 -21
  75. package/src/component/IMChatroom/config/request/index.js +21 -21
  76. package/src/component/IMChatroom/config/request/proxy.js +39 -39
  77. package/src/component/IMChatroom/config/url.js +7 -7
  78. package/src/component/IMChatroom/constants/errorCode.js +9 -9
  79. package/src/component/IMChatroom/constants/index.js +84 -84
  80. package/src/component/IMChatroom/constants/origin.js +27 -27
  81. package/src/component/IMChatroom/context/chatroom.js +154 -154
  82. package/src/component/IMChatroom/context/connect.js +28 -28
  83. package/src/component/IMChatroom/i18n/en/index.json +73 -73
  84. package/src/component/IMChatroom/i18n/index.jsx +14 -14
  85. package/src/component/IMChatroom/i18n/language.js +9 -9
  86. package/src/component/IMChatroom/i18n/zh-CN/index.json +73 -73
  87. package/src/component/IMChatroom/index.jsx +49 -49
  88. package/src/component/IMChatroom/page/chat/index.jsx +27 -27
  89. package/src/component/IMChatroom/page/chat/messageEditor/index.jsx +375 -375
  90. package/src/component/IMChatroom/page/chat/messageList/index.jsx +354 -354
  91. package/src/component/IMChatroom/page/chat/stickedMessage/index.jsx +59 -59
  92. package/src/component/IMChatroom/page/chat/stickedMessage/style/index.module.less +7 -7
  93. package/src/component/IMChatroom/page/chat/style/index.module.less +51 -51
  94. package/src/component/IMChatroom/page/home/connect/index.jsx +188 -188
  95. package/src/component/IMChatroom/page/home/connect/status.jsx +124 -124
  96. package/src/component/IMChatroom/page/home/context/cmd.jsx +37 -37
  97. package/src/component/IMChatroom/page/home/context/index.jsx +67 -67
  98. package/src/component/IMChatroom/page/home/index.jsx +164 -164
  99. package/src/component/IMChatroom/page/home/notice/index.jsx +123 -123
  100. package/src/component/IMChatroom/page/home/notice/style/index.module.less +49 -49
  101. package/src/component/IMChatroom/page/home/style/index.module.less +110 -110
  102. package/src/component/IMChatroom/page/member/index.jsx +15 -15
  103. package/src/component/IMChatroom/page/member/memberCount/index.jsx +44 -44
  104. package/src/component/IMChatroom/page/member/memberList/index.jsx +121 -121
  105. package/src/component/IMChatroom/page/member/style/index.module.less +2 -2
  106. package/src/component/IMChatroom/sdk/bridge.js +39 -39
  107. package/src/component/IMChatroom/sdk/cs/constants.js +20 -20
  108. package/src/component/IMChatroom/sdk/cs/index.js +101 -101
  109. package/src/component/IMChatroom/sdk/imChatroom.js +15 -15
  110. package/src/component/IMChatroom/sdk/imcore/constants.js +128 -128
  111. package/src/component/IMChatroom/sdk/imcore/emitters/chatroomDestroyed.js +5 -5
  112. package/src/component/IMChatroom/sdk/imcore/emitters/chatroomInfoGetFail.js +5 -5
  113. package/src/component/IMChatroom/sdk/imcore/emitters/chatroomKickedByAdmin.js +5 -5
  114. package/src/component/IMChatroom/sdk/imcore/emitters/chatroomKickedBySelf.js +5 -5
  115. package/src/component/IMChatroom/sdk/imcore/emitters/chatroomLoginFail.js +5 -5
  116. package/src/component/IMChatroom/sdk/imcore/emitters/chatroomLoginSuccess.js +5 -5
  117. package/src/component/IMChatroom/sdk/imcore/emitters/chatroomMemberLogin.js +5 -5
  118. package/src/component/IMChatroom/sdk/imcore/emitters/chatroomMemberLogout.js +5 -5
  119. package/src/component/IMChatroom/sdk/imcore/emitters/connectionConnected.js +5 -5
  120. package/src/component/IMChatroom/sdk/imcore/emitters/connectionConnecting.js +5 -5
  121. package/src/component/IMChatroom/sdk/imcore/emitters/connectionDisconnect.js +5 -5
  122. package/src/component/IMChatroom/sdk/imcore/emitters/index.js +57 -57
  123. package/src/component/IMChatroom/sdk/imcore/emitters/messageReceive.js +36 -36
  124. package/src/component/IMChatroom/sdk/imcore/index.js +178 -178
  125. package/src/component/IMChatroom/sdk/imcore/interceptors/request.js +7 -7
  126. package/src/component/IMChatroom/sdk/imcore/interceptors/response.js +5 -5
  127. package/src/component/IMChatroom/sdk/imcore/plugins/getAuth.js +64 -64
  128. package/src/component/IMChatroom/sdk/imcore/plugins/getConversationId.js +20 -20
  129. package/src/component/IMChatroom/sdk/imcore/plugins/getExtInfo.js +10 -10
  130. package/src/component/IMChatroom/sdk/imcore/plugins/getLoginInfo.js +48 -48
  131. package/src/component/IMChatroom/sdk/imcore/plugins/getPlatformType.js +12 -12
  132. package/src/component/IMChatroom/sdk/imcore/plugins/index.js +22 -22
  133. package/src/component/IMChatroom/sdk/imcore/util/format.js +177 -177
  134. package/src/component/IMChatroom/sdk/imcore/util/parser.js +35 -35
  135. package/src/component/IMChatroom/sdk/oms.js +18 -18
  136. package/src/component/IMChatroom/sdk/uc.js +3 -3
  137. package/src/component/IMChatroom/subscription/channel/app.js +5 -5
  138. package/src/component/IMChatroom/subscription/channel/ctl.js +22 -22
  139. package/src/component/IMChatroom/subscription/channel/member.js +40 -40
  140. package/src/component/IMChatroom/subscription/channel/message.js +13 -13
  141. package/src/component/IMChatroom/subscription/channel/ntf.js +86 -86
  142. package/src/component/IMChatroom/subscription/channel/tel.js +5 -5
  143. package/src/component/IMChatroom/subscription/channel/websocket.js +5 -5
  144. package/src/component/IMChatroom/subscription/event.js +37 -37
  145. package/src/component/IMChatroom/subscription/index.js +19 -19
  146. package/src/component/IMChatroom/util/account.js +8 -8
  147. package/src/component/IMChatroom/util/chatroom.js +255 -255
  148. package/src/component/IMChatroom/util/jsonBigInt.js +5 -5
  149. package/src/component/IMChatroom/util/location.js +12 -12
  150. package/src/component/Icon/index.jsx +16 -16
  151. package/src/component/Icon/index.module.less +2 -2
  152. package/src/component/Pagination/LocalPagination.jsx +27 -27
  153. package/src/component/Pagination/RemotePagination.jsx +32 -32
  154. package/src/component/Pagination/index.jsx +31 -31
  155. package/src/component/Pagination/index.module.less +110 -110
  156. package/src/component/PlayerTip/index.jsx +34 -34
  157. package/src/component/VideoBase/index.jsx +242 -242
  158. package/src/component/VideoBase/style.less +65 -65
  159. package/src/component/VideoBase/utils.js +81 -81
  160. package/src/component/mixin.less +9 -9
  161. package/src/component/status/403.jsx +15 -15
  162. package/src/component/status/404/index.jsx +73 -73
  163. package/src/component/status/404/index.module.less +36 -36
  164. package/src/component/status/Error/error.module.less +13 -13
  165. package/src/component/status/Error/index.jsx +47 -47
  166. package/src/component/status/Loading/img/loading.svg +52 -52
  167. package/src/component/status/Loading/index.jsx +31 -31
  168. package/src/component/status/Loading/index.less +56 -56
  169. package/src/component/status/None/index.jsx +20 -20
  170. package/src/component/status/None/index.module.less +35 -35
  171. package/src/component/status/Status/index.jsx +26 -26
  172. package/src/component/status/Status/index.module.less +8 -8
  173. package/src/config/constant/commonUrl.js +2 -2
  174. package/src/config/constant/user.js +6 -6
  175. package/src/config/context/site-config.js +48 -48
  176. package/src/config/env/index.js +5 -5
  177. package/src/config/env/local/index.js +13 -13
  178. package/src/config/env/ncet-xedu/api.js +175 -175
  179. package/src/config/env/ncet-xedu/app.js +12 -12
  180. package/src/config/env/ncet-xedu/cs.js +8 -8
  181. package/src/config/env/ncet-xedu/index.js +14 -14
  182. package/src/config/env/ncet-xedu/push.js +5 -5
  183. package/src/config/env/preproduction/api.js +144 -144
  184. package/src/config/env/preproduction/app.js +12 -12
  185. package/src/config/env/preproduction/cs.js +8 -8
  186. package/src/config/env/preproduction/index.js +14 -14
  187. package/src/config/env/preproduction/push.js +5 -5
  188. package/src/config/env/product/api.js +113 -113
  189. package/src/config/env/product/app.js +12 -12
  190. package/src/config/env/product/cs.js +5 -5
  191. package/src/config/env/product/index.js +14 -14
  192. package/src/config/env/product/push.js +5 -5
  193. package/src/config/live.js +80 -80
  194. package/src/config/publicLive.js +53 -53
  195. package/src/config/request/assessments.js +24 -24
  196. package/src/config/request/config-center.js +8 -8
  197. package/src/config/request/helper.js +166 -166
  198. package/src/config/request/im-broadcasts.js +12 -12
  199. package/src/config/request/live-activity-gateway.js +8 -8
  200. package/src/config/request/live-activity.js +13 -13
  201. package/src/config/request/raw.js +6 -6
  202. package/src/config/request/x-cloud-web.js +13 -13
  203. package/src/config/request/x-proxy.js +34 -34
  204. package/src/demo/Detail.jsx +11 -11
  205. package/src/demo/List.jsx +64 -64
  206. package/src/demo/index.jsx +17 -17
  207. package/src/detail/LineSwitch/index.jsx +71 -71
  208. package/src/detail/LiveCountDown/index.jsx +44 -44
  209. package/src/detail/LiveCountDown/index.module.less +31 -31
  210. package/src/detail/LiveOnlineCount/img/icon.svg +15 -15
  211. package/src/detail/LiveOnlineCount/index.jsx +68 -68
  212. package/src/detail/LiveOnlineCount/index.module.less +34 -34
  213. package/src/detail/LiveOnlineCount/util.js +74 -74
  214. package/src/detail/LiveStatus/AnchorOnTheWay.jsx +88 -88
  215. package/src/detail/LiveStatus/index.jsx +202 -202
  216. package/src/detail/LiveStatus/index.module.less +192 -192
  217. package/src/detail/LiveVideo/config.js +37 -37
  218. package/src/detail/LiveVideo/index.jsx +188 -188
  219. package/src/detail/LiveVideo/index.module.less +41 -41
  220. package/src/detail/NotLoginChatroom/index.jsx +37 -37
  221. package/src/detail/NotLoginChatroom/index.module.less +46 -46
  222. package/src/detail/RecordVideo/index.jsx +150 -150
  223. package/src/detail/RecordVideo/index.module.less +31 -31
  224. package/src/detail/ReplayVideo/index.jsx +93 -93
  225. package/src/detail/ReplayVideo/index.module.less +65 -65
  226. package/src/detail/const.js +20 -20
  227. package/src/detail/hook/usePullSource.js +82 -82
  228. package/src/detail/hook/usePullState.js +51 -51
  229. package/src/detail/index.jsx +482 -482
  230. package/src/detail/index.module.less +188 -188
  231. package/src/hook/useAsync.js +84 -84
  232. package/src/hook/useGoToPage.js +83 -83
  233. package/src/hook/useInterval.js +28 -28
  234. package/src/hook/useIsMounted.js +17 -17
  235. package/src/hook/useModuleByRole.js +53 -53
  236. package/src/hook/usePageScrollable.js +52 -52
  237. package/src/hook/usePortal.js +83 -83
  238. package/src/hook/useScrollRestore/index.js +32 -32
  239. package/src/hook/useScrollRestore/scrollContext.js +20 -20
  240. package/src/hook/useTrackRef.js +11 -11
  241. package/src/hook/useWindowSize.js +28 -28
  242. package/src/hook/useZoom.js +47 -47
  243. package/src/index.js +10 -10
  244. package/src/lib/getLiveOnlineCount.js +10 -10
  245. package/src/lib/getServiceConfig.js +102 -102
  246. package/src/list/Empty/index.jsx +20 -20
  247. package/src/list/Empty/index.module.less +23 -23
  248. package/src/list/ListItem/Action/index.jsx +98 -98
  249. package/src/list/ListItem/Action/index.module.less +21 -21
  250. package/src/list/ListItem/img/dianzan.svg +4 -0
  251. package/src/list/ListItem/img/play.svg +15 -15
  252. package/src/list/ListItem/img/yiguankan.svg +3 -0
  253. package/src/list/ListItem/index.jsx +24 -1
  254. package/src/list/ListItem/index.module.less +146 -123
  255. package/src/list/index.jsx +80 -0
  256. package/src/list/index.module.less +35 -35
  257. package/src/service/common.js +73 -73
  258. package/src/service/content-mgr.js +73 -73
  259. package/src/service/im-group.js +12 -12
  260. package/src/service/im.js +7 -7
  261. package/src/service/imBroadcasts.js +33 -33
  262. package/src/service/like.js +134 -134
  263. package/src/service/manageApi.js +7 -7
  264. package/src/service/managePortal.js +6 -6
  265. package/src/service/myStudyRecord.js +93 -93
  266. package/src/service/navigation.js +47 -47
  267. package/src/service/ndMeeting.js +10 -10
  268. package/src/service/ndr.js +122 -122
  269. package/src/service/news.js +93 -93
  270. package/src/service/personalCenter.js +270 -270
  271. package/src/service/qualityCourse.js +31 -31
  272. package/src/service/recommend.js +81 -81
  273. package/src/service/school.js +323 -323
  274. package/src/service/search.js +170 -170
  275. package/src/service/site-config.js +7 -7
  276. package/src/service/socialCensor.js +45 -45
  277. package/src/service/specialEdu.js +31 -31
  278. package/src/service/suggestion.js +85 -85
  279. package/src/service/syncClassroom.js +321 -321
  280. package/src/service/tCourse.js +204 -204
  281. package/src/service/tchTraining.js +37 -37
  282. package/src/service/uc.js +45 -45
  283. package/src/util/app.js +1 -1
  284. package/src/util/array.js +3 -3
  285. package/src/util/auth/func.js +57 -57
  286. package/src/util/date.js +53 -53
  287. package/src/util/env.js +9 -9
  288. package/src/util/getTimestamp.js +10 -10
  289. package/src/util/hof.js +105 -105
  290. package/src/util/live/index.js +42 -42
  291. package/src/util/liveCountUtil.js +52 -0
  292. package/src/util/netUrl.js +35 -35
  293. package/src/util/object.js +13 -13
  294. package/src/util/push/index.js +58 -58
  295. package/src/util/request.js +227 -227
  296. package/src/util/type.js +17 -17
  297. package/src/util/url.js +203 -203
  298. package/src/util/video.js +26 -26
  299. package/test/setup.js +21 -21
  300. package/test/unit/component/header/logo.spec.jsx +8 -8
  301. package/test/unit/helper.jsx +25 -25
  302. package/test/unit/util/date.spec.js +40 -40
@@ -1,32 +1,32 @@
1
- /*!
2
- *
3
- * videoplayer v0.2.18
4
- *
5
- */
6
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.videoplayer=t():e.videoplayer=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=15)}([function(e,t,n){/**
7
- * @license
8
- * Video.js 6.13.0 <http://videojs.com/>
9
- * Copyright Brightcove, Inc. <https://www.brightcove.com/>
10
- * Available under Apache License Version 2.0
11
- * <https://github.com/videojs/video.js/blob/master/LICENSE>
12
- *
13
- * Includes vtt.js <https://github.com/mozilla/vtt.js>
14
- * Available under Apache License Version 2.0
15
- * <https://github.com/mozilla/vtt.js/blob/master/LICENSE>
16
- */
17
- function i(e){return e&&"object"==typeof e&&"default"in e?e.default:e}function r(e,t){mt(e).forEach(function(n){return t(e[n],n)})}function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return mt(e).reduce(function(n,i){return t(n,e[i],i)},n)}function s(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Object.assign?Object.assign.apply(Object,[e].concat(n)):(n.forEach(function(t){t&&r(t,function(t,n){e[n]=t})}),e)}function o(e){return!!e&&"object"===(void 0===e?"undefined":lt(e))}function u(e){return o(e)&&"[object Object]"===ft.call(e)&&e.constructor===Object}function l(e){var t="info",n=void 0,i=function e(){for(var i=e.stringify||it&&it<11,r=arguments.length,a=Array(r),s=0;s<r;s++)a[s]=arguments[s];n("log",t,a,i)};return n=yt(e,i),i.createLogger=function(t){return l(e+": "+t)},i.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:t},i.level=function(e){if("string"==typeof e){if(!i.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');t=e}return t},i.history=function(){return gt?[].concat(gt):[]},i.history.filter=function(e){return(gt||[]).filter(function(t){return new RegExp(".*"+e+".*").test(t[0])})},i.history.clear=function(){gt&&(gt.length=0)},i.history.disable=function(){null!==gt&&(gt.length=0,gt=null)},i.history.enable=function(){null===gt&&(gt=[])},i.error=function(){for(var e=arguments.length,i=Array(e),r=0;r<e;r++)i[r]=arguments[r];return n("error",t,i)},i.warn=function(){for(var e=arguments.length,i=Array(e),r=0;r<e;r++)i[r]=arguments[r];return n("warn",t,i)},i.debug=function(){for(var e=arguments.length,i=Array(e),r=0;r<e;r++)i[r]=arguments[r];return n("debug",t,i)},i}function c(e,t){if(!e||!t)return"";if("function"==typeof De.getComputedStyle){var n=De.getComputedStyle(e);return n?n[t]:""}return e.currentStyle[t]||""}function d(e){return"string"==typeof e&&/\S/.test(e)}function h(e){if(/\s/.test(e))throw new Error("class has illegal whitespace characters")}function p(e){return new RegExp("(^|\\s)"+e+"($|\\s)")}function f(){return Re===De.document&&void 0!==Re.createElement}function m(e){return o(e)&&1===e.nodeType}function g(){try{return De.parent!==De.self}catch(e){return!0}}function y(e){return function(t,n){if(!d(t))return Re[e](null);d(n)&&(n=Re.querySelector(n));var i=m(n)?n:Re;return i[e]&&i[e](t)}}function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments[3],r=Re.createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){var n=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(vt.warn(Me(bt,e,n)),r.setAttribute(e,n)):"textContent"===e?_(r,n):r[e]=n}),Object.getOwnPropertyNames(n).forEach(function(e){r.setAttribute(e,n[e])}),i&&B(r,i),r}function _(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function b(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function T(e,t){return h(t),e.classList?e.classList.contains(t):p(t).test(e.className)}function S(e,t){return e.classList?e.classList.add(t):T(e,t)||(e.className=(e.className+" "+t).trim()),e}function E(e,t){return e.classList?e.classList.remove(t):(h(t),e.className=e.className.split(/\s+/).filter(function(e){return e!==t}).join(" ")),e}function w(e,t,n){var i=T(e,t);if("function"==typeof n&&(n=n(e,t)),"boolean"!=typeof n&&(n=!i),n!==i)return n?S(e,t):E(e,t),e}function k(e,t){Object.getOwnPropertyNames(t).forEach(function(n){var i=t[n];null===i||void 0===i||!1===i?e.removeAttribute(n):e.setAttribute(n,!0===i?"":i)})}function C(e){var t={};if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,i=n.length-1;i>=0;i--){var r=n[i].name,a=n[i].value;"boolean"!=typeof e[r]&&-1===",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+r+",")||(a=null!==a),t[r]=a}return t}function A(e,t){return e.getAttribute(t)}function I(e,t,n){e.setAttribute(t,n)}function x(e,t){e.removeAttribute(t)}function P(){Re.body.focus(),Re.onselectstart=function(){return!1}}function O(){Re.onselectstart=function(){return!0}}function L(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach(function(e){void 0!==t[e]&&(n[e]=t[e])}),n.height||(n.height=parseFloat(c(e,"height"))),n.width||(n.width=parseFloat(c(e,"width"))),n}}function D(e){var t=void 0;if(e.getBoundingClientRect&&e.parentNode&&(t=e.getBoundingClientRect()),!t)return{left:0,top:0};var n=Re.documentElement,i=Re.body,r=n.clientLeft||i.clientLeft||0,a=De.pageXOffset||i.scrollLeft,s=t.left+a-r,o=n.clientTop||i.clientTop||0,u=De.pageYOffset||i.scrollTop,l=t.top+u-o;return{left:Math.round(s),top:Math.round(l)}}function R(e,t){var n={},i=D(e),r=e.offsetWidth,a=e.offsetHeight,s=i.top,o=i.left,u=t.pageY,l=t.pageX;return t.changedTouches&&(l=t.changedTouches[0].pageX,u=t.changedTouches[0].pageY),n.y=Math.max(0,Math.min(1,(s-u+a)/a)),n.x=Math.max(0,Math.min(1,(l-o)/r)),n}function M(e){return o(e)&&3===e.nodeType}function N(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function U(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return"function"==typeof e&&(e=e()),m(e)||M(e)?e:"string"==typeof e&&/\S/.test(e)?Re.createTextNode(e):void 0}).filter(function(e){return e})}function B(e,t){return U(t).forEach(function(t){return e.appendChild(t)}),e}function j(e,t){return B(N(e),t)}function F(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||(9===it||0===e.button&&1===e.buttons))}function H(){return wt++}function q(e){var t=e[Ct];return t||(t=e[Ct]=H()),kt[t]||(kt[t]={}),kt[t]}function V(e){var t=e[Ct];return!!t&&!!Object.getOwnPropertyNames(kt[t]).length}function W(e){var t=e[Ct];if(t){delete kt[t];try{delete e[Ct]}catch(t){e.removeAttribute?e.removeAttribute(Ct):e[Ct]=null}}}function G(e,t){var n=q(e);0===n.handlers[t].length&&(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),0===Object.getOwnPropertyNames(n).length&&W(e)}function z(e,t,n,i){n.forEach(function(n){e(t,n,i)})}function X(e){function t(){return!0}function n(){return!1}if(!e||!e.isPropagationStopped){var i=e||De.event;e={};for(var r in i)"layerX"!==r&&"layerY"!==r&&"keyLocation"!==r&&"webkitMovementX"!==r&&"webkitMovementY"!==r&&("returnValue"===r&&i.preventDefault||(e[r]=i[r]));if(e.target||(e.target=e.srcElement||Re),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){i.preventDefault&&i.preventDefault(),e.returnValue=!1,i.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),e.cancelBubble=!0,i.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=n,e.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=n,null!==e.clientX&&void 0!==e.clientX){var a=Re.documentElement,s=Re.body;e.pageX=e.clientX+(a&&a.scrollLeft||s&&s.scrollLeft||0)-(a&&a.clientLeft||s&&s.clientLeft||0),e.pageY=e.clientY+(a&&a.scrollTop||s&&s.scrollTop||0)-(a&&a.clientTop||s&&s.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e}function Y(e,t,n){if(Array.isArray(t))return z(Y,e,t,n);var i=q(e);if(i.handlers||(i.handlers={}),i.handlers[t]||(i.handlers[t]=[]),n.guid||(n.guid=H()),i.handlers[t].push(n),i.dispatcher||(i.disabled=!1,i.dispatcher=function(t,n){if(!i.disabled){t=X(t);var r=i.handlers[t.type];if(r)for(var a=r.slice(0),s=0,o=a.length;s<o&&!t.isImmediatePropagationStopped();s++)try{a[s].call(e,t,n)}catch(e){vt.error(e)}}}),1===i.handlers[t].length)if(e.addEventListener){var r=!1;At&&It.indexOf(t)>-1&&(r={passive:!0}),e.addEventListener(t,i.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,i.dispatcher)}function K(e,t,n){if(V(e)){var i=q(e);if(i.handlers){if(Array.isArray(t))return z(K,e,t,n);var r=function(e,t){i.handlers[t]=[],G(e,t)};if(void 0!==t){var a=i.handlers[t];if(a){if(!n)return void r(e,t);if(n.guid)for(var s=0;s<a.length;s++)a[s].guid===n.guid&&a.splice(s--,1);G(e,t)}}else for(var o in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},o)&&r(e,o)}}}function Q(e,t,n){var i=V(e)?q(e):{},r=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=X(t),i.dispatcher&&i.dispatcher.call(e,t,n),r&&!t.isPropagationStopped()&&!0===t.bubbles)Q.call(null,r,t,n);else if(!r&&!t.defaultPrevented){var a=q(t.target);t.target[t.type]&&(a.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),a.disabled=!1)}return!t.defaultPrevented}function $(e,t,n){if(Array.isArray(t))return z($,e,t,n);var i=function i(){K(e,t,i),n.apply(this,arguments)};i.guid=n.guid=n.guid||H(),Y(e,t,i)}function J(e,t){t&&(Ot=t),De.setTimeout(Lt,e)}function Z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.eventBusKey;if(n){if(!e[n].nodeName)throw new Error('The eventBusKey "'+n+'" does not refer to an element.');e.eventBusEl_=e[n]}else e.eventBusEl_=v("span",{className:"vjs-event-bus"});return s(e,zt),e.on("dispose",function(){e.off(),De.setTimeout(function(){e.eventBusEl_=null},0)}),e}function ee(e,t){return s(e,Xt),e.state=s({},e.state,t),"function"==typeof e.handleStateChanged&&jt(e)&&e.on("statechanged",e.handleStateChanged),e}function te(e){return"string"!=typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}function ne(e,t){return te(e)===te(t)}function ie(){for(var e={},t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return n.forEach(function(t){t&&r(t,function(t,n){if(!u(t))return void(e[n]=t);u(e[n])||(e[n]={}),e[n]=ie(e[n],t)})}),e}function re(e,t,n){if("number"!=typeof t||t<0||t>n)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+n+").")}function ae(e,t,n,i){return re(e,i,n.length-1),n[i][t]}function se(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:ae.bind(null,"start",0,e),end:ae.bind(null,"end",1,e)}}function oe(e,t){return Array.isArray(e)?se(e):void 0===e||void 0===t?se():se([[e,t]])}function ue(e,t){var n=0,i=void 0,r=void 0;if(!t)return 0;e&&e.length||(e=oe(0,0));for(var a=0;a<e.length;a++)i=e.start(a),r=e.end(a),r>t&&(r=t),n+=r-i;return n/t}function le(e){if(e instanceof le)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:o(e)&&("number"==typeof e.code&&(this.code=e.code),s(this,e)),this.message||(this.message=le.defaultMessages[this.code]||"")}function ce(e){return void 0!==e&&null!==e&&"function"==typeof e.then}function de(e){ce(e)&&e.then(null,function(e){})}function he(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=e.textTracks();r.kind=t,n&&(r.label=n),i&&(r.language=i),r.tech=e;var s=new Bn.text.TrackClass(r);return a.addTrack(s),s}function pe(e,t){Fn[e]=Fn[e]||[],Fn[e].push(t)}function fe(e,t,n){e.setTimeout(function(){return Ee(t,Fn[t.type],n,e)},1)}function me(e,t){e.forEach(function(e){return e.setTech&&e.setTech(t)})}function ge(e,t,n){return e.reduceRight(_e(n),t[n]())}function ye(e,t,n,i){return t[n](e.reduce(_e(n),i))}function ve(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r="call"+te(n),a=e.reduce(_e(r),i),s=a===qn,o=s?null:t[n](a);return be(e,n,o,s),o}function _e(e){return function(t,n){return t===qn?qn:n[e]?n[e](t):t}}function be(e,t,n,i){for(var r=e.length-1;r>=0;r--){var a=e[r];a[t]&&a[t](i,n)}}function Te(e){Hn[e.id()]=null}function Se(e,t){var n=Hn[e.id()],i=null;if(void 0===n||null===n)return i=t(e),Hn[e.id()]=[[t,i]],i;for(var r=0;r<n.length;r++){var a=n[r],s=a[0],o=a[1];s===t&&(i=o)}return null===i&&(i=t(e),n.push([t,i])),i}function Ee(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments[2],i=arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=t[0],u=t.slice(1);if("string"==typeof o)Ee(e,Fn[o],n,i,r,a);else if(o){var l=Se(i,o);if(!l.setSource)return r.push(l),Ee(e,u,n,i,r,a);l.setSource(s({},e),function(t,s){if(t)return Ee(e,u,n,i,r,a);r.push(l),Ee(s,e.type===s.type?u:Fn[s.type],n,i,r,a)})}else u.length?Ee(e,u,n,i,r,a):a?n(e,r):Ee(e,Fn["*"],n,i,r,!0)}function we(e){var t=Xn(e.src);return!e.type&&t&&(e.type=t),e}function ke(e,t){var n=void 0;if(4===e.length)n=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");n=e.slice(1)}return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+t+")"}function Ce(e,t,n){try{e.style[t]=n}catch(e){return}}function Ae(e){oi=e}function Ie(){oi=si}function xe(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}function Pe(e,t){return xe(e.options[e.options.selectedIndex].value,t)}function Oe(e,t,n){if(t)for(var i=0;i<e.options.length;i++)if(xe(e.options[i].value,n)===t){e.selectedIndex=i;break}}function Le(e,t,n){var i=Le.getPlayer(e);if(i)return t&&vt.warn('Player "'+e+'" is already initialised. Options will not be applied.'),n&&i.ready(n),i;var r="string"==typeof e?Tt("#"+Gr(e)):e;if(!m(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");Re.body.contains(r)||vt.warn("The element supplied is not included in the DOM"),t=t||{},Le.hooks("beforesetup").forEach(function(e){var n=e(r,ie(t));if(!o(n)||Array.isArray(n))return void vt.error("please return an object in beforesetup hooks");t=ie(t,n)});var a=Yt.getComponent("Player");return i=new a(r,t,n),Le.hooks("setup").forEach(function(e){return e(i)}),i}var De=i(n(17)),Re=i(n(18)),Me=i(n(20)),Ne=i(n(21)),Ue=i(n(22)),Be=i(n(27)),je="6.13.0",Fe=De.navigator&&De.navigator.userAgent||"",He=/AppleWebKit\/([\d.]+)/i.exec(Fe),qe=He?parseFloat(He.pop()):null,Ve=/iPad/i.test(Fe),We=/iPhone/i.test(Fe)&&!Ve,Ge=/iPod/i.test(Fe),ze=We||Ve||Ge,Xe=function(){var e=Fe.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Ye=/Android/i.test(Fe),Ke=function(){var e=Fe.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+"."+e[2]):t||null}(),Qe=Ye&&/webkit/i.test(Fe)&&Ke<2.3,$e=Ye&&Ke<5&&qe<537,Je=/Firefox/i.test(Fe),Ze=/Edge/i.test(Fe),et=!Ze&&(/Chrome/i.test(Fe)||/CriOS/i.test(Fe)),tt=function(){var e=Fe.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),nt=/MSIE\s8\.0/.test(Fe),it=function(){var e=/MSIE\s(\d+)\.\d/.exec(Fe),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(Fe)&&/rv:11.0/.test(Fe)&&(t=11),t}(),rt=/Safari/i.test(Fe)&&!et&&!Ye&&!Ze,at=(rt||ze)&&!et,st=f()&&("ontouchstart"in De||De.navigator.maxTouchPoints||De.DocumentTouch&&De.document instanceof De.DocumentTouch),ot=f()&&"backgroundSize"in De.document.createElement("video").style,ut=(Object.freeze||Object)({IS_IPAD:Ve,IS_IPHONE:We,IS_IPOD:Ge,IS_IOS:ze,IOS_VERSION:Xe,IS_ANDROID:Ye,ANDROID_VERSION:Ke,IS_OLD_ANDROID:Qe,IS_NATIVE_ANDROID:$e,IS_FIREFOX:Je,IS_EDGE:Ze,IS_CHROME:et,CHROME_VERSION:tt,IS_IE8:nt,IE_VERSION:it,IS_SAFARI:rt,IS_ANY_SAFARI:at,TOUCH_ENABLED:st,BACKGROUND_SIZE_SUPPORTED:ot}),lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ct=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},dt=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},ht=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},pt=function(e,t){return e.raw=t,e},ft=Object.prototype.toString,mt=function(e){return o(e)?Object.keys(e):[]},gt=[],yt=function(e,t){return function(n,i,r,a){var s=t.levels[i],u=new RegExp("^("+s+")$");if("log"!==n&&r.unshift(n.toUpperCase()+":"),r.unshift(e+":"),gt&&gt.push([].concat(r)),De.console){var l=De.console[n];l||"debug"!==n||(l=De.console.info||De.console.log),l&&s&&u.test(n)&&(a&&(r=r.map(function(e){if(o(e)||Array.isArray(e))try{return JSON.stringify(e)}catch(t){return String(e)}return String(e)}).join(" ")),l.apply?l[Array.isArray(r)?"apply":"call"](De.console,r):l(r))}}},vt=l("VIDEOJS"),_t=vt.createLogger,bt=pt(["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."],["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."]),Tt=y("querySelector"),St=y("querySelectorAll"),Et=(Object.freeze||Object)({isReal:f,isEl:m,isInFrame:g,createEl:v,textContent:_,prependTo:b,hasClass:T,addClass:S,removeClass:E,toggleClass:w,setAttributes:k,getAttributes:C,getAttribute:A,setAttribute:I,removeAttribute:x,blockTextSelection:P,unblockTextSelection:O,getBoundingClientRect:L,findPosition:D,getPointerPosition:R,isTextNode:M,emptyEl:N,normalizeContent:U,appendContent:B,insertContent:j,isSingleLeftClick:F,$:Tt,$$:St}),wt=1,kt={},Ct="vdata"+(new Date).getTime(),At=!1;!function(){try{var e=Object.defineProperty({},"passive",{get:function(){At=!0}});De.addEventListener("test",null,e),De.removeEventListener("test",null,e)}catch(e){}}();var It=["touchstart","touchmove"],xt=(Object.freeze||Object)({fixEvent:X,on:Y,off:K,trigger:Q,one:$}),Pt=!1,Ot=void 0,Lt=function(){if(f()&&!1!==Ot.options.autoSetup){var e=Re.getElementsByTagName("video"),t=Re.getElementsByTagName("audio"),n=Re.getElementsByTagName("video-js"),i=[];if(e&&e.length>0)for(var r=0,a=e.length;r<a;r++)i.push(e[r]);if(t&&t.length>0)for(var s=0,o=t.length;s<o;s++)i.push(t[s]);if(n&&n.length>0)for(var u=0,l=n.length;u<l;u++)i.push(n[u]);if(i&&i.length>0)for(var c=0,d=i.length;c<d;c++){var h=i[c];if(!h||!h.getAttribute){J(1);break}if(void 0===h.player){var p=h.getAttribute("data-setup");null!==p&&Ot(h)}}else Pt||J(1)}};f()&&"complete"===Re.readyState?Pt=!0:$(De,"load",function(){Pt=!0});var Dt=function(e){var t=Re.createElement("style");return t.className=e,t},Rt=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},Mt=function(e,t,n){t.guid||(t.guid=H());var i=function(){return t.apply(e,arguments)};return i.guid=n?n+"_"+t.guid:t.guid,i},Nt=function(e,t){var n=Date.now();return function(){var i=Date.now();i-n>=t&&(e.apply(void 0,arguments),n=i)}},Ut=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:De,r=void 0,a=function(){i.clearTimeout(r),r=null},s=function(){var a=this,s=arguments,o=function(){r=null,o=null,n||e.apply(a,s)};!r&&n&&e.apply(a,s),i.clearTimeout(r),r=i.setTimeout(o,t)};return s.cancel=a,s},Bt=function(){};Bt.prototype.allowedEvents_={},Bt.prototype.on=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},Y(this,e,t),this.addEventListener=n},Bt.prototype.addEventListener=Bt.prototype.on,Bt.prototype.off=function(e,t){K(this,e,t)},Bt.prototype.removeEventListener=Bt.prototype.off,Bt.prototype.one=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},$(this,e,t),this.addEventListener=n},Bt.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=X(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Q(this,e)},Bt.prototype.dispatchEvent=Bt.prototype.trigger;var jt=function(e){return e instanceof Bt||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},Ft=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Ht=function(e){if(!e.nodeName&&!jt(e))throw new Error("Invalid target; must be a DOM node or evented object.")},qt=function(e){if(!Ft(e))throw new Error("Invalid event type; must be a non-empty string or array.")},Vt=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},Wt=function(e,t){var n=t.length<3||t[0]===e||t[0]===e.eventBusEl_,i=void 0,r=void 0,a=void 0;return n?(i=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],a=t[1]):(i=t[0],r=t[1],a=t[2]),Ht(i),qt(r),Vt(a),a=Mt(e,a),{isTargetingSelf:n,target:i,type:r,listener:a}},Gt=function(e,t,n,i){Ht(e),e.nodeName?xt[t](e,n,i):e[t](n,i)},zt={on:function(){for(var e=this,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=Wt(this,n),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(Gt(s,"on",o,u),!a){var l=function(){return e.off(s,o,u)};l.guid=u.guid;var c=function(){return e.off("dispose",l)};c.guid=u.guid,Gt(this,"on","dispose",l),Gt(s,"on","dispose",c)}},one:function(){for(var e=this,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=Wt(this,n),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(a)Gt(s,"one",o,u);else{var l=function t(){for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];e.off(s,o,t),u.apply(null,i)};l.guid=u.guid,Gt(s,"one",o,l)}},off:function(e,t,n){if(!e||Ft(e))K(this.eventBusEl_,e,t);else{var i=e,r=t;Ht(i),qt(r),Vt(n),n=Mt(this,n),this.off("dispose",n),i.nodeName?(K(i,r,n),K(i,"dispose",n)):jt(i)&&(i.off(r,n),i.off("dispose",n))}},trigger:function(e,t){return Q(this.eventBusEl_,e,t)}},Xt={state:{},setState:function(e){var t=this;"function"==typeof e&&(e=e());var n=void 0;return r(e,function(e,i){t.state[i]!==e&&(n=n||{},n[i]={from:t.state[i],to:e}),t.state[i]=e}),n&&jt(this)&&this.trigger({changes:n,type:"statechanged"}),n}},Yt=function(){function e(t,n,i){if(ct(this,e),!t&&this.play?this.player_=t=this:this.player_=t,this.options_=ie({},this.options_),n=this.options_=ie(this.options_,n),this.id_=n.id||n.el&&n.el.id,!this.id_){var r=t&&t.id&&t.id()||"no_player";this.id_=r+"_component_"+H()}this.name_=n.name||null,n.el?this.el_=n.el:!1!==n.createEl&&(this.el_=this.createEl()),!1!==n.evented&&Z(this,{eventBusKey:this.el_?"el_":null}),ee(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},!1!==n.initChildren&&this.initChildren(),this.ready(i),!1!==n.reportTouchActivity&&this.enableTouchActivity()}return e.prototype.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var 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.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),W(this.el_),this.el_=null),this.player_=null},e.prototype.player=function(){return this.player_},e.prototype.options=function(e){return vt.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),e?(this.options_=ie(this.options_,e),this.options_):this.options_},e.prototype.el=function(){return this.el_},e.prototype.createEl=function(e,t,n){return v(e,t,n)},e.prototype.localize=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,i=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[i],s=i&&i.split("-")[0],o=r&&r[s],u=n;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(e,n){var i=t[n-1],r=i;return void 0===i&&(r=e),r})),u},e.prototype.contentEl=function(){return this.contentEl_||this.el_},e.prototype.id=function(){return this.id_},e.prototype.name=function(){return this.name_},e.prototype.children=function(){return this.children_},e.prototype.getChildById=function(e){return this.childIndex_[e]},e.prototype.getChild=function(e){if(e)return e=te(e),this.childNameIndex_[e]},e.prototype.addChild=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,r=void 0,a=void 0;if("string"==typeof t){a=te(t);var s=n.componentClass||a;n.name=a;var o=e.getComponent(s);if(!o)throw new Error("Component "+s+" does not exist");if("function"!=typeof o)return null;r=new o(this.player_||this,n)}else r=t;if(this.children_.splice(i,0,r),"function"==typeof r.id&&(this.childIndex_[r.id()]=r),a=a||r.name&&te(r.name()),a&&(this.childNameIndex_[a]=r),"function"==typeof r.el&&r.el()){var u=this.contentEl().children,l=u[i]||null;this.contentEl().insertBefore(r.el(),l)}return r},e.prototype.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(t){this.childIndex_[e.id()]=null,this.childNameIndex_[e.name()]=null;var i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},e.prototype.initChildren=function(){var t=this,n=this.options_.children;if(n){var i=this.options_,r=function(e){var n=e.name,r=e.opts;if(void 0!==i[n]&&(r=i[n]),!1!==r){!0===r&&(r={}),r.playerOptions=t.options_.playerOptions;var a=t.addChild(n,r);a&&(t[n]=a)}},a=void 0,s=e.getComponent("Tech");a=Array.isArray(n)?n:Object.keys(n),a.concat(Object.keys(this.options_).filter(function(e){return!a.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(function(e){var i=void 0,r=void 0;return"string"==typeof e?(i=e,r=n[i]||t.options_[i]||{}):(i=e.name,r=e),{name:i,opts:r}}).filter(function(t){var n=e.getComponent(t.opts.componentClass||te(t.name));return n&&!s.isTech(n)}).forEach(r)}},e.prototype.buildCSSClass=function(){return""},e.prototype.ready=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},e.prototype.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},e.prototype.$=function(e,t){return Tt(e,t||this.contentEl())},e.prototype.$$=function(e,t){return St(e,t||this.contentEl())},e.prototype.hasClass=function(e){return T(this.el_,e)},e.prototype.addClass=function(e){S(this.el_,e)},e.prototype.removeClass=function(e){E(this.el_,e)},e.prototype.toggleClass=function(e,t){w(this.el_,e,t)},e.prototype.show=function(){this.removeClass("vjs-hidden")},e.prototype.hide=function(){this.addClass("vjs-hidden")},e.prototype.lockShowing=function(){this.addClass("vjs-lock-showing")},e.prototype.unlockShowing=function(){this.removeClass("vjs-lock-showing")},e.prototype.getAttribute=function(e){return A(this.el_,e)},e.prototype.setAttribute=function(e,t){I(this.el_,e,t)},e.prototype.removeAttribute=function(e){x(this.el_,e)},e.prototype.width=function(e,t){return this.dimension("width",e,t)},e.prototype.height=function(e,t){return this.dimension("height",e,t)},e.prototype.dimensions=function(e,t){this.width(e,!0),this.height(t)},e.prototype.dimension=function(e,t,n){if(void 0!==t)return null!==t&&t===t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;var i=this.el_.style[e],r=i.indexOf("px");return-1!==r?parseInt(i.slice(0,r),10):parseInt(this.el_["offset"+te(e)],10)},e.prototype.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if("function"==typeof De.getComputedStyle){var n=De.getComputedStyle(this.el_);t=n.getPropertyValue(e)||n[e]}if(0===(t=parseFloat(t))){var i="offset"+te(e);t=this.el_[i]}return t},e.prototype.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},e.prototype.currentWidth=function(){return this.currentDimension("width")},e.prototype.currentHeight=function(){return this.currentDimension("height")},e.prototype.focus=function(){this.el_.focus()},e.prototype.blur=function(){this.el_.blur()},e.prototype.emitTapEvents=function(){var e=0,t=null,n=void 0;this.on("touchstart",function(i){1===i.touches.length&&(t={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},e=(new Date).getTime(),n=!0)}),this.on("touchmove",function(e){if(e.touches.length>1)n=!1;else if(t){var i=e.touches[0].pageX-t.pageX,r=e.touches[0].pageY-t.pageY,a=Math.sqrt(i*i+r*r);a>10&&(n=!1)}});var i=function(){n=!1};this.on("touchleave",i),this.on("touchcancel",i),this.on("touchend",function(i){if(t=null,!0===n){(new Date).getTime()-e<200&&(i.preventDefault(),this.trigger("tap"))}})},e.prototype.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e=Mt(this.player(),this.player().reportUserActivity),t=void 0;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});var n=function(n){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",n),this.on("touchcancel",n)}},e.prototype.setTimeout=function(e,t){var n,i,r=this;return e=Mt(this,e),n=De.setTimeout(function(){r.off("dispose",i),e()},t),i=function(){return r.clearTimeout(n)},i.guid="vjs-timeout-"+n,this.on("dispose",i),n},e.prototype.clearTimeout=function(e){De.clearTimeout(e);var t=function(){};return t.guid="vjs-timeout-"+e,this.off("dispose",t),e},e.prototype.setInterval=function(e,t){var n=this;e=Mt(this,e);var i=De.setInterval(e,t),r=function(){return n.clearInterval(i)};return r.guid="vjs-interval-"+i,this.on("dispose",r),i},e.prototype.clearInterval=function(e){De.clearInterval(e);var t=function(){};return t.guid="vjs-interval-"+e,this.off("dispose",t),e},e.prototype.requestAnimationFrame=function(e){var t,n,i=this;return this.supportsRaf_?(e=Mt(this,e),t=De.requestAnimationFrame(function(){i.off("dispose",n),e()}),n=function(){return i.cancelAnimationFrame(t)},n.guid="vjs-raf-"+t,this.on("dispose",n),t):this.setTimeout(e,1e3/60)},e.prototype.cancelAnimationFrame=function(e){if(this.supportsRaf_){De.cancelAnimationFrame(e);var t=function(){};return t.guid="vjs-raf-"+e,this.off("dispose",t),e}return this.clearTimeout(e)},e.registerComponent=function(t,n){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var i=e.getComponent("Tech"),r=i&&i.isTech(n),a=e===n||e.prototype.isPrototypeOf(n.prototype);if(r||!a){var s=void 0;throw s=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+s+".")}t=te(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var u=o.players,l=Object.keys(u);if(u&&l.length>0&&l.map(function(e){return u[e]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=n,n},e.getComponent=function(t){if(t)return t=te(t),e.components_&&e.components_[t]?e.components_[t]:void 0},e}();Yt.prototype.supportsRaf_="function"==typeof De.requestAnimationFrame&&"function"==typeof De.cancelAnimationFrame,Yt.registerComponent("Component",Yt);for(var Kt={},Qt=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],$t=Qt[0],Jt=void 0,Zt=0;Zt<Qt.length;Zt++)if(Qt[Zt][1]in Re){Jt=Qt[Zt];break}if(Jt)for(var en=0;en<Jt.length;en++)Kt[$t[en]]=Jt[en];le.prototype.code=0,le.prototype.message="",le.prototype.status=null,le.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],le.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."};for(var tn=0;tn<le.errorTypes.length;tn++)le[le.errorTypes[tn]]=tn,le.prototype[le.errorTypes[tn]]=tn;var nn=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(t,n,i){return 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}})})},rn=function(e){var t=e.$$("track"),n=Array.prototype.map.call(t,function(e){return e.track});return Array.prototype.map.call(t,function(e){var t=nn(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return-1===n.indexOf(e)}).map(nn))},an=function(e,t){return e.forEach(function(e){var n=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(function(e){return n.addCue(e)})}),t.textTracks()},sn={textTracksToJson:rn,jsonToTextTracks:an,trackToJson_:nn},on="vjs-modal-dialog",un=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.opened_=r.hasBeenOpened_=r.hasBeenFilled_=!1,r.closeable(!r.options_.uncloseable),r.content(r.options_.content),r.contentEl_=v("div",{className:on+"-content"},{role:"document"}),r.descEl_=v("p",{className:on+"-description vjs-control-text",id:r.el().getAttribute("aria-describedby")}),_(r.descEl_,r.description()),r.el_.appendChild(r.descEl_),r.el_.appendChild(r.contentEl_),r}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},t.prototype.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,e.prototype.dispose.call(this)},t.prototype.buildCSSClass=function(){return on+" vjs-hidden "+e.prototype.buildCSSClass.call(this)},t.prototype.handleKeyPress=function(e){27===e.which&&this.closeable()&&this.close()},t.prototype.label=function(){return this.localize(this.options_.label||"Modal Window")},t.prototype.description=function(){var 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},t.prototype.open=function(){if(!this.opened_){var 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.closeable()&&this.on(this.el_.ownerDocument,"keydown",Mt(this,this.handleKeyPress)),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},t.prototype.opened=function(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_},t.prototype.close=function(){if(this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.closeable()&&this.off(this.el_.ownerDocument,"keydown",Mt(this,this.handleKeyPress)),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},t.prototype.closeable=function(e){if("boolean"==typeof e){var t=this.closeable_=!!e,n=this.getChild("closeButton");if(t&&!n){var i=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=i,this.on(n,"close",this.close)}!t&&n&&(this.off(n,"close",this.close),this.removeChild(n),n.dispose())}return this.closeable_},t.prototype.fill=function(){this.fillWith(this.content())},t.prototype.fillWith=function(e){var t=this.contentEl(),n=t.parentNode,i=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,n.removeChild(t),this.empty(),j(t,e),this.trigger("modalfill"),i?n.insertBefore(t,i):n.appendChild(t);var r=this.getChild("closeButton");r&&n.appendChild(r.el_)},t.prototype.empty=function(){this.trigger("beforemodalempty"),N(this.contentEl()),this.trigger("modalempty")},t.prototype.content=function(e){return void 0!==e&&(this.content_=e),this.content_},t.prototype.conditionalFocus_=function(){var e=Re.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus(),this.on(Re,"keydown",this.handleKeyDown))},t.prototype.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null),this.off(Re,"keydown",this.handleKeyDown)},t.prototype.handleKeyDown=function(e){if(9===e.which){for(var t=this.focusableEls_(),n=this.el_.querySelector(":focus"),i=void 0,r=0;r<t.length;r++)if(n===t[r]){i=r;break}Re.activeElement===this.el_&&(i=0),e.shiftKey&&0===i?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||i!==t.length-1||(t[0].focus(),e.preventDefault())}},t.prototype.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,function(e){return(e instanceof De.HTMLAnchorElement||e instanceof De.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof De.HTMLInputElement||e instanceof De.HTMLSelectElement||e instanceof De.HTMLTextAreaElement||e instanceof De.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof De.HTMLIFrameElement||e instanceof De.HTMLObjectElement||e instanceof De.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")})},t}(Yt);un.prototype.options_={pauseOnOpen:!0,temporary:!0},Yt.registerComponent("ModalDialog",un);var ln=function(e){function t(){var n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;ct(this,t);var a=ht(this,e.call(this));if(!r&&(r=a,nt)){r=Re.createElement("custom");for(var s in t.prototype)"constructor"!==s&&(r[s]=t.prototype[s])}r.tracks_=[],Object.defineProperty(r,"length",{get:function(){return this.tracks_.length}});for(var o=0;o<i.length;o++)r.addTrack(i[o]);return n=r,ht(a,n)}return dt(t,e),t.prototype.addTrack=function(e){var t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack"}))},t.prototype.removeTrack=function(e){for(var t=void 0,n=0,i=this.length;n<i;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"})},t.prototype.getTrackById=function(e){for(var t=null,n=0,i=this.length;n<i;n++){var r=this[n];if(r.id===e){t=r;break}}return t},t}(Bt);ln.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"};for(var cn in ln.prototype.allowedEvents_)ln.prototype["on"+cn]=null;var dn=function(e,t){for(var n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].enabled=!1)},hn=function(e){function t(){var n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];ct(this,t);for(var a=void 0,s=r.length-1;s>=0;s--)if(r[s].enabled){dn(r,r[s]);break}if(nt){a=Re.createElement("custom");for(var o in ln.prototype)"constructor"!==o&&(a[o]=ln.prototype[o]);for(var u in t.prototype)"constructor"!==u&&(a[u]=t.prototype[u])}return a=n=ht(this,e.call(this,r,a)),a.changing_=!1,i=a,ht(n,i)}return dt(t,e),t.prototype.addTrack=function(t){var n=this;t.enabled&&dn(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("enabledchange",function(){n.changing_||(n.changing_=!0,dn(n,t),n.changing_=!1,n.trigger("change"))})},t}(ln),pn=function(e,t){for(var n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].selected=!1)},fn=function(e){function t(){var n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];ct(this,t);for(var a=void 0,s=r.length-1;s>=0;s--)if(r[s].selected){pn(r,r[s]);break}if(nt){a=Re.createElement("custom");for(var o in ln.prototype)"constructor"!==o&&(a[o]=ln.prototype[o]);for(var u in t.prototype)"constructor"!==u&&(a[u]=t.prototype[u])}return a=n=ht(this,e.call(this,r,a)),a.changing_=!1,Object.defineProperty(a,"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),i=a,ht(n,i)}return dt(t,e),t.prototype.addTrack=function(t){var n=this;t.selected&&pn(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("selectedchange",function(){n.changing_||(n.changing_=!0,pn(n,t),n.changing_=!1,n.trigger("change"))})},t}(ln),mn=function(e){function t(){var n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];ct(this,t);var a=void 0;if(nt){a=Re.createElement("custom");for(var s in ln.prototype)"constructor"!==s&&(a[s]=ln.prototype[s]);for(var o in t.prototype)"constructor"!==o&&(a[o]=t.prototype[o])}return a=n=ht(this,e.call(this,r,a)),i=a,ht(n,i)}return dt(t,e),t.prototype.addTrack=function(t){e.prototype.addTrack.call(this,t),t.addEventListener("modechange",Mt(this,function(){this.trigger("change")})),-1===["metadata","chapters"].indexOf(t.kind)&&t.addEventListener("modechange",Mt(this,function(){this.trigger("selectedlanguagechange")}))},t}(ln),gn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];ct(this,e);var n=this;if(nt){n=Re.createElement("custom");for(var i in e.prototype)"constructor"!==i&&(n[i]=e.prototype[i])}n.trackElements_=[],Object.defineProperty(n,"length",{get:function(){return this.trackElements_.length}});for(var r=0,a=t.length;r<a;r++)n.addTrackElement_(t[r]);if(nt)return n}return e.prototype.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},e.prototype.getTrackElementByTrack_=function(e){for(var t=void 0,n=0,i=this.trackElements_.length;n<i;n++)if(e===this.trackElements_[n].track){t=this.trackElements_[n];break}return t},e.prototype.removeTrackElement_=function(e){for(var t=0,n=this.trackElements_.length;t<n;t++)if(e===this.trackElements_[t]){this.trackElements_.splice(t,1);break}},e}(),yn=function(){function e(t){ct(this,e);var n=this;if(nt){n=Re.createElement("custom");for(var i in e.prototype)"constructor"!==i&&(n[i]=e.prototype[i])}if(e.prototype.setCues_.call(n,t),Object.defineProperty(n,"length",{get:function(){return this.length_}}),nt)return n}return e.prototype.setCues_=function(e){var t=this.length||0,n=0,i=e.length;this.cues_=e,this.length_=e.length;var r=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})};if(t<i)for(n=t;n<i;n++)r.call(this,n)},e.prototype.getCueById=function(e){for(var t=null,n=0,i=this.length;n<i;n++){var r=this[n];if(r.id===e){t=r;break}}return t},e}(),vn={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},_n={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},bn={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Tn={disabled:"disabled",hidden:"hidden",showing:"showing"},Sn=function(e){function t(){var n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ct(this,t);var r=ht(this,e.call(this)),a=r;if(nt){a=Re.createElement("custom");for(var s in t.prototype)"constructor"!==s&&(a[s]=t.prototype[s])}var o={id:i.id||"vjs_track_"+H(),kind:i.kind||"",label:i.label||"",language:i.language||""};for(var u in o)!function(e){Object.defineProperty(a,e,{get:function(){return o[e]},set:function(){}})}(u);return n=a,ht(r,n)}return dt(t,e),t}(Bt),En=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],n=Re.createElement("a");n.href=e;var i=""===n.host&&"file:"!==n.protocol,r=void 0;i&&(r=Re.createElement("div"),r.innerHTML='<a href="'+e+'"></a>',n=r.firstChild,r.setAttribute("style","display:none; position:absolute;"),Re.body.appendChild(r));for(var a={},s=0;s<t.length;s++)a[t[s]]=n[t[s]];return"http:"===a.protocol&&(a.host=a.host.replace(/:80$/,"")),"https:"===a.protocol&&(a.host=a.host.replace(/:443$/,"")),a.protocol||(a.protocol=De.location.protocol),i&&Re.body.removeChild(r),a},wn=function(e){if(!e.match(/^https?:\/\//)){var t=Re.createElement("div");t.innerHTML='<a href="'+e+'">x</a>',e=t.firstChild.href}return e},kn=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i,n=t.exec(e);if(n)return n.pop().toLowerCase()}return""},Cn=function(e){var t=De.location,n=En(e);return(":"===n.protocol?t.protocol:n.protocol)+n.host!==t.protocol+t.host},An=(Object.freeze||Object)({parseUrl:En,getAbsoluteURL:wn,getFileExtension:kn,isCrossOrigin:Cn}),In=function(e,t){var n=new De.WebVTT.Parser(De,De.vttjs,De.WebVTT.StringDecoder()),i=[];n.oncue=function(e){t.addCue(e)},n.onparsingerror=function(e){i.push(e)},n.onflush=function(){t.trigger({type:"loadeddata",target:t})},n.parse(e),i.length>0&&(De.console&&De.console.groupCollapsed&&De.console.groupCollapsed("Text Track parsing errors for "+t.src),i.forEach(function(e){return vt.error(e)}),De.console&&De.console.groupEnd&&De.console.groupEnd()),n.flush()},xn=function(e,t){var n={uri:e},i=Cn(e);i&&(n.cors=i),Ue(n,Mt(this,function(e,n,i){if(e)return vt.error(e,n);if(t.loaded_=!0,"function"!=typeof De.WebVTT){if(t.tech_){var r=function(){return In(i,t)};t.tech_.on("vttjsloaded",r),t.tech_.on("vttjserror",function(){vt.error("vttjs failed to load, stopping trying to process "+t.src),t.tech_.off("vttjsloaded",r)})}}else In(i,t)}))},Pn=function(e){function t(){var n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(ct(this,t),!r.tech)throw new Error("A tech was not provided.");var a=ie(r,{kind:bn[r.kind]||"subtitles",language:r.language||r.srclang||""}),s=Tn[a.mode]||"disabled",o=a.default;"metadata"!==a.kind&&"chapters"!==a.kind||(s="hidden");var u=n=ht(this,e.call(this,a));if(u.tech_=a.tech,nt)for(var l in t.prototype)"constructor"!==l&&(u[l]=t.prototype[l]);u.cues_=[],u.activeCues_=[];var c=new yn(u.cues_),d=new yn(u.activeCues_),h=!1,p=Mt(u,function(){this.activeCues=this.activeCues,h&&(this.trigger("cuechange"),h=!1)});return"disabled"!==s&&u.tech_.ready(function(){u.tech_.on("timeupdate",p)},!0),Object.defineProperty(u,"default",{get:function(){return o},set:function(){}}),Object.defineProperty(u,"mode",{get:function(){return s},set:function(e){var t=this;Tn[e]&&(s=e,"disabled"!==s?this.tech_.ready(function(){t.tech_.on("timeupdate",p)},!0):this.tech_.off("timeupdate",p),this.trigger("modechange"))}}),Object.defineProperty(u,"cues",{get:function(){return this.loaded_?c:null},set:function(){}}),Object.defineProperty(u,"activeCues",{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return d;for(var e=this.tech_.currentTime(),t=[],n=0,i=this.cues.length;n<i;n++){var r=this.cues[n];r.startTime<=e&&r.endTime>=e?t.push(r):r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e&&t.push(r)}if(h=!1,t.length!==this.activeCues_.length)h=!0;else for(var a=0;a<t.length;a++)-1===this.activeCues_.indexOf(t[a])&&(h=!0);return this.activeCues_=t,d.setCues_(this.activeCues_),d},set:function(){}}),a.src?(u.src=a.src,xn(a.src,u)):u.loaded_=!0,i=u,ht(n,i)}return dt(t,e),t.prototype.addCue=function(e){var t=e;if(De.vttjs&&!(e instanceof De.vttjs.VTTCue)){t=new De.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(var n in e)n in t||(t[n]=e[n]);t.id=e.id,t.originalCue_=e}for(var i=this.tech_.textTracks(),r=0;r<i.length;r++)i[r]!==this&&i[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},t.prototype.removeCue=function(e){for(var t=this.cues_.length;t--;){var n=this.cues_[t];if(n===e||n.originalCue_&&n.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},t}(Sn);Pn.prototype.allowedEvents_={cuechange:"cuechange"};var On=function(e){function t(){var n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ct(this,t);var a=ie(r,{kind:_n[r.kind]||""}),s=n=ht(this,e.call(this,a)),o=!1;if(nt)for(var u in t.prototype)"constructor"!==u&&(s[u]=t.prototype[u]);return Object.defineProperty(s,"enabled",{get:function(){return o},set:function(e){"boolean"==typeof e&&e!==o&&(o=e,this.trigger("enabledchange"))}}),a.enabled&&(s.enabled=a.enabled),s.loaded_=!0,i=s,ht(n,i)}return dt(t,e),t}(Sn),Ln=function(e){function t(){var n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ct(this,t);var a=ie(r,{kind:vn[r.kind]||""}),s=n=ht(this,e.call(this,a)),o=!1;if(nt)for(var u in t.prototype)"constructor"!==u&&(s[u]=t.prototype[u]);return Object.defineProperty(s,"selected",{get:function(){return o},set:function(e){"boolean"==typeof e&&e!==o&&(o=e,this.trigger("selectedchange"))}}),a.selected&&(s.selected=a.selected),i=s,ht(n,i)}return dt(t,e),t}(Sn),Dn=0,Rn=2,Mn=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ct(this,t);var i=ht(this,e.call(this)),r=void 0,a=i;if(nt){a=Re.createElement("custom");for(var s in t.prototype)"constructor"!==s&&(a[s]=t.prototype[s])}var o=new Pn(n);if(a.kind=o.kind,a.src=o.src,a.srclang=o.language,a.label=o.label,a.default=o.default,Object.defineProperty(a,"readyState",{get:function(){return r}}),Object.defineProperty(a,"track",{get:function(){return o}}),r=Dn,o.addEventListener("loadeddata",function(){r=Rn,a.trigger({type:"load",target:a})}),nt){var u;return u=a,ht(i,u)}return i}return dt(t,e),t}(Bt);Mn.prototype.allowedEvents_={load:"load"},Mn.NONE=Dn,Mn.LOADING=1,Mn.LOADED=Rn,Mn.ERROR=3;var Nn={audio:{ListClass:hn,TrackClass:On,capitalName:"Audio"},video:{ListClass:fn,TrackClass:Ln,capitalName:"Video"},text:{ListClass:mn,TrackClass:Pn,capitalName:"Text"}};Object.keys(Nn).forEach(function(e){Nn[e].getterName=e+"Tracks",Nn[e].privateName=e+"Tracks_"});var Un={remoteText:{ListClass:mn,TrackClass:Pn,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:gn,TrackClass:Mn,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Bn=ie(Nn,Un);Un.names=Object.keys(Un),Nn.names=Object.keys(Nn),Bn.names=[].concat(Un.names).concat(Nn.names);var jn=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};ct(this,t),n.reportTouchActivity=!1;var r=ht(this,e.call(this,null,n,i));return r.hasStarted_=!1,r.on("playing",function(){this.hasStarted_=!0}),r.on("loadstart",function(){this.hasStarted_=!1}),Bn.names.forEach(function(e){var t=Bn[e];n&&n[t.getterName]&&(r[t.privateName]=n[t.getterName])}),r.featuresProgressEvents||r.manualProgressOn(),r.featuresTimeupdateEvents||r.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(e){!1===n["native"+e+"Tracks"]&&(r["featuresNative"+e+"Tracks"]=!1)}),!1===n.nativeCaptions||!1===n.nativeTextTracks?r.featuresNativeTextTracks=!1:!0!==n.nativeCaptions&&!0!==n.nativeTextTracks||(r.featuresNativeTextTracks=!0),r.featuresNativeTextTracks||r.emulateTextTracks(),r.autoRemoteTextTracks_=new Bn.text.ListClass,r.initTrackListeners(),n.nativeControlsForTouch||r.emitTapEvents(),r.constructor&&(r.name_=r.constructor.name||"Unknown Tech"),r}return dt(t,e),t.prototype.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",function(){return t.setTimeout(function(){return t.triggerSourceset(e)},1)}),this.trigger({src:e,type:"sourceset"})},t.prototype.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},t.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},t.prototype.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Mt(this,function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()}),500)},t.prototype.onDurationChange=function(e){this.duration_=this.duration()},t.prototype.buffered=function(){return oe(0,0)},t.prototype.bufferedPercent=function(){return ue(this.buffered(),this.duration_)},t.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},t.prototype.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},t.prototype.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},t.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},t.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.prototype.dispose=function(){this.clearTracks(Nn.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},t.prototype.clearTracks=function(e){var t=this;e=[].concat(e),e.forEach(function(e){for(var n=t[e+"Tracks"]()||[],i=n.length;i--;){var r=n[i];"text"===e&&t.removeRemoteTextTrack(r),n.removeTrack(r)}})},t.prototype.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var n=e[t];this.removeRemoteTextTrack(n)}},t.prototype.reset=function(){},t.prototype.error=function(e){return void 0!==e&&(this.error_=new le(e),this.trigger("error")),this.error_},t.prototype.played=function(){return this.hasStarted_?oe(0,0):oe()},t.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.prototype.initTrackListeners=function(){var e=this;Nn.names.forEach(function(t){var n=Nn[t],i=function(){e.trigger(t+"trackchange")},r=e[n.getterName]();r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),e.on("dispose",function(){r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i)})})},t.prototype.addWebVttScript_=function(){var e=this;if(!De.WebVTT)if(Re.body.contains(this.el())){if(!this.options_["vtt.js"]&&u(Be)&&Object.keys(Be).length>0)return void this.trigger("vttjsloaded");var t=Re.createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.12.4/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){t.onload=null,t.onerror=null}),De.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},t.prototype.emulateTextTracks=function(){var e=this,t=this.textTracks(),n=this.remoteTextTracks(),i=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};n.on("addtrack",i),n.on("removetrack",r),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e<t.length;e++){var n=t[e];n.removeEventListener("cuechange",a),"showing"===n.mode&&n.addEventListener("cuechange",a)}};s(),t.addEventListener("change",s),t.addEventListener("addtrack",s),t.addEventListener("removetrack",s),this.on("dispose",function(){n.off("addtrack",i),n.off("removetrack",r),t.removeEventListener("change",s),t.removeEventListener("addtrack",s),t.removeEventListener("removetrack",s);for(var e=0;e<t.length;e++){t[e].removeEventListener("cuechange",a)}})},t.prototype.addTextTrack=function(e,t,n){if(!e)throw new Error("TextTrack kind is required but was not provided");return he(this,e,t,n)},t.prototype.createRemoteTextTrack=function(e){var t=ie(e,{tech:this});return new Un.remoteTextEl.TrackClass(t)},t.prototype.addRemoteTextTrack=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1],i=this.createRemoteTextTrack(t);return!0!==n&&!1!==n&&(vt.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),n=!0),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!0!==n&&this.ready(function(){return e.autoRemoteTextTracks_.addTrack(i.track)}),i},t.prototype.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},t.prototype.getVideoPlaybackQuality=function(){return{}},t.prototype.setPoster=function(){},t.prototype.playsinline=function(){},t.prototype.setPlaysinline=function(){},t.prototype.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,n){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,n){if(t.techs_||(t.techs_={}),!t.isTech(n))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=te(e),t.techs_[e]=n,"Tech"!==e&&t.defaultTechOrder_.push(e),n},t.getTech=function(e){if(e)return e=te(e),t.techs_&&t.techs_[e]?t.techs_[e]:De&&De.videojs&&De.videojs[e]?(vt.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),De.videojs[e]):void 0},t}(Yt);Bn.names.forEach(function(e){var t=Bn[e];jn.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),jn.prototype.featuresVolumeControl=!0,jn.prototype.featuresMuteControl=!0,jn.prototype.featuresFullscreenResize=!1,jn.prototype.featuresPlaybackRate=!1,jn.prototype.featuresProgressEvents=!1,jn.prototype.featuresSourceset=!1,jn.prototype.featuresTimeupdateEvents=!1,jn.prototype.featuresNativeTextTracks=!1,jn.withSourceHandlers=function(e){e.registerSourceHandler=function(t,n){var i=e.sourceHandlers;i||(i=e.sourceHandlers=[]),void 0===n&&(n=i.length),i.splice(n,0,t)},e.canPlayType=function(t){for(var n=e.sourceHandlers||[],i=void 0,r=0;r<n.length;r++)if(i=n[r].canPlayType(t))return i;return""},e.selectSourceHandler=function(t,n){for(var i=e.sourceHandlers||[],r=0;r<i.length;r++)if(i[r].canHandleSource(t,n))return i[r];return null},e.canPlaySource=function(t,n){var i=e.selectSourceHandler(t,n);return i?i.canHandleSource(t,n):""},["seekable","seeking","duration"].forEach(function(e){var t=this[e];"function"==typeof t&&(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){var n=e.selectSourceHandler(t,this.options_);n||(e.nativeSourceHandler?n=e.nativeSourceHandler:vt.error("No source hander 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.on("dispose",this.disposeSourceHandler)},e.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)}},Yt.registerComponent("Tech",jn),jn.registerTech("Tech",jn),jn.defaultTechOrder_=[];var Fn={},Hn={},qn={},Vn={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1},Wn={setCurrentTime:1},Gn={play:1,pause:1},zn={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL"},Xn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=kn(e);return zn[t.toLowerCase()]||""},Yn=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var n=e.cache_.sources.filter(function(e){return e.src===t});if(n.length)return n[0].type;for(var i=e.$$("source"),r=0;r<i.length;r++){var a=i[r];if(a.type&&a.src&&a.src===t)return a.type}return Xn(t)},Kn=function e(t){if(Array.isArray(t)){var n=[];t.forEach(function(t){t=e(t),Array.isArray(t)?n=n.concat(t):o(t)&&n.push(t)}),t=n}else t="string"==typeof t&&t.trim()?[we({src:t})]:o(t)&&"string"==typeof t.src&&t.src&&t.src.trim()?[we(t)]:[];return t},Qn=function(e){function t(n,i,r){ct(this,t);var a=ie({createEl:!1},i),s=ht(this,e.call(this,n,a,r));if(i.playerOptions.sources&&0!==i.playerOptions.sources.length)n.src(i.playerOptions.sources);else for(var o=0,u=i.playerOptions.techOrder;o<u.length;o++){var l=te(u[o]),c=jn.getTech(l);if(l||(c=Yt.getComponent(l)),c&&c.isSupported()){n.loadTech_(l);break}}return s}return dt(t,e),t}(Yt);Yt.registerComponent("MediaLoader",Qn);var $n=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.emitTapEvents(),r.enable(),r}return dt(t,e),t.prototype.createEl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n=s({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},n),"button"===t&&vt.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),i=s({role:"button"},i),this.tabIndex_=n.tabIndex;var r=e.prototype.createEl.call(this,t,n,i);return this.createControlTextEl(r),r},t.prototype.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},t.prototype.createControlTextEl=function(e){return this.controlTextEl_=v("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},t.prototype.controlText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(void 0===e)return this.controlText_||"Need Text";var n=this.localize(e);this.controlText_=e,_(this.controlTextEl_,n),this.nonIconControl||t.setAttribute("title",n)},t.prototype.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},t.prototype.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur))},t.prototype.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off(["tap","click"],this.handleClick),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur)},t.prototype.handleClick=function(e){},t.prototype.handleFocus=function(e){Y(Re,"keydown",Mt(this,this.handleKeyPress))},t.prototype.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.trigger("click")):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t.prototype.handleBlur=function(e){K(Re,"keydown",Mt(this,this.handleKeyPress))},t}(Yt);Yt.registerComponent("ClickableComponent",$n);var Jn=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.update(),n.on("posterchange",Mt(r,r.update)),r}return dt(t,e),t.prototype.dispose=function(){this.player().off("posterchange",this.update),e.prototype.dispose.call(this)},t.prototype.createEl=function(){var e=v("div",{className:"vjs-poster",tabIndex:-1});return ot||(this.fallbackImg_=v("img"),e.appendChild(this.fallbackImg_)),e},t.prototype.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},t.prototype.setSrc=function(e){if(this.fallbackImg_)this.fallbackImg_.src=e;else{var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t}},t.prototype.handleClick=function(e){this.player_.controls()&&(this.player_.paused()?de(this.player_.play()):this.player_.pause())},t}($n);Yt.registerComponent("PosterImage",Jn);var Zn={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'},ei=function(e){function t(n,i,r){ct(this,t);var a=ht(this,e.call(this,n,i,r)),s=Mt(a,a.updateDisplay);return n.on("loadstart",Mt(a,a.toggleDisplay)),n.on("texttrackchange",s),n.on("loadstart",Mt(a,a.preselectTrack)),n.ready(Mt(a,function(){if(n.tech_&&n.tech_.featuresNativeTextTracks)return void this.hide();n.on("fullscreenchange",s),n.on("playerresize",s),De.addEventListener&&De.addEventListener("orientationchange",s),n.on("dispose",function(){return De.removeEventListener("orientationchange",s)});for(var e=this.options_.playerOptions.tracks||[],t=0;t<e.length;t++)this.player_.addRemoteTextTrack(e[t],!0);this.preselectTrack()})),a}return dt(t,e),t.prototype.preselectTrack=function(){for(var e={captions:1,subtitles:1},t=this.player_.textTracks(),n=this.player_.cache_.selectedLanguage,i=void 0,r=void 0,a=void 0,s=0;s<t.length;s++){var o=t[s];n&&n.enabled&&n.language===o.language?o.kind===n.kind?a=o:a||(a=o):n&&!n.enabled?(a=null,i=null,r=null):o.default&&("descriptions"!==o.kind||i?o.kind in e&&!r&&(r=o):i=o)}a?a.mode="showing":r?r.mode="showing":i&&(i.mode="showing")},t.prototype.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},t.prototype.clearDisplay=function(){"function"==typeof De.WebVTT&&De.WebVTT.processCues(De,[],this.el_)},t.prototype.updateDisplay=function(){var e=this.player_.textTracks();this.clearDisplay();for(var t=null,n=null,i=e.length;i--;){var r=e[i];"showing"===r.mode&&("descriptions"===r.kind?t=r:n=r)}n?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(n)):t&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(t))},t.prototype.updateForTrack=function(e){if("function"==typeof De.WebVTT&&e.activeCues){for(var t=[],n=0;n<e.activeCues.length;n++)t.push(e.activeCues[n]);if(De.WebVTT.processCues(De,t,this.el_),this.player_.textTrackSettings)for(var i=this.player_.textTrackSettings.getValues(),r=t.length;r--;){var a=t[r];if(a){var s=a.displayState;if(i.color&&(s.firstChild.style.color=i.color),i.textOpacity&&Ce(s.firstChild,"color",ke(i.color||"#fff",i.textOpacity)),i.backgroundColor&&(s.firstChild.style.backgroundColor=i.backgroundColor),i.backgroundOpacity&&Ce(s.firstChild,"backgroundColor",ke(i.backgroundColor||"#000",i.backgroundOpacity)),i.windowColor&&(i.windowOpacity?Ce(s,"backgroundColor",ke(i.windowColor,i.windowOpacity)):s.style.backgroundColor=i.windowColor),i.edgeStyle&&("dropshadow"===i.edgeStyle?s.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222":"raised"===i.edgeStyle?s.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222":"depressed"===i.edgeStyle?s.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222":"uniform"===i.edgeStyle&&(s.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222")),i.fontPercent&&1!==i.fontPercent){var o=De.parseFloat(s.style.fontSize);s.style.fontSize=o*i.fontPercent+"px",s.style.height="auto",s.style.top="auto",s.style.bottom="2px"}i.fontFamily&&"default"!==i.fontFamily&&("small-caps"===i.fontFamily?s.firstChild.style.fontVariant="small-caps":s.firstChild.style.fontFamily=Zn[i.fontFamily])}}}},t}(Yt);Yt.registerComponent("TextTrackDisplay",ei);var ti=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.createEl=function(){var t=this.player_.isAudio(),n=this.localize(t?"Audio Player":"Video Player"),i=v("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[n])}),r=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(i),r},t}(Yt);Yt.registerComponent("LoadingSpinner",ti);var ni=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.createEl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e="button",t=s({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},t),n=s({type:"button"},n);var i=Yt.prototype.createEl.call(this,e,t,n);return this.createControlTextEl(i),i},t.prototype.addChild=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.constructor.name;return vt.warn("Adding an actionable (user controllable) child to a Button ("+n+") is not supported; use a ClickableComponent instead."),Yt.prototype.addChild.call(this,e,t)},t.prototype.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},t.prototype.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},t.prototype.handleKeyPress=function(t){32!==t.which&&13!==t.which&&e.prototype.handleKeyPress.call(this,t)},t}($n);Yt.registerComponent("Button",ni);var ii=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.mouseused_=!1,r.on("mousedown",r.handleMouseDown),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-big-play-button"},t.prototype.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)return void de(t);var n=this.player_.getChild("controlBar"),i=n&&n.getChild("playToggle");if(!i)return void this.player_.focus();var r=function(){return i.focus()};ce(t)?t.then(r,function(){}):this.setTimeout(r,1)},t.prototype.handleKeyPress=function(t){this.mouseused_=!1,e.prototype.handleKeyPress.call(this,t)},t.prototype.handleMouseDown=function(e){this.mouseused_=!0},t}(ni);ii.prototype.controlText_="Play Video",Yt.registerComponent("BigPlayButton",ii);var ri=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.controlText(i&&i.controlText||r.localize("Close")),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},t}(ni);Yt.registerComponent("CloseButton",ri);var ai=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.on(n,"play",r.handlePlay),r.on(n,"pause",r.handlePause),r.on(n,"ended",r.handleEnded),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.prototype.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},t.prototype.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.prototype.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.prototype.handleEnded=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},t}(ni);ai.prototype.controlText_="Play",Yt.registerComponent("PlayToggle",ai);var si=function(e,t){e=e<0?0:e;var n=Math.floor(e%60),i=Math.floor(e/60%60),r=Math.floor(e/3600),a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=i=n="-"),r=r>0||s>0?r+":":"",i=((r||a>=10)&&i<10?"0"+i:i)+":",n=n<10?"0"+n:n,r+i+n},oi=si,ui=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return oi(e,t)},li=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.throttledUpdateContent=Nt(Mt(r,r.updateContent),25),r.on(n,"timeupdate",r.throttledUpdateContent),r}return dt(t,e),t.prototype.createEl=function(t){var n=this.buildCSSClass(),i=e.prototype.createEl.call(this,"div",{className:n+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text">'+this.localize(this.labelText_)+"\xa0</span>"});return this.contentEl_=v("span",{className:n+"-display"},{"aria-live":"off"}),this.updateTextNode_(),i.appendChild(this.contentEl_),i},t.prototype.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},t.prototype.updateTextNode_=function(){if(this.contentEl_){for(;this.contentEl_.firstChild;)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=Re.createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},t.prototype.formatTime_=function(e){return ui(e)},t.prototype.updateFormattedTime_=function(e){var t=this.formatTime_(e);t!==this.formattedTime_&&(this.formattedTime_=t,this.requestAnimationFrame(this.updateTextNode_))},t.prototype.updateContent=function(e){},t}(Yt);li.prototype.labelText_="Time",li.prototype.controlText_="Time",Yt.registerComponent("TimeDisplay",li);var ci=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.on(n,"ended",r.handleEnded),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-current-time"},t.prototype.updateContent=function(e){var t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(t)},t.prototype.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},t}(li);ci.prototype.labelText_="Current Time",ci.prototype.controlText_="Current Time",Yt.registerComponent("CurrentTimeDisplay",ci);var di=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.on(n,"durationchange",r.updateContent),r.on(n,"loadedmetadata",r.throttledUpdateContent),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-duration"},t.prototype.updateContent=function(e){var t=this.player_.duration();t&&this.duration_!==t&&(this.duration_=t,this.updateFormattedTime_(t))},t}(li);di.prototype.labelText_="Duration",di.prototype.controlText_="Duration",Yt.registerComponent("DurationDisplay",di);var hi=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"})},t}(Yt);Yt.registerComponent("TimeDivider",hi);var pi=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.on(n,"durationchange",r.throttledUpdateContent),r.on(n,"ended",r.handleEnded),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-remaining-time"},t.prototype.formatTime_=function(t){return"-"+e.prototype.formatTime_.call(this,t)},t.prototype.updateContent=function(e){this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},t.prototype.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(0)},t}(li);pi.prototype.labelText_="Remaining Time",pi.prototype.controlText_="Remaining Time",Yt.registerComponent("RemainingTimeDisplay",pi);var fi=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.updateShowing(),r.on(r.player(),"durationchange",r.updateShowing),r}return dt(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=v("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+"\xa0</span>"+this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},t.prototype.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},t.prototype.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(Yt);Yt.registerComponent("LiveDisplay",fi);var mi=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.bar=r.getChild(r.options_.barName),r.vertical(!!r.options_.vertical),r.enable(),r}return dt(t,e),t.prototype.enabled=function(){return this.enabled_},t.prototype.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur),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)},t.prototype.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur),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}},t.prototype.createEl=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.className=n.className+" vjs-slider",n=s({tabIndex:0},n),i=s({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},i),e.prototype.createEl.call(this,t,n,i)},t.prototype.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||et||e.preventDefault(),P(),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)},t.prototype.handleMouseMove=function(e){},t.prototype.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;O(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),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.update()},t.prototype.update=function(){if(this.el_){var e=this.getPercent(),t=this.bar;if(t){("number"!=typeof e||e!==e||e<0||e===1/0)&&(e=0);var n=(100*e).toFixed(2)+"%",i=t.el().style;return this.vertical()?i.height=n:i.width=n,e}}},t.prototype.calculateDistance=function(e){var t=R(this.el_,e);return this.vertical()?t.y:t.x},t.prototype.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},t.prototype.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepBack()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepForward())},t.prototype.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},t.prototype.handleClick=function(e){e.stopImmediatePropagation(),e.preventDefault()},t.prototype.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(Yt);Yt.registerComponent("Slider",mi);var gi=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.partEls_=[],r.on(n,"progress",r.update),r}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+"</span>: 0%</span>"})},t.prototype.dispose=function(){this.partEls_=null,e.prototype.dispose.call(this)},t.prototype.update=function(e){var t=this.player_.buffered(),n=this.player_.duration(),i=this.player_.bufferedEnd(),r=this.partEls_,a=function(e,t){var n=e/t||0;return 100*(n>=1?1:n)+"%"};this.el_.style.width=a(i,n);for(var s=0;s<t.length;s++){var o=t.start(s),u=t.end(s),l=r[s];l||(l=this.el_.appendChild(v()),r[s]=l),l.style.left=a(o,i),l.style.width=a(u-o,i)}for(var c=r.length;c>t.length;c--)this.el_.removeChild(r[c-1]);r.length=t.length},t}(Yt);Yt.registerComponent("LoadProgressBar",gi);var yi=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"})},t.prototype.update=function(e,t,n){var i=L(this.el_),r=L(this.player_.el()),a=e.width*t;if(r&&i){var s=e.left-r.left+a,o=e.width-a+(r.right-e.right),u=i.width/2;s<u?u+=u-s:o<u&&(u=o),u<0?u=0:u>i.width&&(u=i.width),this.el_.style.right="-"+u+"px",_(this.el_,n)}},t}(Yt);Yt.registerComponent("TimeTooltip",yi);var vi=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Progress")+"</span>: 0%</span>"})},t.prototype.update=function(e,t){var n=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var i=n.player_.scrubbing()?n.player_.getCache().currentTime:n.player_.currentTime(),r=ui(i,n.player_.duration()),a=n.getChild("timeTooltip");a&&a.update(e,t,r)})},t}(Yt);vi.prototype.options_={children:[]},it&&!(it>8)||ze||Ye||vi.prototype.options_.children.push("timeTooltip"),Yt.registerComponent("PlayProgressBar",vi);var _i=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.update=Nt(Mt(r,r.update),25),r}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.prototype.update=function(e,t){var n=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var i=n.player_.duration(),r=ui(t*i,i);n.el_.style.left=e.width*t+"px",n.getChild("timeTooltip").update(e,t,r)})},t}(Yt);_i.prototype.options_={children:["timeTooltip"]},Yt.registerComponent("MouseTimeDisplay",_i);var bi=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.setEventHandlers_(),r}return dt(t,e),t.prototype.setEventHandlers_=function(){var e=this;this.update=Nt(Mt(this,this.update),30),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.updateInterval=null,this.on(this.player_,["playing"],function(){e.clearInterval(e.updateInterval),e.updateInterval=e.setInterval(function(){e.requestAnimationFrame(function(){e.update()})},30)}),this.on(this.player_,["ended","pause","waiting"],function(){e.clearInterval(e.updateInterval)}),this.on(this.player_,["timeupdate","ended"],this.update)},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.prototype.update_=function(e,t){var n=this.player_.duration();this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[ui(e,n),ui(n,n)],"{1} of {2}")),this.bar.update(L(this.el_),t)},t.prototype.update=function(t){var n=e.prototype.update.call(this);return this.update_(this.getCurrentTime_(),n),n},t.prototype.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.prototype.handleEnded=function(e){this.update_(this.player_.duration(),1)},t.prototype.getPercent=function(){var e=this.getCurrentTime_()/this.player_.duration();return e>=1?1:e},t.prototype.handleMouseDown=function(t){F(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},t.prototype.handleMouseMove=function(e){if(F(e)){var t=this.calculateDistance(e)*this.player_.duration();t===this.player_.duration()&&(t-=.1),this.player_.currentTime(t)}},t.prototype.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},t.prototype.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},t.prototype.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&de(this.player_.play())},t.prototype.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},t.prototype.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},t.prototype.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.prototype.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.handleAction(t)):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t}(mi);bi.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},it&&!(it>8)||ze||Ye||bi.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),bi.prototype.playerEvent="timeupdate",Yt.registerComponent("SeekBar",bi);var Ti=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.handleMouseMove=Nt(Mt(r,r.handleMouseMove),25),r.throttledHandleMouseSeek=Nt(Mt(r,r.handleMouseSeek),25),r.enable(),r}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.prototype.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var n=t.getChild("mouseTimeDisplay"),i=t.el(),r=L(i),a=R(i,e).x;a>1?a=1:a<0&&(a=0),n&&n.update(r,a)}},t.prototype.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},t.prototype.enabled=function(){return this.enabled_},t.prototype.disable=function(){this.children().forEach(function(e){return e.disable&&e.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},t.prototype.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.prototype.handleMouseDown=function(e){var 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.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseUp=function(e){var t=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.handleMouseUp(e),this.off(t,"mousemove",this.throttledHandleMouseSeek),this.off(t,"touchmove",this.throttledHandleMouseSeek),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t}(Yt);Ti.prototype.options_={children:["seekBar"]},Yt.registerComponent("ProgressControl",Ti);var Si=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.on(n,"fullscreenchange",r.handleFullscreenChange),!1===Re[Kt.fullscreenEnabled]&&r.disable(),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.prototype.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(ni);Si.prototype.controlText_="Fullscreen",Yt.registerComponent("FullscreenToggle",Si);var Ei=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")})},wi=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},t}(Yt);Yt.registerComponent("VolumeLevel",wi);var ki=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.on("slideractive",r.updateLastVolume_),r.on(n,"volumechange",r.updateARIAAttributes),n.ready(function(){return r.updateARIAAttributes()}),r}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.prototype.handleMouseDown=function(t){F(t)&&e.prototype.handleMouseDown.call(this,t)},t.prototype.handleMouseMove=function(e){F(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},t.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.prototype.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},t.prototype.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},t.prototype.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(t)})},t}(mi);ki.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},ki.prototype.playerEvent="volumechange",Yt.registerComponent("VolumeBar",ki);var Ci=function(e){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ct(this,t),i.vertical=i.vertical||!1,(void 0===i.volumeBar||u(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical);var r=ht(this,e.call(this,n,i));return Ei(r,n),r.throttledHandleMouseMove=Nt(Mt(r,r.handleMouseMove),25),r.on("mousedown",r.handleMouseDown),r.on("touchstart",r.handleMouseDown),r.on(r.volumeBar,["focus","slideractive"],function(){r.volumeBar.addClass("vjs-slider-active"),r.addClass("vjs-slider-active"),r.trigger("slideractive")}),r.on(r.volumeBar,["blur","sliderinactive"],function(){r.volumeBar.removeClass("vjs-slider-active"),r.removeClass("vjs-slider-active"),r.trigger("sliderinactive")}),r}return dt(t,e),t.prototype.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},t.prototype.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(Yt);Ci.prototype.options_={children:["volumeBar"]},Yt.registerComponent("VolumeControl",Ci);var Ai=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")})},Ii=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return Ai(r,n),r.on(n,["loadstart","volumechange"],r.update),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){var t=this.player_.volume(),n=this.player_.lastVolume_();if(0===t){var i=n<.1?.1:n;this.player_.volume(i),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},t.prototype.update=function(e){this.updateIcon_(),this.updateControlText_()},t.prototype.updateIcon_=function(){var e=this.player_.volume(),t=3;ze&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var n=0;n<4;n++)E(this.el_,"vjs-vol-"+n);S(this.el_,"vjs-vol-"+t)},t.prototype.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume(),t=e?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)},t}(ni);Ii.prototype.controlText_="Mute",Yt.registerComponent("MuteToggle",Ii);var xi=function(e){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ct(this,t),void 0!==i.inline?i.inline=i.inline:i.inline=!0,(void 0===i.volumeControl||u(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline);var r=ht(this,e.call(this,n,i));return r.on(n,["loadstart"],r.volumePanelState_),r.on(r.volumeControl,["slideractive"],r.sliderActive_),r.on(r.volumeControl,["sliderinactive"],r.sliderInactive_),r}return dt(t,e),t.prototype.sliderActive_=function(){this.addClass("vjs-slider-active")},t.prototype.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.prototype.volumePanelState_=function(){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")},t.prototype.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},t}(Yt);xi.prototype.options_={children:["muteToggle","volumeControl"]},Yt.registerComponent("VolumePanel",xi);var Pi=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return i&&(r.menuButton_=i.menuButton),r.focusedChild_=-1,r.on("keydown",r.handleKeyPress),r}return dt(t,e),t.prototype.addItem=function(e){this.addChild(e),e.on("click",Mt(this,function(t){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==e.name()&&this.menuButton_.focus())}))},t.prototype.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=v(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),Y(n,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),n},t.prototype.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},t.prototype.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepForward()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepBack())},t.prototype.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},t.prototype.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},t.prototype.focus=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.children().slice();t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className)&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(Yt);Yt.registerComponent("Menu",Pi);var Oi=function(e){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ct(this,t);var r=ht(this,e.call(this,n,i));r.menuButton_=new ni(n,i),r.menuButton_.controlText(r.controlText_),r.menuButton_.el_.setAttribute("aria-haspopup","true");var a=ni.prototype.buildCSSClass();return r.menuButton_.el_.className=r.buildCSSClass()+" "+a,r.menuButton_.removeClass("vjs-control"),r.addChild(r.menuButton_),r.update(),r.enabled_=!0,r.on(r.menuButton_,"tap",r.handleClick),r.on(r.menuButton_,"click",r.handleClick),r.on(r.menuButton_,"focus",r.handleFocus),r.on(r.menuButton_,"blur",r.handleBlur),r.on("keydown",r.handleSubmenuKeyPress),r}return dt(t,e),t.prototype.update=function(){var 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.show()},t.prototype.createMenu=function(){var e=new Pi(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=v("li",{className:"vjs-menu-title",innerHTML:te(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,e.children_.unshift(t),b(t,e.contentEl())}if(this.items=this.createItems(),this.items)for(var n=0;n<this.items.length;n++)e.addItem(this.items[n]);return e},t.prototype.createItems=function(){},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},t.prototype.buildWrapperCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+ni.prototype.buildCSSClass()+" "+e.prototype.buildCSSClass.call(this)},t.prototype.buildCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+e.prototype.buildCSSClass.call(this)},t.prototype.controlText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(e,t)},t.prototype.handleClick=function(e){this.one(this.menu.contentEl(),"mouseleave",Mt(this,function(e){this.unpressButton(),this.el_.blur()})),this.buttonPressed_?this.unpressButton():this.pressButton()},t.prototype.focus=function(){this.menuButton_.focus()},t.prototype.blur=function(){this.menuButton_.blur()},t.prototype.handleFocus=function(){Y(Re,"keydown",Mt(this,this.handleKeyPress))},t.prototype.handleBlur=function(){K(Re,"keydown",Mt(this,this.handleKeyPress))},t.prototype.handleKeyPress=function(e){27===e.which||9===e.which?(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus())):38!==e.which&&40!==e.which||this.buttonPressed_||(this.pressButton(),e.preventDefault())},t.prototype.handleSubmenuKeyPress=function(e){27!==e.which&&9!==e.which||(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus()))},t.prototype.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),ze&&g())return;this.menu.focus()}},t.prototype.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},t.prototype.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},t.prototype.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(Yt);Yt.registerComponent("MenuButton",Oi);var Li=function(e){function t(n,i){ct(this,t);var r=i.tracks,a=ht(this,e.call(this,n,i));if(a.items.length<=1&&a.hide(),!r)return ht(a);var s=Mt(a,a.update);return r.addEventListener("removetrack",s),r.addEventListener("addtrack",s),a.player_.on("ready",s),a.player_.on("dispose",function(){r.removeEventListener("removetrack",s),r.removeEventListener("addtrack",s)}),a}return dt(t,e),t}(Oi);Yt.registerComponent("TrackButton",Li);var Di=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.selectable=i.selectable,r.isSelected_=i.selected||!1,r.multiSelectable=i.multiSelectable,r.selected(r.isSelected_),r.selectable?r.multiSelectable?r.el_.setAttribute("role","menuitemcheckbox"):r.el_.setAttribute("role","menuitemradio"):r.el_.setAttribute("role","menuitem"),r}return dt(t,e),t.prototype.createEl=function(t,n,i){return this.nonIconControl=!0,e.prototype.createEl.call(this,"li",s({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},n),i)},t.prototype.handleClick=function(e){this.selected(!0)},t.prototype.selected=function(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))},t}($n);Yt.registerComponent("MenuItem",Di);var Ri=function(e){function t(n,i){ct(this,t);var r=i.track,a=n.textTracks();i.label=r.label||r.language||"Unknown",i.selected="showing"===r.mode;var s=ht(this,e.call(this,n,i));s.track=r;var o=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];s.handleTracksChange.apply(s,t)},u=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];s.handleSelectedLanguageChange.apply(s,t)};if(n.on(["loadstart","texttrackchange"],o),a.addEventListener("change",o),a.addEventListener("selectedlanguagechange",u),s.on("dispose",function(){n.off(["loadstart","texttrackchange"],o),a.removeEventListener("change",o),a.removeEventListener("selectedlanguagechange",u)}),void 0===a.onchange){var l=void 0;s.on(["tap","click"],function(){if("object"!==lt(De.Event))try{l=new De.Event("change")}catch(e){}l||(l=Re.createEvent("Event"),l.initEvent("change",!0,!0)),a.dispatchEvent(l)})}return s.handleTracksChange(),s}return dt(t,e),t.prototype.handleClick=function(t){var n=this.track.kind,i=this.track.kinds,r=this.player_.textTracks();if(i||(i=[n]),e.prototype.handleClick.call(this,t),r)for(var a=0;a<r.length;a++){var s=r[a];s===this.track&&i.indexOf(s.kind)>-1?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled")}},t.prototype.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},t.prototype.handleSelectedLanguageChange=function(e){if("showing"===this.track.mode){var 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}}},t.prototype.dispose=function(){this.track=null,e.prototype.dispose.call(this)},t}(Di);Yt.registerComponent("TextTrackMenuItem",Ri);var Mi=function(e){function t(n,i){return ct(this,t),i.track={player:n,kind:i.kind,kinds:i.kinds,default:!1,mode:"disabled"},i.kinds||(i.kinds=[i.kind]),i.label?i.track.label=i.label:i.track.label=i.kinds.join(" and ")+" off",i.selectable=!0,i.multiSelectable=!1,ht(this,e.call(this,n,i))}return dt(t,e),t.prototype.handleTracksChange=function(e){for(var t=this.player().textTracks(),n=!0,i=0,r=t.length;i<r;i++){var a=t[i];if(this.options_.kinds.indexOf(a.kind)>-1&&"showing"===a.mode){n=!1;break}}n!==this.isSelected_&&this.selected(n)},t.prototype.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),n=!0,i=0,r=t.length;i<r;i++){var a=t[i];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&"showing"===a.mode){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(Ri);Yt.registerComponent("OffTextTrackMenuItem",Mi);var Ni=function(e){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ct(this,t),i.tracks=n.textTracks(),ht(this,e.call(this,n,i))}return dt(t,e),t.prototype.createItems=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ri,n=void 0;this.label_&&(n=this.label_+" off"),e.push(new Mi(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;var i=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r<i.length;r++){var a=i[r];if(this.kinds_.indexOf(a.kind)>-1){var s=new t(this.player_,{track:a,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),e.push(s)}}return e},t}(Li);Yt.registerComponent("TextTrackButton",Ni);var Ui=function(e){function t(n,i){ct(this,t);var r=i.track,a=i.cue,s=n.currentTime();i.selectable=!0,i.multiSelectable=!1,i.label=a.text,i.selected=a.startTime<=s&&s<a.endTime;var o=ht(this,e.call(this,n,i));return o.track=r,o.cue=a,r.addEventListener("cuechange",Mt(o,o.update)),o}return dt(t,e),t.prototype.handleClick=function(t){e.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},t.prototype.update=function(e){var t=this.cue,n=this.player_.currentTime();this.selected(t.startTime<=n&&n<t.endTime)},t}(Di);Yt.registerComponent("ChaptersTrackMenuItem",Ui);var Bi=function(e){function t(n,i,r){return ct(this,t),ht(this,e.call(this,n,i,r))}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.update=function(t){this.track_&&(!t||"addtrack"!==t.type&&"removetrack"!==t.type)||this.setTrack(this.findChaptersTrack()),e.prototype.update.call(this)},t.prototype.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var n=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);n&&n.addEventListener("load",this.updateHandler_)}}},t.prototype.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;t>=0;t--){var n=e[t];if(n.kind===this.kind_)return n}},t.prototype.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(te(this.kind_))},t.prototype.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},t.prototype.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var n=0,i=t.length;n<i;n++){var r=t[n],a=new Ui(this.player_,{track:this.track_,cue:r});e.push(a)}return e},t}(Ni);Bi.prototype.kind_="chapters",Bi.prototype.controlText_="Chapters",Yt.registerComponent("ChaptersButton",Bi);var ji=function(e){function t(n,i,r){ct(this,t);var a=ht(this,e.call(this,n,i,r)),s=n.textTracks(),o=Mt(a,a.handleTracksChange);return s.addEventListener("change",o),a.on("dispose",function(){s.removeEventListener("change",o)}),a}return dt(t,e),t.prototype.handleTracksChange=function(e){for(var t=this.player().textTracks(),n=!1,i=0,r=t.length;i<r;i++){var a=t[i];if(a.kind!==this.kind_&&"showing"===a.mode){n=!0;break}}n?this.disable():this.enable()},t.prototype.buildCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Ni);ji.prototype.kind_="descriptions",ji.prototype.controlText_="Descriptions",Yt.registerComponent("DescriptionsButton",ji);var Fi=function(e){function t(n,i,r){return ct(this,t),ht(this,e.call(this,n,i,r))}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Ni);Fi.prototype.kind_="subtitles",Fi.prototype.controlText_="Subtitles",Yt.registerComponent("SubtitlesButton",Fi);var Hi=function(e){function t(n,i){ct(this,t),i.track={player:n,kind:i.kind,label:i.kind+" settings",selectable:!1,default:!1,mode:"disabled"},i.selectable=!1,i.name="CaptionSettingsMenuItem";var r=ht(this,e.call(this,n,i));return r.addClass("vjs-texttrack-settings"),r.controlText(", opens "+i.kind+" settings dialog"),r}return dt(t,e),t.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}(Ri);Yt.registerComponent("CaptionSettingsMenuItem",Hi);var qi=function(e){function t(n,i,r){return ct(this,t),ht(this,e.call(this,n,i,r))}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new Hi(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t)},t}(Ni);qi.prototype.kind_="captions",qi.prototype.controlText_="Captions",Yt.registerComponent("CaptionsButton",qi);var Vi=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.createEl=function(t,n,i){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"captions"===this.options_.track.kind&&(r+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n "),r+="</span>",e.prototype.createEl.call(this,t,s({innerHTML:r},n),i)},t}(Ri);Yt.registerComponent("SubsCapsMenuItem",Vi);var Wi=function(e){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ct(this,t);var r=ht(this,e.call(this,n,i));return r.label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(r.player_.language_)>-1&&(r.label_="captions"),r.menuButton_.controlText(te(r.label_)),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new Hi(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,Vi)},t}(Ni);Wi.prototype.kinds_=["captions","subtitles"],Wi.prototype.controlText_="Subtitles",Yt.registerComponent("SubsCapsButton",Wi);var Gi=function(e){function t(n,i){ct(this,t);var r=i.track,a=n.audioTracks();i.label=r.label||r.language||"Unknown",i.selected=r.enabled;var s=ht(this,e.call(this,n,i));s.track=r,s.addClass("vjs-"+r.kind+"-menu-item");var o=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];s.handleTracksChange.apply(s,t)};return a.addEventListener("change",o),s.on("dispose",function(){a.removeEventListener("change",o)}),s}return dt(t,e),t.prototype.createEl=function(t,n,i){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"main-desc"===this.options_.track.kind&&(r+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Descriptions")+"</span>\n "),r+="</span>",e.prototype.createEl.call(this,t,s({innerHTML:r},n),i)},t.prototype.handleClick=function(t){var n=this.player_.audioTracks();e.prototype.handleClick.call(this,t);for(var i=0;i<n.length;i++){var r=n[i];r.enabled=r===this.track}},t.prototype.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(Di);Yt.registerComponent("AudioTrackMenuItem",Gi);var zi=function(e){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ct(this,t),i.tracks=n.audioTracks(),ht(this,e.call(this,n,i))}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createItems=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.hideThreshold_=1;for(var t=this.player_.audioTracks(),n=0;n<t.length;n++){var i=t[n];e.push(new Gi(this.player_,{track:i,selectable:!0,multiSelectable:!1}))}return e},t}(Li);zi.prototype.controlText_="Audio Track",Yt.registerComponent("AudioTrackButton",zi);var Xi=function(e){function t(n,i){ct(this,t);var r=i.rate,a=parseFloat(r,10);i.label=r,i.selected=1===a,i.selectable=!0,i.multiSelectable=!1;var s=ht(this,e.call(this,n,i));return s.label=r,s.rate=a,s.on(n,"ratechange",s.update),s}return dt(t,e),t.prototype.handleClick=function(t){e.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},t.prototype.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(Di);Xi.prototype.contentElType="button",Yt.registerComponent("PlaybackRateMenuItem",Xi);var Yi=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.updateVisibility(),r.updateLabel(),r.on(n,"loadstart",r.updateVisibility),r.on(n,"ratechange",r.updateLabel),r}return dt(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this);return this.labelEl_=v("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),t.appendChild(this.labelEl_),t},t.prototype.dispose=function(){this.labelEl_=null,e.prototype.dispose.call(this)},t.prototype.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createMenu=function(){var e=new Pi(this.player()),t=this.playbackRates();if(t)for(var n=t.length-1;n>=0;n--)e.addChild(new Xi(this.player(),{rate:t[n]+"x"}));return e},t.prototype.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},t.prototype.handleClick=function(e){for(var t=this.player().playbackRate(),n=this.playbackRates(),i=n[0],r=0;r<n.length;r++)if(n[r]>t){i=n[r];break}this.player().playbackRate(i)},t.prototype.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},t.prototype.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},t.prototype.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},t.prototype.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},t}(Oi);Yi.prototype.controlText_="Playback Rate",Yt.registerComponent("PlaybackRateMenuButton",Yi);var Ki=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},t}(Yt);Yt.registerComponent("Spacer",Ki);var Qi=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,{className:this.buildCSSClass()});return t.innerHTML="\xa0",t},t}(Ki);Yt.registerComponent("CustomControlSpacer",Qi);var $i=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(Yt);$i.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},Yt.registerComponent("ControlBar",$i);var Ji=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.on(n,"error",r.open),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},t.prototype.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(un);Ji.prototype.options_=ie(un.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Yt.registerComponent("ErrorDisplay",Ji);var Zi=["#000","Black"],er=["#00F","Blue"],tr=["#0FF","Cyan"],nr=["#0F0","Green"],ir=["#F0F","Magenta"],rr=["#F00","Red"],ar=["#FFF","White"],sr=["#FF0","Yellow"],or=["1","Opaque"],ur=["0.5","Semi-Transparent"],lr=["0","Transparent"],cr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Zi,ar,rr,nr,er,sr,ir,tr]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[or,ur,lr]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[ar,Zi,rr,nr,er,sr,ir,tr]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",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:"captions-font-size-%s",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:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[or,ur]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[lr,ur,or]}};cr.windowColor.options=cr.backgroundColor.options;var dr=function(e){function t(n,i){ct(this,t),i.temporary=!1;var a=ht(this,e.call(this,n,i));return a.updateDisplay=Mt(a,a.updateDisplay),a.fill(),a.hasBeenOpened_=a.hasBeenFilled_=!0,a.endDialog=v("p",{className:"vjs-control-text",textContent:a.localize("End of dialog window.")}),a.el().appendChild(a.endDialog),a.setDefaults(),void 0===i.persistTextTrackSettings&&(a.options_.persistTextTrackSettings=a.options_.playerOptions.persistTextTrackSettings),a.on(a.$(".vjs-done-button"),"click",function(){a.saveSettings(),a.close()}),a.on(a.$(".vjs-default-button"),"click",function(){a.setDefaults(),a.updateDisplay()}),r(cr,function(e){a.on(a.$(e.selector),"change",a.updateDisplay)}),a.options_.persistTextTrackSettings&&a.restoreSettings(),a}return dt(t,e),t.prototype.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},t.prototype.createElSelect_=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"label",r=cr[e],a=r.id.replace("%s",this.id_),s=[n,a].join(" ").trim();return["<"+i+' id="'+a+'" class="'+("label"===i?"vjs-label":"")+'">',this.localize(r.label),"</"+i+">",'<select aria-labelledby="'+s+'">'].concat(r.options.map(function(e){var n=a+"-"+e[1].replace(/\W+/g,"");return['<option id="'+n+'" value="'+e[0]+'" ','aria-labelledby="'+s+" "+n+'">',t.localize(e[1]),"</option>"].join("")})).concat("</select>").join("")},t.prototype.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},t.prototype.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},t.prototype.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},t.prototype.createElColors_=function(){return v("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},t.prototype.createElFont_=function(){return v("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},t.prototype.createElControls_=function(){var e=this.localize("restore all settings to the default values");return v("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},t.prototype.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},t.prototype.label=function(){return this.localize("Caption Settings Dialog")},t.prototype.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},t.prototype.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},t.prototype.getValues=function(){var e=this;return a(cr,function(t,n,i){var r=Pe(e.$(n.selector),n.parser);return void 0!==r&&(t[i]=r),t},{})},t.prototype.setValues=function(e){var t=this;r(cr,function(n,i){Oe(t.$(n.selector),e[i],n.parser)})},t.prototype.setDefaults=function(){var e=this;r(cr,function(t){var n=t.hasOwnProperty("default")?t.default:0;e.$(t.selector).selectedIndex=n})},t.prototype.restoreSettings=function(){var e=void 0;try{e=JSON.parse(De.localStorage.getItem("vjs-text-track-settings"))}catch(e){vt.warn(e)}e&&this.setValues(e)},t.prototype.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?De.localStorage.setItem("vjs-text-track-settings",JSON.stringify(e)):De.localStorage.removeItem("vjs-text-track-settings")}catch(e){vt.warn(e)}}},t.prototype.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},t.prototype.conditionalBlur_=function(){this.previouslyActiveEl_=null,this.off(Re,"keydown",this.handleKeyDown);var e=this.player_.controlBar,t=e&&e.subsCapsButton,n=e&&e.captionsButton;t?t.focus():n&&n.focus()},t}(un);Yt.registerComponent("TextTrackSettings",dr);var hr=function(e){function t(n,i){ct(this,t);var r=i.ResizeObserver||De.ResizeObserver;null===i.ResizeObserver&&(r=!1);var a=ie({createEl:!r},i),s=ht(this,e.call(this,n,a));return s.ResizeObserver=i.ResizeObserver||De.ResizeObserver,s.loadListener_=null,s.resizeObserver_=null,s.debouncedHandler_=Ut(function(){s.resizeHandler()},100,!1,s),r?(s.resizeObserver_=new s.ResizeObserver(s.debouncedHandler_),s.resizeObserver_.observe(n.el())):(s.loadListener_=function(){s.el_&&s.el_.contentWindow&&Y(s.el_.contentWindow,"resize",s.debouncedHandler_)},s.one("load",s.loadListener_)),s}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager"})},t.prototype.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},t.prototype.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.el_&&this.el_.contentWindow&&K(this.el_.contentWindow,"resize",this.debouncedHandler_),this.loadListener_&&this.off("load",this.loadListener_),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null},t}(Yt);Yt.registerComponent("ResizeManager",hr);var pr=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var n=e.$$("source"),i=[],r="";if(!n.length)return!1;for(var a=0;a<n.length;a++){var s=n[a].src;s&&-1===i.indexOf(s)&&i.push(s)}return!!i.length&&(1===i.length&&(r=i[0]),e.triggerSourceset(r),!0)},fr={};nt||(fr=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=Re.createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var n=Re.createDocumentFragment();t.childNodes.length;)n.appendChild(t.childNodes[0]);return this.innerText="",De.Element.prototype.appendChild.call(this,n),this.innerHTML}}));var mr=function(e,t){for(var n={},i=0;i<e.length&&!((n=Object.getOwnPropertyDescriptor(e[i],t))&&n.set&&n.get);i++);return n.enumerable=!0,n.configurable=!0,n},gr=function(e){return mr([e.el(),De.HTMLMediaElement.prototype,De.Element.prototype,fr],"innerHTML")},yr=function(e){var t=e.el();if(!t.resetSourceWatch_){var n={},i=gr(e),r=function(n){return function(){for(var i=arguments.length,r=Array(i),a=0;a<i;a++)r[a]=arguments[a];var s=n.apply(t,r);return pr(e),s}};["append","appendChild","insertAdjacentHTML"].forEach(function(e){t[e]&&(n[e]=t[e],t[e]=r(n[e]))}),Object.defineProperty(t,"innerHTML",ie(i,{set:r(i.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(n).forEach(function(e){t[e]=n[e]}),Object.defineProperty(t,"innerHTML",i)},e.one("sourceset",t.resetSourceWatch_)}},vr={};nt||(vr=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?wn(De.Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return De.Element.prototype.setAttribute.call(this,"src",e),e}}));var _r=function(e){return mr([e.el(),De.HTMLMediaElement.prototype,vr],"src")},br=function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var n=_r(e),i=t.setAttribute,r=t.load;Object.defineProperty(t,"src",ie(n,{set:function(i){var r=n.set.call(t,i);return e.triggerSourceset(t.src),r}})),t.setAttribute=function(n,r){var a=i.call(t,n,r);return/src/i.test(n)&&e.triggerSourceset(t.src),a},t.load=function(){var n=r.call(t);return pr(e)||(e.triggerSourceset(""),yr(e)),n},t.currentSrc?e.triggerSourceset(t.currentSrc):pr(e)||yr(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=r,t.setAttribute=i,Object.defineProperty(t,"src",n),t.resetSourceWatch_&&t.resetSourceWatch_()}}}},Tr=pt(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."],["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."]),Sr=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i)),a=n.source,s=!1;if(a&&(r.el_.currentSrc!==a.src||n.tag&&3===n.tag.initNetworkState_)?r.setSource(a):r.handleLateInit_(r.el_),n.enableSourceset&&r.setupSourcesetHandling_(),r.el_.hasChildNodes()){for(var o=r.el_.childNodes,u=o.length,l=[];u--;){var c=o[u];"track"===c.nodeName.toLowerCase()&&(r.featuresNativeTextTracks?(r.remoteTextTrackEls().addTrackElement_(c),r.remoteTextTracks().addTrack(c.track),r.textTracks().addTrack(c.track),s||r.el_.hasAttribute("crossorigin")||!Cn(c.src)||(s=!0)):l.push(c))}for(var d=0;d<l.length;d++)r.el_.removeChild(l[d])}return r.proxyNativeTracks_(),r.featuresNativeTextTracks&&s&&vt.warn(Me(Tr)),r.restoreMetadataTracksInIOSNativePlayer_(),(st||We||$e)&&!0===n.nativeControlsForTouch&&r.setControls(!0),r.proxyWebkitFullscreen_(),r.triggerReady(),r}return dt(t,e),t.prototype.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),t.disposeMediaElement(this.el_),this.options_=null,e.prototype.dispose.call(this)},t.prototype.setupSourcesetHandling_=function(){br(this)},t.prototype.restoreMetadataTracksInIOSNativePlayer_=function(){var e=this.textTracks(),t=void 0,n=function(){t=[];for(var n=0;n<e.length;n++){var i=e[n];"metadata"===i.kind&&t.push({track:i,storedMode:i.mode})}};n(),e.addEventListener("change",n),this.on("dispose",function(){return e.removeEventListener("change",n)});var i=function n(){for(var i=0;i<t.length;i++){var r=t[i];"disabled"===r.track.mode&&r.track.mode!==r.storedMode&&(r.track.mode=r.storedMode)}e.removeEventListener("change",n)};this.on("webkitbeginfullscreen",function(){e.removeEventListener("change",n),e.removeEventListener("change",i),e.addEventListener("change",i)}),this.on("webkitendfullscreen",function(){e.removeEventListener("change",n),e.addEventListener("change",n),e.removeEventListener("change",i)})},t.prototype.proxyNativeTracks_=function(){var e=this;Nn.names.forEach(function(t){var n=Nn[t],i=e.el()[n.getterName],r=e[n.getterName]();if(e["featuresNative"+n.capitalName+"Tracks"]&&i&&i.addEventListener){var a={change:function(e){r.trigger({type:"change",target:r,currentTarget:r,srcElement:r})},addtrack:function(e){r.addTrack(e.track)},removetrack:function(e){r.removeTrack(e.track)}},s=function(){for(var e=[],t=0;t<r.length;t++){for(var n=!1,a=0;a<i.length;a++)if(i[a]===r[t]){n=!0;break}n||e.push(r[t])}for(;e.length;)r.removeTrack(e.shift())};Object.keys(a).forEach(function(t){var n=a[t];i.addEventListener(t,n),e.on("dispose",function(e){return i.removeEventListener(t,n)})}),e.on("loadstart",s),e.on("dispose",function(t){return e.off("loadstart",s)})}})},t.prototype.createEl=function(){var e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){var n=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(n,e),t.disposeMediaElement(e),e=n}else{e=Re.createElement("video");var i=this.options_.tag&&C(this.options_.tag),r=ie({},i);st&&!0===this.options_.nativeControlsForTouch||delete r.controls,k(e,s(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&I(e,"preload",this.options_.preload);for(var a=["loop","muted","playsinline","autoplay"],o=0;o<a.length;o++){var u=a[o],l=this.options_[u];void 0!==l&&(l?I(e,u,u):x(e,u),e[u]=l)}return e},t.prototype.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,n=function(){t=!0};this.on("loadstart",n);var i=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",i),void this.ready(function(){this.off("loadstart",n),this.off("loadedmetadata",i),t||this.trigger("loadstart")})}var r=["loadstart"];r.push("loadedmetadata"),e.readyState>=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready(function(){r.forEach(function(e){this.trigger(e)},this)})}},t.prototype.setCurrentTime=function(e){try{this.el_.currentTime=e}catch(e){vt(e,"Video is not ready. (Video.js)")}},t.prototype.duration=function(){var e=this;if(this.el_.duration===1/0&&Ye&&et&&0===this.el_.currentTime){var t=function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))};return this.on("timeupdate",t),NaN}return this.el_.duration||NaN},t.prototype.width=function(){return this.el_.offsetWidth},t.prototype.height=function(){return this.el_.offsetHeight},t.prototype.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},n=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0}))};this.on("webkitbeginfullscreen",n),this.on("dispose",function(){e.off("webkitbeginfullscreen",n),e.off("webkitendfullscreen",t)})}},t.prototype.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=De.navigator&&De.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},t.prototype.enterFullScreen=function(){var e=this.el_;e.paused&&e.networkState<=e.HAVE_METADATA?(this.el_.play(),this.setTimeout(function(){e.pause(),e.webkitEnterFullScreen()},0)):e.webkitEnterFullScreen()},t.prototype.exitFullScreen=function(){this.el_.webkitExitFullScreen()},t.prototype.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},t.prototype.reset=function(){t.resetMediaElement(this.el_)},t.prototype.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},t.prototype.setControls=function(e){this.el_.controls=!!e},t.prototype.addTextTrack=function(t,n,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,n,i):e.prototype.addTextTrack.call(this,t,n,i)},t.prototype.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var n=Re.createElement("track");return t.kind&&(n.kind=t.kind),t.label&&(n.label=t.label),(t.language||t.srclang)&&(n.srclang=t.language||t.srclang),t.default&&(n.default=t.default),t.id&&(n.id=t.id),t.src&&(n.src=t.src),n},t.prototype.addRemoteTextTrack=function(t,n){var i=e.prototype.addRemoteTextTrack.call(this,t,n);return this.featuresNativeTextTracks&&this.el().appendChild(i),i},t.prototype.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var n=this.$$("track"),i=n.length;i--;)t!==n[i]&&t!==n[i].track||this.el().removeChild(n[i])},t.prototype.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),De.performance&&"function"==typeof De.performance.now?e.creationTime=De.performance.now():De.performance&&De.performance.timing&&"number"==typeof De.performance.timing.navigationStart&&(e.creationTime=De.Date.now()-De.performance.timing.navigationStart),e},t}(jn);if(f()){Sr.TEST_VID=Re.createElement("video");var Er=Re.createElement("track");Er.kind="captions",Er.srclang="en",Er.label="English",Sr.TEST_VID.appendChild(Er)}Sr.isSupported=function(){try{Sr.TEST_VID.volume=.5}catch(e){return!1}return!(!Sr.TEST_VID||!Sr.TEST_VID.canPlayType)},Sr.canPlayType=function(e){return Sr.TEST_VID.canPlayType(e)},Sr.canPlaySource=function(e,t){return Sr.canPlayType(e.type)},Sr.canControlVolume=function(){try{var e=Sr.TEST_VID.volume;return Sr.TEST_VID.volume=e/2+.1,e!==Sr.TEST_VID.volume}catch(e){return!1}},Sr.canMuteVolume=function(){try{var e=Sr.TEST_VID.muted;return Sr.TEST_VID.muted=!e,Sr.TEST_VID.muted?I(Sr.TEST_VID,"muted","muted"):x(Sr.TEST_VID,"muted"),e!==Sr.TEST_VID.muted}catch(e){return!1}},Sr.canControlPlaybackRate=function(){if(Ye&&et&&tt<58)return!1;try{var e=Sr.TEST_VID.playbackRate;return Sr.TEST_VID.playbackRate=e/2+.1,e!==Sr.TEST_VID.playbackRate}catch(e){return!1}},Sr.canOverrideAttributes=function(){if(nt)return!1;try{var e=function(){};Object.defineProperty(Re.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(Re.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(Re.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(Re.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},Sr.supportsNativeTextTracks=function(){return at||ze&&et},Sr.supportsNativeVideoTracks=function(){return!(!Sr.TEST_VID||!Sr.TEST_VID.videoTracks)},Sr.supportsNativeAudioTracks=function(){return!(!Sr.TEST_VID||!Sr.TEST_VID.audioTracks)},Sr.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],Sr.prototype.featuresVolumeControl=Sr.canControlVolume(),Sr.prototype.featuresMuteControl=Sr.canMuteVolume(),Sr.prototype.featuresPlaybackRate=Sr.canControlPlaybackRate(),Sr.prototype.featuresSourceset=Sr.canOverrideAttributes(),Sr.prototype.movingMediaElementInDOM=!ze,Sr.prototype.featuresFullscreenResize=!0,Sr.prototype.featuresProgressEvents=!0,Sr.prototype.featuresTimeupdateEvents=!0,Sr.prototype.featuresNativeTextTracks=Sr.supportsNativeTextTracks(),Sr.prototype.featuresNativeVideoTracks=Sr.supportsNativeVideoTracks(),Sr.prototype.featuresNativeAudioTracks=Sr.supportsNativeAudioTracks();var wr=Sr.TEST_VID&&Sr.TEST_VID.constructor.prototype.canPlayType,kr=/^application\/(?:x-|vnd\.apple\.)mpegurl/i,Cr=/^video\/mp4/i;Sr.patchCanPlayType=function(){Ke>=4&&!Je&&!et?Sr.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&kr.test(e)?"maybe":wr.call(this,e)}:Qe&&(Sr.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&Cr.test(e)?"maybe":wr.call(this,e)})},Sr.unpatchCanPlayType=function(){var e=Sr.TEST_VID.constructor.prototype.canPlayType;return Sr.TEST_VID.constructor.prototype.canPlayType=wr,e},Sr.patchCanPlayType(),Sr.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},Sr.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),n=t.length;n--;)e.removeChild(t[n]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){Sr.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){Sr.prototype["set"+te(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","played","networkState","readyState","videoWidth","videoHeight"].forEach(function(e){Sr.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach(function(e){Sr.prototype["set"+te(e)]=function(t){this.el_[e]=t}}),["pause","load","play"].forEach(function(e){Sr.prototype[e]=function(){return this.el_[e]()}}),jn.withSourceHandlers(Sr),Sr.nativeSourceHandler={},Sr.nativeSourceHandler.canPlayType=function(e){try{return Sr.TEST_VID.canPlayType(e)}catch(e){return""}},Sr.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Sr.nativeSourceHandler.canPlayType(e.type);if(e.src){var n=kn(e.src);return Sr.nativeSourceHandler.canPlayType("video/"+n)}return""},Sr.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},Sr.nativeSourceHandler.dispose=function(){},Sr.registerSourceHandler(Sr.nativeSourceHandler),jn.registerTech("Html5",Sr);var Ar=pt(["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "],["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "]),Ir=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],xr={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Pr=["tiny","xsmall","small","medium","large","xlarge","huge"],Or={};Pr.forEach(function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Or[e]="vjs-layout-"+t});var Lr={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Dr=function(e){function t(n,i,r){if(ct(this,t),n.id=n.id||i.id||"vjs_video_"+H(),i=s(t.getTagSettings(n),i),i.initChildren=!1,i.createEl=!1,i.evented=!1,i.reportTouchActivity=!1,!i.language)if("function"==typeof n.closest){var a=n.closest("[lang]");a&&a.getAttribute&&(i.language=a.getAttribute("lang"))}else for(var o=n;o&&1===o.nodeType;){if(C(o).hasOwnProperty("lang")){i.language=o.getAttribute("lang");break}o=o.parentNode}var u=ht(this,e.call(this,null,i,r));if(u.log=_t(u.id_),u.isPosterFromTech_=!1,u.queuedCallbacks_=[],u.isReady_=!1,u.hasStarted_=!1,u.userActive_=!1,!u.options_||!u.options_.techOrder||!u.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(u.tag=n,u.tagAttributes=n&&C(n),u.language(u.options_.language),i.languages){var l={};Object.getOwnPropertyNames(i.languages).forEach(function(e){l[e.toLowerCase()]=i.languages[e]}),u.languages_=l}else u.languages_=t.prototype.options_.languages;u.cache_={},u.poster_=i.poster||"",u.controls_=!!i.controls,u.cache_.lastVolume=1,n.controls=!1,n.removeAttribute("controls"),n.hasAttribute("autoplay")?u.options_.autoplay=!0:u.autoplay(u.options_.autoplay),u.scrubbing_=!1,u.el_=u.createEl(),u.cache_.lastPlaybackRate=u.defaultPlaybackRate(),Z(u,{eventBusKey:"el_"});var c=ie(u.options_);if(i.plugins){var d=i.plugins;Object.keys(d).forEach(function(e){if("function"!=typeof this[e])throw new Error('plugin "'+e+'" does not exist');this[e](d[e])},u)}u.options_.playerOptions=c,u.middleware_=[],u.initChildren(),u.isAudio("audio"===n.nodeName.toLowerCase()),u.controls()?u.addClass("vjs-controls-enabled"):u.addClass("vjs-controls-disabled"),u.el_.setAttribute("role","region"),u.isAudio()?u.el_.setAttribute("aria-label",u.localize("Audio Player")):u.el_.setAttribute("aria-label",u.localize("Video Player")),u.isAudio()&&u.addClass("vjs-audio"),u.flexNotSupported_()&&u.addClass("vjs-no-flex"),ze||u.addClass("vjs-workinghover"),t.players[u.id_]=u;var h=je.split(".")[0];return u.addClass("vjs-v"+h),u.userActive(!0),u.reportUserActivity(),u.one("play",u.listenForUserActivity_),u.on("fullscreenchange",u.handleFullscreenChange_),u.on("stageclick",u.handleStageClick_),u.breakpoints(u.options_.breakpoints),u.responsive(u.options_.responsive),u.changingSrc_=!1,u.playWaitingForReady_=!1,u.playOnLoadstart_=null,u}return dt(t,e),t.prototype.dispose=function(){this.trigger("dispose"),this.off("dispose"),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.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),Te(this),e.prototype.dispose.call(this)},t.prototype.createEl=function(){var t=this.tag,n=void 0,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();i?n=this.el_=t.parentNode:r||(n=this.el_=e.prototype.createEl.call(this,"div"));var a=C(t);if(r){for(n=this.el_=t,t=this.tag=Re.createElement("video");n.children.length;)t.appendChild(n.firstChild);T(n,"video-js")||S(n,"video-js"),n.appendChild(t),i=this.playerElIngest_=n,["autoplay","controls","crossOrigin","defaultMuted","defaultPlaybackRate","loop","muted","playbackRate","src","volume"].forEach(function(e){void 0!==n[e]&&(t[e]=n[e])})}if(t.setAttribute("tabindex","-1"),a.tabindex="-1",it&&(t.setAttribute("role","application"),a.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in a&&delete a.width,"height"in a&&delete a.height,Object.getOwnPropertyNames(a).forEach(function(e){"class"===e?(n.className+=" "+a[e],r&&(t.className+=" "+a[e])):(n.setAttribute(e,a[e]),r&&t.setAttribute(e,a[e]))}),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=n.player=this,this.addClass("vjs-paused"),!0!==De.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Dt("vjs-styles-dimensions");var s=Tt(".vjs-styles-defaults"),o=Tt("head");o.insertBefore(this.styleEl_,s?s.nextSibling:o.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);for(var u=t.getElementsByTagName("a"),l=0;l<u.length;l++){var c=u.item(l);S(c,"vjs-hidden"),c.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!i&&t.parentNode.insertBefore(n,t),b(t,n),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_=n,n},t.prototype.width=function(e){return this.dimension("width",e)},t.prototype.height=function(e){return this.dimension("height",e)},t.prototype.dimension=function(e,t){var n=e+"_";if(void 0===t)return this[n]||0;if(""===t)return this[n]=void 0,void this.updateStyleEl_();var i=parseFloat(t);if(isNaN(i))return void vt.error('Improper value "'+t+'" supplied for for '+e);this[n]=i,this.updateStyleEl_()},t.prototype.fluid=function(e){if(void 0===e)return!!this.fluid_;this.fluid_=!!e,e?(this.addClass("vjs-fluid"),this.fill(!1)):this.removeClass("vjs-fluid"),this.updateStyleEl_()},t.prototype.fill=function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},t.prototype.aspectRatio=function(e){if(void 0===e)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_()},t.prototype.updateStyleEl_=function(){if(!0===De.VIDEOJS_NO_DYNAMIC_STYLE){var e="number"==typeof this.width_?this.width_:this.options_.width,t="number"==typeof this.height_?this.height_:this.options_.height,n=this.tech_&&this.tech_.el();return void(n&&(e>=0&&(n.width=e),t>=0&&(n.height=t)))}var i=void 0,r=void 0,a=void 0,s=void 0;a=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";var o=a.split(":"),u=o[1]/o[0];i=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/u:this.videoWidth()||300,r=void 0!==this.height_?this.height_:i*u,s=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(s),Rt(this.styleEl_,"\n ."+s+" {\n width: "+i+"px;\n height: "+r+"px;\n }\n\n ."+s+".vjs-fluid {\n padding-top: "+100*u+"%;\n }\n ")},t.prototype.loadTech_=function(e,t){var n=this;this.tech_&&this.unloadTech_();var i=te(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(jn.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;var a="string"!=typeof this.autoplay()&&this.autoplay(),o={source:t,autoplay:a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,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};Bn.names.forEach(function(e){var t=Bn[e];o[t.getterName]=n[t.privateName]}),s(o,this.options_[i]),s(o,this.options_[r]),s(o,this.options_[e.toLowerCase()]),this.tag&&(o.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(o.startTime=this.cache_.currentTime);var u=jn.getTech(e);if(!u)throw new Error("No Tech named '"+i+"' exists! '"+i+"' should be registered using videojs.registerTech()'");this.tech_=new u(o),this.tech_.ready(Mt(this,this.handleTechReady_),!0),sn.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Ir.forEach(function(e){n.on(n.tech_,e,n["handleTech"+te(e)+"_"])}),Object.keys(xr).forEach(function(e){n.on(n.tech_,e,function(t){if(0===n.tech_.playbackRate()&&n.tech_.seeking())return void n.queuedCallbacks_.push({callback:n["handleTech"+xr[e]+"_"].bind(n),event:t});n["handleTech"+xr[e]+"_"](t)})}),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"sourceset",this.handleTechSourceset_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),this.on(this.tech_,"play",this.handleTechPlay_),this.on(this.tech_,"firstplay",this.handleTechFirstPlay_),this.on(this.tech_,"pause",this.handleTechPause_),this.on(this.tech_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"error",this.handleTechError_),this.on(this.tech_,"loadedmetadata",this.updateStyleEl_),this.on(this.tech_,"posterchange",this.handleTechPosterChange_),this.on(this.tech_,"textdata",this.handleTechTextData_),this.on(this.tech_,"ratechange",this.handleTechRateChange_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||b(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},t.prototype.unloadTech_=function(){var e=this;Bn.names.forEach(function(t){var n=Bn[t];e[n.privateName]=e[n.getterName]()}),this.textTracksJson_=sn.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},t.prototype.tech=function(e){return void 0===e&&vt.warn(Me(Ar)),this.tech_},t.prototype.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",this.handleTechClick_),this.on(this.tech_,"touchstart",this.handleTechTouchStart_),this.on(this.tech_,"touchmove",this.handleTechTouchMove_),this.on(this.tech_,"touchend",this.handleTechTouchEnd_),this.on(this.tech_,"tap",this.handleTechTap_)},t.prototype.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.handleTechTap_),this.off(this.tech_,"touchstart",this.handleTechTouchStart_),this.off(this.tech_,"touchmove",this.handleTechTouchMove_),this.off(this.tech_,"touchend",this.handleTechTouchEnd_),this.off(this.tech_,"mousedown",this.handleTechClick_)},t.prototype.handleTechReady_=function(){if(this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_(),(this.src()||this.currentSrc())&&this.tag&&this.options_.autoplay&&this.paused())try{delete this.tag.poster}catch(e){vt("deleting tag.poster throws in some browsers",e)}},t.prototype.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay())},t.prototype.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"==typeof e){var n=function(){var e=t.muted();t.muted(!0);var n=t.play();if(n&&n.then&&n.catch)return n.catch(function(n){t.muted(e)})},i=void 0;if("any"===e?(i=this.play())&&i.then&&i.catch&&i.catch(function(){return n()}):i="muted"===e?n():this.play(),i&&i.then&&i.catch)return i.then(function(){t.trigger({type:"autoplay-success",autoplay:e})}).catch(function(n){t.trigger({type:"autoplay-failure",autoplay:e})})}},t.prototype.updateSourceCaches_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e,n="";"string"!=typeof t&&(t=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!n&&(n=Yn(this,t)),this.cache_.source=ie({},e,{src:t,type:n});for(var i=this.cache_.sources.filter(function(e){return e.src&&e.src===t}),r=[],a=this.$$("source"),s=[],o=0;o<a.length;o++){var u=C(a[o]);r.push(u),u.src&&u.src===t&&s.push(u.src)}s.length&&!i.length?this.cache_.sources=r:i.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},t.prototype.handleTechSourceset_=function(e){var t=this;if(!this.changingSrc_){var n=function(e){return t.updateSourceCaches_(e)},i=this.currentSource().src,r=e.src;if(i&&!/^blob:/.test(i)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==i)&&(n=function(){}),n(r),!e.src){var a=function e(n){if("sourceset"!==n.type){var i=t.techGet("currentSrc");t.lastSource_.tech=i,t.updateSourceCaches_(i)}t.tech_.off(["sourceset","loadstart"],e)};this.tech_.one(["sourceset","loadstart"],a)}}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},t.prototype.hasStarted=function(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},t.prototype.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},t.prototype.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},t.prototype.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting"),this.one("timeupdate",function(){return e.removeClass("vjs-waiting")})},t.prototype.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},t.prototype.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},t.prototype.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},t.prototype.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},t.prototype.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.trigger("seeked")},t.prototype.handleTechFirstPlay_=function(){this.options_.starttime&&(vt.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},t.prototype.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},t.prototype.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},t.prototype.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},t.prototype.handleTechClick_=function(e){F(e)&&this.controls_&&(this.paused()?de(this.play()):this.pause())},t.prototype.handleTechTap_=function(){this.userActive(!this.userActive())},t.prototype.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},t.prototype.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},t.prototype.handleTechTouchEnd_=function(e){e.preventDefault()},t.prototype.handleFullscreenChange_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},t.prototype.handleStageClick_=function(){this.reportUserActivity()},t.prototype.handleTechFullscreenChange_=function(e,t){t&&this.isFullscreen(t.isFullscreen),this.trigger("fullscreenchange")},t.prototype.handleTechError_=function(){var e=this.tech_.error();this.error(e)},t.prototype.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},t.prototype.getCache=function(){return this.cache_},t.prototype.techCall_=function(e,t){this.ready(function(){if(e in Wn)return ye(this.middleware_,this.tech_,e,t);if(e in Gn)return ve(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw vt(e),e}},!0)},t.prototype.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in Vn)return ge(this.middleware_,this.tech_,e);if(e in Gn)return ve(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw vt("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw vt("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw vt(t),t}}},t.prototype.play=function(){var e=this,t=this.options_.Promise||De.Promise;return t?new t(function(t){e.play_(t)}):this.play_()},t.prototype.play_=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:de;if(this.playOnLoadstart_&&this.off("loadstart",this.playOnLoadstart_),this.isReady_){if(!this.changingSrc_&&(this.src()||this.currentSrc()))return void t(this.techGet_("play"));this.playOnLoadstart_=function(){e.playOnLoadstart_=null,t(e.play())},this.one("loadstart",this.playOnLoadstart_)}else{if(this.playWaitingForReady_)return;this.playWaitingForReady_=!0,this.ready(function(){e.playWaitingForReady_=!1,t(e.play())})}},t.prototype.pause=function(){this.techCall_("pause")},t.prototype.paused=function(){return!1!==this.techGet_("paused")},t.prototype.played=function(){return this.techGet_("played")||oe(0,0)},t.prototype.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},t.prototype.currentTime=function(e){return void 0!==e?(e<0&&(e=0),void this.techCall_("setCurrentTime",e)):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},t.prototype.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?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"),this.trigger("durationchange"))},t.prototype.remainingTime=function(){return this.duration()-this.currentTime()},t.prototype.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},t.prototype.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=oe(0,0)),e},t.prototype.bufferedPercent=function(){return ue(this.buffered(),this.duration())},t.prototype.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),n=e.end(e.length-1);return n>t&&(n=t),n},t.prototype.volume=function(e){var t=void 0;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},t.prototype.muted=function(e){return void 0!==e?void this.techCall_("setMuted",e):this.techGet_("muted")||!1},t.prototype.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},t.prototype.lastVolume_=function(e){return void 0!==e&&0!==e?void(this.cache_.lastVolume=e):this.cache_.lastVolume},t.prototype.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},t.prototype.isFullscreen=function(e){return void 0!==e?void(this.isFullscreen_=!!e):!!this.isFullscreen_},t.prototype.requestFullscreen=function(){var e=Kt;this.isFullscreen(!0),e.requestFullscreen?(Y(Re,e.fullscreenchange,Mt(this,function t(n){this.isFullscreen(Re[e.fullscreenElement]),!1===this.isFullscreen()&&K(Re,e.fullscreenchange,t),this.trigger("fullscreenchange")})),this.el_[e.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange"))},t.prototype.exitFullscreen=function(){var e=Kt;this.isFullscreen(!1),e.requestFullscreen?Re[e.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange"))},t.prototype.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=Re.documentElement.style.overflow,Y(Re,"keydown",Mt(this,this.fullWindowOnEscKey)),Re.documentElement.style.overflow="hidden",S(Re.body,"vjs-full-window"),this.trigger("enterFullWindow")},t.prototype.fullWindowOnEscKey=function(e){27===e.keyCode&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},t.prototype.exitFullWindow=function(){this.isFullWindow=!1,K(Re,"keydown",this.fullWindowOnEscKey),Re.documentElement.style.overflow=this.docOrigOverflow,E(Re.body,"vjs-full-window"),this.trigger("exitFullWindow")},t.prototype.canPlayType=function(e){for(var t=void 0,n=0,i=this.options_.techOrder;n<i.length;n++){var r=i[n],a=jn.getTech(r);if(a||(a=Yt.getComponent(r)),a){if(a.isSupported()&&(t=a.canPlayType(e)))return t}else vt.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},t.prototype.selectSource=function(e){var t=this,n=this.options_.techOrder.map(function(e){return[e,jn.getTech(e)]}).filter(function(e){var t=e[0],n=e[1];return n?n.isSupported():(vt.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),i=function(e,t,n){var i=void 0;return e.some(function(e){return t.some(function(t){if(i=n(e,t))return!0})}),i},r=function(e,n){var i=e[0];if(e[1].canPlaySource(n,t.options_[i.toLowerCase()]))return{source:n,tech:i}};return(this.options_.sourceOrder?i(e,n,function(e){return function(t,n){return e(n,t)}}(r)):i(n,e,r))||!1},t.prototype.src=function(e){var t=this;if(void 0===e)return this.cache_.src||"";var n=Kn(e);if(!n.length)return void this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0);this.changingSrc_=!0,this.cache_.sources=n,this.updateSourceCaches_(n[0]),fe(this,n[0],function(e,i){if(t.middleware_=i,t.cache_.sources=n,t.updateSourceCaches_(e),t.src_(e))return n.length>1?t.src(n.slice(1)):(t.changingSrc_=!1,t.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0),void t.triggerReady());me(i,t.tech_)})},t.prototype.src_=function(e){var t=this,n=this.selectSource([e]);return!n||(ne(n.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_(n.tech,n.source),this.tech_.ready(function(){t.changingSrc_=!1}),!1))},t.prototype.load=function(){this.techCall_("load")},t.prototype.reset=function(){this.tech_&&this.tech_.clearTracks("text"),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset")},t.prototype.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},t.prototype.currentSource=function(){return this.cache_.source||{}},t.prototype.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},t.prototype.currentType=function(){return this.currentSource()&&this.currentSource().type||""},t.prototype.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},t.prototype.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t=void 0;"string"==typeof e&&/(any|play|muted)/.test(e)?(this.options_.autoplay=e,this.manualAutoplay_(e),t=!1):this.options_.autoplay=!!e,t=t||this.options_.autoplay,this.tech_&&this.techCall_("setAutoplay",t)},t.prototype.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},t.prototype.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},t.prototype.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},t.prototype.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},t.prototype.controls=function(e){if(void 0===e)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_()))},t.prototype.usingNativeControls=function(e){if(void 0===e)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")))},t.prototype.error=function(e){return void 0===e?this.error_||null:null===e?(this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close())):(this.error_=new le(e),this.addClass("vjs-error"),vt.error("(CODE:"+this.error_.code+" "+le.errorTypes[this.error_.code]+")",this.error_.message,this.error_),void this.trigger("error"))},t.prototype.reportUserActivity=function(e){this.userActivity_=!0},t.prototype.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");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")}},t.prototype.listenForUserActivity_=function(){var e=void 0,t=void 0,n=void 0,i=Mt(this,this.reportUserActivity),r=function(e){e.screenX===t&&e.screenY===n||(t=e.screenX,n=e.screenY,i())},a=function(){i(),this.clearInterval(e),e=this.setInterval(i,250)},s=function(t){i(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",r),this.on("mouseup",s),this.on("keydown",i),this.on("keyup",i);var o=void 0;this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(o);var e=this.options_.inactivityTimeout;e<=0||(o=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e))}},250)},t.prototype.playbackRate=function(e){return void 0!==e?void this.techCall_("setPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1},t.prototype.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},t.prototype.isAudio=function(e){return void 0!==e?void(this.isAudio_=!!e):!!this.isAudio_},t.prototype.addTextTrack=function(e,t,n){if(this.tech_)return this.tech_.addTextTrack(e,t,n)},t.prototype.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},t.prototype.removeRemoteTextTrack=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.track,n=void 0===t?arguments[0]:t;if(this.tech_)return this.tech_.removeRemoteTextTrack(n)},t.prototype.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},t.prototype.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},t.prototype.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},t.prototype.language=function(e){if(void 0===e)return this.language_;this.language_=String(e).toLowerCase()},t.prototype.languages=function(){return ie(t.prototype.options_.languages,this.languages_)},t.prototype.toJSON=function(){var e=ie(this.options_),t=e.tracks;e.tracks=[];for(var n=0;n<t.length;n++){var i=t[n];i=ie(i),i.player=void 0,e.tracks[n]=i}return e},t.prototype.createModal=function(e,t){var n=this;t=t||{},t.content=e||"";var i=new un(this,t);return this.addChild(i),i.on("dispose",function(){n.removeChild(i)}),i.open(),i},t.prototype.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),n=0;n<Pr.length;n++){var i=Pr[n],r=this.breakpoints_[i];if(t<=r){if(e===i)return;e&&this.removeClass(Or[e]),this.addClass(Or[i]),this.breakpoint_=i;break}}},t.prototype.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},t.prototype.breakpoints=function(e){return void 0===e?s(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=s({},Lr,e),this.updateCurrentBreakpoint_(),s(this.breakpoints_))},t.prototype.responsive=function(e){return void 0===e?this.responsive_:(e=Boolean(e),e!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.updateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.updateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0)},t.prototype.currentBreakpoint=function(){return this.breakpoint_},t.prototype.currentBreakpointClass=function(){return Or[this.breakpoint_]||""},t.getTagSettings=function(e){var t={sources:[],tracks:[]},n=C(e),i=n["data-setup"];if(T(e,"vjs-fill")&&(n.fill=!0),T(e,"vjs-fluid")&&(n.fluid=!0),null!==i){var r=Ne(i||"{}"),a=r[0],o=r[1];a&&vt.error(a),s(n,o)}if(s(t,n),e.hasChildNodes())for(var u=e.childNodes,l=0,c=u.length;l<c;l++){var d=u[l],h=d.nodeName.toLowerCase();"source"===h?t.sources.push(C(d)):"track"===h&&t.tracks.push(C(d))}return t},t.prototype.flexNotSupported_=function(){var e=Re.createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},t}(Yt);Bn.names.forEach(function(e){var t=Bn[e];Dr.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),Dr.players={};var Rr=De.navigator;Dr.prototype.options_={techOrder:jn.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","controlBar","errorDisplay","textTrackSettings"],language:Rr&&(Rr.languages&&Rr.languages[0]||Rr.userLanguage||Rr.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",breakpoints:{},responsive:!1},nt||Dr.prototype.options_.children.push("resizeManager"),["ended","seeking","seekable","networkState","readyState"].forEach(function(e){Dr.prototype[e]=function(){return this.techGet_(e)}}),Ir.forEach(function(e){Dr.prototype["handleTech"+te(e)+"_"]=function(){return this.trigger(e)}}),Yt.registerComponent("Player",Dr);var Mr={},Nr=function(e){return Mr.hasOwnProperty(e)},Ur=function(e){return Nr(e)?Mr[e]:void 0},Br=function(e,t){e.activePlugins_=e.activePlugins_||{},e.activePlugins_[t]=!0},jr=function(e,t,n){var i=(n?"before":"")+"pluginsetup";e.trigger(i,t),e.trigger(i+":"+t.name,t)},Fr=function(e,t){var n=function(){jr(this,{name:e,plugin:t,instance:null},!0);var n=t.apply(this,arguments);return Br(this,e),jr(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach(function(e){n[e]=t[e]}),n},Hr=function(e,t){return t.prototype.name=e,function(){jr(this,{name:e,plugin:t,instance:null},!0);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var a=new(Function.prototype.bind.apply(t,[null].concat([this].concat(i))));return this[e]=function(){return a},jr(this,a.getEventHash()),a}},qr=function(){function e(t){if(ct(this,e),this.constructor===e)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,Z(this),delete this.trigger,ee(this,this.constructor.defaultState),Br(t,this.name),this.dispose=Mt(this,this.dispose),t.on("dispose",this.dispose)}return e.prototype.version=function(){return this.constructor.VERSION},e.prototype.getEventHash=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.name=this.name,e.plugin=this.constructor,e.instance=this,e},e.prototype.trigger=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Q(this.eventBusEl_,e,this.getEventHash(t))},e.prototype.handleStateChanged=function(e){},e.prototype.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t.activePlugins_[e]=!1,this.player=this.state=null,t[e]=Hr(e,Mr[e])},e.isBasic=function(t){var n="string"==typeof t?Ur(t):t;return"function"==typeof n&&!e.prototype.isPrototypeOf(n.prototype)},e.registerPlugin=function(t,n){if("string"!=typeof t)throw new Error('Illegal plugin name, "'+t+'", must be a string, was '+(void 0===t?"undefined":lt(t))+".");if(Nr(t))vt.warn('A plugin named "'+t+'" already exists. You may want to avoid re-registering plugins!');else if(Dr.prototype.hasOwnProperty(t))throw new Error('Illegal plugin name, "'+t+'", cannot share a name with an existing player method!');if("function"!=typeof n)throw new Error('Illegal plugin for "'+t+'", must be a function, was '+(void 0===n?"undefined":lt(n))+".");return Mr[t]=n,"plugin"!==t&&(e.isBasic(n)?Dr.prototype[t]=Fr(t,n):Dr.prototype[t]=Hr(t,n)),n},e.deregisterPlugin=function(e){if("plugin"===e)throw new Error("Cannot de-register base plugin.");Nr(e)&&(delete Mr[e],delete Dr.prototype[e])},e.getPlugins=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.keys(Mr),t=void 0;return e.forEach(function(e){var n=Ur(e);n&&(t=t||{},t[e]=n)}),t},e.getPluginVersion=function(e){var t=Ur(e);return t&&t.VERSION||""},e}();qr.getPlugin=Ur,qr.BASE_PLUGIN_NAME="plugin",qr.registerPlugin("plugin",qr),Dr.prototype.usingPlugin=function(e){return!!this.activePlugins_&&!0===this.activePlugins_[e]},Dr.prototype.hasPlugin=function(e){return!!Nr(e)};var Vr=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":lt(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.super_=t)},Wr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(){e.apply(this,arguments)},i={};"object"===(void 0===t?"undefined":lt(t))?(t.constructor!==Object.prototype.constructor&&(n=t.constructor),i=t):"function"==typeof t&&(n=t),Vr(n,e);for(var r in i)i.hasOwnProperty(r)&&(n.prototype[r]=i[r]);return n};"undefined"==typeof HTMLVideoElement&&f()&&(Re.createElement("video"),Re.createElement("audio"),Re.createElement("track"),Re.createElement("video-js"));var Gr=function(e){return 0===e.indexOf("#")?e.slice(1):e};if(Le.hooks_={},Le.hooks=function(e,t){return Le.hooks_[e]=Le.hooks_[e]||[],t&&(Le.hooks_[e]=Le.hooks_[e].concat(t)),Le.hooks_[e]},Le.hook=function(e,t){Le.hooks(e,t)},Le.hookOnce=function(e,t){Le.hooks(e,[].concat(t).map(function(t){return function n(){return Le.removeHook(e,n),t.apply(void 0,arguments)}}))},Le.removeHook=function(e,t){var n=Le.hooks(e).indexOf(t);return!(n<=-1)&&(Le.hooks_[e]=Le.hooks_[e].slice(),Le.hooks_[e].splice(n,1),!0)},!0!==De.VIDEOJS_NO_DYNAMIC_STYLE&&f()){var zr=Tt(".vjs-styles-defaults");if(!zr){zr=Dt("vjs-styles-defaults");var Xr=Tt("head");Xr&&Xr.insertBefore(zr,Xr.firstChild),Rt(zr,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}J(1,Le),Le.VERSION=je,Le.options=Dr.prototype.options_,Le.getPlayers=function(){return Dr.players},Le.getPlayer=function(e){var t=Dr.players,n=void 0;if("string"==typeof e){var i=Gr(e),r=t[i];if(r)return r;n=Tt("#"+i)}else n=e;if(m(n)){var a=n,s=a.player,o=a.playerId;if(s||t[o])return s||t[o]}},Le.getAllPlayers=function(){return Object.keys(Dr.players).map(function(e){return Dr.players[e]}).filter(Boolean)},Le.players=Dr.players,Le.getComponent=Yt.getComponent,Le.registerComponent=function(e,t){jn.isTech(t)&&vt.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),Yt.registerComponent.call(Yt,e,t)},Le.getTech=jn.getTech,Le.registerTech=jn.registerTech,Le.use=pe,!nt&&Object.defineProperty?(Object.defineProperty(Le,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Le.middleware,"TERMINATOR",{value:qn,writeable:!1,enumerable:!0})):Le.middleware={TERMINATOR:qn},Le.browser=ut,Le.TOUCH_ENABLED=st,Le.extend=Wr,Le.mergeOptions=ie,Le._bind=Mt,Le.registerPlugin=qr.registerPlugin,Le.deregisterPlugin=qr.deregisterPlugin,Le.plugin=function(e,t){return vt.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),qr.registerPlugin(e,t)},Le.getPlugins=qr.getPlugins,Le.getPlugin=qr.getPlugin,Le.getPluginVersion=qr.getPluginVersion,Le.addLanguage=function(e,t){var n;return e=(""+e).toLowerCase(),Le.options.languages=ie(Le.options.languages,(n={},n[e]=t,n)),Le.options.languages[e]},Le.log=vt,Le.createLogger=_t,Le.createTimeRange=Le.createTimeRanges=oe,Le.formatTime=ui,Le.setFormatTime=Ae,Le.resetFormatTime=Ie,Le.parseUrl=En,Le.isCrossOrigin=Cn,Le.EventTarget=Bt,Le.on=Y,Le.one=$,Le.off=K,Le.trigger=Q,Le.xhr=Ue,Le.TextTrack=Pn,Le.AudioTrack=On,Le.VideoTrack=Ln,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(e){Le[e]=function(){return vt.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),Et[e].apply(null,arguments)}}),Le.computedStyle=c,Le.dom=Et,Le.url=An,e.exports=Le},function(e,t,n){(function(t){var n;n="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=n}).call(t,n(2))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.d(t,"g",function(){return u}),n.d(t,"e",function(){return l}),n.d(t,"k",function(){return d}),n.d(t,"j",function(){return h}),n.d(t,"i",function(){return p}),n.d(t,"b",function(){return g}),n.d(t,"f",function(){return y}),n.d(t,"c",function(){return v}),n.d(t,"h",function(){return _}),n.d(t,"d",function(){return b}),n.d(t,"a",function(){return T});var i=n(1),r=n.n(i),a=function(e,t){for(var n="";t--;)n+=e;return n},s=function(e){return e.toString(2).length},o=function(e){return Math.ceil(s(e)/8)},u=function(e,t,n){return void 0===n&&(n=" "),(a(n,t)+e.toString()).slice(-t)},l=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},c=function(e){return l(e)},d=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||c(e)||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!==e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},h=function(e){e=d(e);for(var t="",n=0;n<e.length;n++)t+=u(e[n].toString(16),2,"0");return t},p=function(e){e=d(e);for(var t="",n=0;n<e.length;n++)t+=u(e[n].toString(2),8,"0");return t},f=r.a.BigInt||Number,m=[f("0x1"),f("0x100"),f("0x10000"),f("0x1000000"),f("0x100000000"),f("0x10000000000"),f("0x1000000000000"),f("0x100000000000000"),f("0x10000000000000000")],g=(function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}(),function(e,t){var n=void 0===t?{}:t,i=n.signed,r=void 0!==i&&i,a=n.le,s=void 0!==a&&a;e=d(e);var o=s?"reduce":"reduceRight",u=e[o]?e[o]:Array.prototype[o],l=u.call(e,function(t,n,i){var r=s?i:Math.abs(i+1-e.length);return t+f(n)*m[r]},f(0));if(r){var c=m[e.length]/f(2)-f(1);l=f(l),l>c&&(l-=c,l-=c,l-=f(2))}return Number(l)}),y=function(e,t){var n=void 0===t?{}:t,i=n.le,r=void 0!==i&&i;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!==e)&&(e=0),e=f(e);for(var a=o(e),s=new Uint8Array(new ArrayBuffer(a)),u=0;u<a;u++){var l=r?u:Math.abs(u+1-s.length);s[l]=Number(e/m[u]&f(255)),e<0&&(s[l]=Math.abs(~s[l]),s[l]-=0===u?1:2)}return s},v=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,d(e));try{return decodeURIComponent(escape(t))}catch(e){}return t},_=function(e,t){if("string"!=typeof e&&e&&"function"==typeof e.toString&&(e=e.toString()),"string"!=typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var n=new Uint8Array(e.length),i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return n},b=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t=t.filter(function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e}),t.length<=1)return d(t[0]);var i=t.reduce(function(e,t,n){return e+(t.byteLength||t.length)},0),r=new Uint8Array(i),a=0;return t.forEach(function(e){e=d(e),r.set(e,a),a+=e.byteLength}),r},T=function(e,t,n){var i=void 0===n?{}:n,r=i.offset,a=void 0===r?0:r,s=i.mask,o=void 0===s?[]:s;e=d(e),t=d(t);var u=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&u.call(t,function(t,n){return t===(o[n]?o[n]&e[a+n]:e[a+n])})}},function(e,t,n){"use strict";function i(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var r=i({HTML:"text/html",isHTML:function(e){return e===r.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),a=i({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/"});t.freeze=i,t.MIME_TYPE=r,t.NAMESPACE=a},function(e,t){function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}var r=n(34);e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){(function(t){var i,r=void 0!==t?t:"undefined"!=typeof window?window:{},a=n(35);"undefined"!=typeof document?i=document:(i=r["__GLOBAL_DOCUMENT_CACHE@4"])||(i=r["__GLOBAL_DOCUMENT_CACHE@4"]=a),e.exports=i}).call(t,n(2))},function(e,t,n){"use strict";var i=n(36),r=n.n(i),a=n(1),s=n.n(a),o=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=s.a.location&&s.a.location.href||"");var n="function"==typeof s.a.URL,i=/^\/\//.test(e),a=!s.a.location&&!/\/\//i.test(e);if(n?e=new s.a.URL(e,s.a.location||"http://example.com"):/\/\//i.test(e)||(e=r.a.buildAbsoluteURL(s.a.location&&s.a.location.href||"",e)),n){var o=new URL(t,e);return a?o.href.slice("http://example.com".length):i?o.href.slice(o.protocol.length):o.href}return r.a.buildAbsoluteURL(e,t)};t.a=o},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,n.apply(this,arguments)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";(function(e){function i(e){for(var t=s(e),n=new Uint8Array(t.length),i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}t.a=i;var r=n(1),a=n.n(r),s=function(t){return a.a.atob?a.a.atob(t):e.from(t,"base64").toString("binary")}}).call(t,n(38).Buffer)},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,r=/^application\/dash\+xml/i,a=function(e){return i.test(e)?"hls":r.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null}},function(e,t,n){function i(e){return""!==e}function r(e){return e?e.split(/[\t\n\f\r ]+/).filter(i):[]}function a(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function s(e){if(!e)return[];var t=r(e);return Object.keys(t.reduce(a,{}))}function o(e){return function(t){return e&&-1!==e.indexOf(t)}}function u(e,t){for(var n in e)t[n]=e[n]}function l(e,t){function n(){}var i=e.prototype;i instanceof t||(n.prototype=t.prototype,n=new n,u(i,n),e.prototype=i=n),i.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),i.constructor=e)}function c(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,he[e]),this.message=he[e],Error.captureStackTrace&&Error.captureStackTrace(this,c);return n.code=e,t&&(this.message=this.message+": "+t),n}function d(){}function h(e,t){this._node=e,this._refresh=t,p(this)}function p(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);Y(e,"length",n.length),u(n,e),e._inc=t}}function f(){}function m(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function g(e,t,n,i){if(i?t[m(t,i)]=n:t[t.length++]=n,e){n.ownerElement=e;var r=e.ownerDocument;r&&(i&&w(r,e,i),E(r,e,n))}}function y(e,t,n){var i=m(t,n);if(!(i>=0))throw c(fe,new Error(e.tagName+"@"+n));for(var r=t.length-1;i<r;)t[i]=t[++i];if(t.length=r,e){var a=e.ownerDocument;a&&(w(a,e,n),n.ownerElement=null)}}function v(){}function _(){}function b(e){return"<"==e&&"&lt;"||">"==e&&"&gt;"||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function T(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(T(e,t))return!0}while(e=e.nextSibling)}function S(){}function E(e,t,n){e&&e._inc++,n.namespaceURI===$.XMLNS&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function w(e,t,n,i){e&&e._inc++,n.namespaceURI===$.XMLNS&&delete t._nsMap[n.prefix?n.localName:""]}function k(e,t,n){if(e&&e._inc){e._inc++;var i=t.childNodes;if(n)i[i.length++]=n;else{for(var r=t.firstChild,a=0;r;)i[a++]=r,r=r.nextSibling;i.length=a}}}function C(e,t){var n=t.previousSibling,i=t.nextSibling;return n?n.nextSibling=i:e.firstChild=i,i?i.previousSibling=n:e.lastChild=n,k(e.ownerDocument,e),t}function A(e,t,n){var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===le){var r=t.firstChild;if(null==r)return t;var a=t.lastChild}else r=a=t;var s=n?n.previousSibling:e.lastChild;r.previousSibling=s,a.nextSibling=n,s?s.nextSibling=r:e.firstChild=r,null==n?e.lastChild=a:n.previousSibling=a;do{r.parentNode=e}while(r!==a&&(r=r.nextSibling));return k(e.ownerDocument||e,e),t.nodeType==le&&(t.firstChild=t.lastChild=null),t}function I(e,t){var n=t.parentNode;if(n){var i=e.lastChild;n.removeChild(t);var i=e.lastChild}var i=e.lastChild;return t.parentNode=e,t.previousSibling=i,t.nextSibling=null,i?i.nextSibling=t:e.firstChild=t,e.lastChild=t,k(e.ownerDocument,e,t),t}function x(){this._nsMap={}}function P(){}function O(){}function L(){}function D(){}function R(){}function M(){}function N(){}function U(){}function B(){}function j(){}function F(){}function H(){}function q(e,t){var n=[],i=9==this.nodeType&&this.documentElement||this,r=i.prefix,a=i.namespaceURI;if(a&&null==r){var r=i.lookupPrefix(a);if(null==r)var s=[{namespace:a,prefix:null}]}return G(this,n,e,t,s),n.join("")}function V(e,t,n){var i=e.prefix||"",r=e.namespaceURI;if(!r)return!1;if("xml"===i&&r===$.XML||r===$.XMLNS)return!1;for(var a=n.length;a--;){var s=n[a];if(s.prefix===i)return s.namespace!==r}return!0}function W(e,t,n){e.push(" ",t,'="',n.replace(/[<&"]/g,b),'"')}function G(e,t,n,i,r){if(r||(r=[]),i){if(!(e=i(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case Z:var a=e.attributes,s=a.length,o=e.firstChild,u=e.tagName;n=$.isHTML(e.namespaceURI)||n;var l=u;if(!n&&!e.prefix&&e.namespaceURI){for(var c,d=0;d<a.length;d++)if("xmlns"===a.item(d).name){c=a.item(d).value;break}if(!c)for(var h=r.length-1;h>=0;h--){var p=r[h];if(""===p.prefix&&p.namespace===e.namespaceURI){c=p.namespace;break}}if(c!==e.namespaceURI)for(var h=r.length-1;h>=0;h--){var p=r[h];if(p.namespace===e.namespaceURI){p.prefix&&(l=p.prefix+":"+u);break}}}t.push("<",l);for(var f=0;f<s;f++){var m=a.item(f);"xmlns"==m.prefix?r.push({prefix:m.localName,namespace:m.value}):"xmlns"==m.nodeName&&r.push({prefix:"",namespace:m.value})}for(var f=0;f<s;f++){var m=a.item(f);if(V(m,n,r)){var g=m.prefix||"",y=m.namespaceURI;W(t,g?"xmlns:"+g:"xmlns",y),r.push({prefix:g,namespace:y})}G(m,t,n,i,r)}if(u===l&&V(e,n,r)){var g=e.prefix||"",y=e.namespaceURI;W(t,g?"xmlns:"+g:"xmlns",y),r.push({prefix:g,namespace:y})}if(o||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(t.push(">"),n&&/^script$/i.test(u))for(;o;)o.data?t.push(o.data):G(o,t,n,i,r.slice()),o=o.nextSibling;else for(;o;)G(o,t,n,i,r.slice()),o=o.nextSibling;t.push("</",l,">")}else t.push("/>");return;case oe:case le:for(var o=e.firstChild;o;)G(o,t,n,i,r.slice()),o=o.nextSibling;return;case ee:return W(t,e.name,e.value);case te:return t.push(e.data.replace(/[<&]/g,b).replace(/]]>/g,"]]&gt;"));case ne:return t.push("<![CDATA[",e.data,"]]>");case se:return t.push("\x3c!--",e.data,"--\x3e");case ue:var v=e.publicId,_=e.systemId;if(t.push("<!DOCTYPE ",e.name),v)t.push(" PUBLIC ",v),_&&"."!=_&&t.push(" ",_),t.push(">");else if(_&&"."!=_)t.push(" SYSTEM ",_,">");else{var T=e.internalSubset;T&&t.push(" [",T,"]"),t.push(">")}return;case ae:return t.push("<?",e.target," ",e.data,"?>");case ie:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function z(e,t,n){var i;switch(t.nodeType){case Z:i=t.cloneNode(!1),i.ownerDocument=e;case le:break;case ee:n=!0}if(i||(i=t.cloneNode(!1)),i.ownerDocument=e,i.parentNode=null,n)for(var r=t.firstChild;r;)i.appendChild(z(e,r,n)),r=r.nextSibling;return i}function X(e,t,n){var i=new t.constructor;for(var r in t){var a=t[r];"object"!=typeof a&&a!=i[r]&&(i[r]=a)}switch(t.childNodes&&(i.childNodes=new d),i.ownerDocument=e,i.nodeType){case Z:var s=t.attributes,o=i.attributes=new f,u=s.length;o._ownerElement=i;for(var l=0;l<u;l++)i.setAttributeNode(X(e,s.item(l),!0));break;case ee:n=!0}if(n)for(var c=t.firstChild;c;)i.appendChild(X(e,c,n)),c=c.nextSibling;return i}function Y(e,t,n){e[t]=n}function K(e){switch(e.nodeType){case Z:case le:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(K(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}var Q=n(4),$=Q.NAMESPACE,J={},Z=J.ELEMENT_NODE=1,ee=J.ATTRIBUTE_NODE=2,te=J.TEXT_NODE=3,ne=J.CDATA_SECTION_NODE=4,ie=J.ENTITY_REFERENCE_NODE=5,re=J.ENTITY_NODE=6,ae=J.PROCESSING_INSTRUCTION_NODE=7,se=J.COMMENT_NODE=8,oe=J.DOCUMENT_NODE=9,ue=J.DOCUMENT_TYPE_NODE=10,le=J.DOCUMENT_FRAGMENT_NODE=11,ce=J.NOTATION_NODE=12,de={},he={},pe=(de.INDEX_SIZE_ERR=(he[1]="Index size error",1),de.DOMSTRING_SIZE_ERR=(he[2]="DOMString size error",2),de.HIERARCHY_REQUEST_ERR=(he[3]="Hierarchy request error",3)),fe=(de.WRONG_DOCUMENT_ERR=(he[4]="Wrong document",4),de.INVALID_CHARACTER_ERR=(he[5]="Invalid character",5),de.NO_DATA_ALLOWED_ERR=(he[6]="No data allowed",6),de.NO_MODIFICATION_ALLOWED_ERR=(he[7]="No modification allowed",7),de.NOT_FOUND_ERR=(he[8]="Not found",8)),me=(de.NOT_SUPPORTED_ERR=(he[9]="Not supported",9),de.INUSE_ATTRIBUTE_ERR=(he[10]="Attribute in use",10));de.INVALID_STATE_ERR=(he[11]="Invalid state",11),de.SYNTAX_ERR=(he[12]="Syntax error",12),de.INVALID_MODIFICATION_ERR=(he[13]="Invalid modification",13),de.NAMESPACE_ERR=(he[14]="Invalid namespace",14),de.INVALID_ACCESS_ERR=(he[15]="Invalid access",15);c.prototype=Error.prototype,u(de,c),d.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var n=[],i=0;i<this.length;i++)G(this[i],n,e,t);return n.join("")}},h.prototype.item=function(e){return p(this),this[e]},l(h,d),f.prototype={length:0,item:d.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 c(me);var n=this.getNamedItem(e.nodeName);return g(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t,n=e.ownerElement;if(n&&n!=this._ownerElement)throw new c(me);return t=this.getNamedItemNS(e.namespaceURI,e.localName),g(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return y(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return y(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var i=this[n];if(i.localName==t&&i.namespaceURI==e)return i}return null}},v.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var i=new S;if(i.implementation=this,i.childNodes=new d,i.doctype=n||null,n&&i.appendChild(n),t){var r=i.createElementNS(e,t);i.appendChild(r)}return i},createDocumentType:function(e,t,n){var i=new M;return i.name=e,i.nodeName=e,i.publicId=t||"",i.systemId=n||"",i}},_.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 A(this,e,t)},replaceChild:function(e,t){this.insertBefore(e,t),t&&this.removeChild(t)},removeChild:function(e){return C(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return X(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==te&&e.nodeType==te?(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 i in n)if(n[i]==e)return i;t=t.nodeType==ee?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==ee?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},u(J,_),u(J,_.prototype),S.prototype={nodeName:"#document",nodeType:oe,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==le){for(var n=e.firstChild;n;){var i=n.nextSibling;this.insertBefore(n,t),n=i}return e}return null==this.documentElement&&e.nodeType==Z&&(this.documentElement=e),A(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),C(this,e)},importNode:function(e,t){return z(this,e,t)},getElementById:function(e){var t=null;return T(this.documentElement,function(n){if(n.nodeType==Z&&n.getAttribute("id")==e)return t=n,!0}),t},getElementsByClassName:function(e){var t=s(e);return new h(this,function(n){var i=[];return t.length>0&&T(n.documentElement,function(r){if(r!==n&&r.nodeType===Z){var a=r.getAttribute("class");if(a){var u=e===a;if(!u){var l=s(a);u=t.every(o(l))}u&&i.push(r)}}}),i})},createElement:function(e){var t=new x;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new d,(t.attributes=new f)._ownerElement=t,t},createDocumentFragment:function(){var e=new j;return e.ownerDocument=this,e.childNodes=new d,e},createTextNode:function(e){var t=new L;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new D;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new R;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new F;return n.ownerDocument=this,n.tagName=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 B;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new x,i=t.split(":"),r=n.attributes=new f;return n.childNodes=new d,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,r._ownerElement=n,n},createAttributeNS:function(e,t){var n=new P,i=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,n}},l(S,_),x.prototype={nodeType:Z,hasAttribute:function(e){return null!=this.getAttributeNode(e)},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===le?this.insertBefore(e,null):I(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 null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var i=this.ownerDocument.createAttributeNS(e,t);i.value=i.nodeValue=""+n,this.setAttributeNode(i)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new h(this,function(t){var n=[];return T(t,function(i){i===t||i.nodeType!=Z||"*"!==e&&i.tagName!=e||n.push(i)}),n})},getElementsByTagNameNS:function(e,t){return new h(this,function(n){var i=[];return T(n,function(r){r===n||r.nodeType!==Z||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||i.push(r)}),i})}},S.prototype.getElementsByTagName=x.prototype.getElementsByTagName,S.prototype.getElementsByTagNameNS=x.prototype.getElementsByTagNameNS,l(x,_),P.prototype.nodeType=ee,l(P,_),O.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 new Error(he[pe])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},l(O,_),L.prototype={nodeName:"#text",nodeType:te,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 i=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},l(L,O),D.prototype={nodeName:"#comment",nodeType:se},l(D,O),R.prototype={nodeName:"#cdata-section",nodeType:ne},l(R,O),M.prototype.nodeType=ue,l(M,_),N.prototype.nodeType=ce,l(N,_),U.prototype.nodeType=re,l(U,_),B.prototype.nodeType=ie,l(B,_),j.prototype.nodeName="#document-fragment",j.prototype.nodeType=le,l(j,_),F.prototype.nodeType=ae,l(F,_),H.prototype.serializeToString=function(e,t,n){return q.call(e,t,n)},_.prototype.toString=q;try{Object.defineProperty&&(Object.defineProperty(h.prototype,"length",{get:function(){return p(this),this.$$length}}),Object.defineProperty(_.prototype,"textContent",{get:function(){return K(this)},set:function(e){switch(this.nodeType){case Z:case le: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}}}),Y=function(e,t,n){e["$$"+t]=n})}catch(e){}t.DocumentType=M,t.DOMException=c,t.DOMImplementation=v,t.Element=x,t.Node=_,t.NodeList=d,t.XMLSerializer=H},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(3),r=Object(i.k)([73,68,51]),a=function(e,t){void 0===t&&(t=0),e=Object(i.k)(e);var n=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&n)>>4?r+20:r+10},s=function e(t,n){return void 0===n&&(n=0),t=Object(i.k)(t),t.length-n<10||!Object(i.a)(t,r,{offset:n})?n:(n+=a(t,n),e(t,n))}},function(e,t,n){"use strict";function i(){var e=new Date;return(e.getHours()>=10?e.getHours():"0"+e.getHours())+":"+(e.getMinutes()>=10?e.getMinutes():"0"+e.getMinutes())}function r(e,t){Object.keys(t).forEach(function(n){t.hasOwnProperty(n)&&(e[n]=t[n])})}function a(){return!!navigator.userAgent.toLowerCase().match(/rv:([\d.]+)\) like gecko/)}function s(){return-1!==navigator.userAgent.indexOf("Windows NT 6.1")}function o(e){setTimeout(function(){e.controlBar.setAttribute("tabindex","0"),e.controlBar.el_.focus()})}Object.defineProperty(t,"__esModule",{value:!0}),t.getTime=i,t.assign=r,t.isIE11=a,t.isWin7=s,t.setControlBarFocus=o},function(e,t,n){e.exports=n(16)},function(e,t,n){"use strict";(function(t){function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}function a(e,t,n){var i=t.title,a=t.logo,o=t.loadingLogo,c=t.spriteThumbnails,p=t.markers,f=t.resources,m=t.flashUrl,g=t.rateChangeTip,y=t.supportTip,v=t.forcePlaybackRates,_=t.hotKeysOptions,b=void 0===_?{}:_,T=r(t,["title","logo","loadingLogo","spriteThumbnails","markers","resources","flashUrl","rateChangeTip","supportTip","forcePlaybackRates","hotKeysOptions"]),S=null;u.default.options.flash.swf=m||"//gcdncs.101.com/v0.1/static/fish/videoplayer/video-js.swf",h&&!v&&delete T.playbackRates;var E=(0,u.default)(e,s({},T));h&&0===E.audioTracks().length&&E.controlBar.audioTrackButton.el_&&(E.controlBar.audioTrackButton.el_.style.display="none");var w=function(e){if("Flash"===E.tech().name_&&T.flash&&T.flash.hls&&T.flash.hls.keyCallback){E.createModal("Flash \u6682\u4e0d\u652f\u6301\u81ea\u5b9a\u4e49\u4f20 key \u89e3\u5bc6\u6d41\u7a0b",{uncloseable:!0}).addClass("vjs-flash-error-modal")}if(f&&E.updateSrc(f),(h&&(0,l.isWin7)()||"Flash"===E.tech().name_)&&E.src().indexOf(".m3u8")>=0){var t=u.default.dom.createEl("div");t.innerHTML=y||'\n \u5f53\u524d\u6d4f\u89c8\u5668\u7248\u672c\u5df2\u7ecf\u8fc7\u65f6\uff0c\u53ef\u80fd\u5bfc\u81f4\u64ad\u653e\u9519\u8bef\u3002\u4e3a\u63d0\u5347\u60a8\u7684\u89c2\u770b\u4f53\u9a8c\u8bf7<a href="//gcdncs.101.com/v0.1/static/update/index.html">\n \u70b9\u51fb\u5347\u7ea7\u6d4f\u89c8\u5668\u6765\u83b7\u5f97\u66f4\u597d\u7684\u4f53\u9a8c</a> \u6216\u5207\u6362\u6d4f\u89c8\u5668\u6a21\u5f0f';return void E.createModal(t).addClass("vjs-flash-upgrade-modal")}if(E.isAudio()&&!E.poster()){var r=d.default.audioBg(E);E.paused()&&r.addClass("hide-audio-background"),E.on("pause",function(){r.addClass("hide-audio-background")}),E.on("play",function(){r.removeClass("hide-audio-background")}),E.on("click",function(e){e.target.className.indexOf("vjs-audio")>-1&&(E.paused()?E.play():E.pause())})}a&&d.default.logo(E,a),i&&d.default.title(E,i),d.default.topControl(E),E.on("fullscreenchange",function(){E.isFullscreen()||(E.removeClass("vjs-fullscreen-middle"),E.removeClass("vjs-fullscreen-small"))});var o=!1;E.on("ratechange",function(){g&&d.default.playbackRateTip(E,g,!o),o=!1,(0,l.setControlBarFocus)(E)}),E.on("resolutionchange",function(){if(o=!0,(0,l.setControlBarFocus)(E),E.paused()){var e=E.play();void 0!==e&&e.then(function(e){E.pause()}).catch(function(){})}}),E.hotkeys(s({enableVolumeScroll:!1},b)),c&&E.spriteThumbnails(c),p&&E.markers(p),n&&n(e)};return E.on("ready",function(e){o?(d.default.frontLoading(E,o.url),E.pause(),S=setTimeout(function(){E.removeChild("FrontLoading"),T.autoplay&&E.autoplay("play"),w(e)},o.time)):w(e)}),E.on("dispose",function(){clearTimeout(S)}),E}var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},o=n(0),u=i(o);n(31),n(33),n(52),n(53),n(54),n(55),n(56),n(57),n(58);var l=n(14),c=n(59),d=i(c);n(60);var h=(0,l.isIE11)();(0,l.assign)(a,u.default),t.videojs=u.default,e.exports=a}).call(t,n(2))},function(e,t,n){(function(t){var n;n="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=n}).call(t,n(2))},function(e,t,n){(function(t){var i,r=void 0!==t?t:"undefined"!=typeof window?window:{},a=n(19);"undefined"!=typeof document?i=document:(i=r["__GLOBAL_DOCUMENT_CACHE@4"])||(i=r["__GLOBAL_DOCUMENT_CACHE@4"]=a),e.exports=i}).call(t,n(2))},function(e,t){},function(e,t){function n(e){return e.replace(/\n\r?\s*/g,"")}e.exports=function(e){for(var t="",i=0;i<arguments.length;i++)t+=n(e[i])+(arguments[i+1]||"");return t}},function(e,t){function n(e,t){var n,i=null;try{n=JSON.parse(e,t)}catch(e){i=e}return[i,n]}e.exports=n},function(e,t,n){"use strict";function i(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function r(e,t,n){var i=e;return c(t)?(n=t,"string"==typeof e&&(i={uri:e})):i=h(t,{uri:e}),i.callback=n,i}function a(e,t,n){return t=r(e,t,n),s(t)}function s(e){function t(){4===c.readyState&&setTimeout(s,0)}function n(){var e=void 0;if(e=c.response?c.response:c.responseText||o(c),b)try{e=JSON.parse(e)}catch(e){}return e}function r(e){return clearTimeout(f),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,l(e,T)}function s(){if(!p){var t;clearTimeout(f),t=e.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var i=T,r=null;return 0!==t?(i={body:n(),statusCode:t,method:g,headers:{},url:m,rawRequest:c},c.getAllResponseHeaders&&(i.headers=d(c.getAllResponseHeaders()))):r=new Error("Internal XMLHttpRequest Error"),l(r,i,i.body)}}if(void 0===e.callback)throw new Error("callback argument missing");var u=!1,l=function(t,n,i){u||(u=!0,e.callback(t,n,i))},c=e.xhr||null;c||(c=e.cors||e.useXDR?new a.XDomainRequest:new a.XMLHttpRequest);var h,p,f,m=c.url=e.uri||e.url,g=c.method=e.method||"GET",y=e.body||e.data,v=c.headers=e.headers||{},_=!!e.sync,b=!1,T={body:void 0,headers:{},statusCode:0,method:g,url:m,rawRequest:c};if("json"in e&&!1!==e.json&&(b=!0,v.accept||v.Accept||(v.Accept="application/json"),"GET"!==g&&"HEAD"!==g&&(v["content-type"]||v["Content-Type"]||(v["Content-Type"]="application/json"),y=JSON.stringify(!0===e.json?y:e.json))),c.onreadystatechange=t,c.onload=s,c.onerror=r,c.onprogress=function(){},c.onabort=function(){p=!0},c.ontimeout=r,c.open(g,m,!_,e.username,e.password),_||(c.withCredentials=!!e.withCredentials),!_&&e.timeout>0&&(f=setTimeout(function(){if(!p){p=!0,c.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}},e.timeout)),c.setRequestHeader)for(h in v)v.hasOwnProperty(h)&&c.setRequestHeader(h,v[h]);else if(e.headers&&!i(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(c.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(c),c.send(y||null),c}function o(e){if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;return""!==e.responseType||t?null:e.responseXML}function u(){}var l=n(23),c=n(24),d=n(25),h=n(26);e.exports=a,a.XMLHttpRequest=l.XMLHttpRequest||u,a.XDomainRequest="withCredentials"in new a.XMLHttpRequest?a.XMLHttpRequest:l.XDomainRequest,function(e,t){for(var n=0;n<e.length;n++)t(e[n])}(["get","put","post","patch","head","delete"],function(e){a["delete"===e?"del":e]=function(t,n,i){return n=r(t,n,i),n.method=e.toUpperCase(),s(n)}})},function(e,t,n){(function(t){var n;n="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=n}).call(t,n(2))},function(e,t){function n(e){if(!e)return!1;var t=i.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}e.exports=n;var i=Object.prototype.toString},function(e,t){var n=function(e){return e.replace(/^\s+|\s+$/g,"")},i=function(e){return"[object Array]"===Object.prototype.toString.call(e)};e.exports=function(e){if(!e)return{};for(var t={},r=n(e).split("\n"),a=0;a<r.length;a++){var s=r[a],o=s.indexOf(":"),u=n(s.slice(0,o)).toLowerCase(),l=n(s.slice(o+1));void 0===t[u]?t[u]=l:i(t[u])?t[u].push(l):t[u]=[t[u],l]}return t}},function(e,t){function n(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)i.call(n,r)&&(e[r]=n[r])}return e}e.exports=n;var i=Object.prototype.hasOwnProperty},function(e,t,n){var i=n(1),r=e.exports={WebVTT:n(28),VTTCue:n(29),VTTRegion:n(30)};i.vttjs=r,i.WebVTT=r.WebVTT;var a=r.VTTCue,s=r.VTTRegion,o=i.VTTCue,u=i.VTTRegion;r.shim=function(){i.VTTCue=a,i.VTTRegion=s},r.restore=function(){i.VTTCue=o,i.VTTRegion=u},i.VTTCue||r.shim()},function(e,t){function n(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function i(e){function t(e,t,n,i){return 3600*(0|e)+60*(0|t)+(0|n)+(0|i)/1e3}var n=e.match(/^(\d+):(\d{2})(:\d{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 r(){this.values=g(null)}function a(e,t,n,i){var r=i?e.split(i):[e];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(n);if(2===s.length){var o=s[0],u=s[1];t(o,u)}}}function s(e,t,s){function o(){var t=i(e);if(null===t)throw new n(n.Errors.BadTimeStamp,"Malformed timestamp: "+l);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function u(){e=e.replace(/^\s+/,"")}var l=e;if(u(),t.startTime=o(),u(),"--\x3e"!==e.substr(0,3))throw new n(n.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+l);e=e.substr(3),u(),t.endTime=o(),u(),function(e,t){var n=new r;a(e,function(e,t){switch(e){case"region":for(var i=s.length-1;i>=0;i--)if(s[i].id===t){n.set(e,s[i].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var r=t.split(","),a=r[0];n.integer(e,a),n.percent(e,a)&&n.set("snapToLines",!1),n.alt(e,a,["auto"]),2===r.length&&n.alt("lineAlign",r[1],["start","middle","end"]);break;case"position":r=t.split(","),n.percent(e,r[0]),2===r.length&&n.alt("positionAlign",r[1],["start","middle","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","middle","end","left","right"])}},/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical",""),t.line=n.get("line","auto"),t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100),t.align=n.get("align","middle"),t.position=n.get("position",{start:0,left:0,middle:50,end:100,right:100},t.align),t.positionAlign=n.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},t.align)}(e,t)}function o(e,t){function n(e){return y[e]}for(var r,a=e.document.createElement("div"),s=a,o=[];null!==(r=function(){if(!t)return null;var e=t.match(/^([^<]*)(<[^>]*>?)?/);return function(e){return t=t.substr(e.length),e}(e[1]?e[1]:e[2])}());)if("<"!==r[0])s.appendChild(e.document.createTextNode(function(e){for(;c=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)e=e.replace(c[0],n);return e}(r)));else{if("/"===r[1]){o.length&&o[o.length-1]===r.substr(2).replace(">","")&&(o.pop(),s=s.parentNode);continue}var u,l=i(r.substr(1,r.length-2));if(l){u=e.document.createProcessingInstruction("timestamp",l),s.appendChild(u);continue}var c=r.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!c)continue;if(!(u=function(t,n){var i=v[t];if(!i)return null;var r=e.document.createElement(i);r.localName=i;var a=_[t];return a&&n&&(r[a]=n.trim()),r}(c[1],c[3])))continue;if(!function(e,t){return!b[t.localName]||b[t.localName]===e.localName}(s,u))continue;c[2]&&(u.className=c[2].substr(1).replace("."," ")),o.push(c[1]),s.appendChild(u),s=u}return a}function u(e){for(var t=0;t<T.length;t++){var n=T[t];if(e>=n[0]&&e<=n[1])return!0}return!1}function l(e){function t(e,t){for(var n=t.childNodes.length-1;n>=0;n--)e.push(t.childNodes[n])}function n(e){if(!e||!e.length)return null;var i=e.pop(),r=i.textContent||i.innerText;if(r){var a=r.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):r}return"ruby"===i.tagName?n(e):i.childNodes?(t(e,i),n(e)):void 0}var i,r=[],a="";if(!e||!e.childNodes)return"ltr";for(t(r,e);a=n(r);)for(var s=0;s<a.length;s++)if(i=a.charCodeAt(s),u(i))return"rtl";return"ltr"}function c(e){if("number"==typeof e.line&&(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,i=0,r=0;r<n.length&&n[r]!==t;r++)"showing"===n[r].mode&&i++;return-1*++i}function d(){}function h(e,t,n){var i=/MSIE\s8\.0/.test(navigator.userAgent),r="rgba(255, 255, 255, 1)",a="rgba(0, 0, 0, 0.8)";i&&(r="rgb(255, 255, 255)",a="rgb(0, 0, 0)"),d.call(this),this.cue=t,this.cueDiv=o(e,t.text);var s={color:r,backgroundColor:a,position:"relative",left:0,right:0,top:0,bottom:0,display:"inline"};i||(s.writingMode=""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",s.unicodeBidi="plaintext"),this.applyStyles(s,this.cueDiv),this.div=e.document.createElement("div"),s={textAlign:"middle"===t.align?"center":t.align,font:n.font,whiteSpace:"pre-line",position:"absolute"},i||(s.direction=l(this.cueDiv),s.writingMode=""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl".stylesunicodeBidi="plaintext"),this.applyStyles(s),this.div.appendChild(this.cueDiv);var u=0;switch(t.positionAlign){case"start":u=t.position;break;case"middle":u=t.position-t.size/2;break;case"end":u=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(u,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(u,"%"),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")})}}function p(e){var t,n,i,r,a=/MSIE\s8\.0/.test(navigator.userAgent);if(e.div){n=e.div.offsetHeight,i=e.div.offsetWidth,r=e.div.offsetTop;var s=(s=e.div.childNodes)&&(s=s[0])&&s.getClientRects&&s.getClientRects();e=e.div.getBoundingClientRect(),t=s?Math.max(s[0]&&s[0].height||0,e.height/s.length):0}this.left=e.left,this.right=e.right,this.top=e.top||r,this.height=e.height||n,this.bottom=e.bottom||r+(e.height||n),this.width=e.width||i,this.lineHeight=void 0!==t?t:e.lineHeight,a&&!this.lineHeight&&(this.lineHeight=13)}function f(e,t,n,i){var r=new p(t),a=t.cue,s=c(a),o=[];if(a.snapToLines){var u;switch(a.vertical){case"":o=["+y","-y"],u="height";break;case"rl":o=["+x","-x"],u="width";break;case"lr":o=["-x","+x"],u="width"}var l=r.lineHeight,d=l*Math.round(s),h=n[u]+l,f=o[0];Math.abs(d)>h&&(d=d<0?-1:1,d*=Math.ceil(h/l)*l),s<0&&(d+=""===a.vertical?n.height:n.width,o=o.reverse()),r.move(f,d)}else{var m=r.lineHeight/n.height*100;switch(a.lineAlign){case"middle":s-=m/2;break;case"end":s-=m}switch(a.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,"%")})}o=["+y","-x","+x","-y"],r=new p(t)}var g=function(e,t){for(var r,a=new p(e),s=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(n,t[o])||e.within(n)&&e.overlapsAny(i);)e.move(t[o]);if(e.within(n))return e;var u=e.intersectPercentage(n);s>u&&(r=new p(e),s=u),e=new p(a)}return r||a}(r,o);t.move(g.toCSSCompatValues(n))}function m(){}var g=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();n.prototype=g(Error.prototype),n.prototype.constructor=n,n.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},r.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 i=0;i<n.length;++i)if(t===n[i]){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))>=0&&t<=100)&&(this.set(e,t),!0)}};var y={"&amp;":"&","&lt;":"<","&gt;":">","&lrm;":"\u200e","&rlm;":"\u200f","&nbsp;":"\xa0"},v={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},_={v:"title",lang:"lang"},b={rt:"ruby"},T=[[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]];d.prototype.applyStyles=function(e,t){t=t||this.div;for(var n in e)e.hasOwnProperty(n)&&(t.style[n]=e[n])},d.prototype.formatStyle=function(e,t){return 0===e?0:e+t},h.prototype=g(d.prototype),h.prototype.constructor=h,p.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,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}},p.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},p.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},p.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},p.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}},p.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)},p.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}},p.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,i=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||i,height:e.height||t,bottom:e.bottom||i+(e.height||t),width:e.width||n}},m.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},m.convertCueToDOMTree=function(e,t){return e&&t?o(e,t):null};m.processCues=function(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var i=e.document.createElement("div");if(i.style.position="absolute",i.style.left="0",i.style.right="0",i.style.top="0",i.style.bottom="0",i.style.margin="1.5%",n.appendChild(i),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var r=[],a=p.getSimpleBoxPosition(i),s=Math.round(.05*a.height*100)/100,o={font:s+"px sans-serif"};!function(){for(var n,s,u=0;u<t.length;u++)s=t[u],n=new h(e,s,o),i.appendChild(n.div),f(e,n,a,r),s.displayState=n.div,r.push(p.getSimpleBoxPosition(n))}()}else for(var u=0;u<t.length;u++)i.appendChild(t[u].displayState)},m.Parser=function(e,t,n){n||(n=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=n||new TextDecoder("utf8"),this.regionList=[]},m.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof n))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){function t(){for(var e=l.buffer,t=0;t<e.length&&"\r"!==e[t]&&"\n"!==e[t];)++t;var n=e.substr(0,t);return"\r"===e[t]&&++t,"\n"===e[t]&&++t,l.buffer=e.substr(t),n}function o(e){var t=new r;if(a(e,function(e,n){switch(e){case"id":t.set(e,n);break;case"width":t.percent(e,n);break;case"lines":t.integer(e,n);break;case"regionanchor":case"viewportanchor":var i=n.split(",");if(2!==i.length)break;var a=new r;if(a.percent("x",i[0]),a.percent("y",i[1]),!a.has("x")||!a.has("y"))break;t.set(e+"X",a.get("x")),t.set(e+"Y",a.get("y"));break;case"scroll":t.alt(e,n,["up"])}},/=/,/\s/),t.has("id")){var n=new(l.vttjs.VTTRegion||l.window.VTTRegion);n.width=t.get("width",100),n.lines=t.get("lines",3),n.regionAnchorX=t.get("regionanchorX",0),n.regionAnchorY=t.get("regionanchorY",100),n.viewportAnchorX=t.get("viewportanchorX",0),n.viewportAnchorY=t.get("viewportanchorY",100),n.scroll=t.get("scroll",""),l.onregion&&l.onregion(n),l.regionList.push({id:t.get("id"),region:n})}}function u(e){var t=new r;a(e,function(e,n){switch(e){case"MPEGT":t.integer(e+"S",n);break;case"LOCA":t.set(e+"L",i(n))}},/[^\d]:/,/,/),l.ontimestampmap&&l.ontimestampmap({MPEGTS:t.get("MPEGTS"),LOCAL:t.get("LOCAL")})}var l=this;e&&(l.buffer+=l.decoder.decode(e,{stream:!0}));try{var c;if("INITIAL"===l.state){if(!/\r\n|\n/.test(l.buffer))return this;c=t();var d=c.match(/^WEBVTT([ \t].*)?$/);if(!d||!d[0])throw new n(n.Errors.BadSignature);l.state="HEADER"}for(var h=!1;l.buffer;){if(!/\r\n|\n/.test(l.buffer))return this;switch(h?h=!1:c=t(),l.state){case"HEADER":/:/.test(c)?function(e){e.match(/X-TIMESTAMP-MAP/)?a(e,function(e,t){switch(e){case"X-TIMESTAMP-MAP":u(t)}},/=/):a(e,function(e,t){switch(e){case"Region":o(t)}},/:/)}(c):c||(l.state="ID");continue;case"NOTE":c||(l.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(c)){l.state="NOTE";break}if(!c)continue;if(l.cue=new(l.vttjs.VTTCue||l.window.VTTCue)(0,0,""),l.state="CUE",-1===c.indexOf("--\x3e")){l.cue.id=c;continue}case"CUE":try{s(c,l.cue,l.regionList)}catch(e){l.reportOrThrowError(e),l.cue=null,l.state="BADCUE";continue}l.state="CUETEXT";continue;case"CUETEXT":var p=-1!==c.indexOf("--\x3e");if(!c||p&&(h=!0)){l.oncue&&l.oncue(l.cue),l.cue=null,l.state="ID";continue}l.cue.text&&(l.cue.text+="\n"),l.cue.text+=c;continue;case"BADCUE":c||(l.state="ID");continue}}}catch(e){l.reportOrThrowError(e),"CUETEXT"===l.state&&l.cue&&l.oncue&&l.oncue(l.cue),l.cue=null,l.state="INITIAL"===l.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new n(n.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},e.exports=m},function(e,t){function n(e){return"string"==typeof e&&(!!o[e.toLowerCase()]&&e.toLowerCase())}function i(e){return"string"==typeof e&&(!!u[e.toLowerCase()]&&e.toLowerCase())}function r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)e[i]=n[i]}return e}function a(e,t,a){var o=this,u=/MSIE\s8\.0/.test(navigator.userAgent),l={};u?o=document.createElement("custom"):l.enumerable=!0,o.hasBeenReset=!1;var c="",d=!1,h=e,p=t,f=a,m=null,g="",y=!0,v="auto",_="start",b=50,T="middle",S=50,E="middle";if(Object.defineProperty(o,"id",r({},l,{get:function(){return c},set:function(e){c=""+e}})),Object.defineProperty(o,"pauseOnExit",r({},l,{get:function(){return d},set:function(e){d=!!e}})),Object.defineProperty(o,"startTime",r({},l,{get:function(){return h},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");h=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",r({},l,{get:function(){return p},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");p=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",r({},l,{get:function(){return f},set:function(e){f=""+e,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",r({},l,{get:function(){return m},set:function(e){m=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",r({},l,{get:function(){return g},set:function(e){var t=n(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");g=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",r({},l,{get:function(){return y},set:function(e){y=!!e,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",r({},l,{get:function(){return v},set:function(e){if("number"!=typeof e&&e!==s)throw new SyntaxError("An invalid number or illegal string was specified.");v=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",r({},l,{get:function(){return _},set:function(e){var t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",r({},l,{get:function(){return b},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",r({},l,{get:function(){return T},set:function(e){var t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");T=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",r({},l,{get:function(){return S},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");S=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",r({},l,{get:function(){return E},set:function(e){var t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");E=t,this.hasBeenReset=!0}})),o.displayState=void 0,u)return o}var s="auto",o={"":!0,lr:!0,rl:!0},u={start:!0,middle:!0,end:!0,left:!0,right:!0};a.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=a},function(e,t){function n(e){return"string"==typeof e&&(!!a[e.toLowerCase()]&&e.toLowerCase())}function i(e){return"number"==typeof e&&e>=0&&e<=100}function r(){var e=100,t=3,r=0,a=100,s=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!i(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!i(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e}},regionAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!i(e))throw new Error("RegionAnchorY must be between 0 and 100.");r=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!i(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!i(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var t=n(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");u=t}}})}var a={"":!0,up:!0};e.exports=r},function(e,t,n){"use strict";function i(e){T[e]=function(){return this.el_.vjs_getProperty(e)}}Object.defineProperty(t,"__esModule",{value:!0});for(var r=n(0),a=n.n(r),s=n(32),o=(n.n(s),n(1)),u=n.n(o),l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},c=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},d=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},h=a.a.getComponent("Tech"),p=a.a.dom,f=a.a.url,m=a.a.createTimeRange,g=a.a.mergeOptions,y=u.a&&u.a.navigator||{},v=function(e){function t(n,i){l(this,t);var r=d(this,e.call(this,n,i));return n.source&&r.ready(function(){this.setSource(n.source)},!0),n.startTime&&r.ready(function(){this.load(),this.play(),this.currentTime(n.startTime)},!0),u.a.videojs=u.a.videojs||{},u.a.videojs.Flash=u.a.videojs.Flash||{},u.a.videojs.Flash.onReady=t.onReady,u.a.videojs.Flash.onEvent=t.onEvent,u.a.videojs.Flash.onError=t.onError,r.on("seeked",function(){this.lastSeekTarget_=void 0}),r}return c(t,e),t.prototype.createEl=function(){var e=this.options_;e.swf||(e.swf="https://vjs.zencdn.net/swf/"+s.version+"/video-js.swf");var n=e.techId,i=g({readyFunction:"videojs.Flash.onReady",eventProxyFunction:"videojs.Flash.onEvent",errorEventProxyFunction:"videojs.Flash.onError",autoplay:e.autoplay,preload:e.preload,loop:e.loop,muted:e.muted},e.flashVars),r=g({wmode:"opaque",bgcolor:"#000000"},e.params),a=g({id:n,name:n,class:"vjs-tech"},e.attributes);return this.el_=t.embed(e.swf,i,r,a),this.el_.tech=this,this.el_},t.prototype.play=function(){this.ended()&&this.setCurrentTime(0),this.el_.vjs_play()},t.prototype.pause=function(){this.el_.vjs_pause()},t.prototype.src=function(e){return void 0===e?this.currentSrc():this.setSrc(e)},t.prototype.setSrc=function(e){var t=this;e=f.getAbsoluteURL(e),this.el_.vjs_src(e),this.autoplay()&&this.setTimeout(function(){return t.play()},0)},t.prototype.seeking=function(){return void 0!==this.lastSeekTarget_},t.prototype.setCurrentTime=function(t){var n=this.seekable();n.length&&(t=t>n.start(0)?t:n.start(0),t=t<n.end(n.length-1)?t:n.end(n.length-1),this.lastSeekTarget_=t,this.trigger("seeking"),this.el_.vjs_setProperty("currentTime",t),e.prototype.setCurrentTime.call(this))},t.prototype.currentTime=function(){return this.seeking()?this.lastSeekTarget_||0:this.el_.vjs_getProperty("currentTime")},t.prototype.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.vjs_getProperty("currentSrc")},t.prototype.duration=function(){if(0===this.readyState())return NaN;var e=this.el_.vjs_getProperty("duration");return e>=0?e:1/0},t.prototype.load=function(){this.el_.vjs_load()},t.prototype.poster=function(){this.el_.vjs_getProperty("poster")},t.prototype.setPoster=function(){},t.prototype.seekable=function(){var e=this.duration();return 0===e?m():m(0,e)},t.prototype.buffered=function(){var e=this.el_.vjs_getProperty("buffered");return 0===e.length?m():m(e[0][0],e[0][1])},t.prototype.supportsFullScreen=function(){return!1},t.prototype.enterFullScreen=function(){return!1},t.prototype.getVideoPlaybackQuality=function(){var e=this.el_.vjs_getProperty("getVideoPlaybackQuality");return u.a.performance&&"function"==typeof u.a.performance.now?e.creationTime=u.a.performance.now():u.a.performance&&u.a.performance.timing&&"number"==typeof u.a.performance.timing.navigationStart&&(e.creationTime=u.a.Date.now()-u.a.performance.timing.navigationStart),e},t}(h),_=["rtmpConnection","rtmpStream","preload","defaultPlaybackRate","playbackRate","autoplay","loop","controls","volume","muted","defaultMuted"],b=["networkState","readyState","initialTime","startOffsetTime","paused","ended","videoWidth","videoHeight"],T=v.prototype,S=0;S<_.length;S++)i(_[S]),function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);T["set"+t]=function(t){return this.el_.vjs_setProperty(e,t)}}(_[S]);for(var E=0;E<b.length;E++)i(b[E]);v.isSupported=function(){return!((!a.a.browser.IS_CHROME||a.a.browser.IS_ANDROID&&a.a.browser.IS_IOS)&&(!a.a.browser.IS_SAFARI||a.a.browser.IS_IOS)&&!a.a.browser.IS_EDGE)||v.version()[0]>=10},h.withSourceHandlers(v),v.nativeSourceHandler={},v.nativeSourceHandler.canPlayType=function(e){return e in v.formats?"maybe":""},v.nativeSourceHandler.canHandleSource=function(e,t){var n=void 0;return n=e.type?e.type.replace(/;.*/,"").toLowerCase():function(e){var t=f.getFileExtension(e);return t?"video/"+t:""}(e.src),v.nativeSourceHandler.canPlayType(n)},v.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},v.nativeSourceHandler.dispose=function(){},v.registerSourceHandler(v.nativeSourceHandler),v.formats={"video/flv":"FLV","video/x-flv":"FLV","video/mp4":"MP4","video/m4v":"MP4"},v.onReady=function(e){var t=p.$("#"+e),n=t&&t.tech;n&&n.el()&&v.checkReady(n)},v.checkReady=function(e){e.el()&&(e.el().vjs_getProperty?e.triggerReady():this.setTimeout(function(){v.checkReady(e)},50))},v.onEvent=function(e,t){var n=p.$("#"+e).tech,i=Array.prototype.slice.call(arguments,2);n.setTimeout(function(){n.trigger(t,i)},1)},v.onError=function(e,t){var n=p.$("#"+e).tech;if("srcnotfound"===t)return n.error(4);"string"==typeof t?n.error("FLASH: "+t):(t.origin="flash",n.error(t))},v.version=function(){var e="0,0,0";try{e=new u.a.ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(t){try{y.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(e=(y.plugins["Shockwave Flash 2.0"]||y.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1])}catch(e){}}return e.split(",")},v.embed=function(e,t,n,i){var r=v.getEmbedCode(e,t,n,i);return p.createEl("div",{innerHTML:r}).childNodes[0]},v.getEmbedCode=function(e,t,n,i){var r="",a="",s="";return t&&Object.getOwnPropertyNames(t).forEach(function(e){r+=e+"="+t[e]+"&amp;"}),n=g({movie:e,flashvars:r,allowScriptAccess:"always",allowNetworking:"all"},n),Object.getOwnPropertyNames(n).forEach(function(e){a+='<param name="'+e+'" value="'+n[e]+'" />'}),i=g({data:e,width:"100%",height:"100%"},i),Object.getOwnPropertyNames(i).forEach(function(e){s+=e+'="'+i[e]+'" '}),'<object type="application/x-shockwave-flash" '+s+">"+a+"</object>"},function(e){e.streamingFormats={"rtmp/mp4":"MP4","rtmp/flv":"FLV"},e.streamFromParts=function(e,t){return e+"&"+t},e.streamToParts=function(e){var t={connection:"",stream:""};if(!e)return t;var n=e.search(/&(?![\w-]+=)/),i=void 0;return-1!==n?i=n+1:0===(n=i=e.lastIndexOf("/")+1)&&(n=i=e.length),t.connection=e.substring(0,n),t.stream=e.substring(i,e.length),t},e.isStreamingType=function(t){return t in e.streamingFormats},e.RTMP_RE=/^rtmp[set]?:\/\//i,e.isStreamingSrc=function(t){return e.RTMP_RE.test(t)},e.rtmpSourceHandler={},e.rtmpSourceHandler.canPlayType=function(t){return e.isStreamingType(t)?"maybe":""},e.rtmpSourceHandler.canHandleSource=function(t,n){var i=e.rtmpSourceHandler.canPlayType(t.type);return i||(e.isStreamingSrc(t.src)?"maybe":"")},e.rtmpSourceHandler.handleSource=function(t,n,i){var r=e.streamToParts(t.src);n.setRtmpConnection(r.connection),n.setRtmpStream(r.stream)},e.registerSourceHandler(e.rtmpSourceHandler)}(v),h.getTech("Flash")?(a.a.log.warn("Not using videojs-flash as it appears to already be registered"),a.a.log.warn("videojs-flash should only be used with video.js@6 and above")):a.a.registerTech("Flash",v),v.VERSION="2.2.1",t.default=v},function(e,t){e.exports={_args:[["videojs-swf@5.4.2","C:\\Users\\Jany\\nd-project\\videojs\\videoPlayer"]],_from:"videojs-swf@5.4.2",_id:"videojs-swf@5.4.2",_inBundle:!1,_integrity:"sha1-aWSpv/kDtzLz5GUxSuR4oCoX6Ks=",_location:"/videojs-swf",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"videojs-swf@5.4.2",name:"videojs-swf",escapedName:"videojs-swf",rawSpec:"5.4.2",saveSpec:null,fetchSpec:"5.4.2"},_requiredBy:["/videojs-flash"],_resolved:"http://registry.npm.sdp.nd/videojs-swf/download/videojs-swf-5.4.2.tgz",_spec:"5.4.2",_where:"C:\\Users\\Jany\\nd-project\\videojs\\videoPlayer",author:{name:"Brightcove"},bugs:{url:"https://github.com/videojs/video-js-swf/issues"},copyright:"Copyright 2014 Brightcove, Inc. https://github.com/videojs/video-js-swf/blob/master/LICENSE",description:"The Flash-fallback video player for video.js (http://videojs.com)",devDependencies:{async:"~0.2.9",chg:"^0.3.2","flex-sdk":"4.6.0-0",grunt:"~0.4.0","grunt-bumpup":"~0.5.0","grunt-cli":"~0.1.0","grunt-connect":"~0.2.0","grunt-contrib-jshint":"~0.4.3","grunt-contrib-qunit":"~0.2.1","grunt-contrib-watch":"~0.1.4","grunt-npm":"~0.0.2","grunt-prompt":"~0.1.2","grunt-shell":"~0.6.1","grunt-tagrelease":"~0.3.1",qunitjs:"~1.12.0","video.js":"^5.9.2"},homepage:"http://videojs.com",keywords:["flash","video","player"],name:"videojs-swf",repository:{type:"git",url:"git+https://github.com/videojs/video-js-swf.git"},scripts:{version:"chg release -y && grunt dist && git add -f dist/ && git add CHANGELOG.md"},version:"5.4.2"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){function i(){}n.d(t,"LOCAL_STORAGE_KEY",function(){return Bi}),n.d(t,"Vhs",function(){return Ui}),n.d(t,"VhsHandler",function(){return Ki}),n.d(t,"VhsSourceHandler",function(){return Qi}),n.d(t,"emeKeySystems",function(){return Hi}),n.d(t,"expandDataUri",function(){return Xi}),n.d(t,"getAllPsshKeySystemsOptions",function(){return qi}),n.d(t,"setupEmeOptions",function(){return Wi}),n.d(t,"waitForKeySessionCreation",function(){return Vi});var r=n(5),a=n.n(r),s=n(6),o=n.n(s),u=n(7),l=n.n(u),c=n(1),d=n.n(c),h=n(8),p=n(0),f=n.n(p),m=n(9),g=n.n(m),y=n(37),v=n(42),_=n(11);n.d(t,"simpleTypeFromSourceType",function(){return _.a});var b,T=n(3),S=n(43),E=n(48),w=n.n(E),k=n(13),C=n(50),A=n(51),I=(n.n(A),h.a),x=function(e,t,n){return e&&n&&n.responseURL&&t!==n.responseURL?n.responseURL:t},P=function(e){return f.a.log.debug?f.a.log.debug.bind(f.a,"VHS:",e+" >"):function(){}},O=function(e,t){var n,i=[];if(e&&e.length)for(n=0;n<e.length;n++)t(e.start(n),e.end(n))&&i.push([e.start(n),e.end(n)]);return f.a.createTimeRanges(i)},L=function(e,t){return O(e,function(e,n){return e-.1<=t&&n+.1>=t})},D=function(e,t){return O(e,function(e){return e-1/30>=t})},R=function(e){if(e.length<2)return f.a.createTimeRanges();for(var t=[],n=1;n<e.length;n++){var i=e.end(n-1),r=e.start(n);t.push([i,r])}return f.a.createTimeRanges(t)},M=function(e,t){var n=null,i=null,r=0,a=[],s=[];if(!(e&&e.length&&t&&t.length))return f.a.createTimeRange();for(var o=e.length;o--;)a.push({time:e.start(o),type:"start"}),a.push({time:e.end(o),type:"end"});for(o=t.length;o--;)a.push({time:t.start(o),type:"start"}),a.push({time:t.end(o),type:"end"});for(a.sort(function(e,t){return e.time-t.time}),o=0;o<a.length;o++)"start"===a[o].type?2===++r&&(n=a[o].time):"end"===a[o].type&&1===--r&&(i=a[o].time),null!==n&&null!==i&&(s.push([n,i]),n=null,i=null);return f.a.createTimeRanges(s)},N=function(e){var t=[];if(!e||!e.length)return"";for(var n=0;n<e.length;n++)t.push(e.start(n)+" => "+e.end(n));return t.join(", ")},U=function(e,t,n){return void 0===n&&(n=1),((e.length?e.end(e.length-1):0)-t)/n},B=function(e){for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t},j=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var n=0;n<e.length;n++)if(e.start(n)!==t.start(n)||e.end(n)!==t.end(n))return!0;return!1},F=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},H=function(e,t){var n=0;if(!e||!e.length)return n;for(var i=0;i<e.length;i++){var r=e.start(i),a=e.end(i);t>a||(n+=t>r&&t<=a?a-t:a-r)}return n},q=f.a.createTimeRange,V=function(e,t){if(!t.preload)return t.duration;var n=0;return(t.parts||[]).forEach(function(e){n+=e.duration}),(t.preloadHints||[]).forEach(function(t){"PART"===t.type&&(n+=e.partTargetDuration)}),n},W=function(e){return(e.segments||[]).reduce(function(e,t,n){return t.parts?t.parts.forEach(function(i,r){e.push({duration:i.duration,segmentIndex:n,partIndex:r,part:i,segment:t})}):e.push({duration:t.duration,segmentIndex:n,partIndex:null,segment:t,part:null}),e},[])},G=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},z=function(e){var t=e.preloadSegment;if(t){var n=t.parts,i=t.preloadHints,r=(i||[]).reduce(function(e,t){return e+("PART"===t.type?1:0)},0);return r+=n&&n.length?n.length:0}},X=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var n=G(t).length>0;return n&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:n&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},Y=function(e,t){var n=0,i=t-e.mediaSequence,r=e.segments[i];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;i--;){if(r=e.segments[i],void 0!==r.end)return{result:n+r.end,precise:!0};if(n+=V(e,r),void 0!==r.start)return{result:n+r.start,precise:!0}}return{result:n,precise:!1}},K=function(e,t){for(var n,i=0,r=t-e.mediaSequence;r<e.segments.length;r++){if(n=e.segments[r],void 0!==n.start)return{result:n.start-i,precise:!0};if(i+=V(e,n),void 0!==n.end)return{result:n.end-i,precise:!0}}return{result:-1,precise:!1}},Q=function(e,t,n){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;var i=Y(e,t);if(i.precise)return i.result;var r=K(e,t);return r.precise?r.result:i.result+n},$=function(e,t,n){if(!e)return 0;if("number"!=typeof n&&(n=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return d.a.Infinity}return Q(e,t,n)},J=function(e){var t=e.defaultDuration,n=e.durationList,i=e.startIndex,r=e.endIndex,a=0;if(i>r){var s=[r,i];i=s[0],r=s[1]}if(i<0){for(var o=i;o<Math.min(0,r);o++)a+=t;i=0}for(var u=i;u<r;u++)a+=n[u].duration;return a},Z=function(e,t,n,i){if(!e||!e.segments)return null;if(e.endList)return $(e);if(null===t)return null;t=t||0;var r=Q(e,e.mediaSequence+e.segments.length,t);return n&&(i="number"==typeof i?i:X(null,e),r-=i),Math.max(0,r)},ee=function(e,t,n){var i=t||0,r=Z(e,t,!0,n);return null===r?q():q(i,r)},te=function(e){for(var t=e.playlist,n=e.currentTime,i=e.startingSegmentIndex,r=e.startingPartIndex,a=e.startTime,s=e.experimentalExactManifestTimings,o=n-a,u=W(t),l=0,c=0;c<u.length;c++){var d=u[c];if(i===d.segmentIndex&&("number"!=typeof r||"number"!=typeof d.partIndex||r===d.partIndex)){l=c;break}}if(o<0){if(l>0)for(var h=l-1;h>=0;h--){var p=u[h];if(o+=p.duration,s){if(o<0)continue}else if(o+1/30<=0)continue;return{partIndex:p.partIndex,segmentIndex:p.segmentIndex,startTime:a-J({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:h})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:n}}if(l<0){for(var f=l;f<0;f++)if((o-=t.targetDuration)<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:n};l=0}for(var m=l;m<u.length;m++){var g=u[m];if(o-=g.duration,s){if(o>0)continue}else if(o-1/30>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:a+J({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:m})}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:n}},ne=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},ie=function(e){return e.excludeUntil&&e.excludeUntil===1/0},re=function(e){var t=ne(e);return!e.disabled&&!t},ae=function(e){return e.disabled},se=function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},oe=function(e,t){return t.attributes&&t.attributes[e]},ue=function(e,t,n,i){return void 0===i&&(i=0),oe("BANDWIDTH",n)?(e*n.attributes.BANDWIDTH-8*i)/t:NaN},le=function(e,t){if(1===e.playlists.length)return!0;var n=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(function(e){return!!re(e)&&(e.attributes.BANDWIDTH||0)<n}).length},ce=function(e,t){return!(!e&&!t||!e&&t||e&&!t)&&(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))))},de=function(e,t){var n=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},i=!1;for(var r in n){for(var a in n[r])if(i=t(n[r][a]))break;if(i)break}return!!i},he=function(e){if(!e||!e.playlists||!e.playlists.length){return de(e,function(e){return e.playlists&&e.playlists.length||e.uri})}for(var t=0;t<e.playlists.length;t++){var n=function(t){var n=e.playlists[t],i=n.attributes&&n.attributes.CODECS;return i&&i.split(",").every(function(e){return Object(v.f)(e)})?"continue":de(e,function(e){return ce(n,e)})?"continue":{v:!1}}(t);if("continue"!==n&&"object"==typeof n)return n.v}return!0},pe={liveEdgeDelay:X,duration:$,seekable:ee,getMediaInfoForTime:te,isEnabled:re,isDisabled:ae,isBlacklisted:ne,isIncompatible:ie,playlistEnd:Z,isAes:se,hasAttribute:oe,estimateSegmentRequestTime:ue,isLowestEnabledRendition:le,isAudioOnly:he,playlistMatch:ce,segmentDurationWithParts:V},fe=f.a.log,me=function(e,t){return e+"-"+t},ge=function(e){var t=e.onwarn,n=e.oninfo,i=e.manifestString,r=e.customTagParsers,a=void 0===r?[]:r,s=e.customTagMappers,o=void 0===s?[]:s,u=e.experimentalLLHLS,l=new y.a;t&&l.on("warn",t),n&&l.on("info",n),a.forEach(function(e){return l.addParser(e)}),o.forEach(function(e){return l.addTagMapper(e)}),l.push(i),l.end();var c=l.manifest;if(u||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){c.hasOwnProperty(e)&&delete c[e]}),c.segments&&c.segments.forEach(function(e){["parts","preloadHints"].forEach(function(t){e.hasOwnProperty(t)&&delete e[t]})})),!c.targetDuration){var d=10;c.segments&&c.segments.length&&(d=c.segments.reduce(function(e,t){return Math.max(e,t.duration)},0)),t&&t("manifest has no targetDuration defaulting to "+d),c.targetDuration=d}var h=G(c);if(h.length&&!c.partTargetDuration){var p=h.reduce(function(e,t){return Math.max(e,t.duration)},0);t&&(t("manifest has no partTargetDuration defaulting to "+p),fe.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.")),c.partTargetDuration=p}return c},ye=function(e,t){e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(function(n){if(e.mediaGroups[n])for(var i in e.mediaGroups[n])for(var r in e.mediaGroups[n][i]){var a=e.mediaGroups[n][i][r];t(a,n,i,r)}})},ve=function(e){var t=e.playlist,n=e.uri,i=e.id;t.id=i,t.playlistErrors_=0,n&&(t.uri=n),t.attributes=t.attributes||{}},_e=function(e){for(var t=e.playlists.length;t--;){var n=e.playlists[t];ve({playlist:n,id:me(t,n.uri)}),n.resolvedUri=I(e.uri,n.uri),e.playlists[n.id]=n,e.playlists[n.uri]=n,n.attributes.BANDWIDTH||fe.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},be=function(e){ye(e,function(t){t.uri&&(t.resolvedUri=I(e.uri,t.uri))})},Te=function(e,t){var n=me(0,t),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:d.a.location.href,resolvedUri:d.a.location.href,playlists:[{uri:t,id:n,resolvedUri:t,attributes:{}}]};return i.playlists[n]=i.playlists[0],i.playlists[t]=i.playlists[0],i},Se=function(e,t){e.uri=t;for(var n=0;n<e.playlists.length;n++)if(!e.playlists[n].uri){var i="placeholder-uri-"+n;e.playlists[n].uri=i}var r=he(e);ye(e,function(t,n,i,a){var s="placeholder-uri-"+n+"-"+i+"-"+a;if(!t.playlists||!t.playlists.length){if(r&&"AUDIO"===n&&!t.uri)for(var o=0;o<e.playlists.length;o++){var u=e.playlists[o];if(u.attributes&&u.attributes.AUDIO&&u.attributes.AUDIO===i)return}t.playlists=[g()({},t)]}t.playlists.forEach(function(t,n){var i=me(n,s);t.uri?t.resolvedUri=t.resolvedUri||I(e.uri,t.uri):(t.uri=0===n?s:i,t.resolvedUri=t.uri),t.id=t.id||i,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t})}),_e(e),be(e)},Ee=f.a.mergeOptions,we=f.a.EventTarget,ke=function(e,t){if(t.endList||!t.serverControl)return e;var n={};if(t.serverControl.canBlockReload){var i=t.preloadSegment,r=t.mediaSequence+t.segments.length;if(i){var a=i.parts||[],s=z(t)-1;s>-1&&s!==a.length-1&&(n._HLS_part=s),(s>-1||a.length)&&r--}n._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(n._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(n).length){var o=new d.a.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){n.hasOwnProperty(e)&&o.searchParams.set(e,n[e])}),e=o.toString()}return e},Ce=function(e,t){if(!e)return t;var n=Ee(e,t);if(e.preloadHints&&!t.preloadHints&&delete n.preloadHints,e.parts&&!t.parts)delete n.parts;else if(e.parts&&t.parts)for(var i=0;i<t.parts.length;i++)e.parts&&e.parts[i]&&(n.parts[i]=Ee(e.parts[i],t.parts[i]));return!e.skipped&&t.skipped&&(n.skipped=!1),e.preload&&!t.preload&&(n.preload=!1),n},Ae=function(e,t,n){var i=e.slice(),r=t.slice();n=n||0;for(var a,s=[],o=0;o<r.length;o++){var u=i[o+n],l=r[o];u?(a=u.map||a,s.push(Ce(u,l))):(a&&!l.map&&(l.map=a),s.push(l))}return s},Ie=function(e,t){!e.resolvedUri&&e.uri&&(e.resolvedUri=I(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=I(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=I(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=I(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(function(e){e.resolvedUri||(e.resolvedUri=I(t,e.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(function(e){e.resolvedUri||(e.resolvedUri=I(t,e.uri))})},xe=function(e){var t=e.segments||[],n=e.preloadSegment;if(n&&n.parts&&n.parts.length){if(n.preloadHints)for(var i=0;i<n.preloadHints.length;i++)if("MAP"===n.preloadHints[i].type)return t;n.duration=e.targetDuration,n.preload=!0,t.push(n)}return t},Pe=function(e,t){return e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment},Oe=function(e,t,n){void 0===n&&(n=Pe);var i=Ee(e,{}),r=i.playlists[t.id];if(!r)return null;if(n(r,t))return null;t.segments=xe(t);var a=Ee(r,t);if(a.preloadSegment&&!t.preloadSegment&&delete a.preloadSegment,r.segments){if(t.skip){t.segments=t.segments||[];for(var s=0;s<t.skip.skippedSegments;s++)t.segments.unshift({skipped:!0})}a.segments=Ae(r.segments,t.segments,t.mediaSequence-r.mediaSequence)}a.segments.forEach(function(e){Ie(e,a.resolvedUri)});for(var o=0;o<i.playlists.length;o++)i.playlists[o].id===t.id&&(i.playlists[o]=a);return i.playlists[t.id]=a,i.playlists[t.uri]=a,ye(e,function(e,n,i,r){if(e.playlists)for(var s=0;s<e.playlists.length;s++)t.id===e.playlists[s].id&&(e.playlists[s]=a)}),i},Le=function(e,t){var n=e.segments||[],i=n[n.length-1],r=i&&i.parts&&i.parts[i.parts.length-1],a=r&&r.duration||i&&i.duration;return t&&a?1e3*a:500*(e.partTargetDuration||e.targetDuration||10)},De=function(e){function t(t,n,i){var r;if(void 0===i&&(i={}),r=e.call(this)||this,!t)throw new Error("A non-empty playlist URL or object is required");r.logger_=P("PlaylistLoader");var s=i,o=s.withCredentials,u=void 0!==o&&o,l=s.handleManifestRedirects,c=void 0!==l&&l;r.src=t,r.vhs_=n,r.withCredentials=u,r.handleManifestRedirects=c;var d=n.options_;return r.customTagParsers=d&&d.customTagParsers||[],r.customTagMappers=d&&d.customTagMappers||[],r.experimentalLLHLS=d&&d.experimentalLLHLS||!1,f.a.browser.IE_VERSION&&(r.experimentalLLHLS=!1),r.state="HAVE_NOTHING",r.handleMediaupdatetimeout_=r.handleMediaupdatetimeout_.bind(a()(r)),r.on("mediaupdatetimeout",r.handleMediaupdatetimeout_),r}o()(t,e);var n=t.prototype;return n.handleMediaupdatetimeout_=function(){var e=this;if("HAVE_METADATA"===this.state){var t=this.media(),n=I(this.master.uri,t.uri);this.experimentalLLHLS&&(n=ke(n,t)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:n,withCredentials:this.withCredentials},function(t,n){if(e.request)return t?e.playlistRequestError(e.request,e.media(),"HAVE_METADATA"):void e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})})}},n.playlistRequestError=function(e,t,n){var i=t.uri,r=t.id;this.request=null,n&&(this.state=n),this.error={playlist:this.master.playlists[r],status:e.status,message:"HLS playlist request error at URL: "+i+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},n.parseManifest_=function(e){var t=this,n=e.url,i=e.manifestString;return ge({onwarn:function(e){var i=e.message;return t.logger_("m3u8-parser warn for "+n+": "+i)},oninfo:function(e){var i=e.message;return t.logger_("m3u8-parser info for "+n+": "+i)},manifestString:i,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},n.haveMetadata=function(e){var t=e.playlistString,n=e.playlistObject,i=e.url,r=e.id;this.request=null,this.state="HAVE_METADATA";var a=n||this.parseManifest_({url:i,manifestString:t});a.lastRequest=Date.now(),ve({playlist:a,uri:i,id:r});var s=Oe(this.master,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,s?(this.master=s,this.media_=this.master.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Le(this.media(),!!s)),this.trigger("loadedplaylist")},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),d.a.clearTimeout(this.mediaUpdateTimeout),d.a.clearTimeout(this.finalRenditionTimeout),this.off()},n.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},n.media=function(e,t){var n=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(d.a.clearTimeout(this.finalRenditionTimeout),t){var i=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=d.a.setTimeout(this.media.bind(this,e,!1),i))}var r=this.state,a=!this.media_||e.id!==this.media_.id,s=this.master.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(a&&(this.trigger("mediachanging"),"HAVE_MASTER"===r?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(Le(e,!0)),a){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,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},function(t,i){if(n.request){if(e.lastRequest=Date.now(),e.resolvedUri=x(n.handleManifestRedirects,e.resolvedUri,i),t)return n.playlistRequestError(n.request,e,r);n.haveMetadata({playlistString:i.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===r?n.trigger("loadedmetadata"):n.trigger("mediachange")}})}},n.pause=function(){this.mediaUpdateTimeout&&(d.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},n.load=function(e){var t=this;this.mediaUpdateTimeout&&(d.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var n=this.media();if(e){var i=n?(n.partTargetDuration||n.targetDuration)/2*1e3:5e3;return void(this.mediaUpdateTimeout=d.a.setTimeout(function(){t.mediaUpdateTimeout=null,t.load()},i))}if(!this.started)return void this.start();n&&!n.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")},n.updateMediaUpdateTimeout_=function(e){var t=this;this.mediaUpdateTimeout&&(d.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=d.a.setTimeout(function(){t.mediaUpdateTimeout=null,t.trigger("mediaupdatetimeout"),t.updateMediaUpdateTimeout_(e)},e))},n.start=function(){var e=this;if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=d.a.location.href),this.src.resolvedUri=this.src.uri,void setTimeout(function(){e.setupInitialPlaylist(e.src)},0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(t,n){if(e.request){if(e.request=null,t)return e.error={status:n.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:n.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=x(e.handleManifestRedirects,e.src,n);var i=e.parseManifest_({manifestString:n.responseText,url:e.src});e.setupInitialPlaylist(i)}})},n.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri},n.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,Se(this.master,this.srcUri()),e.playlists.forEach(function(e){e.segments=xe(e),e.segments.forEach(function(t){Ie(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var t=this.srcUri()||d.a.location.href;this.master=Te(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(we),Re=f.a.xhr,Me=f.a.mergeOptions,Ne=function(e,t,n,i){var r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),n.headers&&(e.responseHeaders=n.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===n.statusCode||206===n.statusCode||0===n.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(r||e.responseText)))),i(t,e)},Ue=function(){var e=function e(t,n){t=Me({timeout:45e3},t);var i=e.beforeRequest||f.a.Vhs.xhr.beforeRequest;if(i&&"function"==typeof i){var r=i(t);r&&(t=r)}var a=!0===f.a.Vhs.xhr.original?Re:f.a.Vhs.xhr,s=a(t,function(e,t){return Ne(s,e,t,n)}),o=s.abort;return s.abort=function(){return s.aborted=!0,o.apply(s,arguments)},s.uri=t.uri,s.requestTime=Date.now(),s};return e.original=!0,e},Be=function(e){var t,n=e.offset;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?d.a.BigInt(e.offset)+d.a.BigInt(e.length)-d.a.BigInt(1):e.offset+e.length-1,"bytes="+n+"-"+t},je=function(e){var t={};return e.byterange&&(t.Range=Be(e.byterange)),t},Fe=function(e,t){return e.start(t)+"-"+e.end(t)},He=function(e,t){var n=e.toString(16);return"00".substring(0,2-n.length)+n+(t%2?" ":"")},qe=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},Ve=function(e){var t={};return Object.keys(e).forEach(function(n){var i=e[n];Object(T.e)(i)?t[n]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:t[n]=i}),t},We=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},Ge=function(e){return e.resolvedUri},ze=function(e){for(var t,n,i=Array.prototype.slice.call(e),r="",a=0;a<i.length/16;a++)t=i.slice(16*a,16*a+16).map(He).join(""),n=i.slice(16*a,16*a+16).map(qe).join(""),r+=t+" "+n+"\n";return r},Xe=function(e){var t=e.bytes;return ze(t)},Ye=function(e){var t,n="";for(t=0;t<e.length;t++)n+=Fe(e,t)+" ";return n},Ke=Object.freeze({__proto__:null,createTransferableMessage:Ve,initSegmentId:We,segmentKeyId:Ge,hexDump:ze,tagDump:Xe,textRanges:Ye}),Qe=function(e,t){if(!t.dateTimeObject)return null;var n=t.videoTimingInfo.transmuxerPrependedSeconds,i=t.videoTimingInfo.transmuxedPresentationStart,r=i+n,a=e-r;return new Date(t.dateTimeObject.getTime()+1e3*a)},$e=function(e){return e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds},Je=function(e,t){var n;try{n=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;var i=t.segments[0];if(n<i.dateTimeObject)return null;for(var r=0;r<t.segments.length-1;r++){i=t.segments[r];if(n<t.segments[r+1].dateTimeObject)break}var a=t.segments[t.segments.length-1],s=a.dateTimeObject,o=a.videoTimingInfo?$e(a.videoTimingInfo):a.duration+.25*a.duration;return n>new Date(s.getTime()+1e3*o)?null:(n>s&&(i=a),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:pe.duration(t,t.mediaSequence+t.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},Ze=function(e,t){if(!t||!t.segments||0===t.segments.length)return null;for(var n,i=0,r=0;r<t.segments.length&&(n=t.segments[r],i=n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationEnd:i+n.duration,!(e<=i));r++);var a=t.segments[t.segments.length-1];if(a.videoTimingInfo&&a.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>i){if(e>i+.25*a.duration)return null;n=a}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:i-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}},et=function(e,t){var n,i;try{n=new Date(e),i=new Date(t)}catch(e){}var r=n.getTime();return(i.getTime()-r)/1e3},tt=function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;t<e.segments.length;t++){if(!e.segments[t].dateTimeObject)return!1}return!0},nt=function(e){var t=e.playlist,n=e.time,i=void 0===n?void 0:n,r=e.callback;if(!r)throw new Error("getProgramTime: callback must be provided");if(!t||void 0===i)return r({message:"getProgramTime: playlist and time must be provided"});var a=Ze(i,t);if(!a)return r({message:"valid programTime was not found"});if("estimate"===a.type)return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:i},o=Qe(i,a.segment);return o&&(s.programDateTime=o.toISOString()),r(null,s)},it=function e(t){var n=t.programTime,i=t.playlist,r=t.retryCount,a=void 0===r?2:r,s=t.seekTo,o=t.pauseAfterSeek,u=void 0===o||o,l=t.tech,c=t.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(void 0===n||!i||!s)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!i.endList&&!l.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!tt(i))return c({message:"programDateTime tags must be provided in the manifest "+i.resolvedUri});var d=Je(n,i);if(!d)return c({message:n+" was not found in the stream"});var h=d.segment,p=et(h.dateTimeObject,n);if("estimate"===d.type)return 0===a?c({message:n+" is not buffered yet. Try again"}):(s(d.estimatedStart+p),void l.one("seeked",function(){e({programTime:n,playlist:i,retryCount:a-1,seekTo:s,pauseAfterSeek:u,tech:l,callback:c})}));var f=h.start+p,m=function(){return c(null,l.currentTime())};l.one("seeked",m),u&&l.pause(),s(f)},rt=function(e,t){if(4===e.readyState)return t()},at=function(e,t,n){var i,r=[],a=!1,s=function(e,t,i,r){return t.abort(),a=!0,n(e,t,i,r)},o=function(e,t){if(!a){if(e)return s(e,t,"",r);var n=t.responseText.substring(r&&r.byteLength||0,t.responseText.length);if(r=Object(T.d)(r,Object(T.h)(n,!0)),i=i||Object(k.a)(r),r.length<10||i&&r.length<i+2)return rt(t,function(){return s(e,t,"",r)});var o=Object(C.a)(r);return"ts"===o&&r.length<188?rt(t,function(){return s(e,t,"",r)}):!o&&r.length<376?rt(t,function(){return s(e,t,"",r)}):s(null,t,o,r)}},u={uri:e,beforeSend:function(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",function(t){return t.total,t.loaded,Ne(e,null,{statusCode:e.status},o)})}},l=t(u,function(e,t){return Ne(l,e,t,o)});return l},st=f.a.EventTarget,ot=f.a.mergeOptions,ut=function(e,t){if(!Pe(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(var n=0;n<e.segments.length;n++){var i=e.segments[n],r=t.segments[n];if(i.uri!==r.uri)return!1;if(i.byterange||r.byterange){var a=i.byterange,s=r.byterange;if(a&&!s||!a&&s)return!1;if(a.offset!==s.offset||a.length!==s.length)return!1}}return!0},lt=function(e){var t=e.masterXml,n=e.srcUrl,i=e.clientOffset,r=e.sidxMapping,a=e.previousManifest,s=Object(S.c)(t,{manifestUri:n,clientOffset:i,sidxMapping:r,previousManifest:a});return Se(s,n),s},ct=function(e,t,n){for(var i=!0,r=ot(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts}),a=0;a<t.playlists.length;a++){var s=t.playlists[a];if(s.sidx){var o=Object(S.b)(s.sidx);n&&n[o]&&n[o].sidx&&Object(S.a)(s,n[o].sidx,s.sidx.resolvedUri)}var u=Oe(r,s,ut);u&&(r=u,i=!1)}return ye(t,function(e,t,n,a){if(e.playlists&&e.playlists.length){var s=e.playlists[0].id,o=Oe(r,e.playlists[0],ut);o&&(r=o,r.mediaGroups[t][n][a].playlists[0]=r.playlists[s],i=!1)}}),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(i=!1),i?null:r},dt=function(e,t){return(Boolean(!e.map&&!t.map)||Boolean(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},ht=function(e,t){var n={};for(var i in e){var r=e[i],a=r.sidx;if(a){var s=Object(S.b)(a);if(!t[s])break;var o=t[s].sidxInfo;dt(o,a)&&(n[s]=t[s])}}return n},pt=function(e,t){var n=ht(e.playlists,t),i=n;return ye(e,function(e,n,r,a){if(e.playlists&&e.playlists.length){var s=e.playlists;i=ot(i,ht(s,t))}}),i},ft=function(e){function t(t,n,i,r){var s;void 0===i&&(i={}),s=e.call(this)||this,s.masterPlaylistLoader_=r||a()(s),r||(s.isMaster_=!0);var o=i,u=o.withCredentials,l=void 0!==u&&u,c=o.handleManifestRedirects,d=void 0!==c&&c;if(s.vhs_=n,s.withCredentials=l,s.handleManifestRedirects=d,!t)throw new Error("A non-empty playlist URL or object is required");return s.on("minimumUpdatePeriod",function(){s.refreshXml_()}),s.on("mediaupdatetimeout",function(){s.refreshMedia_(s.media().id)}),s.state="HAVE_NOTHING",s.loadedPlaylists_={},s.logger_=P("DashPlaylistLoader"),s.isMaster_?(s.masterPlaylistLoader_.srcUrl=t,s.masterPlaylistLoader_.sidxMapping_={}):s.childPlaylist_=t,s}o()(t,e);var n=t.prototype;return n.requestErrored_=function(e,t,n){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2}:e,n&&(this.state=n),this.trigger("error"),!0):void 0)},n.addSidxSegments_=function(e,t,n){var i=this,r=e.sidx&&Object(S.b)(e.sidx);if(!e.sidx||!r||this.masterPlaylistLoader_.sidxMapping_[r])return void(this.mediaRequest_=d.a.setTimeout(function(){return n(!1)},0));var a=x(this.handleManifestRedirects,e.sidx.resolvedUri),s=function(a,s){if(!i.requestErrored_(a,s,t)){var o,u=i.masterPlaylistLoader_.sidxMapping_;try{o=w()(Object(T.k)(s.response).subarray(8))}catch(e){return void i.requestErrored_(e,s,t)}return u[r]={sidxInfo:e.sidx,sidx:o},Object(S.a)(e,o,e.sidx.resolvedUri),n(!0)}};this.request=at(a,this.vhs_.xhr,function(t,n,r,o){if(t)return s(t,n);if(!r||"mp4"!==r)return s({status:n.status,message:"Unsupported "+(r||"unknown")+" container type for sidx segment at URL: "+a,response:"",playlist:e,internal:!0,blacklistDuration:1/0,code:2},n);var u=e.sidx.byterange,l=u.offset,c=u.length;if(o.length>=c+l)return s(t,{response:o.subarray(l,l+c),status:n.status,uri:n.uri});i.request=i.vhs_.xhr({uri:a,responseType:"arraybuffer",headers:je({byterange:e.sidx.byterange})},s)})},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},d.a.clearTimeout(this.minimumUpdatePeriodTimeout_),d.a.clearTimeout(this.mediaRequest_),d.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},n.hasPendingRequest=function(){return this.request||this.mediaRequest_},n.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},n.media=function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var n=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(i&&(this.trigger("mediachanging"),this.trigger("mediachange")));i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,n,function(i){t.haveMetadata({startingState:n,playlist:e})}))},n.haveMetadata=function(e){var t=e.startingState,n=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[n.id]=n,this.mediaRequest_=null,this.refreshMedia_(n.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")},n.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),d.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(d.a.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},n.load=function(e){var t=this;d.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var n=this.media();if(e){var i=n?n.targetDuration/2*1e3:5e3;return void(this.mediaUpdateTimeout=d.a.setTimeout(function(){return t.load()},i))}if(!this.started)return void this.start();n&&!n.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")},n.start=function(){var e=this;if(this.started=!0,!this.isMaster_)return void(this.mediaRequest_=d.a.setTimeout(function(){return e.haveMaster_()},0));this.requestMaster_(function(t,n){e.haveMaster_(),e.hasPendingRequest()||e.media_||e.media(e.masterPlaylistLoader_.master.playlists[0])})},n.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(n,i){if(t.requestErrored_(n,i))return void("HAVE_NOTHING"===t.state&&(t.started=!1));var r=i.responseText!==t.masterPlaylistLoader_.masterXml_;return t.masterPlaylistLoader_.masterXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?t.masterLoaded_=Date.parse(i.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=x(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,i),r?(t.handleMaster_(),void t.syncClientServerClock_(function(){return e(i,r)})):e(i,r)})},n.syncClientServerClock_=function(e){var t=this,n=Object(S.d)(this.masterPlaylistLoader_.masterXml_);return null===n?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===n.method?(this.masterPlaylistLoader_.clientOffset_=n.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:I(this.masterPlaylistLoader_.srcUrl,n.value),method:n.method,withCredentials:this.withCredentials},function(i,r){if(t.request){if(i)return t.masterPlaylistLoader_.clientOffset_=t.masterLoaded_-Date.now(),e();var a;a="HEAD"===n.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):t.masterLoaded_:Date.parse(r.responseText),t.masterPlaylistLoader_.clientOffset_=a-Date.now(),e()}}))},n.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},n.handleMaster_=function(){this.mediaRequest_=null;var e=this.masterPlaylistLoader_.master,t=lt({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=ct(e,t,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=t||e;var n=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return n&&n!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=n),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(t)},n.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(d.a.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var t=e.master&&e.master.minimumUpdatePeriod;if(0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0)return void(t<0&&this.logger_("found invalid minimumUpdatePeriod of "+t+", not setting a timeout"));this.createMUPTimeout_(t)},n.createMUPTimeout_=function(e){var t=this.masterPlaylistLoader_;t.minimumUpdatePeriodTimeout_=d.a.setTimeout(function(){t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)},n.refreshXml_=function(){var e=this;this.requestMaster_(function(t,n){n&&(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=pt(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.sidxMapping_),e.addSidxSegments_(e.media(),e.state,function(t){e.refreshMedia_(e.media().id)}))})},n.refreshMedia_=function(e){var t=this;if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var n=this.masterPlaylistLoader_.master.playlists,i=!this.media_||this.media_!==n[e];if(i?this.media_=n[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){!function e(){t.media().endList||(t.mediaUpdateTimeout=d.a.setTimeout(function(){t.trigger("mediaupdatetimeout"),e()},Le(t.media(),Boolean(i))))}()}this.trigger("loadedplaylist")},t}(st),mt={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},gt=function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer},yt=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},vt=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(n){var t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}},_t=function(e){return function(){var t=vt(e),n=yt(new Worker(t));n.objURL=t;var i=n.terminate;return n.on=n.addEventListener,n.off=n.removeEventListener,n.terminate=function(){return URL.revokeObjectURL(t),i.call(this)},n}},bt=function(e){return"var browserWorkerPolyFill = "+yt.toString()+";\nbrowserWorkerPolyFill(self);\n"+e},Tt=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},St=bt(Tt(function(){var 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 i;return!!e[t]&&(i=e[t].indexOf(n),e[t]=e[t].slice(),e[t].splice(i,1),i>-1)},this.trigger=function(t){var n,i,r,a;if(n=e[t])if(2===arguments.length)for(r=n.length,i=0;i<r;++i)n[i].call(this,arguments[1]);else{for(a=[],i=arguments.length,i=1;i<arguments.length;++i)a.push(arguments[i]);for(r=n.length,i=0;i<r;++i)n[i].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,i,r,a,s,o,u,l,c,d,h,p,f,m,g,y,v,_,b,T,S,E,w,k,C,A,I,x,P,O,L,D,R,M,N,U,B=t,j=Math.pow(2,32),F=function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getBigUint64?(t=n.getBigUint64(0),t<Number.MAX_SAFE_INTEGER?Number(t):t):n.getUint32(0)*j+n.getUint32(4)},H={getUint64:F,MAX_UINT32:j},q=H.MAX_UINT32;!function(){var e;if(w={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:[]},"undefined"!=typeof Uint8Array){for(e in w)w.hasOwnProperty(e)&&(w[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);k=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),A=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),C=new Uint8Array([0,0,0,1]),I=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]),x=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]),P={video:I,audio:x},D=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),L=new Uint8Array([0,0,0,0,0,0,0,0]),R=new Uint8Array([0,0,0,0,0,0,0,0]),M=R,N=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),U=R,O=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),n=function(e){var t,n,i,r=[],a=0;for(t=1;t<arguments.length;t++)r.push(arguments[t]);for(t=r.length;t--;)a+=r[t].byteLength;for(n=new Uint8Array(a+8),i=new DataView(n.buffer,n.byteOffset,n.byteLength),i.setUint32(0,n.byteLength),n.set(e,4),t=0,a=8;t<r.length;t++)n.set(r[t],a),a+=r[t].byteLength;return n},i=function(){return n(w.dinf,n(w.dref,D))},r=function(e){return n(w.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]))},a=function(){return n(w.ftyp,k,C,k,A)},y=function(e){return n(w.hdlr,P[e])},s=function(e){return n(w.mdat,e)},g=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,255&e.duration,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]=255&e.samplerate),n(w.mdhd,t)},m=function(e){return n(w.mdia,g(e),y(e.type),u(e))},o=function(e){return n(w.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},u=function(e){return n(w.minf,"video"===e.type?n(w.vmhd,O):n(w.smhd,L),i(),_(e))},l=function(e,t){for(var i=[],r=t.length;r--;)i[r]=T(t[r]);return n.apply(null,[w.moof,o(e)].concat(i))},c=function(e){for(var t=e.length,i=[];t--;)i[t]=p(e[t]);return n.apply(null,[w.moov,h(4294967295)].concat(i).concat(d(e)))},d=function(e){for(var t=e.length,i=[];t--;)i[t]=S(e[t]);return n.apply(null,[w.mvex].concat(i))},h=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,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 n(w.mvhd,t)},v=function(e){var t,i,r=e.samples||[],a=new Uint8Array(4+r.length);for(i=0;i<r.length;i++)t=r[i].flags,a[i+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return n(w.sdtp,a)},_=function(e){return n(w.stbl,b(e),n(w.stts,U),n(w.stsc,M),n(w.stsz,N),n(w.stco,R))},function(){var e,t;b=function(i){return n(w.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===i.type?e(i):t(i))},e=function(e){var t,i,r=e.sps||[],a=e.pps||[],s=[],o=[];for(t=0;t<r.length;t++)s.push((65280&r[t].byteLength)>>>8),s.push(255&r[t].byteLength),s=s.concat(Array.prototype.slice.call(r[t]));for(t=0;t<a.length;t++)o.push((65280&a[t].byteLength)>>>8),o.push(255&a[t].byteLength),o=o.concat(Array.prototype.slice.call(a[t]));if(i=[w.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,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,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]),n(w.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],s,[a.length],o))),n(w.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var u=e.sarRatio[0],l=e.sarRatio[1];i.push(n(w.pasp,new Uint8Array([(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l])))}return n.apply(null,i)},t=function(e){return n(w.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),r(e))}}(),f=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,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,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return n(w.tkhd,t)},T=function(e){var t,i,r,a,s,o,u;return t=n(w.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),o=Math.floor(e.baseMediaDecodeTime/q),u=Math.floor(e.baseMediaDecodeTime%q),i=n(w.tfdt,new Uint8Array([1,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,255&o,u>>>24&255,u>>>16&255,u>>>8&255,255&u])),s=92,"audio"===e.type?(r=E(e,s),n(w.traf,t,i,r)):(a=v(e),r=E(e,a.length+s),n(w.traf,t,i,r,a))},p=function(e){return e.duration=e.duration||4294967295,n(w.trak,f(e),m(e))},S=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),n(w.trex,t)},function(){var e,t,i;i=function(e,t){var n=0,i=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(n=1),void 0!==e[0].size&&(i=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,n|i|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},t=function(e,t){var r,a,s,o,u,l;for(o=e.samples||[],t+=20+16*o.length,s=i(o,t),a=new Uint8Array(s.length+16*o.length),a.set(s),r=s.length,l=0;l<o.length;l++)u=o[l],a[r++]=(4278190080&u.duration)>>>24,a[r++]=(16711680&u.duration)>>>16,a[r++]=(65280&u.duration)>>>8,a[r++]=255&u.duration,a[r++]=(4278190080&u.size)>>>24,a[r++]=(16711680&u.size)>>>16,a[r++]=(65280&u.size)>>>8,a[r++]=255&u.size,a[r++]=u.flags.isLeading<<2|u.flags.dependsOn,a[r++]=u.flags.isDependedOn<<6|u.flags.hasRedundancy<<4|u.flags.paddingValue<<1|u.flags.isNonSyncSample,a[r++]=61440&u.flags.degradationPriority,a[r++]=15&u.flags.degradationPriority,a[r++]=(4278190080&u.compositionTimeOffset)>>>24,a[r++]=(16711680&u.compositionTimeOffset)>>>16,a[r++]=(65280&u.compositionTimeOffset)>>>8,a[r++]=255&u.compositionTimeOffset;return n(w.trun,a)},e=function(e,t){var r,a,s,o,u,l;for(o=e.samples||[],t+=20+8*o.length,s=i(o,t),r=new Uint8Array(s.length+8*o.length),r.set(s),a=s.length,l=0;l<o.length;l++)u=o[l],r[a++]=(4278190080&u.duration)>>>24,r[a++]=(16711680&u.duration)>>>16,r[a++]=(65280&u.duration)>>>8,r[a++]=255&u.duration,r[a++]=(4278190080&u.size)>>>24,r[a++]=(16711680&u.size)>>>16,r[a++]=(65280&u.size)>>>8,r[a++]=255&u.size;return n(w.trun,r)},E=function(n,i){return"audio"===n.type?e(n,i):t(n,i)}}();var V,W,G,z,X,Y,K,Q,$={ftyp:a,mdat:s,moof:l,moov:c,initSegment:function(e){var t,n=a(),i=c(e);return t=new Uint8Array(n.byteLength+i.byteLength),t.set(n),t.set(i,n.byteLength),t}},J=function(e){var t,n,i=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,i.byteLength=0,t=0;t<e.length;t++)n=e[t],"access_unit_delimiter_rbsp"===n.nalUnitType?(i.length&&(i.duration=n.dts-i.dts,r.byteLength+=i.byteLength,r.nalCount+=i.length,r.duration+=i.duration,r.push(i)),i=[n],i.byteLength=n.data.byteLength,i.pts=n.pts,i.dts=n.dts):("slice_layer_without_partitioning_rbsp_idr"===n.nalUnitType&&(i.keyFrame=!0),i.duration=n.dts-i.dts,i.byteLength+=n.data.byteLength,i.push(n));return r.length&&(!i.duration||i.duration<=0)&&(i.duration=r[r.length-1].duration),r.byteLength+=i.byteLength,r.nalCount+=i.length,r.duration+=i.duration,r.push(i),r},Z=function(e){var t,n,i=[],r=[];for(i.byteLength=0,i.nalCount=0,i.duration=0,i.pts=e[0].pts,i.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)n=e[t],n.keyFrame?(i.length&&(r.push(i),r.byteLength+=i.byteLength,r.nalCount+=i.nalCount,r.duration+=i.duration),i=[n],i.nalCount=n.length,i.byteLength=n.byteLength,i.pts=n.pts,i.dts=n.dts,i.duration=n.duration):(i.duration+=n.duration,i.nalCount+=n.length,i.byteLength+=n.byteLength,i.push(n));return r.length&&i.duration<=0&&(i.duration=r[r.length-1].duration),r.byteLength+=i.byteLength,r.nalCount+=i.nalCount,r.duration+=i.duration,r.push(i),r},ee=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},te=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},ne=function(e,t){var n=te();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},ie=function(e,t){var n,i,r,a,s,o=t||0,u=[];for(n=0;n<e.length;n++)for(a=e[n],i=0;i<a.length;i++)s=a[i],r=ne(s,o),o+=r.size,u.push(r);return u},re=function(e){var t,n,i,r,a,s,o=0,u=e.byteLength,l=e.nalCount,c=u+4*l,d=new Uint8Array(c),h=new DataView(d.buffer);for(t=0;t<e.length;t++)for(r=e[t],n=0;n<r.length;n++)for(a=r[n],i=0;i<a.length;i++)s=a[i],h.setUint32(o,s.data.byteLength),o+=4,d.set(s.data,o),o+=s.data.byteLength;return d},ae=function(e,t){var n,i=t||0,r=[];return n=ne(e,i),r.push(n),r},se=function(e){var t,n,i=0,r=e.byteLength,a=e.length,s=r+4*a,o=new Uint8Array(s),u=new DataView(o.buffer);for(t=0;t<e.length;t++)n=e[t],u.setUint32(i,n.data.byteLength),i+=4,o.set(n.data,i),i+=n.data.byteLength;return o},oe={groupNalsIntoFrames:J,groupFramesIntoGops:Z,extendFirstKeyFrame:ee,generateSampleTable:ie,concatenateNalData:re,generateSampleTableForFrame:ae,concatenateNalDataForFrame:se},ue=[33,16,5,32,164,27],le=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ce=function(e){for(var t=[];e--;)t.push(0);return t},de=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},{})},he=function(){if(!V){var e={96e3:[ue,[227,64],ce(154),[56]],88200:[ue,[231],ce(170),[56]],64e3:[ue,[248,192],ce(240),[56]],48e3:[ue,[255,192],ce(268),[55,148,128],ce(54),[112]],44100:[ue,[255,192],ce(268),[55,163,128],ce(84),[112]],32e3:[ue,[255,192],ce(268),[55,234],ce(226),[112]],24e3:[ue,[255,192],ce(268),[55,255,128],ce(268),[111,112],ce(126),[224]],16e3:[ue,[255,192],ce(268),[55,255,128],ce(268),[111,255],ce(269),[223,108],ce(195),[1,192]],12e3:[le,ce(268),[3,127,248],ce(268),[6,255,240],ce(268),[13,255,224],ce(268),[27,253,128],ce(259),[56]],11025:[le,ce(268),[3,127,248],ce(268),[6,255,240],ce(268),[13,255,224],ce(268),[27,255,192],ce(268),[55,175,128],ce(108),[112]],8e3:[le,ce(268),[3,121,16],ce(47),[7]]};V=de(e)}return V};W=function(e){return 9e4*e},G=function(e,t){return e*t},z=function(e){return e/9e4},X=function(e,t){return e/t},Y=function(e,t){return W(X(e,t))},K=function(e,t){return G(z(e),t)},Q=function(e,t,n){return z(n?e:e-t)};var pe={ONE_SECOND_IN_TS:9e4,secondsToVideoTs:W,secondsToAudioTs:G,videoTsToSeconds:z,audioTsToSeconds:X,audioTsToVideoTs:Y,videoTsToAudioTs:K,metadataTsToSeconds:Q},fe=function(e){var t,n,i=0;for(t=0;t<e.length;t++)n=e[t],i+=n.data.byteLength;return i},me=function(e,t,n,i){var r,a,s,o,u=0,l=0,c=0,d=0;if(t.length&&(r=pe.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),u=Math.ceil(pe.ONE_SECOND_IN_TS/(e.samplerate/1024)),n&&i&&(l=r-Math.max(n,i),c=Math.floor(l/u),d=c*u),!(c<1||d>pe.ONE_SECOND_IN_TS/2))){for(a=he()[e.samplerate],a||(a=t[0].data),s=0;s<c;s++)o=t[0],t.splice(0,0,{data:a,dts:o.dts-u,pts:o.pts-u});return e.baseMediaDecodeTime-=Math.floor(pe.videoTsToAudioTs(d,e.samplerate)),d}},ge=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)}))},ye=function(e){var t,n,i=[];for(t=0;t<e.length;t++)n=e[t],i.push({size:n.data.byteLength,duration:1024});return i},ve=function(e){var t,n,i=0,r=new Uint8Array(fe(e));for(t=0;t<e.length;t++)n=e[t],r.set(n.data,i),i+=n.data.byteLength;return r},_e={prefixWithSilence:me,trimAdtsFramesByEarliestDts:ge,generateSampleTable:ye,concatenateFrameData:ve},be=pe.ONE_SECOND_IN_TS,Te=function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},Se=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},Ee=function(e,t){var n,i,r=e.minSegmentDts;return t||(r-=e.timelineStartInfo.dts),n=e.timelineStartInfo.baseMediaDecodeTime,n+=r,n=Math.max(0,n),"audio"===e.type&&(i=e.samplerate/be,n*=i,n=Math.floor(n)),n},we={clearDtsInfo:Se,calculateTrackBaseMediaDecodeTime:Ee,collectDtsInfo:Te},ke=function(e){for(var t=0,n={payloadType:-1,payloadSize:0},i=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)i+=255,t++;for(i+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!n.payload&&4===i){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){n.payloadType=i,n.payloadSize=r,n.payload=e.subarray(t,t+r);break}n.payload=void 0}t+=r,i=0,r=0}return n},Ce=function(e){return 181!==e.payload[0]?null:49!=(e.payload[1]<<8|e.payload[2])?null:"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])?null:3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},Ae=function(e,t){var n,i,r,a,s=[];if(!(64&t[0]))return s;for(i=31&t[0],n=0;n<i;n++)r=3*n,a={type:3&t[r+2],pts:e},4&t[r+2]&&(a.ccData=t[r+3]<<8|t[r+4],s.push(a));return s},Ie=function(e){for(var t,n,i=e.byteLength,r=[],a=1;a<i-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=i-r.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),n[a]=e[s];return n},xe={parseSei:ke,parseUserData:Ce,parseCaptionPackets:Ae,discardEmulationPreventionBytes:Ie,USER_DATA_REGISTERED_ITU_T_T35:4},Pe=function e(t){t=t||{},e.prototype.init.call(this),this.parse708captions_="boolean"!=typeof t.parse708captions||t.parse708captions,this.captionPackets_=[],this.ccStreams_=[new He(0,0),new He(0,1),new He(1,0),new He(1,1)],this.parse708captions_&&(this.cc708Stream_=new Ne({captionServices:t.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")))};Pe.prototype=new B,Pe.prototype.push=function(e){var t,n,i;if("sei_rbsp"===e.nalUnitType&&(t=xe.parseSei(e.escapedRBSP),t.payload&&t.payloadType===xe.USER_DATA_REGISTERED_ITU_T_T35&&(n=xe.parseUserData(t)))){if(e.dts<this.latestDts_)return void(this.ignoreNextEqualDts_=!0);if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return void(--this.numSameDts_||(this.ignoreNextEqualDts_=!1));i=xe.parseCaptionPackets(e.pts,n),this.captionPackets_=this.captionPackets_.concat(i),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},Pe.prototype.flushCCStreams=function(e){this.ccStreams_.forEach(function(t){return"flush"===e?t.flush():t.partialFlush()},this)},Pe.prototype.flushStream=function(e){if(!this.captionPackets_.length)return void this.flushCCStreams(e);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)},Pe.prototype.flush=function(){return this.flushStream("flush")},Pe.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Pe.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset()})},Pe.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),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},Pe.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},Pe.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},Pe.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},Pe.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var Oe={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},Le=function(e){var t=Oe[e]||e;return 4096&e&&e===t?"":String.fromCharCode(t)},De=function(e){return 32<=e&&e<=127||160<=e&&e<=255},Re=function(e){this.windowNum=e,this.reset()};Re.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},Re.prototype.getText=function(){return this.rows.join("\n")},Re.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},Re.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Re.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},Re.prototype.addText=function(e){this.rows[this.rowIdx]+=e},Re.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var Me=function(e,t,n){this.serviceNum=e,this.text="",this.currentWindow=new Re(-1),this.windows=[],this.stream=n,"string"==typeof t&&this.createTextDecoder(t)};Me.prototype.init=function(e,t){this.startPts=e;for(var n=0;n<8;n++)this.windows[n]=new Re(n),"function"==typeof t&&(this.windows[n].beforeRowOverflow=t)},Me.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},Me.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)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 Ne=function e(t){t=t||{},e.prototype.init.call(this);var n,i=this,r=t.captionServices||{},a={};Object.keys(r).forEach(function(e){n=r[e],/^SERVICE/.test(e)&&(a[e]=n.encoding)}),this.serviceEncodings=a,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(i.new708Packet(),i.add708Bytes(e)):(null===i.current708Packet&&i.new708Packet(),i.add708Bytes(e))}};Ne.prototype=new B,Ne.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Ne.prototype.add708Bytes=function(e){var t=e.ccData,n=t>>>8,i=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(n),this.current708Packet.data.push(i)},Ne.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,n=null,i=null,r=0,a=t[r++];for(e.seq=a>>6,e.sizeCode=63&a;r<t.length;r++)a=t[r++],n=a>>5,i=31&a,7===n&&i>0&&(a=t[r++],n=a),this.pushServiceBlock(n,r,i),i>0&&(r+=i-1)},Ne.prototype.pushServiceBlock=function(e,t,n){var i,r=t,a=this.current708Packet.data,s=this.services[e];for(s||(s=this.initService(e,r));r<t+n&&r<a.length;r++)i=a[r],De(i)?r=this.handleText(r,s):24===i?r=this.multiByteCharacter(r,s):16===i?r=this.extendedCommands(r,s):128<=i&&i<=135?r=this.setCurrentWindow(r,s):152<=i&&i<=159?r=this.defineWindow(r,s):136===i?r=this.clearWindows(r,s):140===i?r=this.deleteWindows(r,s):137===i?r=this.displayWindows(r,s):138===i?r=this.hideWindows(r,s):139===i?r=this.toggleWindows(r,s):151===i?r=this.setWindowAttributes(r,s):144===i?r=this.setPenAttributes(r,s):145===i?r=this.setPenColor(r,s):146===i?r=this.setPenLocation(r,s):143===i?s=this.reset(r,s):8===i?s.currentWindow.backspace():12===i?s.currentWindow.clearText():13===i?s.currentWindow.pendingNewLine=!0:14===i?s.currentWindow.clearText():141===i&&r++},Ne.prototype.extendedCommands=function(e,t){var n=this.current708Packet.data,i=n[++e];return De(i)&&(e=this.handleText(e,t,{isExtended:!0})),e},Ne.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},Ne.prototype.initService=function(e,t){var n,i,n="SERVICE"+e,r=this;return n in this.serviceEncodings&&(i=this.serviceEncodings[n]),this.services[e]=new Me(e,i,r),this.services[e].init(this.getPts(t),function(t){r.flushDisplayed(t,r.services[e])}),this.services[e]},Ne.prototype.handleText=function(e,t,n){var i,r,a=n&&n.isExtended,s=n&&n.isMultiByte,o=this.current708Packet.data,u=a?4096:0,l=o[e],c=o[e+1],d=t.currentWindow;return t.textDecoder_&&!a?(s?(r=[l,c],e++):r=[l],i=t.textDecoder_.decode(new Uint8Array(r))):i=Le(u|l),d.pendingNewLine&&!d.isEmpty()&&d.newLine(this.getPts(e)),d.pendingNewLine=!1,d.addText(i),e},Ne.prototype.multiByteCharacter=function(e,t){var n=this.current708Packet.data,i=n[e+1],r=n[e+2];return De(i)&&De(r)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},Ne.prototype.setCurrentWindow=function(e,t){var n=this.current708Packet.data,i=n[e],r=7&i;return t.setCurrentWindow(r),e},Ne.prototype.defineWindow=function(e,t){var n=this.current708Packet.data,i=n[e],r=7&i;t.setCurrentWindow(r);var a=t.currentWindow;return i=n[++e],a.visible=(32&i)>>5,a.rowLock=(16&i)>>4,a.columnLock=(8&i)>>3,a.priority=7&i,i=n[++e],a.relativePositioning=(128&i)>>7,a.anchorVertical=127&i,i=n[++e],a.anchorHorizontal=i,i=n[++e],a.anchorPoint=(240&i)>>4,a.rowCount=15&i,i=n[++e],a.columnCount=63&i,i=n[++e],a.windowStyle=(56&i)>>3,a.penStyle=7&i,a.virtualRowCount=a.rowCount+1,e},Ne.prototype.setWindowAttributes=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.winAttr;return i=n[++e],r.fillOpacity=(192&i)>>6,r.fillRed=(48&i)>>4,r.fillGreen=(12&i)>>2,r.fillBlue=3&i,i=n[++e],r.borderType=(192&i)>>6,r.borderRed=(48&i)>>4,r.borderGreen=(12&i)>>2,r.borderBlue=3&i,i=n[++e],r.borderType+=(128&i)>>5,r.wordWrap=(64&i)>>6,r.printDirection=(48&i)>>4,r.scrollDirection=(12&i)>>2,r.justify=3&i,i=n[++e],r.effectSpeed=(240&i)>>4,r.effectDirection=(12&i)>>2,r.displayEffect=3&i,e},Ne.prototype.flushDisplayed=function(e,t){for(var n=[],i=0;i<8;i++)t.windows[i].visible&&!t.windows[i].isEmpty()&&n.push(t.windows[i].getText());t.endPts=e,t.text=n.join("\n\n"),this.pushCaption(t),t.startPts=e},Ne.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)},Ne.prototype.displayWindows=function(e,t){var n=this.current708Packet.data,i=n[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var a=0;a<8;a++)i&1<<a&&(t.windows[a].visible=1);return e},Ne.prototype.hideWindows=function(e,t){var n=this.current708Packet.data,i=n[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var a=0;a<8;a++)i&1<<a&&(t.windows[a].visible=0);return e},Ne.prototype.toggleWindows=function(e,t){var n=this.current708Packet.data,i=n[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var a=0;a<8;a++)i&1<<a&&(t.windows[a].visible^=1);return e},Ne.prototype.clearWindows=function(e,t){var n=this.current708Packet.data,i=n[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var a=0;a<8;a++)i&1<<a&&t.windows[a].clearText();return e},Ne.prototype.deleteWindows=function(e,t){var n=this.current708Packet.data,i=n[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var a=0;a<8;a++)i&1<<a&&t.windows[a].reset();return e},Ne.prototype.setPenAttributes=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.penAttr;return i=n[++e],r.textTag=(240&i)>>4,r.offset=(12&i)>>2,r.penSize=3&i,i=n[++e],r.italics=(128&i)>>7,r.underline=(64&i)>>6,r.edgeType=(56&i)>>3,r.fontStyle=7&i,e},Ne.prototype.setPenColor=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.penColor;return i=n[++e],r.fgOpacity=(192&i)>>6,r.fgRed=(48&i)>>4,r.fgGreen=(12&i)>>2,r.fgBlue=3&i,i=n[++e],r.bgOpacity=(192&i)>>6,r.bgRed=(48&i)>>4,r.bgGreen=(12&i)>>2,r.bgBlue=3&i,i=n[++e],r.edgeRed=(48&i)>>4,r.edgeGreen=(12&i)>>2,r.edgeBlue=3&i,e},Ne.prototype.setPenLocation=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,i=n[++e],r.row=15&i,i=n[++e],r.column=63&i,e},Ne.prototype.reset=function(e,t){var n=this.getPts(e);return this.flushDisplayed(n,t),this.initService(t.serviceNum,e)};var Ue={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},Be=function(e){return null===e?"":(e=Ue[e]||e,String.fromCharCode(e))},je=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Fe=function(){for(var e=[],t=15;t--;)e.push("");return e},He=function e(t,n){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=n||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,n,i,r,a;if((t=32639&e.ccData)===this.lastControlCode_)return void(this.lastControlCode_=null);if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),i=t>>>8,r=255&t,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_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Fe();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Fe();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Fe()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(i,r))i=(3&i)<<8,a=Be(i|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(i,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),i=(3&i)<<8,a=Be(i|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(i,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(i,r))this.column_+=3&r;else if(this.isPAC(i,r)){var s=je.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(i)&&(0===r&&(r=null),a=Be(i),a+=Be(r),this[this.mode_](e.pts,a),this.column_+=a.length)}};He.prototype=new B,He.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e,t){try{return e.trim()}catch(e){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}},this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},He.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Fe(),this.nonDisplayed_=Fe(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},He.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},He.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},He.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},He.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},He.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},He.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},He.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},He.prototype.isNormalChar=function(e){return e>=32&&e<=127},He.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Fe(),this.displayed_=Fe()),void 0!==t&&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]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},He.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)},He.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)}},He.prototype.popOn=function(e,t){var n=this.nonDisplayed_[this.row_];n+=t,this.nonDisplayed_[this.row_]=n},He.prototype.rollUp=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n},He.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},He.prototype.paintOn=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n};var qe={CaptionStream:Pe,Cea608Stream:He,Cea708Stream:Ne},Ve={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},We=function(e,t){var n=1;for(e>t&&(n=-1);Math.abs(t-e)>4294967296;)e+=8589934592*n;return e},Ge=function e(t){var n,i;e.prototype.init.call(this),this.type_=t||"shared",this.push=function(e){"shared"!==this.type_&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=We(e.dts,i),e.pts=We(e.pts,i),n=e.dts,this.trigger("data",e))},this.flush=function(){i=n,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,n=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Ge.prototype=new B;var ze,Xe={TimestampRolloverStream:Ge,handleRollover:We},Ye=function(e,t,n){var i,r="";for(i=t;i<n;i++)r+="%"+("00"+e[i].toString(16)).slice(-2);return r},Ke=function(e,t,n){return decodeURIComponent(Ye(e,t,n))},Qe=function(e,t,n){return unescape(Ye(e,t,n))},$e=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Je={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=Ke(e.data,1,t),e.value=Ke(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=Ke(e.data,1,t),e.url=Ke(e.data,t+1,e.data.length);break}},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=Qe(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};ze=function(e){var t,n={descriptor:e&&e.descriptor},i=0,r=[],a=0;if(ze.prototype.init.call(this),this.dispatchType=Ve.METADATA_STREAM_TYPE.toString(16),n.descriptor)for(t=0;t<n.descriptor.length;t++)this.dispatchType+=("00"+n.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,n,s,o,u,l;if("timed-metadata"===e.type){if(e.dataAlignmentIndicator&&(a=0,r.length=0),0===r.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))return void this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});if(r.push(e),a+=e.data.byteLength,1===r.length&&(i=$e(e.data.subarray(6,10)),i+=10),!(a<i)){for(t={data:new Uint8Array(i),frames:[],pts:r[0].pts,dts:r[0].dts},u=0;u<i;)t.data.set(r[0].data.subarray(0,i-u),u),u+=r[0].data.byteLength,a-=r[0].data.byteLength,r.shift();n=10,64&t.data[5]&&(n+=4,n+=$e(t.data.subarray(10,14)),i-=$e(t.data.subarray(16,20)));do{if((s=$e(t.data.subarray(n+4,n+8)))<1)return void this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});if(l=String.fromCharCode(t.data[n],t.data[n+1],t.data[n+2],t.data[n+3]),o={id:l,data:t.data.subarray(n+10,n+s+10)},o.key=o.id,Je[o.id]&&(Je[o.id](o),"com.apple.streaming.transportStreamTimestamp"===o.owner)){var c=o.data,d=(1&c[3])<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;d*=4,d+=3&c[7],o.timeStamp=d,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),n+=10,n+=s}while(n<i);this.trigger("data",t)}}}},ze.prototype=new B;var Ze,et,tt,nt=ze,it=Xe.TimestampRolloverStream;Ze=function(){var e=new Uint8Array(188),t=0;Ze.prototype.init.call(this),this.push=function(n){var i,r=0,a=188;for(t?(i=new Uint8Array(n.byteLength+t),i.set(e.subarray(0,t)),i.set(n,t),t=0):i=n;a<i.byteLength;)71!==i[r]||71!==i[a]?(r++,a++):(this.trigger("data",i.subarray(r,a)),r+=188,a+=188);r<i.byteLength&&(e.set(i.subarray(r),0),t=i.byteLength-r)},this.flush=function(){188===t&&71===e[0]&&(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")}},Ze.prototype=new B,et=function(){var e,t,n,i;et.prototype.init.call(this),i=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,i){var r=0;i.payloadUnitStartIndicator&&(r+=e[r]+1),"pat"===i.type?t(e.subarray(r),i):n(e.subarray(r),i)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],i.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=i.pmtPid},n=function(e,t){var n,r,a,s;if(1&e[5]){for(i.programMapTable={video:null,audio:null,"timed-metadata":{}},n=(15&e[1])<<8|e[2],r=3+n-4,a=(15&e[10])<<8|e[11],s=12+a;s<r;){var o=e[s],u=(31&e[s+1])<<8|e[s+2];o===Ve.H264_STREAM_TYPE&&null===i.programMapTable.video?i.programMapTable.video=u:o===Ve.ADTS_STREAM_TYPE&&null===i.programMapTable.audio?i.programMapTable.audio=u:o===Ve.METADATA_STREAM_TYPE&&(i.programMapTable["timed-metadata"][u]=o),s+=5+((15&e[s+3])<<8|e[s+4])}t.programMapTable=i.programMapTable}},this.push=function(t){var n={},i=4;if(n.payloadUnitStartIndicator=!!(64&t[1]),n.pid=31&t[1],n.pid<<=8,n.pid|=t[2],(48&t[3])>>>4>1&&(i+=t[i]+1),0===n.pid)n.type="pat",e(t.subarray(i),n),this.trigger("data",n);else if(n.pid===this.pmtPid)for(n.type="pmt",e(t.subarray(i),n),this.trigger("data",n);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,i,n]):this.processPes_(t,i,n)},this.processPes_=function(e,t,n){n.pid===this.programMapTable.video?n.streamType=Ve.H264_STREAM_TYPE:n.pid===this.programMapTable.audio?n.streamType=Ve.ADTS_STREAM_TYPE:n.streamType=this.programMapTable["timed-metadata"][n.pid],n.type="pes",n.data=e.subarray(t),this.trigger("data",n)}},et.prototype=new B,et.STREAM_TYPES={h264:27,adts:15},tt=function(){var e,t=this,n=!1,i={data:[],size:0},r={data:[],size:0},a={data:[],size:0},s=function(e,t){var n,i=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===i&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!=(4&e[6]),n=e[7],192&n&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&n&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))},o=function(e,n,i){var r,a=new Uint8Array(e.size),o={type:n},u=0,l=0,c=!1;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,u=0;u<e.data.length;u++)r=e.data[u],a.set(r.data,l),l+=r.data.byteLength;s(a,o),c="video"===n||o.packetLength<=e.size,(i||c)&&(e.size=0,e.data.length=0),c&&t.trigger("data",o)}};tt.prototype.init.call(this),this.push=function(s){({pat:function(){},pes:function(){var e,t;switch(s.streamType){case Ve.H264_STREAM_TYPE:e=i,t="video";break;case Ve.ADTS_STREAM_TYPE:e=r,t="audio";break;case Ve.METADATA_STREAM_TYPE:e=a,t="timed-metadata";break;default:return}s.payloadUnitStartIndicator&&o(e,t,!0),e.data.push(s),e.size+=s.data.byteLength},pmt:function(){var i={type:"metadata",tracks:[]};e=s.programMapTable,null!==e.video&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),n=!0,t.trigger("data",i)}})[s.type]()},this.reset=function(){i.size=0,i.data.length=0,r.size=0,r.data.length=0,this.trigger("reset")},this.flushStreams_=function(){o(i,"video"),o(r,"audio"),o(a,"timed-metadata")},this.flush=function(){if(!n&&e){var i={type:"metadata",tracks:[]};null!==e.video&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",i)}n=!1,this.flushStreams_(),this.trigger("done")}},tt.prototype=new B;var rt={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:Ze,TransportParseStream:et,ElementaryStream:tt,TimestampRolloverStream:it,CaptionStream:qe.CaptionStream,Cea608Stream:qe.Cea608Stream,Cea708Stream:qe.Cea708Stream,MetadataStream:nt};for(var at in Ve)Ve.hasOwnProperty(at)&&(rt[at]=Ve[at]);var st,ot=rt,ut=pe.ONE_SECOND_IN_TS,lt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];st=function(e){var t,n=0;st.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(i){var r,a,s,o,u,l=0;if(e||(n=0),"audio"===i.type){t&&t.length?(s=t,t=new Uint8Array(s.byteLength+i.data.byteLength),t.set(s),t.set(i.data,s.byteLength)):t=i.data;for(var c;l+7<t.length;)if(255===t[l]&&240==(246&t[l+1])){if("number"==typeof c&&(this.skipWarn_(c,l),c=null),a=2*(1&~t[l+1]),r=(3&t[l+3])<<11|t[l+4]<<3|(224&t[l+5])>>5,o=1024*(1+(3&t[l+6])),u=o*ut/lt[(60&t[l+2])>>>2],t.byteLength-l<r)break;this.trigger("data",{pts:i.pts+n*u,dts:i.dts+n*u,sampleCount:o,audioobjecttype:1+(t[l+2]>>>6&3),channelcount:(1&t[l+2])<<2|(192&t[l+3])>>>6,samplerate:lt[(60&t[l+2])>>>2],samplingfrequencyindex:(60&t[l+2])>>>2,samplesize:16,data:t.subarray(l+7+a,l+r)}),n++,l+=r}else"number"!=typeof c&&(c=l),l++;"number"==typeof c&&(this.skipWarn_(c,l),c=null),t=t.subarray(l)}},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")}},st.prototype=new B;var ct,dt=st;ct=function(e){var t=e.byteLength,n=0,i=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+i},this.loadWord=function(){var r=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(r,r+s)),n=new DataView(a.buffer).getUint32(0),i=8*s,t-=s},this.skipBits=function(e){var r;i>e?(n<<=e,i-=e):(e-=i,r=Math.floor(e/8),e-=8*r,t-=r,this.loadWord(),n<<=e,i-=e)},this.readBits=function(e){var r=Math.min(i,e),a=n>>>32-r;return i-=r,i>0?n<<=r:t>0&&this.loadWord(),r=e-r,r>0?a<<r|this.readBits(r):a},this.skipLeadingZeros=function(){var e;for(e=0;e<i;++e)if(0!=(n&2147483648>>>e))return n<<=e,i-=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 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var ht,pt,ft,mt=ct;pt=function(){var e,t,n=0;pt.prototype.init.call(this),this.push=function(i){var r;t?(r=new Uint8Array(t.byteLength+i.data.byteLength),r.set(t),r.set(i.data,t.byteLength),t=r):t=i.data;for(var a=t.byteLength;n<a-3;n++)if(1===t[n+2]){e=n+5;break}for(;e<a;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}n+3!==e-2&&this.trigger("data",t.subarray(n+3,e-2));do{e++}while(1!==t[e]&&e<a);n=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(n+3,e-2)),n=e-2,e+=3;break;default:e+=3}t=t.subarray(n),e-=n,n=0},this.reset=function(){t=null,n=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(n+3)),t=null,n=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},pt.prototype=new B,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},ht=function(){var e,t,n,i,r,a,s,o=new pt;ht.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,n=e.pts,i=e.dts,o.push(e))},o.on("data",function(s){var o={trackId:t,pts:n,dts:i,data:s,nalUnitTypeCode:31&s[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=r(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(s.subarray(1)),o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)}),o.on("done",function(){e.trigger("done")}),o.on("partialdone",function(){e.trigger("partialdone")}),o.on("reset",function(){e.trigger("reset")}),o.on("endedtimeline",function(){e.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},s=function(e,t){var n,i,r=8,a=8;for(n=0;n<e;n++)0!==a&&(i=t.readExpGolomb(),a=(r+i+256)%256),r=0===a?r:a},r=function(e){for(var t,n,i=e.byteLength,r=[],a=1;a<i-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=i-r.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),n[a]=e[s];return n},a=function(e){var t,n,i,r,a,o,u,l,c,d,h,p,f=0,m=0,g=0,y=0,v=[1,1];if(t=new mt(e),n=t.readUnsignedByte(),r=t.readUnsignedByte(),i=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),ft[n]&&(a=t.readUnsignedExpGolomb(),3===a&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(h=3!==a?8:12,p=0;p<h;p++)t.readBoolean()&&(p<6?s(16,t):s(64,t));if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),u=t.readUnsignedExpGolomb(),p=0;p<u;p++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),l=t.readUnsignedExpGolomb(),c=t.readUnsignedExpGolomb(),d=t.readBits(1),0===d&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(f=t.readUnsignedExpGolomb(),m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}v&&(v[0],v[1])}return{profileIdc:n,levelIdc:i,profileCompatibility:r,width:16*(l+1)-2*f-2*m,height:(2-d)*(c+1)*16-2*g-2*y,sarRatio:v}}},ht.prototype=new B;var gt,yt={H264Stream:ht,NalByteStream:pt},vt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],_t=function(e,t){var n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],i=e[t+5],r=(16&i)>>4;return n=n>=0?n:0,r?n+20:n+10},bt=function e(t,n){return t.length-n<10||t[n]!=="I".charCodeAt(0)||t[n+1]!=="D".charCodeAt(0)||t[n+2]!=="3".charCodeAt(0)?n:(n+=_t(t,n),e(t,n))},Tt=function(e){var t=bt(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1])},St=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Et=function(e,t,n){var i,r="";for(i=t;i<n;i++)r+="%"+("00"+e[i].toString(16)).slice(-2);return r},wt=function(e,t,n){return unescape(Et(e,t,n))},kt=function(e,t){var n=(224&e[t+5])>>5,i=e[t+4]<<3;return 6144&e[t+3]|i|n},Ct=function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},At=function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return vt[(60&e[t+2])>>>2];t++}return null},It=function(e){var t,n,i;t=10,64&e[5]&&(t+=4,t+=St(e.subarray(10,14)));do{if((n=St(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){i=e.subarray(t+10,t+n+10);for(var r=0;r<i.byteLength;r++)if(0===i[r]){var a=wt(i,0,r);if("com.apple.streaming.transportStreamTimestamp"===a){var s=i.subarray(r+1),o=(1&s[3])<<30|s[4]<<22|s[5]<<14|s[6]<<6|s[7]>>>2;return o*=4,o+=3&s[7]}break}}t+=10,t+=n}while(t<e.byteLength);return null},xt={isLikelyAacData:Tt,parseId3TagSize:_t,parseAdtsSize:kt,parseType:Ct,parseSampleRate:At,parseAacTimestamp:It};gt=function(){var e=new Uint8Array,t=0;gt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(n){var i,r,a,s,o=0,u=0;for(e.length?(s=e.length,e=new Uint8Array(n.byteLength+s),e.set(e.subarray(0,s)),e.set(n,s)):e=n;e.length-u>=3;)if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0))if(255!=(255&e[u])||240!=(240&e[u+1]))u++;else{if(e.length-u<7)break;if(o=xt.parseAdtsSize(e,u),u+o>e.length)break;a={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",a),u+=o}else{if(e.length-u<10)break;if(o=xt.parseId3TagSize(e,u),u+o>e.length)break;r={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",r),u+=o}i=e.length-u,e=i>0?e.subarray(u):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}},gt.prototype=new B;var Pt,Ot,Lt,Dt,Rt=gt,Mt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Nt=Mt,Ut=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Bt=Ut,jt=yt.H264Stream,Ft=xt.isLikelyAacData,Ht=pe.ONE_SECOND_IN_TS,qt=function(e,t){t.stream=e,this.trigger("log",t)},Vt=function(e,t){for(var n=Object.keys(t),i=0;i<n.length;i++){var r=n[i];"headOfPipeline"!==r&&t[r].on&&t[r].on("log",qt.bind(e,r))}},Wt=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},Gt=function(e,t,n,i,r,a){return{start:{dts:e,pts:e+(n-t)},end:{dts:e+(i-t),pts:e+(r-n)},prependedContentDuration:a,baseMediaDecodeTime:e}};Ot=function(e,t){var n,i=[],r=0,a=0,s=1/0;t=t||{},n=t.firstSequenceNumber||0,Ot.prototype.init.call(this),this.push=function(t){we.collectDtsInfo(e,t),e&&Nt.forEach(function(n){e[n]=t[n]}),i.push(t)},this.setEarliestDts=function(e){r=e},this.setVideoBaseMediaDecodeTime=function(e){s=e},this.setAudioAppendStart=function(e){a=e},this.flush=function(){var o,u,l,c,d,h,p;if(0===i.length)return void this.trigger("done","AudioSegmentStream");o=_e.trimAdtsFramesByEarliestDts(i,e,r),e.baseMediaDecodeTime=we.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),p=_e.prefixWithSilence(e,o,a,s),e.samples=_e.generateSampleTable(o),l=$.mdat(_e.concatenateFrameData(o)),i=[],u=$.moof(n,[e]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.byteLength),we.clearDtsInfo(e),d=Math.ceil(1024*Ht/e.samplerate),o.length&&(h=o.length*d,this.trigger("segmentTimingInfo",Gt(pe.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+h,o[0].pts+h,p||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+h})),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")},this.reset=function(){we.clearDtsInfo(e),i=[],this.trigger("reset")}},Ot.prototype=new B,Pt=function(e,t){var n,i,r,a=[],s=[];t=t||{},n=t.firstSequenceNumber||0,Pt.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){we.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.config,e.sps=[t.data],Bt.forEach(function(t){e[t]=i[t]},this)),"pic_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.data,e.pps=[t.data]),a.push(t)},this.flush=function(){for(var i,r,o,u,l,c,d,h,p=0;a.length&&"access_unit_delimiter_rbsp"!==a[0].nalUnitType;)a.shift();if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(i=oe.groupNalsIntoFrames(a),o=oe.groupFramesIntoGops(i),o[0][0].keyFrame||(r=this.getGopForFusion_(a[0],e),r?(p=r.duration,o.unshift(r),o.byteLength+=r.byteLength,o.nalCount+=r.nalCount,o.pts=r.pts,o.dts=r.dts,o.duration+=r.duration):o=oe.extendFirstKeyFrame(o)),s.length){var f;if(!(f=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");we.clearDtsInfo(e),o=f}we.collectDtsInfo(e,o),e.samples=oe.generateSampleTable(o),l=$.mdat(oe.concatenateNalData(o)),e.baseMediaDecodeTime=we.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}})),d=o[0],h=o[o.length-1],this.trigger("segmentTimingInfo",Gt(e.baseMediaDecodeTime,d.dts,d.pts,h.dts+h.duration,h.pts+h.duration,p)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),u=$.moof(n,[e]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.byteLength),this.trigger("data",{track:e,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),a=[],this.gopCache_.length=0,s.length=0,this.trigger("reset")},this.resetStream_=function(){we.clearDtsInfo(e),i=void 0,r=void 0},this.getGopForFusion_=function(t){var n,i,r,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)a=this.gopCache_[s],r=a.gop,e.pps&&Wt(e.pps[0],a.pps[0])&&e.sps&&Wt(e.sps[0],a.sps[0])&&(r.dts<e.timelineStartInfo.dts||(n=t.dts-r.dts-r.duration)>=-1e4&&n<=45e3&&(!i||o>n)&&(i=a,o=n));return i?i.gop:null},this.alignGopsAtStart_=function(e){var t,n,i,r,a,o,u,l;for(a=e.byteLength,o=e.nalCount,u=e.duration,t=n=0;t<s.length&&n<e.length&&(i=s[t],r=e[n],i.pts!==r.pts);)r.pts>i.pts?t++:(n++,a-=r.byteLength,o-=r.nalCount,u-=r.duration);return 0===n?e:n===e.length?null:(l=e.slice(n),l.byteLength=a,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,n,i,r,a,o;for(t=s.length-1,n=e.length-1,a=null,o=!1;t>=0&&n>=0;){if(i=s[t],r=e[n],i.pts===r.pts){o=!0;break}i.pts>r.pts?t--:(t===s.length-1&&(a=n),n--)}if(!o&&null===a)return null;var u;if(0===(u=o?n:a))return e;var l=e.slice(u),c=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=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){s=e}},Pt.prototype=new B,Dt=function(e,t){this.numberOfTracks=0,this.metadataStream=t,e=e||{},void 0!==e.remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Dt.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}},Dt.prototype=new B,Dt.prototype.flush=function(e){var t,n,i,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return void(++this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,Bt.forEach(function(e){s.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,Nt.forEach(function(e){s.info[e]=this.audioTrack[e]},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,i=$.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(i.byteLength),s.initSegment.set(i),s.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)s.data.set(this.pendingBoxes[r],a),a+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)t=this.pendingCaptions[r],t.startTime=pe.metadataTsToSeconds(t.startPts,o,this.keepOriginalTimestamps),t.endTime=pe.metadataTsToSeconds(t.endPts,o,this.keepOriginalTimestamps),s.captionStreams[t.stream]=!0,s.captions.push(t);for(r=0;r<this.pendingMetadata.length;r++)n=this.pendingMetadata[r],n.cueTime=pe.metadataTsToSeconds(n.pts,o,this.keepOriginalTimestamps),s.metadata.push(n);for(s.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",s),r=0;r<s.captions.length;r++)t=s.captions[r],this.trigger("caption",t);for(r=0;r<s.metadata.length;r++)n=s.metadata[r],this.trigger("id3Frame",n)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Dt.prototype.setRemux=function(e){this.remuxTracks=e},Lt=function(e){var t,n,i=this,r=!0;Lt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="aac",r.metadataStream=new ot.MetadataStream,r.aacStream=new Rt,r.audioTimestampRolloverStream=new ot.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new ot.TimestampRolloverStream("timed-metadata"),r.adtsStream=new dt,r.coalesceStream=new Dt(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",function(e){r.aacStream.setTimestamp(e.timeStamp)}),r.aacStream.on("data",function(a){"timed-metadata"!==a.type&&"audio"!==a.type||r.audioSegmentStream||(n=n||{timelineStartInfo:{baseMediaDecodeTime:i.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new Ot(n,e),r.audioSegmentStream.on("log",i.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",i.trigger.bind(i,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),i.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t}))}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),Vt(this,r)},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new ot.MetadataStream,r.packetStream=new ot.TransportPacketStream,r.parseStream=new ot.TransportParseStream,r.elementaryStream=new ot.ElementaryStream,r.timestampRolloverStream=new ot.TimestampRolloverStream,r.adtsStream=new dt,r.h264Stream=new jt,r.captionStream=new ot.CaptionStream(e),r.coalesceStream=new Dt(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",function(a){var s;if("metadata"===a.type){for(s=a.tracks.length;s--;)t||"video"!==a.tracks[s].type?n||"audio"!==a.tracks[s].type||(n=a.tracks[s],n.timelineStartInfo.baseMediaDecodeTime=i.baseMediaDecodeTime):(t=a.tracks[s],t.timelineStartInfo.baseMediaDecodeTime=i.baseMediaDecodeTime);t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new Pt(t,e),r.videoSegmentStream.on("log",i.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",function(t){n&&!e.keepOriginalTimestamps&&(n.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-i.baseMediaDecodeTime))}),r.videoSegmentStream.on("processedGopsInfo",i.trigger.bind(i,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",i.trigger.bind(i,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",function(e){n&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),r.videoSegmentStream.on("timingInfo",i.trigger.bind(i,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),n&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new Ot(n,e),r.audioSegmentStream.on("log",i.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",i.trigger.bind(i,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",i.trigger.bind(i,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),i.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t})}}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",function(e){e.dispatchType=r.metadataStream.dispatchType,i.trigger("id3Frame",e)}),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),Vt(this,r)},this.setBaseMediaDecodeTime=function(i){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=i),n&&(n.timelineStartInfo.dts=void 0,n.timelineStartInfo.pts=void 0,we.clearDtsInfo(n),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,we.clearDtsInfo(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){n&&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){t&&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(r){var t=Ft(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!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()}},Lt.prototype=new B;var zt,Xt={Transmuxer:Lt,VideoSegmentStream:Pt,AudioSegmentStream:Ot,AUDIO_PROPERTIES:Nt,VIDEO_PROPERTIES:Bt,generateSegmentTimingInfo:Gt},Yt=function(e){return e>>>0},Kt=function(e){return("00"+e.toString(16)).slice(-2)},Qt={toUnsigned:Yt,toHexString:Kt},$t=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])},Jt=$t,Zt=Qt.toUnsigned,en=function e(t,n){var i,r,a,s,o,u=[];if(!n.length)return null;for(i=0;i<t.byteLength;)r=Zt(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3]),a=Jt(t.subarray(i+4,i+8)),s=r>1?i+r:t.byteLength,a===n[0]&&(1===n.length?u.push(t.subarray(i+8,s)):(o=e(t.subarray(i+8,s),n.slice(1)),o.length&&(u=u.concat(o)))),i=s;return u},tn=en,nn=Qt.toUnsigned,rn=H.getUint64,an=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=rn(e.subarray(4)):t.baseMediaDecodeTime=nn(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},sn=an,on=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},un=on,ln=function(e){var t,n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&n.flags[2],a=4&n.flags[2],s=1&n.flags[1],o=2&n.flags[1],u=4&n.flags[1],l=8&n.flags[1],c=i.getUint32(4),d=8;for(r&&(n.dataOffset=i.getInt32(d),d+=4),a&&c&&(t={flags:un(e.subarray(d,d+4))},d+=4,s&&(t.duration=i.getUint32(d),d+=4),o&&(t.size=i.getUint32(d),d+=4),l&&(1===n.version?t.compositionTimeOffset=i.getInt32(d):t.compositionTimeOffset=i.getUint32(d),d+=4),n.samples.push(t),c--);c--;)t={},s&&(t.duration=i.getUint32(d),d+=4),o&&(t.size=i.getUint32(d),d+=4),u&&(t.flags=un(e.subarray(d,d+4)),d+=4),l&&(1===n.version?t.compositionTimeOffset=i.getInt32(d):t.compositionTimeOffset=i.getUint32(d),d+=4),n.samples.push(t);return n},cn=ln,dn=function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:n.getUint32(4)},r=1&i.flags[2],a=2&i.flags[2],s=8&i.flags[2],o=16&i.flags[2],u=32&i.flags[2],l=65536&i.flags[0],c=131072&i.flags[0];return t=8,r&&(t+=4,i.baseDataOffset=n.getUint32(12),t+=4),a&&(i.sampleDescriptionIndex=n.getUint32(t),t+=4),s&&(i.defaultSampleDuration=n.getUint32(t),t+=4),o&&(i.defaultSampleSize=n.getUint32(t),t+=4),u&&(i.defaultSampleFlags=n.getUint32(t)),l&&(i.durationIsEmpty=!0),!r&&c&&(i.baseDataOffsetIsMoof=!0),i},hn=dn,pn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{};zt="undefined"!=typeof window?window:void 0!==pn?pn:"undefined"!=typeof self?self:{};var fn,mn,gn,yn,vn,_n,bn=zt,Tn=xe.discardEmulationPreventionBytes,Sn=qe.CaptionStream,En=function(e,t){for(var n=e,i=0;i<t.length;i++){var r=t[i];if(n<r.size)return r;n-=r.size}return null},wn=function(e,t,n){var i,r,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u={logs:[],seiNals:[]};for(r=0;r+4<e.length;r+=a)if(a=o.getUint32(r),r+=4,!(a<=0))switch(31&e[r]){case 6:var l=e.subarray(r+1,r+1+a),c=En(r,t);if(i={nalUnitType:"sei_rbsp",size:a,data:l,escapedRBSP:Tn(l),trackId:n},c)i.pts=c.pts,i.dts=c.dts,s=c;else{if(!s){u.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+r+" for trackId "+n+". See mux.js#223."});break}i.pts=s.pts,i.dts=s.dts}u.seiNals.push(i)}return u},kn=function(e,t,n){var i=t,r=n.defaultSampleDuration||0,a=n.defaultSampleSize||0,s=n.trackId,o=[];return e.forEach(function(e){var t=cn(e),n=t.samples;n.forEach(function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=a),e.trackId=s,e.dts=i,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof i?(e.pts=i+bn.BigInt(e.compositionTimeOffset),i+=bn.BigInt(e.duration)):(e.pts=i+e.compositionTimeOffset,i+=e.duration)}),o=o.concat(n)}),o},Cn=function(e,t){var n=tn(e,["moof","traf"]),i=tn(e,["mdat"]),r={},a=[];return i.forEach(function(e,t){var i=n[t];a.push({mdat:e,traf:i})}),a.forEach(function(e){var n,i,a=e.mdat,s=e.traf,o=tn(s,["tfhd"]),u=hn(o[0]),l=u.trackId,c=tn(s,["tfdt"]),d=c.length>0?sn(c[0]).baseMediaDecodeTime:0,h=tn(s,["trun"]);t===l&&h.length>0&&(n=kn(h,d,u),i=wn(a,n,l),r[l]||(r[l]={seiNals:[],logs:[]}),r[l].seiNals=r[l].seiNals.concat(i.seiNals),r[l].logs=r[l].logs.concat(i.logs))}),r},An=function(e,t,n){var i;if(null===t)return null;i=Cn(e,t);var r=i[t]||{};return{seiNals:r.seiNals,logs:r.logs,timescale:n}},In=function(){var e,t,n,i,r,a,s=!1;this.isInitialized=function(){return s},this.init=function(t){e=new Sn,s=!0,a=!!t&&t.isPartial,e.on("data",function(e){e.startTime=e.startPts/i,e.endTime=e.endPts/i,r.captions.push(e),r.captionStreams[e.stream]=!0}),e.on("log",function(e){r.logs.push(e)})},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length)&&(n!==e[0]||i!==t[n])},this.parse=function(e,a,s){var o;if(!this.isInitialized())return null;if(!a||!s)return null;if(this.isNewInit(a,s))n=a[0],i=s[n];else if(null===n||!i)return t.push(e),null;for(;t.length>0;){var u=t.shift();this.parse(u,a,s)}return o=An(e,n,i),o&&o.logs&&(r.logs=r.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):r.logs.length?{logs:r.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t)})},this.flushStream=function(){if(!this.isInitialized())return null;a?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={},r.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],n=null,i=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},xn=In,Pn=Qt.toUnsigned,On=Qt.toHexString,Ln=H.getUint64;fn=function(e){var t={};return tn(e,["moov","trak"]).reduce(function(e,t){var n,i,r,a,s;return(n=tn(t,["tkhd"])[0])?(i=n[0],r=0===i?12:20,a=Pn(n[r]<<24|n[r+1]<<16|n[r+2]<<8|n[r+3]),(s=tn(t,["mdia","mdhd"])[0])?(i=s[0],r=0===i?12:20,e[a]=Pn(s[r]<<24|s[r+1]<<16|s[r+2]<<8|s[r+3]),e):null):null},t)},mn=function(e,t){var n;n=tn(t,["moof","traf"]);var i=n.reduce(function(t,n){var i,r=tn(n,["tfhd"])[0],a=Pn(r[4]<<24|r[5]<<16|r[6]<<8|r[7]),s=e[a]||9e4,o=tn(n,["tfdt"])[0],u=new DataView(o.buffer,o.byteOffset,o.byteLength);i=1===o[0]?Ln(o.subarray(4,12)):u.getUint32(4);var l;return"bigint"==typeof i?l=i/bn.BigInt(s):"number"!=typeof i||isNaN(i)||(l=i/s),l<Number.MAX_SAFE_INTEGER&&(l=Number(l)),l<t&&(t=l),t},1/0);return"bigint"==typeof i||isFinite(i)?i:0},gn=function(e,t){var n,i=tn(t,["moof","traf"]),r=0,a=0;if(i&&i.length){var s=tn(i[0],["tfhd"])[0],o=tn(i[0],["trun"])[0],u=tn(i[0],["tfdt"])[0];if(s){n=hn(s).trackId}if(u){r=sn(u).baseMediaDecodeTime}if(o){var l=cn(o);l.samples&&l.samples.length&&(a=l.samples[0].compositionTimeOffset||0)}}var c=e[n]||9e4;"bigint"==typeof r&&(a=bn.BigInt(a),c=bn.BigInt(c));var d=(r+a)/c;return"bigint"==typeof d&&d<Number.MAX_SAFE_INTEGER&&(d=Number(d)),d},yn=function(e){var t=tn(e,["moov","trak"]),n=[];return t.forEach(function(e){var t=tn(e,["mdia","hdlr"]),i=tn(e,["tkhd"]);t.forEach(function(e,t){var r,a,s,o=Jt(e.subarray(8,12)),u=i[t];"vide"===o&&(r=new DataView(u.buffer,u.byteOffset,u.byteLength),a=r.getUint8(0),s=0===a?r.getUint32(12):r.getUint32(20),n.push(s))})}),n},_n=function(e){var t=e[0],n=0===t?12:20;return Pn(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])},vn=function(e){var t=tn(e,["moov","trak"]),n=[];return t.forEach(function(e){var t,i,r={},a=tn(e,["tkhd"])[0];a&&(t=new DataView(a.buffer,a.byteOffset,a.byteLength),i=t.getUint8(0),r.id=0===i?t.getUint32(12):t.getUint32(20));var s=tn(e,["mdia","hdlr"])[0];if(s){var o=Jt(s.subarray(8,12));r.type="vide"===o?"video":"soun"===o?"audio":o}var u=tn(e,["mdia","minf","stbl","stsd"])[0];if(u){var l=u.subarray(8);r.codec=Jt(l.subarray(4,8));var c,d,h=tn(l,[r.codec])[0];h&&(/^[asm]vc[1-9]$/i.test(r.codec)?(c=h.subarray(78),d=Jt(c.subarray(4,8)),"avcC"===d&&c.length>11?(r.codec+=".",r.codec+=On(c[9]),r.codec+=On(c[10]),r.codec+=On(c[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)?(c=h.subarray(28),d=Jt(c.subarray(4,8)),"esds"===d&&c.length>20&&0!==c[19]?(r.codec+="."+On(c[19]),r.codec+="."+On(c[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"):r.codec=r.codec.toLowerCase())}var p=tn(e,["mdia","mdhd"])[0];p&&(r.timescale=_n(p)),n.push(r)}),n};var Dn={findBox:tn,parseType:Jt,timescale:fn,startTime:mn,compositionStartTime:gn,videoTrackIds:yn,tracks:vn,getTimescaleFromMediaHeader:_n},Rn=function(e){var t=31&e[1];return t<<=8,t|=e[2]},Mn=function(e){return!!(64&e[1])},Nn=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},Un=function(e,t){var n=Rn(e);return 0===n?"pat":n===t?"pmt":t?"pes":null},Bn=function(e){var t=Mn(e),n=4+Nn(e);return t&&(n+=e[n]+1),(31&e[n+10])<<8|e[n+11]},jn=function(e){var t={},n=Mn(e),i=4+Nn(e);if(n&&(i+=e[i]+1),1&e[i+5]){var r,a,s;r=(15&e[i+1])<<8|e[i+2],a=3+r-4,s=(15&e[i+10])<<8|e[i+11];for(var o=12+s;o<a;){var u=i+o;t[(31&e[u+1])<<8|e[u+2]]=e[u],o+=5+((15&e[u+3])<<8|e[u+4])}return t}},Fn=function(e,t){switch(t[Rn(e)]){case Ve.H264_STREAM_TYPE:return"video";case Ve.ADTS_STREAM_TYPE:return"audio";case Ve.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Hn=function(e){if(!Mn(e))return null;var t=4+Nn(e);if(t>=e.byteLength)return null;var n,i=null;return n=e[t+7],192&n&&(i={},i.pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,i.pts*=4,i.pts+=(6&e[t+13])>>>1,i.dts=i.pts,64&n&&(i.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,i.dts*=4,i.dts+=(6&e[t+18])>>>1)),i},qn=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}},Vn=function(e){for(var t,n=4+Nn(e),i=e.subarray(n),r=0,a=0,s=!1;a<i.byteLength-3;a++)if(1===i[a+2]){r=a+5;break}for(;r<i.byteLength;)switch(i[r]){case 0:if(0!==i[r-1]){r+=2;break}if(0!==i[r-2]){r++;break}a+3!==r-2&&"slice_layer_without_partitioning_rbsp_idr"===(t=qn(31&i[a+3]))&&(s=!0);do{r++}while(1!==i[r]&&r<i.length);a=r-2,r+=3;break;case 1:if(0!==i[r-1]||0!==i[r-2]){r+=3;break}t=qn(31&i[a+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(s=!0),a=r-2,r+=3;break;default:r+=3}return i=i.subarray(a),r-=a,a=0,i&&i.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===(t=qn(31&i[a+3]))&&(s=!0),s},Wn={parseType:Un,parsePat:Bn,parsePmt:jn,parsePayloadUnitStartIndicator:Mn,parsePesType:Fn,parsePesTime:Hn,videoPacketContainsKeyFrame:Vn},Gn=Xe.handleRollover,zn={};zn.ts=Wn,zn.aac=xt;var Xn=pe.ONE_SECOND_IN_TS,Yn=function(e,t){for(var n,i=0,r=188;r<e.byteLength;)if(71!==e[i]||71!==e[r])i++,r++;else{switch(n=e.subarray(i,r),zn.ts.parseType(n,t.pid)){case"pat":t.pid=zn.ts.parsePat(n);break;case"pmt":var a=zn.ts.parsePmt(n);t.table=t.table||{},Object.keys(a).forEach(function(e){t.table[e]=a[e]})}i+=188,r+=188}},Kn=function(e,t,n){for(var i,r,a,s,o=0,u=188,l=!1;u<=e.byteLength;)if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o++,u++;else{switch(i=e.subarray(o,u),zn.ts.parseType(i,t.pid)){case"pes":r=zn.ts.parsePesType(i,t.table),a=zn.ts.parsePayloadUnitStartIndicator(i),"audio"===r&&a&&(s=zn.ts.parsePesTime(i))&&(s.type="audio",n.audio.push(s),l=!0)}if(l)break;o+=188,u+=188}for(u=e.byteLength,o=u-188,l=!1;o>=0;)if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o--,u--;else{switch(i=e.subarray(o,u),zn.ts.parseType(i,t.pid)){case"pes":r=zn.ts.parsePesType(i,t.table),a=zn.ts.parsePayloadUnitStartIndicator(i),"audio"===r&&a&&(s=zn.ts.parsePesTime(i))&&(s.type="audio",n.audio.push(s),l=!0)}if(l)break;o-=188,u-=188}},Qn=function(e,t,n){for(var i,r,a,s,o,u,l,c=0,d=188,h=!1,p={data:[],size:0};d<e.byteLength;)if(71!==e[c]||71!==e[d])c++,d++;else{switch(i=e.subarray(c,d),zn.ts.parseType(i,t.pid)){case"pes":if(r=zn.ts.parsePesType(i,t.table),a=zn.ts.parsePayloadUnitStartIndicator(i),"video"===r&&(a&&!h&&(s=zn.ts.parsePesTime(i))&&(s.type="video",n.video.push(s),h=!0),!n.firstKeyFrame)){if(a&&0!==p.size){for(o=new Uint8Array(p.size),u=0;p.data.length;)l=p.data.shift(),o.set(l,u),u+=l.byteLength;if(zn.ts.videoPacketContainsKeyFrame(o)){var f=zn.ts.parsePesTime(o);f?(n.firstKeyFrame=f,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.")}p.size=0}p.data.push(i),p.size+=i.byteLength}}if(h&&n.firstKeyFrame)break;c+=188,d+=188}for(d=e.byteLength,c=d-188,h=!1;c>=0;)if(71!==e[c]||71!==e[d])c--,d--;else{switch(i=e.subarray(c,d),zn.ts.parseType(i,t.pid)){case"pes":r=zn.ts.parsePesType(i,t.table),a=zn.ts.parsePayloadUnitStartIndicator(i),"video"===r&&a&&(s=zn.ts.parsePesTime(i))&&(s.type="video",n.video.push(s),h=!0)}if(h)break;c-=188,d-=188}},$n=function(e,t){if(e.audio&&e.audio.length){var n=t;(void 0===n||isNaN(n))&&(n=e.audio[0].dts),e.audio.forEach(function(e){e.dts=Gn(e.dts,n),e.pts=Gn(e.pts,n),e.dtsTime=e.dts/Xn,e.ptsTime=e.pts/Xn})}if(e.video&&e.video.length){var i=t;if((void 0===i||isNaN(i))&&(i=e.video[0].dts),e.video.forEach(function(e){e.dts=Gn(e.dts,i),e.pts=Gn(e.pts,i),e.dtsTime=e.dts/Xn,e.ptsTime=e.pts/Xn}),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=Gn(r.dts,i),r.pts=Gn(r.pts,i),r.dtsTime=r.dts/Xn,r.ptsTime=r.pts/Xn}}},Jn=function(e){for(var t,n=!1,i=0,r=null,a=null,s=0,o=0;e.length-o>=3;){switch(zn.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){n=!0;break}if((s=zn.aac.parseId3TagSize(e,o))>e.length){n=!0;break}null===a&&(t=e.subarray(o,o+s),a=zn.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7){n=!0;break}if((s=zn.aac.parseAdtsSize(e,o))>e.length){n=!0;break}null===r&&(t=e.subarray(o,o+s),r=zn.aac.parseSampleRate(t)),i++,o+=s;break;default:o++}if(n)return null}if(null===r||null===a)return null;var u=Xn/r;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*i*u,pts:a+1024*i*u}]}},Zn=function(e){var t={pid:null,table:null},n={};Yn(e,t);for(var i in t.table)if(t.table.hasOwnProperty(i)){var r=t.table[i];switch(r){case Ve.H264_STREAM_TYPE:n.video=[],Qn(e,t,n),0===n.video.length&&delete n.video;break;case Ve.ADTS_STREAM_TYPE:n.audio=[],Kn(e,t,n),0===n.audio.length&&delete n.audio}}return n},ei=function(e,t){var n,i=zn.aac.isLikelyAacData(e);return(n=i?Jn(e):Zn(e))&&(n.audio||n.video)?($n(n,t),n):null},ti={inspect:ei,parseAudioPes_:Kn},ni=function(e,t){t.on("data",function(t){var n=t.initSegment;t.initSegment={data:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength};var i=t.data;t.data=i.buffer,e.postMessage({action:"data",segment:t,byteOffset:i.byteOffset,byteLength:i.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){var n={start:{decode:pe.videoTsToSeconds(t.start.dts),presentation:pe.videoTsToSeconds(t.start.pts)},end:{decode:pe.videoTsToSeconds(t.end.dts),presentation:pe.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:pe.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=pe.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:n})}),t.on("audioSegmentTimingInfo",function(t){var n={start:{decode:pe.videoTsToSeconds(t.start.dts),presentation:pe.videoTsToSeconds(t.start.pts)},end:{decode:pe.videoTsToSeconds(t.end.dts),presentation:pe.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:pe.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=pe.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:pe.videoTsToSeconds(t.start),end:pe.videoTsToSeconds(t.end)}})}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:pe.videoTsToSeconds(t.start),end:pe.videoTsToSeconds(t.end)}})}),t.on("log",function(t){e.postMessage({action:"log",log:t})})},ii=function(){function e(e,t){this.options=t||{},this.self=e,this.init()}var t=e.prototype;return t.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Xt.Transmuxer(this.options),ni(this.self,this.transmuxer)},t.pushMp4Captions=function(e){this.captionParser||(this.captionParser=new xn,this.captionParser.init());var 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])},t.probeMp4StartTime=function(e){var t=e.timescales,n=e.data,i=Dn.startTime(t,n);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:n},[n.buffer])},t.probeMp4Tracks=function(e){var t=e.data,n=Dn.tracks(t);this.self.postMessage({action:"probeMp4Tracks",tracks:n,data:t},[t.buffer])},t.probeTs=function(e){var t=e.data,n=e.baseStartTime,i="number"!=typeof n||isNaN(n)?void 0:n*pe.ONE_SECOND_IN_TS,r=ti.inspect(t,i),a=null;r&&(a={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1},a.hasVideo&&(a.videoStart=r.video[0].ptsTime),a.hasAudio&&(a.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:a,data:t},[t.buffer])},t.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},t.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},t.push=function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)},t.reset=function(){this.transmuxer.reset()},t.setTimestampOffset=function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(pe.secondsToVideoTs(t)))},t.setAudioAppendStart=function(e){this.transmuxer.setAudioAppendStart(Math.ceil(pe.secondsToVideoTs(e.appendStart)))},t.setRemux=function(e){this.transmuxer.setRemux(e.remux)},t.flush=function(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},t.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},t.alignGopsWith=function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())},e}();self.onmessage=function(e){if("init"===e.data.action&&e.data.options)return void(this.messageHandlers=new ii(self,e.data.options));this.messageHandlers||(this.messageHandlers=new ii(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data)}})),Et=_t(St),wt=function(e,t,n){var i=e.data.segment,r=i.type,a=i.initSegment,s=i.captions,o=i.captionStreams,u=i.metadata,l=i.videoFrameDtsTime,c=i.videoFramePtsTime;t.buffer.push({captions:s,captionStreams:o,metadata:u});var d=e.data.segment.boxes||{data:e.data.segment.data},h={type:r,data:new Uint8Array(d.data,d.data.byteOffset,d.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};void 0!==l&&(h.videoFrameDtsTime=l),void 0!==c&&(h.videoFramePtsTime=c),n(h)},kt=function(e){var t=e.transmuxedData,n=e.callback;t.buffer=[],n(t)},Ct=function(e,t){t.gopInfo=e.data.gopInfo},At=function(e){var t=e.transmuxer,n=e.bytes,i=e.audioAppendStart,r=e.gopsToAlignWith,a=e.remux,s=e.onData,o=e.onTrackInfo,u=e.onAudioTimingInfo,l=e.onVideoTimingInfo,c=e.onVideoSegmentTimingInfo,d=e.onAudioSegmentTimingInfo,h=e.onId3,p=e.onCaptions,f=e.onDone,m=e.onEndedTimeline,g=e.onTransmuxerLog,y=e.isEndOfTimeline,v={buffer:[]},_=y,b=function(n){t.currentTransmux===e&&("data"===n.data.action&&wt(n,v,s),"trackinfo"===n.data.action&&o(n.data.trackInfo),"gopInfo"===n.data.action&&Ct(n,v),"audioTimingInfo"===n.data.action&&u(n.data.audioTimingInfo),"videoTimingInfo"===n.data.action&&l(n.data.videoTimingInfo),"videoSegmentTimingInfo"===n.data.action&&c(n.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===n.data.action&&d(n.data.audioSegmentTimingInfo),"id3Frame"===n.data.action&&h([n.data.id3Frame],n.data.id3Frame.dispatchType),"caption"===n.data.action&&p(n.data.caption),"endedtimeline"===n.data.action&&(_=!1,m()),"log"===n.data.action&&g(n.data.log),"transmuxed"===n.data.type&&(_||(t.onmessage=null,kt({transmuxedData:v,callback:f}),It(t))))};if(t.onmessage=b,i&&t.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),void 0!==a&&t.postMessage({action:"setRemux",remux:a}),n.byteLength){var T=n instanceof ArrayBuffer?n:n.buffer,S=n instanceof ArrayBuffer?0:n.byteOffset;t.postMessage({action:"push",data:T,byteOffset:S,byteLength:n.byteLength},[T])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},It=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():At(e.currentTransmux))},xt=function(e,t){e.postMessage({action:t}),It(e)},Pt=function(e,t){if(!t.currentTransmux)return t.currentTransmux=e,void xt(t,e);t.transmuxQueue.push(xt.bind(null,t,e))},Ot=function(e){Pt("reset",e)},Lt=function(e){Pt("endTimeline",e)},Dt=function(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void At(e);e.transmuxer.transmuxQueue.push(e)},Rt=function(e){var t=new Et;t.currentTransmux=null,t.transmuxQueue=[];var n=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,n.call(t)},t.postMessage({action:"init",options:e}),t},Mt={reset:Ot,endTimeline:Lt,transmux:Dt,createTransmuxer:Rt},Nt=function(e){var t=e.transmuxer,n=e.endAction||e.action,i=e.callback,r=g()({},e,{endAction:null,transmuxer:null,callback:null}),a=function r(a){a.data.action===n&&(t.removeEventListener("message",r),a.data.data&&(a.data.data=new Uint8Array(a.data.data,e.byteOffset||0,e.byteLength||a.data.data.byteLength),e.data&&(e.data=a.data.data)),i(a.data))};if(t.addEventListener("message",a),e.data){var s=e.data instanceof ArrayBuffer;r.byteOffset=s?0:e.data.byteOffset,r.byteLength=e.data.byteLength;var o=[s?e.data:e.data.buffer];t.postMessage(r,o)}else t.postMessage(r)},Ut={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Bt=function(e){e.forEach(function(e){e.abort()})},jt=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}},Ft=function(e){var t=e.target,n=Date.now()-t.requestTime,i={bandwidth:1/0,bytesReceived:0,roundTripTime:n||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i},Ht=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Ut.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Ut.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Ut.FAILURE,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:Ut.FAILURE,xhr:t}:null},qt=function(e,t,n){return function(i,r){var a=r.response,s=Ht(i,r);if(s)return n(s,e);if(16!==a.byteLength)return n({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:Ut.FAILURE,xhr:r},e);for(var o=new DataView(a),u=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]),l=0;l<t.length;l++)t[l].bytes=u;return n(null,e)}},Vt=function(e,t){var n=Object(C.a)(e.map.bytes);if("mp4"!==n){var i=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:"Found unsupported "+(n||"unknown")+" container for initialization segment at URL: "+i,code:Ut.FAILURE})}Nt({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:function(n){var i=n.tracks,r=n.data;return e.map.bytes=r,i.forEach(function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||(e.map.tracks[t.type]=t,"number"==typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale))}),t(null)}})},Wt=function(e){var t=e.segment,n=e.finishProcessingFn;return function(e,i){var r=Ht(e,i);if(r)return n(r,t);var a=new Uint8Array(i.response);if(t.map.key)return t.map.encryptedBytes=a,n(null,t);t.map.bytes=a,Vt(t,function(e){if(e)return e.xhr=i,e.status=i.status,n(e,t);n(null,t)})}},Gt=function(e){var t=e.segment,n=e.finishProcessingFn,i=e.responseType;return function(e,r){var a=Ht(e,r);if(a)return n(a,t);var s="arraybuffer"!==i&&r.responseText?gt(r.responseText.substring(t.lastReachedChar||0)):r.response;return t.stats=jt(r),t.key?t.encryptedBytes=new Uint8Array(s):t.bytes=new Uint8Array(s),n(null,t)}},zt=function(e){var t=e.segment,n=e.bytes,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=t.map&&t.map.tracks||{},m=Boolean(f.audio&&f.video),g=r.bind(null,t,"audio","start"),y=r.bind(null,t,"audio","end"),v=r.bind(null,t,"video","start"),_=r.bind(null,t,"video","end"),b=function(){return Dt({bytes:n,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:m,onData:function(e){e.type="combined"===e.type?"video":e.type,d(t,e)},onTrackInfo:function(e){i&&(m&&(e.isMuxed=!0),i(t,e))},onAudioTimingInfo:function(e){g&&void 0!==e.start&&(g(e.start),g=null),y&&void 0!==e.end&&y(e.end)},onVideoTimingInfo:function(e){v&&void 0!==e.start&&(v(e.start),v=null),_&&void 0!==e.end&&_(e.end)},onVideoSegmentTimingInfo:function(e){a(e)},onAudioSegmentTimingInfo:function(e){s(e)},onId3:function(e,n){o(t,e,n)},onCaptions:function(e){u(t,[e])},isEndOfTimeline:l,onEndedTimeline:function(){c()},onTransmuxerLog:p,onDone:function(e){h&&(e.type="combined"===e.type?"video":e.type,h(null,t,e))}})};Nt({action:"probeTs",transmuxer:t.transmuxer,data:n,baseStartTime:t.baseStartTime,callback:function(e){t.bytes=n=e.data;var r=e.result;r&&(i(t,{hasAudio:r.hasAudio,hasVideo:r.hasVideo,isMuxed:m}),i=null,r.hasAudio&&!m&&g(r.audioStart),r.hasVideo&&v(r.videoStart),g=null,v=null),b()}})},Xt=function(e){var t=e.segment,n=e.bytes,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,m=new Uint8Array(n);if(Object(C.b)(m)){t.isFmp4=!0;var g=t.map.tracks,y={isFmp4:!0,hasVideo:!!g.video,hasAudio:!!g.audio};g.audio&&g.audio.codec&&"enca"!==g.audio.codec&&(y.audioCodec=g.audio.codec),g.video&&g.video.codec&&"encv"!==g.video.codec&&(y.videoCodec=g.video.codec),g.video&&g.audio&&(y.isMuxed=!0),i(t,y);var v=function(e){d(t,{data:m,type:y.hasAudio&&!y.isMuxed?"audio":"video"}),e&&e.length&&u(t,e),h(null,t,{})};return void Nt({action:"probeMp4StartTime",timescales:t.map.timescales,data:m,transmuxer:t.transmuxer,callback:function(e){var i=e.data,a=e.startTime;if(n=i.buffer,t.bytes=m=i,y.hasAudio&&!y.isMuxed&&r(t,"audio","start",a),y.hasVideo&&r(t,"video","start",a),!g.video||!i.byteLength||!t.transmuxer)return void v();Nt({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:m,timescales:t.map.timescales,trackIds:[g.video.id],callback:function(e){n=e.data.buffer,t.bytes=m=e.data,e.logs.forEach(function(e){p(f.a.mergeOptions(e,{stream:"mp4CaptionParser"}))}),v(e.captions)}})}})}return t.transmuxer?(void 0===t.container&&(t.container=Object(C.a)(m)),"ts"!==t.container&&"aac"!==t.container?(i(t,{hasAudio:!1,hasVideo:!1}),void h(null,t,{})):void zt({segment:t,bytes:n,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})):void h(null,t,{})},Yt=function(e,t){var n=e.id,i=e.key,r=e.encryptedBytes,a=e.decryptionWorker,s=function e(i){if(i.data.source===n){a.removeEventListener("message",e);var r=i.data.decrypted;t(new Uint8Array(r.bytes,r.byteOffset,r.byteLength))}};a.addEventListener("message",s);var o;o=i.bytes.slice?i.bytes.slice():new Uint32Array(Array.prototype.slice.call(i.bytes)),a.postMessage(Ve({source:n,encrypted:r,key:o,iv:i.iv}),[r.buffer,o.buffer])},Kt=function(e){var t=e.decryptionWorker,n=e.segment,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog;Yt({id:n.requestId,key:n.key,encryptedBytes:n.encryptedBytes,decryptionWorker:t},function(e){n.bytes=e,Xt({segment:n,bytes:n.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})})},Qt=function(e){var t=e.activeXhrs,n=e.decryptionWorker,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=0,m=!1;return function(e,g){if(!m){if(e)return m=!0,Bt(t),h(e,g);if((f+=1)===t.length){var y=function(){if(g.encryptedBytes)return Kt({decryptionWorker:n,segment:g,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p});Xt({segment:g,bytes:g.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})};if(g.endOfAllRequests=Date.now(),g.map&&g.map.encryptedBytes&&!g.map.bytes)return Yt({decryptionWorker:n,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key},function(e){g.map.bytes=e,Vt(g,function(e){if(e)return Bt(t),h(e,g);y()})});y()}}}},$t=function(e){var t=e.loadendState,n=e.abortFn;return function(e){e.target.aborted&&n&&!t.calledAbortFn&&(n(),t.calledAbortFn=!0)}},Jt=function(e){var t=e.segment,n=e.progressFn;return e.trackInfoFn,e.timingInfoFn,e.videoSegmentTimingInfoFn,e.audioSegmentTimingInfoFn,e.id3Fn,e.captionsFn,e.isEndOfTimeline,e.endedTimelineFn,e.dataFn,function(e){if(!e.target.aborted)return t.stats=f.a.mergeOptions(t.stats,Ft(e)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),n(e,t)}},Zt=function(e){var t=e.xhr,n=e.xhrOptions,i=e.decryptionWorker,r=e.segment,a=e.abortFn,s=e.progressFn,o=e.trackInfoFn,u=e.timingInfoFn,l=e.videoSegmentTimingInfoFn,c=e.audioSegmentTimingInfoFn,d=e.id3Fn,h=e.captionsFn,p=e.isEndOfTimeline,m=e.endedTimelineFn,g=e.dataFn,y=e.doneFn,v=e.onTransmuxerLog,_=[],b=Qt({activeXhrs:_,decryptionWorker:i,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:d,captionsFn:h,isEndOfTimeline:p,endedTimelineFn:m,dataFn:g,doneFn:y,onTransmuxerLog:v});if(r.key&&!r.key.bytes){var T=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&T.push(r.map.key);var S=f.a.mergeOptions(n,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),E=qt(r,T,b),w=t(S,E);_.push(w)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){var k=f.a.mergeOptions(n,{uri:r.map.key.resolvedUri,responseType:"arraybuffer"}),C=qt(r,[r.map.key],b),A=t(k,C);_.push(A)}var I=f.a.mergeOptions(n,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:je(r.map)}),x=Wt({segment:r,finishProcessingFn:b}),P=t(I,x);_.push(P)}var O=f.a.mergeOptions(n,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:je(r)}),L=Gt({segment:r,finishProcessingFn:b,responseType:O.responseType}),D=t(O,L);D.addEventListener("progress",Jt({segment:r,progressFn:s,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:d,captionsFn:h,isEndOfTimeline:p,endedTimelineFn:m,dataFn:g})),_.push(D);var R={};return _.forEach(function(e){e.addEventListener("loadend",$t({loadendState:R,abortFn:a}))}),function(){return Bt(_)}},en=P("CodecUtils"),tn=function(e){var t=e.attributes||{};if(t.CODECS)return Object(v.h)(t.CODECS)},nn=function(e,t){var n=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&n.AUDIO&&e.mediaGroups.AUDIO[n.AUDIO]},rn=function(e,t){if(!nn(e,t))return!0;var n=t.attributes||{},i=e.mediaGroups.AUDIO[n.AUDIO];for(var r in i)if(!i[r].uri&&!i[r].playlists)return!0;return!1},an=function(e){var t={};return e.forEach(function(e){var n=e.mediaType,i=e.type,r=e.details;t[n]=t[n]||[],t[n].push(Object(v.i)(""+i+r))}),Object.keys(t).forEach(function(e){if(t[e].length>1)return en("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."),void(t[e]=null);t[e]=t[e][0]}),t},sn=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},on=function(e,t){var n=t.attributes||{},i=an(tn(t)||[]);if(nn(e,t)&&!i.audio&&!rn(e,t)){var r=an(Object(v.d)(e,n.AUDIO)||[]);r.audio&&(i.audio=r.audio)}return i},un=P("PlaylistSelector"),ln=function(e){if(e&&e.playlist){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}},cn=function(e,t){if(!e)return"";var n=d.a.getComputedStyle(e);return n?n[t]:""},dn=function(e,t){var n=e.slice();e.sort(function(e,i){var r=t(e,i);return 0===r?n.indexOf(e)-n.indexOf(i):r})},hn=function(e,t){var n,i;return e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||d.a.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(i=t.attributes.BANDWIDTH),i=i||d.a.Number.MAX_VALUE,n-i},pn=function(e,t){var n,i;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||d.a.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(i=t.attributes.RESOLUTION.width),i=i||d.a.Number.MAX_VALUE,n===i&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:n-i},fn=function(e,t,n,i,r,a){if(e){var s={bandwidth:t,width:n,height:i,limitRenditionByPlayerDimensions:r},o=e.playlists;pe.isAudioOnly(e)&&(o=a.getAudioTrackPlaylists_(),s.audioOnly=!0);var u=o.map(function(e){var t,n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t=t||d.a.Number.MAX_VALUE,{bandwidth:t,width:n,height:i,playlist:e}});dn(u,function(e,t){return e.bandwidth-t.bandwidth}),u=u.filter(function(e){return!pe.isIncompatible(e.playlist)});var l=u.filter(function(e){return pe.isEnabled(e.playlist)});l.length||(l=u.filter(function(e){return!pe.isDisabled(e.playlist)}));var c=l.filter(function(e){return e.bandwidth*mt.BANDWIDTH_VARIANCE<t}),h=c[c.length-1],p=c.filter(function(e){return e.bandwidth===h.bandwidth})[0];if(!1===r){var f=p||l[0]||u[0];if(f&&f.playlist){var m="sortedPlaylistReps";return p&&(m="bandwidthBestRep"),l[0]&&(m="enabledPlaylistReps"),un("choosing "+ln(f)+" using "+m+" with options",s),f.playlist}return un("could not choose a playlist with options",s),null}var g=c.filter(function(e){return e.width&&e.height});dn(g,function(e,t){return e.width-t.width});var y=g.filter(function(e){return e.width===n&&e.height===i});h=y[y.length-1];var v,_,b,T=y.filter(function(e){return e.bandwidth===h.bandwidth})[0];T||(v=g.filter(function(e){return e.width>n||e.height>i}),_=v.filter(function(e){return e.width===v[0].width&&e.height===v[0].height}),h=_[_.length-1],b=_.filter(function(e){return e.bandwidth===h.bandwidth})[0]);var S;if(a.experimentalLeastPixelDiffSelector){var E=g.map(function(e){return e.pixelDiff=Math.abs(e.width-n)+Math.abs(e.height-i),e});dn(E,function(e,t){return e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff}),S=E[0]}var w=S||b||T||p||l[0]||u[0];if(w&&w.playlist){var k="sortedPlaylistReps";return S?k="leastPixelDiffRep":b?k="resolutionPlusOneRep":T?k="resolutionBestRep":p?k="bandwidthBestRep":l[0]&&(k="enabledPlaylistReps"),un("choosing "+ln(w)+" using "+k+" with options",s),w.playlist}return un("could not choose a playlist with options",s),null}},mn=function(){var e=this.useDevicePixelRatio?d.a.devicePixelRatio||1:1;return fn(this.playlists.master,this.systemBandwidth,parseInt(cn(this.tech_.el(),"width"),10)*e,parseInt(cn(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},gn=function(e){var t=-1,n=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var i=this.useDevicePixelRatio?d.a.devicePixelRatio||1:1;return t<0&&(t=this.systemBandwidth,n=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==n&&(t=e*this.systemBandwidth+(1-e)*t,n=this.systemBandwidth),fn(this.playlists.master,t,parseInt(cn(this.tech_.el(),"width"),10)*i,parseInt(cn(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},yn=function(e){var t=e.master,n=e.currentTime,i=e.bandwidth,r=e.duration,a=e.segmentDuration,s=e.timeUntilRebuffer,o=e.currentTimeline,u=e.syncController,l=t.playlists.filter(function(e){return!pe.isIncompatible(e)}),c=l.filter(pe.isEnabled);c.length||(c=l.filter(function(e){return!pe.isDisabled(e)}));var d=c.filter(pe.hasAttribute.bind(null,"BANDWIDTH")),h=d.map(function(e){var t=u.getSyncPoint(e,r,o,n),l=t?1:2;return{playlist:e,rebufferingImpact:pe.estimateSegmentRequestTime(a,i,e)*l-s}}),p=h.filter(function(e){return e.rebufferingImpact<=0});return dn(p,function(e,t){return hn(t.playlist,e.playlist)}),p.length?p[0]:(dn(h,function(e,t){return e.rebufferingImpact-t.rebufferingImpact}),h[0]||null)},vn=function(){var e=this,t=this.playlists.master.playlists.filter(pe.isEnabled);return dn(t,function(e,t){return hn(e,t)}),t.filter(function(t){return!!on(e.playlists.master,t).video})[0]||null},_n=function(e){var t,n=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach(function(e){t.set(e,n),n+=e.byteLength})),t},bn=function(e,t,n){if(!e[n]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var i=n;/^cc708_/.test(n)&&(i="SERVICE"+n.split("_")[1]);var r=t.textTracks().getTrackById(i);if(r)e[n]=r;else{var a=t.options_.vhs&&t.options_.vhs.captionServices||{},s=n,o=n,u=!1,l=a[i];l&&(s=l.label,o=l.language,u=l.default),e[n]=t.addRemoteTextTrack({kind:"captions",id:i,default:u,label:s,language:o},!1).track}}},Tn=function(e){var t=e.inbandTextTracks,n=e.captionArray,i=e.timestampOffset;if(n){var r=d.a.WebKitDataCue||d.a.VTTCue;n.forEach(function(e){var n=e.stream;t[n].addCue(new r(e.startTime+i,e.endTime+i,e.text))})}},Sn=function(e){Object.defineProperties(e.frame,{id:{get:function(){return f.a.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return f.a.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return f.a.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},En=function(e){var t=e.inbandTextTracks,n=e.metadataArray,i=e.timestampOffset,r=e.videoDuration;if(n){var a=d.a.WebKitDataCue||d.a.VTTCue,s=t.metadataTrack_;if(s&&(n.forEach(function(e){var t=e.cueTime+i;!("number"!=typeof t||d.a.isNaN(t)||t<0)&&t<1/0&&e.frames.forEach(function(e){var n=new a(t,t,e.value||e.url||e.data||"");n.frame=e,n.value=e,Sn(n),s.addCue(n)})}),s.cues&&s.cues.length)){for(var o=s.cues,u=[],l=0;l<o.length;l++)o[l]&&u.push(o[l]);var c=u.reduce(function(e,t){var n=e[t.startTime]||[];return n.push(t),e[t.startTime]=n,e},{}),h=Object.keys(c).sort(function(e,t){return Number(e)-Number(t)});h.forEach(function(e,t){var n=c[e],i=Number(h[t+1])||r;n.forEach(function(e){e.endTime=i})})}}},wn=function(e,t,n){e.metadataTrack_||(e.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)},kn=function(e,t,n){var i,r;if(n&&n.cues)for(i=n.cues.length;i--;)r=n.cues[i],r.startTime>=e&&r.endTime<=t&&n.removeCue(r)},Cn=function(e){var t=e.cues;if(t)for(var n=0;n<t.length;n++){for(var i=[],r=0,a=0;a<t.length;a++)t[n].startTime===t[a].startTime&&t[n].endTime===t[a].endTime&&t[n].text===t[a].text&&++r>1&&i.push(t[a]);i.length&&i.forEach(function(t){return e.removeCue(t)})}},An=function(e,t,n){if(void 0===t||null===t||!e.length)return[];var i,r=Math.ceil((t-n+3)*A.ONE_SECOND_IN_TS);for(i=0;i<e.length&&!(e[i].pts>r);i++);return e.slice(i)},In=function(e,t,n){if(!t.length)return e;if(n)return t.slice();var i=t[0].pts,r=0;for(r;r<e.length&&!(e[r].pts>=i);r++);return e.slice(0,r).concat(t)},xn=function(e,t,n,i){for(var r=Math.ceil((t-i)*A.ONE_SECOND_IN_TS),a=Math.ceil((n-i)*A.ONE_SECOND_IN_TS),s=e.slice(),o=e.length;o--&&!(e[o].pts<=a););if(-1===o)return s;for(var u=o+1;u--&&!(e[u].pts<=r););return u=Math.max(u,0),s.splice(u,o-u+1),s},Pn=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;var n=Object.keys(e).sort(),i=Object.keys(t).sort();if(n.length!==i.length)return!1;for(var r=0;r<n.length;r++){var a=n[r];if(a!==i[r])return!1;if(e[a]!==t[a])return!1}return!0},On=function(e,t,n){t=t||[];for(var i=[],r=0,a=0;a<t.length;a++){var s=t[a];if(e===s.timeline&&(i.push(a),(r+=s.duration)>n))return a}return 0===i.length?0:i[i.length-1]},Ln=function(e){return"number"==typeof e&&isFinite(e)},Dn=function(e,t,n){return"main"===e&&t&&n?n.hasAudio||n.hasVideo?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:"Neither audio nor video found in segment.":null},Rn=function(e,t,n){var i=t-mt.BACK_BUFFER_LENGTH;e.length&&(i=Math.max(i,e.start(0)));var r=t-n;return Math.min(r,i)},Mn=function(e){var t=e.startOfSegment,n=e.duration,i=e.segment,r=e.part,a=e.playlist,s=a.mediaSequence,o=a.id,u=a.segments,l=void 0===u?[]:u,c=e.mediaIndex,d=e.partIndex,h=e.timeline,p=l.length-1,f="mediaIndex/partIndex increment";e.getMediaInfoForTime?f="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(f="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(f+=" with independent "+e.independent);var m="number"==typeof d,g=e.segment.uri?"segment":"pre-segment",y=m?z({preloadSegment:i})-1:0;return g+" ["+(s+c)+"/"+(s+p)+"]"+(m?" part ["+d+"/"+y+"]":"")+" segment start/end ["+i.start+" => "+i.end+"]"+(m?" part start/end ["+r.start+" => "+r.end+"]":"")+" startOfSegment ["+t+"] duration ["+n+"] timeline ["+h+"] selected by ["+f+"] playlist ["+o+"]"},Nn=function(e){return e+"TimingInfo"},Un=function(e){var t=e.segmentTimeline,n=e.currentTimeline,i=e.startOfSegment,r=e.buffered;return e.overrideCheck||t!==n?t<n?i:r.length?r.end(r.length-1):i:null},Bn=function(e){var t=e.timelineChangeController,n=e.currentTimeline,i=e.segmentTimeline,r=e.loaderType,a=e.audioDisabled;if(n===i)return!1;if("audio"===r){var s=t.lastTimelineChange({type:"main"});return!s||s.to!==i}if("main"===r&&a){var o=t.pendingTimelineChange({type:"audio"});return!o||o.to!==i}return!1},jn=function(e){var t=0;return["video","audio"].forEach(function(n){var i=e[n+"TimingInfo"];if(i){var r,a=i.start,s=i.end;"bigint"==typeof a||"bigint"==typeof s?r=d.a.BigInt(s)-d.a.BigInt(a):"number"==typeof a&&"number"==typeof s&&(r=s-a),void 0!==r&&r>t&&(t=r)}}),"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t},Fn=function(e){var t=e.segmentDuration,n=e.maxDuration;return!!t&&Math.round(t)>n+1/30},Hn=function(e,t){if("hls"!==t)return null;var n=jn({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!n)return null;var i=e.playlist.targetDuration,r=Fn({segmentDuration:n,maxDuration:2*i}),a=Fn({segmentDuration:n,maxDuration:i}),s="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 "+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||a?{severity:r?"warn":"info",message:s}:null},qn=function(e){function t(t,n){var i;if(i=e.call(this)||this,!t)throw new TypeError("Initialization settings are required");if("function"!=typeof t.currentTime)throw new TypeError("No currentTime getter specified");if(!t.mediaSource)throw new TypeError("No MediaSource specified");return i.bandwidth=t.bandwidth,i.throughput={rate:0,count:0},i.roundTrip=NaN,i.resetStats_(),i.mediaIndex=null,i.partIndex=null,i.hasPlayed_=t.hasPlayed,i.currentTime_=t.currentTime,i.seekable_=t.seekable,i.seeking_=t.seeking,i.duration_=t.duration,i.mediaSource_=t.mediaSource,i.vhs_=t.vhs,i.loaderType_=t.loaderType,i.currentMediaInfo_=void 0,i.startingMediaInfo_=void 0,i.segmentMetadataTrack_=t.segmentMetadataTrack,i.goalBufferLength_=t.goalBufferLength,i.sourceType_=t.sourceType,i.sourceUpdater_=t.sourceUpdater,i.inbandTextTracks_=t.inbandTextTracks,i.state_="INIT",i.timelineChangeController_=t.timelineChangeController,i.shouldSaveSegmentTimingInfo_=!0,i.parse708captions_=t.parse708captions,i.useDtsForTimestampOffset_=t.useDtsForTimestampOffset,i.captionServices_=t.captionServices,i.experimentalExactManifestTimings=t.experimentalExactManifestTimings,i.checkBufferTimeout_=null,i.error_=void 0,i.currentTimeline_=-1,i.pendingSegment_=null,i.xhrOptions_=null,i.pendingSegments_=[],i.audioDisabled_=!1,i.isPendingTimestampOffset_=!1,i.gopBuffer_=[],i.timeMapping_=0,i.safeAppend_=f.a.browser.IE_VERSION>=11,i.appendInitSegment_={audio:!0,video:!0},i.playlistOfLastInitSegment_={audio:null,video:null},i.callQueue_=[],i.loadQueue_=[],i.metadataQueue_={id3:[],caption:[]},i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=null,i.activeInitSegmentId_=null,i.initSegments_={},i.cacheEncryptionKeys_=t.cacheEncryptionKeys,i.keyCache_={},i.decrypter_=t.decrypter,i.syncController_=t.syncController,i.syncPoint_={segmentIndex:0,time:0},i.transmuxer_=i.createTransmuxer_(),i.triggerSyncInfoUpdate_=function(){return i.trigger("syncinfoupdate")},i.syncController_.on("syncinfoupdate",i.triggerSyncInfoUpdate_),i.mediaSource_.addEventListener("sourceopen",function(){i.isEndOfStream_()||(i.ended_=!1)}),i.fetchAtBuffer_=!1,i.logger_=P("SegmentLoader["+i.loaderType_+"]"),Object.defineProperty(a()(i),"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"))}}),i.sourceUpdater_.on("ready",function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),"main"===i.loaderType_&&i.timelineChangeController_.on("pendingtimelinechange",function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),"audio"===i.loaderType_&&i.timelineChangeController_.on("timelinechange",function(){i.hasEnoughInfoToLoad_()&&i.processLoadQueue_(),i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),i}o()(t,e);var n=t.prototype;return n.createTransmuxer_=function(){return Mt.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},n.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},n.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&d.a.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},n.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},n.abort=function(){if("WAITING"!==this.state)return void(this.pendingSegment_&&(this.pendingSegment_=null));this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()},n.abort_=function(){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,d.a.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},n.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},n.error=function(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},n.endOfStream=function(){this.ended_=!0,this.transmuxer_&&Mt.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},n.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return f.a.createTimeRanges();if("main"===this.loaderType_){var t=e.hasAudio,n=e.hasVideo,i=e.isMuxed;if(n&&t&&!this.audioDisabled_&&!i)return this.sourceUpdater_.buffered();if(n)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},n.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var n=We(e),i=this.initSegments_[n];return t&&!i&&e.bytes&&(this.initSegments_[n]=i={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),i||e},n.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var n=Ge(e),i=this.keyCache_[n];this.cacheEncryptionKeys_&&t&&!i&&e.bytes&&(this.keyCache_[n]=i={resolvedUri:e.resolvedUri,bytes:e.bytes});var r={resolvedUri:(i||e).resolvedUri};return i&&(r.bytes=i.bytes),r},n.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},n.load=function(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))},n.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},n.playlist=function(e,t){if(void 0===t&&(t={}),e){var n=this.playlist_,i=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var r=null;if(n&&(n.id?r=n.id:n.uri&&(r=n.uri)),this.logger_("playlist update ["+r+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!n||n.uri!==e.uri)return null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var a=e.mediaSequence-n.mediaSequence;if(this.logger_("live window shift ["+a+"]"),null!==this.mediaIndex)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var s=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!s.parts||!s.parts.length||!s.parts[this.partIndex])){var o=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=o}}i&&(i.mediaIndex-=a,i.mediaIndex<0?(i.mediaIndex=null,i.partIndex=null):(i.mediaIndex>=0&&(i.segment=e.segments[i.mediaIndex]),i.partIndex>=0&&i.segment.parts&&(i.part=i.segment.parts[i.partIndex]))),this.syncController_.saveExpiredSegmentInfo(n,e)}},n.pause=function(){this.checkBufferTimeout_&&(d.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},n.paused=function(){return null===this.checkBufferTimeout_},n.resetEverything=function(e){this.ended_=!1,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"}))},n.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},n.resyncLoader=function(){this.transmuxer_&&Mt.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},n.remove=function(e,t,n,i){if(void 0===n&&(n=function(){}),void 0===i&&(i=!1),t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");var r=1,a=function(){0===--r&&n()};!i&&this.audioDisabled_||(r++,this.sourceUpdater_.removeAudio(e,t,a)),(i||"main"===this.loaderType_)&&(this.gopBuffer_=xn(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,a));for(var s in this.inbandTextTracks_)kn(e,t,this.inbandTextTracks_[s]);kn(e,t,this.segmentMetadataTrack_),a()},n.monitorBuffer_=function(){this.checkBufferTimeout_&&d.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=d.a.setTimeout(this.monitorBufferTick_.bind(this),1)},n.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&d.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=d.a.setTimeout(this.monitorBufferTick_.bind(this),500)},n.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},n.isEndOfStream_=function(e,t,n){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===n&&(n=this.partIndex),!t||!this.mediaSource_)return!1;var i="number"==typeof e&&t.segments[e],r=e+1===t.segments.length,a=!i||!i.parts||n+1===i.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&a},n.chooseNextRequest_=function(){var e=this.buffered_(),t=F(e)||0,n=H(e,this.currentTime_()),i=!this.hasPlayed_()&&n>=1,r=n>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||i||r)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var s={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(s.isSyncRequest)s.mediaIndex=On(this.currentTimeline_,a,t);else if(null!==this.mediaIndex){var o=a[this.mediaIndex],u="number"==typeof this.partIndex?this.partIndex:-1;s.startOfSegment=o.end?o.end:t,o.parts&&o.parts[u+1]?(s.mediaIndex=this.mediaIndex,s.partIndex=u+1):s.mediaIndex=this.mediaIndex+1}else{var l=pe.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),c=l.segmentIndex,d=l.startTime,h=l.partIndex;s.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+t:"currentTime "+this.currentTime_(),s.mediaIndex=c,s.startOfSegment=d,s.partIndex=h}var p=a[s.mediaIndex],f=p&&"number"==typeof s.partIndex&&p.parts&&p.parts[s.partIndex];if(!p||"number"==typeof s.partIndex&&!f)return null;if("number"!=typeof s.partIndex&&p.parts&&(s.partIndex=0,f=p.parts[0]),!n&&f&&!f.independent)if(0===s.partIndex){var m=a[s.mediaIndex-1],g=m.parts&&m.parts.length&&m.parts[m.parts.length-1];g&&g.independent&&(s.mediaIndex-=1,s.partIndex=m.parts.length-1,s.independent="previous segment")}else p.parts[s.partIndex-1].independent&&(s.partIndex-=1,s.independent="previous part");var y=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return s.mediaIndex>=a.length-1&&y&&!this.seeking_()?null:this.generateSegmentInfo_(s)},n.generateSegmentInfo_=function(e){var t=e.independent,n=e.playlist,i=e.mediaIndex,r=e.startOfSegment,a=e.isSyncRequest,s=e.partIndex,o=e.forceTimestampOffset,u=e.getMediaInfoForTime,l=n.segments[i],c="number"==typeof s&&l.parts[s],d={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||l.resolvedUri,mediaIndex:i,partIndex:c?s:null,isSyncRequest:a,startOfSegment:r,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:c&&c.duration||l.duration,segment:l,part:c,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:u,independent:t},h=void 0!==o?o:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:r,buffered:this.buffered_(),overrideCheck:h});var p=F(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(d.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=An(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d},n.timestampOffsetForSegment_=function(e){return Un(e)},n.earlyAbortWhenNeeded_=function(e){if(!this.vhs_.tech_.paused()&&this.xhrOptions_.timeout&&this.playlist_.attributes.BANDWIDTH&&!(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var t=this.currentTime_(),n=e.bandwidth,i=this.pendingSegment_.duration,r=pe.estimateSegmentRequestTime(i,n,this.playlist_,e.bytesReceived),a=U(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(!(r<=a)){var s=yn({master:this.vhs_.playlists.master,currentTime:t,bandwidth:n,duration:this.duration_(),segmentDuration:i,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(s){var o=r-a,u=o-s.rebufferingImpact,l=.5;a<=1/30&&(l=1),!s.playlist||s.playlist.uri===this.playlist_.uri||u<l||(this.bandwidth=s.playlist.attributes.BANDWIDTH*mt.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},n.handleAbort_=function(e){this.logger_("Aborting "+Mn(e)),this.mediaRequestsAborted+=1},n.handleProgress_=function(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")},n.handleTrackInfo_=function(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},Pn(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_()))},n.handleTimingInfo_=function(e,t,n,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var r=this.pendingSegment_,a=Nn(t);r[a]=r[a]||{},r[a][n]=i,this.logger_("timinginfo: "+t+" - "+n+" - "+i),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},n.handleCaptions_=function(e,t){var n=this;if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(0===t.length)return void this.logger_("SegmentLoader received no captions from a caption event");if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));var i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),r={};t.forEach(function(e){r[e.stream]=r[e.stream]||{startTime:1/0,captions:[],endTime:0};var t=r[e.stream];t.startTime=Math.min(t.startTime,e.startTime+i),t.endTime=Math.max(t.endTime,e.endTime+i),t.captions.push(e)}),Object.keys(r).forEach(function(e){var t=r[e],a=t.startTime,s=t.endTime,o=t.captions,u=n.inbandTextTracks_;n.logger_("adding cues from "+a+" -> "+s+" for "+e),bn(u,n.vhs_.tech_,e),kn(a,s,u[e]),Tn({captionArray:o,inbandTextTracks:u,timestampOffset:i})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},n.handleId3_=function(e,t,n){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,n));var i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();wn(this.inbandTextTracks_,n,this.vhs_.tech_),En({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:i,videoDuration:this.duration_()})}},n.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(e){return e()}),this.metadataQueue_.caption.forEach(function(e){return e()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},n.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach(function(e){return e()})},n.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach(function(e){return e()})},n.hasEnoughInfoToLoad_=function(){if("audio"!==this.loaderType_)return!0;var e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!Bn({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.getCurrentMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},n.getMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},n.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;var n=t.hasAudio,i=t.hasVideo,r=t.isMuxed;return!(i&&!e.videoTimingInfo)&&(!(n&&!this.audioDisabled_&&!r&&!e.audioTimingInfo)&&!Bn({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.handleData_=function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return void this.callQueue_.push(this.handleData_.bind(this,e,t));var n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.part||n.segment),"closed"!==this.mediaSource_.readyState){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[Nn(t.type)].start;else{var i,r=this.getCurrentMediaInfo_(),a="main"===this.loaderType_&&r&&r.hasVideo;a&&(i=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:a,firstVideoFrameTimeForData:i,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:"main"===this.loaderType_});var s=this.chooseNextRequest_();if(s.mediaIndex!==n.mediaIndex||s.partIndex!==n.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,t)}}},n.updateAppendInitSegmentStatus=function(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)},n.getInitSegmentAndUpdateState_=function(e){var t=e.type,n=e.initSegment,i=e.map,r=e.playlist;if(i){var a=We(i);if(this.activeInitSegmentId_===a)return null;n=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=a}return n&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=r,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,n):null},n.handleQuotaExceededError_=function(e,t){var n=this,i=e.segmentInfo,r=e.type,a=e.bytes,s=this.sourceUpdater_.audioBuffered(),o=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+B(s).join(", ")),o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+B(o).join(", "));var u=s.length?s.start(0):0,l=s.length?s.end(s.length-1):0,c=o.length?o.start(0):0,h=o.length?o.end(o.length-1):0;if(l-u<=1&&h-c<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+a.byteLength+", audio buffer: "+B(s).join(", ")+", video buffer: "+B(o).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:i,type:r,bytes:a}));var p=this.currentTime_(),f=p-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+f),this.remove(0,f,function(){n.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=d.a.setTimeout(function(){n.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),n.quotaExceededErrorRetryTimeout_=null,n.processCallQueue_()},1e3)},!0)},n.handleAppendError_=function(e,t){var n=e.segmentInfo,i=e.type,r=e.bytes;if(t){if(22===t.code)return void this.handleQuotaExceededError_({segmentInfo:n,type:i,bytes:r});this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(i+" append of "+r.length+"b failed for segment #"+n.mediaIndex+" in playlist "+n.playlist.id),this.trigger("appenderror")}},n.appendToSourceBuffer_=function(e){var t=e.segmentInfo,n=e.type,i=e.initSegment,r=e.data,a=e.bytes;if(!a){var s=[r],o=r.byteLength;i&&(s.unshift(i),o+=i.byteLength),a=_n({bytes:o,segments:s})}this.sourceUpdater_.appendBuffer({segmentInfo:t,type:n,bytes:a},this.handleAppendError_.bind(this,{segmentInfo:t,type:n,bytes:a}))},n.handleSegmentTimingInfo_=function(e,t,n){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var i=this.pendingSegment_.segment,r=e+"TimingInfo";i[r]||(i[r]={}),i[r].transmuxerPrependedSeconds=n.prependedContentDuration||0,i[r].transmuxedPresentationStart=n.start.presentation,i[r].transmuxedDecodeStart=n.start.decode,i[r].transmuxedPresentationEnd=n.end.presentation,i[r].transmuxedDecodeEnd=n.end.decode,i[r].baseMediaDecodeTime=n.baseMediaDecodeTime}},n.appendData_=function(e,t){var n=t.type,i=t.data;if(i&&i.byteLength&&("audio"!==n||!this.audioDisabled_)){var r=this.getInitSegmentAndUpdateState_({type:n,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:r,data:i})}},n.loadSegment_=function(e){var t=this;if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_())return void this.loadQueue_.push(function(){var n=g()({},e,{forceTimestampOffset:!0});g()(e,t.generateSegmentInfo_(n)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e)});this.updateTransmuxerAndRequestSegment_(e)},n.updateTransmuxerAndRequestSegment_=function(e){var t=this;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}));var n=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,a=e.timeline!==this.currentTimeline_&&e.timeline>0,s=i||r&&a;this.logger_("Requesting "+Mn(e)),n.map&&!n.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Zt({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:n,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:s,endedTimelineFn:function(){t.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(n){var i=n.message,r=n.level,a=n.stream;t.logger_(Mn(e)+" logged from transmuxer stream "+a+" as a "+r+": "+i)}})},n.trimBackBuffer_=function(e){var t=Rn(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)},n.createSimplifiedSegmentObj_=function(e){var t=e.segment,n=e.part,i={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},r=e.playlist.segments[e.mediaIndex-1];if(r&&r.timeline===t.timeline&&(r.videoTimingInfo?i.baseStartTime=r.videoTimingInfo.transmuxedDecodeEnd:r.audioTimingInfo&&(i.baseStartTime=r.audioTimingInfo.transmuxedDecodeEnd)),t.key){var a=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);i.key=this.segmentKey(t.key),i.key.iv=a}return t.map&&(i.map=this.initSegmentForMap(t.map)),i},n.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},n.saveBandwidthRelatedStats_=function(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<1/60)return void this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+1/60);this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime},n.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate")},n.segmentRequestFinished_=function(e,t,n){if(this.callQueue_.length)return void this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,n));if(this.saveTransferStats_(t.stats),this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId){if(e){if(this.pendingSegment_=null,this.state="READY",e.code===Ut.ABORTED)return;return this.pause(),e.code===Ut.TIMEOUT?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}var i=this.pendingSegment_;this.saveBandwidthRelatedStats_(i.duration,t.stats),i.endOfAllRequests=t.endOfAllRequests,n.gopInfo&&(this.gopBuffer_=In(this.gopBuffer_,n.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(i)}},n.setTimeMapping_=function(e){var t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)},n.updateMediaSecondsLoaded_=function(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},n.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},n.trueSegmentStart_=function(e){var t=e.currentStart,n=e.playlist,i=e.mediaIndex,r=e.firstVideoFrameTimeForData,a=e.currentVideoTimestampOffset,s=e.useVideoTimingInfo,o=e.videoTimingInfo,u=e.audioTimingInfo;if(void 0!==t)return t;if(!s)return u.start;var l=n.segments[i-1];return 0!==i&&l&&void 0!==l.start&&l.end===r+a?o.start:r},n.waitForAppendsToComplete_=function(e){var t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var n=t.hasAudio,i=t.hasVideo,r=t.isMuxed,a="main"===this.loaderType_&&i,s=!this.audioDisabled_&&n&&!r;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);a&&e.waitingOnAppends++,s&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),s&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},n.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||0===--e.waitingOnAppends&&this.handleAppendsDone_()},n.checkForIllegalMediaSwitch=function(e){var t=Dn(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,blacklistDuration:1/0}),this.trigger("error"),!0)},n.updateSourceBufferTimestampOffset_=function(e){if(null!==e.timestampOffset&&"number"==typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){var 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")}},n.getSegmentStartTimeForTimestampOffsetCalculation_=function(e){var t=e.videoTimingInfo,n=e.audioTimingInfo,i=e.timingInfo;return this.useDtsForTimestampOffset_?t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:n&&"number"==typeof n.transmuxedDecodeStart?n.transmuxedDecodeStart:i.start:i.start},n.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var t=this.getMediaInfo_(),n="main"===this.loaderType_&&t&&t.hasVideo,i=n&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end="number"==typeof i.end?i.end:i.start+e.duration)},n.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var t=Hn(e,this.sourceType_);if(t&&("warn"===t.severity?f.a.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_))return void this.logger_("Throwing away un-appended sync request "+Mn(e));this.logger_("Appended "+Mn(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");var n=e.segment,i=e.part,r=n.end&&this.currentTime_()-n.end>3*e.playlist.targetDuration,a=i&&i.end&&this.currentTime_()-i.end>3*e.playlist.partTargetDuration;if(r||a)return this.logger_("bad "+(r?"segment":"part")+" "+Mn(e)),void this.resetEverything();null!==this.mediaIndex&&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_()},n.recordThroughput_=function(e){if(e.duration<1/60)return void this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+1/60);var t=this.throughput.rate,n=Date.now()-e.endOfAllRequests+1,i=Math.floor(e.byteLength/n*8*1e3);this.throughput.rate+=(i-t)/++this.throughput.count},n.addSegmentMetadataCue_=function(e){if(this.segmentMetadataTrack_){var t=e.segment,n=t.start,i=t.end;if(Ln(n)&&Ln(i)){kn(n,i,this.segmentMetadataTrack_);var r=d.a.WebKitDataCue||d.a.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,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:i},s=JSON.stringify(a),o=new r(n,i,s);o.value=a,this.segmentMetadataTrack_.addCue(o)}}},t}(f.a.EventTarget),Vn=function(e){return"string"!=typeof e?e:e.replace(/./,function(e){return e.toUpperCase()})},Wn=["video","audio"],Gn=function(e,t){var n=t[e+"Buffer"];return n&&n.updating||t.queuePending[e]},zn=function(e,t){for(var n=0;n<t.length;n++){var i=t[n];if("mediaSource"===i.type)return null;if(i.type===e)return n}return null},Xn=function e(t,n){if(0!==n.queue.length){var i=0,r=n.queue[i];if("mediaSource"===r.type)return void(n.updating()||"closed"===n.mediaSource.readyState||(n.queue.shift(),r.action(n),r.doneFn&&r.doneFn(),e("audio",n),e("video",n)));if("mediaSource"!==t&&n.ready()&&"closed"!==n.mediaSource.readyState&&!Gn(t,n)){if(r.type!==t){if(null===(i=zn(t,n.queue)))return;r=n.queue[i]}return n.queue.splice(i,1),n.queuePending[t]=r,r.action(t,n),r.doneFn?void 0:(n.queuePending[t]=null,void e(t,n))}}},Yn=function(e,t){var n=t[e+"Buffer"],i=Vn(e);n&&(n.removeEventListener("updateend",t["on"+i+"UpdateEnd_"]),n.removeEventListener("error",t["on"+i+"Error_"]),t.codecs[e]=null,t[e+"Buffer"]=null)},Kn=function(e,t){return e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t)},Qn={appendBuffer:function(e,t,n){return function(i,r){var a=r[i+"Buffer"];if(Kn(r.mediaSource,a)){r.logger_("Appending segment "+t.mediaIndex+"'s "+e.length+" bytes to "+i+"Buffer");try{a.appendBuffer(e)}catch(e){r.logger_("Error with code "+e.code+" "+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+"when appending segment "+t.mediaIndex+" to "+i+"Buffer"),r.queuePending[i]=null,n(e)}}}},remove:function(e,t){return function(n,i){var r=i[n+"Buffer"];if(Kn(i.mediaSource,r)){i.logger_("Removing "+e+" to "+t+" from "+n+"Buffer");try{r.remove(e,t)}catch(r){i.logger_("Remove "+e+" to "+t+" from "+n+"Buffer failed")}}}},timestampOffset:function(e){return function(t,n){var i=n[t+"Buffer"];Kn(n.mediaSource,i)&&(n.logger_("Setting "+t+"timestampOffset to "+e),i.timestampOffset=e)}},callback:function(e){return function(t,n){e()}},endOfStream:function(e){return function(t){if("open"===t.mediaSource.readyState){t.logger_("Calling mediaSource endOfStream("+(e||"")+")");try{t.mediaSource.endOfStream(e)}catch(e){f.a.log.warn("Failed to call media source endOfStream",e)}}}},duration:function(e){return function(t){t.logger_("Setting mediaSource duration to "+e);try{t.mediaSource.duration=e}catch(e){f.a.log.warn("Failed to set media source duration",e)}}},abort:function(){return function(e,t){if("open"===t.mediaSource.readyState){var n=t[e+"Buffer"];if(Kn(t.mediaSource,n)){t.logger_("calling abort on "+e+"Buffer");try{n.abort()}catch(t){f.a.log.warn("Failed to abort on "+e+"Buffer",t)}}}}},addSourceBuffer:function(e,t){return function(n){var i=Vn(e),r=Object(v.e)(t);n.logger_("Adding "+e+"Buffer with codec "+t+" to mediaSource");var a=n.mediaSource.addSourceBuffer(r);a.addEventListener("updateend",n["on"+i+"UpdateEnd_"]),a.addEventListener("error",n["on"+i+"Error_"]),n.codecs[e]=t,n[e+"Buffer"]=a}},removeSourceBuffer:function(e){return function(t){var n=t[e+"Buffer"];if(Yn(e,t),Kn(t.mediaSource,n)){t.logger_("Removing "+e+"Buffer with codec "+t.codecs[e]+" from mediaSource");try{t.mediaSource.removeSourceBuffer(n)}catch(t){f.a.log.warn("Failed to removeSourceBuffer "+e+"Buffer",t)}}}},changeType:function(e){return function(t,n){var i=n[t+"Buffer"],r=Object(v.e)(e);Kn(n.mediaSource,i)&&n.codecs[t]!==e&&(n.logger_("changing "+t+"Buffer codec from "+n.codecs[t]+" to "+e),i.changeType(r),n.codecs[t]=e)}}},$n=function(e){var t=e.type,n=e.sourceUpdater,i=e.action,r=e.doneFn,a=e.name;n.queue.push({type:t,action:i,doneFn:r,name:a}),Xn(t,n)},Jn=function(e,t){return function(n){if(t.queuePending[e]){var i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[e+"Error_"])}Xn(e,t)}},Zn=function(e){function t(t){var n;return n=e.call(this)||this,n.mediaSource=t,n.sourceopenListener_=function(){return Xn("mediaSource",a()(n))},n.mediaSource.addEventListener("sourceopen",n.sourceopenListener_),n.logger_=P("SourceUpdater"),n.audioTimestampOffset_=0,n.videoTimestampOffset_=0,n.queue=[],n.queuePending={audio:null,video:null},n.delayedAudioAppendQueue_=[],n.videoAppendQueued_=!1,n.codecs={},n.onVideoUpdateEnd_=Jn("video",a()(n)),n.onAudioUpdateEnd_=Jn("audio",a()(n)),n.onVideoError_=function(e){n.videoError_=e},n.onAudioError_=function(e){n.audioError_=e},n.createdSourceBuffers_=!1,n.initializedEme_=!1,n.triggeredReady_=!1,n}o()(t,e);var n=t.prototype;return n.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},n.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},n.hasInitializedAnyEme=function(){return this.initializedEme_},n.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},n.createSourceBuffers=function(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},n.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},n.addSourceBuffer=function(e,t){$n({type:"mediaSource",sourceUpdater:this,action:Qn.addSourceBuffer(e,t),name:"addSourceBuffer"})},n.abort=function(e){$n({type:e,sourceUpdater:this,action:Qn.abort(e),name:"abort"})},n.removeSourceBuffer=function(e){if(!this.canRemoveSourceBuffer())return void f.a.log.error("removeSourceBuffer is not supported!");$n({type:"mediaSource",sourceUpdater:this,action:Qn.removeSourceBuffer(e),name:"removeSourceBuffer"})},n.canRemoveSourceBuffer=function(){return!f.a.browser.IE_VERSION&&!f.a.browser.IS_FIREFOX&&d.a.MediaSource&&d.a.MediaSource.prototype&&"function"==typeof d.a.MediaSource.prototype.removeSourceBuffer},t.canChangeType=function(){return d.a.SourceBuffer&&d.a.SourceBuffer.prototype&&"function"==typeof d.a.SourceBuffer.prototype.changeType},n.canChangeType=function(){return this.constructor.canChangeType()},n.changeType=function(e,t){if(!this.canChangeType())return void f.a.log.error("changeType is not supported!");$n({type:e,sourceUpdater:this,action:Qn.changeType(t),name:"changeType"})},n.addOrChangeSourceBuffers=function(e){var t=this;if(!e||"object"!=typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(function(n){var i=e[n];if(!t.hasCreatedSourceBuffers())return t.addSourceBuffer(n,i);t.canChangeType()&&t.changeType(n,i)})},n.appendBuffer=function(e,t){var n=this,i=e.segmentInfo,r=e.type,a=e.bytes;if(this.processedAppend_=!0,"audio"===r&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_("delayed audio append of "+a.length+" until video append");var s=t;if($n({type:r,sourceUpdater:this,action:Qn.appendBuffer(a,i||{mediaIndex:-1},s),doneFn:t,name:"appendBuffer"}),"video"===r){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var o=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+o.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,o.forEach(function(e){n.appendBuffer.apply(n,e)})}},n.audioBuffered=function(){return Kn(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:f.a.createTimeRange()},n.videoBuffered=function(){return Kn(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:f.a.createTimeRange()},n.buffered=function(){var e=Kn(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Kn(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():M(this.audioBuffered(),this.videoBuffered())},n.setDuration=function(e,t){void 0===t&&(t=i),$n({type:"mediaSource",sourceUpdater:this,action:Qn.duration(e),name:"duration",doneFn:t})},n.endOfStream=function(e,t){void 0===e&&(e=null),void 0===t&&(t=i),"string"!=typeof e&&(e=void 0),$n({type:"mediaSource",sourceUpdater:this,action:Qn.endOfStream(e),name:"endOfStream",doneFn:t})},n.removeAudio=function(e,t,n){if(void 0===n&&(n=i),!this.audioBuffered().length||0===this.audioBuffered().end(0))return void n();$n({type:"audio",sourceUpdater:this,action:Qn.remove(e,t),doneFn:n,name:"remove"})},n.removeVideo=function(e,t,n){if(void 0===n&&(n=i),!this.videoBuffered().length||0===this.videoBuffered().end(0))return void n();$n({type:"video",sourceUpdater:this,action:Qn.remove(e,t),doneFn:n,name:"remove"})},n.updating=function(){return!(!Gn("audio",this)&&!Gn("video",this))},n.audioTimestampOffset=function(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&($n({type:"audio",sourceUpdater:this,action:Qn.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_},n.videoTimestampOffset=function(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset!==e&&($n({type:"video",sourceUpdater:this,action:Qn.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_},n.audioQueueCallback=function(e){this.audioBuffer&&$n({type:"audio",sourceUpdater:this,action:Qn.callback(e),name:"callback"})},n.videoQueueCallback=function(e){this.videoBuffer&&$n({type:"video",sourceUpdater:this,action:Qn.callback(e),name:"callback"})},n.dispose=function(){var e=this;this.trigger("dispose"),Wn.forEach(function(t){e.abort(t),e.canRemoveSourceBuffer()?e.removeSourceBuffer(t):e[t+"QueueCallback"](function(){return Yn(t,e)})}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},t}(f.a.EventTarget),ei=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},ti=new Uint8Array("\n\n".split("").map(function(e){return e.charCodeAt(0)})),ni=function(e){function t(t,n){var i;return void 0===n&&(n={}),i=e.call(this,t,n)||this,i.mediaSource_=null,i.subtitlesTrack_=null,i.loaderType_="subtitle",i.featuresNativeTextTracks_=t.featuresNativeTextTracks,i.shouldSaveSegmentTimingInfo_=!1,i}o()(t,e);var n=t.prototype;return n.createTransmuxer_=function(){return null},n.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return f.a.createTimeRanges();var e=this.subtitlesTrack_.cues,t=e[0].startTime,n=e[e.length-1].startTime;return f.a.createTimeRanges([[t,n]])},n.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var n=We(e),i=this.initSegments_[n];if(t&&!i&&e.bytes){var r=ti.byteLength+e.bytes.byteLength,a=new Uint8Array(r);a.set(e.bytes),a.set(ti,e.bytes.byteLength),this.initSegments_[n]=i={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return i||e},n.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},n.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},n.track=function(e){return void 0===e?this.subtitlesTrack_:(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)},n.remove=function(e,t){kn(e,t,this.subtitlesTrack_)},n.fillBuffer_=function(){var e=this,t=this.chooseNextRequest_();if(t){if(null===this.syncController_.timestampOffsetForTimeline(t.timeline)){var n=function(){e.state="READY",e.paused()||e.monitorBuffer_()};return this.syncController_.one("timestampoffset",n),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(t)}},n.timestampOffsetForSegment_=function(){return null},n.chooseNextRequest_=function(){return this.skipEmptySegments_(e.prototype.chooseNextRequest_.call(this))},n.skipEmptySegments_=function(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},n.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},n.segmentRequestFinished_=function(e,t,n){var i=this;if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Ut.TIMEOUT&&this.handleTimeout_(),e.code===Ut.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),this.state="APPENDING",this.trigger("appending");var a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof d.a.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var s,o=function(){i.subtitlesTrack_.tech_.off("vttjsloaded",s),i.stopForError({message:"Error loading vtt.js"})};return s=function(){i.subtitlesTrack_.tech_.off("vttjserror",o),i.segmentRequestFinished_(e,t,n)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",s),void this.subtitlesTrack_.tech_.one("vttjserror",o)}a.requested=!0;try{this.parseVTTCues_(r)}catch(e){return void this.stopForError({message:e.message})}if(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)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach(function(e){i.subtitlesTrack_.addCue(i.featuresNativeTextTracks_?new d.a.VTTCue(e.startTime,e.endTime,e.text):e)}),Cn(this.subtitlesTrack_),this.handleAppendsDone_()},n.handleData_=function(){},n.updateTimingInfoEnd_=function(){},n.parseVTTCues_=function(e){var t,n=!1;"function"==typeof d.a.TextDecoder?t=new d.a.TextDecoder("utf8"):(t=d.a.WebVTT.StringDecoder(),n=!0);var i=new d.a.WebVTT.Parser(d.a,d.a.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},i.oncue=e.cues.push.bind(e.cues),i.ontimestampmap=function(t){e.timestampmap=t},i.onparsingerror=function(e){f.a.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var r=e.segment.map.bytes;n&&(r=ei(r)),i.parse(r)}var a=e.bytes;n&&(a=ei(a)),i.parse(a),i.flush()},n.updateTimeMapping_=function(e,t,n){var i=e.segment;if(t){if(!e.cues.length)return void(i.empty=!0);var r=e.timestampmap,a=r.MPEGTS/A.ONE_SECOND_IN_TS-r.LOCAL+t.mapping;if(e.cues.forEach(function(e){e.startTime+=a,e.endTime+=a}),!n.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(s,o-i.duration)}}}},t}(qn),ii=function(e,t){for(var n=e.cues,i=0;i<n.length;i++){var r=n[i];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null},ri=function(e,t,n){if(void 0===n&&(n=0),e.segments)for(var i,r=n,a=0;a<e.segments.length;a++){var s=e.segments[a];if(i||(i=ii(t,r+s.duration/2)),i){if("cueIn"in s){i.endTime=r,i.adEndTime=r,r+=s.duration,i=null;continue}if(r<i.endTime){r+=s.duration;continue}i.endTime+=s.duration}else if("cueOut"in s&&(i=new d.a.VTTCue(r,r+s.duration,s.cueOut),i.adStartTime=r,i.adEndTime=r+parseFloat(s.cueOut),t.addCue(i)),"cueOutCont"in s){var o=s.cueOutCont.split("/").map(parseFloat),u=o[0],l=o[1];i=new d.a.VTTCue(r,r+s.duration,""),i.adStartTime=r-u,i.adEndTime=i.adStartTime+l,t.addCue(i)}r+=s.duration}},ai=[{name:"VOD",run:function(e,t,n,i,r){if(n!==1/0){return{time:0,segmentIndex:0,partIndex:null}}return null}},{name:"ProgramDateTime",run:function(e,t,n,i,r){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,s=null,o=W(t);r=r||0;for(var u=0;u<o.length;u++){var l=t.endList||0===r?u:o.length-(u+1),c=o[l],d=c.segment,h=e.timelineToDatetimeMappings[d.timeline];if(h&&d.dateTimeObject){var p=d.dateTimeObject.getTime()/1e3,f=p+h;if(d.parts&&"number"==typeof c.partIndex)for(var m=0;m<c.partIndex;m++)f+=d.parts[m].duration;var g=Math.abs(r-f);if(null!==s&&(0===g||s<g))break;s=g,a={time:f,segmentIndex:c.segmentIndex,partIndex:c.partIndex}}}return a}},{name:"Segment",run:function(e,t,n,i,r){var a=null,s=null;r=r||0;for(var o=W(t),u=0;u<o.length;u++){var l=t.endList||0===r?u:o.length-(u+1),c=o[l],d=c.segment,h=c.part&&c.part.start||d&&d.start;if(d.timeline===i&&void 0!==h){var p=Math.abs(r-h);if(null!==s&&s<p)break;(!a||null===s||s>=p)&&(s=p,a={time:h,segmentIndex:c.segmentIndex,partIndex:c.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,n,i,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o<t.discontinuityStarts.length;o++){var u=t.discontinuityStarts[o],l=t.discontinuitySequence+o+1,c=e.discontinuities[l];if(c){var d=Math.abs(r-c.time);if(null!==s&&s<d)break;(!a||null===s||s>=d)&&(s=d,a={time:c.time,segmentIndex:u,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,n,i,r){if(t.syncInfo){return{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}}return null}}],si=function(e){function t(t){var n;return n=e.call(this)||this,n.timelines=[],n.discontinuities=[],n.timelineToDatetimeMappings={},n.logger_=P("SyncController"),n}o()(t,e);var n=t.prototype;return n.getSyncPoint=function(e,t,n,i){var r=this.runStrategies_(e,t,n,i);return r.length?this.selectSyncPoint_(r,{key:"time",value:i}):null},n.getExpiredTime=function(e,t){if(!e||!e.segments)return null;var n=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!n.length)return null;var i=this.selectSyncPoint_(n,{key:"segmentIndex",value:0});return i.segmentIndex>0&&(i.time*=-1),Math.abs(i.time+J({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:i.segmentIndex,endIndex:0}))},n.runStrategies_=function(e,t,n,i){for(var r=[],a=0;a<ai.length;a++){var s=ai[a],o=s.run(this,e,t,n,i);o&&(o.strategy=s.name,r.push({strategy:s.name,syncPoint:o}))}return r},n.selectSyncPoint_=function(e,t){for(var n=e[0].syncPoint,i=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy,a=1;a<e.length;a++){var s=Math.abs(e[a].syncPoint[t.key]-t.value);s<i&&(i=s,n=e[a].syncPoint,r=e[a].strategy)}return this.logger_("syncPoint for ["+t.key+": "+t.value+"] chosen with strategy ["+r+"]: [time:"+n.time+", segmentIndex:"+n.segmentIndex+("number"==typeof n.partIndex?",partIndex:"+n.partIndex:"")+"]"),n},n.saveExpiredSegmentInfo=function(e,t){var n=t.mediaSequence-e.mediaSequence;if(n>86400)return void f.a.log.warn("Not saving expired segment info. Media sequence gap "+n+" is too large.");for(var i=n-1;i>=0;i--){var r=e.segments[i];if(r&&void 0!==r.start){t.syncInfo={mediaSequence:e.mediaSequence+i,time:r.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},n.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0],n=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-n}},n.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,n=e.shouldSaveTimelineMapping,i=this.calculateSegmentTimeMapping_(t,t.timingInfo,n),r=t.segment;i&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:r.start}));var a=r.dateTimeObject;r.discontinuity&&n&&a&&(this.timelineToDatetimeMappings[r.timeline]=-a.getTime()/1e3)},n.timestampOffsetForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].time},n.mappingForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping},n.calculateSegmentTimeMapping_=function(e,t,n){var i,r,a=e.segment,s=e.part,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},n&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+o.time+"] [mapping: "+o.mapping+"]")),i=e.startOfSegment,r=t.end+o.mapping;else{if(!o)return!1;i=t.start+o.mapping,r=t.end+o.mapping}return s&&(s.start=i,s.end=r),(!a.start||i<a.start)&&(a.start=i),a.end=r,!0},n.saveDiscontinuitySyncInfo_=function(e){var 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(var i=0;i<t.discontinuityStarts.length;i++){var r=t.discontinuityStarts[i],a=t.discontinuitySequence+i+1,s=r-e.mediaIndex,o=Math.abs(s);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>o){var u=void 0;u=s<0?n.start-J({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):n.end+J({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[a]={time:u,accuracy:o}}}},n.dispose=function(){this.trigger("dispose"),this.off()},t}(f.a.EventTarget),oi=function(e){function t(){var t;return t=e.call(this)||this,t.pendingTimelineChanges_={},t.lastTimelineChanges_={},t}o()(t,e);var n=t.prototype;return n.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},n.pendingTimelineChange=function(e){var t=e.type,n=e.from,i=e.to;return"number"==typeof n&&"number"==typeof i&&(this.pendingTimelineChanges_[t]={type:t,from:n,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},n.lastTimelineChange=function(e){var t=e.type,n=e.from,i=e.to;return"number"==typeof n&&"number"==typeof i&&(this.lastTimelineChanges_[t]={type:t,from:n,to:i},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},n.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(f.a.EventTarget),ui=bt(Tt(function(){function t(e,t,i){return i={path:t,exports:{},require:function(e,t){return n((void 0===t||null===t)&&i.path)}},e(i,i.exports),i.exports}function n(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
18
- function i(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}var r,a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},s=t(function(e){function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function n(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0}),o=t(function(e){function t(n,i){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,t(n,i)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0}),u=t(function(e){function t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,o(e,t)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0}),l=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(2===arguments.length)for(var n=t.length,i=0;i<n;++i)t[i].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(t){e.push(t)})},e}(),c=function(){var e,t,n,i,r,a,s,o,u,l=[[[],[],[],[],[]],[[],[],[],[],[]]],c=l[0],d=l[1],h=c[4],p=d[4],f=[],m=[];for(e=0;e<256;e++)m[(f[e]=e<<1^283*(e>>7))^e]=e;for(t=n=0;!h[t];t^=i||1,n=m[n]||1)for(s=n^n<<1^n<<2^n<<3^n<<4,s=s>>8^255&s^99,h[t]=s,p[s]=t,a=f[r=f[i=f[t]]],u=16843009*a^65537*r^257*i^16843008*t,o=257*f[s]^16843008*s,e=0;e<4;e++)c[e][t]=o=o<<24^o>>>8,d[e][s]=u=u<<24^u>>>8;for(e=0;e<5;e++)c[e]=c[e].slice(0),d[e]=d[e].slice(0);return l},d=null,h=function(){function e(e){d||(d=c()),this._tables=[[d[0][0].slice(),d[0][1].slice(),d[0][2].slice(),d[0][3].slice(),d[0][4].slice()],[d[1][0].slice(),d[1][1].slice(),d[1][2].slice(),d[1][3].slice(),d[1][4].slice()]];var t,n,i,r=this._tables[0][4],a=this._tables[1],s=e.length,o=1;if(4!==s&&6!==s&&8!==s)throw new Error("Invalid aes key size");var u=e.slice(0),l=[];for(this._key=[u,l],t=s;t<4*s+28;t++)i=u[t-1],(t%s==0||8===s&&t%s==4)&&(i=r[i>>>24]<<24^r[i>>16&255]<<16^r[i>>8&255]<<8^r[255&i],t%s==0&&(i=i<<8^i>>>24^o<<24,o=o<<1^283*(o>>7))),u[t]=u[t-s]^i;for(n=0;t;n++,t--)i=u[3&n?t:t-4],l[n]=t<=4||n<4?i:a[0][r[i>>>24]]^a[1][r[i>>16&255]]^a[2][r[i>>8&255]]^a[3][r[255&i]]}return e.prototype.decrypt=function(e,t,n,i,r,a){var s,o,u,l,c=this._key[1],d=e^c[0],h=i^c[1],p=n^c[2],f=t^c[3],m=c.length/4-2,g=4,y=this._tables[1],v=y[0],_=y[1],b=y[2],T=y[3],S=y[4];for(l=0;l<m;l++)s=v[d>>>24]^_[h>>16&255]^b[p>>8&255]^T[255&f]^c[g],o=v[h>>>24]^_[p>>16&255]^b[f>>8&255]^T[255&d]^c[g+1],u=v[p>>>24]^_[f>>16&255]^b[d>>8&255]^T[255&h]^c[g+2],f=v[f>>>24]^_[d>>16&255]^b[h>>8&255]^T[255&p]^c[g+3],g+=4,d=s,h=o,p=u;for(l=0;l<4;l++)r[(3&-l)+a]=S[d>>>24]<<24^S[h>>16&255]<<16^S[p>>8&255]<<8^S[255&f]^c[g++],s=d,d=h,h=p,p=f,f=s},e}(),p=function(e){function t(){var t;return t=e.call(this,l)||this,t.jobs=[],t.delay=1,t.timeout_=null,t}u(t,e);var n=t.prototype;return n.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},n.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(l),f=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},m=function(e,t,n){var i,r,a,s,o,u,l,c,d,p=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),m=new h(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),y=new Int32Array(g.buffer);for(i=n[0],r=n[1],a=n[2],s=n[3],d=0;d<p.length;d+=4)o=f(p[d]),u=f(p[d+1]),l=f(p[d+2]),c=f(p[d+3]),m.decrypt(o,u,l,c,y,d),y[d]=f(y[d]^i),y[d+1]=f(y[d+1]^r),y[d+2]=f(y[d+2]^a),y[d+3]=f(y[d+3]^s),i=o,r=u,a=l,s=c;return g},g=function(){function e(t,n,r,a){var s=e.STEP,o=new Int32Array(t.buffer),u=new Uint8Array(t.byteLength),l=0;for(this.asyncStream_=new p,this.asyncStream_.push(this.decryptChunk_(o.subarray(l,l+s),n,r,u)),l=s;l<o.length;l+=s)r=new Uint32Array([f(o[l-4]),f(o[l-3]),f(o[l-2]),f(o[l-1])]),this.asyncStream_.push(this.decryptChunk_(o.subarray(l,l+s),n,r,u));this.asyncStream_.push(function(){a(null,i(u))})}return e.prototype.decryptChunk_=function(e,t,n,i){return function(){var r=m(e,t,n);i.set(r,e.byteOffset)}},s(e,null,[{key:"STEP",get:function(){return 32e3}}]),e}();r="undefined"!=typeof window?window:void 0!==a?a:"undefined"!=typeof self?self:{};var y=r,v=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},_=y.BigInt||Number;_("0x1"),_("0x100"),_("0x10000"),_("0x1000000"),_("0x100000000"),_("0x10000000000"),_("0x1000000000000"),_("0x100000000000000"),_("0x10000000000000000"),function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}();var b=function(e){var t={};return Object.keys(e).forEach(function(n){var i=e[n];v(i)?t[n]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:t[n]=i}),t};self.onmessage=function(e){var t=e.data,n=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),i=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),r=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new g(n,i,r,function(e,n){self.postMessage(b({source:t.source,decrypted:n}),[n.buffer])})}})),li=_t(ui),ci=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},di=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},hi=function(e,t){t.activePlaylistLoader=e,e.load()},pi=function(e,t){return function(){var n=t.segmentLoaders,i=n[e],r=n.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.getActiveGroup(),u=a.activePlaylistLoader,l=a.lastGroup_;if((!o||!l||o.id!==l.id)&&(a.lastGroup_=o,a.lastTrack_=s,di(i,a),o&&!o.isMasterPlaylist)){if(!o.playlistLoader)return void(u&&r.resetEverything());i.resyncLoader(),hi(o.playlistLoader,a)}}},fi=function(e,t){return function(){var n=t.segmentLoaders[e];t.mediaTypes[e].lastGroup_=null,n.abort(),n.pause()}},mi=function(e,t){return function(){var n=t.masterPlaylistLoader,i=t.segmentLoaders,r=i[e],a=i.main,s=t.mediaTypes[e],o=s.activeTrack(),u=s.getActiveGroup(),l=s.activePlaylistLoader,c=s.lastTrack_;if((!c||!o||c.id!==o.id)&&(s.lastGroup_=u,s.lastTrack_=o,di(r,s),u)){if(u.isMasterPlaylist){if(!o||!c||o.id===c.id)return;var d=t.vhs.masterPlaylistController_,h=d.selectPlaylist();if(d.media()===h)return;return s.logger_("track change. Switching master audio from "+c.id+" to "+o.id),n.pause(),a.resetEverything(),void d.fastQualityChange_(h)}if("AUDIO"===e){if(!u.playlistLoader)return a.setAudio(!0),void a.resetEverything();r.setAudio(!0),a.setAudio(!1)}if(l===u.playlistLoader)return void hi(u.playlistLoader,s);r.track&&r.track(o),r.resetEverything(),hi(u.playlistLoader,s)}}},gi={AUDIO:function(e,t){return function(){var n=t.segmentLoaders[e],i=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;di(n,i);var a=i.activeTrack(),s=i.activeGroup(),o=(s.filter(function(e){return e.default})[0]||s[0]).id,u=i.tracks[o];if(a===u)return void r({message:"Problem encountered loading the default audio track."});f.a.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(var l in i.tracks)i.tracks[l].enabled=i.tracks[l]===u;i.onTrackChanged()}},SUBTITLES:function(e,t){return function(){var n=t.segmentLoaders[e],i=t.mediaTypes[e];f.a.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),di(n,i);var r=i.activeTrack();r&&(r.mode="disabled"),i.onTrackChanged()}}},yi={AUDIO:function(e,t,n){if(t){var i=n.tech,r=n.requestOptions,a=n.segmentLoaders[e];t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),(!i.paused()||e.endList&&"none"!==i.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),i.paused()||a.load()}),t.on("error",gi[e](e,n))}},SUBTITLES:function(e,t,n){var i=n.tech,r=n.requestOptions,a=n.segmentLoaders[e],s=n.mediaTypes[e];t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!i.paused()||e.endList&&"none"!==i.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),i.paused()||a.load()}),t.on("error",gi[e](e,n))}},vi={AUDIO:function(e,t){var n=t.vhs,i=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,c=o.logger_,d=t.masterPlaylistLoader,h=he(d.master);s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},h&&(s[e].main.default.playlists=d.master.playlists));for(var p in s[e]){u[p]||(u[p]=[]);for(var m in s[e][p]){var g=s[e][p][m],y=void 0;if(h?(c("AUDIO group '"+p+"' label '"+m+"' is a master playlist"),g.isMasterPlaylist=!0,y=null):y="vhs-json"===i&&g.playlists?new De(g.playlists[0],n,a):g.resolvedUri?new De(g.resolvedUri,n,a):g.playlists&&"dash"===i?new ft(g.playlists[0],n,a,d):null,g=f.a.mergeOptions({id:m,playlistLoader:y},g),yi[e](e,g.playlistLoader,t),u[p].push(g),void 0===l[m]){var v=new f.a.AudioTrack({id:m,kind:ci(g),enabled:!1,language:g.language,default:g.default,label:m});l[m]=v}}}r.on("error",gi[e](e,t))},SUBTITLES:function(e,t){var n=t.tech,i=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,c=u.tracks,d=t.masterPlaylistLoader;for(var h in o[e]){l[h]||(l[h]=[]);for(var p in o[e][h])if(!o[e][h][p].forced){var m=o[e][h][p],g=void 0;if("hls"===r)g=new De(m.resolvedUri,i,s);else if("dash"===r){var y=m.playlists.filter(function(e){return e.excludeUntil!==1/0});if(!y.length)return;g=new ft(m.playlists[0],i,s,d)}else"vhs-json"===r&&(g=new De(m.playlists?m.playlists[0]:m.resolvedUri,i,s));if(m=f.a.mergeOptions({id:p,playlistLoader:g},m),yi[e](e,m.playlistLoader,t),l[h].push(m),void 0===c[p]){var v=n.addRemoteTextTrack({id:p,kind:"subtitles",default:m.default&&m.autoselect,language:m.language,label:p},!1).track;c[p]=v}}}a.on("error",gi[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var n=t.tech,i=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in i[e]){a[o]||(a[o]=[]);for(var u in i[e][o]){var l=i[e][o][u];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var c=n.options_.vhs&&n.options_.vhs.captionServices||{},d={label:u,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(c[d.instreamId]&&(d=f.a.mergeOptions(d,c[d.instreamId])),void 0===d.default&&delete d.default,a[o].push(f.a.mergeOptions({id:u},l)),void 0===s[u]){var h=n.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;s[u]=h}}}}}},_i=function e(t,n){for(var i=0;i<t.length;i++){if(ce(n,t[i]))return!0;if(t[i].playlists&&e(t[i].playlists,n))return!0}return!1},bi=function(e,t){return function(n){var i=t.masterPlaylistLoader,r=t.mediaTypes[e].groups,a=i.media();if(!a)return null;var s=null;a.attributes[e]&&(s=r[a.attributes[e]]);var o=Object.keys(r);if(!s)if("AUDIO"===e&&o.length>1&&he(t.master))for(var u=0;u<o.length;u++){var l=r[o[u]];if(_i(l,a)){s=l;break}}else r.main?s=r.main:1===o.length&&(s=r[o[0]]);return void 0===n?s:null!==n&&s?s.filter(function(e){return e.id===n.id})[0]||null:null}},Ti={AUDIO:function(e,t){return function(){var n=t.mediaTypes[e].tracks;for(var i in n)if(n[i].enabled)return n[i];return null}},SUBTITLES:function(e,t){return function(){var n=t.mediaTypes[e].tracks;for(var i in n)if("showing"===n[i].mode||"hidden"===n[i].mode)return n[i];return null}}},Si=function(e,t){var n=t.mediaTypes;return function(){var t=n[e].activeTrack();return t?n[e].activeGroup(t):null}},Ei=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){vi[t](t,e)});var t=e.mediaTypes,n=e.masterPlaylistLoader,i=e.tech,r=e.vhs,a=e.segmentLoaders,s=a.AUDIO,o=a.main;["AUDIO","SUBTITLES"].forEach(function(n){t[n].activeGroup=bi(n,e),t[n].activeTrack=Ti[n](n,e),t[n].onGroupChanged=pi(n,e),t[n].onGroupChanging=fi(n,e),t[n].onTrackChanged=mi(n,e),t[n].getActiveGroup=Si(n,e)});var u=t.AUDIO.activeGroup();if(u){var l=(u.filter(function(e){return e.default})[0]||u[0]).id;t.AUDIO.tracks[l].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged();t.AUDIO.getActiveGroup().playlistLoader?(o.setAudio(!1),s.setAudio(!0)):o.setAudio(!0)}n.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(e){return t[e].onGroupChanged()})}),n.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(e){return t[e].onGroupChanging()})});var c=function(){t.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"}),i.trigger({type:"usage",name:"hls-audio-change"})};i.audioTracks().addEventListener("change",c),i.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",function(){i.audioTracks().removeEventListener("change",c),i.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(var d in t.AUDIO.tracks)i.audioTracks().addTrack(t.AUDIO.tracks[d])},wi=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:i,activeTrack:i,getActiveGroup:i,onGroupChanged:i,onTrackChanged:i,lastTrack_:null,logger_:P("MediaGroups["+t+"]")}}),e},ki=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Ci=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},Ai=function(e){var t=e.currentPlaylist,n=e.buffered,i=e.currentTime,r=e.nextPlaylist,a=e.bufferLowWaterLine,s=e.bufferHighWaterLine,o=e.duration,u=e.experimentalBufferBasedABR,l=e.log;if(!r)return f.a.log.warn("We received no playlist to switch to. Please check your stream."),!1;var c="allowing switch "+(t&&t.id||"null")+" -> "+r.id;if(!t)return l(c+" as current playlist is not set"),!0;if(r.id===t.id)return!1;var d=Boolean(L(n,i).length);if(!t.endList)return d||"number"!=typeof t.partTargetDuration?(l(c+" as current playlist is live"),!0):(l("not "+c+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var h=H(n,i),p=u?mt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:mt.MAX_BUFFER_LOW_WATER_LINE;if(o<p)return l(c+" as duration < max low water line ("+o+" < "+p+")"),!0;var m=r.attributes.BANDWIDTH,g=t.attributes.BANDWIDTH;if(m<g&&(!u||h<s)){var y=c+" as next bandwidth < current bandwidth ("+m+" < "+g+")";return u&&(y+=" and forwardBuffer < bufferHighWaterLine ("+h+" < "+s+")"),l(y),!0}if((!u||m>g)&&h>=a){var v=c+" as forwardBuffer >= bufferLowWaterLine ("+h+" >= "+a+")";return u&&(v+=" and next bandwidth > current bandwidth ("+m+" > "+g+")"),l(v),!0}return l("not "+c+" as no switching criteria met"),!1},Ii=function(e){function t(t){var n;n=e.call(this)||this;var i=t.src,r=t.handleManifestRedirects,s=t.withCredentials,o=t.tech,u=t.bandwidth,l=t.externVhs,c=t.useCueTags,h=t.blacklistDuration,p=t.enableLowInitialPlaylist,m=t.sourceType,g=t.cacheEncryptionKeys,y=t.experimentalBufferBasedABR,v=t.experimentalLeastPixelDiffSelector,_=t.captionServices;if(!i)throw new Error("A non-empty playlist URL or JSON manifest string is required");var T=t.maxPlaylistRetries;null!==T&&void 0!==T||(T=1/0),b=l,n.experimentalBufferBasedABR=Boolean(y),n.experimentalLeastPixelDiffSelector=Boolean(v),n.withCredentials=s,n.tech_=o,n.vhs_=o.vhs,n.sourceType_=m,n.useCueTags_=c,n.blacklistDuration=h,n.maxPlaylistRetries=T,n.enableLowInitialPlaylist=p,n.useCueTags_&&(n.cueTagsTrack_=n.tech_.addTextTrack("metadata","ad-cues"),n.cueTagsTrack_.inBandMetadataTrackDispatchType=""),n.requestOptions_={withCredentials:s,handleManifestRedirects:r,maxPlaylistRetries:T,timeout:null},n.on("error",n.pauseLoading),n.mediaTypes_=wi(),n.mediaSource=new d.a.MediaSource,n.handleDurationChange_=n.handleDurationChange_.bind(a()(n)),n.handleSourceOpen_=n.handleSourceOpen_.bind(a()(n)),n.handleSourceEnded_=n.handleSourceEnded_.bind(a()(n)),n.mediaSource.addEventListener("durationchange",n.handleDurationChange_),n.mediaSource.addEventListener("sourceopen",n.handleSourceOpen_),n.mediaSource.addEventListener("sourceended",n.handleSourceEnded_),n.seekable_=f.a.createTimeRanges(),n.hasPlayed_=!1,n.syncController_=new si(t),n.segmentMetadataTrack_=o.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,n.decrypter_=new li,n.sourceUpdater_=new Zn(n.mediaSource),n.inbandTextTracks_={},n.timelineChangeController_=new oi;var S={vhs:n.vhs_,parse708captions:t.parse708captions,useDtsForTimestampOffset:t.useDtsForTimestampOffset,captionServices:_,mediaSource:n.mediaSource,currentTime:n.tech_.currentTime.bind(n.tech_),seekable:function(){return n.seekable()},seeking:function(){return n.tech_.seeking()},duration:function(){return n.duration()},hasPlayed:function(){return n.hasPlayed_},goalBufferLength:function(){return n.goalBufferLength()},bandwidth:u,syncController:n.syncController_,decrypter:n.decrypter_,sourceType:n.sourceType_,inbandTextTracks:n.inbandTextTracks_,cacheEncryptionKeys:g,sourceUpdater:n.sourceUpdater_,timelineChangeController:n.timelineChangeController_,experimentalExactManifestTimings:t.experimentalExactManifestTimings};n.masterPlaylistLoader_="dash"===n.sourceType_?new ft(i,n.vhs_,n.requestOptions_):new De(i,n.vhs_,n.requestOptions_),n.setupMasterPlaylistLoaderListeners_(),n.mainSegmentLoader_=new qn(f.a.mergeOptions(S,{segmentMetadataTrack:n.segmentMetadataTrack_,loaderType:"main"}),t),n.audioSegmentLoader_=new qn(f.a.mergeOptions(S,{loaderType:"audio"}),t),n.subtitleSegmentLoader_=new ni(f.a.mergeOptions(S,{loaderType:"vtt",featuresNativeTextTracks:n.tech_.featuresNativeTextTracks}),t),n.setupSegmentLoaderListeners_(),n.experimentalBufferBasedABR&&(n.masterPlaylistLoader_.one("loadedplaylist",function(){return n.startABRTimer_()}),n.tech_.on("pause",function(){return n.stopABRTimer_()}),n.tech_.on("play",function(){return n.startABRTimer_()})),ki.forEach(function(e){n[e+"_"]=Ci.bind(a()(n),e)}),n.logger_=P("MPC"),n.triggeredFmp4Usage=!1,"none"===n.tech_.preload()?(n.loadOnPlay_=function(){n.loadOnPlay_=null,n.masterPlaylistLoader_.load()},n.tech_.one("play",n.loadOnPlay_)):n.masterPlaylistLoader_.load(),n.timeToLoadedData__=-1,n.mainAppendsToLoadedData__=-1,n.audioAppendsToLoadedData__=-1;var E="none"===n.tech_.preload()?"play":"loadstart";return n.tech_.one(E,function(){var e=Date.now();n.tech_.one("loadeddata",function(){n.timeToLoadedData__=Date.now()-e,n.mainAppendsToLoadedData__=n.mainSegmentLoader_.mediaAppends,n.audioAppendsToLoadedData__=n.audioSegmentLoader_.mediaAppends})}),n}o()(t,e);var n=t.prototype;return n.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},n.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},n.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t},n.timeToLoadedData_=function(){return this.timeToLoadedData__},n.checkABR_=function(){var e=this.selectPlaylist();e&&this.shouldSwitchToMedia_(e)&&this.switchMedia_(e,"abr")},n.switchMedia_=function(e,t,n){var i=this.media(),r=i&&(i.id||i.uri),a=e.id||e.uri;r&&r!==a&&(this.logger_("switch media "+r+" -> "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,n)},n.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=d.a.setInterval(function(){return e.checkABR_()},250)},n.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(d.a.clearInterval(this.abrTimer_),this.abrTimer_=null)},n.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var n,i=e.mediaGroups.AUDIO,r=Object.keys(i);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{var a=i.main||r.length&&i[r[0]];for(var s in a)if(a[s].default){n={label:s};break}}if(!n)return t;var o=[];for(var u in i)if(i[u][n.label]){var l=i[u][n.label];if(l.playlists&&l.playlists.length)o.push.apply(o,l.playlists);else if(l.uri)o.push(l);else if(e.playlists.length)for(var c=0;c<e.playlists.length;c++){var d=e.playlists[c];d.attributes&&d.attributes.AUDIO&&d.attributes.AUDIO===u&&o.push(d)}}return o.length?o:t},n.setupMasterPlaylistLoaderListeners_=function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var t=e.masterPlaylistLoader_.media(),n=1.5*t.targetDuration*1e3;le(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=n,t.endList&&"none"!==e.tech_.preload()&&(e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load()),Ei({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,vhs:e.vhs_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),t),e.setupFirstPlay(),!e.mediaTypes_.AUDIO.activePlaylistLoader||e.mediaTypes_.AUDIO.activePlaylistLoader.media()?e.trigger("selectedinitialmedia"):e.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){e.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){e.loadOnPlay_&&e.tech_.off("play",e.loadOnPlay_);var t=e.masterPlaylistLoader_.media();if(!t){e.excludeUnsupportedVariants_();var n;if(e.enableLowInitialPlaylist&&(n=e.selectInitialPlaylist()),n||(n=e.selectPlaylist()),!n||!e.shouldSwitchToMedia_(n))return;e.initialMedia_=n,e.switchMedia_(e.initialMedia_,"initial");if(!("vhs-json"===e.sourceType_&&e.initialMedia_.segments))return;t=e.initialMedia_}e.handleUpdatedMediaPlaylist(t)}),this.masterPlaylistLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var t=e.masterPlaylistLoader_.media(),n=1.5*t.targetDuration*1e3;le(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=n,e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var t=e.masterPlaylistLoader_.media();if("playlist-unchanged"!==t.lastExcludeReason_){e.stuckAtPlaylistEnd_(t)&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),e.tech_.trigger("playliststuck"))}}),this.masterPlaylistLoader_.on("renditiondisabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})},n.handleUpdatedMediaPlaylist=function(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},n.triggerPresenceUsage_=function(e,t){var n=e.mediaGroups||{},i=!0,r=Object.keys(n.AUDIO);for(var a in n.AUDIO)for(var s in n.AUDIO[a]){var o=n.AUDIO[a][s];o.uri||(i=!1)}i&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(n.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),b.Playlist.isAes(t)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),r.length&&Object.keys(n.AUDIO[r[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},n.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),i=this.bufferLowWaterLine(),r=this.bufferHighWaterLine(),a=this.tech_.buffered();return Ai({buffered:a,currentTime:n,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:i,bufferHighWaterLine:r,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},n.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("progress",function(){e.trigger("progress")})),this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){e.logger_("main segment loader ended"),e.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))});var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()})},n.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},n.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},n.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},n.fastQualityChange_=function(e){var t=this;if(void 0===e&&(e=this.selectPlaylist()),e===this.masterPlaylistLoader_.media())return void this.logger_("skipping fastQualityChange because new media is same as old");this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){f.a.browser.IE_VERSION||f.a.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())})},n.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}},n.setupFirstPlay=function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_)return!1;if(!t.endList){var n=this.seekable();if(!n.length)return!1;if(f.a.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",function(){e.trigger("firstplay"),e.tech_.setCurrentTime(n.end(0)),e.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(n.end(0))}return this.hasPlayed_=!0,this.load(),!0},n.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,function(e){})}this.trigger("sourceopen")},n.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var e=this.inbandTextTracks_.metadataTrack_.cues;if(e&&e.length){var t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}}},n.handleDurationChange_=function(){this.tech_.trigger("durationchange")},n.onEndOfStream=function(){var e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},n.stuckAtPlaylistEnd_=function(e){if(!this.seekable().length)return!1;var t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;var n=b.Playlist.playlistEnd(e,t),i=this.tech_.currentTime(),r=this.tech_.buffered();if(!r.length)return n-i<=.1;var a=r.end(r.length-1);return a-i<=.1&&n-a<=.1},n.blacklistCurrentPlaylist=function(e,t){void 0===e&&(e={});var n=e.playlist||this.masterPlaylistLoader_.media();if(t=t||e.blacklistDuration||this.blacklistDuration,!n)return this.error=e,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));n.playlistErrors_++;var i=this.masterPlaylistLoader_.master.playlists,r=i.filter(re),a=1===r.length&&r[0]===n;if(1===i.length&&t!==1/0)return f.a.log.warn("Problem encountered with playlist "+n.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(a);if(a){var s=!1;i.forEach(function(e){if(e!==n){var t=e.excludeUntil;void 0!==t&&t!==1/0&&(s=!0,delete e.excludeUntil)}}),s&&(f.a.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}var o;o=n.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*t,n.excludeUntil=o,e.reason&&(n.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var u=this.selectPlaylist();if(!u)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var l=e.internal?this.logger_:f.a.log.warn,c=e.message?" "+e.message:"";l((e.internal?"Internal problem":"Problem")+" encountered with playlist "+n.id+"."+c+" Switching to playlist "+u.id+"."),u.attributes.AUDIO!==n.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==n.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var d=u.targetDuration/2*1e3||5e3,h="number"==typeof u.lastRequest&&Date.now()-u.lastRequest<=d;return this.switchMedia_(u,"exclude",a||h)},n.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},n.delegateLoaders_=function(e,t){var n=this,i=[],r="all"===e;(r||"main"===e)&&i.push(this.masterPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach(function(e){var t=n.mediaTypes_[e]&&n.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)}),["main","audio","subtitle"].forEach(function(t){var r=n[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||i.push(r)}),i.forEach(function(e){return t.forEach(function(t){"function"==typeof e[t]&&e[t]()})})},n.setCurrentTime=function(e){var t=L(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},n.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:b.Playlist.duration(e):1/0:0},n.seekable=function(){return this.seekable_},n.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var n=this.syncController_.getExpiredTime(t,this.duration());if(null!==n){var i=this.masterPlaylistLoader_.master,r=b.Playlist.seekable(t,n,b.Playlist.liveEdgeDelay(i,t));if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(n=this.syncController_.getExpiredTime(t,this.duration())))return;if(e=b.Playlist.seekable(t,n,b.Playlist.liveEdgeDelay(i,t)),0===e.length)return}var a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=f.a.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)<r.end(0)?e.end(0):r.end(0)]]):this.seekable_=r,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===a&&this.seekable_.start(0)===s||(this.logger_("seekable updated ["+N(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},n.updateDuration=function(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){var t=this.seekable();if(!t.length)return;return void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<t.end(t.length-1))&&this.sourceUpdater_.setDuration(t.end(t.length-1)))}var n=this.tech_.buffered(),i=b.Playlist.duration(this.masterPlaylistLoader_.media());n.length>0&&(i=Math.max(i,n.end(n.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)},n.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(t){var n=e.mediaTypes_[t].groups;for(var i in n)n[i].forEach(function(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()},n.master=function(){return this.masterPlaylistLoader_.master},n.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},n.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!n)},n.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var n=on(this.master(),this.media()),i={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(i.video=n.video||t.main.videoCodec||v.b),t.main.isMuxed&&(i.video+=","+(n.audio||t.main.audioCodec||v.a)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(i.audio=n.audio||t.main.audioCodec||t.audio.audioCodec||v.a,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),!i.audio&&!i.video)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0});var a,s=function(e,t){return e?Object(v.c)(t):Object(v.g)(t)},o={};if(["video","audio"].forEach(function(e){if(i.hasOwnProperty(e)&&!s(t[e].isFmp4,i[e])){var n=t[e].isFmp4?"browser":"muxer";o[n]=o[n]||[],o[n].push(i[e]),"audio"===e&&(a=n)}}),r&&a&&this.media().attributes.AUDIO){var u=this.media().attributes.AUDIO;this.master().playlists.forEach(function(t){(t.attributes&&t.attributes.AUDIO)===u&&t!==e.media()&&(t.excludeUntil=1/0)}),this.logger_("excluding audio group "+u+" as "+a+' does not support codec(s): "'+i.audio+'"')}if(Object.keys(o).length){var l=Object.keys(o).reduce(function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+o[t].join(",")+'"'},"")+".";return void this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:l,blacklistDuration:1/0})}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var c=[];if(["video","audio"].forEach(function(t){var n=(Object(v.h)(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(Object(v.h)(i[t]||"")[0]||{}).type;n&&r&&n.toLowerCase()!==r.toLowerCase()&&c.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+i[t]+'"')}),c.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+c.join(", ")+".",blacklistDuration:1/0,internal:!0})}return i},n.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},n.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,n=[];Object.keys(t).forEach(function(i){var r=t[i];if(-1===n.indexOf(r.id)){n.push(r.id);var a=on(e.master,r),s=[];!a.audio||Object(v.g)(a.audio)||Object(v.c)(a.audio)||s.push("audio codec "+a.audio),!a.video||Object(v.g)(a.video)||Object(v.c)(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")))}})},n.excludeIncompatibleVariants_=function(e){var t=this,n=[],i=this.master().playlists,r=an(Object(v.h)(e)),a=sn(r),s=r.video&&Object(v.h)(r.video)[0]||null,o=r.audio&&Object(v.h)(r.audio)[0]||null;Object.keys(i).forEach(function(e){var r=i[e];if(-1===n.indexOf(r.id)&&r.excludeUntil!==1/0){n.push(r.id);var u=[],l=on(t.masterPlaylistLoader_.master,r),c=sn(l);if(l.audio||l.video){if(c!==a&&u.push('codec count "'+c+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var d=l.video&&Object(v.h)(l.video)[0]||null,h=l.audio&&Object(v.h)(l.audio)[0]||null;d&&s&&d.type.toLowerCase()!==s.type.toLowerCase()&&u.push('video codec "'+d.type+'" !== "'+s.type+'"'),h&&o&&h.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'+h.type+'" !== "'+o.type+'"')}u.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+u.join(" && ")))}}})},n.updateAdCues_=function(e){var t=0,n=this.seekable();n.length&&(t=n.start(0)),ri(e,this.cueTagsTrack_,t)},n.goalBufferLength=function(){var e=this.tech_.currentTime(),t=mt.GOAL_BUFFER_LENGTH,n=mt.GOAL_BUFFER_LENGTH_RATE,i=Math.max(t,mt.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*n,i)},n.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),t=mt.BUFFER_LOW_WATER_LINE,n=mt.BUFFER_LOW_WATER_LINE_RATE,i=Math.max(t,mt.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(t,mt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*n,this.experimentalBufferBasedABR?r:i)},n.bufferHighWaterLine=function(){return mt.BUFFER_HIGH_WATER_LINE},t}(f.a.EventTarget),xi=function(e,t,n){return function(i){var r=e.master.playlists[t],a=ie(r),s=re(r);return void 0===i?s:(i?delete r.disabled:r.disabled=!0,i===s||a||(n(),i?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),i)}},Pi=function(e,t,n){var i=e.masterPlaylistController_,r=e.options_.smoothQualityChange,a=r?"smooth":"fast",s=i[a+"QualityChange_"].bind(i);if(t.attributes){var o=t.attributes.RESOLUTION;this.width=o&&o.width,this.height=o&&o.height,this.bandwidth=t.attributes.BANDWIDTH}this.codecs=on(i.master(),t),this.playlist=t,this.id=n,this.enabled=xi(e.playlists,t.id,s)},Oi=function(e){e.representations=function(){var t=e.masterPlaylistController_.master(),n=he(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return n?n.filter(function(e){return!ie(e)}).map(function(t,n){return new Pi(e,t,t.id)}):[]}},Li=["seeking","seeked","pause","playing","error"],Di=function(){function e(e){var t=this;this.masterPlaylistController_=e.masterPlaylistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=P("PlaybackWatcher"),this.logger_("initialize");var n=function(){return t.monitorCurrentTime_()},i=function(){return t.monitorCurrentTime_()},r=function(){return t.techWaiting_()},a=function(){return t.cancelTimer_()},s=this.masterPlaylistController_,o=["main","subtitle","audio"],u={};o.forEach(function(e){u[e]={reset:function(){return t.resetSegmentDownloads_(e)},updateend:function(){return t.checkSegmentDownloads_(e)}},s[e+"SegmentLoader_"].on("appendsdone",u[e].updateend),s[e+"SegmentLoader_"].on("playlistupdate",u[e].reset),t.tech_.on(["seeked","seeking"],u[e].reset)});var l=function(e){["main","audio"].forEach(function(n){s[n+"SegmentLoader_"][e]("appended",t.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){t.fixesBadSeeks_()&&(t.consecutiveUpdates=0,t.lastRecordedTime=t.tech_.currentTime(),l("off"))},this.clearSeekingAppendCheck_=function(){return l("off")},this.watchForBadSeeking_=function(){t.clearSeekingAppendCheck_(),l("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(Li,a),this.tech_.on("canplay",i),this.tech_.one("play",n),this.dispose=function(){t.clearSeekingAppendCheck_(),t.logger_("dispose"),t.tech_.off("waiting",r),t.tech_.off(Li,a),t.tech_.off("canplay",i),t.tech_.off("play",n),t.tech_.off("seeking",t.watchForBadSeeking_),t.tech_.off("seeked",t.clearSeekingAppendCheck_),o.forEach(function(e){s[e+"SegmentLoader_"].off("appendsdone",u[e].updateend),s[e+"SegmentLoader_"].off("playlistupdate",u[e].reset),t.tech_.off(["seeked","seeking"],u[e].reset)}),t.checkCurrentTimeTimeout_&&d.a.clearTimeout(t.checkCurrentTimeTimeout_),t.cancelTimer_()}}var t=e.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&d.a.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=d.a.setTimeout(this.monitorCurrentTime_.bind(this),250)},t.resetSegmentDownloads_=function(e){var t=this.masterPlaylistController_[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_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,n=t[e+"SegmentLoader_"],i=n.buffered_(),r=j(this[e+"Buffered_"],i);if(this[e+"Buffered_"]=i,r)return void this.resetSegmentDownloads_(e);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:B(i)}),this[e+"StalledDownloads_"]<10||(this.logger_(e+" loader stalled download exclusion"),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:"vhs-"+e+"-download-exclusion"}),"subtitle"!==e&&t.blacklistCurrentPlaylist({message:"Excessive "+e+" segment downloading detected."},1/0))},t.checkCurrentTime_=function(){if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+.1>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),n=this.tech_.currentTime(),i=this.afterSeekableWindow_(t,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow);if(i){e=t.end(t.length-1)}if(this.beforeSeekableWindow_(t,n)){var r=t.start(0);e=r+(r===t.end(0)?0:.1)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+n+" with seekable range "+N(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;for(var a=this.masterPlaylistController_.sourceUpdater_,s=this.tech_.buffered(),o=a.audioBuffer?a.audioBuffered():null,u=a.videoBuffer?a.videoBuffered():null,l=this.media(),c=l.partTargetDuration?l.partTargetDuration:2*(l.targetDuration-1/30),d=[o,u],h=0;h<d.length;h++)if(d[h]){var p=H(d[h],n);if(p<c)return!1}var f=D(s,n);return 0!==f.length&&(e=f.start(0)+.1,this.logger_("Buffered region starts ("+f.start(0)+") just beyond seek point ("+n+"). Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0)},t.waiting_=function(){if(!this.techWaiting_()){var e=this.tech_.currentTime(),t=this.tech_.buffered(),n=L(t,e);return n.length&&e+3<=n.end(0)?(this.cancelTimer_(),this.tech_.setCurrentTime(e),this.logger_("Stopped at "+e+" while inside a buffered region ["+n.start(0)+" -> "+n.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var 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.cancelTimer_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var i=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var a=D(r,t);if(a.length>0){var s=a.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+a.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0}return!1},t.afterSeekableWindow_=function(e,t,n,i){if(void 0===i&&(i=!1),!e.length)return!1;var r=e.end(e.length-1)+.1;return!n.endList&&i&&(r=e.end(e.length-1)+3*n.targetDuration),t>r},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)},t.videoUnderflow_=function(e){var t=e.videoBuffered,n=e.audioBuffered,i=e.currentTime;if(t){var r;if(t.length&&n.length){var a=L(t,i-3),s=L(t,i),o=L(n,i);o.length&&!s.length&&a.length&&(r={start:a.end(0),end:o.end(0)})}else{D(t,i).length||(r=this.gapFromVideoUnderflow_(t,i))}return!!r&&(this.logger_("Encountered a gap in video from "+r.start+" to "+r.end+". Seeking to current time "+i),!0)}},t.skipTheGap_=function(e){var t=this.tech_.buffered(),n=this.tech_.currentTime(),i=D(t,n);this.cancelTimer_(),0!==i.length&&n===e&&(this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",e,"nextRange start:",i.start(0)),this.tech_.setCurrentTime(i.start(0)+1/30),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},t.gapFromVideoUnderflow_=function(e,t){for(var n=R(e),i=0;i<n.length;i++){var r=n.start(i),a=n.end(i);if(t-r<4&&t-r>2)return{start:r,end:a}}return null},e}(),Ri={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Mi=function e(t,n){var i=0,r=0,a=f.a.mergeOptions(Ri,n);t.ready(function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})});var s=function(){r&&t.currentTime(r)},o=function(e){null!==e&&void 0!==e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){return Date.now()-i<1e3*a.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&"function"==typeof a.getSource?(i=Date.now(),a.getSource.call(t,o)):void f.a.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e)},c=function(n){l(),e(t,n)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=c},Ni=function(e){Mi(this,e)},Ui={PlaylistLoader:De,Playlist:pe,utils:Ke,STANDARD_PLAYLIST_SELECTOR:mn,INITIAL_PLAYLIST_SELECTOR:vn,lastBandwidthSelector:mn,movingAverageBandwidthSelector:gn,comparePlaylistBandwidth:hn,comparePlaylistResolution:pn,xhr:Ue()};Object.keys(mt).forEach(function(e){Object.defineProperty(Ui,e,{get:function(){return f.a.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),mt[e]},set:function(t){if(f.a.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0)return void f.a.log.warn("value of Vhs."+e+" must be greater than or equal to 0");mt[e]=t}})});var Bi="videojs-vhs",ji=function(e,t){for(var n=t.media(),i=-1,r=0;r<e.length;r++)if(e[r].id===n.id){i=r;break}e.selectedIndex_=i,e.trigger({selectedIndex:i,type:"change"})},Fi=function(e,t){t.representations().forEach(function(t){e.addQualityLevel(t)}),ji(e,t.playlists)};Ui.canPlaySource=function(){return f.a.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Hi=function(e,t,n){if(!e)return e;var i={};t&&t.attributes&&t.attributes.CODECS&&(i=an(Object(v.h)(t.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(i.audio=n.attributes.CODECS);var r=Object(v.e)(i.video),a=Object(v.e)(i.audio),s={};for(var o in e)s[o]={},a&&(s[o].audioContentType=a),r&&(s[o].videoContentType=r),t.contentProtection&&t.contentProtection[o]&&t.contentProtection[o].pssh&&(s[o].pssh=t.contentProtection[o].pssh),"string"==typeof e[o]&&(s[o].url=e[o]);return f.a.mergeOptions(e,s)},qi=function(e,t){return e.reduce(function(e,n){if(!n.contentProtection)return e;var i=t.reduce(function(e,t){var i=n.contentProtection[t];return i&&i.pssh&&(e[t]={pssh:i.pssh}),e},{});return Object.keys(i).length&&e.push(i),e},[])},Vi=function(e){var t=e.player,n=e.sourceKeySystems,i=e.audioMedia,r=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var a=i?r.concat([i]):r,s=qi(a,Object.keys(n)),o=[],u=[];return s.forEach(function(e){u.push(new Promise(function(e,n){t.tech_.one("keysessioncreated",e)})),o.push(new Promise(function(n,i){t.eme.initializeMediaKeys({keySystems:e},function(e){if(e)return void i(e);n()})}))}),Promise.race([Promise.all(o),Promise.race(u)])},Wi=function(e){var t=e.player,n=e.sourceKeySystems,i=e.media,r=e.audioMedia,a=Hi(n,i,r);return!!a&&(t.currentSource().keySystems=a,!(a&&!t.eme)||(f.a.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},Gi=function(){if(!d.a.localStorage)return null;var e=d.a.localStorage.getItem(Bi);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},zi=function(e){if(!d.a.localStorage)return!1;var t=Gi();t=t?f.a.mergeOptions(t,e):e;try{d.a.localStorage.setItem(Bi,JSON.stringify(t))}catch(e){return!1}return t},Xi=function(e){return 0===e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(e.substring(e.indexOf(",")+1)):e};Ui.supportsNativeHls=function(){if(!l.a||!l.a.createElement)return!1;var e=l.a.createElement("video");return!!f.a.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))})}(),Ui.supportsNativeDash=function(){return!!(l.a&&l.a.createElement&&f.a.getTech("Html5").isSupported())&&/maybe|probably/i.test(l.a.createElement("video").canPlayType("application/dash+xml"))}(),Ui.supportsTypeNatively=function(e){return"hls"===e?Ui.supportsNativeHls:"dash"===e&&Ui.supportsNativeDash},Ui.isSupported=function(){return f.a.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Yi=f.a.getComponent("Component"),Ki=function(e){function t(t,n,i){var r;if(r=e.call(this,n,f.a.mergeOptions(i.hls,i.vhs))||this,i.hls&&Object.keys(i.hls).length&&f.a.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object."),"number"==typeof i.initialBandwidth&&(r.options_.bandwidth=i.initialBandwidth),r.logger_=P("VhsHandler"),n.options_&&n.options_.playerId){var s=f()(n.options_.playerId);s.hasOwnProperty("hls")||Object.defineProperty(s,"hls",{get:function(){return f.a.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"hls-player-access"}),a()(r)},configurable:!0}),s.hasOwnProperty("vhs")||Object.defineProperty(s,"vhs",{get:function(){return f.a.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"vhs-player-access"}),a()(r)},configurable:!0}),s.hasOwnProperty("dash")||Object.defineProperty(s,"dash",{get:function(){return f.a.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),a()(r)},configurable:!0}),r.player_=s}if(r.tech_=n,r.source_=t,r.stats={},r.ignoreNextSeekingEvent_=!1,r.setOptions_(),r.options_.overrideNative&&n.overrideNativeAudioTracks&&n.overrideNativeVideoTracks)n.overrideNativeAudioTracks(!0),n.overrideNativeVideoTracks(!0);else if(r.options_.overrideNative&&(n.featuresNativeVideoTracks||n.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return r.on(l.a,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(e){var t=l.a.fullscreenElement||l.a.webkitFullscreenElement||l.a.mozFullScreenElement||l.a.msFullscreenElement;t&&t.contains(r.tech_.el())?r.masterPlaylistController_.fastQualityChange_():r.masterPlaylistController_.checkABR_()}),r.on(r.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_)return void(this.ignoreNextSeekingEvent_=!1);this.setCurrentTime(this.tech_.currentTime())}),r.on(r.tech_,"error",function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),r.on(r.tech_,"play",r.play),r}o()(t,e);var n=t.prototype;return n.setOptions_=function(){var e=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=!1!==this.options_.handleManifestRedirects,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,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,"number"!=typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){var t=Gi();t&&t.bandwidth&&(this.options_.bandwidth=t.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),t&&t.throughput&&(this.options_.throughput=t.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=mt.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===mt.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","useDtsForTimestampOffset","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach(function(t){void 0!==e.source_[t]&&(e.options_[t]=e.source_[t])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},n.src=function(e,t){var n=this;if(e){this.setOptions_(),this.options_.src=Xi(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Ui,this.options_.sourceType=Object(_.a)(t),this.options_.seekTo=function(e){n.tech_.setCurrentTime(e)},this.options_.smoothQualityChange&&f.a.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new Ii(this.options_);var i=f.a.mergeOptions({liveRangeSafeTimeDelta:.1},this.options_,{seekable:function(){return n.seekable()},media:function(){return n.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new Di(i),this.masterPlaylistController_.on("error",function(){var e=f.a.players[n.tech_.options_.playerId],t=n.masterPlaylistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)});var r=this.options_.experimentalBufferBasedABR?Ui.movingAverageBandwidthSelector(.55):Ui.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.masterPlaylistController_.selectInitialPlaylist=Ui.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var e=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,t=d.a.navigator.connection||d.a.navigator.mozConnection||d.a.navigator.webkitConnection;if(this.options_.useNetworkInformationApi&&t){var n=1e3*t.downlink*1e3;e=n>=1e7&&e>=1e7?Math.max(e,n):n}return e},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e,t=1/(this.bandwidth||1);return e=this.throughput>0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){f.a.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:function(){return n.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return n.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return n.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return n.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return n.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return n.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return n.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return n.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return n.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return n.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return n.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return B(n.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return n.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return n.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return n.tech_.name_},enumerable:!0},duration:{get:function(){return n.tech_.duration()},enumerable:!0},master:{get:function(){return n.playlists.master},enumerable:!0},playerDimensions:{get:function(){return n.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return B(n.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return n.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){n.options_.useBandwidthFromLocalStorage&&zi({bandwidth:n.bandwidth,throughput:Math.round(n.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){Oi(n)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){n.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=d.a.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},n.createKeySessions_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),Vi({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})})},n.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},n.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,n=Wi({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});if(this.player_.tech_.on("keystatuschange",function(t){"output-restricted"===t.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+t.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11===f.a.browser.IE_VERSION||!n)return void this.masterPlaylistController_.sourceUpdater_.initializedEme();this.createKeySessions_()},n.setupQualityLevels_=function(){var e=this,t=f.a.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){Fi(e.qualityLevels_,e)}),this.playlists.on("mediachange",function(){ji(e.qualityLevels_,e.playlists)}))},t.version=function(){return{"@videojs/http-streaming":"2.14.2","mux.js":"6.0.1","mpd-parser":"0.21.1","m3u8-parser":"4.7.1","aes-decrypter":"3.1.3"}},n.version=function(){return this.constructor.version()},n.canChangeType=function(){return Zn.canChangeType()},n.play=function(){this.masterPlaylistController_.play()},n.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},n.duration=function(){return this.masterPlaylistController_.duration()},n.seekable=function(){return this.masterPlaylistController_.seekable()},n.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&d.a.URL.revokeObjectURL&&(d.a.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),e.prototype.dispose.call(this)},n.convertToProgramTime=function(e,t){return nt({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},n.seekToProgramTime=function(e,t,n,i){return void 0===n&&(n=!0),void 0===i&&(i=2),it({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:i,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(Yi),Qi={name:"videojs-http-streaming",VERSION:"2.14.2",canHandleSource:function(e,t){void 0===t&&(t={});var n=f.a.mergeOptions(f.a.options,t);return Qi.canPlayType(e.type,n)},handleSource:function(e,t,n){void 0===n&&(n={});var i=f.a.mergeOptions(f.a.options,n);return t.vhs=new Ki(e,t,i),f.a.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return f.a.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=Ue(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var n=f.a.mergeOptions(f.a.options,t),i=n.vhs;i=void 0===i?{}:i;var r=i.overrideNative,a=void 0===r?!f.a.browser.IS_ANY_SAFARI:r,s=n.hls;s=void 0===s?{}:s;var o=s.overrideNative,u=void 0!==o&&o,l=Object(_.a)(e);return l&&(!Ui.supportsTypeNatively(l)||u||a)?"maybe":""}};if(function(){return Object(v.c)("avc1.4d400d,mp4a.40.2")}()&&f.a.getTech("Html5").registerSourceHandler(Qi,0),f.a.VhsHandler=Ki,Object.defineProperty(f.a,"HlsHandler",{get:function(){return f.a.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Ki},configurable:!0}),f.a.VhsSourceHandler=Qi,Object.defineProperty(f.a,"HlsSourceHandler",{get:function(){return f.a.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Qi},configurable:!0}),f.a.Vhs=Ui,Object.defineProperty(f.a,"Hls",{get:function(){return f.a.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Ui},configurable:!0}),f.a.use||(f.a.registerComponent("Hls",Ui),f.a.registerComponent("Vhs",Ui)),f.a.options.vhs=f.a.options.vhs||{},f.a.options.hls=f.a.options.hls||{},!f.a.getPlugin||!f.a.getPlugin("reloadSourceOnError")){(f.a.registerPlugin||f.a.plugin)("reloadSourceOnError",Ni)}}.call(t,n(2))},function(e,t){function n(t,i){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t,i)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){},function(e,t,n){!function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var r=s.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=s.normalizePath(r.path),s.buildURLFromParts(r)}var a=s.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return n.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):t;var o=s.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=i.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=o.netLoc,"/"!==a.path[0]))if(a.path){var c=o.path,d=c.substring(0,c.lastIndexOf("/")+1)+a.path;l.path=s.normalizePath(d)}else l.path=o.path,a.params||(l.params=o.params,a.query||(l.query=o.query));return null===l.path&&(l.path=n.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(l)},parseURL:function(e){var t=n.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(r,"");e.length!==(e=e.replace(a,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=s}()},function(e,t,n){"use strict";var i=n(6),r=n.n(i),a=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(2===arguments.length)for(var n=t.length,i=0;i<n;++i)t[i].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(t){e.push(t)})},e}(),s=n(9),o=n.n(s),u=n(5),l=n.n(u),c=n(10);n.d(t,"a",function(){return b});/*! @name m3u8-parser @version 4.7.1 @license Apache-2.0 */
19
- var d=function(e){function t(){var t;return t=e.call(this)||this,t.buffer="",t}return r()(t,e),t.prototype.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(a),h=String.fromCharCode(9),p=function(e){var 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},f=function(){return new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')},m=function(e){for(var t,n=e.split(f()),i={},r=n.length;r--;)""!==n[r]&&(t=/([^=]*)=(.*)/.exec(n[r]).slice(1),t[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),i[t[0]]=t[1]);return i},g=function(e){function t(){var t;return t=e.call(this)||this,t.customParsers=[],t.tagMappers=[],t}r()(t,e);var n=t.prototype;return n.push=function(e){var t,n,i=this;if(e=e.trim(),0!==e.length){if("#"!==e[0])return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce(function(t,n){var i=n(e);return i===e?t:t.concat([i])},[e]).forEach(function(e){for(var r=0;r<i.customParsers.length;r++)if(i.customParsers[r].call(i,e))return;if(0!==e.indexOf("#EXT"))return void i.trigger("data",{type:"comment",text:e.slice(1)});if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))return void i.trigger("data",{type:"tag",tagType:"m3u"});if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))return n={type:"tag",tagType:"inf"},t[1]&&(n.duration=parseFloat(t[1])),t[2]&&(n.title=t[2]),void i.trigger("data",n);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))return n={type:"tag",tagType:"targetduration"},t[1]&&(n.duration=parseInt(t[1],10)),void i.trigger("data",n);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))return n={type:"tag",tagType:"version"},t[1]&&(n.version=parseInt(t[1],10)),void i.trigger("data",n);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return n={type:"tag",tagType:"media-sequence"},t[1]&&(n.number=parseInt(t[1],10)),void i.trigger("data",n);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return n={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(n.number=parseInt(t[1],10)),void i.trigger("data",n);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))return n={type:"tag",tagType:"playlist-type"},t[1]&&(n.playlistType=t[1]),void i.trigger("data",n);if(t=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(e))return n=o()(p(t[1]),{type:"tag",tagType:"byterange"}),void i.trigger("data",n);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))return n={type:"tag",tagType:"allow-cache"},t[1]&&(n.allowed=!/NO/.test(t[1])),void i.trigger("data",n);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e)){if(n={type:"tag",tagType:"map"},t[1]){var a=m(t[1]);a.URI&&(n.uri=a.URI),a.BYTERANGE&&(n.byterange=p(a.BYTERANGE))}return void i.trigger("data",n)}if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e)){if(n={type:"tag",tagType:"stream-inf"},t[1]){if(n.attributes=m(t[1]),n.attributes.RESOLUTION){var s=n.attributes.RESOLUTION.split("x"),u={};s[0]&&(u.width=parseInt(s[0],10)),s[1]&&(u.height=parseInt(s[1],10)),n.attributes.RESOLUTION=u}n.attributes.BANDWIDTH&&(n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)),n.attributes["PROGRAM-ID"]&&(n.attributes["PROGRAM-ID"]=parseInt(n.attributes["PROGRAM-ID"],10))}return void i.trigger("data",n)}return(t=/^#EXT-X-MEDIA:?(.*)$/.exec(e))?(n={type:"tag",tagType:"media"},t[1]&&(n.attributes=m(t[1])),void i.trigger("data",n)):(t=/^#EXT-X-ENDLIST/.exec(e))?void i.trigger("data",{type:"tag",tagType:"endlist"}):(t=/^#EXT-X-DISCONTINUITY/.exec(e))?void i.trigger("data",{type:"tag",tagType:"discontinuity"}):(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))?(n={type:"tag",tagType:"program-date-time"},t[1]&&(n.dateTimeString=t[1],n.dateTimeObject=new Date(t[1])),void i.trigger("data",n)):(t=/^#EXT-X-KEY:?(.*)$/.exec(e))?(n={type:"tag",tagType:"key"},t[1]&&(n.attributes=m(t[1]),n.attributes.IV&&("0x"===n.attributes.IV.substring(0,2).toLowerCase()&&(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))),void i.trigger("data",n)):(t=/^#EXT-X-START:?(.*)$/.exec(e))?(n={type:"tag",tagType:"start"},t[1]&&(n.attributes=m(t[1]),n.attributes["TIME-OFFSET"]=parseFloat(n.attributes["TIME-OFFSET"]),n.attributes.PRECISE=/YES/.test(n.attributes.PRECISE)),void i.trigger("data",n)):(t=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e))?(n={type:"tag",tagType:"cue-out-cont"},t[1]?n.data=t[1]:n.data="",void i.trigger("data",n)):(t=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e))?(n={type:"tag",tagType:"cue-out"},t[1]?n.data=t[1]:n.data="",void i.trigger("data",n)):(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e))?(n={type:"tag",tagType:"cue-in"},t[1]?n.data=t[1]:n.data="",void i.trigger("data",n)):(t=/^#EXT-X-SKIP:(.*)$/.exec(e))&&t[1]?(n={type:"tag",tagType:"skip"},n.attributes=m(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(h)),void i.trigger("data",n)):(t=/^#EXT-X-PART:(.*)$/.exec(e))&&t[1]?(n={type:"tag",tagType:"part"},n.attributes=m(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=p(n.attributes.BYTERANGE)),void i.trigger("data",n)):(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e))&&t[1]?(n={type:"tag",tagType:"server-control"},n.attributes=m(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]))}),void i.trigger("data",n)):(t=/^#EXT-X-PART-INF:(.*)$/.exec(e))&&t[1]?(n={type:"tag",tagType:"part-inf"},n.attributes=m(t[1]),["PART-TARGET"].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))}),void i.trigger("data",n)):(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e))&&t[1]?(n={type:"tag",tagType:"preload-hint"},n.attributes=m(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(e){if(n.attributes.hasOwnProperty(e)){n.attributes[e]=parseInt(n.attributes[e],10);var t="BYTERANGE-LENGTH"===e?"length":"offset";n.attributes.byterange=n.attributes.byterange||{},n.attributes.byterange[t]=n.attributes[e],delete n.attributes[e]}}),void i.trigger("data",n)):(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e))&&t[1]?(n={type:"tag",tagType:"rendition-report"},n.attributes=m(t[1]),["LAST-MSN","LAST-PART"].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseInt(n.attributes[e],10))}),void i.trigger("data",n)):void i.trigger("data",{type:"tag",data:e.slice(4)})})}},n.addParser=function(e){var t=this,n=e.expression,i=e.customType,r=e.dataParser,a=e.segment;"function"!=typeof r&&(r=function(e){return e}),this.customParsers.push(function(e){if(n.exec(e))return t.trigger("data",{type:"custom",data:r(e),customType:i,segment:a}),!0})},n.addTagMapper=function(e){var t=e.expression,n=e.map,i=function(e){return t.test(e)?n(e):e};this.tagMappers.push(i)},t}(a),y=function(e){return e.toLowerCase().replace(/-(\w)/g,function(e){return e[1].toUpperCase()})},v=function(e){var t={};return Object.keys(e).forEach(function(n){t[y(n)]=e[n]}),t},_=function(e){var t=e.serverControl,n=e.targetDuration,i=e.partTargetDuration;if(t){var r="#EXT-X-SERVER-CONTROL",a="holdBack",s="partHoldBack",o=n&&3*n,u=i&&2*i;n&&!t.hasOwnProperty(a)&&(t[a]=o,this.trigger("info",{message:r+" defaulting HOLD-BACK to targetDuration * 3 ("+o+")."})),o&&t[a]<o&&(this.trigger("warn",{message:r+" clamping HOLD-BACK ("+t[a]+") to targetDuration * 3 ("+o+")"}),t[a]=o),i&&!t.hasOwnProperty(s)&&(t[s]=3*i,this.trigger("info",{message:r+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+t[s]+")."})),i&&t[s]<u&&(this.trigger("warn",{message:r+" clamping PART-HOLD-BACK ("+t[s]+") to partTargetDuration * 2 ("+u+")."}),t[s]=u)}},b=function(e){function t(){var t;t=e.call(this)||this,t.lineStream=new d,t.parseStream=new g,t.lineStream.pipe(t.parseStream);var n,i,r=l()(t),a=[],s={},u=!1,h=function(){},p={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},f=0;t.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var m=0,y=0;return t.on("end",function(){s.uri||!s.parts&&!s.preloadHints||(!s.map&&n&&(s.map=n),!s.key&&i&&(s.key=i),s.timeline||"number"!=typeof f||(s.timeline=f),t.manifest.preloadSegment=s)}),t.parseStream.on("data",function(e){var t,l;({tag:function(){(({version:function(){e.version&&(this.manifest.version=e.version)},"allow-cache":function(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var t={};"length"in e&&(s.byterange=t,t.length=e.length,"offset"in e||(e.offset=m)),"offset"in e&&(s.byterange=t,t.offset=e.offset),m=t.offset+t.length},endlist:function(){this.manifest.endList=!0},inf:function(){"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.duration>0&&(s.duration=e.duration),0===e.duration&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=a},key:function(){if(!e.attributes)return void this.trigger("warn",{message:"ignoring key declaration without attribute list"});if("NONE"===e.attributes.METHOD)return void(i=null);if(!e.attributes.URI)return void this.trigger("warn",{message:"ignoring key declaration without URI"});if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes});if("com.microsoft.playready"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:e.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT){return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:Object(c.a)(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),i={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(i.iv=e.attributes.IV)},"media-sequence":function(){if(!isFinite(e.number))return void this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number});this.manifest.mediaSequence=e.number},"discontinuity-sequence":function(){if(!isFinite(e.number))return void this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number});this.manifest.discontinuitySequence=e.number,f=e.number},"playlist-type":function(){if(!/VOD|EVENT/.test(e.playlistType))return void this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist});this.manifest.playlistType=e.playlistType},map:function(){n={},e.uri&&(n.uri=e.uri),e.byterange&&(n.byterange=e.byterange),i&&(n.key=i)},"stream-inf":function(){if(this.manifest.playlists=a,this.manifest.mediaGroups=this.manifest.mediaGroups||p,!e.attributes)return void this.trigger("warn",{message:"ignoring empty stream-inf attributes"});s.attributes||(s.attributes={}),o()(s.attributes,e.attributes)},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||p,!(e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});var n=this.manifest.mediaGroups[e.attributes.TYPE];n[e.attributes["GROUP-ID"]]=n[e.attributes["GROUP-ID"]]||{},t=n[e.attributes["GROUP-ID"]],l={default:/yes/i.test(e.attributes.DEFAULT)},l.default?l.autoselect=!0:l.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(l.language=e.attributes.LANGUAGE),e.attributes.URI&&(l.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(l.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(l.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(l.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=l},discontinuity:function(){f+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(a.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),s.dateTimeString=e.dateTimeString,s.dateTimeObject=e.dateTimeObject},targetduration:function(){if(!isFinite(e.duration)||e.duration<0)return void this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration});this.manifest.targetDuration=e.duration,_.call(this,this.manifest)},start:function(){if(!e.attributes||isNaN(e.attributes["TIME-OFFSET"]))return void this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}},"cue-out":function(){s.cueOut=e.data},"cue-out-cont":function(){s.cueOutCont=e.data},"cue-in":function(){s.cueIn=e.data},skip:function(){this.manifest.skip=v(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part:function(){var t=this;u=!0;var n=this.manifest.segments.length,i=v(e.attributes);s.parts=s.parts||[],s.parts.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=y),y=i.byterange.offset+i.byterange.length);var r=s.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+r+" for segment #"+n,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(e,n){e.hasOwnProperty("lastPart")||t.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+n+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var t=this.manifest.serverControl=v(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),_.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":function(){var t=this.manifest.segments.length,n=v(e.attributes),i=n.type&&"PART"===n.type;s.preloadHints=s.preloadHints||[],s.preloadHints.push(n),n.byterange&&(n.byterange.hasOwnProperty("offset")||(n.byterange.offset=i?y:0,i&&(y=n.byterange.offset+n.byterange.length)));var r=s.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+r+" for segment #"+t,e.attributes,["TYPE","URI"]),n.type)for(var a=0;a<s.preloadHints.length-1;a++){var o=s.preloadHints[a];o.type&&(o.type===n.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+r+" for segment #"+t+" has the same TYPE "+n.type+" as preload hint #"+a}))}},"rendition-report":function(){var t=v(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);var n=this.manifest.renditionReports.length-1,i=["LAST-MSN","URI"];u&&i.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+n,e.attributes,i)},"part-inf":function(){this.manifest.partInf=v(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),_.call(this,this.manifest)}})[e.tagType]||h).call(r)},uri:function(){s.uri=e.uri,a.push(s),!this.manifest.targetDuration||"duration"in s||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),i&&(s.key=i),s.timeline=f,n&&(s.map=n),y=0,s={}},comment:function(){},custom:function(){e.segment?(s.custom=s.custom||{},s.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(r)}),t}r()(t,e);var n=t.prototype;return n.warnOnMissingAttributes_=function(e,t,n){var i=[];n.forEach(function(e){t.hasOwnProperty(e)||i.push(e)}),i.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+i.join(", ")})},n.push=function(e){this.lineStream.push(e)},n.end=function(){this.lineStream.push("\n"),this.trigger("end")},n.addParser=function(e){this.parseStream.addParser(e)},n.addTagMapper=function(e){this.parseStream.addTagMapper(e)},t}(a)},function(e,t,n){"use strict";(function(e){function i(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function r(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=a.prototype):(null===e&&(e=new a(t)),e.length=t),e}function a(e,t,n){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return s(this,e,t,n)}function s(e,t,n,i){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?h(e,t,n,i):"string"==typeof t?c(e,t,n):p(e,t)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t,n,i){return o(t),t<=0?r(e,t):void 0!==n?"string"==typeof i?r(e,t).fill(n,i):r(e,t).fill(n):r(e,t)}function l(e,t){if(o(t),e=r(e,t<0?0:0|f(t)),!a.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function c(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!a.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=0|g(t,n);e=r(e,i);var s=e.write(t,n);return s!==i&&(e=e.slice(0,s)),e}function d(e,t){var n=t.length<0?0:0|f(t.length);e=r(e,n);for(var i=0;i<n;i+=1)e[i]=255&t[i];return e}function h(e,t,n,i){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,n):new Uint8Array(t,n,i),a.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=a.prototype):e=d(e,t),e}function p(e,t){if(a.isBuffer(t)){var n=0|f(t.length);return e=r(e,n),0===e.length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||K(t.length)?r(e,0):d(e,t);if("Buffer"===t.type&&J(t.data))return d(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function f(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function m(e){return+e!=e&&(e=0),a.alloc(+e)}function g(e,t){if(a.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return X(e).length;default:if(i)return W(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,n){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,n);case"utf8":case"utf-8":return I(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function v(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function _(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=a.from(t,i)),a.isBuffer(t))return 0===t.length?-1:b(e,t,n,i,r);if("number"==typeof t)return t&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,i,r){function a(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,o=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s=2,o/=2,u/=2,n/=2}var l;if(r){var c=-1;for(l=n;l<o;l++)if(a(e,l)===a(t,-1===c?0:l-c)){if(-1===c&&(c=l),l-c+1===u)return c*s}else-1!==c&&(l-=l-c),c=-1}else for(n+u>o&&(n=o-u),l=n;l>=0;l--){for(var d=!0,h=0;h<u;h++)if(a(e,l+h)!==a(t,h)){d=!1;break}if(d)return l}return-1}function T(e,t,n,i){n=Number(n)||0;var r=e.length-n;i?(i=Number(i))>r&&(i=r):i=r;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");i>a/2&&(i=a/2);for(var s=0;s<i;++s){var o=parseInt(t.substr(2*s,2),16);if(isNaN(o))return s;e[n+s]=o}return s}function S(e,t,n,i){return Y(W(t,e.length-n),e,n,i)}function E(e,t,n,i){return Y(G(t),e,n,i)}function w(e,t,n,i){return E(e,t,n,i)}function k(e,t,n,i){return Y(X(t),e,n,i)}function C(e,t,n,i){return Y(z(t,e.length-n),e,n,i)}function A(e,t,n){return 0===t&&n===e.length?Q.fromByteArray(e):Q.fromByteArray(e.slice(t,n))}function I(e,t,n){n=Math.min(e.length,n);for(var i=[],r=t;r<n;){var a=e[r],s=null,o=a>239?4:a>223?3:a>191?2:1;if(r+o<=n){var u,l,c,d;switch(o){case 1:a<128&&(s=a);break;case 2:u=e[r+1],128==(192&u)&&(d=(31&a)<<6|63&u)>127&&(s=d);break;case 3:u=e[r+1],l=e[r+2],128==(192&u)&&128==(192&l)&&(d=(15&a)<<12|(63&u)<<6|63&l)>2047&&(d<55296||d>57343)&&(s=d);break;case 4:u=e[r+1],l=e[r+2],c=e[r+3],128==(192&u)&&128==(192&l)&&128==(192&c)&&(d=(15&a)<<18|(63&u)<<12|(63&l)<<6|63&c)>65535&&d<1114112&&(s=d)}}null===s?(s=65533,o=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),r+=o}return x(i)}function x(e){var t=e.length;if(t<=Z)return String.fromCharCode.apply(String,e);for(var n="",i=0;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=Z));return n}function P(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(127&e[r]);return i}function O(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(e[r]);return i}function L(e,t,n){var i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);for(var r="",a=t;a<n;++a)r+=V(e[a]);return r}function D(e,t,n){for(var i=e.slice(t,n),r="",a=0;a<i.length;a+=2)r+=String.fromCharCode(i[a]+256*i[a+1]);return r}function R(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,i,r,s){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<s)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function N(e,t,n,i){t<0&&(t=65535+t+1);for(var r=0,a=Math.min(e.length-n,2);r<a;++r)e[n+r]=(t&255<<8*(i?r:1-r))>>>8*(i?r:1-r)}function U(e,t,n,i){t<0&&(t=4294967295+t+1);for(var r=0,a=Math.min(e.length-n,4);r<a;++r)e[n+r]=t>>>8*(i?r:3-r)&255}function B(e,t,n,i,r,a){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(e,t,n,i,r){return r||B(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(e,t,n,i,23,4),n+4}function F(e,t,n,i,r){return r||B(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(e,t,n,i,52,8),n+8}function H(e){if(e=q(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function q(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function V(e){return e<16?"0"+e.toString(16):e.toString(16)}function W(e,t){t=t||1/0;for(var n,i=e.length,r=null,a=[],s=0;s<i;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===i){(t-=3)>-1&&a.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&a.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function G(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function z(e,t){for(var n,i,r,a=[],s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),i=n>>8,r=n%256,a.push(r),a.push(i);return a}function X(e){return Q.toByteArray(H(e))}function Y(e,t,n,i){for(var r=0;r<i&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function K(e){return e!==e}/*!
20
- * The buffer module from node.js, for the browser.
21
- *
22
- * @author Feross Aboukhadijeh <http://feross.org>
23
- * @license MIT
24
- */
25
- var Q=n(39),$=n(40),J=n(41);t.Buffer=a,t.SlowBuffer=m,t.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=i(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,n){return s(null,e,t,n)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(e,t,n){return u(null,e,t,n)},a.allocUnsafe=function(e){return l(null,e)},a.allocUnsafeSlow=function(e){return l(null,e)},a.isBuffer=function(e){return!(null==e||!e._isBuffer)},a.compare=function(e,t){if(!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,r=0,s=Math.min(n,i);r<s;++r)if(e[r]!==t[r]){n=e[r],i=t[r];break}return n<i?-1:i<n?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!J(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=a.allocUnsafe(t),r=0;for(n=0;n<e.length;++n){var s=e[n];if(!a.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,r),r+=s.length}return i},a.byteLength=g,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},a.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?I(this,0,e):y.apply(this,arguments)},a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},a.prototype.compare=function(e,t,n,i,r){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),t<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,r>>>=0,this===e)return 0;for(var s=r-i,o=n-t,u=Math.min(s,o),l=this.slice(i,r),c=e.slice(t,n),d=0;d<u;++d)if(l[d]!==c[d]){s=l[d],o=c[d];break}return s<o?-1:o<s?1:0},a.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},a.prototype.indexOf=function(e,t,n){return _(this,e,t,n,!0)},a.prototype.lastIndexOf=function(e,t,n){return _(this,e,t,n,!1)},a.prototype.write=function(e,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return T(this,e,t,n);case"utf8":case"utf-8":return S(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return w(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;a.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var i;if(a.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=a.prototype;else{var r=t-e;i=new a(r,void 0);for(var s=0;s<r;++s)i[s]=this[s+e]}return i},a.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var i=this[e],r=1,a=0;++a<t&&(r*=256);)i+=this[e+a]*r;return i},a.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var i=this[e+--t],r=1;t>0&&(r*=256);)i+=this[e+--t]*r;return i},a.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var i=this[e],r=1,a=0;++a<t&&(r*=256);)i+=this[e+a]*r;return r*=128,i>=r&&(i-=Math.pow(2,8*t)),i},a.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var i=t,r=1,a=this[e+--i];i>0&&(r*=256);)a+=this[e+--i]*r;return r*=128,a>=r&&(a-=Math.pow(2,8*t)),a},a.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),$.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),$.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),$.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),$.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t|=0,n|=0,!i){M(this,e,t,n,Math.pow(2,8*n)-1,0)}var r=1,a=0;for(this[t]=255&e;++a<n&&(r*=256);)this[t+a]=e/r&255;return t+n},a.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t|=0,n|=0,!i){M(this,e,t,n,Math.pow(2,8*n)-1,0)}var r=n-1,a=1;for(this[t+r]=255&e;--r>=0&&(a*=256);)this[t+r]=e/a&255;return t+n},a.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):U(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t|=0,!i){var r=Math.pow(2,8*n-1);M(this,e,t,n,r-1,-r)}var a=0,s=1,o=0;for(this[t]=255&e;++a<n&&(s*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+n},a.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t|=0,!i){var r=Math.pow(2,8*n-1);M(this,e,t,n,r-1,-r)}var a=n-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):U(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,n){return j(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return j(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return F(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,i){if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var r,s=i-n;if(this===e&&n<t&&t<i)for(r=s-1;r>=0;--r)e[r+t]=this[r+n];else if(s<1e3||!a.TYPED_ARRAY_SUPPORT)for(r=0;r<s;++r)e[r+t]=this[r+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+s),t);return s},a.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===e.length){var r=e.charCodeAt(0);r<256&&(e=r)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var s;if("number"==typeof e)for(s=t;s<n;++s)this[s]=e;else{var o=a.isBuffer(e)?e:W(new a(e,i).toString()),u=o.length;for(s=0;s<n-t;++s)this[s+t]=o[s%u]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(t,n(2))},function(e,t,n){"use strict";function i(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function r(e){var t=i(e),n=t[0],r=t[1];return 3*(n+r)/4-r}function a(e,t,n){return 3*(t+n)/4-n}function s(e){var t,n,r=i(e),s=r[0],o=r[1],u=new h(a(e,s,o)),l=0,c=o>0?s-4:s;for(n=0;n<c;n+=4)t=d[e.charCodeAt(n)]<<18|d[e.charCodeAt(n+1)]<<12|d[e.charCodeAt(n+2)]<<6|d[e.charCodeAt(n+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===o&&(t=d[e.charCodeAt(n)]<<2|d[e.charCodeAt(n+1)]>>4,u[l++]=255&t),1===o&&(t=d[e.charCodeAt(n)]<<10|d[e.charCodeAt(n+1)]<<4|d[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u}function o(e){return c[e>>18&63]+c[e>>12&63]+c[e>>6&63]+c[63&e]}function u(e,t,n){for(var i,r=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),r.push(o(i));return r.join("")}function l(e){for(var t,n=e.length,i=n%3,r=[],a=0,s=n-i;a<s;a+=16383)r.push(u(e,a,a+16383>s?s:a+16383));return 1===i?(t=e[n-1],r.push(c[t>>2]+c[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],r.push(c[t>>10]+c[t>>4&63]+c[t<<2&63]+"=")),r.join("")}t.byteLength=r,t.toByteArray=s,t.fromByteArray=l;for(var c=[],d=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,m=p.length;f<m;++f)c[f]=p[f],d[p.charCodeAt(f)]=f;d["-".charCodeAt(0)]=62,d["_".charCodeAt(0)]=63},function(e,t){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
26
- t.read=function(e,t,n,i,r){var a,s,o=8*r-i-1,u=(1<<o)-1,l=u>>1,c=-7,d=n?r-1:0,h=n?-1:1,p=e[t+d];for(d+=h,a=p&(1<<-c)-1,p>>=-c,c+=o;c>0;a=256*a+e[t+d],d+=h,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=i;c>0;s=256*s+e[t+d],d+=h,c-=8);if(0===a)a=1-l;else{if(a===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,i),a-=l}return(p?-1:1)*s*Math.pow(2,a-i)},t.write=function(e,t,n,i,r,a){var s,o,u,l=8*a-r-1,c=(1<<l)-1,d=c>>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:a-1,f=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+d>=1?h/u:h*Math.pow(2,1-d),t*u>=2&&(s++,u/=2),s+d>=c?(o=0,s=c):s+d>=1?(o=(t*u-1)*Math.pow(2,r),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,r),s=0));r>=8;e[n+p]=255&o,p+=f,o/=256,r-=8);for(s=s<<r|o,l+=r;l>0;e[n+p]=255&s,p+=f,s/=256,l-=8);e[n+p-f]|=128*m}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";n.d(t,"i",function(){return u}),n.d(t,"h",function(){return l}),n.d(t,"d",function(){return c}),n.d(t,"f",function(){return d}),n.d(t,"e",function(){return p}),n.d(t,"c",function(){return f}),n.d(t,"g",function(){return m}),n.d(t,"a",function(){return g}),n.d(t,"b",function(){return y});var i=n(1),r=n.n(i),a={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^/},s=["video","audio","text"],o=["Video","Audio","Text"],u=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,n){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(n).toString(16)).slice(-2)}):e},l=function(e){void 0===e&&(e="");var t=e.split(","),n=[];return t.forEach(function(e){e=e.trim();var t;s.forEach(function(i){var r=a[i].exec(e.toLowerCase());if(r&&!(r.length<=1)){t=i;var s=e.substring(0,r[1].length),o=e.replace(s,"");n.push({type:s,details:o,mediaType:i})}}),t||n.push({type:e,details:"",mediaType:"unknown"})}),n},c=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var n=e.mediaGroups.AUDIO[t];if(!n)return null;for(var i in n){var r=n[i];if(r.default&&r.playlists)return l(r.playlists[0].attributes.CODECS)}return null},d=function(e){return void 0===e&&(e=""),a.audio.test(e.trim().toLowerCase())},h=function(e){return void 0===e&&(e=""),a.text.test(e.trim().toLowerCase())},p=function(e){if(e&&"string"==typeof e){var t=e.toLowerCase().split(",").map(function(e){return u(e.trim())}),n="video";1===t.length&&d(t[0])?n="audio":1===t.length&&h(t[0])&&(n="application");var i="mp4";return t.every(function(e){return a.mp4.test(e)})?i="mp4":t.every(function(e){return a.webm.test(e)})?i="webm":t.every(function(e){return a.ogg.test(e)})&&(i="ogg"),n+"/"+i+';codecs="'+e+'"'}},f=function(e){return void 0===e&&(e=""),r.a.MediaSource&&r.a.MediaSource.isTypeSupported&&r.a.MediaSource.isTypeSupported(p(e))||!1},m=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every(function(e){e=e.trim();for(var t=0;t<o.length;t++){if(a["muxer"+o[t]].test(e))return!0}return!1})},g="mp4a.40.2",y="avc1.4d400d"},function(e,t,n){"use strict";var i=n(8),r=n(1),a=n.n(r),s=function(e,t,n){t.forEach(function(t){for(var i in e.mediaGroups[t])for(var r in e.mediaGroups[t][i]){var a=e.mediaGroups[t][i][r];n(a,t,i,r)}})},o=n(10),u=n(44);n.d(t,"a",function(){return C}),n.d(t,"b",function(){return R}),n.d(t,"c",function(){return ke}),n.d(t,"d",function(){return Ce});/*! @name mpd-parser @version 0.21.1 @license Apache-2.0 */
27
- var l=function(e){return!!e&&"object"==typeof e},c=function e(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return n.reduce(function(t,n){return"object"!=typeof n?t:(Object.keys(n).forEach(function(i){Array.isArray(t[i])&&Array.isArray(n[i])?t[i]=t[i].concat(n[i]):l(t[i])&&l(n[i])?t[i]=e(t[i],n[i]):t[i]=n[i]}),t)},{})},d=function(e){return Object.keys(e).map(function(t){return e[t]})},h=function(e,t){for(var n=[],i=e;i<t;i++)n.push(i);return n},p=function(e){return e.reduce(function(e,t){return e.concat(t)},[])},f=function(e){if(!e.length)return[];for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t},m=function(e,t){return e.reduce(function(e,n,i){return n[t]&&e.push(i),e},[])},g=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1},y=function(e,t){return d(e.reduce(function(e,n){return n.forEach(function(n){e[t(n)]=n}),e},{}))},v={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",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"},_=function(e){var t=e.baseUrl,n=void 0===t?"":t,r=e.source,s=void 0===r?"":r,o=e.range,u=void 0===o?"":o,l=e.indexRange,c=void 0===l?"":l,d={uri:s,resolvedUri:Object(i.a)(n||"",s)};if(u||c){var h=u||c,p=h.split("-"),f=a.a.BigInt?a.a.BigInt(p[0]):parseInt(p[0],10),m=a.a.BigInt?a.a.BigInt(p[1]):parseInt(p[1],10);f<Number.MAX_SAFE_INTEGER&&"bigint"==typeof f&&(f=Number(f)),m<Number.MAX_SAFE_INTEGER&&"bigint"==typeof m&&(m=Number(m));var g;g="bigint"==typeof m||"bigint"==typeof f?a.a.BigInt(m)-a.a.BigInt(f)+a.a.BigInt(1):m-f+1,"bigint"==typeof g&&g<Number.MAX_SAFE_INTEGER&&(g=Number(g)),d.byterange={length:g,offset:f}}return d},b=function(e){var t;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?a.a.BigInt(e.offset)+a.a.BigInt(e.length)-a.a.BigInt(1):e.offset+e.length-1,e.offset+"-"+t},T=function(e){return e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e},S={static:function(e){var t=e.duration,n=e.timescale,i=void 0===n?1:n,r=e.sourceDuration,a=e.periodDuration,s=T(e.endNumber),o=t/i;return"number"==typeof s?{start:0,end:s}:"number"==typeof a?{start:0,end:a/o}:{start:0,end:r/o}},dynamic:function(e){var t=e.NOW,n=e.clientOffset,i=e.availabilityStartTime,r=e.timescale,a=void 0===r?1:r,s=e.duration,o=e.periodStart,u=void 0===o?0:o,l=e.minimumUpdatePeriod,c=void 0===l?0:l,d=e.timeShiftBufferDepth,h=void 0===d?1/0:d,p=T(e.endNumber),f=(t+n)/1e3,m=i+u,g=f+c,y=g-m,v=Math.ceil(y*a/s),_=Math.floor((f-m-h)*a/s),b=Math.floor((f-m)*a/s);return{start:Math.max(0,_),end:"number"==typeof p?p:Math.min(v,b)}}},E=function(e){return function(t){var n=e.duration,i=e.timescale,r=void 0===i?1:i,a=e.periodStart,s=e.startNumber;return{number:(void 0===s?1:s)+t,duration:n/r,timeline:a,time:t*n}}},w=function(e){var t=e.type,n=e.duration,i=e.timescale,r=void 0===i?1:i,a=e.periodDuration,s=e.sourceDuration,o=S[t](e),u=o.start,l=o.end,c=h(u,l).map(E(e));if("static"===t){var d=c.length-1,p="number"==typeof a?a:s;c[d].duration=p-n/r*d}return c},k=function(e){var t=e.baseUrl,n=e.initialization,i=void 0===n?{}:n,r=e.sourceDuration,a=e.indexRange,s=void 0===a?"":a,o=e.periodStart,u=e.presentationTime,l=e.number,c=void 0===l?0:l,d=e.duration;if(!t)throw new Error(v.NO_BASE_URL);var h=_({baseUrl:t,source:i.sourceURL,range:i.range}),p=_({baseUrl:t,source:t,indexRange:s});if(p.map=h,d){var f=w(e);f.length&&(p.duration=f[0].duration,p.timeline=f[0].timeline)}else r&&(p.duration=r,p.timeline=o);return p.presentationTime=u||o,p.number=c,[p]},C=function(e,t,n){var i,r=e.sidx.map?e.sidx.map:null,s=e.sidx.duration,o=e.timeline||0,u=e.sidx.byterange,l=u.offset+u.length,c=t.timescale,d=t.references.filter(function(e){return 1!==e.referenceType}),h=[],p=e.endList?"static":"dynamic",f=e.sidx.timeline,m=f,g=e.mediaSequence||0;i="bigint"==typeof t.firstOffset?a.a.BigInt(l)+t.firstOffset:l+t.firstOffset;for(var y=0;y<d.length;y++){var v=t.references[y],_=v.referencedSize,b=v.subsegmentDuration,T=void 0;T="bigint"==typeof i?i+a.a.BigInt(_)-a.a.BigInt(1):i+_-1;var S=i+"-"+T,E={baseUrl:n,timescale:c,timeline:o,periodStart:f,presentationTime:m,number:g,duration:b,sourceDuration:s,indexRange:S,type:p},w=k(E)[0];r&&(w.map=r),h.push(w),i+="bigint"==typeof i?a.a.BigInt(_):_,m+=b/c,g++}return e.segments=h,e},A=["AUDIO","SUBTITLES"],I=function(e){return y(e,function(e){return e.timeline}).sort(function(e,t){return e.timeline>t.timeline?1:-1})},x=function(e,t){for(var n=0;n<e.length;n++)if(e[n].attributes.NAME===t)return e[n];return null},P=function(e){var t=[];return s(e,A,function(e,n,i,r){t=t.concat(e.playlists||[])}),t},O=function(e){var t=e.playlist,n=e.mediaSequence;t.mediaSequence=n,t.segments.forEach(function(e,n){e.number=t.mediaSequence+n})},L=function(e){var t=e.oldPlaylists,n=e.newPlaylists,i=e.timelineStarts;n.forEach(function(e){e.discontinuitySequence=g(i,function(t){return t.timeline===e.timeline});var n=x(t,e.attributes.NAME);if(n&&!e.sidx){var r=e.segments[0],a=g(n.segments,function(e){return Math.abs(e.presentationTime-r.presentationTime)<1/60});if(-1===a)return O({playlist:e,mediaSequence:n.mediaSequence+n.segments.length}),e.segments[0].discontinuity=!0,e.discontinuityStarts.unshift(0),void((!n.segments.length&&e.timeline>n.timeline||n.segments.length&&e.timeline>n.segments[n.segments.length-1].timeline)&&e.discontinuitySequence--);n.segments[a].discontinuity&&!r.discontinuity&&(r.discontinuity=!0,e.discontinuityStarts.unshift(0),e.discontinuitySequence--),O({playlist:e,mediaSequence:n.segments[a].number})}})},D=function(e){var t=e.oldManifest,n=e.newManifest,i=t.playlists.concat(P(t)),r=n.playlists.concat(P(n));return n.timelineStarts=I([t.timelineStarts,n.timelineStarts]),L({oldPlaylists:i,newPlaylists:r,timelineStarts:n.timelineStarts}),n},R=function(e){return e&&e.uri+"-"+b(e.byterange)},M=function(e){return d(e.reduce(function(e,t){var n=t.attributes.id+(t.attributes.lang||"");if(e[n]){if(t.segments){var i;t.segments[0]&&(t.segments[0].discontinuity=!0),(i=e[n].segments).push.apply(i,t.segments)}t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)}else e[n]=t,e[n].attributes.timelineStarts=[];return e[n].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e},{})).map(function(e){return e.discontinuityStarts=m(e.segments||[],"discontinuity"),e})},N=function(e,t){var n=R(e.sidx),i=n&&t[n]&&t[n].sidx;return i&&C(e,i,e.sidx.resolvedUri),e},U=function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var n in e)e[n]=N(e[n],t);return e},B=function(e,t){var n,i=e.attributes,r=e.segments,a=e.sidx,s=e.mediaSequence,o=e.discontinuitySequence,u=e.discontinuityStarts,l={attributes:(n={NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs},n["PROGRAM-ID"]=1,n),uri:"",endList:"static"===i.type,timeline:i.periodStart,resolvedUri:"",targetDuration:i.duration,discontinuitySequence:o,discontinuityStarts:u,timelineStarts:i.timelineStarts,mediaSequence:s,segments:r};return i.contentProtection&&(l.contentProtection=i.contentProtection),a&&(l.sidx=a),t&&(l.attributes.AUDIO="audio",l.attributes.SUBTITLES="subs"),l},j=function(e){var t,n=e.attributes,i=e.segments,r=e.mediaSequence,a=e.discontinuityStarts,s=e.discontinuitySequence;void 0===i&&(i=[{uri:n.baseUrl,timeline:n.periodStart,resolvedUri:n.baseUrl||"",duration:n.sourceDuration,number:0}],n.duration=n.sourceDuration);var o=(t={NAME:n.id,BANDWIDTH:n.bandwidth},t["PROGRAM-ID"]=1,t);return n.codecs&&(o.CODECS=n.codecs),{attributes:o,uri:"",endList:"static"===n.type,timeline:n.periodStart,resolvedUri:n.baseUrl||"",targetDuration:n.duration,timelineStarts:n.timelineStarts,discontinuityStarts:a,discontinuitySequence:s,mediaSequence:r,segments:i}},F=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n=!1);var i,r=e.reduce(function(e,r){var a=r.attributes.role&&r.attributes.role.value||"",s=r.attributes.lang||"",o=r.attributes.label||"main";if(s&&!r.attributes.label){var u=a?" ("+a+")":"";o=""+r.attributes.lang+u}e[o]||(e[o]={language:s,autoselect:!0,default:"main"===a,playlists:[],uri:""});var l=N(B(r,n),t);return e[o].playlists.push(l),void 0===i&&"main"===a&&(i=r,i.default=!0),e},{});if(!i){r[Object.keys(r)[0]].default=!0}return r},H=function(e,t){return void 0===t&&(t={}),e.reduce(function(e,n){var i=n.attributes.lang||"text";return e[i]||(e[i]={language:i,default:!1,autoselect:!1,playlists:[],uri:""}),e[i].playlists.push(N(j(n),t)),e},{})},q=function(e){return e.reduce(function(e,t){return t?(t.forEach(function(t){var n=t.channel,i=t.language;e[i]={autoselect:!1,default:!1,instreamId:n,language:i},t.hasOwnProperty("aspectRatio")&&(e[i].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[i].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[i]["3D"]=t["3D"])}),e):e},{})},V=function(e){var t,n=e.attributes,i=e.segments,r=e.sidx,a=e.discontinuityStarts,s={attributes:(t={NAME:n.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:n.width,height:n.height},CODECS:n.codecs,BANDWIDTH:n.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===n.type,timeline:n.periodStart,resolvedUri:"",targetDuration:n.duration,discontinuityStarts:a,timelineStarts:n.timelineStarts,segments:i};return n.contentProtection&&(s.contentProtection=n.contentProtection),r&&(s.sidx=r),s},W=function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},G=function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},z=function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},X=function(e,t){e.forEach(function(e){e.mediaSequence=0,e.discontinuitySequence=g(t,function(t){return t.timeline===e.timeline}),e.segments&&e.segments.forEach(function(e,t){e.number=t})})},Y=function(e){return e?Object.keys(e).reduce(function(t,n){var i=e[n];return t.concat(i.playlists)},[]):[]},K=function(e){var t,n=e.dashPlaylists,i=e.locations,r=e.sidxMapping,a=void 0===r?{}:r,s=e.previousManifest;if(!n.length)return{};var o=n[0].attributes,u=o.sourceDuration,l=o.type,c=o.suggestedPresentationDelay,d=o.minimumUpdatePeriod,h=M(n.filter(W)).map(V),p=M(n.filter(G)),f=M(n.filter(z)),m=n.map(function(e){return e.attributes.captionServices}).filter(Boolean),g={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:u,playlists:U(h,a)};d>=0&&(g.minimumUpdatePeriod=1e3*d),i&&(g.locations=i),"dynamic"===l&&(g.suggestedPresentationDelay=c);var y=0===g.playlists.length,v=p.length?F(p,a,y):null,_=f.length?H(f,a):null,b=h.concat(Y(v),Y(_)),T=b.map(function(e){return e.timelineStarts});return g.timelineStarts=I(T),X(b,g.timelineStarts),v&&(g.mediaGroups.AUDIO.audio=v),_&&(g.mediaGroups.SUBTITLES.subs=_),m.length&&(g.mediaGroups["CLOSED-CAPTIONS"].cc=q(m)),s?D({oldManifest:s,newManifest:g}):g},Q=function(e,t,n){var i=e.NOW,r=e.clientOffset,a=e.availabilityStartTime,s=e.timescale,o=void 0===s?1:s,u=e.periodStart,l=void 0===u?0:u,c=e.minimumUpdatePeriod,d=void 0===c?0:c,h=(i+r)/1e3,p=a+l,f=h+d,m=f-p;return Math.ceil((m*o-t)/n)},$=function(e,t){for(var n=e.type,i=e.minimumUpdatePeriod,r=void 0===i?0:i,a=e.media,s=void 0===a?"":a,o=e.sourceDuration,u=e.timescale,l=void 0===u?1:u,c=e.startNumber,d=void 0===c?1:c,h=e.periodStart,p=[],f=-1,m=0;m<t.length;m++){var g=t[m],y=g.d,v=g.r||0,_=g.t||0;f<0&&(f=_),_&&_>f&&(f=_);var b=void 0;if(v<0){var T=m+1;b=T===t.length?"dynamic"===n&&r>0&&s.indexOf("$Number$")>0?Q(e,f,y):(o*l-f)/y:(t[T].t-f)/y}else b=v+1;for(var S=d+p.length+b,E=d+p.length;E<S;)p.push({number:E,duration:y/l,time:f,timeline:h}),f+=y,E++}return p},J=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Z=function(e){return function(t,n,i,r){if("$$"===t)return"$";if(void 0===e[n])return t;var a=""+e[n];return"RepresentationID"===n?a:(r=i?parseInt(r,10):1,a.length>=r?a:""+new Array(r-a.length+1).join("0")+a)}},ee=function(e,t){return e.replace(J,Z(t))},te=function(e,t){return e.duration||t?e.duration?w(e):$(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]},ne=function(e,t){var n={RepresentationID:e.id,Bandwidth:e.bandwidth||0},r=e.initialization,a=void 0===r?{sourceURL:"",range:""}:r,s=_({baseUrl:e.baseUrl,source:ee(a.sourceURL,n),range:a.range});return te(e,t).map(function(t){n.Number=t.number,n.Time=t.time;var r=ee(e.media||"",n),a=e.timescale||1,o=e.presentationTimeOffset||0,u=e.periodStart+(t.time-o)/a;return{uri:r,timeline:t.timeline,duration:t.duration,resolvedUri:Object(i.a)(e.baseUrl||"",r),map:s,number:t.number,presentationTime:u}})},ie=function(e,t){var n=e.baseUrl,i=e.initialization,r=void 0===i?{}:i,a=_({baseUrl:n,source:r.sourceURL,range:r.range}),s=_({baseUrl:n,source:t.media,range:t.mediaRange});return s.map=a,s},re=function(e,t){var n=e.duration,i=e.segmentUrls,r=void 0===i?[]:i,a=e.periodStart;if(!n&&!t||n&&t)throw new Error(v.SEGMENT_TIME_UNSPECIFIED);var s,o=r.map(function(t){return ie(e,t)});return n&&(s=w(e)),t&&(s=$(e,t)),s.map(function(t,n){if(o[n]){var i=o[n],r=e.timescale||1,s=e.presentationTimeOffset||0;return i.timeline=t.timeline,i.duration=t.duration,i.number=t.number,i.presentationTime=a+(t.time-s)/r,i}}).filter(function(e){return e})},ae=function(e){var t,n,i=e.attributes,r=e.segmentInfo;r.template?(n=ne,t=c(i,r.template)):r.base?(n=k,t=c(i,r.base)):r.list&&(n=re,t=c(i,r.list));var a={attributes:i};if(!n)return a;var s=n(t,r.segmentTimeline);if(t.duration){var o=t,u=o.duration,l=o.timescale,d=void 0===l?1:l;t.duration=u/d}else s.length?t.duration=s.reduce(function(e,t){return Math.max(e,Math.ceil(t.duration))},0):t.duration=0;return a.attributes=t,a.segments=s,r.base&&t.indexRange&&(a.sidx=s[0],a.segments=[]),a},se=function(e){return e.map(ae)},oe=function(e,t){return f(e.childNodes).filter(function(e){return e.tagName===t})},ue=function(e){return e.textContent.trim()},le=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/,n=t.exec(e);if(!n)return 0;var i=n.slice(1),r=i[0],a=i[1],s=i[2],o=i[3],u=i[4],l=i[5];return 31536e3*parseFloat(r||0)+2592e3*parseFloat(a||0)+86400*parseFloat(s||0)+3600*parseFloat(o||0)+60*parseFloat(u||0)+parseFloat(l||0)},ce=function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),Date.parse(e)},de={mediaPresentationDuration:function(e){return le(e)},availabilityStartTime:function(e){return ce(e)/1e3},minimumUpdatePeriod:function(e){return le(e)},suggestedPresentationDelay:function(e){return le(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return le(e)},start:function(e){return le(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?le(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},he=function(e){return e&&e.attributes?f(e.attributes).reduce(function(e,t){var n=de[t.name]||de.DEFAULT;return e[t.name]=n(t.value),e},{}):{}},pe={"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"},fe=function(e,t){return t.length?p(e.map(function(e){return t.map(function(t){return Object(i.a)(e,ue(t))})})):e},me=function(e){var t=oe(e,"SegmentTemplate")[0],n=oe(e,"SegmentList")[0],i=n&&oe(n,"SegmentURL").map(function(e){return c({tag:"SegmentURL"},he(e))}),r=oe(e,"SegmentBase")[0],a=n||t,s=a&&oe(a,"SegmentTimeline")[0],o=n||r||t,u=o&&oe(o,"Initialization")[0],l=t&&he(t);l&&u?l.initialization=u&&he(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var d={template:l,segmentTimeline:s&&oe(s,"S").map(function(e){return he(e)}),list:n&&c(he(n),{segmentUrls:i,initialization:he(u)}),base:r&&c(he(r),{initialization:he(u)})};return Object.keys(d).forEach(function(e){d[e]||delete d[e]}),d},ge=function(e,t,n){return function(i){var r=oe(i,"BaseURL"),a=fe(t,r),s=c(e,he(i)),o=me(i);return a.map(function(e){return{segmentInfo:c(n,o),attributes:c(s,{baseUrl:e})}})}},ye=function(e){return e.reduce(function(e,t){var n=he(t);n.schemeIdUri&&(n.schemeIdUri=n.schemeIdUri.toLowerCase());var i=pe[n.schemeIdUri];if(i){e[i]={attributes:n};var r=oe(t,"cenc:pssh")[0];if(r){var a=ue(r);e[i].pssh=a&&Object(o.a)(a)}}return e},{})},ve=function(e){if("urn:scte:dash:cc:cea-608:2015"===e.schemeIdUri){return("string"!=typeof e.value?[]:e.value.split(";")).map(function(e){var t,n;if(n=e,/^CC\d=/.test(e)){var i=e.split("=");t=i[0],n=i[1]}else/^CC\d$/.test(e)&&(t=e);return{channel:t,language:n}})}if("urn:scte:dash:cc:cea-708:2015"===e.schemeIdUri){return("string"!=typeof e.value?[]:e.value.split(";")).map(function(e){var t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var n=e.split("="),i=n[0],r=n[1],a=void 0===r?"":r;t.channel=i,t.language=e,a.split(",").forEach(function(e){var n=e.split(":"),i=n[0],r=n[1];"lang"===i?t.language=r:"er"===i?t.easyReader=Number(r):"war"===i?t.aspectRatio=Number(r):"3D"===i&&(t["3D"]=Number(r))})}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})}},_e=function(e,t,n){return function(i){var r=he(i),a=fe(t,oe(i,"BaseURL")),s=oe(i,"Role")[0],o={role:he(s)},u=c(e,r,o),l=oe(i,"Accessibility")[0],d=ve(he(l));d&&(u=c(u,{captionServices:d}));var h=oe(i,"Label")[0];if(h&&h.childNodes.length){var f=h.childNodes[0].nodeValue.trim();u=c(u,{label:f})}var m=ye(oe(i,"ContentProtection"));Object.keys(m).length&&(u=c(u,{contentProtection:m}));var g=me(i),y=oe(i,"Representation"),v=c(n,g);return p(y.map(ge(u,a,v)))}},be=function(e,t){return function(n,i){var r=fe(t,oe(n.node,"BaseURL")),a=c(e,{periodStart:n.attributes.start});"number"==typeof n.attributes.duration&&(a.periodDuration=n.attributes.duration);var s=oe(n.node,"AdaptationSet"),o=me(n.node);return p(s.map(_e(a,r,o)))}},Te=function(e){var t=e.attributes,n=e.priorPeriodAttributes,i=e.mpdType;return"number"==typeof t.start?t.start:n&&"number"==typeof n.start&&"number"==typeof n.duration?n.start+n.duration:n||"static"!==i?null:0},Se=function(e,t){void 0===t&&(t={});var n=t,i=n.manifestUri,r=void 0===i?"":i,a=n.NOW,s=void 0===a?Date.now():a,o=n.clientOffset,u=void 0===o?0:o,l=oe(e,"Period");if(!l.length)throw new Error(v.INVALID_NUMBER_OF_PERIOD);var c=oe(e,"Location"),d=he(e),h=fe([r],oe(e,"BaseURL"));d.type=d.type||"static",d.sourceDuration=d.mediaPresentationDuration||0,d.NOW=s,d.clientOffset=u,c.length&&(d.locations=c.map(ue));var f=[];return l.forEach(function(e,t){var n=he(e),i=f[t-1];n.start=Te({attributes:n,priorPeriodAttributes:i?i.attributes:null,mpdType:d.type}),f.push({node:e,attributes:n})}),{locations:d.locations,representationInfo:p(f.map(be(d,h)))}},Ee=function(e){if(""===e)throw new Error(v.DASH_EMPTY_MANIFEST);var t,n,i=new u.DOMParser;try{t=i.parseFromString(e,"application/xml"),n=t&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(e){}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error(v.DASH_INVALID_XML);return n},we=function(e){var t=oe(e,"UTCTiming")[0];if(!t)return null;var n=he(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;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(v.UNSUPPORTED_UTC_TIMING_SCHEME)}return n},ke=function(e,t){void 0===t&&(t={});var n=Se(Ee(e),t),i=se(n.representationInfo);return K({dashPlaylists:i,locations:n.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})},Ce=function(e){return we(Ee(e))}},function(e,t,n){var i=n(12);t.DOMImplementation=i.DOMImplementation,t.XMLSerializer=i.XMLSerializer,t.DOMParser=n(45).DOMParser},function(e,t,n){function i(e){this.options=e||{locator:{}}}function r(e,t,n){function i(t){var i=e[t];!i&&s&&(i=2==e.length?function(n){e(t,n)}:e),r[t]=i&&function(e){i("[xmldom "+t+"]\t"+e+o(n))}||function(){}}if(!e){if(t instanceof a)return t;e=t}var r={},s=e instanceof Function;return n=n||{},i("warning"),i("error"),i("fatalError"),r}function a(){this.cdata=!1}function s(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function o(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function u(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function l(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}var c=n(4),d=n(12),h=n(46),p=n(47),f=d.DOMImplementation,m=c.NAMESPACE,g=p.ParseError,y=p.XMLReader;i.prototype.parseFromString=function(e,t){var n=this.options,i=new y,s=n.domBuilder||new a,o=n.errorHandler,u=n.locator,l=n.xmlns||{},c=/\/x?html?$/.test(t),d=c?h.HTML_ENTITIES:h.XML_ENTITIES;return u&&s.setDocumentLocator(u),i.errorHandler=r(o,s,u),i.domBuilder=n.domBuilder||s,c&&(l[""]=m.HTML),l.xml=l.xml||m.XML,e&&"string"==typeof e?i.parse(e,l,d):i.errorHandler.error("invalid doc source"),s.doc},a.prototype={startDocument:function(){this.doc=(new f).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,i){var r=this.doc,a=r.createElementNS(e,n||t),o=i.length;l(this,a),this.currentElement=a,this.locator&&s(this.locator,a);for(var u=0;u<o;u++){var e=i.getURI(u),c=i.getValue(u),n=i.getQName(u),d=r.createAttributeNS(e,n);this.locator&&s(i.getLocator(u),d),d.value=d.nodeValue=c,a.setAttributeNode(d)}},endElement:function(e,t,n){var i=this.currentElement;i.tagName;this.currentElement=i.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&s(this.locator,n),l(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=u.apply(this,arguments)){if(this.cdata)var i=this.doc.createCDATASection(e);else var i=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(i):/^\s*$/.test(e)&&this.doc.appendChild(i),this.locator&&s(this.locator,i)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=u.apply(this,arguments);var i=this.doc.createComment(e);this.locator&&s(this.locator,i),l(this,i)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var i=this.doc.implementation;if(i&&i.createDocumentType){var r=i.createDocumentType(e,t,n);this.locator&&s(this.locator,r),l(this,r),this.doc.doctype=r}},warning:function(e){console.warn("[xmldom warning]\t"+e,o(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,o(this.locator))},fatalError:function(e){throw new g(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){a.prototype[e]=function(){return null}}),t.__DOMHandler=a,t.DOMParser=i,t.DOMImplementation=d.DOMImplementation,t.XMLSerializer=d.XMLSerializer},function(e,t,n){var i=n(4).freeze;t.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=i({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"\xc0",Aacute:"\xc1",Acirc:"\xc2",Atilde:"\xc3",Auml:"\xc4",Aring:"\xc5",AElig:"\xc6",Ccedil:"\xc7",Egrave:"\xc8",Eacute:"\xc9",Ecirc:"\xca",Euml:"\xcb",Igrave:"\xcc",Iacute:"\xcd",Icirc:"\xce",Iuml:"\xcf",ETH:"\xd0",Ntilde:"\xd1",Ograve:"\xd2",Oacute:"\xd3",Ocirc:"\xd4",Otilde:"\xd5",Ouml:"\xd6",Oslash:"\xd8",Ugrave:"\xd9",Uacute:"\xda",Ucirc:"\xdb",Uuml:"\xdc",Yacute:"\xdd",THORN:"\xde",szlig:"\xdf",agrave:"\xe0",aacute:"\xe1",acirc:"\xe2",atilde:"\xe3",auml:"\xe4",aring:"\xe5",aelig:"\xe6",ccedil:"\xe7",egrave:"\xe8",eacute:"\xe9",ecirc:"\xea",euml:"\xeb",igrave:"\xec",iacute:"\xed",icirc:"\xee",iuml:"\xef",eth:"\xf0",ntilde:"\xf1",ograve:"\xf2",oacute:"\xf3",ocirc:"\xf4",otilde:"\xf5",ouml:"\xf6",oslash:"\xf8",ugrave:"\xf9",uacute:"\xfa",ucirc:"\xfb",uuml:"\xfc",yacute:"\xfd",thorn:"\xfe",yuml:"\xff",nbsp:"\xa0",iexcl:"\xa1",cent:"\xa2",pound:"\xa3",curren:"\xa4",yen:"\xa5",brvbar:"\xa6",sect:"\xa7",uml:"\xa8",copy:"\xa9",ordf:"\xaa",laquo:"\xab",not:"\xac",shy:"\xad\xad",reg:"\xae",macr:"\xaf",deg:"\xb0",plusmn:"\xb1",sup2:"\xb2",sup3:"\xb3",acute:"\xb4",micro:"\xb5",para:"\xb6",middot:"\xb7",cedil:"\xb8",sup1:"\xb9",ordm:"\xba",raquo:"\xbb",frac14:"\xbc",frac12:"\xbd",frac34:"\xbe",iquest:"\xbf",times:"\xd7",divide:"\xf7",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220b",prod:"\u220f",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221a",prop:"\u221d",infin:"\u221e",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222a",int:"\u222b",there4:"\u2234",sim:"\u223c",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22a5",sdot:"\u22c5",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039a",Lambda:"\u039b",Mu:"\u039c",Nu:"\u039d",Xi:"\u039e",Omicron:"\u039f",Pi:"\u03a0",Rho:"\u03a1",Sigma:"\u03a3",Tau:"\u03a4",Upsilon:"\u03a5",Phi:"\u03a6",Chi:"\u03a7",Psi:"\u03a8",Omega:"\u03a9",alpha:"\u03b1",beta:"\u03b2",gamma:"\u03b3",delta:"\u03b4",epsilon:"\u03b5",zeta:"\u03b6",eta:"\u03b7",theta:"\u03b8",iota:"\u03b9",kappa:"\u03ba",lambda:"\u03bb",mu:"\u03bc",nu:"\u03bd",xi:"\u03be",omicron:"\u03bf",pi:"\u03c0",rho:"\u03c1",sigmaf:"\u03c2",sigma:"\u03c3",tau:"\u03c4",upsilon:"\u03c5",phi:"\u03c6",chi:"\u03c7",psi:"\u03c8",omega:"\u03c9",thetasym:"\u03d1",upsih:"\u03d2",piv:"\u03d6",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02c6",tilde:"\u02dc",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200c",zwj:"\u200d",lrm:"\u200e",rlm:"\u200f",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201a",ldquo:"\u201c",rdquo:"\u201d",bdquo:"\u201e",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203a",oline:"\u203e",euro:"\u20ac",trade:"\u2122",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21b5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230a",rfloor:"\u230b",loz:"\u25ca",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"}),t.entityMap=t.HTML_ENTITIES},function(e,t,n){function i(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,i)}function r(){}function a(e,t,n,r,a){function d(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function m(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?d(parseInt(t.substr(1).replace("x","0x"))):(a.error("entity not found:"+e),e)}function y(t){if(t>k){var n=e.substring(k,t).replace(/&#?\w+;/g,m);S&&v(k),r.characters(n,0,t-k),k=t}}function v(t,n){for(;t>=b&&(n=T.exec(e));)_=n.index,b=_+n[0].length,S.lineNumber++;S.columnNumber=t-_+1}for(var _=0,b=0,T=/.*(?:\r\n?|\n)|.*$/g,S=r.locator,E=[{currentNSMap:t}],w={},k=0;;){try{var C=e.indexOf("<",k);if(C<0){if(!e.substr(k).match(/^\s*$/)){var A=r.doc,I=A.createTextNode(e.substr(k));A.appendChild(I),r.currentElement=I}return}switch(C>k&&y(C),e.charAt(C+1)){case"/":var x=e.indexOf(">",C+3),P=e.substring(C+2,x).replace(/[ \t\n\r]+$/g,""),O=E.pop();x<0?(P=e.substring(C+2).replace(/[\s<].*/,""),a.error("end tag name: "+P+" is not complete:"+O.tagName),x=C+1+P.length):P.match(/\s</)&&(P=P.replace(/[\s<].*/,""),a.error("end tag name: "+P+" maybe not complete"),x=C+1+P.length);var L=O.localNSMap,D=O.tagName==P;if(D||O.tagName&&O.tagName.toLowerCase()==P.toLowerCase()){if(r.endElement(O.uri,O.localName,P),L)for(var R in L)r.endPrefixMapping(R);D||a.fatalError("end tag name: "+P+" is not match the current start tagName:"+O.tagName)}else E.push(O);x++;break;case"?":S&&v(C),x=p(e,C,r);break;case"!":S&&v(C),x=h(e,C,r,a);break;default:S&&v(C);var M=new f,N=E[E.length-1].currentNSMap,x=o(e,C,M,N,m,a),U=M.length;if(!M.closed&&c(e,x,M.tagName,w)&&(M.closed=!0,n.nbsp||a.warning("unclosed xml attribute")),S&&U){for(var B=s(S,{}),j=0;j<U;j++){var F=M[j];v(F.offset),F.locator=s(S,{})}r.locator=B,u(M,r,N)&&E.push(M),r.locator=S}else u(M,r,N)&&E.push(M);g.isHTML(M.uri)&&!M.closed?x=l(e,x,M.tagName,m,r):x++}}catch(e){if(e instanceof i)throw e;a.error("element parse error: "+e),x=-1}x>k?k=x:y(Math.max(C,k)+1)}}function s(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function o(e,t,n,i,r,a){function s(e,t,i){n.attributeNames.hasOwnProperty(e)&&a.fatalError("Attribute "+e+" redefined"),n.addValue(e,t,i)}for(var o,u,l=++t,c=b;;){var d=e.charAt(l);switch(d){case"=":if(c===T)o=e.slice(t,l),c=E;else{if(c!==S)throw new Error("attribute equal must after attrName");c=E}break;case"'":case'"':if(c===E||c===T){if(c===T&&(a.warning('attribute value must after "="'),o=e.slice(t,l)),t=l+1,!((l=e.indexOf(d,t))>0))throw new Error("attribute value no end '"+d+"' match");u=e.slice(t,l).replace(/&#?\w+;/g,r),s(o,u,t-1),c=k}else{if(c!=w)throw new Error('attribute value must after "="');u=e.slice(t,l).replace(/&#?\w+;/g,r),s(o,u,t),a.warning('attribute "'+o+'" missed start quot('+d+")!!"),t=l+1,c=k}break;case"/":switch(c){case b:n.setTagName(e.slice(t,l));case k:case C:case A:c=A,n.closed=!0;case w:case T:case S:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),c==b&&n.setTagName(e.slice(t,l)),l;case">":switch(c){case b:n.setTagName(e.slice(t,l));case k:case C:case A:break;case w:case T:u=e.slice(t,l),"/"===u.slice(-1)&&(n.closed=!0,u=u.slice(0,-1));case S:c===S&&(u=o),c==w?(a.warning('attribute "'+u+'" missed quot(")!'),s(o,u.replace(/&#?\w+;/g,r),t)):(g.isHTML(i[""])&&u.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),s(u,u,t));break;case E:throw new Error("attribute value missed!!")}return l;case"\x80":d=" ";default:if(d<=" ")switch(c){case b:n.setTagName(e.slice(t,l)),c=C;break;case T:o=e.slice(t,l),c=S;break;case w:var u=e.slice(t,l).replace(/&#?\w+;/g,r);a.warning('attribute "'+u+'" missed quot(")!!'),s(o,u,t);case k:c=C}else switch(c){case S:n.tagName;g.isHTML(i[""])&&o.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),s(o,o,t),t=l,c=T;break;case k:a.warning('attribute space is required"'+o+'"!!');case C:c=T,t=l;break;case E:c=w,t=l;break;case A:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}function u(e,t,n){for(var i=e.tagName,r=null,a=e.length;a--;){var s=e[a],o=s.qName,u=s.value,l=o.indexOf(":");if(l>0)var c=s.prefix=o.slice(0,l),h=o.slice(l+1),p="xmlns"===c&&h;else h=o,c=null,p="xmlns"===o&&"";s.localName=h,!1!==p&&(null==r&&(r={},d(n,n={})),n[p]=r[p]=u,s.uri=g.XMLNS,t.startPrefixMapping(p,u))}for(var a=e.length;a--;){s=e[a];var c=s.prefix;c&&("xml"===c&&(s.uri=g.XML),"xmlns"!==c&&(s.uri=n[c||""]))}var l=i.indexOf(":");l>0?(c=e.prefix=i.slice(0,l),h=e.localName=i.slice(l+1)):(c=null,h=e.localName=i);var f=e.uri=n[c||""];if(t.startElement(f,h,i,e),!e.closed)return e.currentNSMap=n,e.localNSMap=r,!0;if(t.endElement(f,h,i),r)for(c in r)t.endPrefixMapping(c)}function l(e,t,n,i,r){if(/^(?:script|textarea)$/i.test(n)){var a=e.indexOf("</"+n+">",t),s=e.substring(t+1,a);if(/[&<]/.test(s))return/^script$/i.test(n)?(r.characters(s,0,s.length),a):(s=s.replace(/&#?\w+;/g,i),r.characters(s,0,s.length),a)}return t+1}function c(e,t,n,i){var r=i[n];return null==r&&(r=e.lastIndexOf("</"+n+">"),r<t&&(r=e.lastIndexOf("</"+n)),i[n]=r),r<t}function d(e,t){for(var n in e)t[n]=e[n]}function h(e,t,n,i){switch(e.charAt(t+2)){case"-":if("-"===e.charAt(t+3)){var r=e.indexOf("--\x3e",t+4);return r>t?(n.comment(e,t+4,r-t-4),r+3):(i.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==e.substr(t+3,6)){var r=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,r-t-9),n.endCDATA(),r+3}var a=m(e,t),s=a.length;if(s>1&&/!doctype/i.test(a[0][0])){var o=a[1][0],u=!1,l=!1;s>3&&(/^public$/i.test(a[2][0])?(u=a[3][0],l=s>4&&a[4][0]):/^system$/i.test(a[2][0])&&(l=a[3][0]));var c=a[s-1];return n.startDTD(o,u,l),n.endDTD(),c.index+c[0].length}}return-1}function p(e,t,n){var i=e.indexOf("?>",t);if(i){var r=e.substring(t,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(r){r[0].length;return n.processingInstruction(r[1],r[2]),i+2}return-1}return-1}function f(){this.attributeNames={}}function m(e,t){var n,i=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=t,r.exec(e);n=r.exec(e);)if(i.push(n),n[1])return i}var g=n(4).NAMESPACE,y=/[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]/,v=new RegExp("[\\-\\.0-9"+y.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),_=new RegExp("^"+y.source+v.source+"*(?::"+y.source+v.source+"*)?$"),b=0,T=1,S=2,E=3,w=4,k=5,C=6,A=7;i.prototype=new Error,i.prototype.name=i.name,r.prototype={parse:function(e,t,n){var i=this.domBuilder;i.startDocument(),d(t,t={}),a(e,t,n,i,this.errorHandler),i.endDocument()}},f.prototype={setTagName:function(e){if(!_.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!_.test(e))throw new 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}},t.XMLReader=r,t.ParseError=i},function(e,t,n){var i=n(49).getUint64,r=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;0===n.version?(n.earliestPresentationTime=t.getUint32(r),n.firstOffset=t.getUint32(r+4),r+=8):(n.earliestPresentationTime=i(e.subarray(r)),n.firstOffset=i(e.subarray(r+8)),r+=16),r+=2;var a=t.getUint16(r);for(r+=2;a>0;r+=12,a--)n.references.push({referenceType:(128&e[r])>>>7,referencedSize:2147483647&t.getUint32(r),subsegmentDuration:t.getUint32(r+4),startsWithSap:!!(128&e[r+8]),sapType:(112&e[r+8])>>>4,sapDeltaTime:268435455&t.getUint32(r+8)});return n};e.exports=r},function(e,t){var n=Math.pow(2,32),i=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0),t<Number.MAX_SAFE_INTEGER?Number(t):t):i.getUint32(0)*n+i.getUint32(4)};e.exports={getUint64:i,MAX_UINT32:n}},function(e,t,n){"use strict";var i,r=n(3),a=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"==typeof e?Object(r.h)(e):e}),s=function(e){return Array.isArray(e)?e.map(function(e){return a(e)}):[a(e)]},o=function(e){e=Object(r.k)(e);for(var t=[],n=0;e.length>n;){var a=e[n],s=0,o=0;o++;var u=e[o];for(o++;128&u;)s=(127&u)<<7,u=e[o],o++;s+=127&u;for(var l=0;l<i.length;l++){var c=i[l],d=c.id,h=c.parser;if(a===d){t.push(h(e.subarray(o,o+s)));break}}n+=s+o}return t};i=[{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(128&t.flags&&(t.dependsOnEsId=e[t.size]<<8|e[t.size+1],t.size+=2),64&t.flags){var n=e[t.size];t.url=Object(r.c)(e.subarray(t.size+1,t.size+1+n)),t.size+=n}return 32&t.flags&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=o(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:o(e.subarray(13))}}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var u=function e(t,n,i){void 0===i&&(i=!1),n=s(n),t=Object(r.k)(t);var a=[];if(!n.length)return a;for(var o=0;o<t.length;){var u=(t[o]<<24|t[o+1]<<16|t[o+2]<<8|t[o+3])>>>0,l=t.subarray(o+4,o+8);if(0===u)break;var c=o+u;if(c>t.length){if(i)break;c=t.length}var d=t.subarray(o+8,c);Object(r.a)(l,n[0])&&(1===n.length?a.push(d):a.push.apply(a,e(d,n.slice(1),i))),o=c}return a},l={EBML:Object(r.k)([26,69,223,163]),DocType:Object(r.k)([66,130]),Segment:Object(r.k)([24,83,128,103]),SegmentInfo:Object(r.k)([21,73,169,102]),Tracks:Object(r.k)([22,84,174,107]),Track:Object(r.k)([174]),TrackNumber:Object(r.k)([215]),DefaultDuration:Object(r.k)([35,227,131]),TrackEntry:Object(r.k)([174]),TrackType:Object(r.k)([131]),FlagDefault:Object(r.k)([136]),CodecID:Object(r.k)([134]),CodecPrivate:Object(r.k)([99,162]),VideoTrack:Object(r.k)([224]),AudioTrack:Object(r.k)([225]),Cluster:Object(r.k)([31,67,182,117]),Timestamp:Object(r.k)([231]),TimestampScale:Object(r.k)([42,215,177]),BlockGroup:Object(r.k)([160]),BlockDuration:Object(r.k)([155]),Block:Object(r.k)([161]),SimpleBlock:Object(r.k)([163])},c=[128,64,32,16,8,4,2,1],d=function(e){for(var t=1,n=0;n<c.length&&!(e&c[n]);n++)t++;return t},h=function(e,t,n,i){void 0===n&&(n=!0),void 0===i&&(i=!1);var a=d(e[t]),s=e.subarray(t,t+a);return n&&(s=Array.prototype.slice.call(e,t,t+a),s[0]^=c[a-1]),{length:a,value:Object(r.b)(s,{signed:i}),bytes:s}},p=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map(function(t){return e(t)}):"number"==typeof t?Object(r.f)(t):t},f=function(e){return Array.isArray(e)?e.map(function(e){return p(e)}):[p(e)]},m=function e(t,n,i){if(i>=n.length)return n.length;var a=h(n,i,!1);if(Object(r.a)(t.bytes,a.bytes))return i;var s=h(n,i+a.length);return e(t,n,i+s.length+s.value+a.length)},g=function e(t,n){n=f(n),t=Object(r.k)(t);var i=[];if(!n.length)return i;for(var a=0;a<t.length;){var s=h(t,a,!1),o=h(t,a+s.length),u=a+s.length+o.length;127===o.value&&(o.value=m(s,t,u),o.value!==t.length&&(o.value-=u));var l=u+o.value>t.length?t.length:u+o.value,c=t.subarray(u,l);Object(r.a)(n[0],s.bytes)&&(1===n.length?i.push(c):i=i.concat(e(c,n.slice(1))));a+=s.length+o.length+c.length}return i},y=n(13),v=Object(r.k)([0,0,0,1]),_=Object(r.k)([0,0,1]),b=Object(r.k)([0,0,3]),T=function(e){for(var t=[],n=1;n<e.length-2;)Object(r.a)(e.subarray(n,n+3),b)&&(t.push(n+2),n++),n++;if(0===t.length)return e;var i=e.length-t.length,a=new Uint8Array(i),s=0;for(n=0;n<i;s++,n++)s===t[0]&&(s++,t.shift()),a[n]=e[s];return a},S=function(e,t,n,i){void 0===i&&(i=1/0),e=Object(r.k)(e),n=[].concat(n);for(var a,s=0,o=0;s<e.length&&(o<i||a);){var u=void 0;if(Object(r.a)(e.subarray(s),v)?u=4:Object(r.a)(e.subarray(s),_)&&(u=3),u){if(o++,a)return T(e.subarray(a,s));var l=void 0;"h264"===t?l=31&e[s+u]:"h265"===t&&(l=e[s+u]>>1&63),-1!==n.indexOf(l)&&(a=s+u),s+=u+("h264"===t?1:2)}else s++}return e.subarray(0,0)},E=function(e,t,n){return S(e,"h264",t,n)},w=function(e,t,n){return S(e,"h265",t,n)};n.d(t,"a",function(){return x}),n.d(t,"b",function(){return P});var k={webm:Object(r.k)([119,101,98,109]),matroska:Object(r.k)([109,97,116,114,111,115,107,97]),flac:Object(r.k)([102,76,97,67]),ogg:Object(r.k)([79,103,103,83]),ac3:Object(r.k)([11,119]),riff:Object(r.k)([82,73,70,70]),avi:Object(r.k)([65,86,73]),wav:Object(r.k)([87,65,86,69]),"3gp":Object(r.k)([102,116,121,112,51,103]),mp4:Object(r.k)([102,116,121,112]),fmp4:Object(r.k)([115,116,121,112]),mov:Object(r.k)([102,116,121,112,113,116]),moov:Object(r.k)([109,111,111,118]),moof:Object(r.k)([109,111,111,102])},C={aac:function(e){var t=Object(y.a)(e);return Object(r.a)(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Object(y.a)(e);return Object(r.a)(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=g(e,[l.EBML,l.DocType])[0];return Object(r.a)(t,k.webm)},mkv:function(e){var t=g(e,[l.EBML,l.DocType])[0];return Object(r.a)(t,k.matroska)},mp4:function(e){return!C["3gp"](e)&&!C.mov(e)&&(!(!Object(r.a)(e,k.mp4,{offset:4})&&!Object(r.a)(e,k.fmp4,{offset:4}))||(!(!Object(r.a)(e,k.moof,{offset:4})&&!Object(r.a)(e,k.moov,{offset:4}))||void 0))},mov:function(e){return Object(r.a)(e,k.mov,{offset:4})},"3gp":function(e){return Object(r.a)(e,k["3gp"],{offset:4})},ac3:function(e){var t=Object(y.a)(e);return Object(r.a)(e,k.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=Object(y.a)(e);return Object(r.a)(e,k.flac,{offset:t})},ogg:function(e){return Object(r.a)(e,k.ogg)},avi:function(e){return Object(r.a)(e,k.riff)&&Object(r.a)(e,k.avi,{offset:8})},wav:function(e){return Object(r.a)(e,k.riff)&&Object(r.a)(e,k.wav,{offset:8})},h264:function(e){return E(e,7,3).length},h265:function(e){return w(e,[32,33],3).length}},A=Object.keys(C).filter(function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e}).concat(["ts","h264","h265"]);A.forEach(function(e){var t=C[e];C[e]=function(e){return t(Object(r.k)(e))}});var I=C,x=function(e){e=Object(r.k)(e);for(var t=0;t<A.length;t++){var n=A[t];if(I[n](e))return n}return""},P=function(e){return u(e,["moof"]).length>0}},function(e,t){var n,i,r,a,s,o,u;n=function(e){return 9e4*e},i=function(e,t){return e*t},r=function(e){return e/9e4},a=function(e,t){return e/t},s=function(e,t){return n(a(e,t))},o=function(e,t){return i(r(e),t)},u=function(e,t,n){return r(n?e:e-t)},e.exports={ONE_SECOND_IN_TS:9e4,secondsToVideoTs:n,secondsToAudioTs:i,videoTsToSeconds:r,audioTsToSeconds:a,audioTsToVideoTs:s,videoTsToAudioTs:o,metadataTsToSeconds:u}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"FlashlsHandler",function(){return q});var i=n(1),r=n.n(i),a=n(0),s=n.n(a),o=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 i;return!!e[t]&&(i=e[t].indexOf(n),e[t]=e[t].slice(),e[t].splice(i,1),i>-1)},this.trigger=function(t){var n,i,r,a;if(n=e[t])if(2===arguments.length)for(r=n.length,i=0;i<r;++i)n[i].call(this,arguments[1]);else{for(a=[],i=arguments.length,i=1;i<arguments.length;++i)a.push(arguments[i]);for(r=n.length,i=0;i<r;++i)n[i].apply(this,a)}},this.dispose=function(){e={}}}};o.prototype.pipe=function(e){return this.on("data",function(t){e.push(t)}),this.on("done",function(t){e.flush(t)}),e},o.prototype.push=function(e){this.trigger("data",e)},o.prototype.flush=function(e){this.trigger("done",e)};var u=o,l=function(e){for(var t=0,n={payloadType:-1,payloadSize:0},i=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)i+=255,t++;for(i+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!n.payload&&4===i){n.payloadType=i,n.payloadSize=r,n.payload=e.subarray(t,t+r);break}t+=r,i=0,r=0}return n},c=function(e){return 181!==e.payload[0]?null:49!=(e.payload[1]<<8|e.payload[2])?null:"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])?null:3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},d=function(e,t){var n,i,r,a,s=[];if(!(64&t[0]))return s;for(i=31&t[0],n=0;n<i;n++)r=3*n,a={type:3&t[r+2],pts:e},4&t[r+2]&&(a.ccData=t[r+3]<<8|t[r+4],s.push(a));return s},h=function(e){for(var t,n,i=e.byteLength,r=[],a=1;a<i-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=i-r.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),n[a]=e[s];return n},p={parseSei:l,parseUserData:c,parseCaptionPackets:d,discardEmulationPreventionBytes:h,USER_DATA_REGISTERED_ITU_T_T35:4},f=function(){f.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new _(0,0),new _(0,1),new _(1,0),new _(1,1)],this.reset(),this.ccStreams_.forEach(function(e){e.on("data",this.trigger.bind(this,"data")),e.on("done",this.trigger.bind(this,"done"))},this)};f.prototype=new u,f.prototype.push=function(e){var t,n,i;if("sei_rbsp"===e.nalUnitType&&(t=p.parseSei(e.escapedRBSP),t.payloadType===p.USER_DATA_REGISTERED_ITU_T_T35&&(n=p.parseUserData(t)))){if(e.dts<this.latestDts_)return void(this.ignoreNextEqualDts_=!0);if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return void(--this.numSameDts_||(this.ignoreNextEqualDts_=!1));i=p.parseCaptionPackets(e.pts,n),this.captionPackets_=this.captionPackets_.concat(i),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},f.prototype.flush=function(){if(!this.captionPackets_.length)return void this.ccStreams_.forEach(function(e){e.flush()},this);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),this.captionPackets_.length=0,this.ccStreams_.forEach(function(e){e.flush()},this)},f.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset()})},f.prototype.dispatchCea608Packet=function(e){this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},f.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},f.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)};var m={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},g=function(e){return null===e?"":(e=m[e]||e,String.fromCharCode(e))},y=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],v=function(){for(var e=[],t=15;t--;)e.push("");return e},_=function(e,t){_.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,n,i,r,a;if((t=32639&e.ccData)===this.lastControlCode_)return void(this.lastControlCode_=null);if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),i=t>>>8,r=255&t,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_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=v();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=v();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=v()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(i,r))i=(3&i)<<8,a=g(i|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(i,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),i=(3&i)<<8,a=g(i|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(i,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(i,r))this.column_+=3&r;else if(this.isPAC(i,r)){var s=y.indexOf(7968&t);"rollUp"===this.mode_&&this.setRollUp(e.pts,s),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(i)&&(0===r&&(r=null),a=g(i),a+=g(r),this[this.mode_](e.pts,a),this.column_+=a.length)}};_.prototype=new u,_.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e){return e.trim()}).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},_.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=v(),this.nonDisplayed_=v(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},_.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},_.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},_.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},_.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},_.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},_.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},_.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},_.prototype.isNormalChar=function(e){return e>=32&&e<=127},_.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=v(),this.displayed_=v()),void 0!==t&&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]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},_.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)},_.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)}},_.prototype.popOn=function(e,t){var n=this.nonDisplayed_[this.row_];n+=t,this.nonDisplayed_[this.row_]=n},_.prototype.rollUp=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n},_.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},_.prototype.paintOn=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n};var b,T={CaptionStream:f,Cea608Stream:_},S=T.CaptionStream,E={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},w=function(e,t,n){var i,r="";for(i=t;i<n;i++)r+="%"+("00"+e[i].toString(16)).slice(-2);return r},k=function(e,t,n){return decodeURIComponent(w(e,t,n))},C=function(e,t,n){return unescape(w(e,t,n))},A=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},I={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=k(e.data,1,t),e.value=k(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=k(e.data,1,t),e.url=k(e.data,t+1,e.data.length);break}},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=C(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};b=function(e){var t,n={debug:!(!e||!e.debug),descriptor:e&&e.descriptor},i=0,r=[],a=0;if(b.prototype.init.call(this),this.dispatchType=E.METADATA_STREAM_TYPE.toString(16),n.descriptor)for(t=0;t<n.descriptor.length;t++)this.dispatchType+=("00"+n.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,s,o,u,l,c;if("timed-metadata"===e.type){if(e.dataAlignmentIndicator&&(a=0,r.length=0),0===r.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))return void(n.debug&&console.log("Skipping unrecognized metadata packet"));if(r.push(e),a+=e.data.byteLength,1===r.length&&(i=A(e.data.subarray(6,10)),i+=10),!(a<i)){for(t={data:new Uint8Array(i),frames:[],pts:r[0].pts,dts:r[0].dts},l=0;l<i;)t.data.set(r[0].data.subarray(0,i-l),l),l+=r[0].data.byteLength,a-=r[0].data.byteLength,r.shift();s=10,64&t.data[5]&&(s+=4,s+=A(t.data.subarray(10,14)),i-=A(t.data.subarray(16,20)));do{if((o=A(t.data.subarray(s+4,s+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if(c=String.fromCharCode(t.data[s],t.data[s+1],t.data[s+2],t.data[s+3]),u={id:c,data:t.data.subarray(s+10,s+o+10)},u.key=u.id,I[u.id]&&(I[u.id](u),"com.apple.streaming.transportStreamTimestamp"===u.owner)){var d=u.data,h=(1&d[3])<<30|d[4]<<22|d[5]<<14|d[6]<<6|d[7]>>>2;h*=4,h+=3&d[7],u.timeStamp=h,void 0===t.pts&&void 0===t.dts&&(t.pts=u.timeStamp,t.dts=u.timeStamp),this.trigger("timestamp",u)}t.frames.push(u),s+=10,s+=o}while(s<i);this.trigger("data",t)}}}},b.prototype=new u;var x=b,P=function(e,t){var n={id:t.index+"",width:t.width,height:t.height,bandwidth:t.bitrate,isEnabled_:!0};return n.enabled=function(t){if(void 0===t)return n.isEnabled_;t!==n.isEnabled_&&(!0!==t&&!1!==t||(n.isEnabled_=t,e()))},n},O=function(e){var t=null,n=function(){var n=t.filter(function(e){return e.enabled()});if(n.length===t.length||0===n.length)return e.el_.vjs_setProperty("autoLevelCapping",-1),void e.el_.vjs_setProperty("level",-1);if(1===n.length)return e.el_.vjs_setProperty("level",parseInt(n[0].id,10)),void e.el_.vjs_setProperty("autoLevelCapping",-1);var i=n[n.length-1].id;e.el_.vjs_setProperty("autoLevelCapping",parseInt(i,10)),e.el_.vjs_setProperty("level",-1)};return function(){if(!t){var i=e.el_.vjs_getProperty("levels");t=i.filter(function(e){return!e.audio}).map(P.bind(null,n))}return t}},L=function(e){for(var t=e.el_.vjs_getProperty("audioTracks"),n=e.audioTracks(),i=null,r=0;r<n.length;r++)if(n[r].enabled){i=n[r].id;break}if(null!==i)for(var a=0;a<t.length;a++)if(i===t[a].title)return void e.el_.vjs_setProperty("audioTrack",a)},D=function(e){var t=e.el_.vjs_getProperty("altAudioTracks"),n=e.el_.vjs_getProperty("audioTracks"),i=e.el_.vjs_getProperty("audioTrack");n.forEach(function(n,r){var a=t[n.id];e.audioTracks().addTrack(new s.a.AudioTrack({id:a.name,enabled:i===r,language:a.lang,default:a.default_track,label:a.name}))})},R=function(e){Object.defineProperties(e.frame,{id:{get:function(){return s.a.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return s.a.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return s.a.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},M=function(e,t,n){for(var i=e.remoteTextTracks()||[],r=0;r<i.length;r++){var a=i[r];a.kind===t&&a.label===n&&e.removeRemoteTextTrack(a)}},N=function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t},U=function(e,t,n){var i,r;if(n&&n.cues)for(i=n.cues.length;i--;)r=n.cues[i],r.startTime<=t&&r.endTime>=e&&n.removeCue(r)},B=function(e,t){e.length&&U(0,e.start(0),t)},j=function(e,t){for(var n=-1,i=0;i<e.length;i++)if(e[i].id===t){n=i;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})},F=function(e,t){var n=[];if(e&&e.length)for(var i=0;i<e.length;i++)t(e.start(i),e.end(i))&&n.push([e.start(i),e.end(i)]);return s.a.createTimeRanges(n)},H=function(e,t){return F(e,function(e,n){return e-1/30<=t&&n+1/30>=t})},q=function(){function e(e,t,n){var i=this;if(t.options_&&t.options_.playerId){var r=s()(t.options_.playerId);r.hasOwnProperty("hls")||Object.defineProperty(r,"hls",{get:function(){return s.a.log.warn("player.hls is deprecated. Use player.tech_.hls instead."),t.trigger({type:"usage",name:"flashls-player-access"}),i}})}Object.defineProperties(this,{stats:{get:function(){return this.tech_.el_.vjs_getProperty("stats")}},bandwidth:{get:function(){return this.tech_.el_.vjs_getProperty("stats").bandwidth}}}),this.tech_=t,this.metadataTrack_=null,this.inbandTextTracks_={},this.metadataStream_=new x,this.captionStream_=new S,this.offsetPts=null,this.offsetDts=null,this.onLoadedmetadata_=this.onLoadedmetadata_.bind(this),this.onSeeking_=this.onSeeking_.bind(this),this.onId3updated_=this.onId3updated_.bind(this),this.onCaptionData_=this.onCaptionData_.bind(this),this.onMetadataStreamData_=this.onMetadataStreamData_.bind(this),this.onCaptionStreamData_=this.onCaptionStreamData_.bind(this),this.onLevelSwitch_=this.onLevelSwitch_.bind(this),this.onLevelLoaded_=this.onLevelLoaded_.bind(this),this.onFragmentLoaded_=this.onFragmentLoaded_.bind(this),this.onAudioTrackChanged=this.onAudioTrackChanged.bind(this),this.onPlay_=this.onPlay_.bind(this),this.tech_.on("loadedmetadata",this.onLoadedmetadata_),this.tech_.on("seeking",this.onSeeking_),this.tech_.on("id3updated",this.onId3updated_),this.tech_.on("captiondata",this.onCaptionData_),this.tech_.on("levelswitch",this.onLevelSwitch_),this.tech_.on("levelloaded",this.onLevelLoaded_),this.tech_.on("fragmentloaded",this.onFragmentLoaded_),this.tech_.on("play",this.onPlay_),this.metadataStream_.on("data",this.onMetadataStreamData_),this.captionStream_.on("data",this.onCaptionStreamData_),this.playlists=new s.a.EventTarget,this.playlists.media=function(){return i.media_()}}var t=e.prototype;return t.src=function(e){e&&this.tech_.setSrc(e.src)},t.onPlay_=function(){if(this.tech_.duration()===1/0){var e=this.seekable();if(this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}},t.seekable=function(){var e=this.tech_.el_.vjs_getProperty("seekableStart"),t=this.tech_.el_.vjs_getProperty("seekableEnd");return 0===t?s.a.createTimeRange():s.a.createTimeRange(e,t)},t.media_=function(){var e,t=this.tech_.el_.vjs_getProperty("levels"),n=this.tech_.el_.vjs_getProperty("level");return t.length&&(e={resolvedUri:t[n].url,attributes:{BANDWIDTH:t[n].bitrate,RESOLUTION:{width:t[n].width,height:t[n].height}}}),e},t.onLoadedmetadata_=function(){var e=this;this.representations=O(this.tech_);var t=s.a.players[this.tech_.options_.playerId];t&&t.qualityLevels&&(this.qualityLevels_=t.qualityLevels(),this.representations().forEach(function(t){e.qualityLevels_.addQualityLevel(t)}),j(this.qualityLevels_,this.tech_.el_.vjs_getProperty("level")+"")),D(this.tech_),this.tech_.audioTracks().on("change",this.onAudioTrackChanged)},t.onAudioTrackChanged=function(){L(this.tech_)},t.onLevelSwitch_=function(e,t){this.qualityLevels_&&j(this.qualityLevels_,t[0].levelIndex+""),this.playlists.trigger("mediachange"),this.tech_.trigger({type:"mediachange",bubbles:!0})},t.onLevelLoaded_=function(){this.playlists.trigger("loadedplaylist")},t.onFragmentLoaded_=function(){this.tech_.trigger("bandwidthupdate"),this.captionStream_.flush()},t.onSeeking_=function(){var e=this;U(0,1/0,this.metadataTrack_),H(this.tech_.buffered(),this.tech_.currentTime()).length||(Object.keys(this.inbandTextTracks_).forEach(function(t){U(0,1/0,e.inbandTextTracks_[t])}),this.captionStream_.reset())},t.onId3updated_=function(e,t){var n=r.a.atob(t[0]),i=N(n),a={type:"timed-metadata",dataAlignmentIndicator:!0,data:i};this.metadataStream_.push(a)},t.onMetadataStreamData_=function(e){var t=this;this.metadataTrack_||(this.metadataTrack_=this.tech_.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,this.metadataTrack_.inBandMetadataTrackDispatchType="15"),B(this.tech_.buffered(),this.metadataTrack_);var n=this.tech_.currentTime();if(e.frames.forEach(function(e){var i=new r.a.VTTCue(n,n+.1,e.value||e.url||e.data||"");i.frame=e,i.value=e,R(i),t.metadataTrack_.addCue(i)}),this.metadataTrack_.cues&&this.metadataTrack_.cues.length){var i=this.metadataTrack_.cues,a=[],s=this.tech_.duration();(isNaN(s)||Math.abs(s)===1/0)&&(s=Number.MAX_VALUE);for(var o=0;o<i.length;o++)a.push(i[o]);a.sort(function(e,t){return e.startTime-t.startTime});for(var u=0;u<a.length-1;u++)a[u].endTime!==a[u+1].startTime&&(a[u].endTime=a[u+1].startTime);a[a.length-1].endTime=s}},t.onCaptionData_=function(e,t){var n=this;t[0].forEach(function(e){n.offsetPts||(n.offsetPts=e.pos),n.offsetDts||(n.offsetDts=e.dts),n.captionStream_.push({pts:9e4*(e.pos-n.offsetPts),dts:9e4*(e.dts-n.offsetDts),escapedRBSP:N(r.a.atob(e.data)),nalUnitType:"sei_rbsp"})})},t.onCaptionStreamData_=function(e){e&&(this.inbandTextTracks_[e.stream]||(M(this.tech_,"captions",e.stream),this.inbandTextTracks_[e.stream]=this.tech_.addRemoteTextTrack({kind:"captions",label:e.stream,id:e.stream},!1).track),B(this.tech_.buffered(),this.inbandTextTracks_[e.stream]),this.inbandTextTracks_[e.stream].addCue(new r.a.VTTCue(e.startPts/9e4,e.endPts/9e4,e.text)))},t.dispose=function(){this.tech_.off("loadedmetadata",this.onLoadedmetadata_),this.tech_.off("seeked",this.onSeeking_),this.tech_.off("id3updated",this.onId3updated_),this.tech_.off("captiondata",this.onCaptionData_),this.tech_.audioTracks().off("change",this.onAudioTrackChanged),this.tech_.off("levelswitch",this.onLevelSwitch_),this.tech_.off("levelloaded",this.onLevelLoaded_),this.tech_.off("fragmentloaded",this.onFragmentLoaded_),this.tech_.off("play",this.onPlay_),this.qualityLevels_&&this.qualityLevels_.dispose()},e}(),V={},W=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;V.canPlayType=function(e){return W.test(e)?"maybe":""},V.canHandleSource=function(e,t){return"maybe"===V.canPlayType(e.type)},V.handleSource=function(e,t,n){return t.hls=new q(e,t,n),t.hls.src(e),t.hls},s.a.getTech("Flash").registerSourceHandler(V,0),V.VERSION="1.4.8",t.default=V},function(e,t,n){"use strict";function i(e){return!!e&&"object"===(void 0===e?"undefined":u(e))&&"[object Object]"===toString.call(e)&&e.constructor===Object}function r(e,t){var n={};return[e,t].forEach(function(e){e&&Object.keys(e).forEach(function(t){var a=e[t];if(!i(a))return void(n[t]=a);i(n[t])||(n[t]={}),n[t]=r(n[t],a)})}),n}function a(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)})}function s(e){var t=void 0,n={top:0,bottom:0,left:0,width:0,height:0,right:0};try{t=e.getBoundingClientRect()}catch(e){t=n}return t}function o(e){function t(){E.sort(function(e,t){return T.markerTip.time(e)-T.markerTip.time(t)})}function n(e){e.forEach(function(e){e.key=a(),k.el().querySelector(".vjs-progress-holder").appendChild(u(e)),S[e.key]=e,E.push(e)}),t()}function i(e){return T.markerTip.time(e)/k.duration()*100}function o(e,t){t.className="vjs-marker "+(e.class||"");var n=t.querySelector(".vjs-marker-point");Object.keys(T.markerStyle).forEach(function(e){n.style[e]=T.markerStyle[e]});var r=e.time/k.duration();(r<0||r>1)&&(t.style.display="none"),t.style.left=i(e)+"%",e.duration&&(t.style.width=e.duration/k.duration()*100+"%",t.style.marginLeft="0px")}function u(e){var t=c.default.dom.createEl("div",{},{"data-marker-key":e.key,"data-marker-time":T.markerTip.time(e)}),n=c.default.dom.createEl("div",{className:"vjs-marker-point"});if(t.appendChild(n),o(e,t),t.addEventListener("click",function(t){var n=!1;if("function"==typeof T.onMarkerClick&&(n=!1===T.onMarkerClick(e)),!n){var i=this.getAttribute("data-marker-key");k.currentTime(T.markerTip.time(S[i]))}}),T.markerTip.display){var i=c.default.dom.createEl("div",{className:"vjs-tip",innerHTML:"<div class='vjs-tip-inner'>"+T.markerTip.text(e)+"</div>\n <div class='vjs-tip-arrow'><div class='arrow'></div></div>"});i.addEventListener("mousedown",function(e){e.stopPropagation()}),i.addEventListener("click",function(e){e.stopPropagation()}),t.appendChild(i),m(t)}return t}function l(e){E.forEach(function(t){var n=k.el().querySelector(".vjs-marker[data-marker-key='"+t.key+"']"),i=T.markerTip.time(t);(e||n.getAttribute("data-marker-time")!==i)&&(o(t,n),n.setAttribute("data-marker-time",i))}),t()}function f(e){A&&(I=p,A.style.visibility="hidden"),w=p;var n=[];e.forEach(function(e){var t=E[e];if(t){delete S[t.key],n.push(e);var i=k.el().querySelector(".vjs-marker[data-marker-key='"+t.key+"']");i&&i.parentNode.removeChild(i)}}),n.reverse(),n.forEach(function(e){E.splice(e,1)}),t()}function m(e){var t=e.querySelector(".vjs-tip");e.addEventListener("mouseover",function(){if(t){var n=s(e);t.style.marginLeft=n.width/2+"px",t.style.visibility="visible"}}),e.addEventListener("mouseout",function(){t&&(t.style.visibility="hidden")})}function g(){if(T.breakOverlay.display&&!(w<0)){var e=k.currentTime(),t=E[w],n=T.markerTip.time(t);e>=n&&e<=n+T.breakOverlay.displayTime?(I!==w&&(I=w,A&&(A.querySelector(".vjs-break-overlay-text").innerHTML=T.breakOverlay.text(t))),A&&(A.style.visibility="visible")):(I=p,A&&(A.style.visibility="hidden"))}}function y(){A=c.default.dom.createEl("div",{className:"vjs-break-overlay",innerHTML:"<div class='vjs-break-overlay-text'></div>"}),Object.keys(T.breakOverlay.style).forEach(function(e){A&&(A.style[e]=T.breakOverlay.style[e])}),k.el().appendChild(A),I=p}function v(){_(),g(),e.onTimeUpdateAfterMarkerUpdate&&e.onTimeUpdateAfterMarkerUpdate()}function _(){if(E.length){var t=function(e){return e<E.length-1?T.markerTip.time(E[e+1]):k.duration()},n=k.currentTime(),i=p;if(w!==p){var r=t(w);if(n>=T.markerTip.time(E[w])&&n<r)return;if(w===E.length-1&&n===k.duration())return}if(n<T.markerTip.time(E[0]))i=p;else for(var a=0;a<E.length;a++){var s=t(a);if(n>=T.markerTip.time(E[a])&&n<s){i=a;break}}i!==w&&(i!==p&&e.onMarkerReached&&e.onMarkerReached(E[i],i),w=i)}}function b(){k.markers.removeAll(),n(T.markers),T.breakOverlay.display&&y();var e=null;k.on("playing",function(){k.clearInterval(e),e=k.setInterval(function(){k.requestAnimationFrame(function(){v()})},d)}),k.on(["ended","pause","waiting"],function(){k.clearInterval(e)}),k.off("loadedmetadata")}c.default.mergeOptions||(c.default.mergeOptions=r),c.default.dom.createEl||(c.default.dom.createEl=function(e,t,n){var i=c.default.Player.prototype.dom.createEl(e,t);return n&&Object.keys(n).forEach(function(e){i.setAttribute(e,n[e])}),i});var T=c.default.mergeOptions(h,e),S={},E=[],w=p,k=this,C=null,A=null,I=p;k.on("loadedmetadata",function(){b()}),k.markers={getMarkers:function(){return E},next:function(){for(var e=k.currentTime(),t=0;t<E.length;t++){var n=T.markerTip.time(E[t]);if(n>e){k.currentTime(n);break}}},prev:function(){for(var e=k.currentTime(),t=E.length-1;t>=0;t--){var n=T.markerTip.time(E[t]);if(n+.5<e)return void k.currentTime(n)}},add:function(e){n(e)},remove:function(e){f(e)},removeAll:function(){for(var e=[],t=0;t<E.length;t++)e.push(t);f(e)},updateTime:function(e){l(e)},reset:function(e){k.markers.removeAll(),n(e)},destroy:function(){k.markers.removeAll(),A&&A.remove(),C&&C.remove(),k.off("timeupdate",g),delete k.markers}}}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=n(0),c=function(e){return e&&e.__esModule?e:{default:e}}(l),d=30,h={markerStyle:{width:"7px","border-radius":"30%","background-color":"red"},markerTip:{display:!0,text:function(e){return"Break: "+e.text},time:function(e){return e.time}},breakOverlay:{display:!1,displayTime:3,text:function(e){return"Break overlay: "+e.overlayText},style:{width:"100%",height:"20%","background-color":"rgba(0,0,0,0.7)",color:"white","font-size":"17px"}},onMarkerClick:function(e){},onMarkerReached:function(e,t){},markers:[]},p=-1;c.default.registerPlugin("markers",o)},function(e,t,n){"use strict";/*! videojs-resolution-switcher - 2015-7-26
28
- * Copyright (c) 2016 Kasper Moskwiak
29
- * Modified by Pierre Kraft
30
- * Licensed under the Apache-2.0 license. */
31
- !function(){var e=null;e=void 0===window.videojs?n(0):window.videojs,function(e,t){function n(){return!!e.navigator.userAgent.toLowerCase().match(/rv:([\d.]+)\) like gecko/)}function i(){return-1!==e.navigator.userAgent.indexOf("Windows NT 6.1")}function r(e,t,n,i){return o={label:n,sources:t},"function"==typeof i?i(e,t,n):(e.src(t.map(function(e){return{src:e.src,type:e.type,res:e.res}})),e)}var a,s={},o={},u={},l=t.getComponent("MenuItem"),c=t.extend(l,{constructor:function(e,t,n,i){this.onClickListener=n,this.label=i,l.call(this,e,t),this.src=t.src,this.on("click",this.onClick),this.on("touchstart",this.onClick),t.initialySelected&&(this.showAsLabel(),this.selected(!0),this.addClass("vjs-selected"))},showAsLabel:function(){this.label&&(this.label.innerHTML=this.options_.label)},onClick:function(t){this.onClickListener(this);var n=this.player_.currentTime(),i=this.player_.paused(),a=this.player_.src(),s=this.player_.playbackRate(),o=this.player_.volume();this.showAsLabel(),this.addClass("vjs-selected"),i||this.player_.bigPlayButton.hide(),"function"!=typeof t&&"function"==typeof this.options_.customSourcePicker&&(t=this.options_.customSourcePicker);var u="loadeddata";"Youtube"!==this.player_.techName_&&"none"===this.player_.preload()&&"Flash"!==this.player_.techName_&&(u="timeupdate"),a!==this.src[0].src&&r(this.player_,this.src,this.options_.label,t).one(u,function(){var t=this;this.player_.currentTime(n),this.player_.handleTechSeeked_(),i||(this.player_.play(),this.player_.handleTechSeeked_()),this.player_.trigger("resolutionchange"),e.setTimeout(function(){t.player_.controlBar.$(".vjs-play-control").focus()}),this.player_.playbackRate(s),this.player_.volume(o)})}}),d=t.getComponent("MenuButton"),h=t.extend(d,{constructor:function(e,n,i,r){if(this.sources=n.sources,this.label=r,this.label.innerHTML=n.initialySelectedLabel,d.call(this,e,n,i),this.controlText("Quality"),i.dynamicLabel)this.el().appendChild(r);else{var a=document.createElement("span");t.dom.addClass(a,"vjs-resolution-button-staticlabel"),this.el().appendChild(a)}},createItems:function(){var e=[],t=this.sources&&this.sources.label||{},n=function(t){e.map(function(e){e.selected(e===t),e.removeClass("vjs-selected")})};for(var i in t)t.hasOwnProperty(i)&&(e.push(new c(this.player_,{label:i,src:t[i],initialySelected:i===this.options_.initialySelectedLabel,customSourcePicker:this.options_.customSourcePicker},n,this.label)),u[i]=e[e.length-1]);return e}});a=function(e){function a(e,t){return e.res&&t.res?+t.res-+e.res:0}function l(e){var t={label:{},res:{},type:{}};return e.map(function(e){c(t,"label",e),c(t,"res",e),c(t,"type",e),d(t,"label",e),d(t,"res",e),d(t,"type",e)}),t}function c(e,t,n){null==e[t][n[t]]&&(e[t][n[t]]=[])}function d(e,t,n){e[t][n[t]].push(n)}function p(e,t){var n=m.default,i="";return"high"===n?(n=t[0].res,i=t[0].label):"low"!==n&&null!=n&&e.res[n]?e.res[n]&&(i=e.res[n][0].label):(n=t[t.length-1].res,i=t[t.length-1].label),{res:n,label:i,sources:e.res[n]}}function f(e){e.tech_.ytPlayer.setPlaybackQuality("default"),e.tech_.ytPlayer.addEventListener("onPlaybackQualityChange",function(){e.trigger("resolutionchange")}),e.one("play",function(){var t=e.tech_.ytPlayer.getAvailableQualityLevels(),n={highres:{res:1080,label:"1080",yt:"highres"},hd1080:{res:1080,label:"1080",yt:"hd1080"},hd720:{res:720,label:"720",yt:"hd720"},large:{res:480,label:"480",yt:"large"},medium:{res:360,label:"360",yt:"medium"},small:{res:240,label:"240",yt:"small"},tiny:{res:144,label:"144",yt:"tiny"},auto:{res:0,label:"auto",yt:"default"}},i=[];t.map(function(t){i.push({src:e.src().src,type:e.src().type,label:n[t].label,res:n[t].res,_yt:n[t].yt})}),v=l(i);var r=function(t,n){return e.tech_.ytPlayer.setPlaybackQuality(n[0]._yt),e},a={label:"auto",res:0,sources:v.label.auto},s=new h(e,{sources:v,initialySelectedLabel:a.label,initialySelectedRes:a.res,customSourcePicker:r},m,y);s.el().classList.add("vjs-resolution-button"),e.controlBar.resolutionSwitcher=e.controlBar.addChild(s)})}var m=t.mergeOptions(s,e),g=this,y=document.createElement("span"),v={};t.dom.addClass(y,"vjs-resolution-button-label"),g.updateSrc=function(e){if(!e)return g.src();g.controlBar.resolutionSwitcher&&(g.controlBar.resolutionSwitcher.dispose(),delete g.controlBar.resolutionSwitcher),e=e.sort(a),v=l(e);var s=p(v,e),o=new h(g,{sources:v,initialySelectedLabel:s.label,initialySelectedRes:s.res,customSourcePicker:m.customSourcePicker},m,y),u="vjs-resolution-button";return(n()&&i()||"Flash"===g.tech().name_)&&g.src().indexOf(".m3u8")>=0&&(u+=" vjs-resolution-button-hidden"),t.dom.addClass(o.el(),u),g.controlBar.resolutionSwitcher=g.controlBar.el_.insertBefore(o.el_,g.controlBar.getChild("fullscreenToggle").el_),g.controlBar.resolutionSwitcher.dispose=function(){this.parentNode.removeChild(this)},r(g,s.sources,s.label)},g.currentResolution=function(e,t){return null==e?o:(null!=u[e]&&u[e].onClick(t),g)},g.getGroupedSrc=function(){return v},g.ready(function(){g.options_.sources.length>1&&g.updateSrc(g.options_.sources),"Youtube"===g.techName_&&f(g)})},t.registerPlugin("videoJsResolutionSwitcher",a)}(window,e)}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=function(e){return e&&e.__esModule?e:{default:e}}(i),a=function(e){var t=0;return{setSource:function(e,t){t(null,e)},currentTime:function(e){return e>t&&(t=e),e},setCurrentTime:function(n){var i=e.dragTime||e.options_.dragTime,r=t>i?t:i;return"backward"===e.options_.dragMode&&i>=0&&Math.floor(n)>r?e.currentTime():"disabled"===e.options_.dragMode?e.currentTime():n}}};r.default.use("*",a),t.default=a,e.exports=t.default},function(e,t,n){"use strict";function i(e,t){var n=t.path,i=t.height,r=t.width,s=t.interval;if(n.length&&i&&r){var o=a.a.dom||a.a,u=e.controlBar,l=u.progressControl,c=l.seekBar,d=c.mouseTimeDisplay;if(d){var h=function(e){Object.keys(e).forEach(function(t){var n=e[t],i=d.timeTooltip.el_.style;""!==n?i.setProperty(t,n):i.removeProperty(t)})},p=0,f=0,m=0,g=0,y=0;o.createEl("img",{src:n[0]}).onload=function(e){var t=e.target;m=t.naturalWidth,g=t.naturalHeight,f=Math.floor(m/r),p=Math.floor(g/i),y=p*f};var v=function(){if(f){var t=Math.floor(e.duration()*(parseFloat(d.el_.style.left)/c.el_.clientWidth));if(!isNaN(t)){var a=0;n.length>1&&(a=Math.floor(t/s/y));var l=t-a*y*s,p=Math.floor(l/s),m=Math.floor(p/f),g=Math.floor(p%f),v=-m*i,_=-g*r,b=o.getBoundingClientRect(u.el_).top,T=o.getBoundingClientRect(c.el_).top,S=-i;b<T&&(S-=T-b),h({width:r+"px",height:i+"px","background-image":"url("+n[a]+")","background-repeat":"no-repeat","background-position":_+"px "+v+"px",top:S+"px",color:"#fff","text-shadow":"1px 1px #000",border:"1px solid #000",margin:"0 1px"})}}};e.ready(function(){l.on("mousemove",v),l.on("touchmove",v)}),e.addClass("vjs-sprite-thumbnails")}}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=n.n(r),s={path:[],width:0,height:0,interval:1},o=function(e){i(this,a.a.mergeOptions(s,e))};a.a.registerPlugin("spriteThumbnails",o),o.VERSION="0.0.5",t.default=o},function(e,t,n){"use strict";function i(e){return{disableNextSnapshotRestore:!1,_contentEnding:!1,_contentHasEnded:!1,_hasThereBeenALoadStartDuringPlayerLife:!1,_hasThereBeenALoadedData:!1,_hasThereBeenALoadedMetaData:!1,_inLinearAdMode:!1,_shouldBlockPlay:!1,_playBlocked:!1,_playRequested:!1,adType:null,VERSION:b,reset:function(){e.ads.disableNextSnapshotRestore=!1,e.ads._contentEnding=!1,e.ads._contentHasEnded=!1,e.ads.snapshot=null,e.ads.adType=null,e.ads._hasThereBeenALoadedData=!1,e.ads._hasThereBeenALoadedMetaData=!1,e.ads._cancelledPlay=!1,e.ads._shouldBlockPlay=!1,e.ads._playBlocked=!1,e.ads.nopreroll_=!1,e.ads.nopostroll_=!1,e.ads._playRequested=!1},startLinearAdMode:function(){e.ads._state.startLinearAdMode()},endLinearAdMode:function(){e.ads._state.endLinearAdMode()},skipLinearAdMode:function(){e.ads._state.skipLinearAdMode()},stitchedAds:function(e){return void 0!==e&&(m.a.log.warn("Using player.ads.stitchedAds() as a setter is deprecated, it should be set as an option upon initialization of contrib-ads."),this.settings.stitchedAds=!!e),this.settings.stitchedAds},videoElementRecycled:function(){if(e.ads.shouldPlayContentBehindAd(e))return!1;if(!this.snapshot)throw new Error("You cannot use videoElementRecycled while there is no snapshot.");var t=e.tech_.src()!==this.snapshot.src,n=e.currentSrc()!==this.snapshot.currentSrc;return t||n},isLive:function(t){return void 0===t&&(t=e),"boolean"==typeof t.ads.settings.contentIsLive?t.ads.settings.contentIsLive:t.duration()===1/0||"8"===m.a.browser.IOS_VERSION&&0===t.duration()},shouldPlayContentBehindAd:function(t){if(void 0===t&&(t=e),t)return!!t.ads.settings.liveCuePoints&&(!m.a.browser.IS_IOS&&!m.a.browser.IS_ANDROID&&t.duration()===1/0);throw new Error("shouldPlayContentBehindAd requires a player as a param")},shouldTakeSnapshots:function(t){return void 0===t&&(t=e),!this.shouldPlayContentBehindAd(t)&&!this.stitchedAds()},isInAdMode:function(){return this._state.isAdState()},isWaitingForAdBreak:function(){return this._state.isWaitingForAdBreak()},isContentResuming:function(){return this._state.isContentResuming()},isAdPlaying:function(){return this._state.inAdBreak()},inAdBreak:function(){return this._state.inAdBreak()},removeNativePoster:function(){var t=e.$(".vjs-tech");t&&t.removeAttribute("poster")},debug:function(){if(this.settings.debug){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];1===t.length&&"string"==typeof t[0]?m.a.log("ADS: "+t[0]):m.a.log.apply(m.a,["ADS:"].concat(t))}}}}function r(e){"playing"===e.type?E(this,e):"ended"===e.type?w(this,e):"loadstart"===e.type||"loadeddata"===e.type||"loadedmetadata"===e.type?k(this,e):"play"===e.type?C(this,e):this.ads.isInAdMode()&&(this.ads.isContentResuming()?S(this,"content",e):S(this,"ad",e))}function a(e){e.ads.contentSrc=e.currentSrc(),e.ads._seenInitialLoadstart=!1;var t=function(){if(!e.ads.inAdBreak()){var t=e.currentSrc();t!==e.ads.contentSrc&&(e.ads._seenInitialLoadstart&&e.trigger({type:"contentchanged"}),e.trigger({type:"contentupdate",oldValue:e.ads.contentSrc,newValue:t}),e.ads.contentSrc=t),e.ads._seenInitialLoadstart=!0}};e.on("loadstart",t)}function s(e,t,n){var i=this,r={};e=e.replace(/{([^}=]+)=([^}]+)}/g,function(e,t,n){return r["{"+t+"}"]=n,"{"+t+"}"}),void 0===t&&(t=!1);var a={};void 0!==n&&(a=n),a["{player.id}"]=this.options_["data-player"]||this.id_,a["{player.height}"]=this.currentHeight(),a["{player.width}"]=this.currentWidth(),a["{mediainfo.id}"]=this.mediainfo?this.mediainfo.id:"",a["{mediainfo.name}"]=this.mediainfo?this.mediainfo.name:"",a["{mediainfo.duration}"]=this.mediainfo?this.mediainfo.duration:"",a["{player.duration}"]=this.duration(),a["{player.pageUrl}"]=m.a.dom.isInFrame()?_.a.referrer:y.a.location.href,a["{playlistinfo.id}"]=this.playlistinfo?this.playlistinfo.id:"",a["{playlistinfo.name}"]=this.playlistinfo?this.playlistinfo.name:"",a["{timestamp}"]=(new Date).getTime(),a["{document.referrer}"]=_.a.referrer,a["{window.location.href}"]=y.a.location.href,a["{random}"]=Math.floor(1e12*Math.random()),["description","tags","reference_id","ad_keys"].forEach(function(e){i.mediainfo&&i.mediainfo[e]?a["{mediainfo."+e+"}"]=i.mediainfo[e]:r["{mediainfo."+e+"}"]?a["{mediainfo."+e+"}"]=r["{mediainfo."+e+"}"]:a["{mediainfo."+e+"}"]=""}),O(this.mediainfo,a,"custom_fields"),O(this.mediainfo,a,"customFields"),Object.keys(A).forEach(function(e){a["{tcf."+e+"}"]=A[e]}),a["{tcf.gdprAppliesInt}"]=A.gdprApplies?1:0;for(var s in a)e=e.split(s).join(P(a[s],t));e=e.replace(/{pageVariable\.([^}]+)}/g,function(e,n){for(var i,a=y.a,s=n.split("."),o=0;o<s.length;o++)o===s.length-1?i=a[s[o]]:a=a[s[o]];var u=typeof i;return null===i?"null":void 0===i?r["{pageVariable."+n+"}"]?r["{pageVariable."+n+"}"]:(m.a.log.warn('Page variable "'+n+'" not found'),""):"string"!==u&&"number"!==u&&"boolean"!==u?(m.a.log.warn('Page variable "'+n+'" is not a supported type'),""):P(String(i),t)});for(var o in r)e=e.replace(o,r[o]);return e}function o(e,t){t&&m.a.log("Using cancelContentPlay to block content playback"),e.on("play",u)}function u(){!1!==this.ads._shouldBlockPlay&&(this.paused()||(this.ads.debug("Playback was canceled by cancelContentPlay"),this.pause()),this.ads._cancelledPlay=!0)}function l(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function c(e){var t;t=m.a.browser.IS_IOS&&e.ads.isLive(e)&&e.seekable().length>0?e.currentTime()-e.seekable().end(0):e.currentTime();var n=e.$(".vjs-tech"),i=e.textTracks?e.textTracks():[],r=[],a={ended:e.ended(),currentSrc:e.currentSrc(),sources:e.currentSources(),src:e.tech_.src(),currentTime:t,type:e.currentType()};n&&(a.style=n.getAttribute("style"));for(var s=0;s<i.length;s++){var o=i[s];r.push({track:o,mode:o.mode}),o.mode="disabled"}return a.suppressedTracks=r,a}function d(e,t){var n=e.ads.snapshot;if(void 0===t&&(t=function(){}),!0===e.ads.disableNextSnapshotRestore)return e.ads.disableNextSnapshotRestore=!1,delete e.ads.snapshot,void t();var i,r=e.$(".vjs-tech"),a=20,s=n.suppressedTracks,o=function(){for(var e=0;e<s.length;e++)i=s[e],i.track.mode=i.mode},u=function(){var t;if(m.a.browser.IS_IOS&&e.ads.isLive(e)){if(n.currentTime<0&&(t=e.seekable().length>0?e.seekable().end(0)+n.currentTime:e.currentTime(),e.currentTime(t)),e.paused()){var i=e.play();i&&i.catch&&i.catch(function(e){m.a.log.warn("Play promise rejected in IOS snapshot resume",e)})}}else if(n.ended)e.currentTime(e.duration());else{e.currentTime(n.currentTime);var r=e.play();r&&r.catch&&r.catch(function(e){m.a.log.warn("Play promise rejected in snapshot resume",e)})}e.ads.shouldRemoveAutoplay_&&(e.autoplay(!1),e.ads.shouldRemoveAutoplay_=!1)},l=function t(){if(e.off("contentcanplay",t),z&&e.clearTimeout(z),r=e.el().querySelector(".vjs-tech"),r.readyState>1)return u();if(void 0===r.seekable)return u();if(r.seekable.length>0)return u();if(a--)e.setTimeout(t,50);else try{u()}catch(e){m.a.log.warn("Failed to resume the content after an advertisement",e)}};if("style"in n&&r.setAttribute("style",n.style||""),e.ads.videoElementRecycled())e.one("resumeended",function(){delete e.ads.snapshot,t()}),e.one("contentloadedmetadata",o),m.a.browser.IS_IOS&&!e.autoplay()&&(e.autoplay(!0),e.ads.shouldRemoveAutoplay_=!0),e.src(n.sources),e.one("contentcanplay",l),z=e.setTimeout(l,2e3);else{if(o(),!e.ended()){var c=e.play();c&&c.catch&&c.catch(function(e){m.a.log.warn("Play promise rejected in snapshot restore",e)})}delete e.ads.snapshot,t()}}function h(e){e.ads.debug("Starting ad break"),e.ads._inLinearAdMode=!0,e.trigger("adstart"),e.ads.shouldTakeSnapshots()&&(e.ads.snapshot=c(e)),e.ads.shouldPlayContentBehindAd(e)&&(e.ads.preAdVolume_=e.volume(),e.volume(0)),e.addClass("vjs-ad-playing"),e.hasClass("vjs-live")&&e.removeClass("vjs-live"),e.ads.removeNativePoster()}function p(e,t){e.ads.debug("Ending ad break"),void 0===t&&(t=function(){}),e.ads.adType=null,e.ads._inLinearAdMode=!1,e.trigger("adend"),e.removeClass("vjs-ad-playing"),e.ads.isLive(e)&&e.addClass("vjs-live"),e.ads.shouldTakeSnapshots()?d(e,t):(e.volume(e.ads.preAdVolume_),t())}Object.defineProperty(t,"__esModule",{value:!0});var f=n(0),m=n.n(f),g=n(1),y=n.n(g),v=n(7),_=n.n(v),b="6.9.0",T=function(e,t){t.isImmediatePropagationStopped=function(){return!0},t.cancelBubble=!0,t.isPropagationStopped=function(){return!0}},S=function(e,t,n){T(0,n),e.trigger({type:t+n.type,originalEvent:n})},E=function(e,t){e.ads.isInAdMode()&&(e.ads.isContentResuming()?e.ads._contentEnding&&S(e,"content",t):S(e,"ad",t))},w=function(e,t){e.ads.isInAdMode()?e.ads.isContentResuming()?(T(0,t),e.trigger("resumeended")):S(e,"ad",t):e.ads._contentHasEnded||e.ads.stitchedAds()||(S(e,"content",t),e.trigger("readyforpostroll"))},k=function(e,t){if(!("loadstart"===t.type&&!e.ads._hasThereBeenALoadStartDuringPlayerLife||"loadeddata"===t.type&&!e.ads._hasThereBeenALoadedData||"loadedmetadata"===t.type&&!e.ads._hasThereBeenALoadedMetaData))if(e.ads.inAdBreak())S(e,"ad",t);else{if(e.currentSrc()!==e.ads.contentSrc)return;S(e,"content",t)}},C=function(e,t){e.ads.inAdBreak()?S(e,"ad",t):e.ads.isContentResuming()&&S(e,"content",t)},A={},I=function(e){if(m.a.dom.isInFrame()&&"function"!=typeof y.a.__tcfapi){for(var t,n=y.a,i={};n;){try{if(n.frames.__tcfapiLocator){t=n;break}}catch(e){}if(n===y.a.top)break;n=n.parent}if(!t)return;y.a.__tcfapi=function(e,n,r,a){var s=Math.random()+"",o={__tcfapiCall:{command:e,parameter:a,version:n,callId:s}};i[s]=r,t.postMessage(o,"*")},y.a.addEventListener("message",function(e){var t={};try{t="string"==typeof e.data?JSON.parse(e.data):e.data}catch(e){}var n=t.__tcfapiReturn;n&&"function"==typeof i[n.callId]&&(i[n.callId](n.returnValue,n.success),i[n.callId]=null)},!1)}},x=function(){I(),"function"==typeof y.a.__tcfapi&&y.a.__tcfapi("addEventListener",2,function(e,t){t&&(A=e)})},P=function(e,t){return t?encodeURIComponent(e):e},O=function(e,t,n){if(e&&e[n])for(var i=e[n],r=Object.keys(i),a=0;a<r.length;a++){var s="{mediainfo."+n+"."+r[a]+"}";t[s]=i[r[a]]}},L={};L.processMetadataTracks=function(e,t){for(var n=e.textTracks(),i=function(n){"metadata"===n.kind&&(e.ads.cueTextTracks.setMetadataTrackMode(n),t(e,n))},r=0;r<n.length;r++)i(n[r]);n.addEventListener("addtrack",function(e){i(e.track)})},L.setMetadataTrackMode=function(e){},L.getSupportedAdCue=function(e,t){return t},L.isSupportedAdCue=function(e,t){return!0},L.getCueId=function(e,t){return t.id};var D=function(e,t){return void 0!==t&&e.ads.includedCues[t]},R=function(e,t){void 0!==t&&""!==t&&(e.ads.includedCues[t]=!0)};L.processAdTrack=function(e,t,n,i){e.ads.includedCues={};for(var r=0;r<t.length;r++){var a=t[r],s=this.getSupportedAdCue(e,a);if(!this.isSupportedAdCue(e,a))return void m.a.log.warn("Skipping as this is not a supported ad cue.",a);var o=this.getCueId(e,a),u=a.startTime;if(D(e,o))return void m.a.log("Skipping ad already seen with ID "+o);i&&i(e,s,o,u),n(e,s,o,u),R(e,o)}};var M={},N=m.a;M.isMiddlewareMediatorSupported=function(){return!N.browser.IS_IOS&&!N.browser.IS_ANDROID&&!!(N.use&&N.middleware&&N.middleware.TERMINATOR)},M.playMiddleware=function(e){return{setSource:function(e,t){t(null,e)},callPlay:function(){if(e.ads&&!0===e.ads._shouldBlockPlay)return e.ads.debug("Using playMiddleware to block content playback"),e.ads._playBlocked=!0,N.middleware.TERMINATOR},play:function(t,n){e.ads&&e.ads._playBlocked&&t?(e.ads.debug("Play call to Tech was terminated."),e.trigger("play"),e.addClass("vjs-has-started"),e.ads._playBlocked=!1):n&&n.catch&&n.catch(function(t){"NotAllowedError"!==t.name||m.a.browser.IS_SAFARI||e.trigger("pause")})}}},M.testHook=function(e){N=e};var U=M.playMiddleware,B=M.isMiddlewareMediatorSupported,j=function(){if(m.a.getPlugin)return Boolean(m.a.getPlugin("ads"));var e=m.a.getComponent("Player");return Boolean(e&&e.prototype.ads)},F=function(){function e(){}return e.getState=function(t){if(t)return e.states_&&e.states_[t]?e.states_[t]:void 0},e.registerState=function(t,n){if("string"!=typeof t||!t)throw new Error('Illegal state name, "'+t+'"; must be a non-empty string.');return e.states_||(e.states_={}),e.states_[t]=n,n},e}(),H=function(){function e(e){this.player=e}e._getName=function(){return"Anonymous State"};var t=e.prototype;return t.transitionTo=function(e){var t=this.player;this.cleanup(t);var n=new e(t);t.ads._state=n,t.ads.debug(this.constructor._getName()+" -> "+n.constructor._getName());for(var i=arguments.length,r=new Array(i>1?i-1:0),a=1;a<i;a++)r[a-1]=arguments[a];n.init.apply(n,[t].concat(r))},t.init=function(){},t.cleanup=function(){},t.onPlay=function(){},t.onPlaying=function(){},t.onEnded=function(){},t.onAdEnded=function(){},t.onAdsReady=function(){m.a.log.warn("Unexpected adsready event")},t.onAdsError=function(){},t.onAdsCanceled=function(){},t.onAdTimeout=function(){},t.onAdStarted=function(){},t.onContentChanged=function(){},t.onContentResumed=function(){},t.onReadyForPostroll=function(){m.a.log.warn("Unexpected readyforpostroll event")},t.onNoPreroll=function(){},t.onNoPostroll=function(){},t.startLinearAdMode=function(){m.a.log.warn("Unexpected startLinearAdMode invocation (State via "+this.constructor._getName()+")")},t.endLinearAdMode=function(){m.a.log.warn("Unexpected endLinearAdMode invocation (State via "+this.constructor._getName()+")")},t.skipLinearAdMode=function(){m.a.log.warn("Unexpected skipLinearAdMode invocation (State via "+this.constructor._getName()+")")},t.isAdState=function(){throw new Error("isAdState unimplemented for "+this.constructor._getName())},t.isWaitingForAdBreak=function(){return!1},t.isContentResuming=function(){return!1},t.inAdBreak=function(){return!1},t.handleEvent=function(e){var t=this.player;"play"===e?this.onPlay(t):"adsready"===e?this.onAdsReady(t):"adserror"===e?this.onAdsError(t):"adscanceled"===e?this.onAdsCanceled(t):"adtimeout"===e?this.onAdTimeout(t):"ads-ad-started"===e?this.onAdStarted(t):"contentchanged"===e?this.onContentChanged(t):"contentresumed"===e?this.onContentResumed(t):"readyforpostroll"===e?this.onReadyForPostroll(t):"playing"===e?this.onPlaying(t):"ended"===e?this.onEnded(t):"nopreroll"===e?this.onNoPreroll(t):"nopostroll"===e?this.onNoPostroll(t):"adended"===e&&this.onAdEnded(t)},e}();F.registerState("State",H);var q=function(e){function t(t){var n;return n=e.call(this,t)||this,n.contentResuming=!1,n.waitingForAdBreak=!1,n}l(t,e);var n=t.prototype;return n.isAdState=function(){return!0},n.onPlaying=function(){var e=F.getState("ContentPlayback");this.contentResuming&&this.transitionTo(e)},n.onContentResumed=function(){var e=F.getState("ContentPlayback");this.contentResuming&&this.transitionTo(e)},n.isWaitingForAdBreak=function(){return this.waitingForAdBreak},n.isContentResuming=function(){return this.contentResuming},n.inAdBreak=function(){return!0===this.player.ads._inLinearAdMode},t}(H);F.registerState("AdState",q);var V=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var n=t.prototype;return n.isAdState=function(){return!1},n.onContentChanged=function(e){var t=F.getState("BeforePreroll"),n=F.getState("Preroll");e.ads.debug("Received contentchanged event (ContentState)"),e.paused()?this.transitionTo(t):(this.transitionTo(n,!1),e.pause(),e.ads._pausedOnContentupdate=!0)},t}(H);F.registerState("ContentState",V);var W=F.getState("ContentState"),G=function(e){function t(){return e.apply(this,arguments)||this}l(t,e),t._getName=function(){return"AdsDone"};var n=t.prototype;return n.init=function(e){e.ads._contentHasEnded=!0,e.trigger("ended")},n.startLinearAdMode=function(){m.a.log.warn("Unexpected startLinearAdMode invocation (AdsDone)")},t}(W);F.registerState("AdsDone",G);var z,X={start:h,end:p},Y=F.getState("AdState"),K=function(e){function t(){return e.apply(this,arguments)||this}l(t,e),t._getName=function(){return"Preroll"};var n=t.prototype;return n.init=function(e,t,n){if(this.waitingForAdBreak=!0,e.addClass("vjs-ad-loading"),n||e.ads.nopreroll_)return this.resumeAfterNoPreroll(e);var i=e.ads.settings.timeout;"number"==typeof e.ads.settings.prerollTimeout&&(i=e.ads.settings.prerollTimeout),this._timeout=e.setTimeout(function(){e.trigger("adtimeout")},i),t?this.handleAdsReady():this.adsReady=!1},n.onAdsReady=function(e){e.ads.inAdBreak()?m.a.log.warn("Unexpected adsready event (Preroll)"):(e.ads.debug("Received adsready event (Preroll)"),this.handleAdsReady())},n.handleAdsReady=function(){this.adsReady=!0,this.readyForPreroll()},n.afterLoadStart=function(e){var t=this.player;t.ads._hasThereBeenALoadStartDuringPlayerLife?e():(t.ads.debug("Waiting for loadstart..."),t.one("loadstart",function(){t.ads.debug("Received loadstart event"),e()}))},n.noPreroll=function(){var e=this;this.afterLoadStart(function(){e.player.ads.debug("Skipping prerolls due to nopreroll event (Preroll)"),e.resumeAfterNoPreroll(e.player)})},n.readyForPreroll=function(){var e=this.player;this.afterLoadStart(function(){e.ads.debug("Triggered readyforpreroll event (Preroll)"),e.trigger("readyforpreroll")})},n.onAdsCanceled=function(e){var t=this;e.ads.debug("adscanceled (Preroll)"),this.afterLoadStart(function(){t.resumeAfterNoPreroll(e)})},n.onAdsError=function(e){var t=this;m.a.log("adserror (Preroll)"),this.inAdBreak()?e.ads.endLinearAdMode():this.afterLoadStart(function(){t.resumeAfterNoPreroll(e)})},n.startLinearAdMode=function(){var e=this.player;!this.adsReady||e.ads.inAdBreak()||this.isContentResuming()?m.a.log.warn("Unexpected startLinearAdMode invocation (Preroll)"):(this.clearTimeout(e),e.ads.adType="preroll",this.waitingForAdBreak=!1,X.start(e),e.ads._shouldBlockPlay=!1)},n.onAdStarted=function(e){e.removeClass("vjs-ad-loading")},n.endLinearAdMode=function(){var e=this.player;this.inAdBreak()&&(e.removeClass("vjs-ad-loading"),e.addClass("vjs-ad-content-resuming"),this.contentResuming=!0,X.end(e))},n.skipLinearAdMode=function(){var e=this,t=this.player;t.ads.inAdBreak()||this.isContentResuming()?m.a.log.warn("Unexpected skipLinearAdMode invocation"):this.afterLoadStart(function(){t.trigger("adskip"),t.ads.debug("skipLinearAdMode (Preroll)"),e.resumeAfterNoPreroll(t)})},n.onAdTimeout=function(e){var t=this;this.afterLoadStart(function(){e.ads.debug("adtimeout (Preroll)"),t.resumeAfterNoPreroll(e)})},n.onNoPreroll=function(e){e.ads.inAdBreak()||this.isContentResuming()?m.a.log.warn("Unexpected nopreroll event (Preroll)"):this.noPreroll()},n.resumeAfterNoPreroll=function(e){if(this.contentResuming=!0,e.ads._shouldBlockPlay=!1,this.cleanupPartial(e),e.ads._playRequested||e.ads._pausedOnContentupdate)if(e.paused()){e.ads.debug("resumeAfterNoPreroll: attempting to resume playback (Preroll)");var t=e.play();t&&t.then&&t.then(null,function(e){})}else e.ads.debug("resumeAfterNoPreroll: already playing (Preroll)"),e.trigger("play"),e.trigger("playing")},n.cleanup=function(e){e.ads._hasThereBeenALoadStartDuringPlayerLife||m.a.log.warn("Leaving Preroll state before loadstart event can cause issues."),this.cleanupPartial(e)},n.cleanupPartial=function(e){e.removeClass("vjs-ad-loading"),e.removeClass("vjs-ad-content-resuming"),this.clearTimeout(e)},n.clearTimeout=function(e){e.clearTimeout(this._timeout),this._timeout=null},t}(Y);F.registerState("Preroll",K);var Q=F.getState("ContentState"),$=function(e){function t(){return e.apply(this,arguments)||this}l(t,e),t._getName=function(){return"BeforePreroll"};var n=t.prototype;return n.init=function(e){this.adsReady=!1,this.shouldResumeToContent=!1,e.ads._shouldBlockPlay=!e.ads.settings.allowVjsAutoplay||!e.autoplay()},n.onAdsReady=function(e){e.ads.debug("Received adsready event (BeforePreroll)"),this.adsReady=!0},n.onPlay=function(e){var t=F.getState("Preroll");e.ads.debug("Received play event (BeforePreroll)"),this.transitionTo(t,this.adsReady,this.shouldResumeToContent)},n.onAdsCanceled=function(e){e.ads.debug("adscanceled (BeforePreroll)"),this.shouldResumeToContent=!0},n.onAdsError=function(){this.player.ads.debug("adserror (BeforePreroll)"),this.shouldResumeToContent=!0},n.onNoPreroll=function(){this.player.ads.debug("Skipping prerolls due to nopreroll event (BeforePreroll)"),this.shouldResumeToContent=!0},n.skipLinearAdMode=function(){var e=this.player;e.trigger("adskip"),e.ads.debug("skipLinearAdMode (BeforePreroll)"),this.shouldResumeToContent=!0},n.onContentChanged=function(){this.init(this.player)},t}(Q);F.registerState("BeforePreroll",$);var J=F.getState("AdState"),Z=function(e){function t(){return e.apply(this,arguments)||this}l(t,e),t._getName=function(){return"Midroll"};var n=t.prototype;return n.init=function(e){e.ads.adType="midroll",X.start(e),e.addClass("vjs-ad-loading")},n.onAdStarted=function(e){e.removeClass("vjs-ad-loading")},n.endLinearAdMode=function(){var e=this.player;this.inAdBreak()&&(this.contentResuming=!0,e.addClass("vjs-ad-content-resuming"),e.removeClass("vjs-ad-loading"),X.end(e))},n.onAdsError=function(e){this.inAdBreak()&&e.ads.endLinearAdMode()},n.cleanup=function(e){e.removeClass("vjs-ad-loading"),e.removeClass("vjs-ad-content-resuming")},t}(J);F.registerState("Midroll",Z);var ee=F.getState("AdState"),te=function(e){function t(){return e.apply(this,arguments)||this}l(t,e),t._getName=function(){return"Postroll"};var n=t.prototype;return n.init=function(e){if(this.waitingForAdBreak=!0,e.ads._contentEnding=!0,e.ads.nopostroll_){this.resumeContent(e);var t=F.getState("AdsDone");this.transitionTo(t)}else{e.addClass("vjs-ad-loading");var n=e.ads.settings.timeout;"number"==typeof e.ads.settings.postrollTimeout&&(n=e.ads.settings.postrollTimeout),this._postrollTimeout=e.setTimeout(function(){e.trigger("adtimeout")},n)}},n.startLinearAdMode=function(){var e=this.player;e.ads.inAdBreak()||this.isContentResuming()?m.a.log.warn("Unexpected startLinearAdMode invocation (Postroll)"):(e.ads.adType="postroll",e.clearTimeout(this._postrollTimeout),this.waitingForAdBreak=!1,X.start(e))},n.onAdStarted=function(e){e.removeClass("vjs-ad-loading")},n.endLinearAdMode=function(){var e=this,t=this.player,n=F.getState("AdsDone");this.inAdBreak()&&(t.removeClass("vjs-ad-loading"),this.resumeContent(t),X.end(t,function(){e.transitionTo(n)}))},n.skipLinearAdMode=function(){var e=this.player;e.ads.inAdBreak()||this.isContentResuming()?m.a.log.warn("Unexpected skipLinearAdMode invocation"):(e.ads.debug("Postroll abort (skipLinearAdMode)"),e.trigger("adskip"),this.abort(e))},n.onAdTimeout=function(e){e.ads.debug("Postroll abort (adtimeout)"),this.abort(e)},n.onAdsError=function(e){e.ads.debug("Postroll abort (adserror)"),e.ads.inAdBreak()?e.ads.endLinearAdMode():this.abort(e)},n.onContentChanged=function(e){if(this.isContentResuming()){var t=F.getState("BeforePreroll");this.transitionTo(t)}else if(!this.inAdBreak()){var n=F.getState("Preroll");this.transitionTo(n)}},n.onNoPostroll=function(e){this.isContentResuming()||this.inAdBreak()?m.a.log.warn("Unexpected nopostroll event (Postroll)"):this.abort(e)},n.resumeContent=function(e){this.contentResuming=!0,e.addClass("vjs-ad-content-resuming")},n.abort=function(e){var t=F.getState("AdsDone");this.resumeContent(e),e.removeClass("vjs-ad-loading"),this.transitionTo(t)},n.cleanup=function(e){e.removeClass("vjs-ad-content-resuming"),e.clearTimeout(this._postrollTimeout),e.ads._contentEnding=!1},t}(ee);F.registerState("Postroll",te);var ne=F.getState("ContentState"),ie=function(e){function t(){return e.apply(this,arguments)||this}l(t,e),t._getName=function(){return"ContentPlayback"};var n=t.prototype;return n.init=function(e){e.ads._shouldBlockPlay=!1},n.onAdsReady=function(e){e.ads.debug("Received adsready event (ContentPlayback)"),e.ads.nopreroll_||(e.ads.debug("Triggered readyforpreroll event (ContentPlayback)"),e.trigger("readyforpreroll"))},n.onReadyForPostroll=function(e){var t=F.getState("Postroll");e.ads.debug("Received readyforpostroll event"),this.transitionTo(t)},n.startLinearAdMode=function(){var e=F.getState("Midroll");this.transitionTo(e)},t}(ne);F.registerState("ContentPlayback",ie);var re=F.getState("ContentState"),ae=function(e){function t(){return e.apply(this,arguments)||this}l(t,e),t._getName=function(){return"StitchedContentPlayback"};var n=t.prototype;return n.init=function(){this.player.ads._shouldBlockPlay=!1},n.onContentChanged=function(){this.player.ads.debug("Received contentchanged event ("+this.constructor._getName()+")")},n.startLinearAdMode=function(){var e=F.getState("StitchedAdRoll");this.transitionTo(e)},t}(re);F.registerState("StitchedContentPlayback",ae);var se=F.getState("AdState"),oe=function(e){function t(){return e.apply(this,arguments)||this}l(t,e),t._getName=function(){return"StitchedAdRoll"};var n=t.prototype;return n.init=function(){this.waitingForAdBreak=!1,this.contentResuming=!1,this.player.ads.adType="stitched",X.start(this.player)},n.onPlaying=function(){},n.onContentResumed=function(){},n.onAdEnded=function(){this.endLinearAdMode(),this.player.trigger("ended")},n.endLinearAdMode=function(){var e=F.getState("StitchedContentPlayback");X.end(this.player),this.transitionTo(e)},t}(se);F.registerState("StitchedAdRoll",oe);var ue=M.isMiddlewareMediatorSupported,le=m.a.getTech("Html5").Events,ce={timeout:5e3,prerollTimeout:void 0,postrollTimeout:void 0,debug:!1,stitchedAds:!1,contentIsLive:void 0,liveCuePoints:!0,allowVjsAutoplay:m.a.options.normalizeAutoplay||!1},de=function(e){var t=this,n=m.a.mergeOptions(ce,e),u=[];le.concat(["firstplay","loadedalldata"]).forEach(function(e){-1===u.indexOf(e)&&u.push(e)}),t.on(u,r),ue()||o(t,n.debug),t.setTimeout(function(){t.ads._hasThereBeenALoadStartDuringPlayerLife||""===t.src()||m.a.log.error("videojs-contrib-ads has not seen a loadstart event 5 seconds after being initialized, but a source is present. This indicates that videojs-contrib-ads was initialized too late. It must be initialized immediately after video.js in the same tick. As a result, some ads will not play and some media events will be incorrect. For more information, see http://videojs.github.io/videojs-contrib-ads/integrator/getting-started.html")},5e3),t.on("ended",function(){t.hasClass("vjs-has-started")||t.addClass("vjs-has-started")}),t.on("contenttimeupdate",function(){t.removeClass("vjs-waiting")}),t.on(["addurationchange","adcanplay"],function(){if(!t.ads.settings.stitchedAds&&!t.hasStarted()&&(!t.ads.snapshot||t.currentSrc()!==t.ads.snapshot.currentSrc)&&t.ads.inAdBreak()){var e=t.play();e&&e.catch&&e.catch(function(e){m.a.log.warn("Play promise rejected when playing ad",e)})}}),t.on("nopreroll",function(){t.ads.debug("Received nopreroll event"),t.ads.nopreroll_=!0}),t.on("nopostroll",function(){t.ads.debug("Received nopostroll event"),t.ads.nopostroll_=!0}),t.on("playing",function(){t.ads._cancelledPlay=!1,t.ads._pausedOnContentupdate=!1}),t.on("play",function(){t.ads._playRequested=!0}),t.one("loadstart",function(){t.ads._hasThereBeenALoadStartDuringPlayerLife=!0}),t.on("loadeddata",function(){t.ads._hasThereBeenALoadedData=!0}),t.on("loadedmetadata",function(){t.ads._hasThereBeenALoadedMetaData=!0}),t.ads=i(t),t.ads.settings=n,n.stitchedAds=!!n.stitchedAds,n.stitchedAds?t.ads._state=new(F.getState("StitchedContentPlayback"))(t):t.ads._state=new(F.getState("BeforePreroll"))(t),t.ads._state.init(t),t.ads.cueTextTracks=L,t.ads.adMacroReplacement=s.bind(t),a(t),t.on("contentchanged",t.ads.reset);var l=function(){return!t.ads.shouldPlayContentBehindAd(t)&&t.ads.inAdBreak()&&t.tech_.featuresNativeTextTracks&&m.a.browser.IS_IOS&&!Array.isArray(t.textTracks())},c=function(){var e=t.textTracks();if(l())for(var n=0;n<e.length;n++){var i=e[n];"showing"===i.mode&&(i.mode="disabled")}};t.ready(function(){t.textTracks().addEventListener("change",c)}),t.on(["play","playing","ended","adsready","adscanceled","adskip","adserror","adtimeout","adended","ads-ad-started","contentchanged","dispose","contentresumed","readyforpostroll","nopreroll","nopostroll"],function(e){t.ads._state.handleEvent(e.type)}),t.on("dispose",function(){t.ads.reset(),t.textTracks().removeEventListener("change",c)}),x(),t.ads.listenToTcf=x};de.VERSION=b,function(e){!j(m.a)&&((m.a.registerPlugin||m.a.plugin)("ads",e),B()&&!m.a.usingContribAdsMiddleware_&&(m.a.use("*",U),m.a.usingContribAdsMiddleware_=!0,m.a.log.debug("Play middleware has been registered with videojs")))}(de),t.default=de},function(e,t,n){var i,r;!function(a,s){"undefined"!=typeof window&&window.videojs?s(window.videojs):(i=[n(0)],void 0!==(r=function(e){return s(e.default||e)}.apply(t,i))&&(e.exports=r))}(0,function(e){"use strict";"undefined"!=typeof window&&(window.videojs_hotkeys={version:"0.2.27"}),(e.registerPlugin||e.plugin)("hotkeys",function(t){function n(e){return"function"==typeof c?c(e):c}function i(e){null!=e&&"function"==typeof e.then&&e.then(null,function(e){})}var r=this,a=r.el(),s=document,o={volumeStep:.1,seekStep:5,enableMute:!0,enableVolumeScroll:!0,enableHoverScroll:!1,enableFullscreen:!0,enableNumbers:!0,enableJogStyle:!1,alwaysCaptureHotkeys:!1,captureDocumentHotkeys:!1,documentHotkeysFocusElementFilter:function(){return!1},enableModifiersForNumbers:!0,enableInactiveFocus:!0,skipInitialFocus:!1,playPauseKey:function(e){return 32===e.which||179===e.which},rewindKey:function(e){return 37===e.which||177===e.which},forwardKey:function(e){return 39===e.which||176===e.which},volumeUpKey:function(e){return 38===e.which},volumeDownKey:function(e){return 40===e.which},muteKey:function(e){return 77===e.which},fullscreenKey:function(e){return 70===e.which},customKeys:{}},u=e.mergeOptions||e.util.mergeOptions,l=(t=u(o,t||{})).volumeStep,c=t.seekStep,d=t.enableMute,h=t.enableVolumeScroll,p=t.enableHoverScroll,f=t.enableFullscreen,m=t.enableNumbers,g=t.enableJogStyle,y=t.alwaysCaptureHotkeys,v=t.captureDocumentHotkeys,_=t.documentHotkeysFocusElementFilter,b=t.enableModifiersForNumbers,T=t.enableInactiveFocus,S=t.skipInitialFocus,E=e.VERSION;a.hasAttribute("tabIndex")||a.setAttribute("tabIndex","-1"),a.style.outline="none",!y&&r.autoplay()||S||r.one("play",function(){a.focus()}),T&&r.on("userinactive",function(){var e=function(){clearTimeout(t)},t=setTimeout(function(){r.off("useractive",e);var t=s.activeElement,n=a.querySelector(".vjs-control-bar");t&&t.parentElement==n&&a.focus()},10);r.one("useractive",e)}),r.on("play",function(){var e=a.querySelector(".iframeblocker");e&&""===e.style.display&&(e.style.display="block",e.style.bottom="39px")});var w=function(e){var o,u,c=e.which,h=e.preventDefault.bind(e),p=r.duration();if(r.controls()){var T=s.activeElement;if(y||v&&_(T)||T==a||T==a.querySelector(".vjs-tech")||T==a.querySelector(".vjs-control-bar")||T==a.querySelector(".iframeblocker"))switch(I(e,r)){case 1:h(),(y||v)&&e.stopPropagation(),r.paused()?i(r.play()):r.pause();break;case 2:o=!r.paused(),h(),o&&r.pause(),(u=r.currentTime()-n(e))<=0&&(u=0),r.currentTime(u),o&&i(r.play());break;case 3:o=!r.paused(),h(),o&&r.pause(),(u=r.currentTime()+n(e))>=p&&(u=o?p-.001:p),r.currentTime(u),o&&i(r.play());break;case 5:h(),g?(u=r.currentTime()-1,r.currentTime()<=1&&(u=0),r.currentTime(u)):r.volume(r.volume()-l);break;case 4:h(),g?((u=r.currentTime()+1)>=p&&(u=p),r.currentTime(u)):r.volume(r.volume()+l);break;case 6:d&&r.muted(!r.muted());break;case 7:f&&(r.isFullscreen()?r.exitFullscreen():r.requestFullscreen());break;default:if((c>47&&c<59||c>95&&c<106)&&(b||!(e.metaKey||e.ctrlKey||e.altKey))&&m){var S=48;c>95&&(S=96);var E=c-S;h(),r.currentTime(r.duration()*E*.1)}for(var w in t.customKeys){var k=t.customKeys[w];k&&k.key&&k.handler&&k.key(e)&&(h(),k.handler(r,t,e))}}}},k=!1,C=a.querySelector(".vjs-volume-menu-button")||a.querySelector(".vjs-volume-panel");null!=C&&(C.onmouseover=function(){k=!0},C.onmouseout=function(){k=!1});var A=function(e){if(p)t=0;else var t=s.activeElement;if(r.controls()&&(y||t==a||t==a.querySelector(".vjs-tech")||t==a.querySelector(".iframeblocker")||t==a.querySelector(".vjs-control-bar")||k)&&h){e=window.event||e;var n=Math.max(-1,Math.min(1,e.wheelDelta||-e.detail));e.preventDefault(),1==n?r.volume(r.volume()+l):-1==n&&r.volume(r.volume()-l)}},I=function(e,n){return t.playPauseKey(e,n)?1:t.rewindKey(e,n)?2:t.forwardKey(e,n)?3:t.volumeUpKey(e,n)?4:t.volumeDownKey(e,n)?5:t.muteKey(e,n)?6:t.fullscreenKey(e,n)?7:void 0};return r.on("keydown",w),r.on("dblclick",function(e){if(null!=E&&E<="7.1.0"&&r.controls()){var t=e.relatedTarget||e.toElement||s.activeElement;t!=a&&t!=a.querySelector(".vjs-tech")&&t!=a.querySelector(".iframeblocker")||f&&(r.isFullscreen()?r.exitFullscreen():r.requestFullscreen())}}),r.on("mousewheel",A),r.on("DOMMouseScroll",A),v&&document.addEventListener("keydown",function(e){w(e)}),this})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(14),s={};s.audioBg=function(){var e=r.default.getComponent("Component"),t=r.default.extend(e,{constructor:function(t){e.apply(this,arguments)},createEl:function(){var e=r.default.dom.createEl("div",{className:"vjs-audio-bg"});return e.innerHTML="\n <div class='vjs-audio-bg-logo'>\n <div class='vjs-audio-bg-logo-background'></div>\n </div>\n <div class='vjs-audio-bg__down'>\n <div class='vjs-audio-bg__reflection'>\n <div class='vjs-audio-bg-logo'>\n <div class='vjs-audio-bg-logo-background'></div>\n </div>\n </div>\n <div class='vjs-audio-bg__overlay'></div>\n </div>",e}});r.default.registerComponent("AudioBg",t)},s.frontLoading=function(){var e=r.default.getComponent("Component"),t=r.default.extend(e,{constructor:function(t,n){e.apply(this,arguments),n.url&&this.updateBackground(n.url)},createEl:function(){return r.default.dom.createEl("div",{className:"vjs-front-loading"})},updateBackground:function(e){"string"==typeof e&&this.el()&&(r.default.dom.emptyEl(this.el()),this.el().style.backgroundImage="url("+e+")")}});r.default.registerComponent("FrontLoading",t)},s.topControl=function(){var e=r.default.getComponent("Component"),t=r.default.extend(e,{constructor:function(t){e.apply(this,arguments)},createEl:function(){return r.default.dom.createEl("div",{className:"vjs-top-control"})}});r.default.registerComponent("TopControl",t)},s.topTime=function(){var e=r.default.getComponent("Component"),t=r.default.extend(e,{constructor:function(t,n){e.apply(this,arguments),n.text&&this.updateTextContent(n.text)},createEl:function(){return r.default.dom.createEl("div",{className:"vjs-full-time"})},updateTextContent:function(e){"string"!=typeof e&&(e="Text Unknown"),this.el()&&(r.default.dom.emptyEl(this.el()),r.default.dom.appendContent(this.el(),e))}});r.default.registerComponent("TopTime",t)},s.title=function(){var e=r.default.getComponent("Component"),t=r.default.extend(e,{constructor:function(t,n){e.apply(this,arguments),n.title&&this.updateTitleContent(n.title)},createEl:function(){return r.default.dom.createEl("div",{className:"vjs-title"})},updateTitleContent:function(e){"string"==typeof e&&this.el()&&(r.default.dom.emptyEl(this.el()),this.el().innerHTML=e)}});r.default.registerComponent("Title",t)},s.topButton=function(){var e=r.default.getComponent("Component"),t=r.default.extend(e,{constructor:function(t,n){e.apply(this,arguments),n.text&&this.updateTextContent(n.text),n.className&&this.updateClassName(n.className)},createEl:function(){return r.default.dom.createEl("div",{className:"vjs-size-button"})},updateTextContent:function(e){"string"!=typeof e&&(e="Text Unknown"),this.el()&&(r.default.dom.emptyEl(this.el()),r.default.dom.appendContent(this.el(),e))},updateClassName:function(e){"string"!=typeof e&&(e=""),this.el()&&r.default.dom.addClass(this.el(),e)}});r.default.registerComponent("TopButton",t)},s.logo=function(){var e=r.default.getComponent("Component"),t=r.default.extend(e,{constructor:function(t,n){e.apply(this,arguments),n.url&&this.updateBackground(n.url)},createEl:function(){return r.default.dom.createEl("div",{className:"vjs-control-bar-logo vjs-control"})},updateBackground:function(e){"string"==typeof e&&this.el()&&(r.default.dom.emptyEl(this.el()),this.el().style.backgroundImage="url("+e+")")}});r.default.registerComponent("ControlBarLogo",t)},s.playbackRateTip=function(){var e=r.default.getComponent("Component"),t=r.default.extend(e,{constructor:function(t,n){e.apply(this,arguments),n.text&&this.updateText(n.text)},createEl:function(){var e=r.default.dom.createEl("div",{className:"vjs-rate-tip"});return e.innerHTML="",e},updateText:function(e){"string"==typeof e&&this.el()&&(r.default.dom.emptyEl(this.el()),this.el().innerHTML=e)}});r.default.registerComponent("PlaybackRateTip",t)};var o={};o.topControl=function(e){s.topControl(),s.topTime(),s.topButton();var t=function(e,t){e.forEach(function(e){e.removeClass("current")}),t.addClass("current")};if(e.addChild("TopControl"),!e.isAudio()){var n=e.getChild("TopControl").addChild("TopButton",{text:"50%"}),i=e.getChild("TopControl").addChild("TopButton",{text:"75%"}),r=e.getChild("TopControl").addChild("TopButton",{text:"100%",className:"current"}),o=[n,i,r];n.on("click",function(){e.addClass("vjs-fullscreen-small"),e.removeClass("vjs-fullscreen-middle"),t(o,n)}),i.on("click",function(){e.removeClass("vjs-fullscreen-small"),e.addClass("vjs-fullscreen-middle"),t(o,i)}),r.on("click",function(){e.removeClass("vjs-fullscreen-small"),e.removeClass("vjs-fullscreen-middle"),t(o,r)})}var u=e.getChild("TopControl").addChild("TopTime",{text:(0,a.getTime)()});!function e(){return setTimeout(function(){e()},1e3),u.updateTextContent((0,a.getTime)())}()},o.logo=function(e,t){s.logo(),e.getChild("ControlBar").addChild("ControlBarLogo",{url:t})},o.frontLoading=function(e,t){s.frontLoading(),e.addChild("FrontLoading",{url:t})},o.audioBg=function(e){return s.audioBg(),e.addChild("AudioBg")},o.title=function(e,t){s.title(),e.addChild("Title",{title:t})};var u=null;o.playbackRateTip=function(e,t,n){if(e.getChild("ControlBar").removeChild("PlaybackRateTip"),n){s.playbackRateTip(),clearTimeout(u),u=setTimeout(function(){e.getChild("ControlBar").removeChild("PlaybackRateTip")},t.time||1500);var i="function"==typeof t.text?t.text(e):t.text;return e.getChild("ControlBar").addChild("PlaybackRateTip",{text:i})}},t.default=o,e.exports=t.default},function(e,t,n){"use strict";n(61),n(62),n(64),n(66),n(67)},function(e,t){},function(e,t,n){"use strict";n(63)},function(e,t){},function(e,t,n){"use strict";n(65)},function(e,t){},function(e,t){},function(e,t){}])});
1
+ /*!
2
+ *
3
+ * videoplayer v0.2.18
4
+ *
5
+ */
6
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.videoplayer=t():e.videoplayer=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=15)}([function(e,t,n){/**
7
+ * @license
8
+ * Video.js 6.13.0 <http://videojs.com/>
9
+ * Copyright Brightcove, Inc. <https://www.brightcove.com/>
10
+ * Available under Apache License Version 2.0
11
+ * <https://github.com/videojs/video.js/blob/master/LICENSE>
12
+ *
13
+ * Includes vtt.js <https://github.com/mozilla/vtt.js>
14
+ * Available under Apache License Version 2.0
15
+ * <https://github.com/mozilla/vtt.js/blob/master/LICENSE>
16
+ */
17
+ function i(e){return e&&"object"==typeof e&&"default"in e?e.default:e}function r(e,t){mt(e).forEach(function(n){return t(e[n],n)})}function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return mt(e).reduce(function(n,i){return t(n,e[i],i)},n)}function s(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Object.assign?Object.assign.apply(Object,[e].concat(n)):(n.forEach(function(t){t&&r(t,function(t,n){e[n]=t})}),e)}function o(e){return!!e&&"object"===(void 0===e?"undefined":lt(e))}function u(e){return o(e)&&"[object Object]"===ft.call(e)&&e.constructor===Object}function l(e){var t="info",n=void 0,i=function e(){for(var i=e.stringify||it&&it<11,r=arguments.length,a=Array(r),s=0;s<r;s++)a[s]=arguments[s];n("log",t,a,i)};return n=yt(e,i),i.createLogger=function(t){return l(e+": "+t)},i.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:t},i.level=function(e){if("string"==typeof e){if(!i.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');t=e}return t},i.history=function(){return gt?[].concat(gt):[]},i.history.filter=function(e){return(gt||[]).filter(function(t){return new RegExp(".*"+e+".*").test(t[0])})},i.history.clear=function(){gt&&(gt.length=0)},i.history.disable=function(){null!==gt&&(gt.length=0,gt=null)},i.history.enable=function(){null===gt&&(gt=[])},i.error=function(){for(var e=arguments.length,i=Array(e),r=0;r<e;r++)i[r]=arguments[r];return n("error",t,i)},i.warn=function(){for(var e=arguments.length,i=Array(e),r=0;r<e;r++)i[r]=arguments[r];return n("warn",t,i)},i.debug=function(){for(var e=arguments.length,i=Array(e),r=0;r<e;r++)i[r]=arguments[r];return n("debug",t,i)},i}function c(e,t){if(!e||!t)return"";if("function"==typeof De.getComputedStyle){var n=De.getComputedStyle(e);return n?n[t]:""}return e.currentStyle[t]||""}function d(e){return"string"==typeof e&&/\S/.test(e)}function h(e){if(/\s/.test(e))throw new Error("class has illegal whitespace characters")}function p(e){return new RegExp("(^|\\s)"+e+"($|\\s)")}function f(){return Re===De.document&&void 0!==Re.createElement}function m(e){return o(e)&&1===e.nodeType}function g(){try{return De.parent!==De.self}catch(e){return!0}}function y(e){return function(t,n){if(!d(t))return Re[e](null);d(n)&&(n=Re.querySelector(n));var i=m(n)?n:Re;return i[e]&&i[e](t)}}function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments[3],r=Re.createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){var n=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(vt.warn(Me(bt,e,n)),r.setAttribute(e,n)):"textContent"===e?_(r,n):r[e]=n}),Object.getOwnPropertyNames(n).forEach(function(e){r.setAttribute(e,n[e])}),i&&B(r,i),r}function _(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function b(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function T(e,t){return h(t),e.classList?e.classList.contains(t):p(t).test(e.className)}function S(e,t){return e.classList?e.classList.add(t):T(e,t)||(e.className=(e.className+" "+t).trim()),e}function E(e,t){return e.classList?e.classList.remove(t):(h(t),e.className=e.className.split(/\s+/).filter(function(e){return e!==t}).join(" ")),e}function w(e,t,n){var i=T(e,t);if("function"==typeof n&&(n=n(e,t)),"boolean"!=typeof n&&(n=!i),n!==i)return n?S(e,t):E(e,t),e}function k(e,t){Object.getOwnPropertyNames(t).forEach(function(n){var i=t[n];null===i||void 0===i||!1===i?e.removeAttribute(n):e.setAttribute(n,!0===i?"":i)})}function C(e){var t={};if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,i=n.length-1;i>=0;i--){var r=n[i].name,a=n[i].value;"boolean"!=typeof e[r]&&-1===",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+r+",")||(a=null!==a),t[r]=a}return t}function A(e,t){return e.getAttribute(t)}function I(e,t,n){e.setAttribute(t,n)}function x(e,t){e.removeAttribute(t)}function P(){Re.body.focus(),Re.onselectstart=function(){return!1}}function O(){Re.onselectstart=function(){return!0}}function L(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach(function(e){void 0!==t[e]&&(n[e]=t[e])}),n.height||(n.height=parseFloat(c(e,"height"))),n.width||(n.width=parseFloat(c(e,"width"))),n}}function D(e){var t=void 0;if(e.getBoundingClientRect&&e.parentNode&&(t=e.getBoundingClientRect()),!t)return{left:0,top:0};var n=Re.documentElement,i=Re.body,r=n.clientLeft||i.clientLeft||0,a=De.pageXOffset||i.scrollLeft,s=t.left+a-r,o=n.clientTop||i.clientTop||0,u=De.pageYOffset||i.scrollTop,l=t.top+u-o;return{left:Math.round(s),top:Math.round(l)}}function R(e,t){var n={},i=D(e),r=e.offsetWidth,a=e.offsetHeight,s=i.top,o=i.left,u=t.pageY,l=t.pageX;return t.changedTouches&&(l=t.changedTouches[0].pageX,u=t.changedTouches[0].pageY),n.y=Math.max(0,Math.min(1,(s-u+a)/a)),n.x=Math.max(0,Math.min(1,(l-o)/r)),n}function M(e){return o(e)&&3===e.nodeType}function N(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function U(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return"function"==typeof e&&(e=e()),m(e)||M(e)?e:"string"==typeof e&&/\S/.test(e)?Re.createTextNode(e):void 0}).filter(function(e){return e})}function B(e,t){return U(t).forEach(function(t){return e.appendChild(t)}),e}function j(e,t){return B(N(e),t)}function F(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||(9===it||0===e.button&&1===e.buttons))}function H(){return wt++}function q(e){var t=e[Ct];return t||(t=e[Ct]=H()),kt[t]||(kt[t]={}),kt[t]}function V(e){var t=e[Ct];return!!t&&!!Object.getOwnPropertyNames(kt[t]).length}function W(e){var t=e[Ct];if(t){delete kt[t];try{delete e[Ct]}catch(t){e.removeAttribute?e.removeAttribute(Ct):e[Ct]=null}}}function G(e,t){var n=q(e);0===n.handlers[t].length&&(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),0===Object.getOwnPropertyNames(n).length&&W(e)}function z(e,t,n,i){n.forEach(function(n){e(t,n,i)})}function X(e){function t(){return!0}function n(){return!1}if(!e||!e.isPropagationStopped){var i=e||De.event;e={};for(var r in i)"layerX"!==r&&"layerY"!==r&&"keyLocation"!==r&&"webkitMovementX"!==r&&"webkitMovementY"!==r&&("returnValue"===r&&i.preventDefault||(e[r]=i[r]));if(e.target||(e.target=e.srcElement||Re),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){i.preventDefault&&i.preventDefault(),e.returnValue=!1,i.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),e.cancelBubble=!0,i.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=n,e.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=n,null!==e.clientX&&void 0!==e.clientX){var a=Re.documentElement,s=Re.body;e.pageX=e.clientX+(a&&a.scrollLeft||s&&s.scrollLeft||0)-(a&&a.clientLeft||s&&s.clientLeft||0),e.pageY=e.clientY+(a&&a.scrollTop||s&&s.scrollTop||0)-(a&&a.clientTop||s&&s.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e}function Y(e,t,n){if(Array.isArray(t))return z(Y,e,t,n);var i=q(e);if(i.handlers||(i.handlers={}),i.handlers[t]||(i.handlers[t]=[]),n.guid||(n.guid=H()),i.handlers[t].push(n),i.dispatcher||(i.disabled=!1,i.dispatcher=function(t,n){if(!i.disabled){t=X(t);var r=i.handlers[t.type];if(r)for(var a=r.slice(0),s=0,o=a.length;s<o&&!t.isImmediatePropagationStopped();s++)try{a[s].call(e,t,n)}catch(e){vt.error(e)}}}),1===i.handlers[t].length)if(e.addEventListener){var r=!1;At&&It.indexOf(t)>-1&&(r={passive:!0}),e.addEventListener(t,i.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,i.dispatcher)}function K(e,t,n){if(V(e)){var i=q(e);if(i.handlers){if(Array.isArray(t))return z(K,e,t,n);var r=function(e,t){i.handlers[t]=[],G(e,t)};if(void 0!==t){var a=i.handlers[t];if(a){if(!n)return void r(e,t);if(n.guid)for(var s=0;s<a.length;s++)a[s].guid===n.guid&&a.splice(s--,1);G(e,t)}}else for(var o in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},o)&&r(e,o)}}}function Q(e,t,n){var i=V(e)?q(e):{},r=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=X(t),i.dispatcher&&i.dispatcher.call(e,t,n),r&&!t.isPropagationStopped()&&!0===t.bubbles)Q.call(null,r,t,n);else if(!r&&!t.defaultPrevented){var a=q(t.target);t.target[t.type]&&(a.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),a.disabled=!1)}return!t.defaultPrevented}function $(e,t,n){if(Array.isArray(t))return z($,e,t,n);var i=function i(){K(e,t,i),n.apply(this,arguments)};i.guid=n.guid=n.guid||H(),Y(e,t,i)}function J(e,t){t&&(Ot=t),De.setTimeout(Lt,e)}function Z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.eventBusKey;if(n){if(!e[n].nodeName)throw new Error('The eventBusKey "'+n+'" does not refer to an element.');e.eventBusEl_=e[n]}else e.eventBusEl_=v("span",{className:"vjs-event-bus"});return s(e,zt),e.on("dispose",function(){e.off(),De.setTimeout(function(){e.eventBusEl_=null},0)}),e}function ee(e,t){return s(e,Xt),e.state=s({},e.state,t),"function"==typeof e.handleStateChanged&&jt(e)&&e.on("statechanged",e.handleStateChanged),e}function te(e){return"string"!=typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}function ne(e,t){return te(e)===te(t)}function ie(){for(var e={},t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return n.forEach(function(t){t&&r(t,function(t,n){if(!u(t))return void(e[n]=t);u(e[n])||(e[n]={}),e[n]=ie(e[n],t)})}),e}function re(e,t,n){if("number"!=typeof t||t<0||t>n)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+n+").")}function ae(e,t,n,i){return re(e,i,n.length-1),n[i][t]}function se(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:ae.bind(null,"start",0,e),end:ae.bind(null,"end",1,e)}}function oe(e,t){return Array.isArray(e)?se(e):void 0===e||void 0===t?se():se([[e,t]])}function ue(e,t){var n=0,i=void 0,r=void 0;if(!t)return 0;e&&e.length||(e=oe(0,0));for(var a=0;a<e.length;a++)i=e.start(a),r=e.end(a),r>t&&(r=t),n+=r-i;return n/t}function le(e){if(e instanceof le)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:o(e)&&("number"==typeof e.code&&(this.code=e.code),s(this,e)),this.message||(this.message=le.defaultMessages[this.code]||"")}function ce(e){return void 0!==e&&null!==e&&"function"==typeof e.then}function de(e){ce(e)&&e.then(null,function(e){})}function he(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=e.textTracks();r.kind=t,n&&(r.label=n),i&&(r.language=i),r.tech=e;var s=new Bn.text.TrackClass(r);return a.addTrack(s),s}function pe(e,t){Fn[e]=Fn[e]||[],Fn[e].push(t)}function fe(e,t,n){e.setTimeout(function(){return Ee(t,Fn[t.type],n,e)},1)}function me(e,t){e.forEach(function(e){return e.setTech&&e.setTech(t)})}function ge(e,t,n){return e.reduceRight(_e(n),t[n]())}function ye(e,t,n,i){return t[n](e.reduce(_e(n),i))}function ve(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r="call"+te(n),a=e.reduce(_e(r),i),s=a===qn,o=s?null:t[n](a);return be(e,n,o,s),o}function _e(e){return function(t,n){return t===qn?qn:n[e]?n[e](t):t}}function be(e,t,n,i){for(var r=e.length-1;r>=0;r--){var a=e[r];a[t]&&a[t](i,n)}}function Te(e){Hn[e.id()]=null}function Se(e,t){var n=Hn[e.id()],i=null;if(void 0===n||null===n)return i=t(e),Hn[e.id()]=[[t,i]],i;for(var r=0;r<n.length;r++){var a=n[r],s=a[0],o=a[1];s===t&&(i=o)}return null===i&&(i=t(e),n.push([t,i])),i}function Ee(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments[2],i=arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=t[0],u=t.slice(1);if("string"==typeof o)Ee(e,Fn[o],n,i,r,a);else if(o){var l=Se(i,o);if(!l.setSource)return r.push(l),Ee(e,u,n,i,r,a);l.setSource(s({},e),function(t,s){if(t)return Ee(e,u,n,i,r,a);r.push(l),Ee(s,e.type===s.type?u:Fn[s.type],n,i,r,a)})}else u.length?Ee(e,u,n,i,r,a):a?n(e,r):Ee(e,Fn["*"],n,i,r,!0)}function we(e){var t=Xn(e.src);return!e.type&&t&&(e.type=t),e}function ke(e,t){var n=void 0;if(4===e.length)n=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");n=e.slice(1)}return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+t+")"}function Ce(e,t,n){try{e.style[t]=n}catch(e){return}}function Ae(e){oi=e}function Ie(){oi=si}function xe(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}function Pe(e,t){return xe(e.options[e.options.selectedIndex].value,t)}function Oe(e,t,n){if(t)for(var i=0;i<e.options.length;i++)if(xe(e.options[i].value,n)===t){e.selectedIndex=i;break}}function Le(e,t,n){var i=Le.getPlayer(e);if(i)return t&&vt.warn('Player "'+e+'" is already initialised. Options will not be applied.'),n&&i.ready(n),i;var r="string"==typeof e?Tt("#"+Gr(e)):e;if(!m(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");Re.body.contains(r)||vt.warn("The element supplied is not included in the DOM"),t=t||{},Le.hooks("beforesetup").forEach(function(e){var n=e(r,ie(t));if(!o(n)||Array.isArray(n))return void vt.error("please return an object in beforesetup hooks");t=ie(t,n)});var a=Yt.getComponent("Player");return i=new a(r,t,n),Le.hooks("setup").forEach(function(e){return e(i)}),i}var De=i(n(17)),Re=i(n(18)),Me=i(n(20)),Ne=i(n(21)),Ue=i(n(22)),Be=i(n(27)),je="6.13.0",Fe=De.navigator&&De.navigator.userAgent||"",He=/AppleWebKit\/([\d.]+)/i.exec(Fe),qe=He?parseFloat(He.pop()):null,Ve=/iPad/i.test(Fe),We=/iPhone/i.test(Fe)&&!Ve,Ge=/iPod/i.test(Fe),ze=We||Ve||Ge,Xe=function(){var e=Fe.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Ye=/Android/i.test(Fe),Ke=function(){var e=Fe.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+"."+e[2]):t||null}(),Qe=Ye&&/webkit/i.test(Fe)&&Ke<2.3,$e=Ye&&Ke<5&&qe<537,Je=/Firefox/i.test(Fe),Ze=/Edge/i.test(Fe),et=!Ze&&(/Chrome/i.test(Fe)||/CriOS/i.test(Fe)),tt=function(){var e=Fe.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),nt=/MSIE\s8\.0/.test(Fe),it=function(){var e=/MSIE\s(\d+)\.\d/.exec(Fe),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(Fe)&&/rv:11.0/.test(Fe)&&(t=11),t}(),rt=/Safari/i.test(Fe)&&!et&&!Ye&&!Ze,at=(rt||ze)&&!et,st=f()&&("ontouchstart"in De||De.navigator.maxTouchPoints||De.DocumentTouch&&De.document instanceof De.DocumentTouch),ot=f()&&"backgroundSize"in De.document.createElement("video").style,ut=(Object.freeze||Object)({IS_IPAD:Ve,IS_IPHONE:We,IS_IPOD:Ge,IS_IOS:ze,IOS_VERSION:Xe,IS_ANDROID:Ye,ANDROID_VERSION:Ke,IS_OLD_ANDROID:Qe,IS_NATIVE_ANDROID:$e,IS_FIREFOX:Je,IS_EDGE:Ze,IS_CHROME:et,CHROME_VERSION:tt,IS_IE8:nt,IE_VERSION:it,IS_SAFARI:rt,IS_ANY_SAFARI:at,TOUCH_ENABLED:st,BACKGROUND_SIZE_SUPPORTED:ot}),lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ct=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},dt=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},ht=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},pt=function(e,t){return e.raw=t,e},ft=Object.prototype.toString,mt=function(e){return o(e)?Object.keys(e):[]},gt=[],yt=function(e,t){return function(n,i,r,a){var s=t.levels[i],u=new RegExp("^("+s+")$");if("log"!==n&&r.unshift(n.toUpperCase()+":"),r.unshift(e+":"),gt&&gt.push([].concat(r)),De.console){var l=De.console[n];l||"debug"!==n||(l=De.console.info||De.console.log),l&&s&&u.test(n)&&(a&&(r=r.map(function(e){if(o(e)||Array.isArray(e))try{return JSON.stringify(e)}catch(t){return String(e)}return String(e)}).join(" ")),l.apply?l[Array.isArray(r)?"apply":"call"](De.console,r):l(r))}}},vt=l("VIDEOJS"),_t=vt.createLogger,bt=pt(["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."],["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."]),Tt=y("querySelector"),St=y("querySelectorAll"),Et=(Object.freeze||Object)({isReal:f,isEl:m,isInFrame:g,createEl:v,textContent:_,prependTo:b,hasClass:T,addClass:S,removeClass:E,toggleClass:w,setAttributes:k,getAttributes:C,getAttribute:A,setAttribute:I,removeAttribute:x,blockTextSelection:P,unblockTextSelection:O,getBoundingClientRect:L,findPosition:D,getPointerPosition:R,isTextNode:M,emptyEl:N,normalizeContent:U,appendContent:B,insertContent:j,isSingleLeftClick:F,$:Tt,$$:St}),wt=1,kt={},Ct="vdata"+(new Date).getTime(),At=!1;!function(){try{var e=Object.defineProperty({},"passive",{get:function(){At=!0}});De.addEventListener("test",null,e),De.removeEventListener("test",null,e)}catch(e){}}();var It=["touchstart","touchmove"],xt=(Object.freeze||Object)({fixEvent:X,on:Y,off:K,trigger:Q,one:$}),Pt=!1,Ot=void 0,Lt=function(){if(f()&&!1!==Ot.options.autoSetup){var e=Re.getElementsByTagName("video"),t=Re.getElementsByTagName("audio"),n=Re.getElementsByTagName("video-js"),i=[];if(e&&e.length>0)for(var r=0,a=e.length;r<a;r++)i.push(e[r]);if(t&&t.length>0)for(var s=0,o=t.length;s<o;s++)i.push(t[s]);if(n&&n.length>0)for(var u=0,l=n.length;u<l;u++)i.push(n[u]);if(i&&i.length>0)for(var c=0,d=i.length;c<d;c++){var h=i[c];if(!h||!h.getAttribute){J(1);break}if(void 0===h.player){var p=h.getAttribute("data-setup");null!==p&&Ot(h)}}else Pt||J(1)}};f()&&"complete"===Re.readyState?Pt=!0:$(De,"load",function(){Pt=!0});var Dt=function(e){var t=Re.createElement("style");return t.className=e,t},Rt=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},Mt=function(e,t,n){t.guid||(t.guid=H());var i=function(){return t.apply(e,arguments)};return i.guid=n?n+"_"+t.guid:t.guid,i},Nt=function(e,t){var n=Date.now();return function(){var i=Date.now();i-n>=t&&(e.apply(void 0,arguments),n=i)}},Ut=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:De,r=void 0,a=function(){i.clearTimeout(r),r=null},s=function(){var a=this,s=arguments,o=function(){r=null,o=null,n||e.apply(a,s)};!r&&n&&e.apply(a,s),i.clearTimeout(r),r=i.setTimeout(o,t)};return s.cancel=a,s},Bt=function(){};Bt.prototype.allowedEvents_={},Bt.prototype.on=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},Y(this,e,t),this.addEventListener=n},Bt.prototype.addEventListener=Bt.prototype.on,Bt.prototype.off=function(e,t){K(this,e,t)},Bt.prototype.removeEventListener=Bt.prototype.off,Bt.prototype.one=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},$(this,e,t),this.addEventListener=n},Bt.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=X(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Q(this,e)},Bt.prototype.dispatchEvent=Bt.prototype.trigger;var jt=function(e){return e instanceof Bt||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},Ft=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Ht=function(e){if(!e.nodeName&&!jt(e))throw new Error("Invalid target; must be a DOM node or evented object.")},qt=function(e){if(!Ft(e))throw new Error("Invalid event type; must be a non-empty string or array.")},Vt=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},Wt=function(e,t){var n=t.length<3||t[0]===e||t[0]===e.eventBusEl_,i=void 0,r=void 0,a=void 0;return n?(i=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],a=t[1]):(i=t[0],r=t[1],a=t[2]),Ht(i),qt(r),Vt(a),a=Mt(e,a),{isTargetingSelf:n,target:i,type:r,listener:a}},Gt=function(e,t,n,i){Ht(e),e.nodeName?xt[t](e,n,i):e[t](n,i)},zt={on:function(){for(var e=this,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=Wt(this,n),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(Gt(s,"on",o,u),!a){var l=function(){return e.off(s,o,u)};l.guid=u.guid;var c=function(){return e.off("dispose",l)};c.guid=u.guid,Gt(this,"on","dispose",l),Gt(s,"on","dispose",c)}},one:function(){for(var e=this,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=Wt(this,n),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(a)Gt(s,"one",o,u);else{var l=function t(){for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];e.off(s,o,t),u.apply(null,i)};l.guid=u.guid,Gt(s,"one",o,l)}},off:function(e,t,n){if(!e||Ft(e))K(this.eventBusEl_,e,t);else{var i=e,r=t;Ht(i),qt(r),Vt(n),n=Mt(this,n),this.off("dispose",n),i.nodeName?(K(i,r,n),K(i,"dispose",n)):jt(i)&&(i.off(r,n),i.off("dispose",n))}},trigger:function(e,t){return Q(this.eventBusEl_,e,t)}},Xt={state:{},setState:function(e){var t=this;"function"==typeof e&&(e=e());var n=void 0;return r(e,function(e,i){t.state[i]!==e&&(n=n||{},n[i]={from:t.state[i],to:e}),t.state[i]=e}),n&&jt(this)&&this.trigger({changes:n,type:"statechanged"}),n}},Yt=function(){function e(t,n,i){if(ct(this,e),!t&&this.play?this.player_=t=this:this.player_=t,this.options_=ie({},this.options_),n=this.options_=ie(this.options_,n),this.id_=n.id||n.el&&n.el.id,!this.id_){var r=t&&t.id&&t.id()||"no_player";this.id_=r+"_component_"+H()}this.name_=n.name||null,n.el?this.el_=n.el:!1!==n.createEl&&(this.el_=this.createEl()),!1!==n.evented&&Z(this,{eventBusKey:this.el_?"el_":null}),ee(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},!1!==n.initChildren&&this.initChildren(),this.ready(i),!1!==n.reportTouchActivity&&this.enableTouchActivity()}return e.prototype.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var 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.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),W(this.el_),this.el_=null),this.player_=null},e.prototype.player=function(){return this.player_},e.prototype.options=function(e){return vt.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),e?(this.options_=ie(this.options_,e),this.options_):this.options_},e.prototype.el=function(){return this.el_},e.prototype.createEl=function(e,t,n){return v(e,t,n)},e.prototype.localize=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,i=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[i],s=i&&i.split("-")[0],o=r&&r[s],u=n;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(e,n){var i=t[n-1],r=i;return void 0===i&&(r=e),r})),u},e.prototype.contentEl=function(){return this.contentEl_||this.el_},e.prototype.id=function(){return this.id_},e.prototype.name=function(){return this.name_},e.prototype.children=function(){return this.children_},e.prototype.getChildById=function(e){return this.childIndex_[e]},e.prototype.getChild=function(e){if(e)return e=te(e),this.childNameIndex_[e]},e.prototype.addChild=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,r=void 0,a=void 0;if("string"==typeof t){a=te(t);var s=n.componentClass||a;n.name=a;var o=e.getComponent(s);if(!o)throw new Error("Component "+s+" does not exist");if("function"!=typeof o)return null;r=new o(this.player_||this,n)}else r=t;if(this.children_.splice(i,0,r),"function"==typeof r.id&&(this.childIndex_[r.id()]=r),a=a||r.name&&te(r.name()),a&&(this.childNameIndex_[a]=r),"function"==typeof r.el&&r.el()){var u=this.contentEl().children,l=u[i]||null;this.contentEl().insertBefore(r.el(),l)}return r},e.prototype.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(t){this.childIndex_[e.id()]=null,this.childNameIndex_[e.name()]=null;var i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},e.prototype.initChildren=function(){var t=this,n=this.options_.children;if(n){var i=this.options_,r=function(e){var n=e.name,r=e.opts;if(void 0!==i[n]&&(r=i[n]),!1!==r){!0===r&&(r={}),r.playerOptions=t.options_.playerOptions;var a=t.addChild(n,r);a&&(t[n]=a)}},a=void 0,s=e.getComponent("Tech");a=Array.isArray(n)?n:Object.keys(n),a.concat(Object.keys(this.options_).filter(function(e){return!a.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(function(e){var i=void 0,r=void 0;return"string"==typeof e?(i=e,r=n[i]||t.options_[i]||{}):(i=e.name,r=e),{name:i,opts:r}}).filter(function(t){var n=e.getComponent(t.opts.componentClass||te(t.name));return n&&!s.isTech(n)}).forEach(r)}},e.prototype.buildCSSClass=function(){return""},e.prototype.ready=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},e.prototype.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},e.prototype.$=function(e,t){return Tt(e,t||this.contentEl())},e.prototype.$$=function(e,t){return St(e,t||this.contentEl())},e.prototype.hasClass=function(e){return T(this.el_,e)},e.prototype.addClass=function(e){S(this.el_,e)},e.prototype.removeClass=function(e){E(this.el_,e)},e.prototype.toggleClass=function(e,t){w(this.el_,e,t)},e.prototype.show=function(){this.removeClass("vjs-hidden")},e.prototype.hide=function(){this.addClass("vjs-hidden")},e.prototype.lockShowing=function(){this.addClass("vjs-lock-showing")},e.prototype.unlockShowing=function(){this.removeClass("vjs-lock-showing")},e.prototype.getAttribute=function(e){return A(this.el_,e)},e.prototype.setAttribute=function(e,t){I(this.el_,e,t)},e.prototype.removeAttribute=function(e){x(this.el_,e)},e.prototype.width=function(e,t){return this.dimension("width",e,t)},e.prototype.height=function(e,t){return this.dimension("height",e,t)},e.prototype.dimensions=function(e,t){this.width(e,!0),this.height(t)},e.prototype.dimension=function(e,t,n){if(void 0!==t)return null!==t&&t===t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;var i=this.el_.style[e],r=i.indexOf("px");return-1!==r?parseInt(i.slice(0,r),10):parseInt(this.el_["offset"+te(e)],10)},e.prototype.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if("function"==typeof De.getComputedStyle){var n=De.getComputedStyle(this.el_);t=n.getPropertyValue(e)||n[e]}if(0===(t=parseFloat(t))){var i="offset"+te(e);t=this.el_[i]}return t},e.prototype.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},e.prototype.currentWidth=function(){return this.currentDimension("width")},e.prototype.currentHeight=function(){return this.currentDimension("height")},e.prototype.focus=function(){this.el_.focus()},e.prototype.blur=function(){this.el_.blur()},e.prototype.emitTapEvents=function(){var e=0,t=null,n=void 0;this.on("touchstart",function(i){1===i.touches.length&&(t={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},e=(new Date).getTime(),n=!0)}),this.on("touchmove",function(e){if(e.touches.length>1)n=!1;else if(t){var i=e.touches[0].pageX-t.pageX,r=e.touches[0].pageY-t.pageY,a=Math.sqrt(i*i+r*r);a>10&&(n=!1)}});var i=function(){n=!1};this.on("touchleave",i),this.on("touchcancel",i),this.on("touchend",function(i){if(t=null,!0===n){(new Date).getTime()-e<200&&(i.preventDefault(),this.trigger("tap"))}})},e.prototype.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e=Mt(this.player(),this.player().reportUserActivity),t=void 0;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});var n=function(n){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",n),this.on("touchcancel",n)}},e.prototype.setTimeout=function(e,t){var n,i,r=this;return e=Mt(this,e),n=De.setTimeout(function(){r.off("dispose",i),e()},t),i=function(){return r.clearTimeout(n)},i.guid="vjs-timeout-"+n,this.on("dispose",i),n},e.prototype.clearTimeout=function(e){De.clearTimeout(e);var t=function(){};return t.guid="vjs-timeout-"+e,this.off("dispose",t),e},e.prototype.setInterval=function(e,t){var n=this;e=Mt(this,e);var i=De.setInterval(e,t),r=function(){return n.clearInterval(i)};return r.guid="vjs-interval-"+i,this.on("dispose",r),i},e.prototype.clearInterval=function(e){De.clearInterval(e);var t=function(){};return t.guid="vjs-interval-"+e,this.off("dispose",t),e},e.prototype.requestAnimationFrame=function(e){var t,n,i=this;return this.supportsRaf_?(e=Mt(this,e),t=De.requestAnimationFrame(function(){i.off("dispose",n),e()}),n=function(){return i.cancelAnimationFrame(t)},n.guid="vjs-raf-"+t,this.on("dispose",n),t):this.setTimeout(e,1e3/60)},e.prototype.cancelAnimationFrame=function(e){if(this.supportsRaf_){De.cancelAnimationFrame(e);var t=function(){};return t.guid="vjs-raf-"+e,this.off("dispose",t),e}return this.clearTimeout(e)},e.registerComponent=function(t,n){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var i=e.getComponent("Tech"),r=i&&i.isTech(n),a=e===n||e.prototype.isPrototypeOf(n.prototype);if(r||!a){var s=void 0;throw s=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+s+".")}t=te(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var u=o.players,l=Object.keys(u);if(u&&l.length>0&&l.map(function(e){return u[e]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=n,n},e.getComponent=function(t){if(t)return t=te(t),e.components_&&e.components_[t]?e.components_[t]:void 0},e}();Yt.prototype.supportsRaf_="function"==typeof De.requestAnimationFrame&&"function"==typeof De.cancelAnimationFrame,Yt.registerComponent("Component",Yt);for(var Kt={},Qt=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],$t=Qt[0],Jt=void 0,Zt=0;Zt<Qt.length;Zt++)if(Qt[Zt][1]in Re){Jt=Qt[Zt];break}if(Jt)for(var en=0;en<Jt.length;en++)Kt[$t[en]]=Jt[en];le.prototype.code=0,le.prototype.message="",le.prototype.status=null,le.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],le.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."};for(var tn=0;tn<le.errorTypes.length;tn++)le[le.errorTypes[tn]]=tn,le.prototype[le.errorTypes[tn]]=tn;var nn=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(t,n,i){return 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}})})},rn=function(e){var t=e.$$("track"),n=Array.prototype.map.call(t,function(e){return e.track});return Array.prototype.map.call(t,function(e){var t=nn(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return-1===n.indexOf(e)}).map(nn))},an=function(e,t){return e.forEach(function(e){var n=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(function(e){return n.addCue(e)})}),t.textTracks()},sn={textTracksToJson:rn,jsonToTextTracks:an,trackToJson_:nn},on="vjs-modal-dialog",un=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.opened_=r.hasBeenOpened_=r.hasBeenFilled_=!1,r.closeable(!r.options_.uncloseable),r.content(r.options_.content),r.contentEl_=v("div",{className:on+"-content"},{role:"document"}),r.descEl_=v("p",{className:on+"-description vjs-control-text",id:r.el().getAttribute("aria-describedby")}),_(r.descEl_,r.description()),r.el_.appendChild(r.descEl_),r.el_.appendChild(r.contentEl_),r}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},t.prototype.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,e.prototype.dispose.call(this)},t.prototype.buildCSSClass=function(){return on+" vjs-hidden "+e.prototype.buildCSSClass.call(this)},t.prototype.handleKeyPress=function(e){27===e.which&&this.closeable()&&this.close()},t.prototype.label=function(){return this.localize(this.options_.label||"Modal Window")},t.prototype.description=function(){var 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},t.prototype.open=function(){if(!this.opened_){var 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.closeable()&&this.on(this.el_.ownerDocument,"keydown",Mt(this,this.handleKeyPress)),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},t.prototype.opened=function(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_},t.prototype.close=function(){if(this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.closeable()&&this.off(this.el_.ownerDocument,"keydown",Mt(this,this.handleKeyPress)),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},t.prototype.closeable=function(e){if("boolean"==typeof e){var t=this.closeable_=!!e,n=this.getChild("closeButton");if(t&&!n){var i=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=i,this.on(n,"close",this.close)}!t&&n&&(this.off(n,"close",this.close),this.removeChild(n),n.dispose())}return this.closeable_},t.prototype.fill=function(){this.fillWith(this.content())},t.prototype.fillWith=function(e){var t=this.contentEl(),n=t.parentNode,i=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,n.removeChild(t),this.empty(),j(t,e),this.trigger("modalfill"),i?n.insertBefore(t,i):n.appendChild(t);var r=this.getChild("closeButton");r&&n.appendChild(r.el_)},t.prototype.empty=function(){this.trigger("beforemodalempty"),N(this.contentEl()),this.trigger("modalempty")},t.prototype.content=function(e){return void 0!==e&&(this.content_=e),this.content_},t.prototype.conditionalFocus_=function(){var e=Re.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus(),this.on(Re,"keydown",this.handleKeyDown))},t.prototype.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null),this.off(Re,"keydown",this.handleKeyDown)},t.prototype.handleKeyDown=function(e){if(9===e.which){for(var t=this.focusableEls_(),n=this.el_.querySelector(":focus"),i=void 0,r=0;r<t.length;r++)if(n===t[r]){i=r;break}Re.activeElement===this.el_&&(i=0),e.shiftKey&&0===i?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||i!==t.length-1||(t[0].focus(),e.preventDefault())}},t.prototype.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,function(e){return(e instanceof De.HTMLAnchorElement||e instanceof De.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof De.HTMLInputElement||e instanceof De.HTMLSelectElement||e instanceof De.HTMLTextAreaElement||e instanceof De.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof De.HTMLIFrameElement||e instanceof De.HTMLObjectElement||e instanceof De.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")})},t}(Yt);un.prototype.options_={pauseOnOpen:!0,temporary:!0},Yt.registerComponent("ModalDialog",un);var ln=function(e){function t(){var n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;ct(this,t);var a=ht(this,e.call(this));if(!r&&(r=a,nt)){r=Re.createElement("custom");for(var s in t.prototype)"constructor"!==s&&(r[s]=t.prototype[s])}r.tracks_=[],Object.defineProperty(r,"length",{get:function(){return this.tracks_.length}});for(var o=0;o<i.length;o++)r.addTrack(i[o]);return n=r,ht(a,n)}return dt(t,e),t.prototype.addTrack=function(e){var t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack"}))},t.prototype.removeTrack=function(e){for(var t=void 0,n=0,i=this.length;n<i;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"})},t.prototype.getTrackById=function(e){for(var t=null,n=0,i=this.length;n<i;n++){var r=this[n];if(r.id===e){t=r;break}}return t},t}(Bt);ln.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"};for(var cn in ln.prototype.allowedEvents_)ln.prototype["on"+cn]=null;var dn=function(e,t){for(var n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].enabled=!1)},hn=function(e){function t(){var n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];ct(this,t);for(var a=void 0,s=r.length-1;s>=0;s--)if(r[s].enabled){dn(r,r[s]);break}if(nt){a=Re.createElement("custom");for(var o in ln.prototype)"constructor"!==o&&(a[o]=ln.prototype[o]);for(var u in t.prototype)"constructor"!==u&&(a[u]=t.prototype[u])}return a=n=ht(this,e.call(this,r,a)),a.changing_=!1,i=a,ht(n,i)}return dt(t,e),t.prototype.addTrack=function(t){var n=this;t.enabled&&dn(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("enabledchange",function(){n.changing_||(n.changing_=!0,dn(n,t),n.changing_=!1,n.trigger("change"))})},t}(ln),pn=function(e,t){for(var n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].selected=!1)},fn=function(e){function t(){var n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];ct(this,t);for(var a=void 0,s=r.length-1;s>=0;s--)if(r[s].selected){pn(r,r[s]);break}if(nt){a=Re.createElement("custom");for(var o in ln.prototype)"constructor"!==o&&(a[o]=ln.prototype[o]);for(var u in t.prototype)"constructor"!==u&&(a[u]=t.prototype[u])}return a=n=ht(this,e.call(this,r,a)),a.changing_=!1,Object.defineProperty(a,"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),i=a,ht(n,i)}return dt(t,e),t.prototype.addTrack=function(t){var n=this;t.selected&&pn(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("selectedchange",function(){n.changing_||(n.changing_=!0,pn(n,t),n.changing_=!1,n.trigger("change"))})},t}(ln),mn=function(e){function t(){var n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];ct(this,t);var a=void 0;if(nt){a=Re.createElement("custom");for(var s in ln.prototype)"constructor"!==s&&(a[s]=ln.prototype[s]);for(var o in t.prototype)"constructor"!==o&&(a[o]=t.prototype[o])}return a=n=ht(this,e.call(this,r,a)),i=a,ht(n,i)}return dt(t,e),t.prototype.addTrack=function(t){e.prototype.addTrack.call(this,t),t.addEventListener("modechange",Mt(this,function(){this.trigger("change")})),-1===["metadata","chapters"].indexOf(t.kind)&&t.addEventListener("modechange",Mt(this,function(){this.trigger("selectedlanguagechange")}))},t}(ln),gn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];ct(this,e);var n=this;if(nt){n=Re.createElement("custom");for(var i in e.prototype)"constructor"!==i&&(n[i]=e.prototype[i])}n.trackElements_=[],Object.defineProperty(n,"length",{get:function(){return this.trackElements_.length}});for(var r=0,a=t.length;r<a;r++)n.addTrackElement_(t[r]);if(nt)return n}return e.prototype.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},e.prototype.getTrackElementByTrack_=function(e){for(var t=void 0,n=0,i=this.trackElements_.length;n<i;n++)if(e===this.trackElements_[n].track){t=this.trackElements_[n];break}return t},e.prototype.removeTrackElement_=function(e){for(var t=0,n=this.trackElements_.length;t<n;t++)if(e===this.trackElements_[t]){this.trackElements_.splice(t,1);break}},e}(),yn=function(){function e(t){ct(this,e);var n=this;if(nt){n=Re.createElement("custom");for(var i in e.prototype)"constructor"!==i&&(n[i]=e.prototype[i])}if(e.prototype.setCues_.call(n,t),Object.defineProperty(n,"length",{get:function(){return this.length_}}),nt)return n}return e.prototype.setCues_=function(e){var t=this.length||0,n=0,i=e.length;this.cues_=e,this.length_=e.length;var r=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})};if(t<i)for(n=t;n<i;n++)r.call(this,n)},e.prototype.getCueById=function(e){for(var t=null,n=0,i=this.length;n<i;n++){var r=this[n];if(r.id===e){t=r;break}}return t},e}(),vn={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},_n={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},bn={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Tn={disabled:"disabled",hidden:"hidden",showing:"showing"},Sn=function(e){function t(){var n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ct(this,t);var r=ht(this,e.call(this)),a=r;if(nt){a=Re.createElement("custom");for(var s in t.prototype)"constructor"!==s&&(a[s]=t.prototype[s])}var o={id:i.id||"vjs_track_"+H(),kind:i.kind||"",label:i.label||"",language:i.language||""};for(var u in o)!function(e){Object.defineProperty(a,e,{get:function(){return o[e]},set:function(){}})}(u);return n=a,ht(r,n)}return dt(t,e),t}(Bt),En=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],n=Re.createElement("a");n.href=e;var i=""===n.host&&"file:"!==n.protocol,r=void 0;i&&(r=Re.createElement("div"),r.innerHTML='<a href="'+e+'"></a>',n=r.firstChild,r.setAttribute("style","display:none; position:absolute;"),Re.body.appendChild(r));for(var a={},s=0;s<t.length;s++)a[t[s]]=n[t[s]];return"http:"===a.protocol&&(a.host=a.host.replace(/:80$/,"")),"https:"===a.protocol&&(a.host=a.host.replace(/:443$/,"")),a.protocol||(a.protocol=De.location.protocol),i&&Re.body.removeChild(r),a},wn=function(e){if(!e.match(/^https?:\/\//)){var t=Re.createElement("div");t.innerHTML='<a href="'+e+'">x</a>',e=t.firstChild.href}return e},kn=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i,n=t.exec(e);if(n)return n.pop().toLowerCase()}return""},Cn=function(e){var t=De.location,n=En(e);return(":"===n.protocol?t.protocol:n.protocol)+n.host!==t.protocol+t.host},An=(Object.freeze||Object)({parseUrl:En,getAbsoluteURL:wn,getFileExtension:kn,isCrossOrigin:Cn}),In=function(e,t){var n=new De.WebVTT.Parser(De,De.vttjs,De.WebVTT.StringDecoder()),i=[];n.oncue=function(e){t.addCue(e)},n.onparsingerror=function(e){i.push(e)},n.onflush=function(){t.trigger({type:"loadeddata",target:t})},n.parse(e),i.length>0&&(De.console&&De.console.groupCollapsed&&De.console.groupCollapsed("Text Track parsing errors for "+t.src),i.forEach(function(e){return vt.error(e)}),De.console&&De.console.groupEnd&&De.console.groupEnd()),n.flush()},xn=function(e,t){var n={uri:e},i=Cn(e);i&&(n.cors=i),Ue(n,Mt(this,function(e,n,i){if(e)return vt.error(e,n);if(t.loaded_=!0,"function"!=typeof De.WebVTT){if(t.tech_){var r=function(){return In(i,t)};t.tech_.on("vttjsloaded",r),t.tech_.on("vttjserror",function(){vt.error("vttjs failed to load, stopping trying to process "+t.src),t.tech_.off("vttjsloaded",r)})}}else In(i,t)}))},Pn=function(e){function t(){var n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(ct(this,t),!r.tech)throw new Error("A tech was not provided.");var a=ie(r,{kind:bn[r.kind]||"subtitles",language:r.language||r.srclang||""}),s=Tn[a.mode]||"disabled",o=a.default;"metadata"!==a.kind&&"chapters"!==a.kind||(s="hidden");var u=n=ht(this,e.call(this,a));if(u.tech_=a.tech,nt)for(var l in t.prototype)"constructor"!==l&&(u[l]=t.prototype[l]);u.cues_=[],u.activeCues_=[];var c=new yn(u.cues_),d=new yn(u.activeCues_),h=!1,p=Mt(u,function(){this.activeCues=this.activeCues,h&&(this.trigger("cuechange"),h=!1)});return"disabled"!==s&&u.tech_.ready(function(){u.tech_.on("timeupdate",p)},!0),Object.defineProperty(u,"default",{get:function(){return o},set:function(){}}),Object.defineProperty(u,"mode",{get:function(){return s},set:function(e){var t=this;Tn[e]&&(s=e,"disabled"!==s?this.tech_.ready(function(){t.tech_.on("timeupdate",p)},!0):this.tech_.off("timeupdate",p),this.trigger("modechange"))}}),Object.defineProperty(u,"cues",{get:function(){return this.loaded_?c:null},set:function(){}}),Object.defineProperty(u,"activeCues",{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return d;for(var e=this.tech_.currentTime(),t=[],n=0,i=this.cues.length;n<i;n++){var r=this.cues[n];r.startTime<=e&&r.endTime>=e?t.push(r):r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e&&t.push(r)}if(h=!1,t.length!==this.activeCues_.length)h=!0;else for(var a=0;a<t.length;a++)-1===this.activeCues_.indexOf(t[a])&&(h=!0);return this.activeCues_=t,d.setCues_(this.activeCues_),d},set:function(){}}),a.src?(u.src=a.src,xn(a.src,u)):u.loaded_=!0,i=u,ht(n,i)}return dt(t,e),t.prototype.addCue=function(e){var t=e;if(De.vttjs&&!(e instanceof De.vttjs.VTTCue)){t=new De.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(var n in e)n in t||(t[n]=e[n]);t.id=e.id,t.originalCue_=e}for(var i=this.tech_.textTracks(),r=0;r<i.length;r++)i[r]!==this&&i[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},t.prototype.removeCue=function(e){for(var t=this.cues_.length;t--;){var n=this.cues_[t];if(n===e||n.originalCue_&&n.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},t}(Sn);Pn.prototype.allowedEvents_={cuechange:"cuechange"};var On=function(e){function t(){var n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ct(this,t);var a=ie(r,{kind:_n[r.kind]||""}),s=n=ht(this,e.call(this,a)),o=!1;if(nt)for(var u in t.prototype)"constructor"!==u&&(s[u]=t.prototype[u]);return Object.defineProperty(s,"enabled",{get:function(){return o},set:function(e){"boolean"==typeof e&&e!==o&&(o=e,this.trigger("enabledchange"))}}),a.enabled&&(s.enabled=a.enabled),s.loaded_=!0,i=s,ht(n,i)}return dt(t,e),t}(Sn),Ln=function(e){function t(){var n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ct(this,t);var a=ie(r,{kind:vn[r.kind]||""}),s=n=ht(this,e.call(this,a)),o=!1;if(nt)for(var u in t.prototype)"constructor"!==u&&(s[u]=t.prototype[u]);return Object.defineProperty(s,"selected",{get:function(){return o},set:function(e){"boolean"==typeof e&&e!==o&&(o=e,this.trigger("selectedchange"))}}),a.selected&&(s.selected=a.selected),i=s,ht(n,i)}return dt(t,e),t}(Sn),Dn=0,Rn=2,Mn=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ct(this,t);var i=ht(this,e.call(this)),r=void 0,a=i;if(nt){a=Re.createElement("custom");for(var s in t.prototype)"constructor"!==s&&(a[s]=t.prototype[s])}var o=new Pn(n);if(a.kind=o.kind,a.src=o.src,a.srclang=o.language,a.label=o.label,a.default=o.default,Object.defineProperty(a,"readyState",{get:function(){return r}}),Object.defineProperty(a,"track",{get:function(){return o}}),r=Dn,o.addEventListener("loadeddata",function(){r=Rn,a.trigger({type:"load",target:a})}),nt){var u;return u=a,ht(i,u)}return i}return dt(t,e),t}(Bt);Mn.prototype.allowedEvents_={load:"load"},Mn.NONE=Dn,Mn.LOADING=1,Mn.LOADED=Rn,Mn.ERROR=3;var Nn={audio:{ListClass:hn,TrackClass:On,capitalName:"Audio"},video:{ListClass:fn,TrackClass:Ln,capitalName:"Video"},text:{ListClass:mn,TrackClass:Pn,capitalName:"Text"}};Object.keys(Nn).forEach(function(e){Nn[e].getterName=e+"Tracks",Nn[e].privateName=e+"Tracks_"});var Un={remoteText:{ListClass:mn,TrackClass:Pn,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:gn,TrackClass:Mn,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Bn=ie(Nn,Un);Un.names=Object.keys(Un),Nn.names=Object.keys(Nn),Bn.names=[].concat(Un.names).concat(Nn.names);var jn=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};ct(this,t),n.reportTouchActivity=!1;var r=ht(this,e.call(this,null,n,i));return r.hasStarted_=!1,r.on("playing",function(){this.hasStarted_=!0}),r.on("loadstart",function(){this.hasStarted_=!1}),Bn.names.forEach(function(e){var t=Bn[e];n&&n[t.getterName]&&(r[t.privateName]=n[t.getterName])}),r.featuresProgressEvents||r.manualProgressOn(),r.featuresTimeupdateEvents||r.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(e){!1===n["native"+e+"Tracks"]&&(r["featuresNative"+e+"Tracks"]=!1)}),!1===n.nativeCaptions||!1===n.nativeTextTracks?r.featuresNativeTextTracks=!1:!0!==n.nativeCaptions&&!0!==n.nativeTextTracks||(r.featuresNativeTextTracks=!0),r.featuresNativeTextTracks||r.emulateTextTracks(),r.autoRemoteTextTracks_=new Bn.text.ListClass,r.initTrackListeners(),n.nativeControlsForTouch||r.emitTapEvents(),r.constructor&&(r.name_=r.constructor.name||"Unknown Tech"),r}return dt(t,e),t.prototype.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",function(){return t.setTimeout(function(){return t.triggerSourceset(e)},1)}),this.trigger({src:e,type:"sourceset"})},t.prototype.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},t.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},t.prototype.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Mt(this,function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()}),500)},t.prototype.onDurationChange=function(e){this.duration_=this.duration()},t.prototype.buffered=function(){return oe(0,0)},t.prototype.bufferedPercent=function(){return ue(this.buffered(),this.duration_)},t.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},t.prototype.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},t.prototype.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},t.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},t.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.prototype.dispose=function(){this.clearTracks(Nn.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},t.prototype.clearTracks=function(e){var t=this;e=[].concat(e),e.forEach(function(e){for(var n=t[e+"Tracks"]()||[],i=n.length;i--;){var r=n[i];"text"===e&&t.removeRemoteTextTrack(r),n.removeTrack(r)}})},t.prototype.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var n=e[t];this.removeRemoteTextTrack(n)}},t.prototype.reset=function(){},t.prototype.error=function(e){return void 0!==e&&(this.error_=new le(e),this.trigger("error")),this.error_},t.prototype.played=function(){return this.hasStarted_?oe(0,0):oe()},t.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.prototype.initTrackListeners=function(){var e=this;Nn.names.forEach(function(t){var n=Nn[t],i=function(){e.trigger(t+"trackchange")},r=e[n.getterName]();r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),e.on("dispose",function(){r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i)})})},t.prototype.addWebVttScript_=function(){var e=this;if(!De.WebVTT)if(Re.body.contains(this.el())){if(!this.options_["vtt.js"]&&u(Be)&&Object.keys(Be).length>0)return void this.trigger("vttjsloaded");var t=Re.createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.12.4/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){t.onload=null,t.onerror=null}),De.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},t.prototype.emulateTextTracks=function(){var e=this,t=this.textTracks(),n=this.remoteTextTracks(),i=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};n.on("addtrack",i),n.on("removetrack",r),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e<t.length;e++){var n=t[e];n.removeEventListener("cuechange",a),"showing"===n.mode&&n.addEventListener("cuechange",a)}};s(),t.addEventListener("change",s),t.addEventListener("addtrack",s),t.addEventListener("removetrack",s),this.on("dispose",function(){n.off("addtrack",i),n.off("removetrack",r),t.removeEventListener("change",s),t.removeEventListener("addtrack",s),t.removeEventListener("removetrack",s);for(var e=0;e<t.length;e++){t[e].removeEventListener("cuechange",a)}})},t.prototype.addTextTrack=function(e,t,n){if(!e)throw new Error("TextTrack kind is required but was not provided");return he(this,e,t,n)},t.prototype.createRemoteTextTrack=function(e){var t=ie(e,{tech:this});return new Un.remoteTextEl.TrackClass(t)},t.prototype.addRemoteTextTrack=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1],i=this.createRemoteTextTrack(t);return!0!==n&&!1!==n&&(vt.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),n=!0),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!0!==n&&this.ready(function(){return e.autoRemoteTextTracks_.addTrack(i.track)}),i},t.prototype.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},t.prototype.getVideoPlaybackQuality=function(){return{}},t.prototype.setPoster=function(){},t.prototype.playsinline=function(){},t.prototype.setPlaysinline=function(){},t.prototype.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,n){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,n){if(t.techs_||(t.techs_={}),!t.isTech(n))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=te(e),t.techs_[e]=n,"Tech"!==e&&t.defaultTechOrder_.push(e),n},t.getTech=function(e){if(e)return e=te(e),t.techs_&&t.techs_[e]?t.techs_[e]:De&&De.videojs&&De.videojs[e]?(vt.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),De.videojs[e]):void 0},t}(Yt);Bn.names.forEach(function(e){var t=Bn[e];jn.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),jn.prototype.featuresVolumeControl=!0,jn.prototype.featuresMuteControl=!0,jn.prototype.featuresFullscreenResize=!1,jn.prototype.featuresPlaybackRate=!1,jn.prototype.featuresProgressEvents=!1,jn.prototype.featuresSourceset=!1,jn.prototype.featuresTimeupdateEvents=!1,jn.prototype.featuresNativeTextTracks=!1,jn.withSourceHandlers=function(e){e.registerSourceHandler=function(t,n){var i=e.sourceHandlers;i||(i=e.sourceHandlers=[]),void 0===n&&(n=i.length),i.splice(n,0,t)},e.canPlayType=function(t){for(var n=e.sourceHandlers||[],i=void 0,r=0;r<n.length;r++)if(i=n[r].canPlayType(t))return i;return""},e.selectSourceHandler=function(t,n){for(var i=e.sourceHandlers||[],r=0;r<i.length;r++)if(i[r].canHandleSource(t,n))return i[r];return null},e.canPlaySource=function(t,n){var i=e.selectSourceHandler(t,n);return i?i.canHandleSource(t,n):""},["seekable","seeking","duration"].forEach(function(e){var t=this[e];"function"==typeof t&&(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){var n=e.selectSourceHandler(t,this.options_);n||(e.nativeSourceHandler?n=e.nativeSourceHandler:vt.error("No source hander 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.on("dispose",this.disposeSourceHandler)},e.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)}},Yt.registerComponent("Tech",jn),jn.registerTech("Tech",jn),jn.defaultTechOrder_=[];var Fn={},Hn={},qn={},Vn={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1},Wn={setCurrentTime:1},Gn={play:1,pause:1},zn={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL"},Xn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=kn(e);return zn[t.toLowerCase()]||""},Yn=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var n=e.cache_.sources.filter(function(e){return e.src===t});if(n.length)return n[0].type;for(var i=e.$$("source"),r=0;r<i.length;r++){var a=i[r];if(a.type&&a.src&&a.src===t)return a.type}return Xn(t)},Kn=function e(t){if(Array.isArray(t)){var n=[];t.forEach(function(t){t=e(t),Array.isArray(t)?n=n.concat(t):o(t)&&n.push(t)}),t=n}else t="string"==typeof t&&t.trim()?[we({src:t})]:o(t)&&"string"==typeof t.src&&t.src&&t.src.trim()?[we(t)]:[];return t},Qn=function(e){function t(n,i,r){ct(this,t);var a=ie({createEl:!1},i),s=ht(this,e.call(this,n,a,r));if(i.playerOptions.sources&&0!==i.playerOptions.sources.length)n.src(i.playerOptions.sources);else for(var o=0,u=i.playerOptions.techOrder;o<u.length;o++){var l=te(u[o]),c=jn.getTech(l);if(l||(c=Yt.getComponent(l)),c&&c.isSupported()){n.loadTech_(l);break}}return s}return dt(t,e),t}(Yt);Yt.registerComponent("MediaLoader",Qn);var $n=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.emitTapEvents(),r.enable(),r}return dt(t,e),t.prototype.createEl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n=s({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},n),"button"===t&&vt.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),i=s({role:"button"},i),this.tabIndex_=n.tabIndex;var r=e.prototype.createEl.call(this,t,n,i);return this.createControlTextEl(r),r},t.prototype.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},t.prototype.createControlTextEl=function(e){return this.controlTextEl_=v("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},t.prototype.controlText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(void 0===e)return this.controlText_||"Need Text";var n=this.localize(e);this.controlText_=e,_(this.controlTextEl_,n),this.nonIconControl||t.setAttribute("title",n)},t.prototype.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},t.prototype.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur))},t.prototype.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off(["tap","click"],this.handleClick),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur)},t.prototype.handleClick=function(e){},t.prototype.handleFocus=function(e){Y(Re,"keydown",Mt(this,this.handleKeyPress))},t.prototype.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.trigger("click")):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t.prototype.handleBlur=function(e){K(Re,"keydown",Mt(this,this.handleKeyPress))},t}(Yt);Yt.registerComponent("ClickableComponent",$n);var Jn=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.update(),n.on("posterchange",Mt(r,r.update)),r}return dt(t,e),t.prototype.dispose=function(){this.player().off("posterchange",this.update),e.prototype.dispose.call(this)},t.prototype.createEl=function(){var e=v("div",{className:"vjs-poster",tabIndex:-1});return ot||(this.fallbackImg_=v("img"),e.appendChild(this.fallbackImg_)),e},t.prototype.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},t.prototype.setSrc=function(e){if(this.fallbackImg_)this.fallbackImg_.src=e;else{var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t}},t.prototype.handleClick=function(e){this.player_.controls()&&(this.player_.paused()?de(this.player_.play()):this.player_.pause())},t}($n);Yt.registerComponent("PosterImage",Jn);var Zn={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'},ei=function(e){function t(n,i,r){ct(this,t);var a=ht(this,e.call(this,n,i,r)),s=Mt(a,a.updateDisplay);return n.on("loadstart",Mt(a,a.toggleDisplay)),n.on("texttrackchange",s),n.on("loadstart",Mt(a,a.preselectTrack)),n.ready(Mt(a,function(){if(n.tech_&&n.tech_.featuresNativeTextTracks)return void this.hide();n.on("fullscreenchange",s),n.on("playerresize",s),De.addEventListener&&De.addEventListener("orientationchange",s),n.on("dispose",function(){return De.removeEventListener("orientationchange",s)});for(var e=this.options_.playerOptions.tracks||[],t=0;t<e.length;t++)this.player_.addRemoteTextTrack(e[t],!0);this.preselectTrack()})),a}return dt(t,e),t.prototype.preselectTrack=function(){for(var e={captions:1,subtitles:1},t=this.player_.textTracks(),n=this.player_.cache_.selectedLanguage,i=void 0,r=void 0,a=void 0,s=0;s<t.length;s++){var o=t[s];n&&n.enabled&&n.language===o.language?o.kind===n.kind?a=o:a||(a=o):n&&!n.enabled?(a=null,i=null,r=null):o.default&&("descriptions"!==o.kind||i?o.kind in e&&!r&&(r=o):i=o)}a?a.mode="showing":r?r.mode="showing":i&&(i.mode="showing")},t.prototype.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},t.prototype.clearDisplay=function(){"function"==typeof De.WebVTT&&De.WebVTT.processCues(De,[],this.el_)},t.prototype.updateDisplay=function(){var e=this.player_.textTracks();this.clearDisplay();for(var t=null,n=null,i=e.length;i--;){var r=e[i];"showing"===r.mode&&("descriptions"===r.kind?t=r:n=r)}n?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(n)):t&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(t))},t.prototype.updateForTrack=function(e){if("function"==typeof De.WebVTT&&e.activeCues){for(var t=[],n=0;n<e.activeCues.length;n++)t.push(e.activeCues[n]);if(De.WebVTT.processCues(De,t,this.el_),this.player_.textTrackSettings)for(var i=this.player_.textTrackSettings.getValues(),r=t.length;r--;){var a=t[r];if(a){var s=a.displayState;if(i.color&&(s.firstChild.style.color=i.color),i.textOpacity&&Ce(s.firstChild,"color",ke(i.color||"#fff",i.textOpacity)),i.backgroundColor&&(s.firstChild.style.backgroundColor=i.backgroundColor),i.backgroundOpacity&&Ce(s.firstChild,"backgroundColor",ke(i.backgroundColor||"#000",i.backgroundOpacity)),i.windowColor&&(i.windowOpacity?Ce(s,"backgroundColor",ke(i.windowColor,i.windowOpacity)):s.style.backgroundColor=i.windowColor),i.edgeStyle&&("dropshadow"===i.edgeStyle?s.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222":"raised"===i.edgeStyle?s.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222":"depressed"===i.edgeStyle?s.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222":"uniform"===i.edgeStyle&&(s.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222")),i.fontPercent&&1!==i.fontPercent){var o=De.parseFloat(s.style.fontSize);s.style.fontSize=o*i.fontPercent+"px",s.style.height="auto",s.style.top="auto",s.style.bottom="2px"}i.fontFamily&&"default"!==i.fontFamily&&("small-caps"===i.fontFamily?s.firstChild.style.fontVariant="small-caps":s.firstChild.style.fontFamily=Zn[i.fontFamily])}}}},t}(Yt);Yt.registerComponent("TextTrackDisplay",ei);var ti=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.createEl=function(){var t=this.player_.isAudio(),n=this.localize(t?"Audio Player":"Video Player"),i=v("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[n])}),r=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(i),r},t}(Yt);Yt.registerComponent("LoadingSpinner",ti);var ni=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.createEl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e="button",t=s({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},t),n=s({type:"button"},n);var i=Yt.prototype.createEl.call(this,e,t,n);return this.createControlTextEl(i),i},t.prototype.addChild=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.constructor.name;return vt.warn("Adding an actionable (user controllable) child to a Button ("+n+") is not supported; use a ClickableComponent instead."),Yt.prototype.addChild.call(this,e,t)},t.prototype.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},t.prototype.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},t.prototype.handleKeyPress=function(t){32!==t.which&&13!==t.which&&e.prototype.handleKeyPress.call(this,t)},t}($n);Yt.registerComponent("Button",ni);var ii=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.mouseused_=!1,r.on("mousedown",r.handleMouseDown),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-big-play-button"},t.prototype.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)return void de(t);var n=this.player_.getChild("controlBar"),i=n&&n.getChild("playToggle");if(!i)return void this.player_.focus();var r=function(){return i.focus()};ce(t)?t.then(r,function(){}):this.setTimeout(r,1)},t.prototype.handleKeyPress=function(t){this.mouseused_=!1,e.prototype.handleKeyPress.call(this,t)},t.prototype.handleMouseDown=function(e){this.mouseused_=!0},t}(ni);ii.prototype.controlText_="Play Video",Yt.registerComponent("BigPlayButton",ii);var ri=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.controlText(i&&i.controlText||r.localize("Close")),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},t}(ni);Yt.registerComponent("CloseButton",ri);var ai=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.on(n,"play",r.handlePlay),r.on(n,"pause",r.handlePause),r.on(n,"ended",r.handleEnded),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.prototype.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},t.prototype.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.prototype.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.prototype.handleEnded=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},t}(ni);ai.prototype.controlText_="Play",Yt.registerComponent("PlayToggle",ai);var si=function(e,t){e=e<0?0:e;var n=Math.floor(e%60),i=Math.floor(e/60%60),r=Math.floor(e/3600),a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=i=n="-"),r=r>0||s>0?r+":":"",i=((r||a>=10)&&i<10?"0"+i:i)+":",n=n<10?"0"+n:n,r+i+n},oi=si,ui=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return oi(e,t)},li=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.throttledUpdateContent=Nt(Mt(r,r.updateContent),25),r.on(n,"timeupdate",r.throttledUpdateContent),r}return dt(t,e),t.prototype.createEl=function(t){var n=this.buildCSSClass(),i=e.prototype.createEl.call(this,"div",{className:n+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text">'+this.localize(this.labelText_)+"\xa0</span>"});return this.contentEl_=v("span",{className:n+"-display"},{"aria-live":"off"}),this.updateTextNode_(),i.appendChild(this.contentEl_),i},t.prototype.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},t.prototype.updateTextNode_=function(){if(this.contentEl_){for(;this.contentEl_.firstChild;)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=Re.createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},t.prototype.formatTime_=function(e){return ui(e)},t.prototype.updateFormattedTime_=function(e){var t=this.formatTime_(e);t!==this.formattedTime_&&(this.formattedTime_=t,this.requestAnimationFrame(this.updateTextNode_))},t.prototype.updateContent=function(e){},t}(Yt);li.prototype.labelText_="Time",li.prototype.controlText_="Time",Yt.registerComponent("TimeDisplay",li);var ci=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.on(n,"ended",r.handleEnded),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-current-time"},t.prototype.updateContent=function(e){var t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(t)},t.prototype.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},t}(li);ci.prototype.labelText_="Current Time",ci.prototype.controlText_="Current Time",Yt.registerComponent("CurrentTimeDisplay",ci);var di=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.on(n,"durationchange",r.updateContent),r.on(n,"loadedmetadata",r.throttledUpdateContent),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-duration"},t.prototype.updateContent=function(e){var t=this.player_.duration();t&&this.duration_!==t&&(this.duration_=t,this.updateFormattedTime_(t))},t}(li);di.prototype.labelText_="Duration",di.prototype.controlText_="Duration",Yt.registerComponent("DurationDisplay",di);var hi=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"})},t}(Yt);Yt.registerComponent("TimeDivider",hi);var pi=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.on(n,"durationchange",r.throttledUpdateContent),r.on(n,"ended",r.handleEnded),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-remaining-time"},t.prototype.formatTime_=function(t){return"-"+e.prototype.formatTime_.call(this,t)},t.prototype.updateContent=function(e){this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},t.prototype.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(0)},t}(li);pi.prototype.labelText_="Remaining Time",pi.prototype.controlText_="Remaining Time",Yt.registerComponent("RemainingTimeDisplay",pi);var fi=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.updateShowing(),r.on(r.player(),"durationchange",r.updateShowing),r}return dt(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=v("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+"\xa0</span>"+this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},t.prototype.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},t.prototype.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(Yt);Yt.registerComponent("LiveDisplay",fi);var mi=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.bar=r.getChild(r.options_.barName),r.vertical(!!r.options_.vertical),r.enable(),r}return dt(t,e),t.prototype.enabled=function(){return this.enabled_},t.prototype.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur),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)},t.prototype.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur),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}},t.prototype.createEl=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.className=n.className+" vjs-slider",n=s({tabIndex:0},n),i=s({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},i),e.prototype.createEl.call(this,t,n,i)},t.prototype.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||et||e.preventDefault(),P(),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)},t.prototype.handleMouseMove=function(e){},t.prototype.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;O(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),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.update()},t.prototype.update=function(){if(this.el_){var e=this.getPercent(),t=this.bar;if(t){("number"!=typeof e||e!==e||e<0||e===1/0)&&(e=0);var n=(100*e).toFixed(2)+"%",i=t.el().style;return this.vertical()?i.height=n:i.width=n,e}}},t.prototype.calculateDistance=function(e){var t=R(this.el_,e);return this.vertical()?t.y:t.x},t.prototype.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},t.prototype.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepBack()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepForward())},t.prototype.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},t.prototype.handleClick=function(e){e.stopImmediatePropagation(),e.preventDefault()},t.prototype.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(Yt);Yt.registerComponent("Slider",mi);var gi=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.partEls_=[],r.on(n,"progress",r.update),r}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+"</span>: 0%</span>"})},t.prototype.dispose=function(){this.partEls_=null,e.prototype.dispose.call(this)},t.prototype.update=function(e){var t=this.player_.buffered(),n=this.player_.duration(),i=this.player_.bufferedEnd(),r=this.partEls_,a=function(e,t){var n=e/t||0;return 100*(n>=1?1:n)+"%"};this.el_.style.width=a(i,n);for(var s=0;s<t.length;s++){var o=t.start(s),u=t.end(s),l=r[s];l||(l=this.el_.appendChild(v()),r[s]=l),l.style.left=a(o,i),l.style.width=a(u-o,i)}for(var c=r.length;c>t.length;c--)this.el_.removeChild(r[c-1]);r.length=t.length},t}(Yt);Yt.registerComponent("LoadProgressBar",gi);var yi=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"})},t.prototype.update=function(e,t,n){var i=L(this.el_),r=L(this.player_.el()),a=e.width*t;if(r&&i){var s=e.left-r.left+a,o=e.width-a+(r.right-e.right),u=i.width/2;s<u?u+=u-s:o<u&&(u=o),u<0?u=0:u>i.width&&(u=i.width),this.el_.style.right="-"+u+"px",_(this.el_,n)}},t}(Yt);Yt.registerComponent("TimeTooltip",yi);var vi=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Progress")+"</span>: 0%</span>"})},t.prototype.update=function(e,t){var n=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var i=n.player_.scrubbing()?n.player_.getCache().currentTime:n.player_.currentTime(),r=ui(i,n.player_.duration()),a=n.getChild("timeTooltip");a&&a.update(e,t,r)})},t}(Yt);vi.prototype.options_={children:[]},it&&!(it>8)||ze||Ye||vi.prototype.options_.children.push("timeTooltip"),Yt.registerComponent("PlayProgressBar",vi);var _i=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.update=Nt(Mt(r,r.update),25),r}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.prototype.update=function(e,t){var n=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var i=n.player_.duration(),r=ui(t*i,i);n.el_.style.left=e.width*t+"px",n.getChild("timeTooltip").update(e,t,r)})},t}(Yt);_i.prototype.options_={children:["timeTooltip"]},Yt.registerComponent("MouseTimeDisplay",_i);var bi=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.setEventHandlers_(),r}return dt(t,e),t.prototype.setEventHandlers_=function(){var e=this;this.update=Nt(Mt(this,this.update),30),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.updateInterval=null,this.on(this.player_,["playing"],function(){e.clearInterval(e.updateInterval),e.updateInterval=e.setInterval(function(){e.requestAnimationFrame(function(){e.update()})},30)}),this.on(this.player_,["ended","pause","waiting"],function(){e.clearInterval(e.updateInterval)}),this.on(this.player_,["timeupdate","ended"],this.update)},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.prototype.update_=function(e,t){var n=this.player_.duration();this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[ui(e,n),ui(n,n)],"{1} of {2}")),this.bar.update(L(this.el_),t)},t.prototype.update=function(t){var n=e.prototype.update.call(this);return this.update_(this.getCurrentTime_(),n),n},t.prototype.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.prototype.handleEnded=function(e){this.update_(this.player_.duration(),1)},t.prototype.getPercent=function(){var e=this.getCurrentTime_()/this.player_.duration();return e>=1?1:e},t.prototype.handleMouseDown=function(t){F(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},t.prototype.handleMouseMove=function(e){if(F(e)){var t=this.calculateDistance(e)*this.player_.duration();t===this.player_.duration()&&(t-=.1),this.player_.currentTime(t)}},t.prototype.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},t.prototype.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},t.prototype.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&de(this.player_.play())},t.prototype.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},t.prototype.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},t.prototype.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.prototype.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.handleAction(t)):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t}(mi);bi.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},it&&!(it>8)||ze||Ye||bi.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),bi.prototype.playerEvent="timeupdate",Yt.registerComponent("SeekBar",bi);var Ti=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.handleMouseMove=Nt(Mt(r,r.handleMouseMove),25),r.throttledHandleMouseSeek=Nt(Mt(r,r.handleMouseSeek),25),r.enable(),r}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.prototype.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var n=t.getChild("mouseTimeDisplay"),i=t.el(),r=L(i),a=R(i,e).x;a>1?a=1:a<0&&(a=0),n&&n.update(r,a)}},t.prototype.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},t.prototype.enabled=function(){return this.enabled_},t.prototype.disable=function(){this.children().forEach(function(e){return e.disable&&e.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},t.prototype.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.prototype.handleMouseDown=function(e){var 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.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseUp=function(e){var t=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.handleMouseUp(e),this.off(t,"mousemove",this.throttledHandleMouseSeek),this.off(t,"touchmove",this.throttledHandleMouseSeek),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t}(Yt);Ti.prototype.options_={children:["seekBar"]},Yt.registerComponent("ProgressControl",Ti);var Si=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.on(n,"fullscreenchange",r.handleFullscreenChange),!1===Re[Kt.fullscreenEnabled]&&r.disable(),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.prototype.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(ni);Si.prototype.controlText_="Fullscreen",Yt.registerComponent("FullscreenToggle",Si);var Ei=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")})},wi=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},t}(Yt);Yt.registerComponent("VolumeLevel",wi);var ki=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.on("slideractive",r.updateLastVolume_),r.on(n,"volumechange",r.updateARIAAttributes),n.ready(function(){return r.updateARIAAttributes()}),r}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.prototype.handleMouseDown=function(t){F(t)&&e.prototype.handleMouseDown.call(this,t)},t.prototype.handleMouseMove=function(e){F(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},t.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.prototype.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},t.prototype.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},t.prototype.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(t)})},t}(mi);ki.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},ki.prototype.playerEvent="volumechange",Yt.registerComponent("VolumeBar",ki);var Ci=function(e){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ct(this,t),i.vertical=i.vertical||!1,(void 0===i.volumeBar||u(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical);var r=ht(this,e.call(this,n,i));return Ei(r,n),r.throttledHandleMouseMove=Nt(Mt(r,r.handleMouseMove),25),r.on("mousedown",r.handleMouseDown),r.on("touchstart",r.handleMouseDown),r.on(r.volumeBar,["focus","slideractive"],function(){r.volumeBar.addClass("vjs-slider-active"),r.addClass("vjs-slider-active"),r.trigger("slideractive")}),r.on(r.volumeBar,["blur","sliderinactive"],function(){r.volumeBar.removeClass("vjs-slider-active"),r.removeClass("vjs-slider-active"),r.trigger("sliderinactive")}),r}return dt(t,e),t.prototype.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},t.prototype.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(Yt);Ci.prototype.options_={children:["volumeBar"]},Yt.registerComponent("VolumeControl",Ci);var Ai=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")})},Ii=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return Ai(r,n),r.on(n,["loadstart","volumechange"],r.update),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){var t=this.player_.volume(),n=this.player_.lastVolume_();if(0===t){var i=n<.1?.1:n;this.player_.volume(i),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},t.prototype.update=function(e){this.updateIcon_(),this.updateControlText_()},t.prototype.updateIcon_=function(){var e=this.player_.volume(),t=3;ze&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var n=0;n<4;n++)E(this.el_,"vjs-vol-"+n);S(this.el_,"vjs-vol-"+t)},t.prototype.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume(),t=e?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)},t}(ni);Ii.prototype.controlText_="Mute",Yt.registerComponent("MuteToggle",Ii);var xi=function(e){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ct(this,t),void 0!==i.inline?i.inline=i.inline:i.inline=!0,(void 0===i.volumeControl||u(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline);var r=ht(this,e.call(this,n,i));return r.on(n,["loadstart"],r.volumePanelState_),r.on(r.volumeControl,["slideractive"],r.sliderActive_),r.on(r.volumeControl,["sliderinactive"],r.sliderInactive_),r}return dt(t,e),t.prototype.sliderActive_=function(){this.addClass("vjs-slider-active")},t.prototype.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.prototype.volumePanelState_=function(){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")},t.prototype.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},t}(Yt);xi.prototype.options_={children:["muteToggle","volumeControl"]},Yt.registerComponent("VolumePanel",xi);var Pi=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return i&&(r.menuButton_=i.menuButton),r.focusedChild_=-1,r.on("keydown",r.handleKeyPress),r}return dt(t,e),t.prototype.addItem=function(e){this.addChild(e),e.on("click",Mt(this,function(t){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==e.name()&&this.menuButton_.focus())}))},t.prototype.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=v(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),Y(n,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),n},t.prototype.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},t.prototype.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepForward()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepBack())},t.prototype.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},t.prototype.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},t.prototype.focus=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.children().slice();t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className)&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(Yt);Yt.registerComponent("Menu",Pi);var Oi=function(e){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ct(this,t);var r=ht(this,e.call(this,n,i));r.menuButton_=new ni(n,i),r.menuButton_.controlText(r.controlText_),r.menuButton_.el_.setAttribute("aria-haspopup","true");var a=ni.prototype.buildCSSClass();return r.menuButton_.el_.className=r.buildCSSClass()+" "+a,r.menuButton_.removeClass("vjs-control"),r.addChild(r.menuButton_),r.update(),r.enabled_=!0,r.on(r.menuButton_,"tap",r.handleClick),r.on(r.menuButton_,"click",r.handleClick),r.on(r.menuButton_,"focus",r.handleFocus),r.on(r.menuButton_,"blur",r.handleBlur),r.on("keydown",r.handleSubmenuKeyPress),r}return dt(t,e),t.prototype.update=function(){var 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.show()},t.prototype.createMenu=function(){var e=new Pi(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=v("li",{className:"vjs-menu-title",innerHTML:te(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,e.children_.unshift(t),b(t,e.contentEl())}if(this.items=this.createItems(),this.items)for(var n=0;n<this.items.length;n++)e.addItem(this.items[n]);return e},t.prototype.createItems=function(){},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},t.prototype.buildWrapperCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+ni.prototype.buildCSSClass()+" "+e.prototype.buildCSSClass.call(this)},t.prototype.buildCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+e.prototype.buildCSSClass.call(this)},t.prototype.controlText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(e,t)},t.prototype.handleClick=function(e){this.one(this.menu.contentEl(),"mouseleave",Mt(this,function(e){this.unpressButton(),this.el_.blur()})),this.buttonPressed_?this.unpressButton():this.pressButton()},t.prototype.focus=function(){this.menuButton_.focus()},t.prototype.blur=function(){this.menuButton_.blur()},t.prototype.handleFocus=function(){Y(Re,"keydown",Mt(this,this.handleKeyPress))},t.prototype.handleBlur=function(){K(Re,"keydown",Mt(this,this.handleKeyPress))},t.prototype.handleKeyPress=function(e){27===e.which||9===e.which?(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus())):38!==e.which&&40!==e.which||this.buttonPressed_||(this.pressButton(),e.preventDefault())},t.prototype.handleSubmenuKeyPress=function(e){27!==e.which&&9!==e.which||(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus()))},t.prototype.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),ze&&g())return;this.menu.focus()}},t.prototype.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},t.prototype.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},t.prototype.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(Yt);Yt.registerComponent("MenuButton",Oi);var Li=function(e){function t(n,i){ct(this,t);var r=i.tracks,a=ht(this,e.call(this,n,i));if(a.items.length<=1&&a.hide(),!r)return ht(a);var s=Mt(a,a.update);return r.addEventListener("removetrack",s),r.addEventListener("addtrack",s),a.player_.on("ready",s),a.player_.on("dispose",function(){r.removeEventListener("removetrack",s),r.removeEventListener("addtrack",s)}),a}return dt(t,e),t}(Oi);Yt.registerComponent("TrackButton",Li);var Di=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.selectable=i.selectable,r.isSelected_=i.selected||!1,r.multiSelectable=i.multiSelectable,r.selected(r.isSelected_),r.selectable?r.multiSelectable?r.el_.setAttribute("role","menuitemcheckbox"):r.el_.setAttribute("role","menuitemradio"):r.el_.setAttribute("role","menuitem"),r}return dt(t,e),t.prototype.createEl=function(t,n,i){return this.nonIconControl=!0,e.prototype.createEl.call(this,"li",s({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},n),i)},t.prototype.handleClick=function(e){this.selected(!0)},t.prototype.selected=function(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))},t}($n);Yt.registerComponent("MenuItem",Di);var Ri=function(e){function t(n,i){ct(this,t);var r=i.track,a=n.textTracks();i.label=r.label||r.language||"Unknown",i.selected="showing"===r.mode;var s=ht(this,e.call(this,n,i));s.track=r;var o=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];s.handleTracksChange.apply(s,t)},u=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];s.handleSelectedLanguageChange.apply(s,t)};if(n.on(["loadstart","texttrackchange"],o),a.addEventListener("change",o),a.addEventListener("selectedlanguagechange",u),s.on("dispose",function(){n.off(["loadstart","texttrackchange"],o),a.removeEventListener("change",o),a.removeEventListener("selectedlanguagechange",u)}),void 0===a.onchange){var l=void 0;s.on(["tap","click"],function(){if("object"!==lt(De.Event))try{l=new De.Event("change")}catch(e){}l||(l=Re.createEvent("Event"),l.initEvent("change",!0,!0)),a.dispatchEvent(l)})}return s.handleTracksChange(),s}return dt(t,e),t.prototype.handleClick=function(t){var n=this.track.kind,i=this.track.kinds,r=this.player_.textTracks();if(i||(i=[n]),e.prototype.handleClick.call(this,t),r)for(var a=0;a<r.length;a++){var s=r[a];s===this.track&&i.indexOf(s.kind)>-1?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled")}},t.prototype.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},t.prototype.handleSelectedLanguageChange=function(e){if("showing"===this.track.mode){var 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}}},t.prototype.dispose=function(){this.track=null,e.prototype.dispose.call(this)},t}(Di);Yt.registerComponent("TextTrackMenuItem",Ri);var Mi=function(e){function t(n,i){return ct(this,t),i.track={player:n,kind:i.kind,kinds:i.kinds,default:!1,mode:"disabled"},i.kinds||(i.kinds=[i.kind]),i.label?i.track.label=i.label:i.track.label=i.kinds.join(" and ")+" off",i.selectable=!0,i.multiSelectable=!1,ht(this,e.call(this,n,i))}return dt(t,e),t.prototype.handleTracksChange=function(e){for(var t=this.player().textTracks(),n=!0,i=0,r=t.length;i<r;i++){var a=t[i];if(this.options_.kinds.indexOf(a.kind)>-1&&"showing"===a.mode){n=!1;break}}n!==this.isSelected_&&this.selected(n)},t.prototype.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),n=!0,i=0,r=t.length;i<r;i++){var a=t[i];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&"showing"===a.mode){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(Ri);Yt.registerComponent("OffTextTrackMenuItem",Mi);var Ni=function(e){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ct(this,t),i.tracks=n.textTracks(),ht(this,e.call(this,n,i))}return dt(t,e),t.prototype.createItems=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ri,n=void 0;this.label_&&(n=this.label_+" off"),e.push(new Mi(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;var i=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r<i.length;r++){var a=i[r];if(this.kinds_.indexOf(a.kind)>-1){var s=new t(this.player_,{track:a,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),e.push(s)}}return e},t}(Li);Yt.registerComponent("TextTrackButton",Ni);var Ui=function(e){function t(n,i){ct(this,t);var r=i.track,a=i.cue,s=n.currentTime();i.selectable=!0,i.multiSelectable=!1,i.label=a.text,i.selected=a.startTime<=s&&s<a.endTime;var o=ht(this,e.call(this,n,i));return o.track=r,o.cue=a,r.addEventListener("cuechange",Mt(o,o.update)),o}return dt(t,e),t.prototype.handleClick=function(t){e.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},t.prototype.update=function(e){var t=this.cue,n=this.player_.currentTime();this.selected(t.startTime<=n&&n<t.endTime)},t}(Di);Yt.registerComponent("ChaptersTrackMenuItem",Ui);var Bi=function(e){function t(n,i,r){return ct(this,t),ht(this,e.call(this,n,i,r))}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.update=function(t){this.track_&&(!t||"addtrack"!==t.type&&"removetrack"!==t.type)||this.setTrack(this.findChaptersTrack()),e.prototype.update.call(this)},t.prototype.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var n=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);n&&n.addEventListener("load",this.updateHandler_)}}},t.prototype.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;t>=0;t--){var n=e[t];if(n.kind===this.kind_)return n}},t.prototype.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(te(this.kind_))},t.prototype.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},t.prototype.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var n=0,i=t.length;n<i;n++){var r=t[n],a=new Ui(this.player_,{track:this.track_,cue:r});e.push(a)}return e},t}(Ni);Bi.prototype.kind_="chapters",Bi.prototype.controlText_="Chapters",Yt.registerComponent("ChaptersButton",Bi);var ji=function(e){function t(n,i,r){ct(this,t);var a=ht(this,e.call(this,n,i,r)),s=n.textTracks(),o=Mt(a,a.handleTracksChange);return s.addEventListener("change",o),a.on("dispose",function(){s.removeEventListener("change",o)}),a}return dt(t,e),t.prototype.handleTracksChange=function(e){for(var t=this.player().textTracks(),n=!1,i=0,r=t.length;i<r;i++){var a=t[i];if(a.kind!==this.kind_&&"showing"===a.mode){n=!0;break}}n?this.disable():this.enable()},t.prototype.buildCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Ni);ji.prototype.kind_="descriptions",ji.prototype.controlText_="Descriptions",Yt.registerComponent("DescriptionsButton",ji);var Fi=function(e){function t(n,i,r){return ct(this,t),ht(this,e.call(this,n,i,r))}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Ni);Fi.prototype.kind_="subtitles",Fi.prototype.controlText_="Subtitles",Yt.registerComponent("SubtitlesButton",Fi);var Hi=function(e){function t(n,i){ct(this,t),i.track={player:n,kind:i.kind,label:i.kind+" settings",selectable:!1,default:!1,mode:"disabled"},i.selectable=!1,i.name="CaptionSettingsMenuItem";var r=ht(this,e.call(this,n,i));return r.addClass("vjs-texttrack-settings"),r.controlText(", opens "+i.kind+" settings dialog"),r}return dt(t,e),t.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}(Ri);Yt.registerComponent("CaptionSettingsMenuItem",Hi);var qi=function(e){function t(n,i,r){return ct(this,t),ht(this,e.call(this,n,i,r))}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new Hi(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t)},t}(Ni);qi.prototype.kind_="captions",qi.prototype.controlText_="Captions",Yt.registerComponent("CaptionsButton",qi);var Vi=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.createEl=function(t,n,i){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"captions"===this.options_.track.kind&&(r+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n "),r+="</span>",e.prototype.createEl.call(this,t,s({innerHTML:r},n),i)},t}(Ri);Yt.registerComponent("SubsCapsMenuItem",Vi);var Wi=function(e){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ct(this,t);var r=ht(this,e.call(this,n,i));return r.label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(r.player_.language_)>-1&&(r.label_="captions"),r.menuButton_.controlText(te(r.label_)),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new Hi(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,Vi)},t}(Ni);Wi.prototype.kinds_=["captions","subtitles"],Wi.prototype.controlText_="Subtitles",Yt.registerComponent("SubsCapsButton",Wi);var Gi=function(e){function t(n,i){ct(this,t);var r=i.track,a=n.audioTracks();i.label=r.label||r.language||"Unknown",i.selected=r.enabled;var s=ht(this,e.call(this,n,i));s.track=r,s.addClass("vjs-"+r.kind+"-menu-item");var o=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];s.handleTracksChange.apply(s,t)};return a.addEventListener("change",o),s.on("dispose",function(){a.removeEventListener("change",o)}),s}return dt(t,e),t.prototype.createEl=function(t,n,i){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"main-desc"===this.options_.track.kind&&(r+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Descriptions")+"</span>\n "),r+="</span>",e.prototype.createEl.call(this,t,s({innerHTML:r},n),i)},t.prototype.handleClick=function(t){var n=this.player_.audioTracks();e.prototype.handleClick.call(this,t);for(var i=0;i<n.length;i++){var r=n[i];r.enabled=r===this.track}},t.prototype.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(Di);Yt.registerComponent("AudioTrackMenuItem",Gi);var zi=function(e){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ct(this,t),i.tracks=n.audioTracks(),ht(this,e.call(this,n,i))}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createItems=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.hideThreshold_=1;for(var t=this.player_.audioTracks(),n=0;n<t.length;n++){var i=t[n];e.push(new Gi(this.player_,{track:i,selectable:!0,multiSelectable:!1}))}return e},t}(Li);zi.prototype.controlText_="Audio Track",Yt.registerComponent("AudioTrackButton",zi);var Xi=function(e){function t(n,i){ct(this,t);var r=i.rate,a=parseFloat(r,10);i.label=r,i.selected=1===a,i.selectable=!0,i.multiSelectable=!1;var s=ht(this,e.call(this,n,i));return s.label=r,s.rate=a,s.on(n,"ratechange",s.update),s}return dt(t,e),t.prototype.handleClick=function(t){e.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},t.prototype.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(Di);Xi.prototype.contentElType="button",Yt.registerComponent("PlaybackRateMenuItem",Xi);var Yi=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.updateVisibility(),r.updateLabel(),r.on(n,"loadstart",r.updateVisibility),r.on(n,"ratechange",r.updateLabel),r}return dt(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this);return this.labelEl_=v("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),t.appendChild(this.labelEl_),t},t.prototype.dispose=function(){this.labelEl_=null,e.prototype.dispose.call(this)},t.prototype.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createMenu=function(){var e=new Pi(this.player()),t=this.playbackRates();if(t)for(var n=t.length-1;n>=0;n--)e.addChild(new Xi(this.player(),{rate:t[n]+"x"}));return e},t.prototype.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},t.prototype.handleClick=function(e){for(var t=this.player().playbackRate(),n=this.playbackRates(),i=n[0],r=0;r<n.length;r++)if(n[r]>t){i=n[r];break}this.player().playbackRate(i)},t.prototype.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},t.prototype.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},t.prototype.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},t.prototype.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},t}(Oi);Yi.prototype.controlText_="Playback Rate",Yt.registerComponent("PlaybackRateMenuButton",Yi);var Ki=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},t}(Yt);Yt.registerComponent("Spacer",Ki);var Qi=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,{className:this.buildCSSClass()});return t.innerHTML="\xa0",t},t}(Ki);Yt.registerComponent("CustomControlSpacer",Qi);var $i=function(e){function t(){return ct(this,t),ht(this,e.apply(this,arguments))}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(Yt);$i.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},Yt.registerComponent("ControlBar",$i);var Ji=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i));return r.on(n,"error",r.open),r}return dt(t,e),t.prototype.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},t.prototype.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(un);Ji.prototype.options_=ie(un.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Yt.registerComponent("ErrorDisplay",Ji);var Zi=["#000","Black"],er=["#00F","Blue"],tr=["#0FF","Cyan"],nr=["#0F0","Green"],ir=["#F0F","Magenta"],rr=["#F00","Red"],ar=["#FFF","White"],sr=["#FF0","Yellow"],or=["1","Opaque"],ur=["0.5","Semi-Transparent"],lr=["0","Transparent"],cr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Zi,ar,rr,nr,er,sr,ir,tr]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[or,ur,lr]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[ar,Zi,rr,nr,er,sr,ir,tr]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",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:"captions-font-size-%s",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:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[or,ur]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[lr,ur,or]}};cr.windowColor.options=cr.backgroundColor.options;var dr=function(e){function t(n,i){ct(this,t),i.temporary=!1;var a=ht(this,e.call(this,n,i));return a.updateDisplay=Mt(a,a.updateDisplay),a.fill(),a.hasBeenOpened_=a.hasBeenFilled_=!0,a.endDialog=v("p",{className:"vjs-control-text",textContent:a.localize("End of dialog window.")}),a.el().appendChild(a.endDialog),a.setDefaults(),void 0===i.persistTextTrackSettings&&(a.options_.persistTextTrackSettings=a.options_.playerOptions.persistTextTrackSettings),a.on(a.$(".vjs-done-button"),"click",function(){a.saveSettings(),a.close()}),a.on(a.$(".vjs-default-button"),"click",function(){a.setDefaults(),a.updateDisplay()}),r(cr,function(e){a.on(a.$(e.selector),"change",a.updateDisplay)}),a.options_.persistTextTrackSettings&&a.restoreSettings(),a}return dt(t,e),t.prototype.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},t.prototype.createElSelect_=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"label",r=cr[e],a=r.id.replace("%s",this.id_),s=[n,a].join(" ").trim();return["<"+i+' id="'+a+'" class="'+("label"===i?"vjs-label":"")+'">',this.localize(r.label),"</"+i+">",'<select aria-labelledby="'+s+'">'].concat(r.options.map(function(e){var n=a+"-"+e[1].replace(/\W+/g,"");return['<option id="'+n+'" value="'+e[0]+'" ','aria-labelledby="'+s+" "+n+'">',t.localize(e[1]),"</option>"].join("")})).concat("</select>").join("")},t.prototype.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},t.prototype.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},t.prototype.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},t.prototype.createElColors_=function(){return v("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},t.prototype.createElFont_=function(){return v("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},t.prototype.createElControls_=function(){var e=this.localize("restore all settings to the default values");return v("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},t.prototype.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},t.prototype.label=function(){return this.localize("Caption Settings Dialog")},t.prototype.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},t.prototype.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},t.prototype.getValues=function(){var e=this;return a(cr,function(t,n,i){var r=Pe(e.$(n.selector),n.parser);return void 0!==r&&(t[i]=r),t},{})},t.prototype.setValues=function(e){var t=this;r(cr,function(n,i){Oe(t.$(n.selector),e[i],n.parser)})},t.prototype.setDefaults=function(){var e=this;r(cr,function(t){var n=t.hasOwnProperty("default")?t.default:0;e.$(t.selector).selectedIndex=n})},t.prototype.restoreSettings=function(){var e=void 0;try{e=JSON.parse(De.localStorage.getItem("vjs-text-track-settings"))}catch(e){vt.warn(e)}e&&this.setValues(e)},t.prototype.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?De.localStorage.setItem("vjs-text-track-settings",JSON.stringify(e)):De.localStorage.removeItem("vjs-text-track-settings")}catch(e){vt.warn(e)}}},t.prototype.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},t.prototype.conditionalBlur_=function(){this.previouslyActiveEl_=null,this.off(Re,"keydown",this.handleKeyDown);var e=this.player_.controlBar,t=e&&e.subsCapsButton,n=e&&e.captionsButton;t?t.focus():n&&n.focus()},t}(un);Yt.registerComponent("TextTrackSettings",dr);var hr=function(e){function t(n,i){ct(this,t);var r=i.ResizeObserver||De.ResizeObserver;null===i.ResizeObserver&&(r=!1);var a=ie({createEl:!r},i),s=ht(this,e.call(this,n,a));return s.ResizeObserver=i.ResizeObserver||De.ResizeObserver,s.loadListener_=null,s.resizeObserver_=null,s.debouncedHandler_=Ut(function(){s.resizeHandler()},100,!1,s),r?(s.resizeObserver_=new s.ResizeObserver(s.debouncedHandler_),s.resizeObserver_.observe(n.el())):(s.loadListener_=function(){s.el_&&s.el_.contentWindow&&Y(s.el_.contentWindow,"resize",s.debouncedHandler_)},s.one("load",s.loadListener_)),s}return dt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager"})},t.prototype.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},t.prototype.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.el_&&this.el_.contentWindow&&K(this.el_.contentWindow,"resize",this.debouncedHandler_),this.loadListener_&&this.off("load",this.loadListener_),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null},t}(Yt);Yt.registerComponent("ResizeManager",hr);var pr=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var n=e.$$("source"),i=[],r="";if(!n.length)return!1;for(var a=0;a<n.length;a++){var s=n[a].src;s&&-1===i.indexOf(s)&&i.push(s)}return!!i.length&&(1===i.length&&(r=i[0]),e.triggerSourceset(r),!0)},fr={};nt||(fr=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=Re.createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var n=Re.createDocumentFragment();t.childNodes.length;)n.appendChild(t.childNodes[0]);return this.innerText="",De.Element.prototype.appendChild.call(this,n),this.innerHTML}}));var mr=function(e,t){for(var n={},i=0;i<e.length&&!((n=Object.getOwnPropertyDescriptor(e[i],t))&&n.set&&n.get);i++);return n.enumerable=!0,n.configurable=!0,n},gr=function(e){return mr([e.el(),De.HTMLMediaElement.prototype,De.Element.prototype,fr],"innerHTML")},yr=function(e){var t=e.el();if(!t.resetSourceWatch_){var n={},i=gr(e),r=function(n){return function(){for(var i=arguments.length,r=Array(i),a=0;a<i;a++)r[a]=arguments[a];var s=n.apply(t,r);return pr(e),s}};["append","appendChild","insertAdjacentHTML"].forEach(function(e){t[e]&&(n[e]=t[e],t[e]=r(n[e]))}),Object.defineProperty(t,"innerHTML",ie(i,{set:r(i.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(n).forEach(function(e){t[e]=n[e]}),Object.defineProperty(t,"innerHTML",i)},e.one("sourceset",t.resetSourceWatch_)}},vr={};nt||(vr=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?wn(De.Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return De.Element.prototype.setAttribute.call(this,"src",e),e}}));var _r=function(e){return mr([e.el(),De.HTMLMediaElement.prototype,vr],"src")},br=function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var n=_r(e),i=t.setAttribute,r=t.load;Object.defineProperty(t,"src",ie(n,{set:function(i){var r=n.set.call(t,i);return e.triggerSourceset(t.src),r}})),t.setAttribute=function(n,r){var a=i.call(t,n,r);return/src/i.test(n)&&e.triggerSourceset(t.src),a},t.load=function(){var n=r.call(t);return pr(e)||(e.triggerSourceset(""),yr(e)),n},t.currentSrc?e.triggerSourceset(t.currentSrc):pr(e)||yr(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=r,t.setAttribute=i,Object.defineProperty(t,"src",n),t.resetSourceWatch_&&t.resetSourceWatch_()}}}},Tr=pt(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."],["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."]),Sr=function(e){function t(n,i){ct(this,t);var r=ht(this,e.call(this,n,i)),a=n.source,s=!1;if(a&&(r.el_.currentSrc!==a.src||n.tag&&3===n.tag.initNetworkState_)?r.setSource(a):r.handleLateInit_(r.el_),n.enableSourceset&&r.setupSourcesetHandling_(),r.el_.hasChildNodes()){for(var o=r.el_.childNodes,u=o.length,l=[];u--;){var c=o[u];"track"===c.nodeName.toLowerCase()&&(r.featuresNativeTextTracks?(r.remoteTextTrackEls().addTrackElement_(c),r.remoteTextTracks().addTrack(c.track),r.textTracks().addTrack(c.track),s||r.el_.hasAttribute("crossorigin")||!Cn(c.src)||(s=!0)):l.push(c))}for(var d=0;d<l.length;d++)r.el_.removeChild(l[d])}return r.proxyNativeTracks_(),r.featuresNativeTextTracks&&s&&vt.warn(Me(Tr)),r.restoreMetadataTracksInIOSNativePlayer_(),(st||We||$e)&&!0===n.nativeControlsForTouch&&r.setControls(!0),r.proxyWebkitFullscreen_(),r.triggerReady(),r}return dt(t,e),t.prototype.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),t.disposeMediaElement(this.el_),this.options_=null,e.prototype.dispose.call(this)},t.prototype.setupSourcesetHandling_=function(){br(this)},t.prototype.restoreMetadataTracksInIOSNativePlayer_=function(){var e=this.textTracks(),t=void 0,n=function(){t=[];for(var n=0;n<e.length;n++){var i=e[n];"metadata"===i.kind&&t.push({track:i,storedMode:i.mode})}};n(),e.addEventListener("change",n),this.on("dispose",function(){return e.removeEventListener("change",n)});var i=function n(){for(var i=0;i<t.length;i++){var r=t[i];"disabled"===r.track.mode&&r.track.mode!==r.storedMode&&(r.track.mode=r.storedMode)}e.removeEventListener("change",n)};this.on("webkitbeginfullscreen",function(){e.removeEventListener("change",n),e.removeEventListener("change",i),e.addEventListener("change",i)}),this.on("webkitendfullscreen",function(){e.removeEventListener("change",n),e.addEventListener("change",n),e.removeEventListener("change",i)})},t.prototype.proxyNativeTracks_=function(){var e=this;Nn.names.forEach(function(t){var n=Nn[t],i=e.el()[n.getterName],r=e[n.getterName]();if(e["featuresNative"+n.capitalName+"Tracks"]&&i&&i.addEventListener){var a={change:function(e){r.trigger({type:"change",target:r,currentTarget:r,srcElement:r})},addtrack:function(e){r.addTrack(e.track)},removetrack:function(e){r.removeTrack(e.track)}},s=function(){for(var e=[],t=0;t<r.length;t++){for(var n=!1,a=0;a<i.length;a++)if(i[a]===r[t]){n=!0;break}n||e.push(r[t])}for(;e.length;)r.removeTrack(e.shift())};Object.keys(a).forEach(function(t){var n=a[t];i.addEventListener(t,n),e.on("dispose",function(e){return i.removeEventListener(t,n)})}),e.on("loadstart",s),e.on("dispose",function(t){return e.off("loadstart",s)})}})},t.prototype.createEl=function(){var e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){var n=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(n,e),t.disposeMediaElement(e),e=n}else{e=Re.createElement("video");var i=this.options_.tag&&C(this.options_.tag),r=ie({},i);st&&!0===this.options_.nativeControlsForTouch||delete r.controls,k(e,s(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&I(e,"preload",this.options_.preload);for(var a=["loop","muted","playsinline","autoplay"],o=0;o<a.length;o++){var u=a[o],l=this.options_[u];void 0!==l&&(l?I(e,u,u):x(e,u),e[u]=l)}return e},t.prototype.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,n=function(){t=!0};this.on("loadstart",n);var i=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",i),void this.ready(function(){this.off("loadstart",n),this.off("loadedmetadata",i),t||this.trigger("loadstart")})}var r=["loadstart"];r.push("loadedmetadata"),e.readyState>=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready(function(){r.forEach(function(e){this.trigger(e)},this)})}},t.prototype.setCurrentTime=function(e){try{this.el_.currentTime=e}catch(e){vt(e,"Video is not ready. (Video.js)")}},t.prototype.duration=function(){var e=this;if(this.el_.duration===1/0&&Ye&&et&&0===this.el_.currentTime){var t=function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))};return this.on("timeupdate",t),NaN}return this.el_.duration||NaN},t.prototype.width=function(){return this.el_.offsetWidth},t.prototype.height=function(){return this.el_.offsetHeight},t.prototype.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},n=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0}))};this.on("webkitbeginfullscreen",n),this.on("dispose",function(){e.off("webkitbeginfullscreen",n),e.off("webkitendfullscreen",t)})}},t.prototype.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=De.navigator&&De.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},t.prototype.enterFullScreen=function(){var e=this.el_;e.paused&&e.networkState<=e.HAVE_METADATA?(this.el_.play(),this.setTimeout(function(){e.pause(),e.webkitEnterFullScreen()},0)):e.webkitEnterFullScreen()},t.prototype.exitFullScreen=function(){this.el_.webkitExitFullScreen()},t.prototype.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},t.prototype.reset=function(){t.resetMediaElement(this.el_)},t.prototype.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},t.prototype.setControls=function(e){this.el_.controls=!!e},t.prototype.addTextTrack=function(t,n,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,n,i):e.prototype.addTextTrack.call(this,t,n,i)},t.prototype.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var n=Re.createElement("track");return t.kind&&(n.kind=t.kind),t.label&&(n.label=t.label),(t.language||t.srclang)&&(n.srclang=t.language||t.srclang),t.default&&(n.default=t.default),t.id&&(n.id=t.id),t.src&&(n.src=t.src),n},t.prototype.addRemoteTextTrack=function(t,n){var i=e.prototype.addRemoteTextTrack.call(this,t,n);return this.featuresNativeTextTracks&&this.el().appendChild(i),i},t.prototype.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var n=this.$$("track"),i=n.length;i--;)t!==n[i]&&t!==n[i].track||this.el().removeChild(n[i])},t.prototype.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),De.performance&&"function"==typeof De.performance.now?e.creationTime=De.performance.now():De.performance&&De.performance.timing&&"number"==typeof De.performance.timing.navigationStart&&(e.creationTime=De.Date.now()-De.performance.timing.navigationStart),e},t}(jn);if(f()){Sr.TEST_VID=Re.createElement("video");var Er=Re.createElement("track");Er.kind="captions",Er.srclang="en",Er.label="English",Sr.TEST_VID.appendChild(Er)}Sr.isSupported=function(){try{Sr.TEST_VID.volume=.5}catch(e){return!1}return!(!Sr.TEST_VID||!Sr.TEST_VID.canPlayType)},Sr.canPlayType=function(e){return Sr.TEST_VID.canPlayType(e)},Sr.canPlaySource=function(e,t){return Sr.canPlayType(e.type)},Sr.canControlVolume=function(){try{var e=Sr.TEST_VID.volume;return Sr.TEST_VID.volume=e/2+.1,e!==Sr.TEST_VID.volume}catch(e){return!1}},Sr.canMuteVolume=function(){try{var e=Sr.TEST_VID.muted;return Sr.TEST_VID.muted=!e,Sr.TEST_VID.muted?I(Sr.TEST_VID,"muted","muted"):x(Sr.TEST_VID,"muted"),e!==Sr.TEST_VID.muted}catch(e){return!1}},Sr.canControlPlaybackRate=function(){if(Ye&&et&&tt<58)return!1;try{var e=Sr.TEST_VID.playbackRate;return Sr.TEST_VID.playbackRate=e/2+.1,e!==Sr.TEST_VID.playbackRate}catch(e){return!1}},Sr.canOverrideAttributes=function(){if(nt)return!1;try{var e=function(){};Object.defineProperty(Re.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(Re.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(Re.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(Re.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},Sr.supportsNativeTextTracks=function(){return at||ze&&et},Sr.supportsNativeVideoTracks=function(){return!(!Sr.TEST_VID||!Sr.TEST_VID.videoTracks)},Sr.supportsNativeAudioTracks=function(){return!(!Sr.TEST_VID||!Sr.TEST_VID.audioTracks)},Sr.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],Sr.prototype.featuresVolumeControl=Sr.canControlVolume(),Sr.prototype.featuresMuteControl=Sr.canMuteVolume(),Sr.prototype.featuresPlaybackRate=Sr.canControlPlaybackRate(),Sr.prototype.featuresSourceset=Sr.canOverrideAttributes(),Sr.prototype.movingMediaElementInDOM=!ze,Sr.prototype.featuresFullscreenResize=!0,Sr.prototype.featuresProgressEvents=!0,Sr.prototype.featuresTimeupdateEvents=!0,Sr.prototype.featuresNativeTextTracks=Sr.supportsNativeTextTracks(),Sr.prototype.featuresNativeVideoTracks=Sr.supportsNativeVideoTracks(),Sr.prototype.featuresNativeAudioTracks=Sr.supportsNativeAudioTracks();var wr=Sr.TEST_VID&&Sr.TEST_VID.constructor.prototype.canPlayType,kr=/^application\/(?:x-|vnd\.apple\.)mpegurl/i,Cr=/^video\/mp4/i;Sr.patchCanPlayType=function(){Ke>=4&&!Je&&!et?Sr.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&kr.test(e)?"maybe":wr.call(this,e)}:Qe&&(Sr.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&Cr.test(e)?"maybe":wr.call(this,e)})},Sr.unpatchCanPlayType=function(){var e=Sr.TEST_VID.constructor.prototype.canPlayType;return Sr.TEST_VID.constructor.prototype.canPlayType=wr,e},Sr.patchCanPlayType(),Sr.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},Sr.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),n=t.length;n--;)e.removeChild(t[n]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){Sr.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){Sr.prototype["set"+te(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","played","networkState","readyState","videoWidth","videoHeight"].forEach(function(e){Sr.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach(function(e){Sr.prototype["set"+te(e)]=function(t){this.el_[e]=t}}),["pause","load","play"].forEach(function(e){Sr.prototype[e]=function(){return this.el_[e]()}}),jn.withSourceHandlers(Sr),Sr.nativeSourceHandler={},Sr.nativeSourceHandler.canPlayType=function(e){try{return Sr.TEST_VID.canPlayType(e)}catch(e){return""}},Sr.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Sr.nativeSourceHandler.canPlayType(e.type);if(e.src){var n=kn(e.src);return Sr.nativeSourceHandler.canPlayType("video/"+n)}return""},Sr.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},Sr.nativeSourceHandler.dispose=function(){},Sr.registerSourceHandler(Sr.nativeSourceHandler),jn.registerTech("Html5",Sr);var Ar=pt(["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "],["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "]),Ir=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],xr={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Pr=["tiny","xsmall","small","medium","large","xlarge","huge"],Or={};Pr.forEach(function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Or[e]="vjs-layout-"+t});var Lr={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Dr=function(e){function t(n,i,r){if(ct(this,t),n.id=n.id||i.id||"vjs_video_"+H(),i=s(t.getTagSettings(n),i),i.initChildren=!1,i.createEl=!1,i.evented=!1,i.reportTouchActivity=!1,!i.language)if("function"==typeof n.closest){var a=n.closest("[lang]");a&&a.getAttribute&&(i.language=a.getAttribute("lang"))}else for(var o=n;o&&1===o.nodeType;){if(C(o).hasOwnProperty("lang")){i.language=o.getAttribute("lang");break}o=o.parentNode}var u=ht(this,e.call(this,null,i,r));if(u.log=_t(u.id_),u.isPosterFromTech_=!1,u.queuedCallbacks_=[],u.isReady_=!1,u.hasStarted_=!1,u.userActive_=!1,!u.options_||!u.options_.techOrder||!u.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(u.tag=n,u.tagAttributes=n&&C(n),u.language(u.options_.language),i.languages){var l={};Object.getOwnPropertyNames(i.languages).forEach(function(e){l[e.toLowerCase()]=i.languages[e]}),u.languages_=l}else u.languages_=t.prototype.options_.languages;u.cache_={},u.poster_=i.poster||"",u.controls_=!!i.controls,u.cache_.lastVolume=1,n.controls=!1,n.removeAttribute("controls"),n.hasAttribute("autoplay")?u.options_.autoplay=!0:u.autoplay(u.options_.autoplay),u.scrubbing_=!1,u.el_=u.createEl(),u.cache_.lastPlaybackRate=u.defaultPlaybackRate(),Z(u,{eventBusKey:"el_"});var c=ie(u.options_);if(i.plugins){var d=i.plugins;Object.keys(d).forEach(function(e){if("function"!=typeof this[e])throw new Error('plugin "'+e+'" does not exist');this[e](d[e])},u)}u.options_.playerOptions=c,u.middleware_=[],u.initChildren(),u.isAudio("audio"===n.nodeName.toLowerCase()),u.controls()?u.addClass("vjs-controls-enabled"):u.addClass("vjs-controls-disabled"),u.el_.setAttribute("role","region"),u.isAudio()?u.el_.setAttribute("aria-label",u.localize("Audio Player")):u.el_.setAttribute("aria-label",u.localize("Video Player")),u.isAudio()&&u.addClass("vjs-audio"),u.flexNotSupported_()&&u.addClass("vjs-no-flex"),ze||u.addClass("vjs-workinghover"),t.players[u.id_]=u;var h=je.split(".")[0];return u.addClass("vjs-v"+h),u.userActive(!0),u.reportUserActivity(),u.one("play",u.listenForUserActivity_),u.on("fullscreenchange",u.handleFullscreenChange_),u.on("stageclick",u.handleStageClick_),u.breakpoints(u.options_.breakpoints),u.responsive(u.options_.responsive),u.changingSrc_=!1,u.playWaitingForReady_=!1,u.playOnLoadstart_=null,u}return dt(t,e),t.prototype.dispose=function(){this.trigger("dispose"),this.off("dispose"),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.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),Te(this),e.prototype.dispose.call(this)},t.prototype.createEl=function(){var t=this.tag,n=void 0,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();i?n=this.el_=t.parentNode:r||(n=this.el_=e.prototype.createEl.call(this,"div"));var a=C(t);if(r){for(n=this.el_=t,t=this.tag=Re.createElement("video");n.children.length;)t.appendChild(n.firstChild);T(n,"video-js")||S(n,"video-js"),n.appendChild(t),i=this.playerElIngest_=n,["autoplay","controls","crossOrigin","defaultMuted","defaultPlaybackRate","loop","muted","playbackRate","src","volume"].forEach(function(e){void 0!==n[e]&&(t[e]=n[e])})}if(t.setAttribute("tabindex","-1"),a.tabindex="-1",it&&(t.setAttribute("role","application"),a.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in a&&delete a.width,"height"in a&&delete a.height,Object.getOwnPropertyNames(a).forEach(function(e){"class"===e?(n.className+=" "+a[e],r&&(t.className+=" "+a[e])):(n.setAttribute(e,a[e]),r&&t.setAttribute(e,a[e]))}),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=n.player=this,this.addClass("vjs-paused"),!0!==De.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Dt("vjs-styles-dimensions");var s=Tt(".vjs-styles-defaults"),o=Tt("head");o.insertBefore(this.styleEl_,s?s.nextSibling:o.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);for(var u=t.getElementsByTagName("a"),l=0;l<u.length;l++){var c=u.item(l);S(c,"vjs-hidden"),c.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!i&&t.parentNode.insertBefore(n,t),b(t,n),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_=n,n},t.prototype.width=function(e){return this.dimension("width",e)},t.prototype.height=function(e){return this.dimension("height",e)},t.prototype.dimension=function(e,t){var n=e+"_";if(void 0===t)return this[n]||0;if(""===t)return this[n]=void 0,void this.updateStyleEl_();var i=parseFloat(t);if(isNaN(i))return void vt.error('Improper value "'+t+'" supplied for for '+e);this[n]=i,this.updateStyleEl_()},t.prototype.fluid=function(e){if(void 0===e)return!!this.fluid_;this.fluid_=!!e,e?(this.addClass("vjs-fluid"),this.fill(!1)):this.removeClass("vjs-fluid"),this.updateStyleEl_()},t.prototype.fill=function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},t.prototype.aspectRatio=function(e){if(void 0===e)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_()},t.prototype.updateStyleEl_=function(){if(!0===De.VIDEOJS_NO_DYNAMIC_STYLE){var e="number"==typeof this.width_?this.width_:this.options_.width,t="number"==typeof this.height_?this.height_:this.options_.height,n=this.tech_&&this.tech_.el();return void(n&&(e>=0&&(n.width=e),t>=0&&(n.height=t)))}var i=void 0,r=void 0,a=void 0,s=void 0;a=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";var o=a.split(":"),u=o[1]/o[0];i=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/u:this.videoWidth()||300,r=void 0!==this.height_?this.height_:i*u,s=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(s),Rt(this.styleEl_,"\n ."+s+" {\n width: "+i+"px;\n height: "+r+"px;\n }\n\n ."+s+".vjs-fluid {\n padding-top: "+100*u+"%;\n }\n ")},t.prototype.loadTech_=function(e,t){var n=this;this.tech_&&this.unloadTech_();var i=te(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(jn.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;var a="string"!=typeof this.autoplay()&&this.autoplay(),o={source:t,autoplay:a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,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};Bn.names.forEach(function(e){var t=Bn[e];o[t.getterName]=n[t.privateName]}),s(o,this.options_[i]),s(o,this.options_[r]),s(o,this.options_[e.toLowerCase()]),this.tag&&(o.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(o.startTime=this.cache_.currentTime);var u=jn.getTech(e);if(!u)throw new Error("No Tech named '"+i+"' exists! '"+i+"' should be registered using videojs.registerTech()'");this.tech_=new u(o),this.tech_.ready(Mt(this,this.handleTechReady_),!0),sn.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Ir.forEach(function(e){n.on(n.tech_,e,n["handleTech"+te(e)+"_"])}),Object.keys(xr).forEach(function(e){n.on(n.tech_,e,function(t){if(0===n.tech_.playbackRate()&&n.tech_.seeking())return void n.queuedCallbacks_.push({callback:n["handleTech"+xr[e]+"_"].bind(n),event:t});n["handleTech"+xr[e]+"_"](t)})}),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"sourceset",this.handleTechSourceset_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),this.on(this.tech_,"play",this.handleTechPlay_),this.on(this.tech_,"firstplay",this.handleTechFirstPlay_),this.on(this.tech_,"pause",this.handleTechPause_),this.on(this.tech_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"error",this.handleTechError_),this.on(this.tech_,"loadedmetadata",this.updateStyleEl_),this.on(this.tech_,"posterchange",this.handleTechPosterChange_),this.on(this.tech_,"textdata",this.handleTechTextData_),this.on(this.tech_,"ratechange",this.handleTechRateChange_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||b(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},t.prototype.unloadTech_=function(){var e=this;Bn.names.forEach(function(t){var n=Bn[t];e[n.privateName]=e[n.getterName]()}),this.textTracksJson_=sn.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},t.prototype.tech=function(e){return void 0===e&&vt.warn(Me(Ar)),this.tech_},t.prototype.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",this.handleTechClick_),this.on(this.tech_,"touchstart",this.handleTechTouchStart_),this.on(this.tech_,"touchmove",this.handleTechTouchMove_),this.on(this.tech_,"touchend",this.handleTechTouchEnd_),this.on(this.tech_,"tap",this.handleTechTap_)},t.prototype.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.handleTechTap_),this.off(this.tech_,"touchstart",this.handleTechTouchStart_),this.off(this.tech_,"touchmove",this.handleTechTouchMove_),this.off(this.tech_,"touchend",this.handleTechTouchEnd_),this.off(this.tech_,"mousedown",this.handleTechClick_)},t.prototype.handleTechReady_=function(){if(this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_(),(this.src()||this.currentSrc())&&this.tag&&this.options_.autoplay&&this.paused())try{delete this.tag.poster}catch(e){vt("deleting tag.poster throws in some browsers",e)}},t.prototype.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay())},t.prototype.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"==typeof e){var n=function(){var e=t.muted();t.muted(!0);var n=t.play();if(n&&n.then&&n.catch)return n.catch(function(n){t.muted(e)})},i=void 0;if("any"===e?(i=this.play())&&i.then&&i.catch&&i.catch(function(){return n()}):i="muted"===e?n():this.play(),i&&i.then&&i.catch)return i.then(function(){t.trigger({type:"autoplay-success",autoplay:e})}).catch(function(n){t.trigger({type:"autoplay-failure",autoplay:e})})}},t.prototype.updateSourceCaches_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e,n="";"string"!=typeof t&&(t=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!n&&(n=Yn(this,t)),this.cache_.source=ie({},e,{src:t,type:n});for(var i=this.cache_.sources.filter(function(e){return e.src&&e.src===t}),r=[],a=this.$$("source"),s=[],o=0;o<a.length;o++){var u=C(a[o]);r.push(u),u.src&&u.src===t&&s.push(u.src)}s.length&&!i.length?this.cache_.sources=r:i.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},t.prototype.handleTechSourceset_=function(e){var t=this;if(!this.changingSrc_){var n=function(e){return t.updateSourceCaches_(e)},i=this.currentSource().src,r=e.src;if(i&&!/^blob:/.test(i)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==i)&&(n=function(){}),n(r),!e.src){var a=function e(n){if("sourceset"!==n.type){var i=t.techGet("currentSrc");t.lastSource_.tech=i,t.updateSourceCaches_(i)}t.tech_.off(["sourceset","loadstart"],e)};this.tech_.one(["sourceset","loadstart"],a)}}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},t.prototype.hasStarted=function(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},t.prototype.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},t.prototype.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},t.prototype.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting"),this.one("timeupdate",function(){return e.removeClass("vjs-waiting")})},t.prototype.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},t.prototype.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},t.prototype.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},t.prototype.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},t.prototype.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.trigger("seeked")},t.prototype.handleTechFirstPlay_=function(){this.options_.starttime&&(vt.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},t.prototype.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},t.prototype.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},t.prototype.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},t.prototype.handleTechClick_=function(e){F(e)&&this.controls_&&(this.paused()?de(this.play()):this.pause())},t.prototype.handleTechTap_=function(){this.userActive(!this.userActive())},t.prototype.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},t.prototype.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},t.prototype.handleTechTouchEnd_=function(e){e.preventDefault()},t.prototype.handleFullscreenChange_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},t.prototype.handleStageClick_=function(){this.reportUserActivity()},t.prototype.handleTechFullscreenChange_=function(e,t){t&&this.isFullscreen(t.isFullscreen),this.trigger("fullscreenchange")},t.prototype.handleTechError_=function(){var e=this.tech_.error();this.error(e)},t.prototype.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},t.prototype.getCache=function(){return this.cache_},t.prototype.techCall_=function(e,t){this.ready(function(){if(e in Wn)return ye(this.middleware_,this.tech_,e,t);if(e in Gn)return ve(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw vt(e),e}},!0)},t.prototype.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in Vn)return ge(this.middleware_,this.tech_,e);if(e in Gn)return ve(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw vt("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw vt("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw vt(t),t}}},t.prototype.play=function(){var e=this,t=this.options_.Promise||De.Promise;return t?new t(function(t){e.play_(t)}):this.play_()},t.prototype.play_=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:de;if(this.playOnLoadstart_&&this.off("loadstart",this.playOnLoadstart_),this.isReady_){if(!this.changingSrc_&&(this.src()||this.currentSrc()))return void t(this.techGet_("play"));this.playOnLoadstart_=function(){e.playOnLoadstart_=null,t(e.play())},this.one("loadstart",this.playOnLoadstart_)}else{if(this.playWaitingForReady_)return;this.playWaitingForReady_=!0,this.ready(function(){e.playWaitingForReady_=!1,t(e.play())})}},t.prototype.pause=function(){this.techCall_("pause")},t.prototype.paused=function(){return!1!==this.techGet_("paused")},t.prototype.played=function(){return this.techGet_("played")||oe(0,0)},t.prototype.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},t.prototype.currentTime=function(e){return void 0!==e?(e<0&&(e=0),void this.techCall_("setCurrentTime",e)):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},t.prototype.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?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"),this.trigger("durationchange"))},t.prototype.remainingTime=function(){return this.duration()-this.currentTime()},t.prototype.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},t.prototype.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=oe(0,0)),e},t.prototype.bufferedPercent=function(){return ue(this.buffered(),this.duration())},t.prototype.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),n=e.end(e.length-1);return n>t&&(n=t),n},t.prototype.volume=function(e){var t=void 0;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},t.prototype.muted=function(e){return void 0!==e?void this.techCall_("setMuted",e):this.techGet_("muted")||!1},t.prototype.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},t.prototype.lastVolume_=function(e){return void 0!==e&&0!==e?void(this.cache_.lastVolume=e):this.cache_.lastVolume},t.prototype.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},t.prototype.isFullscreen=function(e){return void 0!==e?void(this.isFullscreen_=!!e):!!this.isFullscreen_},t.prototype.requestFullscreen=function(){var e=Kt;this.isFullscreen(!0),e.requestFullscreen?(Y(Re,e.fullscreenchange,Mt(this,function t(n){this.isFullscreen(Re[e.fullscreenElement]),!1===this.isFullscreen()&&K(Re,e.fullscreenchange,t),this.trigger("fullscreenchange")})),this.el_[e.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange"))},t.prototype.exitFullscreen=function(){var e=Kt;this.isFullscreen(!1),e.requestFullscreen?Re[e.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange"))},t.prototype.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=Re.documentElement.style.overflow,Y(Re,"keydown",Mt(this,this.fullWindowOnEscKey)),Re.documentElement.style.overflow="hidden",S(Re.body,"vjs-full-window"),this.trigger("enterFullWindow")},t.prototype.fullWindowOnEscKey=function(e){27===e.keyCode&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},t.prototype.exitFullWindow=function(){this.isFullWindow=!1,K(Re,"keydown",this.fullWindowOnEscKey),Re.documentElement.style.overflow=this.docOrigOverflow,E(Re.body,"vjs-full-window"),this.trigger("exitFullWindow")},t.prototype.canPlayType=function(e){for(var t=void 0,n=0,i=this.options_.techOrder;n<i.length;n++){var r=i[n],a=jn.getTech(r);if(a||(a=Yt.getComponent(r)),a){if(a.isSupported()&&(t=a.canPlayType(e)))return t}else vt.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},t.prototype.selectSource=function(e){var t=this,n=this.options_.techOrder.map(function(e){return[e,jn.getTech(e)]}).filter(function(e){var t=e[0],n=e[1];return n?n.isSupported():(vt.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),i=function(e,t,n){var i=void 0;return e.some(function(e){return t.some(function(t){if(i=n(e,t))return!0})}),i},r=function(e,n){var i=e[0];if(e[1].canPlaySource(n,t.options_[i.toLowerCase()]))return{source:n,tech:i}};return(this.options_.sourceOrder?i(e,n,function(e){return function(t,n){return e(n,t)}}(r)):i(n,e,r))||!1},t.prototype.src=function(e){var t=this;if(void 0===e)return this.cache_.src||"";var n=Kn(e);if(!n.length)return void this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0);this.changingSrc_=!0,this.cache_.sources=n,this.updateSourceCaches_(n[0]),fe(this,n[0],function(e,i){if(t.middleware_=i,t.cache_.sources=n,t.updateSourceCaches_(e),t.src_(e))return n.length>1?t.src(n.slice(1)):(t.changingSrc_=!1,t.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0),void t.triggerReady());me(i,t.tech_)})},t.prototype.src_=function(e){var t=this,n=this.selectSource([e]);return!n||(ne(n.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_(n.tech,n.source),this.tech_.ready(function(){t.changingSrc_=!1}),!1))},t.prototype.load=function(){this.techCall_("load")},t.prototype.reset=function(){this.tech_&&this.tech_.clearTracks("text"),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset")},t.prototype.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},t.prototype.currentSource=function(){return this.cache_.source||{}},t.prototype.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},t.prototype.currentType=function(){return this.currentSource()&&this.currentSource().type||""},t.prototype.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},t.prototype.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t=void 0;"string"==typeof e&&/(any|play|muted)/.test(e)?(this.options_.autoplay=e,this.manualAutoplay_(e),t=!1):this.options_.autoplay=!!e,t=t||this.options_.autoplay,this.tech_&&this.techCall_("setAutoplay",t)},t.prototype.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},t.prototype.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},t.prototype.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},t.prototype.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},t.prototype.controls=function(e){if(void 0===e)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_()))},t.prototype.usingNativeControls=function(e){if(void 0===e)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")))},t.prototype.error=function(e){return void 0===e?this.error_||null:null===e?(this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close())):(this.error_=new le(e),this.addClass("vjs-error"),vt.error("(CODE:"+this.error_.code+" "+le.errorTypes[this.error_.code]+")",this.error_.message,this.error_),void this.trigger("error"))},t.prototype.reportUserActivity=function(e){this.userActivity_=!0},t.prototype.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");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")}},t.prototype.listenForUserActivity_=function(){var e=void 0,t=void 0,n=void 0,i=Mt(this,this.reportUserActivity),r=function(e){e.screenX===t&&e.screenY===n||(t=e.screenX,n=e.screenY,i())},a=function(){i(),this.clearInterval(e),e=this.setInterval(i,250)},s=function(t){i(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",r),this.on("mouseup",s),this.on("keydown",i),this.on("keyup",i);var o=void 0;this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(o);var e=this.options_.inactivityTimeout;e<=0||(o=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e))}},250)},t.prototype.playbackRate=function(e){return void 0!==e?void this.techCall_("setPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1},t.prototype.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},t.prototype.isAudio=function(e){return void 0!==e?void(this.isAudio_=!!e):!!this.isAudio_},t.prototype.addTextTrack=function(e,t,n){if(this.tech_)return this.tech_.addTextTrack(e,t,n)},t.prototype.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},t.prototype.removeRemoteTextTrack=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.track,n=void 0===t?arguments[0]:t;if(this.tech_)return this.tech_.removeRemoteTextTrack(n)},t.prototype.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},t.prototype.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},t.prototype.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},t.prototype.language=function(e){if(void 0===e)return this.language_;this.language_=String(e).toLowerCase()},t.prototype.languages=function(){return ie(t.prototype.options_.languages,this.languages_)},t.prototype.toJSON=function(){var e=ie(this.options_),t=e.tracks;e.tracks=[];for(var n=0;n<t.length;n++){var i=t[n];i=ie(i),i.player=void 0,e.tracks[n]=i}return e},t.prototype.createModal=function(e,t){var n=this;t=t||{},t.content=e||"";var i=new un(this,t);return this.addChild(i),i.on("dispose",function(){n.removeChild(i)}),i.open(),i},t.prototype.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),n=0;n<Pr.length;n++){var i=Pr[n],r=this.breakpoints_[i];if(t<=r){if(e===i)return;e&&this.removeClass(Or[e]),this.addClass(Or[i]),this.breakpoint_=i;break}}},t.prototype.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},t.prototype.breakpoints=function(e){return void 0===e?s(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=s({},Lr,e),this.updateCurrentBreakpoint_(),s(this.breakpoints_))},t.prototype.responsive=function(e){return void 0===e?this.responsive_:(e=Boolean(e),e!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.updateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.updateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0)},t.prototype.currentBreakpoint=function(){return this.breakpoint_},t.prototype.currentBreakpointClass=function(){return Or[this.breakpoint_]||""},t.getTagSettings=function(e){var t={sources:[],tracks:[]},n=C(e),i=n["data-setup"];if(T(e,"vjs-fill")&&(n.fill=!0),T(e,"vjs-fluid")&&(n.fluid=!0),null!==i){var r=Ne(i||"{}"),a=r[0],o=r[1];a&&vt.error(a),s(n,o)}if(s(t,n),e.hasChildNodes())for(var u=e.childNodes,l=0,c=u.length;l<c;l++){var d=u[l],h=d.nodeName.toLowerCase();"source"===h?t.sources.push(C(d)):"track"===h&&t.tracks.push(C(d))}return t},t.prototype.flexNotSupported_=function(){var e=Re.createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},t}(Yt);Bn.names.forEach(function(e){var t=Bn[e];Dr.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),Dr.players={};var Rr=De.navigator;Dr.prototype.options_={techOrder:jn.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","controlBar","errorDisplay","textTrackSettings"],language:Rr&&(Rr.languages&&Rr.languages[0]||Rr.userLanguage||Rr.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",breakpoints:{},responsive:!1},nt||Dr.prototype.options_.children.push("resizeManager"),["ended","seeking","seekable","networkState","readyState"].forEach(function(e){Dr.prototype[e]=function(){return this.techGet_(e)}}),Ir.forEach(function(e){Dr.prototype["handleTech"+te(e)+"_"]=function(){return this.trigger(e)}}),Yt.registerComponent("Player",Dr);var Mr={},Nr=function(e){return Mr.hasOwnProperty(e)},Ur=function(e){return Nr(e)?Mr[e]:void 0},Br=function(e,t){e.activePlugins_=e.activePlugins_||{},e.activePlugins_[t]=!0},jr=function(e,t,n){var i=(n?"before":"")+"pluginsetup";e.trigger(i,t),e.trigger(i+":"+t.name,t)},Fr=function(e,t){var n=function(){jr(this,{name:e,plugin:t,instance:null},!0);var n=t.apply(this,arguments);return Br(this,e),jr(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach(function(e){n[e]=t[e]}),n},Hr=function(e,t){return t.prototype.name=e,function(){jr(this,{name:e,plugin:t,instance:null},!0);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var a=new(Function.prototype.bind.apply(t,[null].concat([this].concat(i))));return this[e]=function(){return a},jr(this,a.getEventHash()),a}},qr=function(){function e(t){if(ct(this,e),this.constructor===e)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,Z(this),delete this.trigger,ee(this,this.constructor.defaultState),Br(t,this.name),this.dispose=Mt(this,this.dispose),t.on("dispose",this.dispose)}return e.prototype.version=function(){return this.constructor.VERSION},e.prototype.getEventHash=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.name=this.name,e.plugin=this.constructor,e.instance=this,e},e.prototype.trigger=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Q(this.eventBusEl_,e,this.getEventHash(t))},e.prototype.handleStateChanged=function(e){},e.prototype.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t.activePlugins_[e]=!1,this.player=this.state=null,t[e]=Hr(e,Mr[e])},e.isBasic=function(t){var n="string"==typeof t?Ur(t):t;return"function"==typeof n&&!e.prototype.isPrototypeOf(n.prototype)},e.registerPlugin=function(t,n){if("string"!=typeof t)throw new Error('Illegal plugin name, "'+t+'", must be a string, was '+(void 0===t?"undefined":lt(t))+".");if(Nr(t))vt.warn('A plugin named "'+t+'" already exists. You may want to avoid re-registering plugins!');else if(Dr.prototype.hasOwnProperty(t))throw new Error('Illegal plugin name, "'+t+'", cannot share a name with an existing player method!');if("function"!=typeof n)throw new Error('Illegal plugin for "'+t+'", must be a function, was '+(void 0===n?"undefined":lt(n))+".");return Mr[t]=n,"plugin"!==t&&(e.isBasic(n)?Dr.prototype[t]=Fr(t,n):Dr.prototype[t]=Hr(t,n)),n},e.deregisterPlugin=function(e){if("plugin"===e)throw new Error("Cannot de-register base plugin.");Nr(e)&&(delete Mr[e],delete Dr.prototype[e])},e.getPlugins=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.keys(Mr),t=void 0;return e.forEach(function(e){var n=Ur(e);n&&(t=t||{},t[e]=n)}),t},e.getPluginVersion=function(e){var t=Ur(e);return t&&t.VERSION||""},e}();qr.getPlugin=Ur,qr.BASE_PLUGIN_NAME="plugin",qr.registerPlugin("plugin",qr),Dr.prototype.usingPlugin=function(e){return!!this.activePlugins_&&!0===this.activePlugins_[e]},Dr.prototype.hasPlugin=function(e){return!!Nr(e)};var Vr=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":lt(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.super_=t)},Wr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(){e.apply(this,arguments)},i={};"object"===(void 0===t?"undefined":lt(t))?(t.constructor!==Object.prototype.constructor&&(n=t.constructor),i=t):"function"==typeof t&&(n=t),Vr(n,e);for(var r in i)i.hasOwnProperty(r)&&(n.prototype[r]=i[r]);return n};"undefined"==typeof HTMLVideoElement&&f()&&(Re.createElement("video"),Re.createElement("audio"),Re.createElement("track"),Re.createElement("video-js"));var Gr=function(e){return 0===e.indexOf("#")?e.slice(1):e};if(Le.hooks_={},Le.hooks=function(e,t){return Le.hooks_[e]=Le.hooks_[e]||[],t&&(Le.hooks_[e]=Le.hooks_[e].concat(t)),Le.hooks_[e]},Le.hook=function(e,t){Le.hooks(e,t)},Le.hookOnce=function(e,t){Le.hooks(e,[].concat(t).map(function(t){return function n(){return Le.removeHook(e,n),t.apply(void 0,arguments)}}))},Le.removeHook=function(e,t){var n=Le.hooks(e).indexOf(t);return!(n<=-1)&&(Le.hooks_[e]=Le.hooks_[e].slice(),Le.hooks_[e].splice(n,1),!0)},!0!==De.VIDEOJS_NO_DYNAMIC_STYLE&&f()){var zr=Tt(".vjs-styles-defaults");if(!zr){zr=Dt("vjs-styles-defaults");var Xr=Tt("head");Xr&&Xr.insertBefore(zr,Xr.firstChild),Rt(zr,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}J(1,Le),Le.VERSION=je,Le.options=Dr.prototype.options_,Le.getPlayers=function(){return Dr.players},Le.getPlayer=function(e){var t=Dr.players,n=void 0;if("string"==typeof e){var i=Gr(e),r=t[i];if(r)return r;n=Tt("#"+i)}else n=e;if(m(n)){var a=n,s=a.player,o=a.playerId;if(s||t[o])return s||t[o]}},Le.getAllPlayers=function(){return Object.keys(Dr.players).map(function(e){return Dr.players[e]}).filter(Boolean)},Le.players=Dr.players,Le.getComponent=Yt.getComponent,Le.registerComponent=function(e,t){jn.isTech(t)&&vt.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),Yt.registerComponent.call(Yt,e,t)},Le.getTech=jn.getTech,Le.registerTech=jn.registerTech,Le.use=pe,!nt&&Object.defineProperty?(Object.defineProperty(Le,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Le.middleware,"TERMINATOR",{value:qn,writeable:!1,enumerable:!0})):Le.middleware={TERMINATOR:qn},Le.browser=ut,Le.TOUCH_ENABLED=st,Le.extend=Wr,Le.mergeOptions=ie,Le._bind=Mt,Le.registerPlugin=qr.registerPlugin,Le.deregisterPlugin=qr.deregisterPlugin,Le.plugin=function(e,t){return vt.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),qr.registerPlugin(e,t)},Le.getPlugins=qr.getPlugins,Le.getPlugin=qr.getPlugin,Le.getPluginVersion=qr.getPluginVersion,Le.addLanguage=function(e,t){var n;return e=(""+e).toLowerCase(),Le.options.languages=ie(Le.options.languages,(n={},n[e]=t,n)),Le.options.languages[e]},Le.log=vt,Le.createLogger=_t,Le.createTimeRange=Le.createTimeRanges=oe,Le.formatTime=ui,Le.setFormatTime=Ae,Le.resetFormatTime=Ie,Le.parseUrl=En,Le.isCrossOrigin=Cn,Le.EventTarget=Bt,Le.on=Y,Le.one=$,Le.off=K,Le.trigger=Q,Le.xhr=Ue,Le.TextTrack=Pn,Le.AudioTrack=On,Le.VideoTrack=Ln,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(e){Le[e]=function(){return vt.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),Et[e].apply(null,arguments)}}),Le.computedStyle=c,Le.dom=Et,Le.url=An,e.exports=Le},function(e,t,n){(function(t){var n;n="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=n}).call(t,n(2))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.d(t,"g",function(){return u}),n.d(t,"e",function(){return l}),n.d(t,"k",function(){return d}),n.d(t,"j",function(){return h}),n.d(t,"i",function(){return p}),n.d(t,"b",function(){return g}),n.d(t,"f",function(){return y}),n.d(t,"c",function(){return v}),n.d(t,"h",function(){return _}),n.d(t,"d",function(){return b}),n.d(t,"a",function(){return T});var i=n(1),r=n.n(i),a=function(e,t){for(var n="";t--;)n+=e;return n},s=function(e){return e.toString(2).length},o=function(e){return Math.ceil(s(e)/8)},u=function(e,t,n){return void 0===n&&(n=" "),(a(n,t)+e.toString()).slice(-t)},l=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},c=function(e){return l(e)},d=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||c(e)||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!==e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},h=function(e){e=d(e);for(var t="",n=0;n<e.length;n++)t+=u(e[n].toString(16),2,"0");return t},p=function(e){e=d(e);for(var t="",n=0;n<e.length;n++)t+=u(e[n].toString(2),8,"0");return t},f=r.a.BigInt||Number,m=[f("0x1"),f("0x100"),f("0x10000"),f("0x1000000"),f("0x100000000"),f("0x10000000000"),f("0x1000000000000"),f("0x100000000000000"),f("0x10000000000000000")],g=(function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}(),function(e,t){var n=void 0===t?{}:t,i=n.signed,r=void 0!==i&&i,a=n.le,s=void 0!==a&&a;e=d(e);var o=s?"reduce":"reduceRight",u=e[o]?e[o]:Array.prototype[o],l=u.call(e,function(t,n,i){var r=s?i:Math.abs(i+1-e.length);return t+f(n)*m[r]},f(0));if(r){var c=m[e.length]/f(2)-f(1);l=f(l),l>c&&(l-=c,l-=c,l-=f(2))}return Number(l)}),y=function(e,t){var n=void 0===t?{}:t,i=n.le,r=void 0!==i&&i;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!==e)&&(e=0),e=f(e);for(var a=o(e),s=new Uint8Array(new ArrayBuffer(a)),u=0;u<a;u++){var l=r?u:Math.abs(u+1-s.length);s[l]=Number(e/m[u]&f(255)),e<0&&(s[l]=Math.abs(~s[l]),s[l]-=0===u?1:2)}return s},v=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,d(e));try{return decodeURIComponent(escape(t))}catch(e){}return t},_=function(e,t){if("string"!=typeof e&&e&&"function"==typeof e.toString&&(e=e.toString()),"string"!=typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var n=new Uint8Array(e.length),i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return n},b=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t=t.filter(function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e}),t.length<=1)return d(t[0]);var i=t.reduce(function(e,t,n){return e+(t.byteLength||t.length)},0),r=new Uint8Array(i),a=0;return t.forEach(function(e){e=d(e),r.set(e,a),a+=e.byteLength}),r},T=function(e,t,n){var i=void 0===n?{}:n,r=i.offset,a=void 0===r?0:r,s=i.mask,o=void 0===s?[]:s;e=d(e),t=d(t);var u=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&u.call(t,function(t,n){return t===(o[n]?o[n]&e[a+n]:e[a+n])})}},function(e,t,n){"use strict";function i(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var r=i({HTML:"text/html",isHTML:function(e){return e===r.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),a=i({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/"});t.freeze=i,t.MIME_TYPE=r,t.NAMESPACE=a},function(e,t){function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}var r=n(34);e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){(function(t){var i,r=void 0!==t?t:"undefined"!=typeof window?window:{},a=n(35);"undefined"!=typeof document?i=document:(i=r["__GLOBAL_DOCUMENT_CACHE@4"])||(i=r["__GLOBAL_DOCUMENT_CACHE@4"]=a),e.exports=i}).call(t,n(2))},function(e,t,n){"use strict";var i=n(36),r=n.n(i),a=n(1),s=n.n(a),o=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=s.a.location&&s.a.location.href||"");var n="function"==typeof s.a.URL,i=/^\/\//.test(e),a=!s.a.location&&!/\/\//i.test(e);if(n?e=new s.a.URL(e,s.a.location||"http://example.com"):/\/\//i.test(e)||(e=r.a.buildAbsoluteURL(s.a.location&&s.a.location.href||"",e)),n){var o=new URL(t,e);return a?o.href.slice("http://example.com".length):i?o.href.slice(o.protocol.length):o.href}return r.a.buildAbsoluteURL(e,t)};t.a=o},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,n.apply(this,arguments)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";(function(e){function i(e){for(var t=s(e),n=new Uint8Array(t.length),i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}t.a=i;var r=n(1),a=n.n(r),s=function(t){return a.a.atob?a.a.atob(t):e.from(t,"base64").toString("binary")}}).call(t,n(38).Buffer)},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,r=/^application\/dash\+xml/i,a=function(e){return i.test(e)?"hls":r.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null}},function(e,t,n){function i(e){return""!==e}function r(e){return e?e.split(/[\t\n\f\r ]+/).filter(i):[]}function a(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function s(e){if(!e)return[];var t=r(e);return Object.keys(t.reduce(a,{}))}function o(e){return function(t){return e&&-1!==e.indexOf(t)}}function u(e,t){for(var n in e)t[n]=e[n]}function l(e,t){function n(){}var i=e.prototype;i instanceof t||(n.prototype=t.prototype,n=new n,u(i,n),e.prototype=i=n),i.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),i.constructor=e)}function c(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,he[e]),this.message=he[e],Error.captureStackTrace&&Error.captureStackTrace(this,c);return n.code=e,t&&(this.message=this.message+": "+t),n}function d(){}function h(e,t){this._node=e,this._refresh=t,p(this)}function p(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);Y(e,"length",n.length),u(n,e),e._inc=t}}function f(){}function m(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function g(e,t,n,i){if(i?t[m(t,i)]=n:t[t.length++]=n,e){n.ownerElement=e;var r=e.ownerDocument;r&&(i&&w(r,e,i),E(r,e,n))}}function y(e,t,n){var i=m(t,n);if(!(i>=0))throw c(fe,new Error(e.tagName+"@"+n));for(var r=t.length-1;i<r;)t[i]=t[++i];if(t.length=r,e){var a=e.ownerDocument;a&&(w(a,e,n),n.ownerElement=null)}}function v(){}function _(){}function b(e){return"<"==e&&"&lt;"||">"==e&&"&gt;"||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function T(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(T(e,t))return!0}while(e=e.nextSibling)}function S(){}function E(e,t,n){e&&e._inc++,n.namespaceURI===$.XMLNS&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function w(e,t,n,i){e&&e._inc++,n.namespaceURI===$.XMLNS&&delete t._nsMap[n.prefix?n.localName:""]}function k(e,t,n){if(e&&e._inc){e._inc++;var i=t.childNodes;if(n)i[i.length++]=n;else{for(var r=t.firstChild,a=0;r;)i[a++]=r,r=r.nextSibling;i.length=a}}}function C(e,t){var n=t.previousSibling,i=t.nextSibling;return n?n.nextSibling=i:e.firstChild=i,i?i.previousSibling=n:e.lastChild=n,k(e.ownerDocument,e),t}function A(e,t,n){var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===le){var r=t.firstChild;if(null==r)return t;var a=t.lastChild}else r=a=t;var s=n?n.previousSibling:e.lastChild;r.previousSibling=s,a.nextSibling=n,s?s.nextSibling=r:e.firstChild=r,null==n?e.lastChild=a:n.previousSibling=a;do{r.parentNode=e}while(r!==a&&(r=r.nextSibling));return k(e.ownerDocument||e,e),t.nodeType==le&&(t.firstChild=t.lastChild=null),t}function I(e,t){var n=t.parentNode;if(n){var i=e.lastChild;n.removeChild(t);var i=e.lastChild}var i=e.lastChild;return t.parentNode=e,t.previousSibling=i,t.nextSibling=null,i?i.nextSibling=t:e.firstChild=t,e.lastChild=t,k(e.ownerDocument,e,t),t}function x(){this._nsMap={}}function P(){}function O(){}function L(){}function D(){}function R(){}function M(){}function N(){}function U(){}function B(){}function j(){}function F(){}function H(){}function q(e,t){var n=[],i=9==this.nodeType&&this.documentElement||this,r=i.prefix,a=i.namespaceURI;if(a&&null==r){var r=i.lookupPrefix(a);if(null==r)var s=[{namespace:a,prefix:null}]}return G(this,n,e,t,s),n.join("")}function V(e,t,n){var i=e.prefix||"",r=e.namespaceURI;if(!r)return!1;if("xml"===i&&r===$.XML||r===$.XMLNS)return!1;for(var a=n.length;a--;){var s=n[a];if(s.prefix===i)return s.namespace!==r}return!0}function W(e,t,n){e.push(" ",t,'="',n.replace(/[<&"]/g,b),'"')}function G(e,t,n,i,r){if(r||(r=[]),i){if(!(e=i(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case Z:var a=e.attributes,s=a.length,o=e.firstChild,u=e.tagName;n=$.isHTML(e.namespaceURI)||n;var l=u;if(!n&&!e.prefix&&e.namespaceURI){for(var c,d=0;d<a.length;d++)if("xmlns"===a.item(d).name){c=a.item(d).value;break}if(!c)for(var h=r.length-1;h>=0;h--){var p=r[h];if(""===p.prefix&&p.namespace===e.namespaceURI){c=p.namespace;break}}if(c!==e.namespaceURI)for(var h=r.length-1;h>=0;h--){var p=r[h];if(p.namespace===e.namespaceURI){p.prefix&&(l=p.prefix+":"+u);break}}}t.push("<",l);for(var f=0;f<s;f++){var m=a.item(f);"xmlns"==m.prefix?r.push({prefix:m.localName,namespace:m.value}):"xmlns"==m.nodeName&&r.push({prefix:"",namespace:m.value})}for(var f=0;f<s;f++){var m=a.item(f);if(V(m,n,r)){var g=m.prefix||"",y=m.namespaceURI;W(t,g?"xmlns:"+g:"xmlns",y),r.push({prefix:g,namespace:y})}G(m,t,n,i,r)}if(u===l&&V(e,n,r)){var g=e.prefix||"",y=e.namespaceURI;W(t,g?"xmlns:"+g:"xmlns",y),r.push({prefix:g,namespace:y})}if(o||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(t.push(">"),n&&/^script$/i.test(u))for(;o;)o.data?t.push(o.data):G(o,t,n,i,r.slice()),o=o.nextSibling;else for(;o;)G(o,t,n,i,r.slice()),o=o.nextSibling;t.push("</",l,">")}else t.push("/>");return;case oe:case le:for(var o=e.firstChild;o;)G(o,t,n,i,r.slice()),o=o.nextSibling;return;case ee:return W(t,e.name,e.value);case te:return t.push(e.data.replace(/[<&]/g,b).replace(/]]>/g,"]]&gt;"));case ne:return t.push("<![CDATA[",e.data,"]]>");case se:return t.push("\x3c!--",e.data,"--\x3e");case ue:var v=e.publicId,_=e.systemId;if(t.push("<!DOCTYPE ",e.name),v)t.push(" PUBLIC ",v),_&&"."!=_&&t.push(" ",_),t.push(">");else if(_&&"."!=_)t.push(" SYSTEM ",_,">");else{var T=e.internalSubset;T&&t.push(" [",T,"]"),t.push(">")}return;case ae:return t.push("<?",e.target," ",e.data,"?>");case ie:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function z(e,t,n){var i;switch(t.nodeType){case Z:i=t.cloneNode(!1),i.ownerDocument=e;case le:break;case ee:n=!0}if(i||(i=t.cloneNode(!1)),i.ownerDocument=e,i.parentNode=null,n)for(var r=t.firstChild;r;)i.appendChild(z(e,r,n)),r=r.nextSibling;return i}function X(e,t,n){var i=new t.constructor;for(var r in t){var a=t[r];"object"!=typeof a&&a!=i[r]&&(i[r]=a)}switch(t.childNodes&&(i.childNodes=new d),i.ownerDocument=e,i.nodeType){case Z:var s=t.attributes,o=i.attributes=new f,u=s.length;o._ownerElement=i;for(var l=0;l<u;l++)i.setAttributeNode(X(e,s.item(l),!0));break;case ee:n=!0}if(n)for(var c=t.firstChild;c;)i.appendChild(X(e,c,n)),c=c.nextSibling;return i}function Y(e,t,n){e[t]=n}function K(e){switch(e.nodeType){case Z:case le:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(K(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}var Q=n(4),$=Q.NAMESPACE,J={},Z=J.ELEMENT_NODE=1,ee=J.ATTRIBUTE_NODE=2,te=J.TEXT_NODE=3,ne=J.CDATA_SECTION_NODE=4,ie=J.ENTITY_REFERENCE_NODE=5,re=J.ENTITY_NODE=6,ae=J.PROCESSING_INSTRUCTION_NODE=7,se=J.COMMENT_NODE=8,oe=J.DOCUMENT_NODE=9,ue=J.DOCUMENT_TYPE_NODE=10,le=J.DOCUMENT_FRAGMENT_NODE=11,ce=J.NOTATION_NODE=12,de={},he={},pe=(de.INDEX_SIZE_ERR=(he[1]="Index size error",1),de.DOMSTRING_SIZE_ERR=(he[2]="DOMString size error",2),de.HIERARCHY_REQUEST_ERR=(he[3]="Hierarchy request error",3)),fe=(de.WRONG_DOCUMENT_ERR=(he[4]="Wrong document",4),de.INVALID_CHARACTER_ERR=(he[5]="Invalid character",5),de.NO_DATA_ALLOWED_ERR=(he[6]="No data allowed",6),de.NO_MODIFICATION_ALLOWED_ERR=(he[7]="No modification allowed",7),de.NOT_FOUND_ERR=(he[8]="Not found",8)),me=(de.NOT_SUPPORTED_ERR=(he[9]="Not supported",9),de.INUSE_ATTRIBUTE_ERR=(he[10]="Attribute in use",10));de.INVALID_STATE_ERR=(he[11]="Invalid state",11),de.SYNTAX_ERR=(he[12]="Syntax error",12),de.INVALID_MODIFICATION_ERR=(he[13]="Invalid modification",13),de.NAMESPACE_ERR=(he[14]="Invalid namespace",14),de.INVALID_ACCESS_ERR=(he[15]="Invalid access",15);c.prototype=Error.prototype,u(de,c),d.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var n=[],i=0;i<this.length;i++)G(this[i],n,e,t);return n.join("")}},h.prototype.item=function(e){return p(this),this[e]},l(h,d),f.prototype={length:0,item:d.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 c(me);var n=this.getNamedItem(e.nodeName);return g(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t,n=e.ownerElement;if(n&&n!=this._ownerElement)throw new c(me);return t=this.getNamedItemNS(e.namespaceURI,e.localName),g(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return y(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return y(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var i=this[n];if(i.localName==t&&i.namespaceURI==e)return i}return null}},v.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var i=new S;if(i.implementation=this,i.childNodes=new d,i.doctype=n||null,n&&i.appendChild(n),t){var r=i.createElementNS(e,t);i.appendChild(r)}return i},createDocumentType:function(e,t,n){var i=new M;return i.name=e,i.nodeName=e,i.publicId=t||"",i.systemId=n||"",i}},_.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 A(this,e,t)},replaceChild:function(e,t){this.insertBefore(e,t),t&&this.removeChild(t)},removeChild:function(e){return C(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return X(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==te&&e.nodeType==te?(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 i in n)if(n[i]==e)return i;t=t.nodeType==ee?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==ee?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},u(J,_),u(J,_.prototype),S.prototype={nodeName:"#document",nodeType:oe,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==le){for(var n=e.firstChild;n;){var i=n.nextSibling;this.insertBefore(n,t),n=i}return e}return null==this.documentElement&&e.nodeType==Z&&(this.documentElement=e),A(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),C(this,e)},importNode:function(e,t){return z(this,e,t)},getElementById:function(e){var t=null;return T(this.documentElement,function(n){if(n.nodeType==Z&&n.getAttribute("id")==e)return t=n,!0}),t},getElementsByClassName:function(e){var t=s(e);return new h(this,function(n){var i=[];return t.length>0&&T(n.documentElement,function(r){if(r!==n&&r.nodeType===Z){var a=r.getAttribute("class");if(a){var u=e===a;if(!u){var l=s(a);u=t.every(o(l))}u&&i.push(r)}}}),i})},createElement:function(e){var t=new x;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new d,(t.attributes=new f)._ownerElement=t,t},createDocumentFragment:function(){var e=new j;return e.ownerDocument=this,e.childNodes=new d,e},createTextNode:function(e){var t=new L;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new D;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new R;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new F;return n.ownerDocument=this,n.tagName=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 B;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new x,i=t.split(":"),r=n.attributes=new f;return n.childNodes=new d,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,r._ownerElement=n,n},createAttributeNS:function(e,t){var n=new P,i=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,n}},l(S,_),x.prototype={nodeType:Z,hasAttribute:function(e){return null!=this.getAttributeNode(e)},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===le?this.insertBefore(e,null):I(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 null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var i=this.ownerDocument.createAttributeNS(e,t);i.value=i.nodeValue=""+n,this.setAttributeNode(i)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new h(this,function(t){var n=[];return T(t,function(i){i===t||i.nodeType!=Z||"*"!==e&&i.tagName!=e||n.push(i)}),n})},getElementsByTagNameNS:function(e,t){return new h(this,function(n){var i=[];return T(n,function(r){r===n||r.nodeType!==Z||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||i.push(r)}),i})}},S.prototype.getElementsByTagName=x.prototype.getElementsByTagName,S.prototype.getElementsByTagNameNS=x.prototype.getElementsByTagNameNS,l(x,_),P.prototype.nodeType=ee,l(P,_),O.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 new Error(he[pe])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},l(O,_),L.prototype={nodeName:"#text",nodeType:te,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 i=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},l(L,O),D.prototype={nodeName:"#comment",nodeType:se},l(D,O),R.prototype={nodeName:"#cdata-section",nodeType:ne},l(R,O),M.prototype.nodeType=ue,l(M,_),N.prototype.nodeType=ce,l(N,_),U.prototype.nodeType=re,l(U,_),B.prototype.nodeType=ie,l(B,_),j.prototype.nodeName="#document-fragment",j.prototype.nodeType=le,l(j,_),F.prototype.nodeType=ae,l(F,_),H.prototype.serializeToString=function(e,t,n){return q.call(e,t,n)},_.prototype.toString=q;try{Object.defineProperty&&(Object.defineProperty(h.prototype,"length",{get:function(){return p(this),this.$$length}}),Object.defineProperty(_.prototype,"textContent",{get:function(){return K(this)},set:function(e){switch(this.nodeType){case Z:case le: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}}}),Y=function(e,t,n){e["$$"+t]=n})}catch(e){}t.DocumentType=M,t.DOMException=c,t.DOMImplementation=v,t.Element=x,t.Node=_,t.NodeList=d,t.XMLSerializer=H},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(3),r=Object(i.k)([73,68,51]),a=function(e,t){void 0===t&&(t=0),e=Object(i.k)(e);var n=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&n)>>4?r+20:r+10},s=function e(t,n){return void 0===n&&(n=0),t=Object(i.k)(t),t.length-n<10||!Object(i.a)(t,r,{offset:n})?n:(n+=a(t,n),e(t,n))}},function(e,t,n){"use strict";function i(){var e=new Date;return(e.getHours()>=10?e.getHours():"0"+e.getHours())+":"+(e.getMinutes()>=10?e.getMinutes():"0"+e.getMinutes())}function r(e,t){Object.keys(t).forEach(function(n){t.hasOwnProperty(n)&&(e[n]=t[n])})}function a(){return!!navigator.userAgent.toLowerCase().match(/rv:([\d.]+)\) like gecko/)}function s(){return-1!==navigator.userAgent.indexOf("Windows NT 6.1")}function o(e){setTimeout(function(){e.controlBar.setAttribute("tabindex","0"),e.controlBar.el_.focus()})}Object.defineProperty(t,"__esModule",{value:!0}),t.getTime=i,t.assign=r,t.isIE11=a,t.isWin7=s,t.setControlBarFocus=o},function(e,t,n){e.exports=n(16)},function(e,t,n){"use strict";(function(t){function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}function a(e,t,n){var i=t.title,a=t.logo,o=t.loadingLogo,c=t.spriteThumbnails,p=t.markers,f=t.resources,m=t.flashUrl,g=t.rateChangeTip,y=t.supportTip,v=t.forcePlaybackRates,_=t.hotKeysOptions,b=void 0===_?{}:_,T=r(t,["title","logo","loadingLogo","spriteThumbnails","markers","resources","flashUrl","rateChangeTip","supportTip","forcePlaybackRates","hotKeysOptions"]),S=null;u.default.options.flash.swf=m||"//gcdncs.101.com/v0.1/static/fish/videoplayer/video-js.swf",h&&!v&&delete T.playbackRates;var E=(0,u.default)(e,s({},T));h&&0===E.audioTracks().length&&E.controlBar.audioTrackButton.el_&&(E.controlBar.audioTrackButton.el_.style.display="none");var w=function(e){if("Flash"===E.tech().name_&&T.flash&&T.flash.hls&&T.flash.hls.keyCallback){E.createModal("Flash \u6682\u4e0d\u652f\u6301\u81ea\u5b9a\u4e49\u4f20 key \u89e3\u5bc6\u6d41\u7a0b",{uncloseable:!0}).addClass("vjs-flash-error-modal")}if(f&&E.updateSrc(f),(h&&(0,l.isWin7)()||"Flash"===E.tech().name_)&&E.src().indexOf(".m3u8")>=0){var t=u.default.dom.createEl("div");t.innerHTML=y||'\n \u5f53\u524d\u6d4f\u89c8\u5668\u7248\u672c\u5df2\u7ecf\u8fc7\u65f6\uff0c\u53ef\u80fd\u5bfc\u81f4\u64ad\u653e\u9519\u8bef\u3002\u4e3a\u63d0\u5347\u60a8\u7684\u89c2\u770b\u4f53\u9a8c\u8bf7<a href="//gcdncs.101.com/v0.1/static/update/index.html">\n \u70b9\u51fb\u5347\u7ea7\u6d4f\u89c8\u5668\u6765\u83b7\u5f97\u66f4\u597d\u7684\u4f53\u9a8c</a> \u6216\u5207\u6362\u6d4f\u89c8\u5668\u6a21\u5f0f';return void E.createModal(t).addClass("vjs-flash-upgrade-modal")}if(E.isAudio()&&!E.poster()){var r=d.default.audioBg(E);E.paused()&&r.addClass("hide-audio-background"),E.on("pause",function(){r.addClass("hide-audio-background")}),E.on("play",function(){r.removeClass("hide-audio-background")}),E.on("click",function(e){e.target.className.indexOf("vjs-audio")>-1&&(E.paused()?E.play():E.pause())})}a&&d.default.logo(E,a),i&&d.default.title(E,i),d.default.topControl(E),E.on("fullscreenchange",function(){E.isFullscreen()||(E.removeClass("vjs-fullscreen-middle"),E.removeClass("vjs-fullscreen-small"))});var o=!1;E.on("ratechange",function(){g&&d.default.playbackRateTip(E,g,!o),o=!1,(0,l.setControlBarFocus)(E)}),E.on("resolutionchange",function(){if(o=!0,(0,l.setControlBarFocus)(E),E.paused()){var e=E.play();void 0!==e&&e.then(function(e){E.pause()}).catch(function(){})}}),E.hotkeys(s({enableVolumeScroll:!1},b)),c&&E.spriteThumbnails(c),p&&E.markers(p),n&&n(e)};return E.on("ready",function(e){o?(d.default.frontLoading(E,o.url),E.pause(),S=setTimeout(function(){E.removeChild("FrontLoading"),T.autoplay&&E.autoplay("play"),w(e)},o.time)):w(e)}),E.on("dispose",function(){clearTimeout(S)}),E}var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},o=n(0),u=i(o);n(31),n(33),n(52),n(53),n(54),n(55),n(56),n(57),n(58);var l=n(14),c=n(59),d=i(c);n(60);var h=(0,l.isIE11)();(0,l.assign)(a,u.default),t.videojs=u.default,e.exports=a}).call(t,n(2))},function(e,t,n){(function(t){var n;n="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=n}).call(t,n(2))},function(e,t,n){(function(t){var i,r=void 0!==t?t:"undefined"!=typeof window?window:{},a=n(19);"undefined"!=typeof document?i=document:(i=r["__GLOBAL_DOCUMENT_CACHE@4"])||(i=r["__GLOBAL_DOCUMENT_CACHE@4"]=a),e.exports=i}).call(t,n(2))},function(e,t){},function(e,t){function n(e){return e.replace(/\n\r?\s*/g,"")}e.exports=function(e){for(var t="",i=0;i<arguments.length;i++)t+=n(e[i])+(arguments[i+1]||"");return t}},function(e,t){function n(e,t){var n,i=null;try{n=JSON.parse(e,t)}catch(e){i=e}return[i,n]}e.exports=n},function(e,t,n){"use strict";function i(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function r(e,t,n){var i=e;return c(t)?(n=t,"string"==typeof e&&(i={uri:e})):i=h(t,{uri:e}),i.callback=n,i}function a(e,t,n){return t=r(e,t,n),s(t)}function s(e){function t(){4===c.readyState&&setTimeout(s,0)}function n(){var e=void 0;if(e=c.response?c.response:c.responseText||o(c),b)try{e=JSON.parse(e)}catch(e){}return e}function r(e){return clearTimeout(f),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,l(e,T)}function s(){if(!p){var t;clearTimeout(f),t=e.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var i=T,r=null;return 0!==t?(i={body:n(),statusCode:t,method:g,headers:{},url:m,rawRequest:c},c.getAllResponseHeaders&&(i.headers=d(c.getAllResponseHeaders()))):r=new Error("Internal XMLHttpRequest Error"),l(r,i,i.body)}}if(void 0===e.callback)throw new Error("callback argument missing");var u=!1,l=function(t,n,i){u||(u=!0,e.callback(t,n,i))},c=e.xhr||null;c||(c=e.cors||e.useXDR?new a.XDomainRequest:new a.XMLHttpRequest);var h,p,f,m=c.url=e.uri||e.url,g=c.method=e.method||"GET",y=e.body||e.data,v=c.headers=e.headers||{},_=!!e.sync,b=!1,T={body:void 0,headers:{},statusCode:0,method:g,url:m,rawRequest:c};if("json"in e&&!1!==e.json&&(b=!0,v.accept||v.Accept||(v.Accept="application/json"),"GET"!==g&&"HEAD"!==g&&(v["content-type"]||v["Content-Type"]||(v["Content-Type"]="application/json"),y=JSON.stringify(!0===e.json?y:e.json))),c.onreadystatechange=t,c.onload=s,c.onerror=r,c.onprogress=function(){},c.onabort=function(){p=!0},c.ontimeout=r,c.open(g,m,!_,e.username,e.password),_||(c.withCredentials=!!e.withCredentials),!_&&e.timeout>0&&(f=setTimeout(function(){if(!p){p=!0,c.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}},e.timeout)),c.setRequestHeader)for(h in v)v.hasOwnProperty(h)&&c.setRequestHeader(h,v[h]);else if(e.headers&&!i(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(c.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(c),c.send(y||null),c}function o(e){if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;return""!==e.responseType||t?null:e.responseXML}function u(){}var l=n(23),c=n(24),d=n(25),h=n(26);e.exports=a,a.XMLHttpRequest=l.XMLHttpRequest||u,a.XDomainRequest="withCredentials"in new a.XMLHttpRequest?a.XMLHttpRequest:l.XDomainRequest,function(e,t){for(var n=0;n<e.length;n++)t(e[n])}(["get","put","post","patch","head","delete"],function(e){a["delete"===e?"del":e]=function(t,n,i){return n=r(t,n,i),n.method=e.toUpperCase(),s(n)}})},function(e,t,n){(function(t){var n;n="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=n}).call(t,n(2))},function(e,t){function n(e){if(!e)return!1;var t=i.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}e.exports=n;var i=Object.prototype.toString},function(e,t){var n=function(e){return e.replace(/^\s+|\s+$/g,"")},i=function(e){return"[object Array]"===Object.prototype.toString.call(e)};e.exports=function(e){if(!e)return{};for(var t={},r=n(e).split("\n"),a=0;a<r.length;a++){var s=r[a],o=s.indexOf(":"),u=n(s.slice(0,o)).toLowerCase(),l=n(s.slice(o+1));void 0===t[u]?t[u]=l:i(t[u])?t[u].push(l):t[u]=[t[u],l]}return t}},function(e,t){function n(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)i.call(n,r)&&(e[r]=n[r])}return e}e.exports=n;var i=Object.prototype.hasOwnProperty},function(e,t,n){var i=n(1),r=e.exports={WebVTT:n(28),VTTCue:n(29),VTTRegion:n(30)};i.vttjs=r,i.WebVTT=r.WebVTT;var a=r.VTTCue,s=r.VTTRegion,o=i.VTTCue,u=i.VTTRegion;r.shim=function(){i.VTTCue=a,i.VTTRegion=s},r.restore=function(){i.VTTCue=o,i.VTTRegion=u},i.VTTCue||r.shim()},function(e,t){function n(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function i(e){function t(e,t,n,i){return 3600*(0|e)+60*(0|t)+(0|n)+(0|i)/1e3}var n=e.match(/^(\d+):(\d{2})(:\d{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 r(){this.values=g(null)}function a(e,t,n,i){var r=i?e.split(i):[e];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(n);if(2===s.length){var o=s[0],u=s[1];t(o,u)}}}function s(e,t,s){function o(){var t=i(e);if(null===t)throw new n(n.Errors.BadTimeStamp,"Malformed timestamp: "+l);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function u(){e=e.replace(/^\s+/,"")}var l=e;if(u(),t.startTime=o(),u(),"--\x3e"!==e.substr(0,3))throw new n(n.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+l);e=e.substr(3),u(),t.endTime=o(),u(),function(e,t){var n=new r;a(e,function(e,t){switch(e){case"region":for(var i=s.length-1;i>=0;i--)if(s[i].id===t){n.set(e,s[i].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var r=t.split(","),a=r[0];n.integer(e,a),n.percent(e,a)&&n.set("snapToLines",!1),n.alt(e,a,["auto"]),2===r.length&&n.alt("lineAlign",r[1],["start","middle","end"]);break;case"position":r=t.split(","),n.percent(e,r[0]),2===r.length&&n.alt("positionAlign",r[1],["start","middle","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","middle","end","left","right"])}},/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical",""),t.line=n.get("line","auto"),t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100),t.align=n.get("align","middle"),t.position=n.get("position",{start:0,left:0,middle:50,end:100,right:100},t.align),t.positionAlign=n.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},t.align)}(e,t)}function o(e,t){function n(e){return y[e]}for(var r,a=e.document.createElement("div"),s=a,o=[];null!==(r=function(){if(!t)return null;var e=t.match(/^([^<]*)(<[^>]*>?)?/);return function(e){return t=t.substr(e.length),e}(e[1]?e[1]:e[2])}());)if("<"!==r[0])s.appendChild(e.document.createTextNode(function(e){for(;c=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)e=e.replace(c[0],n);return e}(r)));else{if("/"===r[1]){o.length&&o[o.length-1]===r.substr(2).replace(">","")&&(o.pop(),s=s.parentNode);continue}var u,l=i(r.substr(1,r.length-2));if(l){u=e.document.createProcessingInstruction("timestamp",l),s.appendChild(u);continue}var c=r.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!c)continue;if(!(u=function(t,n){var i=v[t];if(!i)return null;var r=e.document.createElement(i);r.localName=i;var a=_[t];return a&&n&&(r[a]=n.trim()),r}(c[1],c[3])))continue;if(!function(e,t){return!b[t.localName]||b[t.localName]===e.localName}(s,u))continue;c[2]&&(u.className=c[2].substr(1).replace("."," ")),o.push(c[1]),s.appendChild(u),s=u}return a}function u(e){for(var t=0;t<T.length;t++){var n=T[t];if(e>=n[0]&&e<=n[1])return!0}return!1}function l(e){function t(e,t){for(var n=t.childNodes.length-1;n>=0;n--)e.push(t.childNodes[n])}function n(e){if(!e||!e.length)return null;var i=e.pop(),r=i.textContent||i.innerText;if(r){var a=r.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):r}return"ruby"===i.tagName?n(e):i.childNodes?(t(e,i),n(e)):void 0}var i,r=[],a="";if(!e||!e.childNodes)return"ltr";for(t(r,e);a=n(r);)for(var s=0;s<a.length;s++)if(i=a.charCodeAt(s),u(i))return"rtl";return"ltr"}function c(e){if("number"==typeof e.line&&(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,i=0,r=0;r<n.length&&n[r]!==t;r++)"showing"===n[r].mode&&i++;return-1*++i}function d(){}function h(e,t,n){var i=/MSIE\s8\.0/.test(navigator.userAgent),r="rgba(255, 255, 255, 1)",a="rgba(0, 0, 0, 0.8)";i&&(r="rgb(255, 255, 255)",a="rgb(0, 0, 0)"),d.call(this),this.cue=t,this.cueDiv=o(e,t.text);var s={color:r,backgroundColor:a,position:"relative",left:0,right:0,top:0,bottom:0,display:"inline"};i||(s.writingMode=""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",s.unicodeBidi="plaintext"),this.applyStyles(s,this.cueDiv),this.div=e.document.createElement("div"),s={textAlign:"middle"===t.align?"center":t.align,font:n.font,whiteSpace:"pre-line",position:"absolute"},i||(s.direction=l(this.cueDiv),s.writingMode=""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl".stylesunicodeBidi="plaintext"),this.applyStyles(s),this.div.appendChild(this.cueDiv);var u=0;switch(t.positionAlign){case"start":u=t.position;break;case"middle":u=t.position-t.size/2;break;case"end":u=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(u,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(u,"%"),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")})}}function p(e){var t,n,i,r,a=/MSIE\s8\.0/.test(navigator.userAgent);if(e.div){n=e.div.offsetHeight,i=e.div.offsetWidth,r=e.div.offsetTop;var s=(s=e.div.childNodes)&&(s=s[0])&&s.getClientRects&&s.getClientRects();e=e.div.getBoundingClientRect(),t=s?Math.max(s[0]&&s[0].height||0,e.height/s.length):0}this.left=e.left,this.right=e.right,this.top=e.top||r,this.height=e.height||n,this.bottom=e.bottom||r+(e.height||n),this.width=e.width||i,this.lineHeight=void 0!==t?t:e.lineHeight,a&&!this.lineHeight&&(this.lineHeight=13)}function f(e,t,n,i){var r=new p(t),a=t.cue,s=c(a),o=[];if(a.snapToLines){var u;switch(a.vertical){case"":o=["+y","-y"],u="height";break;case"rl":o=["+x","-x"],u="width";break;case"lr":o=["-x","+x"],u="width"}var l=r.lineHeight,d=l*Math.round(s),h=n[u]+l,f=o[0];Math.abs(d)>h&&(d=d<0?-1:1,d*=Math.ceil(h/l)*l),s<0&&(d+=""===a.vertical?n.height:n.width,o=o.reverse()),r.move(f,d)}else{var m=r.lineHeight/n.height*100;switch(a.lineAlign){case"middle":s-=m/2;break;case"end":s-=m}switch(a.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,"%")})}o=["+y","-x","+x","-y"],r=new p(t)}var g=function(e,t){for(var r,a=new p(e),s=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(n,t[o])||e.within(n)&&e.overlapsAny(i);)e.move(t[o]);if(e.within(n))return e;var u=e.intersectPercentage(n);s>u&&(r=new p(e),s=u),e=new p(a)}return r||a}(r,o);t.move(g.toCSSCompatValues(n))}function m(){}var g=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();n.prototype=g(Error.prototype),n.prototype.constructor=n,n.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},r.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 i=0;i<n.length;++i)if(t===n[i]){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))>=0&&t<=100)&&(this.set(e,t),!0)}};var y={"&amp;":"&","&lt;":"<","&gt;":">","&lrm;":"\u200e","&rlm;":"\u200f","&nbsp;":"\xa0"},v={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},_={v:"title",lang:"lang"},b={rt:"ruby"},T=[[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]];d.prototype.applyStyles=function(e,t){t=t||this.div;for(var n in e)e.hasOwnProperty(n)&&(t.style[n]=e[n])},d.prototype.formatStyle=function(e,t){return 0===e?0:e+t},h.prototype=g(d.prototype),h.prototype.constructor=h,p.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,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}},p.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},p.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},p.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},p.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}},p.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)},p.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}},p.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,i=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||i,height:e.height||t,bottom:e.bottom||i+(e.height||t),width:e.width||n}},m.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},m.convertCueToDOMTree=function(e,t){return e&&t?o(e,t):null};m.processCues=function(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var i=e.document.createElement("div");if(i.style.position="absolute",i.style.left="0",i.style.right="0",i.style.top="0",i.style.bottom="0",i.style.margin="1.5%",n.appendChild(i),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var r=[],a=p.getSimpleBoxPosition(i),s=Math.round(.05*a.height*100)/100,o={font:s+"px sans-serif"};!function(){for(var n,s,u=0;u<t.length;u++)s=t[u],n=new h(e,s,o),i.appendChild(n.div),f(e,n,a,r),s.displayState=n.div,r.push(p.getSimpleBoxPosition(n))}()}else for(var u=0;u<t.length;u++)i.appendChild(t[u].displayState)},m.Parser=function(e,t,n){n||(n=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=n||new TextDecoder("utf8"),this.regionList=[]},m.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof n))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){function t(){for(var e=l.buffer,t=0;t<e.length&&"\r"!==e[t]&&"\n"!==e[t];)++t;var n=e.substr(0,t);return"\r"===e[t]&&++t,"\n"===e[t]&&++t,l.buffer=e.substr(t),n}function o(e){var t=new r;if(a(e,function(e,n){switch(e){case"id":t.set(e,n);break;case"width":t.percent(e,n);break;case"lines":t.integer(e,n);break;case"regionanchor":case"viewportanchor":var i=n.split(",");if(2!==i.length)break;var a=new r;if(a.percent("x",i[0]),a.percent("y",i[1]),!a.has("x")||!a.has("y"))break;t.set(e+"X",a.get("x")),t.set(e+"Y",a.get("y"));break;case"scroll":t.alt(e,n,["up"])}},/=/,/\s/),t.has("id")){var n=new(l.vttjs.VTTRegion||l.window.VTTRegion);n.width=t.get("width",100),n.lines=t.get("lines",3),n.regionAnchorX=t.get("regionanchorX",0),n.regionAnchorY=t.get("regionanchorY",100),n.viewportAnchorX=t.get("viewportanchorX",0),n.viewportAnchorY=t.get("viewportanchorY",100),n.scroll=t.get("scroll",""),l.onregion&&l.onregion(n),l.regionList.push({id:t.get("id"),region:n})}}function u(e){var t=new r;a(e,function(e,n){switch(e){case"MPEGT":t.integer(e+"S",n);break;case"LOCA":t.set(e+"L",i(n))}},/[^\d]:/,/,/),l.ontimestampmap&&l.ontimestampmap({MPEGTS:t.get("MPEGTS"),LOCAL:t.get("LOCAL")})}var l=this;e&&(l.buffer+=l.decoder.decode(e,{stream:!0}));try{var c;if("INITIAL"===l.state){if(!/\r\n|\n/.test(l.buffer))return this;c=t();var d=c.match(/^WEBVTT([ \t].*)?$/);if(!d||!d[0])throw new n(n.Errors.BadSignature);l.state="HEADER"}for(var h=!1;l.buffer;){if(!/\r\n|\n/.test(l.buffer))return this;switch(h?h=!1:c=t(),l.state){case"HEADER":/:/.test(c)?function(e){e.match(/X-TIMESTAMP-MAP/)?a(e,function(e,t){switch(e){case"X-TIMESTAMP-MAP":u(t)}},/=/):a(e,function(e,t){switch(e){case"Region":o(t)}},/:/)}(c):c||(l.state="ID");continue;case"NOTE":c||(l.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(c)){l.state="NOTE";break}if(!c)continue;if(l.cue=new(l.vttjs.VTTCue||l.window.VTTCue)(0,0,""),l.state="CUE",-1===c.indexOf("--\x3e")){l.cue.id=c;continue}case"CUE":try{s(c,l.cue,l.regionList)}catch(e){l.reportOrThrowError(e),l.cue=null,l.state="BADCUE";continue}l.state="CUETEXT";continue;case"CUETEXT":var p=-1!==c.indexOf("--\x3e");if(!c||p&&(h=!0)){l.oncue&&l.oncue(l.cue),l.cue=null,l.state="ID";continue}l.cue.text&&(l.cue.text+="\n"),l.cue.text+=c;continue;case"BADCUE":c||(l.state="ID");continue}}}catch(e){l.reportOrThrowError(e),"CUETEXT"===l.state&&l.cue&&l.oncue&&l.oncue(l.cue),l.cue=null,l.state="INITIAL"===l.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new n(n.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},e.exports=m},function(e,t){function n(e){return"string"==typeof e&&(!!o[e.toLowerCase()]&&e.toLowerCase())}function i(e){return"string"==typeof e&&(!!u[e.toLowerCase()]&&e.toLowerCase())}function r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)e[i]=n[i]}return e}function a(e,t,a){var o=this,u=/MSIE\s8\.0/.test(navigator.userAgent),l={};u?o=document.createElement("custom"):l.enumerable=!0,o.hasBeenReset=!1;var c="",d=!1,h=e,p=t,f=a,m=null,g="",y=!0,v="auto",_="start",b=50,T="middle",S=50,E="middle";if(Object.defineProperty(o,"id",r({},l,{get:function(){return c},set:function(e){c=""+e}})),Object.defineProperty(o,"pauseOnExit",r({},l,{get:function(){return d},set:function(e){d=!!e}})),Object.defineProperty(o,"startTime",r({},l,{get:function(){return h},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");h=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",r({},l,{get:function(){return p},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");p=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",r({},l,{get:function(){return f},set:function(e){f=""+e,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",r({},l,{get:function(){return m},set:function(e){m=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",r({},l,{get:function(){return g},set:function(e){var t=n(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");g=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",r({},l,{get:function(){return y},set:function(e){y=!!e,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",r({},l,{get:function(){return v},set:function(e){if("number"!=typeof e&&e!==s)throw new SyntaxError("An invalid number or illegal string was specified.");v=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",r({},l,{get:function(){return _},set:function(e){var t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",r({},l,{get:function(){return b},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",r({},l,{get:function(){return T},set:function(e){var t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");T=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",r({},l,{get:function(){return S},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");S=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",r({},l,{get:function(){return E},set:function(e){var t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");E=t,this.hasBeenReset=!0}})),o.displayState=void 0,u)return o}var s="auto",o={"":!0,lr:!0,rl:!0},u={start:!0,middle:!0,end:!0,left:!0,right:!0};a.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=a},function(e,t){function n(e){return"string"==typeof e&&(!!a[e.toLowerCase()]&&e.toLowerCase())}function i(e){return"number"==typeof e&&e>=0&&e<=100}function r(){var e=100,t=3,r=0,a=100,s=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!i(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!i(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e}},regionAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!i(e))throw new Error("RegionAnchorY must be between 0 and 100.");r=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!i(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!i(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var t=n(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");u=t}}})}var a={"":!0,up:!0};e.exports=r},function(e,t,n){"use strict";function i(e){T[e]=function(){return this.el_.vjs_getProperty(e)}}Object.defineProperty(t,"__esModule",{value:!0});for(var r=n(0),a=n.n(r),s=n(32),o=(n.n(s),n(1)),u=n.n(o),l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},c=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},d=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},h=a.a.getComponent("Tech"),p=a.a.dom,f=a.a.url,m=a.a.createTimeRange,g=a.a.mergeOptions,y=u.a&&u.a.navigator||{},v=function(e){function t(n,i){l(this,t);var r=d(this,e.call(this,n,i));return n.source&&r.ready(function(){this.setSource(n.source)},!0),n.startTime&&r.ready(function(){this.load(),this.play(),this.currentTime(n.startTime)},!0),u.a.videojs=u.a.videojs||{},u.a.videojs.Flash=u.a.videojs.Flash||{},u.a.videojs.Flash.onReady=t.onReady,u.a.videojs.Flash.onEvent=t.onEvent,u.a.videojs.Flash.onError=t.onError,r.on("seeked",function(){this.lastSeekTarget_=void 0}),r}return c(t,e),t.prototype.createEl=function(){var e=this.options_;e.swf||(e.swf="https://vjs.zencdn.net/swf/"+s.version+"/video-js.swf");var n=e.techId,i=g({readyFunction:"videojs.Flash.onReady",eventProxyFunction:"videojs.Flash.onEvent",errorEventProxyFunction:"videojs.Flash.onError",autoplay:e.autoplay,preload:e.preload,loop:e.loop,muted:e.muted},e.flashVars),r=g({wmode:"opaque",bgcolor:"#000000"},e.params),a=g({id:n,name:n,class:"vjs-tech"},e.attributes);return this.el_=t.embed(e.swf,i,r,a),this.el_.tech=this,this.el_},t.prototype.play=function(){this.ended()&&this.setCurrentTime(0),this.el_.vjs_play()},t.prototype.pause=function(){this.el_.vjs_pause()},t.prototype.src=function(e){return void 0===e?this.currentSrc():this.setSrc(e)},t.prototype.setSrc=function(e){var t=this;e=f.getAbsoluteURL(e),this.el_.vjs_src(e),this.autoplay()&&this.setTimeout(function(){return t.play()},0)},t.prototype.seeking=function(){return void 0!==this.lastSeekTarget_},t.prototype.setCurrentTime=function(t){var n=this.seekable();n.length&&(t=t>n.start(0)?t:n.start(0),t=t<n.end(n.length-1)?t:n.end(n.length-1),this.lastSeekTarget_=t,this.trigger("seeking"),this.el_.vjs_setProperty("currentTime",t),e.prototype.setCurrentTime.call(this))},t.prototype.currentTime=function(){return this.seeking()?this.lastSeekTarget_||0:this.el_.vjs_getProperty("currentTime")},t.prototype.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.vjs_getProperty("currentSrc")},t.prototype.duration=function(){if(0===this.readyState())return NaN;var e=this.el_.vjs_getProperty("duration");return e>=0?e:1/0},t.prototype.load=function(){this.el_.vjs_load()},t.prototype.poster=function(){this.el_.vjs_getProperty("poster")},t.prototype.setPoster=function(){},t.prototype.seekable=function(){var e=this.duration();return 0===e?m():m(0,e)},t.prototype.buffered=function(){var e=this.el_.vjs_getProperty("buffered");return 0===e.length?m():m(e[0][0],e[0][1])},t.prototype.supportsFullScreen=function(){return!1},t.prototype.enterFullScreen=function(){return!1},t.prototype.getVideoPlaybackQuality=function(){var e=this.el_.vjs_getProperty("getVideoPlaybackQuality");return u.a.performance&&"function"==typeof u.a.performance.now?e.creationTime=u.a.performance.now():u.a.performance&&u.a.performance.timing&&"number"==typeof u.a.performance.timing.navigationStart&&(e.creationTime=u.a.Date.now()-u.a.performance.timing.navigationStart),e},t}(h),_=["rtmpConnection","rtmpStream","preload","defaultPlaybackRate","playbackRate","autoplay","loop","controls","volume","muted","defaultMuted"],b=["networkState","readyState","initialTime","startOffsetTime","paused","ended","videoWidth","videoHeight"],T=v.prototype,S=0;S<_.length;S++)i(_[S]),function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);T["set"+t]=function(t){return this.el_.vjs_setProperty(e,t)}}(_[S]);for(var E=0;E<b.length;E++)i(b[E]);v.isSupported=function(){return!((!a.a.browser.IS_CHROME||a.a.browser.IS_ANDROID&&a.a.browser.IS_IOS)&&(!a.a.browser.IS_SAFARI||a.a.browser.IS_IOS)&&!a.a.browser.IS_EDGE)||v.version()[0]>=10},h.withSourceHandlers(v),v.nativeSourceHandler={},v.nativeSourceHandler.canPlayType=function(e){return e in v.formats?"maybe":""},v.nativeSourceHandler.canHandleSource=function(e,t){var n=void 0;return n=e.type?e.type.replace(/;.*/,"").toLowerCase():function(e){var t=f.getFileExtension(e);return t?"video/"+t:""}(e.src),v.nativeSourceHandler.canPlayType(n)},v.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},v.nativeSourceHandler.dispose=function(){},v.registerSourceHandler(v.nativeSourceHandler),v.formats={"video/flv":"FLV","video/x-flv":"FLV","video/mp4":"MP4","video/m4v":"MP4"},v.onReady=function(e){var t=p.$("#"+e),n=t&&t.tech;n&&n.el()&&v.checkReady(n)},v.checkReady=function(e){e.el()&&(e.el().vjs_getProperty?e.triggerReady():this.setTimeout(function(){v.checkReady(e)},50))},v.onEvent=function(e,t){var n=p.$("#"+e).tech,i=Array.prototype.slice.call(arguments,2);n.setTimeout(function(){n.trigger(t,i)},1)},v.onError=function(e,t){var n=p.$("#"+e).tech;if("srcnotfound"===t)return n.error(4);"string"==typeof t?n.error("FLASH: "+t):(t.origin="flash",n.error(t))},v.version=function(){var e="0,0,0";try{e=new u.a.ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(t){try{y.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(e=(y.plugins["Shockwave Flash 2.0"]||y.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1])}catch(e){}}return e.split(",")},v.embed=function(e,t,n,i){var r=v.getEmbedCode(e,t,n,i);return p.createEl("div",{innerHTML:r}).childNodes[0]},v.getEmbedCode=function(e,t,n,i){var r="",a="",s="";return t&&Object.getOwnPropertyNames(t).forEach(function(e){r+=e+"="+t[e]+"&amp;"}),n=g({movie:e,flashvars:r,allowScriptAccess:"always",allowNetworking:"all"},n),Object.getOwnPropertyNames(n).forEach(function(e){a+='<param name="'+e+'" value="'+n[e]+'" />'}),i=g({data:e,width:"100%",height:"100%"},i),Object.getOwnPropertyNames(i).forEach(function(e){s+=e+'="'+i[e]+'" '}),'<object type="application/x-shockwave-flash" '+s+">"+a+"</object>"},function(e){e.streamingFormats={"rtmp/mp4":"MP4","rtmp/flv":"FLV"},e.streamFromParts=function(e,t){return e+"&"+t},e.streamToParts=function(e){var t={connection:"",stream:""};if(!e)return t;var n=e.search(/&(?![\w-]+=)/),i=void 0;return-1!==n?i=n+1:0===(n=i=e.lastIndexOf("/")+1)&&(n=i=e.length),t.connection=e.substring(0,n),t.stream=e.substring(i,e.length),t},e.isStreamingType=function(t){return t in e.streamingFormats},e.RTMP_RE=/^rtmp[set]?:\/\//i,e.isStreamingSrc=function(t){return e.RTMP_RE.test(t)},e.rtmpSourceHandler={},e.rtmpSourceHandler.canPlayType=function(t){return e.isStreamingType(t)?"maybe":""},e.rtmpSourceHandler.canHandleSource=function(t,n){var i=e.rtmpSourceHandler.canPlayType(t.type);return i||(e.isStreamingSrc(t.src)?"maybe":"")},e.rtmpSourceHandler.handleSource=function(t,n,i){var r=e.streamToParts(t.src);n.setRtmpConnection(r.connection),n.setRtmpStream(r.stream)},e.registerSourceHandler(e.rtmpSourceHandler)}(v),h.getTech("Flash")?(a.a.log.warn("Not using videojs-flash as it appears to already be registered"),a.a.log.warn("videojs-flash should only be used with video.js@6 and above")):a.a.registerTech("Flash",v),v.VERSION="2.2.1",t.default=v},function(e,t){e.exports={_args:[["videojs-swf@5.4.2","C:\\Users\\Jany\\nd-project\\videojs\\videoPlayer"]],_from:"videojs-swf@5.4.2",_id:"videojs-swf@5.4.2",_inBundle:!1,_integrity:"sha1-aWSpv/kDtzLz5GUxSuR4oCoX6Ks=",_location:"/videojs-swf",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"videojs-swf@5.4.2",name:"videojs-swf",escapedName:"videojs-swf",rawSpec:"5.4.2",saveSpec:null,fetchSpec:"5.4.2"},_requiredBy:["/videojs-flash"],_resolved:"http://registry.npm.sdp.nd/videojs-swf/download/videojs-swf-5.4.2.tgz",_spec:"5.4.2",_where:"C:\\Users\\Jany\\nd-project\\videojs\\videoPlayer",author:{name:"Brightcove"},bugs:{url:"https://github.com/videojs/video-js-swf/issues"},copyright:"Copyright 2014 Brightcove, Inc. https://github.com/videojs/video-js-swf/blob/master/LICENSE",description:"The Flash-fallback video player for video.js (http://videojs.com)",devDependencies:{async:"~0.2.9",chg:"^0.3.2","flex-sdk":"4.6.0-0",grunt:"~0.4.0","grunt-bumpup":"~0.5.0","grunt-cli":"~0.1.0","grunt-connect":"~0.2.0","grunt-contrib-jshint":"~0.4.3","grunt-contrib-qunit":"~0.2.1","grunt-contrib-watch":"~0.1.4","grunt-npm":"~0.0.2","grunt-prompt":"~0.1.2","grunt-shell":"~0.6.1","grunt-tagrelease":"~0.3.1",qunitjs:"~1.12.0","video.js":"^5.9.2"},homepage:"http://videojs.com",keywords:["flash","video","player"],name:"videojs-swf",repository:{type:"git",url:"git+https://github.com/videojs/video-js-swf.git"},scripts:{version:"chg release -y && grunt dist && git add -f dist/ && git add CHANGELOG.md"},version:"5.4.2"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){function i(){}n.d(t,"LOCAL_STORAGE_KEY",function(){return Bi}),n.d(t,"Vhs",function(){return Ui}),n.d(t,"VhsHandler",function(){return Ki}),n.d(t,"VhsSourceHandler",function(){return Qi}),n.d(t,"emeKeySystems",function(){return Hi}),n.d(t,"expandDataUri",function(){return Xi}),n.d(t,"getAllPsshKeySystemsOptions",function(){return qi}),n.d(t,"setupEmeOptions",function(){return Wi}),n.d(t,"waitForKeySessionCreation",function(){return Vi});var r=n(5),a=n.n(r),s=n(6),o=n.n(s),u=n(7),l=n.n(u),c=n(1),d=n.n(c),h=n(8),p=n(0),f=n.n(p),m=n(9),g=n.n(m),y=n(37),v=n(42),_=n(11);n.d(t,"simpleTypeFromSourceType",function(){return _.a});var b,T=n(3),S=n(43),E=n(48),w=n.n(E),k=n(13),C=n(50),A=n(51),I=(n.n(A),h.a),x=function(e,t,n){return e&&n&&n.responseURL&&t!==n.responseURL?n.responseURL:t},P=function(e){return f.a.log.debug?f.a.log.debug.bind(f.a,"VHS:",e+" >"):function(){}},O=function(e,t){var n,i=[];if(e&&e.length)for(n=0;n<e.length;n++)t(e.start(n),e.end(n))&&i.push([e.start(n),e.end(n)]);return f.a.createTimeRanges(i)},L=function(e,t){return O(e,function(e,n){return e-.1<=t&&n+.1>=t})},D=function(e,t){return O(e,function(e){return e-1/30>=t})},R=function(e){if(e.length<2)return f.a.createTimeRanges();for(var t=[],n=1;n<e.length;n++){var i=e.end(n-1),r=e.start(n);t.push([i,r])}return f.a.createTimeRanges(t)},M=function(e,t){var n=null,i=null,r=0,a=[],s=[];if(!(e&&e.length&&t&&t.length))return f.a.createTimeRange();for(var o=e.length;o--;)a.push({time:e.start(o),type:"start"}),a.push({time:e.end(o),type:"end"});for(o=t.length;o--;)a.push({time:t.start(o),type:"start"}),a.push({time:t.end(o),type:"end"});for(a.sort(function(e,t){return e.time-t.time}),o=0;o<a.length;o++)"start"===a[o].type?2===++r&&(n=a[o].time):"end"===a[o].type&&1===--r&&(i=a[o].time),null!==n&&null!==i&&(s.push([n,i]),n=null,i=null);return f.a.createTimeRanges(s)},N=function(e){var t=[];if(!e||!e.length)return"";for(var n=0;n<e.length;n++)t.push(e.start(n)+" => "+e.end(n));return t.join(", ")},U=function(e,t,n){return void 0===n&&(n=1),((e.length?e.end(e.length-1):0)-t)/n},B=function(e){for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t},j=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var n=0;n<e.length;n++)if(e.start(n)!==t.start(n)||e.end(n)!==t.end(n))return!0;return!1},F=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},H=function(e,t){var n=0;if(!e||!e.length)return n;for(var i=0;i<e.length;i++){var r=e.start(i),a=e.end(i);t>a||(n+=t>r&&t<=a?a-t:a-r)}return n},q=f.a.createTimeRange,V=function(e,t){if(!t.preload)return t.duration;var n=0;return(t.parts||[]).forEach(function(e){n+=e.duration}),(t.preloadHints||[]).forEach(function(t){"PART"===t.type&&(n+=e.partTargetDuration)}),n},W=function(e){return(e.segments||[]).reduce(function(e,t,n){return t.parts?t.parts.forEach(function(i,r){e.push({duration:i.duration,segmentIndex:n,partIndex:r,part:i,segment:t})}):e.push({duration:t.duration,segmentIndex:n,partIndex:null,segment:t,part:null}),e},[])},G=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},z=function(e){var t=e.preloadSegment;if(t){var n=t.parts,i=t.preloadHints,r=(i||[]).reduce(function(e,t){return e+("PART"===t.type?1:0)},0);return r+=n&&n.length?n.length:0}},X=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var n=G(t).length>0;return n&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:n&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},Y=function(e,t){var n=0,i=t-e.mediaSequence,r=e.segments[i];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;i--;){if(r=e.segments[i],void 0!==r.end)return{result:n+r.end,precise:!0};if(n+=V(e,r),void 0!==r.start)return{result:n+r.start,precise:!0}}return{result:n,precise:!1}},K=function(e,t){for(var n,i=0,r=t-e.mediaSequence;r<e.segments.length;r++){if(n=e.segments[r],void 0!==n.start)return{result:n.start-i,precise:!0};if(i+=V(e,n),void 0!==n.end)return{result:n.end-i,precise:!0}}return{result:-1,precise:!1}},Q=function(e,t,n){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;var i=Y(e,t);if(i.precise)return i.result;var r=K(e,t);return r.precise?r.result:i.result+n},$=function(e,t,n){if(!e)return 0;if("number"!=typeof n&&(n=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return d.a.Infinity}return Q(e,t,n)},J=function(e){var t=e.defaultDuration,n=e.durationList,i=e.startIndex,r=e.endIndex,a=0;if(i>r){var s=[r,i];i=s[0],r=s[1]}if(i<0){for(var o=i;o<Math.min(0,r);o++)a+=t;i=0}for(var u=i;u<r;u++)a+=n[u].duration;return a},Z=function(e,t,n,i){if(!e||!e.segments)return null;if(e.endList)return $(e);if(null===t)return null;t=t||0;var r=Q(e,e.mediaSequence+e.segments.length,t);return n&&(i="number"==typeof i?i:X(null,e),r-=i),Math.max(0,r)},ee=function(e,t,n){var i=t||0,r=Z(e,t,!0,n);return null===r?q():q(i,r)},te=function(e){for(var t=e.playlist,n=e.currentTime,i=e.startingSegmentIndex,r=e.startingPartIndex,a=e.startTime,s=e.experimentalExactManifestTimings,o=n-a,u=W(t),l=0,c=0;c<u.length;c++){var d=u[c];if(i===d.segmentIndex&&("number"!=typeof r||"number"!=typeof d.partIndex||r===d.partIndex)){l=c;break}}if(o<0){if(l>0)for(var h=l-1;h>=0;h--){var p=u[h];if(o+=p.duration,s){if(o<0)continue}else if(o+1/30<=0)continue;return{partIndex:p.partIndex,segmentIndex:p.segmentIndex,startTime:a-J({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:h})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:n}}if(l<0){for(var f=l;f<0;f++)if((o-=t.targetDuration)<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:n};l=0}for(var m=l;m<u.length;m++){var g=u[m];if(o-=g.duration,s){if(o>0)continue}else if(o-1/30>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:a+J({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:m})}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:n}},ne=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},ie=function(e){return e.excludeUntil&&e.excludeUntil===1/0},re=function(e){var t=ne(e);return!e.disabled&&!t},ae=function(e){return e.disabled},se=function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},oe=function(e,t){return t.attributes&&t.attributes[e]},ue=function(e,t,n,i){return void 0===i&&(i=0),oe("BANDWIDTH",n)?(e*n.attributes.BANDWIDTH-8*i)/t:NaN},le=function(e,t){if(1===e.playlists.length)return!0;var n=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(function(e){return!!re(e)&&(e.attributes.BANDWIDTH||0)<n}).length},ce=function(e,t){return!(!e&&!t||!e&&t||e&&!t)&&(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))))},de=function(e,t){var n=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},i=!1;for(var r in n){for(var a in n[r])if(i=t(n[r][a]))break;if(i)break}return!!i},he=function(e){if(!e||!e.playlists||!e.playlists.length){return de(e,function(e){return e.playlists&&e.playlists.length||e.uri})}for(var t=0;t<e.playlists.length;t++){var n=function(t){var n=e.playlists[t],i=n.attributes&&n.attributes.CODECS;return i&&i.split(",").every(function(e){return Object(v.f)(e)})?"continue":de(e,function(e){return ce(n,e)})?"continue":{v:!1}}(t);if("continue"!==n&&"object"==typeof n)return n.v}return!0},pe={liveEdgeDelay:X,duration:$,seekable:ee,getMediaInfoForTime:te,isEnabled:re,isDisabled:ae,isBlacklisted:ne,isIncompatible:ie,playlistEnd:Z,isAes:se,hasAttribute:oe,estimateSegmentRequestTime:ue,isLowestEnabledRendition:le,isAudioOnly:he,playlistMatch:ce,segmentDurationWithParts:V},fe=f.a.log,me=function(e,t){return e+"-"+t},ge=function(e){var t=e.onwarn,n=e.oninfo,i=e.manifestString,r=e.customTagParsers,a=void 0===r?[]:r,s=e.customTagMappers,o=void 0===s?[]:s,u=e.experimentalLLHLS,l=new y.a;t&&l.on("warn",t),n&&l.on("info",n),a.forEach(function(e){return l.addParser(e)}),o.forEach(function(e){return l.addTagMapper(e)}),l.push(i),l.end();var c=l.manifest;if(u||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){c.hasOwnProperty(e)&&delete c[e]}),c.segments&&c.segments.forEach(function(e){["parts","preloadHints"].forEach(function(t){e.hasOwnProperty(t)&&delete e[t]})})),!c.targetDuration){var d=10;c.segments&&c.segments.length&&(d=c.segments.reduce(function(e,t){return Math.max(e,t.duration)},0)),t&&t("manifest has no targetDuration defaulting to "+d),c.targetDuration=d}var h=G(c);if(h.length&&!c.partTargetDuration){var p=h.reduce(function(e,t){return Math.max(e,t.duration)},0);t&&(t("manifest has no partTargetDuration defaulting to "+p),fe.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.")),c.partTargetDuration=p}return c},ye=function(e,t){e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(function(n){if(e.mediaGroups[n])for(var i in e.mediaGroups[n])for(var r in e.mediaGroups[n][i]){var a=e.mediaGroups[n][i][r];t(a,n,i,r)}})},ve=function(e){var t=e.playlist,n=e.uri,i=e.id;t.id=i,t.playlistErrors_=0,n&&(t.uri=n),t.attributes=t.attributes||{}},_e=function(e){for(var t=e.playlists.length;t--;){var n=e.playlists[t];ve({playlist:n,id:me(t,n.uri)}),n.resolvedUri=I(e.uri,n.uri),e.playlists[n.id]=n,e.playlists[n.uri]=n,n.attributes.BANDWIDTH||fe.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},be=function(e){ye(e,function(t){t.uri&&(t.resolvedUri=I(e.uri,t.uri))})},Te=function(e,t){var n=me(0,t),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:d.a.location.href,resolvedUri:d.a.location.href,playlists:[{uri:t,id:n,resolvedUri:t,attributes:{}}]};return i.playlists[n]=i.playlists[0],i.playlists[t]=i.playlists[0],i},Se=function(e,t){e.uri=t;for(var n=0;n<e.playlists.length;n++)if(!e.playlists[n].uri){var i="placeholder-uri-"+n;e.playlists[n].uri=i}var r=he(e);ye(e,function(t,n,i,a){var s="placeholder-uri-"+n+"-"+i+"-"+a;if(!t.playlists||!t.playlists.length){if(r&&"AUDIO"===n&&!t.uri)for(var o=0;o<e.playlists.length;o++){var u=e.playlists[o];if(u.attributes&&u.attributes.AUDIO&&u.attributes.AUDIO===i)return}t.playlists=[g()({},t)]}t.playlists.forEach(function(t,n){var i=me(n,s);t.uri?t.resolvedUri=t.resolvedUri||I(e.uri,t.uri):(t.uri=0===n?s:i,t.resolvedUri=t.uri),t.id=t.id||i,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t})}),_e(e),be(e)},Ee=f.a.mergeOptions,we=f.a.EventTarget,ke=function(e,t){if(t.endList||!t.serverControl)return e;var n={};if(t.serverControl.canBlockReload){var i=t.preloadSegment,r=t.mediaSequence+t.segments.length;if(i){var a=i.parts||[],s=z(t)-1;s>-1&&s!==a.length-1&&(n._HLS_part=s),(s>-1||a.length)&&r--}n._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(n._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(n).length){var o=new d.a.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){n.hasOwnProperty(e)&&o.searchParams.set(e,n[e])}),e=o.toString()}return e},Ce=function(e,t){if(!e)return t;var n=Ee(e,t);if(e.preloadHints&&!t.preloadHints&&delete n.preloadHints,e.parts&&!t.parts)delete n.parts;else if(e.parts&&t.parts)for(var i=0;i<t.parts.length;i++)e.parts&&e.parts[i]&&(n.parts[i]=Ee(e.parts[i],t.parts[i]));return!e.skipped&&t.skipped&&(n.skipped=!1),e.preload&&!t.preload&&(n.preload=!1),n},Ae=function(e,t,n){var i=e.slice(),r=t.slice();n=n||0;for(var a,s=[],o=0;o<r.length;o++){var u=i[o+n],l=r[o];u?(a=u.map||a,s.push(Ce(u,l))):(a&&!l.map&&(l.map=a),s.push(l))}return s},Ie=function(e,t){!e.resolvedUri&&e.uri&&(e.resolvedUri=I(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=I(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=I(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=I(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(function(e){e.resolvedUri||(e.resolvedUri=I(t,e.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(function(e){e.resolvedUri||(e.resolvedUri=I(t,e.uri))})},xe=function(e){var t=e.segments||[],n=e.preloadSegment;if(n&&n.parts&&n.parts.length){if(n.preloadHints)for(var i=0;i<n.preloadHints.length;i++)if("MAP"===n.preloadHints[i].type)return t;n.duration=e.targetDuration,n.preload=!0,t.push(n)}return t},Pe=function(e,t){return e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment},Oe=function(e,t,n){void 0===n&&(n=Pe);var i=Ee(e,{}),r=i.playlists[t.id];if(!r)return null;if(n(r,t))return null;t.segments=xe(t);var a=Ee(r,t);if(a.preloadSegment&&!t.preloadSegment&&delete a.preloadSegment,r.segments){if(t.skip){t.segments=t.segments||[];for(var s=0;s<t.skip.skippedSegments;s++)t.segments.unshift({skipped:!0})}a.segments=Ae(r.segments,t.segments,t.mediaSequence-r.mediaSequence)}a.segments.forEach(function(e){Ie(e,a.resolvedUri)});for(var o=0;o<i.playlists.length;o++)i.playlists[o].id===t.id&&(i.playlists[o]=a);return i.playlists[t.id]=a,i.playlists[t.uri]=a,ye(e,function(e,n,i,r){if(e.playlists)for(var s=0;s<e.playlists.length;s++)t.id===e.playlists[s].id&&(e.playlists[s]=a)}),i},Le=function(e,t){var n=e.segments||[],i=n[n.length-1],r=i&&i.parts&&i.parts[i.parts.length-1],a=r&&r.duration||i&&i.duration;return t&&a?1e3*a:500*(e.partTargetDuration||e.targetDuration||10)},De=function(e){function t(t,n,i){var r;if(void 0===i&&(i={}),r=e.call(this)||this,!t)throw new Error("A non-empty playlist URL or object is required");r.logger_=P("PlaylistLoader");var s=i,o=s.withCredentials,u=void 0!==o&&o,l=s.handleManifestRedirects,c=void 0!==l&&l;r.src=t,r.vhs_=n,r.withCredentials=u,r.handleManifestRedirects=c;var d=n.options_;return r.customTagParsers=d&&d.customTagParsers||[],r.customTagMappers=d&&d.customTagMappers||[],r.experimentalLLHLS=d&&d.experimentalLLHLS||!1,f.a.browser.IE_VERSION&&(r.experimentalLLHLS=!1),r.state="HAVE_NOTHING",r.handleMediaupdatetimeout_=r.handleMediaupdatetimeout_.bind(a()(r)),r.on("mediaupdatetimeout",r.handleMediaupdatetimeout_),r}o()(t,e);var n=t.prototype;return n.handleMediaupdatetimeout_=function(){var e=this;if("HAVE_METADATA"===this.state){var t=this.media(),n=I(this.master.uri,t.uri);this.experimentalLLHLS&&(n=ke(n,t)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:n,withCredentials:this.withCredentials},function(t,n){if(e.request)return t?e.playlistRequestError(e.request,e.media(),"HAVE_METADATA"):void e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})})}},n.playlistRequestError=function(e,t,n){var i=t.uri,r=t.id;this.request=null,n&&(this.state=n),this.error={playlist:this.master.playlists[r],status:e.status,message:"HLS playlist request error at URL: "+i+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},n.parseManifest_=function(e){var t=this,n=e.url,i=e.manifestString;return ge({onwarn:function(e){var i=e.message;return t.logger_("m3u8-parser warn for "+n+": "+i)},oninfo:function(e){var i=e.message;return t.logger_("m3u8-parser info for "+n+": "+i)},manifestString:i,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},n.haveMetadata=function(e){var t=e.playlistString,n=e.playlistObject,i=e.url,r=e.id;this.request=null,this.state="HAVE_METADATA";var a=n||this.parseManifest_({url:i,manifestString:t});a.lastRequest=Date.now(),ve({playlist:a,uri:i,id:r});var s=Oe(this.master,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,s?(this.master=s,this.media_=this.master.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Le(this.media(),!!s)),this.trigger("loadedplaylist")},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),d.a.clearTimeout(this.mediaUpdateTimeout),d.a.clearTimeout(this.finalRenditionTimeout),this.off()},n.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},n.media=function(e,t){var n=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(d.a.clearTimeout(this.finalRenditionTimeout),t){var i=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=d.a.setTimeout(this.media.bind(this,e,!1),i))}var r=this.state,a=!this.media_||e.id!==this.media_.id,s=this.master.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(a&&(this.trigger("mediachanging"),"HAVE_MASTER"===r?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(Le(e,!0)),a){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,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},function(t,i){if(n.request){if(e.lastRequest=Date.now(),e.resolvedUri=x(n.handleManifestRedirects,e.resolvedUri,i),t)return n.playlistRequestError(n.request,e,r);n.haveMetadata({playlistString:i.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===r?n.trigger("loadedmetadata"):n.trigger("mediachange")}})}},n.pause=function(){this.mediaUpdateTimeout&&(d.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},n.load=function(e){var t=this;this.mediaUpdateTimeout&&(d.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var n=this.media();if(e){var i=n?(n.partTargetDuration||n.targetDuration)/2*1e3:5e3;return void(this.mediaUpdateTimeout=d.a.setTimeout(function(){t.mediaUpdateTimeout=null,t.load()},i))}if(!this.started)return void this.start();n&&!n.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")},n.updateMediaUpdateTimeout_=function(e){var t=this;this.mediaUpdateTimeout&&(d.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=d.a.setTimeout(function(){t.mediaUpdateTimeout=null,t.trigger("mediaupdatetimeout"),t.updateMediaUpdateTimeout_(e)},e))},n.start=function(){var e=this;if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=d.a.location.href),this.src.resolvedUri=this.src.uri,void setTimeout(function(){e.setupInitialPlaylist(e.src)},0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(t,n){if(e.request){if(e.request=null,t)return e.error={status:n.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:n.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=x(e.handleManifestRedirects,e.src,n);var i=e.parseManifest_({manifestString:n.responseText,url:e.src});e.setupInitialPlaylist(i)}})},n.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri},n.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,Se(this.master,this.srcUri()),e.playlists.forEach(function(e){e.segments=xe(e),e.segments.forEach(function(t){Ie(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var t=this.srcUri()||d.a.location.href;this.master=Te(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(we),Re=f.a.xhr,Me=f.a.mergeOptions,Ne=function(e,t,n,i){var r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),n.headers&&(e.responseHeaders=n.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===n.statusCode||206===n.statusCode||0===n.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(r||e.responseText)))),i(t,e)},Ue=function(){var e=function e(t,n){t=Me({timeout:45e3},t);var i=e.beforeRequest||f.a.Vhs.xhr.beforeRequest;if(i&&"function"==typeof i){var r=i(t);r&&(t=r)}var a=!0===f.a.Vhs.xhr.original?Re:f.a.Vhs.xhr,s=a(t,function(e,t){return Ne(s,e,t,n)}),o=s.abort;return s.abort=function(){return s.aborted=!0,o.apply(s,arguments)},s.uri=t.uri,s.requestTime=Date.now(),s};return e.original=!0,e},Be=function(e){var t,n=e.offset;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?d.a.BigInt(e.offset)+d.a.BigInt(e.length)-d.a.BigInt(1):e.offset+e.length-1,"bytes="+n+"-"+t},je=function(e){var t={};return e.byterange&&(t.Range=Be(e.byterange)),t},Fe=function(e,t){return e.start(t)+"-"+e.end(t)},He=function(e,t){var n=e.toString(16);return"00".substring(0,2-n.length)+n+(t%2?" ":"")},qe=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},Ve=function(e){var t={};return Object.keys(e).forEach(function(n){var i=e[n];Object(T.e)(i)?t[n]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:t[n]=i}),t},We=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},Ge=function(e){return e.resolvedUri},ze=function(e){for(var t,n,i=Array.prototype.slice.call(e),r="",a=0;a<i.length/16;a++)t=i.slice(16*a,16*a+16).map(He).join(""),n=i.slice(16*a,16*a+16).map(qe).join(""),r+=t+" "+n+"\n";return r},Xe=function(e){var t=e.bytes;return ze(t)},Ye=function(e){var t,n="";for(t=0;t<e.length;t++)n+=Fe(e,t)+" ";return n},Ke=Object.freeze({__proto__:null,createTransferableMessage:Ve,initSegmentId:We,segmentKeyId:Ge,hexDump:ze,tagDump:Xe,textRanges:Ye}),Qe=function(e,t){if(!t.dateTimeObject)return null;var n=t.videoTimingInfo.transmuxerPrependedSeconds,i=t.videoTimingInfo.transmuxedPresentationStart,r=i+n,a=e-r;return new Date(t.dateTimeObject.getTime()+1e3*a)},$e=function(e){return e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds},Je=function(e,t){var n;try{n=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;var i=t.segments[0];if(n<i.dateTimeObject)return null;for(var r=0;r<t.segments.length-1;r++){i=t.segments[r];if(n<t.segments[r+1].dateTimeObject)break}var a=t.segments[t.segments.length-1],s=a.dateTimeObject,o=a.videoTimingInfo?$e(a.videoTimingInfo):a.duration+.25*a.duration;return n>new Date(s.getTime()+1e3*o)?null:(n>s&&(i=a),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:pe.duration(t,t.mediaSequence+t.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},Ze=function(e,t){if(!t||!t.segments||0===t.segments.length)return null;for(var n,i=0,r=0;r<t.segments.length&&(n=t.segments[r],i=n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationEnd:i+n.duration,!(e<=i));r++);var a=t.segments[t.segments.length-1];if(a.videoTimingInfo&&a.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>i){if(e>i+.25*a.duration)return null;n=a}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:i-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}},et=function(e,t){var n,i;try{n=new Date(e),i=new Date(t)}catch(e){}var r=n.getTime();return(i.getTime()-r)/1e3},tt=function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;t<e.segments.length;t++){if(!e.segments[t].dateTimeObject)return!1}return!0},nt=function(e){var t=e.playlist,n=e.time,i=void 0===n?void 0:n,r=e.callback;if(!r)throw new Error("getProgramTime: callback must be provided");if(!t||void 0===i)return r({message:"getProgramTime: playlist and time must be provided"});var a=Ze(i,t);if(!a)return r({message:"valid programTime was not found"});if("estimate"===a.type)return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:i},o=Qe(i,a.segment);return o&&(s.programDateTime=o.toISOString()),r(null,s)},it=function e(t){var n=t.programTime,i=t.playlist,r=t.retryCount,a=void 0===r?2:r,s=t.seekTo,o=t.pauseAfterSeek,u=void 0===o||o,l=t.tech,c=t.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(void 0===n||!i||!s)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!i.endList&&!l.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!tt(i))return c({message:"programDateTime tags must be provided in the manifest "+i.resolvedUri});var d=Je(n,i);if(!d)return c({message:n+" was not found in the stream"});var h=d.segment,p=et(h.dateTimeObject,n);if("estimate"===d.type)return 0===a?c({message:n+" is not buffered yet. Try again"}):(s(d.estimatedStart+p),void l.one("seeked",function(){e({programTime:n,playlist:i,retryCount:a-1,seekTo:s,pauseAfterSeek:u,tech:l,callback:c})}));var f=h.start+p,m=function(){return c(null,l.currentTime())};l.one("seeked",m),u&&l.pause(),s(f)},rt=function(e,t){if(4===e.readyState)return t()},at=function(e,t,n){var i,r=[],a=!1,s=function(e,t,i,r){return t.abort(),a=!0,n(e,t,i,r)},o=function(e,t){if(!a){if(e)return s(e,t,"",r);var n=t.responseText.substring(r&&r.byteLength||0,t.responseText.length);if(r=Object(T.d)(r,Object(T.h)(n,!0)),i=i||Object(k.a)(r),r.length<10||i&&r.length<i+2)return rt(t,function(){return s(e,t,"",r)});var o=Object(C.a)(r);return"ts"===o&&r.length<188?rt(t,function(){return s(e,t,"",r)}):!o&&r.length<376?rt(t,function(){return s(e,t,"",r)}):s(null,t,o,r)}},u={uri:e,beforeSend:function(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",function(t){return t.total,t.loaded,Ne(e,null,{statusCode:e.status},o)})}},l=t(u,function(e,t){return Ne(l,e,t,o)});return l},st=f.a.EventTarget,ot=f.a.mergeOptions,ut=function(e,t){if(!Pe(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(var n=0;n<e.segments.length;n++){var i=e.segments[n],r=t.segments[n];if(i.uri!==r.uri)return!1;if(i.byterange||r.byterange){var a=i.byterange,s=r.byterange;if(a&&!s||!a&&s)return!1;if(a.offset!==s.offset||a.length!==s.length)return!1}}return!0},lt=function(e){var t=e.masterXml,n=e.srcUrl,i=e.clientOffset,r=e.sidxMapping,a=e.previousManifest,s=Object(S.c)(t,{manifestUri:n,clientOffset:i,sidxMapping:r,previousManifest:a});return Se(s,n),s},ct=function(e,t,n){for(var i=!0,r=ot(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts}),a=0;a<t.playlists.length;a++){var s=t.playlists[a];if(s.sidx){var o=Object(S.b)(s.sidx);n&&n[o]&&n[o].sidx&&Object(S.a)(s,n[o].sidx,s.sidx.resolvedUri)}var u=Oe(r,s,ut);u&&(r=u,i=!1)}return ye(t,function(e,t,n,a){if(e.playlists&&e.playlists.length){var s=e.playlists[0].id,o=Oe(r,e.playlists[0],ut);o&&(r=o,r.mediaGroups[t][n][a].playlists[0]=r.playlists[s],i=!1)}}),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(i=!1),i?null:r},dt=function(e,t){return(Boolean(!e.map&&!t.map)||Boolean(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},ht=function(e,t){var n={};for(var i in e){var r=e[i],a=r.sidx;if(a){var s=Object(S.b)(a);if(!t[s])break;var o=t[s].sidxInfo;dt(o,a)&&(n[s]=t[s])}}return n},pt=function(e,t){var n=ht(e.playlists,t),i=n;return ye(e,function(e,n,r,a){if(e.playlists&&e.playlists.length){var s=e.playlists;i=ot(i,ht(s,t))}}),i},ft=function(e){function t(t,n,i,r){var s;void 0===i&&(i={}),s=e.call(this)||this,s.masterPlaylistLoader_=r||a()(s),r||(s.isMaster_=!0);var o=i,u=o.withCredentials,l=void 0!==u&&u,c=o.handleManifestRedirects,d=void 0!==c&&c;if(s.vhs_=n,s.withCredentials=l,s.handleManifestRedirects=d,!t)throw new Error("A non-empty playlist URL or object is required");return s.on("minimumUpdatePeriod",function(){s.refreshXml_()}),s.on("mediaupdatetimeout",function(){s.refreshMedia_(s.media().id)}),s.state="HAVE_NOTHING",s.loadedPlaylists_={},s.logger_=P("DashPlaylistLoader"),s.isMaster_?(s.masterPlaylistLoader_.srcUrl=t,s.masterPlaylistLoader_.sidxMapping_={}):s.childPlaylist_=t,s}o()(t,e);var n=t.prototype;return n.requestErrored_=function(e,t,n){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2}:e,n&&(this.state=n),this.trigger("error"),!0):void 0)},n.addSidxSegments_=function(e,t,n){var i=this,r=e.sidx&&Object(S.b)(e.sidx);if(!e.sidx||!r||this.masterPlaylistLoader_.sidxMapping_[r])return void(this.mediaRequest_=d.a.setTimeout(function(){return n(!1)},0));var a=x(this.handleManifestRedirects,e.sidx.resolvedUri),s=function(a,s){if(!i.requestErrored_(a,s,t)){var o,u=i.masterPlaylistLoader_.sidxMapping_;try{o=w()(Object(T.k)(s.response).subarray(8))}catch(e){return void i.requestErrored_(e,s,t)}return u[r]={sidxInfo:e.sidx,sidx:o},Object(S.a)(e,o,e.sidx.resolvedUri),n(!0)}};this.request=at(a,this.vhs_.xhr,function(t,n,r,o){if(t)return s(t,n);if(!r||"mp4"!==r)return s({status:n.status,message:"Unsupported "+(r||"unknown")+" container type for sidx segment at URL: "+a,response:"",playlist:e,internal:!0,blacklistDuration:1/0,code:2},n);var u=e.sidx.byterange,l=u.offset,c=u.length;if(o.length>=c+l)return s(t,{response:o.subarray(l,l+c),status:n.status,uri:n.uri});i.request=i.vhs_.xhr({uri:a,responseType:"arraybuffer",headers:je({byterange:e.sidx.byterange})},s)})},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},d.a.clearTimeout(this.minimumUpdatePeriodTimeout_),d.a.clearTimeout(this.mediaRequest_),d.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},n.hasPendingRequest=function(){return this.request||this.mediaRequest_},n.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},n.media=function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var n=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(i&&(this.trigger("mediachanging"),this.trigger("mediachange")));i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,n,function(i){t.haveMetadata({startingState:n,playlist:e})}))},n.haveMetadata=function(e){var t=e.startingState,n=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[n.id]=n,this.mediaRequest_=null,this.refreshMedia_(n.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")},n.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),d.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(d.a.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},n.load=function(e){var t=this;d.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var n=this.media();if(e){var i=n?n.targetDuration/2*1e3:5e3;return void(this.mediaUpdateTimeout=d.a.setTimeout(function(){return t.load()},i))}if(!this.started)return void this.start();n&&!n.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")},n.start=function(){var e=this;if(this.started=!0,!this.isMaster_)return void(this.mediaRequest_=d.a.setTimeout(function(){return e.haveMaster_()},0));this.requestMaster_(function(t,n){e.haveMaster_(),e.hasPendingRequest()||e.media_||e.media(e.masterPlaylistLoader_.master.playlists[0])})},n.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(n,i){if(t.requestErrored_(n,i))return void("HAVE_NOTHING"===t.state&&(t.started=!1));var r=i.responseText!==t.masterPlaylistLoader_.masterXml_;return t.masterPlaylistLoader_.masterXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?t.masterLoaded_=Date.parse(i.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=x(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,i),r?(t.handleMaster_(),void t.syncClientServerClock_(function(){return e(i,r)})):e(i,r)})},n.syncClientServerClock_=function(e){var t=this,n=Object(S.d)(this.masterPlaylistLoader_.masterXml_);return null===n?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===n.method?(this.masterPlaylistLoader_.clientOffset_=n.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:I(this.masterPlaylistLoader_.srcUrl,n.value),method:n.method,withCredentials:this.withCredentials},function(i,r){if(t.request){if(i)return t.masterPlaylistLoader_.clientOffset_=t.masterLoaded_-Date.now(),e();var a;a="HEAD"===n.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):t.masterLoaded_:Date.parse(r.responseText),t.masterPlaylistLoader_.clientOffset_=a-Date.now(),e()}}))},n.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},n.handleMaster_=function(){this.mediaRequest_=null;var e=this.masterPlaylistLoader_.master,t=lt({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=ct(e,t,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=t||e;var n=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return n&&n!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=n),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(t)},n.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(d.a.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var t=e.master&&e.master.minimumUpdatePeriod;if(0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0)return void(t<0&&this.logger_("found invalid minimumUpdatePeriod of "+t+", not setting a timeout"));this.createMUPTimeout_(t)},n.createMUPTimeout_=function(e){var t=this.masterPlaylistLoader_;t.minimumUpdatePeriodTimeout_=d.a.setTimeout(function(){t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)},n.refreshXml_=function(){var e=this;this.requestMaster_(function(t,n){n&&(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=pt(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.sidxMapping_),e.addSidxSegments_(e.media(),e.state,function(t){e.refreshMedia_(e.media().id)}))})},n.refreshMedia_=function(e){var t=this;if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var n=this.masterPlaylistLoader_.master.playlists,i=!this.media_||this.media_!==n[e];if(i?this.media_=n[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){!function e(){t.media().endList||(t.mediaUpdateTimeout=d.a.setTimeout(function(){t.trigger("mediaupdatetimeout"),e()},Le(t.media(),Boolean(i))))}()}this.trigger("loadedplaylist")},t}(st),mt={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},gt=function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer},yt=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},vt=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(n){var t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}},_t=function(e){return function(){var t=vt(e),n=yt(new Worker(t));n.objURL=t;var i=n.terminate;return n.on=n.addEventListener,n.off=n.removeEventListener,n.terminate=function(){return URL.revokeObjectURL(t),i.call(this)},n}},bt=function(e){return"var browserWorkerPolyFill = "+yt.toString()+";\nbrowserWorkerPolyFill(self);\n"+e},Tt=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},St=bt(Tt(function(){var 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 i;return!!e[t]&&(i=e[t].indexOf(n),e[t]=e[t].slice(),e[t].splice(i,1),i>-1)},this.trigger=function(t){var n,i,r,a;if(n=e[t])if(2===arguments.length)for(r=n.length,i=0;i<r;++i)n[i].call(this,arguments[1]);else{for(a=[],i=arguments.length,i=1;i<arguments.length;++i)a.push(arguments[i]);for(r=n.length,i=0;i<r;++i)n[i].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,i,r,a,s,o,u,l,c,d,h,p,f,m,g,y,v,_,b,T,S,E,w,k,C,A,I,x,P,O,L,D,R,M,N,U,B=t,j=Math.pow(2,32),F=function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getBigUint64?(t=n.getBigUint64(0),t<Number.MAX_SAFE_INTEGER?Number(t):t):n.getUint32(0)*j+n.getUint32(4)},H={getUint64:F,MAX_UINT32:j},q=H.MAX_UINT32;!function(){var e;if(w={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:[]},"undefined"!=typeof Uint8Array){for(e in w)w.hasOwnProperty(e)&&(w[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);k=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),A=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),C=new Uint8Array([0,0,0,1]),I=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]),x=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]),P={video:I,audio:x},D=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),L=new Uint8Array([0,0,0,0,0,0,0,0]),R=new Uint8Array([0,0,0,0,0,0,0,0]),M=R,N=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),U=R,O=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),n=function(e){var t,n,i,r=[],a=0;for(t=1;t<arguments.length;t++)r.push(arguments[t]);for(t=r.length;t--;)a+=r[t].byteLength;for(n=new Uint8Array(a+8),i=new DataView(n.buffer,n.byteOffset,n.byteLength),i.setUint32(0,n.byteLength),n.set(e,4),t=0,a=8;t<r.length;t++)n.set(r[t],a),a+=r[t].byteLength;return n},i=function(){return n(w.dinf,n(w.dref,D))},r=function(e){return n(w.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]))},a=function(){return n(w.ftyp,k,C,k,A)},y=function(e){return n(w.hdlr,P[e])},s=function(e){return n(w.mdat,e)},g=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,255&e.duration,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]=255&e.samplerate),n(w.mdhd,t)},m=function(e){return n(w.mdia,g(e),y(e.type),u(e))},o=function(e){return n(w.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},u=function(e){return n(w.minf,"video"===e.type?n(w.vmhd,O):n(w.smhd,L),i(),_(e))},l=function(e,t){for(var i=[],r=t.length;r--;)i[r]=T(t[r]);return n.apply(null,[w.moof,o(e)].concat(i))},c=function(e){for(var t=e.length,i=[];t--;)i[t]=p(e[t]);return n.apply(null,[w.moov,h(4294967295)].concat(i).concat(d(e)))},d=function(e){for(var t=e.length,i=[];t--;)i[t]=S(e[t]);return n.apply(null,[w.mvex].concat(i))},h=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,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 n(w.mvhd,t)},v=function(e){var t,i,r=e.samples||[],a=new Uint8Array(4+r.length);for(i=0;i<r.length;i++)t=r[i].flags,a[i+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return n(w.sdtp,a)},_=function(e){return n(w.stbl,b(e),n(w.stts,U),n(w.stsc,M),n(w.stsz,N),n(w.stco,R))},function(){var e,t;b=function(i){return n(w.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===i.type?e(i):t(i))},e=function(e){var t,i,r=e.sps||[],a=e.pps||[],s=[],o=[];for(t=0;t<r.length;t++)s.push((65280&r[t].byteLength)>>>8),s.push(255&r[t].byteLength),s=s.concat(Array.prototype.slice.call(r[t]));for(t=0;t<a.length;t++)o.push((65280&a[t].byteLength)>>>8),o.push(255&a[t].byteLength),o=o.concat(Array.prototype.slice.call(a[t]));if(i=[w.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,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,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]),n(w.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],s,[a.length],o))),n(w.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var u=e.sarRatio[0],l=e.sarRatio[1];i.push(n(w.pasp,new Uint8Array([(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l])))}return n.apply(null,i)},t=function(e){return n(w.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),r(e))}}(),f=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,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,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return n(w.tkhd,t)},T=function(e){var t,i,r,a,s,o,u;return t=n(w.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),o=Math.floor(e.baseMediaDecodeTime/q),u=Math.floor(e.baseMediaDecodeTime%q),i=n(w.tfdt,new Uint8Array([1,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,255&o,u>>>24&255,u>>>16&255,u>>>8&255,255&u])),s=92,"audio"===e.type?(r=E(e,s),n(w.traf,t,i,r)):(a=v(e),r=E(e,a.length+s),n(w.traf,t,i,r,a))},p=function(e){return e.duration=e.duration||4294967295,n(w.trak,f(e),m(e))},S=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),n(w.trex,t)},function(){var e,t,i;i=function(e,t){var n=0,i=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(n=1),void 0!==e[0].size&&(i=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,n|i|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},t=function(e,t){var r,a,s,o,u,l;for(o=e.samples||[],t+=20+16*o.length,s=i(o,t),a=new Uint8Array(s.length+16*o.length),a.set(s),r=s.length,l=0;l<o.length;l++)u=o[l],a[r++]=(4278190080&u.duration)>>>24,a[r++]=(16711680&u.duration)>>>16,a[r++]=(65280&u.duration)>>>8,a[r++]=255&u.duration,a[r++]=(4278190080&u.size)>>>24,a[r++]=(16711680&u.size)>>>16,a[r++]=(65280&u.size)>>>8,a[r++]=255&u.size,a[r++]=u.flags.isLeading<<2|u.flags.dependsOn,a[r++]=u.flags.isDependedOn<<6|u.flags.hasRedundancy<<4|u.flags.paddingValue<<1|u.flags.isNonSyncSample,a[r++]=61440&u.flags.degradationPriority,a[r++]=15&u.flags.degradationPriority,a[r++]=(4278190080&u.compositionTimeOffset)>>>24,a[r++]=(16711680&u.compositionTimeOffset)>>>16,a[r++]=(65280&u.compositionTimeOffset)>>>8,a[r++]=255&u.compositionTimeOffset;return n(w.trun,a)},e=function(e,t){var r,a,s,o,u,l;for(o=e.samples||[],t+=20+8*o.length,s=i(o,t),r=new Uint8Array(s.length+8*o.length),r.set(s),a=s.length,l=0;l<o.length;l++)u=o[l],r[a++]=(4278190080&u.duration)>>>24,r[a++]=(16711680&u.duration)>>>16,r[a++]=(65280&u.duration)>>>8,r[a++]=255&u.duration,r[a++]=(4278190080&u.size)>>>24,r[a++]=(16711680&u.size)>>>16,r[a++]=(65280&u.size)>>>8,r[a++]=255&u.size;return n(w.trun,r)},E=function(n,i){return"audio"===n.type?e(n,i):t(n,i)}}();var V,W,G,z,X,Y,K,Q,$={ftyp:a,mdat:s,moof:l,moov:c,initSegment:function(e){var t,n=a(),i=c(e);return t=new Uint8Array(n.byteLength+i.byteLength),t.set(n),t.set(i,n.byteLength),t}},J=function(e){var t,n,i=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,i.byteLength=0,t=0;t<e.length;t++)n=e[t],"access_unit_delimiter_rbsp"===n.nalUnitType?(i.length&&(i.duration=n.dts-i.dts,r.byteLength+=i.byteLength,r.nalCount+=i.length,r.duration+=i.duration,r.push(i)),i=[n],i.byteLength=n.data.byteLength,i.pts=n.pts,i.dts=n.dts):("slice_layer_without_partitioning_rbsp_idr"===n.nalUnitType&&(i.keyFrame=!0),i.duration=n.dts-i.dts,i.byteLength+=n.data.byteLength,i.push(n));return r.length&&(!i.duration||i.duration<=0)&&(i.duration=r[r.length-1].duration),r.byteLength+=i.byteLength,r.nalCount+=i.length,r.duration+=i.duration,r.push(i),r},Z=function(e){var t,n,i=[],r=[];for(i.byteLength=0,i.nalCount=0,i.duration=0,i.pts=e[0].pts,i.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)n=e[t],n.keyFrame?(i.length&&(r.push(i),r.byteLength+=i.byteLength,r.nalCount+=i.nalCount,r.duration+=i.duration),i=[n],i.nalCount=n.length,i.byteLength=n.byteLength,i.pts=n.pts,i.dts=n.dts,i.duration=n.duration):(i.duration+=n.duration,i.nalCount+=n.length,i.byteLength+=n.byteLength,i.push(n));return r.length&&i.duration<=0&&(i.duration=r[r.length-1].duration),r.byteLength+=i.byteLength,r.nalCount+=i.nalCount,r.duration+=i.duration,r.push(i),r},ee=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},te=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},ne=function(e,t){var n=te();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},ie=function(e,t){var n,i,r,a,s,o=t||0,u=[];for(n=0;n<e.length;n++)for(a=e[n],i=0;i<a.length;i++)s=a[i],r=ne(s,o),o+=r.size,u.push(r);return u},re=function(e){var t,n,i,r,a,s,o=0,u=e.byteLength,l=e.nalCount,c=u+4*l,d=new Uint8Array(c),h=new DataView(d.buffer);for(t=0;t<e.length;t++)for(r=e[t],n=0;n<r.length;n++)for(a=r[n],i=0;i<a.length;i++)s=a[i],h.setUint32(o,s.data.byteLength),o+=4,d.set(s.data,o),o+=s.data.byteLength;return d},ae=function(e,t){var n,i=t||0,r=[];return n=ne(e,i),r.push(n),r},se=function(e){var t,n,i=0,r=e.byteLength,a=e.length,s=r+4*a,o=new Uint8Array(s),u=new DataView(o.buffer);for(t=0;t<e.length;t++)n=e[t],u.setUint32(i,n.data.byteLength),i+=4,o.set(n.data,i),i+=n.data.byteLength;return o},oe={groupNalsIntoFrames:J,groupFramesIntoGops:Z,extendFirstKeyFrame:ee,generateSampleTable:ie,concatenateNalData:re,generateSampleTableForFrame:ae,concatenateNalDataForFrame:se},ue=[33,16,5,32,164,27],le=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ce=function(e){for(var t=[];e--;)t.push(0);return t},de=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},{})},he=function(){if(!V){var e={96e3:[ue,[227,64],ce(154),[56]],88200:[ue,[231],ce(170),[56]],64e3:[ue,[248,192],ce(240),[56]],48e3:[ue,[255,192],ce(268),[55,148,128],ce(54),[112]],44100:[ue,[255,192],ce(268),[55,163,128],ce(84),[112]],32e3:[ue,[255,192],ce(268),[55,234],ce(226),[112]],24e3:[ue,[255,192],ce(268),[55,255,128],ce(268),[111,112],ce(126),[224]],16e3:[ue,[255,192],ce(268),[55,255,128],ce(268),[111,255],ce(269),[223,108],ce(195),[1,192]],12e3:[le,ce(268),[3,127,248],ce(268),[6,255,240],ce(268),[13,255,224],ce(268),[27,253,128],ce(259),[56]],11025:[le,ce(268),[3,127,248],ce(268),[6,255,240],ce(268),[13,255,224],ce(268),[27,255,192],ce(268),[55,175,128],ce(108),[112]],8e3:[le,ce(268),[3,121,16],ce(47),[7]]};V=de(e)}return V};W=function(e){return 9e4*e},G=function(e,t){return e*t},z=function(e){return e/9e4},X=function(e,t){return e/t},Y=function(e,t){return W(X(e,t))},K=function(e,t){return G(z(e),t)},Q=function(e,t,n){return z(n?e:e-t)};var pe={ONE_SECOND_IN_TS:9e4,secondsToVideoTs:W,secondsToAudioTs:G,videoTsToSeconds:z,audioTsToSeconds:X,audioTsToVideoTs:Y,videoTsToAudioTs:K,metadataTsToSeconds:Q},fe=function(e){var t,n,i=0;for(t=0;t<e.length;t++)n=e[t],i+=n.data.byteLength;return i},me=function(e,t,n,i){var r,a,s,o,u=0,l=0,c=0,d=0;if(t.length&&(r=pe.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),u=Math.ceil(pe.ONE_SECOND_IN_TS/(e.samplerate/1024)),n&&i&&(l=r-Math.max(n,i),c=Math.floor(l/u),d=c*u),!(c<1||d>pe.ONE_SECOND_IN_TS/2))){for(a=he()[e.samplerate],a||(a=t[0].data),s=0;s<c;s++)o=t[0],t.splice(0,0,{data:a,dts:o.dts-u,pts:o.pts-u});return e.baseMediaDecodeTime-=Math.floor(pe.videoTsToAudioTs(d,e.samplerate)),d}},ge=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)}))},ye=function(e){var t,n,i=[];for(t=0;t<e.length;t++)n=e[t],i.push({size:n.data.byteLength,duration:1024});return i},ve=function(e){var t,n,i=0,r=new Uint8Array(fe(e));for(t=0;t<e.length;t++)n=e[t],r.set(n.data,i),i+=n.data.byteLength;return r},_e={prefixWithSilence:me,trimAdtsFramesByEarliestDts:ge,generateSampleTable:ye,concatenateFrameData:ve},be=pe.ONE_SECOND_IN_TS,Te=function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},Se=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},Ee=function(e,t){var n,i,r=e.minSegmentDts;return t||(r-=e.timelineStartInfo.dts),n=e.timelineStartInfo.baseMediaDecodeTime,n+=r,n=Math.max(0,n),"audio"===e.type&&(i=e.samplerate/be,n*=i,n=Math.floor(n)),n},we={clearDtsInfo:Se,calculateTrackBaseMediaDecodeTime:Ee,collectDtsInfo:Te},ke=function(e){for(var t=0,n={payloadType:-1,payloadSize:0},i=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)i+=255,t++;for(i+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!n.payload&&4===i){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){n.payloadType=i,n.payloadSize=r,n.payload=e.subarray(t,t+r);break}n.payload=void 0}t+=r,i=0,r=0}return n},Ce=function(e){return 181!==e.payload[0]?null:49!=(e.payload[1]<<8|e.payload[2])?null:"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])?null:3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},Ae=function(e,t){var n,i,r,a,s=[];if(!(64&t[0]))return s;for(i=31&t[0],n=0;n<i;n++)r=3*n,a={type:3&t[r+2],pts:e},4&t[r+2]&&(a.ccData=t[r+3]<<8|t[r+4],s.push(a));return s},Ie=function(e){for(var t,n,i=e.byteLength,r=[],a=1;a<i-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=i-r.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),n[a]=e[s];return n},xe={parseSei:ke,parseUserData:Ce,parseCaptionPackets:Ae,discardEmulationPreventionBytes:Ie,USER_DATA_REGISTERED_ITU_T_T35:4},Pe=function e(t){t=t||{},e.prototype.init.call(this),this.parse708captions_="boolean"!=typeof t.parse708captions||t.parse708captions,this.captionPackets_=[],this.ccStreams_=[new He(0,0),new He(0,1),new He(1,0),new He(1,1)],this.parse708captions_&&(this.cc708Stream_=new Ne({captionServices:t.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")))};Pe.prototype=new B,Pe.prototype.push=function(e){var t,n,i;if("sei_rbsp"===e.nalUnitType&&(t=xe.parseSei(e.escapedRBSP),t.payload&&t.payloadType===xe.USER_DATA_REGISTERED_ITU_T_T35&&(n=xe.parseUserData(t)))){if(e.dts<this.latestDts_)return void(this.ignoreNextEqualDts_=!0);if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return void(--this.numSameDts_||(this.ignoreNextEqualDts_=!1));i=xe.parseCaptionPackets(e.pts,n),this.captionPackets_=this.captionPackets_.concat(i),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},Pe.prototype.flushCCStreams=function(e){this.ccStreams_.forEach(function(t){return"flush"===e?t.flush():t.partialFlush()},this)},Pe.prototype.flushStream=function(e){if(!this.captionPackets_.length)return void this.flushCCStreams(e);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)},Pe.prototype.flush=function(){return this.flushStream("flush")},Pe.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Pe.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset()})},Pe.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),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},Pe.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},Pe.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},Pe.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},Pe.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var Oe={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},Le=function(e){var t=Oe[e]||e;return 4096&e&&e===t?"":String.fromCharCode(t)},De=function(e){return 32<=e&&e<=127||160<=e&&e<=255},Re=function(e){this.windowNum=e,this.reset()};Re.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},Re.prototype.getText=function(){return this.rows.join("\n")},Re.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},Re.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Re.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},Re.prototype.addText=function(e){this.rows[this.rowIdx]+=e},Re.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var Me=function(e,t,n){this.serviceNum=e,this.text="",this.currentWindow=new Re(-1),this.windows=[],this.stream=n,"string"==typeof t&&this.createTextDecoder(t)};Me.prototype.init=function(e,t){this.startPts=e;for(var n=0;n<8;n++)this.windows[n]=new Re(n),"function"==typeof t&&(this.windows[n].beforeRowOverflow=t)},Me.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},Me.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)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 Ne=function e(t){t=t||{},e.prototype.init.call(this);var n,i=this,r=t.captionServices||{},a={};Object.keys(r).forEach(function(e){n=r[e],/^SERVICE/.test(e)&&(a[e]=n.encoding)}),this.serviceEncodings=a,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(i.new708Packet(),i.add708Bytes(e)):(null===i.current708Packet&&i.new708Packet(),i.add708Bytes(e))}};Ne.prototype=new B,Ne.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Ne.prototype.add708Bytes=function(e){var t=e.ccData,n=t>>>8,i=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(n),this.current708Packet.data.push(i)},Ne.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,n=null,i=null,r=0,a=t[r++];for(e.seq=a>>6,e.sizeCode=63&a;r<t.length;r++)a=t[r++],n=a>>5,i=31&a,7===n&&i>0&&(a=t[r++],n=a),this.pushServiceBlock(n,r,i),i>0&&(r+=i-1)},Ne.prototype.pushServiceBlock=function(e,t,n){var i,r=t,a=this.current708Packet.data,s=this.services[e];for(s||(s=this.initService(e,r));r<t+n&&r<a.length;r++)i=a[r],De(i)?r=this.handleText(r,s):24===i?r=this.multiByteCharacter(r,s):16===i?r=this.extendedCommands(r,s):128<=i&&i<=135?r=this.setCurrentWindow(r,s):152<=i&&i<=159?r=this.defineWindow(r,s):136===i?r=this.clearWindows(r,s):140===i?r=this.deleteWindows(r,s):137===i?r=this.displayWindows(r,s):138===i?r=this.hideWindows(r,s):139===i?r=this.toggleWindows(r,s):151===i?r=this.setWindowAttributes(r,s):144===i?r=this.setPenAttributes(r,s):145===i?r=this.setPenColor(r,s):146===i?r=this.setPenLocation(r,s):143===i?s=this.reset(r,s):8===i?s.currentWindow.backspace():12===i?s.currentWindow.clearText():13===i?s.currentWindow.pendingNewLine=!0:14===i?s.currentWindow.clearText():141===i&&r++},Ne.prototype.extendedCommands=function(e,t){var n=this.current708Packet.data,i=n[++e];return De(i)&&(e=this.handleText(e,t,{isExtended:!0})),e},Ne.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},Ne.prototype.initService=function(e,t){var n,i,n="SERVICE"+e,r=this;return n in this.serviceEncodings&&(i=this.serviceEncodings[n]),this.services[e]=new Me(e,i,r),this.services[e].init(this.getPts(t),function(t){r.flushDisplayed(t,r.services[e])}),this.services[e]},Ne.prototype.handleText=function(e,t,n){var i,r,a=n&&n.isExtended,s=n&&n.isMultiByte,o=this.current708Packet.data,u=a?4096:0,l=o[e],c=o[e+1],d=t.currentWindow;return t.textDecoder_&&!a?(s?(r=[l,c],e++):r=[l],i=t.textDecoder_.decode(new Uint8Array(r))):i=Le(u|l),d.pendingNewLine&&!d.isEmpty()&&d.newLine(this.getPts(e)),d.pendingNewLine=!1,d.addText(i),e},Ne.prototype.multiByteCharacter=function(e,t){var n=this.current708Packet.data,i=n[e+1],r=n[e+2];return De(i)&&De(r)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},Ne.prototype.setCurrentWindow=function(e,t){var n=this.current708Packet.data,i=n[e],r=7&i;return t.setCurrentWindow(r),e},Ne.prototype.defineWindow=function(e,t){var n=this.current708Packet.data,i=n[e],r=7&i;t.setCurrentWindow(r);var a=t.currentWindow;return i=n[++e],a.visible=(32&i)>>5,a.rowLock=(16&i)>>4,a.columnLock=(8&i)>>3,a.priority=7&i,i=n[++e],a.relativePositioning=(128&i)>>7,a.anchorVertical=127&i,i=n[++e],a.anchorHorizontal=i,i=n[++e],a.anchorPoint=(240&i)>>4,a.rowCount=15&i,i=n[++e],a.columnCount=63&i,i=n[++e],a.windowStyle=(56&i)>>3,a.penStyle=7&i,a.virtualRowCount=a.rowCount+1,e},Ne.prototype.setWindowAttributes=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.winAttr;return i=n[++e],r.fillOpacity=(192&i)>>6,r.fillRed=(48&i)>>4,r.fillGreen=(12&i)>>2,r.fillBlue=3&i,i=n[++e],r.borderType=(192&i)>>6,r.borderRed=(48&i)>>4,r.borderGreen=(12&i)>>2,r.borderBlue=3&i,i=n[++e],r.borderType+=(128&i)>>5,r.wordWrap=(64&i)>>6,r.printDirection=(48&i)>>4,r.scrollDirection=(12&i)>>2,r.justify=3&i,i=n[++e],r.effectSpeed=(240&i)>>4,r.effectDirection=(12&i)>>2,r.displayEffect=3&i,e},Ne.prototype.flushDisplayed=function(e,t){for(var n=[],i=0;i<8;i++)t.windows[i].visible&&!t.windows[i].isEmpty()&&n.push(t.windows[i].getText());t.endPts=e,t.text=n.join("\n\n"),this.pushCaption(t),t.startPts=e},Ne.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)},Ne.prototype.displayWindows=function(e,t){var n=this.current708Packet.data,i=n[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var a=0;a<8;a++)i&1<<a&&(t.windows[a].visible=1);return e},Ne.prototype.hideWindows=function(e,t){var n=this.current708Packet.data,i=n[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var a=0;a<8;a++)i&1<<a&&(t.windows[a].visible=0);return e},Ne.prototype.toggleWindows=function(e,t){var n=this.current708Packet.data,i=n[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var a=0;a<8;a++)i&1<<a&&(t.windows[a].visible^=1);return e},Ne.prototype.clearWindows=function(e,t){var n=this.current708Packet.data,i=n[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var a=0;a<8;a++)i&1<<a&&t.windows[a].clearText();return e},Ne.prototype.deleteWindows=function(e,t){var n=this.current708Packet.data,i=n[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var a=0;a<8;a++)i&1<<a&&t.windows[a].reset();return e},Ne.prototype.setPenAttributes=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.penAttr;return i=n[++e],r.textTag=(240&i)>>4,r.offset=(12&i)>>2,r.penSize=3&i,i=n[++e],r.italics=(128&i)>>7,r.underline=(64&i)>>6,r.edgeType=(56&i)>>3,r.fontStyle=7&i,e},Ne.prototype.setPenColor=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.penColor;return i=n[++e],r.fgOpacity=(192&i)>>6,r.fgRed=(48&i)>>4,r.fgGreen=(12&i)>>2,r.fgBlue=3&i,i=n[++e],r.bgOpacity=(192&i)>>6,r.bgRed=(48&i)>>4,r.bgGreen=(12&i)>>2,r.bgBlue=3&i,i=n[++e],r.edgeRed=(48&i)>>4,r.edgeGreen=(12&i)>>2,r.edgeBlue=3&i,e},Ne.prototype.setPenLocation=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,i=n[++e],r.row=15&i,i=n[++e],r.column=63&i,e},Ne.prototype.reset=function(e,t){var n=this.getPts(e);return this.flushDisplayed(n,t),this.initService(t.serviceNum,e)};var Ue={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},Be=function(e){return null===e?"":(e=Ue[e]||e,String.fromCharCode(e))},je=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Fe=function(){for(var e=[],t=15;t--;)e.push("");return e},He=function e(t,n){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=n||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,n,i,r,a;if((t=32639&e.ccData)===this.lastControlCode_)return void(this.lastControlCode_=null);if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),i=t>>>8,r=255&t,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_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Fe();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Fe();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Fe()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(i,r))i=(3&i)<<8,a=Be(i|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(i,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),i=(3&i)<<8,a=Be(i|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(i,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(i,r))this.column_+=3&r;else if(this.isPAC(i,r)){var s=je.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(i)&&(0===r&&(r=null),a=Be(i),a+=Be(r),this[this.mode_](e.pts,a),this.column_+=a.length)}};He.prototype=new B,He.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e,t){try{return e.trim()}catch(e){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}},this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},He.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Fe(),this.nonDisplayed_=Fe(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},He.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},He.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},He.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},He.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},He.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},He.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},He.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},He.prototype.isNormalChar=function(e){return e>=32&&e<=127},He.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Fe(),this.displayed_=Fe()),void 0!==t&&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]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},He.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)},He.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)}},He.prototype.popOn=function(e,t){var n=this.nonDisplayed_[this.row_];n+=t,this.nonDisplayed_[this.row_]=n},He.prototype.rollUp=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n},He.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},He.prototype.paintOn=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n};var qe={CaptionStream:Pe,Cea608Stream:He,Cea708Stream:Ne},Ve={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},We=function(e,t){var n=1;for(e>t&&(n=-1);Math.abs(t-e)>4294967296;)e+=8589934592*n;return e},Ge=function e(t){var n,i;e.prototype.init.call(this),this.type_=t||"shared",this.push=function(e){"shared"!==this.type_&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=We(e.dts,i),e.pts=We(e.pts,i),n=e.dts,this.trigger("data",e))},this.flush=function(){i=n,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,n=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Ge.prototype=new B;var ze,Xe={TimestampRolloverStream:Ge,handleRollover:We},Ye=function(e,t,n){var i,r="";for(i=t;i<n;i++)r+="%"+("00"+e[i].toString(16)).slice(-2);return r},Ke=function(e,t,n){return decodeURIComponent(Ye(e,t,n))},Qe=function(e,t,n){return unescape(Ye(e,t,n))},$e=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Je={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=Ke(e.data,1,t),e.value=Ke(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=Ke(e.data,1,t),e.url=Ke(e.data,t+1,e.data.length);break}},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=Qe(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};ze=function(e){var t,n={descriptor:e&&e.descriptor},i=0,r=[],a=0;if(ze.prototype.init.call(this),this.dispatchType=Ve.METADATA_STREAM_TYPE.toString(16),n.descriptor)for(t=0;t<n.descriptor.length;t++)this.dispatchType+=("00"+n.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,n,s,o,u,l;if("timed-metadata"===e.type){if(e.dataAlignmentIndicator&&(a=0,r.length=0),0===r.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))return void this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});if(r.push(e),a+=e.data.byteLength,1===r.length&&(i=$e(e.data.subarray(6,10)),i+=10),!(a<i)){for(t={data:new Uint8Array(i),frames:[],pts:r[0].pts,dts:r[0].dts},u=0;u<i;)t.data.set(r[0].data.subarray(0,i-u),u),u+=r[0].data.byteLength,a-=r[0].data.byteLength,r.shift();n=10,64&t.data[5]&&(n+=4,n+=$e(t.data.subarray(10,14)),i-=$e(t.data.subarray(16,20)));do{if((s=$e(t.data.subarray(n+4,n+8)))<1)return void this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});if(l=String.fromCharCode(t.data[n],t.data[n+1],t.data[n+2],t.data[n+3]),o={id:l,data:t.data.subarray(n+10,n+s+10)},o.key=o.id,Je[o.id]&&(Je[o.id](o),"com.apple.streaming.transportStreamTimestamp"===o.owner)){var c=o.data,d=(1&c[3])<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;d*=4,d+=3&c[7],o.timeStamp=d,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),n+=10,n+=s}while(n<i);this.trigger("data",t)}}}},ze.prototype=new B;var Ze,et,tt,nt=ze,it=Xe.TimestampRolloverStream;Ze=function(){var e=new Uint8Array(188),t=0;Ze.prototype.init.call(this),this.push=function(n){var i,r=0,a=188;for(t?(i=new Uint8Array(n.byteLength+t),i.set(e.subarray(0,t)),i.set(n,t),t=0):i=n;a<i.byteLength;)71!==i[r]||71!==i[a]?(r++,a++):(this.trigger("data",i.subarray(r,a)),r+=188,a+=188);r<i.byteLength&&(e.set(i.subarray(r),0),t=i.byteLength-r)},this.flush=function(){188===t&&71===e[0]&&(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")}},Ze.prototype=new B,et=function(){var e,t,n,i;et.prototype.init.call(this),i=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,i){var r=0;i.payloadUnitStartIndicator&&(r+=e[r]+1),"pat"===i.type?t(e.subarray(r),i):n(e.subarray(r),i)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],i.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=i.pmtPid},n=function(e,t){var n,r,a,s;if(1&e[5]){for(i.programMapTable={video:null,audio:null,"timed-metadata":{}},n=(15&e[1])<<8|e[2],r=3+n-4,a=(15&e[10])<<8|e[11],s=12+a;s<r;){var o=e[s],u=(31&e[s+1])<<8|e[s+2];o===Ve.H264_STREAM_TYPE&&null===i.programMapTable.video?i.programMapTable.video=u:o===Ve.ADTS_STREAM_TYPE&&null===i.programMapTable.audio?i.programMapTable.audio=u:o===Ve.METADATA_STREAM_TYPE&&(i.programMapTable["timed-metadata"][u]=o),s+=5+((15&e[s+3])<<8|e[s+4])}t.programMapTable=i.programMapTable}},this.push=function(t){var n={},i=4;if(n.payloadUnitStartIndicator=!!(64&t[1]),n.pid=31&t[1],n.pid<<=8,n.pid|=t[2],(48&t[3])>>>4>1&&(i+=t[i]+1),0===n.pid)n.type="pat",e(t.subarray(i),n),this.trigger("data",n);else if(n.pid===this.pmtPid)for(n.type="pmt",e(t.subarray(i),n),this.trigger("data",n);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,i,n]):this.processPes_(t,i,n)},this.processPes_=function(e,t,n){n.pid===this.programMapTable.video?n.streamType=Ve.H264_STREAM_TYPE:n.pid===this.programMapTable.audio?n.streamType=Ve.ADTS_STREAM_TYPE:n.streamType=this.programMapTable["timed-metadata"][n.pid],n.type="pes",n.data=e.subarray(t),this.trigger("data",n)}},et.prototype=new B,et.STREAM_TYPES={h264:27,adts:15},tt=function(){var e,t=this,n=!1,i={data:[],size:0},r={data:[],size:0},a={data:[],size:0},s=function(e,t){var n,i=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===i&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!=(4&e[6]),n=e[7],192&n&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&n&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))},o=function(e,n,i){var r,a=new Uint8Array(e.size),o={type:n},u=0,l=0,c=!1;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,u=0;u<e.data.length;u++)r=e.data[u],a.set(r.data,l),l+=r.data.byteLength;s(a,o),c="video"===n||o.packetLength<=e.size,(i||c)&&(e.size=0,e.data.length=0),c&&t.trigger("data",o)}};tt.prototype.init.call(this),this.push=function(s){({pat:function(){},pes:function(){var e,t;switch(s.streamType){case Ve.H264_STREAM_TYPE:e=i,t="video";break;case Ve.ADTS_STREAM_TYPE:e=r,t="audio";break;case Ve.METADATA_STREAM_TYPE:e=a,t="timed-metadata";break;default:return}s.payloadUnitStartIndicator&&o(e,t,!0),e.data.push(s),e.size+=s.data.byteLength},pmt:function(){var i={type:"metadata",tracks:[]};e=s.programMapTable,null!==e.video&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),n=!0,t.trigger("data",i)}})[s.type]()},this.reset=function(){i.size=0,i.data.length=0,r.size=0,r.data.length=0,this.trigger("reset")},this.flushStreams_=function(){o(i,"video"),o(r,"audio"),o(a,"timed-metadata")},this.flush=function(){if(!n&&e){var i={type:"metadata",tracks:[]};null!==e.video&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",i)}n=!1,this.flushStreams_(),this.trigger("done")}},tt.prototype=new B;var rt={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:Ze,TransportParseStream:et,ElementaryStream:tt,TimestampRolloverStream:it,CaptionStream:qe.CaptionStream,Cea608Stream:qe.Cea608Stream,Cea708Stream:qe.Cea708Stream,MetadataStream:nt};for(var at in Ve)Ve.hasOwnProperty(at)&&(rt[at]=Ve[at]);var st,ot=rt,ut=pe.ONE_SECOND_IN_TS,lt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];st=function(e){var t,n=0;st.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(i){var r,a,s,o,u,l=0;if(e||(n=0),"audio"===i.type){t&&t.length?(s=t,t=new Uint8Array(s.byteLength+i.data.byteLength),t.set(s),t.set(i.data,s.byteLength)):t=i.data;for(var c;l+7<t.length;)if(255===t[l]&&240==(246&t[l+1])){if("number"==typeof c&&(this.skipWarn_(c,l),c=null),a=2*(1&~t[l+1]),r=(3&t[l+3])<<11|t[l+4]<<3|(224&t[l+5])>>5,o=1024*(1+(3&t[l+6])),u=o*ut/lt[(60&t[l+2])>>>2],t.byteLength-l<r)break;this.trigger("data",{pts:i.pts+n*u,dts:i.dts+n*u,sampleCount:o,audioobjecttype:1+(t[l+2]>>>6&3),channelcount:(1&t[l+2])<<2|(192&t[l+3])>>>6,samplerate:lt[(60&t[l+2])>>>2],samplingfrequencyindex:(60&t[l+2])>>>2,samplesize:16,data:t.subarray(l+7+a,l+r)}),n++,l+=r}else"number"!=typeof c&&(c=l),l++;"number"==typeof c&&(this.skipWarn_(c,l),c=null),t=t.subarray(l)}},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")}},st.prototype=new B;var ct,dt=st;ct=function(e){var t=e.byteLength,n=0,i=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+i},this.loadWord=function(){var r=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(r,r+s)),n=new DataView(a.buffer).getUint32(0),i=8*s,t-=s},this.skipBits=function(e){var r;i>e?(n<<=e,i-=e):(e-=i,r=Math.floor(e/8),e-=8*r,t-=r,this.loadWord(),n<<=e,i-=e)},this.readBits=function(e){var r=Math.min(i,e),a=n>>>32-r;return i-=r,i>0?n<<=r:t>0&&this.loadWord(),r=e-r,r>0?a<<r|this.readBits(r):a},this.skipLeadingZeros=function(){var e;for(e=0;e<i;++e)if(0!=(n&2147483648>>>e))return n<<=e,i-=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 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var ht,pt,ft,mt=ct;pt=function(){var e,t,n=0;pt.prototype.init.call(this),this.push=function(i){var r;t?(r=new Uint8Array(t.byteLength+i.data.byteLength),r.set(t),r.set(i.data,t.byteLength),t=r):t=i.data;for(var a=t.byteLength;n<a-3;n++)if(1===t[n+2]){e=n+5;break}for(;e<a;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}n+3!==e-2&&this.trigger("data",t.subarray(n+3,e-2));do{e++}while(1!==t[e]&&e<a);n=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(n+3,e-2)),n=e-2,e+=3;break;default:e+=3}t=t.subarray(n),e-=n,n=0},this.reset=function(){t=null,n=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(n+3)),t=null,n=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},pt.prototype=new B,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},ht=function(){var e,t,n,i,r,a,s,o=new pt;ht.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,n=e.pts,i=e.dts,o.push(e))},o.on("data",function(s){var o={trackId:t,pts:n,dts:i,data:s,nalUnitTypeCode:31&s[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=r(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(s.subarray(1)),o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)}),o.on("done",function(){e.trigger("done")}),o.on("partialdone",function(){e.trigger("partialdone")}),o.on("reset",function(){e.trigger("reset")}),o.on("endedtimeline",function(){e.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},s=function(e,t){var n,i,r=8,a=8;for(n=0;n<e;n++)0!==a&&(i=t.readExpGolomb(),a=(r+i+256)%256),r=0===a?r:a},r=function(e){for(var t,n,i=e.byteLength,r=[],a=1;a<i-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=i-r.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),n[a]=e[s];return n},a=function(e){var t,n,i,r,a,o,u,l,c,d,h,p,f=0,m=0,g=0,y=0,v=[1,1];if(t=new mt(e),n=t.readUnsignedByte(),r=t.readUnsignedByte(),i=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),ft[n]&&(a=t.readUnsignedExpGolomb(),3===a&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(h=3!==a?8:12,p=0;p<h;p++)t.readBoolean()&&(p<6?s(16,t):s(64,t));if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),u=t.readUnsignedExpGolomb(),p=0;p<u;p++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),l=t.readUnsignedExpGolomb(),c=t.readUnsignedExpGolomb(),d=t.readBits(1),0===d&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(f=t.readUnsignedExpGolomb(),m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}v&&(v[0],v[1])}return{profileIdc:n,levelIdc:i,profileCompatibility:r,width:16*(l+1)-2*f-2*m,height:(2-d)*(c+1)*16-2*g-2*y,sarRatio:v}}},ht.prototype=new B;var gt,yt={H264Stream:ht,NalByteStream:pt},vt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],_t=function(e,t){var n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],i=e[t+5],r=(16&i)>>4;return n=n>=0?n:0,r?n+20:n+10},bt=function e(t,n){return t.length-n<10||t[n]!=="I".charCodeAt(0)||t[n+1]!=="D".charCodeAt(0)||t[n+2]!=="3".charCodeAt(0)?n:(n+=_t(t,n),e(t,n))},Tt=function(e){var t=bt(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1])},St=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Et=function(e,t,n){var i,r="";for(i=t;i<n;i++)r+="%"+("00"+e[i].toString(16)).slice(-2);return r},wt=function(e,t,n){return unescape(Et(e,t,n))},kt=function(e,t){var n=(224&e[t+5])>>5,i=e[t+4]<<3;return 6144&e[t+3]|i|n},Ct=function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},At=function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return vt[(60&e[t+2])>>>2];t++}return null},It=function(e){var t,n,i;t=10,64&e[5]&&(t+=4,t+=St(e.subarray(10,14)));do{if((n=St(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){i=e.subarray(t+10,t+n+10);for(var r=0;r<i.byteLength;r++)if(0===i[r]){var a=wt(i,0,r);if("com.apple.streaming.transportStreamTimestamp"===a){var s=i.subarray(r+1),o=(1&s[3])<<30|s[4]<<22|s[5]<<14|s[6]<<6|s[7]>>>2;return o*=4,o+=3&s[7]}break}}t+=10,t+=n}while(t<e.byteLength);return null},xt={isLikelyAacData:Tt,parseId3TagSize:_t,parseAdtsSize:kt,parseType:Ct,parseSampleRate:At,parseAacTimestamp:It};gt=function(){var e=new Uint8Array,t=0;gt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(n){var i,r,a,s,o=0,u=0;for(e.length?(s=e.length,e=new Uint8Array(n.byteLength+s),e.set(e.subarray(0,s)),e.set(n,s)):e=n;e.length-u>=3;)if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0))if(255!=(255&e[u])||240!=(240&e[u+1]))u++;else{if(e.length-u<7)break;if(o=xt.parseAdtsSize(e,u),u+o>e.length)break;a={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",a),u+=o}else{if(e.length-u<10)break;if(o=xt.parseId3TagSize(e,u),u+o>e.length)break;r={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",r),u+=o}i=e.length-u,e=i>0?e.subarray(u):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}},gt.prototype=new B;var Pt,Ot,Lt,Dt,Rt=gt,Mt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Nt=Mt,Ut=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Bt=Ut,jt=yt.H264Stream,Ft=xt.isLikelyAacData,Ht=pe.ONE_SECOND_IN_TS,qt=function(e,t){t.stream=e,this.trigger("log",t)},Vt=function(e,t){for(var n=Object.keys(t),i=0;i<n.length;i++){var r=n[i];"headOfPipeline"!==r&&t[r].on&&t[r].on("log",qt.bind(e,r))}},Wt=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},Gt=function(e,t,n,i,r,a){return{start:{dts:e,pts:e+(n-t)},end:{dts:e+(i-t),pts:e+(r-n)},prependedContentDuration:a,baseMediaDecodeTime:e}};Ot=function(e,t){var n,i=[],r=0,a=0,s=1/0;t=t||{},n=t.firstSequenceNumber||0,Ot.prototype.init.call(this),this.push=function(t){we.collectDtsInfo(e,t),e&&Nt.forEach(function(n){e[n]=t[n]}),i.push(t)},this.setEarliestDts=function(e){r=e},this.setVideoBaseMediaDecodeTime=function(e){s=e},this.setAudioAppendStart=function(e){a=e},this.flush=function(){var o,u,l,c,d,h,p;if(0===i.length)return void this.trigger("done","AudioSegmentStream");o=_e.trimAdtsFramesByEarliestDts(i,e,r),e.baseMediaDecodeTime=we.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),p=_e.prefixWithSilence(e,o,a,s),e.samples=_e.generateSampleTable(o),l=$.mdat(_e.concatenateFrameData(o)),i=[],u=$.moof(n,[e]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.byteLength),we.clearDtsInfo(e),d=Math.ceil(1024*Ht/e.samplerate),o.length&&(h=o.length*d,this.trigger("segmentTimingInfo",Gt(pe.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+h,o[0].pts+h,p||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+h})),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")},this.reset=function(){we.clearDtsInfo(e),i=[],this.trigger("reset")}},Ot.prototype=new B,Pt=function(e,t){var n,i,r,a=[],s=[];t=t||{},n=t.firstSequenceNumber||0,Pt.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){we.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.config,e.sps=[t.data],Bt.forEach(function(t){e[t]=i[t]},this)),"pic_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.data,e.pps=[t.data]),a.push(t)},this.flush=function(){for(var i,r,o,u,l,c,d,h,p=0;a.length&&"access_unit_delimiter_rbsp"!==a[0].nalUnitType;)a.shift();if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(i=oe.groupNalsIntoFrames(a),o=oe.groupFramesIntoGops(i),o[0][0].keyFrame||(r=this.getGopForFusion_(a[0],e),r?(p=r.duration,o.unshift(r),o.byteLength+=r.byteLength,o.nalCount+=r.nalCount,o.pts=r.pts,o.dts=r.dts,o.duration+=r.duration):o=oe.extendFirstKeyFrame(o)),s.length){var f;if(!(f=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");we.clearDtsInfo(e),o=f}we.collectDtsInfo(e,o),e.samples=oe.generateSampleTable(o),l=$.mdat(oe.concatenateNalData(o)),e.baseMediaDecodeTime=we.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}})),d=o[0],h=o[o.length-1],this.trigger("segmentTimingInfo",Gt(e.baseMediaDecodeTime,d.dts,d.pts,h.dts+h.duration,h.pts+h.duration,p)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),u=$.moof(n,[e]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.byteLength),this.trigger("data",{track:e,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),a=[],this.gopCache_.length=0,s.length=0,this.trigger("reset")},this.resetStream_=function(){we.clearDtsInfo(e),i=void 0,r=void 0},this.getGopForFusion_=function(t){var n,i,r,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)a=this.gopCache_[s],r=a.gop,e.pps&&Wt(e.pps[0],a.pps[0])&&e.sps&&Wt(e.sps[0],a.sps[0])&&(r.dts<e.timelineStartInfo.dts||(n=t.dts-r.dts-r.duration)>=-1e4&&n<=45e3&&(!i||o>n)&&(i=a,o=n));return i?i.gop:null},this.alignGopsAtStart_=function(e){var t,n,i,r,a,o,u,l;for(a=e.byteLength,o=e.nalCount,u=e.duration,t=n=0;t<s.length&&n<e.length&&(i=s[t],r=e[n],i.pts!==r.pts);)r.pts>i.pts?t++:(n++,a-=r.byteLength,o-=r.nalCount,u-=r.duration);return 0===n?e:n===e.length?null:(l=e.slice(n),l.byteLength=a,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,n,i,r,a,o;for(t=s.length-1,n=e.length-1,a=null,o=!1;t>=0&&n>=0;){if(i=s[t],r=e[n],i.pts===r.pts){o=!0;break}i.pts>r.pts?t--:(t===s.length-1&&(a=n),n--)}if(!o&&null===a)return null;var u;if(0===(u=o?n:a))return e;var l=e.slice(u),c=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=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){s=e}},Pt.prototype=new B,Dt=function(e,t){this.numberOfTracks=0,this.metadataStream=t,e=e||{},void 0!==e.remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Dt.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}},Dt.prototype=new B,Dt.prototype.flush=function(e){var t,n,i,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return void(++this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,Bt.forEach(function(e){s.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,Nt.forEach(function(e){s.info[e]=this.audioTrack[e]},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,i=$.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(i.byteLength),s.initSegment.set(i),s.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)s.data.set(this.pendingBoxes[r],a),a+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)t=this.pendingCaptions[r],t.startTime=pe.metadataTsToSeconds(t.startPts,o,this.keepOriginalTimestamps),t.endTime=pe.metadataTsToSeconds(t.endPts,o,this.keepOriginalTimestamps),s.captionStreams[t.stream]=!0,s.captions.push(t);for(r=0;r<this.pendingMetadata.length;r++)n=this.pendingMetadata[r],n.cueTime=pe.metadataTsToSeconds(n.pts,o,this.keepOriginalTimestamps),s.metadata.push(n);for(s.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",s),r=0;r<s.captions.length;r++)t=s.captions[r],this.trigger("caption",t);for(r=0;r<s.metadata.length;r++)n=s.metadata[r],this.trigger("id3Frame",n)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Dt.prototype.setRemux=function(e){this.remuxTracks=e},Lt=function(e){var t,n,i=this,r=!0;Lt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="aac",r.metadataStream=new ot.MetadataStream,r.aacStream=new Rt,r.audioTimestampRolloverStream=new ot.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new ot.TimestampRolloverStream("timed-metadata"),r.adtsStream=new dt,r.coalesceStream=new Dt(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",function(e){r.aacStream.setTimestamp(e.timeStamp)}),r.aacStream.on("data",function(a){"timed-metadata"!==a.type&&"audio"!==a.type||r.audioSegmentStream||(n=n||{timelineStartInfo:{baseMediaDecodeTime:i.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new Ot(n,e),r.audioSegmentStream.on("log",i.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",i.trigger.bind(i,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),i.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t}))}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),Vt(this,r)},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new ot.MetadataStream,r.packetStream=new ot.TransportPacketStream,r.parseStream=new ot.TransportParseStream,r.elementaryStream=new ot.ElementaryStream,r.timestampRolloverStream=new ot.TimestampRolloverStream,r.adtsStream=new dt,r.h264Stream=new jt,r.captionStream=new ot.CaptionStream(e),r.coalesceStream=new Dt(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",function(a){var s;if("metadata"===a.type){for(s=a.tracks.length;s--;)t||"video"!==a.tracks[s].type?n||"audio"!==a.tracks[s].type||(n=a.tracks[s],n.timelineStartInfo.baseMediaDecodeTime=i.baseMediaDecodeTime):(t=a.tracks[s],t.timelineStartInfo.baseMediaDecodeTime=i.baseMediaDecodeTime);t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new Pt(t,e),r.videoSegmentStream.on("log",i.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",function(t){n&&!e.keepOriginalTimestamps&&(n.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-i.baseMediaDecodeTime))}),r.videoSegmentStream.on("processedGopsInfo",i.trigger.bind(i,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",i.trigger.bind(i,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",function(e){n&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),r.videoSegmentStream.on("timingInfo",i.trigger.bind(i,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),n&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new Ot(n,e),r.audioSegmentStream.on("log",i.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",i.trigger.bind(i,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",i.trigger.bind(i,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),i.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t})}}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",function(e){e.dispatchType=r.metadataStream.dispatchType,i.trigger("id3Frame",e)}),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),Vt(this,r)},this.setBaseMediaDecodeTime=function(i){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=i),n&&(n.timelineStartInfo.dts=void 0,n.timelineStartInfo.pts=void 0,we.clearDtsInfo(n),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,we.clearDtsInfo(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){n&&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){t&&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(r){var t=Ft(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!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()}},Lt.prototype=new B;var zt,Xt={Transmuxer:Lt,VideoSegmentStream:Pt,AudioSegmentStream:Ot,AUDIO_PROPERTIES:Nt,VIDEO_PROPERTIES:Bt,generateSegmentTimingInfo:Gt},Yt=function(e){return e>>>0},Kt=function(e){return("00"+e.toString(16)).slice(-2)},Qt={toUnsigned:Yt,toHexString:Kt},$t=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])},Jt=$t,Zt=Qt.toUnsigned,en=function e(t,n){var i,r,a,s,o,u=[];if(!n.length)return null;for(i=0;i<t.byteLength;)r=Zt(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3]),a=Jt(t.subarray(i+4,i+8)),s=r>1?i+r:t.byteLength,a===n[0]&&(1===n.length?u.push(t.subarray(i+8,s)):(o=e(t.subarray(i+8,s),n.slice(1)),o.length&&(u=u.concat(o)))),i=s;return u},tn=en,nn=Qt.toUnsigned,rn=H.getUint64,an=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=rn(e.subarray(4)):t.baseMediaDecodeTime=nn(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},sn=an,on=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},un=on,ln=function(e){var t,n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&n.flags[2],a=4&n.flags[2],s=1&n.flags[1],o=2&n.flags[1],u=4&n.flags[1],l=8&n.flags[1],c=i.getUint32(4),d=8;for(r&&(n.dataOffset=i.getInt32(d),d+=4),a&&c&&(t={flags:un(e.subarray(d,d+4))},d+=4,s&&(t.duration=i.getUint32(d),d+=4),o&&(t.size=i.getUint32(d),d+=4),l&&(1===n.version?t.compositionTimeOffset=i.getInt32(d):t.compositionTimeOffset=i.getUint32(d),d+=4),n.samples.push(t),c--);c--;)t={},s&&(t.duration=i.getUint32(d),d+=4),o&&(t.size=i.getUint32(d),d+=4),u&&(t.flags=un(e.subarray(d,d+4)),d+=4),l&&(1===n.version?t.compositionTimeOffset=i.getInt32(d):t.compositionTimeOffset=i.getUint32(d),d+=4),n.samples.push(t);return n},cn=ln,dn=function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:n.getUint32(4)},r=1&i.flags[2],a=2&i.flags[2],s=8&i.flags[2],o=16&i.flags[2],u=32&i.flags[2],l=65536&i.flags[0],c=131072&i.flags[0];return t=8,r&&(t+=4,i.baseDataOffset=n.getUint32(12),t+=4),a&&(i.sampleDescriptionIndex=n.getUint32(t),t+=4),s&&(i.defaultSampleDuration=n.getUint32(t),t+=4),o&&(i.defaultSampleSize=n.getUint32(t),t+=4),u&&(i.defaultSampleFlags=n.getUint32(t)),l&&(i.durationIsEmpty=!0),!r&&c&&(i.baseDataOffsetIsMoof=!0),i},hn=dn,pn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{};zt="undefined"!=typeof window?window:void 0!==pn?pn:"undefined"!=typeof self?self:{};var fn,mn,gn,yn,vn,_n,bn=zt,Tn=xe.discardEmulationPreventionBytes,Sn=qe.CaptionStream,En=function(e,t){for(var n=e,i=0;i<t.length;i++){var r=t[i];if(n<r.size)return r;n-=r.size}return null},wn=function(e,t,n){var i,r,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u={logs:[],seiNals:[]};for(r=0;r+4<e.length;r+=a)if(a=o.getUint32(r),r+=4,!(a<=0))switch(31&e[r]){case 6:var l=e.subarray(r+1,r+1+a),c=En(r,t);if(i={nalUnitType:"sei_rbsp",size:a,data:l,escapedRBSP:Tn(l),trackId:n},c)i.pts=c.pts,i.dts=c.dts,s=c;else{if(!s){u.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+r+" for trackId "+n+". See mux.js#223."});break}i.pts=s.pts,i.dts=s.dts}u.seiNals.push(i)}return u},kn=function(e,t,n){var i=t,r=n.defaultSampleDuration||0,a=n.defaultSampleSize||0,s=n.trackId,o=[];return e.forEach(function(e){var t=cn(e),n=t.samples;n.forEach(function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=a),e.trackId=s,e.dts=i,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof i?(e.pts=i+bn.BigInt(e.compositionTimeOffset),i+=bn.BigInt(e.duration)):(e.pts=i+e.compositionTimeOffset,i+=e.duration)}),o=o.concat(n)}),o},Cn=function(e,t){var n=tn(e,["moof","traf"]),i=tn(e,["mdat"]),r={},a=[];return i.forEach(function(e,t){var i=n[t];a.push({mdat:e,traf:i})}),a.forEach(function(e){var n,i,a=e.mdat,s=e.traf,o=tn(s,["tfhd"]),u=hn(o[0]),l=u.trackId,c=tn(s,["tfdt"]),d=c.length>0?sn(c[0]).baseMediaDecodeTime:0,h=tn(s,["trun"]);t===l&&h.length>0&&(n=kn(h,d,u),i=wn(a,n,l),r[l]||(r[l]={seiNals:[],logs:[]}),r[l].seiNals=r[l].seiNals.concat(i.seiNals),r[l].logs=r[l].logs.concat(i.logs))}),r},An=function(e,t,n){var i;if(null===t)return null;i=Cn(e,t);var r=i[t]||{};return{seiNals:r.seiNals,logs:r.logs,timescale:n}},In=function(){var e,t,n,i,r,a,s=!1;this.isInitialized=function(){return s},this.init=function(t){e=new Sn,s=!0,a=!!t&&t.isPartial,e.on("data",function(e){e.startTime=e.startPts/i,e.endTime=e.endPts/i,r.captions.push(e),r.captionStreams[e.stream]=!0}),e.on("log",function(e){r.logs.push(e)})},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length)&&(n!==e[0]||i!==t[n])},this.parse=function(e,a,s){var o;if(!this.isInitialized())return null;if(!a||!s)return null;if(this.isNewInit(a,s))n=a[0],i=s[n];else if(null===n||!i)return t.push(e),null;for(;t.length>0;){var u=t.shift();this.parse(u,a,s)}return o=An(e,n,i),o&&o.logs&&(r.logs=r.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):r.logs.length?{logs:r.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t)})},this.flushStream=function(){if(!this.isInitialized())return null;a?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={},r.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],n=null,i=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},xn=In,Pn=Qt.toUnsigned,On=Qt.toHexString,Ln=H.getUint64;fn=function(e){var t={};return tn(e,["moov","trak"]).reduce(function(e,t){var n,i,r,a,s;return(n=tn(t,["tkhd"])[0])?(i=n[0],r=0===i?12:20,a=Pn(n[r]<<24|n[r+1]<<16|n[r+2]<<8|n[r+3]),(s=tn(t,["mdia","mdhd"])[0])?(i=s[0],r=0===i?12:20,e[a]=Pn(s[r]<<24|s[r+1]<<16|s[r+2]<<8|s[r+3]),e):null):null},t)},mn=function(e,t){var n;n=tn(t,["moof","traf"]);var i=n.reduce(function(t,n){var i,r=tn(n,["tfhd"])[0],a=Pn(r[4]<<24|r[5]<<16|r[6]<<8|r[7]),s=e[a]||9e4,o=tn(n,["tfdt"])[0],u=new DataView(o.buffer,o.byteOffset,o.byteLength);i=1===o[0]?Ln(o.subarray(4,12)):u.getUint32(4);var l;return"bigint"==typeof i?l=i/bn.BigInt(s):"number"!=typeof i||isNaN(i)||(l=i/s),l<Number.MAX_SAFE_INTEGER&&(l=Number(l)),l<t&&(t=l),t},1/0);return"bigint"==typeof i||isFinite(i)?i:0},gn=function(e,t){var n,i=tn(t,["moof","traf"]),r=0,a=0;if(i&&i.length){var s=tn(i[0],["tfhd"])[0],o=tn(i[0],["trun"])[0],u=tn(i[0],["tfdt"])[0];if(s){n=hn(s).trackId}if(u){r=sn(u).baseMediaDecodeTime}if(o){var l=cn(o);l.samples&&l.samples.length&&(a=l.samples[0].compositionTimeOffset||0)}}var c=e[n]||9e4;"bigint"==typeof r&&(a=bn.BigInt(a),c=bn.BigInt(c));var d=(r+a)/c;return"bigint"==typeof d&&d<Number.MAX_SAFE_INTEGER&&(d=Number(d)),d},yn=function(e){var t=tn(e,["moov","trak"]),n=[];return t.forEach(function(e){var t=tn(e,["mdia","hdlr"]),i=tn(e,["tkhd"]);t.forEach(function(e,t){var r,a,s,o=Jt(e.subarray(8,12)),u=i[t];"vide"===o&&(r=new DataView(u.buffer,u.byteOffset,u.byteLength),a=r.getUint8(0),s=0===a?r.getUint32(12):r.getUint32(20),n.push(s))})}),n},_n=function(e){var t=e[0],n=0===t?12:20;return Pn(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])},vn=function(e){var t=tn(e,["moov","trak"]),n=[];return t.forEach(function(e){var t,i,r={},a=tn(e,["tkhd"])[0];a&&(t=new DataView(a.buffer,a.byteOffset,a.byteLength),i=t.getUint8(0),r.id=0===i?t.getUint32(12):t.getUint32(20));var s=tn(e,["mdia","hdlr"])[0];if(s){var o=Jt(s.subarray(8,12));r.type="vide"===o?"video":"soun"===o?"audio":o}var u=tn(e,["mdia","minf","stbl","stsd"])[0];if(u){var l=u.subarray(8);r.codec=Jt(l.subarray(4,8));var c,d,h=tn(l,[r.codec])[0];h&&(/^[asm]vc[1-9]$/i.test(r.codec)?(c=h.subarray(78),d=Jt(c.subarray(4,8)),"avcC"===d&&c.length>11?(r.codec+=".",r.codec+=On(c[9]),r.codec+=On(c[10]),r.codec+=On(c[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)?(c=h.subarray(28),d=Jt(c.subarray(4,8)),"esds"===d&&c.length>20&&0!==c[19]?(r.codec+="."+On(c[19]),r.codec+="."+On(c[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"):r.codec=r.codec.toLowerCase())}var p=tn(e,["mdia","mdhd"])[0];p&&(r.timescale=_n(p)),n.push(r)}),n};var Dn={findBox:tn,parseType:Jt,timescale:fn,startTime:mn,compositionStartTime:gn,videoTrackIds:yn,tracks:vn,getTimescaleFromMediaHeader:_n},Rn=function(e){var t=31&e[1];return t<<=8,t|=e[2]},Mn=function(e){return!!(64&e[1])},Nn=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},Un=function(e,t){var n=Rn(e);return 0===n?"pat":n===t?"pmt":t?"pes":null},Bn=function(e){var t=Mn(e),n=4+Nn(e);return t&&(n+=e[n]+1),(31&e[n+10])<<8|e[n+11]},jn=function(e){var t={},n=Mn(e),i=4+Nn(e);if(n&&(i+=e[i]+1),1&e[i+5]){var r,a,s;r=(15&e[i+1])<<8|e[i+2],a=3+r-4,s=(15&e[i+10])<<8|e[i+11];for(var o=12+s;o<a;){var u=i+o;t[(31&e[u+1])<<8|e[u+2]]=e[u],o+=5+((15&e[u+3])<<8|e[u+4])}return t}},Fn=function(e,t){switch(t[Rn(e)]){case Ve.H264_STREAM_TYPE:return"video";case Ve.ADTS_STREAM_TYPE:return"audio";case Ve.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Hn=function(e){if(!Mn(e))return null;var t=4+Nn(e);if(t>=e.byteLength)return null;var n,i=null;return n=e[t+7],192&n&&(i={},i.pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,i.pts*=4,i.pts+=(6&e[t+13])>>>1,i.dts=i.pts,64&n&&(i.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,i.dts*=4,i.dts+=(6&e[t+18])>>>1)),i},qn=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}},Vn=function(e){for(var t,n=4+Nn(e),i=e.subarray(n),r=0,a=0,s=!1;a<i.byteLength-3;a++)if(1===i[a+2]){r=a+5;break}for(;r<i.byteLength;)switch(i[r]){case 0:if(0!==i[r-1]){r+=2;break}if(0!==i[r-2]){r++;break}a+3!==r-2&&"slice_layer_without_partitioning_rbsp_idr"===(t=qn(31&i[a+3]))&&(s=!0);do{r++}while(1!==i[r]&&r<i.length);a=r-2,r+=3;break;case 1:if(0!==i[r-1]||0!==i[r-2]){r+=3;break}t=qn(31&i[a+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(s=!0),a=r-2,r+=3;break;default:r+=3}return i=i.subarray(a),r-=a,a=0,i&&i.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===(t=qn(31&i[a+3]))&&(s=!0),s},Wn={parseType:Un,parsePat:Bn,parsePmt:jn,parsePayloadUnitStartIndicator:Mn,parsePesType:Fn,parsePesTime:Hn,videoPacketContainsKeyFrame:Vn},Gn=Xe.handleRollover,zn={};zn.ts=Wn,zn.aac=xt;var Xn=pe.ONE_SECOND_IN_TS,Yn=function(e,t){for(var n,i=0,r=188;r<e.byteLength;)if(71!==e[i]||71!==e[r])i++,r++;else{switch(n=e.subarray(i,r),zn.ts.parseType(n,t.pid)){case"pat":t.pid=zn.ts.parsePat(n);break;case"pmt":var a=zn.ts.parsePmt(n);t.table=t.table||{},Object.keys(a).forEach(function(e){t.table[e]=a[e]})}i+=188,r+=188}},Kn=function(e,t,n){for(var i,r,a,s,o=0,u=188,l=!1;u<=e.byteLength;)if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o++,u++;else{switch(i=e.subarray(o,u),zn.ts.parseType(i,t.pid)){case"pes":r=zn.ts.parsePesType(i,t.table),a=zn.ts.parsePayloadUnitStartIndicator(i),"audio"===r&&a&&(s=zn.ts.parsePesTime(i))&&(s.type="audio",n.audio.push(s),l=!0)}if(l)break;o+=188,u+=188}for(u=e.byteLength,o=u-188,l=!1;o>=0;)if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o--,u--;else{switch(i=e.subarray(o,u),zn.ts.parseType(i,t.pid)){case"pes":r=zn.ts.parsePesType(i,t.table),a=zn.ts.parsePayloadUnitStartIndicator(i),"audio"===r&&a&&(s=zn.ts.parsePesTime(i))&&(s.type="audio",n.audio.push(s),l=!0)}if(l)break;o-=188,u-=188}},Qn=function(e,t,n){for(var i,r,a,s,o,u,l,c=0,d=188,h=!1,p={data:[],size:0};d<e.byteLength;)if(71!==e[c]||71!==e[d])c++,d++;else{switch(i=e.subarray(c,d),zn.ts.parseType(i,t.pid)){case"pes":if(r=zn.ts.parsePesType(i,t.table),a=zn.ts.parsePayloadUnitStartIndicator(i),"video"===r&&(a&&!h&&(s=zn.ts.parsePesTime(i))&&(s.type="video",n.video.push(s),h=!0),!n.firstKeyFrame)){if(a&&0!==p.size){for(o=new Uint8Array(p.size),u=0;p.data.length;)l=p.data.shift(),o.set(l,u),u+=l.byteLength;if(zn.ts.videoPacketContainsKeyFrame(o)){var f=zn.ts.parsePesTime(o);f?(n.firstKeyFrame=f,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.")}p.size=0}p.data.push(i),p.size+=i.byteLength}}if(h&&n.firstKeyFrame)break;c+=188,d+=188}for(d=e.byteLength,c=d-188,h=!1;c>=0;)if(71!==e[c]||71!==e[d])c--,d--;else{switch(i=e.subarray(c,d),zn.ts.parseType(i,t.pid)){case"pes":r=zn.ts.parsePesType(i,t.table),a=zn.ts.parsePayloadUnitStartIndicator(i),"video"===r&&a&&(s=zn.ts.parsePesTime(i))&&(s.type="video",n.video.push(s),h=!0)}if(h)break;c-=188,d-=188}},$n=function(e,t){if(e.audio&&e.audio.length){var n=t;(void 0===n||isNaN(n))&&(n=e.audio[0].dts),e.audio.forEach(function(e){e.dts=Gn(e.dts,n),e.pts=Gn(e.pts,n),e.dtsTime=e.dts/Xn,e.ptsTime=e.pts/Xn})}if(e.video&&e.video.length){var i=t;if((void 0===i||isNaN(i))&&(i=e.video[0].dts),e.video.forEach(function(e){e.dts=Gn(e.dts,i),e.pts=Gn(e.pts,i),e.dtsTime=e.dts/Xn,e.ptsTime=e.pts/Xn}),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=Gn(r.dts,i),r.pts=Gn(r.pts,i),r.dtsTime=r.dts/Xn,r.ptsTime=r.pts/Xn}}},Jn=function(e){for(var t,n=!1,i=0,r=null,a=null,s=0,o=0;e.length-o>=3;){switch(zn.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){n=!0;break}if((s=zn.aac.parseId3TagSize(e,o))>e.length){n=!0;break}null===a&&(t=e.subarray(o,o+s),a=zn.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7){n=!0;break}if((s=zn.aac.parseAdtsSize(e,o))>e.length){n=!0;break}null===r&&(t=e.subarray(o,o+s),r=zn.aac.parseSampleRate(t)),i++,o+=s;break;default:o++}if(n)return null}if(null===r||null===a)return null;var u=Xn/r;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*i*u,pts:a+1024*i*u}]}},Zn=function(e){var t={pid:null,table:null},n={};Yn(e,t);for(var i in t.table)if(t.table.hasOwnProperty(i)){var r=t.table[i];switch(r){case Ve.H264_STREAM_TYPE:n.video=[],Qn(e,t,n),0===n.video.length&&delete n.video;break;case Ve.ADTS_STREAM_TYPE:n.audio=[],Kn(e,t,n),0===n.audio.length&&delete n.audio}}return n},ei=function(e,t){var n,i=zn.aac.isLikelyAacData(e);return(n=i?Jn(e):Zn(e))&&(n.audio||n.video)?($n(n,t),n):null},ti={inspect:ei,parseAudioPes_:Kn},ni=function(e,t){t.on("data",function(t){var n=t.initSegment;t.initSegment={data:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength};var i=t.data;t.data=i.buffer,e.postMessage({action:"data",segment:t,byteOffset:i.byteOffset,byteLength:i.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){var n={start:{decode:pe.videoTsToSeconds(t.start.dts),presentation:pe.videoTsToSeconds(t.start.pts)},end:{decode:pe.videoTsToSeconds(t.end.dts),presentation:pe.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:pe.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=pe.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:n})}),t.on("audioSegmentTimingInfo",function(t){var n={start:{decode:pe.videoTsToSeconds(t.start.dts),presentation:pe.videoTsToSeconds(t.start.pts)},end:{decode:pe.videoTsToSeconds(t.end.dts),presentation:pe.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:pe.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=pe.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:pe.videoTsToSeconds(t.start),end:pe.videoTsToSeconds(t.end)}})}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:pe.videoTsToSeconds(t.start),end:pe.videoTsToSeconds(t.end)}})}),t.on("log",function(t){e.postMessage({action:"log",log:t})})},ii=function(){function e(e,t){this.options=t||{},this.self=e,this.init()}var t=e.prototype;return t.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Xt.Transmuxer(this.options),ni(this.self,this.transmuxer)},t.pushMp4Captions=function(e){this.captionParser||(this.captionParser=new xn,this.captionParser.init());var 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])},t.probeMp4StartTime=function(e){var t=e.timescales,n=e.data,i=Dn.startTime(t,n);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:n},[n.buffer])},t.probeMp4Tracks=function(e){var t=e.data,n=Dn.tracks(t);this.self.postMessage({action:"probeMp4Tracks",tracks:n,data:t},[t.buffer])},t.probeTs=function(e){var t=e.data,n=e.baseStartTime,i="number"!=typeof n||isNaN(n)?void 0:n*pe.ONE_SECOND_IN_TS,r=ti.inspect(t,i),a=null;r&&(a={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1},a.hasVideo&&(a.videoStart=r.video[0].ptsTime),a.hasAudio&&(a.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:a,data:t},[t.buffer])},t.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},t.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},t.push=function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)},t.reset=function(){this.transmuxer.reset()},t.setTimestampOffset=function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(pe.secondsToVideoTs(t)))},t.setAudioAppendStart=function(e){this.transmuxer.setAudioAppendStart(Math.ceil(pe.secondsToVideoTs(e.appendStart)))},t.setRemux=function(e){this.transmuxer.setRemux(e.remux)},t.flush=function(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},t.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},t.alignGopsWith=function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())},e}();self.onmessage=function(e){if("init"===e.data.action&&e.data.options)return void(this.messageHandlers=new ii(self,e.data.options));this.messageHandlers||(this.messageHandlers=new ii(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data)}})),Et=_t(St),wt=function(e,t,n){var i=e.data.segment,r=i.type,a=i.initSegment,s=i.captions,o=i.captionStreams,u=i.metadata,l=i.videoFrameDtsTime,c=i.videoFramePtsTime;t.buffer.push({captions:s,captionStreams:o,metadata:u});var d=e.data.segment.boxes||{data:e.data.segment.data},h={type:r,data:new Uint8Array(d.data,d.data.byteOffset,d.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};void 0!==l&&(h.videoFrameDtsTime=l),void 0!==c&&(h.videoFramePtsTime=c),n(h)},kt=function(e){var t=e.transmuxedData,n=e.callback;t.buffer=[],n(t)},Ct=function(e,t){t.gopInfo=e.data.gopInfo},At=function(e){var t=e.transmuxer,n=e.bytes,i=e.audioAppendStart,r=e.gopsToAlignWith,a=e.remux,s=e.onData,o=e.onTrackInfo,u=e.onAudioTimingInfo,l=e.onVideoTimingInfo,c=e.onVideoSegmentTimingInfo,d=e.onAudioSegmentTimingInfo,h=e.onId3,p=e.onCaptions,f=e.onDone,m=e.onEndedTimeline,g=e.onTransmuxerLog,y=e.isEndOfTimeline,v={buffer:[]},_=y,b=function(n){t.currentTransmux===e&&("data"===n.data.action&&wt(n,v,s),"trackinfo"===n.data.action&&o(n.data.trackInfo),"gopInfo"===n.data.action&&Ct(n,v),"audioTimingInfo"===n.data.action&&u(n.data.audioTimingInfo),"videoTimingInfo"===n.data.action&&l(n.data.videoTimingInfo),"videoSegmentTimingInfo"===n.data.action&&c(n.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===n.data.action&&d(n.data.audioSegmentTimingInfo),"id3Frame"===n.data.action&&h([n.data.id3Frame],n.data.id3Frame.dispatchType),"caption"===n.data.action&&p(n.data.caption),"endedtimeline"===n.data.action&&(_=!1,m()),"log"===n.data.action&&g(n.data.log),"transmuxed"===n.data.type&&(_||(t.onmessage=null,kt({transmuxedData:v,callback:f}),It(t))))};if(t.onmessage=b,i&&t.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),void 0!==a&&t.postMessage({action:"setRemux",remux:a}),n.byteLength){var T=n instanceof ArrayBuffer?n:n.buffer,S=n instanceof ArrayBuffer?0:n.byteOffset;t.postMessage({action:"push",data:T,byteOffset:S,byteLength:n.byteLength},[T])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},It=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():At(e.currentTransmux))},xt=function(e,t){e.postMessage({action:t}),It(e)},Pt=function(e,t){if(!t.currentTransmux)return t.currentTransmux=e,void xt(t,e);t.transmuxQueue.push(xt.bind(null,t,e))},Ot=function(e){Pt("reset",e)},Lt=function(e){Pt("endTimeline",e)},Dt=function(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void At(e);e.transmuxer.transmuxQueue.push(e)},Rt=function(e){var t=new Et;t.currentTransmux=null,t.transmuxQueue=[];var n=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,n.call(t)},t.postMessage({action:"init",options:e}),t},Mt={reset:Ot,endTimeline:Lt,transmux:Dt,createTransmuxer:Rt},Nt=function(e){var t=e.transmuxer,n=e.endAction||e.action,i=e.callback,r=g()({},e,{endAction:null,transmuxer:null,callback:null}),a=function r(a){a.data.action===n&&(t.removeEventListener("message",r),a.data.data&&(a.data.data=new Uint8Array(a.data.data,e.byteOffset||0,e.byteLength||a.data.data.byteLength),e.data&&(e.data=a.data.data)),i(a.data))};if(t.addEventListener("message",a),e.data){var s=e.data instanceof ArrayBuffer;r.byteOffset=s?0:e.data.byteOffset,r.byteLength=e.data.byteLength;var o=[s?e.data:e.data.buffer];t.postMessage(r,o)}else t.postMessage(r)},Ut={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Bt=function(e){e.forEach(function(e){e.abort()})},jt=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}},Ft=function(e){var t=e.target,n=Date.now()-t.requestTime,i={bandwidth:1/0,bytesReceived:0,roundTripTime:n||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i},Ht=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Ut.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Ut.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Ut.FAILURE,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:Ut.FAILURE,xhr:t}:null},qt=function(e,t,n){return function(i,r){var a=r.response,s=Ht(i,r);if(s)return n(s,e);if(16!==a.byteLength)return n({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:Ut.FAILURE,xhr:r},e);for(var o=new DataView(a),u=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]),l=0;l<t.length;l++)t[l].bytes=u;return n(null,e)}},Vt=function(e,t){var n=Object(C.a)(e.map.bytes);if("mp4"!==n){var i=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:"Found unsupported "+(n||"unknown")+" container for initialization segment at URL: "+i,code:Ut.FAILURE})}Nt({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:function(n){var i=n.tracks,r=n.data;return e.map.bytes=r,i.forEach(function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||(e.map.tracks[t.type]=t,"number"==typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale))}),t(null)}})},Wt=function(e){var t=e.segment,n=e.finishProcessingFn;return function(e,i){var r=Ht(e,i);if(r)return n(r,t);var a=new Uint8Array(i.response);if(t.map.key)return t.map.encryptedBytes=a,n(null,t);t.map.bytes=a,Vt(t,function(e){if(e)return e.xhr=i,e.status=i.status,n(e,t);n(null,t)})}},Gt=function(e){var t=e.segment,n=e.finishProcessingFn,i=e.responseType;return function(e,r){var a=Ht(e,r);if(a)return n(a,t);var s="arraybuffer"!==i&&r.responseText?gt(r.responseText.substring(t.lastReachedChar||0)):r.response;return t.stats=jt(r),t.key?t.encryptedBytes=new Uint8Array(s):t.bytes=new Uint8Array(s),n(null,t)}},zt=function(e){var t=e.segment,n=e.bytes,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=t.map&&t.map.tracks||{},m=Boolean(f.audio&&f.video),g=r.bind(null,t,"audio","start"),y=r.bind(null,t,"audio","end"),v=r.bind(null,t,"video","start"),_=r.bind(null,t,"video","end"),b=function(){return Dt({bytes:n,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:m,onData:function(e){e.type="combined"===e.type?"video":e.type,d(t,e)},onTrackInfo:function(e){i&&(m&&(e.isMuxed=!0),i(t,e))},onAudioTimingInfo:function(e){g&&void 0!==e.start&&(g(e.start),g=null),y&&void 0!==e.end&&y(e.end)},onVideoTimingInfo:function(e){v&&void 0!==e.start&&(v(e.start),v=null),_&&void 0!==e.end&&_(e.end)},onVideoSegmentTimingInfo:function(e){a(e)},onAudioSegmentTimingInfo:function(e){s(e)},onId3:function(e,n){o(t,e,n)},onCaptions:function(e){u(t,[e])},isEndOfTimeline:l,onEndedTimeline:function(){c()},onTransmuxerLog:p,onDone:function(e){h&&(e.type="combined"===e.type?"video":e.type,h(null,t,e))}})};Nt({action:"probeTs",transmuxer:t.transmuxer,data:n,baseStartTime:t.baseStartTime,callback:function(e){t.bytes=n=e.data;var r=e.result;r&&(i(t,{hasAudio:r.hasAudio,hasVideo:r.hasVideo,isMuxed:m}),i=null,r.hasAudio&&!m&&g(r.audioStart),r.hasVideo&&v(r.videoStart),g=null,v=null),b()}})},Xt=function(e){var t=e.segment,n=e.bytes,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,m=new Uint8Array(n);if(Object(C.b)(m)){t.isFmp4=!0;var g=t.map.tracks,y={isFmp4:!0,hasVideo:!!g.video,hasAudio:!!g.audio};g.audio&&g.audio.codec&&"enca"!==g.audio.codec&&(y.audioCodec=g.audio.codec),g.video&&g.video.codec&&"encv"!==g.video.codec&&(y.videoCodec=g.video.codec),g.video&&g.audio&&(y.isMuxed=!0),i(t,y);var v=function(e){d(t,{data:m,type:y.hasAudio&&!y.isMuxed?"audio":"video"}),e&&e.length&&u(t,e),h(null,t,{})};return void Nt({action:"probeMp4StartTime",timescales:t.map.timescales,data:m,transmuxer:t.transmuxer,callback:function(e){var i=e.data,a=e.startTime;if(n=i.buffer,t.bytes=m=i,y.hasAudio&&!y.isMuxed&&r(t,"audio","start",a),y.hasVideo&&r(t,"video","start",a),!g.video||!i.byteLength||!t.transmuxer)return void v();Nt({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:m,timescales:t.map.timescales,trackIds:[g.video.id],callback:function(e){n=e.data.buffer,t.bytes=m=e.data,e.logs.forEach(function(e){p(f.a.mergeOptions(e,{stream:"mp4CaptionParser"}))}),v(e.captions)}})}})}return t.transmuxer?(void 0===t.container&&(t.container=Object(C.a)(m)),"ts"!==t.container&&"aac"!==t.container?(i(t,{hasAudio:!1,hasVideo:!1}),void h(null,t,{})):void zt({segment:t,bytes:n,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})):void h(null,t,{})},Yt=function(e,t){var n=e.id,i=e.key,r=e.encryptedBytes,a=e.decryptionWorker,s=function e(i){if(i.data.source===n){a.removeEventListener("message",e);var r=i.data.decrypted;t(new Uint8Array(r.bytes,r.byteOffset,r.byteLength))}};a.addEventListener("message",s);var o;o=i.bytes.slice?i.bytes.slice():new Uint32Array(Array.prototype.slice.call(i.bytes)),a.postMessage(Ve({source:n,encrypted:r,key:o,iv:i.iv}),[r.buffer,o.buffer])},Kt=function(e){var t=e.decryptionWorker,n=e.segment,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog;Yt({id:n.requestId,key:n.key,encryptedBytes:n.encryptedBytes,decryptionWorker:t},function(e){n.bytes=e,Xt({segment:n,bytes:n.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})})},Qt=function(e){var t=e.activeXhrs,n=e.decryptionWorker,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=0,m=!1;return function(e,g){if(!m){if(e)return m=!0,Bt(t),h(e,g);if((f+=1)===t.length){var y=function(){if(g.encryptedBytes)return Kt({decryptionWorker:n,segment:g,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p});Xt({segment:g,bytes:g.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})};if(g.endOfAllRequests=Date.now(),g.map&&g.map.encryptedBytes&&!g.map.bytes)return Yt({decryptionWorker:n,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key},function(e){g.map.bytes=e,Vt(g,function(e){if(e)return Bt(t),h(e,g);y()})});y()}}}},$t=function(e){var t=e.loadendState,n=e.abortFn;return function(e){e.target.aborted&&n&&!t.calledAbortFn&&(n(),t.calledAbortFn=!0)}},Jt=function(e){var t=e.segment,n=e.progressFn;return e.trackInfoFn,e.timingInfoFn,e.videoSegmentTimingInfoFn,e.audioSegmentTimingInfoFn,e.id3Fn,e.captionsFn,e.isEndOfTimeline,e.endedTimelineFn,e.dataFn,function(e){if(!e.target.aborted)return t.stats=f.a.mergeOptions(t.stats,Ft(e)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),n(e,t)}},Zt=function(e){var t=e.xhr,n=e.xhrOptions,i=e.decryptionWorker,r=e.segment,a=e.abortFn,s=e.progressFn,o=e.trackInfoFn,u=e.timingInfoFn,l=e.videoSegmentTimingInfoFn,c=e.audioSegmentTimingInfoFn,d=e.id3Fn,h=e.captionsFn,p=e.isEndOfTimeline,m=e.endedTimelineFn,g=e.dataFn,y=e.doneFn,v=e.onTransmuxerLog,_=[],b=Qt({activeXhrs:_,decryptionWorker:i,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:d,captionsFn:h,isEndOfTimeline:p,endedTimelineFn:m,dataFn:g,doneFn:y,onTransmuxerLog:v});if(r.key&&!r.key.bytes){var T=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&T.push(r.map.key);var S=f.a.mergeOptions(n,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),E=qt(r,T,b),w=t(S,E);_.push(w)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){var k=f.a.mergeOptions(n,{uri:r.map.key.resolvedUri,responseType:"arraybuffer"}),C=qt(r,[r.map.key],b),A=t(k,C);_.push(A)}var I=f.a.mergeOptions(n,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:je(r.map)}),x=Wt({segment:r,finishProcessingFn:b}),P=t(I,x);_.push(P)}var O=f.a.mergeOptions(n,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:je(r)}),L=Gt({segment:r,finishProcessingFn:b,responseType:O.responseType}),D=t(O,L);D.addEventListener("progress",Jt({segment:r,progressFn:s,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:d,captionsFn:h,isEndOfTimeline:p,endedTimelineFn:m,dataFn:g})),_.push(D);var R={};return _.forEach(function(e){e.addEventListener("loadend",$t({loadendState:R,abortFn:a}))}),function(){return Bt(_)}},en=P("CodecUtils"),tn=function(e){var t=e.attributes||{};if(t.CODECS)return Object(v.h)(t.CODECS)},nn=function(e,t){var n=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&n.AUDIO&&e.mediaGroups.AUDIO[n.AUDIO]},rn=function(e,t){if(!nn(e,t))return!0;var n=t.attributes||{},i=e.mediaGroups.AUDIO[n.AUDIO];for(var r in i)if(!i[r].uri&&!i[r].playlists)return!0;return!1},an=function(e){var t={};return e.forEach(function(e){var n=e.mediaType,i=e.type,r=e.details;t[n]=t[n]||[],t[n].push(Object(v.i)(""+i+r))}),Object.keys(t).forEach(function(e){if(t[e].length>1)return en("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."),void(t[e]=null);t[e]=t[e][0]}),t},sn=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},on=function(e,t){var n=t.attributes||{},i=an(tn(t)||[]);if(nn(e,t)&&!i.audio&&!rn(e,t)){var r=an(Object(v.d)(e,n.AUDIO)||[]);r.audio&&(i.audio=r.audio)}return i},un=P("PlaylistSelector"),ln=function(e){if(e&&e.playlist){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}},cn=function(e,t){if(!e)return"";var n=d.a.getComputedStyle(e);return n?n[t]:""},dn=function(e,t){var n=e.slice();e.sort(function(e,i){var r=t(e,i);return 0===r?n.indexOf(e)-n.indexOf(i):r})},hn=function(e,t){var n,i;return e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||d.a.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(i=t.attributes.BANDWIDTH),i=i||d.a.Number.MAX_VALUE,n-i},pn=function(e,t){var n,i;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||d.a.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(i=t.attributes.RESOLUTION.width),i=i||d.a.Number.MAX_VALUE,n===i&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:n-i},fn=function(e,t,n,i,r,a){if(e){var s={bandwidth:t,width:n,height:i,limitRenditionByPlayerDimensions:r},o=e.playlists;pe.isAudioOnly(e)&&(o=a.getAudioTrackPlaylists_(),s.audioOnly=!0);var u=o.map(function(e){var t,n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t=t||d.a.Number.MAX_VALUE,{bandwidth:t,width:n,height:i,playlist:e}});dn(u,function(e,t){return e.bandwidth-t.bandwidth}),u=u.filter(function(e){return!pe.isIncompatible(e.playlist)});var l=u.filter(function(e){return pe.isEnabled(e.playlist)});l.length||(l=u.filter(function(e){return!pe.isDisabled(e.playlist)}));var c=l.filter(function(e){return e.bandwidth*mt.BANDWIDTH_VARIANCE<t}),h=c[c.length-1],p=c.filter(function(e){return e.bandwidth===h.bandwidth})[0];if(!1===r){var f=p||l[0]||u[0];if(f&&f.playlist){var m="sortedPlaylistReps";return p&&(m="bandwidthBestRep"),l[0]&&(m="enabledPlaylistReps"),un("choosing "+ln(f)+" using "+m+" with options",s),f.playlist}return un("could not choose a playlist with options",s),null}var g=c.filter(function(e){return e.width&&e.height});dn(g,function(e,t){return e.width-t.width});var y=g.filter(function(e){return e.width===n&&e.height===i});h=y[y.length-1];var v,_,b,T=y.filter(function(e){return e.bandwidth===h.bandwidth})[0];T||(v=g.filter(function(e){return e.width>n||e.height>i}),_=v.filter(function(e){return e.width===v[0].width&&e.height===v[0].height}),h=_[_.length-1],b=_.filter(function(e){return e.bandwidth===h.bandwidth})[0]);var S;if(a.experimentalLeastPixelDiffSelector){var E=g.map(function(e){return e.pixelDiff=Math.abs(e.width-n)+Math.abs(e.height-i),e});dn(E,function(e,t){return e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff}),S=E[0]}var w=S||b||T||p||l[0]||u[0];if(w&&w.playlist){var k="sortedPlaylistReps";return S?k="leastPixelDiffRep":b?k="resolutionPlusOneRep":T?k="resolutionBestRep":p?k="bandwidthBestRep":l[0]&&(k="enabledPlaylistReps"),un("choosing "+ln(w)+" using "+k+" with options",s),w.playlist}return un("could not choose a playlist with options",s),null}},mn=function(){var e=this.useDevicePixelRatio?d.a.devicePixelRatio||1:1;return fn(this.playlists.master,this.systemBandwidth,parseInt(cn(this.tech_.el(),"width"),10)*e,parseInt(cn(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},gn=function(e){var t=-1,n=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var i=this.useDevicePixelRatio?d.a.devicePixelRatio||1:1;return t<0&&(t=this.systemBandwidth,n=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==n&&(t=e*this.systemBandwidth+(1-e)*t,n=this.systemBandwidth),fn(this.playlists.master,t,parseInt(cn(this.tech_.el(),"width"),10)*i,parseInt(cn(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},yn=function(e){var t=e.master,n=e.currentTime,i=e.bandwidth,r=e.duration,a=e.segmentDuration,s=e.timeUntilRebuffer,o=e.currentTimeline,u=e.syncController,l=t.playlists.filter(function(e){return!pe.isIncompatible(e)}),c=l.filter(pe.isEnabled);c.length||(c=l.filter(function(e){return!pe.isDisabled(e)}));var d=c.filter(pe.hasAttribute.bind(null,"BANDWIDTH")),h=d.map(function(e){var t=u.getSyncPoint(e,r,o,n),l=t?1:2;return{playlist:e,rebufferingImpact:pe.estimateSegmentRequestTime(a,i,e)*l-s}}),p=h.filter(function(e){return e.rebufferingImpact<=0});return dn(p,function(e,t){return hn(t.playlist,e.playlist)}),p.length?p[0]:(dn(h,function(e,t){return e.rebufferingImpact-t.rebufferingImpact}),h[0]||null)},vn=function(){var e=this,t=this.playlists.master.playlists.filter(pe.isEnabled);return dn(t,function(e,t){return hn(e,t)}),t.filter(function(t){return!!on(e.playlists.master,t).video})[0]||null},_n=function(e){var t,n=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach(function(e){t.set(e,n),n+=e.byteLength})),t},bn=function(e,t,n){if(!e[n]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var i=n;/^cc708_/.test(n)&&(i="SERVICE"+n.split("_")[1]);var r=t.textTracks().getTrackById(i);if(r)e[n]=r;else{var a=t.options_.vhs&&t.options_.vhs.captionServices||{},s=n,o=n,u=!1,l=a[i];l&&(s=l.label,o=l.language,u=l.default),e[n]=t.addRemoteTextTrack({kind:"captions",id:i,default:u,label:s,language:o},!1).track}}},Tn=function(e){var t=e.inbandTextTracks,n=e.captionArray,i=e.timestampOffset;if(n){var r=d.a.WebKitDataCue||d.a.VTTCue;n.forEach(function(e){var n=e.stream;t[n].addCue(new r(e.startTime+i,e.endTime+i,e.text))})}},Sn=function(e){Object.defineProperties(e.frame,{id:{get:function(){return f.a.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return f.a.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return f.a.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},En=function(e){var t=e.inbandTextTracks,n=e.metadataArray,i=e.timestampOffset,r=e.videoDuration;if(n){var a=d.a.WebKitDataCue||d.a.VTTCue,s=t.metadataTrack_;if(s&&(n.forEach(function(e){var t=e.cueTime+i;!("number"!=typeof t||d.a.isNaN(t)||t<0)&&t<1/0&&e.frames.forEach(function(e){var n=new a(t,t,e.value||e.url||e.data||"");n.frame=e,n.value=e,Sn(n),s.addCue(n)})}),s.cues&&s.cues.length)){for(var o=s.cues,u=[],l=0;l<o.length;l++)o[l]&&u.push(o[l]);var c=u.reduce(function(e,t){var n=e[t.startTime]||[];return n.push(t),e[t.startTime]=n,e},{}),h=Object.keys(c).sort(function(e,t){return Number(e)-Number(t)});h.forEach(function(e,t){var n=c[e],i=Number(h[t+1])||r;n.forEach(function(e){e.endTime=i})})}}},wn=function(e,t,n){e.metadataTrack_||(e.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)},kn=function(e,t,n){var i,r;if(n&&n.cues)for(i=n.cues.length;i--;)r=n.cues[i],r.startTime>=e&&r.endTime<=t&&n.removeCue(r)},Cn=function(e){var t=e.cues;if(t)for(var n=0;n<t.length;n++){for(var i=[],r=0,a=0;a<t.length;a++)t[n].startTime===t[a].startTime&&t[n].endTime===t[a].endTime&&t[n].text===t[a].text&&++r>1&&i.push(t[a]);i.length&&i.forEach(function(t){return e.removeCue(t)})}},An=function(e,t,n){if(void 0===t||null===t||!e.length)return[];var i,r=Math.ceil((t-n+3)*A.ONE_SECOND_IN_TS);for(i=0;i<e.length&&!(e[i].pts>r);i++);return e.slice(i)},In=function(e,t,n){if(!t.length)return e;if(n)return t.slice();var i=t[0].pts,r=0;for(r;r<e.length&&!(e[r].pts>=i);r++);return e.slice(0,r).concat(t)},xn=function(e,t,n,i){for(var r=Math.ceil((t-i)*A.ONE_SECOND_IN_TS),a=Math.ceil((n-i)*A.ONE_SECOND_IN_TS),s=e.slice(),o=e.length;o--&&!(e[o].pts<=a););if(-1===o)return s;for(var u=o+1;u--&&!(e[u].pts<=r););return u=Math.max(u,0),s.splice(u,o-u+1),s},Pn=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;var n=Object.keys(e).sort(),i=Object.keys(t).sort();if(n.length!==i.length)return!1;for(var r=0;r<n.length;r++){var a=n[r];if(a!==i[r])return!1;if(e[a]!==t[a])return!1}return!0},On=function(e,t,n){t=t||[];for(var i=[],r=0,a=0;a<t.length;a++){var s=t[a];if(e===s.timeline&&(i.push(a),(r+=s.duration)>n))return a}return 0===i.length?0:i[i.length-1]},Ln=function(e){return"number"==typeof e&&isFinite(e)},Dn=function(e,t,n){return"main"===e&&t&&n?n.hasAudio||n.hasVideo?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:"Neither audio nor video found in segment.":null},Rn=function(e,t,n){var i=t-mt.BACK_BUFFER_LENGTH;e.length&&(i=Math.max(i,e.start(0)));var r=t-n;return Math.min(r,i)},Mn=function(e){var t=e.startOfSegment,n=e.duration,i=e.segment,r=e.part,a=e.playlist,s=a.mediaSequence,o=a.id,u=a.segments,l=void 0===u?[]:u,c=e.mediaIndex,d=e.partIndex,h=e.timeline,p=l.length-1,f="mediaIndex/partIndex increment";e.getMediaInfoForTime?f="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(f="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(f+=" with independent "+e.independent);var m="number"==typeof d,g=e.segment.uri?"segment":"pre-segment",y=m?z({preloadSegment:i})-1:0;return g+" ["+(s+c)+"/"+(s+p)+"]"+(m?" part ["+d+"/"+y+"]":"")+" segment start/end ["+i.start+" => "+i.end+"]"+(m?" part start/end ["+r.start+" => "+r.end+"]":"")+" startOfSegment ["+t+"] duration ["+n+"] timeline ["+h+"] selected by ["+f+"] playlist ["+o+"]"},Nn=function(e){return e+"TimingInfo"},Un=function(e){var t=e.segmentTimeline,n=e.currentTimeline,i=e.startOfSegment,r=e.buffered;return e.overrideCheck||t!==n?t<n?i:r.length?r.end(r.length-1):i:null},Bn=function(e){var t=e.timelineChangeController,n=e.currentTimeline,i=e.segmentTimeline,r=e.loaderType,a=e.audioDisabled;if(n===i)return!1;if("audio"===r){var s=t.lastTimelineChange({type:"main"});return!s||s.to!==i}if("main"===r&&a){var o=t.pendingTimelineChange({type:"audio"});return!o||o.to!==i}return!1},jn=function(e){var t=0;return["video","audio"].forEach(function(n){var i=e[n+"TimingInfo"];if(i){var r,a=i.start,s=i.end;"bigint"==typeof a||"bigint"==typeof s?r=d.a.BigInt(s)-d.a.BigInt(a):"number"==typeof a&&"number"==typeof s&&(r=s-a),void 0!==r&&r>t&&(t=r)}}),"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t},Fn=function(e){var t=e.segmentDuration,n=e.maxDuration;return!!t&&Math.round(t)>n+1/30},Hn=function(e,t){if("hls"!==t)return null;var n=jn({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!n)return null;var i=e.playlist.targetDuration,r=Fn({segmentDuration:n,maxDuration:2*i}),a=Fn({segmentDuration:n,maxDuration:i}),s="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 "+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||a?{severity:r?"warn":"info",message:s}:null},qn=function(e){function t(t,n){var i;if(i=e.call(this)||this,!t)throw new TypeError("Initialization settings are required");if("function"!=typeof t.currentTime)throw new TypeError("No currentTime getter specified");if(!t.mediaSource)throw new TypeError("No MediaSource specified");return i.bandwidth=t.bandwidth,i.throughput={rate:0,count:0},i.roundTrip=NaN,i.resetStats_(),i.mediaIndex=null,i.partIndex=null,i.hasPlayed_=t.hasPlayed,i.currentTime_=t.currentTime,i.seekable_=t.seekable,i.seeking_=t.seeking,i.duration_=t.duration,i.mediaSource_=t.mediaSource,i.vhs_=t.vhs,i.loaderType_=t.loaderType,i.currentMediaInfo_=void 0,i.startingMediaInfo_=void 0,i.segmentMetadataTrack_=t.segmentMetadataTrack,i.goalBufferLength_=t.goalBufferLength,i.sourceType_=t.sourceType,i.sourceUpdater_=t.sourceUpdater,i.inbandTextTracks_=t.inbandTextTracks,i.state_="INIT",i.timelineChangeController_=t.timelineChangeController,i.shouldSaveSegmentTimingInfo_=!0,i.parse708captions_=t.parse708captions,i.useDtsForTimestampOffset_=t.useDtsForTimestampOffset,i.captionServices_=t.captionServices,i.experimentalExactManifestTimings=t.experimentalExactManifestTimings,i.checkBufferTimeout_=null,i.error_=void 0,i.currentTimeline_=-1,i.pendingSegment_=null,i.xhrOptions_=null,i.pendingSegments_=[],i.audioDisabled_=!1,i.isPendingTimestampOffset_=!1,i.gopBuffer_=[],i.timeMapping_=0,i.safeAppend_=f.a.browser.IE_VERSION>=11,i.appendInitSegment_={audio:!0,video:!0},i.playlistOfLastInitSegment_={audio:null,video:null},i.callQueue_=[],i.loadQueue_=[],i.metadataQueue_={id3:[],caption:[]},i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=null,i.activeInitSegmentId_=null,i.initSegments_={},i.cacheEncryptionKeys_=t.cacheEncryptionKeys,i.keyCache_={},i.decrypter_=t.decrypter,i.syncController_=t.syncController,i.syncPoint_={segmentIndex:0,time:0},i.transmuxer_=i.createTransmuxer_(),i.triggerSyncInfoUpdate_=function(){return i.trigger("syncinfoupdate")},i.syncController_.on("syncinfoupdate",i.triggerSyncInfoUpdate_),i.mediaSource_.addEventListener("sourceopen",function(){i.isEndOfStream_()||(i.ended_=!1)}),i.fetchAtBuffer_=!1,i.logger_=P("SegmentLoader["+i.loaderType_+"]"),Object.defineProperty(a()(i),"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"))}}),i.sourceUpdater_.on("ready",function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),"main"===i.loaderType_&&i.timelineChangeController_.on("pendingtimelinechange",function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),"audio"===i.loaderType_&&i.timelineChangeController_.on("timelinechange",function(){i.hasEnoughInfoToLoad_()&&i.processLoadQueue_(),i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),i}o()(t,e);var n=t.prototype;return n.createTransmuxer_=function(){return Mt.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},n.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},n.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&d.a.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},n.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},n.abort=function(){if("WAITING"!==this.state)return void(this.pendingSegment_&&(this.pendingSegment_=null));this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()},n.abort_=function(){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,d.a.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},n.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},n.error=function(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},n.endOfStream=function(){this.ended_=!0,this.transmuxer_&&Mt.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},n.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return f.a.createTimeRanges();if("main"===this.loaderType_){var t=e.hasAudio,n=e.hasVideo,i=e.isMuxed;if(n&&t&&!this.audioDisabled_&&!i)return this.sourceUpdater_.buffered();if(n)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},n.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var n=We(e),i=this.initSegments_[n];return t&&!i&&e.bytes&&(this.initSegments_[n]=i={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),i||e},n.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var n=Ge(e),i=this.keyCache_[n];this.cacheEncryptionKeys_&&t&&!i&&e.bytes&&(this.keyCache_[n]=i={resolvedUri:e.resolvedUri,bytes:e.bytes});var r={resolvedUri:(i||e).resolvedUri};return i&&(r.bytes=i.bytes),r},n.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},n.load=function(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))},n.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},n.playlist=function(e,t){if(void 0===t&&(t={}),e){var n=this.playlist_,i=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var r=null;if(n&&(n.id?r=n.id:n.uri&&(r=n.uri)),this.logger_("playlist update ["+r+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!n||n.uri!==e.uri)return null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var a=e.mediaSequence-n.mediaSequence;if(this.logger_("live window shift ["+a+"]"),null!==this.mediaIndex)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var s=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!s.parts||!s.parts.length||!s.parts[this.partIndex])){var o=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=o}}i&&(i.mediaIndex-=a,i.mediaIndex<0?(i.mediaIndex=null,i.partIndex=null):(i.mediaIndex>=0&&(i.segment=e.segments[i.mediaIndex]),i.partIndex>=0&&i.segment.parts&&(i.part=i.segment.parts[i.partIndex]))),this.syncController_.saveExpiredSegmentInfo(n,e)}},n.pause=function(){this.checkBufferTimeout_&&(d.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},n.paused=function(){return null===this.checkBufferTimeout_},n.resetEverything=function(e){this.ended_=!1,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"}))},n.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},n.resyncLoader=function(){this.transmuxer_&&Mt.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},n.remove=function(e,t,n,i){if(void 0===n&&(n=function(){}),void 0===i&&(i=!1),t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");var r=1,a=function(){0===--r&&n()};!i&&this.audioDisabled_||(r++,this.sourceUpdater_.removeAudio(e,t,a)),(i||"main"===this.loaderType_)&&(this.gopBuffer_=xn(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,a));for(var s in this.inbandTextTracks_)kn(e,t,this.inbandTextTracks_[s]);kn(e,t,this.segmentMetadataTrack_),a()},n.monitorBuffer_=function(){this.checkBufferTimeout_&&d.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=d.a.setTimeout(this.monitorBufferTick_.bind(this),1)},n.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&d.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=d.a.setTimeout(this.monitorBufferTick_.bind(this),500)},n.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},n.isEndOfStream_=function(e,t,n){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===n&&(n=this.partIndex),!t||!this.mediaSource_)return!1;var i="number"==typeof e&&t.segments[e],r=e+1===t.segments.length,a=!i||!i.parts||n+1===i.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&a},n.chooseNextRequest_=function(){var e=this.buffered_(),t=F(e)||0,n=H(e,this.currentTime_()),i=!this.hasPlayed_()&&n>=1,r=n>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||i||r)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var s={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(s.isSyncRequest)s.mediaIndex=On(this.currentTimeline_,a,t);else if(null!==this.mediaIndex){var o=a[this.mediaIndex],u="number"==typeof this.partIndex?this.partIndex:-1;s.startOfSegment=o.end?o.end:t,o.parts&&o.parts[u+1]?(s.mediaIndex=this.mediaIndex,s.partIndex=u+1):s.mediaIndex=this.mediaIndex+1}else{var l=pe.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),c=l.segmentIndex,d=l.startTime,h=l.partIndex;s.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+t:"currentTime "+this.currentTime_(),s.mediaIndex=c,s.startOfSegment=d,s.partIndex=h}var p=a[s.mediaIndex],f=p&&"number"==typeof s.partIndex&&p.parts&&p.parts[s.partIndex];if(!p||"number"==typeof s.partIndex&&!f)return null;if("number"!=typeof s.partIndex&&p.parts&&(s.partIndex=0,f=p.parts[0]),!n&&f&&!f.independent)if(0===s.partIndex){var m=a[s.mediaIndex-1],g=m.parts&&m.parts.length&&m.parts[m.parts.length-1];g&&g.independent&&(s.mediaIndex-=1,s.partIndex=m.parts.length-1,s.independent="previous segment")}else p.parts[s.partIndex-1].independent&&(s.partIndex-=1,s.independent="previous part");var y=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return s.mediaIndex>=a.length-1&&y&&!this.seeking_()?null:this.generateSegmentInfo_(s)},n.generateSegmentInfo_=function(e){var t=e.independent,n=e.playlist,i=e.mediaIndex,r=e.startOfSegment,a=e.isSyncRequest,s=e.partIndex,o=e.forceTimestampOffset,u=e.getMediaInfoForTime,l=n.segments[i],c="number"==typeof s&&l.parts[s],d={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||l.resolvedUri,mediaIndex:i,partIndex:c?s:null,isSyncRequest:a,startOfSegment:r,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:c&&c.duration||l.duration,segment:l,part:c,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:u,independent:t},h=void 0!==o?o:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:r,buffered:this.buffered_(),overrideCheck:h});var p=F(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(d.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=An(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d},n.timestampOffsetForSegment_=function(e){return Un(e)},n.earlyAbortWhenNeeded_=function(e){if(!this.vhs_.tech_.paused()&&this.xhrOptions_.timeout&&this.playlist_.attributes.BANDWIDTH&&!(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var t=this.currentTime_(),n=e.bandwidth,i=this.pendingSegment_.duration,r=pe.estimateSegmentRequestTime(i,n,this.playlist_,e.bytesReceived),a=U(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(!(r<=a)){var s=yn({master:this.vhs_.playlists.master,currentTime:t,bandwidth:n,duration:this.duration_(),segmentDuration:i,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(s){var o=r-a,u=o-s.rebufferingImpact,l=.5;a<=1/30&&(l=1),!s.playlist||s.playlist.uri===this.playlist_.uri||u<l||(this.bandwidth=s.playlist.attributes.BANDWIDTH*mt.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},n.handleAbort_=function(e){this.logger_("Aborting "+Mn(e)),this.mediaRequestsAborted+=1},n.handleProgress_=function(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")},n.handleTrackInfo_=function(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},Pn(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_()))},n.handleTimingInfo_=function(e,t,n,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var r=this.pendingSegment_,a=Nn(t);r[a]=r[a]||{},r[a][n]=i,this.logger_("timinginfo: "+t+" - "+n+" - "+i),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},n.handleCaptions_=function(e,t){var n=this;if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(0===t.length)return void this.logger_("SegmentLoader received no captions from a caption event");if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));var i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),r={};t.forEach(function(e){r[e.stream]=r[e.stream]||{startTime:1/0,captions:[],endTime:0};var t=r[e.stream];t.startTime=Math.min(t.startTime,e.startTime+i),t.endTime=Math.max(t.endTime,e.endTime+i),t.captions.push(e)}),Object.keys(r).forEach(function(e){var t=r[e],a=t.startTime,s=t.endTime,o=t.captions,u=n.inbandTextTracks_;n.logger_("adding cues from "+a+" -> "+s+" for "+e),bn(u,n.vhs_.tech_,e),kn(a,s,u[e]),Tn({captionArray:o,inbandTextTracks:u,timestampOffset:i})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},n.handleId3_=function(e,t,n){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,n));var i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();wn(this.inbandTextTracks_,n,this.vhs_.tech_),En({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:i,videoDuration:this.duration_()})}},n.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(e){return e()}),this.metadataQueue_.caption.forEach(function(e){return e()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},n.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach(function(e){return e()})},n.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach(function(e){return e()})},n.hasEnoughInfoToLoad_=function(){if("audio"!==this.loaderType_)return!0;var e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!Bn({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.getCurrentMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},n.getMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},n.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;var n=t.hasAudio,i=t.hasVideo,r=t.isMuxed;return!(i&&!e.videoTimingInfo)&&(!(n&&!this.audioDisabled_&&!r&&!e.audioTimingInfo)&&!Bn({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.handleData_=function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return void this.callQueue_.push(this.handleData_.bind(this,e,t));var n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.part||n.segment),"closed"!==this.mediaSource_.readyState){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[Nn(t.type)].start;else{var i,r=this.getCurrentMediaInfo_(),a="main"===this.loaderType_&&r&&r.hasVideo;a&&(i=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:a,firstVideoFrameTimeForData:i,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:"main"===this.loaderType_});var s=this.chooseNextRequest_();if(s.mediaIndex!==n.mediaIndex||s.partIndex!==n.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,t)}}},n.updateAppendInitSegmentStatus=function(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)},n.getInitSegmentAndUpdateState_=function(e){var t=e.type,n=e.initSegment,i=e.map,r=e.playlist;if(i){var a=We(i);if(this.activeInitSegmentId_===a)return null;n=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=a}return n&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=r,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,n):null},n.handleQuotaExceededError_=function(e,t){var n=this,i=e.segmentInfo,r=e.type,a=e.bytes,s=this.sourceUpdater_.audioBuffered(),o=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+B(s).join(", ")),o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+B(o).join(", "));var u=s.length?s.start(0):0,l=s.length?s.end(s.length-1):0,c=o.length?o.start(0):0,h=o.length?o.end(o.length-1):0;if(l-u<=1&&h-c<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+a.byteLength+", audio buffer: "+B(s).join(", ")+", video buffer: "+B(o).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:i,type:r,bytes:a}));var p=this.currentTime_(),f=p-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+f),this.remove(0,f,function(){n.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=d.a.setTimeout(function(){n.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),n.quotaExceededErrorRetryTimeout_=null,n.processCallQueue_()},1e3)},!0)},n.handleAppendError_=function(e,t){var n=e.segmentInfo,i=e.type,r=e.bytes;if(t){if(22===t.code)return void this.handleQuotaExceededError_({segmentInfo:n,type:i,bytes:r});this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(i+" append of "+r.length+"b failed for segment #"+n.mediaIndex+" in playlist "+n.playlist.id),this.trigger("appenderror")}},n.appendToSourceBuffer_=function(e){var t=e.segmentInfo,n=e.type,i=e.initSegment,r=e.data,a=e.bytes;if(!a){var s=[r],o=r.byteLength;i&&(s.unshift(i),o+=i.byteLength),a=_n({bytes:o,segments:s})}this.sourceUpdater_.appendBuffer({segmentInfo:t,type:n,bytes:a},this.handleAppendError_.bind(this,{segmentInfo:t,type:n,bytes:a}))},n.handleSegmentTimingInfo_=function(e,t,n){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var i=this.pendingSegment_.segment,r=e+"TimingInfo";i[r]||(i[r]={}),i[r].transmuxerPrependedSeconds=n.prependedContentDuration||0,i[r].transmuxedPresentationStart=n.start.presentation,i[r].transmuxedDecodeStart=n.start.decode,i[r].transmuxedPresentationEnd=n.end.presentation,i[r].transmuxedDecodeEnd=n.end.decode,i[r].baseMediaDecodeTime=n.baseMediaDecodeTime}},n.appendData_=function(e,t){var n=t.type,i=t.data;if(i&&i.byteLength&&("audio"!==n||!this.audioDisabled_)){var r=this.getInitSegmentAndUpdateState_({type:n,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:r,data:i})}},n.loadSegment_=function(e){var t=this;if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_())return void this.loadQueue_.push(function(){var n=g()({},e,{forceTimestampOffset:!0});g()(e,t.generateSegmentInfo_(n)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e)});this.updateTransmuxerAndRequestSegment_(e)},n.updateTransmuxerAndRequestSegment_=function(e){var t=this;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}));var n=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,a=e.timeline!==this.currentTimeline_&&e.timeline>0,s=i||r&&a;this.logger_("Requesting "+Mn(e)),n.map&&!n.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Zt({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:n,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:s,endedTimelineFn:function(){t.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(n){var i=n.message,r=n.level,a=n.stream;t.logger_(Mn(e)+" logged from transmuxer stream "+a+" as a "+r+": "+i)}})},n.trimBackBuffer_=function(e){var t=Rn(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)},n.createSimplifiedSegmentObj_=function(e){var t=e.segment,n=e.part,i={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},r=e.playlist.segments[e.mediaIndex-1];if(r&&r.timeline===t.timeline&&(r.videoTimingInfo?i.baseStartTime=r.videoTimingInfo.transmuxedDecodeEnd:r.audioTimingInfo&&(i.baseStartTime=r.audioTimingInfo.transmuxedDecodeEnd)),t.key){var a=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);i.key=this.segmentKey(t.key),i.key.iv=a}return t.map&&(i.map=this.initSegmentForMap(t.map)),i},n.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},n.saveBandwidthRelatedStats_=function(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<1/60)return void this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+1/60);this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime},n.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate")},n.segmentRequestFinished_=function(e,t,n){if(this.callQueue_.length)return void this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,n));if(this.saveTransferStats_(t.stats),this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId){if(e){if(this.pendingSegment_=null,this.state="READY",e.code===Ut.ABORTED)return;return this.pause(),e.code===Ut.TIMEOUT?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}var i=this.pendingSegment_;this.saveBandwidthRelatedStats_(i.duration,t.stats),i.endOfAllRequests=t.endOfAllRequests,n.gopInfo&&(this.gopBuffer_=In(this.gopBuffer_,n.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(i)}},n.setTimeMapping_=function(e){var t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)},n.updateMediaSecondsLoaded_=function(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},n.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},n.trueSegmentStart_=function(e){var t=e.currentStart,n=e.playlist,i=e.mediaIndex,r=e.firstVideoFrameTimeForData,a=e.currentVideoTimestampOffset,s=e.useVideoTimingInfo,o=e.videoTimingInfo,u=e.audioTimingInfo;if(void 0!==t)return t;if(!s)return u.start;var l=n.segments[i-1];return 0!==i&&l&&void 0!==l.start&&l.end===r+a?o.start:r},n.waitForAppendsToComplete_=function(e){var t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var n=t.hasAudio,i=t.hasVideo,r=t.isMuxed,a="main"===this.loaderType_&&i,s=!this.audioDisabled_&&n&&!r;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);a&&e.waitingOnAppends++,s&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),s&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},n.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||0===--e.waitingOnAppends&&this.handleAppendsDone_()},n.checkForIllegalMediaSwitch=function(e){var t=Dn(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,blacklistDuration:1/0}),this.trigger("error"),!0)},n.updateSourceBufferTimestampOffset_=function(e){if(null!==e.timestampOffset&&"number"==typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){var 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")}},n.getSegmentStartTimeForTimestampOffsetCalculation_=function(e){var t=e.videoTimingInfo,n=e.audioTimingInfo,i=e.timingInfo;return this.useDtsForTimestampOffset_?t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:n&&"number"==typeof n.transmuxedDecodeStart?n.transmuxedDecodeStart:i.start:i.start},n.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var t=this.getMediaInfo_(),n="main"===this.loaderType_&&t&&t.hasVideo,i=n&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end="number"==typeof i.end?i.end:i.start+e.duration)},n.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var t=Hn(e,this.sourceType_);if(t&&("warn"===t.severity?f.a.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_))return void this.logger_("Throwing away un-appended sync request "+Mn(e));this.logger_("Appended "+Mn(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");var n=e.segment,i=e.part,r=n.end&&this.currentTime_()-n.end>3*e.playlist.targetDuration,a=i&&i.end&&this.currentTime_()-i.end>3*e.playlist.partTargetDuration;if(r||a)return this.logger_("bad "+(r?"segment":"part")+" "+Mn(e)),void this.resetEverything();null!==this.mediaIndex&&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_()},n.recordThroughput_=function(e){if(e.duration<1/60)return void this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+1/60);var t=this.throughput.rate,n=Date.now()-e.endOfAllRequests+1,i=Math.floor(e.byteLength/n*8*1e3);this.throughput.rate+=(i-t)/++this.throughput.count},n.addSegmentMetadataCue_=function(e){if(this.segmentMetadataTrack_){var t=e.segment,n=t.start,i=t.end;if(Ln(n)&&Ln(i)){kn(n,i,this.segmentMetadataTrack_);var r=d.a.WebKitDataCue||d.a.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,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:i},s=JSON.stringify(a),o=new r(n,i,s);o.value=a,this.segmentMetadataTrack_.addCue(o)}}},t}(f.a.EventTarget),Vn=function(e){return"string"!=typeof e?e:e.replace(/./,function(e){return e.toUpperCase()})},Wn=["video","audio"],Gn=function(e,t){var n=t[e+"Buffer"];return n&&n.updating||t.queuePending[e]},zn=function(e,t){for(var n=0;n<t.length;n++){var i=t[n];if("mediaSource"===i.type)return null;if(i.type===e)return n}return null},Xn=function e(t,n){if(0!==n.queue.length){var i=0,r=n.queue[i];if("mediaSource"===r.type)return void(n.updating()||"closed"===n.mediaSource.readyState||(n.queue.shift(),r.action(n),r.doneFn&&r.doneFn(),e("audio",n),e("video",n)));if("mediaSource"!==t&&n.ready()&&"closed"!==n.mediaSource.readyState&&!Gn(t,n)){if(r.type!==t){if(null===(i=zn(t,n.queue)))return;r=n.queue[i]}return n.queue.splice(i,1),n.queuePending[t]=r,r.action(t,n),r.doneFn?void 0:(n.queuePending[t]=null,void e(t,n))}}},Yn=function(e,t){var n=t[e+"Buffer"],i=Vn(e);n&&(n.removeEventListener("updateend",t["on"+i+"UpdateEnd_"]),n.removeEventListener("error",t["on"+i+"Error_"]),t.codecs[e]=null,t[e+"Buffer"]=null)},Kn=function(e,t){return e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t)},Qn={appendBuffer:function(e,t,n){return function(i,r){var a=r[i+"Buffer"];if(Kn(r.mediaSource,a)){r.logger_("Appending segment "+t.mediaIndex+"'s "+e.length+" bytes to "+i+"Buffer");try{a.appendBuffer(e)}catch(e){r.logger_("Error with code "+e.code+" "+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+"when appending segment "+t.mediaIndex+" to "+i+"Buffer"),r.queuePending[i]=null,n(e)}}}},remove:function(e,t){return function(n,i){var r=i[n+"Buffer"];if(Kn(i.mediaSource,r)){i.logger_("Removing "+e+" to "+t+" from "+n+"Buffer");try{r.remove(e,t)}catch(r){i.logger_("Remove "+e+" to "+t+" from "+n+"Buffer failed")}}}},timestampOffset:function(e){return function(t,n){var i=n[t+"Buffer"];Kn(n.mediaSource,i)&&(n.logger_("Setting "+t+"timestampOffset to "+e),i.timestampOffset=e)}},callback:function(e){return function(t,n){e()}},endOfStream:function(e){return function(t){if("open"===t.mediaSource.readyState){t.logger_("Calling mediaSource endOfStream("+(e||"")+")");try{t.mediaSource.endOfStream(e)}catch(e){f.a.log.warn("Failed to call media source endOfStream",e)}}}},duration:function(e){return function(t){t.logger_("Setting mediaSource duration to "+e);try{t.mediaSource.duration=e}catch(e){f.a.log.warn("Failed to set media source duration",e)}}},abort:function(){return function(e,t){if("open"===t.mediaSource.readyState){var n=t[e+"Buffer"];if(Kn(t.mediaSource,n)){t.logger_("calling abort on "+e+"Buffer");try{n.abort()}catch(t){f.a.log.warn("Failed to abort on "+e+"Buffer",t)}}}}},addSourceBuffer:function(e,t){return function(n){var i=Vn(e),r=Object(v.e)(t);n.logger_("Adding "+e+"Buffer with codec "+t+" to mediaSource");var a=n.mediaSource.addSourceBuffer(r);a.addEventListener("updateend",n["on"+i+"UpdateEnd_"]),a.addEventListener("error",n["on"+i+"Error_"]),n.codecs[e]=t,n[e+"Buffer"]=a}},removeSourceBuffer:function(e){return function(t){var n=t[e+"Buffer"];if(Yn(e,t),Kn(t.mediaSource,n)){t.logger_("Removing "+e+"Buffer with codec "+t.codecs[e]+" from mediaSource");try{t.mediaSource.removeSourceBuffer(n)}catch(t){f.a.log.warn("Failed to removeSourceBuffer "+e+"Buffer",t)}}}},changeType:function(e){return function(t,n){var i=n[t+"Buffer"],r=Object(v.e)(e);Kn(n.mediaSource,i)&&n.codecs[t]!==e&&(n.logger_("changing "+t+"Buffer codec from "+n.codecs[t]+" to "+e),i.changeType(r),n.codecs[t]=e)}}},$n=function(e){var t=e.type,n=e.sourceUpdater,i=e.action,r=e.doneFn,a=e.name;n.queue.push({type:t,action:i,doneFn:r,name:a}),Xn(t,n)},Jn=function(e,t){return function(n){if(t.queuePending[e]){var i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[e+"Error_"])}Xn(e,t)}},Zn=function(e){function t(t){var n;return n=e.call(this)||this,n.mediaSource=t,n.sourceopenListener_=function(){return Xn("mediaSource",a()(n))},n.mediaSource.addEventListener("sourceopen",n.sourceopenListener_),n.logger_=P("SourceUpdater"),n.audioTimestampOffset_=0,n.videoTimestampOffset_=0,n.queue=[],n.queuePending={audio:null,video:null},n.delayedAudioAppendQueue_=[],n.videoAppendQueued_=!1,n.codecs={},n.onVideoUpdateEnd_=Jn("video",a()(n)),n.onAudioUpdateEnd_=Jn("audio",a()(n)),n.onVideoError_=function(e){n.videoError_=e},n.onAudioError_=function(e){n.audioError_=e},n.createdSourceBuffers_=!1,n.initializedEme_=!1,n.triggeredReady_=!1,n}o()(t,e);var n=t.prototype;return n.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},n.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},n.hasInitializedAnyEme=function(){return this.initializedEme_},n.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},n.createSourceBuffers=function(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},n.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},n.addSourceBuffer=function(e,t){$n({type:"mediaSource",sourceUpdater:this,action:Qn.addSourceBuffer(e,t),name:"addSourceBuffer"})},n.abort=function(e){$n({type:e,sourceUpdater:this,action:Qn.abort(e),name:"abort"})},n.removeSourceBuffer=function(e){if(!this.canRemoveSourceBuffer())return void f.a.log.error("removeSourceBuffer is not supported!");$n({type:"mediaSource",sourceUpdater:this,action:Qn.removeSourceBuffer(e),name:"removeSourceBuffer"})},n.canRemoveSourceBuffer=function(){return!f.a.browser.IE_VERSION&&!f.a.browser.IS_FIREFOX&&d.a.MediaSource&&d.a.MediaSource.prototype&&"function"==typeof d.a.MediaSource.prototype.removeSourceBuffer},t.canChangeType=function(){return d.a.SourceBuffer&&d.a.SourceBuffer.prototype&&"function"==typeof d.a.SourceBuffer.prototype.changeType},n.canChangeType=function(){return this.constructor.canChangeType()},n.changeType=function(e,t){if(!this.canChangeType())return void f.a.log.error("changeType is not supported!");$n({type:e,sourceUpdater:this,action:Qn.changeType(t),name:"changeType"})},n.addOrChangeSourceBuffers=function(e){var t=this;if(!e||"object"!=typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(function(n){var i=e[n];if(!t.hasCreatedSourceBuffers())return t.addSourceBuffer(n,i);t.canChangeType()&&t.changeType(n,i)})},n.appendBuffer=function(e,t){var n=this,i=e.segmentInfo,r=e.type,a=e.bytes;if(this.processedAppend_=!0,"audio"===r&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_("delayed audio append of "+a.length+" until video append");var s=t;if($n({type:r,sourceUpdater:this,action:Qn.appendBuffer(a,i||{mediaIndex:-1},s),doneFn:t,name:"appendBuffer"}),"video"===r){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var o=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+o.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,o.forEach(function(e){n.appendBuffer.apply(n,e)})}},n.audioBuffered=function(){return Kn(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:f.a.createTimeRange()},n.videoBuffered=function(){return Kn(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:f.a.createTimeRange()},n.buffered=function(){var e=Kn(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Kn(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():M(this.audioBuffered(),this.videoBuffered())},n.setDuration=function(e,t){void 0===t&&(t=i),$n({type:"mediaSource",sourceUpdater:this,action:Qn.duration(e),name:"duration",doneFn:t})},n.endOfStream=function(e,t){void 0===e&&(e=null),void 0===t&&(t=i),"string"!=typeof e&&(e=void 0),$n({type:"mediaSource",sourceUpdater:this,action:Qn.endOfStream(e),name:"endOfStream",doneFn:t})},n.removeAudio=function(e,t,n){if(void 0===n&&(n=i),!this.audioBuffered().length||0===this.audioBuffered().end(0))return void n();$n({type:"audio",sourceUpdater:this,action:Qn.remove(e,t),doneFn:n,name:"remove"})},n.removeVideo=function(e,t,n){if(void 0===n&&(n=i),!this.videoBuffered().length||0===this.videoBuffered().end(0))return void n();$n({type:"video",sourceUpdater:this,action:Qn.remove(e,t),doneFn:n,name:"remove"})},n.updating=function(){return!(!Gn("audio",this)&&!Gn("video",this))},n.audioTimestampOffset=function(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&($n({type:"audio",sourceUpdater:this,action:Qn.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_},n.videoTimestampOffset=function(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset!==e&&($n({type:"video",sourceUpdater:this,action:Qn.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_},n.audioQueueCallback=function(e){this.audioBuffer&&$n({type:"audio",sourceUpdater:this,action:Qn.callback(e),name:"callback"})},n.videoQueueCallback=function(e){this.videoBuffer&&$n({type:"video",sourceUpdater:this,action:Qn.callback(e),name:"callback"})},n.dispose=function(){var e=this;this.trigger("dispose"),Wn.forEach(function(t){e.abort(t),e.canRemoveSourceBuffer()?e.removeSourceBuffer(t):e[t+"QueueCallback"](function(){return Yn(t,e)})}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},t}(f.a.EventTarget),ei=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},ti=new Uint8Array("\n\n".split("").map(function(e){return e.charCodeAt(0)})),ni=function(e){function t(t,n){var i;return void 0===n&&(n={}),i=e.call(this,t,n)||this,i.mediaSource_=null,i.subtitlesTrack_=null,i.loaderType_="subtitle",i.featuresNativeTextTracks_=t.featuresNativeTextTracks,i.shouldSaveSegmentTimingInfo_=!1,i}o()(t,e);var n=t.prototype;return n.createTransmuxer_=function(){return null},n.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return f.a.createTimeRanges();var e=this.subtitlesTrack_.cues,t=e[0].startTime,n=e[e.length-1].startTime;return f.a.createTimeRanges([[t,n]])},n.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var n=We(e),i=this.initSegments_[n];if(t&&!i&&e.bytes){var r=ti.byteLength+e.bytes.byteLength,a=new Uint8Array(r);a.set(e.bytes),a.set(ti,e.bytes.byteLength),this.initSegments_[n]=i={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return i||e},n.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},n.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},n.track=function(e){return void 0===e?this.subtitlesTrack_:(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)},n.remove=function(e,t){kn(e,t,this.subtitlesTrack_)},n.fillBuffer_=function(){var e=this,t=this.chooseNextRequest_();if(t){if(null===this.syncController_.timestampOffsetForTimeline(t.timeline)){var n=function(){e.state="READY",e.paused()||e.monitorBuffer_()};return this.syncController_.one("timestampoffset",n),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(t)}},n.timestampOffsetForSegment_=function(){return null},n.chooseNextRequest_=function(){return this.skipEmptySegments_(e.prototype.chooseNextRequest_.call(this))},n.skipEmptySegments_=function(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},n.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},n.segmentRequestFinished_=function(e,t,n){var i=this;if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Ut.TIMEOUT&&this.handleTimeout_(),e.code===Ut.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),this.state="APPENDING",this.trigger("appending");var a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof d.a.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var s,o=function(){i.subtitlesTrack_.tech_.off("vttjsloaded",s),i.stopForError({message:"Error loading vtt.js"})};return s=function(){i.subtitlesTrack_.tech_.off("vttjserror",o),i.segmentRequestFinished_(e,t,n)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",s),void this.subtitlesTrack_.tech_.one("vttjserror",o)}a.requested=!0;try{this.parseVTTCues_(r)}catch(e){return void this.stopForError({message:e.message})}if(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)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach(function(e){i.subtitlesTrack_.addCue(i.featuresNativeTextTracks_?new d.a.VTTCue(e.startTime,e.endTime,e.text):e)}),Cn(this.subtitlesTrack_),this.handleAppendsDone_()},n.handleData_=function(){},n.updateTimingInfoEnd_=function(){},n.parseVTTCues_=function(e){var t,n=!1;"function"==typeof d.a.TextDecoder?t=new d.a.TextDecoder("utf8"):(t=d.a.WebVTT.StringDecoder(),n=!0);var i=new d.a.WebVTT.Parser(d.a,d.a.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},i.oncue=e.cues.push.bind(e.cues),i.ontimestampmap=function(t){e.timestampmap=t},i.onparsingerror=function(e){f.a.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var r=e.segment.map.bytes;n&&(r=ei(r)),i.parse(r)}var a=e.bytes;n&&(a=ei(a)),i.parse(a),i.flush()},n.updateTimeMapping_=function(e,t,n){var i=e.segment;if(t){if(!e.cues.length)return void(i.empty=!0);var r=e.timestampmap,a=r.MPEGTS/A.ONE_SECOND_IN_TS-r.LOCAL+t.mapping;if(e.cues.forEach(function(e){e.startTime+=a,e.endTime+=a}),!n.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(s,o-i.duration)}}}},t}(qn),ii=function(e,t){for(var n=e.cues,i=0;i<n.length;i++){var r=n[i];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null},ri=function(e,t,n){if(void 0===n&&(n=0),e.segments)for(var i,r=n,a=0;a<e.segments.length;a++){var s=e.segments[a];if(i||(i=ii(t,r+s.duration/2)),i){if("cueIn"in s){i.endTime=r,i.adEndTime=r,r+=s.duration,i=null;continue}if(r<i.endTime){r+=s.duration;continue}i.endTime+=s.duration}else if("cueOut"in s&&(i=new d.a.VTTCue(r,r+s.duration,s.cueOut),i.adStartTime=r,i.adEndTime=r+parseFloat(s.cueOut),t.addCue(i)),"cueOutCont"in s){var o=s.cueOutCont.split("/").map(parseFloat),u=o[0],l=o[1];i=new d.a.VTTCue(r,r+s.duration,""),i.adStartTime=r-u,i.adEndTime=i.adStartTime+l,t.addCue(i)}r+=s.duration}},ai=[{name:"VOD",run:function(e,t,n,i,r){if(n!==1/0){return{time:0,segmentIndex:0,partIndex:null}}return null}},{name:"ProgramDateTime",run:function(e,t,n,i,r){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,s=null,o=W(t);r=r||0;for(var u=0;u<o.length;u++){var l=t.endList||0===r?u:o.length-(u+1),c=o[l],d=c.segment,h=e.timelineToDatetimeMappings[d.timeline];if(h&&d.dateTimeObject){var p=d.dateTimeObject.getTime()/1e3,f=p+h;if(d.parts&&"number"==typeof c.partIndex)for(var m=0;m<c.partIndex;m++)f+=d.parts[m].duration;var g=Math.abs(r-f);if(null!==s&&(0===g||s<g))break;s=g,a={time:f,segmentIndex:c.segmentIndex,partIndex:c.partIndex}}}return a}},{name:"Segment",run:function(e,t,n,i,r){var a=null,s=null;r=r||0;for(var o=W(t),u=0;u<o.length;u++){var l=t.endList||0===r?u:o.length-(u+1),c=o[l],d=c.segment,h=c.part&&c.part.start||d&&d.start;if(d.timeline===i&&void 0!==h){var p=Math.abs(r-h);if(null!==s&&s<p)break;(!a||null===s||s>=p)&&(s=p,a={time:h,segmentIndex:c.segmentIndex,partIndex:c.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,n,i,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o<t.discontinuityStarts.length;o++){var u=t.discontinuityStarts[o],l=t.discontinuitySequence+o+1,c=e.discontinuities[l];if(c){var d=Math.abs(r-c.time);if(null!==s&&s<d)break;(!a||null===s||s>=d)&&(s=d,a={time:c.time,segmentIndex:u,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,n,i,r){if(t.syncInfo){return{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}}return null}}],si=function(e){function t(t){var n;return n=e.call(this)||this,n.timelines=[],n.discontinuities=[],n.timelineToDatetimeMappings={},n.logger_=P("SyncController"),n}o()(t,e);var n=t.prototype;return n.getSyncPoint=function(e,t,n,i){var r=this.runStrategies_(e,t,n,i);return r.length?this.selectSyncPoint_(r,{key:"time",value:i}):null},n.getExpiredTime=function(e,t){if(!e||!e.segments)return null;var n=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!n.length)return null;var i=this.selectSyncPoint_(n,{key:"segmentIndex",value:0});return i.segmentIndex>0&&(i.time*=-1),Math.abs(i.time+J({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:i.segmentIndex,endIndex:0}))},n.runStrategies_=function(e,t,n,i){for(var r=[],a=0;a<ai.length;a++){var s=ai[a],o=s.run(this,e,t,n,i);o&&(o.strategy=s.name,r.push({strategy:s.name,syncPoint:o}))}return r},n.selectSyncPoint_=function(e,t){for(var n=e[0].syncPoint,i=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy,a=1;a<e.length;a++){var s=Math.abs(e[a].syncPoint[t.key]-t.value);s<i&&(i=s,n=e[a].syncPoint,r=e[a].strategy)}return this.logger_("syncPoint for ["+t.key+": "+t.value+"] chosen with strategy ["+r+"]: [time:"+n.time+", segmentIndex:"+n.segmentIndex+("number"==typeof n.partIndex?",partIndex:"+n.partIndex:"")+"]"),n},n.saveExpiredSegmentInfo=function(e,t){var n=t.mediaSequence-e.mediaSequence;if(n>86400)return void f.a.log.warn("Not saving expired segment info. Media sequence gap "+n+" is too large.");for(var i=n-1;i>=0;i--){var r=e.segments[i];if(r&&void 0!==r.start){t.syncInfo={mediaSequence:e.mediaSequence+i,time:r.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},n.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0],n=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-n}},n.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,n=e.shouldSaveTimelineMapping,i=this.calculateSegmentTimeMapping_(t,t.timingInfo,n),r=t.segment;i&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:r.start}));var a=r.dateTimeObject;r.discontinuity&&n&&a&&(this.timelineToDatetimeMappings[r.timeline]=-a.getTime()/1e3)},n.timestampOffsetForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].time},n.mappingForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping},n.calculateSegmentTimeMapping_=function(e,t,n){var i,r,a=e.segment,s=e.part,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},n&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+o.time+"] [mapping: "+o.mapping+"]")),i=e.startOfSegment,r=t.end+o.mapping;else{if(!o)return!1;i=t.start+o.mapping,r=t.end+o.mapping}return s&&(s.start=i,s.end=r),(!a.start||i<a.start)&&(a.start=i),a.end=r,!0},n.saveDiscontinuitySyncInfo_=function(e){var 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(var i=0;i<t.discontinuityStarts.length;i++){var r=t.discontinuityStarts[i],a=t.discontinuitySequence+i+1,s=r-e.mediaIndex,o=Math.abs(s);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>o){var u=void 0;u=s<0?n.start-J({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):n.end+J({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[a]={time:u,accuracy:o}}}},n.dispose=function(){this.trigger("dispose"),this.off()},t}(f.a.EventTarget),oi=function(e){function t(){var t;return t=e.call(this)||this,t.pendingTimelineChanges_={},t.lastTimelineChanges_={},t}o()(t,e);var n=t.prototype;return n.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},n.pendingTimelineChange=function(e){var t=e.type,n=e.from,i=e.to;return"number"==typeof n&&"number"==typeof i&&(this.pendingTimelineChanges_[t]={type:t,from:n,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},n.lastTimelineChange=function(e){var t=e.type,n=e.from,i=e.to;return"number"==typeof n&&"number"==typeof i&&(this.lastTimelineChanges_[t]={type:t,from:n,to:i},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},n.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(f.a.EventTarget),ui=bt(Tt(function(){function t(e,t,i){return i={path:t,exports:{},require:function(e,t){return n((void 0===t||null===t)&&i.path)}},e(i,i.exports),i.exports}function n(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
18
+ function i(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}var r,a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},s=t(function(e){function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function n(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0}),o=t(function(e){function t(n,i){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,t(n,i)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0}),u=t(function(e){function t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,o(e,t)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0}),l=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(2===arguments.length)for(var n=t.length,i=0;i<n;++i)t[i].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(t){e.push(t)})},e}(),c=function(){var e,t,n,i,r,a,s,o,u,l=[[[],[],[],[],[]],[[],[],[],[],[]]],c=l[0],d=l[1],h=c[4],p=d[4],f=[],m=[];for(e=0;e<256;e++)m[(f[e]=e<<1^283*(e>>7))^e]=e;for(t=n=0;!h[t];t^=i||1,n=m[n]||1)for(s=n^n<<1^n<<2^n<<3^n<<4,s=s>>8^255&s^99,h[t]=s,p[s]=t,a=f[r=f[i=f[t]]],u=16843009*a^65537*r^257*i^16843008*t,o=257*f[s]^16843008*s,e=0;e<4;e++)c[e][t]=o=o<<24^o>>>8,d[e][s]=u=u<<24^u>>>8;for(e=0;e<5;e++)c[e]=c[e].slice(0),d[e]=d[e].slice(0);return l},d=null,h=function(){function e(e){d||(d=c()),this._tables=[[d[0][0].slice(),d[0][1].slice(),d[0][2].slice(),d[0][3].slice(),d[0][4].slice()],[d[1][0].slice(),d[1][1].slice(),d[1][2].slice(),d[1][3].slice(),d[1][4].slice()]];var t,n,i,r=this._tables[0][4],a=this._tables[1],s=e.length,o=1;if(4!==s&&6!==s&&8!==s)throw new Error("Invalid aes key size");var u=e.slice(0),l=[];for(this._key=[u,l],t=s;t<4*s+28;t++)i=u[t-1],(t%s==0||8===s&&t%s==4)&&(i=r[i>>>24]<<24^r[i>>16&255]<<16^r[i>>8&255]<<8^r[255&i],t%s==0&&(i=i<<8^i>>>24^o<<24,o=o<<1^283*(o>>7))),u[t]=u[t-s]^i;for(n=0;t;n++,t--)i=u[3&n?t:t-4],l[n]=t<=4||n<4?i:a[0][r[i>>>24]]^a[1][r[i>>16&255]]^a[2][r[i>>8&255]]^a[3][r[255&i]]}return e.prototype.decrypt=function(e,t,n,i,r,a){var s,o,u,l,c=this._key[1],d=e^c[0],h=i^c[1],p=n^c[2],f=t^c[3],m=c.length/4-2,g=4,y=this._tables[1],v=y[0],_=y[1],b=y[2],T=y[3],S=y[4];for(l=0;l<m;l++)s=v[d>>>24]^_[h>>16&255]^b[p>>8&255]^T[255&f]^c[g],o=v[h>>>24]^_[p>>16&255]^b[f>>8&255]^T[255&d]^c[g+1],u=v[p>>>24]^_[f>>16&255]^b[d>>8&255]^T[255&h]^c[g+2],f=v[f>>>24]^_[d>>16&255]^b[h>>8&255]^T[255&p]^c[g+3],g+=4,d=s,h=o,p=u;for(l=0;l<4;l++)r[(3&-l)+a]=S[d>>>24]<<24^S[h>>16&255]<<16^S[p>>8&255]<<8^S[255&f]^c[g++],s=d,d=h,h=p,p=f,f=s},e}(),p=function(e){function t(){var t;return t=e.call(this,l)||this,t.jobs=[],t.delay=1,t.timeout_=null,t}u(t,e);var n=t.prototype;return n.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},n.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(l),f=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},m=function(e,t,n){var i,r,a,s,o,u,l,c,d,p=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),m=new h(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),y=new Int32Array(g.buffer);for(i=n[0],r=n[1],a=n[2],s=n[3],d=0;d<p.length;d+=4)o=f(p[d]),u=f(p[d+1]),l=f(p[d+2]),c=f(p[d+3]),m.decrypt(o,u,l,c,y,d),y[d]=f(y[d]^i),y[d+1]=f(y[d+1]^r),y[d+2]=f(y[d+2]^a),y[d+3]=f(y[d+3]^s),i=o,r=u,a=l,s=c;return g},g=function(){function e(t,n,r,a){var s=e.STEP,o=new Int32Array(t.buffer),u=new Uint8Array(t.byteLength),l=0;for(this.asyncStream_=new p,this.asyncStream_.push(this.decryptChunk_(o.subarray(l,l+s),n,r,u)),l=s;l<o.length;l+=s)r=new Uint32Array([f(o[l-4]),f(o[l-3]),f(o[l-2]),f(o[l-1])]),this.asyncStream_.push(this.decryptChunk_(o.subarray(l,l+s),n,r,u));this.asyncStream_.push(function(){a(null,i(u))})}return e.prototype.decryptChunk_=function(e,t,n,i){return function(){var r=m(e,t,n);i.set(r,e.byteOffset)}},s(e,null,[{key:"STEP",get:function(){return 32e3}}]),e}();r="undefined"!=typeof window?window:void 0!==a?a:"undefined"!=typeof self?self:{};var y=r,v=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},_=y.BigInt||Number;_("0x1"),_("0x100"),_("0x10000"),_("0x1000000"),_("0x100000000"),_("0x10000000000"),_("0x1000000000000"),_("0x100000000000000"),_("0x10000000000000000"),function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}();var b=function(e){var t={};return Object.keys(e).forEach(function(n){var i=e[n];v(i)?t[n]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:t[n]=i}),t};self.onmessage=function(e){var t=e.data,n=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),i=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),r=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new g(n,i,r,function(e,n){self.postMessage(b({source:t.source,decrypted:n}),[n.buffer])})}})),li=_t(ui),ci=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},di=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},hi=function(e,t){t.activePlaylistLoader=e,e.load()},pi=function(e,t){return function(){var n=t.segmentLoaders,i=n[e],r=n.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.getActiveGroup(),u=a.activePlaylistLoader,l=a.lastGroup_;if((!o||!l||o.id!==l.id)&&(a.lastGroup_=o,a.lastTrack_=s,di(i,a),o&&!o.isMasterPlaylist)){if(!o.playlistLoader)return void(u&&r.resetEverything());i.resyncLoader(),hi(o.playlistLoader,a)}}},fi=function(e,t){return function(){var n=t.segmentLoaders[e];t.mediaTypes[e].lastGroup_=null,n.abort(),n.pause()}},mi=function(e,t){return function(){var n=t.masterPlaylistLoader,i=t.segmentLoaders,r=i[e],a=i.main,s=t.mediaTypes[e],o=s.activeTrack(),u=s.getActiveGroup(),l=s.activePlaylistLoader,c=s.lastTrack_;if((!c||!o||c.id!==o.id)&&(s.lastGroup_=u,s.lastTrack_=o,di(r,s),u)){if(u.isMasterPlaylist){if(!o||!c||o.id===c.id)return;var d=t.vhs.masterPlaylistController_,h=d.selectPlaylist();if(d.media()===h)return;return s.logger_("track change. Switching master audio from "+c.id+" to "+o.id),n.pause(),a.resetEverything(),void d.fastQualityChange_(h)}if("AUDIO"===e){if(!u.playlistLoader)return a.setAudio(!0),void a.resetEverything();r.setAudio(!0),a.setAudio(!1)}if(l===u.playlistLoader)return void hi(u.playlistLoader,s);r.track&&r.track(o),r.resetEverything(),hi(u.playlistLoader,s)}}},gi={AUDIO:function(e,t){return function(){var n=t.segmentLoaders[e],i=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;di(n,i);var a=i.activeTrack(),s=i.activeGroup(),o=(s.filter(function(e){return e.default})[0]||s[0]).id,u=i.tracks[o];if(a===u)return void r({message:"Problem encountered loading the default audio track."});f.a.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(var l in i.tracks)i.tracks[l].enabled=i.tracks[l]===u;i.onTrackChanged()}},SUBTITLES:function(e,t){return function(){var n=t.segmentLoaders[e],i=t.mediaTypes[e];f.a.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),di(n,i);var r=i.activeTrack();r&&(r.mode="disabled"),i.onTrackChanged()}}},yi={AUDIO:function(e,t,n){if(t){var i=n.tech,r=n.requestOptions,a=n.segmentLoaders[e];t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),(!i.paused()||e.endList&&"none"!==i.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),i.paused()||a.load()}),t.on("error",gi[e](e,n))}},SUBTITLES:function(e,t,n){var i=n.tech,r=n.requestOptions,a=n.segmentLoaders[e],s=n.mediaTypes[e];t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!i.paused()||e.endList&&"none"!==i.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),i.paused()||a.load()}),t.on("error",gi[e](e,n))}},vi={AUDIO:function(e,t){var n=t.vhs,i=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,c=o.logger_,d=t.masterPlaylistLoader,h=he(d.master);s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},h&&(s[e].main.default.playlists=d.master.playlists));for(var p in s[e]){u[p]||(u[p]=[]);for(var m in s[e][p]){var g=s[e][p][m],y=void 0;if(h?(c("AUDIO group '"+p+"' label '"+m+"' is a master playlist"),g.isMasterPlaylist=!0,y=null):y="vhs-json"===i&&g.playlists?new De(g.playlists[0],n,a):g.resolvedUri?new De(g.resolvedUri,n,a):g.playlists&&"dash"===i?new ft(g.playlists[0],n,a,d):null,g=f.a.mergeOptions({id:m,playlistLoader:y},g),yi[e](e,g.playlistLoader,t),u[p].push(g),void 0===l[m]){var v=new f.a.AudioTrack({id:m,kind:ci(g),enabled:!1,language:g.language,default:g.default,label:m});l[m]=v}}}r.on("error",gi[e](e,t))},SUBTITLES:function(e,t){var n=t.tech,i=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,c=u.tracks,d=t.masterPlaylistLoader;for(var h in o[e]){l[h]||(l[h]=[]);for(var p in o[e][h])if(!o[e][h][p].forced){var m=o[e][h][p],g=void 0;if("hls"===r)g=new De(m.resolvedUri,i,s);else if("dash"===r){var y=m.playlists.filter(function(e){return e.excludeUntil!==1/0});if(!y.length)return;g=new ft(m.playlists[0],i,s,d)}else"vhs-json"===r&&(g=new De(m.playlists?m.playlists[0]:m.resolvedUri,i,s));if(m=f.a.mergeOptions({id:p,playlistLoader:g},m),yi[e](e,m.playlistLoader,t),l[h].push(m),void 0===c[p]){var v=n.addRemoteTextTrack({id:p,kind:"subtitles",default:m.default&&m.autoselect,language:m.language,label:p},!1).track;c[p]=v}}}a.on("error",gi[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var n=t.tech,i=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in i[e]){a[o]||(a[o]=[]);for(var u in i[e][o]){var l=i[e][o][u];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var c=n.options_.vhs&&n.options_.vhs.captionServices||{},d={label:u,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(c[d.instreamId]&&(d=f.a.mergeOptions(d,c[d.instreamId])),void 0===d.default&&delete d.default,a[o].push(f.a.mergeOptions({id:u},l)),void 0===s[u]){var h=n.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;s[u]=h}}}}}},_i=function e(t,n){for(var i=0;i<t.length;i++){if(ce(n,t[i]))return!0;if(t[i].playlists&&e(t[i].playlists,n))return!0}return!1},bi=function(e,t){return function(n){var i=t.masterPlaylistLoader,r=t.mediaTypes[e].groups,a=i.media();if(!a)return null;var s=null;a.attributes[e]&&(s=r[a.attributes[e]]);var o=Object.keys(r);if(!s)if("AUDIO"===e&&o.length>1&&he(t.master))for(var u=0;u<o.length;u++){var l=r[o[u]];if(_i(l,a)){s=l;break}}else r.main?s=r.main:1===o.length&&(s=r[o[0]]);return void 0===n?s:null!==n&&s?s.filter(function(e){return e.id===n.id})[0]||null:null}},Ti={AUDIO:function(e,t){return function(){var n=t.mediaTypes[e].tracks;for(var i in n)if(n[i].enabled)return n[i];return null}},SUBTITLES:function(e,t){return function(){var n=t.mediaTypes[e].tracks;for(var i in n)if("showing"===n[i].mode||"hidden"===n[i].mode)return n[i];return null}}},Si=function(e,t){var n=t.mediaTypes;return function(){var t=n[e].activeTrack();return t?n[e].activeGroup(t):null}},Ei=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){vi[t](t,e)});var t=e.mediaTypes,n=e.masterPlaylistLoader,i=e.tech,r=e.vhs,a=e.segmentLoaders,s=a.AUDIO,o=a.main;["AUDIO","SUBTITLES"].forEach(function(n){t[n].activeGroup=bi(n,e),t[n].activeTrack=Ti[n](n,e),t[n].onGroupChanged=pi(n,e),t[n].onGroupChanging=fi(n,e),t[n].onTrackChanged=mi(n,e),t[n].getActiveGroup=Si(n,e)});var u=t.AUDIO.activeGroup();if(u){var l=(u.filter(function(e){return e.default})[0]||u[0]).id;t.AUDIO.tracks[l].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged();t.AUDIO.getActiveGroup().playlistLoader?(o.setAudio(!1),s.setAudio(!0)):o.setAudio(!0)}n.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(e){return t[e].onGroupChanged()})}),n.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(e){return t[e].onGroupChanging()})});var c=function(){t.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"}),i.trigger({type:"usage",name:"hls-audio-change"})};i.audioTracks().addEventListener("change",c),i.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",function(){i.audioTracks().removeEventListener("change",c),i.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(var d in t.AUDIO.tracks)i.audioTracks().addTrack(t.AUDIO.tracks[d])},wi=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:i,activeTrack:i,getActiveGroup:i,onGroupChanged:i,onTrackChanged:i,lastTrack_:null,logger_:P("MediaGroups["+t+"]")}}),e},ki=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Ci=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},Ai=function(e){var t=e.currentPlaylist,n=e.buffered,i=e.currentTime,r=e.nextPlaylist,a=e.bufferLowWaterLine,s=e.bufferHighWaterLine,o=e.duration,u=e.experimentalBufferBasedABR,l=e.log;if(!r)return f.a.log.warn("We received no playlist to switch to. Please check your stream."),!1;var c="allowing switch "+(t&&t.id||"null")+" -> "+r.id;if(!t)return l(c+" as current playlist is not set"),!0;if(r.id===t.id)return!1;var d=Boolean(L(n,i).length);if(!t.endList)return d||"number"!=typeof t.partTargetDuration?(l(c+" as current playlist is live"),!0):(l("not "+c+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var h=H(n,i),p=u?mt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:mt.MAX_BUFFER_LOW_WATER_LINE;if(o<p)return l(c+" as duration < max low water line ("+o+" < "+p+")"),!0;var m=r.attributes.BANDWIDTH,g=t.attributes.BANDWIDTH;if(m<g&&(!u||h<s)){var y=c+" as next bandwidth < current bandwidth ("+m+" < "+g+")";return u&&(y+=" and forwardBuffer < bufferHighWaterLine ("+h+" < "+s+")"),l(y),!0}if((!u||m>g)&&h>=a){var v=c+" as forwardBuffer >= bufferLowWaterLine ("+h+" >= "+a+")";return u&&(v+=" and next bandwidth > current bandwidth ("+m+" > "+g+")"),l(v),!0}return l("not "+c+" as no switching criteria met"),!1},Ii=function(e){function t(t){var n;n=e.call(this)||this;var i=t.src,r=t.handleManifestRedirects,s=t.withCredentials,o=t.tech,u=t.bandwidth,l=t.externVhs,c=t.useCueTags,h=t.blacklistDuration,p=t.enableLowInitialPlaylist,m=t.sourceType,g=t.cacheEncryptionKeys,y=t.experimentalBufferBasedABR,v=t.experimentalLeastPixelDiffSelector,_=t.captionServices;if(!i)throw new Error("A non-empty playlist URL or JSON manifest string is required");var T=t.maxPlaylistRetries;null!==T&&void 0!==T||(T=1/0),b=l,n.experimentalBufferBasedABR=Boolean(y),n.experimentalLeastPixelDiffSelector=Boolean(v),n.withCredentials=s,n.tech_=o,n.vhs_=o.vhs,n.sourceType_=m,n.useCueTags_=c,n.blacklistDuration=h,n.maxPlaylistRetries=T,n.enableLowInitialPlaylist=p,n.useCueTags_&&(n.cueTagsTrack_=n.tech_.addTextTrack("metadata","ad-cues"),n.cueTagsTrack_.inBandMetadataTrackDispatchType=""),n.requestOptions_={withCredentials:s,handleManifestRedirects:r,maxPlaylistRetries:T,timeout:null},n.on("error",n.pauseLoading),n.mediaTypes_=wi(),n.mediaSource=new d.a.MediaSource,n.handleDurationChange_=n.handleDurationChange_.bind(a()(n)),n.handleSourceOpen_=n.handleSourceOpen_.bind(a()(n)),n.handleSourceEnded_=n.handleSourceEnded_.bind(a()(n)),n.mediaSource.addEventListener("durationchange",n.handleDurationChange_),n.mediaSource.addEventListener("sourceopen",n.handleSourceOpen_),n.mediaSource.addEventListener("sourceended",n.handleSourceEnded_),n.seekable_=f.a.createTimeRanges(),n.hasPlayed_=!1,n.syncController_=new si(t),n.segmentMetadataTrack_=o.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,n.decrypter_=new li,n.sourceUpdater_=new Zn(n.mediaSource),n.inbandTextTracks_={},n.timelineChangeController_=new oi;var S={vhs:n.vhs_,parse708captions:t.parse708captions,useDtsForTimestampOffset:t.useDtsForTimestampOffset,captionServices:_,mediaSource:n.mediaSource,currentTime:n.tech_.currentTime.bind(n.tech_),seekable:function(){return n.seekable()},seeking:function(){return n.tech_.seeking()},duration:function(){return n.duration()},hasPlayed:function(){return n.hasPlayed_},goalBufferLength:function(){return n.goalBufferLength()},bandwidth:u,syncController:n.syncController_,decrypter:n.decrypter_,sourceType:n.sourceType_,inbandTextTracks:n.inbandTextTracks_,cacheEncryptionKeys:g,sourceUpdater:n.sourceUpdater_,timelineChangeController:n.timelineChangeController_,experimentalExactManifestTimings:t.experimentalExactManifestTimings};n.masterPlaylistLoader_="dash"===n.sourceType_?new ft(i,n.vhs_,n.requestOptions_):new De(i,n.vhs_,n.requestOptions_),n.setupMasterPlaylistLoaderListeners_(),n.mainSegmentLoader_=new qn(f.a.mergeOptions(S,{segmentMetadataTrack:n.segmentMetadataTrack_,loaderType:"main"}),t),n.audioSegmentLoader_=new qn(f.a.mergeOptions(S,{loaderType:"audio"}),t),n.subtitleSegmentLoader_=new ni(f.a.mergeOptions(S,{loaderType:"vtt",featuresNativeTextTracks:n.tech_.featuresNativeTextTracks}),t),n.setupSegmentLoaderListeners_(),n.experimentalBufferBasedABR&&(n.masterPlaylistLoader_.one("loadedplaylist",function(){return n.startABRTimer_()}),n.tech_.on("pause",function(){return n.stopABRTimer_()}),n.tech_.on("play",function(){return n.startABRTimer_()})),ki.forEach(function(e){n[e+"_"]=Ci.bind(a()(n),e)}),n.logger_=P("MPC"),n.triggeredFmp4Usage=!1,"none"===n.tech_.preload()?(n.loadOnPlay_=function(){n.loadOnPlay_=null,n.masterPlaylistLoader_.load()},n.tech_.one("play",n.loadOnPlay_)):n.masterPlaylistLoader_.load(),n.timeToLoadedData__=-1,n.mainAppendsToLoadedData__=-1,n.audioAppendsToLoadedData__=-1;var E="none"===n.tech_.preload()?"play":"loadstart";return n.tech_.one(E,function(){var e=Date.now();n.tech_.one("loadeddata",function(){n.timeToLoadedData__=Date.now()-e,n.mainAppendsToLoadedData__=n.mainSegmentLoader_.mediaAppends,n.audioAppendsToLoadedData__=n.audioSegmentLoader_.mediaAppends})}),n}o()(t,e);var n=t.prototype;return n.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},n.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},n.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t},n.timeToLoadedData_=function(){return this.timeToLoadedData__},n.checkABR_=function(){var e=this.selectPlaylist();e&&this.shouldSwitchToMedia_(e)&&this.switchMedia_(e,"abr")},n.switchMedia_=function(e,t,n){var i=this.media(),r=i&&(i.id||i.uri),a=e.id||e.uri;r&&r!==a&&(this.logger_("switch media "+r+" -> "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,n)},n.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=d.a.setInterval(function(){return e.checkABR_()},250)},n.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(d.a.clearInterval(this.abrTimer_),this.abrTimer_=null)},n.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var n,i=e.mediaGroups.AUDIO,r=Object.keys(i);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{var a=i.main||r.length&&i[r[0]];for(var s in a)if(a[s].default){n={label:s};break}}if(!n)return t;var o=[];for(var u in i)if(i[u][n.label]){var l=i[u][n.label];if(l.playlists&&l.playlists.length)o.push.apply(o,l.playlists);else if(l.uri)o.push(l);else if(e.playlists.length)for(var c=0;c<e.playlists.length;c++){var d=e.playlists[c];d.attributes&&d.attributes.AUDIO&&d.attributes.AUDIO===u&&o.push(d)}}return o.length?o:t},n.setupMasterPlaylistLoaderListeners_=function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var t=e.masterPlaylistLoader_.media(),n=1.5*t.targetDuration*1e3;le(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=n,t.endList&&"none"!==e.tech_.preload()&&(e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load()),Ei({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,vhs:e.vhs_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),t),e.setupFirstPlay(),!e.mediaTypes_.AUDIO.activePlaylistLoader||e.mediaTypes_.AUDIO.activePlaylistLoader.media()?e.trigger("selectedinitialmedia"):e.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){e.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){e.loadOnPlay_&&e.tech_.off("play",e.loadOnPlay_);var t=e.masterPlaylistLoader_.media();if(!t){e.excludeUnsupportedVariants_();var n;if(e.enableLowInitialPlaylist&&(n=e.selectInitialPlaylist()),n||(n=e.selectPlaylist()),!n||!e.shouldSwitchToMedia_(n))return;e.initialMedia_=n,e.switchMedia_(e.initialMedia_,"initial");if(!("vhs-json"===e.sourceType_&&e.initialMedia_.segments))return;t=e.initialMedia_}e.handleUpdatedMediaPlaylist(t)}),this.masterPlaylistLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var t=e.masterPlaylistLoader_.media(),n=1.5*t.targetDuration*1e3;le(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=n,e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var t=e.masterPlaylistLoader_.media();if("playlist-unchanged"!==t.lastExcludeReason_){e.stuckAtPlaylistEnd_(t)&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),e.tech_.trigger("playliststuck"))}}),this.masterPlaylistLoader_.on("renditiondisabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})},n.handleUpdatedMediaPlaylist=function(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},n.triggerPresenceUsage_=function(e,t){var n=e.mediaGroups||{},i=!0,r=Object.keys(n.AUDIO);for(var a in n.AUDIO)for(var s in n.AUDIO[a]){var o=n.AUDIO[a][s];o.uri||(i=!1)}i&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(n.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),b.Playlist.isAes(t)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),r.length&&Object.keys(n.AUDIO[r[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},n.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),i=this.bufferLowWaterLine(),r=this.bufferHighWaterLine(),a=this.tech_.buffered();return Ai({buffered:a,currentTime:n,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:i,bufferHighWaterLine:r,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},n.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("progress",function(){e.trigger("progress")})),this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){e.logger_("main segment loader ended"),e.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))});var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()})},n.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},n.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},n.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},n.fastQualityChange_=function(e){var t=this;if(void 0===e&&(e=this.selectPlaylist()),e===this.masterPlaylistLoader_.media())return void this.logger_("skipping fastQualityChange because new media is same as old");this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){f.a.browser.IE_VERSION||f.a.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())})},n.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}},n.setupFirstPlay=function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_)return!1;if(!t.endList){var n=this.seekable();if(!n.length)return!1;if(f.a.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",function(){e.trigger("firstplay"),e.tech_.setCurrentTime(n.end(0)),e.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(n.end(0))}return this.hasPlayed_=!0,this.load(),!0},n.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,function(e){})}this.trigger("sourceopen")},n.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var e=this.inbandTextTracks_.metadataTrack_.cues;if(e&&e.length){var t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}}},n.handleDurationChange_=function(){this.tech_.trigger("durationchange")},n.onEndOfStream=function(){var e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},n.stuckAtPlaylistEnd_=function(e){if(!this.seekable().length)return!1;var t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;var n=b.Playlist.playlistEnd(e,t),i=this.tech_.currentTime(),r=this.tech_.buffered();if(!r.length)return n-i<=.1;var a=r.end(r.length-1);return a-i<=.1&&n-a<=.1},n.blacklistCurrentPlaylist=function(e,t){void 0===e&&(e={});var n=e.playlist||this.masterPlaylistLoader_.media();if(t=t||e.blacklistDuration||this.blacklistDuration,!n)return this.error=e,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));n.playlistErrors_++;var i=this.masterPlaylistLoader_.master.playlists,r=i.filter(re),a=1===r.length&&r[0]===n;if(1===i.length&&t!==1/0)return f.a.log.warn("Problem encountered with playlist "+n.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(a);if(a){var s=!1;i.forEach(function(e){if(e!==n){var t=e.excludeUntil;void 0!==t&&t!==1/0&&(s=!0,delete e.excludeUntil)}}),s&&(f.a.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}var o;o=n.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*t,n.excludeUntil=o,e.reason&&(n.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var u=this.selectPlaylist();if(!u)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var l=e.internal?this.logger_:f.a.log.warn,c=e.message?" "+e.message:"";l((e.internal?"Internal problem":"Problem")+" encountered with playlist "+n.id+"."+c+" Switching to playlist "+u.id+"."),u.attributes.AUDIO!==n.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==n.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var d=u.targetDuration/2*1e3||5e3,h="number"==typeof u.lastRequest&&Date.now()-u.lastRequest<=d;return this.switchMedia_(u,"exclude",a||h)},n.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},n.delegateLoaders_=function(e,t){var n=this,i=[],r="all"===e;(r||"main"===e)&&i.push(this.masterPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach(function(e){var t=n.mediaTypes_[e]&&n.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)}),["main","audio","subtitle"].forEach(function(t){var r=n[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||i.push(r)}),i.forEach(function(e){return t.forEach(function(t){"function"==typeof e[t]&&e[t]()})})},n.setCurrentTime=function(e){var t=L(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},n.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:b.Playlist.duration(e):1/0:0},n.seekable=function(){return this.seekable_},n.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var n=this.syncController_.getExpiredTime(t,this.duration());if(null!==n){var i=this.masterPlaylistLoader_.master,r=b.Playlist.seekable(t,n,b.Playlist.liveEdgeDelay(i,t));if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(n=this.syncController_.getExpiredTime(t,this.duration())))return;if(e=b.Playlist.seekable(t,n,b.Playlist.liveEdgeDelay(i,t)),0===e.length)return}var a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=f.a.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)<r.end(0)?e.end(0):r.end(0)]]):this.seekable_=r,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===a&&this.seekable_.start(0)===s||(this.logger_("seekable updated ["+N(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},n.updateDuration=function(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){var t=this.seekable();if(!t.length)return;return void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<t.end(t.length-1))&&this.sourceUpdater_.setDuration(t.end(t.length-1)))}var n=this.tech_.buffered(),i=b.Playlist.duration(this.masterPlaylistLoader_.media());n.length>0&&(i=Math.max(i,n.end(n.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)},n.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(t){var n=e.mediaTypes_[t].groups;for(var i in n)n[i].forEach(function(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()},n.master=function(){return this.masterPlaylistLoader_.master},n.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},n.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!n)},n.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var n=on(this.master(),this.media()),i={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(i.video=n.video||t.main.videoCodec||v.b),t.main.isMuxed&&(i.video+=","+(n.audio||t.main.audioCodec||v.a)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(i.audio=n.audio||t.main.audioCodec||t.audio.audioCodec||v.a,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),!i.audio&&!i.video)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0});var a,s=function(e,t){return e?Object(v.c)(t):Object(v.g)(t)},o={};if(["video","audio"].forEach(function(e){if(i.hasOwnProperty(e)&&!s(t[e].isFmp4,i[e])){var n=t[e].isFmp4?"browser":"muxer";o[n]=o[n]||[],o[n].push(i[e]),"audio"===e&&(a=n)}}),r&&a&&this.media().attributes.AUDIO){var u=this.media().attributes.AUDIO;this.master().playlists.forEach(function(t){(t.attributes&&t.attributes.AUDIO)===u&&t!==e.media()&&(t.excludeUntil=1/0)}),this.logger_("excluding audio group "+u+" as "+a+' does not support codec(s): "'+i.audio+'"')}if(Object.keys(o).length){var l=Object.keys(o).reduce(function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+o[t].join(",")+'"'},"")+".";return void this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:l,blacklistDuration:1/0})}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var c=[];if(["video","audio"].forEach(function(t){var n=(Object(v.h)(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(Object(v.h)(i[t]||"")[0]||{}).type;n&&r&&n.toLowerCase()!==r.toLowerCase()&&c.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+i[t]+'"')}),c.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+c.join(", ")+".",blacklistDuration:1/0,internal:!0})}return i},n.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},n.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,n=[];Object.keys(t).forEach(function(i){var r=t[i];if(-1===n.indexOf(r.id)){n.push(r.id);var a=on(e.master,r),s=[];!a.audio||Object(v.g)(a.audio)||Object(v.c)(a.audio)||s.push("audio codec "+a.audio),!a.video||Object(v.g)(a.video)||Object(v.c)(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")))}})},n.excludeIncompatibleVariants_=function(e){var t=this,n=[],i=this.master().playlists,r=an(Object(v.h)(e)),a=sn(r),s=r.video&&Object(v.h)(r.video)[0]||null,o=r.audio&&Object(v.h)(r.audio)[0]||null;Object.keys(i).forEach(function(e){var r=i[e];if(-1===n.indexOf(r.id)&&r.excludeUntil!==1/0){n.push(r.id);var u=[],l=on(t.masterPlaylistLoader_.master,r),c=sn(l);if(l.audio||l.video){if(c!==a&&u.push('codec count "'+c+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var d=l.video&&Object(v.h)(l.video)[0]||null,h=l.audio&&Object(v.h)(l.audio)[0]||null;d&&s&&d.type.toLowerCase()!==s.type.toLowerCase()&&u.push('video codec "'+d.type+'" !== "'+s.type+'"'),h&&o&&h.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'+h.type+'" !== "'+o.type+'"')}u.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+u.join(" && ")))}}})},n.updateAdCues_=function(e){var t=0,n=this.seekable();n.length&&(t=n.start(0)),ri(e,this.cueTagsTrack_,t)},n.goalBufferLength=function(){var e=this.tech_.currentTime(),t=mt.GOAL_BUFFER_LENGTH,n=mt.GOAL_BUFFER_LENGTH_RATE,i=Math.max(t,mt.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*n,i)},n.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),t=mt.BUFFER_LOW_WATER_LINE,n=mt.BUFFER_LOW_WATER_LINE_RATE,i=Math.max(t,mt.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(t,mt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*n,this.experimentalBufferBasedABR?r:i)},n.bufferHighWaterLine=function(){return mt.BUFFER_HIGH_WATER_LINE},t}(f.a.EventTarget),xi=function(e,t,n){return function(i){var r=e.master.playlists[t],a=ie(r),s=re(r);return void 0===i?s:(i?delete r.disabled:r.disabled=!0,i===s||a||(n(),i?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),i)}},Pi=function(e,t,n){var i=e.masterPlaylistController_,r=e.options_.smoothQualityChange,a=r?"smooth":"fast",s=i[a+"QualityChange_"].bind(i);if(t.attributes){var o=t.attributes.RESOLUTION;this.width=o&&o.width,this.height=o&&o.height,this.bandwidth=t.attributes.BANDWIDTH}this.codecs=on(i.master(),t),this.playlist=t,this.id=n,this.enabled=xi(e.playlists,t.id,s)},Oi=function(e){e.representations=function(){var t=e.masterPlaylistController_.master(),n=he(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return n?n.filter(function(e){return!ie(e)}).map(function(t,n){return new Pi(e,t,t.id)}):[]}},Li=["seeking","seeked","pause","playing","error"],Di=function(){function e(e){var t=this;this.masterPlaylistController_=e.masterPlaylistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=P("PlaybackWatcher"),this.logger_("initialize");var n=function(){return t.monitorCurrentTime_()},i=function(){return t.monitorCurrentTime_()},r=function(){return t.techWaiting_()},a=function(){return t.cancelTimer_()},s=this.masterPlaylistController_,o=["main","subtitle","audio"],u={};o.forEach(function(e){u[e]={reset:function(){return t.resetSegmentDownloads_(e)},updateend:function(){return t.checkSegmentDownloads_(e)}},s[e+"SegmentLoader_"].on("appendsdone",u[e].updateend),s[e+"SegmentLoader_"].on("playlistupdate",u[e].reset),t.tech_.on(["seeked","seeking"],u[e].reset)});var l=function(e){["main","audio"].forEach(function(n){s[n+"SegmentLoader_"][e]("appended",t.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){t.fixesBadSeeks_()&&(t.consecutiveUpdates=0,t.lastRecordedTime=t.tech_.currentTime(),l("off"))},this.clearSeekingAppendCheck_=function(){return l("off")},this.watchForBadSeeking_=function(){t.clearSeekingAppendCheck_(),l("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(Li,a),this.tech_.on("canplay",i),this.tech_.one("play",n),this.dispose=function(){t.clearSeekingAppendCheck_(),t.logger_("dispose"),t.tech_.off("waiting",r),t.tech_.off(Li,a),t.tech_.off("canplay",i),t.tech_.off("play",n),t.tech_.off("seeking",t.watchForBadSeeking_),t.tech_.off("seeked",t.clearSeekingAppendCheck_),o.forEach(function(e){s[e+"SegmentLoader_"].off("appendsdone",u[e].updateend),s[e+"SegmentLoader_"].off("playlistupdate",u[e].reset),t.tech_.off(["seeked","seeking"],u[e].reset)}),t.checkCurrentTimeTimeout_&&d.a.clearTimeout(t.checkCurrentTimeTimeout_),t.cancelTimer_()}}var t=e.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&d.a.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=d.a.setTimeout(this.monitorCurrentTime_.bind(this),250)},t.resetSegmentDownloads_=function(e){var t=this.masterPlaylistController_[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_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,n=t[e+"SegmentLoader_"],i=n.buffered_(),r=j(this[e+"Buffered_"],i);if(this[e+"Buffered_"]=i,r)return void this.resetSegmentDownloads_(e);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:B(i)}),this[e+"StalledDownloads_"]<10||(this.logger_(e+" loader stalled download exclusion"),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:"vhs-"+e+"-download-exclusion"}),"subtitle"!==e&&t.blacklistCurrentPlaylist({message:"Excessive "+e+" segment downloading detected."},1/0))},t.checkCurrentTime_=function(){if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+.1>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),n=this.tech_.currentTime(),i=this.afterSeekableWindow_(t,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow);if(i){e=t.end(t.length-1)}if(this.beforeSeekableWindow_(t,n)){var r=t.start(0);e=r+(r===t.end(0)?0:.1)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+n+" with seekable range "+N(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;for(var a=this.masterPlaylistController_.sourceUpdater_,s=this.tech_.buffered(),o=a.audioBuffer?a.audioBuffered():null,u=a.videoBuffer?a.videoBuffered():null,l=this.media(),c=l.partTargetDuration?l.partTargetDuration:2*(l.targetDuration-1/30),d=[o,u],h=0;h<d.length;h++)if(d[h]){var p=H(d[h],n);if(p<c)return!1}var f=D(s,n);return 0!==f.length&&(e=f.start(0)+.1,this.logger_("Buffered region starts ("+f.start(0)+") just beyond seek point ("+n+"). Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0)},t.waiting_=function(){if(!this.techWaiting_()){var e=this.tech_.currentTime(),t=this.tech_.buffered(),n=L(t,e);return n.length&&e+3<=n.end(0)?(this.cancelTimer_(),this.tech_.setCurrentTime(e),this.logger_("Stopped at "+e+" while inside a buffered region ["+n.start(0)+" -> "+n.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var 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.cancelTimer_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var i=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var a=D(r,t);if(a.length>0){var s=a.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+a.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0}return!1},t.afterSeekableWindow_=function(e,t,n,i){if(void 0===i&&(i=!1),!e.length)return!1;var r=e.end(e.length-1)+.1;return!n.endList&&i&&(r=e.end(e.length-1)+3*n.targetDuration),t>r},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)},t.videoUnderflow_=function(e){var t=e.videoBuffered,n=e.audioBuffered,i=e.currentTime;if(t){var r;if(t.length&&n.length){var a=L(t,i-3),s=L(t,i),o=L(n,i);o.length&&!s.length&&a.length&&(r={start:a.end(0),end:o.end(0)})}else{D(t,i).length||(r=this.gapFromVideoUnderflow_(t,i))}return!!r&&(this.logger_("Encountered a gap in video from "+r.start+" to "+r.end+". Seeking to current time "+i),!0)}},t.skipTheGap_=function(e){var t=this.tech_.buffered(),n=this.tech_.currentTime(),i=D(t,n);this.cancelTimer_(),0!==i.length&&n===e&&(this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",e,"nextRange start:",i.start(0)),this.tech_.setCurrentTime(i.start(0)+1/30),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},t.gapFromVideoUnderflow_=function(e,t){for(var n=R(e),i=0;i<n.length;i++){var r=n.start(i),a=n.end(i);if(t-r<4&&t-r>2)return{start:r,end:a}}return null},e}(),Ri={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Mi=function e(t,n){var i=0,r=0,a=f.a.mergeOptions(Ri,n);t.ready(function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})});var s=function(){r&&t.currentTime(r)},o=function(e){null!==e&&void 0!==e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){return Date.now()-i<1e3*a.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&"function"==typeof a.getSource?(i=Date.now(),a.getSource.call(t,o)):void f.a.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e)},c=function(n){l(),e(t,n)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=c},Ni=function(e){Mi(this,e)},Ui={PlaylistLoader:De,Playlist:pe,utils:Ke,STANDARD_PLAYLIST_SELECTOR:mn,INITIAL_PLAYLIST_SELECTOR:vn,lastBandwidthSelector:mn,movingAverageBandwidthSelector:gn,comparePlaylistBandwidth:hn,comparePlaylistResolution:pn,xhr:Ue()};Object.keys(mt).forEach(function(e){Object.defineProperty(Ui,e,{get:function(){return f.a.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),mt[e]},set:function(t){if(f.a.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0)return void f.a.log.warn("value of Vhs."+e+" must be greater than or equal to 0");mt[e]=t}})});var Bi="videojs-vhs",ji=function(e,t){for(var n=t.media(),i=-1,r=0;r<e.length;r++)if(e[r].id===n.id){i=r;break}e.selectedIndex_=i,e.trigger({selectedIndex:i,type:"change"})},Fi=function(e,t){t.representations().forEach(function(t){e.addQualityLevel(t)}),ji(e,t.playlists)};Ui.canPlaySource=function(){return f.a.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Hi=function(e,t,n){if(!e)return e;var i={};t&&t.attributes&&t.attributes.CODECS&&(i=an(Object(v.h)(t.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(i.audio=n.attributes.CODECS);var r=Object(v.e)(i.video),a=Object(v.e)(i.audio),s={};for(var o in e)s[o]={},a&&(s[o].audioContentType=a),r&&(s[o].videoContentType=r),t.contentProtection&&t.contentProtection[o]&&t.contentProtection[o].pssh&&(s[o].pssh=t.contentProtection[o].pssh),"string"==typeof e[o]&&(s[o].url=e[o]);return f.a.mergeOptions(e,s)},qi=function(e,t){return e.reduce(function(e,n){if(!n.contentProtection)return e;var i=t.reduce(function(e,t){var i=n.contentProtection[t];return i&&i.pssh&&(e[t]={pssh:i.pssh}),e},{});return Object.keys(i).length&&e.push(i),e},[])},Vi=function(e){var t=e.player,n=e.sourceKeySystems,i=e.audioMedia,r=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var a=i?r.concat([i]):r,s=qi(a,Object.keys(n)),o=[],u=[];return s.forEach(function(e){u.push(new Promise(function(e,n){t.tech_.one("keysessioncreated",e)})),o.push(new Promise(function(n,i){t.eme.initializeMediaKeys({keySystems:e},function(e){if(e)return void i(e);n()})}))}),Promise.race([Promise.all(o),Promise.race(u)])},Wi=function(e){var t=e.player,n=e.sourceKeySystems,i=e.media,r=e.audioMedia,a=Hi(n,i,r);return!!a&&(t.currentSource().keySystems=a,!(a&&!t.eme)||(f.a.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},Gi=function(){if(!d.a.localStorage)return null;var e=d.a.localStorage.getItem(Bi);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},zi=function(e){if(!d.a.localStorage)return!1;var t=Gi();t=t?f.a.mergeOptions(t,e):e;try{d.a.localStorage.setItem(Bi,JSON.stringify(t))}catch(e){return!1}return t},Xi=function(e){return 0===e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(e.substring(e.indexOf(",")+1)):e};Ui.supportsNativeHls=function(){if(!l.a||!l.a.createElement)return!1;var e=l.a.createElement("video");return!!f.a.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))})}(),Ui.supportsNativeDash=function(){return!!(l.a&&l.a.createElement&&f.a.getTech("Html5").isSupported())&&/maybe|probably/i.test(l.a.createElement("video").canPlayType("application/dash+xml"))}(),Ui.supportsTypeNatively=function(e){return"hls"===e?Ui.supportsNativeHls:"dash"===e&&Ui.supportsNativeDash},Ui.isSupported=function(){return f.a.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Yi=f.a.getComponent("Component"),Ki=function(e){function t(t,n,i){var r;if(r=e.call(this,n,f.a.mergeOptions(i.hls,i.vhs))||this,i.hls&&Object.keys(i.hls).length&&f.a.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object."),"number"==typeof i.initialBandwidth&&(r.options_.bandwidth=i.initialBandwidth),r.logger_=P("VhsHandler"),n.options_&&n.options_.playerId){var s=f()(n.options_.playerId);s.hasOwnProperty("hls")||Object.defineProperty(s,"hls",{get:function(){return f.a.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"hls-player-access"}),a()(r)},configurable:!0}),s.hasOwnProperty("vhs")||Object.defineProperty(s,"vhs",{get:function(){return f.a.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"vhs-player-access"}),a()(r)},configurable:!0}),s.hasOwnProperty("dash")||Object.defineProperty(s,"dash",{get:function(){return f.a.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),a()(r)},configurable:!0}),r.player_=s}if(r.tech_=n,r.source_=t,r.stats={},r.ignoreNextSeekingEvent_=!1,r.setOptions_(),r.options_.overrideNative&&n.overrideNativeAudioTracks&&n.overrideNativeVideoTracks)n.overrideNativeAudioTracks(!0),n.overrideNativeVideoTracks(!0);else if(r.options_.overrideNative&&(n.featuresNativeVideoTracks||n.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return r.on(l.a,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(e){var t=l.a.fullscreenElement||l.a.webkitFullscreenElement||l.a.mozFullScreenElement||l.a.msFullscreenElement;t&&t.contains(r.tech_.el())?r.masterPlaylistController_.fastQualityChange_():r.masterPlaylistController_.checkABR_()}),r.on(r.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_)return void(this.ignoreNextSeekingEvent_=!1);this.setCurrentTime(this.tech_.currentTime())}),r.on(r.tech_,"error",function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),r.on(r.tech_,"play",r.play),r}o()(t,e);var n=t.prototype;return n.setOptions_=function(){var e=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=!1!==this.options_.handleManifestRedirects,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,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,"number"!=typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){var t=Gi();t&&t.bandwidth&&(this.options_.bandwidth=t.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),t&&t.throughput&&(this.options_.throughput=t.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=mt.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===mt.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","useDtsForTimestampOffset","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach(function(t){void 0!==e.source_[t]&&(e.options_[t]=e.source_[t])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},n.src=function(e,t){var n=this;if(e){this.setOptions_(),this.options_.src=Xi(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Ui,this.options_.sourceType=Object(_.a)(t),this.options_.seekTo=function(e){n.tech_.setCurrentTime(e)},this.options_.smoothQualityChange&&f.a.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new Ii(this.options_);var i=f.a.mergeOptions({liveRangeSafeTimeDelta:.1},this.options_,{seekable:function(){return n.seekable()},media:function(){return n.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new Di(i),this.masterPlaylistController_.on("error",function(){var e=f.a.players[n.tech_.options_.playerId],t=n.masterPlaylistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)});var r=this.options_.experimentalBufferBasedABR?Ui.movingAverageBandwidthSelector(.55):Ui.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.masterPlaylistController_.selectInitialPlaylist=Ui.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var e=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,t=d.a.navigator.connection||d.a.navigator.mozConnection||d.a.navigator.webkitConnection;if(this.options_.useNetworkInformationApi&&t){var n=1e3*t.downlink*1e3;e=n>=1e7&&e>=1e7?Math.max(e,n):n}return e},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e,t=1/(this.bandwidth||1);return e=this.throughput>0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){f.a.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:function(){return n.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return n.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return n.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return n.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return n.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return n.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return n.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return n.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return n.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return n.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return n.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return B(n.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return n.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return n.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return n.tech_.name_},enumerable:!0},duration:{get:function(){return n.tech_.duration()},enumerable:!0},master:{get:function(){return n.playlists.master},enumerable:!0},playerDimensions:{get:function(){return n.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return B(n.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return n.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){n.options_.useBandwidthFromLocalStorage&&zi({bandwidth:n.bandwidth,throughput:Math.round(n.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){Oi(n)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){n.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=d.a.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},n.createKeySessions_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),Vi({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})})},n.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},n.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,n=Wi({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});if(this.player_.tech_.on("keystatuschange",function(t){"output-restricted"===t.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+t.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11===f.a.browser.IE_VERSION||!n)return void this.masterPlaylistController_.sourceUpdater_.initializedEme();this.createKeySessions_()},n.setupQualityLevels_=function(){var e=this,t=f.a.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){Fi(e.qualityLevels_,e)}),this.playlists.on("mediachange",function(){ji(e.qualityLevels_,e.playlists)}))},t.version=function(){return{"@videojs/http-streaming":"2.14.2","mux.js":"6.0.1","mpd-parser":"0.21.1","m3u8-parser":"4.7.1","aes-decrypter":"3.1.3"}},n.version=function(){return this.constructor.version()},n.canChangeType=function(){return Zn.canChangeType()},n.play=function(){this.masterPlaylistController_.play()},n.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},n.duration=function(){return this.masterPlaylistController_.duration()},n.seekable=function(){return this.masterPlaylistController_.seekable()},n.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&d.a.URL.revokeObjectURL&&(d.a.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),e.prototype.dispose.call(this)},n.convertToProgramTime=function(e,t){return nt({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},n.seekToProgramTime=function(e,t,n,i){return void 0===n&&(n=!0),void 0===i&&(i=2),it({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:i,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(Yi),Qi={name:"videojs-http-streaming",VERSION:"2.14.2",canHandleSource:function(e,t){void 0===t&&(t={});var n=f.a.mergeOptions(f.a.options,t);return Qi.canPlayType(e.type,n)},handleSource:function(e,t,n){void 0===n&&(n={});var i=f.a.mergeOptions(f.a.options,n);return t.vhs=new Ki(e,t,i),f.a.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return f.a.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=Ue(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var n=f.a.mergeOptions(f.a.options,t),i=n.vhs;i=void 0===i?{}:i;var r=i.overrideNative,a=void 0===r?!f.a.browser.IS_ANY_SAFARI:r,s=n.hls;s=void 0===s?{}:s;var o=s.overrideNative,u=void 0!==o&&o,l=Object(_.a)(e);return l&&(!Ui.supportsTypeNatively(l)||u||a)?"maybe":""}};if(function(){return Object(v.c)("avc1.4d400d,mp4a.40.2")}()&&f.a.getTech("Html5").registerSourceHandler(Qi,0),f.a.VhsHandler=Ki,Object.defineProperty(f.a,"HlsHandler",{get:function(){return f.a.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Ki},configurable:!0}),f.a.VhsSourceHandler=Qi,Object.defineProperty(f.a,"HlsSourceHandler",{get:function(){return f.a.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Qi},configurable:!0}),f.a.Vhs=Ui,Object.defineProperty(f.a,"Hls",{get:function(){return f.a.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Ui},configurable:!0}),f.a.use||(f.a.registerComponent("Hls",Ui),f.a.registerComponent("Vhs",Ui)),f.a.options.vhs=f.a.options.vhs||{},f.a.options.hls=f.a.options.hls||{},!f.a.getPlugin||!f.a.getPlugin("reloadSourceOnError")){(f.a.registerPlugin||f.a.plugin)("reloadSourceOnError",Ni)}}.call(t,n(2))},function(e,t){function n(t,i){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t,i)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){},function(e,t,n){!function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var r=s.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=s.normalizePath(r.path),s.buildURLFromParts(r)}var a=s.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return n.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):t;var o=s.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=i.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=o.netLoc,"/"!==a.path[0]))if(a.path){var c=o.path,d=c.substring(0,c.lastIndexOf("/")+1)+a.path;l.path=s.normalizePath(d)}else l.path=o.path,a.params||(l.params=o.params,a.query||(l.query=o.query));return null===l.path&&(l.path=n.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(l)},parseURL:function(e){var t=n.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(r,"");e.length!==(e=e.replace(a,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=s}()},function(e,t,n){"use strict";var i=n(6),r=n.n(i),a=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(2===arguments.length)for(var n=t.length,i=0;i<n;++i)t[i].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(t){e.push(t)})},e}(),s=n(9),o=n.n(s),u=n(5),l=n.n(u),c=n(10);n.d(t,"a",function(){return b});/*! @name m3u8-parser @version 4.7.1 @license Apache-2.0 */
19
+ var d=function(e){function t(){var t;return t=e.call(this)||this,t.buffer="",t}return r()(t,e),t.prototype.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(a),h=String.fromCharCode(9),p=function(e){var 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},f=function(){return new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')},m=function(e){for(var t,n=e.split(f()),i={},r=n.length;r--;)""!==n[r]&&(t=/([^=]*)=(.*)/.exec(n[r]).slice(1),t[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),i[t[0]]=t[1]);return i},g=function(e){function t(){var t;return t=e.call(this)||this,t.customParsers=[],t.tagMappers=[],t}r()(t,e);var n=t.prototype;return n.push=function(e){var t,n,i=this;if(e=e.trim(),0!==e.length){if("#"!==e[0])return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce(function(t,n){var i=n(e);return i===e?t:t.concat([i])},[e]).forEach(function(e){for(var r=0;r<i.customParsers.length;r++)if(i.customParsers[r].call(i,e))return;if(0!==e.indexOf("#EXT"))return void i.trigger("data",{type:"comment",text:e.slice(1)});if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))return void i.trigger("data",{type:"tag",tagType:"m3u"});if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))return n={type:"tag",tagType:"inf"},t[1]&&(n.duration=parseFloat(t[1])),t[2]&&(n.title=t[2]),void i.trigger("data",n);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))return n={type:"tag",tagType:"targetduration"},t[1]&&(n.duration=parseInt(t[1],10)),void i.trigger("data",n);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))return n={type:"tag",tagType:"version"},t[1]&&(n.version=parseInt(t[1],10)),void i.trigger("data",n);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return n={type:"tag",tagType:"media-sequence"},t[1]&&(n.number=parseInt(t[1],10)),void i.trigger("data",n);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return n={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(n.number=parseInt(t[1],10)),void i.trigger("data",n);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))return n={type:"tag",tagType:"playlist-type"},t[1]&&(n.playlistType=t[1]),void i.trigger("data",n);if(t=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(e))return n=o()(p(t[1]),{type:"tag",tagType:"byterange"}),void i.trigger("data",n);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))return n={type:"tag",tagType:"allow-cache"},t[1]&&(n.allowed=!/NO/.test(t[1])),void i.trigger("data",n);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e)){if(n={type:"tag",tagType:"map"},t[1]){var a=m(t[1]);a.URI&&(n.uri=a.URI),a.BYTERANGE&&(n.byterange=p(a.BYTERANGE))}return void i.trigger("data",n)}if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e)){if(n={type:"tag",tagType:"stream-inf"},t[1]){if(n.attributes=m(t[1]),n.attributes.RESOLUTION){var s=n.attributes.RESOLUTION.split("x"),u={};s[0]&&(u.width=parseInt(s[0],10)),s[1]&&(u.height=parseInt(s[1],10)),n.attributes.RESOLUTION=u}n.attributes.BANDWIDTH&&(n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)),n.attributes["PROGRAM-ID"]&&(n.attributes["PROGRAM-ID"]=parseInt(n.attributes["PROGRAM-ID"],10))}return void i.trigger("data",n)}return(t=/^#EXT-X-MEDIA:?(.*)$/.exec(e))?(n={type:"tag",tagType:"media"},t[1]&&(n.attributes=m(t[1])),void i.trigger("data",n)):(t=/^#EXT-X-ENDLIST/.exec(e))?void i.trigger("data",{type:"tag",tagType:"endlist"}):(t=/^#EXT-X-DISCONTINUITY/.exec(e))?void i.trigger("data",{type:"tag",tagType:"discontinuity"}):(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))?(n={type:"tag",tagType:"program-date-time"},t[1]&&(n.dateTimeString=t[1],n.dateTimeObject=new Date(t[1])),void i.trigger("data",n)):(t=/^#EXT-X-KEY:?(.*)$/.exec(e))?(n={type:"tag",tagType:"key"},t[1]&&(n.attributes=m(t[1]),n.attributes.IV&&("0x"===n.attributes.IV.substring(0,2).toLowerCase()&&(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))),void i.trigger("data",n)):(t=/^#EXT-X-START:?(.*)$/.exec(e))?(n={type:"tag",tagType:"start"},t[1]&&(n.attributes=m(t[1]),n.attributes["TIME-OFFSET"]=parseFloat(n.attributes["TIME-OFFSET"]),n.attributes.PRECISE=/YES/.test(n.attributes.PRECISE)),void i.trigger("data",n)):(t=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e))?(n={type:"tag",tagType:"cue-out-cont"},t[1]?n.data=t[1]:n.data="",void i.trigger("data",n)):(t=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e))?(n={type:"tag",tagType:"cue-out"},t[1]?n.data=t[1]:n.data="",void i.trigger("data",n)):(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e))?(n={type:"tag",tagType:"cue-in"},t[1]?n.data=t[1]:n.data="",void i.trigger("data",n)):(t=/^#EXT-X-SKIP:(.*)$/.exec(e))&&t[1]?(n={type:"tag",tagType:"skip"},n.attributes=m(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(h)),void i.trigger("data",n)):(t=/^#EXT-X-PART:(.*)$/.exec(e))&&t[1]?(n={type:"tag",tagType:"part"},n.attributes=m(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=p(n.attributes.BYTERANGE)),void i.trigger("data",n)):(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e))&&t[1]?(n={type:"tag",tagType:"server-control"},n.attributes=m(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]))}),void i.trigger("data",n)):(t=/^#EXT-X-PART-INF:(.*)$/.exec(e))&&t[1]?(n={type:"tag",tagType:"part-inf"},n.attributes=m(t[1]),["PART-TARGET"].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))}),void i.trigger("data",n)):(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e))&&t[1]?(n={type:"tag",tagType:"preload-hint"},n.attributes=m(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(e){if(n.attributes.hasOwnProperty(e)){n.attributes[e]=parseInt(n.attributes[e],10);var t="BYTERANGE-LENGTH"===e?"length":"offset";n.attributes.byterange=n.attributes.byterange||{},n.attributes.byterange[t]=n.attributes[e],delete n.attributes[e]}}),void i.trigger("data",n)):(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e))&&t[1]?(n={type:"tag",tagType:"rendition-report"},n.attributes=m(t[1]),["LAST-MSN","LAST-PART"].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseInt(n.attributes[e],10))}),void i.trigger("data",n)):void i.trigger("data",{type:"tag",data:e.slice(4)})})}},n.addParser=function(e){var t=this,n=e.expression,i=e.customType,r=e.dataParser,a=e.segment;"function"!=typeof r&&(r=function(e){return e}),this.customParsers.push(function(e){if(n.exec(e))return t.trigger("data",{type:"custom",data:r(e),customType:i,segment:a}),!0})},n.addTagMapper=function(e){var t=e.expression,n=e.map,i=function(e){return t.test(e)?n(e):e};this.tagMappers.push(i)},t}(a),y=function(e){return e.toLowerCase().replace(/-(\w)/g,function(e){return e[1].toUpperCase()})},v=function(e){var t={};return Object.keys(e).forEach(function(n){t[y(n)]=e[n]}),t},_=function(e){var t=e.serverControl,n=e.targetDuration,i=e.partTargetDuration;if(t){var r="#EXT-X-SERVER-CONTROL",a="holdBack",s="partHoldBack",o=n&&3*n,u=i&&2*i;n&&!t.hasOwnProperty(a)&&(t[a]=o,this.trigger("info",{message:r+" defaulting HOLD-BACK to targetDuration * 3 ("+o+")."})),o&&t[a]<o&&(this.trigger("warn",{message:r+" clamping HOLD-BACK ("+t[a]+") to targetDuration * 3 ("+o+")"}),t[a]=o),i&&!t.hasOwnProperty(s)&&(t[s]=3*i,this.trigger("info",{message:r+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+t[s]+")."})),i&&t[s]<u&&(this.trigger("warn",{message:r+" clamping PART-HOLD-BACK ("+t[s]+") to partTargetDuration * 2 ("+u+")."}),t[s]=u)}},b=function(e){function t(){var t;t=e.call(this)||this,t.lineStream=new d,t.parseStream=new g,t.lineStream.pipe(t.parseStream);var n,i,r=l()(t),a=[],s={},u=!1,h=function(){},p={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},f=0;t.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var m=0,y=0;return t.on("end",function(){s.uri||!s.parts&&!s.preloadHints||(!s.map&&n&&(s.map=n),!s.key&&i&&(s.key=i),s.timeline||"number"!=typeof f||(s.timeline=f),t.manifest.preloadSegment=s)}),t.parseStream.on("data",function(e){var t,l;({tag:function(){(({version:function(){e.version&&(this.manifest.version=e.version)},"allow-cache":function(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var t={};"length"in e&&(s.byterange=t,t.length=e.length,"offset"in e||(e.offset=m)),"offset"in e&&(s.byterange=t,t.offset=e.offset),m=t.offset+t.length},endlist:function(){this.manifest.endList=!0},inf:function(){"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.duration>0&&(s.duration=e.duration),0===e.duration&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=a},key:function(){if(!e.attributes)return void this.trigger("warn",{message:"ignoring key declaration without attribute list"});if("NONE"===e.attributes.METHOD)return void(i=null);if(!e.attributes.URI)return void this.trigger("warn",{message:"ignoring key declaration without URI"});if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes});if("com.microsoft.playready"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:e.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT){return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:Object(c.a)(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),i={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(i.iv=e.attributes.IV)},"media-sequence":function(){if(!isFinite(e.number))return void this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number});this.manifest.mediaSequence=e.number},"discontinuity-sequence":function(){if(!isFinite(e.number))return void this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number});this.manifest.discontinuitySequence=e.number,f=e.number},"playlist-type":function(){if(!/VOD|EVENT/.test(e.playlistType))return void this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist});this.manifest.playlistType=e.playlistType},map:function(){n={},e.uri&&(n.uri=e.uri),e.byterange&&(n.byterange=e.byterange),i&&(n.key=i)},"stream-inf":function(){if(this.manifest.playlists=a,this.manifest.mediaGroups=this.manifest.mediaGroups||p,!e.attributes)return void this.trigger("warn",{message:"ignoring empty stream-inf attributes"});s.attributes||(s.attributes={}),o()(s.attributes,e.attributes)},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||p,!(e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});var n=this.manifest.mediaGroups[e.attributes.TYPE];n[e.attributes["GROUP-ID"]]=n[e.attributes["GROUP-ID"]]||{},t=n[e.attributes["GROUP-ID"]],l={default:/yes/i.test(e.attributes.DEFAULT)},l.default?l.autoselect=!0:l.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(l.language=e.attributes.LANGUAGE),e.attributes.URI&&(l.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(l.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(l.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(l.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=l},discontinuity:function(){f+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(a.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),s.dateTimeString=e.dateTimeString,s.dateTimeObject=e.dateTimeObject},targetduration:function(){if(!isFinite(e.duration)||e.duration<0)return void this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration});this.manifest.targetDuration=e.duration,_.call(this,this.manifest)},start:function(){if(!e.attributes||isNaN(e.attributes["TIME-OFFSET"]))return void this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}},"cue-out":function(){s.cueOut=e.data},"cue-out-cont":function(){s.cueOutCont=e.data},"cue-in":function(){s.cueIn=e.data},skip:function(){this.manifest.skip=v(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part:function(){var t=this;u=!0;var n=this.manifest.segments.length,i=v(e.attributes);s.parts=s.parts||[],s.parts.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=y),y=i.byterange.offset+i.byterange.length);var r=s.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+r+" for segment #"+n,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(e,n){e.hasOwnProperty("lastPart")||t.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+n+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var t=this.manifest.serverControl=v(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),_.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":function(){var t=this.manifest.segments.length,n=v(e.attributes),i=n.type&&"PART"===n.type;s.preloadHints=s.preloadHints||[],s.preloadHints.push(n),n.byterange&&(n.byterange.hasOwnProperty("offset")||(n.byterange.offset=i?y:0,i&&(y=n.byterange.offset+n.byterange.length)));var r=s.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+r+" for segment #"+t,e.attributes,["TYPE","URI"]),n.type)for(var a=0;a<s.preloadHints.length-1;a++){var o=s.preloadHints[a];o.type&&(o.type===n.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+r+" for segment #"+t+" has the same TYPE "+n.type+" as preload hint #"+a}))}},"rendition-report":function(){var t=v(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);var n=this.manifest.renditionReports.length-1,i=["LAST-MSN","URI"];u&&i.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+n,e.attributes,i)},"part-inf":function(){this.manifest.partInf=v(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),_.call(this,this.manifest)}})[e.tagType]||h).call(r)},uri:function(){s.uri=e.uri,a.push(s),!this.manifest.targetDuration||"duration"in s||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),i&&(s.key=i),s.timeline=f,n&&(s.map=n),y=0,s={}},comment:function(){},custom:function(){e.segment?(s.custom=s.custom||{},s.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(r)}),t}r()(t,e);var n=t.prototype;return n.warnOnMissingAttributes_=function(e,t,n){var i=[];n.forEach(function(e){t.hasOwnProperty(e)||i.push(e)}),i.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+i.join(", ")})},n.push=function(e){this.lineStream.push(e)},n.end=function(){this.lineStream.push("\n"),this.trigger("end")},n.addParser=function(e){this.parseStream.addParser(e)},n.addTagMapper=function(e){this.parseStream.addTagMapper(e)},t}(a)},function(e,t,n){"use strict";(function(e){function i(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function r(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=a.prototype):(null===e&&(e=new a(t)),e.length=t),e}function a(e,t,n){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return s(this,e,t,n)}function s(e,t,n,i){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?h(e,t,n,i):"string"==typeof t?c(e,t,n):p(e,t)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t,n,i){return o(t),t<=0?r(e,t):void 0!==n?"string"==typeof i?r(e,t).fill(n,i):r(e,t).fill(n):r(e,t)}function l(e,t){if(o(t),e=r(e,t<0?0:0|f(t)),!a.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function c(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!a.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=0|g(t,n);e=r(e,i);var s=e.write(t,n);return s!==i&&(e=e.slice(0,s)),e}function d(e,t){var n=t.length<0?0:0|f(t.length);e=r(e,n);for(var i=0;i<n;i+=1)e[i]=255&t[i];return e}function h(e,t,n,i){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,n):new Uint8Array(t,n,i),a.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=a.prototype):e=d(e,t),e}function p(e,t){if(a.isBuffer(t)){var n=0|f(t.length);return e=r(e,n),0===e.length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||K(t.length)?r(e,0):d(e,t);if("Buffer"===t.type&&J(t.data))return d(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function f(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function m(e){return+e!=e&&(e=0),a.alloc(+e)}function g(e,t){if(a.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return X(e).length;default:if(i)return W(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,n){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,n);case"utf8":case"utf-8":return I(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function v(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function _(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=a.from(t,i)),a.isBuffer(t))return 0===t.length?-1:b(e,t,n,i,r);if("number"==typeof t)return t&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,i,r){function a(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,o=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s=2,o/=2,u/=2,n/=2}var l;if(r){var c=-1;for(l=n;l<o;l++)if(a(e,l)===a(t,-1===c?0:l-c)){if(-1===c&&(c=l),l-c+1===u)return c*s}else-1!==c&&(l-=l-c),c=-1}else for(n+u>o&&(n=o-u),l=n;l>=0;l--){for(var d=!0,h=0;h<u;h++)if(a(e,l+h)!==a(t,h)){d=!1;break}if(d)return l}return-1}function T(e,t,n,i){n=Number(n)||0;var r=e.length-n;i?(i=Number(i))>r&&(i=r):i=r;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");i>a/2&&(i=a/2);for(var s=0;s<i;++s){var o=parseInt(t.substr(2*s,2),16);if(isNaN(o))return s;e[n+s]=o}return s}function S(e,t,n,i){return Y(W(t,e.length-n),e,n,i)}function E(e,t,n,i){return Y(G(t),e,n,i)}function w(e,t,n,i){return E(e,t,n,i)}function k(e,t,n,i){return Y(X(t),e,n,i)}function C(e,t,n,i){return Y(z(t,e.length-n),e,n,i)}function A(e,t,n){return 0===t&&n===e.length?Q.fromByteArray(e):Q.fromByteArray(e.slice(t,n))}function I(e,t,n){n=Math.min(e.length,n);for(var i=[],r=t;r<n;){var a=e[r],s=null,o=a>239?4:a>223?3:a>191?2:1;if(r+o<=n){var u,l,c,d;switch(o){case 1:a<128&&(s=a);break;case 2:u=e[r+1],128==(192&u)&&(d=(31&a)<<6|63&u)>127&&(s=d);break;case 3:u=e[r+1],l=e[r+2],128==(192&u)&&128==(192&l)&&(d=(15&a)<<12|(63&u)<<6|63&l)>2047&&(d<55296||d>57343)&&(s=d);break;case 4:u=e[r+1],l=e[r+2],c=e[r+3],128==(192&u)&&128==(192&l)&&128==(192&c)&&(d=(15&a)<<18|(63&u)<<12|(63&l)<<6|63&c)>65535&&d<1114112&&(s=d)}}null===s?(s=65533,o=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),r+=o}return x(i)}function x(e){var t=e.length;if(t<=Z)return String.fromCharCode.apply(String,e);for(var n="",i=0;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=Z));return n}function P(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(127&e[r]);return i}function O(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(e[r]);return i}function L(e,t,n){var i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);for(var r="",a=t;a<n;++a)r+=V(e[a]);return r}function D(e,t,n){for(var i=e.slice(t,n),r="",a=0;a<i.length;a+=2)r+=String.fromCharCode(i[a]+256*i[a+1]);return r}function R(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,i,r,s){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<s)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function N(e,t,n,i){t<0&&(t=65535+t+1);for(var r=0,a=Math.min(e.length-n,2);r<a;++r)e[n+r]=(t&255<<8*(i?r:1-r))>>>8*(i?r:1-r)}function U(e,t,n,i){t<0&&(t=4294967295+t+1);for(var r=0,a=Math.min(e.length-n,4);r<a;++r)e[n+r]=t>>>8*(i?r:3-r)&255}function B(e,t,n,i,r,a){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(e,t,n,i,r){return r||B(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(e,t,n,i,23,4),n+4}function F(e,t,n,i,r){return r||B(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(e,t,n,i,52,8),n+8}function H(e){if(e=q(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function q(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function V(e){return e<16?"0"+e.toString(16):e.toString(16)}function W(e,t){t=t||1/0;for(var n,i=e.length,r=null,a=[],s=0;s<i;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===i){(t-=3)>-1&&a.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&a.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function G(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function z(e,t){for(var n,i,r,a=[],s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),i=n>>8,r=n%256,a.push(r),a.push(i);return a}function X(e){return Q.toByteArray(H(e))}function Y(e,t,n,i){for(var r=0;r<i&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function K(e){return e!==e}/*!
20
+ * The buffer module from node.js, for the browser.
21
+ *
22
+ * @author Feross Aboukhadijeh <http://feross.org>
23
+ * @license MIT
24
+ */
25
+ var Q=n(39),$=n(40),J=n(41);t.Buffer=a,t.SlowBuffer=m,t.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=i(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,n){return s(null,e,t,n)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(e,t,n){return u(null,e,t,n)},a.allocUnsafe=function(e){return l(null,e)},a.allocUnsafeSlow=function(e){return l(null,e)},a.isBuffer=function(e){return!(null==e||!e._isBuffer)},a.compare=function(e,t){if(!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,r=0,s=Math.min(n,i);r<s;++r)if(e[r]!==t[r]){n=e[r],i=t[r];break}return n<i?-1:i<n?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!J(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=a.allocUnsafe(t),r=0;for(n=0;n<e.length;++n){var s=e[n];if(!a.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,r),r+=s.length}return i},a.byteLength=g,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},a.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?I(this,0,e):y.apply(this,arguments)},a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},a.prototype.compare=function(e,t,n,i,r){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),t<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,r>>>=0,this===e)return 0;for(var s=r-i,o=n-t,u=Math.min(s,o),l=this.slice(i,r),c=e.slice(t,n),d=0;d<u;++d)if(l[d]!==c[d]){s=l[d],o=c[d];break}return s<o?-1:o<s?1:0},a.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},a.prototype.indexOf=function(e,t,n){return _(this,e,t,n,!0)},a.prototype.lastIndexOf=function(e,t,n){return _(this,e,t,n,!1)},a.prototype.write=function(e,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return T(this,e,t,n);case"utf8":case"utf-8":return S(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return w(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;a.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var i;if(a.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=a.prototype;else{var r=t-e;i=new a(r,void 0);for(var s=0;s<r;++s)i[s]=this[s+e]}return i},a.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var i=this[e],r=1,a=0;++a<t&&(r*=256);)i+=this[e+a]*r;return i},a.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var i=this[e+--t],r=1;t>0&&(r*=256);)i+=this[e+--t]*r;return i},a.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var i=this[e],r=1,a=0;++a<t&&(r*=256);)i+=this[e+a]*r;return r*=128,i>=r&&(i-=Math.pow(2,8*t)),i},a.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var i=t,r=1,a=this[e+--i];i>0&&(r*=256);)a+=this[e+--i]*r;return r*=128,a>=r&&(a-=Math.pow(2,8*t)),a},a.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),$.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),$.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),$.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),$.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t|=0,n|=0,!i){M(this,e,t,n,Math.pow(2,8*n)-1,0)}var r=1,a=0;for(this[t]=255&e;++a<n&&(r*=256);)this[t+a]=e/r&255;return t+n},a.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t|=0,n|=0,!i){M(this,e,t,n,Math.pow(2,8*n)-1,0)}var r=n-1,a=1;for(this[t+r]=255&e;--r>=0&&(a*=256);)this[t+r]=e/a&255;return t+n},a.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):U(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t|=0,!i){var r=Math.pow(2,8*n-1);M(this,e,t,n,r-1,-r)}var a=0,s=1,o=0;for(this[t]=255&e;++a<n&&(s*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+n},a.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t|=0,!i){var r=Math.pow(2,8*n-1);M(this,e,t,n,r-1,-r)}var a=n-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):U(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,n){return j(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return j(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return F(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,i){if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var r,s=i-n;if(this===e&&n<t&&t<i)for(r=s-1;r>=0;--r)e[r+t]=this[r+n];else if(s<1e3||!a.TYPED_ARRAY_SUPPORT)for(r=0;r<s;++r)e[r+t]=this[r+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+s),t);return s},a.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===e.length){var r=e.charCodeAt(0);r<256&&(e=r)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var s;if("number"==typeof e)for(s=t;s<n;++s)this[s]=e;else{var o=a.isBuffer(e)?e:W(new a(e,i).toString()),u=o.length;for(s=0;s<n-t;++s)this[s+t]=o[s%u]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(t,n(2))},function(e,t,n){"use strict";function i(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function r(e){var t=i(e),n=t[0],r=t[1];return 3*(n+r)/4-r}function a(e,t,n){return 3*(t+n)/4-n}function s(e){var t,n,r=i(e),s=r[0],o=r[1],u=new h(a(e,s,o)),l=0,c=o>0?s-4:s;for(n=0;n<c;n+=4)t=d[e.charCodeAt(n)]<<18|d[e.charCodeAt(n+1)]<<12|d[e.charCodeAt(n+2)]<<6|d[e.charCodeAt(n+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===o&&(t=d[e.charCodeAt(n)]<<2|d[e.charCodeAt(n+1)]>>4,u[l++]=255&t),1===o&&(t=d[e.charCodeAt(n)]<<10|d[e.charCodeAt(n+1)]<<4|d[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u}function o(e){return c[e>>18&63]+c[e>>12&63]+c[e>>6&63]+c[63&e]}function u(e,t,n){for(var i,r=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),r.push(o(i));return r.join("")}function l(e){for(var t,n=e.length,i=n%3,r=[],a=0,s=n-i;a<s;a+=16383)r.push(u(e,a,a+16383>s?s:a+16383));return 1===i?(t=e[n-1],r.push(c[t>>2]+c[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],r.push(c[t>>10]+c[t>>4&63]+c[t<<2&63]+"=")),r.join("")}t.byteLength=r,t.toByteArray=s,t.fromByteArray=l;for(var c=[],d=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,m=p.length;f<m;++f)c[f]=p[f],d[p.charCodeAt(f)]=f;d["-".charCodeAt(0)]=62,d["_".charCodeAt(0)]=63},function(e,t){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
26
+ t.read=function(e,t,n,i,r){var a,s,o=8*r-i-1,u=(1<<o)-1,l=u>>1,c=-7,d=n?r-1:0,h=n?-1:1,p=e[t+d];for(d+=h,a=p&(1<<-c)-1,p>>=-c,c+=o;c>0;a=256*a+e[t+d],d+=h,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=i;c>0;s=256*s+e[t+d],d+=h,c-=8);if(0===a)a=1-l;else{if(a===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,i),a-=l}return(p?-1:1)*s*Math.pow(2,a-i)},t.write=function(e,t,n,i,r,a){var s,o,u,l=8*a-r-1,c=(1<<l)-1,d=c>>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:a-1,f=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+d>=1?h/u:h*Math.pow(2,1-d),t*u>=2&&(s++,u/=2),s+d>=c?(o=0,s=c):s+d>=1?(o=(t*u-1)*Math.pow(2,r),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,r),s=0));r>=8;e[n+p]=255&o,p+=f,o/=256,r-=8);for(s=s<<r|o,l+=r;l>0;e[n+p]=255&s,p+=f,s/=256,l-=8);e[n+p-f]|=128*m}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";n.d(t,"i",function(){return u}),n.d(t,"h",function(){return l}),n.d(t,"d",function(){return c}),n.d(t,"f",function(){return d}),n.d(t,"e",function(){return p}),n.d(t,"c",function(){return f}),n.d(t,"g",function(){return m}),n.d(t,"a",function(){return g}),n.d(t,"b",function(){return y});var i=n(1),r=n.n(i),a={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^/},s=["video","audio","text"],o=["Video","Audio","Text"],u=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,n){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(n).toString(16)).slice(-2)}):e},l=function(e){void 0===e&&(e="");var t=e.split(","),n=[];return t.forEach(function(e){e=e.trim();var t;s.forEach(function(i){var r=a[i].exec(e.toLowerCase());if(r&&!(r.length<=1)){t=i;var s=e.substring(0,r[1].length),o=e.replace(s,"");n.push({type:s,details:o,mediaType:i})}}),t||n.push({type:e,details:"",mediaType:"unknown"})}),n},c=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var n=e.mediaGroups.AUDIO[t];if(!n)return null;for(var i in n){var r=n[i];if(r.default&&r.playlists)return l(r.playlists[0].attributes.CODECS)}return null},d=function(e){return void 0===e&&(e=""),a.audio.test(e.trim().toLowerCase())},h=function(e){return void 0===e&&(e=""),a.text.test(e.trim().toLowerCase())},p=function(e){if(e&&"string"==typeof e){var t=e.toLowerCase().split(",").map(function(e){return u(e.trim())}),n="video";1===t.length&&d(t[0])?n="audio":1===t.length&&h(t[0])&&(n="application");var i="mp4";return t.every(function(e){return a.mp4.test(e)})?i="mp4":t.every(function(e){return a.webm.test(e)})?i="webm":t.every(function(e){return a.ogg.test(e)})&&(i="ogg"),n+"/"+i+';codecs="'+e+'"'}},f=function(e){return void 0===e&&(e=""),r.a.MediaSource&&r.a.MediaSource.isTypeSupported&&r.a.MediaSource.isTypeSupported(p(e))||!1},m=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every(function(e){e=e.trim();for(var t=0;t<o.length;t++){if(a["muxer"+o[t]].test(e))return!0}return!1})},g="mp4a.40.2",y="avc1.4d400d"},function(e,t,n){"use strict";var i=n(8),r=n(1),a=n.n(r),s=function(e,t,n){t.forEach(function(t){for(var i in e.mediaGroups[t])for(var r in e.mediaGroups[t][i]){var a=e.mediaGroups[t][i][r];n(a,t,i,r)}})},o=n(10),u=n(44);n.d(t,"a",function(){return C}),n.d(t,"b",function(){return R}),n.d(t,"c",function(){return ke}),n.d(t,"d",function(){return Ce});/*! @name mpd-parser @version 0.21.1 @license Apache-2.0 */
27
+ var l=function(e){return!!e&&"object"==typeof e},c=function e(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return n.reduce(function(t,n){return"object"!=typeof n?t:(Object.keys(n).forEach(function(i){Array.isArray(t[i])&&Array.isArray(n[i])?t[i]=t[i].concat(n[i]):l(t[i])&&l(n[i])?t[i]=e(t[i],n[i]):t[i]=n[i]}),t)},{})},d=function(e){return Object.keys(e).map(function(t){return e[t]})},h=function(e,t){for(var n=[],i=e;i<t;i++)n.push(i);return n},p=function(e){return e.reduce(function(e,t){return e.concat(t)},[])},f=function(e){if(!e.length)return[];for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t},m=function(e,t){return e.reduce(function(e,n,i){return n[t]&&e.push(i),e},[])},g=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1},y=function(e,t){return d(e.reduce(function(e,n){return n.forEach(function(n){e[t(n)]=n}),e},{}))},v={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",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"},_=function(e){var t=e.baseUrl,n=void 0===t?"":t,r=e.source,s=void 0===r?"":r,o=e.range,u=void 0===o?"":o,l=e.indexRange,c=void 0===l?"":l,d={uri:s,resolvedUri:Object(i.a)(n||"",s)};if(u||c){var h=u||c,p=h.split("-"),f=a.a.BigInt?a.a.BigInt(p[0]):parseInt(p[0],10),m=a.a.BigInt?a.a.BigInt(p[1]):parseInt(p[1],10);f<Number.MAX_SAFE_INTEGER&&"bigint"==typeof f&&(f=Number(f)),m<Number.MAX_SAFE_INTEGER&&"bigint"==typeof m&&(m=Number(m));var g;g="bigint"==typeof m||"bigint"==typeof f?a.a.BigInt(m)-a.a.BigInt(f)+a.a.BigInt(1):m-f+1,"bigint"==typeof g&&g<Number.MAX_SAFE_INTEGER&&(g=Number(g)),d.byterange={length:g,offset:f}}return d},b=function(e){var t;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?a.a.BigInt(e.offset)+a.a.BigInt(e.length)-a.a.BigInt(1):e.offset+e.length-1,e.offset+"-"+t},T=function(e){return e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e},S={static:function(e){var t=e.duration,n=e.timescale,i=void 0===n?1:n,r=e.sourceDuration,a=e.periodDuration,s=T(e.endNumber),o=t/i;return"number"==typeof s?{start:0,end:s}:"number"==typeof a?{start:0,end:a/o}:{start:0,end:r/o}},dynamic:function(e){var t=e.NOW,n=e.clientOffset,i=e.availabilityStartTime,r=e.timescale,a=void 0===r?1:r,s=e.duration,o=e.periodStart,u=void 0===o?0:o,l=e.minimumUpdatePeriod,c=void 0===l?0:l,d=e.timeShiftBufferDepth,h=void 0===d?1/0:d,p=T(e.endNumber),f=(t+n)/1e3,m=i+u,g=f+c,y=g-m,v=Math.ceil(y*a/s),_=Math.floor((f-m-h)*a/s),b=Math.floor((f-m)*a/s);return{start:Math.max(0,_),end:"number"==typeof p?p:Math.min(v,b)}}},E=function(e){return function(t){var n=e.duration,i=e.timescale,r=void 0===i?1:i,a=e.periodStart,s=e.startNumber;return{number:(void 0===s?1:s)+t,duration:n/r,timeline:a,time:t*n}}},w=function(e){var t=e.type,n=e.duration,i=e.timescale,r=void 0===i?1:i,a=e.periodDuration,s=e.sourceDuration,o=S[t](e),u=o.start,l=o.end,c=h(u,l).map(E(e));if("static"===t){var d=c.length-1,p="number"==typeof a?a:s;c[d].duration=p-n/r*d}return c},k=function(e){var t=e.baseUrl,n=e.initialization,i=void 0===n?{}:n,r=e.sourceDuration,a=e.indexRange,s=void 0===a?"":a,o=e.periodStart,u=e.presentationTime,l=e.number,c=void 0===l?0:l,d=e.duration;if(!t)throw new Error(v.NO_BASE_URL);var h=_({baseUrl:t,source:i.sourceURL,range:i.range}),p=_({baseUrl:t,source:t,indexRange:s});if(p.map=h,d){var f=w(e);f.length&&(p.duration=f[0].duration,p.timeline=f[0].timeline)}else r&&(p.duration=r,p.timeline=o);return p.presentationTime=u||o,p.number=c,[p]},C=function(e,t,n){var i,r=e.sidx.map?e.sidx.map:null,s=e.sidx.duration,o=e.timeline||0,u=e.sidx.byterange,l=u.offset+u.length,c=t.timescale,d=t.references.filter(function(e){return 1!==e.referenceType}),h=[],p=e.endList?"static":"dynamic",f=e.sidx.timeline,m=f,g=e.mediaSequence||0;i="bigint"==typeof t.firstOffset?a.a.BigInt(l)+t.firstOffset:l+t.firstOffset;for(var y=0;y<d.length;y++){var v=t.references[y],_=v.referencedSize,b=v.subsegmentDuration,T=void 0;T="bigint"==typeof i?i+a.a.BigInt(_)-a.a.BigInt(1):i+_-1;var S=i+"-"+T,E={baseUrl:n,timescale:c,timeline:o,periodStart:f,presentationTime:m,number:g,duration:b,sourceDuration:s,indexRange:S,type:p},w=k(E)[0];r&&(w.map=r),h.push(w),i+="bigint"==typeof i?a.a.BigInt(_):_,m+=b/c,g++}return e.segments=h,e},A=["AUDIO","SUBTITLES"],I=function(e){return y(e,function(e){return e.timeline}).sort(function(e,t){return e.timeline>t.timeline?1:-1})},x=function(e,t){for(var n=0;n<e.length;n++)if(e[n].attributes.NAME===t)return e[n];return null},P=function(e){var t=[];return s(e,A,function(e,n,i,r){t=t.concat(e.playlists||[])}),t},O=function(e){var t=e.playlist,n=e.mediaSequence;t.mediaSequence=n,t.segments.forEach(function(e,n){e.number=t.mediaSequence+n})},L=function(e){var t=e.oldPlaylists,n=e.newPlaylists,i=e.timelineStarts;n.forEach(function(e){e.discontinuitySequence=g(i,function(t){return t.timeline===e.timeline});var n=x(t,e.attributes.NAME);if(n&&!e.sidx){var r=e.segments[0],a=g(n.segments,function(e){return Math.abs(e.presentationTime-r.presentationTime)<1/60});if(-1===a)return O({playlist:e,mediaSequence:n.mediaSequence+n.segments.length}),e.segments[0].discontinuity=!0,e.discontinuityStarts.unshift(0),void((!n.segments.length&&e.timeline>n.timeline||n.segments.length&&e.timeline>n.segments[n.segments.length-1].timeline)&&e.discontinuitySequence--);n.segments[a].discontinuity&&!r.discontinuity&&(r.discontinuity=!0,e.discontinuityStarts.unshift(0),e.discontinuitySequence--),O({playlist:e,mediaSequence:n.segments[a].number})}})},D=function(e){var t=e.oldManifest,n=e.newManifest,i=t.playlists.concat(P(t)),r=n.playlists.concat(P(n));return n.timelineStarts=I([t.timelineStarts,n.timelineStarts]),L({oldPlaylists:i,newPlaylists:r,timelineStarts:n.timelineStarts}),n},R=function(e){return e&&e.uri+"-"+b(e.byterange)},M=function(e){return d(e.reduce(function(e,t){var n=t.attributes.id+(t.attributes.lang||"");if(e[n]){if(t.segments){var i;t.segments[0]&&(t.segments[0].discontinuity=!0),(i=e[n].segments).push.apply(i,t.segments)}t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)}else e[n]=t,e[n].attributes.timelineStarts=[];return e[n].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e},{})).map(function(e){return e.discontinuityStarts=m(e.segments||[],"discontinuity"),e})},N=function(e,t){var n=R(e.sidx),i=n&&t[n]&&t[n].sidx;return i&&C(e,i,e.sidx.resolvedUri),e},U=function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var n in e)e[n]=N(e[n],t);return e},B=function(e,t){var n,i=e.attributes,r=e.segments,a=e.sidx,s=e.mediaSequence,o=e.discontinuitySequence,u=e.discontinuityStarts,l={attributes:(n={NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs},n["PROGRAM-ID"]=1,n),uri:"",endList:"static"===i.type,timeline:i.periodStart,resolvedUri:"",targetDuration:i.duration,discontinuitySequence:o,discontinuityStarts:u,timelineStarts:i.timelineStarts,mediaSequence:s,segments:r};return i.contentProtection&&(l.contentProtection=i.contentProtection),a&&(l.sidx=a),t&&(l.attributes.AUDIO="audio",l.attributes.SUBTITLES="subs"),l},j=function(e){var t,n=e.attributes,i=e.segments,r=e.mediaSequence,a=e.discontinuityStarts,s=e.discontinuitySequence;void 0===i&&(i=[{uri:n.baseUrl,timeline:n.periodStart,resolvedUri:n.baseUrl||"",duration:n.sourceDuration,number:0}],n.duration=n.sourceDuration);var o=(t={NAME:n.id,BANDWIDTH:n.bandwidth},t["PROGRAM-ID"]=1,t);return n.codecs&&(o.CODECS=n.codecs),{attributes:o,uri:"",endList:"static"===n.type,timeline:n.periodStart,resolvedUri:n.baseUrl||"",targetDuration:n.duration,timelineStarts:n.timelineStarts,discontinuityStarts:a,discontinuitySequence:s,mediaSequence:r,segments:i}},F=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n=!1);var i,r=e.reduce(function(e,r){var a=r.attributes.role&&r.attributes.role.value||"",s=r.attributes.lang||"",o=r.attributes.label||"main";if(s&&!r.attributes.label){var u=a?" ("+a+")":"";o=""+r.attributes.lang+u}e[o]||(e[o]={language:s,autoselect:!0,default:"main"===a,playlists:[],uri:""});var l=N(B(r,n),t);return e[o].playlists.push(l),void 0===i&&"main"===a&&(i=r,i.default=!0),e},{});if(!i){r[Object.keys(r)[0]].default=!0}return r},H=function(e,t){return void 0===t&&(t={}),e.reduce(function(e,n){var i=n.attributes.lang||"text";return e[i]||(e[i]={language:i,default:!1,autoselect:!1,playlists:[],uri:""}),e[i].playlists.push(N(j(n),t)),e},{})},q=function(e){return e.reduce(function(e,t){return t?(t.forEach(function(t){var n=t.channel,i=t.language;e[i]={autoselect:!1,default:!1,instreamId:n,language:i},t.hasOwnProperty("aspectRatio")&&(e[i].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[i].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[i]["3D"]=t["3D"])}),e):e},{})},V=function(e){var t,n=e.attributes,i=e.segments,r=e.sidx,a=e.discontinuityStarts,s={attributes:(t={NAME:n.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:n.width,height:n.height},CODECS:n.codecs,BANDWIDTH:n.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===n.type,timeline:n.periodStart,resolvedUri:"",targetDuration:n.duration,discontinuityStarts:a,timelineStarts:n.timelineStarts,segments:i};return n.contentProtection&&(s.contentProtection=n.contentProtection),r&&(s.sidx=r),s},W=function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},G=function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},z=function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},X=function(e,t){e.forEach(function(e){e.mediaSequence=0,e.discontinuitySequence=g(t,function(t){return t.timeline===e.timeline}),e.segments&&e.segments.forEach(function(e,t){e.number=t})})},Y=function(e){return e?Object.keys(e).reduce(function(t,n){var i=e[n];return t.concat(i.playlists)},[]):[]},K=function(e){var t,n=e.dashPlaylists,i=e.locations,r=e.sidxMapping,a=void 0===r?{}:r,s=e.previousManifest;if(!n.length)return{};var o=n[0].attributes,u=o.sourceDuration,l=o.type,c=o.suggestedPresentationDelay,d=o.minimumUpdatePeriod,h=M(n.filter(W)).map(V),p=M(n.filter(G)),f=M(n.filter(z)),m=n.map(function(e){return e.attributes.captionServices}).filter(Boolean),g={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:u,playlists:U(h,a)};d>=0&&(g.minimumUpdatePeriod=1e3*d),i&&(g.locations=i),"dynamic"===l&&(g.suggestedPresentationDelay=c);var y=0===g.playlists.length,v=p.length?F(p,a,y):null,_=f.length?H(f,a):null,b=h.concat(Y(v),Y(_)),T=b.map(function(e){return e.timelineStarts});return g.timelineStarts=I(T),X(b,g.timelineStarts),v&&(g.mediaGroups.AUDIO.audio=v),_&&(g.mediaGroups.SUBTITLES.subs=_),m.length&&(g.mediaGroups["CLOSED-CAPTIONS"].cc=q(m)),s?D({oldManifest:s,newManifest:g}):g},Q=function(e,t,n){var i=e.NOW,r=e.clientOffset,a=e.availabilityStartTime,s=e.timescale,o=void 0===s?1:s,u=e.periodStart,l=void 0===u?0:u,c=e.minimumUpdatePeriod,d=void 0===c?0:c,h=(i+r)/1e3,p=a+l,f=h+d,m=f-p;return Math.ceil((m*o-t)/n)},$=function(e,t){for(var n=e.type,i=e.minimumUpdatePeriod,r=void 0===i?0:i,a=e.media,s=void 0===a?"":a,o=e.sourceDuration,u=e.timescale,l=void 0===u?1:u,c=e.startNumber,d=void 0===c?1:c,h=e.periodStart,p=[],f=-1,m=0;m<t.length;m++){var g=t[m],y=g.d,v=g.r||0,_=g.t||0;f<0&&(f=_),_&&_>f&&(f=_);var b=void 0;if(v<0){var T=m+1;b=T===t.length?"dynamic"===n&&r>0&&s.indexOf("$Number$")>0?Q(e,f,y):(o*l-f)/y:(t[T].t-f)/y}else b=v+1;for(var S=d+p.length+b,E=d+p.length;E<S;)p.push({number:E,duration:y/l,time:f,timeline:h}),f+=y,E++}return p},J=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Z=function(e){return function(t,n,i,r){if("$$"===t)return"$";if(void 0===e[n])return t;var a=""+e[n];return"RepresentationID"===n?a:(r=i?parseInt(r,10):1,a.length>=r?a:""+new Array(r-a.length+1).join("0")+a)}},ee=function(e,t){return e.replace(J,Z(t))},te=function(e,t){return e.duration||t?e.duration?w(e):$(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]},ne=function(e,t){var n={RepresentationID:e.id,Bandwidth:e.bandwidth||0},r=e.initialization,a=void 0===r?{sourceURL:"",range:""}:r,s=_({baseUrl:e.baseUrl,source:ee(a.sourceURL,n),range:a.range});return te(e,t).map(function(t){n.Number=t.number,n.Time=t.time;var r=ee(e.media||"",n),a=e.timescale||1,o=e.presentationTimeOffset||0,u=e.periodStart+(t.time-o)/a;return{uri:r,timeline:t.timeline,duration:t.duration,resolvedUri:Object(i.a)(e.baseUrl||"",r),map:s,number:t.number,presentationTime:u}})},ie=function(e,t){var n=e.baseUrl,i=e.initialization,r=void 0===i?{}:i,a=_({baseUrl:n,source:r.sourceURL,range:r.range}),s=_({baseUrl:n,source:t.media,range:t.mediaRange});return s.map=a,s},re=function(e,t){var n=e.duration,i=e.segmentUrls,r=void 0===i?[]:i,a=e.periodStart;if(!n&&!t||n&&t)throw new Error(v.SEGMENT_TIME_UNSPECIFIED);var s,o=r.map(function(t){return ie(e,t)});return n&&(s=w(e)),t&&(s=$(e,t)),s.map(function(t,n){if(o[n]){var i=o[n],r=e.timescale||1,s=e.presentationTimeOffset||0;return i.timeline=t.timeline,i.duration=t.duration,i.number=t.number,i.presentationTime=a+(t.time-s)/r,i}}).filter(function(e){return e})},ae=function(e){var t,n,i=e.attributes,r=e.segmentInfo;r.template?(n=ne,t=c(i,r.template)):r.base?(n=k,t=c(i,r.base)):r.list&&(n=re,t=c(i,r.list));var a={attributes:i};if(!n)return a;var s=n(t,r.segmentTimeline);if(t.duration){var o=t,u=o.duration,l=o.timescale,d=void 0===l?1:l;t.duration=u/d}else s.length?t.duration=s.reduce(function(e,t){return Math.max(e,Math.ceil(t.duration))},0):t.duration=0;return a.attributes=t,a.segments=s,r.base&&t.indexRange&&(a.sidx=s[0],a.segments=[]),a},se=function(e){return e.map(ae)},oe=function(e,t){return f(e.childNodes).filter(function(e){return e.tagName===t})},ue=function(e){return e.textContent.trim()},le=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/,n=t.exec(e);if(!n)return 0;var i=n.slice(1),r=i[0],a=i[1],s=i[2],o=i[3],u=i[4],l=i[5];return 31536e3*parseFloat(r||0)+2592e3*parseFloat(a||0)+86400*parseFloat(s||0)+3600*parseFloat(o||0)+60*parseFloat(u||0)+parseFloat(l||0)},ce=function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),Date.parse(e)},de={mediaPresentationDuration:function(e){return le(e)},availabilityStartTime:function(e){return ce(e)/1e3},minimumUpdatePeriod:function(e){return le(e)},suggestedPresentationDelay:function(e){return le(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return le(e)},start:function(e){return le(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?le(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},he=function(e){return e&&e.attributes?f(e.attributes).reduce(function(e,t){var n=de[t.name]||de.DEFAULT;return e[t.name]=n(t.value),e},{}):{}},pe={"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"},fe=function(e,t){return t.length?p(e.map(function(e){return t.map(function(t){return Object(i.a)(e,ue(t))})})):e},me=function(e){var t=oe(e,"SegmentTemplate")[0],n=oe(e,"SegmentList")[0],i=n&&oe(n,"SegmentURL").map(function(e){return c({tag:"SegmentURL"},he(e))}),r=oe(e,"SegmentBase")[0],a=n||t,s=a&&oe(a,"SegmentTimeline")[0],o=n||r||t,u=o&&oe(o,"Initialization")[0],l=t&&he(t);l&&u?l.initialization=u&&he(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var d={template:l,segmentTimeline:s&&oe(s,"S").map(function(e){return he(e)}),list:n&&c(he(n),{segmentUrls:i,initialization:he(u)}),base:r&&c(he(r),{initialization:he(u)})};return Object.keys(d).forEach(function(e){d[e]||delete d[e]}),d},ge=function(e,t,n){return function(i){var r=oe(i,"BaseURL"),a=fe(t,r),s=c(e,he(i)),o=me(i);return a.map(function(e){return{segmentInfo:c(n,o),attributes:c(s,{baseUrl:e})}})}},ye=function(e){return e.reduce(function(e,t){var n=he(t);n.schemeIdUri&&(n.schemeIdUri=n.schemeIdUri.toLowerCase());var i=pe[n.schemeIdUri];if(i){e[i]={attributes:n};var r=oe(t,"cenc:pssh")[0];if(r){var a=ue(r);e[i].pssh=a&&Object(o.a)(a)}}return e},{})},ve=function(e){if("urn:scte:dash:cc:cea-608:2015"===e.schemeIdUri){return("string"!=typeof e.value?[]:e.value.split(";")).map(function(e){var t,n;if(n=e,/^CC\d=/.test(e)){var i=e.split("=");t=i[0],n=i[1]}else/^CC\d$/.test(e)&&(t=e);return{channel:t,language:n}})}if("urn:scte:dash:cc:cea-708:2015"===e.schemeIdUri){return("string"!=typeof e.value?[]:e.value.split(";")).map(function(e){var t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var n=e.split("="),i=n[0],r=n[1],a=void 0===r?"":r;t.channel=i,t.language=e,a.split(",").forEach(function(e){var n=e.split(":"),i=n[0],r=n[1];"lang"===i?t.language=r:"er"===i?t.easyReader=Number(r):"war"===i?t.aspectRatio=Number(r):"3D"===i&&(t["3D"]=Number(r))})}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})}},_e=function(e,t,n){return function(i){var r=he(i),a=fe(t,oe(i,"BaseURL")),s=oe(i,"Role")[0],o={role:he(s)},u=c(e,r,o),l=oe(i,"Accessibility")[0],d=ve(he(l));d&&(u=c(u,{captionServices:d}));var h=oe(i,"Label")[0];if(h&&h.childNodes.length){var f=h.childNodes[0].nodeValue.trim();u=c(u,{label:f})}var m=ye(oe(i,"ContentProtection"));Object.keys(m).length&&(u=c(u,{contentProtection:m}));var g=me(i),y=oe(i,"Representation"),v=c(n,g);return p(y.map(ge(u,a,v)))}},be=function(e,t){return function(n,i){var r=fe(t,oe(n.node,"BaseURL")),a=c(e,{periodStart:n.attributes.start});"number"==typeof n.attributes.duration&&(a.periodDuration=n.attributes.duration);var s=oe(n.node,"AdaptationSet"),o=me(n.node);return p(s.map(_e(a,r,o)))}},Te=function(e){var t=e.attributes,n=e.priorPeriodAttributes,i=e.mpdType;return"number"==typeof t.start?t.start:n&&"number"==typeof n.start&&"number"==typeof n.duration?n.start+n.duration:n||"static"!==i?null:0},Se=function(e,t){void 0===t&&(t={});var n=t,i=n.manifestUri,r=void 0===i?"":i,a=n.NOW,s=void 0===a?Date.now():a,o=n.clientOffset,u=void 0===o?0:o,l=oe(e,"Period");if(!l.length)throw new Error(v.INVALID_NUMBER_OF_PERIOD);var c=oe(e,"Location"),d=he(e),h=fe([r],oe(e,"BaseURL"));d.type=d.type||"static",d.sourceDuration=d.mediaPresentationDuration||0,d.NOW=s,d.clientOffset=u,c.length&&(d.locations=c.map(ue));var f=[];return l.forEach(function(e,t){var n=he(e),i=f[t-1];n.start=Te({attributes:n,priorPeriodAttributes:i?i.attributes:null,mpdType:d.type}),f.push({node:e,attributes:n})}),{locations:d.locations,representationInfo:p(f.map(be(d,h)))}},Ee=function(e){if(""===e)throw new Error(v.DASH_EMPTY_MANIFEST);var t,n,i=new u.DOMParser;try{t=i.parseFromString(e,"application/xml"),n=t&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(e){}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error(v.DASH_INVALID_XML);return n},we=function(e){var t=oe(e,"UTCTiming")[0];if(!t)return null;var n=he(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;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(v.UNSUPPORTED_UTC_TIMING_SCHEME)}return n},ke=function(e,t){void 0===t&&(t={});var n=Se(Ee(e),t),i=se(n.representationInfo);return K({dashPlaylists:i,locations:n.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})},Ce=function(e){return we(Ee(e))}},function(e,t,n){var i=n(12);t.DOMImplementation=i.DOMImplementation,t.XMLSerializer=i.XMLSerializer,t.DOMParser=n(45).DOMParser},function(e,t,n){function i(e){this.options=e||{locator:{}}}function r(e,t,n){function i(t){var i=e[t];!i&&s&&(i=2==e.length?function(n){e(t,n)}:e),r[t]=i&&function(e){i("[xmldom "+t+"]\t"+e+o(n))}||function(){}}if(!e){if(t instanceof a)return t;e=t}var r={},s=e instanceof Function;return n=n||{},i("warning"),i("error"),i("fatalError"),r}function a(){this.cdata=!1}function s(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function o(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function u(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function l(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}var c=n(4),d=n(12),h=n(46),p=n(47),f=d.DOMImplementation,m=c.NAMESPACE,g=p.ParseError,y=p.XMLReader;i.prototype.parseFromString=function(e,t){var n=this.options,i=new y,s=n.domBuilder||new a,o=n.errorHandler,u=n.locator,l=n.xmlns||{},c=/\/x?html?$/.test(t),d=c?h.HTML_ENTITIES:h.XML_ENTITIES;return u&&s.setDocumentLocator(u),i.errorHandler=r(o,s,u),i.domBuilder=n.domBuilder||s,c&&(l[""]=m.HTML),l.xml=l.xml||m.XML,e&&"string"==typeof e?i.parse(e,l,d):i.errorHandler.error("invalid doc source"),s.doc},a.prototype={startDocument:function(){this.doc=(new f).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,i){var r=this.doc,a=r.createElementNS(e,n||t),o=i.length;l(this,a),this.currentElement=a,this.locator&&s(this.locator,a);for(var u=0;u<o;u++){var e=i.getURI(u),c=i.getValue(u),n=i.getQName(u),d=r.createAttributeNS(e,n);this.locator&&s(i.getLocator(u),d),d.value=d.nodeValue=c,a.setAttributeNode(d)}},endElement:function(e,t,n){var i=this.currentElement;i.tagName;this.currentElement=i.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&s(this.locator,n),l(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=u.apply(this,arguments)){if(this.cdata)var i=this.doc.createCDATASection(e);else var i=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(i):/^\s*$/.test(e)&&this.doc.appendChild(i),this.locator&&s(this.locator,i)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=u.apply(this,arguments);var i=this.doc.createComment(e);this.locator&&s(this.locator,i),l(this,i)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var i=this.doc.implementation;if(i&&i.createDocumentType){var r=i.createDocumentType(e,t,n);this.locator&&s(this.locator,r),l(this,r),this.doc.doctype=r}},warning:function(e){console.warn("[xmldom warning]\t"+e,o(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,o(this.locator))},fatalError:function(e){throw new g(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){a.prototype[e]=function(){return null}}),t.__DOMHandler=a,t.DOMParser=i,t.DOMImplementation=d.DOMImplementation,t.XMLSerializer=d.XMLSerializer},function(e,t,n){var i=n(4).freeze;t.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=i({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"\xc0",Aacute:"\xc1",Acirc:"\xc2",Atilde:"\xc3",Auml:"\xc4",Aring:"\xc5",AElig:"\xc6",Ccedil:"\xc7",Egrave:"\xc8",Eacute:"\xc9",Ecirc:"\xca",Euml:"\xcb",Igrave:"\xcc",Iacute:"\xcd",Icirc:"\xce",Iuml:"\xcf",ETH:"\xd0",Ntilde:"\xd1",Ograve:"\xd2",Oacute:"\xd3",Ocirc:"\xd4",Otilde:"\xd5",Ouml:"\xd6",Oslash:"\xd8",Ugrave:"\xd9",Uacute:"\xda",Ucirc:"\xdb",Uuml:"\xdc",Yacute:"\xdd",THORN:"\xde",szlig:"\xdf",agrave:"\xe0",aacute:"\xe1",acirc:"\xe2",atilde:"\xe3",auml:"\xe4",aring:"\xe5",aelig:"\xe6",ccedil:"\xe7",egrave:"\xe8",eacute:"\xe9",ecirc:"\xea",euml:"\xeb",igrave:"\xec",iacute:"\xed",icirc:"\xee",iuml:"\xef",eth:"\xf0",ntilde:"\xf1",ograve:"\xf2",oacute:"\xf3",ocirc:"\xf4",otilde:"\xf5",ouml:"\xf6",oslash:"\xf8",ugrave:"\xf9",uacute:"\xfa",ucirc:"\xfb",uuml:"\xfc",yacute:"\xfd",thorn:"\xfe",yuml:"\xff",nbsp:"\xa0",iexcl:"\xa1",cent:"\xa2",pound:"\xa3",curren:"\xa4",yen:"\xa5",brvbar:"\xa6",sect:"\xa7",uml:"\xa8",copy:"\xa9",ordf:"\xaa",laquo:"\xab",not:"\xac",shy:"\xad\xad",reg:"\xae",macr:"\xaf",deg:"\xb0",plusmn:"\xb1",sup2:"\xb2",sup3:"\xb3",acute:"\xb4",micro:"\xb5",para:"\xb6",middot:"\xb7",cedil:"\xb8",sup1:"\xb9",ordm:"\xba",raquo:"\xbb",frac14:"\xbc",frac12:"\xbd",frac34:"\xbe",iquest:"\xbf",times:"\xd7",divide:"\xf7",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220b",prod:"\u220f",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221a",prop:"\u221d",infin:"\u221e",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222a",int:"\u222b",there4:"\u2234",sim:"\u223c",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22a5",sdot:"\u22c5",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039a",Lambda:"\u039b",Mu:"\u039c",Nu:"\u039d",Xi:"\u039e",Omicron:"\u039f",Pi:"\u03a0",Rho:"\u03a1",Sigma:"\u03a3",Tau:"\u03a4",Upsilon:"\u03a5",Phi:"\u03a6",Chi:"\u03a7",Psi:"\u03a8",Omega:"\u03a9",alpha:"\u03b1",beta:"\u03b2",gamma:"\u03b3",delta:"\u03b4",epsilon:"\u03b5",zeta:"\u03b6",eta:"\u03b7",theta:"\u03b8",iota:"\u03b9",kappa:"\u03ba",lambda:"\u03bb",mu:"\u03bc",nu:"\u03bd",xi:"\u03be",omicron:"\u03bf",pi:"\u03c0",rho:"\u03c1",sigmaf:"\u03c2",sigma:"\u03c3",tau:"\u03c4",upsilon:"\u03c5",phi:"\u03c6",chi:"\u03c7",psi:"\u03c8",omega:"\u03c9",thetasym:"\u03d1",upsih:"\u03d2",piv:"\u03d6",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02c6",tilde:"\u02dc",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200c",zwj:"\u200d",lrm:"\u200e",rlm:"\u200f",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201a",ldquo:"\u201c",rdquo:"\u201d",bdquo:"\u201e",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203a",oline:"\u203e",euro:"\u20ac",trade:"\u2122",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21b5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230a",rfloor:"\u230b",loz:"\u25ca",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"}),t.entityMap=t.HTML_ENTITIES},function(e,t,n){function i(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,i)}function r(){}function a(e,t,n,r,a){function d(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function m(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?d(parseInt(t.substr(1).replace("x","0x"))):(a.error("entity not found:"+e),e)}function y(t){if(t>k){var n=e.substring(k,t).replace(/&#?\w+;/g,m);S&&v(k),r.characters(n,0,t-k),k=t}}function v(t,n){for(;t>=b&&(n=T.exec(e));)_=n.index,b=_+n[0].length,S.lineNumber++;S.columnNumber=t-_+1}for(var _=0,b=0,T=/.*(?:\r\n?|\n)|.*$/g,S=r.locator,E=[{currentNSMap:t}],w={},k=0;;){try{var C=e.indexOf("<",k);if(C<0){if(!e.substr(k).match(/^\s*$/)){var A=r.doc,I=A.createTextNode(e.substr(k));A.appendChild(I),r.currentElement=I}return}switch(C>k&&y(C),e.charAt(C+1)){case"/":var x=e.indexOf(">",C+3),P=e.substring(C+2,x).replace(/[ \t\n\r]+$/g,""),O=E.pop();x<0?(P=e.substring(C+2).replace(/[\s<].*/,""),a.error("end tag name: "+P+" is not complete:"+O.tagName),x=C+1+P.length):P.match(/\s</)&&(P=P.replace(/[\s<].*/,""),a.error("end tag name: "+P+" maybe not complete"),x=C+1+P.length);var L=O.localNSMap,D=O.tagName==P;if(D||O.tagName&&O.tagName.toLowerCase()==P.toLowerCase()){if(r.endElement(O.uri,O.localName,P),L)for(var R in L)r.endPrefixMapping(R);D||a.fatalError("end tag name: "+P+" is not match the current start tagName:"+O.tagName)}else E.push(O);x++;break;case"?":S&&v(C),x=p(e,C,r);break;case"!":S&&v(C),x=h(e,C,r,a);break;default:S&&v(C);var M=new f,N=E[E.length-1].currentNSMap,x=o(e,C,M,N,m,a),U=M.length;if(!M.closed&&c(e,x,M.tagName,w)&&(M.closed=!0,n.nbsp||a.warning("unclosed xml attribute")),S&&U){for(var B=s(S,{}),j=0;j<U;j++){var F=M[j];v(F.offset),F.locator=s(S,{})}r.locator=B,u(M,r,N)&&E.push(M),r.locator=S}else u(M,r,N)&&E.push(M);g.isHTML(M.uri)&&!M.closed?x=l(e,x,M.tagName,m,r):x++}}catch(e){if(e instanceof i)throw e;a.error("element parse error: "+e),x=-1}x>k?k=x:y(Math.max(C,k)+1)}}function s(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function o(e,t,n,i,r,a){function s(e,t,i){n.attributeNames.hasOwnProperty(e)&&a.fatalError("Attribute "+e+" redefined"),n.addValue(e,t,i)}for(var o,u,l=++t,c=b;;){var d=e.charAt(l);switch(d){case"=":if(c===T)o=e.slice(t,l),c=E;else{if(c!==S)throw new Error("attribute equal must after attrName");c=E}break;case"'":case'"':if(c===E||c===T){if(c===T&&(a.warning('attribute value must after "="'),o=e.slice(t,l)),t=l+1,!((l=e.indexOf(d,t))>0))throw new Error("attribute value no end '"+d+"' match");u=e.slice(t,l).replace(/&#?\w+;/g,r),s(o,u,t-1),c=k}else{if(c!=w)throw new Error('attribute value must after "="');u=e.slice(t,l).replace(/&#?\w+;/g,r),s(o,u,t),a.warning('attribute "'+o+'" missed start quot('+d+")!!"),t=l+1,c=k}break;case"/":switch(c){case b:n.setTagName(e.slice(t,l));case k:case C:case A:c=A,n.closed=!0;case w:case T:case S:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),c==b&&n.setTagName(e.slice(t,l)),l;case">":switch(c){case b:n.setTagName(e.slice(t,l));case k:case C:case A:break;case w:case T:u=e.slice(t,l),"/"===u.slice(-1)&&(n.closed=!0,u=u.slice(0,-1));case S:c===S&&(u=o),c==w?(a.warning('attribute "'+u+'" missed quot(")!'),s(o,u.replace(/&#?\w+;/g,r),t)):(g.isHTML(i[""])&&u.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),s(u,u,t));break;case E:throw new Error("attribute value missed!!")}return l;case"\x80":d=" ";default:if(d<=" ")switch(c){case b:n.setTagName(e.slice(t,l)),c=C;break;case T:o=e.slice(t,l),c=S;break;case w:var u=e.slice(t,l).replace(/&#?\w+;/g,r);a.warning('attribute "'+u+'" missed quot(")!!'),s(o,u,t);case k:c=C}else switch(c){case S:n.tagName;g.isHTML(i[""])&&o.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),s(o,o,t),t=l,c=T;break;case k:a.warning('attribute space is required"'+o+'"!!');case C:c=T,t=l;break;case E:c=w,t=l;break;case A:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}function u(e,t,n){for(var i=e.tagName,r=null,a=e.length;a--;){var s=e[a],o=s.qName,u=s.value,l=o.indexOf(":");if(l>0)var c=s.prefix=o.slice(0,l),h=o.slice(l+1),p="xmlns"===c&&h;else h=o,c=null,p="xmlns"===o&&"";s.localName=h,!1!==p&&(null==r&&(r={},d(n,n={})),n[p]=r[p]=u,s.uri=g.XMLNS,t.startPrefixMapping(p,u))}for(var a=e.length;a--;){s=e[a];var c=s.prefix;c&&("xml"===c&&(s.uri=g.XML),"xmlns"!==c&&(s.uri=n[c||""]))}var l=i.indexOf(":");l>0?(c=e.prefix=i.slice(0,l),h=e.localName=i.slice(l+1)):(c=null,h=e.localName=i);var f=e.uri=n[c||""];if(t.startElement(f,h,i,e),!e.closed)return e.currentNSMap=n,e.localNSMap=r,!0;if(t.endElement(f,h,i),r)for(c in r)t.endPrefixMapping(c)}function l(e,t,n,i,r){if(/^(?:script|textarea)$/i.test(n)){var a=e.indexOf("</"+n+">",t),s=e.substring(t+1,a);if(/[&<]/.test(s))return/^script$/i.test(n)?(r.characters(s,0,s.length),a):(s=s.replace(/&#?\w+;/g,i),r.characters(s,0,s.length),a)}return t+1}function c(e,t,n,i){var r=i[n];return null==r&&(r=e.lastIndexOf("</"+n+">"),r<t&&(r=e.lastIndexOf("</"+n)),i[n]=r),r<t}function d(e,t){for(var n in e)t[n]=e[n]}function h(e,t,n,i){switch(e.charAt(t+2)){case"-":if("-"===e.charAt(t+3)){var r=e.indexOf("--\x3e",t+4);return r>t?(n.comment(e,t+4,r-t-4),r+3):(i.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==e.substr(t+3,6)){var r=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,r-t-9),n.endCDATA(),r+3}var a=m(e,t),s=a.length;if(s>1&&/!doctype/i.test(a[0][0])){var o=a[1][0],u=!1,l=!1;s>3&&(/^public$/i.test(a[2][0])?(u=a[3][0],l=s>4&&a[4][0]):/^system$/i.test(a[2][0])&&(l=a[3][0]));var c=a[s-1];return n.startDTD(o,u,l),n.endDTD(),c.index+c[0].length}}return-1}function p(e,t,n){var i=e.indexOf("?>",t);if(i){var r=e.substring(t,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(r){r[0].length;return n.processingInstruction(r[1],r[2]),i+2}return-1}return-1}function f(){this.attributeNames={}}function m(e,t){var n,i=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=t,r.exec(e);n=r.exec(e);)if(i.push(n),n[1])return i}var g=n(4).NAMESPACE,y=/[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]/,v=new RegExp("[\\-\\.0-9"+y.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),_=new RegExp("^"+y.source+v.source+"*(?::"+y.source+v.source+"*)?$"),b=0,T=1,S=2,E=3,w=4,k=5,C=6,A=7;i.prototype=new Error,i.prototype.name=i.name,r.prototype={parse:function(e,t,n){var i=this.domBuilder;i.startDocument(),d(t,t={}),a(e,t,n,i,this.errorHandler),i.endDocument()}},f.prototype={setTagName:function(e){if(!_.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!_.test(e))throw new 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}},t.XMLReader=r,t.ParseError=i},function(e,t,n){var i=n(49).getUint64,r=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;0===n.version?(n.earliestPresentationTime=t.getUint32(r),n.firstOffset=t.getUint32(r+4),r+=8):(n.earliestPresentationTime=i(e.subarray(r)),n.firstOffset=i(e.subarray(r+8)),r+=16),r+=2;var a=t.getUint16(r);for(r+=2;a>0;r+=12,a--)n.references.push({referenceType:(128&e[r])>>>7,referencedSize:2147483647&t.getUint32(r),subsegmentDuration:t.getUint32(r+4),startsWithSap:!!(128&e[r+8]),sapType:(112&e[r+8])>>>4,sapDeltaTime:268435455&t.getUint32(r+8)});return n};e.exports=r},function(e,t){var n=Math.pow(2,32),i=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0),t<Number.MAX_SAFE_INTEGER?Number(t):t):i.getUint32(0)*n+i.getUint32(4)};e.exports={getUint64:i,MAX_UINT32:n}},function(e,t,n){"use strict";var i,r=n(3),a=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"==typeof e?Object(r.h)(e):e}),s=function(e){return Array.isArray(e)?e.map(function(e){return a(e)}):[a(e)]},o=function(e){e=Object(r.k)(e);for(var t=[],n=0;e.length>n;){var a=e[n],s=0,o=0;o++;var u=e[o];for(o++;128&u;)s=(127&u)<<7,u=e[o],o++;s+=127&u;for(var l=0;l<i.length;l++){var c=i[l],d=c.id,h=c.parser;if(a===d){t.push(h(e.subarray(o,o+s)));break}}n+=s+o}return t};i=[{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(128&t.flags&&(t.dependsOnEsId=e[t.size]<<8|e[t.size+1],t.size+=2),64&t.flags){var n=e[t.size];t.url=Object(r.c)(e.subarray(t.size+1,t.size+1+n)),t.size+=n}return 32&t.flags&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=o(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:o(e.subarray(13))}}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var u=function e(t,n,i){void 0===i&&(i=!1),n=s(n),t=Object(r.k)(t);var a=[];if(!n.length)return a;for(var o=0;o<t.length;){var u=(t[o]<<24|t[o+1]<<16|t[o+2]<<8|t[o+3])>>>0,l=t.subarray(o+4,o+8);if(0===u)break;var c=o+u;if(c>t.length){if(i)break;c=t.length}var d=t.subarray(o+8,c);Object(r.a)(l,n[0])&&(1===n.length?a.push(d):a.push.apply(a,e(d,n.slice(1),i))),o=c}return a},l={EBML:Object(r.k)([26,69,223,163]),DocType:Object(r.k)([66,130]),Segment:Object(r.k)([24,83,128,103]),SegmentInfo:Object(r.k)([21,73,169,102]),Tracks:Object(r.k)([22,84,174,107]),Track:Object(r.k)([174]),TrackNumber:Object(r.k)([215]),DefaultDuration:Object(r.k)([35,227,131]),TrackEntry:Object(r.k)([174]),TrackType:Object(r.k)([131]),FlagDefault:Object(r.k)([136]),CodecID:Object(r.k)([134]),CodecPrivate:Object(r.k)([99,162]),VideoTrack:Object(r.k)([224]),AudioTrack:Object(r.k)([225]),Cluster:Object(r.k)([31,67,182,117]),Timestamp:Object(r.k)([231]),TimestampScale:Object(r.k)([42,215,177]),BlockGroup:Object(r.k)([160]),BlockDuration:Object(r.k)([155]),Block:Object(r.k)([161]),SimpleBlock:Object(r.k)([163])},c=[128,64,32,16,8,4,2,1],d=function(e){for(var t=1,n=0;n<c.length&&!(e&c[n]);n++)t++;return t},h=function(e,t,n,i){void 0===n&&(n=!0),void 0===i&&(i=!1);var a=d(e[t]),s=e.subarray(t,t+a);return n&&(s=Array.prototype.slice.call(e,t,t+a),s[0]^=c[a-1]),{length:a,value:Object(r.b)(s,{signed:i}),bytes:s}},p=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map(function(t){return e(t)}):"number"==typeof t?Object(r.f)(t):t},f=function(e){return Array.isArray(e)?e.map(function(e){return p(e)}):[p(e)]},m=function e(t,n,i){if(i>=n.length)return n.length;var a=h(n,i,!1);if(Object(r.a)(t.bytes,a.bytes))return i;var s=h(n,i+a.length);return e(t,n,i+s.length+s.value+a.length)},g=function e(t,n){n=f(n),t=Object(r.k)(t);var i=[];if(!n.length)return i;for(var a=0;a<t.length;){var s=h(t,a,!1),o=h(t,a+s.length),u=a+s.length+o.length;127===o.value&&(o.value=m(s,t,u),o.value!==t.length&&(o.value-=u));var l=u+o.value>t.length?t.length:u+o.value,c=t.subarray(u,l);Object(r.a)(n[0],s.bytes)&&(1===n.length?i.push(c):i=i.concat(e(c,n.slice(1))));a+=s.length+o.length+c.length}return i},y=n(13),v=Object(r.k)([0,0,0,1]),_=Object(r.k)([0,0,1]),b=Object(r.k)([0,0,3]),T=function(e){for(var t=[],n=1;n<e.length-2;)Object(r.a)(e.subarray(n,n+3),b)&&(t.push(n+2),n++),n++;if(0===t.length)return e;var i=e.length-t.length,a=new Uint8Array(i),s=0;for(n=0;n<i;s++,n++)s===t[0]&&(s++,t.shift()),a[n]=e[s];return a},S=function(e,t,n,i){void 0===i&&(i=1/0),e=Object(r.k)(e),n=[].concat(n);for(var a,s=0,o=0;s<e.length&&(o<i||a);){var u=void 0;if(Object(r.a)(e.subarray(s),v)?u=4:Object(r.a)(e.subarray(s),_)&&(u=3),u){if(o++,a)return T(e.subarray(a,s));var l=void 0;"h264"===t?l=31&e[s+u]:"h265"===t&&(l=e[s+u]>>1&63),-1!==n.indexOf(l)&&(a=s+u),s+=u+("h264"===t?1:2)}else s++}return e.subarray(0,0)},E=function(e,t,n){return S(e,"h264",t,n)},w=function(e,t,n){return S(e,"h265",t,n)};n.d(t,"a",function(){return x}),n.d(t,"b",function(){return P});var k={webm:Object(r.k)([119,101,98,109]),matroska:Object(r.k)([109,97,116,114,111,115,107,97]),flac:Object(r.k)([102,76,97,67]),ogg:Object(r.k)([79,103,103,83]),ac3:Object(r.k)([11,119]),riff:Object(r.k)([82,73,70,70]),avi:Object(r.k)([65,86,73]),wav:Object(r.k)([87,65,86,69]),"3gp":Object(r.k)([102,116,121,112,51,103]),mp4:Object(r.k)([102,116,121,112]),fmp4:Object(r.k)([115,116,121,112]),mov:Object(r.k)([102,116,121,112,113,116]),moov:Object(r.k)([109,111,111,118]),moof:Object(r.k)([109,111,111,102])},C={aac:function(e){var t=Object(y.a)(e);return Object(r.a)(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Object(y.a)(e);return Object(r.a)(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=g(e,[l.EBML,l.DocType])[0];return Object(r.a)(t,k.webm)},mkv:function(e){var t=g(e,[l.EBML,l.DocType])[0];return Object(r.a)(t,k.matroska)},mp4:function(e){return!C["3gp"](e)&&!C.mov(e)&&(!(!Object(r.a)(e,k.mp4,{offset:4})&&!Object(r.a)(e,k.fmp4,{offset:4}))||(!(!Object(r.a)(e,k.moof,{offset:4})&&!Object(r.a)(e,k.moov,{offset:4}))||void 0))},mov:function(e){return Object(r.a)(e,k.mov,{offset:4})},"3gp":function(e){return Object(r.a)(e,k["3gp"],{offset:4})},ac3:function(e){var t=Object(y.a)(e);return Object(r.a)(e,k.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=Object(y.a)(e);return Object(r.a)(e,k.flac,{offset:t})},ogg:function(e){return Object(r.a)(e,k.ogg)},avi:function(e){return Object(r.a)(e,k.riff)&&Object(r.a)(e,k.avi,{offset:8})},wav:function(e){return Object(r.a)(e,k.riff)&&Object(r.a)(e,k.wav,{offset:8})},h264:function(e){return E(e,7,3).length},h265:function(e){return w(e,[32,33],3).length}},A=Object.keys(C).filter(function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e}).concat(["ts","h264","h265"]);A.forEach(function(e){var t=C[e];C[e]=function(e){return t(Object(r.k)(e))}});var I=C,x=function(e){e=Object(r.k)(e);for(var t=0;t<A.length;t++){var n=A[t];if(I[n](e))return n}return""},P=function(e){return u(e,["moof"]).length>0}},function(e,t){var n,i,r,a,s,o,u;n=function(e){return 9e4*e},i=function(e,t){return e*t},r=function(e){return e/9e4},a=function(e,t){return e/t},s=function(e,t){return n(a(e,t))},o=function(e,t){return i(r(e),t)},u=function(e,t,n){return r(n?e:e-t)},e.exports={ONE_SECOND_IN_TS:9e4,secondsToVideoTs:n,secondsToAudioTs:i,videoTsToSeconds:r,audioTsToSeconds:a,audioTsToVideoTs:s,videoTsToAudioTs:o,metadataTsToSeconds:u}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"FlashlsHandler",function(){return q});var i=n(1),r=n.n(i),a=n(0),s=n.n(a),o=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 i;return!!e[t]&&(i=e[t].indexOf(n),e[t]=e[t].slice(),e[t].splice(i,1),i>-1)},this.trigger=function(t){var n,i,r,a;if(n=e[t])if(2===arguments.length)for(r=n.length,i=0;i<r;++i)n[i].call(this,arguments[1]);else{for(a=[],i=arguments.length,i=1;i<arguments.length;++i)a.push(arguments[i]);for(r=n.length,i=0;i<r;++i)n[i].apply(this,a)}},this.dispose=function(){e={}}}};o.prototype.pipe=function(e){return this.on("data",function(t){e.push(t)}),this.on("done",function(t){e.flush(t)}),e},o.prototype.push=function(e){this.trigger("data",e)},o.prototype.flush=function(e){this.trigger("done",e)};var u=o,l=function(e){for(var t=0,n={payloadType:-1,payloadSize:0},i=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)i+=255,t++;for(i+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!n.payload&&4===i){n.payloadType=i,n.payloadSize=r,n.payload=e.subarray(t,t+r);break}t+=r,i=0,r=0}return n},c=function(e){return 181!==e.payload[0]?null:49!=(e.payload[1]<<8|e.payload[2])?null:"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])?null:3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},d=function(e,t){var n,i,r,a,s=[];if(!(64&t[0]))return s;for(i=31&t[0],n=0;n<i;n++)r=3*n,a={type:3&t[r+2],pts:e},4&t[r+2]&&(a.ccData=t[r+3]<<8|t[r+4],s.push(a));return s},h=function(e){for(var t,n,i=e.byteLength,r=[],a=1;a<i-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=i-r.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),n[a]=e[s];return n},p={parseSei:l,parseUserData:c,parseCaptionPackets:d,discardEmulationPreventionBytes:h,USER_DATA_REGISTERED_ITU_T_T35:4},f=function(){f.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new _(0,0),new _(0,1),new _(1,0),new _(1,1)],this.reset(),this.ccStreams_.forEach(function(e){e.on("data",this.trigger.bind(this,"data")),e.on("done",this.trigger.bind(this,"done"))},this)};f.prototype=new u,f.prototype.push=function(e){var t,n,i;if("sei_rbsp"===e.nalUnitType&&(t=p.parseSei(e.escapedRBSP),t.payloadType===p.USER_DATA_REGISTERED_ITU_T_T35&&(n=p.parseUserData(t)))){if(e.dts<this.latestDts_)return void(this.ignoreNextEqualDts_=!0);if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return void(--this.numSameDts_||(this.ignoreNextEqualDts_=!1));i=p.parseCaptionPackets(e.pts,n),this.captionPackets_=this.captionPackets_.concat(i),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},f.prototype.flush=function(){if(!this.captionPackets_.length)return void this.ccStreams_.forEach(function(e){e.flush()},this);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),this.captionPackets_.length=0,this.ccStreams_.forEach(function(e){e.flush()},this)},f.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset()})},f.prototype.dispatchCea608Packet=function(e){this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},f.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},f.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)};var m={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},g=function(e){return null===e?"":(e=m[e]||e,String.fromCharCode(e))},y=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],v=function(){for(var e=[],t=15;t--;)e.push("");return e},_=function(e,t){_.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,n,i,r,a;if((t=32639&e.ccData)===this.lastControlCode_)return void(this.lastControlCode_=null);if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),i=t>>>8,r=255&t,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_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=v();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=v();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=v()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(i,r))i=(3&i)<<8,a=g(i|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(i,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),i=(3&i)<<8,a=g(i|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(i,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(i,r))this.column_+=3&r;else if(this.isPAC(i,r)){var s=y.indexOf(7968&t);"rollUp"===this.mode_&&this.setRollUp(e.pts,s),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(i)&&(0===r&&(r=null),a=g(i),a+=g(r),this[this.mode_](e.pts,a),this.column_+=a.length)}};_.prototype=new u,_.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e){return e.trim()}).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},_.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=v(),this.nonDisplayed_=v(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},_.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},_.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},_.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},_.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},_.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},_.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},_.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},_.prototype.isNormalChar=function(e){return e>=32&&e<=127},_.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=v(),this.displayed_=v()),void 0!==t&&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]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},_.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)},_.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)}},_.prototype.popOn=function(e,t){var n=this.nonDisplayed_[this.row_];n+=t,this.nonDisplayed_[this.row_]=n},_.prototype.rollUp=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n},_.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},_.prototype.paintOn=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n};var b,T={CaptionStream:f,Cea608Stream:_},S=T.CaptionStream,E={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},w=function(e,t,n){var i,r="";for(i=t;i<n;i++)r+="%"+("00"+e[i].toString(16)).slice(-2);return r},k=function(e,t,n){return decodeURIComponent(w(e,t,n))},C=function(e,t,n){return unescape(w(e,t,n))},A=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},I={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=k(e.data,1,t),e.value=k(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=k(e.data,1,t),e.url=k(e.data,t+1,e.data.length);break}},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=C(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};b=function(e){var t,n={debug:!(!e||!e.debug),descriptor:e&&e.descriptor},i=0,r=[],a=0;if(b.prototype.init.call(this),this.dispatchType=E.METADATA_STREAM_TYPE.toString(16),n.descriptor)for(t=0;t<n.descriptor.length;t++)this.dispatchType+=("00"+n.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,s,o,u,l,c;if("timed-metadata"===e.type){if(e.dataAlignmentIndicator&&(a=0,r.length=0),0===r.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))return void(n.debug&&console.log("Skipping unrecognized metadata packet"));if(r.push(e),a+=e.data.byteLength,1===r.length&&(i=A(e.data.subarray(6,10)),i+=10),!(a<i)){for(t={data:new Uint8Array(i),frames:[],pts:r[0].pts,dts:r[0].dts},l=0;l<i;)t.data.set(r[0].data.subarray(0,i-l),l),l+=r[0].data.byteLength,a-=r[0].data.byteLength,r.shift();s=10,64&t.data[5]&&(s+=4,s+=A(t.data.subarray(10,14)),i-=A(t.data.subarray(16,20)));do{if((o=A(t.data.subarray(s+4,s+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if(c=String.fromCharCode(t.data[s],t.data[s+1],t.data[s+2],t.data[s+3]),u={id:c,data:t.data.subarray(s+10,s+o+10)},u.key=u.id,I[u.id]&&(I[u.id](u),"com.apple.streaming.transportStreamTimestamp"===u.owner)){var d=u.data,h=(1&d[3])<<30|d[4]<<22|d[5]<<14|d[6]<<6|d[7]>>>2;h*=4,h+=3&d[7],u.timeStamp=h,void 0===t.pts&&void 0===t.dts&&(t.pts=u.timeStamp,t.dts=u.timeStamp),this.trigger("timestamp",u)}t.frames.push(u),s+=10,s+=o}while(s<i);this.trigger("data",t)}}}},b.prototype=new u;var x=b,P=function(e,t){var n={id:t.index+"",width:t.width,height:t.height,bandwidth:t.bitrate,isEnabled_:!0};return n.enabled=function(t){if(void 0===t)return n.isEnabled_;t!==n.isEnabled_&&(!0!==t&&!1!==t||(n.isEnabled_=t,e()))},n},O=function(e){var t=null,n=function(){var n=t.filter(function(e){return e.enabled()});if(n.length===t.length||0===n.length)return e.el_.vjs_setProperty("autoLevelCapping",-1),void e.el_.vjs_setProperty("level",-1);if(1===n.length)return e.el_.vjs_setProperty("level",parseInt(n[0].id,10)),void e.el_.vjs_setProperty("autoLevelCapping",-1);var i=n[n.length-1].id;e.el_.vjs_setProperty("autoLevelCapping",parseInt(i,10)),e.el_.vjs_setProperty("level",-1)};return function(){if(!t){var i=e.el_.vjs_getProperty("levels");t=i.filter(function(e){return!e.audio}).map(P.bind(null,n))}return t}},L=function(e){for(var t=e.el_.vjs_getProperty("audioTracks"),n=e.audioTracks(),i=null,r=0;r<n.length;r++)if(n[r].enabled){i=n[r].id;break}if(null!==i)for(var a=0;a<t.length;a++)if(i===t[a].title)return void e.el_.vjs_setProperty("audioTrack",a)},D=function(e){var t=e.el_.vjs_getProperty("altAudioTracks"),n=e.el_.vjs_getProperty("audioTracks"),i=e.el_.vjs_getProperty("audioTrack");n.forEach(function(n,r){var a=t[n.id];e.audioTracks().addTrack(new s.a.AudioTrack({id:a.name,enabled:i===r,language:a.lang,default:a.default_track,label:a.name}))})},R=function(e){Object.defineProperties(e.frame,{id:{get:function(){return s.a.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return s.a.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return s.a.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},M=function(e,t,n){for(var i=e.remoteTextTracks()||[],r=0;r<i.length;r++){var a=i[r];a.kind===t&&a.label===n&&e.removeRemoteTextTrack(a)}},N=function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t},U=function(e,t,n){var i,r;if(n&&n.cues)for(i=n.cues.length;i--;)r=n.cues[i],r.startTime<=t&&r.endTime>=e&&n.removeCue(r)},B=function(e,t){e.length&&U(0,e.start(0),t)},j=function(e,t){for(var n=-1,i=0;i<e.length;i++)if(e[i].id===t){n=i;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})},F=function(e,t){var n=[];if(e&&e.length)for(var i=0;i<e.length;i++)t(e.start(i),e.end(i))&&n.push([e.start(i),e.end(i)]);return s.a.createTimeRanges(n)},H=function(e,t){return F(e,function(e,n){return e-1/30<=t&&n+1/30>=t})},q=function(){function e(e,t,n){var i=this;if(t.options_&&t.options_.playerId){var r=s()(t.options_.playerId);r.hasOwnProperty("hls")||Object.defineProperty(r,"hls",{get:function(){return s.a.log.warn("player.hls is deprecated. Use player.tech_.hls instead."),t.trigger({type:"usage",name:"flashls-player-access"}),i}})}Object.defineProperties(this,{stats:{get:function(){return this.tech_.el_.vjs_getProperty("stats")}},bandwidth:{get:function(){return this.tech_.el_.vjs_getProperty("stats").bandwidth}}}),this.tech_=t,this.metadataTrack_=null,this.inbandTextTracks_={},this.metadataStream_=new x,this.captionStream_=new S,this.offsetPts=null,this.offsetDts=null,this.onLoadedmetadata_=this.onLoadedmetadata_.bind(this),this.onSeeking_=this.onSeeking_.bind(this),this.onId3updated_=this.onId3updated_.bind(this),this.onCaptionData_=this.onCaptionData_.bind(this),this.onMetadataStreamData_=this.onMetadataStreamData_.bind(this),this.onCaptionStreamData_=this.onCaptionStreamData_.bind(this),this.onLevelSwitch_=this.onLevelSwitch_.bind(this),this.onLevelLoaded_=this.onLevelLoaded_.bind(this),this.onFragmentLoaded_=this.onFragmentLoaded_.bind(this),this.onAudioTrackChanged=this.onAudioTrackChanged.bind(this),this.onPlay_=this.onPlay_.bind(this),this.tech_.on("loadedmetadata",this.onLoadedmetadata_),this.tech_.on("seeking",this.onSeeking_),this.tech_.on("id3updated",this.onId3updated_),this.tech_.on("captiondata",this.onCaptionData_),this.tech_.on("levelswitch",this.onLevelSwitch_),this.tech_.on("levelloaded",this.onLevelLoaded_),this.tech_.on("fragmentloaded",this.onFragmentLoaded_),this.tech_.on("play",this.onPlay_),this.metadataStream_.on("data",this.onMetadataStreamData_),this.captionStream_.on("data",this.onCaptionStreamData_),this.playlists=new s.a.EventTarget,this.playlists.media=function(){return i.media_()}}var t=e.prototype;return t.src=function(e){e&&this.tech_.setSrc(e.src)},t.onPlay_=function(){if(this.tech_.duration()===1/0){var e=this.seekable();if(this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}},t.seekable=function(){var e=this.tech_.el_.vjs_getProperty("seekableStart"),t=this.tech_.el_.vjs_getProperty("seekableEnd");return 0===t?s.a.createTimeRange():s.a.createTimeRange(e,t)},t.media_=function(){var e,t=this.tech_.el_.vjs_getProperty("levels"),n=this.tech_.el_.vjs_getProperty("level");return t.length&&(e={resolvedUri:t[n].url,attributes:{BANDWIDTH:t[n].bitrate,RESOLUTION:{width:t[n].width,height:t[n].height}}}),e},t.onLoadedmetadata_=function(){var e=this;this.representations=O(this.tech_);var t=s.a.players[this.tech_.options_.playerId];t&&t.qualityLevels&&(this.qualityLevels_=t.qualityLevels(),this.representations().forEach(function(t){e.qualityLevels_.addQualityLevel(t)}),j(this.qualityLevels_,this.tech_.el_.vjs_getProperty("level")+"")),D(this.tech_),this.tech_.audioTracks().on("change",this.onAudioTrackChanged)},t.onAudioTrackChanged=function(){L(this.tech_)},t.onLevelSwitch_=function(e,t){this.qualityLevels_&&j(this.qualityLevels_,t[0].levelIndex+""),this.playlists.trigger("mediachange"),this.tech_.trigger({type:"mediachange",bubbles:!0})},t.onLevelLoaded_=function(){this.playlists.trigger("loadedplaylist")},t.onFragmentLoaded_=function(){this.tech_.trigger("bandwidthupdate"),this.captionStream_.flush()},t.onSeeking_=function(){var e=this;U(0,1/0,this.metadataTrack_),H(this.tech_.buffered(),this.tech_.currentTime()).length||(Object.keys(this.inbandTextTracks_).forEach(function(t){U(0,1/0,e.inbandTextTracks_[t])}),this.captionStream_.reset())},t.onId3updated_=function(e,t){var n=r.a.atob(t[0]),i=N(n),a={type:"timed-metadata",dataAlignmentIndicator:!0,data:i};this.metadataStream_.push(a)},t.onMetadataStreamData_=function(e){var t=this;this.metadataTrack_||(this.metadataTrack_=this.tech_.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,this.metadataTrack_.inBandMetadataTrackDispatchType="15"),B(this.tech_.buffered(),this.metadataTrack_);var n=this.tech_.currentTime();if(e.frames.forEach(function(e){var i=new r.a.VTTCue(n,n+.1,e.value||e.url||e.data||"");i.frame=e,i.value=e,R(i),t.metadataTrack_.addCue(i)}),this.metadataTrack_.cues&&this.metadataTrack_.cues.length){var i=this.metadataTrack_.cues,a=[],s=this.tech_.duration();(isNaN(s)||Math.abs(s)===1/0)&&(s=Number.MAX_VALUE);for(var o=0;o<i.length;o++)a.push(i[o]);a.sort(function(e,t){return e.startTime-t.startTime});for(var u=0;u<a.length-1;u++)a[u].endTime!==a[u+1].startTime&&(a[u].endTime=a[u+1].startTime);a[a.length-1].endTime=s}},t.onCaptionData_=function(e,t){var n=this;t[0].forEach(function(e){n.offsetPts||(n.offsetPts=e.pos),n.offsetDts||(n.offsetDts=e.dts),n.captionStream_.push({pts:9e4*(e.pos-n.offsetPts),dts:9e4*(e.dts-n.offsetDts),escapedRBSP:N(r.a.atob(e.data)),nalUnitType:"sei_rbsp"})})},t.onCaptionStreamData_=function(e){e&&(this.inbandTextTracks_[e.stream]||(M(this.tech_,"captions",e.stream),this.inbandTextTracks_[e.stream]=this.tech_.addRemoteTextTrack({kind:"captions",label:e.stream,id:e.stream},!1).track),B(this.tech_.buffered(),this.inbandTextTracks_[e.stream]),this.inbandTextTracks_[e.stream].addCue(new r.a.VTTCue(e.startPts/9e4,e.endPts/9e4,e.text)))},t.dispose=function(){this.tech_.off("loadedmetadata",this.onLoadedmetadata_),this.tech_.off("seeked",this.onSeeking_),this.tech_.off("id3updated",this.onId3updated_),this.tech_.off("captiondata",this.onCaptionData_),this.tech_.audioTracks().off("change",this.onAudioTrackChanged),this.tech_.off("levelswitch",this.onLevelSwitch_),this.tech_.off("levelloaded",this.onLevelLoaded_),this.tech_.off("fragmentloaded",this.onFragmentLoaded_),this.tech_.off("play",this.onPlay_),this.qualityLevels_&&this.qualityLevels_.dispose()},e}(),V={},W=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;V.canPlayType=function(e){return W.test(e)?"maybe":""},V.canHandleSource=function(e,t){return"maybe"===V.canPlayType(e.type)},V.handleSource=function(e,t,n){return t.hls=new q(e,t,n),t.hls.src(e),t.hls},s.a.getTech("Flash").registerSourceHandler(V,0),V.VERSION="1.4.8",t.default=V},function(e,t,n){"use strict";function i(e){return!!e&&"object"===(void 0===e?"undefined":u(e))&&"[object Object]"===toString.call(e)&&e.constructor===Object}function r(e,t){var n={};return[e,t].forEach(function(e){e&&Object.keys(e).forEach(function(t){var a=e[t];if(!i(a))return void(n[t]=a);i(n[t])||(n[t]={}),n[t]=r(n[t],a)})}),n}function a(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)})}function s(e){var t=void 0,n={top:0,bottom:0,left:0,width:0,height:0,right:0};try{t=e.getBoundingClientRect()}catch(e){t=n}return t}function o(e){function t(){E.sort(function(e,t){return T.markerTip.time(e)-T.markerTip.time(t)})}function n(e){e.forEach(function(e){e.key=a(),k.el().querySelector(".vjs-progress-holder").appendChild(u(e)),S[e.key]=e,E.push(e)}),t()}function i(e){return T.markerTip.time(e)/k.duration()*100}function o(e,t){t.className="vjs-marker "+(e.class||"");var n=t.querySelector(".vjs-marker-point");Object.keys(T.markerStyle).forEach(function(e){n.style[e]=T.markerStyle[e]});var r=e.time/k.duration();(r<0||r>1)&&(t.style.display="none"),t.style.left=i(e)+"%",e.duration&&(t.style.width=e.duration/k.duration()*100+"%",t.style.marginLeft="0px")}function u(e){var t=c.default.dom.createEl("div",{},{"data-marker-key":e.key,"data-marker-time":T.markerTip.time(e)}),n=c.default.dom.createEl("div",{className:"vjs-marker-point"});if(t.appendChild(n),o(e,t),t.addEventListener("click",function(t){var n=!1;if("function"==typeof T.onMarkerClick&&(n=!1===T.onMarkerClick(e)),!n){var i=this.getAttribute("data-marker-key");k.currentTime(T.markerTip.time(S[i]))}}),T.markerTip.display){var i=c.default.dom.createEl("div",{className:"vjs-tip",innerHTML:"<div class='vjs-tip-inner'>"+T.markerTip.text(e)+"</div>\n <div class='vjs-tip-arrow'><div class='arrow'></div></div>"});i.addEventListener("mousedown",function(e){e.stopPropagation()}),i.addEventListener("click",function(e){e.stopPropagation()}),t.appendChild(i),m(t)}return t}function l(e){E.forEach(function(t){var n=k.el().querySelector(".vjs-marker[data-marker-key='"+t.key+"']"),i=T.markerTip.time(t);(e||n.getAttribute("data-marker-time")!==i)&&(o(t,n),n.setAttribute("data-marker-time",i))}),t()}function f(e){A&&(I=p,A.style.visibility="hidden"),w=p;var n=[];e.forEach(function(e){var t=E[e];if(t){delete S[t.key],n.push(e);var i=k.el().querySelector(".vjs-marker[data-marker-key='"+t.key+"']");i&&i.parentNode.removeChild(i)}}),n.reverse(),n.forEach(function(e){E.splice(e,1)}),t()}function m(e){var t=e.querySelector(".vjs-tip");e.addEventListener("mouseover",function(){if(t){var n=s(e);t.style.marginLeft=n.width/2+"px",t.style.visibility="visible"}}),e.addEventListener("mouseout",function(){t&&(t.style.visibility="hidden")})}function g(){if(T.breakOverlay.display&&!(w<0)){var e=k.currentTime(),t=E[w],n=T.markerTip.time(t);e>=n&&e<=n+T.breakOverlay.displayTime?(I!==w&&(I=w,A&&(A.querySelector(".vjs-break-overlay-text").innerHTML=T.breakOverlay.text(t))),A&&(A.style.visibility="visible")):(I=p,A&&(A.style.visibility="hidden"))}}function y(){A=c.default.dom.createEl("div",{className:"vjs-break-overlay",innerHTML:"<div class='vjs-break-overlay-text'></div>"}),Object.keys(T.breakOverlay.style).forEach(function(e){A&&(A.style[e]=T.breakOverlay.style[e])}),k.el().appendChild(A),I=p}function v(){_(),g(),e.onTimeUpdateAfterMarkerUpdate&&e.onTimeUpdateAfterMarkerUpdate()}function _(){if(E.length){var t=function(e){return e<E.length-1?T.markerTip.time(E[e+1]):k.duration()},n=k.currentTime(),i=p;if(w!==p){var r=t(w);if(n>=T.markerTip.time(E[w])&&n<r)return;if(w===E.length-1&&n===k.duration())return}if(n<T.markerTip.time(E[0]))i=p;else for(var a=0;a<E.length;a++){var s=t(a);if(n>=T.markerTip.time(E[a])&&n<s){i=a;break}}i!==w&&(i!==p&&e.onMarkerReached&&e.onMarkerReached(E[i],i),w=i)}}function b(){k.markers.removeAll(),n(T.markers),T.breakOverlay.display&&y();var e=null;k.on("playing",function(){k.clearInterval(e),e=k.setInterval(function(){k.requestAnimationFrame(function(){v()})},d)}),k.on(["ended","pause","waiting"],function(){k.clearInterval(e)}),k.off("loadedmetadata")}c.default.mergeOptions||(c.default.mergeOptions=r),c.default.dom.createEl||(c.default.dom.createEl=function(e,t,n){var i=c.default.Player.prototype.dom.createEl(e,t);return n&&Object.keys(n).forEach(function(e){i.setAttribute(e,n[e])}),i});var T=c.default.mergeOptions(h,e),S={},E=[],w=p,k=this,C=null,A=null,I=p;k.on("loadedmetadata",function(){b()}),k.markers={getMarkers:function(){return E},next:function(){for(var e=k.currentTime(),t=0;t<E.length;t++){var n=T.markerTip.time(E[t]);if(n>e){k.currentTime(n);break}}},prev:function(){for(var e=k.currentTime(),t=E.length-1;t>=0;t--){var n=T.markerTip.time(E[t]);if(n+.5<e)return void k.currentTime(n)}},add:function(e){n(e)},remove:function(e){f(e)},removeAll:function(){for(var e=[],t=0;t<E.length;t++)e.push(t);f(e)},updateTime:function(e){l(e)},reset:function(e){k.markers.removeAll(),n(e)},destroy:function(){k.markers.removeAll(),A&&A.remove(),C&&C.remove(),k.off("timeupdate",g),delete k.markers}}}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=n(0),c=function(e){return e&&e.__esModule?e:{default:e}}(l),d=30,h={markerStyle:{width:"7px","border-radius":"30%","background-color":"red"},markerTip:{display:!0,text:function(e){return"Break: "+e.text},time:function(e){return e.time}},breakOverlay:{display:!1,displayTime:3,text:function(e){return"Break overlay: "+e.overlayText},style:{width:"100%",height:"20%","background-color":"rgba(0,0,0,0.7)",color:"white","font-size":"17px"}},onMarkerClick:function(e){},onMarkerReached:function(e,t){},markers:[]},p=-1;c.default.registerPlugin("markers",o)},function(e,t,n){"use strict";/*! videojs-resolution-switcher - 2015-7-26
28
+ * Copyright (c) 2016 Kasper Moskwiak
29
+ * Modified by Pierre Kraft
30
+ * Licensed under the Apache-2.0 license. */
31
+ !function(){var e=null;e=void 0===window.videojs?n(0):window.videojs,function(e,t){function n(){return!!e.navigator.userAgent.toLowerCase().match(/rv:([\d.]+)\) like gecko/)}function i(){return-1!==e.navigator.userAgent.indexOf("Windows NT 6.1")}function r(e,t,n,i){return o={label:n,sources:t},"function"==typeof i?i(e,t,n):(e.src(t.map(function(e){return{src:e.src,type:e.type,res:e.res}})),e)}var a,s={},o={},u={},l=t.getComponent("MenuItem"),c=t.extend(l,{constructor:function(e,t,n,i){this.onClickListener=n,this.label=i,l.call(this,e,t),this.src=t.src,this.on("click",this.onClick),this.on("touchstart",this.onClick),t.initialySelected&&(this.showAsLabel(),this.selected(!0),this.addClass("vjs-selected"))},showAsLabel:function(){this.label&&(this.label.innerHTML=this.options_.label)},onClick:function(t){this.onClickListener(this);var n=this.player_.currentTime(),i=this.player_.paused(),a=this.player_.src(),s=this.player_.playbackRate(),o=this.player_.volume();this.showAsLabel(),this.addClass("vjs-selected"),i||this.player_.bigPlayButton.hide(),"function"!=typeof t&&"function"==typeof this.options_.customSourcePicker&&(t=this.options_.customSourcePicker);var u="loadeddata";"Youtube"!==this.player_.techName_&&"none"===this.player_.preload()&&"Flash"!==this.player_.techName_&&(u="timeupdate"),a!==this.src[0].src&&r(this.player_,this.src,this.options_.label,t).one(u,function(){var t=this;this.player_.currentTime(n),this.player_.handleTechSeeked_(),i||(this.player_.play(),this.player_.handleTechSeeked_()),this.player_.trigger("resolutionchange"),e.setTimeout(function(){t.player_.controlBar.$(".vjs-play-control").focus()}),this.player_.playbackRate(s),this.player_.volume(o)})}}),d=t.getComponent("MenuButton"),h=t.extend(d,{constructor:function(e,n,i,r){if(this.sources=n.sources,this.label=r,this.label.innerHTML=n.initialySelectedLabel,d.call(this,e,n,i),this.controlText("Quality"),i.dynamicLabel)this.el().appendChild(r);else{var a=document.createElement("span");t.dom.addClass(a,"vjs-resolution-button-staticlabel"),this.el().appendChild(a)}},createItems:function(){var e=[],t=this.sources&&this.sources.label||{},n=function(t){e.map(function(e){e.selected(e===t),e.removeClass("vjs-selected")})};for(var i in t)t.hasOwnProperty(i)&&(e.push(new c(this.player_,{label:i,src:t[i],initialySelected:i===this.options_.initialySelectedLabel,customSourcePicker:this.options_.customSourcePicker},n,this.label)),u[i]=e[e.length-1]);return e}});a=function(e){function a(e,t){return e.res&&t.res?+t.res-+e.res:0}function l(e){var t={label:{},res:{},type:{}};return e.map(function(e){c(t,"label",e),c(t,"res",e),c(t,"type",e),d(t,"label",e),d(t,"res",e),d(t,"type",e)}),t}function c(e,t,n){null==e[t][n[t]]&&(e[t][n[t]]=[])}function d(e,t,n){e[t][n[t]].push(n)}function p(e,t){var n=m.default,i="";return"high"===n?(n=t[0].res,i=t[0].label):"low"!==n&&null!=n&&e.res[n]?e.res[n]&&(i=e.res[n][0].label):(n=t[t.length-1].res,i=t[t.length-1].label),{res:n,label:i,sources:e.res[n]}}function f(e){e.tech_.ytPlayer.setPlaybackQuality("default"),e.tech_.ytPlayer.addEventListener("onPlaybackQualityChange",function(){e.trigger("resolutionchange")}),e.one("play",function(){var t=e.tech_.ytPlayer.getAvailableQualityLevels(),n={highres:{res:1080,label:"1080",yt:"highres"},hd1080:{res:1080,label:"1080",yt:"hd1080"},hd720:{res:720,label:"720",yt:"hd720"},large:{res:480,label:"480",yt:"large"},medium:{res:360,label:"360",yt:"medium"},small:{res:240,label:"240",yt:"small"},tiny:{res:144,label:"144",yt:"tiny"},auto:{res:0,label:"auto",yt:"default"}},i=[];t.map(function(t){i.push({src:e.src().src,type:e.src().type,label:n[t].label,res:n[t].res,_yt:n[t].yt})}),v=l(i);var r=function(t,n){return e.tech_.ytPlayer.setPlaybackQuality(n[0]._yt),e},a={label:"auto",res:0,sources:v.label.auto},s=new h(e,{sources:v,initialySelectedLabel:a.label,initialySelectedRes:a.res,customSourcePicker:r},m,y);s.el().classList.add("vjs-resolution-button"),e.controlBar.resolutionSwitcher=e.controlBar.addChild(s)})}var m=t.mergeOptions(s,e),g=this,y=document.createElement("span"),v={};t.dom.addClass(y,"vjs-resolution-button-label"),g.updateSrc=function(e){if(!e)return g.src();g.controlBar.resolutionSwitcher&&(g.controlBar.resolutionSwitcher.dispose(),delete g.controlBar.resolutionSwitcher),e=e.sort(a),v=l(e);var s=p(v,e),o=new h(g,{sources:v,initialySelectedLabel:s.label,initialySelectedRes:s.res,customSourcePicker:m.customSourcePicker},m,y),u="vjs-resolution-button";return(n()&&i()||"Flash"===g.tech().name_)&&g.src().indexOf(".m3u8")>=0&&(u+=" vjs-resolution-button-hidden"),t.dom.addClass(o.el(),u),g.controlBar.resolutionSwitcher=g.controlBar.el_.insertBefore(o.el_,g.controlBar.getChild("fullscreenToggle").el_),g.controlBar.resolutionSwitcher.dispose=function(){this.parentNode.removeChild(this)},r(g,s.sources,s.label)},g.currentResolution=function(e,t){return null==e?o:(null!=u[e]&&u[e].onClick(t),g)},g.getGroupedSrc=function(){return v},g.ready(function(){g.options_.sources.length>1&&g.updateSrc(g.options_.sources),"Youtube"===g.techName_&&f(g)})},t.registerPlugin("videoJsResolutionSwitcher",a)}(window,e)}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=function(e){return e&&e.__esModule?e:{default:e}}(i),a=function(e){var t=0;return{setSource:function(e,t){t(null,e)},currentTime:function(e){return e>t&&(t=e),e},setCurrentTime:function(n){var i=e.dragTime||e.options_.dragTime,r=t>i?t:i;return"backward"===e.options_.dragMode&&i>=0&&Math.floor(n)>r?e.currentTime():"disabled"===e.options_.dragMode?e.currentTime():n}}};r.default.use("*",a),t.default=a,e.exports=t.default},function(e,t,n){"use strict";function i(e,t){var n=t.path,i=t.height,r=t.width,s=t.interval;if(n.length&&i&&r){var o=a.a.dom||a.a,u=e.controlBar,l=u.progressControl,c=l.seekBar,d=c.mouseTimeDisplay;if(d){var h=function(e){Object.keys(e).forEach(function(t){var n=e[t],i=d.timeTooltip.el_.style;""!==n?i.setProperty(t,n):i.removeProperty(t)})},p=0,f=0,m=0,g=0,y=0;o.createEl("img",{src:n[0]}).onload=function(e){var t=e.target;m=t.naturalWidth,g=t.naturalHeight,f=Math.floor(m/r),p=Math.floor(g/i),y=p*f};var v=function(){if(f){var t=Math.floor(e.duration()*(parseFloat(d.el_.style.left)/c.el_.clientWidth));if(!isNaN(t)){var a=0;n.length>1&&(a=Math.floor(t/s/y));var l=t-a*y*s,p=Math.floor(l/s),m=Math.floor(p/f),g=Math.floor(p%f),v=-m*i,_=-g*r,b=o.getBoundingClientRect(u.el_).top,T=o.getBoundingClientRect(c.el_).top,S=-i;b<T&&(S-=T-b),h({width:r+"px",height:i+"px","background-image":"url("+n[a]+")","background-repeat":"no-repeat","background-position":_+"px "+v+"px",top:S+"px",color:"#fff","text-shadow":"1px 1px #000",border:"1px solid #000",margin:"0 1px"})}}};e.ready(function(){l.on("mousemove",v),l.on("touchmove",v)}),e.addClass("vjs-sprite-thumbnails")}}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=n.n(r),s={path:[],width:0,height:0,interval:1},o=function(e){i(this,a.a.mergeOptions(s,e))};a.a.registerPlugin("spriteThumbnails",o),o.VERSION="0.0.5",t.default=o},function(e,t,n){"use strict";function i(e){return{disableNextSnapshotRestore:!1,_contentEnding:!1,_contentHasEnded:!1,_hasThereBeenALoadStartDuringPlayerLife:!1,_hasThereBeenALoadedData:!1,_hasThereBeenALoadedMetaData:!1,_inLinearAdMode:!1,_shouldBlockPlay:!1,_playBlocked:!1,_playRequested:!1,adType:null,VERSION:b,reset:function(){e.ads.disableNextSnapshotRestore=!1,e.ads._contentEnding=!1,e.ads._contentHasEnded=!1,e.ads.snapshot=null,e.ads.adType=null,e.ads._hasThereBeenALoadedData=!1,e.ads._hasThereBeenALoadedMetaData=!1,e.ads._cancelledPlay=!1,e.ads._shouldBlockPlay=!1,e.ads._playBlocked=!1,e.ads.nopreroll_=!1,e.ads.nopostroll_=!1,e.ads._playRequested=!1},startLinearAdMode:function(){e.ads._state.startLinearAdMode()},endLinearAdMode:function(){e.ads._state.endLinearAdMode()},skipLinearAdMode:function(){e.ads._state.skipLinearAdMode()},stitchedAds:function(e){return void 0!==e&&(m.a.log.warn("Using player.ads.stitchedAds() as a setter is deprecated, it should be set as an option upon initialization of contrib-ads."),this.settings.stitchedAds=!!e),this.settings.stitchedAds},videoElementRecycled:function(){if(e.ads.shouldPlayContentBehindAd(e))return!1;if(!this.snapshot)throw new Error("You cannot use videoElementRecycled while there is no snapshot.");var t=e.tech_.src()!==this.snapshot.src,n=e.currentSrc()!==this.snapshot.currentSrc;return t||n},isLive:function(t){return void 0===t&&(t=e),"boolean"==typeof t.ads.settings.contentIsLive?t.ads.settings.contentIsLive:t.duration()===1/0||"8"===m.a.browser.IOS_VERSION&&0===t.duration()},shouldPlayContentBehindAd:function(t){if(void 0===t&&(t=e),t)return!!t.ads.settings.liveCuePoints&&(!m.a.browser.IS_IOS&&!m.a.browser.IS_ANDROID&&t.duration()===1/0);throw new Error("shouldPlayContentBehindAd requires a player as a param")},shouldTakeSnapshots:function(t){return void 0===t&&(t=e),!this.shouldPlayContentBehindAd(t)&&!this.stitchedAds()},isInAdMode:function(){return this._state.isAdState()},isWaitingForAdBreak:function(){return this._state.isWaitingForAdBreak()},isContentResuming:function(){return this._state.isContentResuming()},isAdPlaying:function(){return this._state.inAdBreak()},inAdBreak:function(){return this._state.inAdBreak()},removeNativePoster:function(){var t=e.$(".vjs-tech");t&&t.removeAttribute("poster")},debug:function(){if(this.settings.debug){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];1===t.length&&"string"==typeof t[0]?m.a.log("ADS: "+t[0]):m.a.log.apply(m.a,["ADS:"].concat(t))}}}}function r(e){"playing"===e.type?E(this,e):"ended"===e.type?w(this,e):"loadstart"===e.type||"loadeddata"===e.type||"loadedmetadata"===e.type?k(this,e):"play"===e.type?C(this,e):this.ads.isInAdMode()&&(this.ads.isContentResuming()?S(this,"content",e):S(this,"ad",e))}function a(e){e.ads.contentSrc=e.currentSrc(),e.ads._seenInitialLoadstart=!1;var t=function(){if(!e.ads.inAdBreak()){var t=e.currentSrc();t!==e.ads.contentSrc&&(e.ads._seenInitialLoadstart&&e.trigger({type:"contentchanged"}),e.trigger({type:"contentupdate",oldValue:e.ads.contentSrc,newValue:t}),e.ads.contentSrc=t),e.ads._seenInitialLoadstart=!0}};e.on("loadstart",t)}function s(e,t,n){var i=this,r={};e=e.replace(/{([^}=]+)=([^}]+)}/g,function(e,t,n){return r["{"+t+"}"]=n,"{"+t+"}"}),void 0===t&&(t=!1);var a={};void 0!==n&&(a=n),a["{player.id}"]=this.options_["data-player"]||this.id_,a["{player.height}"]=this.currentHeight(),a["{player.width}"]=this.currentWidth(),a["{mediainfo.id}"]=this.mediainfo?this.mediainfo.id:"",a["{mediainfo.name}"]=this.mediainfo?this.mediainfo.name:"",a["{mediainfo.duration}"]=this.mediainfo?this.mediainfo.duration:"",a["{player.duration}"]=this.duration(),a["{player.pageUrl}"]=m.a.dom.isInFrame()?_.a.referrer:y.a.location.href,a["{playlistinfo.id}"]=this.playlistinfo?this.playlistinfo.id:"",a["{playlistinfo.name}"]=this.playlistinfo?this.playlistinfo.name:"",a["{timestamp}"]=(new Date).getTime(),a["{document.referrer}"]=_.a.referrer,a["{window.location.href}"]=y.a.location.href,a["{random}"]=Math.floor(1e12*Math.random()),["description","tags","reference_id","ad_keys"].forEach(function(e){i.mediainfo&&i.mediainfo[e]?a["{mediainfo."+e+"}"]=i.mediainfo[e]:r["{mediainfo."+e+"}"]?a["{mediainfo."+e+"}"]=r["{mediainfo."+e+"}"]:a["{mediainfo."+e+"}"]=""}),O(this.mediainfo,a,"custom_fields"),O(this.mediainfo,a,"customFields"),Object.keys(A).forEach(function(e){a["{tcf."+e+"}"]=A[e]}),a["{tcf.gdprAppliesInt}"]=A.gdprApplies?1:0;for(var s in a)e=e.split(s).join(P(a[s],t));e=e.replace(/{pageVariable\.([^}]+)}/g,function(e,n){for(var i,a=y.a,s=n.split("."),o=0;o<s.length;o++)o===s.length-1?i=a[s[o]]:a=a[s[o]];var u=typeof i;return null===i?"null":void 0===i?r["{pageVariable."+n+"}"]?r["{pageVariable."+n+"}"]:(m.a.log.warn('Page variable "'+n+'" not found'),""):"string"!==u&&"number"!==u&&"boolean"!==u?(m.a.log.warn('Page variable "'+n+'" is not a supported type'),""):P(String(i),t)});for(var o in r)e=e.replace(o,r[o]);return e}function o(e,t){t&&m.a.log("Using cancelContentPlay to block content playback"),e.on("play",u)}function u(){!1!==this.ads._shouldBlockPlay&&(this.paused()||(this.ads.debug("Playback was canceled by cancelContentPlay"),this.pause()),this.ads._cancelledPlay=!0)}function l(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function c(e){var t;t=m.a.browser.IS_IOS&&e.ads.isLive(e)&&e.seekable().length>0?e.currentTime()-e.seekable().end(0):e.currentTime();var n=e.$(".vjs-tech"),i=e.textTracks?e.textTracks():[],r=[],a={ended:e.ended(),currentSrc:e.currentSrc(),sources:e.currentSources(),src:e.tech_.src(),currentTime:t,type:e.currentType()};n&&(a.style=n.getAttribute("style"));for(var s=0;s<i.length;s++){var o=i[s];r.push({track:o,mode:o.mode}),o.mode="disabled"}return a.suppressedTracks=r,a}function d(e,t){var n=e.ads.snapshot;if(void 0===t&&(t=function(){}),!0===e.ads.disableNextSnapshotRestore)return e.ads.disableNextSnapshotRestore=!1,delete e.ads.snapshot,void t();var i,r=e.$(".vjs-tech"),a=20,s=n.suppressedTracks,o=function(){for(var e=0;e<s.length;e++)i=s[e],i.track.mode=i.mode},u=function(){var t;if(m.a.browser.IS_IOS&&e.ads.isLive(e)){if(n.currentTime<0&&(t=e.seekable().length>0?e.seekable().end(0)+n.currentTime:e.currentTime(),e.currentTime(t)),e.paused()){var i=e.play();i&&i.catch&&i.catch(function(e){m.a.log.warn("Play promise rejected in IOS snapshot resume",e)})}}else if(n.ended)e.currentTime(e.duration());else{e.currentTime(n.currentTime);var r=e.play();r&&r.catch&&r.catch(function(e){m.a.log.warn("Play promise rejected in snapshot resume",e)})}e.ads.shouldRemoveAutoplay_&&(e.autoplay(!1),e.ads.shouldRemoveAutoplay_=!1)},l=function t(){if(e.off("contentcanplay",t),z&&e.clearTimeout(z),r=e.el().querySelector(".vjs-tech"),r.readyState>1)return u();if(void 0===r.seekable)return u();if(r.seekable.length>0)return u();if(a--)e.setTimeout(t,50);else try{u()}catch(e){m.a.log.warn("Failed to resume the content after an advertisement",e)}};if("style"in n&&r.setAttribute("style",n.style||""),e.ads.videoElementRecycled())e.one("resumeended",function(){delete e.ads.snapshot,t()}),e.one("contentloadedmetadata",o),m.a.browser.IS_IOS&&!e.autoplay()&&(e.autoplay(!0),e.ads.shouldRemoveAutoplay_=!0),e.src(n.sources),e.one("contentcanplay",l),z=e.setTimeout(l,2e3);else{if(o(),!e.ended()){var c=e.play();c&&c.catch&&c.catch(function(e){m.a.log.warn("Play promise rejected in snapshot restore",e)})}delete e.ads.snapshot,t()}}function h(e){e.ads.debug("Starting ad break"),e.ads._inLinearAdMode=!0,e.trigger("adstart"),e.ads.shouldTakeSnapshots()&&(e.ads.snapshot=c(e)),e.ads.shouldPlayContentBehindAd(e)&&(e.ads.preAdVolume_=e.volume(),e.volume(0)),e.addClass("vjs-ad-playing"),e.hasClass("vjs-live")&&e.removeClass("vjs-live"),e.ads.removeNativePoster()}function p(e,t){e.ads.debug("Ending ad break"),void 0===t&&(t=function(){}),e.ads.adType=null,e.ads._inLinearAdMode=!1,e.trigger("adend"),e.removeClass("vjs-ad-playing"),e.ads.isLive(e)&&e.addClass("vjs-live"),e.ads.shouldTakeSnapshots()?d(e,t):(e.volume(e.ads.preAdVolume_),t())}Object.defineProperty(t,"__esModule",{value:!0});var f=n(0),m=n.n(f),g=n(1),y=n.n(g),v=n(7),_=n.n(v),b="6.9.0",T=function(e,t){t.isImmediatePropagationStopped=function(){return!0},t.cancelBubble=!0,t.isPropagationStopped=function(){return!0}},S=function(e,t,n){T(0,n),e.trigger({type:t+n.type,originalEvent:n})},E=function(e,t){e.ads.isInAdMode()&&(e.ads.isContentResuming()?e.ads._contentEnding&&S(e,"content",t):S(e,"ad",t))},w=function(e,t){e.ads.isInAdMode()?e.ads.isContentResuming()?(T(0,t),e.trigger("resumeended")):S(e,"ad",t):e.ads._contentHasEnded||e.ads.stitchedAds()||(S(e,"content",t),e.trigger("readyforpostroll"))},k=function(e,t){if(!("loadstart"===t.type&&!e.ads._hasThereBeenALoadStartDuringPlayerLife||"loadeddata"===t.type&&!e.ads._hasThereBeenALoadedData||"loadedmetadata"===t.type&&!e.ads._hasThereBeenALoadedMetaData))if(e.ads.inAdBreak())S(e,"ad",t);else{if(e.currentSrc()!==e.ads.contentSrc)return;S(e,"content",t)}},C=function(e,t){e.ads.inAdBreak()?S(e,"ad",t):e.ads.isContentResuming()&&S(e,"content",t)},A={},I=function(e){if(m.a.dom.isInFrame()&&"function"!=typeof y.a.__tcfapi){for(var t,n=y.a,i={};n;){try{if(n.frames.__tcfapiLocator){t=n;break}}catch(e){}if(n===y.a.top)break;n=n.parent}if(!t)return;y.a.__tcfapi=function(e,n,r,a){var s=Math.random()+"",o={__tcfapiCall:{command:e,parameter:a,version:n,callId:s}};i[s]=r,t.postMessage(o,"*")},y.a.addEventListener("message",function(e){var t={};try{t="string"==typeof e.data?JSON.parse(e.data):e.data}catch(e){}var n=t.__tcfapiReturn;n&&"function"==typeof i[n.callId]&&(i[n.callId](n.returnValue,n.success),i[n.callId]=null)},!1)}},x=function(){I(),"function"==typeof y.a.__tcfapi&&y.a.__tcfapi("addEventListener",2,function(e,t){t&&(A=e)})},P=function(e,t){return t?encodeURIComponent(e):e},O=function(e,t,n){if(e&&e[n])for(var i=e[n],r=Object.keys(i),a=0;a<r.length;a++){var s="{mediainfo."+n+"."+r[a]+"}";t[s]=i[r[a]]}},L={};L.processMetadataTracks=function(e,t){for(var n=e.textTracks(),i=function(n){"metadata"===n.kind&&(e.ads.cueTextTracks.setMetadataTrackMode(n),t(e,n))},r=0;r<n.length;r++)i(n[r]);n.addEventListener("addtrack",function(e){i(e.track)})},L.setMetadataTrackMode=function(e){},L.getSupportedAdCue=function(e,t){return t},L.isSupportedAdCue=function(e,t){return!0},L.getCueId=function(e,t){return t.id};var D=function(e,t){return void 0!==t&&e.ads.includedCues[t]},R=function(e,t){void 0!==t&&""!==t&&(e.ads.includedCues[t]=!0)};L.processAdTrack=function(e,t,n,i){e.ads.includedCues={};for(var r=0;r<t.length;r++){var a=t[r],s=this.getSupportedAdCue(e,a);if(!this.isSupportedAdCue(e,a))return void m.a.log.warn("Skipping as this is not a supported ad cue.",a);var o=this.getCueId(e,a),u=a.startTime;if(D(e,o))return void m.a.log("Skipping ad already seen with ID "+o);i&&i(e,s,o,u),n(e,s,o,u),R(e,o)}};var M={},N=m.a;M.isMiddlewareMediatorSupported=function(){return!N.browser.IS_IOS&&!N.browser.IS_ANDROID&&!!(N.use&&N.middleware&&N.middleware.TERMINATOR)},M.playMiddleware=function(e){return{setSource:function(e,t){t(null,e)},callPlay:function(){if(e.ads&&!0===e.ads._shouldBlockPlay)return e.ads.debug("Using playMiddleware to block content playback"),e.ads._playBlocked=!0,N.middleware.TERMINATOR},play:function(t,n){e.ads&&e.ads._playBlocked&&t?(e.ads.debug("Play call to Tech was terminated."),e.trigger("play"),e.addClass("vjs-has-started"),e.ads._playBlocked=!1):n&&n.catch&&n.catch(function(t){"NotAllowedError"!==t.name||m.a.browser.IS_SAFARI||e.trigger("pause")})}}},M.testHook=function(e){N=e};var U=M.playMiddleware,B=M.isMiddlewareMediatorSupported,j=function(){if(m.a.getPlugin)return Boolean(m.a.getPlugin("ads"));var e=m.a.getComponent("Player");return Boolean(e&&e.prototype.ads)},F=function(){function e(){}return e.getState=function(t){if(t)return e.states_&&e.states_[t]?e.states_[t]:void 0},e.registerState=function(t,n){if("string"!=typeof t||!t)throw new Error('Illegal state name, "'+t+'"; must be a non-empty string.');return e.states_||(e.states_={}),e.states_[t]=n,n},e}(),H=function(){function e(e){this.player=e}e._getName=function(){return"Anonymous State"};var t=e.prototype;return t.transitionTo=function(e){var t=this.player;this.cleanup(t);var n=new e(t);t.ads._state=n,t.ads.debug(this.constructor._getName()+" -> "+n.constructor._getName());for(var i=arguments.length,r=new Array(i>1?i-1:0),a=1;a<i;a++)r[a-1]=arguments[a];n.init.apply(n,[t].concat(r))},t.init=function(){},t.cleanup=function(){},t.onPlay=function(){},t.onPlaying=function(){},t.onEnded=function(){},t.onAdEnded=function(){},t.onAdsReady=function(){m.a.log.warn("Unexpected adsready event")},t.onAdsError=function(){},t.onAdsCanceled=function(){},t.onAdTimeout=function(){},t.onAdStarted=function(){},t.onContentChanged=function(){},t.onContentResumed=function(){},t.onReadyForPostroll=function(){m.a.log.warn("Unexpected readyforpostroll event")},t.onNoPreroll=function(){},t.onNoPostroll=function(){},t.startLinearAdMode=function(){m.a.log.warn("Unexpected startLinearAdMode invocation (State via "+this.constructor._getName()+")")},t.endLinearAdMode=function(){m.a.log.warn("Unexpected endLinearAdMode invocation (State via "+this.constructor._getName()+")")},t.skipLinearAdMode=function(){m.a.log.warn("Unexpected skipLinearAdMode invocation (State via "+this.constructor._getName()+")")},t.isAdState=function(){throw new Error("isAdState unimplemented for "+this.constructor._getName())},t.isWaitingForAdBreak=function(){return!1},t.isContentResuming=function(){return!1},t.inAdBreak=function(){return!1},t.handleEvent=function(e){var t=this.player;"play"===e?this.onPlay(t):"adsready"===e?this.onAdsReady(t):"adserror"===e?this.onAdsError(t):"adscanceled"===e?this.onAdsCanceled(t):"adtimeout"===e?this.onAdTimeout(t):"ads-ad-started"===e?this.onAdStarted(t):"contentchanged"===e?this.onContentChanged(t):"contentresumed"===e?this.onContentResumed(t):"readyforpostroll"===e?this.onReadyForPostroll(t):"playing"===e?this.onPlaying(t):"ended"===e?this.onEnded(t):"nopreroll"===e?this.onNoPreroll(t):"nopostroll"===e?this.onNoPostroll(t):"adended"===e&&this.onAdEnded(t)},e}();F.registerState("State",H);var q=function(e){function t(t){var n;return n=e.call(this,t)||this,n.contentResuming=!1,n.waitingForAdBreak=!1,n}l(t,e);var n=t.prototype;return n.isAdState=function(){return!0},n.onPlaying=function(){var e=F.getState("ContentPlayback");this.contentResuming&&this.transitionTo(e)},n.onContentResumed=function(){var e=F.getState("ContentPlayback");this.contentResuming&&this.transitionTo(e)},n.isWaitingForAdBreak=function(){return this.waitingForAdBreak},n.isContentResuming=function(){return this.contentResuming},n.inAdBreak=function(){return!0===this.player.ads._inLinearAdMode},t}(H);F.registerState("AdState",q);var V=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var n=t.prototype;return n.isAdState=function(){return!1},n.onContentChanged=function(e){var t=F.getState("BeforePreroll"),n=F.getState("Preroll");e.ads.debug("Received contentchanged event (ContentState)"),e.paused()?this.transitionTo(t):(this.transitionTo(n,!1),e.pause(),e.ads._pausedOnContentupdate=!0)},t}(H);F.registerState("ContentState",V);var W=F.getState("ContentState"),G=function(e){function t(){return e.apply(this,arguments)||this}l(t,e),t._getName=function(){return"AdsDone"};var n=t.prototype;return n.init=function(e){e.ads._contentHasEnded=!0,e.trigger("ended")},n.startLinearAdMode=function(){m.a.log.warn("Unexpected startLinearAdMode invocation (AdsDone)")},t}(W);F.registerState("AdsDone",G);var z,X={start:h,end:p},Y=F.getState("AdState"),K=function(e){function t(){return e.apply(this,arguments)||this}l(t,e),t._getName=function(){return"Preroll"};var n=t.prototype;return n.init=function(e,t,n){if(this.waitingForAdBreak=!0,e.addClass("vjs-ad-loading"),n||e.ads.nopreroll_)return this.resumeAfterNoPreroll(e);var i=e.ads.settings.timeout;"number"==typeof e.ads.settings.prerollTimeout&&(i=e.ads.settings.prerollTimeout),this._timeout=e.setTimeout(function(){e.trigger("adtimeout")},i),t?this.handleAdsReady():this.adsReady=!1},n.onAdsReady=function(e){e.ads.inAdBreak()?m.a.log.warn("Unexpected adsready event (Preroll)"):(e.ads.debug("Received adsready event (Preroll)"),this.handleAdsReady())},n.handleAdsReady=function(){this.adsReady=!0,this.readyForPreroll()},n.afterLoadStart=function(e){var t=this.player;t.ads._hasThereBeenALoadStartDuringPlayerLife?e():(t.ads.debug("Waiting for loadstart..."),t.one("loadstart",function(){t.ads.debug("Received loadstart event"),e()}))},n.noPreroll=function(){var e=this;this.afterLoadStart(function(){e.player.ads.debug("Skipping prerolls due to nopreroll event (Preroll)"),e.resumeAfterNoPreroll(e.player)})},n.readyForPreroll=function(){var e=this.player;this.afterLoadStart(function(){e.ads.debug("Triggered readyforpreroll event (Preroll)"),e.trigger("readyforpreroll")})},n.onAdsCanceled=function(e){var t=this;e.ads.debug("adscanceled (Preroll)"),this.afterLoadStart(function(){t.resumeAfterNoPreroll(e)})},n.onAdsError=function(e){var t=this;m.a.log("adserror (Preroll)"),this.inAdBreak()?e.ads.endLinearAdMode():this.afterLoadStart(function(){t.resumeAfterNoPreroll(e)})},n.startLinearAdMode=function(){var e=this.player;!this.adsReady||e.ads.inAdBreak()||this.isContentResuming()?m.a.log.warn("Unexpected startLinearAdMode invocation (Preroll)"):(this.clearTimeout(e),e.ads.adType="preroll",this.waitingForAdBreak=!1,X.start(e),e.ads._shouldBlockPlay=!1)},n.onAdStarted=function(e){e.removeClass("vjs-ad-loading")},n.endLinearAdMode=function(){var e=this.player;this.inAdBreak()&&(e.removeClass("vjs-ad-loading"),e.addClass("vjs-ad-content-resuming"),this.contentResuming=!0,X.end(e))},n.skipLinearAdMode=function(){var e=this,t=this.player;t.ads.inAdBreak()||this.isContentResuming()?m.a.log.warn("Unexpected skipLinearAdMode invocation"):this.afterLoadStart(function(){t.trigger("adskip"),t.ads.debug("skipLinearAdMode (Preroll)"),e.resumeAfterNoPreroll(t)})},n.onAdTimeout=function(e){var t=this;this.afterLoadStart(function(){e.ads.debug("adtimeout (Preroll)"),t.resumeAfterNoPreroll(e)})},n.onNoPreroll=function(e){e.ads.inAdBreak()||this.isContentResuming()?m.a.log.warn("Unexpected nopreroll event (Preroll)"):this.noPreroll()},n.resumeAfterNoPreroll=function(e){if(this.contentResuming=!0,e.ads._shouldBlockPlay=!1,this.cleanupPartial(e),e.ads._playRequested||e.ads._pausedOnContentupdate)if(e.paused()){e.ads.debug("resumeAfterNoPreroll: attempting to resume playback (Preroll)");var t=e.play();t&&t.then&&t.then(null,function(e){})}else e.ads.debug("resumeAfterNoPreroll: already playing (Preroll)"),e.trigger("play"),e.trigger("playing")},n.cleanup=function(e){e.ads._hasThereBeenALoadStartDuringPlayerLife||m.a.log.warn("Leaving Preroll state before loadstart event can cause issues."),this.cleanupPartial(e)},n.cleanupPartial=function(e){e.removeClass("vjs-ad-loading"),e.removeClass("vjs-ad-content-resuming"),this.clearTimeout(e)},n.clearTimeout=function(e){e.clearTimeout(this._timeout),this._timeout=null},t}(Y);F.registerState("Preroll",K);var Q=F.getState("ContentState"),$=function(e){function t(){return e.apply(this,arguments)||this}l(t,e),t._getName=function(){return"BeforePreroll"};var n=t.prototype;return n.init=function(e){this.adsReady=!1,this.shouldResumeToContent=!1,e.ads._shouldBlockPlay=!e.ads.settings.allowVjsAutoplay||!e.autoplay()},n.onAdsReady=function(e){e.ads.debug("Received adsready event (BeforePreroll)"),this.adsReady=!0},n.onPlay=function(e){var t=F.getState("Preroll");e.ads.debug("Received play event (BeforePreroll)"),this.transitionTo(t,this.adsReady,this.shouldResumeToContent)},n.onAdsCanceled=function(e){e.ads.debug("adscanceled (BeforePreroll)"),this.shouldResumeToContent=!0},n.onAdsError=function(){this.player.ads.debug("adserror (BeforePreroll)"),this.shouldResumeToContent=!0},n.onNoPreroll=function(){this.player.ads.debug("Skipping prerolls due to nopreroll event (BeforePreroll)"),this.shouldResumeToContent=!0},n.skipLinearAdMode=function(){var e=this.player;e.trigger("adskip"),e.ads.debug("skipLinearAdMode (BeforePreroll)"),this.shouldResumeToContent=!0},n.onContentChanged=function(){this.init(this.player)},t}(Q);F.registerState("BeforePreroll",$);var J=F.getState("AdState"),Z=function(e){function t(){return e.apply(this,arguments)||this}l(t,e),t._getName=function(){return"Midroll"};var n=t.prototype;return n.init=function(e){e.ads.adType="midroll",X.start(e),e.addClass("vjs-ad-loading")},n.onAdStarted=function(e){e.removeClass("vjs-ad-loading")},n.endLinearAdMode=function(){var e=this.player;this.inAdBreak()&&(this.contentResuming=!0,e.addClass("vjs-ad-content-resuming"),e.removeClass("vjs-ad-loading"),X.end(e))},n.onAdsError=function(e){this.inAdBreak()&&e.ads.endLinearAdMode()},n.cleanup=function(e){e.removeClass("vjs-ad-loading"),e.removeClass("vjs-ad-content-resuming")},t}(J);F.registerState("Midroll",Z);var ee=F.getState("AdState"),te=function(e){function t(){return e.apply(this,arguments)||this}l(t,e),t._getName=function(){return"Postroll"};var n=t.prototype;return n.init=function(e){if(this.waitingForAdBreak=!0,e.ads._contentEnding=!0,e.ads.nopostroll_){this.resumeContent(e);var t=F.getState("AdsDone");this.transitionTo(t)}else{e.addClass("vjs-ad-loading");var n=e.ads.settings.timeout;"number"==typeof e.ads.settings.postrollTimeout&&(n=e.ads.settings.postrollTimeout),this._postrollTimeout=e.setTimeout(function(){e.trigger("adtimeout")},n)}},n.startLinearAdMode=function(){var e=this.player;e.ads.inAdBreak()||this.isContentResuming()?m.a.log.warn("Unexpected startLinearAdMode invocation (Postroll)"):(e.ads.adType="postroll",e.clearTimeout(this._postrollTimeout),this.waitingForAdBreak=!1,X.start(e))},n.onAdStarted=function(e){e.removeClass("vjs-ad-loading")},n.endLinearAdMode=function(){var e=this,t=this.player,n=F.getState("AdsDone");this.inAdBreak()&&(t.removeClass("vjs-ad-loading"),this.resumeContent(t),X.end(t,function(){e.transitionTo(n)}))},n.skipLinearAdMode=function(){var e=this.player;e.ads.inAdBreak()||this.isContentResuming()?m.a.log.warn("Unexpected skipLinearAdMode invocation"):(e.ads.debug("Postroll abort (skipLinearAdMode)"),e.trigger("adskip"),this.abort(e))},n.onAdTimeout=function(e){e.ads.debug("Postroll abort (adtimeout)"),this.abort(e)},n.onAdsError=function(e){e.ads.debug("Postroll abort (adserror)"),e.ads.inAdBreak()?e.ads.endLinearAdMode():this.abort(e)},n.onContentChanged=function(e){if(this.isContentResuming()){var t=F.getState("BeforePreroll");this.transitionTo(t)}else if(!this.inAdBreak()){var n=F.getState("Preroll");this.transitionTo(n)}},n.onNoPostroll=function(e){this.isContentResuming()||this.inAdBreak()?m.a.log.warn("Unexpected nopostroll event (Postroll)"):this.abort(e)},n.resumeContent=function(e){this.contentResuming=!0,e.addClass("vjs-ad-content-resuming")},n.abort=function(e){var t=F.getState("AdsDone");this.resumeContent(e),e.removeClass("vjs-ad-loading"),this.transitionTo(t)},n.cleanup=function(e){e.removeClass("vjs-ad-content-resuming"),e.clearTimeout(this._postrollTimeout),e.ads._contentEnding=!1},t}(ee);F.registerState("Postroll",te);var ne=F.getState("ContentState"),ie=function(e){function t(){return e.apply(this,arguments)||this}l(t,e),t._getName=function(){return"ContentPlayback"};var n=t.prototype;return n.init=function(e){e.ads._shouldBlockPlay=!1},n.onAdsReady=function(e){e.ads.debug("Received adsready event (ContentPlayback)"),e.ads.nopreroll_||(e.ads.debug("Triggered readyforpreroll event (ContentPlayback)"),e.trigger("readyforpreroll"))},n.onReadyForPostroll=function(e){var t=F.getState("Postroll");e.ads.debug("Received readyforpostroll event"),this.transitionTo(t)},n.startLinearAdMode=function(){var e=F.getState("Midroll");this.transitionTo(e)},t}(ne);F.registerState("ContentPlayback",ie);var re=F.getState("ContentState"),ae=function(e){function t(){return e.apply(this,arguments)||this}l(t,e),t._getName=function(){return"StitchedContentPlayback"};var n=t.prototype;return n.init=function(){this.player.ads._shouldBlockPlay=!1},n.onContentChanged=function(){this.player.ads.debug("Received contentchanged event ("+this.constructor._getName()+")")},n.startLinearAdMode=function(){var e=F.getState("StitchedAdRoll");this.transitionTo(e)},t}(re);F.registerState("StitchedContentPlayback",ae);var se=F.getState("AdState"),oe=function(e){function t(){return e.apply(this,arguments)||this}l(t,e),t._getName=function(){return"StitchedAdRoll"};var n=t.prototype;return n.init=function(){this.waitingForAdBreak=!1,this.contentResuming=!1,this.player.ads.adType="stitched",X.start(this.player)},n.onPlaying=function(){},n.onContentResumed=function(){},n.onAdEnded=function(){this.endLinearAdMode(),this.player.trigger("ended")},n.endLinearAdMode=function(){var e=F.getState("StitchedContentPlayback");X.end(this.player),this.transitionTo(e)},t}(se);F.registerState("StitchedAdRoll",oe);var ue=M.isMiddlewareMediatorSupported,le=m.a.getTech("Html5").Events,ce={timeout:5e3,prerollTimeout:void 0,postrollTimeout:void 0,debug:!1,stitchedAds:!1,contentIsLive:void 0,liveCuePoints:!0,allowVjsAutoplay:m.a.options.normalizeAutoplay||!1},de=function(e){var t=this,n=m.a.mergeOptions(ce,e),u=[];le.concat(["firstplay","loadedalldata"]).forEach(function(e){-1===u.indexOf(e)&&u.push(e)}),t.on(u,r),ue()||o(t,n.debug),t.setTimeout(function(){t.ads._hasThereBeenALoadStartDuringPlayerLife||""===t.src()||m.a.log.error("videojs-contrib-ads has not seen a loadstart event 5 seconds after being initialized, but a source is present. This indicates that videojs-contrib-ads was initialized too late. It must be initialized immediately after video.js in the same tick. As a result, some ads will not play and some media events will be incorrect. For more information, see http://videojs.github.io/videojs-contrib-ads/integrator/getting-started.html")},5e3),t.on("ended",function(){t.hasClass("vjs-has-started")||t.addClass("vjs-has-started")}),t.on("contenttimeupdate",function(){t.removeClass("vjs-waiting")}),t.on(["addurationchange","adcanplay"],function(){if(!t.ads.settings.stitchedAds&&!t.hasStarted()&&(!t.ads.snapshot||t.currentSrc()!==t.ads.snapshot.currentSrc)&&t.ads.inAdBreak()){var e=t.play();e&&e.catch&&e.catch(function(e){m.a.log.warn("Play promise rejected when playing ad",e)})}}),t.on("nopreroll",function(){t.ads.debug("Received nopreroll event"),t.ads.nopreroll_=!0}),t.on("nopostroll",function(){t.ads.debug("Received nopostroll event"),t.ads.nopostroll_=!0}),t.on("playing",function(){t.ads._cancelledPlay=!1,t.ads._pausedOnContentupdate=!1}),t.on("play",function(){t.ads._playRequested=!0}),t.one("loadstart",function(){t.ads._hasThereBeenALoadStartDuringPlayerLife=!0}),t.on("loadeddata",function(){t.ads._hasThereBeenALoadedData=!0}),t.on("loadedmetadata",function(){t.ads._hasThereBeenALoadedMetaData=!0}),t.ads=i(t),t.ads.settings=n,n.stitchedAds=!!n.stitchedAds,n.stitchedAds?t.ads._state=new(F.getState("StitchedContentPlayback"))(t):t.ads._state=new(F.getState("BeforePreroll"))(t),t.ads._state.init(t),t.ads.cueTextTracks=L,t.ads.adMacroReplacement=s.bind(t),a(t),t.on("contentchanged",t.ads.reset);var l=function(){return!t.ads.shouldPlayContentBehindAd(t)&&t.ads.inAdBreak()&&t.tech_.featuresNativeTextTracks&&m.a.browser.IS_IOS&&!Array.isArray(t.textTracks())},c=function(){var e=t.textTracks();if(l())for(var n=0;n<e.length;n++){var i=e[n];"showing"===i.mode&&(i.mode="disabled")}};t.ready(function(){t.textTracks().addEventListener("change",c)}),t.on(["play","playing","ended","adsready","adscanceled","adskip","adserror","adtimeout","adended","ads-ad-started","contentchanged","dispose","contentresumed","readyforpostroll","nopreroll","nopostroll"],function(e){t.ads._state.handleEvent(e.type)}),t.on("dispose",function(){t.ads.reset(),t.textTracks().removeEventListener("change",c)}),x(),t.ads.listenToTcf=x};de.VERSION=b,function(e){!j(m.a)&&((m.a.registerPlugin||m.a.plugin)("ads",e),B()&&!m.a.usingContribAdsMiddleware_&&(m.a.use("*",U),m.a.usingContribAdsMiddleware_=!0,m.a.log.debug("Play middleware has been registered with videojs")))}(de),t.default=de},function(e,t,n){var i,r;!function(a,s){"undefined"!=typeof window&&window.videojs?s(window.videojs):(i=[n(0)],void 0!==(r=function(e){return s(e.default||e)}.apply(t,i))&&(e.exports=r))}(0,function(e){"use strict";"undefined"!=typeof window&&(window.videojs_hotkeys={version:"0.2.27"}),(e.registerPlugin||e.plugin)("hotkeys",function(t){function n(e){return"function"==typeof c?c(e):c}function i(e){null!=e&&"function"==typeof e.then&&e.then(null,function(e){})}var r=this,a=r.el(),s=document,o={volumeStep:.1,seekStep:5,enableMute:!0,enableVolumeScroll:!0,enableHoverScroll:!1,enableFullscreen:!0,enableNumbers:!0,enableJogStyle:!1,alwaysCaptureHotkeys:!1,captureDocumentHotkeys:!1,documentHotkeysFocusElementFilter:function(){return!1},enableModifiersForNumbers:!0,enableInactiveFocus:!0,skipInitialFocus:!1,playPauseKey:function(e){return 32===e.which||179===e.which},rewindKey:function(e){return 37===e.which||177===e.which},forwardKey:function(e){return 39===e.which||176===e.which},volumeUpKey:function(e){return 38===e.which},volumeDownKey:function(e){return 40===e.which},muteKey:function(e){return 77===e.which},fullscreenKey:function(e){return 70===e.which},customKeys:{}},u=e.mergeOptions||e.util.mergeOptions,l=(t=u(o,t||{})).volumeStep,c=t.seekStep,d=t.enableMute,h=t.enableVolumeScroll,p=t.enableHoverScroll,f=t.enableFullscreen,m=t.enableNumbers,g=t.enableJogStyle,y=t.alwaysCaptureHotkeys,v=t.captureDocumentHotkeys,_=t.documentHotkeysFocusElementFilter,b=t.enableModifiersForNumbers,T=t.enableInactiveFocus,S=t.skipInitialFocus,E=e.VERSION;a.hasAttribute("tabIndex")||a.setAttribute("tabIndex","-1"),a.style.outline="none",!y&&r.autoplay()||S||r.one("play",function(){a.focus()}),T&&r.on("userinactive",function(){var e=function(){clearTimeout(t)},t=setTimeout(function(){r.off("useractive",e);var t=s.activeElement,n=a.querySelector(".vjs-control-bar");t&&t.parentElement==n&&a.focus()},10);r.one("useractive",e)}),r.on("play",function(){var e=a.querySelector(".iframeblocker");e&&""===e.style.display&&(e.style.display="block",e.style.bottom="39px")});var w=function(e){var o,u,c=e.which,h=e.preventDefault.bind(e),p=r.duration();if(r.controls()){var T=s.activeElement;if(y||v&&_(T)||T==a||T==a.querySelector(".vjs-tech")||T==a.querySelector(".vjs-control-bar")||T==a.querySelector(".iframeblocker"))switch(I(e,r)){case 1:h(),(y||v)&&e.stopPropagation(),r.paused()?i(r.play()):r.pause();break;case 2:o=!r.paused(),h(),o&&r.pause(),(u=r.currentTime()-n(e))<=0&&(u=0),r.currentTime(u),o&&i(r.play());break;case 3:o=!r.paused(),h(),o&&r.pause(),(u=r.currentTime()+n(e))>=p&&(u=o?p-.001:p),r.currentTime(u),o&&i(r.play());break;case 5:h(),g?(u=r.currentTime()-1,r.currentTime()<=1&&(u=0),r.currentTime(u)):r.volume(r.volume()-l);break;case 4:h(),g?((u=r.currentTime()+1)>=p&&(u=p),r.currentTime(u)):r.volume(r.volume()+l);break;case 6:d&&r.muted(!r.muted());break;case 7:f&&(r.isFullscreen()?r.exitFullscreen():r.requestFullscreen());break;default:if((c>47&&c<59||c>95&&c<106)&&(b||!(e.metaKey||e.ctrlKey||e.altKey))&&m){var S=48;c>95&&(S=96);var E=c-S;h(),r.currentTime(r.duration()*E*.1)}for(var w in t.customKeys){var k=t.customKeys[w];k&&k.key&&k.handler&&k.key(e)&&(h(),k.handler(r,t,e))}}}},k=!1,C=a.querySelector(".vjs-volume-menu-button")||a.querySelector(".vjs-volume-panel");null!=C&&(C.onmouseover=function(){k=!0},C.onmouseout=function(){k=!1});var A=function(e){if(p)t=0;else var t=s.activeElement;if(r.controls()&&(y||t==a||t==a.querySelector(".vjs-tech")||t==a.querySelector(".iframeblocker")||t==a.querySelector(".vjs-control-bar")||k)&&h){e=window.event||e;var n=Math.max(-1,Math.min(1,e.wheelDelta||-e.detail));e.preventDefault(),1==n?r.volume(r.volume()+l):-1==n&&r.volume(r.volume()-l)}},I=function(e,n){return t.playPauseKey(e,n)?1:t.rewindKey(e,n)?2:t.forwardKey(e,n)?3:t.volumeUpKey(e,n)?4:t.volumeDownKey(e,n)?5:t.muteKey(e,n)?6:t.fullscreenKey(e,n)?7:void 0};return r.on("keydown",w),r.on("dblclick",function(e){if(null!=E&&E<="7.1.0"&&r.controls()){var t=e.relatedTarget||e.toElement||s.activeElement;t!=a&&t!=a.querySelector(".vjs-tech")&&t!=a.querySelector(".iframeblocker")||f&&(r.isFullscreen()?r.exitFullscreen():r.requestFullscreen())}}),r.on("mousewheel",A),r.on("DOMMouseScroll",A),v&&document.addEventListener("keydown",function(e){w(e)}),this})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(14),s={};s.audioBg=function(){var e=r.default.getComponent("Component"),t=r.default.extend(e,{constructor:function(t){e.apply(this,arguments)},createEl:function(){var e=r.default.dom.createEl("div",{className:"vjs-audio-bg"});return e.innerHTML="\n <div class='vjs-audio-bg-logo'>\n <div class='vjs-audio-bg-logo-background'></div>\n </div>\n <div class='vjs-audio-bg__down'>\n <div class='vjs-audio-bg__reflection'>\n <div class='vjs-audio-bg-logo'>\n <div class='vjs-audio-bg-logo-background'></div>\n </div>\n </div>\n <div class='vjs-audio-bg__overlay'></div>\n </div>",e}});r.default.registerComponent("AudioBg",t)},s.frontLoading=function(){var e=r.default.getComponent("Component"),t=r.default.extend(e,{constructor:function(t,n){e.apply(this,arguments),n.url&&this.updateBackground(n.url)},createEl:function(){return r.default.dom.createEl("div",{className:"vjs-front-loading"})},updateBackground:function(e){"string"==typeof e&&this.el()&&(r.default.dom.emptyEl(this.el()),this.el().style.backgroundImage="url("+e+")")}});r.default.registerComponent("FrontLoading",t)},s.topControl=function(){var e=r.default.getComponent("Component"),t=r.default.extend(e,{constructor:function(t){e.apply(this,arguments)},createEl:function(){return r.default.dom.createEl("div",{className:"vjs-top-control"})}});r.default.registerComponent("TopControl",t)},s.topTime=function(){var e=r.default.getComponent("Component"),t=r.default.extend(e,{constructor:function(t,n){e.apply(this,arguments),n.text&&this.updateTextContent(n.text)},createEl:function(){return r.default.dom.createEl("div",{className:"vjs-full-time"})},updateTextContent:function(e){"string"!=typeof e&&(e="Text Unknown"),this.el()&&(r.default.dom.emptyEl(this.el()),r.default.dom.appendContent(this.el(),e))}});r.default.registerComponent("TopTime",t)},s.title=function(){var e=r.default.getComponent("Component"),t=r.default.extend(e,{constructor:function(t,n){e.apply(this,arguments),n.title&&this.updateTitleContent(n.title)},createEl:function(){return r.default.dom.createEl("div",{className:"vjs-title"})},updateTitleContent:function(e){"string"==typeof e&&this.el()&&(r.default.dom.emptyEl(this.el()),this.el().innerHTML=e)}});r.default.registerComponent("Title",t)},s.topButton=function(){var e=r.default.getComponent("Component"),t=r.default.extend(e,{constructor:function(t,n){e.apply(this,arguments),n.text&&this.updateTextContent(n.text),n.className&&this.updateClassName(n.className)},createEl:function(){return r.default.dom.createEl("div",{className:"vjs-size-button"})},updateTextContent:function(e){"string"!=typeof e&&(e="Text Unknown"),this.el()&&(r.default.dom.emptyEl(this.el()),r.default.dom.appendContent(this.el(),e))},updateClassName:function(e){"string"!=typeof e&&(e=""),this.el()&&r.default.dom.addClass(this.el(),e)}});r.default.registerComponent("TopButton",t)},s.logo=function(){var e=r.default.getComponent("Component"),t=r.default.extend(e,{constructor:function(t,n){e.apply(this,arguments),n.url&&this.updateBackground(n.url)},createEl:function(){return r.default.dom.createEl("div",{className:"vjs-control-bar-logo vjs-control"})},updateBackground:function(e){"string"==typeof e&&this.el()&&(r.default.dom.emptyEl(this.el()),this.el().style.backgroundImage="url("+e+")")}});r.default.registerComponent("ControlBarLogo",t)},s.playbackRateTip=function(){var e=r.default.getComponent("Component"),t=r.default.extend(e,{constructor:function(t,n){e.apply(this,arguments),n.text&&this.updateText(n.text)},createEl:function(){var e=r.default.dom.createEl("div",{className:"vjs-rate-tip"});return e.innerHTML="",e},updateText:function(e){"string"==typeof e&&this.el()&&(r.default.dom.emptyEl(this.el()),this.el().innerHTML=e)}});r.default.registerComponent("PlaybackRateTip",t)};var o={};o.topControl=function(e){s.topControl(),s.topTime(),s.topButton();var t=function(e,t){e.forEach(function(e){e.removeClass("current")}),t.addClass("current")};if(e.addChild("TopControl"),!e.isAudio()){var n=e.getChild("TopControl").addChild("TopButton",{text:"50%"}),i=e.getChild("TopControl").addChild("TopButton",{text:"75%"}),r=e.getChild("TopControl").addChild("TopButton",{text:"100%",className:"current"}),o=[n,i,r];n.on("click",function(){e.addClass("vjs-fullscreen-small"),e.removeClass("vjs-fullscreen-middle"),t(o,n)}),i.on("click",function(){e.removeClass("vjs-fullscreen-small"),e.addClass("vjs-fullscreen-middle"),t(o,i)}),r.on("click",function(){e.removeClass("vjs-fullscreen-small"),e.removeClass("vjs-fullscreen-middle"),t(o,r)})}var u=e.getChild("TopControl").addChild("TopTime",{text:(0,a.getTime)()});!function e(){return setTimeout(function(){e()},1e3),u.updateTextContent((0,a.getTime)())}()},o.logo=function(e,t){s.logo(),e.getChild("ControlBar").addChild("ControlBarLogo",{url:t})},o.frontLoading=function(e,t){s.frontLoading(),e.addChild("FrontLoading",{url:t})},o.audioBg=function(e){return s.audioBg(),e.addChild("AudioBg")},o.title=function(e,t){s.title(),e.addChild("Title",{title:t})};var u=null;o.playbackRateTip=function(e,t,n){if(e.getChild("ControlBar").removeChild("PlaybackRateTip"),n){s.playbackRateTip(),clearTimeout(u),u=setTimeout(function(){e.getChild("ControlBar").removeChild("PlaybackRateTip")},t.time||1500);var i="function"==typeof t.text?t.text(e):t.text;return e.getChild("ControlBar").addChild("PlaybackRateTip",{text:i})}},t.default=o,e.exports=t.default},function(e,t,n){"use strict";n(61),n(62),n(64),n(66),n(67)},function(e,t){},function(e,t,n){"use strict";n(63)},function(e,t){},function(e,t,n){"use strict";n(65)},function(e,t){},function(e,t){},function(e,t){}])});
32
32
  //# sourceMappingURL=videoplayer.min.js.map