@clickview/exchange 0.49.0 → 0.50.0-rc.2

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 (379) hide show
  1. package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  2. package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  3. package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  4. package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  5. package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  6. package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  7. package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  8. package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  9. package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  10. package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  11. package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  12. package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  13. package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  14. package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  15. package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  16. package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  17. package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  18. package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  19. package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  20. package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  21. package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  22. package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  23. package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  24. package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  25. package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  26. package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  27. package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  28. package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  29. package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  30. package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  31. package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  32. package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  33. package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  34. package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  35. package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  36. package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  37. package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  38. package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  39. package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  40. package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  41. package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  42. package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  43. package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  44. package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  45. package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  46. package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  47. package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  48. package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  49. package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  50. package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  51. package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  52. package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  53. package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  54. package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  55. package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  56. package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  57. package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  58. package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  59. package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  60. package/dist/bundles.json +2 -2
  61. package/dist/css/B57G3PZD.chunk.css +1 -0
  62. package/dist/css/BBV1d-ZI.chunk.css +1 -0
  63. package/dist/css/BDOTXlob.chunk.css +1 -0
  64. package/dist/css/BIeUeS4h.chunk.css +1 -0
  65. package/dist/css/BPdg7JW4.chunk.css +1 -0
  66. package/dist/css/BiRz4h1c.chunk.css +1 -0
  67. package/dist/css/Bt3pBBLn.chunk.css +1 -0
  68. package/dist/css/Bz8F9buU.chunk.css +1 -0
  69. package/dist/css/C2R4QydJ.chunk.css +1 -0
  70. package/dist/css/C7XoyEPr.chunk.css +1 -0
  71. package/dist/css/CAdv9Saa.chunk.css +1 -0
  72. package/dist/css/CC5F5C8O.chunk.css +1 -0
  73. package/dist/css/CCsCPLDG.chunk.css +1 -0
  74. package/dist/css/CD1qrI1T.chunk.css +1 -0
  75. package/dist/css/CDiJwtuL.chunk.css +1 -0
  76. package/dist/css/CM-cscAF.chunk.css +1 -0
  77. package/dist/css/CY0yvCW4.chunk.css +1 -0
  78. package/dist/css/Ci6HCTb5.chunk.css +1 -0
  79. package/dist/css/CifDVjr-.chunk.css +1 -0
  80. package/dist/css/CphXVlxY.chunk.css +1 -0
  81. package/dist/css/CrSv-tYo.chunk.css +1 -0
  82. package/dist/css/DD13UQOa.chunk.css +1 -0
  83. package/dist/css/DGyCCqtO.chunk.css +1 -0
  84. package/dist/css/DI4l_5OJ.chunk.css +1 -0
  85. package/dist/css/DL_jCfRl.chunk.css +1 -0
  86. package/dist/css/DRlDmMhN.chunk.css +1 -0
  87. package/dist/css/Dkh6sNpi.chunk.css +1 -0
  88. package/dist/css/DlOtoSz0.chunk.css +1 -0
  89. package/dist/css/DnhNnDZN.chunk.css +1 -0
  90. package/dist/css/EnQ3abug.chunk.css +1 -0
  91. package/dist/css/O777zV0C.chunk.css +1 -0
  92. package/dist/css/fs02hBfZ.chunk.css +1 -0
  93. package/dist/css/jbMisi9r.chunk.css +1 -0
  94. package/dist/css/w4TLT4f5.chunk.css +1 -0
  95. package/dist/en.json +1 -0
  96. package/dist/scripts/-rDA7laA.chunk.js +2 -0
  97. package/dist/scripts/-rDA7laA.chunk.js.map +1 -0
  98. package/dist/scripts/1oBN4k-t.chunk.js +2 -0
  99. package/dist/scripts/1oBN4k-t.chunk.js.map +1 -0
  100. package/dist/scripts/5EeDosB6.chunk.js +15 -0
  101. package/dist/scripts/5EeDosB6.chunk.js.map +1 -0
  102. package/dist/scripts/6D5NxiDj.chunk.js +2 -0
  103. package/dist/scripts/6D5NxiDj.chunk.js.map +1 -0
  104. package/dist/scripts/7fC_wUI0.chunk.js +2 -0
  105. package/dist/scripts/7fC_wUI0.chunk.js.map +1 -0
  106. package/dist/scripts/B1QnQX6X.chunk.js +2 -0
  107. package/dist/scripts/B1QnQX6X.chunk.js.map +1 -0
  108. package/dist/scripts/B5a9j4D_.chunk.js +2 -0
  109. package/dist/scripts/B5a9j4D_.chunk.js.map +1 -0
  110. package/dist/scripts/B668bf5B.chunk.js +2 -0
  111. package/dist/scripts/B668bf5B.chunk.js.map +1 -0
  112. package/dist/scripts/B93FMGSP.chunk.js +2 -0
  113. package/dist/scripts/B93FMGSP.chunk.js.map +1 -0
  114. package/dist/scripts/BBhJOnJs.chunk.js +2 -0
  115. package/dist/scripts/BBhJOnJs.chunk.js.map +1 -0
  116. package/dist/scripts/BHy7EHYB.chunk.js +2 -0
  117. package/dist/scripts/BHy7EHYB.chunk.js.map +1 -0
  118. package/dist/scripts/BI7-pkuo.chunk.js +2 -0
  119. package/dist/scripts/BI7-pkuo.chunk.js.map +1 -0
  120. package/dist/scripts/BNoyVB0N.chunk.js +2 -0
  121. package/dist/scripts/BNoyVB0N.chunk.js.map +1 -0
  122. package/dist/scripts/BOzZT1qL.chunk.js +2 -0
  123. package/dist/scripts/BOzZT1qL.chunk.js.map +1 -0
  124. package/dist/scripts/BTq4W22K.chunk.js +2 -0
  125. package/dist/scripts/BTq4W22K.chunk.js.map +1 -0
  126. package/dist/scripts/BeyY1CwV.chunk.js +2 -0
  127. package/dist/scripts/BeyY1CwV.chunk.js.map +1 -0
  128. package/dist/scripts/Bi0GaEZE.chunk.js +2 -0
  129. package/dist/scripts/Bi0GaEZE.chunk.js.map +1 -0
  130. package/dist/scripts/Bksx5ui9.chunk.js +2 -0
  131. package/dist/scripts/Bksx5ui9.chunk.js.map +1 -0
  132. package/dist/scripts/BlDVEZsX.chunk.js +2 -0
  133. package/dist/scripts/BlDVEZsX.chunk.js.map +1 -0
  134. package/dist/scripts/BoXsW16j.chunk.js +2 -0
  135. package/dist/scripts/BoXsW16j.chunk.js.map +1 -0
  136. package/dist/scripts/BopIehJE.chunk.js +2 -0
  137. package/dist/scripts/BopIehJE.chunk.js.map +1 -0
  138. package/dist/scripts/BpkgwVDj.chunk.js +2 -0
  139. package/dist/scripts/BpkgwVDj.chunk.js.map +1 -0
  140. package/dist/scripts/Bq1eQRV_.chunk.js +2 -0
  141. package/dist/scripts/Bq1eQRV_.chunk.js.map +1 -0
  142. package/dist/scripts/Bsw4ZO9U.chunk.js +2 -0
  143. package/dist/scripts/Bsw4ZO9U.chunk.js.map +1 -0
  144. package/dist/scripts/BuawzJwd.chunk.js +2 -0
  145. package/dist/scripts/BuawzJwd.chunk.js.map +1 -0
  146. package/dist/scripts/BvnJNI_Y.chunk.js +2 -0
  147. package/dist/scripts/BvnJNI_Y.chunk.js.map +1 -0
  148. package/dist/scripts/Bz18U45-.chunk.js +2 -0
  149. package/dist/scripts/Bz18U45-.chunk.js.map +1 -0
  150. package/dist/scripts/C36BgTJV.chunk.js +2 -0
  151. package/dist/scripts/C36BgTJV.chunk.js.map +1 -0
  152. package/dist/scripts/C5r1_Fc_.chunk.js +2 -0
  153. package/dist/scripts/C5r1_Fc_.chunk.js.map +1 -0
  154. package/dist/scripts/C6bEPV55.chunk.js +2 -0
  155. package/dist/scripts/C6bEPV55.chunk.js.map +1 -0
  156. package/dist/scripts/C7lfPlyo.chunk.js +2 -0
  157. package/dist/scripts/C7lfPlyo.chunk.js.map +1 -0
  158. package/dist/scripts/C8aildLX.chunk.js +2 -0
  159. package/dist/scripts/C8aildLX.chunk.js.map +1 -0
  160. package/dist/scripts/C8geGHZf.chunk.js +2 -0
  161. package/dist/scripts/C8geGHZf.chunk.js.map +1 -0
  162. package/dist/scripts/C97fjHLE.chunk.js +2 -0
  163. package/dist/scripts/C97fjHLE.chunk.js.map +1 -0
  164. package/dist/scripts/C99JIGI3.chunk.js +2 -0
  165. package/dist/scripts/C99JIGI3.chunk.js.map +1 -0
  166. package/dist/scripts/CBTOSLnS.chunk.js +2 -0
  167. package/dist/scripts/CBTOSLnS.chunk.js.map +1 -0
  168. package/dist/scripts/CBlUYGqN.chunk.js +2 -0
  169. package/dist/scripts/CBlUYGqN.chunk.js.map +1 -0
  170. package/dist/scripts/CDVd8Gzo.chunk.js +2 -0
  171. package/dist/scripts/CDVd8Gzo.chunk.js.map +1 -0
  172. package/dist/scripts/CEZiVSXU.chunk.js +2 -0
  173. package/dist/scripts/CEZiVSXU.chunk.js.map +1 -0
  174. package/dist/scripts/CHPVU_Qn.chunk.js +362 -0
  175. package/dist/scripts/CHPVU_Qn.chunk.js.map +1 -0
  176. package/dist/scripts/CHa6bZJR.chunk.js +2 -0
  177. package/dist/scripts/CHa6bZJR.chunk.js.map +1 -0
  178. package/dist/scripts/CJ3oIQlG.chunk.js +2 -0
  179. package/dist/scripts/CJ3oIQlG.chunk.js.map +1 -0
  180. package/dist/scripts/CRomQTdh.chunk.js +50 -0
  181. package/dist/scripts/CRomQTdh.chunk.js.map +1 -0
  182. package/dist/scripts/CRuObGvW.chunk.js +2 -0
  183. package/dist/scripts/CRuObGvW.chunk.js.map +1 -0
  184. package/dist/scripts/CX6fV4JE.chunk.js +2 -0
  185. package/dist/scripts/CX6fV4JE.chunk.js.map +1 -0
  186. package/dist/scripts/CYuY28rl.chunk.js +2 -0
  187. package/dist/scripts/CYuY28rl.chunk.js.map +1 -0
  188. package/dist/scripts/C_sNZ3q9.chunk.js +2 -0
  189. package/dist/scripts/C_sNZ3q9.chunk.js.map +1 -0
  190. package/dist/scripts/CdGLJKZk.chunk.js +2 -0
  191. package/dist/scripts/CdGLJKZk.chunk.js.map +1 -0
  192. package/dist/scripts/Cdo-iAIt.chunk.js +2 -0
  193. package/dist/scripts/Cdo-iAIt.chunk.js.map +1 -0
  194. package/dist/scripts/CeVw08Ln.chunk.js +2 -0
  195. package/dist/scripts/CeVw08Ln.chunk.js.map +1 -0
  196. package/dist/scripts/CfRzFJ31.chunk.js +2 -0
  197. package/dist/scripts/CfRzFJ31.chunk.js.map +1 -0
  198. package/dist/scripts/CiRJHxmU.chunk.js +8 -0
  199. package/dist/scripts/CiRJHxmU.chunk.js.map +1 -0
  200. package/dist/scripts/CidPoXbD.chunk.js +2 -0
  201. package/dist/scripts/CidPoXbD.chunk.js.map +1 -0
  202. package/dist/scripts/CmcCT6Mq.chunk.js +2 -0
  203. package/dist/scripts/CmcCT6Mq.chunk.js.map +1 -0
  204. package/dist/scripts/Cmu1J2M7.chunk.js +262 -0
  205. package/dist/scripts/Cmu1J2M7.chunk.js.map +1 -0
  206. package/dist/scripts/CrAxON7A.chunk.js +2 -0
  207. package/dist/scripts/CrAxON7A.chunk.js.map +1 -0
  208. package/dist/scripts/Ct_04zDE.chunk.js +2 -0
  209. package/dist/scripts/Ct_04zDE.chunk.js.map +1 -0
  210. package/dist/scripts/CtciUXp4.chunk.js +2 -0
  211. package/dist/scripts/CtciUXp4.chunk.js.map +1 -0
  212. package/dist/scripts/CxB8O87g.chunk.js +2 -0
  213. package/dist/scripts/CxB8O87g.chunk.js.map +1 -0
  214. package/dist/scripts/Cyhg-nBj.chunk.js +2 -0
  215. package/dist/scripts/Cyhg-nBj.chunk.js.map +1 -0
  216. package/dist/scripts/D1fkcw30.chunk.js +2 -0
  217. package/dist/scripts/D1fkcw30.chunk.js.map +1 -0
  218. package/dist/scripts/DHjeFsuP.chunk.js +5 -0
  219. package/dist/scripts/DHjeFsuP.chunk.js.map +1 -0
  220. package/dist/scripts/DRxJfu3A.chunk.js +2 -0
  221. package/dist/scripts/DRxJfu3A.chunk.js.map +1 -0
  222. package/dist/scripts/DT1DdOeu.chunk.js +2 -0
  223. package/dist/scripts/DT1DdOeu.chunk.js.map +1 -0
  224. package/dist/scripts/DU8kVZuh.chunk.js +2 -0
  225. package/dist/scripts/DU8kVZuh.chunk.js.map +1 -0
  226. package/dist/scripts/DWmgmt8-.chunk.js +2 -0
  227. package/dist/scripts/DWmgmt8-.chunk.js.map +1 -0
  228. package/dist/scripts/DXRtwYU8.chunk.js +2 -0
  229. package/dist/scripts/DXRtwYU8.chunk.js.map +1 -0
  230. package/dist/scripts/DYjoaCnl.chunk.js +2 -0
  231. package/dist/scripts/DYjoaCnl.chunk.js.map +1 -0
  232. package/dist/scripts/DbVI3h0V.chunk.js +2 -0
  233. package/dist/scripts/DbVI3h0V.chunk.js.map +1 -0
  234. package/dist/scripts/DcA5xG6o.chunk.js +2 -0
  235. package/dist/scripts/DcA5xG6o.chunk.js.map +1 -0
  236. package/dist/scripts/DgWxzhMg.chunk.js +2 -0
  237. package/dist/scripts/DgWxzhMg.chunk.js.map +1 -0
  238. package/dist/scripts/Dh_LRqD1.chunk.js +2 -0
  239. package/dist/scripts/Dh_LRqD1.chunk.js.map +1 -0
  240. package/dist/scripts/DiR2eKm4.chunk.js +2 -0
  241. package/dist/scripts/DiR2eKm4.chunk.js.map +1 -0
  242. package/dist/scripts/Dmfr0hZx.chunk.js +2 -0
  243. package/dist/scripts/Dmfr0hZx.chunk.js.map +1 -0
  244. package/dist/scripts/DsCrIxlP.chunk.js +2 -0
  245. package/dist/scripts/DsCrIxlP.chunk.js.map +1 -0
  246. package/dist/scripts/DuHiL0j5.chunk.js +2 -0
  247. package/dist/scripts/DuHiL0j5.chunk.js.map +1 -0
  248. package/dist/scripts/DwMcJ3Ip.chunk.js +2 -0
  249. package/dist/scripts/DwMcJ3Ip.chunk.js.map +1 -0
  250. package/dist/scripts/DxkmuWkI.chunk.js +2 -0
  251. package/dist/scripts/DxkmuWkI.chunk.js.map +1 -0
  252. package/dist/scripts/DzbCvkXx.chunk.js +2 -0
  253. package/dist/scripts/DzbCvkXx.chunk.js.map +1 -0
  254. package/dist/scripts/Kj832An8.chunk.js +2 -0
  255. package/dist/scripts/Kj832An8.chunk.js.map +1 -0
  256. package/dist/scripts/OpOTepmF.chunk.js +2 -0
  257. package/dist/scripts/OpOTepmF.chunk.js.map +1 -0
  258. package/dist/scripts/OvG1eOzS.chunk.js +6 -0
  259. package/dist/scripts/OvG1eOzS.chunk.js.map +1 -0
  260. package/dist/scripts/QfCSKVqV.chunk.js +2 -0
  261. package/dist/scripts/QfCSKVqV.chunk.js.map +1 -0
  262. package/dist/scripts/U4HYh7oC.chunk.js +2 -0
  263. package/dist/scripts/U4HYh7oC.chunk.js.map +1 -0
  264. package/dist/scripts/W8wegH66.chunk.js +2 -0
  265. package/dist/scripts/W8wegH66.chunk.js.map +1 -0
  266. package/dist/scripts/WHGl124l.chunk.js +2 -0
  267. package/dist/scripts/WHGl124l.chunk.js.map +1 -0
  268. package/dist/scripts/_sYSSSUN.chunk.js +2 -0
  269. package/dist/scripts/_sYSSSUN.chunk.js.map +1 -0
  270. package/dist/scripts/aFUDBFEd.chunk.js +2 -0
  271. package/dist/scripts/aFUDBFEd.chunk.js.map +1 -0
  272. package/dist/scripts/app-Det8y4U1.js +219 -0
  273. package/dist/scripts/app-Det8y4U1.js.map +1 -0
  274. package/dist/scripts/cw1CbjiZ.chunk.js +2 -0
  275. package/dist/scripts/cw1CbjiZ.chunk.js.map +1 -0
  276. package/dist/scripts/d_OewpIc.chunk.js +2 -0
  277. package/dist/scripts/d_OewpIc.chunk.js.map +1 -0
  278. package/dist/scripts/dnQMOuPg.chunk.js +2 -0
  279. package/dist/scripts/dnQMOuPg.chunk.js.map +1 -0
  280. package/dist/scripts/h68xZO90.chunk.js +2 -0
  281. package/dist/scripts/h68xZO90.chunk.js.map +1 -0
  282. package/dist/scripts/l-2DoY9E.chunk.js +2 -0
  283. package/dist/scripts/l-2DoY9E.chunk.js.map +1 -0
  284. package/dist/scripts/mALBAvSP.chunk.js +3 -0
  285. package/dist/scripts/mALBAvSP.chunk.js.map +1 -0
  286. package/dist/scripts/pkzD5BEm.chunk.js +2 -0
  287. package/dist/scripts/pkzD5BEm.chunk.js.map +1 -0
  288. package/dist/scripts/wKPIC1H3.chunk.js +2 -0
  289. package/dist/scripts/wKPIC1H3.chunk.js.map +1 -0
  290. package/dist/scripts/x8TB7tv6.chunk.js +2 -0
  291. package/dist/scripts/x8TB7tv6.chunk.js.map +1 -0
  292. package/dist/scripts/z6Us1EdG.chunk.js +2 -0
  293. package/dist/scripts/z6Us1EdG.chunk.js.map +1 -0
  294. package/package.json +7 -4
  295. package/typings/utils/env.d.ts +3 -0
  296. package/typings/utils/imports.d.ts +1 -1
  297. package/vite.config.ts +6 -0
  298. package/dist/css/1068-exchange-b5eaf8af44.chunk.css +0 -35
  299. package/dist/css/1127-exchange-0eab318199.chunk.css +0 -40
  300. package/dist/css/1226-exchange-217b44f8b4.chunk.css +0 -57
  301. package/dist/css/1861-exchange-f3ff7e4f0d.chunk.css +0 -85
  302. package/dist/css/2494-exchange-02d7a0249c.chunk.css +0 -2
  303. package/dist/css/2538-exchange-4cbfe56ba3.chunk.css +0 -1
  304. package/dist/css/3291-exchange-3a8e198338.chunk.css +0 -11
  305. package/dist/css/3858-exchange-06944bdfa4.chunk.css +0 -1
  306. package/dist/css/4075-exchange-6d2304419c.chunk.css +0 -5
  307. package/dist/css/5027-exchange-2284222ca6.chunk.css +0 -25
  308. package/dist/css/6298-exchange-78ece5c7c5.chunk.css +0 -37
  309. package/dist/css/6332-exchange-2a22bfa655.chunk.css +0 -1
  310. package/dist/css/6356-exchange-8c5b220bf6.chunk.css +0 -1
  311. package/dist/css/7095-exchange-4cbfe56ba3.chunk.css +0 -1
  312. package/dist/css/7759-exchange-23bb5dd175.chunk.css +0 -8
  313. package/dist/css/8294-exchange-c797263ac2.chunk.css +0 -1
  314. package/dist/css/8589-exchange-71b6bc18f9.chunk.css +0 -11
  315. package/dist/css/8866-exchange-e80e6c6649.chunk.css +0 -10
  316. package/dist/css/9212-exchange-d71527fc65.chunk.css +0 -1
  317. package/dist/css/9611-exchange-cbf2bb5621.chunk.css +0 -5
  318. package/dist/css/9958-exchange-1387f35e92.chunk.css +0 -14
  319. package/dist/css/lite-exchange-306a09841f.css +0 -15
  320. package/dist/languages/en.json +0 -1
  321. package/dist/scripts/1068-0b00683666-exchange.chunk.js +0 -1
  322. package/dist/scripts/1127-356b23351e-exchange.chunk.js +0 -1
  323. package/dist/scripts/1136-4d8336cfdf-exchange.chunk.js +0 -2
  324. package/dist/scripts/1136-4d8336cfdf-exchange.chunk.js.LICENSE.txt +0 -1
  325. package/dist/scripts/1226-a4c0643661-exchange.chunk.js +0 -1
  326. package/dist/scripts/1861-5966a23e19-exchange.chunk.js +0 -2
  327. package/dist/scripts/1861-5966a23e19-exchange.chunk.js.LICENSE.txt +0 -1
  328. package/dist/scripts/2087-bbc1fd721f-exchange.chunk.js +0 -1
  329. package/dist/scripts/2117-5d867c698d-exchange.chunk.js +0 -1
  330. package/dist/scripts/2127-71bf57d74b-exchange.chunk.js +0 -1
  331. package/dist/scripts/2494-98cce57764-exchange.chunk.js +0 -2
  332. package/dist/scripts/2494-98cce57764-exchange.chunk.js.LICENSE.txt +0 -1
  333. package/dist/scripts/2507-1911a9bdb2-exchange.chunk.js +0 -1
  334. package/dist/scripts/2538-997edb9433-exchange.chunk.js +0 -2
  335. package/dist/scripts/2538-997edb9433-exchange.chunk.js.LICENSE.txt +0 -1
  336. package/dist/scripts/2648-4197959943-exchange.chunk.js +0 -1
  337. package/dist/scripts/2877-eee7fe484e-exchange.chunk.js +0 -1
  338. package/dist/scripts/3291-f9ccc2ea28-exchange.chunk.js +0 -1
  339. package/dist/scripts/3858-cd9d38c31c-exchange.chunk.js +0 -1
  340. package/dist/scripts/4075-6624f96fc6-exchange.chunk.js +0 -1
  341. package/dist/scripts/4299-36e5929cc6-exchange.chunk.js +0 -1
  342. package/dist/scripts/4312-552ca118ad-exchange.chunk.js +0 -1
  343. package/dist/scripts/442-47e3927b49-exchange.chunk.js +0 -1
  344. package/dist/scripts/455-ceeb969c54-exchange.chunk.js +0 -1
  345. package/dist/scripts/4558-057650ef22-exchange.chunk.js +0 -1
  346. package/dist/scripts/5027-357264982b-exchange.chunk.js +0 -1
  347. package/dist/scripts/5173-9cde8f68d3-exchange.chunk.js +0 -1
  348. package/dist/scripts/5267-443f3cdd59-exchange.chunk.js +0 -1
  349. package/dist/scripts/601-a3c22b0a9f-exchange.chunk.js +0 -1
  350. package/dist/scripts/6156-2bf99d5991-exchange.chunk.js +0 -1
  351. package/dist/scripts/6298-1c7a0ba516-exchange.chunk.js +0 -1
  352. package/dist/scripts/6332-9d2d42e2f9-exchange.chunk.js +0 -1
  353. package/dist/scripts/6356-dd8ff70cbb-exchange.chunk.js +0 -1
  354. package/dist/scripts/6725-25d1542dec-exchange.chunk.js +0 -1
  355. package/dist/scripts/6831-30fa3e741e-exchange.chunk.js +0 -1
  356. package/dist/scripts/7095-ee45499a0d-exchange.chunk.js +0 -2
  357. package/dist/scripts/7095-ee45499a0d-exchange.chunk.js.LICENSE.txt +0 -1
  358. package/dist/scripts/7170-cc2ea0de18-exchange.chunk.js +0 -1
  359. package/dist/scripts/7759-2740213eb8-exchange.chunk.js +0 -1
  360. package/dist/scripts/7782-36924dba92-exchange.chunk.js +0 -1
  361. package/dist/scripts/7925-978cf5d7fb-exchange.chunk.js +0 -1
  362. package/dist/scripts/851-d89fb94a66-exchange.chunk.js +0 -2
  363. package/dist/scripts/851-d89fb94a66-exchange.chunk.js.LICENSE.txt +0 -1
  364. package/dist/scripts/8536-dc903c2f54-exchange.chunk.js +0 -1
  365. package/dist/scripts/8589-912ab9f055-exchange.chunk.js +0 -1
  366. package/dist/scripts/8619-e5f595a594-exchange.chunk.js +0 -1
  367. package/dist/scripts/8866-0993e6b43a-exchange.chunk.js +0 -1
  368. package/dist/scripts/8937-727d080ed9-exchange.chunk.js +0 -1
  369. package/dist/scripts/9212-e8bde56a84-exchange.chunk.js +0 -1
  370. package/dist/scripts/9414-85c7657c8f-exchange.chunk.js +0 -2
  371. package/dist/scripts/9414-85c7657c8f-exchange.chunk.js.LICENSE.txt +0 -60
  372. package/dist/scripts/9566-0625fb0cbe-exchange.chunk.js +0 -1
  373. package/dist/scripts/9611-6fe32ccc83-exchange.chunk.js +0 -1
  374. package/dist/scripts/9866-2d10067a4e-exchange.chunk.js +0 -1
  375. package/dist/scripts/9899-2b571c961b-exchange.chunk.js +0 -1
  376. package/dist/scripts/9958-7f8f5ae2c6-exchange.chunk.js +0 -2
  377. package/dist/scripts/9958-7f8f5ae2c6-exchange.chunk.js.LICENSE.txt +0 -1
  378. package/dist/scripts/bundle-1ce30e6578.min.js +0 -2
  379. package/dist/scripts/bundle-1ce30e6578.min.js.LICENSE.txt +0 -108
@@ -0,0 +1,362 @@
1
+ import{y as Vi,b4 as hw,b5 as mt,T as dw,ar as $d,b6 as Fs,ae as ci,ad as wi,b7 as fv,b8 as fw,b9 as pv,ba as pw,ac as _l,bb as Sm,bc as we,bd as We,be as Ys,ab as Dl,bf as mv,bg as mw,bh as gw,bi as vw,bj as yw,bk as _w,bl as Tw,bm as bw,bn as Sw,bo as Cw,bp as Ew,bq as ww,br as kw,bs as xw,bt as Aw,bu as Iw,bv as Pw,bw as Dw,q as Nw,r as Us,bx as Lw,R as Pt,c as Ow,j as oe,L as Th,J as Cm,w as ja,G as _n,Q as dp,aa as Jn,aH as Mw,F as Rw,V as Bw,by as Mu,aV as Ru,bz as Mb,bA as Fw,at as Na,ao as Rb,bB as Uw,az as Bb,aI as $w,aq as uc,M as cc,bC as jw,A as Vw,ap as Hw,as as qw,af as zw,B as Tl,bD as Ww,Y as Gw}from"./app-Det8y4U1.js";import{r as Fb,V as Kw}from"./Bi0GaEZE.chunk.js";import{S as Xw,l as Qw}from"./C6bEPV55.chunk.js";import{T as Yw,d as Jw,V as Zw,L as ek}from"./DHjeFsuP.chunk.js";import{C as Em}from"./cw1CbjiZ.chunk.js";import{S as tk}from"./CBlUYGqN.chunk.js";import{C as ik}from"./C99JIGI3.chunk.js";import{s as rk,c as nk,a as gv}from"./W8wegH66.chunk.js";import{u as Ub,a as sk}from"./CHa6bZJR.chunk.js";import{D as ak,R as Za,B as vv,a as yv}from"./DwMcJ3Ip.chunk.js";import{u as ok}from"./C36BgTJV.chunk.js";import{D as lk}from"./Cdo-iAIt.chunk.js";import{M as Nl}from"./BeyY1CwV.chunk.js";import{B as uk}from"./DzbCvkXx.chunk.js";import{A as ck}from"./B93FMGSP.chunk.js";import{B as hk}from"./DgWxzhMg.chunk.js";import{T as _v}from"./B668bf5B.chunk.js";import{V as Tv}from"./d_OewpIc.chunk.js";import{b as dk}from"./DXRtwYU8.chunk.js";import{T as fk}from"./Bz18U45-.chunk.js";import{T as pk}from"./Dmfr0hZx.chunk.js";import{T as mk}from"./OpOTepmF.chunk.js";var jd,bv;function bo(){if(bv)return jd;bv=1;var s;return typeof window<"u"?s=window:typeof globalThis<"u"?s=globalThis:typeof self<"u"?s=self:s={},jd=s,jd}var gk=bo();const D=Vi(gk),vk={},yk=Object.freeze(Object.defineProperty({__proto__:null,default:vk},Symbol.toStringTag,{value:"Module"})),_k=hw(yk);var Vd,Sv;function $b(){if(Sv)return Vd;Sv=1;var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},e=_k,t;return typeof document<"u"?t=document:(t=s["__GLOBAL_DOCUMENT_CACHE@4"],t||(t=s["__GLOBAL_DOCUMENT_CACHE@4"]=e)),Vd=t,Vd}var Tk=$b();const le=Vi(Tk);var Bu={exports:{}},Hd,Cv;function jb(){if(Cv)return Hd;Cv=1,Hd=e;var s=Object.prototype.toString;function e(t){if(!t)return!1;var i=s.call(t);return i==="[object Function]"||typeof t=="function"&&i!=="[object RegExp]"||typeof window<"u"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}return Hd}var qd,Ev;function bk(){if(Ev)return qd;Ev=1;function s(r,n){var a=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(a)return(a=a.call(r)).next.bind(a);if(Array.isArray(r)||(a=e(r))||n){a&&(r=a);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e(r,n){if(r){if(typeof r=="string")return t(r,n);var a=Object.prototype.toString.call(r).slice(8,-1);if(a==="Object"&&r.constructor&&(a=r.constructor.name),a==="Map"||a==="Set")return Array.from(r);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return t(r,n)}}function t(r,n){(n==null||n>r.length)&&(n=r.length);for(var a=0,o=new Array(n);a<n;a++)o[a]=r[a];return o}var i=(function(){function r(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var n=r.prototype;return n.getIsEnabled=function(){return this.enabled_},n.enable=function(){this.enabled_=!0},n.disable=function(){this.enabled_=!1},n.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},n.addInterceptor=function(o,l){this.typeToInterceptorsMap_.has(o)||this.typeToInterceptorsMap_.set(o,new Set);var u=this.typeToInterceptorsMap_.get(o);return u.has(l)?!1:(u.add(l),!0)},n.removeInterceptor=function(o,l){var u=this.typeToInterceptorsMap_.get(o);return u&&u.has(l)?(u.delete(l),!0):!1},n.clearInterceptorsByType=function(o){var l=this.typeToInterceptorsMap_.get(o);return l?(this.typeToInterceptorsMap_.delete(o),this.typeToInterceptorsMap_.set(o,new Set),!0):!1},n.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},n.getForType=function(o){return this.typeToInterceptorsMap_.get(o)||new Set},n.execute=function(o,l){for(var u=this.getForType(o),c=s(u),h;!(h=c()).done;){var f=h.value;try{l=f(l)}catch{}}return l},r})();return qd=i,qd}var zd,wv;function Sk(){if(wv)return zd;wv=1;var s=(function(){function t(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var i=t.prototype;return i.getIsEnabled=function(){return this.enabled_},i.enable=function(){this.enabled_=!0},i.disable=function(){this.enabled_=!1},i.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},i.getMaxAttempts=function(){return this.maxAttempts_},i.setMaxAttempts=function(n){this.maxAttempts_=n},i.getDelayFactor=function(){return this.delayFactor_},i.setDelayFactor=function(n){this.delayFactor_=n},i.getFuzzFactor=function(){return this.fuzzFactor_},i.setFuzzFactor=function(n){this.fuzzFactor_=n},i.getInitialDelay=function(){return this.initialDelay_},i.setInitialDelay=function(n){this.initialDelay_=n},i.createRetry=function(n){var a=n===void 0?{}:n,o=a.maxAttempts,l=a.delayFactor,u=a.fuzzFactor,c=a.initialDelay;return new e({maxAttempts:o||this.maxAttempts_,delayFactor:l||this.delayFactor_,fuzzFactor:u||this.fuzzFactor_,initialDelay:c||this.initialDelay_})},t})(),e=(function(){function t(r){this.maxAttempts_=r.maxAttempts,this.delayFactor_=r.delayFactor,this.fuzzFactor_=r.fuzzFactor,this.currentDelay_=r.initialDelay,this.currentAttempt_=1}var i=t.prototype;return i.moveToNextAttempt=function(){this.currentAttempt_++;var n=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+n},i.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},i.getCurrentDelay=function(){return this.currentDelay_},i.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},i.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},i.getCurrentFuzzedDelay=function(){var n=this.getCurrentMinPossibleDelay(),a=this.getCurrentMaxPossibleDelay();return n+Math.random()*(a-n)},t})();return zd=s,zd}var Wd,kv;function Ck(){if(kv)return Wd;kv=1;var s=bo(),e=function(r,n){return n===void 0&&(n=!1),function(a,o,l){if(a){r(a);return}if(o.statusCode>=400&&o.statusCode<=599){var u=l;if(n)if(s.TextDecoder){var c=t(o.headers&&o.headers["content-type"]);try{u=new TextDecoder(c).decode(l)}catch{}}else u=String.fromCharCode.apply(null,new Uint8Array(l));r({cause:u});return}r(null,l)}};function t(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(r,n){var a=n.split("="),o=a[0],l=a[1];return o.trim()==="charset"?l.trim():r},"utf-8")}return Wd=e,Wd}var xv;function Ek(){if(xv)return Bu.exports;xv=1;var s=bo(),e=Fb(),t=jb(),i=bk(),r=Sk();u.httpHandler=Ck(),u.requestInterceptorsStorage=new i,u.responseInterceptorsStorage=new i,u.retryManager=new r;/**
3
+ * @license
4
+ * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
5
+ * Copyright (c) 2014 David Björklund
6
+ * Available under the MIT license
7
+ * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
8
+ */var n=function(C){var p={};return C&&C.trim().split(`
9
+ `).forEach(function(b){var I=b.indexOf(":"),L=b.slice(0,I).trim().toLowerCase(),F=b.slice(I+1).trim();typeof p[L]>"u"?p[L]=F:Array.isArray(p[L])?p[L].push(F):p[L]=[p[L],F]}),p};Bu.exports=u,Bu.exports.default=u,u.XMLHttpRequest=s.XMLHttpRequest||f,u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:s.XDomainRequest,a(["get","put","post","patch","head","delete"],function(g){u[g==="delete"?"del":g]=function(C,p,b){return p=l(C,p,b),p.method=g.toUpperCase(),c(p)}});function a(g,C){for(var p=0;p<g.length;p++)C(g[p])}function o(g){for(var C in g)if(g.hasOwnProperty(C))return!1;return!0}function l(g,C,p){var b=g;return t(C)?(p=C,typeof g=="string"&&(b={uri:g})):b=e({},C,{uri:g}),b.callback=p,b}function u(g,C,p){return C=l(g,C,p),c(C)}function c(g){if(typeof g.callback>"u")throw new Error("callback argument missing");if(g.requestType&&u.requestInterceptorsStorage.getIsEnabled()){var C={uri:g.uri||g.url,headers:g.headers||{},body:g.body,metadata:g.metadata||{},retry:g.retry,timeout:g.timeout},p=u.requestInterceptorsStorage.execute(g.requestType,C);g.uri=p.uri,g.headers=p.headers,g.body=p.body,g.metadata=p.metadata,g.retry=p.retry,g.timeout=p.timeout}var b=!1,I=function(se,ue,he){b||(b=!0,g.callback(se,ue,he))};function L(){O.readyState===4&&!u.responseInterceptorsStorage.getIsEnabled()&&setTimeout(B,0)}function F(){var ne=void 0;if(O.response?ne=O.response:ne=O.responseText||h(O),ce)try{ne=JSON.parse(ne)}catch{}return ne}function V(ne){if(clearTimeout(de),clearTimeout(g.retryTimeout),ne instanceof Error||(ne=new Error(""+(ne||"Unknown XMLHttpRequest Error"))),ne.statusCode=0,!U&&u.retryManager.getIsEnabled()&&g.retry&&g.retry.shouldRetry()){g.retryTimeout=setTimeout(function(){g.retry.moveToNextAttempt(),g.xhr=O,c(g)},g.retry.getCurrentFuzzedDelay());return}if(g.requestType&&u.responseInterceptorsStorage.getIsEnabled()){var se={headers:pe.headers||{},body:pe.body,responseUrl:O.responseURL,responseType:O.responseType},ue=u.responseInterceptorsStorage.execute(g.requestType,se);pe.body=ue.body,pe.headers=ue.headers}return I(ne,pe)}function B(){if(!U){var ne;clearTimeout(de),clearTimeout(g.retryTimeout),g.useXDR&&O.status===void 0?ne=200:ne=O.status===1223?204:O.status;var se=pe,ue=null;if(ne!==0?(se={body:F(),statusCode:ne,method:P,headers:{},url:w,rawRequest:O},O.getAllResponseHeaders&&(se.headers=n(O.getAllResponseHeaders()))):ue=new Error("Internal XMLHttpRequest Error"),g.requestType&&u.responseInterceptorsStorage.getIsEnabled()){var he={headers:se.headers||{},body:se.body,responseUrl:O.responseURL,responseType:O.responseType},ve=u.responseInterceptorsStorage.execute(g.requestType,he);se.body=ve.body,se.headers=ve.headers}return I(ue,se,se.body)}}var O=g.xhr||null;O||(g.cors||g.useXDR?O=new u.XDomainRequest:O=new u.XMLHttpRequest);var M,U,w=O.url=g.uri||g.url,P=O.method=g.method||"GET",Q=g.body||g.data,G=O.headers=g.headers||{},K=!!g.sync,ce=!1,de,pe={body:void 0,headers:{},statusCode:0,method:P,url:w,rawRequest:O};if("json"in g&&g.json!==!1&&(ce=!0,G.accept||G.Accept||(G.Accept="application/json"),P!=="GET"&&P!=="HEAD"&&(G["content-type"]||G["Content-Type"]||(G["Content-Type"]="application/json"),Q=JSON.stringify(g.json===!0?Q:g.json))),O.onreadystatechange=L,O.onload=B,O.onerror=V,O.onprogress=function(){},O.onabort=function(){U=!0,clearTimeout(g.retryTimeout)},O.ontimeout=V,O.open(P,w,!K,g.username,g.password),K||(O.withCredentials=!!g.withCredentials),!K&&g.timeout>0&&(de=setTimeout(function(){if(!U){U=!0,O.abort("timeout");var ne=new Error("XMLHttpRequest timeout");ne.code="ETIMEDOUT",V(ne)}},g.timeout)),O.setRequestHeader)for(M in G)G.hasOwnProperty(M)&&O.setRequestHeader(M,G[M]);else if(g.headers&&!o(g.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in g&&(O.responseType=g.responseType),"beforeSend"in g&&typeof g.beforeSend=="function"&&g.beforeSend(O),O.send(Q||null),O}function h(g){try{if(g.responseType==="document")return g.responseXML;var C=g.responseXML&&g.responseXML.documentElement.nodeName==="parsererror";if(g.responseType===""&&!C)return g.responseXML}catch{}return null}function f(){}return Bu.exports}var wk=Ek();const Vb=Vi(wk);var Gd={exports:{}},Kd,Av;function kk(){if(Av)return Kd;Av=1;var s=$b(),e=Object.create||(function(){function w(){}return function(P){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return w.prototype=P,new w}})();function t(w,P){this.name="ParsingError",this.code=w.code,this.message=P||w.message}t.prototype=e(Error.prototype),t.prototype.constructor=t,t.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function i(w){function P(G,K,ce,de){return(G|0)*3600+(K|0)*60+(ce|0)+(de|0)/1e3}var Q=w.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return Q?Q[3]?P(Q[1],Q[2],Q[3].replace(":",""),Q[4]):Q[1]>59?P(Q[1],Q[2],0,Q[4]):P(0,Q[1],Q[2],Q[4]):null}function r(){this.values=e(null)}r.prototype={set:function(w,P){!this.get(w)&&P!==""&&(this.values[w]=P)},get:function(w,P,Q){return Q?this.has(w)?this.values[w]:P[Q]:this.has(w)?this.values[w]:P},has:function(w){return w in this.values},alt:function(w,P,Q){for(var G=0;G<Q.length;++G)if(P===Q[G]){this.set(w,P);break}},integer:function(w,P){/^-?\d+$/.test(P)&&this.set(w,parseInt(P,10))},percent:function(w,P){return P.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(P=parseFloat(P),P>=0&&P<=100)?(this.set(w,P),!0):!1}};function n(w,P,Q,G){var K=G?w.split(G):[w];for(var ce in K)if(typeof K[ce]=="string"){var de=K[ce].split(Q);if(de.length===2){var pe=de[0].trim(),ne=de[1].trim();P(pe,ne)}}}function a(w,P,Q){var G=w;function K(){var pe=i(w);if(pe===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+G);return w=w.replace(/^[^\sa-zA-Z-]+/,""),pe}function ce(pe,ne){var se=new r;n(pe,function(ue,he){switch(ue){case"region":for(var ve=Q.length-1;ve>=0;ve--)if(Q[ve].id===he){se.set(ue,Q[ve].region);break}break;case"vertical":se.alt(ue,he,["rl","lr"]);break;case"line":var Ae=he.split(","),De=Ae[0];se.integer(ue,De),se.percent(ue,De)&&se.set("snapToLines",!1),se.alt(ue,De,["auto"]),Ae.length===2&&se.alt("lineAlign",Ae[1],["start","center","end"]);break;case"position":Ae=he.split(","),se.percent(ue,Ae[0]),Ae.length===2&&se.alt("positionAlign",Ae[1],["start","center","end"]);break;case"size":se.percent(ue,he);break;case"align":se.alt(ue,he,["start","center","end","left","right"]);break}},/:/,/\s/),ne.region=se.get("region",null),ne.vertical=se.get("vertical","");try{ne.line=se.get("line","auto")}catch{}ne.lineAlign=se.get("lineAlign","start"),ne.snapToLines=se.get("snapToLines",!0),ne.size=se.get("size",100);try{ne.align=se.get("align","center")}catch{ne.align=se.get("align","middle")}try{ne.position=se.get("position","auto")}catch{ne.position=se.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},ne.align)}ne.positionAlign=se.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},ne.align)}function de(){w=w.replace(/^\s+/,"")}if(de(),P.startTime=K(),de(),w.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+G);w=w.substr(3),de(),P.endTime=K(),de(),ce(w,P)}var o=s.createElement&&s.createElement("textarea"),l={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},u={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},c={v:"title",lang:"lang"},h={rt:"ruby"};function f(w,P){function Q(){if(!P)return null;function De(Ne){return P=P.substr(Ne.length),Ne}var Me=P.match(/^([^<]*)(<[^>]*>?)?/);return De(Me[1]?Me[1]:Me[2])}function G(De){return o.innerHTML=De,De=o.textContent,o.textContent="",De}function K(De,Me){return!h[Me.localName]||h[Me.localName]===De.localName}function ce(De,Me){var Ne=l[De];if(!Ne)return null;var Je=w.document.createElement(Ne),Re=c[De];return Re&&Me&&(Je[Re]=Me.trim()),Je}for(var de=w.document.createElement("div"),pe=de,ne,se=[];(ne=Q())!==null;){if(ne[0]==="<"){if(ne[1]==="/"){se.length&&se[se.length-1]===ne.substr(2).replace(">","")&&(se.pop(),pe=pe.parentNode);continue}var ue=i(ne.substr(1,ne.length-2)),he;if(ue){he=w.document.createProcessingInstruction("timestamp",ue),pe.appendChild(he);continue}var ve=ne.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!ve||(he=ce(ve[1],ve[3]),!he)||!K(pe,he))continue;if(ve[2]){var Ae=ve[2].split(".");Ae.forEach(function(De){var Me=/^bg_/.test(De),Ne=Me?De.slice(3):De;if(u.hasOwnProperty(Ne)){var Je=Me?"background-color":"color",Re=u[Ne];he.style[Je]=Re}}),he.className=Ae.join(" ")}se.push(ve[1]),pe.appendChild(he),pe=he;continue}pe.appendChild(w.document.createTextNode(G(ne)))}return de}var g=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function C(w){for(var P=0;P<g.length;P++){var Q=g[P];if(w>=Q[0]&&w<=Q[1])return!0}return!1}function p(w){var P=[],Q="",G;if(!w||!w.childNodes)return"ltr";function K(pe,ne){for(var se=ne.childNodes.length-1;se>=0;se--)pe.push(ne.childNodes[se])}function ce(pe){if(!pe||!pe.length)return null;var ne=pe.pop(),se=ne.textContent||ne.innerText;if(se){var ue=se.match(/^.*(\n|\r)/);return ue?(pe.length=0,ue[0]):se}if(ne.tagName==="ruby")return ce(pe);if(ne.childNodes)return K(pe,ne),ce(pe)}for(K(P,w);Q=ce(P);)for(var de=0;de<Q.length;de++)if(G=Q.charCodeAt(de),C(G))return"rtl";return"ltr"}function b(w){if(typeof w.line=="number"&&(w.snapToLines||w.line>=0&&w.line<=100))return w.line;if(!w.track||!w.track.textTrackList||!w.track.textTrackList.mediaElement)return-1;for(var P=w.track,Q=P.textTrackList,G=0,K=0;K<Q.length&&Q[K]!==P;K++)Q[K].mode==="showing"&&G++;return++G*-1}function I(){}I.prototype.applyStyles=function(w,P){P=P||this.div;for(var Q in w)w.hasOwnProperty(Q)&&(P.style[Q]=w[Q])},I.prototype.formatStyle=function(w,P){return w===0?0:w+P};function L(w,P,Q){I.call(this),this.cue=P,this.cueDiv=f(w,P.text);var G={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:P.vertical===""?"horizontal-tb":P.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(G,this.cueDiv),this.div=w.document.createElement("div"),G={direction:p(this.cueDiv),writingMode:P.vertical===""?"horizontal-tb":P.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:P.align==="middle"?"center":P.align,font:Q.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(G),this.div.appendChild(this.cueDiv);var K=0;switch(P.positionAlign){case"start":case"line-left":K=P.position;break;case"center":K=P.position-P.size/2;break;case"end":case"line-right":K=P.position-P.size;break}P.vertical===""?this.applyStyles({left:this.formatStyle(K,"%"),width:this.formatStyle(P.size,"%")}):this.applyStyles({top:this.formatStyle(K,"%"),height:this.formatStyle(P.size,"%")}),this.move=function(ce){this.applyStyles({top:this.formatStyle(ce.top,"px"),bottom:this.formatStyle(ce.bottom,"px"),left:this.formatStyle(ce.left,"px"),right:this.formatStyle(ce.right,"px"),height:this.formatStyle(ce.height,"px"),width:this.formatStyle(ce.width,"px")})}}L.prototype=e(I.prototype),L.prototype.constructor=L;function F(w){var P,Q,G,K;if(w.div){Q=w.div.offsetHeight,G=w.div.offsetWidth,K=w.div.offsetTop;var ce=(ce=w.div.childNodes)&&(ce=ce[0])&&ce.getClientRects&&ce.getClientRects();w=w.div.getBoundingClientRect(),P=ce?Math.max(ce[0]&&ce[0].height||0,w.height/ce.length):0}this.left=w.left,this.right=w.right,this.top=w.top||K,this.height=w.height||Q,this.bottom=w.bottom||K+(w.height||Q),this.width=w.width||G,this.lineHeight=P!==void 0?P:w.lineHeight}F.prototype.move=function(w,P){switch(P=P!==void 0?P:this.lineHeight,w){case"+x":this.left+=P,this.right+=P;break;case"-x":this.left-=P,this.right-=P;break;case"+y":this.top+=P,this.bottom+=P;break;case"-y":this.top-=P,this.bottom-=P;break}},F.prototype.overlaps=function(w){return this.left<w.right&&this.right>w.left&&this.top<w.bottom&&this.bottom>w.top},F.prototype.overlapsAny=function(w){for(var P=0;P<w.length;P++)if(this.overlaps(w[P]))return!0;return!1},F.prototype.within=function(w){return this.top>=w.top&&this.bottom<=w.bottom&&this.left>=w.left&&this.right<=w.right},F.prototype.overlapsOppositeAxis=function(w,P){switch(P){case"+x":return this.left<w.left;case"-x":return this.right>w.right;case"+y":return this.top<w.top;case"-y":return this.bottom>w.bottom}},F.prototype.intersectPercentage=function(w){var P=Math.max(0,Math.min(this.right,w.right)-Math.max(this.left,w.left)),Q=Math.max(0,Math.min(this.bottom,w.bottom)-Math.max(this.top,w.top)),G=P*Q;return G/(this.height*this.width)},F.prototype.toCSSCompatValues=function(w){return{top:this.top-w.top,bottom:w.bottom-this.bottom,left:this.left-w.left,right:w.right-this.right,height:this.height,width:this.width}},F.getSimpleBoxPosition=function(w){var P=w.div?w.div.offsetHeight:w.tagName?w.offsetHeight:0,Q=w.div?w.div.offsetWidth:w.tagName?w.offsetWidth:0,G=w.div?w.div.offsetTop:w.tagName?w.offsetTop:0;w=w.div?w.div.getBoundingClientRect():w.tagName?w.getBoundingClientRect():w;var K={left:w.left,right:w.right,top:w.top||G,height:w.height||P,bottom:w.bottom||G+(w.height||P),width:w.width||Q};return K};function V(w,P,Q,G){function K(Ne,Je){for(var Re,Oe=new F(Ne),He=1,st=0;st<Je.length;st++){for(;Ne.overlapsOppositeAxis(Q,Je[st])||Ne.within(Q)&&Ne.overlapsAny(G);)Ne.move(Je[st]);if(Ne.within(Q))return Ne;var Ct=Ne.intersectPercentage(Q);He>Ct&&(Re=new F(Ne),He=Ct),Ne=new F(Oe)}return Re||Oe}var ce=new F(P),de=P.cue,pe=b(de),ne=[];if(de.snapToLines){var se;switch(de.vertical){case"":ne=["+y","-y"],se="height";break;case"rl":ne=["+x","-x"],se="width";break;case"lr":ne=["-x","+x"],se="width";break}var ue=ce.lineHeight,he=ue*Math.round(pe),ve=Q[se]+ue,Ae=ne[0];Math.abs(he)>ve&&(he=he<0?-1:1,he*=Math.ceil(ve/ue)*ue),pe<0&&(he+=de.vertical===""?Q.height:Q.width,ne=ne.reverse()),ce.move(Ae,he)}else{var De=ce.lineHeight/Q.height*100;switch(de.lineAlign){case"center":pe-=De/2;break;case"end":pe-=De;break}switch(de.vertical){case"":P.applyStyles({top:P.formatStyle(pe,"%")});break;case"rl":P.applyStyles({left:P.formatStyle(pe,"%")});break;case"lr":P.applyStyles({right:P.formatStyle(pe,"%")});break}ne=["+y","-x","+x","-y"],ce=new F(P)}var Me=K(ce,ne);P.move(Me.toCSSCompatValues(Q))}function B(){}B.StringDecoder=function(){return{decode:function(w){if(!w)return"";if(typeof w!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(w))}}},B.convertCueToDOMTree=function(w,P){return!w||!P?null:f(w,P)};var O=.05,M="sans-serif",U="1.5%";return B.processCues=function(w,P,Q){if(!w||!P||!Q)return null;for(;Q.firstChild;)Q.removeChild(Q.firstChild);var G=w.document.createElement("div");G.style.position="absolute",G.style.left="0",G.style.right="0",G.style.top="0",G.style.bottom="0",G.style.margin=U,Q.appendChild(G);function K(ue){for(var he=0;he<ue.length;he++)if(ue[he].hasBeenReset||!ue[he].displayState)return!0;return!1}if(!K(P)){for(var ce=0;ce<P.length;ce++)G.appendChild(P[ce].displayState);return}var de=[],pe=F.getSimpleBoxPosition(G),ne=Math.round(pe.height*O*100)/100,se={font:ne+"px "+M};(function(){for(var ue,he,ve=0;ve<P.length;ve++)he=P[ve],ue=new L(w,he,se),G.appendChild(ue.div),V(w,ue,pe,de),he.displayState=ue.div,de.push(F.getSimpleBoxPosition(ue))})()},B.Parser=function(w,P,Q){Q||(Q=P,P={}),P||(P={}),this.window=w,this.vttjs=P,this.state="INITIAL",this.buffer="",this.decoder=Q||new TextDecoder("utf8"),this.regionList=[]},B.Parser.prototype={reportOrThrowError:function(w){if(w instanceof t)this.onparsingerror&&this.onparsingerror(w);else throw w},parse:function(w){var P=this;w&&(P.buffer+=P.decoder.decode(w,{stream:!0}));function Q(){for(var ue=P.buffer,he=0;he<ue.length&&ue[he]!=="\r"&&ue[he]!==`
10
+ `;)++he;var ve=ue.substr(0,he);return ue[he]==="\r"&&++he,ue[he]===`
11
+ `&&++he,P.buffer=ue.substr(he),ve}function G(ue){var he=new r;if(n(ue,function(Ae,De){switch(Ae){case"id":he.set(Ae,De);break;case"width":he.percent(Ae,De);break;case"lines":he.integer(Ae,De);break;case"regionanchor":case"viewportanchor":var Me=De.split(",");if(Me.length!==2)break;var Ne=new r;if(Ne.percent("x",Me[0]),Ne.percent("y",Me[1]),!Ne.has("x")||!Ne.has("y"))break;he.set(Ae+"X",Ne.get("x")),he.set(Ae+"Y",Ne.get("y"));break;case"scroll":he.alt(Ae,De,["up"]);break}},/=/,/\s/),he.has("id")){var ve=new(P.vttjs.VTTRegion||P.window.VTTRegion);ve.width=he.get("width",100),ve.lines=he.get("lines",3),ve.regionAnchorX=he.get("regionanchorX",0),ve.regionAnchorY=he.get("regionanchorY",100),ve.viewportAnchorX=he.get("viewportanchorX",0),ve.viewportAnchorY=he.get("viewportanchorY",100),ve.scroll=he.get("scroll",""),P.onregion&&P.onregion(ve),P.regionList.push({id:he.get("id"),region:ve})}}function K(ue){var he=new r;n(ue,function(ve,Ae){switch(ve){case"MPEGT":he.integer(ve+"S",Ae);break;case"LOCA":he.set(ve+"L",i(Ae));break}},/[^\d]:/,/,/),P.ontimestampmap&&P.ontimestampmap({MPEGTS:he.get("MPEGTS"),LOCAL:he.get("LOCAL")})}function ce(ue){ue.match(/X-TIMESTAMP-MAP/)?n(ue,function(he,ve){switch(he){case"X-TIMESTAMP-MAP":K(ve);break}},/=/):n(ue,function(he,ve){switch(he){case"Region":G(ve);break}},/:/)}try{var de;if(P.state==="INITIAL"){if(!/\r\n|\n/.test(P.buffer))return this;de=Q();var pe=de.match(/^WEBVTT([ \t].*)?$/);if(!pe||!pe[0])throw new t(t.Errors.BadSignature);P.state="HEADER"}for(var ne=!1;P.buffer;){if(!/\r\n|\n/.test(P.buffer))return this;switch(ne?ne=!1:de=Q(),P.state){case"HEADER":/:/.test(de)?ce(de):de||(P.state="ID");continue;case"NOTE":de||(P.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(de)){P.state="NOTE";break}if(!de)continue;P.cue=new(P.vttjs.VTTCue||P.window.VTTCue)(0,0,"");try{P.cue.align="center"}catch{P.cue.align="middle"}if(P.state="CUE",de.indexOf("-->")===-1){P.cue.id=de;continue}case"CUE":try{a(de,P.cue,P.regionList)}catch(ue){P.reportOrThrowError(ue),P.cue=null,P.state="BADCUE";continue}P.state="CUETEXT";continue;case"CUETEXT":var se=de.indexOf("-->")!==-1;if(!de||se&&(ne=!0)){P.oncue&&P.oncue(P.cue),P.cue=null,P.state="ID";continue}P.cue.text&&(P.cue.text+=`
12
+ `),P.cue.text+=de.replace(/\u2028/g,`
13
+ `).replace(/u2029/g,`
14
+ `);continue;case"BADCUE":de||(P.state="ID");continue}}}catch(ue){P.reportOrThrowError(ue),P.state==="CUETEXT"&&P.cue&&P.oncue&&P.oncue(P.cue),P.cue=null,P.state=P.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var w=this;try{if(w.buffer+=w.decoder.decode(),(w.cue||w.state==="HEADER")&&(w.buffer+=`
15
+
16
+ `,w.parse()),w.state==="INITIAL")throw new t(t.Errors.BadSignature)}catch(P){w.reportOrThrowError(P)}return w.onflush&&w.onflush(),this}},Kd=B,Kd}var Xd,Iv;function xk(){if(Iv)return Xd;Iv=1;var s="auto",e={"":1,lr:1,rl:1},t={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function i(a){if(typeof a!="string")return!1;var o=e[a.toLowerCase()];return o?a.toLowerCase():!1}function r(a){if(typeof a!="string")return!1;var o=t[a.toLowerCase()];return o?a.toLowerCase():!1}function n(a,o,l){this.hasBeenReset=!1;var u="",c=!1,h=a,f=o,g=l,C=null,p="",b=!0,I="auto",L="start",F="auto",V="auto",B=100,O="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return u},set:function(M){u=""+M}},pauseOnExit:{enumerable:!0,get:function(){return c},set:function(M){c=!!M}},startTime:{enumerable:!0,get:function(){return h},set:function(M){if(typeof M!="number")throw new TypeError("Start time must be set to a number.");h=M,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return f},set:function(M){if(typeof M!="number")throw new TypeError("End time must be set to a number.");f=M,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return g},set:function(M){g=""+M,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return C},set:function(M){C=M,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return p},set:function(M){var U=i(M);if(U===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");p=U,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return b},set:function(M){b=!!M,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return I},set:function(M){if(typeof M!="number"&&M!==s)throw new SyntaxError("Line: an invalid number or illegal string was specified.");I=M,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return L},set:function(M){var U=r(M);U?(L=U,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return F},set:function(M){if(M<0||M>100)throw new Error("Position must be between 0 and 100.");F=M,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return V},set:function(M){var U=r(M);U?(V=U,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return B},set:function(M){if(M<0||M>100)throw new Error("Size must be between 0 and 100.");B=M,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return O},set:function(M){var U=r(M);if(!U)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");O=U,this.hasBeenReset=!0}}}),this.displayState=void 0}return n.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},Xd=n,Xd}var Qd,Pv;function Ak(){if(Pv)return Qd;Pv=1;var s={"":!0,up:!0};function e(r){if(typeof r!="string")return!1;var n=s[r.toLowerCase()];return n?r.toLowerCase():!1}function t(r){return typeof r=="number"&&r>=0&&r<=100}function i(){var r=100,n=3,a=0,o=100,l=0,u=100,c="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return r},set:function(h){if(!t(h))throw new Error("Width must be between 0 and 100.");r=h}},lines:{enumerable:!0,get:function(){return n},set:function(h){if(typeof h!="number")throw new TypeError("Lines must be set to a number.");n=h}},regionAnchorY:{enumerable:!0,get:function(){return o},set:function(h){if(!t(h))throw new Error("RegionAnchorX must be between 0 and 100.");o=h}},regionAnchorX:{enumerable:!0,get:function(){return a},set:function(h){if(!t(h))throw new Error("RegionAnchorY must be between 0 and 100.");a=h}},viewportAnchorY:{enumerable:!0,get:function(){return u},set:function(h){if(!t(h))throw new Error("ViewportAnchorY must be between 0 and 100.");u=h}},viewportAnchorX:{enumerable:!0,get:function(){return l},set:function(h){if(!t(h))throw new Error("ViewportAnchorX must be between 0 and 100.");l=h}},scroll:{enumerable:!0,get:function(){return c},set:function(h){var f=e(h);f===!1?console.warn("Scroll: an invalid or illegal string was specified."):c=f}}})}return Qd=i,Qd}var Dv;function Ik(){if(Dv)return Gd.exports;Dv=1;var s=bo(),e=Gd.exports={WebVTT:kk(),VTTCue:xk(),VTTRegion:Ak()};s.vttjs=e,s.WebVTT=e.WebVTT;var t=e.VTTCue,i=e.VTTRegion,r=s.VTTCue,n=s.VTTRegion;return e.shim=function(){s.VTTCue=t,s.VTTRegion=i},e.restore=function(){s.VTTCue=r,s.VTTRegion=n},s.VTTCue||e.shim(),Gd.exports}var Pk=Ik();const eo=Vi(Pk);var Nv="https://example.com",bh=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=D.location&&D.location.href||"");var i=/^\/\//.test(e),r=!D.location&&!/\/\//i.test(e);e=new D.URL(e,D.location||Nv);var n=new URL(t,e);return r?n.href.slice(Nv.length):i?n.href.slice(n.protocol.length):n.href},wm=(function(){function s(){this.listeners={}}var e=s.prototype;return e.on=function(i,r){this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push(r)},e.off=function(i,r){if(!this.listeners[i])return!1;var n=this.listeners[i].indexOf(r);return this.listeners[i]=this.listeners[i].slice(0),this.listeners[i].splice(n,1),n>-1},e.trigger=function(i){var r=this.listeners[i];if(r)if(arguments.length===2)for(var n=r.length,a=0;a<n;++a)r[a].call(this,arguments[1]);else for(var o=Array.prototype.slice.call(arguments,1),l=r.length,u=0;u<l;++u)r[u].apply(this,o)},e.dispose=function(){this.listeners={}},e.pipe=function(i){this.on("data",function(r){i.push(r)})},s})(),Dk=function(e){return D.atob?D.atob(e):Buffer.from(e,"base64").toString("binary")};function Hb(s){for(var e=Dk(s),t=new Uint8Array(e.length),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}/*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */let Nk=class extends wm{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(`
17
+ `);t>-1;t=this.buffer.indexOf(`
18
+ `))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}};const Lk=" ",Yd=function(s){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(s||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},Ok=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},Ti=function(s){const e={};if(!s)return e;const t=s.split(Ok());let i=t.length,r;for(;i--;)t[i]!==""&&(r=/([^=]*)=(.*)/.exec(t[i]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e},Lv=s=>{const e=s.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};let Mk=class extends wm{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((n,a)=>{const o=a(e);return o===e?n:n.concat([o])},[e]).forEach(n=>{for(let a=0;a<this.customParsers.length;a++)if(this.customParsers[a].call(this,n))return;if(n.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:n.slice(1)});return}if(n=n.replace("\r",""),t=/^#EXTM3U/.exec(n),t){this.trigger("data",{type:"tag",tagType:"m3u"});return}if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(n),t){i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),this.trigger("data",i);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(n),t){i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(n),t){i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(n),t){i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),this.trigger("data",i);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(n),t){i=mt(Yd(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",i);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(n),t){i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(n),t){if(i={type:"tag",tagType:"map"},t[1]){const a=Ti(t[1]);a.URI&&(i.uri=a.URI),a.BYTERANGE&&(i.byterange=Yd(a.BYTERANGE))}this.trigger("data",i);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(n),t){i={type:"tag",tagType:"stream-inf"},t[1]&&(i.attributes=Ti(t[1]),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=Lv(i.attributes.RESOLUTION)),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))),this.trigger("data",i);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(n),t){i={type:"tag",tagType:"media"},t[1]&&(i.attributes=Ti(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-ENDLIST/.exec(n),t){this.trigger("data",{type:"tag",tagType:"endlist"});return}if(t=/^#EXT-X-DISCONTINUITY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(n),t){i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(n),t){i={type:"tag",tagType:"key"},t[1]&&(i.attributes=Ti(t[1]),i.attributes.IV&&(i.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),this.trigger("data",i);return}if(t=/^#EXT-X-START:(.*)$/.exec(n),t){i={type:"tag",tagType:"start"},t[1]&&(i.attributes=Ti(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),this.trigger("data",i);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(n),t){i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(n),t){i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(n),t){i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-SKIP:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"skip"},i.attributes=Ti(t[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(Lk)),this.trigger("data",i);return}if(t=/^#EXT-X-PART:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"part"},i.attributes=Ti(t[1]),["DURATION"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=parseFloat(i.attributes[a]))}),["INDEPENDENT","GAP"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=/YES/.test(i.attributes[a]))}),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=Yd(i.attributes.BYTERANGE)),this.trigger("data",i);return}if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"server-control"},i.attributes=Ti(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=parseFloat(i.attributes[a]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=/YES/.test(i.attributes[a]))}),this.trigger("data",i);return}if(t=/^#EXT-X-PART-INF:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"part-inf"},i.attributes=Ti(t[1]),["PART-TARGET"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=parseFloat(i.attributes[a]))}),this.trigger("data",i);return}if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"preload-hint"},i.attributes=Ti(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(a){if(i.attributes.hasOwnProperty(a)){i.attributes[a]=parseInt(i.attributes[a],10);const o=a==="BYTERANGE-LENGTH"?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[o]=i.attributes[a],delete i.attributes[a]}}),this.trigger("data",i);return}if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"rendition-report"},i.attributes=Ti(t[1]),["LAST-MSN","LAST-PART"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=parseInt(i.attributes[a],10))}),this.trigger("data",i);return}if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"daterange"},i.attributes=Ti(t[1]),["ID","CLASS"].forEach(function(o){i.attributes.hasOwnProperty(o)&&(i.attributes[o]=String(i.attributes[o]))}),["START-DATE","END-DATE"].forEach(function(o){i.attributes.hasOwnProperty(o)&&(i.attributes[o]=new Date(i.attributes[o]))}),["DURATION","PLANNED-DURATION"].forEach(function(o){i.attributes.hasOwnProperty(o)&&(i.attributes[o]=parseFloat(i.attributes[o]))}),["END-ON-NEXT"].forEach(function(o){i.attributes.hasOwnProperty(o)&&(i.attributes[o]=/YES/i.test(i.attributes[o]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(o){i.attributes.hasOwnProperty(o)&&(i.attributes[o]=i.attributes[o].toString(16))});const a=/^X-([A-Z]+-)+[A-Z]+$/;for(const o in i.attributes){if(!a.test(o))continue;const l=/[0-9A-Fa-f]{6}/g.test(i.attributes[o]),u=/^\d+(\.\d+)?$/.test(i.attributes[o]);i.attributes[o]=l?i.attributes[o].toString(16):u?parseFloat(i.attributes[o]):String(i.attributes[o])}this.trigger("data",i);return}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(n),t){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"i-frames-only"});return}if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(n),t){i={type:"tag",tagType:"content-steering"},i.attributes=Ti(t[1]),this.trigger("data",i);return}if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(n),t){i={type:"tag",tagType:"i-frame-playlist"},i.attributes=Ti(t[1]),i.attributes.URI&&(i.uri=i.attributes.URI),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=Lv(i.attributes.RESOLUTION)),i.attributes["AVERAGE-BANDWIDTH"]&&(i.attributes["AVERAGE-BANDWIDTH"]=parseInt(i.attributes["AVERAGE-BANDWIDTH"],10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),this.trigger("data",i);return}if(t=/^#EXT-X-DEFINE:(.*)$/.exec(n),t){i={type:"tag",tagType:"define"},i.attributes=Ti(t[1]),this.trigger("data",i);return}this.trigger("data",{type:"tag",data:n.slice(4)})})}addParser({expression:e,customType:t,dataParser:i,segment:r}){typeof i!="function"&&(i=n=>n),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:i(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const i=r=>e.test(r)?t(r):r;this.tagMappers.push(i)}};const Rk=s=>s.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),qn=function(s){const e={};return Object.keys(s).forEach(function(t){e[Rk(t)]=s[t]}),e},Jd=function(s){const{serverControl:e,targetDuration:t,partTargetDuration:i}=s;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",o=t&&t*3,l=i&&i*2;t&&!e.hasOwnProperty(n)&&(e[n]=o,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&e[n]<o&&(this.trigger("warn",{message:`${r} clamping HOLD-BACK (${e[n]}) to targetDuration * 3 (${o})`}),e[n]=o),i&&!e.hasOwnProperty(a)&&(e[a]=i*3,this.trigger("info",{message:`${r} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[a]}).`})),i&&e[a]<l&&(this.trigger("warn",{message:`${r} clamping PART-HOLD-BACK (${e[a]}) to partTargetDuration * 2 (${l}).`}),e[a]=l)};let Bk=class extends wm{constructor(e={}){super(),this.lineStream=new Nk,this.parseStream=new Mk,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;const t=this,i=[];let r={},n,a,o=!1;const l=function(){},u={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},c="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let h=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let f=0,g=0;const C={};this.on("end",()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&n&&(r.map=n),!r.key&&a&&(r.key=a),!r.timeline&&typeof h=="number"&&(r.timeline=h),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(p){let b,I;if(t.manifest.definitions){for(const L in t.manifest.definitions)if(p.uri&&(p.uri=p.uri.replace(`{$${L}}`,t.manifest.definitions[L])),p.attributes)for(const F in p.attributes)typeof p.attributes[F]=="string"&&(p.attributes[F]=p.attributes[F].replace(`{$${L}}`,t.manifest.definitions[L]))}({tag(){({version(){p.version&&(this.manifest.version=p.version)},"allow-cache"(){this.manifest.allowCache=p.allowed,"allowed"in p||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const L={};"length"in p&&(r.byterange=L,L.length=p.length,"offset"in p||(p.offset=f)),"offset"in p&&(r.byterange=L,L.offset=p.offset),f=L.offset+L.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),p.title&&(r.title=p.title),p.duration>0&&(r.duration=p.duration),p.duration===0&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(!p.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(p.attributes.METHOD==="NONE"){a=null;return}if(!p.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(p.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:p.attributes};return}if(p.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:p.attributes.URI};return}if(p.attributes.KEYFORMAT===c){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(p.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(p.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),p.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(p.attributes.KEYID&&p.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:p.attributes.KEYFORMAT,keyId:p.attributes.KEYID.substring(2)},pssh:Hb(p.attributes.URI.split(",")[1])};return}p.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:p.attributes.METHOD||"AES-128",uri:p.attributes.URI},typeof p.attributes.IV<"u"&&(a.iv=p.attributes.IV)},"media-sequence"(){if(!isFinite(p.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+p.number});return}this.manifest.mediaSequence=p.number},"discontinuity-sequence"(){if(!isFinite(p.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+p.number});return}this.manifest.discontinuitySequence=p.number,h=p.number},"playlist-type"(){if(!/VOD|EVENT/.test(p.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+p.playlist});return}this.manifest.playlistType=p.playlistType},map(){n={},p.uri&&(n.uri=p.uri),p.byterange&&(n.byterange=p.byterange),a&&(n.key=a)},"stream-inf"(){if(this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||u,!p.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}r.attributes||(r.attributes={}),mt(r.attributes,p.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||u,!(p.attributes&&p.attributes.TYPE&&p.attributes["GROUP-ID"]&&p.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const L=this.manifest.mediaGroups[p.attributes.TYPE];L[p.attributes["GROUP-ID"]]=L[p.attributes["GROUP-ID"]]||{},b=L[p.attributes["GROUP-ID"]],I={default:/yes/i.test(p.attributes.DEFAULT)},I.default?I.autoselect=!0:I.autoselect=/yes/i.test(p.attributes.AUTOSELECT),p.attributes.LANGUAGE&&(I.language=p.attributes.LANGUAGE),p.attributes.URI&&(I.uri=p.attributes.URI),p.attributes["INSTREAM-ID"]&&(I.instreamId=p.attributes["INSTREAM-ID"]),p.attributes.CHARACTERISTICS&&(I.characteristics=p.attributes.CHARACTERISTICS),p.attributes.FORCED&&(I.forced=/yes/i.test(p.attributes.FORCED)),b[p.attributes.NAME]=I},discontinuity(){h+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=p.dateTimeString,this.manifest.dateTimeObject=p.dateTimeObject),r.dateTimeString=p.dateTimeString,r.dateTimeObject=p.dateTimeObject;const{lastProgramDateTime:L}=this;this.lastProgramDateTime=new Date(p.dateTimeString).getTime(),L===null&&this.manifest.segments.reduceRight((F,V)=>(V.programDateTime=F-V.duration*1e3,V.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(p.duration)||p.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+p.duration});return}this.manifest.targetDuration=p.duration,Jd.call(this,this.manifest)},start(){if(!p.attributes||isNaN(p.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:p.attributes["TIME-OFFSET"],precise:p.attributes.PRECISE}},"cue-out"(){r.cueOut=p.data},"cue-out-cont"(){r.cueOutCont=p.data},"cue-in"(){r.cueIn=p.data},skip(){this.manifest.skip=qn(p.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",p.attributes,["SKIPPED-SEGMENTS"])},part(){o=!0;const L=this.manifest.segments.length,F=qn(p.attributes);r.parts=r.parts||[],r.parts.push(F),F.byterange&&(F.byterange.hasOwnProperty("offset")||(F.byterange.offset=g),g=F.byterange.offset+F.byterange.length);const V=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${V} for segment #${L}`,p.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((B,O)=>{B.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${O} lacks required attribute(s): LAST-PART`})})},"server-control"(){const L=this.manifest.serverControl=qn(p.attributes);L.hasOwnProperty("canBlockReload")||(L.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Jd.call(this,this.manifest),L.canSkipDateranges&&!L.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const L=this.manifest.segments.length,F=qn(p.attributes),V=F.type&&F.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(F),F.byterange&&(F.byterange.hasOwnProperty("offset")||(F.byterange.offset=V?g:0,V&&(g=F.byterange.offset+F.byterange.length)));const B=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${B} for segment #${L}`,p.attributes,["TYPE","URI"]),!!F.type)for(let O=0;O<r.preloadHints.length-1;O++){const M=r.preloadHints[O];M.type&&M.type===F.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${B} for segment #${L} has the same TYPE ${F.type} as preload hint #${O}`})}},"rendition-report"(){const L=qn(p.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(L);const F=this.manifest.renditionReports.length-1,V=["LAST-MSN","URI"];o&&V.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${F}`,p.attributes,V)},"part-inf"(){this.manifest.partInf=qn(p.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",p.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),Jd.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(qn(p.attributes));const L=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${L}`,p.attributes,["ID","START-DATE"]);const F=this.manifest.dateRanges[L];F.endDate&&F.startDate&&new Date(F.endDate)<new Date(F.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),F.duration&&F.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),F.plannedDuration&&F.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const V=!!F.endOnNext;if(V&&!F.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),V&&(F.duration||F.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),F.duration&&F.endDate){const O=F.startDate.getTime()+F.duration*1e3;this.manifest.dateRanges[L].endDate=new Date(O)}if(!C[F.id])C[F.id]=F;else{for(const O in C[F.id])if(F[O]&&JSON.stringify(C[F.id][O])!==JSON.stringify(F[O])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const B=this.manifest.dateRanges.findIndex(O=>O.id===F.id);this.manifest.dateRanges[B]=mt(this.manifest.dateRanges[B],F),C[F.id]=mt(C[F.id],F),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=qn(p.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",p.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const L=(F,V)=>{if(F in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${F}`});return}this.manifest.definitions[F]=V};if("QUERYPARAM"in p.attributes){if("NAME"in p.attributes||"IMPORT"in p.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const F=this.params.get(p.attributes.QUERYPARAM);if(!F){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${p.attributes.QUERYPARAM}`});return}L(p.attributes.QUERYPARAM,decodeURIComponent(F));return}if("NAME"in p.attributes){if("IMPORT"in p.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in p.attributes)||typeof p.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${p.attributes.NAME}`});return}L(p.attributes.NAME,p.attributes.VALUE);return}if("IMPORT"in p.attributes){if(!this.mainDefinitions[p.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${p.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}L(p.attributes.IMPORT,this.mainDefinitions[p.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:p.attributes,uri:p.uri,timeline:h}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",p.attributes,["BANDWIDTH","URI"])}}[p.tagType]||l).call(t)},uri(){r.uri=p.uri,i.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),a&&(r.key=a),r.timeline=h,n&&(r.map=n),g=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){p.segment?(r.custom=r.custom||{},r.custom[p.customType]=p.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[p.customType]=p.data)}})[p.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,i){const r=[];i.forEach(function(n){t.hasOwnProperty(n)||r.push(n)}),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(`
19
+ `),this.manifest.dateRanges.length&&this.lastProgramDateTime===null&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}};var $s={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^/},Fk=["video","audio","text"],Ov=["Video","Audio","Text"],qb=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,i,r){var n=("00"+Number(i).toString(16)).slice(-2),a=("00"+Number(r).toString(16)).slice(-2);return"avc1."+n+"00"+a})},Fr=function(e){e===void 0&&(e="");var t=e.split(","),i=[];return t.forEach(function(r){r=r.trim();var n;Fk.forEach(function(a){var o=$s[a].exec(r.toLowerCase());if(!(!o||o.length<=1)){n=a;var l=r.substring(0,o[1].length),u=r.replace(l,"");i.push({type:l,details:u,mediaType:a})}}),n||i.push({type:r,details:"",mediaType:"unknown"})}),i},Uk=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var r in i){var n=i[r];if(n.default&&n.playlists)return Fr(n.playlists[0].attributes.CODECS)}return null},zb=function(e){return e===void 0&&(e=""),$s.audio.test(e.trim().toLowerCase())},$k=function(e){return e===void 0&&(e=""),$s.text.test(e.trim().toLowerCase())},to=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return qb(n.trim())}),i="video";t.length===1&&zb(t[0])?i="audio":t.length===1&&$k(t[0])&&(i="application");var r="mp4";return t.every(function(n){return $s.mp4.test(n)})?r="mp4":t.every(function(n){return $s.webm.test(n)})?r="webm":t.every(function(n){return $s.ogg.test(n)})&&(r="ogg"),i+"/"+r+';codecs="'+e+'"'}},bl=function(e,t){return e===void 0&&(e=""),t===void 0&&(t=!1),D.MediaSource&&D.MediaSource.isTypeSupported&&D.MediaSource.isTypeSupported(to(e))||t&&D.ManagedMediaSource&&D.ManagedMediaSource.isTypeSupported&&D.ManagedMediaSource.isTypeSupported(to(e))||!1},Zd=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var i=0;i<Ov.length;i++){var r=Ov[i];if($s["muxer"+r].test(t))return!0}return!1})},Mv="mp4a.40.2",jk="avc1.4d400d",Vk=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,Hk=/^application\/dash\+xml/i,Wb=function(e){return Vk.test(e)?"hls":Hk.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},qk=function(e){return e.toString(2).length},zk=function(e){return Math.ceil(qk(e)/8)},Gb=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},Wk=function(e){return Gb(e)},$e=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!Wk(e)&&!(e instanceof ArrayBuffer)&&(typeof e!="number"||typeof e=="number"&&e!==e?e=0:e=[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},oi=D.BigInt||Number,fp=[oi("0x1"),oi("0x100"),oi("0x10000"),oi("0x1000000"),oi("0x100000000"),oi("0x10000000000"),oi("0x1000000000000"),oi("0x100000000000000"),oi("0x10000000000000000")];(function(){var s=new Uint16Array([65484]),e=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var Gk=function(e,t){var i=t===void 0?{}:t,r=i.signed,n=r===void 0?!1:r,a=i.le,o=a===void 0?!1:a;e=$e(e);var l=o?"reduce":"reduceRight",u=e[l]?e[l]:Array.prototype[l],c=u.call(e,function(f,g,C){var p=o?C:Math.abs(C+1-e.length);return f+oi(g)*fp[p]},oi(0));if(n){var h=fp[e.length]/oi(2)-oi(1);c=oi(c),c>h&&(c-=h,c-=h,c-=oi(2))}return Number(c)},Kk=function(e,t){var i={},r=i.le,n=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=oi(e);for(var a=zk(e),o=new Uint8Array(new ArrayBuffer(a)),l=0;l<a;l++){var u=n?l:Math.abs(l+1-o.length);o[u]=Number(e/fp[l]&oi(255)),e<0&&(o[u]=Math.abs(~o[u]),o[u]-=l===0?1:2)}return o},Kb=function(e,t){if(typeof e!="string"&&e&&typeof e.toString=="function"&&(e=e.toString()),typeof e!="string")return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),r=0;r<e.length;r++)i[r]=e.charCodeAt(r);return i},Xk=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(t=t.filter(function(o){return o&&(o.byteLength||o.length)&&typeof o!="string"}),t.length<=1)return $e(t[0]);var r=t.reduce(function(o,l,u){return o+(l.byteLength||l.length)},0),n=new Uint8Array(r),a=0;return t.forEach(function(o){o=$e(o),n.set(o,a),a+=o.byteLength}),n},At=function(e,t,i){var r=i===void 0?{}:i,n=r.offset,a=n===void 0?0:n,o=r.mask,l=o===void 0?[]:o;e=$e(e),t=$e(t);var u=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&u.call(t,function(c,h){var f=l[h]?l[h]&e[a+h]:e[a+h];return c===f})},Qk=function(e,t,i){t.forEach(function(r){for(var n in e.mediaGroups[r])for(var a in e.mediaGroups[r][n]){var o=e.mediaGroups[r][n][a];i(o,r,n,a)}})},Zo={},dn={},Es={},Rv;function Sh(){if(Rv)return Es;Rv=1;function s(n,a,o){if(o===void 0&&(o=Array.prototype),n&&typeof o.find=="function")return o.find.call(n,a);for(var l=0;l<n.length;l++)if(Object.prototype.hasOwnProperty.call(n,l)){var u=n[l];if(a.call(void 0,u,l,n))return u}}function e(n,a){return a===void 0&&(a=Object),a&&typeof a.freeze=="function"?a.freeze(n):n}function t(n,a){if(n===null||typeof n!="object")throw new TypeError("target is not an object");for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o]);return n}var i=e({HTML:"text/html",isHTML:function(n){return n===i.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),r=e({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(n){return n===r.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});return Es.assign=t,Es.find=s,Es.freeze=e,Es.MIME_TYPE=i,Es.NAMESPACE=r,Es}var Bv;function Xb(){if(Bv)return dn;Bv=1;var s=Sh(),e=s.find,t=s.NAMESPACE;function i(j){return j!==""}function r(j){return j?j.split(/[\t\n\f\r ]+/).filter(i):[]}function n(j,H){return j.hasOwnProperty(H)||(j[H]=!0),j}function a(j){if(!j)return[];var H=r(j);return Object.keys(H.reduce(n,{}))}function o(j){return function(H){return j&&j.indexOf(H)!==-1}}function l(j,H){for(var ee in j)Object.prototype.hasOwnProperty.call(j,ee)&&(H[ee]=j[ee])}function u(j,H){var ee=j.prototype;if(!(ee instanceof H)){let fe=function(){};fe.prototype=H.prototype,fe=new fe,l(ee,fe),j.prototype=ee=fe}ee.constructor!=j&&(typeof j!="function"&&console.error("unknown Class:"+j),ee.constructor=j)}var c={},h=c.ELEMENT_NODE=1,f=c.ATTRIBUTE_NODE=2,g=c.TEXT_NODE=3,C=c.CDATA_SECTION_NODE=4,p=c.ENTITY_REFERENCE_NODE=5,b=c.ENTITY_NODE=6,I=c.PROCESSING_INSTRUCTION_NODE=7,L=c.COMMENT_NODE=8,F=c.DOCUMENT_NODE=9,V=c.DOCUMENT_TYPE_NODE=10,B=c.DOCUMENT_FRAGMENT_NODE=11,O=c.NOTATION_NODE=12,M={},U={};M.INDEX_SIZE_ERR=(U[1]="Index size error",1),M.DOMSTRING_SIZE_ERR=(U[2]="DOMString size error",2);var w=M.HIERARCHY_REQUEST_ERR=(U[3]="Hierarchy request error",3);M.WRONG_DOCUMENT_ERR=(U[4]="Wrong document",4),M.INVALID_CHARACTER_ERR=(U[5]="Invalid character",5),M.NO_DATA_ALLOWED_ERR=(U[6]="No data allowed",6),M.NO_MODIFICATION_ALLOWED_ERR=(U[7]="No modification allowed",7);var P=M.NOT_FOUND_ERR=(U[8]="Not found",8);M.NOT_SUPPORTED_ERR=(U[9]="Not supported",9);var Q=M.INUSE_ATTRIBUTE_ERR=(U[10]="Attribute in use",10);M.INVALID_STATE_ERR=(U[11]="Invalid state",11),M.SYNTAX_ERR=(U[12]="Syntax error",12),M.INVALID_MODIFICATION_ERR=(U[13]="Invalid modification",13),M.NAMESPACE_ERR=(U[14]="Invalid namespace",14),M.INVALID_ACCESS_ERR=(U[15]="Invalid access",15);function G(j,H){if(H instanceof Error)var ee=H;else ee=this,Error.call(this,U[j]),this.message=U[j],Error.captureStackTrace&&Error.captureStackTrace(this,G);return ee.code=j,H&&(this.message=this.message+": "+H),ee}G.prototype=Error.prototype,l(M,G);function K(){}K.prototype={length:0,item:function(j){return j>=0&&j<this.length?this[j]:null},toString:function(j,H){for(var ee=[],fe=0;fe<this.length;fe++)Nr(this[fe],ee,j,H);return ee.join("")},filter:function(j){return Array.prototype.filter.call(this,j)},indexOf:function(j){return Array.prototype.indexOf.call(this,j)}};function ce(j,H){this._node=j,this._refresh=H,de(this)}function de(j){var H=j._node._inc||j._node.ownerDocument._inc;if(j._inc!==H){var ee=j._refresh(j._node);if(na(j,"length",ee.length),!j.$$length||ee.length<j.$$length)for(var fe=ee.length;fe in j;fe++)Object.prototype.hasOwnProperty.call(j,fe)&&delete j[fe];l(ee,j),j._inc=H}}ce.prototype.item=function(j){return de(this),this[j]||null},u(ce,K);function pe(){}function ne(j,H){for(var ee=j.length;ee--;)if(j[ee]===H)return ee}function se(j,H,ee,fe){if(fe?H[ne(H,fe)]=ee:H[H.length++]=ee,j){ee.ownerElement=j;var Ce=j.ownerDocument;Ce&&(fe&&Je(Ce,j,fe),Ne(Ce,j,ee))}}function ue(j,H,ee){var fe=ne(H,ee);if(fe>=0){for(var Ce=H.length-1;fe<Ce;)H[fe]=H[++fe];if(H.length=Ce,j){var Ve=j.ownerDocument;Ve&&(Je(Ve,j,ee),ee.ownerElement=null)}}else throw new G(P,new Error(j.tagName+"@"+ee))}pe.prototype={length:0,item:K.prototype.item,getNamedItem:function(j){for(var H=this.length;H--;){var ee=this[H];if(ee.nodeName==j)return ee}},setNamedItem:function(j){var H=j.ownerElement;if(H&&H!=this._ownerElement)throw new G(Q);var ee=this.getNamedItem(j.nodeName);return se(this._ownerElement,this,j,ee),ee},setNamedItemNS:function(j){var H=j.ownerElement,ee;if(H&&H!=this._ownerElement)throw new G(Q);return ee=this.getNamedItemNS(j.namespaceURI,j.localName),se(this._ownerElement,this,j,ee),ee},removeNamedItem:function(j){var H=this.getNamedItem(j);return ue(this._ownerElement,this,H),H},removeNamedItemNS:function(j,H){var ee=this.getNamedItemNS(j,H);return ue(this._ownerElement,this,ee),ee},getNamedItemNS:function(j,H){for(var ee=this.length;ee--;){var fe=this[ee];if(fe.localName==H&&fe.namespaceURI==j)return fe}return null}};function he(){}he.prototype={hasFeature:function(j,H){return!0},createDocument:function(j,H,ee){var fe=new Me;if(fe.implementation=this,fe.childNodes=new K,fe.doctype=ee||null,ee&&fe.appendChild(ee),H){var Ce=fe.createElementNS(j,H);fe.appendChild(Ce)}return fe},createDocumentType:function(j,H,ee){var fe=new vr;return fe.name=j,fe.nodeName=j,fe.publicId=H||"",fe.systemId=ee||"",fe}};function ve(){}ve.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(j,H){return Be(this,j,H)},replaceChild:function(j,H){Be(this,j,H,Fe),H&&this.removeChild(H)},removeChild:function(j){return Oe(this,j)},appendChild:function(j){return this.insertBefore(j,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(j){return as(this.ownerDocument||this,this,j)},normalize:function(){for(var j=this.firstChild;j;){var H=j.nextSibling;H&&H.nodeType==g&&j.nodeType==g?(this.removeChild(H),j.appendData(H.data)):(j.normalize(),j=H)}},isSupported:function(j,H){return this.ownerDocument.implementation.hasFeature(j,H)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(j){for(var H=this;H;){var ee=H._nsMap;if(ee){for(var fe in ee)if(Object.prototype.hasOwnProperty.call(ee,fe)&&ee[fe]===j)return fe}H=H.nodeType==f?H.ownerDocument:H.parentNode}return null},lookupNamespaceURI:function(j){for(var H=this;H;){var ee=H._nsMap;if(ee&&Object.prototype.hasOwnProperty.call(ee,j))return ee[j];H=H.nodeType==f?H.ownerDocument:H.parentNode}return null},isDefaultNamespace:function(j){var H=this.lookupPrefix(j);return H==null}};function Ae(j){return j=="<"&&"&lt;"||j==">"&&"&gt;"||j=="&"&&"&amp;"||j=='"'&&"&quot;"||"&#"+j.charCodeAt()+";"}l(c,ve),l(c,ve.prototype);function De(j,H){if(H(j))return!0;if(j=j.firstChild)do if(De(j,H))return!0;while(j=j.nextSibling)}function Me(){this.ownerDocument=this}function Ne(j,H,ee){j&&j._inc++;var fe=ee.namespaceURI;fe===t.XMLNS&&(H._nsMap[ee.prefix?ee.localName:""]=ee.value)}function Je(j,H,ee,fe){j&&j._inc++;var Ce=ee.namespaceURI;Ce===t.XMLNS&&delete H._nsMap[ee.prefix?ee.localName:""]}function Re(j,H,ee){if(j&&j._inc){j._inc++;var fe=H.childNodes;if(ee)fe[fe.length++]=ee;else{for(var Ce=H.firstChild,Ve=0;Ce;)fe[Ve++]=Ce,Ce=Ce.nextSibling;fe.length=Ve,delete fe[fe.length]}}}function Oe(j,H){var ee=H.previousSibling,fe=H.nextSibling;return ee?ee.nextSibling=fe:j.firstChild=fe,fe?fe.previousSibling=ee:j.lastChild=ee,H.parentNode=null,H.previousSibling=null,H.nextSibling=null,Re(j.ownerDocument,j),H}function He(j){return j&&(j.nodeType===ve.DOCUMENT_NODE||j.nodeType===ve.DOCUMENT_FRAGMENT_NODE||j.nodeType===ve.ELEMENT_NODE)}function st(j){return j&&(Nt(j)||Ni(j)||Ct(j)||j.nodeType===ve.DOCUMENT_FRAGMENT_NODE||j.nodeType===ve.COMMENT_NODE||j.nodeType===ve.PROCESSING_INSTRUCTION_NODE)}function Ct(j){return j&&j.nodeType===ve.DOCUMENT_TYPE_NODE}function Nt(j){return j&&j.nodeType===ve.ELEMENT_NODE}function Ni(j){return j&&j.nodeType===ve.TEXT_NODE}function Bt(j,H){var ee=j.childNodes||[];if(e(ee,Nt)||Ct(H))return!1;var fe=e(ee,Ct);return!(H&&fe&&ee.indexOf(fe)>ee.indexOf(H))}function Hi(j,H){var ee=j.childNodes||[];function fe(Ve){return Nt(Ve)&&Ve!==H}if(e(ee,fe))return!1;var Ce=e(ee,Ct);return!(H&&Ce&&ee.indexOf(Ce)>ee.indexOf(H))}function Te(j,H,ee){if(!He(j))throw new G(w,"Unexpected parent node type "+j.nodeType);if(ee&&ee.parentNode!==j)throw new G(P,"child not in parent");if(!st(H)||Ct(H)&&j.nodeType!==ve.DOCUMENT_NODE)throw new G(w,"Unexpected node type "+H.nodeType+" for parent node type "+j.nodeType)}function ke(j,H,ee){var fe=j.childNodes||[],Ce=H.childNodes||[];if(H.nodeType===ve.DOCUMENT_FRAGMENT_NODE){var Ve=Ce.filter(Nt);if(Ve.length>1||e(Ce,Ni))throw new G(w,"More than one element or text in fragment");if(Ve.length===1&&!Bt(j,ee))throw new G(w,"Element in fragment can not be inserted before doctype")}if(Nt(H)&&!Bt(j,ee))throw new G(w,"Only one element can be added and only after doctype");if(Ct(H)){if(e(fe,Ct))throw new G(w,"Only one doctype is allowed");var ct=e(fe,Nt);if(ee&&fe.indexOf(ct)<fe.indexOf(ee))throw new G(w,"Doctype can only be inserted before an element");if(!ee&&ct)throw new G(w,"Doctype can not be appended since element is present")}}function Fe(j,H,ee){var fe=j.childNodes||[],Ce=H.childNodes||[];if(H.nodeType===ve.DOCUMENT_FRAGMENT_NODE){var Ve=Ce.filter(Nt);if(Ve.length>1||e(Ce,Ni))throw new G(w,"More than one element or text in fragment");if(Ve.length===1&&!Hi(j,ee))throw new G(w,"Element in fragment can not be inserted before doctype")}if(Nt(H)&&!Hi(j,ee))throw new G(w,"Only one element can be added and only after doctype");if(Ct(H)){if(e(fe,function(gt){return Ct(gt)&&gt!==ee}))throw new G(w,"Only one doctype is allowed");var ct=e(fe,Nt);if(ee&&fe.indexOf(ct)<fe.indexOf(ee))throw new G(w,"Doctype can only be inserted before an element")}}function Be(j,H,ee,fe){Te(j,H,ee),j.nodeType===ve.DOCUMENT_NODE&&(fe||ke)(j,H,ee);var Ce=H.parentNode;if(Ce&&Ce.removeChild(H),H.nodeType===B){var Ve=H.firstChild;if(Ve==null)return H;var ct=H.lastChild}else Ve=ct=H;var Ft=ee?ee.previousSibling:j.lastChild;Ve.previousSibling=Ft,ct.nextSibling=ee,Ft?Ft.nextSibling=Ve:j.firstChild=Ve,ee==null?j.lastChild=ct:ee.previousSibling=ct;do{Ve.parentNode=j;var gt=j.ownerDocument||j;Ke(Ve,gt)}while(Ve!==ct&&(Ve=Ve.nextSibling));return Re(j.ownerDocument||j,j),H.nodeType==B&&(H.firstChild=H.lastChild=null),H}function Ke(j,H){if(j.ownerDocument!==H){if(j.ownerDocument=H,j.nodeType===h&&j.attributes)for(var ee=0;ee<j.attributes.length;ee++){var fe=j.attributes.item(ee);fe&&(fe.ownerDocument=H)}for(var Ce=j.firstChild;Ce;)Ke(Ce,H),Ce=Ce.nextSibling}}function rt(j,H){H.parentNode&&H.parentNode.removeChild(H),H.parentNode=j,H.previousSibling=j.lastChild,H.nextSibling=null,H.previousSibling?H.previousSibling.nextSibling=H:j.firstChild=H,j.lastChild=H,Re(j.ownerDocument,j,H);var ee=j.ownerDocument||j;return Ke(H,ee),H}Me.prototype={nodeName:"#document",nodeType:F,doctype:null,documentElement:null,_inc:1,insertBefore:function(j,H){if(j.nodeType==B){for(var ee=j.firstChild;ee;){var fe=ee.nextSibling;this.insertBefore(ee,H),ee=fe}return j}return Be(this,j,H),Ke(j,this),this.documentElement===null&&j.nodeType===h&&(this.documentElement=j),j},removeChild:function(j){return this.documentElement==j&&(this.documentElement=null),Oe(this,j)},replaceChild:function(j,H){Be(this,j,H,Fe),Ke(j,this),H&&this.removeChild(H),Nt(j)&&(this.documentElement=j)},importNode:function(j,H){return ra(this,j,H)},getElementById:function(j){var H=null;return De(this.documentElement,function(ee){if(ee.nodeType==h&&ee.getAttribute("id")==j)return H=ee,!0}),H},getElementsByClassName:function(j){var H=a(j);return new ce(this,function(ee){var fe=[];return H.length>0&&De(ee.documentElement,function(Ce){if(Ce!==ee&&Ce.nodeType===h){var Ve=Ce.getAttribute("class");if(Ve){var ct=j===Ve;if(!ct){var Ft=a(Ve);ct=H.every(o(Ft))}ct&&fe.push(Ce)}}}),fe})},createElement:function(j){var H=new ut;H.ownerDocument=this,H.nodeName=j,H.tagName=j,H.localName=j,H.childNodes=new K;var ee=H.attributes=new pe;return ee._ownerElement=H,H},createDocumentFragment:function(){var j=new nt;return j.ownerDocument=this,j.childNodes=new K,j},createTextNode:function(j){var H=new gr;return H.ownerDocument=this,H.appendData(j),H},createComment:function(j){var H=new nr;return H.ownerDocument=this,H.appendData(j),H},createCDATASection:function(j){var H=new sr;return H.ownerDocument=this,H.appendData(j),H},createProcessingInstruction:function(j,H){var ee=new ss;return ee.ownerDocument=this,ee.tagName=ee.nodeName=ee.target=j,ee.nodeValue=ee.data=H,ee},createAttribute:function(j){var H=new rr;return H.ownerDocument=this,H.name=j,H.nodeName=j,H.localName=j,H.specified=!0,H},createEntityReference:function(j){var H=new tt;return H.ownerDocument=this,H.nodeName=j,H},createElementNS:function(j,H){var ee=new ut,fe=H.split(":"),Ce=ee.attributes=new pe;return ee.childNodes=new K,ee.ownerDocument=this,ee.nodeName=H,ee.tagName=H,ee.namespaceURI=j,fe.length==2?(ee.prefix=fe[0],ee.localName=fe[1]):ee.localName=H,Ce._ownerElement=ee,ee},createAttributeNS:function(j,H){var ee=new rr,fe=H.split(":");return ee.ownerDocument=this,ee.nodeName=H,ee.name=H,ee.namespaceURI=j,ee.specified=!0,fe.length==2?(ee.prefix=fe[0],ee.localName=fe[1]):ee.localName=H,ee}},u(Me,ve);function ut(){this._nsMap={}}ut.prototype={nodeType:h,hasAttribute:function(j){return this.getAttributeNode(j)!=null},getAttribute:function(j){var H=this.getAttributeNode(j);return H&&H.value||""},getAttributeNode:function(j){return this.attributes.getNamedItem(j)},setAttribute:function(j,H){var ee=this.ownerDocument.createAttribute(j);ee.value=ee.nodeValue=""+H,this.setAttributeNode(ee)},removeAttribute:function(j){var H=this.getAttributeNode(j);H&&this.removeAttributeNode(H)},appendChild:function(j){return j.nodeType===B?this.insertBefore(j,null):rt(this,j)},setAttributeNode:function(j){return this.attributes.setNamedItem(j)},setAttributeNodeNS:function(j){return this.attributes.setNamedItemNS(j)},removeAttributeNode:function(j){return this.attributes.removeNamedItem(j.nodeName)},removeAttributeNS:function(j,H){var ee=this.getAttributeNodeNS(j,H);ee&&this.removeAttributeNode(ee)},hasAttributeNS:function(j,H){return this.getAttributeNodeNS(j,H)!=null},getAttributeNS:function(j,H){var ee=this.getAttributeNodeNS(j,H);return ee&&ee.value||""},setAttributeNS:function(j,H,ee){var fe=this.ownerDocument.createAttributeNS(j,H);fe.value=fe.nodeValue=""+ee,this.setAttributeNode(fe)},getAttributeNodeNS:function(j,H){return this.attributes.getNamedItemNS(j,H)},getElementsByTagName:function(j){return new ce(this,function(H){var ee=[];return De(H,function(fe){fe!==H&&fe.nodeType==h&&(j==="*"||fe.tagName==j)&&ee.push(fe)}),ee})},getElementsByTagNameNS:function(j,H){return new ce(this,function(ee){var fe=[];return De(ee,function(Ce){Ce!==ee&&Ce.nodeType===h&&(j==="*"||Ce.namespaceURI===j)&&(H==="*"||Ce.localName==H)&&fe.push(Ce)}),fe})}},Me.prototype.getElementsByTagName=ut.prototype.getElementsByTagName,Me.prototype.getElementsByTagNameNS=ut.prototype.getElementsByTagNameNS,u(ut,ve);function rr(){}rr.prototype.nodeType=f,u(rr,ve);function qi(){}qi.prototype={data:"",substringData:function(j,H){return this.data.substring(j,j+H)},appendData:function(j){j=this.data+j,this.nodeValue=this.data=j,this.length=j.length},insertData:function(j,H){this.replaceData(j,0,H)},appendChild:function(j){throw new Error(U[w])},deleteData:function(j,H){this.replaceData(j,H,"")},replaceData:function(j,H,ee){var fe=this.data.substring(0,j),Ce=this.data.substring(j+H);ee=fe+ee+Ce,this.nodeValue=this.data=ee,this.length=ee.length}},u(qi,ve);function gr(){}gr.prototype={nodeName:"#text",nodeType:g,splitText:function(j){var H=this.data,ee=H.substring(j);H=H.substring(0,j),this.data=this.nodeValue=H,this.length=H.length;var fe=this.ownerDocument.createTextNode(ee);return this.parentNode&&this.parentNode.insertBefore(fe,this.nextSibling),fe}},u(gr,qi);function nr(){}nr.prototype={nodeName:"#comment",nodeType:L},u(nr,qi);function sr(){}sr.prototype={nodeName:"#cdata-section",nodeType:C},u(sr,qi);function vr(){}vr.prototype.nodeType=V,u(vr,ve);function An(){}An.prototype.nodeType=O,u(An,ve);function In(){}In.prototype.nodeType=b,u(In,ve);function tt(){}tt.prototype.nodeType=p,u(tt,ve);function nt(){}nt.prototype.nodeName="#document-fragment",nt.prototype.nodeType=B,u(nt,ve);function ss(){}ss.prototype.nodeType=I,u(ss,ve);function tn(){}tn.prototype.serializeToString=function(j,H,ee){return ta.call(j,H,ee)},ve.prototype.toString=ta;function ta(j,H){var ee=[],fe=this.nodeType==9&&this.documentElement||this,Ce=fe.prefix,Ve=fe.namespaceURI;if(Ve&&Ce==null){var Ce=fe.lookupPrefix(Ve);if(Ce==null)var ct=[{namespace:Ve,prefix:null}]}return Nr(this,ee,j,H,ct),ee.join("")}function ia(j,H,ee){var fe=j.prefix||"",Ce=j.namespaceURI;if(!Ce||fe==="xml"&&Ce===t.XML||Ce===t.XMLNS)return!1;for(var Ve=ee.length;Ve--;){var ct=ee[Ve];if(ct.prefix===fe)return ct.namespace!==Ce}return!0}function Dr(j,H,ee){j.push(" ",H,'="',ee.replace(/[<>&"\t\n\r]/g,Ae),'"')}function Nr(j,H,ee,fe,Ce){if(Ce||(Ce=[]),fe)if(j=fe(j),j){if(typeof j=="string"){H.push(j);return}}else return;switch(j.nodeType){case h:var Ve=j.attributes,ct=Ve.length,at=j.firstChild,Ft=j.tagName;ee=t.isHTML(j.namespaceURI)||ee;var gt=Ft;if(!ee&&!j.prefix&&j.namespaceURI){for(var ar,Li=0;Li<Ve.length;Li++)if(Ve.item(Li).name==="xmlns"){ar=Ve.item(Li).value;break}if(!ar)for(var hi=Ce.length-1;hi>=0;hi--){var Ut=Ce[hi];if(Ut.prefix===""&&Ut.namespace===j.namespaceURI){ar=Ut.namespace;break}}if(ar!==j.namespaceURI)for(var hi=Ce.length-1;hi>=0;hi--){var Ut=Ce[hi];if(Ut.namespace===j.namespaceURI){Ut.prefix&&(gt=Ut.prefix+":"+Ft);break}}}H.push("<",gt);for(var vt=0;vt<ct;vt++){var Ze=Ve.item(vt);Ze.prefix=="xmlns"?Ce.push({prefix:Ze.localName,namespace:Ze.value}):Ze.nodeName=="xmlns"&&Ce.push({prefix:"",namespace:Ze.value})}for(var vt=0;vt<ct;vt++){var Ze=Ve.item(vt);if(ia(Ze,ee,Ce)){var yr=Ze.prefix||"",yi=Ze.namespaceURI;Dr(H,yr?"xmlns:"+yr:"xmlns",yi),Ce.push({prefix:yr,namespace:yi})}Nr(Ze,H,ee,fe,Ce)}if(Ft===gt&&ia(j,ee,Ce)){var yr=j.prefix||"",yi=j.namespaceURI;Dr(H,yr?"xmlns:"+yr:"xmlns",yi),Ce.push({prefix:yr,namespace:yi})}if(at||ee&&!/^(?:meta|link|img|br|hr|input)$/i.test(Ft)){if(H.push(">"),ee&&/^script$/i.test(Ft))for(;at;)at.data?H.push(at.data):Nr(at,H,ee,fe,Ce.slice()),at=at.nextSibling;else for(;at;)Nr(at,H,ee,fe,Ce.slice()),at=at.nextSibling;H.push("</",gt,">")}else H.push("/>");return;case F:case B:for(var at=j.firstChild;at;)Nr(at,H,ee,fe,Ce.slice()),at=at.nextSibling;return;case f:return Dr(H,j.name,j.value);case g:return H.push(j.data.replace(/[<&>]/g,Ae));case C:return H.push("<![CDATA[",j.data,"]]>");case L:return H.push("<!--",j.data,"-->");case V:var rn=j.publicId,Xe=j.systemId;if(H.push("<!DOCTYPE ",j.name),rn)H.push(" PUBLIC ",rn),Xe&&Xe!="."&&H.push(" ",Xe),H.push(">");else if(Xe&&Xe!=".")H.push(" SYSTEM ",Xe,">");else{var ft=j.internalSubset;ft&&H.push(" [",ft,"]"),H.push(">")}return;case I:return H.push("<?",j.target," ",j.data,"?>");case p:return H.push("&",j.nodeName,";");default:H.push("??",j.nodeName)}}function ra(j,H,ee){var fe;switch(H.nodeType){case h:fe=H.cloneNode(!1),fe.ownerDocument=j;case B:break;case f:ee=!0;break}if(fe||(fe=H.cloneNode(!1)),fe.ownerDocument=j,fe.parentNode=null,ee)for(var Ce=H.firstChild;Ce;)fe.appendChild(ra(j,Ce,ee)),Ce=Ce.nextSibling;return fe}function as(j,H,ee){var fe=new H.constructor;for(var Ce in H)if(Object.prototype.hasOwnProperty.call(H,Ce)){var Ve=H[Ce];typeof Ve!="object"&&Ve!=fe[Ce]&&(fe[Ce]=Ve)}switch(H.childNodes&&(fe.childNodes=new K),fe.ownerDocument=j,fe.nodeType){case h:var ct=H.attributes,Ft=fe.attributes=new pe,gt=ct.length;Ft._ownerElement=fe;for(var ar=0;ar<gt;ar++)fe.setAttributeNode(as(j,ct.item(ar),!0));break;case f:ee=!0}if(ee)for(var Li=H.firstChild;Li;)fe.appendChild(as(j,Li,ee)),Li=Li.nextSibling;return fe}function na(j,H,ee){j[H]=ee}try{if(Object.defineProperty){let j=function(H){switch(H.nodeType){case h:case B:var ee=[];for(H=H.firstChild;H;)H.nodeType!==7&&H.nodeType!==8&&ee.push(j(H)),H=H.nextSibling;return ee.join("");default:return H.nodeValue}};Object.defineProperty(ce.prototype,"length",{get:function(){return de(this),this.$$length}}),Object.defineProperty(ve.prototype,"textContent",{get:function(){return j(this)},set:function(H){switch(this.nodeType){case h:case B:for(;this.firstChild;)this.removeChild(this.firstChild);(H||String(H))&&this.appendChild(this.ownerDocument.createTextNode(H));break;default:this.data=H,this.value=H,this.nodeValue=H}}}),na=function(H,ee,fe){H["$$"+ee]=fe}}}catch{}return dn.DocumentType=vr,dn.DOMException=G,dn.DOMImplementation=he,dn.Element=ut,dn.Node=ve,dn.NodeList=K,dn.XMLSerializer=tn,dn}var el={},ef={},Fv;function Yk(){return Fv||(Fv=1,(function(s){var e=Sh().freeze;s.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),s.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
20
+ `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),s.entityMap=s.HTML_ENTITIES})(ef)),ef}var Fu={},Uv;function Jk(){if(Uv)return Fu;Uv=1;var s=Sh().NAMESPACE,e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,t=new RegExp("[\\-\\.0-9"+e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+e.source+t.source+"*(?::"+e.source+t.source+"*)?$"),r=0,n=1,a=2,o=3,l=4,u=5,c=6,h=7;function f(w,P){this.message=w,this.locator=P,Error.captureStackTrace&&Error.captureStackTrace(this,f)}f.prototype=new Error,f.prototype.name=f.name;function g(){}g.prototype={parse:function(w,P,Q){var G=this.domBuilder;G.startDocument(),V(P,P={}),C(w,P,Q,G,this.errorHandler),G.endDocument()}};function C(w,P,Q,G,K){function ce(rt){if(rt>65535){rt-=65536;var ut=55296+(rt>>10),rr=56320+(rt&1023);return String.fromCharCode(ut,rr)}else return String.fromCharCode(rt)}function de(rt){var ut=rt.slice(1,-1);return Object.hasOwnProperty.call(Q,ut)?Q[ut]:ut.charAt(0)==="#"?ce(parseInt(ut.substr(1).replace("x","0x"))):(K.error("entity not found:"+rt),rt)}function pe(rt){if(rt>Me){var ut=w.substring(Me,rt).replace(/&#?\w+;/g,de);ve&&ne(Me),G.characters(ut,0,rt-Me),Me=rt}}function ne(rt,ut){for(;rt>=ue&&(ut=he.exec(w));)se=ut.index,ue=se+ut[0].length,ve.lineNumber++;ve.columnNumber=rt-se+1}for(var se=0,ue=0,he=/.*(?:\r\n?|\n)|.*$/g,ve=G.locator,Ae=[{currentNSMap:P}],De={},Me=0;;){try{var Ne=w.indexOf("<",Me);if(Ne<0){if(!w.substr(Me).match(/^\s*$/)){var Je=G.doc,Re=Je.createTextNode(w.substr(Me));Je.appendChild(Re),G.currentElement=Re}return}switch(Ne>Me&&pe(Ne),w.charAt(Ne+1)){case"/":var Te=w.indexOf(">",Ne+3),Oe=w.substring(Ne+2,Te).replace(/[ \t\n\r]+$/g,""),He=Ae.pop();Te<0?(Oe=w.substring(Ne+2).replace(/[\s<].*/,""),K.error("end tag name: "+Oe+" is not complete:"+He.tagName),Te=Ne+1+Oe.length):Oe.match(/\s</)&&(Oe=Oe.replace(/[\s<].*/,""),K.error("end tag name: "+Oe+" maybe not complete"),Te=Ne+1+Oe.length);var st=He.localNSMap,Ct=He.tagName==Oe,Nt=Ct||He.tagName&&He.tagName.toLowerCase()==Oe.toLowerCase();if(Nt){if(G.endElement(He.uri,He.localName,Oe),st)for(var Ni in st)Object.prototype.hasOwnProperty.call(st,Ni)&&G.endPrefixMapping(Ni);Ct||K.fatalError("end tag name: "+Oe+" is not match the current start tagName:"+He.tagName)}else Ae.push(He);Te++;break;case"?":ve&&ne(Ne),Te=O(w,Ne,G);break;case"!":ve&&ne(Ne),Te=B(w,Ne,G,K);break;default:ve&&ne(Ne);var Bt=new M,Hi=Ae[Ae.length-1].currentNSMap,Te=b(w,Ne,Bt,Hi,de,K),ke=Bt.length;if(!Bt.closed&&F(w,Te,Bt.tagName,De)&&(Bt.closed=!0,Q.nbsp||K.warning("unclosed xml attribute")),ve&&ke){for(var Fe=p(ve,{}),Be=0;Be<ke;Be++){var Ke=Bt[Be];ne(Ke.offset),Ke.locator=p(ve,{})}G.locator=Fe,I(Bt,G,Hi)&&Ae.push(Bt),G.locator=ve}else I(Bt,G,Hi)&&Ae.push(Bt);s.isHTML(Bt.uri)&&!Bt.closed?Te=L(w,Te,Bt.tagName,de,G):Te++}}catch(rt){if(rt instanceof f)throw rt;K.error("element parse error: "+rt),Te=-1}Te>Me?Me=Te:pe(Math.max(Ne,Me)+1)}}function p(w,P){return P.lineNumber=w.lineNumber,P.columnNumber=w.columnNumber,P}function b(w,P,Q,G,K,ce){function de(ve,Ae,De){Q.attributeNames.hasOwnProperty(ve)&&ce.fatalError("Attribute "+ve+" redefined"),Q.addValue(ve,Ae.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,K),De)}for(var pe,ne,se=++P,ue=r;;){var he=w.charAt(se);switch(he){case"=":if(ue===n)pe=w.slice(P,se),ue=o;else if(ue===a)ue=o;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(ue===o||ue===n)if(ue===n&&(ce.warning('attribute value must after "="'),pe=w.slice(P,se)),P=se+1,se=w.indexOf(he,P),se>0)ne=w.slice(P,se),de(pe,ne,P-1),ue=u;else throw new Error("attribute value no end '"+he+"' match");else if(ue==l)ne=w.slice(P,se),de(pe,ne,P),ce.warning('attribute "'+pe+'" missed start quot('+he+")!!"),P=se+1,ue=u;else throw new Error('attribute value must after "="');break;case"/":switch(ue){case r:Q.setTagName(w.slice(P,se));case u:case c:case h:ue=h,Q.closed=!0;case l:case n:break;case a:Q.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return ce.error("unexpected end of input"),ue==r&&Q.setTagName(w.slice(P,se)),se;case">":switch(ue){case r:Q.setTagName(w.slice(P,se));case u:case c:case h:break;case l:case n:ne=w.slice(P,se),ne.slice(-1)==="/"&&(Q.closed=!0,ne=ne.slice(0,-1));case a:ue===a&&(ne=pe),ue==l?(ce.warning('attribute "'+ne+'" missed quot(")!'),de(pe,ne,P)):((!s.isHTML(G[""])||!ne.match(/^(?:disabled|checked|selected)$/i))&&ce.warning('attribute "'+ne+'" missed value!! "'+ne+'" instead!!'),de(ne,ne,P));break;case o:throw new Error("attribute value missed!!")}return se;case"€":he=" ";default:if(he<=" ")switch(ue){case r:Q.setTagName(w.slice(P,se)),ue=c;break;case n:pe=w.slice(P,se),ue=a;break;case l:var ne=w.slice(P,se);ce.warning('attribute "'+ne+'" missed quot(")!!'),de(pe,ne,P);case u:ue=c;break}else switch(ue){case a:Q.tagName,(!s.isHTML(G[""])||!pe.match(/^(?:disabled|checked|selected)$/i))&&ce.warning('attribute "'+pe+'" missed value!! "'+pe+'" instead2!!'),de(pe,pe,P),P=se,ue=n;break;case u:ce.warning('attribute space is required"'+pe+'"!!');case c:ue=n,P=se;break;case o:ue=l,P=se;break;case h:throw new Error("elements closed character '/' and '>' must be connected to")}}se++}}function I(w,P,Q){for(var G=w.tagName,K=null,he=w.length;he--;){var ce=w[he],de=ce.qName,pe=ce.value,ve=de.indexOf(":");if(ve>0)var ne=ce.prefix=de.slice(0,ve),se=de.slice(ve+1),ue=ne==="xmlns"&&se;else se=de,ne=null,ue=de==="xmlns"&&"";ce.localName=se,ue!==!1&&(K==null&&(K={},V(Q,Q={})),Q[ue]=K[ue]=pe,ce.uri=s.XMLNS,P.startPrefixMapping(ue,pe))}for(var he=w.length;he--;){ce=w[he];var ne=ce.prefix;ne&&(ne==="xml"&&(ce.uri=s.XML),ne!=="xmlns"&&(ce.uri=Q[ne||""]))}var ve=G.indexOf(":");ve>0?(ne=w.prefix=G.slice(0,ve),se=w.localName=G.slice(ve+1)):(ne=null,se=w.localName=G);var Ae=w.uri=Q[ne||""];if(P.startElement(Ae,se,G,w),w.closed){if(P.endElement(Ae,se,G),K)for(ne in K)Object.prototype.hasOwnProperty.call(K,ne)&&P.endPrefixMapping(ne)}else return w.currentNSMap=Q,w.localNSMap=K,!0}function L(w,P,Q,G,K){if(/^(?:script|textarea)$/i.test(Q)){var ce=w.indexOf("</"+Q+">",P),de=w.substring(P+1,ce);if(/[&<]/.test(de))return/^script$/i.test(Q)?(K.characters(de,0,de.length),ce):(de=de.replace(/&#?\w+;/g,G),K.characters(de,0,de.length),ce)}return P+1}function F(w,P,Q,G){var K=G[Q];return K==null&&(K=w.lastIndexOf("</"+Q+">"),K<P&&(K=w.lastIndexOf("</"+Q)),G[Q]=K),K<P}function V(w,P){for(var Q in w)Object.prototype.hasOwnProperty.call(w,Q)&&(P[Q]=w[Q])}function B(w,P,Q,G){var K=w.charAt(P+2);switch(K){case"-":if(w.charAt(P+3)==="-"){var ce=w.indexOf("-->",P+4);return ce>P?(Q.comment(w,P+4,ce-P-4),ce+3):(G.error("Unclosed comment"),-1)}else return-1;default:if(w.substr(P+3,6)=="CDATA["){var ce=w.indexOf("]]>",P+9);return Q.startCDATA(),Q.characters(w,P+9,ce-P-9),Q.endCDATA(),ce+3}var de=U(w,P),pe=de.length;if(pe>1&&/!doctype/i.test(de[0][0])){var ne=de[1][0],se=!1,ue=!1;pe>3&&(/^public$/i.test(de[2][0])?(se=de[3][0],ue=pe>4&&de[4][0]):/^system$/i.test(de[2][0])&&(ue=de[3][0]));var he=de[pe-1];return Q.startDTD(ne,se,ue),Q.endDTD(),he.index+he[0].length}}return-1}function O(w,P,Q){var G=w.indexOf("?>",P);if(G){var K=w.substring(P,G).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return K?(K[0].length,Q.processingInstruction(K[1],K[2]),G+2):-1}return-1}function M(){this.attributeNames={}}M.prototype={setTagName:function(w){if(!i.test(w))throw new Error("invalid tagName:"+w);this.tagName=w},addValue:function(w,P,Q){if(!i.test(w))throw new Error("invalid attribute:"+w);this.attributeNames[w]=this.length,this[this.length++]={qName:w,value:P,offset:Q}},length:0,getLocalName:function(w){return this[w].localName},getLocator:function(w){return this[w].locator},getQName:function(w){return this[w].qName},getURI:function(w){return this[w].uri},getValue:function(w){return this[w].value}};function U(w,P){var Q,G=[],K=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(K.lastIndex=P,K.exec(w);Q=K.exec(w);)if(G.push(Q),Q[1])return G}return Fu.XMLReader=g,Fu.ParseError=f,Fu}var $v;function Zk(){if($v)return el;$v=1;var s=Sh(),e=Xb(),t=Yk(),i=Jk(),r=e.DOMImplementation,n=s.NAMESPACE,a=i.ParseError,o=i.XMLReader;function l(b){return b.replace(/\r[\n\u0085]/g,`
21
+ `).replace(/[\r\u0085\u2028]/g,`
22
+ `)}function u(b){this.options=b||{locator:{}}}u.prototype.parseFromString=function(b,I){var L=this.options,F=new o,V=L.domBuilder||new h,B=L.errorHandler,O=L.locator,M=L.xmlns||{},U=/\/x?html?$/.test(I),w=U?t.HTML_ENTITIES:t.XML_ENTITIES;O&&V.setDocumentLocator(O),F.errorHandler=c(B,V,O),F.domBuilder=L.domBuilder||V,U&&(M[""]=n.HTML),M.xml=M.xml||n.XML;var P=L.normalizeLineEndings||l;return b&&typeof b=="string"?F.parse(P(b),M,w):F.errorHandler.error("invalid doc source"),V.doc};function c(b,I,L){if(!b){if(I instanceof h)return I;b=I}var F={},V=b instanceof Function;L=L||{};function B(O){var M=b[O];!M&&V&&(M=b.length==2?function(U){b(O,U)}:b),F[O]=M&&function(U){M("[xmldom "+O+"] "+U+g(L))}||function(){}}return B("warning"),B("error"),B("fatalError"),F}function h(){this.cdata=!1}function f(b,I){I.lineNumber=b.lineNumber,I.columnNumber=b.columnNumber}h.prototype={startDocument:function(){this.doc=new r().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(b,I,L,F){var V=this.doc,B=V.createElementNS(b,L||I),O=F.length;p(this,B),this.currentElement=B,this.locator&&f(this.locator,B);for(var M=0;M<O;M++){var b=F.getURI(M),U=F.getValue(M),L=F.getQName(M),w=V.createAttributeNS(b,L);this.locator&&f(F.getLocator(M),w),w.value=w.nodeValue=U,B.setAttributeNode(w)}},endElement:function(b,I,L){var F=this.currentElement;F.tagName,this.currentElement=F.parentNode},startPrefixMapping:function(b,I){},endPrefixMapping:function(b){},processingInstruction:function(b,I){var L=this.doc.createProcessingInstruction(b,I);this.locator&&f(this.locator,L),p(this,L)},ignorableWhitespace:function(b,I,L){},characters:function(b,I,L){if(b=C.apply(this,arguments),b){if(this.cdata)var F=this.doc.createCDATASection(b);else var F=this.doc.createTextNode(b);this.currentElement?this.currentElement.appendChild(F):/^\s*$/.test(b)&&this.doc.appendChild(F),this.locator&&f(this.locator,F)}},skippedEntity:function(b){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(b){(this.locator=b)&&(b.lineNumber=0)},comment:function(b,I,L){b=C.apply(this,arguments);var F=this.doc.createComment(b);this.locator&&f(this.locator,F),p(this,F)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(b,I,L){var F=this.doc.implementation;if(F&&F.createDocumentType){var V=F.createDocumentType(b,I,L);this.locator&&f(this.locator,V),p(this,V),this.doc.doctype=V}},warning:function(b){console.warn("[xmldom warning] "+b,g(this.locator))},error:function(b){console.error("[xmldom error] "+b,g(this.locator))},fatalError:function(b){throw new a(b,this.locator)}};function g(b){if(b)return`
23
+ @`+(b.systemId||"")+"#[line:"+b.lineNumber+",col:"+b.columnNumber+"]"}function C(b,I,L){return typeof b=="string"?b.substr(I,L):b.length>=I+L||I?new java.lang.String(b,I,L)+"":b}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(b){h.prototype[b]=function(){return null}});function p(b,I){b.currentElement?b.currentElement.appendChild(I):b.doc.appendChild(I)}return el.__DOMHandler=h,el.normalizeLineEndings=l,el.DOMParser=u,el}var jv;function ex(){if(jv)return Zo;jv=1;var s=Xb();return Zo.DOMImplementation=s.DOMImplementation,Zo.XMLSerializer=s.XMLSerializer,Zo.DOMParser=Zk().DOMParser,Zo}var Qb=ex();/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const Vv=s=>!!s&&typeof s=="object",ii=(...s)=>s.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):Vv(e[i])&&Vv(t[i])?e[i]=ii(e[i],t[i]):e[i]=t[i]}),e),{}),Yb=s=>Object.keys(s).map(e=>s[e]),tx=(s,e)=>{const t=[];for(let i=s;i<e;i++)t.push(i);return t},io=s=>s.reduce((e,t)=>e.concat(t),[]),Jb=s=>{if(!s.length)return[];const e=[];for(let t=0;t<s.length;t++)e.push(s[t]);return e},ix=(s,e)=>s.reduce((t,i,r)=>(i[e]&&t.push(r),t),[]),rx=(s,e)=>Yb(s.reduce((t,i)=>(i.forEach(r=>{t[e(r)]=r}),t),{}));var ro={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const Ll=({baseUrl:s="",source:e="",range:t="",indexRange:i=""})=>{const r={uri:e,resolvedUri:bh(s||"",e)};if(t||i){const a=(t||i).split("-");let o=D.BigInt?D.BigInt(a[0]):parseInt(a[0],10),l=D.BigInt?D.BigInt(a[1]):parseInt(a[1],10);o<Number.MAX_SAFE_INTEGER&&typeof o=="bigint"&&(o=Number(o)),l<Number.MAX_SAFE_INTEGER&&typeof l=="bigint"&&(l=Number(l));let u;typeof l=="bigint"||typeof o=="bigint"?u=D.BigInt(l)-D.BigInt(o)+D.BigInt(1):u=l-o+1,typeof u=="bigint"&&u<Number.MAX_SAFE_INTEGER&&(u=Number(u)),r.byterange={length:u,offset:o}}return r},nx=s=>{let e;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=D.BigInt(s.offset)+D.BigInt(s.length)-D.BigInt(1):e=s.offset+s.length-1,`${s.offset}-${e}`},Hv=s=>(s&&typeof s!="number"&&(s=parseInt(s,10)),isNaN(s)?null:s),sx={static(s){const{duration:e,timescale:t=1,sourceDuration:i,periodDuration:r}=s,n=Hv(s.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:i/a}},dynamic(s){const{NOW:e,clientOffset:t,availabilityStartTime:i,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=s,u=Hv(s.endNumber),c=(e+t)/1e3,h=i+a,g=c+o-h,C=Math.ceil(g*r/n),p=Math.floor((c-h-l)*r/n),b=Math.floor((c-h)*r/n);return{start:Math.max(0,p),end:typeof u=="number"?u:Math.min(C,b)}}},ax=s=>e=>{const{duration:t,timescale:i=1,periodStart:r,startNumber:n=1}=s;return{number:n+e,duration:t/i,timeline:r,time:e*t}},km=s=>{const{type:e,duration:t,timescale:i=1,periodDuration:r,sourceDuration:n}=s,{start:a,end:o}=sx[e](s),l=tx(a,o).map(ax(s));if(e==="static"){const u=l.length-1,c=typeof r=="number"?r:n;l[u].duration=c-t/i*u}return l},Zb=s=>{const{baseUrl:e,initialization:t={},sourceDuration:i,indexRange:r="",periodStart:n,presentationTime:a,number:o=0,duration:l}=s;if(!e)throw new Error(ro.NO_BASE_URL);const u=Ll({baseUrl:e,source:t.sourceURL,range:t.range}),c=Ll({baseUrl:e,source:e,indexRange:r});if(c.map=u,l){const h=km(s);h.length&&(c.duration=h[0].duration,c.timeline=h[0].timeline)}else i&&(c.duration=i,c.timeline=n);return c.presentationTime=a||n,c.number=o,[c]},xm=(s,e,t)=>{const i=s.sidx.map?s.sidx.map:null,r=s.sidx.duration,n=s.timeline||0,a=s.sidx.byterange,o=a.offset+a.length,l=e.timescale,u=e.references.filter(b=>b.referenceType!==1),c=[],h=s.endList?"static":"dynamic",f=s.sidx.timeline;let g=f,C=s.mediaSequence||0,p;typeof e.firstOffset=="bigint"?p=D.BigInt(o)+e.firstOffset:p=o+e.firstOffset;for(let b=0;b<u.length;b++){const I=e.references[b],L=I.referencedSize,F=I.subsegmentDuration;let V;typeof p=="bigint"?V=p+D.BigInt(L)-D.BigInt(1):V=p+L-1;const B=`${p}-${V}`,M=Zb({baseUrl:t,timescale:l,timeline:n,periodStart:f,presentationTime:g,number:C,duration:F,sourceDuration:r,indexRange:B,type:h})[0];i&&(M.map=i),c.push(M),typeof p=="bigint"?p+=D.BigInt(L):p+=L,g+=F/l,C++}return s.segments=c,s},ox=["AUDIO","SUBTITLES"],lx=1/60,e0=s=>rx(s,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),ux=(s,e)=>{for(let t=0;t<s.length;t++)if(s[t].attributes.NAME===e)return s[t];return null},qv=s=>{let e=[];return Qk(s,ox,(t,i,r,n)=>{e=e.concat(t.playlists||[])}),e},zv=({playlist:s,mediaSequence:e})=>{s.mediaSequence=e,s.segments.forEach((t,i)=>{t.number=s.mediaSequence+i})},cx=({oldPlaylists:s,newPlaylists:e,timelineStarts:t})=>{e.forEach(i=>{i.discontinuitySequence=t.findIndex(function({timeline:l}){return l===i.timeline});const r=ux(s,i.attributes.NAME);if(!r||i.sidx)return;const n=i.segments[0],a=r.segments.findIndex(function(l){return Math.abs(l.presentationTime-n.presentationTime)<lx});if(a===-1){zv({playlist:i,mediaSequence:r.mediaSequence+r.segments.length}),i.segments[0].discontinuity=!0,i.discontinuityStarts.unshift(0),(!r.segments.length&&i.timeline>r.timeline||r.segments.length&&i.timeline>r.segments[r.segments.length-1].timeline)&&i.discontinuitySequence--;return}r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,i.discontinuityStarts.unshift(0),i.discontinuitySequence--),zv({playlist:i,mediaSequence:r.segments[a].number})})},hx=({oldManifest:s,newManifest:e})=>{const t=s.playlists.concat(qv(s)),i=e.playlists.concat(qv(e));return e.timelineStarts=e0([s.timelineStarts,e.timelineStarts]),cx({oldPlaylists:t,newPlaylists:i,timelineStarts:e.timelineStarts}),e},Ch=s=>s&&s.uri+"-"+nx(s.byterange),tf=s=>{const e=s.reduce(function(i,r){return i[r.attributes.baseUrl]||(i[r.attributes.baseUrl]=[]),i[r.attributes.baseUrl].push(r),i},{});let t=[];return Object.values(e).forEach(i=>{const r=Yb(i.reduce((n,a)=>{const o=a.attributes.id+(a.attributes.lang||"");return n[o]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[o].segments.push(...a.segments)),a.attributes.contentProtection&&(n[o].attributes.contentProtection=a.attributes.contentProtection)):(n[o]=a,n[o].attributes.timelineStarts=[]),n[o].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(i=>(i.discontinuityStarts=ix(i.segments||[],"discontinuity"),i))},Am=(s,e)=>{const t=Ch(s.sidx),i=t&&e[t]&&e[t].sidx;return i&&xm(s,i,s.sidx.resolvedUri),s},dx=(s,e={})=>{if(!Object.keys(e).length)return s;for(const t in s)s[t]=Am(s[t],e);return s},fx=({attributes:s,segments:e,sidx:t,mediaSequence:i,discontinuitySequence:r,discontinuityStarts:n},a)=>{const o={attributes:{NAME:s.id,BANDWIDTH:s.bandwidth,CODECS:s.codecs,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:s.timelineStarts,mediaSequence:i,segments:e};return s.contentProtection&&(o.contentProtection=s.contentProtection),s.serviceLocation&&(o.attributes.serviceLocation=s.serviceLocation),t&&(o.sidx=t),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o},px=({attributes:s,segments:e,mediaSequence:t,discontinuityStarts:i,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:s.baseUrl,timeline:s.periodStart,resolvedUri:s.baseUrl||"",duration:s.sourceDuration,number:0}],s.duration=s.sourceDuration);const n={NAME:s.id,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1};s.codecs&&(n.CODECS=s.codecs);const a={attributes:n,uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,timelineStarts:s.timelineStarts,discontinuityStarts:i,discontinuitySequence:r,mediaSequence:t,segments:e};return s.serviceLocation&&(a.attributes.serviceLocation=s.serviceLocation),a},mx=(s,e={},t=!1)=>{let i;const r=s.reduce((n,a)=>{const o=a.attributes.role&&a.attributes.role.value||"",l=a.attributes.lang||"";let u=a.attributes.label||"main";if(l&&!a.attributes.label){const h=o?` (${o})`:"";u=`${a.attributes.lang}${h}`}n[u]||(n[u]={language:l,autoselect:!0,default:o==="main",playlists:[],uri:""});const c=Am(fx(a,t),e);return n[u].playlists.push(c),typeof i>"u"&&o==="main"&&(i=a,i.default=!0),n},{});if(!i){const n=Object.keys(r)[0];r[n].default=!0}return r},gx=(s,e={})=>s.reduce((t,i)=>{const r=i.attributes.label||i.attributes.lang||"text",n=i.attributes.lang||"und";return t[r]||(t[r]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(Am(px(i),e)),t},{}),vx=s=>s.reduce((e,t)=>(t&&t.forEach(i=>{const{channel:r,language:n}=i;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},i.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=i.aspectRatio),i.hasOwnProperty("easyReader")&&(e[n].easyReader=i.easyReader),i.hasOwnProperty("3D")&&(e[n]["3D"]=i["3D"])}),e),{}),yx=({attributes:s,segments:e,sidx:t,discontinuityStarts:i})=>{const r={attributes:{NAME:s.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:s.width,height:s.height},CODECS:s.codecs,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuityStarts:i,timelineStarts:s.timelineStarts,segments:e};return s.frameRate&&(r.attributes["FRAME-RATE"]=s.frameRate),s.contentProtection&&(r.contentProtection=s.contentProtection),s.serviceLocation&&(r.attributes.serviceLocation=s.serviceLocation),t&&(r.sidx=t),r},_x=({attributes:s})=>s.mimeType==="video/mp4"||s.mimeType==="video/webm"||s.contentType==="video",Tx=({attributes:s})=>s.mimeType==="audio/mp4"||s.mimeType==="audio/webm"||s.contentType==="audio",bx=({attributes:s})=>s.mimeType==="text/vtt"||s.contentType==="text",Sx=(s,e)=>{s.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:i}){return i===t.timeline}),t.segments&&t.segments.forEach((i,r)=>{i.number=r})})},Wv=s=>s?Object.keys(s).reduce((e,t)=>{const i=s[t];return e.concat(i.playlists)},[]):[],Cx=({dashPlaylists:s,locations:e,contentSteering:t,sidxMapping:i={},previousManifest:r,eventStream:n})=>{if(!s.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:u}=s[0].attributes,c=tf(s.filter(_x)).map(yx),h=tf(s.filter(Tx)),f=tf(s.filter(bx)),g=s.map(V=>V.attributes.captionServices).filter(Boolean),C={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:dx(c,i)};u>=0&&(C.minimumUpdatePeriod=u*1e3),e&&(C.locations=e),t&&(C.contentSteering=t),o==="dynamic"&&(C.suggestedPresentationDelay=l),n&&n.length>0&&(C.eventStream=n);const p=C.playlists.length===0,b=h.length?mx(h,i,p):null,I=f.length?gx(f,i):null,L=c.concat(Wv(b),Wv(I)),F=L.map(({timelineStarts:V})=>V);return C.timelineStarts=e0(F),Sx(L,C.timelineStarts),b&&(C.mediaGroups.AUDIO.audio=b),I&&(C.mediaGroups.SUBTITLES.subs=I),g.length&&(C.mediaGroups["CLOSED-CAPTIONS"].cc=vx(g)),r?hx({oldManifest:r,newManifest:C}):C},Ex=(s,e,t)=>{const{NOW:i,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=s,u=(i+r)/1e3,c=n+o,f=u+l-c;return Math.ceil((f*a-e)/t)},t0=(s,e)=>{const{type:t,minimumUpdatePeriod:i=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:o=1,periodStart:l}=s,u=[];let c=-1;for(let h=0;h<e.length;h++){const f=e[h],g=f.d,C=f.r||0,p=f.t||0;c<0&&(c=p),p&&p>c&&(c=p);let b;if(C<0){const F=h+1;F===e.length?t==="dynamic"&&i>0&&r.indexOf("$Number$")>0?b=Ex(s,c,g):b=(n*a-c)/g:b=(e[F].t-c)/g}else b=C+1;const I=o+u.length+b;let L=o+u.length;for(;L<I;)u.push({number:L,duration:g/a,time:c,timeline:l}),c+=g,L++}return u},wx=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,kx=s=>(e,t,i,r)=>{if(e==="$$")return"$";if(typeof s[t]>"u")return e;const n=""+s[t];return t==="RepresentationID"||(i?r=parseInt(r,10):r=1,n.length>=r)?n:`${new Array(r-n.length+1).join("0")}${n}`},Gv=(s,e)=>s.replace(wx,kx(e)),xx=(s,e)=>!s.duration&&!e?[{number:s.startNumber||1,duration:s.sourceDuration,time:0,timeline:s.periodStart}]:s.duration?km(s):t0(s,e),Ax=(s,e)=>{const t={RepresentationID:s.id,Bandwidth:s.bandwidth||0},{initialization:i={sourceURL:"",range:""}}=s,r=Ll({baseUrl:s.baseUrl,source:Gv(i.sourceURL,t),range:i.range});return xx(s,e).map(a=>{t.Number=a.number,t.Time=a.time;const o=Gv(s.media||"",t),l=s.timescale||1,u=s.presentationTimeOffset||0,c=s.periodStart+(a.time-u)/l;return{uri:o,timeline:a.timeline,duration:a.duration,resolvedUri:bh(s.baseUrl||"",o),map:r,number:a.number,presentationTime:c}})},Ix=(s,e)=>{const{baseUrl:t,initialization:i={}}=s,r=Ll({baseUrl:t,source:i.sourceURL,range:i.range}),n=Ll({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},Px=(s,e)=>{const{duration:t,segmentUrls:i=[],periodStart:r}=s;if(!t&&!e||t&&e)throw new Error(ro.SEGMENT_TIME_UNSPECIFIED);const n=i.map(l=>Ix(s,l));let a;return t&&(a=km(s)),e&&(a=t0(s,e)),a.map((l,u)=>{if(n[u]){const c=n[u],h=s.timescale||1,f=s.presentationTimeOffset||0;return c.timeline=l.timeline,c.duration=l.duration,c.number=l.number,c.presentationTime=r+(l.time-f)/h,c}}).filter(l=>l)},Dx=({attributes:s,segmentInfo:e})=>{let t,i;e.template?(i=Ax,t=ii(s,e.template)):e.base?(i=Zb,t=ii(s,e.base)):e.list&&(i=Px,t=ii(s,e.list));const r={attributes:s};if(!i)return r;const n=i(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:o=1}=t;t.duration=a/o}else n.length?t.duration=n.reduce((a,o)=>Math.max(a,Math.ceil(o.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},Nx=s=>s.map(Dx),Dt=(s,e)=>Jb(s.childNodes).filter(({tagName:t})=>t===e),Wl=s=>s.textContent.trim(),Lx=s=>parseFloat(s.split("/").reduce((e,t)=>e/t)),Ea=s=>{const o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(s);if(!o)return 0;const[l,u,c,h,f,g]=o.slice(1);return parseFloat(l||0)*31536e3+parseFloat(u||0)*2592e3+parseFloat(c||0)*86400+parseFloat(h||0)*3600+parseFloat(f||0)*60+parseFloat(g||0)},Ox=s=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(s)&&(s+="Z"),Date.parse(s)),Kv={mediaPresentationDuration(s){return Ea(s)},availabilityStartTime(s){return Ox(s)/1e3},minimumUpdatePeriod(s){return Ea(s)},suggestedPresentationDelay(s){return Ea(s)},type(s){return s},timeShiftBufferDepth(s){return Ea(s)},start(s){return Ea(s)},width(s){return parseInt(s,10)},height(s){return parseInt(s,10)},bandwidth(s){return parseInt(s,10)},frameRate(s){return Lx(s)},startNumber(s){return parseInt(s,10)},timescale(s){return parseInt(s,10)},presentationTimeOffset(s){return parseInt(s,10)},duration(s){const e=parseInt(s,10);return isNaN(e)?Ea(s):e},d(s){return parseInt(s,10)},t(s){return parseInt(s,10)},r(s){return parseInt(s,10)},presentationTime(s){return parseInt(s,10)},DEFAULT(s){return s}},Gt=s=>s&&s.attributes?Jb(s.attributes).reduce((e,t)=>{const i=Kv[t.name]||Kv.DEFAULT;return e[t.name]=i(t.value),e},{}):{},Mx={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},Eh=(s,e)=>e.length?io(s.map(function(t){return e.map(function(i){const r=Wl(i),n=bh(t.baseUrl,r),a=ii(Gt(i),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):s,Im=s=>{const e=Dt(s,"SegmentTemplate")[0],t=Dt(s,"SegmentList")[0],i=t&&Dt(t,"SegmentURL").map(h=>ii({tag:"SegmentURL"},Gt(h))),r=Dt(s,"SegmentBase")[0],n=t||e,a=n&&Dt(n,"SegmentTimeline")[0],o=t||r||e,l=o&&Dt(o,"Initialization")[0],u=e&&Gt(e);u&&l?u.initialization=l&&Gt(l):u&&u.initialization&&(u.initialization={sourceURL:u.initialization});const c={template:u,segmentTimeline:a&&Dt(a,"S").map(h=>Gt(h)),list:t&&ii(Gt(t),{segmentUrls:i,initialization:Gt(l)}),base:r&&ii(Gt(r),{initialization:Gt(l)})};return Object.keys(c).forEach(h=>{c[h]||delete c[h]}),c},Rx=(s,e,t)=>i=>{const r=Dt(i,"BaseURL"),n=Eh(e,r),a=ii(s,Gt(i)),o=Im(i);return n.map(l=>({segmentInfo:ii(t,o),attributes:ii(a,l)}))},Bx=s=>s.reduce((e,t)=>{const i=Gt(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const r=Mx[i.schemeIdUri];if(r){e[r]={attributes:i};const n=Dt(t,"cenc:pssh")[0];if(n){const a=Wl(n);e[r].pssh=a&&Hb(a)}}return e},{}),Fx=s=>{if(s.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(t=>{let i,r;return r=t,/^CC\d=/.test(t)?[i,r]=t.split("="):/^CC\d$/.test(t)&&(i=t),{channel:i,language:r}});if(s.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(t=>{const i={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[r,n=""]=t.split("=");i.channel=r,i.language=t,n.split(",").forEach(a=>{const[o,l]=a.split(":");o==="lang"?i.language=l:o==="er"?i.easyReader=Number(l):o==="war"?i.aspectRatio=Number(l):o==="3D"&&(i["3D"]=Number(l))})}else i.language=t;return i.channel&&(i.channel="SERVICE"+i.channel),i})},Ux=s=>io(Dt(s.node,"EventStream").map(e=>{const t=Gt(e),i=t.schemeIdUri;return Dt(e,"Event").map(r=>{const n=Gt(r),a=n.presentationTime||0,o=t.timescale||1,l=n.duration||0,u=a/o+s.attributes.start;return{schemeIdUri:i,value:t.value,id:n.id,start:u,end:u+l/o,messageData:Wl(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),$x=(s,e,t)=>i=>{const r=Gt(i),n=Eh(e,Dt(i,"BaseURL")),a=Dt(i,"Role")[0],o={role:Gt(a)};let l=ii(s,r,o);const u=Dt(i,"Accessibility")[0],c=Fx(Gt(u));c&&(l=ii(l,{captionServices:c}));const h=Dt(i,"Label")[0];if(h&&h.childNodes.length){const b=h.childNodes[0].nodeValue.trim();l=ii(l,{label:b})}const f=Bx(Dt(i,"ContentProtection"));Object.keys(f).length&&(l=ii(l,{contentProtection:f}));const g=Im(i),C=Dt(i,"Representation"),p=ii(t,g);return io(C.map(Rx(l,n,p)))},jx=(s,e)=>(t,i)=>{const r=Eh(e,Dt(t.node,"BaseURL")),n=ii(s,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=Dt(t.node,"AdaptationSet"),o=Im(t.node);return io(a.map($x(n,r,o)))},Vx=(s,e)=>{if(s.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!s.length)return null;const t=ii({serverURL:Wl(s[0])},Gt(s[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},Hx=({attributes:s,priorPeriodAttributes:e,mpdType:t})=>typeof s.start=="number"?s.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,qx=(s,e={})=>{const{manifestUri:t="",NOW:i=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=Dt(s,"Period");if(!a.length)throw new Error(ro.INVALID_NUMBER_OF_PERIOD);const o=Dt(s,"Location"),l=Gt(s),u=Eh([{baseUrl:t}],Dt(s,"BaseURL")),c=Dt(s,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=i,l.clientOffset=r,o.length&&(l.locations=o.map(Wl));const h=[];return a.forEach((f,g)=>{const C=Gt(f),p=h[g-1];C.start=Hx({attributes:C,priorPeriodAttributes:p?p.attributes:null,mpdType:l.type}),h.push({node:f,attributes:C})}),{locations:l.locations,contentSteeringInfo:Vx(c,n),representationInfo:io(h.map(jx(l,u))),eventStream:io(h.map(Ux))}},i0=s=>{if(s==="")throw new Error(ro.DASH_EMPTY_MANIFEST);const e=new Qb.DOMParser;let t,i;try{t=e.parseFromString(s,"application/xml"),i=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(ro.DASH_INVALID_XML);return i},zx=s=>{const e=Dt(s,"UTCTiming")[0];if(!e)return null;const t=Gt(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(ro.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},Wx=(s,e={})=>{const t=qx(i0(s),e),i=Nx(t.representationInfo);return Cx({dashPlaylists:i,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},Gx=s=>zx(i0(s));var rf,Xv;function Kx(){if(Xv)return rf;Xv=1;var s=Math.pow(2,32),e=function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r;return i.getBigUint64?(r=i.getBigUint64(0),r<Number.MAX_SAFE_INTEGER?Number(r):r):i.getUint32(0)*s+i.getUint32(4)};return rf={getUint64:e,MAX_UINT32:s},rf}var nf,Qv;function Xx(){if(Qv)return nf;Qv=1;var s=Kx().getUint64,e=function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8)},n=12;r.version===0?(r.earliestPresentationTime=i.getUint32(n),r.firstOffset=i.getUint32(n+4),n+=8):(r.earliestPresentationTime=s(t.subarray(n)),r.firstOffset=s(t.subarray(n+8)),n+=16),n+=2;var a=i.getUint16(n);for(n+=2;a>0;n+=12,a--)r.references.push({referenceType:(t[n]&128)>>>7,referencedSize:i.getUint32(n)&2147483647,subsegmentDuration:i.getUint32(n+4),startsWithSap:!!(t[n+8]&128),sapType:(t[n+8]&112)>>>4,sapDeltaTime:i.getUint32(n+8)&268435455});return r};return nf=e,nf}var Qx=Xx();const Yx=Vi(Qx);var Jx=$e([73,68,51]),Zx=function(e,t){t===void 0&&(t=0),e=$e(e);var i=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(i&16)>>4;return n?r+20:r+10},dl=function s(e,t){return t===void 0&&(t=0),e=$e(e),e.length-t<10||!At(e,Jx,{offset:t})?t:(t+=Zx(e,t),s(e,t))},Yv=function(e){return typeof e=="string"?Kb(e):e},eA=function(e){return Array.isArray(e)?e.map(function(t){return Yv(t)}):[Yv(e)]},tA=function s(e,t,i){i===void 0&&(i=!1),t=eA(t),e=$e(e);var r=[];if(!t.length)return r;for(var n=0;n<e.length;){var a=(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0,o=e.subarray(n+4,n+8);if(a===0)break;var l=n+a;if(l>e.length){if(i)break;l=e.length}var u=e.subarray(n+8,l);At(o,t[0])&&(t.length===1?r.push(u):r.push.apply(r,s(u,t.slice(1),i))),n=l}return r},Uu={EBML:$e([26,69,223,163]),DocType:$e([66,130]),Segment:$e([24,83,128,103]),SegmentInfo:$e([21,73,169,102]),Tracks:$e([22,84,174,107]),Track:$e([174]),TrackNumber:$e([215]),DefaultDuration:$e([35,227,131]),TrackEntry:$e([174]),TrackType:$e([131]),FlagDefault:$e([136]),CodecID:$e([134]),CodecPrivate:$e([99,162]),VideoTrack:$e([224]),AudioTrack:$e([225]),Cluster:$e([31,67,182,117]),Timestamp:$e([231]),TimestampScale:$e([42,215,177]),BlockGroup:$e([160]),BlockDuration:$e([155]),Block:$e([161]),SimpleBlock:$e([163])},pp=[128,64,32,16,8,4,2,1],iA=function(e){for(var t=1,i=0;i<pp.length&&!(e&pp[i]);i++)t++;return t},Ec=function(e,t,i,r){i===void 0&&(i=!0),r===void 0&&(r=!1);var n=iA(e[t]),a=e.subarray(t,t+n);return i&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=pp[n-1]),{length:n,value:Gk(a,{signed:r}),bytes:a}},Jv=function s(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return s(t)}):typeof e=="number"?Kk(e):e},rA=function(e){return Array.isArray(e)?e.map(function(t){return Jv(t)}):[Jv(e)]},nA=function s(e,t,i){if(i>=t.length)return t.length;var r=Ec(t,i,!1);if(At(e.bytes,r.bytes))return i;var n=Ec(t,i+r.length);return s(e,t,i+n.length+n.value+r.length)},Zv=function s(e,t){t=rA(t),e=$e(e);var i=[];if(!t.length)return i;for(var r=0;r<e.length;){var n=Ec(e,r,!1),a=Ec(e,r+n.length),o=r+n.length+a.length;a.value===127&&(a.value=nA(n,e,o),a.value!==e.length&&(a.value-=o));var l=o+a.value>e.length?e.length:o+a.value,u=e.subarray(o,l);At(t[0],n.bytes)&&(t.length===1?i.push(u):i=i.concat(s(u,t.slice(1))));var c=n.length+a.length+u.length;r+=c}return i},sA=$e([0,0,0,1]),aA=$e([0,0,1]),oA=$e([0,0,3]),lA=function(e){for(var t=[],i=1;i<e.length-2;)At(e.subarray(i,i+3),oA)&&(t.push(i+2),i++),i++;if(t.length===0)return e;var r=e.length-t.length,n=new Uint8Array(r),a=0;for(i=0;i<r;a++,i++)a===t[0]&&(a++,t.shift()),n[i]=e[a];return n},r0=function(e,t,i,r){e=$e(e),i=[].concat(i);for(var n=0,a,o=0;n<e.length&&(o<r||a);){var l=void 0;if(At(e.subarray(n),sA)?l=4:At(e.subarray(n),aA)&&(l=3),!l){n++;continue}if(o++,a)return lA(e.subarray(a,n));var u=void 0;t==="h264"?u=e[n+l]&31:t==="h265"&&(u=e[n+l]>>1&63),i.indexOf(u)!==-1&&(a=n+l),n+=l+(t==="h264"?1:2)}return e.subarray(0,0)},uA=function(e,t,i){return r0(e,"h264",t,i)},cA=function(e,t,i){return r0(e,"h265",t,i)},bi={webm:$e([119,101,98,109]),matroska:$e([109,97,116,114,111,115,107,97]),flac:$e([102,76,97,67]),ogg:$e([79,103,103,83]),ac3:$e([11,119]),riff:$e([82,73,70,70]),avi:$e([65,86,73]),wav:$e([87,65,86,69]),"3gp":$e([102,116,121,112,51,103]),mp4:$e([102,116,121,112]),fmp4:$e([115,116,121,112]),mov:$e([102,116,121,112,113,116]),moov:$e([109,111,111,118]),moof:$e([109,111,111,102])},no={aac:function(e){var t=dl(e);return At(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=dl(e);return At(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=Zv(e,[Uu.EBML,Uu.DocType])[0];return At(t,bi.webm)},mkv:function(e){var t=Zv(e,[Uu.EBML,Uu.DocType])[0];return At(t,bi.matroska)},mp4:function(e){if(no["3gp"](e)||no.mov(e))return!1;if(At(e,bi.mp4,{offset:4})||At(e,bi.fmp4,{offset:4})||At(e,bi.moof,{offset:4})||At(e,bi.moov,{offset:4}))return!0},mov:function(e){return At(e,bi.mov,{offset:4})},"3gp":function(e){return At(e,bi["3gp"],{offset:4})},ac3:function(e){var t=dl(e);return At(e,bi.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+188<e.length&&t<188;){if(e[t]===71&&e[t+188]===71)return!0;t+=1}return!1},flac:function(e){var t=dl(e);return At(e,bi.flac,{offset:t})},ogg:function(e){return At(e,bi.ogg)},avi:function(e){return At(e,bi.riff)&&At(e,bi.avi,{offset:8})},wav:function(e){return At(e,bi.riff)&&At(e,bi.wav,{offset:8})},h264:function(e){return uA(e,7,3).length},h265:function(e){return cA(e,[32,33],3).length}},mp=Object.keys(no).filter(function(s){return s!=="ts"&&s!=="h264"&&s!=="h265"}).concat(["ts","h264","h265"]);mp.forEach(function(s){var e=no[s];no[s]=function(t){return e($e(t))}});var hA=no,Pm=function(e){e=$e(e);for(var t=0;t<mp.length;t++){var i=mp[t];if(hA[i](e))return i}return""},dA=function(e){return tA(e,["moof"]).length>0},sf,ey;function fA(){if(ey)return sf;ey=1;var s=9e4,e,t,i,r,n,a,o;return e=function(l){return l*s},t=function(l,u){return l*u},i=function(l){return l/s},r=function(l,u){return l/u},n=function(l,u){return e(r(l,u))},a=function(l,u){return t(i(l),u)},o=function(l,u,c){return i(c?l:l-u)},sf={ONE_SECOND_IN_TS:s,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:i,audioTsToSeconds:r,audioTsToVideoTs:n,videoTsToAudioTs:a,metadataTsToSeconds:o},sf}var Ls=fA();/**
24
+ * @license
25
+ * Video.js 8.20.0 <http://videojs.com/>
26
+ * Copyright Brightcove, Inc. <https://www.brightcove.com/>
27
+ * Available under Apache License Version 2.0
28
+ * <https://github.com/videojs/video.js/blob/main/LICENSE>
29
+ *
30
+ * Includes vtt.js <https://github.com/mozilla/vtt.js>
31
+ * Available under Apache License Version 2.0
32
+ * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
33
+ */var gp="8.20.0";const mn={},Zn=function(s,e){return mn[s]=mn[s]||[],e&&(mn[s]=mn[s].concat(e)),mn[s]},pA=function(s,e){Zn(s,e)},n0=function(s,e){const t=Zn(s).indexOf(e);return t<=-1?!1:(mn[s]=mn[s].slice(),mn[s].splice(t,1),!0)},mA=function(s,e){Zn(s,[].concat(e).map(t=>{const i=(...r)=>(n0(s,i),t(...r));return i}))},wc={prefixed:!0},hc=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],ty=hc[0];let fl;for(let s=0;s<hc.length;s++)if(hc[s][1]in le){fl=hc[s];break}if(fl){for(let s=0;s<fl.length;s++)wc[ty[s]]=fl[s];wc.prefixed=fl[0]!==ty[0]}let Bi=[];const gA=(s,e,t)=>(i,r,n)=>{const a=e.levels[r],o=new RegExp(`^(${a})$`);let l=s;if(i!=="log"&&n.unshift(i.toUpperCase()+":"),t&&(l=`%c${s}`,n.unshift(t)),n.unshift(l+":"),Bi){Bi.push([].concat(n));const c=Bi.length-1e3;Bi.splice(0,c>0?c:0)}if(!D.console)return;let u=D.console[i];!u&&i==="debug"&&(u=D.console.info||D.console.log),!(!u||!a||!o.test(i))&&u[Array.isArray(n)?"apply":"call"](D.console,n)};function vp(s,e=":",t=""){let i="info",r;function n(...a){r("log",i,a)}return r=gA(s,n,t),n.createLogger=(a,o,l)=>{const u=o!==void 0?o:e,c=l!==void 0?l:t,h=`${s} ${u} ${a}`;return vp(h,u,c)},n.createNewLogger=(a,o,l)=>vp(a,o,l),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:i},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);i=a}return i},n.history=()=>Bi?[].concat(Bi):[],n.history.filter=a=>(Bi||[]).filter(o=>new RegExp(`.*${a}.*`).test(o[0])),n.history.clear=()=>{Bi&&(Bi.length=0)},n.history.disable=()=>{Bi!==null&&(Bi.length=0,Bi=null)},n.history.enable=()=>{Bi===null&&(Bi=[])},n.error=(...a)=>r("error",i,a),n.warn=(...a)=>r("warn",i,a),n.debug=(...a)=>r("debug",i,a),n}const et=vp("VIDEOJS"),s0=et.createLogger,vA=Object.prototype.toString,a0=function(s){return Xr(s)?Object.keys(s):[]};function Va(s,e){a0(s).forEach(t=>e(s[t],t))}function o0(s,e,t=0){return a0(s).reduce((i,r)=>e(i,s[r],r),t)}function Xr(s){return!!s&&typeof s=="object"}function so(s){return Xr(s)&&vA.call(s)==="[object Object]"&&s.constructor===Object}function Tt(...s){const e={};return s.forEach(t=>{t&&Va(t,(i,r)=>{if(!so(i)){e[r]=i;return}so(e[r])||(e[r]={}),e[r]=Tt(e[r],i)})}),e}function l0(s={}){const e=[];for(const t in s)if(s.hasOwnProperty(t)){const i=s[t];e.push(i)}return e}function wh(s,e,t,i=!0){const r=a=>Object.defineProperty(s,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return i&&(n.set=r),Object.defineProperty(s,e,n)}var yA=Object.freeze({__proto__:null,each:Va,reduce:o0,isObject:Xr,isPlain:so,merge:Tt,values:l0,defineLazyProperty:wh});let Dm=!1,u0=null,Qr=!1,c0,h0=!1,Ha=!1,qa=!1,Yr=!1,Nm=null,kh=null;const _A=!!(D.cast&&D.cast.framework&&D.cast.framework.CastReceiverContext);let d0=null,kc=!1,xh=!1,xc=!1,Ah=!1,Ac=!1,Ic=!1,Pc=!1;const Ol=!!(So()&&("ontouchstart"in D||D.navigator.maxTouchPoints||D.DocumentTouch&&D.document instanceof D.DocumentTouch)),zn=D.navigator&&D.navigator.userAgentData;zn&&zn.platform&&zn.brands&&(Qr=zn.platform==="Android",Ha=!!zn.brands.find(s=>s.brand==="Microsoft Edge"),qa=!!zn.brands.find(s=>s.brand==="Chromium"),Yr=!Ha&&qa,Nm=kh=(zn.brands.find(s=>s.brand==="Chromium")||{}).version||null,xh=zn.platform==="Windows");if(!qa){const s=D.navigator&&D.navigator.userAgent||"";Dm=/iPod/i.test(s),u0=(function(){const e=s.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null})(),Qr=/Android/i.test(s),c0=(function(){const e=s.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null})(),h0=/Firefox/i.test(s),Ha=/Edg/i.test(s),qa=/Chrome/i.test(s)||/CriOS/i.test(s),Yr=!Ha&&qa,Nm=kh=(function(){const e=s.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null})(),d0=(function(){const e=/MSIE\s(\d+)\.\d/.exec(s);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(s)&&/rv:11.0/.test(s)&&(t=11),t})(),Ac=/Tizen/i.test(s),Ic=/Web0S/i.test(s),Pc=Ac||Ic,kc=/Safari/i.test(s)&&!Yr&&!Qr&&!Ha&&!Pc,xh=/Windows/i.test(s),xc=/iPad/i.test(s)||kc&&Ol&&!/iPhone/i.test(s),Ah=/iPhone/i.test(s)&&!xc}const Pi=Ah||xc||Dm,Ih=(kc||Pi)&&!Yr;var f0=Object.freeze({__proto__:null,get IS_IPOD(){return Dm},get IOS_VERSION(){return u0},get IS_ANDROID(){return Qr},get ANDROID_VERSION(){return c0},get IS_FIREFOX(){return h0},get IS_EDGE(){return Ha},get IS_CHROMIUM(){return qa},get IS_CHROME(){return Yr},get CHROMIUM_VERSION(){return Nm},get CHROME_VERSION(){return kh},IS_CHROMECAST_RECEIVER:_A,get IE_VERSION(){return d0},get IS_SAFARI(){return kc},get IS_WINDOWS(){return xh},get IS_IPAD(){return xc},get IS_IPHONE(){return Ah},get IS_TIZEN(){return Ac},get IS_WEBOS(){return Ic},get IS_SMART_TV(){return Pc},TOUCH_ENABLED:Ol,IS_IOS:Pi,IS_ANY_SAFARI:Ih});function iy(s){return typeof s=="string"&&!!s.trim()}function TA(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function So(){return le===D.document}function Co(s){return Xr(s)&&s.nodeType===1}function p0(){try{return D.parent!==D.self}catch{return!0}}function m0(s){return function(e,t){if(!iy(e))return le[s](null);iy(t)&&(t=le.querySelector(t));const i=Co(t)?t:le;return i[s]&&i[s](e)}}function qe(s="div",e={},t={},i){const r=le.createElement(s);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?ns(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),i&&Lm(r,i),r}function ns(s,e){return typeof s.textContent>"u"?s.innerText=e:s.textContent=e,s}function yp(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function Sl(s,e){return TA(e),s.classList.contains(e)}function js(s,...e){return s.classList.add(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s}function Ph(s,...e){return s?(s.classList.remove(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s):(et.warn("removeClass was called with an element that doesn't exist"),null)}function g0(s,e,t){return typeof t=="function"&&(t=t(s,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(i=>s.classList.toggle(i,t)),s}function v0(s,e){Object.getOwnPropertyNames(e).forEach(function(t){const i=e[t];i===null||typeof i>"u"||i===!1?s.removeAttribute(t):s.setAttribute(t,i===!0?"":i)})}function Qn(s){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(s&&s.attributes&&s.attributes.length>0){const i=s.attributes;for(let r=i.length-1;r>=0;r--){const n=i[r].name;let a=i[r].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function y0(s,e){return s.getAttribute(e)}function ao(s,e,t){s.setAttribute(e,t)}function Dh(s,e){s.removeAttribute(e)}function _0(){le.body.focus(),le.onselectstart=function(){return!1}}function T0(){le.onselectstart=function(){return!0}}function oo(s){if(s&&s.getBoundingClientRect&&s.parentNode){const e=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(i=>{e[i]!==void 0&&(t[i]=e[i])}),t.height||(t.height=parseFloat(lo(s,"height"))),t.width||(t.width=parseFloat(lo(s,"width"))),t}}function Ml(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};const e=s.offsetWidth,t=s.offsetHeight;let i=0,r=0;for(;s.offsetParent&&s!==le[wc.fullscreenElement];)i+=s.offsetLeft,r+=s.offsetTop,s=s.offsetParent;return{left:i,top:r,width:e,height:t}}function Nh(s,e){const t={x:0,y:0};if(Pi){let c=s;for(;c&&c.nodeName.toLowerCase()!=="html";){const h=lo(c,"transform");if(/^matrix/.test(h)){const f=h.slice(7,-1).split(/,\s/).map(Number);t.x+=f[4],t.y+=f[5]}else if(/^matrix3d/.test(h)){const f=h.slice(9,-1).split(/,\s/).map(Number);t.x+=f[12],t.y+=f[13]}if(c.assignedSlot&&c.assignedSlot.parentElement&&D.WebKitCSSMatrix){const f=D.getComputedStyle(c.assignedSlot.parentElement).transform,g=new D.WebKitCSSMatrix(f);t.x+=g.m41,t.y+=g.m42}c=c.parentNode||c.host}}const i={},r=Ml(e.target),n=Ml(s),a=n.width,o=n.height;let l=e.offsetY-(n.top-r.top),u=e.offsetX-(n.left-r.left);return e.changedTouches&&(u=e.changedTouches[0].pageX-n.left,l=e.changedTouches[0].pageY+n.top,Pi&&(u-=t.x,l-=t.y)),i.y=1-Math.max(0,Math.min(1,l/o)),i.x=Math.max(0,Math.min(1,u/a)),i}function b0(s){return Xr(s)&&s.nodeType===3}function Lh(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function S0(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(e=>{if(typeof e=="function"&&(e=e()),Co(e)||b0(e))return e;if(typeof e=="string"&&/\S/.test(e))return le.createTextNode(e)}).filter(e=>e)}function Lm(s,e){return S0(e).forEach(t=>s.appendChild(t)),s}function C0(s,e){return Lm(Lh(s),e)}function Rl(s){return s.button===void 0&&s.buttons===void 0||s.button===0&&s.buttons===void 0||s.type==="mouseup"&&s.button===0&&s.buttons===0||s.type==="mousedown"&&s.button===0&&s.buttons===0?!0:!(s.button!==0||s.buttons!==1)}const es=m0("querySelector"),E0=m0("querySelectorAll");function lo(s,e){if(!s||!e)return"";if(typeof D.getComputedStyle=="function"){let t;try{t=D.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function w0(s){[...le.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),i=le.createElement("style");i.textContent=t,s.document.head.appendChild(i)}catch{const i=le.createElement("link");i.rel="stylesheet",i.type=e.type,i.media=e.media.mediaText,i.href=e.href,s.document.head.appendChild(i)}})}var k0=Object.freeze({__proto__:null,isReal:So,isEl:Co,isInFrame:p0,createEl:qe,textContent:ns,prependTo:yp,hasClass:Sl,addClass:js,removeClass:Ph,toggleClass:g0,setAttributes:v0,getAttributes:Qn,getAttribute:y0,setAttribute:ao,removeAttribute:Dh,blockTextSelection:_0,unblockTextSelection:T0,getBoundingClientRect:oo,findPosition:Ml,getPointerPosition:Nh,isTextNode:b0,emptyEl:Lh,normalizeContent:S0,appendContent:Lm,insertContent:C0,isSingleLeftClick:Rl,$:es,$$:E0,computedStyle:lo,copyStyleSheetsToWindow:w0});let x0=!1,_p;const bA=function(){if(_p.options.autoSetup===!1)return;const s=Array.prototype.slice.call(le.getElementsByTagName("video")),e=Array.prototype.slice.call(le.getElementsByTagName("audio")),t=Array.prototype.slice.call(le.getElementsByTagName("video-js")),i=s.concat(e,t);if(i&&i.length>0)for(let r=0,n=i.length;r<n;r++){const a=i[r];if(a&&a.getAttribute)a.player===void 0&&a.getAttribute("data-setup")!==null&&_p(a);else{Tp(1);break}}else x0||Tp(1)};function Tp(s,e){So()&&(e&&(_p=e),D.setTimeout(bA,s))}function bp(){x0=!0,D.removeEventListener("load",bp)}So()&&(le.readyState==="complete"?bp():D.addEventListener("load",bp));const A0=function(s){const e=le.createElement("style");return e.className=s,e},I0=function(s,e){s.styleSheet?s.styleSheet.cssText=e:s.textContent=e};var ki=new WeakMap;const SA=3;let CA=SA;function fr(){return CA++}function ry(s,e){if(!ki.has(s))return;const t=ki.get(s);t.handlers[e].length===0&&(delete t.handlers[e],s.removeEventListener?s.removeEventListener(e,t.dispatcher,!1):s.detachEvent&&s.detachEvent("on"+e,t.dispatcher)),Object.getOwnPropertyNames(t.handlers).length<=0&&(delete t.handlers,delete t.dispatcher,delete t.disabled),Object.getOwnPropertyNames(t).length===0&&ki.delete(s)}function Om(s,e,t,i){t.forEach(function(r){s(e,r,i)})}function Oh(s){if(s.fixed_)return s;function e(){return!0}function t(){return!1}if(!s||!s.isPropagationStopped||!s.isImmediatePropagationStopped){const i=s||D.event;s={};const r=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const n in i)r.includes(n)||n==="returnValue"&&i.preventDefault||(s[n]=i[n]);if(s.target||(s.target=s.srcElement||le),s.relatedTarget||(s.relatedTarget=s.fromElement===s.target?s.toElement:s.fromElement),s.preventDefault=function(){i.preventDefault&&i.preventDefault(),s.returnValue=!1,i.returnValue=!1,s.defaultPrevented=!0},s.defaultPrevented=!1,s.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),s.cancelBubble=!0,i.cancelBubble=!0,s.isPropagationStopped=e},s.isPropagationStopped=t,s.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),s.isImmediatePropagationStopped=e,s.stopPropagation()},s.isImmediatePropagationStopped=t,s.clientX!==null&&s.clientX!==void 0){const n=le.documentElement,a=le.body;s.pageX=s.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0),s.pageY=s.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}s.which=s.charCode||s.keyCode,s.button!==null&&s.button!==void 0&&(s.button=s.button&1?0:s.button&4?1:s.button&2?2:0)}return s.fixed_=!0,s}let $u;const EA=function(){if(typeof $u!="boolean"){$u=!1;try{const s=Object.defineProperty({},"passive",{get(){$u=!0}});D.addEventListener("test",null,s),D.removeEventListener("test",null,s)}catch{}}return $u},wA=["touchstart","touchmove"];function Zi(s,e,t){if(Array.isArray(e))return Om(Zi,s,e,t);ki.has(s)||ki.set(s,{});const i=ki.get(s);if(i.handlers||(i.handlers={}),i.handlers[e]||(i.handlers[e]=[]),t.guid||(t.guid=fr()),i.handlers[e].push(t),i.dispatcher||(i.disabled=!1,i.dispatcher=function(r,n){if(i.disabled)return;r=Oh(r);const a=i.handlers[r.type];if(a){const o=a.slice(0);for(let l=0,u=o.length;l<u&&!r.isImmediatePropagationStopped();l++)try{o[l].call(s,r,n)}catch(c){et.error(c)}}}),i.handlers[e].length===1)if(s.addEventListener){let r=!1;EA()&&wA.indexOf(e)>-1&&(r={passive:!0}),s.addEventListener(e,i.dispatcher,r)}else s.attachEvent&&s.attachEvent("on"+e,i.dispatcher)}function mi(s,e,t){if(!ki.has(s))return;const i=ki.get(s);if(!i.handlers)return;if(Array.isArray(e))return Om(mi,s,e,t);const r=function(a,o){i.handlers[o]=[],ry(a,o)};if(e===void 0){for(const a in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},a)&&r(s,a);return}const n=i.handlers[e];if(n){if(!t){r(s,e);return}if(t.guid)for(let a=0;a<n.length;a++)n[a].guid===t.guid&&n.splice(a--,1);ry(s,e)}}function Eo(s,e,t){const i=ki.has(s)?ki.get(s):{},r=s.parentNode||s.ownerDocument;if(typeof e=="string"?e={type:e,target:s}:e.target||(e.target=s),e=Oh(e),i.dispatcher&&i.dispatcher.call(s,e,t),r&&!e.isPropagationStopped()&&e.bubbles===!0)Eo.call(null,r,e,t);else if(!r&&!e.defaultPrevented&&e.target&&e.target[e.type]){ki.has(e.target)||ki.set(e.target,{});const n=ki.get(e.target);e.target[e.type]&&(n.disabled=!0,typeof e.target[e.type]=="function"&&e.target[e.type](),n.disabled=!1)}return!e.defaultPrevented}function Mh(s,e,t){if(Array.isArray(e))return Om(Mh,s,e,t);const i=function(){mi(s,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||fr(),Zi(s,e,i)}function Mm(s,e,t){const i=function(){mi(s,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||fr(),Zi(s,e,i)}var kA=Object.freeze({__proto__:null,fixEvent:Oh,on:Zi,off:mi,trigger:Eo,one:Mh,any:Mm});const pr=30,Et=function(s,e,t){e.guid||(e.guid=fr());const i=e.bind(s);return i.guid=t?t+"_"+e.guid:e.guid,i},Jr=function(s,e){let t=D.performance.now();return function(...r){const n=D.performance.now();n-t>=e&&(s(...r),t=n)}},P0=function(s,e,t,i=D){let r;const n=()=>{i.clearTimeout(r),r=null},a=function(){const o=this,l=arguments;let u=function(){r=null,u=null,t||s.apply(o,l)};!r&&t&&s.apply(o,l),i.clearTimeout(r),r=i.setTimeout(u,e)};return a.cancel=n,a};var xA=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:pr,bind_:Et,throttle:Jr,debounce:P0});let tl,er=class{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Zi(this,e,t),this.addEventListener=i}off(e,t){mi(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Mh(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Mm(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=Oh(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Eo(this,e)}queueTrigger(e){tl||(tl=new Map);const t=e.type||e;let i=tl.get(this);i||(i=new Map,tl.set(this,i));const r=i.get(t);i.delete(t),D.clearTimeout(r);const n=D.setTimeout(()=>{i.delete(t),i.size===0&&(i=null,tl.delete(this)),this.trigger(e)},0);i.set(t,n)}};er.prototype.allowedEvents_={};er.prototype.addEventListener=er.prototype.on;er.prototype.removeEventListener=er.prototype.off;er.prototype.dispatchEvent=er.prototype.trigger;const Rh=s=>typeof s.name=="function"?s.name():typeof s.name=="string"?s.name:s.name_?s.name_:s.constructor&&s.constructor.name?s.constructor.name:typeof s,Tn=s=>s instanceof er||!!s.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof s[e]=="function"),AA=(s,e)=>{Tn(s)?e():(s.eventedCallbacks||(s.eventedCallbacks=[]),s.eventedCallbacks.push(e))},Sp=s=>typeof s=="string"&&/\S/.test(s)||Array.isArray(s)&&!!s.length,Dc=(s,e,t)=>{if(!s||!s.nodeName&&!Tn(s))throw new Error(`Invalid target for ${Rh(e)}#${t}; must be a DOM node or evented object.`)},D0=(s,e,t)=>{if(!Sp(s))throw new Error(`Invalid event type for ${Rh(e)}#${t}; must be a non-empty string or array.`)},N0=(s,e,t)=>{if(typeof s!="function")throw new Error(`Invalid listener for ${Rh(e)}#${t}; must be a function.`)},af=(s,e,t)=>{const i=e.length<3||e[0]===s||e[0]===s.eventBusEl_;let r,n,a;return i?(r=s.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(r=e[0],n=e[1],a=e[2]),Dc(r,s,t),D0(n,s,t),N0(a,s,t),a=Et(s,a),{isTargetingSelf:i,target:r,type:n,listener:a}},ws=(s,e,t,i)=>{Dc(s,s,e),s.nodeName?kA[e](s,t,i):s[e](t,i)},IA={on(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=af(this,s,"on");if(ws(t,"on",i,r),!e){const n=()=>this.off(t,i,r);n.guid=r.guid;const a=()=>this.off("dispose",n);a.guid=r.guid,ws(this,"on","dispose",n),ws(t,"on","dispose",a)}},one(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=af(this,s,"one");if(e)ws(t,"one",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,ws(t,"one",i,n)}},any(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=af(this,s,"any");if(e)ws(t,"any",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,ws(t,"any",i,n)}},off(s,e,t){if(!s||Sp(s))mi(this.eventBusEl_,s,e);else{const i=s,r=e;Dc(i,this,"off"),D0(r,this,"off"),N0(t,this,"off"),t=Et(this,t),this.off("dispose",t),i.nodeName?(mi(i,r,t),mi(i,"dispose",t)):Tn(i)&&(i.off(r,t),i.off("dispose",t))}},trigger(s,e){Dc(this.eventBusEl_,this,"trigger");const t=s&&typeof s!="string"?s.type:s;if(!Sp(t))throw new Error(`Invalid event type for ${Rh(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Eo(this.eventBusEl_,s,e)}};function Rm(s,e={}){const{eventBusKey:t}=e;if(t){if(!s[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);s.eventBusEl_=s[t]}else s.eventBusEl_=qe("span",{className:"vjs-event-bus"});return Object.assign(s,IA),s.eventedCallbacks&&s.eventedCallbacks.forEach(i=>{i()}),s.on("dispose",()=>{s.off(),[s,s.el_,s.eventBusEl_].forEach(function(i){i&&ki.has(i)&&ki.delete(i)}),D.setTimeout(()=>{s.eventBusEl_=null},0)}),s}const PA={state:{},setState(s){typeof s=="function"&&(s=s());let e;return Va(s,(t,i)=>{this.state[i]!==t&&(e=e||{},e[i]={from:this.state[i],to:t}),this.state[i]=t}),e&&Tn(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function L0(s,e){return Object.assign(s,PA),s.state=Object.assign({},s.state,e),typeof s.handleStateChanged=="function"&&Tn(s)&&s.on("statechanged",s.handleStateChanged),s}const Cl=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toLowerCase())},Ht=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},O0=function(s,e){return Ht(s)===Ht(e)};var DA=Object.freeze({__proto__:null,toLowerCase:Cl,toTitleCase:Ht,titleCaseEquals:O0});let _e=class Ri{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Tt({},this.options_),t=this.options_=Tt(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${fr()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&(Rm(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),L0(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(i),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=Tt(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return qe(e,t,i)}localize(e,t,i=e){const r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],o=r&&r.split("-")[0],l=n&&n[o];let u=i;return a&&a[e]?u=a[e]:l&&l[e]&&(u=l[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(c,h){const f=t[h-1];let g=f;return typeof f>"u"&&(g=c),g})),u}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((i,r)=>i.concat(r),[]);let t=this;for(let i=0;i<e.length;i++)if(t=t.getChild(e[i]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const i="http://www.w3.org/2000/svg",r=qe("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=le.createElementNS(i,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const a=le.createElementNS(i,"use");return n.appendChild(a),a.setAttributeNS(null,"href",`#vjs-icon-${e}`),r.appendChild(n),this.iconIsSet_?t.replaceChild(r,t.querySelector(".vjs-icon-placeholder")):t.appendChild(r),this.iconIsSet_=!0,r}addChild(e,t={},i=this.children_.length){let r,n;if(typeof e=="string"){n=Ht(e);const a=t.componentClass||n;t.name=n;const o=Ri.getComponent(a);if(!o)throw new Error(`Component ${a} does not exist`);if(typeof o!="function")return null;r=new o(this.player_||this,t)}else r=e;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(i,0,r),r.parentComponent_=this,typeof r.id=="function"&&(this.childIndex_[r.id()]=r),n=n||r.name&&Ht(r.name()),n&&(this.childNameIndex_[n]=r,this.childNameIndex_[Cl(n)]=r),typeof r.el=="function"&&r.el()){let a=null;this.children_[i+1]&&(this.children_[i+1].el_?a=this.children_[i+1].el_:Co(this.children_[i+1])&&(a=this.children_[i+1])),this.contentEl().insertBefore(r.el(),a)}return r}removeChild(e){if(typeof e=="string"&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let r=this.children_.length-1;r>=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[Ht(e.name())]=null,this.childNameIndex_[Cl(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=a=>{const o=a.name;let l=a.opts;if(t[o]!==void 0&&(l=t[o]),l===!1)return;l===!0&&(l={}),l.playerOptions=this.options_.playerOptions;const u=this.addChild(o,l);u&&(this[o]=u)};let r;const n=Ri.getComponent("Tech");Array.isArray(e)?r=e:r=Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(o){return typeof o=="string"?a===o:a===o.name})})).map(a=>{let o,l;return typeof a=="string"?(o=a,l=e[o]||this.options_[o]||{}):(o=a.name,l=a),{name:o,opts:l}}).filter(a=>{const o=Ri.getComponent(a.opts.componentClass||Ht(a.name));return o&&!n.isTech(o)}).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return es(e,t||this.contentEl())}$$(e,t){return E0(e,t||this.contentEl())}hasClass(e){return Sl(this.el_,e)}addClass(...e){js(this.el_,...e)}removeClass(...e){Ph(this.el_,...e)}toggleClass(e,t){g0(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return y0(this.el_,e)}setAttribute(e,t){ao(this.el_,e,t)}removeAttribute(e){Dh(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(t!==void 0){(t===null||t!==t)&&(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:t==="auto"?this.el_.style[e]="":this.el_.style[e]=t+"px",i||this.trigger("componentresize");return}if(!this.el_)return 0;const r=this.el_.style[e],n=r.indexOf("px");return parseInt(n!==-1?r.slice(0,n):this.el_["offset"+Ht(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=lo(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const i=`offset${Ht(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},i={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:t,center:i}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const i=10,r=200;let n;this.on("touchstart",function(o){o.touches.length===1&&(t={pageX:o.touches[0].pageX,pageY:o.touches[0].pageY},e=D.performance.now(),n=!0)}),this.on("touchmove",function(o){if(o.touches.length>1)n=!1;else if(t){const l=o.touches[0].pageX-t.pageX,u=o.touches[0].pageY-t.pageY;Math.sqrt(l*l+u*u)>i&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(o){t=null,n===!0&&D.performance.now()-e<r&&(o.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=Et(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const i=function(r){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=Et(this,e),this.clearTimersOnDispose_(),i=D.setTimeout(()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),D.clearTimeout(e)),e}setInterval(e,t){e=Et(this,e),this.clearTimersOnDispose_();const i=D.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),D.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=Et(this,e),t=D.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=Et(this,t);const i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),D.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((i,r)=>this[t](r))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(n){const a=D.getComputedStyle(n,null),o=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(o)}function i(n){return!(!t(n.parentElement)||!t(n)||n.style.opacity==="0"||D.getComputedStyle(n).height==="0px"||D.getComputedStyle(n).width==="0px")}function r(n){if(n.offsetWidth+n.offsetHeight+n.getBoundingClientRect().height+n.getBoundingClientRect().width===0)return!1;const a={x:n.getBoundingClientRect().left+n.offsetWidth/2,y:n.getBoundingClientRect().top+n.offsetHeight/2};if(a.x<0||a.x>(le.documentElement.clientWidth||D.innerWidth)||a.y<0||a.y>(le.documentElement.clientHeight||D.innerHeight))return!1;let o=le.elementFromPoint(a.x,a.y);for(;o;){if(o===n)return!0;if(o.parentNode)o=o.parentNode;else return!1}}return e||(e=this.el()),!!(r(e)&&i(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=Ri.getComponent("Tech"),r=i&&i.isTech(t),n=Ri===t||Ri.prototype.isPrototypeOf(t.prototype);if(r||!n){let o;throw r?o="techs must be registered using Tech.registerTech()":o="must be a Component subclass",new Error(`Illegal component, "${e}"; ${o}.`)}e=Ht(e),Ri.components_||(Ri.components_={});const a=Ri.getComponent("Player");if(e==="Player"&&a&&a.players){const o=a.players,l=Object.keys(o);if(o&&l.length>0&&l.map(u=>o[u]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return Ri.components_[e]=t,Ri.components_[Cl(e)]=t,t}static getComponent(e){if(!(!e||!Ri.components_))return Ri.components_[e]}};_e.registerComponent("Component",_e);function NA(s,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${s}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function ny(s,e,t,i){return NA(s,i,t.length-1),t[i][e]}function of(s){let e;return s===void 0||s.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:s.length,start:ny.bind(null,"start",0,s),end:ny.bind(null,"end",1,s)},D.Symbol&&D.Symbol.iterator&&(e[D.Symbol.iterator]=()=>(s||[]).values()),e}function kr(s,e){return Array.isArray(s)?of(s):s===void 0||e===void 0?of():of([[s,e]])}const M0=function(s,e){s=s<0?0:s;let t=Math.floor(s%60),i=Math.floor(s/60%60),r=Math.floor(s/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(s)||s===1/0)&&(r=i=t="-"),r=r>0||a>0?r+":":"",i=((r||n>=10)&&i<10?"0"+i:i)+":",t=t<10?"0"+t:t,r+i+t};let Bm=M0;function R0(s){Bm=s}function B0(){Bm=M0}function Js(s,e=s){return Bm(s,e)}var LA=Object.freeze({__proto__:null,createTimeRanges:kr,createTimeRange:kr,setFormatTime:R0,resetFormatTime:B0,formatTime:Js});function F0(s,e){let t=0,i,r;if(!e)return 0;(!s||!s.length)&&(s=kr(0,0));for(let n=0;n<s.length;n++)i=s.start(n),r=s.end(n),r>e&&(r=e),t+=r-i;return t/e}function Rt(s){if(s instanceof Rt)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:Xr(s)&&(typeof s.code=="number"&&(this.code=s.code),Object.assign(this,s)),this.message||(this.message=Rt.defaultMessages[this.code]||"")}Rt.prototype.code=0;Rt.prototype.message="";Rt.prototype.status=null;Rt.prototype.metadata=null;Rt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Rt.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."};Rt.MEDIA_ERR_CUSTOM=0;Rt.prototype.MEDIA_ERR_CUSTOM=0;Rt.MEDIA_ERR_ABORTED=1;Rt.prototype.MEDIA_ERR_ABORTED=1;Rt.MEDIA_ERR_NETWORK=2;Rt.prototype.MEDIA_ERR_NETWORK=2;Rt.MEDIA_ERR_DECODE=3;Rt.prototype.MEDIA_ERR_DECODE=3;Rt.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Rt.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Rt.MEDIA_ERR_ENCRYPTED=5;Rt.prototype.MEDIA_ERR_ENCRYPTED=5;function El(s){return s!=null&&typeof s.then=="function"}function Vr(s){El(s)&&s.then(null,e=>{})}const Cp=function(s){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,i,r)=>(s[i]&&(t[i]=s[i]),t),{cues:s.cues&&Array.prototype.map.call(s.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},OA=function(s){const e=s.$$("track"),t=Array.prototype.map.call(e,r=>r.track);return Array.prototype.map.call(e,function(r){const n=Cp(r.track);return r.src&&(n.src=r.src),n}).concat(Array.prototype.filter.call(s.textTracks(),function(r){return t.indexOf(r)===-1}).map(Cp))},MA=function(s,e){return s.forEach(function(t){const i=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>i.addCue(r))}),e.textTracks()};var sy={textTracksToJson:OA,jsonToTextTracks:MA,trackToJson_:Cp};const lf="vjs-modal-dialog";let wo=class extends _e{constructor(e,t){super(e,t),this.handleKeyDown_=i=>this.handleKeyDown(i),this.close_=i=>this.close(i),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=qe("div",{className:`${lf}-content`},{role:"document"}),this.descEl_=qe("p",{className:`${lf}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),ns(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${lf} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const r=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),C0(t,e),this.trigger("modalfill"),r?i.insertBefore(t,r):i.appendChild(t);const n=this.getChild("closeButton");n&&i.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),Lh(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=le.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let r;for(let n=0;n<t.length;n++)if(i===t[n]){r=n;break}le.activeElement===this.el_&&(r=0),e.shiftKey&&r===0?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&r===t.length-1&&(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,t=>(t instanceof D.HTMLAnchorElement||t instanceof D.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof D.HTMLInputElement||t instanceof D.HTMLSelectElement||t instanceof D.HTMLTextAreaElement||t instanceof D.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof D.HTMLIFrameElement||t instanceof D.HTMLObjectElement||t instanceof D.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}};wo.prototype.options_={pauseOnOpen:!0,temporary:!0};_e.registerComponent("ModalDialog",wo);let uo=class extends er{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},Tn(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,r=this.length;i<r;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,r=this.length;i<r;i++){const n=this[i];if(n.id===e){t=n;break}}return t}};uo.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const s in uo.prototype.allowedEvents_)uo.prototype["on"+s]=null;const uf=function(s,e){for(let t=0;t<s.length;t++)!Object.keys(s[t]).length||e.id===s[t].id||(s[t].enabled=!1)};let RA=class extends uo{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){uf(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&uf(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,uf(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}};const cf=function(s,e){for(let t=0;t<s.length;t++)!Object.keys(s[t]).length||e.id===s[t].id||(s[t].selected=!1)};let BA=class extends uo{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){cf(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set(){}})}addTrack(e){e.selected&&cf(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,cf(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}},U0=class extends uo{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}},FA=class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),this.trackElements_.indexOf(e)===-1&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let i=0,r=this.trackElements_.length;i<r;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&typeof this.trackElements_[t].track.off=="function"&&this.trackElements_[t].track.off(),typeof this.trackElements_[t].off=="function"&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}},ay=class $0{constructor(e){$0.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let i=0;const r=e.length;this.cues_=e,this.length_=e.length;const n=function(a){""+a in this||Object.defineProperty(this,""+a,{get(){return this.cues_[a]}})};if(t<r)for(i=t;i<r;i++)n.call(this,i)}getCueById(e){let t=null;for(let i=0,r=this.length;i<r;i++){const n=this[i];if(n.id===e){t=n;break}}return t}};const UA={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},$A={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},jA={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},oy={disabled:"disabled",hidden:"hidden",showing:"showing"};let Fm=class extends er{constructor(e={}){super();const t={id:e.id||"vjs_track_"+fr(),kind:e.kind||"",language:e.language||""};let i=e.label||"";for(const r in t)Object.defineProperty(this,r,{get(){return t[r]},set(){}});Object.defineProperty(this,"label",{get(){return i},set(r){r!==i&&(i=r,this.trigger("labelchange"))}})}};const Um=function(s){return new URL(s,le.baseURI)},j0=function(s){return new URL(s,le.baseURI).href},$m=function(s){if(typeof s=="string"){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(s);if(t)return t.pop().toLowerCase()}return""},Bh=function(s,e=D.location){return Um(s).origin!==e.origin};var VA=Object.freeze({__proto__:null,parseUrl:Um,getAbsoluteURL:j0,getFileExtension:$m,isCrossOrigin:Bh});const ly=function(s,e){const t=new D.WebVTT.Parser(D,D.vttjs,D.WebVTT.StringDecoder()),i=[];t.oncue=function(r){e.addCue(r)},t.onparsingerror=function(r){i.push(r)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(s),i.length>0&&(D.console&&D.console.groupCollapsed&&D.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),i.forEach(r=>et.error(r)),D.console&&D.console.groupEnd&&D.console.groupEnd()),t.flush()},uy=function(s,e){const t={uri:s},i=Bh(s);i&&(t.cors=i);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),Vb(t,Et(this,function(n,a,o){if(n)return et.error(n,a);e.loaded_=!0,typeof D.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],l=>{if(l.type==="vttjserror"){et.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return ly(o,e)}):ly(o,e)}))};let Gl=class extends Fm{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Tt(e,{kind:jA[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=oy[t.mode]||"disabled";const r=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new ay(this.cues_),a=new ay(this.activeCues_);let o=!1;this.timeupdateHandler=Et(this,function(u={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){u.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1),u.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const l=()=>{this.stopTracking()};this.tech_.one("dispose",l),i!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return i},set(u){oy[u]&&i!==u&&(i=u,!this.preload_&&i!=="disabled"&&this.cues.length===0&&uy(this.src,this),this.stopTracking(),i!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const u=this.tech_.currentTime(),c=[];for(let h=0,f=this.cues.length;h<f;h++){const g=this.cues[h];g.startTime<=u&&g.endTime>=u&&c.push(g)}if(o=!1,c.length!==this.activeCues_.length)o=!0;else for(let h=0;h<c.length;h++)this.activeCues_.indexOf(c[h])===-1&&(o=!0);return this.activeCues_=c,a.setCues_(this.activeCues_),a},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||t.kind!=="subtitles"&&t.kind!=="captions")&&uy(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new D.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const r in e)r in t||(t[r]=e[r]);t.id=e.id,t.originalCue_=e}const i=this.tech_.textTracks();for(let r=0;r<i.length;r++)i[r]!==this&&i[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;for(;t--;){const i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}};Gl.prototype.allowedEvents_={cuechange:"cuechange"};let V0=class extends Fm{constructor(e={}){const t=Tt(e,{kind:$A[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"enabled",{get(){return i},set(r){typeof r!="boolean"||r===i||(i=r,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}},H0=class extends Fm{constructor(e={}){const t=Tt(e,{kind:UA[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get(){return i},set(r){typeof r!="boolean"||r===i||(i=r,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}},ko=class Ep extends er{constructor(e={}){super();let t;const i=new Gl(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return i}}}),t=Ep.NONE,i.addEventListener("loadeddata",()=>{t=Ep.LOADED,this.trigger({type:"load",target:this})})}};ko.prototype.allowedEvents_={load:"load"};ko.NONE=0;ko.LOADING=1;ko.LOADED=2;ko.ERROR=3;const hr={audio:{ListClass:RA,TrackClass:V0,capitalName:"Audio"},video:{ListClass:BA,TrackClass:H0,capitalName:"Video"},text:{ListClass:U0,TrackClass:Gl,capitalName:"Text"}};Object.keys(hr).forEach(function(s){hr[s].getterName=`${s}Tracks`,hr[s].privateName=`${s}Tracks_`});const co={remoteText:{ListClass:U0,TrackClass:Gl,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:FA,TrackClass:ko,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Ci=Object.assign({},hr,co);co.names=Object.keys(co);hr.names=Object.keys(hr);Ci.names=[].concat(co.names).concat(hr.names);function HA(s,e,t,i,r={}){const n=s.textTracks();r.kind=e,t&&(r.label=t),i&&(r.language=i),r.tech=s;const a=new Ci.text.TrackClass(r);return n.addTrack(a),a}let bt=class di extends _e{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=i=>this.onDurationChange(i),this.trackProgress_=i=>this.trackProgress(i),this.trackCurrentTime_=i=>this.trackCurrentTime(i),this.stopTrackingCurrentTime_=i=>this.stopTrackingCurrentTime(i),this.disposeSourceHandler_=i=>this.disposeSourceHandler(i),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),Ci.names.forEach(i=>{const r=Ci[i];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(i=>{e[`native${i}Tracks`]===!1&&(this[`featuresNative${i}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new Ci.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Et(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return kr(0,0)}bufferedPercent(){return F0(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(hr.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const i=this[`${t}Tracks`]()||[];let r=i.length;for(;r--;){const n=i[r];t==="text"&&this.removeRemoteTextTrack(n),i.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new Rt(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?kr(0,0):kr()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){hr.names.forEach(e=>{const t=hr[e],i=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),this.on("dispose",()=>{r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!D.WebVTT)if(le.body.contains(this.el())){if(!this.options_["vtt.js"]&&so(eo)&&Object.keys(eo).length>0){this.trigger("vttjsloaded");return}const e=le.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),D.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=o=>e.addTrack(o.track),r=o=>e.removeTrack(o.track);t.on("addtrack",i),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let o=0;o<e.length;o++){const l=e[o];l.removeEventListener("cuechange",n),l.mode==="showing"&&l.addEventListener("cuechange",n)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",function(){t.off("addtrack",i),t.off("removetrack",r),e.removeEventListener("change",a),e.removeEventListener("addtrack",a),e.removeEventListener("removetrack",a);for(let o=0;o<e.length;o++)e[o].removeEventListener("cuechange",n)})}addTextTrack(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return HA(this,e,t,i)}createRemoteTextTrack(e){const t=Tt(e,{tech:this});return new co.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const i=this.createRemoteTextTrack(e);return typeof t!="boolean"&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=fr();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return di.canPlayType(e.type)}static isTech(e){return e.prototype instanceof di||e instanceof di||e===di}static registerTech(e,t){if(di.techs_||(di.techs_={}),!di.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!di.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!di.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Ht(e),di.techs_[e]=t,di.techs_[Cl(e)]=t,e!=="Tech"&&di.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(di.techs_&&di.techs_[e])return di.techs_[e];if(e=Ht(e),D&&D.videojs&&D.videojs[e])return et.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),D.videojs[e]}}};Ci.names.forEach(function(s){const e=Ci[s];bt.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});bt.prototype.featuresVolumeControl=!0;bt.prototype.featuresMuteControl=!0;bt.prototype.featuresFullscreenResize=!1;bt.prototype.featuresPlaybackRate=!1;bt.prototype.featuresProgressEvents=!1;bt.prototype.featuresSourceset=!1;bt.prototype.featuresTimeupdateEvents=!1;bt.prototype.featuresNativeTextTracks=!1;bt.prototype.featuresVideoFrameCallback=!1;bt.withSourceHandlers=function(s){s.registerSourceHandler=function(t,i){let r=s.sourceHandlers;r||(r=s.sourceHandlers=[]),i===void 0&&(i=r.length),r.splice(i,0,t)},s.canPlayType=function(t){const i=s.sourceHandlers||[];let r;for(let n=0;n<i.length;n++)if(r=i[n].canPlayType(t),r)return r;return""},s.selectSourceHandler=function(t,i){const r=s.sourceHandlers||[];let n;for(let a=0;a<r.length;a++)if(n=r[a].canHandleSource(t,i),n)return r[a];return null},s.canPlaySource=function(t,i){const r=s.selectSourceHandler(t,i);return r?r.canHandleSource(t,i):""},["seekable","seeking","duration"].forEach(function(t){const i=this[t];typeof i=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):i.apply(this,arguments)})},s.prototype),s.prototype.setSource=function(t){let i=s.selectSourceHandler(t,this.options_);i||(s.nativeSourceHandler?i=s.nativeSourceHandler:et.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==s.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},s.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}};_e.registerComponent("Tech",bt);bt.registerTech("Tech",bt);bt.defaultTechOrder_=[];const Vs={},Nc={},Lc={};function qA(s,e){Vs[s]=Vs[s]||[],Vs[s].push(e)}function zA(s,e,t){s.setTimeout(()=>xs(e,Vs[e.type],t,s),1)}function WA(s,e){s.forEach(t=>t.setTech&&t.setTech(e))}function GA(s,e,t){return s.reduceRight(jm(t),e[t]())}function KA(s,e,t,i){return e[t](s.reduce(jm(t),i))}function cy(s,e,t,i=null){const r="call"+Ht(t),n=s.reduce(jm(r),i),a=n===Lc,o=a?null:e[t](n);return YA(s,t,o,a),o}const XA={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},QA={setCurrentTime:1,setMuted:1,setVolume:1},hy={play:1,pause:1};function jm(s){return(e,t)=>e===Lc?Lc:t[s]?t[s](e):e}function YA(s,e,t,i){for(let r=s.length-1;r>=0;r--){const n=s[r];n[e]&&n[e](i,t)}}function JA(s){Nc.hasOwnProperty(s.id())&&delete Nc[s.id()]}function ZA(s,e){const t=Nc[s.id()];let i=null;if(t==null)return i=e(s),Nc[s.id()]=[[e,i]],i;for(let r=0;r<t.length;r++){const[n,a]=t[r];n===e&&(i=a)}return i===null&&(i=e(s),t.push([e,i])),i}function xs(s={},e=[],t,i,r=[],n=!1){const[a,...o]=e;if(typeof a=="string")xs(s,Vs[a],t,i,r,n);else if(a){const l=ZA(i,a);if(!l.setSource)return r.push(l),xs(s,o,t,i,r,n);l.setSource(Object.assign({},s),function(u,c){if(u)return xs(s,o,t,i,r,n);r.push(l),xs(c,s.type===c.type?o:Vs[c.type],t,i,r,n)})}else o.length?xs(s,o,t,i,r,n):n?t(s,r):xs(s,Vs["*"],t,i,r,!0)}const eI={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Oc=function(s=""){const e=$m(s);return eI[e.toLowerCase()]||""},tI=(s,e)=>{if(!e)return"";if(s.cache_.source.src===e&&s.cache_.source.type)return s.cache_.source.type;const t=s.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const i=s.$$("source");for(let r=0;r<i.length;r++){const n=i[r];if(n.type&&n.src&&n.src===e)return n.type}return Oc(e)},q0=function(s){if(Array.isArray(s)){let e=[];s.forEach(function(t){t=q0(t),Array.isArray(t)?e=e.concat(t):Xr(t)&&e.push(t)}),s=e}else typeof s=="string"&&s.trim()?s=[dy({src:s})]:Xr(s)&&typeof s.src=="string"&&s.src&&s.src.trim()?s=[dy(s)]:s=[];return s};function dy(s){if(!s.type){const e=Oc(s.src);e&&(s.type=e)}return s}var iI=`<svg xmlns="http://www.w3.org/2000/svg">
34
+ <defs>
35
+ <symbol viewBox="0 0 48 48" id="vjs-icon-play">
36
+ <path d="M16 10v28l22-14z"></path>
37
+ </symbol>
38
+ <symbol viewBox="0 0 48 48" id="vjs-icon-pause">
39
+ <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>
40
+ </symbol>
41
+ <symbol viewBox="0 0 48 48" id="vjs-icon-audio">
42
+ <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>
43
+ </symbol>
44
+ <symbol viewBox="0 0 48 48" id="vjs-icon-captions">
45
+ <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>
46
+ </symbol>
47
+ <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">
48
+ <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>
49
+ </symbol>
50
+ <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">
51
+ <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>
52
+ </symbol>
53
+ <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">
54
+ <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>
55
+ </symbol>
56
+ <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">
57
+ <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
58
+ </symbol>
59
+ <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">
60
+ <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>
61
+ </symbol>
62
+ <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">
63
+ <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>
64
+ </symbol>
65
+ <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">
66
+ <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>
67
+ </symbol>
68
+ <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">
69
+ <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>
70
+ </symbol>
71
+ <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">
72
+ <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>
73
+ </symbol>
74
+ <symbol viewBox="0 0 24 24" id="vjs-icon-hd">
75
+ <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>
76
+ </symbol>
77
+ <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">
78
+ <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>
79
+ </symbol>
80
+ <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">
81
+ <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>
82
+ </symbol>
83
+ <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">
84
+ <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>
85
+ </symbol>
86
+ <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">
87
+ <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>
88
+ </symbol>
89
+ <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">
90
+ <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>
91
+ </symbol>
92
+ <symbol viewBox="0 0 48 48" id="vjs-icon-share">
93
+ <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>
94
+ </symbol>
95
+ <symbol viewBox="0 0 48 48" id="vjs-icon-cog">
96
+ <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>
97
+ </symbol>
98
+ <symbol viewBox="0 0 48 48" id="vjs-icon-square">
99
+ <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>
100
+ </symbol>
101
+ <symbol viewBox="0 0 48 48" id="vjs-icon-circle">
102
+ <circle cx="24" cy="24" r="20"></circle>
103
+ </symbol>
104
+ <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">
105
+ <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
106
+ </symbol>
107
+ <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">
108
+ <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>
109
+ </symbol>
110
+ <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">
111
+ <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>
112
+ </symbol>
113
+ <symbol viewBox="0 0 48 48" id="vjs-icon-replay">
114
+ <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>
115
+ </symbol>
116
+ <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">
117
+ <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>
118
+ </symbol>
119
+ <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">
120
+ <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>
121
+ </symbol>
122
+ <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">
123
+ <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>
124
+ </symbol>
125
+ <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">
126
+ <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>
127
+ </symbol>
128
+ <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">
129
+ <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>
130
+ </symbol>
131
+ <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">
132
+ <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>
133
+ </symbol>
134
+ <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">
135
+ <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>
136
+ </symbol>
137
+ <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">
138
+ <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>
139
+ </symbol>
140
+ <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">
141
+ <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>
142
+ </symbol>
143
+ <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">
144
+ <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>
145
+ </symbol>
146
+ <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">
147
+ <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>
148
+ </symbol>
149
+ <symbol viewBox="0 0 48 48" id="vjs-icon-cast">
150
+ <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>
151
+ </symbol>
152
+ <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">
153
+ <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>
154
+ </symbol>
155
+ <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">
156
+ <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>
157
+ <path fill="none" d="M-1-3h24v24H-1z"></path>
158
+ </symbol>
159
+ <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">
160
+ <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>
161
+ </symbol>
162
+ <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">
163
+ <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>
164
+ </symbol>
165
+ <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">
166
+ <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>
167
+ </symbol>
168
+ <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">
169
+ <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>
170
+ </symbol>
171
+ <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">
172
+ <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>
173
+ </symbol>
174
+ </defs>
175
+ </svg>`;const fy=Ac?10009:Ic?461:8,wa={codes:{play:415,pause:19,ff:417,rw:412,back:fy},names:{415:"play",19:"pause",417:"ff",412:"rw",[fy]:"back"},isEventKey(s,e){return e=e.toLowerCase(),!!(this.names[s.keyCode]&&this.names[s.keyCode]===e)},getEventName(s){if(this.names[s.keyCode])return this.names[s.keyCode];if(this.codes[s.code]){const e=this.codes[s.code];return this.names[e]}return null}},py=5;class rI extends er{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const i=t.key.substring(5).toLowerCase();this.move(i)}else if(wa.isEventKey(t,"play")||wa.isEventKey(t,"pause")||wa.isEventKey(t,"ff")||wa.isEventKey(t,"rw")){t.preventDefault();const i=wa.getEventName(t);this.performMediaAction_(i)}else wa.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+py);break;case"rw":this.userSeek_(this.player_.currentTime()-py);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let i=null;const r=this.getCurrentComponent(e.target);t&&(i=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!i||!t)&&(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function i(r){for(const n of r)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&i(n.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_"))if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())){t.push(r);return}else r.hasOwnProperty("children_")&&r.children_.length>0?i(r.children_):r.hasOwnProperty("items")&&r.items.length>0?i(r.items):this.findSuitableDOMChild(r)&&t.push(r);if(r.name_==="ErrorDisplay"&&r.opened_){const n=r.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((o,l)=>{t.push({name:()=>"ModalButton"+(l+1),el:()=>o,getPositions:()=>{const u=o.getBoundingClientRect(),c={x:u.x,y:u.y,width:u.width,height:u.height,top:u.top,right:u.right,bottom:u.bottom,left:u.left},h={x:u.left+u.width/2,y:u.top+u.height/2,width:0,height:0,top:u.top+u.height/2,right:u.left+u.width/2,bottom:u.top+u.height/2,left:u.left+u.width/2};return{boundingClientRect:c,center:h}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:u=>!0,focus:()=>o.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let r=0;r<i.children.length;r++){const n=i.children[r],a=t(n);if(a)return a}return null}return e.el()?t(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||document.activeElement;if(this.focusableComponents.length){for(const i of this.focusableComponents)if(i.el()===t)return i}}add(e){const t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name()){this.focusableComponents.splice(t,1),this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents});return}}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const i=t.getPositions(),r=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(i.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(i.center,r,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,i){let r=1/0,n=null;for(const a of t){const o=a.getPositions().center,l=this.calculateDistance_(e,o,i);l<r&&(r=l,n=a)}return n}isInDirection_(e,t,i){switch(i){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name()){this.focus(this.focusableComponents[e]);return}}else this.focus(this.updateFocusableComponents()[0])}focus(e){typeof e=="object"&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,i){const r=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);let a;switch(i){case"right":case"left":a=r+n*100;break;case"up":a=n*2+r*.5;break;case"down":a=n*5+r;break;default:a=r+n}return a}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents())if(t.constructor.name==="TextTrackSelect"){e.focus(t);break}}}let nI=class extends _e{constructor(e,t,i){const r=Tt({createEl:!1},t);if(super(e,r,i),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,a=t.playerOptions.techOrder;n<a.length;n++){const o=Ht(a[n]);let l=bt.getTech(o);if(o||(l=_e.getComponent(o)),l&&l.isSupported()){e.loadTech_(o);break}}else e.src(t.playerOptions.sources)}};_e.registerComponent("MediaLoader",nI);let Fh=class extends _e{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=i=>this.handleMouseOver(i),this.handleMouseOut_=i=>this.handleMouseOut(i),this.handleClick_=i=>this.handleClick(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&et.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const r=qe(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(qe("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=qe("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,ns(this.controlTextEl_,i),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}};_e.registerComponent("ClickableComponent",Fh);let wp=class extends Fh{constructor(e,t){super(e,t),this.update(),this.update_=i=>this.update(i),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return qe("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(qe("picture",{className:"vjs-poster",tabIndex:-1},{},qe("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?Vr(this.player_.play()):this.player_.pause())}};wp.prototype.crossorigin=wp.prototype.crossOrigin;_e.registerComponent("PosterImage",wp);const lr="#222",my="#ccc",sI={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function hf(s,e){let t;if(s.length===4)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else if(s.length===7)t=s.slice(1);else throw new Error("Invalid color code provided, "+s+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function Br(s,e,t){try{s.style[e]=t}catch{return}}function gy(s){return s?`${s}px`:""}let aI=class extends _e{constructor(e,t,i){super(e,t,i);const r=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(Et(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=D.screen.orientation||D,o=D.screen.orientation?"change":"orientationchange";a.addEventListener(o,n),e.on("dispose",()=>a.removeEventListener(o,n));const l=this.options_.playerOptions.tracks||[];for(let u=0;u<l.length;u++)this.player_.addRemoteTextTrack(l[u],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let r,n,a;for(let o=0;o<t.length;o++){const l=t[o];i&&i.enabled&&i.language&&i.language===l.language&&l.kind in e?l.kind===i.kind?a=l:a||(a=l):i&&!i.enabled?(a=null,r=null,n=null):l.default&&(l.kind==="descriptions"&&!r?r=l:l.kind in e&&!n&&(n=l))}a?a.mode="showing":n?n.mode="showing":r&&(r.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){typeof D.WebVTT=="function"&&D.WebVTT.processCues(D,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const a=[];for(let o=0;o<e.length;++o){const l=e[o];l.mode==="showing"&&a.push(l)}this.updateForTrack(a);return}let i=null,r=null,n=e.length;for(;n--;){const a=e[n];a.mode==="showing"&&(a.kind==="descriptions"?i=a:r=a)}if(r?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(r)):i&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i)),!D.CSS.supports("inset","10px")){const a=this.el_,o=a.querySelectorAll(".vjs-text-track-cue"),l=this.player_.controlBar.el_.getBoundingClientRect().height,u=this.player_.el_.getBoundingClientRect().height;a.style="",Br(a,"position","relative"),Br(a,"height",u-l+"px"),Br(a,"top","unset"),Pc?Br(a,"bottom",u+"px"):Br(a,"bottom","0px"),o.length>0&&o.forEach(c=>{if(c.style.inset){const h=c.style.inset.split(" ");h.length===3&&Object.assign(c.style,{top:h[0],right:h[1],bottom:h[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!D.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(i-r)>.1&&(i>r?n=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),Br(this.el_,"insetInline",gy(n)),Br(this.el_,"insetBlock",gy(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let r=i.length;for(;r--;){const n=i[r];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&Br(a.firstChild,"color",hf(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Br(a.firstChild,"backgroundColor",hf(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Br(a,"backgroundColor",hf(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${lr}, 2px 2px 4px ${lr}, 2px 2px 5px ${lr}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${lr}, 2px 2px ${lr}, 3px 3px ${lr}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${my}, 0 1px ${my}, -1px -1px ${lr}, 0 -1px ${lr}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${lr}, 0 0 4px ${lr}, 0 0 4px ${lr}, 0 0 4px ${lr}`)),t.fontPercent&&t.fontPercent!==1){const o=D.parseFloat(a.style.fontSize);a.style.fontSize=o*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=sI[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof D.WebVTT!="function"||e.every(i=>!i.activeCues))return;const t=[];for(let i=0;i<e.length;++i){const r=e[i];for(let n=0;n<r.activeCues.length;++n)t.push(r.activeCues[n])}D.WebVTT.processCues(D,t,this.el_);for(let i=0;i<e.length;++i){const r=e[i];for(let n=0;n<r.activeCues.length;++n){const a=r.activeCues[n].displayState;js(a,"vjs-text-track-cue","vjs-text-track-cue-"+(r.language?r.language:i)),r.language&&ao(a,"lang",r.language)}this.player_.textTrackSettings&&this.updateDisplayState(r)}}};_e.registerComponent("TextTrackDisplay",aI);let oI=class extends _e{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),i=qe("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),r=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(i),r}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}};_e.registerComponent("LoadingSpinner",oI);let gi=class extends Fh{createEl(e,t={},i={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i);const r=qe(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(qe("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){const i=this.constructor.name;return et.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),_e.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(e.key===" "||e.key==="Enter"){e.stopPropagation();return}super.handleKeyDown(e)}};_e.registerComponent("Button",gi);let z0=class extends gi{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",i=>this.handleMouseDown(i))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){Vr(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const i=this.player_.getChild("controlBar"),r=i&&i.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}const n=()=>r.focus();El(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}};z0.prototype.controlText_="Play Video";_e.registerComponent("BigPlayButton",z0);let lI=class extends gi{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}};_e.registerComponent("CloseButton",lI);let W0=class extends gi{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",i=>this.handlePlay(i)),this.on(e,"pause",i=>this.handlePause(i)),t.replay&&this.on(e,"ended",i=>this.handleEnded(i))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Vr(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}};W0.prototype.controlText_="Play";_e.registerComponent("PlayToggle",W0);let xo=class extends _e{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],i=>this.update(i)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=qe("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(i),this.contentEl_=qe("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=Js(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,et.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=le.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}};xo.prototype.labelText_="Time";xo.prototype.controlText_="Time";_e.registerComponent("TimeDisplay",xo);let Vm=class extends xo{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}};Vm.prototype.labelText_="Current Time";Vm.prototype.controlText_="Current Time";_e.registerComponent("CurrentTimeDisplay",Vm);let Hm=class extends xo{constructor(e,t){super(e,t);const i=r=>this.updateContent(r);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}};Hm.prototype.labelText_="Duration";Hm.prototype.controlText_="Duration";_e.registerComponent("DurationDisplay",Hm);let uI=class extends _e{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}};_e.registerComponent("TimeDivider",uI);let qm=class extends xo{constructor(e,t){super(e,t),this.on(e,"durationchange",i=>this.updateContent(i))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(qe("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}};qm.prototype.labelText_="Remaining Time";qm.prototype.controlText_="Remaining Time";_e.registerComponent("RemainingTimeDisplay",qm);let cI=class extends _e{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",i=>this.updateShowing(i))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=qe("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(qe("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(le.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}};_e.registerComponent("LiveDisplay",cI);let G0=class extends gi{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=i=>this.updateLiveEdgeStatus(i),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=qe("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}};G0.prototype.controlText_="Seek to live, currently playing live";_e.registerComponent("SeekToLive",G0);function Kl(s,e,t){return s=Number(s),Math.min(t,Math.max(e,isNaN(s)?e:s))}var hI=Object.freeze({__proto__:null,clamp:Kl});let zm=class extends _e{constructor(e,t){super(e,t),this.handleMouseDown_=i=>this.handleMouseDown(i),this.handleMouseUp_=i=>this.handleMouseUp(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.handleClick_=i=>this.handleClick(i),this.handleMouseMove_=i=>this.handleMouseMove(i),this.update_=i=>this.update(i),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!Yr&&e.preventDefault(),_0(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;T0(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(Kl(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Nh(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,r=t&&t.horizontalSeek;i?r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}};_e.registerComponent("Slider",zm);const df=(s,e)=>Kl(s/e*100,0,100).toFixed(2)+"%";let dI=class extends _e{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",i=>this.update(i))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=qe("span",{className:"vjs-control-text"}),i=qe("span",{textContent:this.localize("Loaded")}),r=le.createTextNode(": ");return this.percentageEl_=qe("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,i=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,o=df(n,r);this.percent_!==o&&(this.el_.style.width=o,ns(this.percentageEl_,o),this.percent_=o);for(let l=0;l<i.length;l++){const u=i.start(l),c=i.end(l);let h=a[l];h||(h=this.el_.appendChild(qe()),a[l]=h),!(h.dataset.start===u&&h.dataset.end===c)&&(h.dataset.start=u,h.dataset.end=c,h.style.left=df(u,n),h.style.width=df(c-u,n))}for(let l=a.length;l>i.length;l--)this.el_.removeChild(a[l-1]);a.length=i.length})}};_e.registerComponent("LoadProgressBar",dI);let fI=class extends _e{constructor(e,t){super(e,t),this.update=Jr(Et(this,this.update),pr)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const r=Ml(this.el_),n=oo(this.player_.el()),a=e.width*t;if(!n||!r)return;let o=e.left-n.left+a,l=e.width-a+(n.right-e.right);l||(l=e.width-a,o=a);let u=r.width/2;o<u?u+=u-o:l<u&&(u=l),u<0?u=0:u>r.width&&(u=r.width),u=Math.round(u),this.el_.style.right=`-${u}px`,this.write(i)}write(e){ns(this.el_,e)}updateTime(e,t,i,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const o=this.player_.liveTracker.liveWindow(),l=o-t*o;n=(l<1?"":"-")+Js(l,o)}else n=Js(i,a);this.update(e,t,n),r&&r()})}};_e.registerComponent("TimeTooltip",fI);let Wm=class extends _e{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=Jr(Et(this,this.update),pr)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const i=this.getChild("timeTooltip");if(!i)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,r)}};Wm.prototype.options_={children:[]};!Pi&&!Qr&&Wm.prototype.options_.children.push("timeTooltip");_e.registerComponent("PlayProgressBar",Wm);let K0=class extends _e{constructor(e,t){super(e,t),this.update=Jr(Et(this,this.update),pr)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=`${e.width*t}px`})}};K0.prototype.options_={children:["timeTooltip"]};_e.registerComponent("MouseTimeDisplay",K0);const ju=5,vy=12;let Gm=class extends zm{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=Et(this,this.update),this.update=Jr(this.update_,pr),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in le&&"visibilityState"in le&&this.on(le,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){le.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,pr))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(le.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const i=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let n=this.player_.duration();r&&r.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==i||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Js(i,n),Js(n,n)],"{1} of {2}")),this.currentTime_=i,this.duration_=n),this.bar&&this.bar.update(oo(this.el()),this.getProgress())}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){Rl(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!Rl(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let i;const r=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())i=r*this.player_.duration(),i===this.player_.duration()&&(i=i-.1);else{if(r>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),o=n.liveCurrentTime();if(i=a+r*n.liveWindow(),i>=o&&(i=o),i<=a&&(i=a+.1),i===1/0)return}this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Vr(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+ju)}stepBack(){this.userSeek_(this.player_.currentTime()-ju)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const i=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-ju*vy)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+ju*vy)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in le&&"visibilityState"in le&&this.off(le,"visibilitychange",this.toggleVisibility_),super.dispose()}};Gm.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!Pi&&!Qr&&Gm.prototype.options_.children.splice(1,0,"mouseTimeDisplay");_e.registerComponent("SeekBar",Gm);let X0=class extends _e{constructor(e,t){super(e,t),this.handleMouseMove=Jr(Et(this,this.handleMouseMove),pr),this.throttledHandleMouseSeek=Jr(Et(this,this.handleMouseSeek),pr),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.handleMouseDownHandler_=i=>this.handleMouseDown(i),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!i&&!r)return;const n=t.el(),a=Ml(n);let o=Nh(n,e).x;o=Kl(o,0,1),r&&r.update(a,o),i&&i.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Vr(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}};X0.prototype.options_={children:["seekBar"]};_e.registerComponent("ProgressControl",X0);let Q0=class extends gi{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],i=>this.handlePictureInPictureChange(i)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],i=>this.handlePictureInPictureEnabledChange(i)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){le.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in D?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof le.exitPictureInPicture=="function"&&super.show()}};Q0.prototype.controlText_="Picture-in-Picture";_e.registerComponent("PictureInPictureToggle",Q0);let Y0=class extends gi{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",i=>this.handleFullscreenChange(i)),le[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}};Y0.prototype.controlText_="Fullscreen";_e.registerComponent("FullscreenToggle",Y0);const pI=function(s,e){e.tech_&&!e.tech_.featuresVolumeControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};let mI=class extends _e{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}};_e.registerComponent("VolumeLevel",mI);let gI=class extends _e{constructor(e,t){super(e,t),this.update=Jr(Et(this,this.update),pr)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,r){if(!i){const n=oo(this.el_),a=oo(this.player_.el()),o=e.width*t;if(!a||!n)return;const l=e.left-a.left+o,u=e.width-o+(a.right-e.right);let c=n.width/2;l<c?c+=c-l:u<c&&(c=u),c<0?c=0:c>n.width&&(c=n.width),this.el_.style.right=`-${c}px`}this.write(`${r}%`)}write(e){ns(this.el_,e)}updateVolume(e,t,i,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,r.toFixed(0)),n&&n()})}};_e.registerComponent("VolumeLevelTooltip",gI);let J0=class extends _e{constructor(e,t){super(e,t),this.update=Jr(Et(this,this.update),pr)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,r,()=>{i?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}};J0.prototype.options_={children:["volumeLevelTooltip"]};_e.registerComponent("MouseVolumeLevelDisplay",J0);let Uh=class extends zm{constructor(e,t){super(e,t),this.on("slideractive",i=>this.updateLastVolume_(i)),this.on(e,"volumechange",i=>this.updateARIAAttributes(i)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){Rl(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),r=oo(i),n=this.vertical();let a=Nh(i,e);a=n?a.y:a.x,a=Kl(a,0,1),t.update(r,a,n)}Rl(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}};Uh.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!Pi&&!Qr&&Uh.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Uh.prototype.playerEvent="volumechange";_e.registerComponent("VolumeBar",Uh);let Z0=class extends _e{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||so(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),pI(this,e),this.throttledHandleMouseMove=Jr(Et(this,this.handleMouseMove),pr),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.on("mousedown",i=>this.handleMouseDown(i)),this.on("touchstart",i=>this.handleMouseDown(i)),this.on("mousemove",i=>this.handleMouseMove(i)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}};Z0.prototype.options_={children:["volumeBar"]};_e.registerComponent("VolumeControl",Z0);const vI=function(s,e){e.tech_&&!e.tech_.featuresMuteControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresMuteControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};let eS=class extends gi{constructor(e,t){super(e,t),vI(this,e),this.on(e,["loadstart","volumechange"],i=>this.update(i))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(t===0){const r=i<.1?.1:i;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),Pi&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Ph(this.el_,[0,1,2,3].reduce((i,r)=>i+`${r?" ":""}vjs-vol-${r}`,"")),js(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}};eS.prototype.controlText_="Mute";_e.registerComponent("MuteToggle",eS);let tS=class extends _e{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||so(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=i=>this.handleKeyPress(i),this.on(e,["loadstart"],i=>this.volumePanelState_(i)),this.on(this.muteToggle,"keyup",i=>this.handleKeyPress(i)),this.on(this.volumeControl,"keyup",i=>this.handleVolumeControlKeyUp(i)),this.on("keydown",i=>this.handleKeyPress(i)),this.on("mouseover",i=>this.handleMouseOver(i)),this.on("mouseout",i=>this.handleMouseOut(i)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),Zi(le,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),mi(le,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}};tS.prototype.options_={children:["muteToggle","volumeControl"]};_e.registerComponent("VolumePanel",tS);class iS extends gi{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive()?i.seekableEnd():this.player_.duration();let n;t+this.skipTime<=r?n=t+this.skipTime:n=r,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}iS.prototype.controlText_="Skip Forward";_e.registerComponent("SkipForward",iS);class rS extends gi{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive()&&i.seekableStart();let n;r&&t-this.skipTime<=r?n=r:t>=this.skipTime?n=t-this.skipTime:n=0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}rS.prototype.controlText_="Skip Backward";_e.registerComponent("SkipBackward",rS);let nS=class extends _e{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",i=>this.handleKeyDown(i)),this.boundHandleBlur_=i=>this.handleBlur(i),this.boundHandleTapClick_=i=>this.handleTapClick(i)}addEventListenerForItem(e){e instanceof _e&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof _e&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=qe(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),Zi(t,"click",function(i){i.preventDefault(),i.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||le.activeElement;if(!this.children().some(i=>i.el()===t)){const i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter(r=>r.el()===e.target)[0];if(!i)return;i.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}};_e.registerComponent("Menu",nS);let Km=class extends _e{constructor(e,t={}){super(e,t),this.menuButton_=new gi(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=gi.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),Zi(le,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new nS(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=qe("li",{className:"vjs-menu-title",textContent:Ht(this.options_.title),tabIndex:-1}),i=new _e(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";const t=gi.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),mi(le,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){e.key==="Escape"||e.key==="Tab"?(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus())):(e.key==="Up"||e.key==="Down"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(e.key==="Escape"||e.key==="Tab")&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(e.key==="Escape"||e.key==="Tab")&&(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Pi&&p0())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}};_e.registerComponent("MenuButton",Km);let Xm=class extends Km{constructor(e,t){const i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;const r=Et(this,this.update);i.addEventListener("removetrack",r),i.addEventListener("addtrack",r),i.addEventListener("labelchange",r),this.player_.on("ready",r),this.player_.on("dispose",function(){i.removeEventListener("removetrack",r),i.removeEventListener("addtrack",r),i.removeEventListener("labelchange",r)})}};_e.registerComponent("TrackButton",Xm);let Xl=class extends Fh{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,i){this.nonIconControl=!0;const r=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i),n=qe("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(n):r.replaceChild(n,r.querySelector(".vjs-icon-placeholder")),r}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}};_e.registerComponent("MenuItem",Xl);let Ql=class extends Xl{constructor(e,t){const i=t.track,r=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected=i.mode==="showing",super(e,t),this.track=i,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const n=(...o)=>{this.handleTracksChange.apply(this,o)},a=(...o)=>{this.handleSelectedLanguageChange.apply(this,o)};if(e.on(["loadstart","texttrackchange"],n),r.addEventListener("change",n),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),r.removeEventListener("change",n),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let o;this.on(["tap","click"],function(){if(typeof D.Event!="object")try{o=new D.Event("change")}catch{}o||(o=le.createEvent("Event"),o.initEvent("change",!0,!0)),r.dispatchEvent(o)})}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),!!i)for(let r=0;r<i.length;r++){const n=i[r];this.kinds.indexOf(n.kind)!==-1&&(n===t?n.mode!=="showing"&&(n.mode="showing"):n.mode!=="disabled"&&(n.mode="disabled"))}}handleTracksChange(e){const t=this.track.mode==="showing";t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if(this.track.mode==="showing"){const t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}};_e.registerComponent("TextTrackMenuItem",Ql);let sS=class extends Ql{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let i=!0;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(this.options_.kinds.indexOf(a.kind)>-1&&a.mode==="showing"){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&a.mode==="showing"){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}};_e.registerComponent("OffTextTrackMenuItem",sS);let Ao=class extends Xm{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=Ql){let i;this.label_&&(i=`${this.label_} off`),e.push(new sS(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<r.length;n++){const a=r[n];if(this.kinds_.indexOf(a.kind)>-1){const o=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return e}};_e.registerComponent("TextTrackButton",Ao);let aS=class extends Xl{constructor(e,t){const i=t.track,r=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=n&&n<r.endTime,super(e,t),this.track=i,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}};_e.registerComponent("ChaptersTrackMenuItem",aS);let Qm=class extends Ao{constructor(e,t,i){super(e,t,i),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(Ht(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,r=t.length;i<r;i++){const n=t[i],a=new aS(this.player_,{track:this.track_,cue:n});e.push(a)}return e}};Qm.prototype.kind_="chapters";Qm.prototype.controlText_="Chapters";_e.registerComponent("ChaptersButton",Qm);let Ym=class extends Ao{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");const r=e.textTracks(),n=Et(this,this.handleTracksChange);r.addEventListener("change",n),this.on("dispose",function(){r.removeEventListener("change",n)})}handleTracksChange(e){const t=this.player().textTracks();let i=!1;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(a.kind!==this.kind_&&a.mode==="showing"){i=!0;break}}i?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}};Ym.prototype.kind_="descriptions";Ym.prototype.controlText_="Descriptions";_e.registerComponent("DescriptionsButton",Ym);let Jm=class extends Ao{constructor(e,t,i){super(e,t,i),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}};Jm.prototype.kind_="subtitles";Jm.prototype.controlText_="Subtitles";_e.registerComponent("SubtitlesButton",Jm);let Zm=class extends Ql{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}};_e.registerComponent("CaptionSettingsMenuItem",Zm);let eg=class extends Ao{constructor(e,t,i){super(e,t,i),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Zm(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}};eg.prototype.kind_="captions";eg.prototype.controlText_="Captions";_e.registerComponent("CaptionsButton",eg);let oS=class extends Ql{createEl(e,t,i){const r=super.createEl(e,t,i),n=r.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",r):n.appendChild(qe("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(qe("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}};_e.registerComponent("SubsCapsMenuItem",oS);let tg=class extends Ao{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(Ht(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Zm(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,oS),e}};tg.prototype.kinds_=["captions","subtitles"];tg.prototype.controlText_="Subtitles";_e.registerComponent("SubsCapsButton",tg);let lS=class extends Xl{constructor(e,t){const i=t.track,r=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",n),this.on("dispose",()=>{r.removeEventListener("change",n)})}createEl(e,t,i){const r=super.createEl(e,t,i),n=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(qe("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(qe("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const r=t[i];r!==this.track&&(r.enabled=r===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}};_e.registerComponent("AudioTrackMenuItem",lS);let uS=class extends Xm{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const r=t[i];e.push(new lS(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}};uS.prototype.controlText_="Audio Track";_e.registerComponent("AudioTrackButton",uS);let ig=class extends Xl{constructor(e,t){const i=t.rate,r=parseFloat(i,10);t.label=i,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=r,this.on(e,"ratechange",n=>this.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}};ig.prototype.contentElType="button";_e.registerComponent("PlaybackRateMenuItem",ig);let cS=class extends Km{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",i=>this.updateVisibility(i)),this.on(e,"ratechange",i=>this.updateLabel(i)),this.on(e,"playbackrateschange",i=>this.handlePlaybackRateschange(i))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=qe("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new ig(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}};cS.prototype.controlText_="Playback Rate";_e.registerComponent("PlaybackRateMenuButton",cS);let hS=class extends _e{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}};_e.registerComponent("Spacer",hS);let yI=class extends hS{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}};_e.registerComponent("CustomControlSpacer",yI);let dS=class extends _e{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}};dS.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};_e.registerComponent("ControlBar",dS);let fS=class extends wo{constructor(e,t){super(e,t),this.on(e,"error",i=>{this.open(i)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}};fS.prototype.options_=Object.assign({},wo.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});_e.registerComponent("ErrorDisplay",fS);class pS extends _e{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),qe("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const i=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${fr()}`)+"-"+t[1].replace(/\W+/g,""),r=qe("option",{id:i,value:this.localize(t[0]),textContent:this.localize(t[1])});return r.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${i}`),r}))}}_e.registerComponent("TextTrackSelect",pS);class Hs extends _e{constructor(e,t={}){super(e,t);const i=qe("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const r=this.options_.selects;for(const n of r){const a=this.options_.selectConfigs[n],o=a.className,l=a.id.replace("%s",this.options_.id_);let u=null;const c=`vjs_select_${fr()}`;if(this.options_.type==="colors"){u=qe("span",{className:o});const f=qe("label",{id:l,className:"vjs-label",textContent:this.localize(a.label)});f.setAttribute("for",c),u.appendChild(f)}const h=new pS(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:c,labelId:l});this.addChild(h),this.options_.type==="colors"&&(u.appendChild(h.el()),this.el().appendChild(u))}}createEl(){return qe("fieldset",{className:this.options_.className})}}_e.registerComponent("TextTrackFieldset",Hs);class mS extends _e{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Hs(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const n=new Hs(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const a=new Hs(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return qe("div",{className:"vjs-track-settings-colors"})}}_e.registerComponent("TextTrackSettingsColors",mS);class gS extends _e{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Hs(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const n=new Hs(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const a=new Hs(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return qe("div",{className:"vjs-track-settings-font"})}}_e.registerComponent("TextTrackSettingsFont",gS);class vS extends _e{constructor(e,t={}){super(e,t);const i=this.localize("restore all settings to the default values"),r=new gi(e,{controlText:i,className:"vjs-default-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Reset"),this.addChild(r);const n=new gi(e,{controlText:i,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Done"),this.addChild(n)}createEl(){return qe("div",{className:"vjs-track-settings-controls"})}}_e.registerComponent("TrackSettingsControls",vS);const ff="vjs-text-track-settings",yy=["#000","Black"],_y=["#00F","Blue"],Ty=["#0FF","Cyan"],by=["#0F0","Green"],Sy=["#F0F","Magenta"],Cy=["#F00","Red"],Ey=["#FFF","White"],wy=["#FF0","Yellow"],pf=["1","Opaque"],mf=["0.5","Semi-Transparent"],ky=["0","Transparent"],Yn={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[yy,Ey,Cy,by,_y,wy,Sy,Ty],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[pf,mf,ky],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Ey,yy,Cy,by,_y,wy,Sy,Ty],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:s=>s==="1.00"?null:Number(s)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[pf,mf],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[ky,mf,pf],className:"vjs-window-opacity vjs-opacity"}};Yn.windowColor.options=Yn.backgroundColor.options;function yS(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function _I(s,e){const t=s.options[s.options.selectedIndex].value;return yS(t,e)}function TI(s,e,t){if(e){for(let i=0;i<s.options.length;i++)if(yS(s.options[i].value,t)===e){s.selectedIndex=i;break}}}let bI=class extends wo{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=qe("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),t.persistTextTrackSettings===void 0&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){const t=new mS(e,{textTrackComponentid:this.id_,selectConfigs:Yn,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const i=new gS(e,{textTrackComponentid:this.id_,selectConfigs:Yn,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);const r=new vS(e);this.addChild(r)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),Va(Yn,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return o0(Yn,(e,t,i)=>{const r=_I(this.$(t.selector),t.parser);return r!==void 0&&(e[i]=r),e},{})}setValues(e){Va(Yn,(t,i)=>{TI(this.$(t.selector),e[i],t.parser)})}setDefaults(){Va(Yn,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(D.localStorage.getItem(ff))}catch(t){et.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?D.localStorage.setItem(ff,JSON.stringify(e)):D.localStorage.removeItem(ff)}catch(t){et.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}};_e.registerComponent("TextTrackSettings",bI);let SI=class extends _e{constructor(e,t){let i=t.ResizeObserver||D.ResizeObserver;t.ResizeObserver===null&&(i=!1);const r=Tt({createEl:!i,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||D.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=P0(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const n=this.debouncedHandler_;let a=this.unloadListener_=function(){mi(this,"resize",n),mi(this,"unload",a),a=null};Zi(this.el_.contentWindow,"unload",a),Zi(this.el_.contentWindow,"resize",n)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}};_e.registerComponent("ResizeManager",SI);const CI={trackingThreshold:20,liveTolerance:15};let EI=class extends _e{constructor(e,t){const i=Tt(CI,t,{createEl:!1});super(e,i),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=r=>this.handlePlay(r),this.handleFirstTimeupdate_=r=>this.handleFirstTimeupdate(r),this.handleSeeked_=r=>this.handleSeeked(r),this.seekToLiveEdge_=r=>this.seekToLiveEdge(r),this.reset_(),this.on(this.player_,"durationchange",r=>this.handleDurationchange(r)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(D.performance.now().toFixed(4)),i=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const r=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-n)>this.options_.liveTolerance;(!this.timeupdateSeen_||r===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,pr),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}};_e.registerComponent("LiveTracker",EI);class wI extends _e{constructor(e,t){super(e,t),this.on("statechanged",i=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:qe("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${fr()}`}),description:qe("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${fr()}`})},qe("div",{className:"vjs-title-bar"},{},l0(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const n=this.state[r],a=this.els[r],o=i[r];Lh(a),n&&ns(a,n),t&&(t.removeAttribute(o),n&&t.setAttribute(o,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}_e.registerComponent("TitleBar",wI);const kI={initialDisplay:4e3,position:[],takeFocus:!1};class xI extends gi{constructor(e,t){t=Tt(kI,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],i=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=qe("button",{},{type:"button",class:this.buildCSSClass()},qe("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}_e.registerComponent("TransientButton",xI);const kp=s=>{const e=s.el();if(e.hasAttribute("src"))return s.triggerSourceset(e.src),!0;const t=s.$$("source"),i=[];let r="";if(!t.length)return!1;for(let n=0;n<t.length;n++){const a=t[n].src;a&&i.indexOf(a)===-1&&i.push(a)}return i.length?(i.length===1&&(r=i[0]),s.triggerSourceset(r),!0):!1},AI=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(s){const e=le.createElement(this.nodeName.toLowerCase());e.innerHTML=s;const t=le.createDocumentFragment();for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);return this.innerText="",D.Element.prototype.appendChild.call(this,t),this.innerHTML}}),_S=(s,e)=>{let t={};for(let i=0;i<s.length&&(t=Object.getOwnPropertyDescriptor(s[i],e),!(t&&t.set&&t.get));i++);return t.enumerable=!0,t.configurable=!0,t},II=s=>_S([s.el(),D.HTMLMediaElement.prototype,D.Element.prototype,AI],"innerHTML"),xy=function(s){const e=s.el();if(e.resetSourceWatch_)return;const t={},i=II(s),r=n=>(...a)=>{const o=n.apply(e,a);return kp(s),o};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",Tt(i,{set:r(i.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",i)},s.one("sourceset",e.resetSourceWatch_)},PI=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?j0(D.Element.prototype.getAttribute.call(this,"src")):""},set(s){return D.Element.prototype.setAttribute.call(this,"src",s),s}}),DI=s=>_S([s.el(),D.HTMLMediaElement.prototype,PI],"src"),NI=function(s){if(!s.featuresSourceset)return;const e=s.el();if(e.resetSourceset_)return;const t=DI(s),i=e.setAttribute,r=e.load;Object.defineProperty(e,"src",Tt(t,{set:n=>{const a=t.set.call(e,n);return s.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const o=i.call(e,n,a);return/src/i.test(n)&&s.triggerSourceset(e.src),o},e.load=()=>{const n=r.call(e);return kp(s)||(s.triggerSourceset(""),xy(s)),n},e.currentSrc?s.triggerSourceset(e.currentSrc):kp(s)||xy(s),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=i,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};let Le=class dc extends bt{constructor(e,t){super(e,t);const i=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",i&&(this.el_.currentSrc!==i.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const o=[];for(;a--;){const l=n[a];l.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(l),this.remoteTextTracks().addTrack(l.track),this.textTracks().addTrack(l.track),!r&&!this.el_.hasAttribute("crossorigin")&&Bh(l.src)&&(r=!0)):o.push(l))}for(let l=0;l<o.length;l++)this.el_.removeChild(o[l])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&et.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
176
+ This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(Ol||Ah)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),dc.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){NI(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const i=()=>{t=[];for(let n=0;n<e.length;n++){const a=e[n];a.kind==="metadata"&&t.push({track:a,storedMode:a.mode})}};i(),e.addEventListener("change",i),this.on("dispose",()=>e.removeEventListener("change",i));const r=()=>{for(let n=0;n<t.length;n++){const a=t[n];a.track.mode==="disabled"&&a.track.mode!==a.storedMode&&(a.track.mode=a.storedMode)}e.removeEventListener("change",r)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",i),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(r=>{this.el()[`${i}Tracks`].removeEventListener(r,this[`${i}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=hr[e],i=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const n={change:o=>{const l={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(l),e==="text"&&this[co.remoteText.getterName]().trigger(l)},addtrack(o){r.addTrack(o.track)},removetrack(o){r.removeTrack(o.track)}},a=function(){const o=[];for(let l=0;l<r.length;l++){let u=!1;for(let c=0;c<i.length;c++)if(i[c]===r[l]){u=!0;break}u||o.push(r[l])}for(;o.length;)r.removeTrack(o.shift())};this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach(o=>{const l=n[o];i.addEventListener(o,l),this.on("dispose",u=>i.removeEventListener(o,l))}),this.on("loadstart",a),this.on("dispose",o=>this.off("loadstart",a))}proxyNativeTracks_(){hr.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),dc.disposeMediaElement(e),e=i}else{e=le.createElement("video");const i=this.options_.tag&&Qn(this.options_.tag),r=Tt({},i);(!Ol||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,v0(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&ao(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){const r=t[i],n=this.options_[r];typeof n<"u"&&(n?ao(e,r,r):Dh(e,r),e[r]=n)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let i=!1;const r=function(){i=!0};this.on("loadstart",r);const n=function(){i||this.trigger("loadstart")};this.on("loadedmetadata",n),this.ready(function(){this.off("loadstart",r),this.off("loadedmetadata",n),i||this.trigger("loadstart")});return}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(i){this.trigger(i)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Ih?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){et(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Qr&&Yr&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Vr(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return et.error("Invalid source URL."),!1;const i={src:e};t&&(i.type=t);const r=qe("source",{},i);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return et.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const i of t)if(i.src===e)return this.el_.removeChild(i),!0;return et.warn(`No matching source element found with src: ${e}`),!1}reset(){dc.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=le.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)(e===t[i]||e===t[i].track)&&this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),D.performance&&(e.creationTime=D.performance.now()),e}};wh(Le,"TEST_VID",function(){if(!So())return;const s=le.createElement("video"),e=le.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s});Le.isSupported=function(){try{Le.TEST_VID.volume=.5}catch{return!1}return!!(Le.TEST_VID&&Le.TEST_VID.canPlayType)};Le.canPlayType=function(s){return Le.TEST_VID.canPlayType(s)};Le.canPlaySource=function(s,e){return Le.canPlayType(s.type)};Le.canControlVolume=function(){try{const s=Le.TEST_VID.volume;Le.TEST_VID.volume=s/2+.1;const e=s!==Le.TEST_VID.volume;return e&&Pi?(D.setTimeout(()=>{Le&&Le.prototype&&(Le.prototype.featuresVolumeControl=s!==Le.TEST_VID.volume)}),!1):e}catch{return!1}};Le.canMuteVolume=function(){try{const s=Le.TEST_VID.muted;return Le.TEST_VID.muted=!s,Le.TEST_VID.muted?ao(Le.TEST_VID,"muted","muted"):Dh(Le.TEST_VID,"muted","muted"),s!==Le.TEST_VID.muted}catch{return!1}};Le.canControlPlaybackRate=function(){if(Qr&&Yr&&kh<58)return!1;try{const s=Le.TEST_VID.playbackRate;return Le.TEST_VID.playbackRate=s/2+.1,s!==Le.TEST_VID.playbackRate}catch{return!1}};Le.canOverrideAttributes=function(){try{const s=()=>{};Object.defineProperty(le.createElement("video"),"src",{get:s,set:s}),Object.defineProperty(le.createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(le.createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(le.createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0};Le.supportsNativeTextTracks=function(){return Ih||Pi&&Yr};Le.supportsNativeVideoTracks=function(){return!!(Le.TEST_VID&&Le.TEST_VID.videoTracks)};Le.supportsNativeAudioTracks=function(){return!!(Le.TEST_VID&&Le.TEST_VID.audioTracks)};Le.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([s,e]){wh(Le.prototype,s,()=>Le[e](),!0)});Le.prototype.featuresVolumeControl=Le.canControlVolume();Le.prototype.movingMediaElementInDOM=!Pi;Le.prototype.featuresFullscreenResize=!0;Le.prototype.featuresProgressEvents=!0;Le.prototype.featuresTimeupdateEvents=!0;Le.prototype.featuresVideoFrameCallback=!!(Le.TEST_VID&&Le.TEST_VID.requestVideoFrameCallback);Le.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch{}})()}};Le.resetMediaElement=function(s){if(!s)return;const e=s.querySelectorAll("source");let t=e.length;for(;t--;)s.removeChild(e[t]);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch{}})()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){Le.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){Le.prototype["set"+Ht(s)]=function(e){this.el_[s]=e,e?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){Le.prototype[s]=function(){return this.el_[s]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){Le.prototype["set"+Ht(s)]=function(e){this.el_[s]=e}});["pause","load","play"].forEach(function(s){Le.prototype[s]=function(){return this.el_[s]()}});bt.withSourceHandlers(Le);Le.nativeSourceHandler={};Le.nativeSourceHandler.canPlayType=function(s){try{return Le.TEST_VID.canPlayType(s)}catch{return""}};Le.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return Le.nativeSourceHandler.canPlayType(s.type);if(s.src){const t=$m(s.src);return Le.nativeSourceHandler.canPlayType(`video/${t}`)}return""};Le.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)};Le.nativeSourceHandler.dispose=function(){};Le.registerSourceHandler(Le.nativeSourceHandler);bt.registerTech("Html5",Le);const TS=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],gf={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},xp=["tiny","xsmall","small","medium","large","xlarge","huge"],fc={};xp.forEach(s=>{const e=s.charAt(0)==="x"?`x-${s.substring(1)}`:s;fc[s]=`vjs-layout-${e}`});const LI={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};let Qt=class La extends _e{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${fr()}`,t=Object.assign(La.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=s0(this.id_),this.fsApi_=wc,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&Qn(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(o){a[o.toLowerCase()]=t.languages[o]}),this.languages_=a}else this.languages_=La.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),Rm(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Zi(le,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=Tt(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const o=new D.DOMParser().parseFromString(iI,"image/svg+xml");if(o.querySelector("parsererror"))et.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const u=o.documentElement;u.style.display="none",this.el_.appendChild(u),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new rI(this),this.addClass("vjs-spatial-navigation-enabled")),Ol&&this.addClass("vjs-touch-enabled"),Pi||this.addClass("vjs-workinghover"),La.players[this.id_]=this;const n=gp.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),mi(le,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),mi(le,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),La.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),JA(this),Ci.names.forEach(e=>{const t=Ci[e],i=this[t.getterName]();i&&i.off&&i.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,i=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";i?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl("div"));const n=Qn(e);if(r){for(t=this.el_=e,e=this.tag=le.createElement("video");t.children.length;)e.appendChild(t.firstChild);Sl(t,"video-js")||js(t,"video-js"),t.appendChild(e),i=this.playerElIngest_=t,Object.keys(t).forEach(l=>{try{e[l]=t[l]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",Yr&&xh&&(e.setAttribute("role","application"),n.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(l){r&&l==="class"||t.setAttribute(l,n[l]),r&&e.setAttribute(l,n[l])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(l=>f0[l]).map(l=>"vjs-device-"+l.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),D.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=A0("vjs-styles-dimensions");const l=es(".vjs-styles-defaults"),u=es("head");u.insertBefore(this.styleEl_,l?l.nextSibling:u.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const o=e.getElementsByTagName("a");for(let l=0;l<o.length;l++){const u=o.item(l);js(u,"vjs-hidden"),u.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!i&&e.parentNode.insertBefore(t,e),yp(e,t),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t}crossOrigin(e){if(typeof e>"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){et.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const i=e+"_";if(t===void 0)return this[i]||0;if(t===""||t==="auto"){this[i]=void 0,this.updateStyleEl_();return}const r=parseFloat(t);if(isNaN(r)){et.error(`Improper value "${t}" supplied for for ${e}`);return}this[i]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,Tn(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),AA(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(D.VIDEOJS_NO_DYNAMIC_STYLE===!0){const o=typeof this.width_=="number"?this.width_:this.options_.width,l=typeof this.height_=="number"?this.height_:this.options_.height,u=this.tech_&&this.tech_.el();u&&(o>=0&&(u.width=o),l>=0&&(u.height=l));return}let e,t,i,r;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?i=this.aspectRatio_:this.videoWidth()>0?i=this.videoWidth()+":"+this.videoHeight():i="16:9";const n=i.split(":"),a=n[1]/n[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*a,/^[^a-zA-Z]/.test(this.id())?r="dimensions-"+this.id():r=this.id()+"-dimensions",this.addClass(r),I0(this.styleEl_,`
177
+ .${r} {
178
+ width: ${e}px;
179
+ height: ${t}px;
180
+ }
181
+
182
+ .${r}.vjs-fluid:not(.vjs-audio-only-mode) {
183
+ padding-top: ${a*100}%;
184
+ }
185
+ `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=Ht(e),r=e.charAt(0).toLowerCase()+e.slice(1);i!=="Html5"&&this.tag&&(bt.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};Ci.names.forEach(l=>{const u=Ci[l];a[u.getterName]=this[u.privateName]}),Object.assign(a,this.options_[i]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const o=bt.getTech(e);if(!o)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new o(a),this.tech_.ready(Et(this,this.handleTechReady_),!0),sy.jsonToTextTracks(this.textTracksJson_||[],this.tech_),TS.forEach(l=>{this.on(this.tech_,l,u=>this[`handleTech${Ht(l)}_`](u))}),Object.keys(gf).forEach(l=>{this.on(this.tech_,l,u=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${gf[l]}_`].bind(this),event:u});return}this[`handleTech${gf[l]}_`](u)})}),this.on(this.tech_,"loadstart",l=>this.handleTechLoadStart_(l)),this.on(this.tech_,"sourceset",l=>this.handleTechSourceset_(l)),this.on(this.tech_,"waiting",l=>this.handleTechWaiting_(l)),this.on(this.tech_,"ended",l=>this.handleTechEnded_(l)),this.on(this.tech_,"seeking",l=>this.handleTechSeeking_(l)),this.on(this.tech_,"play",l=>this.handleTechPlay_(l)),this.on(this.tech_,"pause",l=>this.handleTechPause_(l)),this.on(this.tech_,"durationchange",l=>this.handleTechDurationChange_(l)),this.on(this.tech_,"fullscreenchange",(l,u)=>this.handleTechFullscreenChange_(l,u)),this.on(this.tech_,"fullscreenerror",(l,u)=>this.handleTechFullscreenError_(l,u)),this.on(this.tech_,"enterpictureinpicture",l=>this.handleTechEnterPictureInPicture_(l)),this.on(this.tech_,"leavepictureinpicture",l=>this.handleTechLeavePictureInPicture_(l)),this.on(this.tech_,"error",l=>this.handleTechError_(l)),this.on(this.tech_,"posterchange",l=>this.handleTechPosterChange_(l)),this.on(this.tech_,"textdata",l=>this.handleTechTextData_(l)),this.on(this.tech_,"ratechange",l=>this.handleTechRateChange_(l)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(i!=="Html5"||!this.tag)&&yp(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){Ci.names.forEach(e=>{const t=Ci[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=sy.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&et.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
186
+ See https://github.com/videojs/video.js/issues/2617 for more info.
187
+ `),this.tech_}version(){return{"video.js":gp}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const n=()=>{this.muted(r)};this.playTerminatedQueue_.push(n);const a=this.play();if(El(a))return a.catch(o=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${o||""}`)})};let i;if(e==="any"&&!this.muted()?(i=this.play(),El(i)&&(i=i.catch(t))):e==="muted"&&!this.muted()?i=t():i=this.play(),!!El(i))return i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,i="";typeof t!="string"&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=tI(this,t)),this.cache_.source=Tt({},e,{src:t,type:i});const r=this.cache_.sources.filter(l=>l.src&&l.src===t),n=[],a=this.$$("source"),o=[];for(let l=0;l<a.length;l++){const u=Qn(a[l]);n.push(u),u.src&&u.src===t&&o.push(u.src)}o.length&&!r.length?this.cache_.sources=n:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=n=>this.updateSourceCaches_(n);const i=this.currentSource().src,r=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==i)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?Vr(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),i=>i.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!le.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const i=this.el();let r=le[this.fsApi_.fullscreenElement]===i;!r&&i.matches&&(r=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in QA)return KA(this.middleware_,this.tech_,e,t);if(e in hy)return cy(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw et(i),i}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in XA)return GA(this.middleware_,this.tech_,e);if(e in hy)return cy(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(et(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(et(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(et(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=Vr){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),i=!!(Ih||Pi);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=a=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&i&&this.load();return}const r=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(i){i(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||kr(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=kr(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=kr(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return F0(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;if(e!==void 0){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((i,r)=>{function n(){t.off("fullscreenerror",o),t.off("fullscreenchange",a)}function a(){n(),i()}function o(u,c){n(),r(c)}t.one("fullscreenchange",a),t.one("fullscreenerror",o);const l=t.requestFullscreenHelper_(e);l&&(l.then(n,n),l.then(i,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const i=this.el_[this.fsApi_.requestFullscreen](t);return i&&i.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),i}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,i)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){r(),t()}function a(l,u){r(),i(u)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const o=e.exitFullscreenHelper_();o&&(o.then(r,r),o.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=le[this.fsApi_.exitFullscreen]();return e&&Vr(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=le.documentElement.style.overflow,Zi(le,"keydown",this.boundFullWindowOnEscKey_),le.documentElement.style.overflow="hidden",js(le.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,mi(le,"keydown",this.boundFullWindowOnEscKey_),le.documentElement.style.overflow=this.docOrigOverflow,Ph(le.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&D.documentPictureInPicture){const e=le.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(qe("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),D.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(w0(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",i=>{const r=i.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in le&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(D.documentPictureInPicture&&D.documentPictureInPicture.window)return D.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in le)return le.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(r=>{const n=r.tagName.toLowerCase();if(r.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return n==="input"?a.indexOf(r.type)===-1:["textarea"].indexOf(n)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=a=>e.key.toLowerCase()==="f",muteKey:r=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const a=_e.getComponent("FullscreenToggle");le[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),_e.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),_e.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,r=this.options_.techOrder;i<r.length;i++){const n=r[i];let a=bt.getTech(n);if(a||(a=_e.getComponent(n)),!a){et.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`);continue}if(a.isSupported()&&(t=a.canPlayType(e),t))return t}return""}selectSource(e){const t=this.options_.techOrder.map(o=>[o,bt.getTech(o)]).filter(([o,l])=>l?l.isSupported():(et.error(`The "${o}" tech is undefined. Skipped browser support check for that tech.`),!1)),i=function(o,l,u){let c;return o.some(h=>l.some(f=>{if(c=u(h,f),c)return!0})),c};let r;const n=o=>(l,u)=>o(u,l),a=([o,l],u)=>{if(l.canPlaySource(u,this.options_[o.toLowerCase()]))return{source:u,tech:o}};return this.options_.sourceOrder?r=i(e,t,n(a)):r=i(t,e,a),r||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=q0(e);if(!i.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),zA(this,i[0],(r,n)=>{if(this.middleware_=n,t||(this.cache_.sources=i),this.updateSourceCaches_(r),this.src_(r)){if(i.length>1)return this.handleSrc_(i.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}WA(n,this.tech_)}),i.length>1){const r=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},n=()=>{this.off("error",r)};this.one("error",r),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",n)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?O0(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,t){return this.tech_?this.tech_.addSourceElement(e,t):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();Vr(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),Tn(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=i||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t>"u"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(Zn("beforeerror").forEach(t=>{const i=t(this,e);if(!(Xr(i)&&!Array.isArray(i)||typeof i=="string"||typeof i=="number"||i===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=i}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new Rt(e),this.addClass("vjs-error"),et.error(`(CODE:${this.error_.code} ${Rt.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),Zn("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i;const r=Et(this,this.reportUserActivity),n=function(h){(h.screenX!==t||h.screenY!==i)&&(t=h.screenX,i=h.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},o=function(h){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",o),this.on("mouseleave",o);const l=this.getChild("controlBar");l&&!Pi&&!Qr&&(l.on("mouseenter",function(h){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),l.on("mouseleave",function(h){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let u;const c=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(u);const h=this.options_.inactivityTimeout;h<=0||(u=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},h))};this.setInterval(c,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Tn(this)&&this.trigger("languagechange"))}languages(){return Tt(La.prototype.options_.languages,this.languages_)}toJSON(){const e=Tt(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let r=t[i];r=Tt(r),r.player=void 0,e.tracks[i]=r}return e}createModal(e,t){t=t||{},t.content=e||"";const i=new wo(this,t);return this.addChild(i),i.on("dispose",()=>{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<xp.length;i++){const r=xp[i],n=this.breakpoints_[r];if(t<=n){if(e===r)return;e&&this.removeClass(fc[e]),this.addClass(fc[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return e===void 0?Object.assign(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=Object.assign({},LI,e),this.updateCurrentBreakpoint_(),Object.assign(this.breakpoints_))}responsive(e){if(e===void 0)return this.responsive_;e=!!e;const t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return fc[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const i=this.crossOrigin();this.reset(),this.cache_.media=Tt(e);const{artist:r,artwork:n,description:a,poster:o,src:l,textTracks:u,title:c}=this.cache_.media;!n&&o&&(this.cache_.media.artwork=[{src:o,type:Oc(o)}]),i&&this.crossOrigin(i),l&&this.src(l),o&&this.poster(o),Array.isArray(u)&&u.forEach(h=>this.addRemoteTextTrack(h,!1)),this.titleBar&&this.titleBar.update({title:c,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),i=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),r={src:t,textTracks:i};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:Oc(r.poster)}]),r}return Tt(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=Qn(e),r=i["data-setup"];if(Sl(e,"vjs-fill")&&(i.fill=!0),Sl(e,"vjs-fluid")&&(i.fluid=!0),r!==null)try{Object.assign(i,JSON.parse(r||"{}"))}catch(n){et.error("data-setup",n)}if(Object.assign(t,i),e.hasChildNodes()){const n=e.childNodes;for(let a=0,o=n.length;a<o;a++){const l=n[a],u=l.nodeName.toLowerCase();u==="source"?t.sources.push(Qn(l)):u==="track"&&t.tracks.push(Qn(l))}}return t}debug(e){if(e===void 0)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(e===void 0)return this.cache_.playbackRates;Array.isArray(e)&&e.every(t=>typeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}};Ci.names.forEach(function(s){const e=Ci[s];Qt.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});Qt.prototype.crossorigin=Qt.prototype.crossOrigin;Qt.players={};const il=D.navigator;Qt.prototype.options_={techOrder:bt.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:il&&(il.languages&&il.languages[0]||il.userLanguage||il.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1};TS.forEach(function(s){Qt.prototype[`handleTech${Ht(s)}_`]=function(){return this.trigger(s)}});_e.registerComponent("Player",Qt);const Mc="plugin",za="activePlugins_",Ma={},Rc=s=>Ma.hasOwnProperty(s),pc=s=>Rc(s)?Ma[s]:void 0,bS=(s,e)=>{s[za]=s[za]||{},s[za][e]=!0},Bc=(s,e,t)=>{const i=(t?"before":"")+"pluginsetup";s.trigger(i,e),s.trigger(i+":"+e.name,e)},OI=function(s,e){const t=function(){Bc(this,{name:s,plugin:e,instance:null},!0);const i=e.apply(this,arguments);return bS(this,s),Bc(this,{name:s,plugin:e,instance:i}),i};return Object.keys(e).forEach(function(i){t[i]=e[i]}),t},Ay=(s,e)=>(e.prototype.name=s,function(...t){Bc(this,{name:s,plugin:e,instance:null},!0);const i=new e(this,...t);return this[s]=()=>i,Bc(this,i.getEventHash()),i});let Zr=class mc{constructor(e){if(this.constructor===mc)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),Rm(this),delete this.trigger,L0(this,this.constructor.defaultState),bS(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return Eo(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[za][e]=!1,this.player=this.state=null,t[e]=Ay(e,Ma[e])}static isBasic(e){const t=typeof e=="string"?pc(e):e;return typeof t=="function"&&!mc.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(Rc(e))et.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Qt.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return Ma[e]=t,e!==Mc&&(mc.isBasic(t)?Qt.prototype[e]=OI(e,t):Qt.prototype[e]=Ay(e,t)),t}static deregisterPlugin(e){if(e===Mc)throw new Error("Cannot de-register base plugin.");Rc(e)&&(delete Ma[e],delete Qt.prototype[e])}static getPlugins(e=Object.keys(Ma)){let t;return e.forEach(i=>{const r=pc(i);r&&(t=t||{},t[i]=r)}),t}static getPluginVersion(e){const t=pc(e);return t&&t.VERSION||""}};Zr.getPlugin=pc;Zr.BASE_PLUGIN_NAME=Mc;Zr.registerPlugin(Mc,Zr);Qt.prototype.usingPlugin=function(s){return!!this[za]&&this[za][s]===!0};Qt.prototype.hasPlugin=function(s){return!!Rc(s)};function MI(s,e){let t=!1;return function(...i){return t||et.warn(s),t=!0,e.apply(this,i)}}function Ir(s,e,t,i){return MI(`${e} is deprecated and will be removed in ${s}.0; please use ${t} instead.`,i)}var RI={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const SS=s=>s.indexOf("#")===0?s.slice(1):s;function R(s,e,t){let i=R.getPlayer(s);if(i)return e&&et.warn(`Player "${s}" is already initialised. Options will not be applied.`),t&&i.ready(t),i;const r=typeof s=="string"?es("#"+SS(s)):s;if(!Co(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof D.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!a.contains(r))&&et.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),Zn("beforesetup").forEach(l=>{const u=l(r,Tt(e));if(!Xr(u)||Array.isArray(u)){et.error("please return an object in beforesetup hooks");return}e=Tt(e,u)});const o=_e.getComponent("Player");return i=new o(r,e,t),Zn("setup").forEach(l=>l(i)),i}R.hooks_=mn;R.hooks=Zn;R.hook=pA;R.hookOnce=mA;R.removeHook=n0;if(D.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&So()){let s=es(".vjs-styles-defaults");if(!s){s=A0("vjs-styles-defaults");const e=es("head");e&&e.insertBefore(s,e.firstChild),I0(s,`
188
+ .video-js {
189
+ width: 300px;
190
+ height: 150px;
191
+ }
192
+
193
+ .vjs-fluid:not(.vjs-audio-only-mode) {
194
+ padding-top: 56.25%
195
+ }
196
+ `)}}Tp(1,R);R.VERSION=gp;R.options=Qt.prototype.options_;R.getPlayers=()=>Qt.players;R.getPlayer=s=>{const e=Qt.players;let t;if(typeof s=="string"){const i=SS(s),r=e[i];if(r)return r;t=es("#"+i)}else t=s;if(Co(t)){const{player:i,playerId:r}=t;if(i||e[r])return i||e[r]}};R.getAllPlayers=()=>Object.keys(Qt.players).map(s=>Qt.players[s]).filter(Boolean);R.players=Qt.players;R.getComponent=_e.getComponent;R.registerComponent=(s,e)=>(bt.isTech(e)&&et.warn(`The ${s} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),_e.registerComponent.call(_e,s,e));R.getTech=bt.getTech;R.registerTech=bt.registerTech;R.use=qA;Object.defineProperty(R,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(R.middleware,"TERMINATOR",{value:Lc,writeable:!1,enumerable:!0});R.browser=f0;R.obj=yA;R.mergeOptions=Ir(9,"videojs.mergeOptions","videojs.obj.merge",Tt);R.defineLazyProperty=Ir(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",wh);R.bind=Ir(9,"videojs.bind","native Function.prototype.bind",Et);R.registerPlugin=Zr.registerPlugin;R.deregisterPlugin=Zr.deregisterPlugin;R.plugin=(s,e)=>(et.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Zr.registerPlugin(s,e));R.getPlugins=Zr.getPlugins;R.getPlugin=Zr.getPlugin;R.getPluginVersion=Zr.getPluginVersion;R.addLanguage=function(s,e){return s=(""+s).toLowerCase(),R.options.languages=Tt(R.options.languages,{[s]:e}),R.options.languages[s]};R.log=et;R.createLogger=s0;R.time=LA;R.createTimeRange=Ir(9,"videojs.createTimeRange","videojs.time.createTimeRanges",kr);R.createTimeRanges=Ir(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",kr);R.formatTime=Ir(9,"videojs.formatTime","videojs.time.formatTime",Js);R.setFormatTime=Ir(9,"videojs.setFormatTime","videojs.time.setFormatTime",R0);R.resetFormatTime=Ir(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",B0);R.parseUrl=Ir(9,"videojs.parseUrl","videojs.url.parseUrl",Um);R.isCrossOrigin=Ir(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Bh);R.EventTarget=er;R.any=Mm;R.on=Zi;R.one=Mh;R.off=mi;R.trigger=Eo;R.xhr=Vb;R.TextTrack=Gl;R.AudioTrack=V0;R.VideoTrack=H0;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(s=>{R[s]=function(){return et.warn(`videojs.${s}() is deprecated; use videojs.dom.${s}() instead`),k0[s].apply(null,arguments)}});R.computedStyle=Ir(9,"videojs.computedStyle","videojs.dom.computedStyle",lo);R.dom=k0;R.fn=xA;R.num=hI;R.str=DA;R.url=VA;R.Error=RI;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */let BI=class{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(i){t.enabled_(i)}}),t}},Fc=class extends R.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new BI(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,r=this.length;i<r;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){const r=this[t];if(r.id===e)return r}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}};Fc.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const s in Fc.prototype.allowedEvents_)Fc.prototype["on"+s]=null;var CS="4.1.0";const FI=function(s,e){const t=s.qualityLevels,i=new Fc,r=function(){i.dispose(),s.qualityLevels=t,s.off("dispose",r)};return s.on("dispose",r),s.qualityLevels=()=>i,s.qualityLevels.VERSION=CS,i},ES=function(s){return FI(this,R.obj.merge({},s))};R.registerPlugin("qualityLevels",ES);ES.VERSION=CS;/*! @name @videojs/http-streaming @version 3.16.0 @license Apache-2.0 */const Ui=bh,Uc=(s,e)=>e&&e.responseURL&&s!==e.responseURL?e.responseURL:s,mr=s=>R.log.debug?R.log.debug.bind(R,"VHS:",`${s} >`):function(){};function lt(...s){const e=R.obj||R;return(e.merge||e.mergeOptions).apply(e,s)}function ri(...s){const e=R.time||R;return(e.createTimeRanges||e.createTimeRanges).apply(e,s)}function UI(s){if(s.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges:
197
+ `;for(let t=0;t<s.length;t++){const i=s.start(t),r=s.end(t);e+=`${i} --> ${r}. Duration (${r-i})
198
+ `}return e}const Hr=1/30,qr=Hr*3,wS=function(s,e){const t=[];let i;if(s&&s.length)for(i=0;i<s.length;i++)e(s.start(i),s.end(i))&&t.push([s.start(i),s.end(i)]);return ri(t)},Ra=function(s,e){return wS(s,function(t,i){return t-qr<=e&&i+qr>=e})},Vu=function(s,e){return wS(s,function(t){return t-Hr>=e})},$I=function(s){if(s.length<2)return ri();const e=[];for(let t=1;t<s.length;t++){const i=s.end(t-1),r=s.start(t);e.push([i,r])}return ri(e)},jI=function(s,e){let t=null,i=null,r=0;const n=[],a=[];if(!s||!s.length||!e||!e.length)return ri();let o=s.length;for(;o--;)n.push({time:s.start(o),type:"start"}),n.push({time:s.end(o),type:"end"});for(o=e.length;o--;)n.push({time:e.start(o),type:"start"}),n.push({time:e.end(o),type:"end"});for(n.sort(function(l,u){return l.time-u.time}),o=0;o<n.length;o++)n[o].type==="start"?(r++,r===2&&(t=n[o].time)):n[o].type==="end"&&(r--,r===1&&(i=n[o].time)),t!==null&&i!==null&&(a.push([t,i]),t=null,i=null);return ri(a)},kS=s=>{const e=[];if(!s||!s.length)return"";for(let t=0;t<s.length;t++)e.push(s.start(t)+" => "+s.end(t));return e.join(", ")},VI=function(s,e,t=1){return((s.length?s.end(s.length-1):0)-e)/t},Os=s=>{const e=[];for(let t=0;t<s.length;t++)e.push({start:s.start(t),end:s.end(t)});return e},HI=function(s,e){if(s===e)return!1;if(!s&&e||!e&&s||s.length!==e.length)return!0;for(let t=0;t<s.length;t++)if(s.start(t)!==e.start(t)||s.end(t)!==e.end(t))return!0;return!1},vf=function(s){if(!(!s||!s.length||!s.end))return s.end(s.length-1)},rg=function(s,e){let t=0;if(!s||!s.length)return t;for(let i=0;i<s.length;i++){const r=s.start(i),n=s.end(i);if(!(e>n)){if(e>r&&e<=n){t+=n-e;continue}t+=n-r}}return t},ng=(s,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(i){t+=i.duration}),(e.preloadHints||[]).forEach(function(i){i.type==="PART"&&(t+=s.partTargetDuration)}),t},Ap=s=>(s.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:i,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),xS=s=>{const e=s.segments&&s.segments.length&&s.segments[s.segments.length-1];return e&&e.parts||[]},AS=({preloadSegment:s})=>{if(!s)return;const{parts:e,preloadHints:t}=s;let i=(t||[]).reduce((r,n)=>r+(n.type==="PART"?1:0),0);return i+=e&&e.length?e.length:0,i},IS=(s,e)=>{if(e.endList)return 0;if(s&&s.suggestedPresentationDelay)return s.suggestedPresentationDelay;const t=xS(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},qI=function(s,e){let t=0,i=e-s.mediaSequence,r=s.segments[i];if(r){if(typeof r.start<"u")return{result:r.start,precise:!0};if(typeof r.end<"u")return{result:r.end-r.duration,precise:!0}}for(;i--;){if(r=s.segments[i],typeof r.end<"u")return{result:t+r.end,precise:!0};if(t+=ng(s,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},zI=function(s,e){let t=0,i,r=e-s.mediaSequence;for(;r<s.segments.length;r++){if(i=s.segments[r],typeof i.start<"u")return{result:i.start-t,precise:!0};if(t+=ng(s,i),typeof i.end<"u")return{result:i.end-t,precise:!0}}return{result:-1,precise:!1}},PS=function(s,e,t){if(typeof e>"u"&&(e=s.mediaSequence+s.segments.length),e<s.mediaSequence)return 0;const i=qI(s,e);if(i.precise)return i.result;const r=zI(s,e);return r.precise?r.result:i.result+t},DS=function(s,e,t){if(!s)return 0;if(typeof t!="number"&&(t=0),typeof e>"u"){if(s.totalDuration)return s.totalDuration;if(!s.endList)return D.Infinity}return PS(s,e,t)},wl=function({defaultDuration:s,durationList:e,startIndex:t,endIndex:i}){let r=0;if(t>i&&([t,i]=[i,t]),t<0){for(let n=t;n<Math.min(0,i);n++)r+=s;t=0}for(let n=t;n<i;n++)r+=e[n].duration;return r},NS=function(s,e,t,i){if(!s||!s.segments)return null;if(s.endList)return DS(s);if(e===null)return null;e=e||0;let r=PS(s,s.mediaSequence+s.segments.length,e);return t&&(i=typeof i=="number"?i:IS(null,s),r-=i),Math.max(0,r)},WI=function(s,e,t){const r=e||0;let n=NS(s,e,!0,t);return n===null?ri():(n<r&&(n=r),ri(r,n))},GI=function({playlist:s,currentTime:e,startingSegmentIndex:t,startingPartIndex:i,startTime:r,exactManifestTimings:n}){let a=e-r;const o=Ap(s);let l=0;for(let u=0;u<o.length;u++){const c=o[u];if(t===c.segmentIndex&&!(typeof i=="number"&&typeof c.partIndex=="number"&&i!==c.partIndex)){l=u;break}}if(a<0){if(l>0)for(let u=l-1;u>=0;u--){const c=o[u];if(a+=c.duration,n){if(a<0)continue}else if(a+Hr<=0)continue;return{partIndex:c.partIndex,segmentIndex:c.segmentIndex,startTime:r-wl({defaultDuration:s.targetDuration,durationList:o,startIndex:l,endIndex:u})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e}}if(l<0){for(let u=l;u<0;u++)if(a-=s.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e};l=0}for(let u=l;u<o.length;u++){const c=o[u];a-=c.duration;const h=c.duration>Hr,f=a===0,g=h&&a+Hr>=0;if(!((f||g)&&u!==o.length-1)){if(n){if(a>0)continue}else if(a-Hr>=0)continue;return{partIndex:c.partIndex,segmentIndex:c.segmentIndex,startTime:r+wl({defaultDuration:s.targetDuration,durationList:o,startIndex:l,endIndex:u})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:e}},LS=function(s){return s.excludeUntil&&s.excludeUntil>Date.now()},sg=function(s){return s.excludeUntil&&s.excludeUntil===1/0},$h=function(s){const e=LS(s);return!s.disabled&&!e},KI=function(s){return s.disabled},XI=function(s){for(let e=0;e<s.segments.length;e++)if(s.segments[e].key)return!0;return!1},OS=function(s,e){return e.attributes&&e.attributes[s]},QI=function(s,e,t,i=0){return OS("BANDWIDTH",t)?(s*t.attributes.BANDWIDTH-i*8)/e:NaN},Ip=(s,e)=>{if(s.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return s.playlists.filter(i=>$h(i)?(i.attributes.BANDWIDTH||0)<t:!1).length===0},ag=(s,e)=>!s&&!e||!s&&e||s&&!e?!1:!!(s===e||s.id&&e.id&&s.id===e.id||s.resolvedUri&&e.resolvedUri&&s.resolvedUri===e.resolvedUri||s.uri&&e.uri&&s.uri===e.uri),Iy=function(s,e){const t=s&&s.mediaGroups&&s.mediaGroups.AUDIO||{};let i=!1;for(const r in t){for(const n in t[r])if(i=e(t[r][n]),i)break;if(i)break}return!!i},Yl=s=>{if(!s||!s.playlists||!s.playlists.length)return Iy(s,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;e<s.playlists.length;e++){const t=s.playlists[e],i=t.attributes&&t.attributes.CODECS;if(!(i&&i.split(",").every(n=>zb(n))||Iy(s,n=>ag(t,n))))return!1}return!0};var $i={liveEdgeDelay:IS,duration:DS,seekable:WI,getMediaInfoForTime:GI,isEnabled:$h,isDisabled:KI,isExcluded:LS,isIncompatible:sg,playlistEnd:NS,isAes:XI,hasAttribute:OS,estimateSegmentRequestTime:QI,isLowestEnabledRendition:Ip,isAudioOnly:Yl,playlistMatch:ag,segmentDurationWithParts:ng};const{log:MS}=R,Wa=(s,e)=>`${s}-${e}`,RS=(s,e,t)=>`placeholder-uri-${s}-${e}-${t}`,YI=({onwarn:s,oninfo:e,manifestString:t,customTagParsers:i=[],customTagMappers:r=[],llhls:n})=>{const a=new Bk;s&&a.on("warn",s),e&&a.on("info",e),i.forEach(u=>a.addParser(u)),r.forEach(u=>a.addTagMapper(u)),a.push(t),a.end();const o=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(u){o.hasOwnProperty(u)&&delete o[u]}),o.segments&&o.segments.forEach(function(u){["parts","preloadHints"].forEach(function(c){u.hasOwnProperty(c)&&delete u[c]})})),!o.targetDuration){let u=10;o.segments&&o.segments.length&&(u=o.segments.reduce((c,h)=>Math.max(c,h.duration),0)),s&&s({message:`manifest has no targetDuration defaulting to ${u}`}),o.targetDuration=u}const l=xS(o);if(l.length&&!o.partTargetDuration){const u=l.reduce((c,h)=>Math.max(c,h.duration),0);s&&(s({message:`manifest has no partTargetDuration defaulting to ${u}`}),MS.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.")),o.partTargetDuration=u}return o},Io=(s,e)=>{s.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(s.mediaGroups[t])for(const i in s.mediaGroups[t])for(const r in s.mediaGroups[t][i]){const n=s.mediaGroups[t][i][r];e(n,t,i,r)}})},BS=({playlist:s,uri:e,id:t})=>{s.id=t,s.playlistErrors_=0,e&&(s.uri=e),s.attributes=s.attributes||{}},JI=s=>{let e=s.playlists.length;for(;e--;){const t=s.playlists[e];BS({playlist:t,id:Wa(e,t.uri)}),t.resolvedUri=Ui(s.uri,t.uri),s.playlists[t.id]=t,s.playlists[t.uri]=t,t.attributes.BANDWIDTH||MS.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},ZI=s=>{Io(s,e=>{e.uri&&(e.resolvedUri=Ui(s.uri,e.uri))})},eP=(s,e)=>{const t=Wa(0,e),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:D.location.href,resolvedUri:D.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return i.playlists[t]=i.playlists[0],i.playlists[e]=i.playlists[0],i},FS=(s,e,t=RS)=>{s.uri=e;for(let r=0;r<s.playlists.length;r++)if(!s.playlists[r].uri){const n=`placeholder-uri-${r}`;s.playlists[r].uri=n}const i=Yl(s);Io(s,(r,n,a,o)=>{if(!r.playlists||!r.playlists.length){if(i&&n==="AUDIO"&&!r.uri)for(let l=0;l<s.playlists.length;l++){const u=s.playlists[l];if(u.attributes&&u.attributes.AUDIO&&u.attributes.AUDIO===a)return}r.playlists=[mt({},r)]}r.playlists.forEach(function(l,u){const c=t(n,a,o,l),h=Wa(u,c);l.uri?l.resolvedUri=l.resolvedUri||Ui(s.uri,l.uri):(l.uri=u===0?c:h,l.resolvedUri=l.uri),l.id=l.id||h,l.attributes=l.attributes||{},s.playlists[l.id]=l,s.playlists[l.uri]=l})}),JI(s),ZI(s)};class Py{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(this.offset_!==null||!e.length)return;const[t]=e;t.programDateTime!==void 0&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,i=t.startDate.getTime();this.trimProcessedDateRanges_(i),this.pendingDateRanges_=e.reduce((r,n)=>(r.set(n.id,n),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((i,r)=>{if(!this.processedDateRanges_.has(r)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),!!i.class))if(e[i.class]){const n=e[i.class].push(i);i.classListIndex=n-1}else e[i.class]=[i],i.classListIndex=0});for(const i of t){const r=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&r[i.classListIndex+1]?i.endTime=r[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((i,r)=>{i.startDate.getTime()<e&&this.processedDateRanges_.delete(r)})}}const US=22,qs=({requestType:s,request:e,error:t,parseFailure:i})=>{const r=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:s},o=r&&!n||i;if(t&&n)a.error=mt({},t),a.errorType=R.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=R.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=R.Error.NetworkRequestTimeout;else if(o){const l=i?R.Error.NetworkBodyParserFailed:R.Error.NetworkBadStatus;a.errorType=l,a.status=e.status,a.headers=e.headers}return a},{EventTarget:tP}=R,iP=(s,e)=>{if(e.endList||!e.serverControl)return s;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:i}=e;let r=e.mediaSequence+e.segments.length;if(i){const n=i.parts||[],a=AS(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const i=new D.URL(s);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&i.searchParams.set(r,t[r])}),s=i.toString()}return s},rP=(s,e)=>{if(!s)return e;const t=lt(s,e);if(s.preloadHints&&!e.preloadHints&&delete t.preloadHints,s.parts&&!e.parts)delete t.parts;else if(s.parts&&e.parts)for(let i=0;i<e.parts.length;i++)s.parts&&s.parts[i]&&(t.parts[i]=lt(s.parts[i],e.parts[i]));return!s.skipped&&e.skipped&&(t.skipped=!1),s.preload&&!e.preload&&(t.preload=!1),t},nP=(s,e,t)=>{const i=s.slice(),r=e.slice();t=t||0;const n=[];let a;for(let o=0;o<r.length;o++){const l=i[o+t],u=r[o];l?(a=l.map||a,n.push(rP(l,u))):(a&&!u.map&&(u.map=a),n.push(u))}return n},$S=(s,e)=>{!s.resolvedUri&&s.uri&&(s.resolvedUri=Ui(e,s.uri)),s.key&&!s.key.resolvedUri&&(s.key.resolvedUri=Ui(e,s.key.uri)),s.map&&!s.map.resolvedUri&&(s.map.resolvedUri=Ui(e,s.map.uri)),s.map&&s.map.key&&!s.map.key.resolvedUri&&(s.map.key.resolvedUri=Ui(e,s.map.key.uri)),s.parts&&s.parts.length&&s.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=Ui(e,t.uri))}),s.preloadHints&&s.preloadHints.length&&s.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=Ui(e,t.uri))})},jS=function(s){const e=s.segments||[],t=s.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let i=0;i<t.preloadHints.length;i++)if(t.preloadHints[i].type==="MAP")return e}t.duration=s.targetDuration,t.preload=!0,e.push(t)}return e},VS=(s,e)=>s===e||s.segments&&e.segments&&s.segments.length===e.segments.length&&s.endList===e.endList&&s.mediaSequence===e.mediaSequence&&s.preloadSegment===e.preloadSegment,Pp=(s,e,t=VS)=>{const i=lt(s,{}),r=i.playlists[e.id];if(!r||t(r,e))return null;e.segments=jS(e);const n=lt(r,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a<e.skip.skippedSegments;a++)e.segments.unshift({skipped:!0})}n.segments=nP(r.segments,e.segments,e.mediaSequence-r.mediaSequence)}n.segments.forEach(a=>{$S(a,n.resolvedUri)});for(let a=0;a<i.playlists.length;a++)i.playlists[a].id===e.id&&(i.playlists[a]=n);return i.playlists[e.id]=n,i.playlists[e.uri]=n,Io(s,(a,o,l,u)=>{if(a.playlists)for(let c=0;c<a.playlists.length;c++)e.id===a.playlists[c].id&&(a.playlists[c]=n)}),i},Dp=(s,e)=>{const t=s.segments||[],i=t[t.length-1],r=i&&i.parts&&i.parts[i.parts.length-1],n=r&&r.duration||i&&i.duration;return e&&n?n*1e3:(s.partTargetDuration||s.targetDuration||10)*500},Dy=(s,e,t)=>{if(!s)return;const i=[];return s.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:o}=r.attributes;i.push({id:r.id,bandwidth:n,resolution:a,codecs:o})}),{type:e,isLive:t,renditions:i}};let Ba=class extends tP{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=mr("PlaylistLoader");const{withCredentials:r=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new Py,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=Ui(this.main.uri,e.uri);this.llhls&&(t=iP(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(i,r)=>{if(this.request){if(i)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,i){const{uri:r,id:n}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:qs({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{return YI({onwarn:({message:i})=>this.logger_(`m3u8-parser warn for ${e}: ${i}`),oninfo:({message:i})=>this.logger_(`m3u8-parser info for ${e}: ${i}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(i){this.error=i,this.error.metadata={errorType:R.Error.StreamingHlsPlaylistParserError,error:i}}}haveMetadata({playlistString:e,playlistObject:t,url:i,id:r}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:i,manifestString:e});a.lastRequest=Date.now(),BS({playlist:a,uri:i,id:r});const o=Pp(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,o?(this.main=o,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Dp(this.media(),!!o)),n.parsedPlaylist=Dy(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),D.clearTimeout(this.mediaUpdateTimeout),D.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Py,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(D.clearTimeout(this.finalRenditionTimeout),t){const o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=D.setTimeout(this.media.bind(this,e,!1),o);return}const i=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(Dp(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(o,l)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Uc(e.resolvedUri,l),o)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:l.responseText,url:e.uri,id:e.id}),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const i=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=D.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},i);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=D.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=D.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:qs({requestType:i.requestType,request:i,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=Uc(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=Dy(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,FS(this.main,this.srcUri()),e.playlists.forEach(i=>{i.segments=jS(i),i.segments.forEach(r=>{$S(r,i.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||D.location.href;this.main=eP(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,r=e.ID;let n=i.playlists.length;for(;n--;){const a=i.playlists[n];if(a.attributes["PATHWAY-ID"]===r){const o=a.resolvedUri,l=a.id;if(t){const u=this.createCloneURI_(a.resolvedUri,e),c=Wa(r,u),h=this.createCloneAttributes_(r,a.attributes),f=this.createClonePlaylist_(a,c,e,h);i.playlists[n]=f,i.playlists[c]=f,i.playlists[u]=f}else i.playlists.splice(n,1);delete i.playlists[l],delete i.playlists[o]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!i.mediaGroups[n]||!i.mediaGroups[n][r])){for(const a in i.mediaGroups[n])if(a===r){for(const o in i.mediaGroups[n][a])i.mediaGroups[n][a][o].playlists.forEach((u,c)=>{const h=i.playlists[u.id],f=h.id,g=h.resolvedUri;delete i.playlists[f],delete i.playlists[g]});delete i.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,r=i.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=Wa(e.ID,n),o=this.createCloneAttributes_(e.ID,t.attributes),l=this.createClonePlaylist_(t,a,e,o);i.playlists[r]=l,i.playlists[a]=l,i.playlists[n]=l,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!r.mediaGroups[n]||r.mediaGroups[n][t]))for(const a in r.mediaGroups[n]){if(a===i)r.mediaGroups[n][t]={};else continue;for(const o in r.mediaGroups[n][a]){const l=r.mediaGroups[n][a][o];r.mediaGroups[n][t][o]=mt({},l);const u=r.mediaGroups[n][t][o],c=this.createCloneURI_(l.resolvedUri,e);u.resolvedUri=c,u.uri=c,u.playlists=[],l.playlists.forEach((h,f)=>{const g=r.playlists[h.id],C=RS(n,t,o),p=Wa(t,C);if(g&&!r.playlists[p]){const b=this.createClonePlaylist_(g,p,e),I=b.resolvedUri;r.playlists[p]=b,r.playlists[I]=b}u.playlists[f]=this.createClonePlaylist_(h,p,e)})}}})}createClonePlaylist_(e,t,i,r){const n=this.createCloneURI_(e.resolvedUri,i),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),lt(e,a)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))i.searchParams.set(n,r[n]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(i[r]=e)}),i}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const r=e.contentProtection[i].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}};const Np=function(s,e,t,i){const r=s.responseType==="arraybuffer"?s.response:s.responseText;!e&&r&&(s.responseTime=Date.now(),s.roundTripTime=s.responseTime-s.requestTime,s.bytesReceived=r.byteLength||r.length,s.bandwidth||(s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3))),t.headers&&(s.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(s.timedout=!0),!e&&!s.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(s&&(r||s.responseText)))),i(e,s)},sP=(s,e)=>{if(!s||!s.size)return;let t=e;return s.forEach(i=>{t=i(t)}),t},aP=(s,e,t,i)=>{!s||!s.size||s.forEach(r=>{r(e,t,i)})},HS=function(){const s=function e(t,i){t=lt({timeout:45e3},t);const r=e.beforeRequest||R.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||R.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||R.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(R.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const o=R.Vhs.xhr.original===!0?R.xhr:R.Vhs.xhr,l=sP(n,t);n.delete(r);const u=o(l||t,function(h,f){return aP(a,u,h,f),Np(u,h,f,i)}),c=u.abort;return u.abort=function(){return u.aborted=!0,c.apply(u,arguments)},u.uri=t.uri,u.requestType=t.requestType,u.requestTime=Date.now(),u};return s.original=!0,s},oP=function(s){let e;const t=s.offset;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=D.BigInt(s.offset)+D.BigInt(s.length)-D.BigInt(1):e=s.offset+s.length-1,"bytes="+t+"-"+e},Lp=function(s){const e={};return s.byterange&&(e.Range=oP(s.byterange)),e},lP=function(s,e){return s.start(e)+"-"+s.end(e)},uP=function(s,e){const t=s.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},cP=function(s){return s>=32&&s<126?String.fromCharCode(s):"."},qS=function(s){const e={};return Object.keys(s).forEach(t=>{const i=s[t];Gb(i)?e[t]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:e[t]=i}),e},$c=function(s){const e=s.byterange||{length:1/0,offset:0};return[e.length,e.offset,s.resolvedUri].join(",")},zS=function(s){return s.resolvedUri},WS=s=>{const e=Array.prototype.slice.call(s),t=16;let i="",r,n;for(let a=0;a<e.length/t;a++)r=e.slice(a*t,a*t+t).map(uP).join(""),n=e.slice(a*t,a*t+t).map(cP).join(""),i+=r+" "+n+`
199
+ `;return i},hP=({bytes:s})=>WS(s),dP=s=>{let e="",t;for(t=0;t<s.length;t++)e+=lP(s,t)+" ";return e};var fP=Object.freeze({__proto__:null,createTransferableMessage:qS,initSegmentId:$c,segmentKeyId:zS,hexDump:WS,tagDump:hP,textRanges:dP});const GS=.25,pP=(s,e)=>{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,r=e.videoTimingInfo.transmuxedPresentationStart+t,n=s-r;return new Date(e.dateTimeObject.getTime()+n*1e3)},mP=s=>s.transmuxedPresentationEnd-s.transmuxedPresentationStart-s.transmuxerPrependedSeconds,gP=(s,e)=>{let t;try{t=new Date(s)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let i=e.segments[0];if(t<new Date(i.dateTimeObject))return null;for(let l=0;l<e.segments.length-1;l++){i=e.segments[l];const u=new Date(e.segments[l+1].dateTimeObject);if(t<u)break}const r=e.segments[e.segments.length-1],n=r.dateTimeObject,a=r.videoTimingInfo?mP(r.videoTimingInfo):r.duration+r.duration*GS,o=new Date(n.getTime()+a*1e3);return t>o?null:(t>new Date(n)&&(i=r),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:$i.duration(e,e.mediaSequence+e.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},vP=(s,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,i;for(let n=0;n<e.segments.length&&(i=e.segments[n],t=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:t+i.duration,!(s<=t));n++);const r=e.segments[e.segments.length-1];if(r.videoTimingInfo&&r.videoTimingInfo.transmuxedPresentationEnd<s)return null;if(s>t){if(s>t+r.duration*GS)return null;i=r}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:t-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},yP=(s,e)=>{let t,i;try{t=new Date(s),i=new Date(e)}catch{}const r=t.getTime();return(i.getTime()-r)/1e3},_P=s=>{if(!s.segments||s.segments.length===0)return!1;for(let e=0;e<s.segments.length;e++)if(!s.segments[e].dateTimeObject)return!1;return!0},TP=({playlist:s,time:e=void 0,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");if(!s||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const i=vP(e,s);if(!i)return t({message:"valid programTime was not found"});if(i.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:i.estimatedStart});const r={mediaSeconds:e},n=pP(e,i.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},KS=({programTime:s,playlist:e,retryCount:t=2,seekTo:i,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof s>"u"||!e||!i)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!_P(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const o=gP(s,e);if(!o)return a({message:`${s} was not found in the stream`});const l=o.segment,u=yP(l.dateTimeObject,s);if(o.type==="estimate"){if(t===0)return a({message:`${s} is not buffered yet. Try again`});i(o.estimatedStart+u),n.one("seeked",()=>{KS({programTime:s,playlist:e,retryCount:t-1,seekTo:i,pauseAfterSeek:r,tech:n,callback:a})});return}const c=l.start+u,h=()=>a(null,n.currentTime());n.one("seeked",h),r&&n.pause(),i(c)},yf=(s,e)=>{if(s.readyState===4)return e()},bP=(s,e,t,i)=>{let r=[],n,a=!1;const o=function(h,f,g,C){return f.abort(),a=!0,t(h,f,g,C)},l=function(h,f){if(a)return;if(h)return h.metadata=qs({requestType:i,request:f,error:h}),o(h,f,"",r);const g=f.responseText.substring(r&&r.byteLength||0,f.responseText.length);if(r=Xk(r,Kb(g,!0)),n=n||dl(r),r.length<10||n&&r.length<n+2)return yf(f,()=>o(h,f,"",r));const C=Pm(r);return C==="ts"&&r.length<188?yf(f,()=>o(h,f,"",r)):!C&&r.length<376?yf(f,()=>o(h,f,"",r)):o(null,f,C,r)},c=e({uri:s,beforeSend(h){h.overrideMimeType("text/plain; charset=x-user-defined"),h.addEventListener("progress",function({total:f,loaded:g}){return Np(h,null,{statusCode:h.status},l)})}},function(h,f){return Np(c,h,f,l)});return c},{EventTarget:SP}=R,Ny=function(s,e){if(!VS(s,e)||s.sidx&&e.sidx&&(s.sidx.offset!==e.sidx.offset||s.sidx.length!==e.sidx.length))return!1;if(!s.sidx&&e.sidx||s.sidx&&!e.sidx||s.segments&&!e.segments||!s.segments&&e.segments)return!1;if(!s.segments&&!e.segments)return!0;for(let t=0;t<s.segments.length;t++){const i=s.segments[t],r=e.segments[t];if(i.uri!==r.uri)return!1;if(!i.byterange&&!r.byterange)continue;const n=i.byterange,a=r.byterange;if(n&&!a||!n&&a||n.offset!==a.offset||n.length!==a.length)return!1}return!0},CP=(s,e,t,i)=>{const r=i.attributes.NAME||t;return`placeholder-uri-${s}-${e}-${r}`},EP=({mainXml:s,srcUrl:e,clientOffset:t,sidxMapping:i,previousManifest:r})=>{const n=Wx(s,{manifestUri:e,clientOffset:t,sidxMapping:i,previousManifest:r});return FS(n,e,CP),n},wP=(s,e)=>{Io(s,(t,i,r,n)=>{(!e.mediaGroups[i][r]||!(n in e.mediaGroups[i][r]))&&delete s.mediaGroups[i][r][n]})},kP=(s,e,t)=>{let i=!0,r=lt(s,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n<e.playlists.length;n++){const a=e.playlists[n];if(a.sidx){const l=Ch(a.sidx);t&&t[l]&&t[l].sidx&&xm(a,t[l].sidx,a.sidx.resolvedUri)}const o=Pp(r,a,Ny);o&&(r=o,i=!1)}return Io(e,(n,a,o,l)=>{if(n.playlists&&n.playlists.length){const u=n.playlists[0].id,c=Pp(r,n.playlists[0],Ny);c&&(r=c,l in r.mediaGroups[a][o]||(r.mediaGroups[a][o][l]=n),r.mediaGroups[a][o][l].playlists[0]=r.playlists[u],i=!1)}}),wP(r,e),e.minimumUpdatePeriod!==s.minimumUpdatePeriod&&(i=!1),i?null:r},xP=(s,e)=>(!s.map&&!e.map||!!(s.map&&e.map&&s.map.byterange.offset===e.map.byterange.offset&&s.map.byterange.length===e.map.byterange.length))&&s.uri===e.uri&&s.byterange.offset===e.byterange.offset&&s.byterange.length===e.byterange.length,Ly=(s,e)=>{const t={};for(const i in s){const n=s[i].sidx;if(n){const a=Ch(n);if(!e[a])break;const o=e[a].sidxInfo;xP(o,n)&&(t[a]=e[a])}}return t},AP=(s,e)=>{let i=Ly(s.playlists,e);return Io(s,(r,n,a,o)=>{if(r.playlists&&r.playlists.length){const l=r.playlists;i=lt(i,Ly(l,e))}}),i};let Op=class extends SP{constructor(e,t,i={},r){super(),this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:n=!1}=i;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=mr("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,i){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},i&&(this.state=i),this.trigger("error"),!0}addSidxSegments_(e,t,i){const r=e.sidx&&Ch(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){this.mediaRequest_=D.setTimeout(()=>i(!1),0);return}const n=Uc(e.sidx.resolvedUri),a=(l,u)=>{if(this.requestErrored_(l,u,t))return;const c=this.mainPlaylistLoader_.sidxMapping_,{requestType:h}=u;let f;try{f=Yx($e(u.response).subarray(8))}catch(g){g.metadata=qs({requestType:h,request:u,parseFailure:!0}),this.requestErrored_(g,u,t);return}return c[r]={sidxInfo:e.sidx,sidx:f},xm(e,f,e.sidx.resolvedUri),i(!0)},o="dash-sidx";this.request=bP(n,this.vhs_.xhr,(l,u,c,h)=>{if(l)return a(l,u);if(!c||c!=="mp4"){const C=c||"unknown";return a({status:u.status,message:`Unsupported ${C} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},u)}const{offset:f,length:g}=e.sidx.byterange;if(h.length>=g+f)return a(l,{response:h.subarray(f,f+g),status:u.status,uri:u.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:Lp({byterange:e.sidx.byterange})},a)},o)}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},D.clearTimeout(this.minimumUpdatePeriodTimeout_),D.clearTimeout(this.mediaRequest_),D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,i&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(D.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const i=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=D.setTimeout(()=>this.load(),i);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){this.mediaRequest_=D.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(i,r)=>{if(i){const{requestType:a}=r;i.metadata=qs({requestType:a,request:r,error:i})}if(this.requestErrored_(i,r)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});const n=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Uc(this.mainPlaylistLoader_.srcUrl,r),n){this.handleMain_(),this.syncClientServerClock_(()=>e(r,n));return}return e(r,n)})}syncClientServerClock_(e){const t=Gx(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:Ui(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,r)=>{if(!this.request)return;if(i){const{requestType:a}=r;return this.error.metadata=qs({requestType:a,request:r,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;t.method==="HEAD"?!r.responseHeaders||!r.responseHeaders.date?n=this.mainLoaded_:n=Date.parse(r.responseHeaders.date):n=Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let i;try{i=EP({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(n){this.error=n,this.error.metadata={errorType:R.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(i=kP(e,i,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=i||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(i),i){const{duration:n,endList:a}=i,o=[];i.playlists.forEach(u=>{o.push({id:u.id,bandwidth:u.attributes.BANDWIDTH,resolution:u.attributes.RESOLUTION,codecs:u.attributes.CODECS})});const l={duration:n,isLive:!a,renditions:o};t.parsedManifest=l,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!i}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(D.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=D.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=AP(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,i=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=D.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},Dp(this.media(),!!i)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(i=>({cueTime:i.start,frames:[{data:i.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const r=e.contentProtection[i].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}};var ei={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const IP=s=>{const e=new Uint8Array(new ArrayBuffer(s.length));for(let t=0;t<s.length;t++)e[t]=s.charCodeAt(t);return e.buffer},XS=function(s){return s.on=s.addEventListener,s.off=s.removeEventListener,s},PP=function(s){try{return URL.createObjectURL(new Blob([s],{type:"application/javascript"}))}catch{const t=new BlobBuilder;return t.append(s),URL.createObjectURL(t.getBlob())}},QS=function(s){return function(){const e=PP(s),t=XS(new Worker(e));t.objURL=e;const i=t.terminate;return t.on=t.addEventListener,t.off=t.removeEventListener,t.terminate=function(){return URL.revokeObjectURL(e),i.call(this)},t}},YS=function(s){return`var browserWorkerPolyFill = ${XS.toString()};
200
+ browserWorkerPolyFill(self);
201
+ `+s},JS=function(s){return s.toString().replace(/^function.+?{/,"").slice(0,-1)},DP=YS(JS(function(){var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=function(){this.init=function(){var d={};this.on=function(v,T){d[v]||(d[v]=[]),d[v]=d[v].concat(T)},this.off=function(v,T){var _;return d[v]?(_=d[v].indexOf(T),d[v]=d[v].slice(),d[v].splice(_,1),_>-1):!1},this.trigger=function(v){var T,_,k,A;if(T=d[v],!!T)if(arguments.length===2)for(k=T.length,_=0;_<k;++_)T[_].call(this,arguments[1]);else{for(A=[],_=arguments.length,_=1;_<arguments.length;++_)A.push(arguments[_]);for(k=T.length,_=0;_<k;++_)T[_].apply(this,A)}},this.dispose=function(){d={}}}};e.prototype.pipe=function(d){return this.on("data",function(v){d.push(v)}),this.on("done",function(v){d.flush(v)}),this.on("partialdone",function(v){d.partialFlush(v)}),this.on("endedtimeline",function(v){d.endTimeline(v)}),this.on("reset",function(v){d.reset(v)}),d},e.prototype.push=function(d){this.trigger("data",d)},e.prototype.flush=function(d){this.trigger("done",d)},e.prototype.partialFlush=function(d){this.trigger("partialdone",d)},e.prototype.endTimeline=function(d){this.trigger("endedtimeline",d)},e.prototype.reset=function(d){this.trigger("reset",d)};var t=e,i=Math.pow(2,32),r=function(d){var v=new DataView(d.buffer,d.byteOffset,d.byteLength),T;return v.getBigUint64?(T=v.getBigUint64(0),T<Number.MAX_SAFE_INTEGER?Number(T):T):v.getUint32(0)*i+v.getUint32(4)},n={getUint64:r,MAX_UINT32:i},a=n.MAX_UINT32,o,l,u,c,h,f,g,C,p,b,I,L,F,V,B,O,M,U,w,P,Q,G,K,ce,de,pe,ne,se,ue,he,ve,Ae,De,Me,Ne,Je;(function(){var d;if(K={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},!(typeof Uint8Array>"u")){for(d in K)K.hasOwnProperty(d)&&(K[d]=[d.charCodeAt(0),d.charCodeAt(1),d.charCodeAt(2),d.charCodeAt(3)]);ce=new Uint8Array([105,115,111,109]),pe=new Uint8Array([97,118,99,49]),de=new Uint8Array([0,0,0,1]),ne=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),se=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]),ue={video:ne,audio:se},Ae=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ve=new Uint8Array([0,0,0,0,0,0,0,0]),De=new Uint8Array([0,0,0,0,0,0,0,0]),Me=De,Ne=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Je=De,he=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(d){var v=[],T=0,_,k,A;for(_=1;_<arguments.length;_++)v.push(arguments[_]);for(_=v.length;_--;)T+=v[_].byteLength;for(k=new Uint8Array(T+8),A=new DataView(k.buffer,k.byteOffset,k.byteLength),A.setUint32(0,k.byteLength),k.set(d,4),_=0,T=8;_<v.length;_++)k.set(v[_],T),T+=v[_].byteLength;return k},l=function(){return o(K.dinf,o(K.dref,Ae))},u=function(d){return o(K.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,d.audioobjecttype<<3|d.samplingfrequencyindex>>>1,d.samplingfrequencyindex<<7|d.channelcount<<3,6,1,2]))},c=function(){return o(K.ftyp,ce,de,ce,pe)},O=function(d){return o(K.hdlr,ue[d])},h=function(d){return o(K.mdat,d)},B=function(d){var v=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,d.duration>>>24&255,d.duration>>>16&255,d.duration>>>8&255,d.duration&255,85,196,0,0]);return d.samplerate&&(v[12]=d.samplerate>>>24&255,v[13]=d.samplerate>>>16&255,v[14]=d.samplerate>>>8&255,v[15]=d.samplerate&255),o(K.mdhd,v)},V=function(d){return o(K.mdia,B(d),O(d.type),g(d))},f=function(d){return o(K.mfhd,new Uint8Array([0,0,0,0,(d&4278190080)>>24,(d&16711680)>>16,(d&65280)>>8,d&255]))},g=function(d){return o(K.minf,d.type==="video"?o(K.vmhd,he):o(K.smhd,ve),l(),U(d))},C=function(d,v){for(var T=[],_=v.length;_--;)T[_]=P(v[_]);return o.apply(null,[K.moof,f(d)].concat(T))},p=function(d){for(var v=d.length,T=[];v--;)T[v]=L(d[v]);return o.apply(null,[K.moov,I(4294967295)].concat(T).concat(b(d)))},b=function(d){for(var v=d.length,T=[];v--;)T[v]=Q(d[v]);return o.apply(null,[K.mvex].concat(T))},I=function(d){var v=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(d&4278190080)>>24,(d&16711680)>>16,(d&65280)>>8,d&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return o(K.mvhd,v)},M=function(d){var v=d.samples||[],T=new Uint8Array(4+v.length),_,k;for(k=0;k<v.length;k++)_=v[k].flags,T[k+4]=_.dependsOn<<4|_.isDependedOn<<2|_.hasRedundancy;return o(K.sdtp,T)},U=function(d){return o(K.stbl,w(d),o(K.stts,Je),o(K.stsc,Me),o(K.stsz,Ne),o(K.stco,De))},(function(){var d,v;w=function(T){return o(K.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),T.type==="video"?d(T):v(T))},d=function(T){var _=T.sps||[],k=T.pps||[],A=[],z=[],W,Y;for(W=0;W<_.length;W++)A.push((_[W].byteLength&65280)>>>8),A.push(_[W].byteLength&255),A=A.concat(Array.prototype.slice.call(_[W]));for(W=0;W<k.length;W++)z.push((k[W].byteLength&65280)>>>8),z.push(k[W].byteLength&255),z=z.concat(Array.prototype.slice.call(k[W]));if(Y=[K.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,(T.width&65280)>>8,T.width&255,(T.height&65280)>>8,T.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o(K.avcC,new Uint8Array([1,T.profileIdc,T.profileCompatibility,T.levelIdc,255].concat([_.length],A,[k.length],z))),o(K.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],T.sarRatio){var J=T.sarRatio[0],ae=T.sarRatio[1];Y.push(o(K.pasp,new Uint8Array([(J&4278190080)>>24,(J&16711680)>>16,(J&65280)>>8,J&255,(ae&4278190080)>>24,(ae&16711680)>>16,(ae&65280)>>8,ae&255])))}return o.apply(null,Y)},v=function(T){return o(K.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(T.channelcount&65280)>>8,T.channelcount&255,(T.samplesize&65280)>>8,T.samplesize&255,0,0,0,0,(T.samplerate&65280)>>8,T.samplerate&255,0,0]),u(T))}})(),F=function(d){var v=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(d.id&4278190080)>>24,(d.id&16711680)>>16,(d.id&65280)>>8,d.id&255,0,0,0,0,(d.duration&4278190080)>>24,(d.duration&16711680)>>16,(d.duration&65280)>>8,d.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(d.width&65280)>>8,d.width&255,0,0,(d.height&65280)>>8,d.height&255,0,0]);return o(K.tkhd,v)},P=function(d){var v,T,_,k,A,z,W;return v=o(K.tfhd,new Uint8Array([0,0,0,58,(d.id&4278190080)>>24,(d.id&16711680)>>16,(d.id&65280)>>8,d.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),z=Math.floor(d.baseMediaDecodeTime/a),W=Math.floor(d.baseMediaDecodeTime%a),T=o(K.tfdt,new Uint8Array([1,0,0,0,z>>>24&255,z>>>16&255,z>>>8&255,z&255,W>>>24&255,W>>>16&255,W>>>8&255,W&255])),A=92,d.type==="audio"?(_=G(d,A),o(K.traf,v,T,_)):(k=M(d),_=G(d,k.length+A),o(K.traf,v,T,_,k))},L=function(d){return d.duration=d.duration||4294967295,o(K.trak,F(d),V(d))},Q=function(d){var v=new Uint8Array([0,0,0,0,(d.id&4278190080)>>24,(d.id&16711680)>>16,(d.id&65280)>>8,d.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return d.type!=="video"&&(v[v.length-1]=0),o(K.trex,v)},(function(){var d,v,T;T=function(_,k){var A=0,z=0,W=0,Y=0;return _.length&&(_[0].duration!==void 0&&(A=1),_[0].size!==void 0&&(z=2),_[0].flags!==void 0&&(W=4),_[0].compositionTimeOffset!==void 0&&(Y=8)),[0,0,A|z|W|Y,1,(_.length&4278190080)>>>24,(_.length&16711680)>>>16,(_.length&65280)>>>8,_.length&255,(k&4278190080)>>>24,(k&16711680)>>>16,(k&65280)>>>8,k&255]},v=function(_,k){var A,z,W,Y,J,ae;for(Y=_.samples||[],k+=20+16*Y.length,W=T(Y,k),z=new Uint8Array(W.length+Y.length*16),z.set(W),A=W.length,ae=0;ae<Y.length;ae++)J=Y[ae],z[A++]=(J.duration&4278190080)>>>24,z[A++]=(J.duration&16711680)>>>16,z[A++]=(J.duration&65280)>>>8,z[A++]=J.duration&255,z[A++]=(J.size&4278190080)>>>24,z[A++]=(J.size&16711680)>>>16,z[A++]=(J.size&65280)>>>8,z[A++]=J.size&255,z[A++]=J.flags.isLeading<<2|J.flags.dependsOn,z[A++]=J.flags.isDependedOn<<6|J.flags.hasRedundancy<<4|J.flags.paddingValue<<1|J.flags.isNonSyncSample,z[A++]=J.flags.degradationPriority&61440,z[A++]=J.flags.degradationPriority&15,z[A++]=(J.compositionTimeOffset&4278190080)>>>24,z[A++]=(J.compositionTimeOffset&16711680)>>>16,z[A++]=(J.compositionTimeOffset&65280)>>>8,z[A++]=J.compositionTimeOffset&255;return o(K.trun,z)},d=function(_,k){var A,z,W,Y,J,ae;for(Y=_.samples||[],k+=20+8*Y.length,W=T(Y,k),A=new Uint8Array(W.length+Y.length*8),A.set(W),z=W.length,ae=0;ae<Y.length;ae++)J=Y[ae],A[z++]=(J.duration&4278190080)>>>24,A[z++]=(J.duration&16711680)>>>16,A[z++]=(J.duration&65280)>>>8,A[z++]=J.duration&255,A[z++]=(J.size&4278190080)>>>24,A[z++]=(J.size&16711680)>>>16,A[z++]=(J.size&65280)>>>8,A[z++]=J.size&255;return o(K.trun,A)},G=function(_,k){return _.type==="audio"?d(_,k):v(_,k)}})();var Re={ftyp:c,mdat:h,moof:C,moov:p,initSegment:function(d){var v=c(),T=p(d),_;return _=new Uint8Array(v.byteLength+T.byteLength),_.set(v),_.set(T,v.byteLength),_}},Oe=function(d){var v,T,_=[],k=[];for(k.byteLength=0,k.nalCount=0,k.duration=0,_.byteLength=0,v=0;v<d.length;v++)T=d[v],T.nalUnitType==="access_unit_delimiter_rbsp"?(_.length&&(_.duration=T.dts-_.dts,k.byteLength+=_.byteLength,k.nalCount+=_.length,k.duration+=_.duration,k.push(_)),_=[T],_.byteLength=T.data.byteLength,_.pts=T.pts,_.dts=T.dts):(T.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(_.keyFrame=!0),_.duration=T.dts-_.dts,_.byteLength+=T.data.byteLength,_.push(T));return k.length&&(!_.duration||_.duration<=0)&&(_.duration=k[k.length-1].duration),k.byteLength+=_.byteLength,k.nalCount+=_.length,k.duration+=_.duration,k.push(_),k},He=function(d){var v,T,_=[],k=[];for(_.byteLength=0,_.nalCount=0,_.duration=0,_.pts=d[0].pts,_.dts=d[0].dts,k.byteLength=0,k.nalCount=0,k.duration=0,k.pts=d[0].pts,k.dts=d[0].dts,v=0;v<d.length;v++)T=d[v],T.keyFrame?(_.length&&(k.push(_),k.byteLength+=_.byteLength,k.nalCount+=_.nalCount,k.duration+=_.duration),_=[T],_.nalCount=T.length,_.byteLength=T.byteLength,_.pts=T.pts,_.dts=T.dts,_.duration=T.duration):(_.duration+=T.duration,_.nalCount+=T.length,_.byteLength+=T.byteLength,_.push(T));return k.length&&_.duration<=0&&(_.duration=k[k.length-1].duration),k.byteLength+=_.byteLength,k.nalCount+=_.nalCount,k.duration+=_.duration,k.push(_),k},st=function(d){var v;return!d[0][0].keyFrame&&d.length>1&&(v=d.shift(),d.byteLength-=v.byteLength,d.nalCount-=v.nalCount,d[0][0].dts=v.dts,d[0][0].pts=v.pts,d[0][0].duration+=v.duration),d},Ct=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Nt=function(d,v){var T=Ct();return T.dataOffset=v,T.compositionTimeOffset=d.pts-d.dts,T.duration=d.duration,T.size=4*d.length,T.size+=d.byteLength,d.keyFrame&&(T.flags.dependsOn=2,T.flags.isNonSyncSample=0),T},Ni=function(d,v){var T,_,k,A,z,W=v||0,Y=[];for(T=0;T<d.length;T++)for(A=d[T],_=0;_<A.length;_++)z=A[_],k=Nt(z,W),W+=k.size,Y.push(k);return Y},Bt=function(d){var v,T,_,k,A,z,W=0,Y=d.byteLength,J=d.nalCount,ae=Y+4*J,me=new Uint8Array(ae),xe=new DataView(me.buffer);for(v=0;v<d.length;v++)for(k=d[v],T=0;T<k.length;T++)for(A=k[T],_=0;_<A.length;_++)z=A[_],xe.setUint32(W,z.data.byteLength),W+=4,me.set(z.data,W),W+=z.data.byteLength;return me},Hi=function(d,v){var T,_=v||0,k=[];return T=Nt(d,_),k.push(T),k},Te=function(d){var v,T,_=0,k=d.byteLength,A=d.length,z=k+4*A,W=new Uint8Array(z),Y=new DataView(W.buffer);for(v=0;v<d.length;v++)T=d[v],Y.setUint32(_,T.data.byteLength),_+=4,W.set(T.data,_),_+=T.data.byteLength;return W},ke={groupNalsIntoFrames:Oe,groupFramesIntoGops:He,extendFirstKeyFrame:st,generateSampleTable:Ni,concatenateNalData:Bt,generateSampleTableForFrame:Hi,concatenateNalDataForFrame:Te},Fe=[33,16,5,32,164,27],Be=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],Ke=function(d){for(var v=[];d--;)v.push(0);return v},rt=function(d){return Object.keys(d).reduce(function(v,T){return v[T]=new Uint8Array(d[T].reduce(function(_,k){return _.concat(k)},[])),v},{})},ut,rr=function(){if(!ut){var d={96e3:[Fe,[227,64],Ke(154),[56]],88200:[Fe,[231],Ke(170),[56]],64e3:[Fe,[248,192],Ke(240),[56]],48e3:[Fe,[255,192],Ke(268),[55,148,128],Ke(54),[112]],44100:[Fe,[255,192],Ke(268),[55,163,128],Ke(84),[112]],32e3:[Fe,[255,192],Ke(268),[55,234],Ke(226),[112]],24e3:[Fe,[255,192],Ke(268),[55,255,128],Ke(268),[111,112],Ke(126),[224]],16e3:[Fe,[255,192],Ke(268),[55,255,128],Ke(268),[111,255],Ke(269),[223,108],Ke(195),[1,192]],12e3:[Be,Ke(268),[3,127,248],Ke(268),[6,255,240],Ke(268),[13,255,224],Ke(268),[27,253,128],Ke(259),[56]],11025:[Be,Ke(268),[3,127,248],Ke(268),[6,255,240],Ke(268),[13,255,224],Ke(268),[27,255,192],Ke(268),[55,175,128],Ke(108),[112]],8e3:[Be,Ke(268),[3,121,16],Ke(47),[7]]};ut=rt(d)}return ut},qi=9e4,gr,nr,sr,vr,An,In,tt;gr=function(d){return d*qi},nr=function(d,v){return d*v},sr=function(d){return d/qi},vr=function(d,v){return d/v},An=function(d,v){return gr(vr(d,v))},In=function(d,v){return nr(sr(d),v)},tt=function(d,v,T){return sr(T?d:d-v)};var nt={ONE_SECOND_IN_TS:qi,secondsToVideoTs:gr,secondsToAudioTs:nr,videoTsToSeconds:sr,audioTsToSeconds:vr,audioTsToVideoTs:An,videoTsToAudioTs:In,metadataTsToSeconds:tt},ss=rr,tn=nt,ta=function(d){var v,T,_=0;for(v=0;v<d.length;v++)T=d[v],_+=T.data.byteLength;return _},ia=function(d,v,T,_){var k,A=0,z=0,W=0,Y=0,J,ae,me;if(v.length&&(k=tn.audioTsToVideoTs(d.baseMediaDecodeTime,d.samplerate),A=Math.ceil(tn.ONE_SECOND_IN_TS/(d.samplerate/1024)),T&&_&&(z=k-Math.max(T,_),W=Math.floor(z/A),Y=W*A),!(W<1||Y>tn.ONE_SECOND_IN_TS/2))){for(J=ss()[d.samplerate],J||(J=v[0].data),ae=0;ae<W;ae++)me=v[0],v.splice(0,0,{data:J,dts:me.dts-A,pts:me.pts-A});return d.baseMediaDecodeTime-=Math.floor(tn.videoTsToAudioTs(Y,d.samplerate)),Y}},Dr=function(d,v,T){return v.minSegmentDts>=T?d:(v.minSegmentDts=1/0,d.filter(function(_){return _.dts>=T?(v.minSegmentDts=Math.min(v.minSegmentDts,_.dts),v.minSegmentPts=v.minSegmentDts,!0):!1}))},Nr=function(d){var v,T,_=[];for(v=0;v<d.length;v++)T=d[v],_.push({size:T.data.byteLength,duration:1024});return _},ra=function(d){var v,T,_=0,k=new Uint8Array(ta(d));for(v=0;v<d.length;v++)T=d[v],k.set(T.data,_),_+=T.data.byteLength;return k},as={prefixWithSilence:ia,trimAdtsFramesByEarliestDts:Dr,generateSampleTable:Nr,concatenateFrameData:ra},na=nt.ONE_SECOND_IN_TS,j=function(d,v){typeof v.pts=="number"&&(d.timelineStartInfo.pts===void 0&&(d.timelineStartInfo.pts=v.pts),d.minSegmentPts===void 0?d.minSegmentPts=v.pts:d.minSegmentPts=Math.min(d.minSegmentPts,v.pts),d.maxSegmentPts===void 0?d.maxSegmentPts=v.pts:d.maxSegmentPts=Math.max(d.maxSegmentPts,v.pts)),typeof v.dts=="number"&&(d.timelineStartInfo.dts===void 0&&(d.timelineStartInfo.dts=v.dts),d.minSegmentDts===void 0?d.minSegmentDts=v.dts:d.minSegmentDts=Math.min(d.minSegmentDts,v.dts),d.maxSegmentDts===void 0?d.maxSegmentDts=v.dts:d.maxSegmentDts=Math.max(d.maxSegmentDts,v.dts))},H=function(d){delete d.minSegmentDts,delete d.maxSegmentDts,delete d.minSegmentPts,delete d.maxSegmentPts},ee=function(d,v){var T,_,k=d.minSegmentDts;return v||(k-=d.timelineStartInfo.dts),T=d.timelineStartInfo.baseMediaDecodeTime,T+=k,T=Math.max(0,T),d.type==="audio"&&(_=d.samplerate/na,T*=_,T=Math.floor(T)),T},fe={clearDtsInfo:H,calculateTrackBaseMediaDecodeTime:ee,collectDtsInfo:j},Ce=4,Ve=128,ct=function(d){for(var v=0,T={payloadType:-1,payloadSize:0},_=0,k=0;v<d.byteLength&&d[v]!==Ve;){for(;d[v]===255;)_+=255,v++;for(_+=d[v++];d[v]===255;)k+=255,v++;if(k+=d[v++],!T.payload&&_===Ce){var A=String.fromCharCode(d[v+3],d[v+4],d[v+5],d[v+6]);if(A==="GA94"){T.payloadType=_,T.payloadSize=k,T.payload=d.subarray(v,v+k);break}else T.payload=void 0}v+=k,_=0,k=0}return T},Ft=function(d){return d.payload[0]!==181||(d.payload[1]<<8|d.payload[2])!==49||String.fromCharCode(d.payload[3],d.payload[4],d.payload[5],d.payload[6])!=="GA94"||d.payload[7]!==3?null:d.payload.subarray(8,d.payload.length-1)},gt=function(d,v){var T=[],_,k,A,z;if(!(v[0]&64))return T;for(k=v[0]&31,_=0;_<k;_++)A=_*3,z={type:v[A+2]&3,pts:d},v[A+2]&4&&(z.ccData=v[A+3]<<8|v[A+4],T.push(z));return T},ar=function(d){for(var v=d.byteLength,T=[],_=1,k,A;_<v-2;)d[_]===0&&d[_+1]===0&&d[_+2]===3?(T.push(_+2),_+=2):_++;if(T.length===0)return d;k=v-T.length,A=new Uint8Array(k);var z=0;for(_=0;_<k;z++,_++)z===T[0]&&(z++,T.shift()),A[_]=d[z];return A},Li={parseSei:ct,parseUserData:Ft,parseCaptionPackets:gt,discardEmulationPreventionBytes:ar,USER_DATA_REGISTERED_ITU_T_T35:Ce},hi=t,Ut=Li,vt=function(d){d=d||{},vt.prototype.init.call(this),this.parse708captions_=typeof d.parse708captions=="boolean"?d.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new yt(0,0),new yt(0,1),new yt(1,0),new yt(1,1)],this.parse708captions_&&(this.cc708Stream_=new Xe({captionServices:d.captionServices})),this.reset(),this.ccStreams_.forEach(function(v){v.on("data",this.trigger.bind(this,"data")),v.on("partialdone",this.trigger.bind(this,"partialdone")),v.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")))};vt.prototype=new hi,vt.prototype.push=function(d){var v,T,_;if(d.nalUnitType==="sei_rbsp"&&(v=Ut.parseSei(d.escapedRBSP),!!v.payload&&v.payloadType===Ut.USER_DATA_REGISTERED_ITU_T_T35&&(T=Ut.parseUserData(v),!!T))){if(d.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(d.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}_=Ut.parseCaptionPackets(d.pts,T),this.captionPackets_=this.captionPackets_.concat(_),this.latestDts_!==d.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=d.dts}},vt.prototype.flushCCStreams=function(d){this.ccStreams_.forEach(function(v){return d==="flush"?v.flush():v.partialFlush()},this)},vt.prototype.flushStream=function(d){if(!this.captionPackets_.length){this.flushCCStreams(d);return}this.captionPackets_.forEach(function(v,T){v.presortIndex=T}),this.captionPackets_.sort(function(v,T){return v.pts===T.pts?v.presortIndex-T.presortIndex:v.pts-T.pts}),this.captionPackets_.forEach(function(v){v.type<2?this.dispatchCea608Packet(v):this.dispatchCea708Packet(v)},this),this.captionPackets_.length=0,this.flushCCStreams(d)},vt.prototype.flush=function(){return this.flushStream("flush")},vt.prototype.partialFlush=function(){return this.flushStream("partialFlush")},vt.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(d){d.reset()})},vt.prototype.dispatchCea608Packet=function(d){this.setsTextOrXDSActive(d)?this.activeCea608Channel_[d.type]=null:this.setsChannel1Active(d)?this.activeCea608Channel_[d.type]=0:this.setsChannel2Active(d)&&(this.activeCea608Channel_[d.type]=1),this.activeCea608Channel_[d.type]!==null&&this.ccStreams_[(d.type<<1)+this.activeCea608Channel_[d.type]].push(d)},vt.prototype.setsChannel1Active=function(d){return(d.ccData&30720)===4096},vt.prototype.setsChannel2Active=function(d){return(d.ccData&30720)===6144},vt.prototype.setsTextOrXDSActive=function(d){return(d.ccData&28928)===256||(d.ccData&30974)===4138||(d.ccData&30974)===6186},vt.prototype.dispatchCea708Packet=function(d){this.parse708captions_&&this.cc708Stream_.push(d)};var Ze={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},yr=function(d){var v=Ze[d]||d;return d&4096&&d===v?"":String.fromCharCode(v)},yi=function(d){return 32<=d&&d<=127||160<=d&&d<=255},at=function(d){this.windowNum=d,this.reset()};at.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},at.prototype.getText=function(){return this.rows.join(`
202
+ `)},at.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},at.prototype.newLine=function(d){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(d),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},at.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},at.prototype.addText=function(d){this.rows[this.rowIdx]+=d},at.prototype.backspace=function(){if(!this.isEmpty()){var d=this.rows[this.rowIdx];this.rows[this.rowIdx]=d.substr(0,d.length-1)}};var rn=function(d,v,T){this.serviceNum=d,this.text="",this.currentWindow=new at(-1),this.windows=[],this.stream=T,typeof v=="string"&&this.createTextDecoder(v)};rn.prototype.init=function(d,v){this.startPts=d;for(var T=0;T<8;T++)this.windows[T]=new at(T),typeof v=="function"&&(this.windows[T].beforeRowOverflow=v)},rn.prototype.setCurrentWindow=function(d){this.currentWindow=this.windows[d]},rn.prototype.createTextDecoder=function(d){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(d)}catch(v){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+d+" encoding. "+v})}};var Xe=function(d){d=d||{},Xe.prototype.init.call(this);var v=this,T=d.captionServices||{},_={},k;Object.keys(T).forEach(A=>{k=T[A],/^SERVICE/.test(A)&&(_[A]=k.encoding)}),this.serviceEncodings=_,this.current708Packet=null,this.services={},this.push=function(A){A.type===3?(v.new708Packet(),v.add708Bytes(A)):(v.current708Packet===null&&v.new708Packet(),v.add708Bytes(A))}};Xe.prototype=new hi,Xe.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Xe.prototype.add708Bytes=function(d){var v=d.ccData,T=v>>>8,_=v&255;this.current708Packet.ptsVals.push(d.pts),this.current708Packet.data.push(T),this.current708Packet.data.push(_)},Xe.prototype.push708Packet=function(){var d=this.current708Packet,v=d.data,T=null,_=null,k=0,A=v[k++];for(d.seq=A>>6,d.sizeCode=A&63;k<v.length;k++)A=v[k++],T=A>>5,_=A&31,T===7&&_>0&&(A=v[k++],T=A),this.pushServiceBlock(T,k,_),_>0&&(k+=_-1)},Xe.prototype.pushServiceBlock=function(d,v,T){var _,k=v,A=this.current708Packet.data,z=this.services[d];for(z||(z=this.initService(d,k));k<v+T&&k<A.length;k++)_=A[k],yi(_)?k=this.handleText(k,z):_===24?k=this.multiByteCharacter(k,z):_===16?k=this.extendedCommands(k,z):128<=_&&_<=135?k=this.setCurrentWindow(k,z):152<=_&&_<=159?k=this.defineWindow(k,z):_===136?k=this.clearWindows(k,z):_===140?k=this.deleteWindows(k,z):_===137?k=this.displayWindows(k,z):_===138?k=this.hideWindows(k,z):_===139?k=this.toggleWindows(k,z):_===151?k=this.setWindowAttributes(k,z):_===144?k=this.setPenAttributes(k,z):_===145?k=this.setPenColor(k,z):_===146?k=this.setPenLocation(k,z):_===143?z=this.reset(k,z):_===8?z.currentWindow.backspace():_===12?z.currentWindow.clearText():_===13?z.currentWindow.pendingNewLine=!0:_===14?z.currentWindow.clearText():_===141&&k++},Xe.prototype.extendedCommands=function(d,v){var T=this.current708Packet.data,_=T[++d];return yi(_)&&(d=this.handleText(d,v,{isExtended:!0})),d},Xe.prototype.getPts=function(d){return this.current708Packet.ptsVals[Math.floor(d/2)]},Xe.prototype.initService=function(d,v){var _="SERVICE"+d,T=this,_,k;return _ in this.serviceEncodings&&(k=this.serviceEncodings[_]),this.services[d]=new rn(d,k,T),this.services[d].init(this.getPts(v),function(A){T.flushDisplayed(A,T.services[d])}),this.services[d]},Xe.prototype.handleText=function(d,v,T){var _=T&&T.isExtended,k=T&&T.isMultiByte,A=this.current708Packet.data,z=_?4096:0,W=A[d],Y=A[d+1],J=v.currentWindow,ae,me;function xe(ye){return ye.map(Ue=>("0"+(Ue&255).toString(16)).slice(-2)).join("")}if(k?(me=[W,Y],d++):me=[W],v.textDecoder_&&!_)ae=v.textDecoder_.decode(new Uint8Array(me));else if(k){const ye=xe(me);ae=String.fromCharCode(parseInt(ye,16))}else ae=yr(z|W);return J.pendingNewLine&&!J.isEmpty()&&J.newLine(this.getPts(d)),J.pendingNewLine=!1,J.addText(ae),d},Xe.prototype.multiByteCharacter=function(d,v){var T=this.current708Packet.data,_=T[d+1],k=T[d+2];return yi(_)&&yi(k)&&(d=this.handleText(++d,v,{isMultiByte:!0})),d},Xe.prototype.setCurrentWindow=function(d,v){var T=this.current708Packet.data,_=T[d],k=_&7;return v.setCurrentWindow(k),d},Xe.prototype.defineWindow=function(d,v){var T=this.current708Packet.data,_=T[d],k=_&7;v.setCurrentWindow(k);var A=v.currentWindow;return _=T[++d],A.visible=(_&32)>>5,A.rowLock=(_&16)>>4,A.columnLock=(_&8)>>3,A.priority=_&7,_=T[++d],A.relativePositioning=(_&128)>>7,A.anchorVertical=_&127,_=T[++d],A.anchorHorizontal=_,_=T[++d],A.anchorPoint=(_&240)>>4,A.rowCount=_&15,_=T[++d],A.columnCount=_&63,_=T[++d],A.windowStyle=(_&56)>>3,A.penStyle=_&7,A.virtualRowCount=A.rowCount+1,d},Xe.prototype.setWindowAttributes=function(d,v){var T=this.current708Packet.data,_=T[d],k=v.currentWindow.winAttr;return _=T[++d],k.fillOpacity=(_&192)>>6,k.fillRed=(_&48)>>4,k.fillGreen=(_&12)>>2,k.fillBlue=_&3,_=T[++d],k.borderType=(_&192)>>6,k.borderRed=(_&48)>>4,k.borderGreen=(_&12)>>2,k.borderBlue=_&3,_=T[++d],k.borderType+=(_&128)>>5,k.wordWrap=(_&64)>>6,k.printDirection=(_&48)>>4,k.scrollDirection=(_&12)>>2,k.justify=_&3,_=T[++d],k.effectSpeed=(_&240)>>4,k.effectDirection=(_&12)>>2,k.displayEffect=_&3,d},Xe.prototype.flushDisplayed=function(d,v){for(var T=[],_=0;_<8;_++)v.windows[_].visible&&!v.windows[_].isEmpty()&&T.push(v.windows[_].getText());v.endPts=d,v.text=T.join(`
203
+
204
+ `),this.pushCaption(v),v.startPts=d},Xe.prototype.pushCaption=function(d){d.text!==""&&(this.trigger("data",{startPts:d.startPts,endPts:d.endPts,text:d.text,stream:"cc708_"+d.serviceNum}),d.text="",d.startPts=d.endPts)},Xe.prototype.displayWindows=function(d,v){var T=this.current708Packet.data,_=T[++d],k=this.getPts(d);this.flushDisplayed(k,v);for(var A=0;A<8;A++)_&1<<A&&(v.windows[A].visible=1);return d},Xe.prototype.hideWindows=function(d,v){var T=this.current708Packet.data,_=T[++d],k=this.getPts(d);this.flushDisplayed(k,v);for(var A=0;A<8;A++)_&1<<A&&(v.windows[A].visible=0);return d},Xe.prototype.toggleWindows=function(d,v){var T=this.current708Packet.data,_=T[++d],k=this.getPts(d);this.flushDisplayed(k,v);for(var A=0;A<8;A++)_&1<<A&&(v.windows[A].visible^=1);return d},Xe.prototype.clearWindows=function(d,v){var T=this.current708Packet.data,_=T[++d],k=this.getPts(d);this.flushDisplayed(k,v);for(var A=0;A<8;A++)_&1<<A&&v.windows[A].clearText();return d},Xe.prototype.deleteWindows=function(d,v){var T=this.current708Packet.data,_=T[++d],k=this.getPts(d);this.flushDisplayed(k,v);for(var A=0;A<8;A++)_&1<<A&&v.windows[A].reset();return d},Xe.prototype.setPenAttributes=function(d,v){var T=this.current708Packet.data,_=T[d],k=v.currentWindow.penAttr;return _=T[++d],k.textTag=(_&240)>>4,k.offset=(_&12)>>2,k.penSize=_&3,_=T[++d],k.italics=(_&128)>>7,k.underline=(_&64)>>6,k.edgeType=(_&56)>>3,k.fontStyle=_&7,d},Xe.prototype.setPenColor=function(d,v){var T=this.current708Packet.data,_=T[d],k=v.currentWindow.penColor;return _=T[++d],k.fgOpacity=(_&192)>>6,k.fgRed=(_&48)>>4,k.fgGreen=(_&12)>>2,k.fgBlue=_&3,_=T[++d],k.bgOpacity=(_&192)>>6,k.bgRed=(_&48)>>4,k.bgGreen=(_&12)>>2,k.bgBlue=_&3,_=T[++d],k.edgeRed=(_&48)>>4,k.edgeGreen=(_&12)>>2,k.edgeBlue=_&3,d},Xe.prototype.setPenLocation=function(d,v){var T=this.current708Packet.data,_=T[d],k=v.currentWindow.penLoc;return v.currentWindow.pendingNewLine=!0,_=T[++d],k.row=_&15,_=T[++d],k.column=_&63,d},Xe.prototype.reset=function(d,v){var T=this.getPts(d);return this.flushDisplayed(T,v),this.initService(v.serviceNum,d)};var ft={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},nn=function(d){return d===null?"":(d=ft[d]||d,String.fromCharCode(d))},$t=14,nd=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],sn=function(){for(var d=[],v=$t+1;v--;)d.push({text:"",indent:0,offset:0});return d},yt=function(d,v){yt.prototype.init.call(this),this.field_=d||0,this.dataChannel_=v||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(T){var _,k,A,z,W;if(_=T.ccData&32639,_===this.lastControlCode_){this.lastControlCode_=null;return}if((_&61440)===4096?this.lastControlCode_=_:_!==this.PADDING_&&(this.lastControlCode_=null),A=_>>>8,z=_&255,_!==this.PADDING_)if(_===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(_===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(T.pts),this.flushDisplayed(T.pts),k=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=k,this.startPts_=T.pts;else if(_===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(T.pts);else if(_===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(T.pts);else if(_===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(T.pts);else if(_===this.CARRIAGE_RETURN_)this.clearFormatting(T.pts),this.flushDisplayed(T.pts),this.shiftRowsUp_(),this.startPts_=T.pts;else if(_===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(_===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(T.pts),this.displayed_=sn();else if(_===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=sn();else if(_===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(T.pts),this.displayed_=sn()),this.mode_="paintOn",this.startPts_=T.pts;else if(this.isSpecialCharacter(A,z))A=(A&3)<<8,W=nn(A|z),this[this.mode_](T.pts,W),this.column_++;else if(this.isExtCharacter(A,z))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),A=(A&3)<<8,W=nn(A|z),this[this.mode_](T.pts,W),this.column_++;else if(this.isMidRowCode(A,z))this.clearFormatting(T.pts),this[this.mode_](T.pts," "),this.column_++,(z&14)===14&&this.addFormatting(T.pts,["i"]),(z&1)===1&&this.addFormatting(T.pts,["u"]);else if(this.isOffsetControlCode(A,z)){const J=z&3;this.nonDisplayed_[this.row_].offset=J,this.column_+=J}else if(this.isPAC(A,z)){var Y=nd.indexOf(_&7968);if(this.mode_==="rollUp"&&(Y-this.rollUpRows_+1<0&&(Y=this.rollUpRows_-1),this.setRollUp(T.pts,Y)),Y!==this.row_&&Y>=0&&Y<=14&&(this.clearFormatting(T.pts),this.row_=Y),z&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(T.pts,["u"]),(_&16)===16){const J=(_&14)>>1;this.column_=J*4,this.nonDisplayed_[this.row_].indent+=J}this.isColorPAC(z)&&(z&14)===14&&this.addFormatting(T.pts,["i"])}else this.isNormalChar(A)&&(z===0&&(z=null),W=nn(A),W+=nn(z),this[this.mode_](T.pts,W),this.column_+=W.length)}};yt.prototype=new hi,yt.prototype.flushDisplayed=function(d){const v=_=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+_+"."})},T=[];this.displayed_.forEach((_,k)=>{if(_&&_.text&&_.text.length){try{_.text=_.text.trim()}catch{v(k)}_.text.length&&T.push({text:_.text,line:k+1,position:10+Math.min(70,_.indent*10)+_.offset*2.5})}else _==null&&v(k)}),T.length&&this.trigger("data",{startPts:this.startPts_,endPts:d,content:T,stream:this.name_})},yt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=sn(),this.nonDisplayed_=sn(),this.lastControlCode_=null,this.column_=0,this.row_=$t,this.rollUpRows_=2,this.formatting_=[]},yt.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},yt.prototype.isSpecialCharacter=function(d,v){return d===this.EXT_&&v>=48&&v<=63},yt.prototype.isExtCharacter=function(d,v){return(d===this.EXT_+1||d===this.EXT_+2)&&v>=32&&v<=63},yt.prototype.isMidRowCode=function(d,v){return d===this.EXT_&&v>=32&&v<=47},yt.prototype.isOffsetControlCode=function(d,v){return d===this.OFFSET_&&v>=33&&v<=35},yt.prototype.isPAC=function(d,v){return d>=this.BASE_&&d<this.BASE_+8&&v>=64&&v<=127},yt.prototype.isColorPAC=function(d){return d>=64&&d<=79||d>=96&&d<=127},yt.prototype.isNormalChar=function(d){return d>=32&&d<=127},yt.prototype.setRollUp=function(d,v){if(this.mode_!=="rollUp"&&(this.row_=$t,this.mode_="rollUp",this.flushDisplayed(d),this.nonDisplayed_=sn(),this.displayed_=sn()),v!==void 0&&v!==this.row_)for(var T=0;T<this.rollUpRows_;T++)this.displayed_[v-T]=this.displayed_[this.row_-T],this.displayed_[this.row_-T]={text:"",indent:0,offset:0};v===void 0&&(v=this.row_),this.topRow_=v-this.rollUpRows_+1},yt.prototype.addFormatting=function(d,v){this.formatting_=this.formatting_.concat(v);var T=v.reduce(function(_,k){return _+"<"+k+">"},"");this[this.mode_](d,T)},yt.prototype.clearFormatting=function(d){if(this.formatting_.length){var v=this.formatting_.reverse().reduce(function(T,_){return T+"</"+_+">"},"");this.formatting_=[],this[this.mode_](d,v)}},yt.prototype.popOn=function(d,v){var T=this.nonDisplayed_[this.row_].text;T+=v,this.nonDisplayed_[this.row_].text=T},yt.prototype.rollUp=function(d,v){var T=this.displayed_[this.row_].text;T+=v,this.displayed_[this.row_].text=T},yt.prototype.shiftRowsUp_=function(){var d;for(d=0;d<this.topRow_;d++)this.displayed_[d]={text:"",indent:0,offset:0};for(d=this.row_+1;d<$t+1;d++)this.displayed_[d]={text:"",indent:0,offset:0};for(d=this.topRow_;d<this.row_;d++)this.displayed_[d]=this.displayed_[d+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},yt.prototype.paintOn=function(d,v){var T=this.displayed_[this.row_].text;T+=v,this.displayed_[this.row_].text=T};var sa={CaptionStream:vt,Cea608Stream:yt,Cea708Stream:Xe},os={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},ou=t,lu=8589934592,aa=4294967296,uu="shared",Pn=function(d,v){var T=1;for(d>v&&(T=-1);Math.abs(v-d)>aa;)d+=T*lu;return d},oa=function(d){var v,T;oa.prototype.init.call(this),this.type_=d||uu,this.push=function(_){if(_.type==="metadata"){this.trigger("data",_);return}this.type_!==uu&&_.type!==this.type_||(T===void 0&&(T=_.dts),_.dts=Pn(_.dts,T),_.pts=Pn(_.pts,T),v=_.dts,this.trigger("data",_))},this.flush=function(){T=v,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){T=void 0,v=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};oa.prototype=new ou;var ls={TimestampRolloverStream:oa,handleRollover:Pn},sd=(d,v,T)=>{if(!d)return-1;for(var _=T;_<d.length;_++)if(d[_]===v)return _;return-1},ad={typedArrayIndexOf:sd},an=ad.typedArrayIndexOf,Lr={Utf8:3},us=function(d,v,T){var _,k="";for(_=v;_<T;_++)k+="%"+("00"+d[_].toString(16)).slice(-2);return k},or=function(d,v,T){return decodeURIComponent(us(d,v,T))},on=function(d,v,T){return unescape(us(d,v,T))},Dn=function(d){return d[0]<<21|d[1]<<14|d[2]<<7|d[3]},ln={APIC:function(d){var v=1,T,_,k="-->";d.data[0]===Lr.Utf8&&(T=an(d.data,0,v),!(T<0)&&(d.mimeType=on(d.data,v,T),v=T+1,d.pictureType=d.data[v],v++,_=an(d.data,0,v),!(_<0)&&(d.description=or(d.data,v,_),v=_+1,d.mimeType===k?d.url=on(d.data,v,d.data.length):d.pictureData=d.data.subarray(v,d.data.length))))},"T*":function(d){d.data[0]===Lr.Utf8&&(d.value=or(d.data,1,d.data.length).replace(/\0*$/,""),d.values=d.value.split("\0"))},TXXX:function(d){var v;d.data[0]===Lr.Utf8&&(v=an(d.data,0,1),v!==-1&&(d.description=or(d.data,1,v),d.value=or(d.data,v+1,d.data.length).replace(/\0*$/,""),d.data=d.value))},"W*":function(d){d.url=on(d.data,0,d.data.length).replace(/\0.*$/,"")},WXXX:function(d){var v;d.data[0]===Lr.Utf8&&(v=an(d.data,0,1),v!==-1&&(d.description=or(d.data,1,v),d.url=on(d.data,v+1,d.data.length).replace(/\0.*$/,"")))},PRIV:function(d){var v;for(v=0;v<d.data.length;v++)if(d.data[v]===0){d.owner=on(d.data,0,v);break}d.privateData=d.data.subarray(v+1),d.data=d.privateData}},_r=function(d){var v,T,_=10,k=0,A=[];if(!(d.length<10||d[0]!==73||d[1]!==68||d[2]!==51)){k=Dn(d.subarray(6,10)),k+=10;var z=d[5]&64;z&&(_+=4,_+=Dn(d.subarray(10,14)),k-=Dn(d.subarray(16,20)));do{if(v=Dn(d.subarray(_+4,_+8)),v<1)break;T=String.fromCharCode(d[_],d[_+1],d[_+2],d[_+3]);var W={id:T,data:d.subarray(_+10,_+v+10)};W.key=W.id,ln[W.id]?ln[W.id](W):W.id[0]==="T"?ln["T*"](W):W.id[0]==="W"&&ln["W*"](W),A.push(W),_+=10,_+=v}while(_<k);return A}},cu={parseId3Frames:_r,parseSyncSafeInteger:Dn,frameParsers:ln},la=t,hu=os,Tr=cu,cs;cs=function(d){var v={descriptor:d&&d.descriptor},T=0,_=[],k=0,A;if(cs.prototype.init.call(this),this.dispatchType=hu.METADATA_STREAM_TYPE.toString(16),v.descriptor)for(A=0;A<v.descriptor.length;A++)this.dispatchType+=("00"+v.descriptor[A].toString(16)).slice(-2);this.push=function(z){var W,Y,J,ae,me,xe;if(z.type==="timed-metadata"){if(z.dataAlignmentIndicator&&(k=0,_.length=0),_.length===0&&(z.data.length<10||z.data[0]!==73||z.data[1]!==68||z.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(_.push(z),k+=z.data.byteLength,_.length===1&&(T=Tr.parseSyncSafeInteger(z.data.subarray(6,10)),T+=10),!(k<T)){for(W={data:new Uint8Array(T),frames:[],pts:_[0].pts,dts:_[0].dts},me=0;me<T;)W.data.set(_[0].data.subarray(0,T-me),me),me+=_[0].data.byteLength,k-=_[0].data.byteLength,_.shift();Y=10,W.data[5]&64&&(Y+=4,Y+=Tr.parseSyncSafeInteger(W.data.subarray(10,14)),T-=Tr.parseSyncSafeInteger(W.data.subarray(16,20)));do{if(J=Tr.parseSyncSafeInteger(W.data.subarray(Y+4,Y+8)),J<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(xe=String.fromCharCode(W.data[Y],W.data[Y+1],W.data[Y+2],W.data[Y+3]),ae={id:xe,data:W.data.subarray(Y+10,Y+J+10)},ae.key=ae.id,Tr.frameParsers[ae.id]?Tr.frameParsers[ae.id](ae):ae.id[0]==="T"?Tr.frameParsers["T*"](ae):ae.id[0]==="W"&&Tr.frameParsers["W*"](ae),ae.owner==="com.apple.streaming.transportStreamTimestamp"){var ye=ae.data,Ue=(ye[3]&1)<<30|ye[4]<<22|ye[5]<<14|ye[6]<<6|ye[7]>>>2;Ue*=4,Ue+=ye[7]&3,ae.timeStamp=Ue,W.pts===void 0&&W.dts===void 0&&(W.pts=ae.timeStamp,W.dts=ae.timeStamp),this.trigger("timestamp",ae)}W.frames.push(ae),Y+=10,Y+=J}while(Y<T);this.trigger("data",W)}}}},cs.prototype=new la;var od=cs,Nn=t,Ln=sa,Oi=os,ld=ls.TimestampRolloverStream,ua,On,ca,Mn=188,ha=71;ua=function(){var d=new Uint8Array(Mn),v=0;ua.prototype.init.call(this),this.push=function(T){var _=0,k=Mn,A;for(v?(A=new Uint8Array(T.byteLength+v),A.set(d.subarray(0,v)),A.set(T,v),v=0):A=T;k<A.byteLength;){if(A[_]===ha&&A[k]===ha){this.trigger("data",A.subarray(_,k)),_+=Mn,k+=Mn;continue}_++,k++}_<A.byteLength&&(d.set(A.subarray(_),0),v=A.byteLength-_)},this.flush=function(){v===Mn&&d[0]===ha&&(this.trigger("data",d),v=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){v=0,this.trigger("reset")}},ua.prototype=new Nn,On=function(){var d,v,T,_;On.prototype.init.call(this),_=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,d=function(k,A){var z=0;A.payloadUnitStartIndicator&&(z+=k[z]+1),A.type==="pat"?v(k.subarray(z),A):T(k.subarray(z),A)},v=function(k,A){A.section_number=k[7],A.last_section_number=k[8],_.pmtPid=(k[10]&31)<<8|k[11],A.pmtPid=_.pmtPid},T=function(k,A){var z,W,Y,J;if(k[5]&1){for(_.programMapTable={video:null,audio:null,"timed-metadata":{}},z=(k[1]&15)<<8|k[2],W=3+z-4,Y=(k[10]&15)<<8|k[11],J=12+Y;J<W;){var ae=k[J],me=(k[J+1]&31)<<8|k[J+2];ae===Oi.H264_STREAM_TYPE&&_.programMapTable.video===null?_.programMapTable.video=me:ae===Oi.ADTS_STREAM_TYPE&&_.programMapTable.audio===null?_.programMapTable.audio=me:ae===Oi.METADATA_STREAM_TYPE&&(_.programMapTable["timed-metadata"][me]=ae),J+=((k[J+3]&15)<<8|k[J+4])+5}A.programMapTable=_.programMapTable}},this.push=function(k){var A={},z=4;if(A.payloadUnitStartIndicator=!!(k[1]&64),A.pid=k[1]&31,A.pid<<=8,A.pid|=k[2],(k[3]&48)>>>4>1&&(z+=k[z]+1),A.pid===0)A.type="pat",d(k.subarray(z),A),this.trigger("data",A);else if(A.pid===this.pmtPid)for(A.type="pmt",d(k.subarray(z),A),this.trigger("data",A);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([k,z,A]):this.processPes_(k,z,A)},this.processPes_=function(k,A,z){z.pid===this.programMapTable.video?z.streamType=Oi.H264_STREAM_TYPE:z.pid===this.programMapTable.audio?z.streamType=Oi.ADTS_STREAM_TYPE:z.streamType=this.programMapTable["timed-metadata"][z.pid],z.type="pes",z.data=k.subarray(A),this.trigger("data",z)}},On.prototype=new Nn,On.STREAM_TYPES={h264:27,adts:15},ca=function(){var d=this,v=!1,T={data:[],size:0},_={data:[],size:0},k={data:[],size:0},A,z=function(Y,J){var ae;const me=Y[0]<<16|Y[1]<<8|Y[2];J.data=new Uint8Array,me===1&&(J.packetLength=6+(Y[4]<<8|Y[5]),J.dataAlignmentIndicator=(Y[6]&4)!==0,ae=Y[7],ae&192&&(J.pts=(Y[9]&14)<<27|(Y[10]&255)<<20|(Y[11]&254)<<12|(Y[12]&255)<<5|(Y[13]&254)>>>3,J.pts*=4,J.pts+=(Y[13]&6)>>>1,J.dts=J.pts,ae&64&&(J.dts=(Y[14]&14)<<27|(Y[15]&255)<<20|(Y[16]&254)<<12|(Y[17]&255)<<5|(Y[18]&254)>>>3,J.dts*=4,J.dts+=(Y[18]&6)>>>1)),J.data=Y.subarray(9+Y[8]))},W=function(Y,J,ae){var me=new Uint8Array(Y.size),xe={type:J},ye=0,Ue=0,Qe=!1,Zt;if(!(!Y.data.length||Y.size<9)){for(xe.trackId=Y.data[0].pid,ye=0;ye<Y.data.length;ye++)Zt=Y.data[ye],me.set(Zt.data,Ue),Ue+=Zt.data.byteLength;z(me,xe),Qe=J==="video"||xe.packetLength<=Y.size,(ae||Qe)&&(Y.size=0,Y.data.length=0),Qe&&d.trigger("data",xe)}};ca.prototype.init.call(this),this.push=function(Y){({pat:function(){},pes:function(){var J,ae;switch(Y.streamType){case Oi.H264_STREAM_TYPE:J=T,ae="video";break;case Oi.ADTS_STREAM_TYPE:J=_,ae="audio";break;case Oi.METADATA_STREAM_TYPE:J=k,ae="timed-metadata";break;default:return}Y.payloadUnitStartIndicator&&W(J,ae,!0),J.data.push(Y),J.size+=Y.data.byteLength},pmt:function(){var J={type:"metadata",tracks:[]};A=Y.programMapTable,A.video!==null&&J.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+A.video,codec:"avc",type:"video"}),A.audio!==null&&J.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+A.audio,codec:"adts",type:"audio"}),v=!0,d.trigger("data",J)}})[Y.type]()},this.reset=function(){T.size=0,T.data.length=0,_.size=0,_.data.length=0,this.trigger("reset")},this.flushStreams_=function(){W(T,"video"),W(_,"audio"),W(k,"timed-metadata")},this.flush=function(){if(!v&&A){var Y={type:"metadata",tracks:[]};A.video!==null&&Y.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+A.video,codec:"avc",type:"video"}),A.audio!==null&&Y.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+A.audio,codec:"adts",type:"audio"}),d.trigger("data",Y)}v=!1,this.flushStreams_(),this.trigger("done")}},ca.prototype=new Nn;var du={PAT_PID:0,MP2T_PACKET_LENGTH:Mn,TransportPacketStream:ua,TransportParseStream:On,ElementaryStream:ca,TimestampRolloverStream:ld,CaptionStream:Ln.CaptionStream,Cea608Stream:Ln.Cea608Stream,Cea708Stream:Ln.Cea708Stream,MetadataStream:od};for(var Uo in Oi)Oi.hasOwnProperty(Uo)&&(du[Uo]=Oi[Uo]);var ud=du,cd=t,hd=nt.ONE_SECOND_IN_TS,da,hs=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];da=function(d){var v,T=0;da.prototype.init.call(this),this.skipWarn_=function(_,k){this.trigger("log",{level:"warn",message:`adts skiping bytes ${_} to ${k} in frame ${T} outside syncword`})},this.push=function(_){var k=0,A,z,W,Y,J;if(d||(T=0),_.type==="audio"){v&&v.length?(W=v,v=new Uint8Array(W.byteLength+_.data.byteLength),v.set(W),v.set(_.data,W.byteLength)):v=_.data;for(var ae;k+7<v.length;){if(v[k]!==255||(v[k+1]&246)!==240){typeof ae!="number"&&(ae=k),k++;continue}if(typeof ae=="number"&&(this.skipWarn_(ae,k),ae=null),z=(~v[k+1]&1)*2,A=(v[k+3]&3)<<11|v[k+4]<<3|(v[k+5]&224)>>5,Y=((v[k+6]&3)+1)*1024,J=Y*hd/hs[(v[k+2]&60)>>>2],v.byteLength-k<A)break;this.trigger("data",{pts:_.pts+T*J,dts:_.dts+T*J,sampleCount:Y,audioobjecttype:(v[k+2]>>>6&3)+1,channelcount:(v[k+2]&1)<<2|(v[k+3]&192)>>>6,samplerate:hs[(v[k+2]&60)>>>2],samplingfrequencyindex:(v[k+2]&60)>>>2,samplesize:16,data:v.subarray(k+7+z,k+A)}),T++,k+=A}typeof ae=="number"&&(this.skipWarn_(ae,k),ae=null),v=v.subarray(k)}},this.flush=function(){T=0,this.trigger("done")},this.reset=function(){v=void 0,this.trigger("reset")},this.endTimeline=function(){v=void 0,this.trigger("endedtimeline")}},da.prototype=new cd;var fa=da,fu;fu=function(d){var v=d.byteLength,T=0,_=0;this.length=function(){return 8*v},this.bitsAvailable=function(){return 8*v+_},this.loadWord=function(){var k=d.byteLength-v,A=new Uint8Array(4),z=Math.min(4,v);if(z===0)throw new Error("no bytes available");A.set(d.subarray(k,k+z)),T=new DataView(A.buffer).getUint32(0),_=z*8,v-=z},this.skipBits=function(k){var A;_>k?(T<<=k,_-=k):(k-=_,A=Math.floor(k/8),k-=A*8,v-=A,this.loadWord(),T<<=k,_-=k)},this.readBits=function(k){var A=Math.min(_,k),z=T>>>32-A;return _-=A,_>0?T<<=A:v>0&&this.loadWord(),A=k-A,A>0?z<<A|this.readBits(A):z},this.skipLeadingZeros=function(){var k;for(k=0;k<_;++k)if((T&2147483648>>>k)!==0)return T<<=k,_-=k,k;return this.loadWord(),k+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var k=this.skipLeadingZeros();return this.readBits(k+1)-1},this.readExpGolomb=function(){var k=this.readUnsignedExpGolomb();return 1&k?1+k>>>1:-1*(k>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var dd=fu,$o=t,fd=dd,ds,pa,pu;pa=function(){var d=0,v,T;pa.prototype.init.call(this),this.push=function(_){var k;T?(k=new Uint8Array(T.byteLength+_.data.byteLength),k.set(T),k.set(_.data,T.byteLength),T=k):T=_.data;for(var A=T.byteLength;d<A-3;d++)if(T[d+2]===1){v=d+5;break}for(;v<A;)switch(T[v]){case 0:if(T[v-1]!==0){v+=2;break}else if(T[v-2]!==0){v++;break}d+3!==v-2&&this.trigger("data",T.subarray(d+3,v-2));do v++;while(T[v]!==1&&v<A);d=v-2,v+=3;break;case 1:if(T[v-1]!==0||T[v-2]!==0){v+=3;break}this.trigger("data",T.subarray(d+3,v-2)),d=v-2,v+=3;break;default:v+=3;break}T=T.subarray(d),v-=d,d=0},this.reset=function(){T=null,d=0,this.trigger("reset")},this.flush=function(){T&&T.byteLength>3&&this.trigger("data",T.subarray(d+3)),T=null,d=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},pa.prototype=new $o,pu={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},ds=function(){var d=new pa,v,T,_,k,A,z,W;ds.prototype.init.call(this),v=this,this.push=function(Y){Y.type==="video"&&(T=Y.trackId,_=Y.pts,k=Y.dts,d.push(Y))},d.on("data",function(Y){var J={trackId:T,pts:_,dts:k,data:Y,nalUnitTypeCode:Y[0]&31};switch(J.nalUnitTypeCode){case 5:J.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:J.nalUnitType="sei_rbsp",J.escapedRBSP=A(Y.subarray(1));break;case 7:J.nalUnitType="seq_parameter_set_rbsp",J.escapedRBSP=A(Y.subarray(1)),J.config=z(J.escapedRBSP);break;case 8:J.nalUnitType="pic_parameter_set_rbsp";break;case 9:J.nalUnitType="access_unit_delimiter_rbsp";break}v.trigger("data",J)}),d.on("done",function(){v.trigger("done")}),d.on("partialdone",function(){v.trigger("partialdone")}),d.on("reset",function(){v.trigger("reset")}),d.on("endedtimeline",function(){v.trigger("endedtimeline")}),this.flush=function(){d.flush()},this.partialFlush=function(){d.partialFlush()},this.reset=function(){d.reset()},this.endTimeline=function(){d.endTimeline()},W=function(Y,J){var ae=8,me=8,xe,ye;for(xe=0;xe<Y;xe++)me!==0&&(ye=J.readExpGolomb(),me=(ae+ye+256)%256),ae=me===0?ae:me},A=function(Y){for(var J=Y.byteLength,ae=[],me=1,xe,ye;me<J-2;)Y[me]===0&&Y[me+1]===0&&Y[me+2]===3?(ae.push(me+2),me+=2):me++;if(ae.length===0)return Y;xe=J-ae.length,ye=new Uint8Array(xe);var Ue=0;for(me=0;me<xe;Ue++,me++)Ue===ae[0]&&(Ue++,ae.shift()),ye[me]=Y[Ue];return ye},z=function(Y){var J=0,ae=0,me=0,xe=0,ye,Ue,Qe,Zt,Gi,Hn,Ko,Xo,Qo,Yo,Ou,wt=[1,1],Jo,Cr;if(ye=new fd(Y),Ue=ye.readUnsignedByte(),Zt=ye.readUnsignedByte(),Qe=ye.readUnsignedByte(),ye.skipUnsignedExpGolomb(),pu[Ue]&&(Gi=ye.readUnsignedExpGolomb(),Gi===3&&ye.skipBits(1),ye.skipUnsignedExpGolomb(),ye.skipUnsignedExpGolomb(),ye.skipBits(1),ye.readBoolean()))for(Ou=Gi!==3?8:12,Cr=0;Cr<Ou;Cr++)ye.readBoolean()&&(Cr<6?W(16,ye):W(64,ye));if(ye.skipUnsignedExpGolomb(),Hn=ye.readUnsignedExpGolomb(),Hn===0)ye.readUnsignedExpGolomb();else if(Hn===1)for(ye.skipBits(1),ye.skipExpGolomb(),ye.skipExpGolomb(),Ko=ye.readUnsignedExpGolomb(),Cr=0;Cr<Ko;Cr++)ye.skipExpGolomb();if(ye.skipUnsignedExpGolomb(),ye.skipBits(1),Xo=ye.readUnsignedExpGolomb(),Qo=ye.readUnsignedExpGolomb(),Yo=ye.readBits(1),Yo===0&&ye.skipBits(1),ye.skipBits(1),ye.readBoolean()&&(J=ye.readUnsignedExpGolomb(),ae=ye.readUnsignedExpGolomb(),me=ye.readUnsignedExpGolomb(),xe=ye.readUnsignedExpGolomb()),ye.readBoolean()&&ye.readBoolean()){switch(Jo=ye.readUnsignedByte(),Jo){case 1:wt=[1,1];break;case 2:wt=[12,11];break;case 3:wt=[10,11];break;case 4:wt=[16,11];break;case 5:wt=[40,33];break;case 6:wt=[24,11];break;case 7:wt=[20,11];break;case 8:wt=[32,11];break;case 9:wt=[80,33];break;case 10:wt=[18,11];break;case 11:wt=[15,11];break;case 12:wt=[64,33];break;case 13:wt=[160,99];break;case 14:wt=[4,3];break;case 15:wt=[3,2];break;case 16:wt=[2,1];break;case 255:{wt=[ye.readUnsignedByte()<<8|ye.readUnsignedByte(),ye.readUnsignedByte()<<8|ye.readUnsignedByte()];break}}wt&&wt[0]/wt[1]}return{profileIdc:Ue,levelIdc:Qe,profileCompatibility:Zt,width:(Xo+1)*16-J*2-ae*2,height:(2-Yo)*(Qo+1)*16-me*2-xe*2,sarRatio:wt}}},ds.prototype=new $o;var pd={H264Stream:ds},ma=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Rn=function(d,v){var T=d[v+6]<<21|d[v+7]<<14|d[v+8]<<7|d[v+9],_=d[v+5],k=(_&16)>>4;return T=T>=0?T:0,k?T+20:T+10},fs=function(d,v){return d.length-v<10||d[v]!==73||d[v+1]!==68||d[v+2]!==51?v:(v+=Rn(d,v),fs(d,v))},un=function(d){var v=fs(d,0);return d.length>=v+2&&(d[v]&255)===255&&(d[v+1]&240)===240&&(d[v+1]&22)===16},mu=function(d){return d[0]<<21|d[1]<<14|d[2]<<7|d[3]},gu=function(d,v,T){var _,k="";for(_=v;_<T;_++)k+="%"+("00"+d[_].toString(16)).slice(-2);return k},vu=function(d,v,T){return unescape(gu(d,v,T))},yu=function(d,v){var T=(d[v+5]&224)>>5,_=d[v+4]<<3,k=d[v+3]&6144;return k|_|T},md=function(d,v){return d[v]===73&&d[v+1]===68&&d[v+2]===51?"timed-metadata":d[v]&!0&&(d[v+1]&240)===240?"audio":null},gd=function(d){for(var v=0;v+5<d.length;){if(d[v]!==255||(d[v+1]&246)!==240){v++;continue}return ma[(d[v+2]&60)>>>2]}return null},vd=function(d){var v,T,_,k;v=10,d[5]&64&&(v+=4,v+=mu(d.subarray(10,14)));do{if(T=mu(d.subarray(v+4,v+8)),T<1)return null;if(k=String.fromCharCode(d[v],d[v+1],d[v+2],d[v+3]),k==="PRIV"){_=d.subarray(v+10,v+T+10);for(var A=0;A<_.byteLength;A++)if(_[A]===0){var z=vu(_,0,A);if(z==="com.apple.streaming.transportStreamTimestamp"){var W=_.subarray(A+1),Y=(W[3]&1)<<30|W[4]<<22|W[5]<<14|W[6]<<6|W[7]>>>2;return Y*=4,Y+=W[7]&3,Y}break}}v+=10,v+=T}while(v<d.byteLength);return null},Bn={isLikelyAacData:un,parseId3TagSize:Rn,parseAdtsSize:yu,parseType:md,parseSampleRate:gd,parseAacTimestamp:vd},yd=t,Or=Bn,ga;ga=function(){var d=new Uint8Array,v=0;ga.prototype.init.call(this),this.setTimestamp=function(T){v=T},this.push=function(T){var _=0,k=0,A,z,W,Y;for(d.length?(Y=d.length,d=new Uint8Array(T.byteLength+Y),d.set(d.subarray(0,Y)),d.set(T,Y)):d=T;d.length-k>=3;){if(d[k]===73&&d[k+1]===68&&d[k+2]===51){if(d.length-k<10||(_=Or.parseId3TagSize(d,k),k+_>d.length))break;z={type:"timed-metadata",data:d.subarray(k,k+_)},this.trigger("data",z),k+=_;continue}else if((d[k]&255)===255&&(d[k+1]&240)===240){if(d.length-k<7||(_=Or.parseAdtsSize(d,k),k+_>d.length))break;W={type:"audio",data:d.subarray(k,k+_),pts:v,dts:v},this.trigger("data",W),k+=_;continue}k++}A=d.length-k,A>0?d=d.subarray(k):d=new Uint8Array},this.reset=function(){d=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){d=new Uint8Array,this.trigger("endedtimeline")}},ga.prototype=new yd;var _d=ga,_t=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Td=_t,bd=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Sd=bd,ps=t,ms=Re,Fn=ke,va=as,Mi=fe,br=ud,gs=nt,jo=fa,vs=pd.H264Stream,ys=_d,Cd=Bn.isLikelyAacData,Ed=nt.ONE_SECOND_IN_TS,_u=Td,Tu=Sd,ya,_s,_a,cn,wd=function(d,v){v.stream=d,this.trigger("log",v)},Ts=function(d,v){for(var T=Object.keys(v),_=0;_<T.length;_++){var k=T[_];k==="headOfPipeline"||!v[k].on||v[k].on("log",wd.bind(d,k))}},Un=function(d,v){var T;if(d.length!==v.length)return!1;for(T=0;T<d.length;T++)if(d[T]!==v[T])return!1;return!0},bu=function(d,v,T,_,k,A){var z=T-v,W=_-v,Y=k-T;return{start:{dts:d,pts:d+z},end:{dts:d+W,pts:d+Y},prependedContentDuration:A,baseMediaDecodeTime:d}};_s=function(d,v){var T=[],_,k=0,A=0,z=1/0;v=v||{},_=v.firstSequenceNumber||0,_s.prototype.init.call(this),this.push=function(W){Mi.collectDtsInfo(d,W),d&&_u.forEach(function(Y){d[Y]=W[Y]}),T.push(W)},this.setEarliestDts=function(W){k=W},this.setVideoBaseMediaDecodeTime=function(W){z=W},this.setAudioAppendStart=function(W){A=W},this.flush=function(){var W,Y,J,ae,me,xe,ye;if(T.length===0){this.trigger("done","AudioSegmentStream");return}W=va.trimAdtsFramesByEarliestDts(T,d,k),d.baseMediaDecodeTime=Mi.calculateTrackBaseMediaDecodeTime(d,v.keepOriginalTimestamps),ye=va.prefixWithSilence(d,W,A,z),d.samples=va.generateSampleTable(W),J=ms.mdat(va.concatenateFrameData(W)),T=[],Y=ms.moof(_,[d]),ae=new Uint8Array(Y.byteLength+J.byteLength),_++,ae.set(Y),ae.set(J,Y.byteLength),Mi.clearDtsInfo(d),me=Math.ceil(Ed*1024/d.samplerate),W.length&&(xe=W.length*me,this.trigger("segmentTimingInfo",bu(gs.audioTsToVideoTs(d.baseMediaDecodeTime,d.samplerate),W[0].dts,W[0].pts,W[0].dts+xe,W[0].pts+xe,ye||0)),this.trigger("timingInfo",{start:W[0].pts,end:W[0].pts+xe})),this.trigger("data",{track:d,boxes:ae}),this.trigger("done","AudioSegmentStream")},this.reset=function(){Mi.clearDtsInfo(d),T=[],this.trigger("reset")}},_s.prototype=new ps,ya=function(d,v){var T,_=[],k=[],A,z;v=v||{},T=v.firstSequenceNumber||0,ya.prototype.init.call(this),delete d.minPTS,this.gopCache_=[],this.push=function(W){Mi.collectDtsInfo(d,W),W.nalUnitType==="seq_parameter_set_rbsp"&&!A&&(A=W.config,d.sps=[W.data],Tu.forEach(function(Y){d[Y]=A[Y]},this)),W.nalUnitType==="pic_parameter_set_rbsp"&&!z&&(z=W.data,d.pps=[W.data]),_.push(W)},this.flush=function(){for(var W,Y,J,ae,me,xe,ye=0,Ue,Qe;_.length&&_[0].nalUnitType!=="access_unit_delimiter_rbsp";)_.shift();if(_.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(W=Fn.groupNalsIntoFrames(_),J=Fn.groupFramesIntoGops(W),J[0][0].keyFrame||(Y=this.getGopForFusion_(_[0],d),Y?(ye=Y.duration,J.unshift(Y),J.byteLength+=Y.byteLength,J.nalCount+=Y.nalCount,J.pts=Y.pts,J.dts=Y.dts,J.duration+=Y.duration):J=Fn.extendFirstKeyFrame(J)),k.length){var Zt;if(v.alignGopsAtEnd?Zt=this.alignGopsAtEnd_(J):Zt=this.alignGopsAtStart_(J),!Zt){this.gopCache_.unshift({gop:J.pop(),pps:d.pps,sps:d.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),_=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}Mi.clearDtsInfo(d),J=Zt}Mi.collectDtsInfo(d,J),d.samples=Fn.generateSampleTable(J),me=ms.mdat(Fn.concatenateNalData(J)),d.baseMediaDecodeTime=Mi.calculateTrackBaseMediaDecodeTime(d,v.keepOriginalTimestamps),this.trigger("processedGopsInfo",J.map(function(Gi){return{pts:Gi.pts,dts:Gi.dts,byteLength:Gi.byteLength}})),Ue=J[0],Qe=J[J.length-1],this.trigger("segmentTimingInfo",bu(d.baseMediaDecodeTime,Ue.dts,Ue.pts,Qe.dts+Qe.duration,Qe.pts+Qe.duration,ye)),this.trigger("timingInfo",{start:J[0].pts,end:J[J.length-1].pts+J[J.length-1].duration}),this.gopCache_.unshift({gop:J.pop(),pps:d.pps,sps:d.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),_=[],this.trigger("baseMediaDecodeTime",d.baseMediaDecodeTime),this.trigger("timelineStartInfo",d.timelineStartInfo),ae=ms.moof(T,[d]),xe=new Uint8Array(ae.byteLength+me.byteLength),T++,xe.set(ae),xe.set(me,ae.byteLength),this.trigger("data",{track:d,boxes:xe}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),_=[],this.gopCache_.length=0,k.length=0,this.trigger("reset")},this.resetStream_=function(){Mi.clearDtsInfo(d),A=void 0,z=void 0},this.getGopForFusion_=function(W){var Y=45e3,J=1/0,ae,me,xe,ye,Ue;for(Ue=0;Ue<this.gopCache_.length;Ue++)ye=this.gopCache_[Ue],xe=ye.gop,!(!(d.pps&&Un(d.pps[0],ye.pps[0]))||!(d.sps&&Un(d.sps[0],ye.sps[0])))&&(xe.dts<d.timelineStartInfo.dts||(ae=W.dts-xe.dts-xe.duration,ae>=-1e4&&ae<=Y&&(!me||J>ae)&&(me=ye,J=ae)));return me?me.gop:null},this.alignGopsAtStart_=function(W){var Y,J,ae,me,xe,ye,Ue,Qe;for(xe=W.byteLength,ye=W.nalCount,Ue=W.duration,Y=J=0;Y<k.length&&J<W.length&&(ae=k[Y],me=W[J],ae.pts!==me.pts);){if(me.pts>ae.pts){Y++;continue}J++,xe-=me.byteLength,ye-=me.nalCount,Ue-=me.duration}return J===0?W:J===W.length?null:(Qe=W.slice(J),Qe.byteLength=xe,Qe.duration=Ue,Qe.nalCount=ye,Qe.pts=Qe[0].pts,Qe.dts=Qe[0].dts,Qe)},this.alignGopsAtEnd_=function(W){var Y,J,ae,me,xe,ye;for(Y=k.length-1,J=W.length-1,xe=null,ye=!1;Y>=0&&J>=0;){if(ae=k[Y],me=W[J],ae.pts===me.pts){ye=!0;break}if(ae.pts>me.pts){Y--;continue}Y===k.length-1&&(xe=J),J--}if(!ye&&xe===null)return null;var Ue;if(ye?Ue=J:Ue=xe,Ue===0)return W;var Qe=W.slice(Ue),Zt=Qe.reduce(function(Gi,Hn){return Gi.byteLength+=Hn.byteLength,Gi.duration+=Hn.duration,Gi.nalCount+=Hn.nalCount,Gi},{byteLength:0,duration:0,nalCount:0});return Qe.byteLength=Zt.byteLength,Qe.duration=Zt.duration,Qe.nalCount=Zt.nalCount,Qe.pts=Qe[0].pts,Qe.dts=Qe[0].dts,Qe},this.alignGopsWith=function(W){k=W}},ya.prototype=new ps,cn=function(d,v){this.numberOfTracks=0,this.metadataStream=v,d=d||{},typeof d.remux<"u"?this.remuxTracks=!!d.remux:this.remuxTracks=!0,typeof d.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=d.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,cn.prototype.init.call(this),this.push=function(T){if(T.content||T.text)return this.pendingCaptions.push(T);if(T.frames)return this.pendingMetadata.push(T);this.pendingTracks.push(T.track),this.pendingBytes+=T.boxes.byteLength,T.track.type==="video"&&(this.videoTrack=T.track,this.pendingBoxes.push(T.boxes)),T.track.type==="audio"&&(this.audioTrack=T.track,this.pendingBoxes.unshift(T.boxes))}},cn.prototype=new ps,cn.prototype.flush=function(d){var v=0,T={captions:[],captionStreams:{},metadata:[],info:{}},_,k,A,z=0,W;if(this.pendingTracks.length<this.numberOfTracks){if(d!=="VideoSegmentStream"&&d!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(z=this.videoTrack.timelineStartInfo.pts,Tu.forEach(function(Y){T.info[Y]=this.videoTrack[Y]},this)):this.audioTrack&&(z=this.audioTrack.timelineStartInfo.pts,_u.forEach(function(Y){T.info[Y]=this.audioTrack[Y]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?T.type=this.pendingTracks[0].type:T.type="combined",this.emittedTracks+=this.pendingTracks.length,A=ms.initSegment(this.pendingTracks),T.initSegment=new Uint8Array(A.byteLength),T.initSegment.set(A),T.data=new Uint8Array(this.pendingBytes),W=0;W<this.pendingBoxes.length;W++)T.data.set(this.pendingBoxes[W],v),v+=this.pendingBoxes[W].byteLength;for(W=0;W<this.pendingCaptions.length;W++)_=this.pendingCaptions[W],_.startTime=gs.metadataTsToSeconds(_.startPts,z,this.keepOriginalTimestamps),_.endTime=gs.metadataTsToSeconds(_.endPts,z,this.keepOriginalTimestamps),T.captionStreams[_.stream]=!0,T.captions.push(_);for(W=0;W<this.pendingMetadata.length;W++)k=this.pendingMetadata[W],k.cueTime=gs.metadataTsToSeconds(k.pts,z,this.keepOriginalTimestamps),T.metadata.push(k);for(T.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",T),W=0;W<T.captions.length;W++)_=T.captions[W],this.trigger("caption",_);for(W=0;W<T.metadata.length;W++)k=T.metadata[W],this.trigger("id3Frame",k)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},cn.prototype.setRemux=function(d){this.remuxTracks=d},_a=function(d){var v=this,T=!0,_,k;_a.prototype.init.call(this),d=d||{},this.baseMediaDecodeTime=d.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var A={};this.transmuxPipeline_=A,A.type="aac",A.metadataStream=new br.MetadataStream,A.aacStream=new ys,A.audioTimestampRolloverStream=new br.TimestampRolloverStream("audio"),A.timedMetadataTimestampRolloverStream=new br.TimestampRolloverStream("timed-metadata"),A.adtsStream=new jo,A.coalesceStream=new cn(d,A.metadataStream),A.headOfPipeline=A.aacStream,A.aacStream.pipe(A.audioTimestampRolloverStream).pipe(A.adtsStream),A.aacStream.pipe(A.timedMetadataTimestampRolloverStream).pipe(A.metadataStream).pipe(A.coalesceStream),A.metadataStream.on("timestamp",function(z){A.aacStream.setTimestamp(z.timeStamp)}),A.aacStream.on("data",function(z){z.type!=="timed-metadata"&&z.type!=="audio"||A.audioSegmentStream||(k=k||{timelineStartInfo:{baseMediaDecodeTime:v.baseMediaDecodeTime},codec:"adts",type:"audio"},A.coalesceStream.numberOfTracks++,A.audioSegmentStream=new _s(k,d),A.audioSegmentStream.on("log",v.getLogTrigger_("audioSegmentStream")),A.audioSegmentStream.on("timingInfo",v.trigger.bind(v,"audioTimingInfo")),A.adtsStream.pipe(A.audioSegmentStream).pipe(A.coalesceStream),v.trigger("trackinfo",{hasAudio:!!k,hasVideo:!!_}))}),A.coalesceStream.on("data",this.trigger.bind(this,"data")),A.coalesceStream.on("done",this.trigger.bind(this,"done")),Ts(this,A)},this.setupTsPipeline=function(){var A={};this.transmuxPipeline_=A,A.type="ts",A.metadataStream=new br.MetadataStream,A.packetStream=new br.TransportPacketStream,A.parseStream=new br.TransportParseStream,A.elementaryStream=new br.ElementaryStream,A.timestampRolloverStream=new br.TimestampRolloverStream,A.adtsStream=new jo,A.h264Stream=new vs,A.captionStream=new br.CaptionStream(d),A.coalesceStream=new cn(d,A.metadataStream),A.headOfPipeline=A.packetStream,A.packetStream.pipe(A.parseStream).pipe(A.elementaryStream).pipe(A.timestampRolloverStream),A.timestampRolloverStream.pipe(A.h264Stream),A.timestampRolloverStream.pipe(A.adtsStream),A.timestampRolloverStream.pipe(A.metadataStream).pipe(A.coalesceStream),A.h264Stream.pipe(A.captionStream).pipe(A.coalesceStream),A.elementaryStream.on("data",function(z){var W;if(z.type==="metadata"){for(W=z.tracks.length;W--;)!_&&z.tracks[W].type==="video"?(_=z.tracks[W],_.timelineStartInfo.baseMediaDecodeTime=v.baseMediaDecodeTime):!k&&z.tracks[W].type==="audio"&&(k=z.tracks[W],k.timelineStartInfo.baseMediaDecodeTime=v.baseMediaDecodeTime);_&&!A.videoSegmentStream&&(A.coalesceStream.numberOfTracks++,A.videoSegmentStream=new ya(_,d),A.videoSegmentStream.on("log",v.getLogTrigger_("videoSegmentStream")),A.videoSegmentStream.on("timelineStartInfo",function(Y){k&&!d.keepOriginalTimestamps&&(k.timelineStartInfo=Y,A.audioSegmentStream.setEarliestDts(Y.dts-v.baseMediaDecodeTime))}),A.videoSegmentStream.on("processedGopsInfo",v.trigger.bind(v,"gopInfo")),A.videoSegmentStream.on("segmentTimingInfo",v.trigger.bind(v,"videoSegmentTimingInfo")),A.videoSegmentStream.on("baseMediaDecodeTime",function(Y){k&&A.audioSegmentStream.setVideoBaseMediaDecodeTime(Y)}),A.videoSegmentStream.on("timingInfo",v.trigger.bind(v,"videoTimingInfo")),A.h264Stream.pipe(A.videoSegmentStream).pipe(A.coalesceStream)),k&&!A.audioSegmentStream&&(A.coalesceStream.numberOfTracks++,A.audioSegmentStream=new _s(k,d),A.audioSegmentStream.on("log",v.getLogTrigger_("audioSegmentStream")),A.audioSegmentStream.on("timingInfo",v.trigger.bind(v,"audioTimingInfo")),A.audioSegmentStream.on("segmentTimingInfo",v.trigger.bind(v,"audioSegmentTimingInfo")),A.adtsStream.pipe(A.audioSegmentStream).pipe(A.coalesceStream)),v.trigger("trackinfo",{hasAudio:!!k,hasVideo:!!_})}}),A.coalesceStream.on("data",this.trigger.bind(this,"data")),A.coalesceStream.on("id3Frame",function(z){z.dispatchType=A.metadataStream.dispatchType,v.trigger("id3Frame",z)}),A.coalesceStream.on("caption",this.trigger.bind(this,"caption")),A.coalesceStream.on("done",this.trigger.bind(this,"done")),Ts(this,A)},this.setBaseMediaDecodeTime=function(A){var z=this.transmuxPipeline_;d.keepOriginalTimestamps||(this.baseMediaDecodeTime=A),k&&(k.timelineStartInfo.dts=void 0,k.timelineStartInfo.pts=void 0,Mi.clearDtsInfo(k),z.audioTimestampRolloverStream&&z.audioTimestampRolloverStream.discontinuity()),_&&(z.videoSegmentStream&&(z.videoSegmentStream.gopCache_=[]),_.timelineStartInfo.dts=void 0,_.timelineStartInfo.pts=void 0,Mi.clearDtsInfo(_),z.captionStream.reset()),z.timestampRolloverStream&&z.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(A){k&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(A)},this.setRemux=function(A){var z=this.transmuxPipeline_;d.remux=A,z&&z.coalesceStream&&z.coalesceStream.setRemux(A)},this.alignGopsWith=function(A){_&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(A)},this.getLogTrigger_=function(A){var z=this;return function(W){W.stream=A,z.trigger("log",W)}},this.push=function(A){if(T){var z=Cd(A);z&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!z&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),T=!1}this.transmuxPipeline_.headOfPipeline.push(A)},this.flush=function(){T=!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()}},_a.prototype=new ps;var Su={Transmuxer:_a},Cu=function(d){return d>>>0},Eu=function(d){return("00"+d.toString(16)).slice(-2)},bs={toUnsigned:Cu,toHexString:Eu},wu=function(d){var v="";return v+=String.fromCharCode(d[0]),v+=String.fromCharCode(d[1]),v+=String.fromCharCode(d[2]),v+=String.fromCharCode(d[3]),v},Ta=wu,ku=bs.toUnsigned,xu=Ta,Ss=function(d,v){var T=[],_,k,A,z,W;if(!v.length)return null;for(_=0;_<d.byteLength;)k=ku(d[_]<<24|d[_+1]<<16|d[_+2]<<8|d[_+3]),A=xu(d.subarray(_+4,_+8)),z=k>1?_+k:d.byteLength,A===v[0]&&(v.length===1?T.push(d.subarray(_+8,z)):(W=Ss(d.subarray(_+8,z),v.slice(1)),W.length&&(T=T.concat(W)))),_=z;return T},$n=Ss,kd=bs.toUnsigned,xd=n.getUint64,Ad=function(d){var v={version:d[0],flags:new Uint8Array(d.subarray(1,4))};return v.version===1?v.baseMediaDecodeTime=xd(d.subarray(4)):v.baseMediaDecodeTime=kd(d[4]<<24|d[5]<<16|d[6]<<8|d[7]),v},Vo=Ad,Id=function(d){var v=new DataView(d.buffer,d.byteOffset,d.byteLength),T={version:d[0],flags:new Uint8Array(d.subarray(1,4)),trackId:v.getUint32(4)},_=T.flags[2]&1,k=T.flags[2]&2,A=T.flags[2]&8,z=T.flags[2]&16,W=T.flags[2]&32,Y=T.flags[0]&65536,J=T.flags[0]&131072,ae;return ae=8,_&&(ae+=4,T.baseDataOffset=v.getUint32(12),ae+=4),k&&(T.sampleDescriptionIndex=v.getUint32(ae),ae+=4),A&&(T.defaultSampleDuration=v.getUint32(ae),ae+=4),z&&(T.defaultSampleSize=v.getUint32(ae),ae+=4),W&&(T.defaultSampleFlags=v.getUint32(ae)),Y&&(T.durationIsEmpty=!0),!_&&J&&(T.baseDataOffsetIsMoof=!0),T},ba=Id,Pd=function(d){return{isLeading:(d[0]&12)>>>2,dependsOn:d[0]&3,isDependedOn:(d[1]&192)>>>6,hasRedundancy:(d[1]&48)>>>4,paddingValue:(d[1]&14)>>>1,isNonSyncSample:d[1]&1,degradationPriority:d[2]<<8|d[3]}},Dd=Pd,hn=Dd,ot=function(d){var v={version:d[0],flags:new Uint8Array(d.subarray(1,4)),samples:[]},T=new DataView(d.buffer,d.byteOffset,d.byteLength),_=v.flags[2]&1,k=v.flags[2]&4,A=v.flags[1]&1,z=v.flags[1]&2,W=v.flags[1]&4,Y=v.flags[1]&8,J=T.getUint32(4),ae=8,me;for(_&&(v.dataOffset=T.getInt32(ae),ae+=4),k&&J&&(me={flags:hn(d.subarray(ae,ae+4))},ae+=4,A&&(me.duration=T.getUint32(ae),ae+=4),z&&(me.size=T.getUint32(ae),ae+=4),Y&&(v.version===1?me.compositionTimeOffset=T.getInt32(ae):me.compositionTimeOffset=T.getUint32(ae),ae+=4),v.samples.push(me),J--);J--;)me={},A&&(me.duration=T.getUint32(ae),ae+=4),z&&(me.size=T.getUint32(ae),ae+=4),W&&(me.flags=hn(d.subarray(ae,ae+4)),ae+=4),Y&&(v.version===1?me.compositionTimeOffset=T.getInt32(ae):me.compositionTimeOffset=T.getUint32(ae),ae+=4),v.samples.push(me);return v},Mr=ot,Jt={tfdt:Vo,trun:Mr},zi={parseTfdt:Jt.tfdt,parseTrun:Jt.trun},Nd=function(d){for(var v=0,T=String.fromCharCode(d[v]),_="";T!=="\0";)_+=T,v++,T=String.fromCharCode(d[v]);return _+=T,_},Au={uint8ToCString:Nd},Sa=Au.uint8ToCString,Ld=n.getUint64,Od=function(d){var v=4,T=d[0],_,k,A,z,W,Y,J,ae;if(T===0){_=Sa(d.subarray(v)),v+=_.length,k=Sa(d.subarray(v)),v+=k.length;var me=new DataView(d.buffer);A=me.getUint32(v),v+=4,W=me.getUint32(v),v+=4,Y=me.getUint32(v),v+=4,J=me.getUint32(v),v+=4}else if(T===1){var me=new DataView(d.buffer);A=me.getUint32(v),v+=4,z=Ld(d.subarray(v)),v+=8,Y=me.getUint32(v),v+=4,J=me.getUint32(v),v+=4,_=Sa(d.subarray(v)),v+=_.length,k=Sa(d.subarray(v)),v+=k.length}ae=new Uint8Array(d.subarray(v,d.byteLength));var xe={scheme_id_uri:_,value:k,timescale:A||1,presentation_time:z,presentation_time_delta:W,event_duration:Y,id:J,message_data:ae};return Rd(T,xe)?xe:void 0},Md=function(d,v,T,_){return d||d===0?d/v:_+T/v},Rd=function(d,v){var T=v.scheme_id_uri!=="\0",_=d===0&&Iu(v.presentation_time_delta)&&T,k=d===1&&Iu(v.presentation_time)&&T;return!(d>1)&&_||k},Iu=function(d){return d!==void 0||d!==null},Bd={parseEmsgBox:Od,scaleTime:Md},jn;typeof window<"u"?jn=window:typeof s<"u"?jn=s:typeof self<"u"?jn=self:jn={};var $=jn,m=bs.toUnsigned,S=bs.toHexString,y=$n,E=Ta,x=Bd,N=ba,q=Mr,X=Vo,te=n.getUint64,Z,ie,ge,Ee,Pe,Se,ze,Lt=$,ai=cu.parseId3Frames;Z=function(d){var v={},T=y(d,["moov","trak"]);return T.reduce(function(_,k){var A,z,W,Y,J;return A=y(k,["tkhd"])[0],!A||(z=A[0],W=z===0?12:20,Y=m(A[W]<<24|A[W+1]<<16|A[W+2]<<8|A[W+3]),J=y(k,["mdia","mdhd"])[0],!J)?null:(z=J[0],W=z===0?12:20,_[Y]=m(J[W]<<24|J[W+1]<<16|J[W+2]<<8|J[W+3]),_)},v)},ie=function(d,v){var T;T=y(v,["moof","traf"]);var _=T.reduce(function(k,A){var z=y(A,["tfhd"])[0],W=m(z[4]<<24|z[5]<<16|z[6]<<8|z[7]),Y=d[W]||9e4,J=y(A,["tfdt"])[0],ae=new DataView(J.buffer,J.byteOffset,J.byteLength),me;J[0]===1?me=te(J.subarray(4,12)):me=ae.getUint32(4);let xe;return typeof me=="bigint"?xe=me/Lt.BigInt(Y):typeof me=="number"&&!isNaN(me)&&(xe=me/Y),xe<Number.MAX_SAFE_INTEGER&&(xe=Number(xe)),xe<k&&(k=xe),k},1/0);return typeof _=="bigint"||isFinite(_)?_:0},ge=function(d,v){var T=y(v,["moof","traf"]),_=0,k=0,A;if(T&&T.length){var z=y(T[0],["tfhd"])[0],W=y(T[0],["trun"])[0],Y=y(T[0],["tfdt"])[0];if(z){var J=N(z);A=J.trackId}if(Y){var ae=X(Y);_=ae.baseMediaDecodeTime}if(W){var me=q(W);me.samples&&me.samples.length&&(k=me.samples[0].compositionTimeOffset||0)}}var xe=d[A]||9e4;typeof _=="bigint"&&(k=Lt.BigInt(k),xe=Lt.BigInt(xe));var ye=(_+k)/xe;return typeof ye=="bigint"&&ye<Number.MAX_SAFE_INTEGER&&(ye=Number(ye)),ye},Ee=function(d){var v=y(d,["moov","trak"]),T=[];return v.forEach(function(_){var k=y(_,["mdia","hdlr"]),A=y(_,["tkhd"]);k.forEach(function(z,W){var Y=E(z.subarray(8,12)),J=A[W],ae,me,xe;Y==="vide"&&(ae=new DataView(J.buffer,J.byteOffset,J.byteLength),me=ae.getUint8(0),xe=me===0?ae.getUint32(12):ae.getUint32(20),T.push(xe))})}),T},Se=function(d){var v=d[0],T=v===0?12:20;return m(d[T]<<24|d[T+1]<<16|d[T+2]<<8|d[T+3])},Pe=function(d){var v=y(d,["moov","trak"]),T=[];return v.forEach(function(_){var k={},A=y(_,["tkhd"])[0],z,W;A&&(z=new DataView(A.buffer,A.byteOffset,A.byteLength),W=z.getUint8(0),k.id=W===0?z.getUint32(12):z.getUint32(20));var Y=y(_,["mdia","hdlr"])[0];if(Y){var J=E(Y.subarray(8,12));J==="vide"?k.type="video":J==="soun"?k.type="audio":k.type=J}var ae=y(_,["mdia","minf","stbl","stsd"])[0];if(ae){var me=ae.subarray(8);k.codec=E(me.subarray(4,8));var xe=y(me,[k.codec])[0],ye,Ue;xe&&(/^[asm]vc[1-9]$/i.test(k.codec)?(ye=xe.subarray(78),Ue=E(ye.subarray(4,8)),Ue==="avcC"&&ye.length>11?(k.codec+=".",k.codec+=S(ye[9]),k.codec+=S(ye[10]),k.codec+=S(ye[11])):k.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(k.codec)?(ye=xe.subarray(28),Ue=E(ye.subarray(4,8)),Ue==="esds"&&ye.length>20&&ye[19]!==0?(k.codec+="."+S(ye[19]),k.codec+="."+S(ye[20]>>>2&63).replace(/^0/,"")):k.codec="mp4a.40.2"):k.codec=k.codec.toLowerCase())}var Qe=y(_,["mdia","mdhd"])[0];Qe&&(k.timescale=Se(Qe)),T.push(k)}),T},ze=function(d,v=0){var T=y(d,["emsg"]);return T.map(_=>{var k=x.parseEmsgBox(new Uint8Array(_)),A=ai(k.message_data);return{cueTime:x.scaleTime(k.presentation_time,k.timescale,k.presentation_time_delta,v),duration:x.scaleTime(k.event_duration,k.timescale),frames:A}})};var Wi={findBox:y,parseType:E,timescale:Z,startTime:ie,compositionStartTime:ge,videoTrackIds:Ee,tracks:Pe,getTimescaleFromMediaHeader:Se,getEmsgID3:ze};const{parseTrun:Ho}=zi,{findBox:qo}=Wi;var zo=$,Pu=function(d){var v=qo(d,["moof","traf"]),T=qo(d,["mdat"]),_=[];return T.forEach(function(k,A){var z=v[A];_.push({mdat:k,traf:z})}),_},Wo=function(d,v,T){var _=v,k=T.defaultSampleDuration||0,A=T.defaultSampleSize||0,z=T.trackId,W=[];return d.forEach(function(Y){var J=Ho(Y),ae=J.samples;ae.forEach(function(me){me.duration===void 0&&(me.duration=k),me.size===void 0&&(me.size=A),me.trackId=z,me.dts=_,me.compositionTimeOffset===void 0&&(me.compositionTimeOffset=0),typeof _=="bigint"?(me.pts=_+zo.BigInt(me.compositionTimeOffset),_+=zo.BigInt(me.duration)):(me.pts=_+me.compositionTimeOffset,_+=me.duration)}),W=W.concat(ae)}),W},Go={getMdatTrafPairs:Pu,parseSamples:Wo},Ot=Li.discardEmulationPreventionBytes,Du=sa.CaptionStream,Sr=$n,R2=Vo,B2=ba,{getMdatTrafPairs:F2,parseSamples:U2}=Go,$2=function(d,v){for(var T=d,_=0;_<v.length;_++){var k=v[_];if(T<k.size)return k;T-=k.size}return null},j2=function(d,v,T){var _=new DataView(d.buffer,d.byteOffset,d.byteLength),k={logs:[],seiNals:[]},A,z,W,Y;for(z=0;z+4<d.length;z+=W)if(W=_.getUint32(z),z+=4,!(W<=0))switch(d[z]&31){case 6:var J=d.subarray(z+1,z+1+W),ae=$2(z,v);if(A={nalUnitType:"sei_rbsp",size:W,data:J,escapedRBSP:Ot(J),trackId:T},ae)A.pts=ae.pts,A.dts=ae.dts,Y=ae;else if(Y)A.pts=Y.pts,A.dts=Y.dts;else{k.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+z+" for trackId "+T+". See mux.js#223."});break}k.seiNals.push(A);break}return k},V2=function(d,v){var T={},_=F2(d);return _.forEach(function(k){var A=k.mdat,z=k.traf,W=Sr(z,["tfhd"]),Y=B2(W[0]),J=Y.trackId,ae=Sr(z,["tfdt"]),me=ae.length>0?R2(ae[0]).baseMediaDecodeTime:0,xe=Sr(z,["trun"]),ye,Ue;v===J&&xe.length>0&&(ye=U2(xe,me,Y),Ue=j2(A,ye,J),T[J]||(T[J]={seiNals:[],logs:[]}),T[J].seiNals=T[J].seiNals.concat(Ue.seiNals),T[J].logs=T[J].logs.concat(Ue.logs))}),T},H2=function(d,v,T){var _;if(v===null)return null;_=V2(d,v);var k=_[v]||{};return{seiNals:k.seiNals,logs:k.logs,timescale:T}},q2=function(){var d=!1,v,T,_,k,A,z;this.isInitialized=function(){return d},this.init=function(W){v=new Du,d=!0,z=W?W.isPartial:!1,v.on("data",function(Y){Y.startTime=Y.startPts/k,Y.endTime=Y.endPts/k,A.captions.push(Y),A.captionStreams[Y.stream]=!0}),v.on("log",function(Y){A.logs.push(Y)})},this.isNewInit=function(W,Y){return W&&W.length===0||Y&&typeof Y=="object"&&Object.keys(Y).length===0?!1:_!==W[0]||k!==Y[_]},this.parse=function(W,Y,J){var ae;if(this.isInitialized()){if(!Y||!J)return null;if(this.isNewInit(Y,J))_=Y[0],k=J[_];else if(_===null||!k)return T.push(W),null}else return null;for(;T.length>0;){var me=T.shift();this.parse(me,Y,J)}return ae=H2(W,_,k),ae&&ae.logs&&(A.logs=A.logs.concat(ae.logs)),ae===null||!ae.seiNals?A.logs.length?{logs:A.logs,captions:[],captionStreams:[]}:null:(this.pushNals(ae.seiNals),this.flushStream(),A)},this.pushNals=function(W){if(!this.isInitialized()||!W||W.length===0)return null;W.forEach(function(Y){v.push(Y)})},this.flushStream=function(){if(!this.isInitialized())return null;z?v.partialFlush():v.flush()},this.clearParsedCaptions=function(){A.captions=[],A.captionStreams={},A.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;v.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){T=[],_=null,k=null,A?this.clearParsedCaptions():A={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},z2=q2;const{parseTfdt:W2}=zi,Vn=$n,{getTimescaleFromMediaHeader:G2}=Wi,{parseSamples:K2,getMdatTrafPairs:X2}=Go;var lv=function(){let d=9e4;this.init=function(v){const T=Vn(v,["moov","trak","mdia","mdhd"])[0];T&&(d=G2(T))},this.parseSegment=function(v){const T=[],_=X2(v);let k=0;return _.forEach(function(A){const z=A.mdat,W=A.traf,Y=Vn(W,["tfdt"])[0],J=Vn(W,["tfhd"])[0],ae=Vn(W,["trun"]);if(Y&&(k=W2(Y).baseMediaDecodeTime),ae.length&&J){const me=K2(ae,k,J);let xe=0;me.forEach(function(ye){const Ue="utf-8",Qe=new TextDecoder(Ue),Zt=z.slice(xe,xe+ye.size);if(Vn(Zt,["vtte"])[0]){xe+=ye.size;return}Vn(Zt,["vttc"]).forEach(function(Ko){const Xo=Vn(Ko,["payl"])[0],Qo=Vn(Ko,["sttg"])[0],Yo=ye.pts/d,Ou=(ye.pts+ye.duration)/d;let wt,Jo;if(Xo)try{wt=Qe.decode(Xo)}catch(Cr){console.error(Cr)}if(Qo)try{Jo=Qe.decode(Qo)}catch(Cr){console.error(Cr)}ye.duration&&wt&&T.push({cueText:wt,start:Yo,end:Ou,settings:Jo})}),xe+=ye.size})}}),T}},Fd=os,uv=function(d){var v=d[1]&31;return v<<=8,v|=d[2],v},Nu=function(d){return!!(d[1]&64)},Lu=function(d){var v=0;return(d[3]&48)>>>4>1&&(v+=d[4]+1),v},Q2=function(d,v){var T=uv(d);return T===0?"pat":T===v?"pmt":v?"pes":null},Y2=function(d){var v=Nu(d),T=4+Lu(d);return v&&(T+=d[T]+1),(d[T+10]&31)<<8|d[T+11]},J2=function(d){var v={},T=Nu(d),_=4+Lu(d);if(T&&(_+=d[_]+1),!!(d[_+5]&1)){var k,A,z;k=(d[_+1]&15)<<8|d[_+2],A=3+k-4,z=(d[_+10]&15)<<8|d[_+11];for(var W=12+z;W<A;){var Y=_+W;v[(d[Y+1]&31)<<8|d[Y+2]]=d[Y],W+=((d[Y+3]&15)<<8|d[Y+4])+5}return v}},Z2=function(d,v){var T=uv(d),_=v[T];switch(_){case Fd.H264_STREAM_TYPE:return"video";case Fd.ADTS_STREAM_TYPE:return"audio";case Fd.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},ew=function(d){var v=Nu(d);if(!v)return null;var T=4+Lu(d);if(T>=d.byteLength)return null;var _=null,k;return k=d[T+7],k&192&&(_={},_.pts=(d[T+9]&14)<<27|(d[T+10]&255)<<20|(d[T+11]&254)<<12|(d[T+12]&255)<<5|(d[T+13]&254)>>>3,_.pts*=4,_.pts+=(d[T+13]&6)>>>1,_.dts=_.pts,k&64&&(_.dts=(d[T+14]&14)<<27|(d[T+15]&255)<<20|(d[T+16]&254)<<12|(d[T+17]&255)<<5|(d[T+18]&254)>>>3,_.dts*=4,_.dts+=(d[T+18]&6)>>>1)),_},Ud=function(d){switch(d){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}},tw=function(d){for(var v=4+Lu(d),T=d.subarray(v),_=0,k=0,A=!1,z;k<T.byteLength-3;k++)if(T[k+2]===1){_=k+5;break}for(;_<T.byteLength;)switch(T[_]){case 0:if(T[_-1]!==0){_+=2;break}else if(T[_-2]!==0){_++;break}k+3!==_-2&&(z=Ud(T[k+3]&31),z==="slice_layer_without_partitioning_rbsp_idr"&&(A=!0));do _++;while(T[_]!==1&&_<T.length);k=_-2,_+=3;break;case 1:if(T[_-1]!==0||T[_-2]!==0){_+=3;break}z=Ud(T[k+3]&31),z==="slice_layer_without_partitioning_rbsp_idr"&&(A=!0),k=_-2,_+=3;break;default:_+=3;break}return T=T.subarray(k),_-=k,k=0,T&&T.byteLength>3&&(z=Ud(T[k+3]&31),z==="slice_layer_without_partitioning_rbsp_idr"&&(A=!0)),A},iw={parseType:Q2,parsePat:Y2,parsePmt:J2,parsePayloadUnitStartIndicator:Nu,parsePesType:Z2,parsePesTime:ew,videoPacketContainsKeyFrame:tw},cv=os,Ca=ls.handleRollover,ht={};ht.ts=iw,ht.aac=Bn;var Cs=nt.ONE_SECOND_IN_TS,_i=188,Rr=71,rw=function(d,v){for(var T=0,_=_i,k,A;_<d.byteLength;){if(d[T]===Rr&&d[_]===Rr){switch(k=d.subarray(T,_),A=ht.ts.parseType(k,v.pid),A){case"pat":v.pid=ht.ts.parsePat(k);break;case"pmt":var z=ht.ts.parsePmt(k);v.table=v.table||{},Object.keys(z).forEach(function(W){v.table[W]=z[W]});break}T+=_i,_+=_i;continue}T++,_++}},hv=function(d,v,T){for(var _=0,k=_i,A,z,W,Y,J,ae=!1;k<=d.byteLength;){if(d[_]===Rr&&(d[k]===Rr||k===d.byteLength)){switch(A=d.subarray(_,k),z=ht.ts.parseType(A,v.pid),z){case"pes":W=ht.ts.parsePesType(A,v.table),Y=ht.ts.parsePayloadUnitStartIndicator(A),W==="audio"&&Y&&(J=ht.ts.parsePesTime(A),J&&(J.type="audio",T.audio.push(J),ae=!0));break}if(ae)break;_+=_i,k+=_i;continue}_++,k++}for(k=d.byteLength,_=k-_i,ae=!1;_>=0;){if(d[_]===Rr&&(d[k]===Rr||k===d.byteLength)){switch(A=d.subarray(_,k),z=ht.ts.parseType(A,v.pid),z){case"pes":W=ht.ts.parsePesType(A,v.table),Y=ht.ts.parsePayloadUnitStartIndicator(A),W==="audio"&&Y&&(J=ht.ts.parsePesTime(A),J&&(J.type="audio",T.audio.push(J),ae=!0));break}if(ae)break;_-=_i,k-=_i;continue}_--,k--}},nw=function(d,v,T){for(var _=0,k=_i,A,z,W,Y,J,ae,me,xe,ye=!1,Ue={data:[],size:0};k<d.byteLength;){if(d[_]===Rr&&d[k]===Rr){switch(A=d.subarray(_,k),z=ht.ts.parseType(A,v.pid),z){case"pes":if(W=ht.ts.parsePesType(A,v.table),Y=ht.ts.parsePayloadUnitStartIndicator(A),W==="video"&&(Y&&!ye&&(J=ht.ts.parsePesTime(A),J&&(J.type="video",T.video.push(J),ye=!0)),!T.firstKeyFrame)){if(Y&&Ue.size!==0){for(ae=new Uint8Array(Ue.size),me=0;Ue.data.length;)xe=Ue.data.shift(),ae.set(xe,me),me+=xe.byteLength;if(ht.ts.videoPacketContainsKeyFrame(ae)){var Qe=ht.ts.parsePesTime(ae);Qe?(T.firstKeyFrame=Qe,T.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.")}Ue.size=0}Ue.data.push(A),Ue.size+=A.byteLength}break}if(ye&&T.firstKeyFrame)break;_+=_i,k+=_i;continue}_++,k++}for(k=d.byteLength,_=k-_i,ye=!1;_>=0;){if(d[_]===Rr&&d[k]===Rr){switch(A=d.subarray(_,k),z=ht.ts.parseType(A,v.pid),z){case"pes":W=ht.ts.parsePesType(A,v.table),Y=ht.ts.parsePayloadUnitStartIndicator(A),W==="video"&&Y&&(J=ht.ts.parsePesTime(A),J&&(J.type="video",T.video.push(J),ye=!0));break}if(ye)break;_-=_i,k-=_i;continue}_--,k--}},sw=function(d,v){if(d.audio&&d.audio.length){var T=v;(typeof T>"u"||isNaN(T))&&(T=d.audio[0].dts),d.audio.forEach(function(A){A.dts=Ca(A.dts,T),A.pts=Ca(A.pts,T),A.dtsTime=A.dts/Cs,A.ptsTime=A.pts/Cs})}if(d.video&&d.video.length){var _=v;if((typeof _>"u"||isNaN(_))&&(_=d.video[0].dts),d.video.forEach(function(A){A.dts=Ca(A.dts,_),A.pts=Ca(A.pts,_),A.dtsTime=A.dts/Cs,A.ptsTime=A.pts/Cs}),d.firstKeyFrame){var k=d.firstKeyFrame;k.dts=Ca(k.dts,_),k.pts=Ca(k.pts,_),k.dtsTime=k.dts/Cs,k.ptsTime=k.pts/Cs}}},aw=function(d){for(var v=!1,T=0,_=null,k=null,A=0,z=0,W;d.length-z>=3;){var Y=ht.aac.parseType(d,z);switch(Y){case"timed-metadata":if(d.length-z<10){v=!0;break}if(A=ht.aac.parseId3TagSize(d,z),A>d.length){v=!0;break}k===null&&(W=d.subarray(z,z+A),k=ht.aac.parseAacTimestamp(W)),z+=A;break;case"audio":if(d.length-z<7){v=!0;break}if(A=ht.aac.parseAdtsSize(d,z),A>d.length){v=!0;break}_===null&&(W=d.subarray(z,z+A),_=ht.aac.parseSampleRate(W)),T++,z+=A;break;default:z++;break}if(v)return null}if(_===null||k===null)return null;var J=Cs/_,ae={audio:[{type:"audio",dts:k,pts:k},{type:"audio",dts:k+T*1024*J,pts:k+T*1024*J}]};return ae},ow=function(d){var v={pid:null,table:null},T={};rw(d,v);for(var _ in v.table)if(v.table.hasOwnProperty(_)){var k=v.table[_];switch(k){case cv.H264_STREAM_TYPE:T.video=[],nw(d,v,T),T.video.length===0&&delete T.video;break;case cv.ADTS_STREAM_TYPE:T.audio=[],hv(d,v,T),T.audio.length===0&&delete T.audio;break}}return T},lw=function(d,v){var T=ht.aac.isLikelyAacData(d),_;return T?_=aw(d):_=ow(d),!_||!_.audio&&!_.video?null:(sw(_,v),_)},uw={inspect:lw,parseAudioPes_:hv};const cw=function(d,v){v.on("data",function(T){const _=T.initSegment;T.initSegment={data:_.buffer,byteOffset:_.byteOffset,byteLength:_.byteLength};const k=T.data;T.data=k.buffer,d.postMessage({action:"data",segment:T,byteOffset:k.byteOffset,byteLength:k.byteLength},[T.data])}),v.on("done",function(T){d.postMessage({action:"done"})}),v.on("gopInfo",function(T){d.postMessage({action:"gopInfo",gopInfo:T})}),v.on("videoSegmentTimingInfo",function(T){const _={start:{decode:nt.videoTsToSeconds(T.start.dts),presentation:nt.videoTsToSeconds(T.start.pts)},end:{decode:nt.videoTsToSeconds(T.end.dts),presentation:nt.videoTsToSeconds(T.end.pts)},baseMediaDecodeTime:nt.videoTsToSeconds(T.baseMediaDecodeTime)};T.prependedContentDuration&&(_.prependedContentDuration=nt.videoTsToSeconds(T.prependedContentDuration)),d.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:_})}),v.on("audioSegmentTimingInfo",function(T){const _={start:{decode:nt.videoTsToSeconds(T.start.dts),presentation:nt.videoTsToSeconds(T.start.pts)},end:{decode:nt.videoTsToSeconds(T.end.dts),presentation:nt.videoTsToSeconds(T.end.pts)},baseMediaDecodeTime:nt.videoTsToSeconds(T.baseMediaDecodeTime)};T.prependedContentDuration&&(_.prependedContentDuration=nt.videoTsToSeconds(T.prependedContentDuration)),d.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:_})}),v.on("id3Frame",function(T){d.postMessage({action:"id3Frame",id3Frame:T})}),v.on("caption",function(T){d.postMessage({action:"caption",caption:T})}),v.on("trackinfo",function(T){d.postMessage({action:"trackinfo",trackInfo:T})}),v.on("audioTimingInfo",function(T){d.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:nt.videoTsToSeconds(T.start),end:nt.videoTsToSeconds(T.end)}})}),v.on("videoTimingInfo",function(T){d.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:nt.videoTsToSeconds(T.start),end:nt.videoTsToSeconds(T.end)}})}),v.on("log",function(T){d.postMessage({action:"log",log:T})})};class dv{constructor(v,T){this.options=T||{},this.self=v,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Su.Transmuxer(this.options),cw(this.self,this.transmuxer)}pushMp4Captions(v){this.captionParser||(this.captionParser=new z2,this.captionParser.init());const T=new Uint8Array(v.data,v.byteOffset,v.byteLength),_=this.captionParser.parse(T,v.trackIds,v.timescales);this.self.postMessage({action:"mp4Captions",captions:_&&_.captions||[],logs:_&&_.logs||[],data:T.buffer},[T.buffer])}initMp4WebVttParser(v){this.webVttParser||(this.webVttParser=new lv);const T=new Uint8Array(v.data,v.byteOffset,v.byteLength);this.webVttParser.init(T)}getMp4WebVttText(v){this.webVttParser||(this.webVttParser=new lv);const T=new Uint8Array(v.data,v.byteOffset,v.byteLength),_=this.webVttParser.parseSegment(T);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:_||[],data:T.buffer},[T.buffer])}probeMp4StartTime({timescales:v,data:T}){const _=Wi.startTime(v,T);this.self.postMessage({action:"probeMp4StartTime",startTime:_,data:T},[T.buffer])}probeMp4Tracks({data:v}){const T=Wi.tracks(v);this.self.postMessage({action:"probeMp4Tracks",tracks:T,data:v},[v.buffer])}probeEmsgID3({data:v,offset:T}){const _=Wi.getEmsgID3(v,T);this.self.postMessage({action:"probeEmsgID3",id3Frames:_,emsgData:v},[v.buffer])}probeTs({data:v,baseStartTime:T}){const _=typeof T=="number"&&!isNaN(T)?T*nt.ONE_SECOND_IN_TS:void 0,k=uw.inspect(v,_);let A=null;k&&(A={hasVideo:k.video&&k.video.length===2||!1,hasAudio:k.audio&&k.audio.length===2||!1},A.hasVideo&&(A.videoStart=k.video[0].ptsTime),A.hasAudio&&(A.audioStart=k.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:A,data:v},[v.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(v){const T=new Uint8Array(v.data,v.byteOffset,v.byteLength);this.transmuxer.push(T)}reset(){this.transmuxer.reset()}setTimestampOffset(v){const T=v.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(nt.secondsToVideoTs(T)))}setAudioAppendStart(v){this.transmuxer.setAudioAppendStart(Math.ceil(nt.secondsToVideoTs(v.appendStart)))}setRemux(v){this.transmuxer.setRemux(v.remux)}flush(v){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(v){this.transmuxer.alignGopsWith(v.gopsToAlignWith.slice())}}self.onmessage=function(d){if(d.data.action==="init"&&d.data.options){this.messageHandlers=new dv(self,d.data.options);return}this.messageHandlers||(this.messageHandlers=new dv(self)),d.data&&d.data.action&&d.data.action!=="init"&&this.messageHandlers[d.data.action]&&this.messageHandlers[d.data.action](d.data)}}));var NP=QS(DP);const LP=(s,e,t)=>{const{type:i,initSegment:r,captions:n,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:u}=s.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:o});const c=s.data.segment.boxes||{data:s.data.segment.data},h={type:i,data:new Uint8Array(c.data,c.data.byteOffset,c.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof l<"u"&&(h.videoFrameDtsTime=l),typeof u<"u"&&(h.videoFramePtsTime=u),t(h)},OP=({transmuxedData:s,callback:e})=>{s.buffer=[],e(s)},MP=(s,e)=>{e.gopInfo=s.data.gopInfo},ZS=s=>{const{transmuxer:e,bytes:t,audioAppendStart:i,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:u,onVideoSegmentTimingInfo:c,onAudioSegmentTimingInfo:h,onId3:f,onCaptions:g,onDone:C,onEndedTimeline:p,onTransmuxerLog:b,isEndOfTimeline:I,segment:L,triggerSegmentEventFn:F}=s,V={buffer:[]};let B=I;const O=U=>{e.currentTransmux===s&&(U.data.action==="data"&&LP(U,V,a),U.data.action==="trackinfo"&&o(U.data.trackInfo),U.data.action==="gopInfo"&&MP(U,V),U.data.action==="audioTimingInfo"&&l(U.data.audioTimingInfo),U.data.action==="videoTimingInfo"&&u(U.data.videoTimingInfo),U.data.action==="videoSegmentTimingInfo"&&c(U.data.videoSegmentTimingInfo),U.data.action==="audioSegmentTimingInfo"&&h(U.data.audioSegmentTimingInfo),U.data.action==="id3Frame"&&f([U.data.id3Frame],U.data.id3Frame.dispatchType),U.data.action==="caption"&&g(U.data.caption),U.data.action==="endedtimeline"&&(B=!1,p()),U.data.action==="log"&&b(U.data.log),U.data.type==="transmuxed"&&(B||(e.onmessage=null,OP({transmuxedData:V,callback:C}),e1(e))))},M=()=>{const U={message:"Received an error message from the transmuxer worker",metadata:{errorType:R.Error.StreamingFailedToTransmuxSegment,segmentInfo:Ps({segment:L})}};C(null,U)};if(e.onmessage=O,e.onerror=M,i&&e.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const U=t instanceof ArrayBuffer?t:t.buffer,w=t instanceof ArrayBuffer?0:t.byteOffset;F({type:"segmenttransmuxingstart",segment:L}),e.postMessage({action:"push",data:U,byteOffset:w,byteLength:t.byteLength},[U])}I&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},e1=s=>{s.currentTransmux=null,s.transmuxQueue.length&&(s.currentTransmux=s.transmuxQueue.shift(),typeof s.currentTransmux=="function"?s.currentTransmux():ZS(s.currentTransmux))},Oy=(s,e)=>{s.postMessage({action:e}),e1(s)},t1=(s,e)=>{if(!e.currentTransmux){e.currentTransmux=s,Oy(e,s);return}e.transmuxQueue.push(Oy.bind(null,e,s))},RP=s=>{t1("reset",s)},BP=s=>{t1("endTimeline",s)},i1=s=>{if(!s.transmuxer.currentTransmux){s.transmuxer.currentTransmux=s,ZS(s);return}s.transmuxer.transmuxQueue.push(s)},FP=s=>{const e=new NP;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:s}),e};var _f={reset:RP,endTimeline:BP,transmux:i1,createTransmuxer:FP};const Ga=function(s){const e=s.transmuxer,t=s.endAction||s.action,i=s.callback,r=mt({},s,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,s.byteOffset||0,s.byteLength||a.data.data.byteLength),s.data&&(s.data=a.data.data)),i(a.data))};if(e.addEventListener("message",n),s.data){const a=s.data instanceof ArrayBuffer;r.byteOffset=a?0:s.data.byteOffset,r.byteLength=s.data.byteLength;const o=[a?s.data:s.data.buffer];e.postMessage(r,o)}else e.postMessage(r)},zr={FAILURE:2,TIMEOUT:-101,ABORTED:-102},r1="wvtt",Mp=s=>{s.forEach(e=>{e.abort()})},UP=s=>({bandwidth:s.bandwidth,bytesReceived:s.bytesReceived||0,roundTripTime:s.roundTripTime||0}),$P=s=>{const e=s.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return i.bytesReceived=s.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i},og=(s,e)=>{const{requestType:t}=e,i=qs({requestType:t,request:e,error:s});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:zr.TIMEOUT,xhr:e,metadata:i}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:zr.ABORTED,xhr:e,metadata:i}:s?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:zr.FAILURE,xhr:e,metadata:i}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:zr.FAILURE,xhr:e,metadata:i}:null},My=(s,e,t,i)=>(r,n)=>{const a=n.response,o=og(r,n);if(o)return t(o,s);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:zr.FAILURE,xhr:n},s);const l=new DataView(a),u=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]);for(let h=0;h<e.length;h++)e[h].bytes=u;const c={uri:n.uri};return i({type:"segmentkeyloadcomplete",segment:s,keyInfo:c}),t(null,s)},jP=(s,e)=>{e===r1&&s.transmuxer.postMessage({action:"initMp4WebVttParser",data:s.map.bytes})},VP=(s,e,t)=>{e===r1&&Ga({action:"getMp4WebVttText",data:s.bytes,transmuxer:s.transmuxer,callback:({data:i,mp4VttCues:r})=>{s.bytes=i,t(null,s,{mp4VttCues:r})}})},n1=(s,e)=>{const t=Pm(s.map.bytes);if(t!=="mp4"){const i=s.map.resolvedUri||s.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${i}`,code:zr.FAILURE,metadata:{mediaType:r}})}Ga({action:"probeMp4Tracks",data:s.map.bytes,transmuxer:s.transmuxer,callback:({tracks:i,data:r})=>(s.map.bytes=r,i.forEach(function(n){s.map.tracks=s.map.tracks||{},!s.map.tracks[n.type]&&(s.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(s.map.timescales=s.map.timescales||{},s.map.timescales[n.id]=n.timescale),n.type==="text"&&jP(s,n.codec))}),e(null))})},HP=({segment:s,finishProcessingFn:e,triggerSegmentEventFn:t})=>(i,r)=>{const n=og(i,r);if(n)return e(n,s);const a=new Uint8Array(r.response);if(t({type:"segmentloaded",segment:s}),s.map.key)return s.map.encryptedBytes=a,e(null,s);s.map.bytes=a,n1(s,function(o){if(o)return o.xhr=r,o.status=r.status,e(o,s);e(null,s)})},qP=({segment:s,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:i})=>(r,n)=>{const a=og(r,n);if(a)return e(a,s);i({type:"segmentloaded",segment:s});const o=t==="arraybuffer"||!n.responseText?n.response:IP(n.responseText.substring(s.lastReachedChar||0));return s.stats=UP(n),s.key?s.encryptedBytes=new Uint8Array(o):s.bytes=new Uint8Array(o),e(null,s)},zP=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:f,triggerSegmentEventFn:g})=>{const C=s.map&&s.map.tracks||{},p=!!(C.audio&&C.video);let b=i.bind(null,s,"audio","start");const I=i.bind(null,s,"audio","end");let L=i.bind(null,s,"video","start");const F=i.bind(null,s,"video","end"),V=()=>i1({bytes:e,transmuxer:s.transmuxer,audioAppendStart:s.audioAppendStart,gopsToAlignWith:s.gopsToAlignWith,remux:p,onData:B=>{B.type=B.type==="combined"?"video":B.type,c(s,B)},onTrackInfo:B=>{t&&(p&&(B.isMuxed=!0),t(s,B))},onAudioTimingInfo:B=>{b&&typeof B.start<"u"&&(b(B.start),b=null),I&&typeof B.end<"u"&&I(B.end)},onVideoTimingInfo:B=>{L&&typeof B.start<"u"&&(L(B.start),L=null),F&&typeof B.end<"u"&&F(B.end)},onVideoSegmentTimingInfo:B=>{const O={pts:{start:B.start.presentation,end:B.end.presentation},dts:{start:B.start.decode,end:B.end.decode}};g({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:O}),r(B)},onAudioSegmentTimingInfo:B=>{const O={pts:{start:B.start.pts,end:B.end.pts},dts:{start:B.start.dts,end:B.end.dts}};g({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:O}),n(B)},onId3:(B,O)=>{a(s,B,O)},onCaptions:B=>{o(s,[B])},isEndOfTimeline:l,onEndedTimeline:()=>{u()},onTransmuxerLog:f,onDone:(B,O)=>{h&&(B.type=B.type==="combined"?"video":B.type,g({type:"segmenttransmuxingcomplete",segment:s}),h(O,s,B))},segment:s,triggerSegmentEventFn:g});Ga({action:"probeTs",transmuxer:s.transmuxer,data:e,baseStartTime:s.baseStartTime,callback:B=>{s.bytes=e=B.data;const O=B.result;O&&(t(s,{hasAudio:O.hasAudio,hasVideo:O.hasVideo,isMuxed:p}),t=null),V()}})},s1=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:f,triggerSegmentEventFn:g})=>{let C=new Uint8Array(e);if(dA(C)){s.isFmp4=!0;const{tracks:p}=s.map;if(p.text&&(!p.audio||!p.video)){c(s,{data:C,type:"text"}),VP(s,p.text.codec,h);return}const I={isFmp4:!0,hasVideo:!!p.video,hasAudio:!!p.audio};p.audio&&p.audio.codec&&p.audio.codec!=="enca"&&(I.audioCodec=p.audio.codec),p.video&&p.video.codec&&p.video.codec!=="encv"&&(I.videoCodec=p.video.codec),p.video&&p.audio&&(I.isMuxed=!0),t(s,I);const L=(F,V)=>{c(s,{data:C,type:I.hasAudio&&!I.isMuxed?"audio":"video"}),V&&V.length&&a(s,V),F&&F.length&&o(s,F),h(null,s,{})};Ga({action:"probeMp4StartTime",timescales:s.map.timescales,data:C,transmuxer:s.transmuxer,callback:({data:F,startTime:V})=>{e=F.buffer,s.bytes=C=F,I.hasAudio&&!I.isMuxed&&i(s,"audio","start",V),I.hasVideo&&i(s,"video","start",V),Ga({action:"probeEmsgID3",data:C,transmuxer:s.transmuxer,offset:V,callback:({emsgData:B,id3Frames:O})=>{if(e=B.buffer,s.bytes=C=B,!p.video||!B.byteLength||!s.transmuxer){L(void 0,O);return}Ga({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:s.transmuxer,data:C,timescales:s.map.timescales,trackIds:[p.video.id],callback:M=>{e=M.data.buffer,s.bytes=C=M.data,M.logs.forEach(function(U){f(lt(U,{stream:"mp4CaptionParser"}))}),L(M.captions,O)}})}})}});return}if(!s.transmuxer){h(null,s,{});return}if(typeof s.container>"u"&&(s.container=Pm(C)),s.container!=="ts"&&s.container!=="aac"){t(s,{hasAudio:!1,hasVideo:!1}),h(null,s,{});return}zP({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:f,triggerSegmentEventFn:g})},a1=function({id:s,key:e,encryptedBytes:t,decryptionWorker:i,segment:r,doneFn:n},a){const o=u=>{if(u.data.source===s){i.removeEventListener("message",o);const c=u.data.decrypted;a(new Uint8Array(c.bytes,c.byteOffset,c.byteLength))}};i.onerror=()=>{const u="An error occurred in the decryption worker",c=Ps({segment:r}),h={message:u,metadata:{error:new Error(u),errorType:R.Error.StreamingFailedToDecryptSegment,segmentInfo:c,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};n(h,r)},i.addEventListener("message",o);let l;e.bytes.slice?l=e.bytes.slice():l=new Uint32Array(Array.prototype.slice.call(e.bytes)),i.postMessage(qS({source:s,encrypted:t,key:l,iv:e.iv}),[t.buffer,l.buffer])},WP=({decryptionWorker:s,segment:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:f,triggerSegmentEventFn:g})=>{g({type:"segmentdecryptionstart"}),a1({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:s,segment:e,doneFn:h},C=>{e.bytes=C,g({type:"segmentdecryptioncomplete",segment:e}),s1({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:f,triggerSegmentEventFn:g})})},GP=({activeXhrs:s,decryptionWorker:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:f,triggerSegmentEventFn:g})=>{let C=0,p=!1;return(b,I)=>{if(!p){if(b)return p=!0,Mp(s),h(b,I);if(C+=1,C===s.length){const L=function(){if(I.encryptedBytes)return WP({decryptionWorker:e,segment:I,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:f,triggerSegmentEventFn:g});s1({segment:I,bytes:I.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:f,triggerSegmentEventFn:g})};if(I.endOfAllRequests=Date.now(),I.map&&I.map.encryptedBytes&&!I.map.bytes)return g({type:"segmentdecryptionstart",segment:I}),a1({decryptionWorker:e,id:I.requestId+"-init",encryptedBytes:I.map.encryptedBytes,key:I.map.key,segment:I,doneFn:h},F=>{I.map.bytes=F,g({type:"segmentdecryptioncomplete",segment:I}),n1(I,V=>{if(V)return Mp(s),h(V,I);L()})});L()}}}},KP=({loadendState:s,abortFn:e})=>t=>{t.target.aborted&&e&&!s.calledAbortFn&&(e(),s.calledAbortFn=!0)},XP=({segment:s,progressFn:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c})=>h=>{if(!h.target.aborted)return s.stats=lt(s.stats,$P(h)),!s.stats.firstBytesReceivedAt&&s.stats.bytesReceived&&(s.stats.firstBytesReceivedAt=Date.now()),e(h,s)},QP=({xhr:s,xhrOptions:e,decryptionWorker:t,segment:i,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:h,isEndOfTimeline:f,endedTimelineFn:g,dataFn:C,doneFn:p,onTransmuxerLog:b,triggerSegmentEventFn:I})=>{const L=[],F=GP({activeXhrs:L,decryptionWorker:t,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:h,isEndOfTimeline:f,endedTimelineFn:g,dataFn:C,doneFn:p,onTransmuxerLog:b,triggerSegmentEventFn:I});if(i.key&&!i.key.bytes){const U=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&U.push(i.map.key);const w=lt(e,{uri:i.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),P=My(i,U,F,I),Q={uri:i.key.resolvedUri};I({type:"segmentkeyloadstart",segment:i,keyInfo:Q});const G=s(w,P);L.push(G)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){const G=lt(e,{uri:i.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),K=My(i,[i.map.key],F,I),ce={uri:i.map.key.resolvedUri};I({type:"segmentkeyloadstart",segment:i,keyInfo:ce});const de=s(G,K);L.push(de)}const w=lt(e,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:Lp(i.map),requestType:"segment-media-initialization"}),P=HP({segment:i,finishProcessingFn:F,triggerSegmentEventFn:I});I({type:"segmentloadstart",segment:i});const Q=s(w,P);L.push(Q)}const V=lt(e,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:Lp(i),requestType:"segment"}),B=qP({segment:i,finishProcessingFn:F,responseType:V.responseType,triggerSegmentEventFn:I});I({type:"segmentloadstart",segment:i});const O=s(V,B);O.addEventListener("progress",XP({segment:i,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:h,isEndOfTimeline:f,endedTimelineFn:g,dataFn:C})),L.push(O);const M={};return L.forEach(U=>{U.addEventListener("loadend",KP({loadendState:M,abortFn:r}))}),()=>Mp(L)},YP=mr("CodecUtils"),JP=function(s){const e=s.attributes||{};if(e.CODECS)return Fr(e.CODECS)},o1=(s,e)=>{const t=e.attributes||{};return s&&s.mediaGroups&&s.mediaGroups.AUDIO&&t.AUDIO&&s.mediaGroups.AUDIO[t.AUDIO]},ZP=(s,e)=>{if(!o1(s,e))return!0;const t=e.attributes||{},i=s.mediaGroups.AUDIO[t.AUDIO];for(const r in i)if(!i[r].uri&&!i[r].playlists)return!0;return!1},jc=function(s){const e={};return s.forEach(({mediaType:t,type:i,details:r})=>{e[t]=e[t]||[],e[t].push(qb(`${i}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){YP(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},Ry=function(s){let e=0;return s.audio&&e++,s.video&&e++,e},kl=function(s,e){const t=e.attributes||{},i=jc(JP(e)||[]);if(o1(s,e)&&!i.audio&&!ZP(s,e)){const r=jc(Uk(s,t.AUDIO)||[]);r.audio&&(i.audio=r.audio)}return i},Hu=mr("PlaylistSelector"),By=function(s){if(!s||!s.playlist)return;const e=s.playlist;return JSON.stringify({id:e.id,bandwidth:s.bandwidth,width:s.width,height:s.height,codecs:e.attributes&&e.attributes.CODECS||""})},Vc=function(s,e){if(!s)return"";const t=D.getComputedStyle(s);return t?t[e]:""},Ka=function(s,e){const t=s.slice();s.sort(function(i,r){const n=e(i,r);return n===0?t.indexOf(i)-t.indexOf(r):n})},lg=function(s,e){let t,i;return s.attributes.BANDWIDTH&&(t=s.attributes.BANDWIDTH),t=t||D.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||D.Number.MAX_VALUE,t-i},eD=function(s,e){let t,i;return s.attributes.RESOLUTION&&s.attributes.RESOLUTION.width&&(t=s.attributes.RESOLUTION.width),t=t||D.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||D.Number.MAX_VALUE,t===i&&s.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?s.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-i};let l1=function(s,e,t,i,r,n){if(!s)return;const a={bandwidth:e,width:t,height:i,limitRenditionByPlayerDimensions:r};let o=s.playlists;$i.isAudioOnly(s)&&(o=n.getAudioTrackPlaylists_(),a.audioOnly=!0);let l=o.map(B=>{let O;const M=B.attributes&&B.attributes.RESOLUTION&&B.attributes.RESOLUTION.width,U=B.attributes&&B.attributes.RESOLUTION&&B.attributes.RESOLUTION.height;return O=B.attributes&&B.attributes.BANDWIDTH,O=O||D.Number.MAX_VALUE,{bandwidth:O,width:M,height:U,playlist:B}});Ka(l,(B,O)=>B.bandwidth-O.bandwidth),l=l.filter(B=>!$i.isIncompatible(B.playlist));let u=l.filter(B=>$i.isEnabled(B.playlist));u.length||(u=l.filter(B=>!$i.isDisabled(B.playlist)));const c=u.filter(B=>B.bandwidth*ei.BANDWIDTH_VARIANCE<e);let h=c[c.length-1];const f=c.filter(B=>B.bandwidth===h.bandwidth)[0];if(r===!1){const B=f||u[0]||l[0];if(B&&B.playlist){let O="sortedPlaylistReps";return f&&(O="bandwidthBestRep"),u[0]&&(O="enabledPlaylistReps"),Hu(`choosing ${By(B)} using ${O} with options`,a),B.playlist}return Hu("could not choose a playlist with options",a),null}const g=c.filter(B=>B.width&&B.height);Ka(g,(B,O)=>B.width-O.width);const C=g.filter(B=>B.width===t&&B.height===i);h=C[C.length-1];const p=C.filter(B=>B.bandwidth===h.bandwidth)[0];let b,I,L;p||(b=g.filter(B=>B.width>t||B.height>i),I=b.filter(B=>B.width===b[0].width&&B.height===b[0].height),h=I[I.length-1],L=I.filter(B=>B.bandwidth===h.bandwidth)[0]);let F;if(n.leastPixelDiffSelector){const B=g.map(O=>(O.pixelDiff=Math.abs(O.width-t)+Math.abs(O.height-i),O));Ka(B,(O,M)=>O.pixelDiff===M.pixelDiff?M.bandwidth-O.bandwidth:O.pixelDiff-M.pixelDiff),F=B[0]}const V=F||L||p||f||u[0]||l[0];if(V&&V.playlist){let B="sortedPlaylistReps";return F?B="leastPixelDiffRep":L?B="resolutionPlusOneRep":p?B="resolutionBestRep":f?B="bandwidthBestRep":u[0]&&(B="enabledPlaylistReps"),Hu(`choosing ${By(V)} using ${B} with options`,a),V.playlist}return Hu("could not choose a playlist with options",a),null};const Fy=function(){let s=this.useDevicePixelRatio&&D.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),l1(this.playlists.main,this.systemBandwidth,parseInt(Vc(this.tech_.el(),"width"),10)*s,parseInt(Vc(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)},tD=function(s){let e=-1,t=-1;if(s<0||s>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let i=this.useDevicePixelRatio&&D.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=s*this.systemBandwidth+(1-s)*e,t=this.systemBandwidth),l1(this.playlists.main,e,parseInt(Vc(this.tech_.el(),"width"),10)*i,parseInt(Vc(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.playlistController_)}},iD=function(s){const{main:e,currentTime:t,bandwidth:i,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=s,u=e.playlists.filter(C=>!$i.isIncompatible(C));let c=u.filter($i.isEnabled);c.length||(c=u.filter(C=>!$i.isDisabled(C)));const f=c.filter($i.hasAttribute.bind(null,"BANDWIDTH")).map(C=>{const b=l.getSyncPoint(C,r,o,t)?1:2,L=$i.estimateSegmentRequestTime(n,i,C)*b-a;return{playlist:C,rebufferingImpact:L}}),g=f.filter(C=>C.rebufferingImpact<=0);return Ka(g,(C,p)=>lg(p.playlist,C.playlist)),g.length?g[0]:(Ka(f,(C,p)=>C.rebufferingImpact-p.rebufferingImpact),f[0]||null)},rD=function(){const s=this.playlists.main.playlists.filter($i.isEnabled);return Ka(s,(t,i)=>lg(t,i)),s.filter(t=>!!kl(this.playlists.main,t).video)[0]||null},nD=s=>{let e=0,t;return s.bytes&&(t=new Uint8Array(s.bytes),s.segments.forEach(i=>{t.set(i,e),e+=i.byteLength})),t};function u1(s){try{return new URL(s).pathname.split("/").slice(-2).join("/")}catch{return""}}const sD=function(s,e,t){if(!s[t]){e.trigger({type:"usage",name:"vhs-608"});let i=t;/^cc708_/.test(t)&&(i="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(i);if(r)s[t]=r;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,o=t,l=!1;const u=n[i];u&&(a=u.label,o=u.language,l=u.default),s[t]=e.addRemoteTextTrack({kind:"captions",id:i,default:l,label:a,language:o},!1).track}}},aD=function({inbandTextTracks:s,captionArray:e,timestampOffset:t}){if(!e)return;const i=D.WebKitDataCue||D.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const o=new i(r.startTime+t,r.endTime+t,a.text);o.line=a.line,o.align="left",o.position=a.position,o.positionAlign="line-left",s[n].addCue(o)}):s[n].addCue(new i(r.startTime+t,r.endTime+t,r.text))})},oD=function(s){Object.defineProperties(s.frame,{id:{get(){return R.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),s.value.key}},value:{get(){return R.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),s.value.data}},privateData:{get(){return R.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),s.value.data}}})},lD=({inbandTextTracks:s,metadataArray:e,timestampOffset:t,videoDuration:i})=>{if(!e)return;const r=D.WebKitDataCue||D.VTTCue,n=s.metadataTrack_;if(!n||(e.forEach(c=>{const h=c.cueTime+t;typeof h!="number"||D.isNaN(h)||h<0||!(h<1/0)||!c.frames||!c.frames.length||c.frames.forEach(f=>{const g=new r(h,h,f.value||f.url||f.data||"");g.frame=f,g.value=f,oD(g),n.addCue(g)})}),!n.cues||!n.cues.length))return;const a=n.cues,o=[];for(let c=0;c<a.length;c++)a[c]&&o.push(a[c]);const l=o.reduce((c,h)=>{const f=c[h.startTime]||[];return f.push(h),c[h.startTime]=f,c},{}),u=Object.keys(l).sort((c,h)=>Number(c)-Number(h));u.forEach((c,h)=>{const f=l[c],g=isFinite(i)?i:c,C=Number(u[h+1])||g;f.forEach(p=>{p.endTime=C})})},uD={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},cD=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),hD=({inbandTextTracks:s,dateRanges:e})=>{const t=s.metadataTrack_;if(!t)return;const i=D.WebKitDataCue||D.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(cD.has(n))continue;const a=new i(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:uD[n],data:r[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},Uy=(s,e,t)=>{s.metadataTrack_||(s.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,R.browser.IS_ANY_SAFARI||(s.metadataTrack_.inBandMetadataTrackDispatchType=e))},pl=function(s,e,t){let i,r;if(t&&t.cues)for(i=t.cues.length;i--;)r=t.cues[i],r.startTime>=s&&r.endTime<=e&&t.removeCue(r)},dD=function(s){const e=s.cues;if(!e)return;const t={};for(let i=e.length-1;i>=0;i--){const r=e[i],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?s.removeCue(r):t[n]=r}},fD=(s,e,t)=>{if(typeof e>"u"||e===null||!s.length)return[];const i=Math.ceil((e-t+3)*Ls.ONE_SECOND_IN_TS);let r;for(r=0;r<s.length&&!(s[r].pts>i);r++);return s.slice(r)},pD=(s,e,t)=>{if(!e.length)return s;if(t)return e.slice();const i=e[0].pts;let r=0;for(r;r<s.length&&!(s[r].pts>=i);r++);return s.slice(0,r).concat(e)},mD=(s,e,t,i)=>{const r=Math.ceil((e-i)*Ls.ONE_SECOND_IN_TS),n=Math.ceil((t-i)*Ls.ONE_SECOND_IN_TS),a=s.slice();let o=s.length;for(;o--&&!(s[o].pts<=n););if(o===-1)return a;let l=o+1;for(;l--&&!(s[l].pts<=r););return l=Math.max(l,0),a.splice(l,o-l+1),a},gD=function(s,e){if(!s&&!e||!s&&e||s&&!e)return!1;if(s===e)return!0;const t=Object.keys(s).sort(),i=Object.keys(e).sort();if(t.length!==i.length)return!1;for(let r=0;r<t.length;r++){const n=t[r];if(n!==i[r]||s[n]!==e[n])return!1}return!0},vD=function(s,e,t){e=e||[];const i=[];let r=0;for(let n=0;n<e.length;n++){const a=e[n];if(s===a.timeline&&(i.push(n),r+=a.duration,r>t))return n}return i.length===0?0:i[i.length-1]},rl=1,yD=500,$y=s=>typeof s=="number"&&isFinite(s),qu=1/60,_D=(s,e,t)=>s!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,TD=(s,e,t)=>{let i=e-ei.BACK_BUFFER_LENGTH;s.length&&(i=Math.max(i,s.start(0)));const r=e-t;return Math.min(r,i)},ka=s=>{const{startOfSegment:e,duration:t,segment:i,part:r,playlist:{mediaSequence:n,id:a,segments:o=[]},mediaIndex:l,partIndex:u,timeline:c}=s,h=o.length-1;let f="mediaIndex/partIndex increment";s.getMediaInfoForTime?f=`getMediaInfoForTime (${s.getMediaInfoForTime})`:s.isSyncRequest&&(f="getSyncSegmentCandidate (isSyncRequest)"),s.independent&&(f+=` with independent ${s.independent}`);const g=typeof u=="number",C=s.segment.uri?"segment":"pre-segment",p=g?AS({preloadSegment:i})-1:0;return`${C} [${n+l}/${n+h}]`+(g?` part [${u}/${p}]`:"")+` segment start/end [${i.start} => ${i.end}]`+(g?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${c}] selected by [${f}] playlist [${a}]`},jy=s=>`${s}TimingInfo`,bD=({segmentTimeline:s,currentTimeline:e,startOfSegment:t,buffered:i,overrideCheck:r})=>!r&&s===e?null:s<e?t:i.length?i.end(i.length-1):t,Rp=({timelineChangeController:s,currentTimeline:e,segmentTimeline:t,loaderType:i,audioDisabled:r})=>{if(e===t)return!1;if(i==="audio"){const n=s.lastTimelineChange({type:"main"});return!n||n.to!==t}if(i==="main"&&r){const n=s.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},SD=s=>{if(!s)return!1;const e=s.pendingTimelineChange({type:"audio"}),t=s.pendingTimelineChange({type:"main"}),i=e&&t,r=i&&e.to!==t.to;return!!(i&&e.from!==-1&&t.from!==-1&&r)},CD=s=>{s&&(s.pause(),s.resetEverything(),s.load())},ED=s=>{const e=s.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=s.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},Wn=s=>{const e=s.pendingSegment_;if(!e)return;if(Rp({timelineChangeController:s.timelineChangeController_,currentTimeline:s.currentTimeline_,segmentTimeline:e.timeline,loaderType:s.loaderType_,audioDisabled:s.audioDisabled_})&&SD(s.timelineChangeController_)){if(ED(s)){s.timelineChangeController_.trigger("audioTimelineBehind");return}CD(s)}},wD=s=>{let e=0;return["video","audio"].forEach(function(t){const i=s[`${t}TimingInfo`];if(!i)return;const{start:r,end:n}=i;let a;typeof r=="bigint"||typeof n=="bigint"?a=D.BigInt(n)-D.BigInt(r):typeof r=="number"&&typeof n=="number"&&(a=n-r),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),e},Vy=({segmentDuration:s,maxDuration:e})=>s?Math.round(s)>e+Hr:!1,kD=(s,e)=>{if(e!=="hls")return null;const t=wD({audioTimingInfo:s.audioTimingInfo,videoTimingInfo:s.videoTimingInfo});if(!t)return null;const i=s.playlist.targetDuration,r=Vy({segmentDuration:t,maxDuration:i*2}),n=Vy({segmentDuration:t,maxDuration:i}),a=`Segment with index ${s.mediaIndex} from playlist ${s.playlist.id} has a duration of ${t} when the reported duration is ${s.duration} and the target duration is ${i}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||n?{severity:r?"warn":"info",message:a}:null},Ps=({type:s,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),i=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:s||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:t,isMediaInitialization:i}};let Bp=class extends R.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=mr(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(i){i!==this.state_&&(this.logger_(`${this.state_} -> ${i}`),this.state_=i,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wn(this)}),this.sourceUpdater_.on("codecschange",i=>{this.trigger(mt({type:"codecschange"},i))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wn(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",i=>{this.trigger(mt({type:"timelinechange"},i)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Wn(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wn(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return _f.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,D.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&_f.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return ri();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:i,isMuxed:r}=e;if(i&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=$c(e);let r=this.initSegments_[i];return t&&!r&&e.bytes&&(this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const i=zS(e);let r=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[i]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const i=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(i&&(i.id?n=i.id:i.uri&&(n=i.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:
205
+ currentTime: ${this.currentTime_()}
206
+ bufferedEnd: ${vf(this.buffered_())}
207
+ `,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const l=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=l}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&_f.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const a=()=>{n--,n===0&&i()};(r||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=mD(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const o in this.inbandTextTracks_)pl(e,t,this.inbandTextTracks_[o]);pl(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=D.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=D.setTimeout(this.monitorBufferTick_.bind(this),yD)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:Ps({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!r||!r.parts||i+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=vf(e)||0,i=rg(e,this.currentTime_()),r=!this.hasPlayed_()&&i>=1,n=i>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(o.isSyncRequest)o.mediaIndex=vD(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(this.mediaIndex!==null){const f=a[this.mediaIndex],g=typeof this.partIndex=="number"?this.partIndex:-1;o.startOfSegment=f.end?f.end:t,f.parts&&f.parts[g+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=g+1):o.mediaIndex=this.mediaIndex+1}else{let f,g,C;const p=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:
208
+ For TargetTime: ${p}.
209
+ CurrentTime: ${this.currentTime_()}
210
+ BufferedEnd: ${t}
211
+ Fetch At Buffer: ${this.fetchAtBuffer_}
212
+ `,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const b=this.getSyncInfoFromMediaSequenceSync_(p);if(!b){const I="No sync info found while using media sequence sync";return this.error({message:I,metadata:{errorType:R.Error.StreamingFailedToSelectNextSegment,error:new Error(I)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${b.start} --> ${b.end})`),f=b.segmentIndex,g=b.partIndex,C=b.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const b=$i.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:p,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});f=b.segmentIndex,g=b.partIndex,C=b.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${p}`:`currentTime ${p}`,o.mediaIndex=f,o.startOfSegment=C,o.partIndex=g,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const l=a[o.mediaIndex];let u=l&&typeof o.partIndex=="number"&&l.parts&&l.parts[o.partIndex];if(!l||typeof o.partIndex=="number"&&!u)return null;typeof o.partIndex!="number"&&l.parts&&(o.partIndex=0,u=l.parts[0]);const c=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&u&&!c&&!u.independent)if(o.partIndex===0){const f=a[o.mediaIndex-1],g=f.parts&&f.parts.length&&f.parts[f.parts.length-1];g&&g.independent&&(o.mediaIndex-=1,o.partIndex=f.parts.length-1,o.independent="previous segment")}else l.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");const h=this.mediaSource_&&this.mediaSource_.readyState==="ended";return o.mediaIndex>=a.length-1&&h&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const r=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:o,forceTimestampOffset:l,getMediaInfoForTime:u}=e,c=i.segments[r],h=typeof o=="number"&&c.parts[o],f={requestId:"segment-loader-"+Math.random(),uri:h&&h.resolvedUri||c.resolvedUri,mediaIndex:r,partIndex:h?o:null,isSyncRequest:a,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:c.timeline,duration:h&&h.duration||c.duration,segment:c,part:h,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:u,independent:t},g=typeof l<"u"?l:this.isPendingTimestampOffset_;f.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:c.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:g});const C=vf(this.sourceUpdater_.audioBuffered());return typeof C=="number"&&(f.audioAppendStart=C-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(f.gopsToAlignWith=fD(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),f}timestampOffsetForSegment_(e){return bD(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,r=this.pendingSegment_.duration,n=$i.estimateSegmentRequestTime(r,i,this.playlist_,e.bytesReceived),a=VI(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const o=iD({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;const u=n-a-o.rebufferingImpact;let c=.5;a<=Hr&&(c=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||u<c)&&(this.bandwidth=o.playlist.attributes.BANDWIDTH*ei.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${ka(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:i,hasVideo:r}=t,n={segmentInfo:Ps({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:i,hasVideo:r}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},gD(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_():Wn(this))))}handleTimingInfo_(e,t,i,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,a=jy(t);n[a]=n[a]||{},n[a][i]=r,this.logger_(`timinginfo: ${t} - ${i} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wn(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(t.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}const r=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),n={};t.forEach(a=>{n[a.stream]=n[a.stream]||{startTime:1/0,captions:[],endTime:0};const o=n[a.stream];o.startTime=Math.min(o.startTime,a.startTime+r),o.endTime=Math.max(o.endTime,a.endTime+r),o.captions.push(a)}),Object.keys(n).forEach(a=>{const{startTime:o,endTime:l,captions:u}=n[a],c=this.inbandTextTracks_;this.logger_(`adding cues from ${o} -> ${l} for ${a}`),sD(c,this.vhs_.tech_,a),pl(o,l,c[a]),aD({captionArray:u,inbandTextTracks:c,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));return}this.addMetadataToTextTrack(i,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Rp({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||Rp({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){Wn(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[jy(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==i.mediaIndex||r.partIndex!==i.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:r}){if(i){const n=$c(i);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Os(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Os(a).join(", "));const o=n.length?n.start(0):0,l=n.length?n.end(n.length-1):0,u=a.length?a.start(0):0,c=a.length?a.end(a.length-1):0;if(l-o<=rl&&c-u<=rl){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Os(n).join(", ")}, video buffer: ${Os(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const f=this.currentTime_()-rl;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${f}`),this.remove(0,f,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${rl}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=D.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},rl*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},r){if(r){if(r.code===US){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:R.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:r,bytes:n}){if(!n){const o=[r];let l=r.byteLength;i&&(o.unshift(i),l+=i.byteLength),n=nD({bytes:l,segments:o})}const a={segmentInfo:Ps({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=i.prependedContentDuration||0,r[n].transmuxedPresentationStart=i.start.presentation,r[n].transmuxedDecodeStart=i.start.decode,r[n].transmuxedPresentationEnd=i.end.presentation,r[n].transmuxedDecodeEnd=i.end.decode,r[n].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:r}=t;if(!r||!r.byteLength||i==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){Wn(this),this.loadQueue_.push(()=>{const t=mt({},e,{forceTimestampOffset:!0});mt(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=i||r&&n;this.logger_(`Requesting
213
+ ${u1(e.uri)}
214
+ ${ka(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=QP({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:o,level:l,stream:u})=>{this.logger_(`${ka(e)} logged from transmuxer stream ${u} as a ${l}: ${o}`)},triggerSegmentEventFn:({type:o,segment:l,keyInfo:u,trackInfo:c,timingInfo:h})=>{const g={segmentInfo:Ps({segment:l})};u&&(g.keyInfo=u),c&&(g.trackInfo=c),h&&(g.timingInfo=h),this.trigger({type:o,metadata:g})}})}trimBackBuffer_(e){const t=TD(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:n},o=e.playlist.segments[e.mediaIndex-1];if(o&&o.timeline===t.timeline&&(o.videoTimingInfo?a.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(a.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),t.key){const l=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=l}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<qu){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${qu}`);return}const i={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:i}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,i){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===zr.ABORTED)return;if(this.pause(),e.code===zr.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=pD(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);t!==null&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:n,useVideoTimingInfo:a,videoTimingInfo:o,audioTimingInfo:l}){if(typeof e<"u")return e;if(!a)return l.start;const u=t.segments[i-1];return i===0||!u||typeof u.start>"u"||u.end!==r+n?r:o.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:i,hasVideo:r,isMuxed:n}=t,a=this.loaderType_==="main"&&r,o=!this.audioDisabled_&&i&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}a&&e.waitingOnAppends++,o&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=_D(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:i}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),r=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;r&&(e.timingInfo.end=typeof r.end=="number"?r.end:r.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const l={segmentInfo:Ps({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:l})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=kD(e,this.sourceType_);if(t&&(t.severity==="warn"?R.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${ka(e)}`);return}this.logger_(`Appended ${ka(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const i=e.segment,r=e.part,n=i.end&&this.currentTime_()-i.end>e.playlist.targetDuration*3,a=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${ka(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<qu){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${qu}`);return}const t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,i=t.start,r=t.end;if(!$y(i)||!$y(r))return;pl(i,r,this.segmentMetadataTrack_);const n=D.WebKitDataCue||D.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:r},o=JSON.stringify(a),l=new n(i,r,o);l.value=a,this.segmentMetadataTrack_.addCue(l)}};function gn(){}const c1=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},xD=["video","audio"],Fp=(s,e)=>{const t=e[`${s}Buffer`];return t&&t.updating||e.queuePending[s]},AD=(s,e)=>{for(let t=0;t<e.length;t++){const i=e[t];if(i.type==="mediaSource")return null;if(i.type===s)return t}return null},Xa=(s,e)=>{if(e.queue.length===0)return;let t=0,i=e.queue[t];if(i.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),i.action(e),i.doneFn&&i.doneFn(),Xa("audio",e),Xa("video",e));return}if(s!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||Fp(s,e))){if(i.type!==s){if(t=AD(s,e.queue),t===null)return;i=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[s]=i,i.action(s,e),!i.doneFn){e.queuePending[s]=null,Xa(s,e);return}}},h1=(s,e)=>{const t=e[`${s}Buffer`],i=c1(s);t&&(t.removeEventListener("updateend",e[`on${i}UpdateEnd_`]),t.removeEventListener("error",e[`on${i}Error_`]),e.codecs[s]=null,e[`${s}Buffer`]=null)},$r=(s,e)=>s&&e&&Array.prototype.indexOf.call(s.sourceBuffers,e)!==-1,Ki={appendBuffer:(s,e,t)=>(i,r)=>{const n=r[`${i}Buffer`];if($r(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${s.length} bytes to ${i}Buffer`);try{n.appendBuffer(s)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===US?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${i}Buffer`),r.queuePending[i]=null,t(a)}}},remove:(s,e)=>(t,i)=>{const r=i[`${t}Buffer`];if($r(i.mediaSource,r)){i.logger_(`Removing ${s} to ${e} from ${t}Buffer`);try{r.remove(s,e)}catch{i.logger_(`Remove ${s} to ${e} from ${t}Buffer failed`)}}},timestampOffset:s=>(e,t)=>{const i=t[`${e}Buffer`];$r(t.mediaSource,i)&&(t.logger_(`Setting ${e}timestampOffset to ${s}`),i.timestampOffset=s)},callback:s=>(e,t)=>{s()},endOfStream:s=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${s||""})`);try{e.mediaSource.endOfStream(s)}catch(t){R.log.warn("Failed to call media source endOfStream",t)}}},duration:s=>e=>{e.logger_(`Setting mediaSource duration to ${s}`);try{e.mediaSource.duration=s}catch(t){R.log.warn("Failed to set media source duration",t)}},abort:()=>(s,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${s}Buffer`];if($r(e.mediaSource,t)){e.logger_(`calling abort on ${s}Buffer`);try{t.abort()}catch(i){R.log.warn(`Failed to abort on ${s}Buffer`,i)}}},addSourceBuffer:(s,e)=>t=>{const i=c1(s),r=to(e);t.logger_(`Adding ${s}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${i}UpdateEnd_`]),n.addEventListener("error",t[`on${i}Error_`]),t.codecs[s]=e,t[`${s}Buffer`]=n},removeSourceBuffer:s=>e=>{const t=e[`${s}Buffer`];if(h1(s,e),!!$r(e.mediaSource,t)){e.logger_(`Removing ${s}Buffer with codec ${e.codecs[s]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(i){R.log.warn(`Failed to removeSourceBuffer ${s}Buffer`,i)}}},changeType:s=>(e,t)=>{const i=t[`${e}Buffer`],r=to(s);if(!$r(t.mediaSource,i))return;const n=s.substring(0,s.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const l={codecsChangeInfo:{from:a,to:s}};t.trigger({type:"codecschange",metadata:l}),t.logger_(`changing ${e}Buffer codec from ${a} to ${s}`);try{i.changeType(r),t.codecs[e]=s}catch(u){l.errorType=R.Error.StreamingCodecsChangeError,l.error=u,u.metadata=l,t.error_=u,t.trigger("error"),R.log.warn(`Failed to changeType on ${e}Buffer`,u)}}},Xi=({type:s,sourceUpdater:e,action:t,doneFn:i,name:r})=>{e.queue.push({type:s,action:t,doneFn:i,name:r}),Xa(s,e)},Hy=(s,e)=>t=>{const i=e[`${s}Buffered`](),r=UI(i);if(e.logger_(`received "updateend" event for ${s} Source Buffer: `,r),e.queuePending[s]){const n=e.queuePending[s].doneFn;e.queuePending[s]=null,n&&n(e[`${s}Error_`])}Xa(s,e)};let d1=class extends R.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Xa("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=mr("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Hy("video",this),this.onAudioUpdateEnd_=Hy("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){Xi({type:"mediaSource",sourceUpdater:this,action:Ki.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){Xi({type:e,sourceUpdater:this,action:Ki.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){R.log.error("removeSourceBuffer is not supported!");return}Xi({type:"mediaSource",sourceUpdater:this,action:Ki.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!R.browser.IS_FIREFOX&&D.MediaSource&&D.MediaSource.prototype&&typeof D.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return D.SourceBuffer&&D.SourceBuffer.prototype&&typeof D.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){R.log.error("changeType is not supported!");return}Xi({type:e,sourceUpdater:this,action:Ki.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){const{segmentInfo:i,type:r,bytes:n}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const a=t;if(Xi({type:r,sourceUpdater:this,action:Ki.appendBuffer(n,i||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const o=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${o.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,o.forEach(l=>{this.appendBuffer.apply(this,l)})}}audioBuffered(){return $r(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:ri()}videoBuffered(){return $r(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:ri()}buffered(){const e=$r(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=$r(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():jI(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=gn){Xi({type:"mediaSource",sourceUpdater:this,action:Ki.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=gn){typeof e!="string"&&(e=void 0),Xi({type:"mediaSource",sourceUpdater:this,action:Ki.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=gn){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}Xi({type:"audio",sourceUpdater:this,action:Ki.remove(e,t),doneFn:i,name:"remove"})}removeVideo(e,t,i=gn){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}Xi({type:"video",sourceUpdater:this,action:Ki.remove(e,t),doneFn:i,name:"remove"})}updating(){return!!(Fp("audio",this)||Fp("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Xi({type:"audio",sourceUpdater:this,action:Ki.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(Xi({type:"video",sourceUpdater:this,action:Ki.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Xi({type:"audio",sourceUpdater:this,action:Ki.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Xi({type:"video",sourceUpdater:this,action:Ki.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),xD.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>h1(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}};const qy=s=>decodeURIComponent(escape(String.fromCharCode.apply(null,s))),ID=s=>{const e=new Uint8Array(s);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},zy=new Uint8Array(`
215
+
216
+ `.split("").map(s=>s.charCodeAt(0)));let PD=class extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}},DD=class extends Bp{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return ri();const e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return ri([[t,i]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=$c(e);let r=this.initSegments_[i];if(t&&!r&&e.bytes){const n=zy.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(zy,e.bytes.byteLength),this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){pl(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===zr.TIMEOUT&&this.handleTimeout_(),e.code===zr.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const r=this.pendingSegment_,n=i.mp4VttCues&&i.mp4VttCues.length;n&&(r.mp4VttCues=i.mp4VttCues),this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof D.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));return}a.requested=!0;try{this.parseVTTCues_(r)}catch(o){this.stopForError({message:o.message,metadata:{errorType:R.Error.StreamingVttParserError,error:o}});return}if(n||this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach(o=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new D.VTTCue(o.startTime,o.endTime,o.text):o)}),dD(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){const i=e&&e.type==="vtt",r=t&&t.type==="text";i&&r&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const t=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(i=>{const r=i.start+t,n=i.end+t,a=new D.VTTCue(r,n,i.cueText);i.settings&&i.settings.split(" ").forEach(o=>{const l=o.split(":"),u=l[0],c=l[1];a[u]=isNaN(c)?c:Number(c)}),e.cues.push(a)})}parseVTTCues_(e){let t,i=!1;if(typeof D.WebVTT!="function")throw new PD;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof D.TextDecoder=="function"?t=new D.TextDecoder("utf8"):(t=D.WebVTT.StringDecoder(),i=!0);const r=new D.WebVTT.Parser(D,D.vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{R.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;i&&(a=qy(a)),r.parse(a)}let n=e.bytes;i&&(n=qy(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,i){const r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:n,LOCAL:a}=e.timestampmap,l=n/Ls.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(u=>{const c=u.endTime-u.startTime,h=this.handleRollover_(u.startTime+l,t.time);u.startTime=Math.max(h,0),u.endTime=Math.max(h+c,0)}),!i.syncInfo){const u=e.cues[0].startTime,c=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(u,c-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let i=e*Ls.ONE_SECOND_IN_TS;const r=t*Ls.ONE_SECOND_IN_TS;let n;for(r<i?n=-8589934592:n=8589934592;Math.abs(i-r)>4294967296;)i+=n;return i/Ls.ONE_SECOND_IN_TS}};const ND=function(s,e){const t=s.cues;for(let i=0;i<t.length;i++){const r=t[i];if(e>=r.adStartTime&&e<=r.adEndTime)return r}return null},LD=function(s,e,t=0){if(!s.segments)return;let i=t,r;for(let n=0;n<s.segments.length;n++){const a=s.segments[n];if(r||(r=ND(e,i+a.duration/2)),r){if("cueIn"in a){r.endTime=i,r.adEndTime=i,i+=a.duration,r=null;continue}if(i<r.endTime){i+=a.duration;continue}r.endTime+=a.duration}else if("cueOut"in a&&(r=new D.VTTCue(i,i+a.duration,a.cueOut),r.adStartTime=i,r.adEndTime=i+parseFloat(a.cueOut),e.addCue(r)),"cueOutCont"in a){const[o,l]=a.cueOutCont.split("/").map(parseFloat);r=new D.VTTCue(i,i+a.duration,""),r.adStartTime=i-o,r.adEndTime=r.adStartTime+l,e.addCue(r)}i+=a.duration}};class Wy{constructor({start:e,end:t,segmentIndex:i,partIndex:r=null,appended:n=!1}){this.start_=e,this.end_=t,this.segmentIndex_=i,this.partIndex_=r,this.appended_=n}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class OD{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class f1{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:i,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(i,r),!!this.isReliable_)return this.updateStorage_(r,i,this.calculateBaseTime_(i,r,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const r of i)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,i){const r=new Map;let n=`
217
+ `,a=i,o=t;this.start_=a,e.forEach((l,u)=>{const c=this.storage_.get(o),h=a,f=h+l.duration,g=!!(c&&c.segmentSyncInfo&&c.segmentSyncInfo.isAppended),C=new Wy({start:h,end:f,appended:g,segmentIndex:u});l.syncInfo=C;let p=a;const b=(l.parts||[]).map((I,L)=>{const F=p,V=p+I.duration,B=!!(c&&c.partsSyncInfo&&c.partsSyncInfo[L]&&c.partsSyncInfo[L].isAppended),O=new Wy({start:F,end:V,appended:B,segmentIndex:u,partIndex:L});return p=V,n+=`Media Sequence: ${o}.${L} | Range: ${F} --> ${V} | Appended: ${B}
218
+ `,I.syncInfo=O,O});r.set(o,new OD(C,b)),n+=`${u1(l.resolvedUri)} | Media Sequence: ${o} | Range: ${h} --> ${f} | Appended: ${g}
219
+ `,o++,a=f}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t,i){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const r=Math.min(...this.storage_.keys());if(e<r){const n=r-e;let a=this.storage_.get(r).segmentSyncInfo.start;for(let o=0;o<n;o++){const l=t[o];a-=l.duration}return a}return i}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class Gy extends f1{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,i){if(!this.storage_.size){const r=this.parent_.getSyncInfoForMediaSequence(e);return r?r.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,i)}}const MD=86400,Tf=[{name:"VOD",run:(s,e,t,i,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(s,e,t,i,r,n)=>{const a=s.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const o=a.getSyncInfoForTime(r);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(s,e,t,i,r)=>{if(!Object.keys(s.timelineToDatetimeMappings).length)return null;let n=null,a=null;const o=Ap(e);r=r||0;for(let l=0;l<o.length;l++){const u=e.endList||r===0?l:o.length-(l+1),c=o[u],h=c.segment,f=s.timelineToDatetimeMappings[h.timeline];if(!f||!h.dateTimeObject)continue;let C=h.dateTimeObject.getTime()/1e3+f;if(h.parts&&typeof c.partIndex=="number")for(let b=0;b<c.partIndex;b++)C+=h.parts[b].duration;const p=Math.abs(r-C);if(a!==null&&(p===0||a<p))break;a=p,n={time:C,segmentIndex:c.segmentIndex,partIndex:c.partIndex}}return n}},{name:"Segment",run:(s,e,t,i,r)=>{let n=null,a=null;r=r||0;const o=Ap(e);for(let l=0;l<o.length;l++){const u=e.endList||r===0?l:o.length-(l+1),c=o[u],h=c.segment,f=c.part&&c.part.start||h&&h.start;if(h.timeline===i&&typeof f<"u"){const g=Math.abs(r-f);if(a!==null&&a<g)break;(!n||a===null||a>=g)&&(a=g,n={time:f,segmentIndex:c.segmentIndex,partIndex:c.partIndex})}}return n}},{name:"Discontinuity",run:(s,e,t,i,r)=>{let n=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let o=0;o<e.discontinuityStarts.length;o++){const l=e.discontinuityStarts[o],u=e.discontinuitySequence+o+1,c=s.discontinuities[u];if(c){const h=Math.abs(r-c.time);if(a!==null&&a<h)break;(!n||a===null||a>=h)&&(a=h,n={time:c.time,segmentIndex:l,partIndex:null})}}}return n}},{name:"Playlist",run:(s,e,t,i,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];let RD=class extends R.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new f1,i=new Gy(t),r=new Gy(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:r},this.logger_=mr("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,r,n){if(t!==1/0)return Tf.find(({name:l})=>l==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,i,r,n);if(!a.length)return null;for(const o of a){const{syncPoint:l,strategy:u}=o,{segmentIndex:c,time:h}=l;if(c<0)continue;const f=e.segments[c],g=h,C=g+f.duration;if(this.logger_(`Strategy: ${u}. Current time: ${r}. selected segment: ${c}. Time: [${g} -> ${C}]}`),r>=g&&r<C)return this.logger_("Found sync point with exact match: ",l),l}return this.selectSyncPoint_(a,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;const r=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+wl({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,r,n){const a=[];for(let o=0;o<Tf.length;o++){const l=Tf[o],u=l.run(this,e,t,i,r,n);u&&(u.strategy=l.name,a.push({strategy:l.name,syncPoint:u}))}return a}selectSyncPoint_(e,t){let i=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),n=e[0].strategy;for(let a=1;a<e.length;a++){const o=Math.abs(e[a].syncPoint[t.key]-t.value);o<r&&(r=o,i=e[a].syncPoint,n=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${n}]: [time:${i.time}, segmentIndex:${i.segmentIndex}`+(typeof i.partIndex=="number"?`,partIndex:${i.partIndex}`:"")+"]"),i}saveExpiredSegmentInfo(e,t){const i=t.mediaSequence-e.mediaSequence;if(i>MD){R.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);return}for(let r=i-1;r>=0;r--){const n=e.segments[r];if(n&&typeof n.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const r=e.segment,n=e.part;let a=this.timelines[e.timeline],o,l;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,l=t.end+a.mapping;else if(a)o=t.start+a.mapping,l=t.end+a.mapping;else return!1;return n&&(n.start=o,n.end=l),(!r.start||o<r.start)&&(r.start=o),r.end=l,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){const n=t.discontinuityStarts[r],a=t.discontinuitySequence+r+1,o=n-e.mediaIndex,l=Math.abs(o);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>l){let u;o<0?u=i.start-wl({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):u=i.end+wl({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:u,accuracy:l}}}}dispose(){this.trigger("dispose"),this.off()}},BD=class extends R.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return typeof t=="number"&&typeof i=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if(typeof t=="number"&&typeof i=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}};const FD=YS(JS(function(){var s=(function(){function p(){this.listeners={}}var b=p.prototype;return b.on=function(L,F){this.listeners[L]||(this.listeners[L]=[]),this.listeners[L].push(F)},b.off=function(L,F){if(!this.listeners[L])return!1;var V=this.listeners[L].indexOf(F);return this.listeners[L]=this.listeners[L].slice(0),this.listeners[L].splice(V,1),V>-1},b.trigger=function(L){var F=this.listeners[L];if(F)if(arguments.length===2)for(var V=F.length,B=0;B<V;++B)F[B].call(this,arguments[1]);else for(var O=Array.prototype.slice.call(arguments,1),M=F.length,U=0;U<M;++U)F[U].apply(this,O)},b.dispose=function(){this.listeners={}},b.pipe=function(L){this.on("data",function(F){L.push(F)})},p})();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(p){return p.subarray(0,p.byteLength-p[p.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */const t=function(){const p=[[[],[],[],[],[]],[[],[],[],[],[]]],b=p[0],I=p[1],L=b[4],F=I[4];let V,B,O;const M=[],U=[];let w,P,Q,G,K,ce;for(V=0;V<256;V++)U[(M[V]=V<<1^(V>>7)*283)^V]=V;for(B=O=0;!L[B];B^=w||1,O=U[O]||1)for(G=O^O<<1^O<<2^O<<3^O<<4,G=G>>8^G&255^99,L[B]=G,F[G]=B,Q=M[P=M[w=M[B]]],ce=Q*16843009^P*65537^w*257^B*16843008,K=M[G]*257^G*16843008,V=0;V<4;V++)b[V][B]=K=K<<24^K>>>8,I[V][G]=ce=ce<<24^ce>>>8;for(V=0;V<5;V++)b[V]=b[V].slice(0),I[V]=I[V].slice(0);return p};let i=null;class r{constructor(b){i||(i=t()),this._tables=[[i[0][0].slice(),i[0][1].slice(),i[0][2].slice(),i[0][3].slice(),i[0][4].slice()],[i[1][0].slice(),i[1][1].slice(),i[1][2].slice(),i[1][3].slice(),i[1][4].slice()]];let I,L,F;const V=this._tables[0][4],B=this._tables[1],O=b.length;let M=1;if(O!==4&&O!==6&&O!==8)throw new Error("Invalid aes key size");const U=b.slice(0),w=[];for(this._key=[U,w],I=O;I<4*O+28;I++)F=U[I-1],(I%O===0||O===8&&I%O===4)&&(F=V[F>>>24]<<24^V[F>>16&255]<<16^V[F>>8&255]<<8^V[F&255],I%O===0&&(F=F<<8^F>>>24^M<<24,M=M<<1^(M>>7)*283)),U[I]=U[I-O]^F;for(L=0;I;L++,I--)F=U[L&3?I:I-4],I<=4||L<4?w[L]=F:w[L]=B[0][V[F>>>24]]^B[1][V[F>>16&255]]^B[2][V[F>>8&255]]^B[3][V[F&255]]}decrypt(b,I,L,F,V,B){const O=this._key[1];let M=b^O[0],U=F^O[1],w=L^O[2],P=I^O[3],Q,G,K;const ce=O.length/4-2;let de,pe=4;const ne=this._tables[1],se=ne[0],ue=ne[1],he=ne[2],ve=ne[3],Ae=ne[4];for(de=0;de<ce;de++)Q=se[M>>>24]^ue[U>>16&255]^he[w>>8&255]^ve[P&255]^O[pe],G=se[U>>>24]^ue[w>>16&255]^he[P>>8&255]^ve[M&255]^O[pe+1],K=se[w>>>24]^ue[P>>16&255]^he[M>>8&255]^ve[U&255]^O[pe+2],P=se[P>>>24]^ue[M>>16&255]^he[U>>8&255]^ve[w&255]^O[pe+3],pe+=4,M=Q,U=G,w=K;for(de=0;de<4;de++)V[(3&-de)+B]=Ae[M>>>24]<<24^Ae[U>>16&255]<<16^Ae[w>>8&255]<<8^Ae[P&255]^O[pe++],Q=M,M=U,U=w,w=P,P=Q}}class n extends s{constructor(){super(s),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(b){this.jobs.push(b),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(p){return p<<24|(p&65280)<<8|(p&16711680)>>8|p>>>24},o=function(p,b,I){const L=new Int32Array(p.buffer,p.byteOffset,p.byteLength>>2),F=new r(Array.prototype.slice.call(b)),V=new Uint8Array(p.byteLength),B=new Int32Array(V.buffer);let O,M,U,w,P,Q,G,K,ce;for(O=I[0],M=I[1],U=I[2],w=I[3],ce=0;ce<L.length;ce+=4)P=a(L[ce]),Q=a(L[ce+1]),G=a(L[ce+2]),K=a(L[ce+3]),F.decrypt(P,Q,G,K,B,ce),B[ce]=a(B[ce]^O),B[ce+1]=a(B[ce+1]^M),B[ce+2]=a(B[ce+2]^U),B[ce+3]=a(B[ce+3]^w),O=P,M=Q,U=G,w=K;return V};class l{constructor(b,I,L,F){const V=l.STEP,B=new Int32Array(b.buffer),O=new Uint8Array(b.byteLength);let M=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(B.subarray(M,M+V),I,L,O)),M=V;M<B.length;M+=V)L=new Uint32Array([a(B[M-4]),a(B[M-3]),a(B[M-2]),a(B[M-1])]),this.asyncStream_.push(this.decryptChunk_(B.subarray(M,M+V),I,L,O));this.asyncStream_.push(function(){F(null,e(O))})}static get STEP(){return 32e3}decryptChunk_(b,I,L,F){return function(){const V=o(b,I,L);F.set(V,b.byteOffset)}}}var u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c;typeof window<"u"?c=window:typeof u<"u"?c=u:typeof self<"u"?c=self:c={};var h=c,f=function(b){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(b):b&&b.buffer instanceof ArrayBuffer},g=h.BigInt||Number;g("0x1"),g("0x100"),g("0x10000"),g("0x1000000"),g("0x100000000"),g("0x10000000000"),g("0x1000000000000"),g("0x100000000000000"),g("0x10000000000000000"),(function(){var p=new Uint16Array([65484]),b=new Uint8Array(p.buffer,p.byteOffset,p.byteLength);return b[0]===255?"big":b[0]===204?"little":"unknown"})();const C=function(p){const b={};return Object.keys(p).forEach(I=>{const L=p[I];f(L)?b[I]={bytes:L.buffer,byteOffset:L.byteOffset,byteLength:L.byteLength}:b[I]=L}),b};self.onmessage=function(p){const b=p.data,I=new Uint8Array(b.encrypted.bytes,b.encrypted.byteOffset,b.encrypted.byteLength),L=new Uint32Array(b.key.bytes,b.key.byteOffset,b.key.byteLength/4),F=new Uint32Array(b.iv.bytes,b.iv.byteOffset,b.iv.byteLength/4);new l(I,L,F,function(V,B){self.postMessage(C({source:b.source,decrypted:B}),[B.buffer])})}}));var UD=QS(FD);const $D=s=>{let e=s.default?"main":"alternative";return s.characteristics&&s.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},p1=(s,e)=>{s.abort(),s.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Up=(s,e)=>{e.activePlaylistLoader=s,s.load()},jD=(s,e)=>()=>{const{segmentLoaders:{[s]:t,main:i},mediaTypes:{[s]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),o=r.activePlaylistLoader,l=r.lastGroup_;if(!(a&&l&&a.id===l.id)&&(r.lastGroup_=a,r.lastTrack_=n,p1(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){o&&i.resetEverything();return}t.resyncLoader(),Up(a.playlistLoader,r)}},VD=(s,e)=>()=>{const{segmentLoaders:{[s]:t},mediaTypes:{[s]:i}}=e;i.lastGroup_=null,t.abort(),t.pause()},HD=(s,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[s]:i,main:r},mediaTypes:{[s]:n}}=e,a=n.activeTrack(),o=n.getActiveGroup(),l=n.activePlaylistLoader,u=n.lastTrack_;if(!(u&&a&&u.id===a.id)&&(n.lastGroup_=o,n.lastTrack_=a,p1(i,n),!!o)){if(o.isMainPlaylist){if(!a||!u||a.id===u.id)return;const c=e.vhs.playlistController_,h=c.selectPlaylist();if(c.media()===h)return;n.logger_(`track change. Switching main audio from ${u.id} to ${a.id}`),t.pause(),r.resetEverything(),c.fastQualityChange_(h);return}if(s==="AUDIO"){if(!o.playlistLoader){r.setAudio(!0),r.resetEverything();return}i.setAudio(!0),r.setAudio(!1)}if(l===o.playlistLoader){Up(o.playlistLoader,n);return}i.track&&i.track(a),i.resetEverything(),Up(o.playlistLoader,n)}},Hc={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:t},excludePlaylist:i}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(l=>l.default)[0]||n[0]).id,o=t.tracks[a];if(r===o){i({error:{message:"Problem encountered loading the default audio track."}});return}R.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const l in t.tracks)t.tracks[l].enabled=t.tracks[l]===o;t.onTrackChanged()},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:t}}=e;R.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const i=t.activeTrack();i&&(i.mode="disabled"),t.onTrackChanged()}},Ky={AUDIO:(s,e,t)=>{if(!e)return;const{tech:i,requestOptions:r,segmentLoaders:{[s]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!i.paused()||a.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),i.paused()||n.load()}),e.on("error",Hc[s](s,t))},SUBTITLES:(s,e,t)=>{const{tech:i,requestOptions:r,segmentLoaders:{[s]:n},mediaTypes:{[s]:a}}=t;e.on("loadedmetadata",()=>{const o=e.media();n.playlist(o,r),n.track(a.activeTrack()),(!i.paused()||o.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),i.paused()||n.load()}),e.on("error",Hc[s](s,t))}},qD={AUDIO:(s,e)=>{const{vhs:t,sourceType:i,segmentLoaders:{[s]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[s]:{groups:o,tracks:l,logger_:u}},mainPlaylistLoader:c}=e,h=Yl(c.main);(!a[s]||Object.keys(a[s]).length===0)&&(a[s]={main:{default:{default:!0}}},h&&(a[s].main.default.playlists=c.main.playlists));for(const f in a[s]){o[f]||(o[f]=[]);for(const g in a[s][f]){let C=a[s][f][g],p;if(h?(u(`AUDIO group '${f}' label '${g}' is a main playlist`),C.isMainPlaylist=!0,p=null):i==="vhs-json"&&C.playlists?p=new Ba(C.playlists[0],t,n):C.resolvedUri?p=new Ba(C.resolvedUri,t,n):C.playlists&&i==="dash"?p=new Op(C.playlists[0],t,n,c):p=null,C=lt({id:g,playlistLoader:p},C),Ky[s](s,C.playlistLoader,e),o[f].push(C),typeof l[g]>"u"){const b=new R.AudioTrack({id:g,kind:$D(C),enabled:!1,language:C.language,default:C.default,label:g});l[g]=b}}}r.on("error",Hc[s](s,e))},SUBTITLES:(s,e)=>{const{tech:t,vhs:i,sourceType:r,segmentLoaders:{[s]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[s]:{groups:l,tracks:u}},mainPlaylistLoader:c}=e;for(const h in o[s]){l[h]||(l[h]=[]);for(const f in o[s][h]){if(!i.options_.useForcedSubtitles&&o[s][h][f].forced)continue;let g=o[s][h][f],C;if(r==="hls")C=new Ba(g.resolvedUri,i,a);else if(r==="dash"){if(!g.playlists.filter(b=>b.excludeUntil!==1/0).length)return;C=new Op(g.playlists[0],i,a,c)}else r==="vhs-json"&&(C=new Ba(g.playlists?g.playlists[0]:g.resolvedUri,i,a));if(g=lt({id:f,playlistLoader:C},g),Ky[s](s,g.playlistLoader,e),l[h].push(g),typeof u[f]>"u"){const p=t.addRemoteTextTrack({id:f,kind:"subtitles",default:g.default&&g.autoselect,language:g.language,label:f},!1).track;u[f]=p}}}n.on("error",Hc[s](s,e))},"CLOSED-CAPTIONS":(s,e)=>{const{tech:t,main:{mediaGroups:i},mediaTypes:{[s]:{groups:r,tracks:n}}}=e;for(const a in i[s]){r[a]||(r[a]=[]);for(const o in i[s][a]){const l=i[s][a][o];if(!/^(?:CC|SERVICE)/.test(l.instreamId))continue;const u=t.options_.vhs&&t.options_.vhs.captionServices||{};let c={label:o,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(u[c.instreamId]&&(c=lt(c,u[c.instreamId])),c.default===void 0&&delete c.default,r[a].push(lt({id:o},l)),typeof n[o]>"u"){const h=t.addRemoteTextTrack({id:c.instreamId,kind:"captions",default:c.default,language:c.language,label:c.label},!1).track;n[o]=h}}}}},m1=(s,e)=>{for(let t=0;t<s.length;t++)if(ag(e,s[t])||s[t].playlists&&m1(s[t].playlists,e))return!0;return!1},zD=(s,e)=>t=>{const{mainPlaylistLoader:i,mediaTypes:{[s]:{groups:r}}}=e,n=i.media();if(!n)return null;let a=null;n.attributes[s]&&(a=r[n.attributes[s]]);const o=Object.keys(r);if(!a)if(s==="AUDIO"&&o.length>1&&Yl(e.main))for(let l=0;l<o.length;l++){const u=r[o[l]];if(m1(u,n)){a=u;break}}else r.main?a=r.main:o.length===1&&(a=r[o[0]]);return typeof t>"u"?a:t===null||!a?null:a.filter(l=>l.id===t.id)[0]||null},WD={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].enabled)return t[i];return null},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].mode==="showing"||t[i].mode==="hidden")return t[i];return null}},GD=(s,{mediaTypes:e})=>()=>{const t=e[s].activeTrack();return t?e[s].activeGroup(t):null},KD=s=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(u=>{qD[u](u,s)});const{mediaTypes:e,mainPlaylistLoader:t,tech:i,vhs:r,segmentLoaders:{["AUDIO"]:n,main:a}}=s;["AUDIO","SUBTITLES"].forEach(u=>{e[u].activeGroup=zD(u,s),e[u].activeTrack=WD[u](u,s),e[u].onGroupChanged=jD(u,s),e[u].onGroupChanging=VD(u,s),e[u].onTrackChanged=HD(u,s),e[u].getActiveGroup=GD(u,s)});const o=e.AUDIO.activeGroup();if(o){const u=(o.filter(h=>h.default)[0]||o[0]).id;e.AUDIO.tracks[u].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(u=>e[u].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(u=>e[u].onGroupChanging())});const l=()=>{e.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"})};i.audioTracks().addEventListener("change",l),i.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{i.audioTracks().removeEventListener("change",l),i.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(const u in e.AUDIO.tracks)i.audioTracks().addTrack(e.AUDIO.tracks[u])},XD=()=>{const s={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{s[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:gn,activeTrack:gn,getActiveGroup:gn,onGroupChanged:gn,onTrackChanged:gn,lastTrack_:null,logger_:mr(`MediaGroups[${e}]`)}}),s};class Xy{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Ui(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class QD extends R.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new Xy,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=mr("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i){this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),this.trigger("error");return}if(i.startsWith("data:")){this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1));return}this.steeringManifest.reloadUri=Ui(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const i=e?t:this.getRequestURI(t);if(!i){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const r={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},(n,a)=>{if(n){if(a.status===410){this.logger_(`manifest request 410 ${n}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),this.excludedSteeringManifestURLs.add(i);return}if(a.status===429){const u=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${u} seconds.`),this.startTTLTimeout_(parseInt(u,10));return}this.logger_(`manifest failed to load ${n}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:r});let o;try{o=JSON.parse(this.request_.responseText)}catch(u){const c={errorType:R.Error.StreamingContentSteeringParserError,error:u};this.trigger({type:"error",metadata:c})}this.assignSteeringProperties_(o);const l={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:l}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new D.URL(e),i=new D.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(D.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new D.URL(e),i=this.getPathway(),r=this.getBandwidth_();if(i){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,i)}if(r){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const i=(r=>{for(const n of r)if(this.availablePathways_.has(n))return n;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==i&&(this.currentPathway=i,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=D.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){D.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new Xy}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(Ui(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const YD=10;let Gn;const JD=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],ZD=function(s){return this.audioSegmentLoader_[s]+this.mainSegmentLoader_[s]},eN=function({currentPlaylist:s,buffered:e,currentTime:t,nextPlaylist:i,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:l}){if(!i)return R.log.warn("We received no playlist to switch to. Please check your stream."),!1;const u=`allowing switch ${s&&s.id||"null"} -> ${i.id}`;if(!s)return l(`${u} as current playlist is not set`),!0;if(i.id===s.id)return!1;const c=!!Ra(e,t).length;if(!s.endList)return!c&&typeof s.partTargetDuration=="number"?(l(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(l(`${u} as current playlist is live`),!0);const h=rg(e,t),f=o?ei.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ei.MAX_BUFFER_LOW_WATER_LINE;if(a<f)return l(`${u} as duration < max low water line (${a} < ${f})`),!0;const g=i.attributes.BANDWIDTH,C=s.attributes.BANDWIDTH;if(g<C&&(!o||h<n)){let p=`${u} as next bandwidth < current bandwidth (${g} < ${C})`;return o&&(p+=` and forwardBuffer < bufferHighWaterLine (${h} < ${n})`),l(p),!0}if((!o||g>C)&&h>=r){let p=`${u} as forwardBuffer >= bufferLowWaterLine (${h} >= ${r})`;return o&&(p+=` and next bandwidth > current bandwidth (${g} > ${C})`),l(p),!0}return l(`not ${u} as no switching criteria met`),!1};class tN extends R.EventTarget{constructor(e){super();const{src:t,withCredentials:i,tech:r,bandwidth:n,externVhs:a,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:u,sourceType:c,cacheEncryptionKeys:h,bufferBasedABR:f,leastPixelDiffSelector:g,captionServices:C,experimentalUseMMS:p}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:b}=e;(b===null||typeof b>"u")&&(b=1/0),Gn=a,this.bufferBasedABR=!!f,this.leastPixelDiffSelector=!!g,this.withCredentials=i,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=c,this.useCueTags_=o,this.playlistExclusionDuration=l,this.maxPlaylistRetries=b,this.enableLowInitialPlaylist=u,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:b,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=XD(),p&&D.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new D.ManagedMediaSource,R.log("Using ManagedMediaSource")):D.MediaSource&&(this.mediaSource=new D.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=ri(),this.hasPlayed_=!1,this.syncController_=new RD(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new UD,this.sourceUpdater_=new d1(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new BD,this.keyStatusMap_=new Map;const I={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:C,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:h,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Op(t,this.vhs_,lt(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Ba(t,this.vhs_,lt(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Bp(lt(I,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Bp(lt(I,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new DD(lt(I,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((V,B)=>{function O(){r.off("vttjserror",M),V()}function M(){r.off("vttjsloaded",O),B()}r.one("vttjsloaded",O),r.one("vttjserror",M),r.addWebVttScript_()})}),e);const L=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new QD(this.vhs_.xhr,L),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),JD.forEach(V=>{this[V+"_"]=ZD.bind(this,V)}),this.logger_=mr("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const F=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(F,()=>{const V=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-V,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const r=this.media(),n=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);const o={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:o}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(i&&r){const a=(i.length?i[0].playlists:i.playlists).filter(o=>o.attributes.serviceLocation===r);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=D.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(D.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,r=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const o=i.main||r.length&&i[r[0]];for(const l in o)if(o[l].default){n={label:l};break}}if(!n)return t;const a=[];for(const o in i)if(i[o][n.label]){const l=i[o][n.label];if(l.playlists&&l.playlists.length)a.push.apply(a,l.playlists);else if(l.uri)a.push(l);else if(e.playlists.length)for(let u=0;u<e.playlists.length;u++){const c=e.playlists[u];c.attributes&&c.attributes.AUDIO&&c.attributes.AUDIO===o&&a.push(c)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const t=this.mainPlaylistLoader_.media(),i=t.targetDuration*1.5*1e3;Ip(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=i,t.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),KD({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),t),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let i;if(this.enableLowInitialPlaylist&&(i=this.selectInitialPlaylist()),i||(i=this.selectPlaylist()),!i||!this.shouldSwitchToMedia_(i)||(this.initialMedia_=i,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}),this.mainPlaylistLoader_.on("error",()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const t=this.mainPlaylistLoader_.media(),i=t.targetDuration*1.5*1e3;Ip(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=i,this.sourceType_==="dash"&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(t)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(t=>{this.mainPlaylistLoader_.on(t,i=>{this.player_.trigger(mt({},i))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let r=!0;const n=Object.keys(i.AUDIO);for(const a in i.AUDIO)for(const o in i.AUDIO[a])i.AUDIO[a][o].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Gn.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(i.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return eN({buffered:a,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const i=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:i.playlist,error:i})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const i=this.audioSegmentLoader_.pendingSegment_;if(!i||!i.segment||!i.segment.syncInfo)return;const r=i.segment.syncInfo.end+.01;this.tech_.setCurrentTime(r)}),this.mainSegmentLoader_.on("earlyabort",i=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:YD}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const i=this.getCodecsOrExclude_();i&&this.sourceUpdater_.addOrChangeSourceBuffers(i)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(i=>{this.mainSegmentLoader_.on(i,r=>{this.player_.trigger(mt({},r))}),this.audioSegmentLoader_.on(i,r=>{this.player_.trigger(mt({},r))}),this.subtitleSegmentLoader_.on(i,r=>{this.player_.trigger(mt({},r))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.mainSegmentLoader_.load()})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const i=t.end(0);let r=i;if(e.start){const n=e.start.timeOffset;n<0?r=Math.max(i+n,t.start(0)):r=Math.min(i,n)}this.trigger("firstplay"),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();typeof e<"u"&&typeof e.then=="function"&&e.then(null,t=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const i=this.syncController_.getExpiredTime(e,this.duration());if(i===null)return!1;const r=Gn.Playlist.playlistEnd(e,i),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-n<=qr;const o=a.end(a.length-1);return o-n<=qr&&r-o<=qr}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,n=r.filter($h),a=n.length===1&&n[0]===e;if(r.length===1&&i!==1/0)return R.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const C=this.pathwayAttribute_(e),p=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(C),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(C)},p);return}let g=!1;r.forEach(C=>{if(C===e)return;const p=C.excludeUntil;typeof p<"u"&&p!==1/0&&(g=!0,delete C.excludeUntil)}),g&&(R.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let o;e.playlistErrors_>this.maxPlaylistRetries?o=1/0:o=Date.now()+i*1e3,e.excludeUntil=o,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const l=this.selectPlaylist();if(!l){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const u=t.internal?this.logger_:R.log.warn,c=t.message?" "+t.message:"";u(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${c} Switching to playlist ${l.id}.`),l.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),l.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const h=l.targetDuration/2*1e3||5*1e3,f=typeof l.lastRequest=="number"&&Date.now()-l.lastRequest<=h;return this.switchMedia_(l,"exclude",a||f)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],r=e==="all";(r||e==="main")&&i.push(this.mainPlaylistLoader_);const n=[];(r||e==="audio")&&n.push("AUDIO"),(r||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const o=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;o&&i.push(o)}),["main","audio","subtitle"].forEach(a=>{const o=this[`${a}SegmentLoader_`];o&&(e===a||e==="all")&&i.push(o)}),i.forEach(a=>t.forEach(o=>{typeof a[o]=="function"&&a[o]()}))}setCurrentTime(e){const t=Ra(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Gn.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){const i=e.media();if(!i)return null;const r=this.syncController_.getMediaSequenceSync(t);if(r&&r.isReliable){const o=r.start,l=r.end;if(!isFinite(o)||!isFinite(l))return null;const u=Gn.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i),c=Math.max(0,l-u);return c<o?null:ri([[o,c]])}const n=this.syncController_.getExpiredTime(i,this.duration());if(n===null)return null;const a=Gn.Playlist.seekable(i,n,Gn.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i));return a.length?a:null}computeFinalSeekable_(e,t){if(!t)return e;const i=e.start(0),r=e.end(0),n=t.start(0),a=t.end(0);return n>r||i>a?e:ri([[Math.max(i,n),Math.min(r,a)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let t;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!t))return;const i=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||i&&i.length&&this.seekable_.length&&i.start(0)===this.seekable_.start(0)&&i.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${kS(this.seekable_)}]`);const r={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:r}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const r=this.seekable();if(!r.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<r.end(r.length-1))&&this.sourceUpdater_.setDuration(r.end(r.length-1));return}const t=this.tech_.buffered();let i=Gn.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const i in t)t[i].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=kl(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=i.video||e.main.videoCodec||jk),e.main.isMuxed&&(r.video+=`,${i.audio||e.main.audioCodec||Mv}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||Mv,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(u,c)=>u?bl(c):Zd(c),o={};let l;if(["video","audio"].forEach(function(u){if(r.hasOwnProperty(u)&&!a(e[u].isFmp4,r[u])){const c=e[u].isFmp4?"browser":"muxer";o[c]=o[c]||[],o[c].push(r[u]),u==="audio"&&(l=c)}}),n&&l&&t.attributes.AUDIO){const u=t.attributes.AUDIO;this.main().playlists.forEach(c=>{(c.attributes&&c.attributes.AUDIO)===u&&c!==t&&(c.excludeUntil=1/0)}),this.logger_(`excluding audio group ${u} as ${l} does not support codec(s): "${r.audio}"`)}if(Object.keys(o).length){const u=Object.keys(o).reduce((c,h)=>(c&&(c+=", "),c+=`${h} does not support codec(s): "${o[h].join(",")}"`,c),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:u},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const u=[];if(["video","audio"].forEach(c=>{const h=(Fr(this.sourceUpdater_.codecs[c]||"")[0]||{}).type,f=(Fr(r[c]||"")[0]||{}).type;h&&f&&h.toLowerCase()!==f.toLowerCase()&&u.push(`"${this.sourceUpdater_.codecs[c]}" -> "${r[c]}"`)}),u.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${u.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{const r=e[i];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=kl(this.main,r),a=[];n.audio&&!Zd(n.audio)&&!bl(n.audio)&&a.push(`audio codec ${n.audio}`),n.video&&!Zd(n.video)&&!bl(n.video)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,r=jc(Fr(e)),n=Ry(r),a=r.video&&Fr(r.video)[0]||null,o=r.audio&&Fr(r.audio)[0]||null;Object.keys(i).forEach(l=>{const u=i[l];if(t.indexOf(u.id)!==-1||u.excludeUntil===1/0)return;t.push(u.id);const c=[],h=kl(this.mainPlaylistLoader_.main,u),f=Ry(h);if(!(!h.audio&&!h.video)){if(f!==n&&c.push(`codec count "${f}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const g=h.video&&Fr(h.video)[0]||null,C=h.audio&&Fr(h.audio)[0]||null;g&&a&&g.type.toLowerCase()!==a.type.toLowerCase()&&c.push(`video codec "${g.type}" !== "${a.type}"`),C&&o&&C.type.toLowerCase()!==o.type.toLowerCase()&&c.push(`audio codec "${C.type}" !== "${o.type}"`)}c.length&&(u.excludeUntil=1/0,this.logger_(`excluding ${u.id}: ${c.join(" && ")}`))}})}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),LD(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=ei.GOAL_BUFFER_LENGTH,i=ei.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,ei.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=ei.BUFFER_LOW_WATER_LINE,i=ei.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,ei.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,ei.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return ei.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){Uy(this.inbandTextTracks_,"com.apple.streaming",this.tech_),hD({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Uy(this.inbandTextTracks_,e,this.tech_),lD({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.contentSteeringController_.on(t,i=>{this.trigger(mt({},i))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const t=this.main();(this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||(()=>{const n=this.contentSteeringController_.getAvailablePathways(),a=[];for(const o of t.playlists){const l=o.attributes.serviceLocation;if(l&&(a.push(l),!n.has(l)))return!0}return!!(!a.length&&n.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const i=this.main().playlists,r=new Set;let n=!1;Object.keys(i).forEach(a=>{const o=i[a],l=this.pathwayAttribute_(o),u=l&&e!==l;o.excludeUntil===1/0&&o.lastExcludeReason_==="content-steering"&&!u&&(delete o.excludeUntil,delete o.lastExcludeReason_,n=!0);const h=!o.excludeUntil&&o.excludeUntil!==1/0;!r.has(o.id)&&u&&h&&(r.add(o.id),o.excludeUntil=1/0,o.lastExcludeReason_="content-steering",this.logger_(`excluding ${o.id} for ${o.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const o=this.mediaTypes_[a];if(o.activePlaylistLoader){const l=o.activePlaylistLoader.media_;l&&l.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,i=this.contentSteeringController_.currentPathwayClones,r=this.contentSteeringController_.nextPathwayClones;if(i&&i.size||r&&r.size){for(const[a,o]of i.entries())r.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(o),this.contentSteeringController_.excludePathway(a));for(const[a,o]of r.entries()){const l=i.get(a);if(!l){t.filter(c=>c.attributes["PATHWAY-ID"]===o["BASE-ID"]).forEach(c=>{this.mainPlaylistLoader_.addClonePathway(o,c)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(l,o)||(this.mainPlaylistLoader_.updateOrDeleteClone(o,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...r])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const i=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in i)if(i[n]!==r[n])return!1;for(const n in r)if(i[n]!==r[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(i=>{const r=this.mainPlaylistLoader_.getKeyIdSet(i);!r||!r.size||r.forEach(n=>{const a="usable",o=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,l=i.lastExcludeReason_===t&&i.excludeUntil===1/0;o?o&&l&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${n} is ${a}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(i=>{const r=i&&i.attributes&&i.attributes.RESOLUTION&&i.attributes.RESOLUTION.height<720,n=i.excludeUntil===1/0&&i.lastExcludeReason_===t;r&&n&&(delete i.excludeUntil,R.log.warn(`enabling non-HD playlist ${i.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=(typeof e=="string"?e:ID(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const iN=(s,e,t)=>i=>{const r=s.main.playlists[e],n=sg(r),a=$h(r);if(typeof i>"u")return a;i?delete r.disabled:r.disabled=!0;const o={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return i!==a&&!n&&(t(r),i?s.trigger({type:"renditionenabled",metadata:o}):s.trigger({type:"renditiondisabled",metadata:o})),i};let rN=class{constructor(e,t,i){const{playlistController_:r}=e,n=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=kl(r.main(),t),this.playlist=t,this.id=i,this.enabled=iN(e.playlists,t.id,n)}};const nN=function(s){s.representations=()=>{const e=s.playlistController_.main(),t=Yl(e)?s.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(i=>!sg(i)).map((i,r)=>new rN(s,i,i.id)):[]}},Qy=["seeking","seeked","pause","playing","error"];let sN=class extends R.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=mr("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],l={};o.forEach(c=>{l[c]={reset:()=>this.resetSegmentDownloads_(c),updateend:()=>this.checkSegmentDownloads_(c)},a[`${c}SegmentLoader_`].on("appendsdone",l[c].updateend),a[`${c}SegmentLoader_`].on("playlistupdate",l[c].reset),this.tech_.on(["seeked","seeking"],l[c].reset)});const u=c=>{["main","audio"].forEach(h=>{a[`${h}SegmentLoader_`][c]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),u("off"))},this.clearSeekingAppendCheck_=()=>u("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),u("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(Qy,n),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(Qy,n),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(c=>{a[`${c}SegmentLoader_`].off("appendsdone",l[c].updateend),a[`${c}SegmentLoader_`].off("playlistupdate",l[c].reset),this.tech_.off(["seeked","seeking"],l[c].reset)}),this.checkCurrentTimeTimeout_&&D.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&D.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=D.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[`${e}SegmentLoader_`],r=i.buffered_(),n=HI(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){const a={bufferedRanges:r};t.trigger({type:"bufferedrangeschanged",metadata:a}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Os(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+qr>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(ri([this.lastRecordedTime,e]));const i={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:i}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),i=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(r&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,i)){const C=t.start(0);n=C+(C===t.end(0)?0:qr)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${i} with seekable range ${kS(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,o=this.tech_.buffered(),l=a.audioBuffer?a.audioBuffered():null,u=a.videoBuffer?a.videoBuffered():null,c=this.media(),h=c.partTargetDuration?c.partTargetDuration:(c.targetDuration-Hr)*2,f=[l,u];for(let C=0;C<f.length;C++){if(!f[C])continue;if(rg(f[C],i)<h)return!1}const g=Vu(o,i);return g.length===0?!1:(n=g.start(0)+qr,this.logger_(`Buffered region starts (${g.start(0)}) just beyond seek point (${i}). Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),i=Ra(t,e);if(i.length&&e+3<=i.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${i.start(0)} -> ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const o=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${o}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=Vu(r,t);return a.length>0?(this.logger_(`Stopped at ${t} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,i,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+qr;const a=!i.endList,o=typeof i.partTargetDuration=="number";return a&&(o||r)&&(n=e.end(e.length-1)+i.targetDuration*3),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e)return;let r;if(e.length&&t.length){const n=Ra(e,i-3),a=Ra(e,i),o=Ra(t,i);o.length&&!a.length&&n.length&&(r={start:n.end(0),end:o.end(0)})}else Vu(e,i).length||(r=this.gapFromVideoUnderflow_(e,i));return r?(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${i}`),!0):!1}skipTheGap_(e){const t=this.tech_.buffered(),i=this.tech_.currentTime(),r=Vu(t,i);if(this.resetTimeUpdate_(),r.length===0||i!==e)return;this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+Hr);const n={gapInfo:{from:i,to:r.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const i=$I(e);for(let r=0;r<i.length;r++){const n=i.start(r),a=i.end(r);if(t-n<4&&t-n>2)return{start:n,end:a}}return null}};const aN={errorInterval:30,getSource(s){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return s(t)}},g1=function(s,e){let t=0,i=0;const r=lt(aN,e);s.ready(()=>{s.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){i&&s.currentTime(i)},a=function(c){c!=null&&(i=s.duration()!==1/0&&s.currentTime()||0,s.one("loadedmetadata",n),s.src(c),s.trigger({type:"usage",name:"vhs-error-reload"}),s.play())},o=function(){if(Date.now()-t<r.errorInterval*1e3){s.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!r.getSource||typeof r.getSource!="function"){R.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return t=Date.now(),r.getSource.call(s,a)},l=function(){s.off("loadedmetadata",n),s.off("error",o),s.off("dispose",l)},u=function(c){l(),g1(s,c)};s.on("error",o),s.on("dispose",l),s.reloadSourceOnError=u},oN=function(s){g1(this,s)};var v1="3.16.0",lN="7.1.0",uN="1.3.1",cN="7.2.0",hN="4.0.2";const Mt={PlaylistLoader:Ba,Playlist:$i,utils:fP,STANDARD_PLAYLIST_SELECTOR:Fy,INITIAL_PLAYLIST_SELECTOR:rD,lastBandwidthSelector:Fy,movingAverageBandwidthSelector:tD,comparePlaylistBandwidth:lg,comparePlaylistResolution:eD,xhr:HS()};Object.keys(ei).forEach(s=>{Object.defineProperty(Mt,s,{get(){return R.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),ei[s]},set(e){if(R.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){R.log.warn(`value of Vhs.${s} must be greater than or equal to 0`);return}ei[s]=e}})});const y1="videojs-vhs",_1=function(s,e){const t=e.media();let i=-1;for(let r=0;r<s.length;r++)if(s[r].id===t.id){i=r;break}s.selectedIndex_=i,s.trigger({selectedIndex:i,type:"change"})},dN=function(s,e){e.representations().forEach(t=>{s.addQualityLevel(t)}),_1(s,e.playlists)};Mt.canPlaySource=function(){return R.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const fN=(s,e,t)=>{if(!s)return s;let i={};e&&e.attributes&&e.attributes.CODECS&&(i=jc(Fr(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(i.audio=t.attributes.CODECS);const r=to(i.video),n=to(i.audio),a={};for(const o in s)a[o]={},n&&(a[o].audioContentType=n),r&&(a[o].videoContentType=r),e.contentProtection&&e.contentProtection[o]&&e.contentProtection[o].pssh&&(a[o].pssh=e.contentProtection[o].pssh),typeof s[o]=="string"&&(a[o].url=s[o]);return lt(s,a)},pN=(s,e)=>s.reduce((t,i)=>{if(!i.contentProtection)return t;const r=e.reduce((n,a)=>{const o=i.contentProtection[a];return o&&o.pssh&&(n[a]={pssh:o.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),mN=({player:s,sourceKeySystems:e,audioMedia:t,mainPlaylists:i})=>{if(!s.eme.initializeMediaKeys)return Promise.resolve();const r=t?i.concat([t]):i,n=pN(r,Object.keys(e)),a=[],o=[];return n.forEach(l=>{o.push(new Promise((u,c)=>{s.tech_.one("keysessioncreated",u)})),a.push(new Promise((u,c)=>{s.eme.initializeMediaKeys({keySystems:l},h=>{if(h){c(h);return}u()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},gN=({player:s,sourceKeySystems:e,media:t,audioMedia:i})=>{const r=fN(e,t,i);return r?(s.currentSource().keySystems=r,r&&!s.eme?(R.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},T1=()=>{if(!D.localStorage)return null;const s=D.localStorage.getItem(y1);if(!s)return null;try{return JSON.parse(s)}catch{return null}},vN=s=>{if(!D.localStorage)return!1;let e=T1();e=e?lt(e,s):s;try{D.localStorage.setItem(y1,JSON.stringify(e))}catch{return!1}return e},yN=s=>s.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(s.substring(s.indexOf(",")+1)):s,b1=(s,e)=>{s._requestCallbackSet||(s._requestCallbackSet=new Set),s._requestCallbackSet.add(e)},S1=(s,e)=>{s._responseCallbackSet||(s._responseCallbackSet=new Set),s._responseCallbackSet.add(e)},C1=(s,e)=>{s._requestCallbackSet&&(s._requestCallbackSet.delete(e),s._requestCallbackSet.size||delete s._requestCallbackSet)},E1=(s,e)=>{s._responseCallbackSet&&(s._responseCallbackSet.delete(e),s._responseCallbackSet.size||delete s._responseCallbackSet)};Mt.supportsNativeHls=(function(){if(!le||!le.createElement)return!1;const s=le.createElement("video");return R.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(s.canPlayType(t))}):!1})();Mt.supportsNativeDash=(function(){return!le||!le.createElement||!R.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(le.createElement("video").canPlayType("application/dash+xml"))})();Mt.supportsTypeNatively=s=>s==="hls"?Mt.supportsNativeHls:s==="dash"?Mt.supportsNativeDash:!1;Mt.isSupported=function(){return R.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};Mt.xhr.onRequest=function(s){b1(Mt.xhr,s)};Mt.xhr.onResponse=function(s){S1(Mt.xhr,s)};Mt.xhr.offRequest=function(s){C1(Mt.xhr,s)};Mt.xhr.offResponse=function(s){E1(Mt.xhr,s)};const _N=R.getComponent("Component");let w1=class extends _N{constructor(e,t,i){if(super(t,i.vhs),typeof i.initialBandwidth=="number"&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=mr("VhsHandler"),t.options_&&t.options_.playerId){const r=R.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(le,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=le.fullscreenElement||le.webkitFullscreenElement||le.mozFullScreenElement||le.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=lt(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!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,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const i=T1();i&&i.bandwidth&&(this.options_.bandwidth=i.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),i&&i.throughput&&(this.options_.throughput=i.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=ei.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===ei.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(i=>{typeof this.source_[i]<"u"&&(this.options_[i]=this.source_[i])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=yN(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Mt,this.options_.sourceType=Wb(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new tN(this.options_);const i=lt({liveRangeSafeTimeDelta:qr},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new sN(i),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=R.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});const r=this.options_.bufferBasedABR?Mt.movingAverageBandwidthSelector(.55):Mt.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=Mt.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=D.navigator.connection||D.navigator.mozConnection||D.navigator.webkitConnection,o=1e7;if(this.options_.useNetworkInformationApi&&a){const l=a.downlink*1e3*1e3;l>=o&&n>=o?n=Math.max(n,l):n=l}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(n+a))},set(){R.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Os(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Os(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&vN({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{nN(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=D.URL.createObjectURL(this.playlistController_.mediaSource),(R.browser.IS_ANY_SAFARI||R.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),mN({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=gN({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",i=>{this.playlistController_.updatePlaylistByKeyStatus(i.keyId,i.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=R.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{dN(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{_1(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":v1,"mux.js":lN,"mpd-parser":uN,"m3u8-parser":cN,"aes-decrypter":hN}}version(){return this.constructor.version()}canChangeType(){return d1.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&D.URL.revokeObjectURL&&(D.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return TP({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,r=2){return KS({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{b1(this.xhr,e)},this.xhr.onResponse=e=>{S1(this.xhr,e)},this.xhr.offRequest=e=>{C1(this.xhr,e)},this.xhr.offResponse=e=>{E1(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(i=>{this.playlistController_.on(i,r=>{this.player_.trigger(mt({},r))})}),t.forEach(i=>{this.playbackWatcher_.on(i,r=>{this.player_.trigger(mt({},r))})})}};const qc={name:"videojs-http-streaming",VERSION:v1,canHandleSource(s,e={}){const t=lt(R.options,e);return!t.vhs.experimentalUseMMS&&!bl("avc1.4d400d,mp4a.40.2",!1)?!1:qc.canPlayType(s.type,t)},handleSource(s,e,t={}){const i=lt(R.options,t);return e.vhs=new w1(s,e,i),e.vhs.xhr=HS(),e.vhs.setupXhrHooks_(),e.vhs.src(s.src,s.type),e.vhs},canPlayType(s,e){const t=Wb(s);if(!t)return"";const i=qc.getOverrideNative(e);return!Mt.supportsTypeNatively(t)||i?"maybe":""},getOverrideNative(s={}){const{vhs:e={}}=s,t=!(R.browser.IS_ANY_SAFARI||R.browser.IS_IOS),{overrideNative:i=t}=e;return i}},TN=()=>bl("avc1.4d400d,mp4a.40.2",!0);TN()&&R.getTech("Html5").registerSourceHandler(qc,0);R.VhsHandler=w1;R.VhsSourceHandler=qc;R.Vhs=Mt;R.use||R.registerComponent("Vhs",Mt);R.options.vhs=R.options.vhs||{};(!R.getPlugin||!R.getPlugin("reloadSourceOnError"))&&R.registerPlugin("reloadSourceOnError",oN);const bN=R.getComponent("MenuItem");class SN extends bN{constructor(e,t){super(e,t)}handleClick(e){super.handleClick(e),this.requestAnimationFrame(()=>{this.options_.item.showCollapsibleMenu()})}createEl(e,t,i){if(!this.options_.item)return super.createEl(e,t,i);const r=this.options_.item.getCollabsibleName(),n=this.options_.item.getCollabsibleValue(),a=this.options_.item.className,o=`<span class="vjs-menu-item-text">${r}</span>`;this.valueHolder_=R.dom.createEl("span",{innerHTML:n});const l=super.createEl(e,{className:`vjs-menu-item cv-cog-menu-item ${n?"cv-has-cog-value":""} ${a||""}`.trim(),innerHTML:o},i);return l.appendChild(this.valueHolder_),l}updateCollapsibleValue(){this.valueHolder_.innerHTML=this.options_.item.getCollabsibleValue()}}const CN=R.getComponent("MenuButton"),Pl=class Pl extends CN{constructor(e,t){super(e,t),this.controlText("Settings")}buildWrapperCSSClass(){return`cv-menu-small cv-cog-menu-button ${super.buildWrapperCSSClass()}`}buildCSSClass(){return`cv-cog-button ${super.buildCSSClass()}`}pressButton(){if(this.player_.options_.deferMenus){this.player_.deferMenusPlugin().deferMenu();return}this.menu.children_.forEach(e=>{e.updateCollapsibleValue&&e.updateCollapsibleValue()}),super.pressButton()}createItems(){var t;const e=[];for(let i=0;i<this.options_.items.length;i++){const r=this.options_.items[i];r.isCollabsible&&r.showInCollabsibleMenu()&&r.isCollapsed&&e.push(new SN(this.player_,{item:r}))}return(t=this.additionalItems)!=null&&t.length&&[...this.additionalItems].sort((r,n)=>{const a=Pl.additionalItemOrder.indexOf(r.name);return Pl.additionalItemOrder.indexOf(n.name)-a}).forEach(r=>{const n=new r.ctor(this.player_,{...this.options_,...r.options??{}});e.splice(0,0,n)}),e}update(){super.update(),this.player_.trigger("resizemenus")}addItem(e){this.additionalItems||(this.additionalItems=[]),!this.additionalItems.some(t=>t.name===e.name)&&(this.additionalItems.push(e),this.update())}};Pl.additionalItemOrder=["EngagementOverlayMenuItem","PointsOfInterestMenuItem","LoopVideoMenuItem","NextVideoMenuItem"];let $p=Pl;R.registerComponent("cogButton",$p);const EN=R.getComponent("MenuItem");class Zs extends EN{constructor(e,t){super(e,t)}createEl(){return R.dom.createEl("li",{className:"vjs-menu-item cv-collapsible-menu-heading cv-divider-after-menu-item",innerHTML:`<span class="vjs-menu-item-text">${this.localize(this.options_.label)}</span>`,tabIndex:-1})}handleClick(e){if(super.handleClick(e),this.options_.onClickBack){this.options_.onClickBack();return}this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("cogButton").pressButton()})}}const wN=R.getComponent("MenuItem"),Yy=R.getComponent("MenuButton"),kN=["large","medium","small"];let xN=class extends wN{constructor(e,t){super(e,t)}handleClick(){this.player_.textTrackSettings.setSizeSetting(this.options_.value)}};class AN extends Yy{constructor(e,t){super(e,t),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0,this.player_.ready(()=>{this.update()})}createItems(){const e=this.player_.textTrackSettings;if(!e)return;const t=e.getSizeSetting(),i=[new Zs(this.player_,{label:"Caption Text Size",onClickBack:()=>{this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("subsCapsButton").pressButton()})}})];return kN.map(r=>{i.push(new xN(this.player_,{label:r.charAt(0).toUpperCase()+r.substring(1),selectable:!0,multiSelectable:!1,selected:r===t,value:r}))}),i}buildWrapperCSSClass(){return`cv-menu-small cv-has-left-icons ${super.buildWrapperCSSClass()}`}getCollabsibleName(){return"Subtitle Size"}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!1}showCollapsibleMenu(){Yy.prototype.handleClick.apply(this)}}R.registerComponent("SubtitleSizeButton",AN);function ug(s,e,t,i){if(!s.length)return[];const r=[];for(let n=s.length-1;n>=0;n--){const a=s[n];if(a.kind===e){if(t&&a.label!==t||i&&a.language!==i)continue;r.push(a)}}return r}function zc(s,e,t,i,r){if(s.kind===e&&!(t&&s.label!==t)&&!(r&&s.language!==r)){if(s.loaded_){i(s);return}s.one("loadeddata",()=>{i(s)})}}function Jy(s){if(s!=null&&s.cues.length)for(let e=0;e<s.cues.length;e++){const t=s.cues[e];t!=null&&t.text&&(t.text=dw.sanitize(t.text))}}function Zy(s,e,t,i,r){const n=s.textTracks(),a=ug(n,e,t,r)[0];if(a){zc(a,e,t,i);return}const o=l=>{zc(l.track,e,t,i),n.removeEventListener("addtrack",o)};n.addEventListener("addtrack",o),s.one("dispose",()=>{n.removeEventListener("addtrack",o)})}function e_(s,e,t,i,r){const n=s.textTracks(),a=ug(n,e,t,r);a.length&&a.forEach(l=>zc(l,e,t,i,r));const o=l=>{zc(l.track,e,t,i,r)};n.addEventListener("addtrack",o),s.one("dispose",()=>{n.removeEventListener("addtrack",o)})}const Yt={getTrack(s,e,t,i){const r=s.textTracks();return ug(r,e,t,i)[0]},useChapters(s,e){Zy(s,"chapters",null,e)},useMetadataTrack(s,e,t){Zy(s,"metadata",e,t,null)},useMetadataTracks(s,e,t,i){e_(s,"metadata",e,t,i)},useSubtitles(s,e,t){e_(s,"subtitles",null,e,t)},getCurrentTextTrack(s){return this.findTrackByPredicate(s,e=>e.mode==="showing")},findTrackByPredicate(s,e){if(!s)return null;const t=s.textTracks();for(let i=0;i<t.length;i++){const r=t[i];if(e(r))return r}return null},forEachTrack(s,e){if(!s)return;const t=s.textTracks();for(let i=0;i<t.length;i++){const r=t[i];e(r)}},sanitizeTrack(s,e){if(!s||!e)return;if(s.loaded){Jy(s);return}const t=()=>Jy(s);s.addEventListener("loadeddata",t),e.one("dispose",()=>{s.removeEventListener("loadeddata",t)})}},IN=function(s,e){let t=window.performance.now();return function(...r){const n=window.performance.now();n-t>=e&&(s(...r),t=n)}},Jl=function(s,e,t,i=window){let r;const n=()=>{i.clearTimeout(r),r=null},a=(...o)=>{let l=!1,u=function(){r=null,u=null,s.apply(this,o)};return!r&&t&&(s.apply(this,o),l=!0),i.clearTimeout(r),r=i.setTimeout(u,e),l};return a.cancel=n,a},k1=R.getComponent("MenuItem");class cg extends k1{constructor(e,t){super(e,t),this.onChange=Jl(this.onChange,100,!1,this),this.bindEventListeners()}createEl(){const e=this.localize("Search");return super.createEl("li",{className:`vjs-menu-item cv-search-input-menu-item-container ${this.options_.className||""}`.trim(),innerHTML:`
220
+ <div class="cv-search-input-menu-item">
221
+ <span class="cv-search-icon">
222
+ <svg viewBox="0 0 24 24">
223
+ <path d="M15.803 14.306l3.917 3.954a1 1 0 0 1-.007 1.417l-.018.018-.018.018a.997.997 0 0 1-1.41 0l-3.918-3.953-.3.214c-1.14.713-2.323 1.07-3.549 1.07-1.796 0-3.328-.642-4.597-1.925C4.634 13.836 4 12.296 4 10.5c0-1.796.634-3.328 1.903-4.597C7.172 4.634 8.704 4 10.5 4c1.796 0 3.329.634 4.597 1.903 1.27 1.269 1.904 2.801 1.904 4.597a6.447 6.447 0 0 1-1.027 3.507l-.17.3zM10.5 5.368c-1.425 0-2.637.5-3.635 1.497-.998.998-1.497 2.21-1.497 3.635 0 1.426.5 2.637 1.497 3.635.998.998 2.21 1.497 3.635 1.497 1.426 0 2.637-.499 3.635-1.497 1.027-1.026 1.54-2.238 1.54-3.635 0-1.397-.513-2.608-1.54-3.635-.998-.998-2.21-1.497-3.635-1.497z"/>
224
+ </svg>
225
+ </span><input placeholder="${e}" type="text" autocomplete="off" spellcheck="false" aria-label="${e}" />
226
+ </div>
227
+ `})}focus(){this.$("input").focus()}handleClick(e){e.stopImmediatePropagation(),this.$("input").focus()}handleKeyDown(){this.focus()}bindEventListeners(){const e=this.$("input");this.onChange=this.onChange.bind(this),e.addEventListener("keyup",this.onChange),e.addEventListener("blur",t=>{this.options_.menuButton.menu.handleBlur(t)})}onChange(e){const t=e.target;this.options_.search(t.value)}}R.registerComponent("SearchInputMenuItem",cg);class hg extends k1{createEl(e,t,i){return super.createEl(e,{...t,className:"vjs-menu-item cv-no-results"},i)}setLabel(e){const t=this.$(".vjs-menu-item-text");t&&(t.innerHTML=e)}}R.registerComponent("NoMatchingResultsMenuItem",hg);const PN=R.getComponent("MenuItem");class DN extends PN{constructor(e,t){super(e,t)}update(e,t){if(!(e!=null&&e.length)){this.el().innerHTML=`<span class="vjs-menu-item-text">${this.options_.label}</span>`;return}const i=[];let r=0;e.forEach(n=>{const a=this.options_.label.substr(r,n);a&&i.push(a),i.push('<span class="cv-highlight">'),i.push(this.options_.label.substr(n,t)),i.push("</span>"),r=n+t}),i.push(this.options_.label.substring(r,this.options_.label.length)),this.el().innerHTML=`<span class="vjs-menu-item-text">${i.join("")}</span>`}handleClick(e){e.stopImmediatePropagation(),this.player_.currentTime(this.options_.cue.startTime)}}const t_=R.getComponent("MenuButton");class NN extends t_{constructor(e,t){super(e,t),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0,this.update=this.update.bind(this),this.search=this.search.bind(this),this.player_.textTracks().addEventListener("selectedlanguagechange",this.update)}bindTrackEvents(e){e.removeEventListener("loadeddata",this.update),e.addEventListener("loadeddata",this.update),this.player_.one("dispose",()=>{e.removeEventListener("loadeddata",this.update)})}createItems(){var r;const e=Yt.getCurrentTextTrack(this.player_);if(!e)return;if(!((r=e.cues)!=null&&r.length)){this.bindTrackEvents(e);return}const t=[new cg(this.player_,{menuButton:this,search:this.search})];for(let n=0;n<e.cues.length;n++){const a=e.cues[n];t.push(new DN(this.player_,{cue:a,label:a.text,selected:!1,multiSelectable:!1}))}const i=new hg(this.player_,{label:"No matching results",selected:!1,selectable:!1,multiSelectable:!1});return i.hide(),t.push(i),t}search(e){var r;e=e.trim();const t=Yt.getCurrentTextTrack(this.player_);if(!((r=t==null?void 0:t.cues)!=null&&r.length))return;const i=this.findMatches(e,t);this.toggleItemVisibility(e,i),this.toggleNoResults(e,i)}findMatches(e,t){const i={};if(!e)return i;const r=new RegExp(e,"gi");for(let n=0;n<t.cues.length;n++){const o=t.cues[n].text,l=[];let u;for(;u=r.exec(o);)l.push(u.index);l.length&&(i[n]=l)}return i}toggleItemVisibility(e,t){this.menu.children_.slice(1,this.menu.children_.length-1).forEach((r,n)=>{!e||t[n]?r.show():r.hide(),r.update(t[n],e.length)})}toggleNoResults(e,t){const i=this.menu.children_[this.menu.children_.length-1];!e||Object.keys(t).length?i.hide():i.show()}buildWrapperCSSClass(){return`cv-menu-big cv-subtitle-search-button ${super.buildWrapperCSSClass()}`}update(){super.update(),this.player_.trigger("resizemenus")}pressButton(){super.pressButton();const e=this.menu.children_[0];e!=null&&e.focus&&(e==null||e.focus())}getCollabsibleName(){return"Subtitle Size"}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!1}showCollapsibleMenu(){t_.prototype.handleClick.apply(this)}}R.registerComponent("subtitleSearchButton",NN);const LN=R.getComponent("MenuItem"),i_=R.getComponent("MenuButton"),ON=[{label:"Play / Pause",type:"play-pause"},{label:"Volume",type:"volume"},{label:"Mute",type:"mute"},{label:"Toggle fullscreen",type:"fullscreen"},{label:"Exit fullscreen",type:"exit-fullscreen"},{label:"Toggle theatre mode",type:"theatre-mode"}];class MN extends LN{constructor(e,t){super(e,t)}createEl(){return R.dom.createEl("li",{className:"vjs-menu-item",tabIndex:-1,innerHTML:`
228
+ <span class="vjs-menu-item-text">${this.options_.label}</span>
229
+ <span>${this.getDisplayHtml(this.options_.type)}
230
+ `})}getDisplayHtml(e){switch(e){case"play-pause":return'<span class="cv-keyboard-button">Spacebar</span>';case"volume":return`<span class="cv-keyboard-button">Shift</span> +
231
+ <span class="cv-keyboard-button cv-single-key">&uArr;</span> /
232
+ <span class="cv-keyboard-button">Shift</span> +
233
+ <span class="cv-keyboard-button cv-single-key">&dArr;</span>`;case"mute":return'<span class="cv-keyboard-button cv-single-key">m</span>';case"fullscreen":return'<span class="cv-keyboard-button cv-single-key">f</span>';case"exit-fullscreen":return'<span class="cv-keyboard-button cv-single-key">esc</span>';case"theatre-mode":return'<span class="cv-keyboard-button cv-single-key">t</span>'}return""}}class RN extends i_{constructor(){super(...arguments),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0}createItems(){const e=[];return e.push(new Zs(this.player_,{label:"Keyboard shortcuts"})),ON.forEach(t=>{e.push(new MN(this.player_,t))}),e}buildWrapperCSSClass(){return`cv-menu-small cv-keyboard-shortcuts ${super.buildWrapperCSSClass()}`}getCollabsibleName(){return"Keyboard shortcuts"}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!this.player_.options_.mobile}showCollapsibleMenu(){i_.prototype.handleClick.apply(this)}}R.registerComponent("KeyboardShortcutsButton",RN);const BN=600,FN=1200,bf="cv-collapsed",UN=R.getComponent("Component");class $N extends UN{constructor(e,t){super(e,t),this.addChild("cogButton",{items:this.children_},this.children_.length-1),this.update=this.update.bind(this),this.player_.on("cv-updatecog",this.update),this.player_.on("playerresize",this.update),this.player_.one("play",this.update),this.player_.on("dispose",()=>{this.player_.off("cv-updatecog",this.update),this.player_.off("playerresize",this.update),this.player_.off("play",this.update)})}toggleHidden(e){for(let t=0;t<this.children_.length;t++){const i=this.children_[t];if(i.isCollabsible){if(i.alwaysCollapsed){i.isCollapsed=!0,i.addClass(bf);continue}e?(i.isCollapsed=!0,i.addClass(bf)):(i.isCollapsed=!1,i.removeClass(bf))}}this.getChild("cogButton").update()}update(){const e=this.player_.isFullscreen(),t=this.player_.whiteboardModePlugin().side,i=this.player_.el().getBoundingClientRect(),r=e&&(t==="left"||t==="right")?i.height:i.width;if(!r)return;this.addClass("cv-collapsorator-ready");let a=r<(e&&(t==="left"||t==="right"||t==="top")?FN:BN);this.player_.options_.deferMenus&&(a=!0),this.toggleHidden(a)}buildCSSClass(){return`cv-collapsorator ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}}R.registerComponent("collapserator",$N);const jN=["playToggle","volumePanel","customControlSpacer","playbackRateMenuButton","chaptersButton","qualityButton","keyboardShortcutsButton","subsCapsButton","whiteboardModeButton","subtitleSizeButton","subtitleSearchButton","fullscreenToggle"];class VN{constructor(e){this.options=e,this.initialize()}logStream(){const e=`v:${this.options.videoId}`;$d.cacheExists(e)||(this.collectionApiClient.log({type:ci.WebPlayerStream,actionContext:this.getActionContext(),data:this.getAnalyticsData(),eventVersion:Fs.V3}),$d&&$d.cacheSet(e,null,300))}logVideoProgress(e){const t=this.getAnalyticsData();this.collectionApiClient.log(e.map(i=>({type:ci.StreamProgress,actionContext:this.getActionContext(),data:{...t,progress:i},eventVersion:Fs.V2})))}logUserAction(e,t){const i={...this.getAnalyticsData(),...e},r={...this.getActionContext(),...t};this.collectionApiClient.log({type:t.actionType,data:i,actionContext:r,eventVersion:t.eventVersion||Fs.V2})}getAnalyticsData(){const e={video:{id:this.options.videoId},flags:{isUsingLocalCache:this.options.isUsingLocalCache},...this.options.additionalAnalyticsData||{}};this.options.shareId&&(e.video.shareId=this.options.shareId);const t=this.getEntityType();return t===wi.Interactive?e.interactive={id:+this.options.mediaId}:t===wi.Clip&&(e.clip={id:+this.options.mediaId}),e}initialize(){this.setupCollectionApiClient(),fv.lockWindowSession(),this.options.player.one("dispose",()=>fv.unlockWindowSession())}setupCollectionApiClient(){this.collectionApiClient=new fw({productName:"player.web",productVersion:this.options.productVersion,regionName:this.options.regionName,collectionApiUrls:this.options.collectionApiUrls,collectionApiClientId:this.options.collectionApiClientId,getUser:()=>this.getCurrentUser(),shouldLog:pv.shouldLog,formatData:pv.formatData})}async getCurrentUser(){return{id:this.options.userId,customerId:this.options.customerId,sessionId:this.options.authSessionId}}getActionContext(){return{entity:this.getEntityType(),location:this.getLocationContext(),productArea:void 0,descriptor:this.options.isEmbedded?pw.Embedded:void 0,workflowPhase:void 0}}getEntityType(){switch(this.options.mediaType){case"MasterVideo":return wi.Video;case"MasterInteractive":return wi.Interactive;case"MasterClip":return wi.Clip}}getLocationContext(){switch(this.options.playerType){case"player":return _l.Player;case"interactive-player":return _l.InteractivePlayer;case"create-clip-player":return _l.CreateClipPlayer}}}class jp extends Error{constructor(e,t){super((t==null?void 0:t.title)||"Ajax error"),this.url=e,this.response=t}}class HN{constructor(){this.tokens={gateway:null}}async get(e,t){return await this.parseResponse(await fetch(e,{method:"GET",mode:"cors",headers:this.getHeaders(t)}))}async delete(e,t){await fetch(e,{method:"DELETE",headers:this.getHeaders(t)})}async post(e,t,i,r=!0){const n=await fetch(e,{method:"POST",headers:this.getHeaders(i),body:t,mode:"cors"});if(r)return await this.parseResponse(n)}async put(e,t,i,r=!0){const n=await fetch(e,{method:"PUT",headers:this.getHeaders(i),body:t,mode:"cors"});if(r)return await this.parseResponse(n)}setToken(e,t){this.tokens[e]=t}getHeaders(e={}){const t={"Content-Type":"application/json"};return this.tokens[e.tokenName]&&(t.authorization=`Bearer ${this.tokens[e.tokenName]}`),t}async parseResponse(e){if(e.status===404)return null;if(!e.ok){let i;try{i=await e.json()}catch{throw new jp(e.url)}finally{throw new jp(e.url,i)}}return await e.json()}}const Vp=new HN;var zu={exports:{}},r_;function qN(){return r_||(r_=1,(function(s,e){function t(l){if(l&&typeof l=="object"){var u=l.which||l.keyCode||l.charCode;u&&(l=u)}if(typeof l=="number")return a[l];var c=String(l),h=i[c.toLowerCase()];if(h)return h;var h=r[c.toLowerCase()];if(h)return h;if(c.length===1)return c.charCodeAt(0)}t.isEventKey=function(u,c){if(u&&typeof u=="object"){var h=u.which||u.keyCode||u.charCode;if(h==null)return!1;if(typeof c=="string"){var f=i[c.toLowerCase()];if(f)return f===h;var f=r[c.toLowerCase()];if(f)return f===h}else if(typeof c=="number")return c===h;return!1}},e=s.exports=t;var i=e.code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},r=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};/*!
234
+ * Programatically add the following
235
+ */for(n=97;n<123;n++)i[String.fromCharCode(n)]=n-32;for(var n=48;n<58;n++)i[n-48]=n;for(n=1;n<13;n++)i["f"+n]=n+111;for(n=0;n<10;n++)i["numpad "+n]=n+96;var a=e.names=e.title={};for(n in i)a[i[n]]=n;for(var o in r)i[o]=r[o]})(zu,zu.exports)),zu.exports}var zN=qN();const Ge=Vi(zN);function WN(s){document[s.fsApi_.fullscreenEnabled]&&(s.isFullscreen()?s.exitFullscreen():s.requestFullscreen())}function GN(s){const e=s.theatreModePlugin().getTheatreMode();s.theatreModePlugin().toggleTheatreMode(!e,{shouldLog:!0})}function KN(s){const e=s.volume(),t=s.lastVolume_();if(e===0){const i=t<.1?.1:t;s.volume(i),s.muted(!1)}else s.muted(!s.muted())}function n_(s){s.paused()?s.play():s.pause()}function Wu(s,e){s.currentTime(s.currentTime()+e)}function s_(s,e){s.volume(s.volume()+e)}function XN(s){const e=s.target,t=["video-js","vjs-tech"];return e.tagName.toLowerCase()==="video"||!!t.find(i=>e.classList.contains(i))}const a_={f:WN,m:KN,k:n_,space:n_,t:GN,left:s=>Wu(s,-5),right:s=>Wu(s,5),j:s=>Wu(s,-10),l:s=>Wu(s,10),up:s=>s_(s,.05),down:s=>s_(s,-.05)};function QN(s,e,t){if(s.ctrlKey||s.metaKey||s.altKey||s.shiftKey)return;const i=Ge(s);if(i==="t"&&!t.allowTheatreMode||i==="f"&&!t.allowFullscreen||!a_[i])return;a_[i](e,s);const r=XN(s),n=["space"].includes(i);(r||n)&&(s.preventDefault(),s.stopPropagation())}var x1=(s=>(s.PhysicallyChapteredVideo="physically-chaptered-video",s))(x1||{});const YN="1.40.0",JN={version:YN};var Sf,o_;function ZN(){if(o_)return Sf;o_=1,Sf=s;function s(e,t){var i,r=null;try{i=JSON.parse(e,t)}catch(n){r=n}return[r,i]}return Sf}var eL=ZN();const tL=Vi(eL);var Gu={exports:{}},Cf,l_;function iL(){if(l_)return Cf;l_=1;var s=bo(),e=function(r,n){return n===void 0&&(n=!1),function(a,o,l){if(a){r(a);return}if(o.statusCode>=400&&o.statusCode<=599){var u=l;if(n)if(s.TextDecoder){var c=t(o.headers&&o.headers["content-type"]);try{u=new TextDecoder(c).decode(l)}catch{}}else u=String.fromCharCode.apply(null,new Uint8Array(l));r({cause:u});return}r(null,l)}};function t(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(r,n){var a=n.split("="),o=a[0],l=a[1];return o.trim()==="charset"?l.trim():r},"utf-8")}return Cf=e,Cf}var u_;function rL(){if(u_)return Gu.exports;u_=1;var s=bo(),e=Fb(),t=jb();o.httpHandler=iL();/**
236
+ * @license
237
+ * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
238
+ * Copyright (c) 2014 David Björklund
239
+ * Available under the MIT license
240
+ * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
241
+ */var i=function(f){var g={};return f&&f.trim().split(`
242
+ `).forEach(function(C){var p=C.indexOf(":"),b=C.slice(0,p).trim().toLowerCase(),I=C.slice(p+1).trim();typeof g[b]>"u"?g[b]=I:Array.isArray(g[b])?g[b].push(I):g[b]=[g[b],I]}),g};Gu.exports=o,Gu.exports.default=o,o.XMLHttpRequest=s.XMLHttpRequest||c,o.XDomainRequest="withCredentials"in new o.XMLHttpRequest?o.XMLHttpRequest:s.XDomainRequest,r(["get","put","post","patch","head","delete"],function(h){o[h==="delete"?"del":h]=function(f,g,C){return g=a(f,g,C),g.method=h.toUpperCase(),l(g)}});function r(h,f){for(var g=0;g<h.length;g++)f(h[g])}function n(h){for(var f in h)if(h.hasOwnProperty(f))return!1;return!0}function a(h,f,g){var C=h;return t(f)?(g=f,typeof h=="string"&&(C={uri:h})):C=e({},f,{uri:h}),C.callback=g,C}function o(h,f,g){return f=a(h,f,g),l(f)}function l(h){if(typeof h.callback>"u")throw new Error("callback argument missing");var f=!1,g=function(ce,de,pe){f||(f=!0,h.callback(ce,de,pe))};function C(){L.readyState===4&&setTimeout(I,0)}function p(){var K=void 0;if(L.response?K=L.response:K=L.responseText||u(L),P)try{K=JSON.parse(K)}catch{}return K}function b(K){return clearTimeout(Q),K instanceof Error||(K=new Error(""+(K||"Unknown XMLHttpRequest Error"))),K.statusCode=0,g(K,G)}function I(){if(!V){var K;clearTimeout(Q),h.useXDR&&L.status===void 0?K=200:K=L.status===1223?204:L.status;var ce=G,de=null;return K!==0?(ce={body:p(),statusCode:K,method:O,headers:{},url:B,rawRequest:L},L.getAllResponseHeaders&&(ce.headers=i(L.getAllResponseHeaders()))):de=new Error("Internal XMLHttpRequest Error"),g(de,ce,ce.body)}}var L=h.xhr||null;L||(h.cors||h.useXDR?L=new o.XDomainRequest:L=new o.XMLHttpRequest);var F,V,B=L.url=h.uri||h.url,O=L.method=h.method||"GET",M=h.body||h.data,U=L.headers=h.headers||{},w=!!h.sync,P=!1,Q,G={body:void 0,headers:{},statusCode:0,method:O,url:B,rawRequest:L};if("json"in h&&h.json!==!1&&(P=!0,U.accept||U.Accept||(U.Accept="application/json"),O!=="GET"&&O!=="HEAD"&&(U["content-type"]||U["Content-Type"]||(U["Content-Type"]="application/json"),M=JSON.stringify(h.json===!0?M:h.json))),L.onreadystatechange=C,L.onload=I,L.onerror=b,L.onprogress=function(){},L.onabort=function(){V=!0},L.ontimeout=b,L.open(O,B,!w,h.username,h.password),w||(L.withCredentials=!!h.withCredentials),!w&&h.timeout>0&&(Q=setTimeout(function(){if(!V){V=!0,L.abort("timeout");var K=new Error("XMLHttpRequest timeout");K.code="ETIMEDOUT",b(K)}},h.timeout)),L.setRequestHeader)for(F in U)U.hasOwnProperty(F)&&L.setRequestHeader(F,U[F]);else if(h.headers&&!n(h.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in h&&(L.responseType=h.responseType),"beforeSend"in h&&typeof h.beforeSend=="function"&&h.beforeSend(L),L.send(M||null),L}function u(h){try{if(h.responseType==="document")return h.responseXML;var f=h.responseXML&&h.responseXML.documentElement.nodeName==="parsererror";if(h.responseType===""&&!f)return h.responseXML}catch{}return null}function c(){}return Gu.exports}var nL=rL();const A1=Vi(nL);function I1(){try{var s=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(I1=function(){return!!s})()}function P1(s,e,t){if(I1())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,e);var r=new(s.bind.apply(s,i));return t&&Sm(r,t.prototype),r}function sL(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(e&&e.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),e&&Sm(s,e)}var Ef={exports:{}},c_;function aL(){return c_||(c_=1,(function(s,e){(function(t){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,u,c){if(c=c||{},l=l.trim(),u=u.trim(),!u){if(!c.alwaysNormalize)return l;var h=o.parseURL(l);if(!h)throw new Error("Error trying to parse base URL.");return h.path=o.normalizePath(h.path),o.buildURLFromParts(h)}var f=o.parseURL(u);if(!f)throw new Error("Error trying to parse relative URL.");if(f.scheme)return c.alwaysNormalize?(f.path=o.normalizePath(f.path),o.buildURLFromParts(f)):u;var g=o.parseURL(l);if(!g)throw new Error("Error trying to parse base URL.");if(!g.netLoc&&g.path&&g.path[0]!=="/"){var C=r.exec(g.path);g.netLoc=C[1],g.path=C[2]}g.netLoc&&!g.path&&(g.path="/");var p={scheme:g.scheme,netLoc:f.netLoc,path:null,params:f.params,query:f.query,fragment:f.fragment};if(!f.netLoc&&(p.netLoc=g.netLoc,f.path[0]!=="/"))if(!f.path)p.path=g.path,f.params||(p.params=g.params,f.query||(p.query=g.query));else{var b=g.path,I=b.substring(0,b.lastIndexOf("/")+1)+f.path;p.path=o.normalizePath(I)}return p.path===null&&(p.path=c.alwaysNormalize?o.normalizePath(f.path):f.path),o.buildURLFromParts(p)},parseURL:function(l){var u=i.exec(l);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(n,"");l.length!==(l=l.replace(a,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};s.exports=o})()})(Ef)),Ef.exports}var oL=aL();const h_=Vi(oL);var d_="http://example.com",jh=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=D.location&&D.location.href||"");var i=typeof D.URL=="function",r=/^\/\//.test(e),n=!D.location&&!/\/\//i.test(e);if(i?e=new D.URL(e,D.location||d_):/\/\//i.test(e)||(e=h_.buildAbsoluteURL(D.location&&D.location.href||"",e)),i){var a=new URL(t,e);return n?a.href.slice(d_.length):r?a.href.slice(a.protocol.length):a.href}return h_.buildAbsoluteURL(e,t)},dg=(function(){function s(){this.listeners={}}var e=s.prototype;return e.on=function(i,r){this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push(r)},e.off=function(i,r){if(!this.listeners[i])return!1;var n=this.listeners[i].indexOf(r);return this.listeners[i]=this.listeners[i].slice(0),this.listeners[i].splice(n,1),n>-1},e.trigger=function(i){var r=this.listeners[i];if(r)if(arguments.length===2)for(var n=r.length,a=0;a<n;++a)r[a].call(this,arguments[1]);else for(var o=Array.prototype.slice.call(arguments,1),l=r.length,u=0;u<l;++u)r[u].apply(this,o)},e.dispose=function(){this.listeners={}},e.pipe=function(i){this.on("data",function(r){i.push(r)})},s})(),lL=function(e){return D.atob?D.atob(e):Buffer.from(e,"base64").toString("binary")};function D1(s){for(var e=lL(s),t=new Uint8Array(e.length),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}/*! @name m3u8-parser @version 4.8.0 @license Apache-2.0 */var uL=(function(s){we(e,s);function e(){var i;return i=s.call(this)||this,i.buffer="",i}var t=e.prototype;return t.push=function(r){var n;for(this.buffer+=r,n=this.buffer.indexOf(`
243
+ `);n>-1;n=this.buffer.indexOf(`
244
+ `))this.trigger("data",this.buffer.substring(0,n)),this.buffer=this.buffer.substring(n+1)},e})(dg),cL=" ",wf=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},hL=function(){var e="[^=]*",t='"[^"]*"|[^,]*',i="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+i+")")},Er=function(e){for(var t=e.split(hL()),i={},r=t.length,n;r--;)t[r]!==""&&(n=/([^=]*)=(.*)/.exec(t[r]).slice(1),n[0]=n[0].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^['"](.*)['"]$/g,"$1"),i[n[0]]=n[1]);return i},dL=(function(s){we(e,s);function e(){var i;return i=s.call(this)||this,i.customParsers=[],i.tagMappers=[],i}var t=e.prototype;return t.push=function(r){var n=this,a,o;if(r=r.trim(),r.length!==0){if(r[0]!=="#"){this.trigger("data",{type:"uri",uri:r});return}var l=this.tagMappers.reduce(function(u,c){var h=c(r);return h===r?u:u.concat([h])},[r]);l.forEach(function(u){for(var c=0;c<n.customParsers.length;c++)if(n.customParsers[c].call(n,u))return;if(u.indexOf("#EXT")!==0){n.trigger("data",{type:"comment",text:u.slice(1)});return}if(u=u.replace("\r",""),a=/^#EXTM3U/.exec(u),a){n.trigger("data",{type:"tag",tagType:"m3u"});return}if(a=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(u),a){o={type:"tag",tagType:"inf"},a[1]&&(o.duration=parseFloat(a[1])),a[2]&&(o.title=a[2]),n.trigger("data",o);return}if(a=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(u),a){o={type:"tag",tagType:"targetduration"},a[1]&&(o.duration=parseInt(a[1],10)),n.trigger("data",o);return}if(a=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(u),a){o={type:"tag",tagType:"version"},a[1]&&(o.version=parseInt(a[1],10)),n.trigger("data",o);return}if(a=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(u),a){o={type:"tag",tagType:"media-sequence"},a[1]&&(o.number=parseInt(a[1],10)),n.trigger("data",o);return}if(a=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(u),a){o={type:"tag",tagType:"discontinuity-sequence"},a[1]&&(o.number=parseInt(a[1],10)),n.trigger("data",o);return}if(a=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(u),a){o={type:"tag",tagType:"playlist-type"},a[1]&&(o.playlistType=a[1]),n.trigger("data",o);return}if(a=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(u),a){o=mt(wf(a[1]),{type:"tag",tagType:"byterange"}),n.trigger("data",o);return}if(a=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(u),a){o={type:"tag",tagType:"allow-cache"},a[1]&&(o.allowed=!/NO/.test(a[1])),n.trigger("data",o);return}if(a=/^#EXT-X-MAP:?(.*)$/.exec(u),a){if(o={type:"tag",tagType:"map"},a[1]){var h=Er(a[1]);h.URI&&(o.uri=h.URI),h.BYTERANGE&&(o.byterange=wf(h.BYTERANGE))}n.trigger("data",o);return}if(a=/^#EXT-X-STREAM-INF:?(.*)$/.exec(u),a){if(o={type:"tag",tagType:"stream-inf"},a[1]){if(o.attributes=Er(a[1]),o.attributes.RESOLUTION){var f=o.attributes.RESOLUTION.split("x"),g={};f[0]&&(g.width=parseInt(f[0],10)),f[1]&&(g.height=parseInt(f[1],10)),o.attributes.RESOLUTION=g}o.attributes.BANDWIDTH&&(o.attributes.BANDWIDTH=parseInt(o.attributes.BANDWIDTH,10)),o.attributes["FRAME-RATE"]&&(o.attributes["FRAME-RATE"]=parseFloat(o.attributes["FRAME-RATE"])),o.attributes["PROGRAM-ID"]&&(o.attributes["PROGRAM-ID"]=parseInt(o.attributes["PROGRAM-ID"],10))}n.trigger("data",o);return}if(a=/^#EXT-X-MEDIA:?(.*)$/.exec(u),a){o={type:"tag",tagType:"media"},a[1]&&(o.attributes=Er(a[1])),n.trigger("data",o);return}if(a=/^#EXT-X-ENDLIST/.exec(u),a){n.trigger("data",{type:"tag",tagType:"endlist"});return}if(a=/^#EXT-X-DISCONTINUITY/.exec(u),a){n.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(a=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(u),a){o={type:"tag",tagType:"program-date-time"},a[1]&&(o.dateTimeString=a[1],o.dateTimeObject=new Date(a[1])),n.trigger("data",o);return}if(a=/^#EXT-X-KEY:?(.*)$/.exec(u),a){o={type:"tag",tagType:"key"},a[1]&&(o.attributes=Er(a[1]),o.attributes.IV&&(o.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(o.attributes.IV=o.attributes.IV.substring(2)),o.attributes.IV=o.attributes.IV.match(/.{8}/g),o.attributes.IV[0]=parseInt(o.attributes.IV[0],16),o.attributes.IV[1]=parseInt(o.attributes.IV[1],16),o.attributes.IV[2]=parseInt(o.attributes.IV[2],16),o.attributes.IV[3]=parseInt(o.attributes.IV[3],16),o.attributes.IV=new Uint32Array(o.attributes.IV))),n.trigger("data",o);return}if(a=/^#EXT-X-START:?(.*)$/.exec(u),a){o={type:"tag",tagType:"start"},a[1]&&(o.attributes=Er(a[1]),o.attributes["TIME-OFFSET"]=parseFloat(o.attributes["TIME-OFFSET"]),o.attributes.PRECISE=/YES/.test(o.attributes.PRECISE)),n.trigger("data",o);return}if(a=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(u),a){o={type:"tag",tagType:"cue-out-cont"},a[1]?o.data=a[1]:o.data="",n.trigger("data",o);return}if(a=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(u),a){o={type:"tag",tagType:"cue-out"},a[1]?o.data=a[1]:o.data="",n.trigger("data",o);return}if(a=/^#EXT-X-CUE-IN:?(.*)?$/.exec(u),a){o={type:"tag",tagType:"cue-in"},a[1]?o.data=a[1]:o.data="",n.trigger("data",o);return}if(a=/^#EXT-X-SKIP:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"skip"},o.attributes=Er(a[1]),o.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(o.attributes["SKIPPED-SEGMENTS"]=parseInt(o.attributes["SKIPPED-SEGMENTS"],10)),o.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(o.attributes["RECENTLY-REMOVED-DATERANGES"]=o.attributes["RECENTLY-REMOVED-DATERANGES"].split(cL)),n.trigger("data",o);return}if(a=/^#EXT-X-PART:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"part"},o.attributes=Er(a[1]),["DURATION"].forEach(function(C){o.attributes.hasOwnProperty(C)&&(o.attributes[C]=parseFloat(o.attributes[C]))}),["INDEPENDENT","GAP"].forEach(function(C){o.attributes.hasOwnProperty(C)&&(o.attributes[C]=/YES/.test(o.attributes[C]))}),o.attributes.hasOwnProperty("BYTERANGE")&&(o.attributes.byterange=wf(o.attributes.BYTERANGE)),n.trigger("data",o);return}if(a=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"server-control"},o.attributes=Er(a[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(C){o.attributes.hasOwnProperty(C)&&(o.attributes[C]=parseFloat(o.attributes[C]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(C){o.attributes.hasOwnProperty(C)&&(o.attributes[C]=/YES/.test(o.attributes[C]))}),n.trigger("data",o);return}if(a=/^#EXT-X-PART-INF:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"part-inf"},o.attributes=Er(a[1]),["PART-TARGET"].forEach(function(C){o.attributes.hasOwnProperty(C)&&(o.attributes[C]=parseFloat(o.attributes[C]))}),n.trigger("data",o);return}if(a=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"preload-hint"},o.attributes=Er(a[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(C){if(o.attributes.hasOwnProperty(C)){o.attributes[C]=parseInt(o.attributes[C],10);var p=C==="BYTERANGE-LENGTH"?"length":"offset";o.attributes.byterange=o.attributes.byterange||{},o.attributes.byterange[p]=o.attributes[C],delete o.attributes[C]}}),n.trigger("data",o);return}if(a=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"rendition-report"},o.attributes=Er(a[1]),["LAST-MSN","LAST-PART"].forEach(function(C){o.attributes.hasOwnProperty(C)&&(o.attributes[C]=parseInt(o.attributes[C],10))}),n.trigger("data",o);return}n.trigger("data",{type:"tag",data:u.slice(4)})})}},t.addParser=function(r){var n=this,a=r.expression,o=r.customType,l=r.dataParser,u=r.segment;typeof l!="function"&&(l=function(h){return h}),this.customParsers.push(function(c){var h=a.exec(c);if(h)return n.trigger("data",{type:"custom",data:l(c),customType:o,segment:u}),!0})},t.addTagMapper=function(r){var n=r.expression,a=r.map,o=function(u){return n.test(u)?a(u):u};this.tagMappers.push(o)},e})(dg),fL=function(e){return e.toLowerCase().replace(/-(\w)/g,function(t){return t[1].toUpperCase()})},xa=function(e){var t={};return Object.keys(e).forEach(function(i){t[fL(i)]=e[i]}),t},kf=function(e){var t=e.serverControl,i=e.targetDuration,r=e.partTargetDuration;if(t){var n="#EXT-X-SERVER-CONTROL",a="holdBack",o="partHoldBack",l=i&&i*3,u=r&&r*2;i&&!t.hasOwnProperty(a)&&(t[a]=l,this.trigger("info",{message:n+" defaulting HOLD-BACK to targetDuration * 3 ("+l+")."})),l&&t[a]<l&&(this.trigger("warn",{message:n+" clamping HOLD-BACK ("+t[a]+") to targetDuration * 3 ("+l+")"}),t[a]=l),r&&!t.hasOwnProperty(o)&&(t[o]=r*3,this.trigger("info",{message:n+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+t[o]+")."})),r&&t[o]<u&&(this.trigger("warn",{message:n+" clamping PART-HOLD-BACK ("+t[o]+") to partTargetDuration * 2 ("+u+")."}),t[o]=u)}},pL=(function(s){we(e,s);function e(){var i;i=s.call(this)||this,i.lineStream=new uL,i.parseStream=new dL,i.lineStream.pipe(i.parseStream);var r=We(i),n=[],a={},o,l,u=!1,c=function(){},h={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},f="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",g=0;i.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var C=0,p=0;return i.on("end",function(){a.uri||!a.parts&&!a.preloadHints||(!a.map&&o&&(a.map=o),!a.key&&l&&(a.key=l),!a.timeline&&typeof g=="number"&&(a.timeline=g),i.manifest.preloadSegment=a)}),i.parseStream.on("data",function(b){var I,L;({tag:function(){({version:function(){b.version&&(this.manifest.version=b.version)},"allow-cache":function(){this.manifest.allowCache=b.allowed,"allowed"in b||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var B={};"length"in b&&(a.byterange=B,B.length=b.length,"offset"in b||(b.offset=C)),"offset"in b&&(a.byterange=B,B.offset=b.offset),C=B.offset+B.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"})),b.duration>0&&(a.duration=b.duration),b.duration===0&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=n},key:function(){if(!b.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(b.attributes.METHOD==="NONE"){l=null;return}if(!b.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(b.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:b.attributes};return}if(b.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:b.attributes.URI};return}if(b.attributes.KEYFORMAT===f){var B=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(B.indexOf(b.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(b.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),b.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(b.attributes.KEYID&&b.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:b.attributes.KEYFORMAT,keyId:b.attributes.KEYID.substring(2)},pssh:D1(b.attributes.URI.split(",")[1])};return}b.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),l={method:b.attributes.METHOD||"AES-128",uri:b.attributes.URI},typeof b.attributes.IV<"u"&&(l.iv=b.attributes.IV)},"media-sequence":function(){if(!isFinite(b.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+b.number});return}this.manifest.mediaSequence=b.number},"discontinuity-sequence":function(){if(!isFinite(b.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+b.number});return}this.manifest.discontinuitySequence=b.number,g=b.number},"playlist-type":function(){if(!/VOD|EVENT/.test(b.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+b.playlist});return}this.manifest.playlistType=b.playlistType},map:function(){o={},b.uri&&(o.uri=b.uri),b.byterange&&(o.byterange=b.byterange),l&&(o.key=l)},"stream-inf":function(){if(this.manifest.playlists=n,this.manifest.mediaGroups=this.manifest.mediaGroups||h,!b.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}a.attributes||(a.attributes={}),mt(a.attributes,b.attributes)},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||h,!(b.attributes&&b.attributes.TYPE&&b.attributes["GROUP-ID"]&&b.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}var B=this.manifest.mediaGroups[b.attributes.TYPE];B[b.attributes["GROUP-ID"]]=B[b.attributes["GROUP-ID"]]||{},I=B[b.attributes["GROUP-ID"]],L={default:/yes/i.test(b.attributes.DEFAULT)},L.default?L.autoselect=!0:L.autoselect=/yes/i.test(b.attributes.AUTOSELECT),b.attributes.LANGUAGE&&(L.language=b.attributes.LANGUAGE),b.attributes.URI&&(L.uri=b.attributes.URI),b.attributes["INSTREAM-ID"]&&(L.instreamId=b.attributes["INSTREAM-ID"]),b.attributes.CHARACTERISTICS&&(L.characteristics=b.attributes.CHARACTERISTICS),b.attributes.FORCED&&(L.forced=/yes/i.test(b.attributes.FORCED)),I[b.attributes.NAME]=L},discontinuity:function(){g+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(n.length)},"program-date-time":function(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=b.dateTimeString,this.manifest.dateTimeObject=b.dateTimeObject),a.dateTimeString=b.dateTimeString,a.dateTimeObject=b.dateTimeObject},targetduration:function(){if(!isFinite(b.duration)||b.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+b.duration});return}this.manifest.targetDuration=b.duration,kf.call(this,this.manifest)},start:function(){if(!b.attributes||isNaN(b.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:b.attributes["TIME-OFFSET"],precise:b.attributes.PRECISE}},"cue-out":function(){a.cueOut=b.data},"cue-out-cont":function(){a.cueOutCont=b.data},"cue-in":function(){a.cueIn=b.data},skip:function(){this.manifest.skip=xa(b.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",b.attributes,["SKIPPED-SEGMENTS"])},part:function(){var B=this;u=!0;var O=this.manifest.segments.length,M=xa(b.attributes);a.parts=a.parts||[],a.parts.push(M),M.byterange&&(M.byterange.hasOwnProperty("offset")||(M.byterange.offset=p),p=M.byterange.offset+M.byterange.length);var U=a.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+U+" for segment #"+O,b.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(w,P){w.hasOwnProperty("lastPart")||B.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+P+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var B=this.manifest.serverControl=xa(b.attributes);B.hasOwnProperty("canBlockReload")||(B.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),kf.call(this,this.manifest),B.canSkipDateranges&&!B.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 B=this.manifest.segments.length,O=xa(b.attributes),M=O.type&&O.type==="PART";a.preloadHints=a.preloadHints||[],a.preloadHints.push(O),O.byterange&&(O.byterange.hasOwnProperty("offset")||(O.byterange.offset=M?p:0,M&&(p=O.byterange.offset+O.byterange.length)));var U=a.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+U+" for segment #"+B,b.attributes,["TYPE","URI"]),!!O.type)for(var w=0;w<a.preloadHints.length-1;w++){var P=a.preloadHints[w];P.type&&P.type===O.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+U+" for segment #"+B+" has the same TYPE "+O.type+" as preload hint #"+w})}},"rendition-report":function(){var B=xa(b.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(B);var O=this.manifest.renditionReports.length-1,M=["LAST-MSN","URI"];u&&M.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+O,b.attributes,M)},"part-inf":function(){this.manifest.partInf=xa(b.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",b.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),kf.call(this,this.manifest)}}[b.tagType]||c).call(r)},uri:function(){a.uri=b.uri,n.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),l&&(a.key=l),a.timeline=g,o&&(a.map=o),p=0,a={}},comment:function(){},custom:function(){b.segment?(a.custom=a.custom||{},a.custom[b.customType]=b.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[b.customType]=b.data)}})[b.type].call(r)}),i}var t=e.prototype;return t.warnOnMissingAttributes_=function(r,n,a){var o=[];a.forEach(function(l){n.hasOwnProperty(l)||o.push(l)}),o.length&&this.trigger("warn",{message:r+" lacks required attribute(s): "+o.join(", ")})},t.push=function(r){this.lineStream.push(r)},t.end=function(){this.lineStream.push(`
245
+ `),this.trigger("end")},t.addParser=function(r){this.parseStream.addParser(r)},t.addTagMapper=function(r){this.parseStream.addTagMapper(r)},e})(dg),zs={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^/},mL=["video","audio","text"],f_=["Video","Audio","Text"],N1=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,i,r){var n=("00"+Number(i).toString(16)).slice(-2),a=("00"+Number(r).toString(16)).slice(-2);return"avc1."+n+"00"+a})},Ur=function(e){e===void 0&&(e="");var t=e.split(","),i=[];return t.forEach(function(r){r=r.trim();var n;mL.forEach(function(a){var o=zs[a].exec(r.toLowerCase());if(!(!o||o.length<=1)){n=a;var l=r.substring(0,o[1].length),u=r.replace(l,"");i.push({type:l,details:u,mediaType:a})}}),n||i.push({type:r,details:"",mediaType:"unknown"})}),i},gL=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var r in i){var n=i[r];if(n.default&&n.playlists)return Ur(n.playlists[0].attributes.CODECS)}return null},L1=function(e){return e===void 0&&(e=""),zs.audio.test(e.trim().toLowerCase())},vL=function(e){return e===void 0&&(e=""),zs.text.test(e.trim().toLowerCase())},Bl=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return N1(n.trim())}),i="video";t.length===1&&L1(t[0])?i="audio":t.length===1&&vL(t[0])&&(i="application");var r="mp4";return t.every(function(n){return zs.mp4.test(n)})?r="mp4":t.every(function(n){return zs.webm.test(n)})?r="webm":t.every(function(n){return zs.ogg.test(n)})&&(r="ogg"),i+"/"+r+';codecs="'+e+'"'}},gc=function(e){return e===void 0&&(e=""),D.MediaSource&&D.MediaSource.isTypeSupported&&D.MediaSource.isTypeSupported(Bl(e))||!1},xf=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var i=0;i<f_.length;i++){var r=f_[i];if(zs["muxer"+r].test(t))return!0}return!1})},p_="mp4a.40.2",yL="avc1.4d400d",_L=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,TL=/^application\/dash\+xml/i,O1=function(e){return _L.test(e)?"hls":TL.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},bL=function(e){return e.toString(2).length},SL=function(e){return Math.ceil(bL(e)/8)},M1=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},CL=function(e){return M1(e)},je=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!CL(e)&&!(e instanceof ArrayBuffer)&&(typeof e!="number"||typeof e=="number"&&e!==e?e=0:e=[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},li=D.BigInt||Number,Hp=[li("0x1"),li("0x100"),li("0x10000"),li("0x1000000"),li("0x100000000"),li("0x10000000000"),li("0x1000000000000"),li("0x100000000000000"),li("0x10000000000000000")];(function(){var s=new Uint16Array([65484]),e=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var EL=function(e,t){var i=t===void 0?{}:t,r=i.signed,n=r===void 0?!1:r,a=i.le,o=a===void 0?!1:a;e=je(e);var l=o?"reduce":"reduceRight",u=e[l]?e[l]:Array.prototype[l],c=u.call(e,function(f,g,C){var p=o?C:Math.abs(C+1-e.length);return f+li(g)*Hp[p]},li(0));if(n){var h=Hp[e.length]/li(2)-li(1);c=li(c),c>h&&(c-=h,c-=h,c-=li(2))}return Number(c)},wL=function(e,t){var i={},r=i.le,n=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=li(e);for(var a=SL(e),o=new Uint8Array(new ArrayBuffer(a)),l=0;l<a;l++){var u=n?l:Math.abs(l+1-o.length);o[u]=Number(e/Hp[l]&li(255)),e<0&&(o[u]=Math.abs(~o[u]),o[u]-=l===0?1:2)}return o},R1=function(e,t){if(typeof e!="string"&&e&&typeof e.toString=="function"&&(e=e.toString()),typeof e!="string")return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),r=0;r<e.length;r++)i[r]=e.charCodeAt(r);return i},kL=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(t=t.filter(function(o){return o&&(o.byteLength||o.length)&&typeof o!="string"}),t.length<=1)return je(t[0]);var r=t.reduce(function(o,l,u){return o+(l.byteLength||l.length)},0),n=new Uint8Array(r),a=0;return t.forEach(function(o){o=je(o),n.set(o,a),a+=o.byteLength}),n},It=function(e,t,i){var r=i===void 0?{}:i,n=r.offset,a=n===void 0?0:n,o=r.mask,l=o===void 0?[]:o;e=je(e),t=je(t);var u=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&u.call(t,function(c,h){var f=l[h]?l[h]&e[a+h]:e[a+h];return c===f})},xL=function(e,t,i){t.forEach(function(r){for(var n in e.mediaGroups[r])for(var a in e.mediaGroups[r][n]){var o=e.mediaGroups[r][n][a];i(o,r,n,a)}})};/*! @name mpd-parser @version 0.22.1 @license Apache-2.0 */var m_=function(e){return!!e&&typeof e=="object"},xi=function s(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return t.reduce(function(r,n){return typeof n!="object"||Object.keys(n).forEach(function(a){Array.isArray(r[a])&&Array.isArray(n[a])?r[a]=r[a].concat(n[a]):m_(r[a])&&m_(n[a])?r[a]=s(r[a],n[a]):r[a]=n[a]}),r},{})},B1=function(e){return Object.keys(e).map(function(t){return e[t]})},AL=function(e,t){for(var i=[],r=e;r<t;r++)i.push(r);return i},Vh=function(e){return e.reduce(function(t,i){return t.concat(i)},[])},F1=function(e){if(!e.length)return[];for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},IL=function(e,t){return e.reduce(function(i,r,n){return r[t]&&i.push(n),i},[])},qp=function(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return i;return-1},PL=function(e,t){return B1(e.reduce(function(i,r){return r.forEach(function(n){i[t(n)]=n}),i},{}))},ho={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"},Fl=function(e){var t=e.baseUrl,i=t===void 0?"":t,r=e.source,n=r===void 0?"":r,a=e.range,o=a===void 0?"":a,l=e.indexRange,u=l===void 0?"":l,c={uri:n,resolvedUri:jh(i||"",n)};if(o||u){var h=o||u,f=h.split("-"),g=D.BigInt?D.BigInt(f[0]):parseInt(f[0],10),C=D.BigInt?D.BigInt(f[1]):parseInt(f[1],10);g<Number.MAX_SAFE_INTEGER&&typeof g=="bigint"&&(g=Number(g)),C<Number.MAX_SAFE_INTEGER&&typeof C=="bigint"&&(C=Number(C));var p;typeof C=="bigint"||typeof g=="bigint"?p=D.BigInt(C)-D.BigInt(g)+D.BigInt(1):p=C-g+1,typeof p=="bigint"&&p<Number.MAX_SAFE_INTEGER&&(p=Number(p)),c.byterange={length:p,offset:g}}return c},DL=function(e){var t;return typeof e.offset=="bigint"||typeof e.length=="bigint"?t=D.BigInt(e.offset)+D.BigInt(e.length)-D.BigInt(1):t=e.offset+e.length-1,e.offset+"-"+t},g_=function(e){return e&&typeof e!="number"&&(e=parseInt(e,10)),isNaN(e)?null:e},NL={static:function(e){var t=e.duration,i=e.timescale,r=i===void 0?1:i,n=e.sourceDuration,a=e.periodDuration,o=g_(e.endNumber),l=t/r;return typeof o=="number"?{start:0,end:o}:typeof a=="number"?{start:0,end:a/l}:{start:0,end:n/l}},dynamic:function(e){var t=e.NOW,i=e.clientOffset,r=e.availabilityStartTime,n=e.timescale,a=n===void 0?1:n,o=e.duration,l=e.periodStart,u=l===void 0?0:l,c=e.minimumUpdatePeriod,h=c===void 0?0:c,f=e.timeShiftBufferDepth,g=f===void 0?1/0:f,C=g_(e.endNumber),p=(t+i)/1e3,b=r+u,I=p+h,L=I-b,F=Math.ceil(L*a/o),V=Math.floor((p-b-g)*a/o),B=Math.floor((p-b)*a/o);return{start:Math.max(0,V),end:typeof C=="number"?C:Math.min(F,B)}}},LL=function(e){return function(t){var i=e.duration,r=e.timescale,n=r===void 0?1:r,a=e.periodStart,o=e.startNumber,l=o===void 0?1:o;return{number:l+t,duration:i/n,timeline:a,time:t*i}}},fg=function(e){var t=e.type,i=e.duration,r=e.timescale,n=r===void 0?1:r,a=e.periodDuration,o=e.sourceDuration,l=NL[t](e),u=l.start,c=l.end,h=AL(u,c).map(LL(e));if(t==="static"){var f=h.length-1,g=typeof a=="number"?a:o;h[f].duration=g-i/n*f}return h},U1=function(e){var t=e.baseUrl,i=e.initialization,r=i===void 0?{}:i,n=e.sourceDuration,a=e.indexRange,o=a===void 0?"":a,l=e.periodStart,u=e.presentationTime,c=e.number,h=c===void 0?0:c,f=e.duration;if(!t)throw new Error(ho.NO_BASE_URL);var g=Fl({baseUrl:t,source:r.sourceURL,range:r.range}),C=Fl({baseUrl:t,source:t,indexRange:o});if(C.map=g,f){var p=fg(e);p.length&&(C.duration=p[0].duration,C.timeline=p[0].timeline)}else n&&(C.duration=n,C.timeline=l);return C.presentationTime=u||l,C.number=h,[C]},pg=function(e,t,i){var r=e.sidx.map?e.sidx.map:null,n=e.sidx.duration,a=e.timeline||0,o=e.sidx.byterange,l=o.offset+o.length,u=t.timescale,c=t.references.filter(function(w){return w.referenceType!==1}),h=[],f=e.endList?"static":"dynamic",g=e.sidx.timeline,C=g,p=e.mediaSequence||0,b;typeof t.firstOffset=="bigint"?b=D.BigInt(l)+t.firstOffset:b=l+t.firstOffset;for(var I=0;I<c.length;I++){var L=t.references[I],F=L.referencedSize,V=L.subsegmentDuration,B=void 0;typeof b=="bigint"?B=b+D.BigInt(F)-D.BigInt(1):B=b+F-1;var O=b+"-"+B,M={baseUrl:i,timescale:u,timeline:a,periodStart:g,presentationTime:C,number:p,duration:V,sourceDuration:n,indexRange:O,type:f},U=U1(M)[0];r&&(U.map=r),h.push(U),typeof b=="bigint"?b+=D.BigInt(F):b+=F,C+=V/u,p++}return e.segments=h,e},OL=["AUDIO","SUBTITLES"],ML=1/60,$1=function(e){return PL(e,function(t){var i=t.timeline;return i}).sort(function(t,i){return t.timeline>i.timeline?1:-1})},RL=function(e,t){for(var i=0;i<e.length;i++)if(e[i].attributes.NAME===t)return e[i];return null},v_=function(e){var t=[];return xL(e,OL,function(i,r,n,a){t=t.concat(i.playlists||[])}),t},y_=function(e){var t=e.playlist,i=e.mediaSequence;t.mediaSequence=i,t.segments.forEach(function(r,n){r.number=t.mediaSequence+n})},BL=function(e){var t=e.oldPlaylists,i=e.newPlaylists,r=e.timelineStarts;i.forEach(function(n){n.discontinuitySequence=qp(r,function(c){var h=c.timeline;return h===n.timeline});var a=RL(t,n.attributes.NAME);if(a&&!n.sidx){var o=n.segments[0],l=qp(a.segments,function(c){return Math.abs(c.presentationTime-o.presentationTime)<ML});if(l===-1){y_({playlist:n,mediaSequence:a.mediaSequence+a.segments.length}),n.segments[0].discontinuity=!0,n.discontinuityStarts.unshift(0),(!a.segments.length&&n.timeline>a.timeline||a.segments.length&&n.timeline>a.segments[a.segments.length-1].timeline)&&n.discontinuitySequence--;return}var u=a.segments[l];u.discontinuity&&!o.discontinuity&&(o.discontinuity=!0,n.discontinuityStarts.unshift(0),n.discontinuitySequence--),y_({playlist:n,mediaSequence:a.segments[l].number})}})},FL=function(e){var t=e.oldManifest,i=e.newManifest,r=t.playlists.concat(v_(t)),n=i.playlists.concat(v_(i));return i.timelineStarts=$1([t.timelineStarts,i.timelineStarts]),BL({oldPlaylists:r,newPlaylists:n,timelineStarts:i.timelineStarts}),i},Hh=function(e){return e&&e.uri+"-"+DL(e.byterange)},Af=function(e){var t=B1(e.reduce(function(i,r){var n=r.attributes.id+(r.attributes.lang||"");if(!i[n])i[n]=r,i[n].attributes.timelineStarts=[];else{if(r.segments){var a;r.segments[0]&&(r.segments[0].discontinuity=!0),(a=i[n].segments).push.apply(a,r.segments)}r.attributes.contentProtection&&(i[n].attributes.contentProtection=r.attributes.contentProtection)}return i[n].attributes.timelineStarts.push({start:r.attributes.periodStart,timeline:r.attributes.periodStart}),i},{}));return t.map(function(i){return i.discontinuityStarts=IL(i.segments||[],"discontinuity"),i})},mg=function(e,t){var i=Hh(e.sidx),r=i&&t[i]&&t[i].sidx;return r&&pg(e,r,e.sidx.resolvedUri),e},UL=function(e,t){if(t===void 0&&(t={}),!Object.keys(t).length)return e;for(var i in e)e[i]=mg(e[i],t);return e},$L=function(e,t){var i,r=e.attributes,n=e.segments,a=e.sidx,o=e.mediaSequence,l=e.discontinuitySequence,u=e.discontinuityStarts,c={attributes:(i={NAME:r.id,BANDWIDTH:r.bandwidth,CODECS:r.codecs},i["PROGRAM-ID"]=1,i),uri:"",endList:r.type==="static",timeline:r.periodStart,resolvedUri:"",targetDuration:r.duration,discontinuitySequence:l,discontinuityStarts:u,timelineStarts:r.timelineStarts,mediaSequence:o,segments:n};return r.contentProtection&&(c.contentProtection=r.contentProtection),a&&(c.sidx=a),t&&(c.attributes.AUDIO="audio",c.attributes.SUBTITLES="subs"),c},jL=function(e){var t,i=e.attributes,r=e.segments,n=e.mediaSequence,a=e.discontinuityStarts,o=e.discontinuitySequence;typeof r>"u"&&(r=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);var l=(t={NAME:i.id,BANDWIDTH:i.bandwidth},t["PROGRAM-ID"]=1,t);return i.codecs&&(l.CODECS=i.codecs),{attributes:l,uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:a,discontinuitySequence:o,mediaSequence:n,segments:r}},VL=function(e,t,i){t===void 0&&(t={}),i===void 0&&(i=!1);var r,n=e.reduce(function(o,l){var u=l.attributes.role&&l.attributes.role.value||"",c=l.attributes.lang||"",h=l.attributes.label||"main";if(c&&!l.attributes.label){var f=u?" ("+u+")":"";h=""+l.attributes.lang+f}o[h]||(o[h]={language:c,autoselect:!0,default:u==="main",playlists:[],uri:""});var g=mg($L(l,i),t);return o[h].playlists.push(g),typeof r>"u"&&u==="main"&&(r=l,r.default=!0),o},{});if(!r){var a=Object.keys(n)[0];n[a].default=!0}return n},HL=function(e,t){return t===void 0&&(t={}),e.reduce(function(i,r){var n=r.attributes.lang||"text";return i[n]||(i[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),i[n].playlists.push(mg(jL(r),t)),i},{})},qL=function(e){return e.reduce(function(t,i){return i&&i.forEach(function(r){var n=r.channel,a=r.language;t[a]={autoselect:!1,default:!1,instreamId:n,language:a},r.hasOwnProperty("aspectRatio")&&(t[a].aspectRatio=r.aspectRatio),r.hasOwnProperty("easyReader")&&(t[a].easyReader=r.easyReader),r.hasOwnProperty("3D")&&(t[a]["3D"]=r["3D"])}),t},{})},zL=function(e){var t,i=e.attributes,r=e.segments,n=e.sidx,a=e.discontinuityStarts,o={attributes:(t={NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:"",targetDuration:i.duration,discontinuityStarts:a,timelineStarts:i.timelineStarts,segments:r};return i.frameRate&&(o.attributes["FRAME-RATE"]=i.frameRate),i.contentProtection&&(o.contentProtection=i.contentProtection),n&&(o.sidx=n),o},WL=function(e){var t=e.attributes;return t.mimeType==="video/mp4"||t.mimeType==="video/webm"||t.contentType==="video"},GL=function(e){var t=e.attributes;return t.mimeType==="audio/mp4"||t.mimeType==="audio/webm"||t.contentType==="audio"},KL=function(e){var t=e.attributes;return t.mimeType==="text/vtt"||t.contentType==="text"},XL=function(e,t){e.forEach(function(i){i.mediaSequence=0,i.discontinuitySequence=qp(t,function(r){var n=r.timeline;return n===i.timeline}),i.segments&&i.segments.forEach(function(r,n){r.number=n})})},__=function(e){return e?Object.keys(e).reduce(function(t,i){var r=e[i];return t.concat(r.playlists)},[]):[]},QL=function(e){var t,i=e.dashPlaylists,r=e.locations,n=e.sidxMapping,a=n===void 0?{}:n,o=e.previousManifest;if(!i.length)return{};var l=i[0].attributes,u=l.sourceDuration,c=l.type,h=l.suggestedPresentationDelay,f=l.minimumUpdatePeriod,g=Af(i.filter(WL)).map(zL),C=Af(i.filter(GL)),p=Af(i.filter(KL)),b=i.map(function(M){return M.attributes.captionServices}).filter(Boolean),I={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:u,playlists:UL(g,a)};f>=0&&(I.minimumUpdatePeriod=f*1e3),r&&(I.locations=r),c==="dynamic"&&(I.suggestedPresentationDelay=h);var L=I.playlists.length===0,F=C.length?VL(C,a,L):null,V=p.length?HL(p,a):null,B=g.concat(__(F),__(V)),O=B.map(function(M){var U=M.timelineStarts;return U});return I.timelineStarts=$1(O),XL(B,I.timelineStarts),F&&(I.mediaGroups.AUDIO.audio=F),V&&(I.mediaGroups.SUBTITLES.subs=V),b.length&&(I.mediaGroups["CLOSED-CAPTIONS"].cc=qL(b)),o?FL({oldManifest:o,newManifest:I}):I},YL=function(e,t,i){var r=e.NOW,n=e.clientOffset,a=e.availabilityStartTime,o=e.timescale,l=o===void 0?1:o,u=e.periodStart,c=u===void 0?0:u,h=e.minimumUpdatePeriod,f=h===void 0?0:h,g=(r+n)/1e3,C=a+c,p=g+f,b=p-C;return Math.ceil((b*l-t)/i)},j1=function(e,t){for(var i=e.type,r=e.minimumUpdatePeriod,n=r===void 0?0:r,a=e.media,o=a===void 0?"":a,l=e.sourceDuration,u=e.timescale,c=u===void 0?1:u,h=e.startNumber,f=h===void 0?1:h,g=e.periodStart,C=[],p=-1,b=0;b<t.length;b++){var I=t[b],L=I.d,F=I.r||0,V=I.t||0;p<0&&(p=V),V&&V>p&&(p=V);var B=void 0;if(F<0){var O=b+1;O===t.length?i==="dynamic"&&n>0&&o.indexOf("$Number$")>0?B=YL(e,p,L):B=(l*c-p)/L:B=(t[O].t-p)/L}else B=F+1;for(var M=f+C.length+B,U=f+C.length;U<M;)C.push({number:U,duration:L/c,time:p,timeline:g}),p+=L,U++}return C},JL=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,ZL=function(e){return function(t,i,r,n){if(t==="$$")return"$";if(typeof e[i]>"u")return t;var a=""+e[i];return i==="RepresentationID"||(r?n=parseInt(n,10):n=1,a.length>=n)?a:""+new Array(n-a.length+1).join("0")+a}},T_=function(e,t){return e.replace(JL,ZL(t))},eO=function(e,t){return!e.duration&&!t?[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]:e.duration?fg(e):j1(e,t)},tO=function(e,t){var i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},r=e.initialization,n=r===void 0?{sourceURL:"",range:""}:r,a=Fl({baseUrl:e.baseUrl,source:T_(n.sourceURL,i),range:n.range}),o=eO(e,t);return o.map(function(l){i.Number=l.number,i.Time=l.time;var u=T_(e.media||"",i),c=e.timescale||1,h=e.presentationTimeOffset||0,f=e.periodStart+(l.time-h)/c,g={uri:u,timeline:l.timeline,duration:l.duration,resolvedUri:jh(e.baseUrl||"",u),map:a,number:l.number,presentationTime:f};return g})},iO=function(e,t){var i=e.baseUrl,r=e.initialization,n=r===void 0?{}:r,a=Fl({baseUrl:i,source:n.sourceURL,range:n.range}),o=Fl({baseUrl:i,source:t.media,range:t.mediaRange});return o.map=a,o},rO=function(e,t){var i=e.duration,r=e.segmentUrls,n=r===void 0?[]:r,a=e.periodStart;if(!i&&!t||i&&t)throw new Error(ho.SEGMENT_TIME_UNSPECIFIED);var o=n.map(function(c){return iO(e,c)}),l;i&&(l=fg(e)),t&&(l=j1(e,t));var u=l.map(function(c,h){if(o[h]){var f=o[h],g=e.timescale||1,C=e.presentationTimeOffset||0;return f.timeline=c.timeline,f.duration=c.duration,f.number=c.number,f.presentationTime=a+(c.time-C)/g,f}}).filter(function(c){return c});return u},nO=function(e){var t=e.attributes,i=e.segmentInfo,r,n;i.template?(n=tO,r=xi(t,i.template)):i.base?(n=U1,r=xi(t,i.base)):i.list&&(n=rO,r=xi(t,i.list));var a={attributes:t};if(!n)return a;var o=n(r,i.segmentTimeline);if(r.duration){var l=r,u=l.duration,c=l.timescale,h=c===void 0?1:c;r.duration=u/h}else o.length?r.duration=o.reduce(function(f,g){return Math.max(f,Math.ceil(g.duration))},0):r.duration=0;return a.attributes=r,a.segments=o,i.base&&r.indexRange&&(a.sidx=o[0],a.segments=[]),a},sO=function(e){return e.map(nO)},zt=function(e,t){return F1(e.childNodes).filter(function(i){var r=i.tagName;return r===t})},gg=function(e){return e.textContent.trim()},aO=function(e){return parseFloat(e.split("/").reduce(function(t,i){return t/i}))},Aa=function(e){var t=31536e3,i=720*60*60,r=1440*60,n=3600,a=60,o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/,l=o.exec(e);if(!l)return 0;var u=l.slice(1),c=u[0],h=u[1],f=u[2],g=u[3],C=u[4],p=u[5];return parseFloat(c||0)*t+parseFloat(h||0)*i+parseFloat(f||0)*r+parseFloat(g||0)*n+parseFloat(C||0)*a+parseFloat(p||0)},oO=function(e){var t=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;return t.test(e)&&(e+="Z"),Date.parse(e)},b_={mediaPresentationDuration:function(e){return Aa(e)},availabilityStartTime:function(e){return oO(e)/1e3},minimumUpdatePeriod:function(e){return Aa(e)},suggestedPresentationDelay:function(e){return Aa(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return Aa(e)},start:function(e){return Aa(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},frameRate:function(e){return aO(e)},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)?Aa(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}},pi=function(e){return e&&e.attributes?F1(e.attributes).reduce(function(t,i){var r=b_[i.name]||b_.DEFAULT;return t[i.name]=r(i.value),t},{}):{}},lO={"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"},qh=function(e,t){return t.length?Vh(e.map(function(i){return t.map(function(r){return jh(i,gg(r))})})):e},vg=function(e){var t=zt(e,"SegmentTemplate")[0],i=zt(e,"SegmentList")[0],r=i&&zt(i,"SegmentURL").map(function(f){return xi({tag:"SegmentURL"},pi(f))}),n=zt(e,"SegmentBase")[0],a=i||t,o=a&&zt(a,"SegmentTimeline")[0],l=i||n||t,u=l&&zt(l,"Initialization")[0],c=t&&pi(t);c&&u?c.initialization=u&&pi(u):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});var h={template:c,segmentTimeline:o&&zt(o,"S").map(function(f){return pi(f)}),list:i&&xi(pi(i),{segmentUrls:r,initialization:pi(u)}),base:n&&xi(pi(n),{initialization:pi(u)})};return Object.keys(h).forEach(function(f){h[f]||delete h[f]}),h},uO=function(e,t,i){return function(r){var n=zt(r,"BaseURL"),a=qh(t,n),o=xi(e,pi(r)),l=vg(r);return a.map(function(u){return{segmentInfo:xi(i,l),attributes:xi(o,{baseUrl:u})}})}},cO=function(e){return e.reduce(function(t,i){var r=pi(i);r.schemeIdUri&&(r.schemeIdUri=r.schemeIdUri.toLowerCase());var n=lO[r.schemeIdUri];if(n){t[n]={attributes:r};var a=zt(i,"cenc:pssh")[0];if(a){var o=gg(a);t[n].pssh=o&&D1(o)}}return t},{})},hO=function(e){if(e.schemeIdUri==="urn:scte:dash:cc:cea-608:2015"){var t=typeof e.value!="string"?[]:e.value.split(";");return t.map(function(r){var n,a;if(a=r,/^CC\d=/.test(r)){var o=r.split("=");n=o[0],a=o[1]}else/^CC\d$/.test(r)&&(n=r);return{channel:n,language:a}})}else if(e.schemeIdUri==="urn:scte:dash:cc:cea-708:2015"){var i=typeof e.value!="string"?[]:e.value.split(";");return i.map(function(r){var n={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(r)){var a=r.split("="),o=a[0],l=a[1],u=l===void 0?"":l;n.channel=o,n.language=r,u.split(",").forEach(function(c){var h=c.split(":"),f=h[0],g=h[1];f==="lang"?n.language=g:f==="er"?n.easyReader=Number(g):f==="war"?n.aspectRatio=Number(g):f==="3D"&&(n["3D"]=Number(g))})}else n.language=r;return n.channel&&(n.channel="SERVICE"+n.channel),n})}},dO=function(e,t,i){return function(r){var n=pi(r),a=qh(t,zt(r,"BaseURL")),o=zt(r,"Role")[0],l={role:pi(o)},u=xi(e,n,l),c=zt(r,"Accessibility")[0],h=hO(pi(c));h&&(u=xi(u,{captionServices:h}));var f=zt(r,"Label")[0];if(f&&f.childNodes.length){var g=f.childNodes[0].nodeValue.trim();u=xi(u,{label:g})}var C=cO(zt(r,"ContentProtection"));Object.keys(C).length&&(u=xi(u,{contentProtection:C}));var p=vg(r),b=zt(r,"Representation"),I=xi(i,p);return Vh(b.map(uO(u,a,I)))}},fO=function(e,t){return function(i,r){var n=qh(t,zt(i.node,"BaseURL")),a=xi(e,{periodStart:i.attributes.start});typeof i.attributes.duration=="number"&&(a.periodDuration=i.attributes.duration);var o=zt(i.node,"AdaptationSet"),l=vg(i.node);return Vh(o.map(dO(a,n,l)))}},pO=function(e){var t=e.attributes,i=e.priorPeriodAttributes,r=e.mpdType;return typeof t.start=="number"?t.start:i&&typeof i.start=="number"&&typeof i.duration=="number"?i.start+i.duration:!i&&r==="static"?0:null},mO=function(e,t){t===void 0&&(t={});var i=t,r=i.manifestUri,n=r===void 0?"":r,a=i.NOW,o=a===void 0?Date.now():a,l=i.clientOffset,u=l===void 0?0:l,c=zt(e,"Period");if(!c.length)throw new Error(ho.INVALID_NUMBER_OF_PERIOD);var h=zt(e,"Location"),f=pi(e),g=qh([n],zt(e,"BaseURL"));f.type=f.type||"static",f.sourceDuration=f.mediaPresentationDuration||0,f.NOW=o,f.clientOffset=u,h.length&&(f.locations=h.map(gg));var C=[];return c.forEach(function(p,b){var I=pi(p),L=C[b-1];I.start=pO({attributes:I,priorPeriodAttributes:L?L.attributes:null,mpdType:f.type}),C.push({node:p,attributes:I})}),{locations:f.locations,representationInfo:Vh(C.map(fO(f,g)))}},V1=function(e){if(e==="")throw new Error(ho.DASH_EMPTY_MANIFEST);var t=new Qb.DOMParser,i,r;try{i=t.parseFromString(e,"application/xml"),r=i&&i.documentElement.tagName==="MPD"?i.documentElement:null}catch{}if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error(ho.DASH_INVALID_XML);return r},gO=function(e){var t=zt(e,"UTCTiming")[0];if(!t)return null;var i=pi(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.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":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.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(ho.UNSUPPORTED_UTC_TIMING_SCHEME)}return i},vO=function(e,t){t===void 0&&(t={});var i=mO(V1(e),t),r=sO(i.representationInfo);return QL({dashPlaylists:r,locations:i.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})},yO=function(e){return gO(V1(e))},If,S_;function _O(){if(S_)return If;S_=1;var s=Math.pow(2,32),e=function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r;return i.getBigUint64?(r=i.getBigUint64(0),r<Number.MAX_SAFE_INTEGER?Number(r):r):i.getUint32(0)*s+i.getUint32(4)};return If={getUint64:e,MAX_UINT32:s},If}var Pf,C_;function TO(){if(C_)return Pf;C_=1;var s=_O().getUint64,e=function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8)},n=12;r.version===0?(r.earliestPresentationTime=i.getUint32(n),r.firstOffset=i.getUint32(n+4),n+=8):(r.earliestPresentationTime=s(t.subarray(n)),r.firstOffset=s(t.subarray(n+8)),n+=16),n+=2;var a=i.getUint16(n);for(n+=2;a>0;n+=12,a--)r.references.push({referenceType:(t[n]&128)>>>7,referencedSize:i.getUint32(n)&2147483647,subsegmentDuration:i.getUint32(n+4),startsWithSap:!!(t[n+8]&128),sapType:(t[n+8]&112)>>>4,sapDeltaTime:i.getUint32(n+8)&268435455});return r};return Pf=e,Pf}var bO=TO();const SO=Vi(bO);var CO=je([73,68,51]),EO=function(e,t){t===void 0&&(t=0),e=je(e);var i=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(i&16)>>4;return n?r+20:r+10},ml=function s(e,t){return t===void 0&&(t=0),e=je(e),e.length-t<10||!It(e,CO,{offset:t})?t:(t+=EO(e,t),s(e,t))},E_=function(e){return typeof e=="string"?R1(e):e},wO=function(e){return Array.isArray(e)?e.map(function(t){return E_(t)}):[E_(e)]},kO=function s(e,t,i){i===void 0&&(i=!1),t=wO(t),e=je(e);var r=[];if(!t.length)return r;for(var n=0;n<e.length;){var a=(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0,o=e.subarray(n+4,n+8);if(a===0)break;var l=n+a;if(l>e.length){if(i)break;l=e.length}var u=e.subarray(n+8,l);It(o,t[0])&&(t.length===1?r.push(u):r.push.apply(r,s(u,t.slice(1),i))),n=l}return r},Ku={EBML:je([26,69,223,163]),DocType:je([66,130]),Segment:je([24,83,128,103]),SegmentInfo:je([21,73,169,102]),Tracks:je([22,84,174,107]),Track:je([174]),TrackNumber:je([215]),DefaultDuration:je([35,227,131]),TrackEntry:je([174]),TrackType:je([131]),FlagDefault:je([136]),CodecID:je([134]),CodecPrivate:je([99,162]),VideoTrack:je([224]),AudioTrack:je([225]),Cluster:je([31,67,182,117]),Timestamp:je([231]),TimestampScale:je([42,215,177]),BlockGroup:je([160]),BlockDuration:je([155]),Block:je([161]),SimpleBlock:je([163])},zp=[128,64,32,16,8,4,2,1],xO=function(e){for(var t=1,i=0;i<zp.length&&!(e&zp[i]);i++)t++;return t},Wc=function(e,t,i,r){i===void 0&&(i=!0),r===void 0&&(r=!1);var n=xO(e[t]),a=e.subarray(t,t+n);return i&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=zp[n-1]),{length:n,value:EL(a,{signed:r}),bytes:a}},w_=function s(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return s(t)}):typeof e=="number"?wL(e):e},AO=function(e){return Array.isArray(e)?e.map(function(t){return w_(t)}):[w_(e)]},IO=function s(e,t,i){if(i>=t.length)return t.length;var r=Wc(t,i,!1);if(It(e.bytes,r.bytes))return i;var n=Wc(t,i+r.length);return s(e,t,i+n.length+n.value+r.length)},k_=function s(e,t){t=AO(t),e=je(e);var i=[];if(!t.length)return i;for(var r=0;r<e.length;){var n=Wc(e,r,!1),a=Wc(e,r+n.length),o=r+n.length+a.length;a.value===127&&(a.value=IO(n,e,o),a.value!==e.length&&(a.value-=o));var l=o+a.value>e.length?e.length:o+a.value,u=e.subarray(o,l);It(t[0],n.bytes)&&(t.length===1?i.push(u):i=i.concat(s(u,t.slice(1))));var c=n.length+a.length+u.length;r+=c}return i},PO=je([0,0,0,1]),DO=je([0,0,1]),NO=je([0,0,3]),LO=function(e){for(var t=[],i=1;i<e.length-2;)It(e.subarray(i,i+3),NO)&&(t.push(i+2),i++),i++;if(t.length===0)return e;var r=e.length-t.length,n=new Uint8Array(r),a=0;for(i=0;i<r;a++,i++)a===t[0]&&(a++,t.shift()),n[i]=e[a];return n},H1=function(e,t,i,r){e=je(e),i=[].concat(i);for(var n=0,a,o=0;n<e.length&&(o<r||a);){var l=void 0;if(It(e.subarray(n),PO)?l=4:It(e.subarray(n),DO)&&(l=3),!l){n++;continue}if(o++,a)return LO(e.subarray(a,n));var u=void 0;t==="h264"?u=e[n+l]&31:t==="h265"&&(u=e[n+l]>>1&63),i.indexOf(u)!==-1&&(a=n+l),n+=l+(t==="h264"?1:2)}return e.subarray(0,0)},OO=function(e,t,i){return H1(e,"h264",t,i)},MO=function(e,t,i){return H1(e,"h265",t,i)},Si={webm:je([119,101,98,109]),matroska:je([109,97,116,114,111,115,107,97]),flac:je([102,76,97,67]),ogg:je([79,103,103,83]),ac3:je([11,119]),riff:je([82,73,70,70]),avi:je([65,86,73]),wav:je([87,65,86,69]),"3gp":je([102,116,121,112,51,103]),mp4:je([102,116,121,112]),fmp4:je([115,116,121,112]),mov:je([102,116,121,112,113,116]),moov:je([109,111,111,118]),moof:je([109,111,111,102])},fo={aac:function(e){var t=ml(e);return It(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=ml(e);return It(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=k_(e,[Ku.EBML,Ku.DocType])[0];return It(t,Si.webm)},mkv:function(e){var t=k_(e,[Ku.EBML,Ku.DocType])[0];return It(t,Si.matroska)},mp4:function(e){if(fo["3gp"](e)||fo.mov(e))return!1;if(It(e,Si.mp4,{offset:4})||It(e,Si.fmp4,{offset:4})||It(e,Si.moof,{offset:4})||It(e,Si.moov,{offset:4}))return!0},mov:function(e){return It(e,Si.mov,{offset:4})},"3gp":function(e){return It(e,Si["3gp"],{offset:4})},ac3:function(e){var t=ml(e);return It(e,Si.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+188<e.length&&t<188;){if(e[t]===71&&e[t+188]===71)return!0;t+=1}return!1},flac:function(e){var t=ml(e);return It(e,Si.flac,{offset:t})},ogg:function(e){return It(e,Si.ogg)},avi:function(e){return It(e,Si.riff)&&It(e,Si.avi,{offset:8})},wav:function(e){return It(e,Si.riff)&&It(e,Si.wav,{offset:8})},h264:function(e){return OO(e,7,3).length},h265:function(e){return MO(e,[32,33],3).length}},Wp=Object.keys(fo).filter(function(s){return s!=="ts"&&s!=="h264"&&s!=="h265"}).concat(["ts","h264","h265"]);Wp.forEach(function(s){var e=fo[s];fo[s]=function(t){return e(je(t))}});var RO=fo,yg=function(e){e=je(e);for(var t=0;t<Wp.length;t++){var i=Wp[t];if(RO[i](e))return i}return""},BO=function(e){return kO(e,["moof"]).length>0},Df,x_;function FO(){if(x_)return Df;x_=1;var s=9e4,e,t,i,r,n,a,o;return e=function(l){return l*s},t=function(l,u){return l*u},i=function(l){return l/s},r=function(l,u){return l/u},n=function(l,u){return e(r(l,u))},a=function(l,u){return t(i(l),u)},o=function(l,u,c){return i(c?l:l-u)},Df={ONE_SECOND_IN_TS:s,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:i,audioTsToSeconds:r,audioTsToVideoTs:n,videoTsToAudioTs:a,metadataTsToSeconds:o},Df}var Gc=FO();function Gp(s){return Gp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gp(s)}function UO(s){try{return Function.toString.call(s).indexOf("[native code]")!==-1}catch{return typeof s=="function"}}function Kp(s){var e=typeof Map=="function"?new Map:void 0;return Kp=function(i){if(i===null||!UO(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(i))return e.get(i);e.set(i,r)}function r(){return P1(i,arguments,Gp(this).constructor)}return r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Sm(r,i)},Kp(s)}/**
246
+ * @license
247
+ * Video.js 7.21.7 <http://videojs.com/>
248
+ * Copyright Brightcove, Inc. <https://www.brightcove.com/>
249
+ * Available under Apache License Version 2.0
250
+ * <https://github.com/videojs/video.js/blob/main/LICENSE>
251
+ *
252
+ * Includes vtt.js <https://github.com/mozilla/vtt.js>
253
+ * Available under Apache License Version 2.0
254
+ * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
255
+ */var q1="7.21.7",vn={},ts=function(e,t){return vn[e]=vn[e]||[],t&&(vn[e]=vn[e].concat(t)),vn[e]},$O=function(e,t){ts(e,t)},z1=function(e,t){var i=ts(e).indexOf(t);return i<=-1?!1:(vn[e]=vn[e].slice(),vn[e].splice(i,1),!0)},jO=function(e,t){ts(e,[].concat(t).map(function(i){var r=function n(){return z1(e,n),i.apply(void 0,arguments)};return r}))},Kc={prefixed:!0},vc=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],A_=vc[0],gl;for(var Xu=0;Xu<vc.length;Xu++)if(vc[Xu][1]in le){gl=vc[Xu];break}if(gl){for(var Qu=0;Qu<gl.length;Qu++)Kc[A_[Qu]]=gl[Qu];Kc.prefixed=gl[0]!==A_[0]}var Fi=[],VO=function(e,t){return function(i,r,n){var a=t.levels[r],o=new RegExp("^("+a+")$");if(i!=="log"&&n.unshift(i.toUpperCase()+":"),n.unshift(e+":"),Fi){Fi.push([].concat(n));var l=Fi.length-1e3;Fi.splice(0,l>0?l:0)}if(D.console){var u=D.console[i];!u&&i==="debug"&&(u=D.console.info||D.console.log),!(!u||!a||!o.test(i))&&u[Array.isArray(n)?"apply":"call"](D.console,n)}}};function W1(s){var e="info",t,i=function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];t("log",e,a)};return t=VO(s,i),i.createLogger=function(r){return W1(s+": "+r)},i.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:e},i.level=function(r){if(typeof r=="string"){if(!i.levels.hasOwnProperty(r))throw new Error('"'+r+'" in not a valid log level');e=r}return e},i.history=function(){return Fi?[].concat(Fi):[]},i.history.filter=function(r){return(Fi||[]).filter(function(n){return new RegExp(".*"+r+".*").test(n[0])})},i.history.clear=function(){Fi&&(Fi.length=0)},i.history.disable=function(){Fi!==null&&(Fi.length=0,Fi=null)},i.history.enable=function(){Fi===null&&(Fi=[])},i.error=function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return t("error",e,n)},i.warn=function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return t("warn",e,n)},i.debug=function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return t("debug",e,n)},i}var Ye=W1("VIDEOJS"),G1=Ye.createLogger,HO=Object.prototype.toString,K1=function(e){return Cn(e)?Object.keys(e):[]};function Qa(s,e){K1(s).forEach(function(t){return e(s[t],t)})}function qO(s,e,t){return t===void 0&&(t=0),K1(s).reduce(function(i,r){return e(i,s[r],r)},t)}function Vt(s){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Object.assign?mt.apply(void 0,[s].concat(t)):(t.forEach(function(r){r&&Qa(r,function(n,a){s[a]=n})}),s)}function Cn(s){return!!s&&typeof s=="object"}function Ul(s){return Cn(s)&&HO.call(s)==="[object Object]"&&s.constructor===Object}function $l(s,e){if(!s||!e)return"";if(typeof D.getComputedStyle=="function"){var t;try{t=D.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}var ni=D.navigator&&D.navigator.userAgent||"",I_=/AppleWebKit\/([\d.]+)/i.exec(ni),zO=I_?parseFloat(I_.pop()):null,X1=/iPod/i.test(ni),WO=(function(){var s=ni.match(/OS (\d+)_/i);return s&&s[1]?s[1]:null})(),wn=/Android/i.test(ni),_g=(function(){var s=ni.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!s)return null;var e=s[1]&&parseFloat(s[1]),t=s[2]&&parseFloat(s[2]);return e&&t?parseFloat(s[1]+"."+s[2]):e||null})(),Q1=wn&&_g<5&&zO<537,Y1=/Firefox/i.test(ni),Zl=/Edg/i.test(ni),kn=!Zl&&(/Chrome/i.test(ni)||/CriOS/i.test(ni)),J1=(function(){var s=ni.match(/(Chrome|CriOS)\/(\d+)/);return s&&s[2]?parseFloat(s[2]):null})(),eu=(function(){var s=/MSIE\s(\d+)\.\d/.exec(ni),e=s&&parseFloat(s[1]);return!e&&/Trident\/7.0/i.test(ni)&&/rv:11.0/.test(ni)&&(e=11),e})(),Tg=/Safari/i.test(ni)&&!kn&&!wn&&!Zl,Z1=/Windows/i.test(ni),po=!!(Po()&&("ontouchstart"in D||D.navigator.maxTouchPoints||D.DocumentTouch&&D.document instanceof D.DocumentTouch)),bg=/iPad/i.test(ni)||Tg&&po&&!/iPhone/i.test(ni),Sg=/iPhone/i.test(ni)&&!bg,Di=Sg||bg||X1,zh=(Tg||Di)&&!kn,GO=Object.freeze({__proto__:null,IS_IPOD:X1,IOS_VERSION:WO,IS_ANDROID:wn,ANDROID_VERSION:_g,IS_NATIVE_ANDROID:Q1,IS_FIREFOX:Y1,IS_EDGE:Zl,IS_CHROME:kn,CHROME_VERSION:J1,IE_VERSION:eu,IS_SAFARI:Tg,IS_WINDOWS:Z1,TOUCH_ENABLED:po,IS_IPAD:bg,IS_IPHONE:Sg,IS_IOS:Di,IS_ANY_SAFARI:zh});function P_(s){return typeof s=="string"&&!!s.trim()}function eC(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function KO(s){return new RegExp("(^|\\s)"+s+"($|\\s)")}function Po(){return le===D.document}function Do(s){return Cn(s)&&s.nodeType===1}function tC(){try{return D.parent!==D.self}catch{return!0}}function iC(s){return function(e,t){if(!P_(e))return le[s](null);P_(t)&&(t=le.querySelector(t));var i=Do(t)?t:le;return i[s]&&i[s](e)}}function it(s,e,t,i){s===void 0&&(s="div"),e===void 0&&(e={}),t===void 0&&(t={});var r=le.createElement(s);return Object.getOwnPropertyNames(e).forEach(function(n){var a=e[n];n.indexOf("aria-")!==-1||n==="role"||n==="type"?(Ye.warn(`Setting attributes in the second argument of createEl()
256
+ has been deprecated. Use the third argument instead.
257
+ `+("createEl(type, properties, attributes). Attempting to set "+n+" to "+a+".")),r.setAttribute(n,a)):n==="textContent"?ea(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),i&&Eg(r,i),r}function ea(s,e){return typeof s.textContent>"u"?s.innerText=e:s.textContent=e,s}function Xp(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function Ws(s,e){return eC(e),s.classList?s.classList.contains(e):KO(e).test(s.className)}function bn(s,e){return s.classList?s.classList.add(e):Ws(s,e)||(s.className=(s.className+" "+e).trim()),s}function tu(s,e){return s?(s.classList?s.classList.remove(e):(eC(e),s.className=s.className.split(/\s+/).filter(function(t){return t!==e}).join(" ")),s):(Ye.warn("removeClass was called with an element that doesn't exist"),null)}function rC(s,e,t){var i=Ws(s,e);if(typeof t=="function"&&(t=t(s,e)),typeof t!="boolean"&&(t=!i),t!==i)return t?bn(s,e):tu(s,e),s}function nC(s,e){Object.getOwnPropertyNames(e).forEach(function(t){var i=e[t];i===null||typeof i>"u"||i===!1?s.removeAttribute(t):s.setAttribute(t,i===!0?"":i)})}function pn(s){var e={},t=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(s&&s.attributes&&s.attributes.length>0)for(var i=s.attributes,r=i.length-1;r>=0;r--){var n=i[r].name,a=i[r].value;(typeof s[n]=="boolean"||t.indexOf(","+n+",")!==-1)&&(a=a!==null),e[n]=a}return e}function sC(s,e){return s.getAttribute(e)}function mo(s,e,t){s.setAttribute(e,t)}function Wh(s,e){s.removeAttribute(e)}function aC(){le.body.focus(),le.onselectstart=function(){return!1}}function oC(){le.onselectstart=function(){return!0}}function go(s){if(s&&s.getBoundingClientRect&&s.parentNode){var e=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(function(i){e[i]!==void 0&&(t[i]=e[i])}),t.height||(t.height=parseFloat($l(s,"height"))),t.width||(t.width=parseFloat($l(s,"width"))),t}}function jl(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};for(var e=s.offsetWidth,t=s.offsetHeight,i=0,r=0;s.offsetParent&&s!==le[Kc.fullscreenElement];)i+=s.offsetLeft,r+=s.offsetTop,s=s.offsetParent;return{left:i,top:r,width:e,height:t}}function Gh(s,e){var t={x:0,y:0};if(Di)for(var i=s;i&&i.nodeName.toLowerCase()!=="html";){var r=$l(i,"transform");if(/^matrix/.test(r)){var n=r.slice(7,-1).split(/,\s/).map(Number);t.x+=n[4],t.y+=n[5]}else if(/^matrix3d/.test(r)){var a=r.slice(9,-1).split(/,\s/).map(Number);t.x+=a[12],t.y+=a[13]}i=i.parentNode}var o={},l=jl(e.target),u=jl(s),c=u.width,h=u.height,f=e.offsetY-(u.top-l.top),g=e.offsetX-(u.left-l.left);return e.changedTouches&&(g=e.changedTouches[0].pageX-u.left,f=e.changedTouches[0].pageY+u.top,Di&&(g-=t.x,f-=t.y)),o.y=1-Math.max(0,Math.min(1,f/h)),o.x=Math.max(0,Math.min(1,g/c)),o}function lC(s){return Cn(s)&&s.nodeType===3}function Cg(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function uC(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(function(e){if(typeof e=="function"&&(e=e()),Do(e)||lC(e))return e;if(typeof e=="string"&&/\S/.test(e))return le.createTextNode(e)}).filter(function(e){return e})}function Eg(s,e){return uC(e).forEach(function(t){return s.appendChild(t)}),s}function cC(s,e){return Eg(Cg(s),e)}function Vl(s){return s.button===void 0&&s.buttons===void 0||s.button===0&&s.buttons===void 0||s.type==="mouseup"&&s.button===0&&s.buttons===0?!0:!(s.button!==0||s.buttons!==1)}var is=iC("querySelector"),hC=iC("querySelectorAll"),dC=Object.freeze({__proto__:null,isReal:Po,isEl:Do,isInFrame:tC,createEl:it,textContent:ea,prependTo:Xp,hasClass:Ws,addClass:bn,removeClass:tu,toggleClass:rC,setAttributes:nC,getAttributes:pn,getAttribute:sC,setAttribute:mo,removeAttribute:Wh,blockTextSelection:aC,unblockTextSelection:oC,getBoundingClientRect:go,findPosition:jl,getPointerPosition:Gh,isTextNode:lC,emptyEl:Cg,normalizeContent:uC,appendContent:Eg,insertContent:cC,isSingleLeftClick:Vl,$:is,$$:hC}),fC=!1,Qp,XO=function(){if(Qp.options.autoSetup!==!1){var e=Array.prototype.slice.call(le.getElementsByTagName("video")),t=Array.prototype.slice.call(le.getElementsByTagName("audio")),i=Array.prototype.slice.call(le.getElementsByTagName("video-js")),r=e.concat(t,i);if(r&&r.length>0)for(var n=0,a=r.length;n<a;n++){var o=r[n];if(o&&o.getAttribute){if(o.player===void 0){var l=o.getAttribute("data-setup");l!==null&&Qp(o)}}else{Yp(1);break}}else fC||Yp(1)}};function Yp(s,e){Po()&&(e&&(Qp=e),D.setTimeout(XO,s))}function Jp(){fC=!0,D.removeEventListener("load",Jp)}Po()&&(le.readyState==="complete"?Jp():D.addEventListener("load",Jp));var pC=function(e){var t=le.createElement("style");return t.className=e,t},mC=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},QO=3,YO=QO;function xn(){return YO++}var gC;D.WeakMap||(gC=(function(){function s(){this.vdata="vdata"+Math.floor(D.performance&&D.performance.now()||Date.now()),this.data={}}var e=s.prototype;return e.set=function(i,r){var n=i[this.vdata]||xn();return i[this.vdata]||(i[this.vdata]=n),this.data[n]=r,this},e.get=function(i){var r=i[this.vdata];if(r)return this.data[r];Ye("We have no data for this element",i)},e.has=function(i){var r=i[this.vdata];return r in this.data},e.delete=function(i){var r=i[this.vdata];r&&(delete this.data[r],delete i[this.vdata])},s})());var Ai=D.WeakMap?new WeakMap:new gC;function D_(s,e){if(Ai.has(s)){var t=Ai.get(s);t.handlers[e].length===0&&(delete t.handlers[e],s.removeEventListener?s.removeEventListener(e,t.dispatcher,!1):s.detachEvent&&s.detachEvent("on"+e,t.dispatcher)),Object.getOwnPropertyNames(t.handlers).length<=0&&(delete t.handlers,delete t.dispatcher,delete t.disabled),Object.getOwnPropertyNames(t).length===0&&Ai.delete(s)}}function wg(s,e,t,i){t.forEach(function(r){s(e,r,i)})}function Kh(s){if(s.fixed_)return s;function e(){return!0}function t(){return!1}if(!s||!s.isPropagationStopped||!s.isImmediatePropagationStopped){var i=s||D.event;s={};for(var r in i)r!=="layerX"&&r!=="layerY"&&r!=="keyLocation"&&r!=="webkitMovementX"&&r!=="webkitMovementY"&&r!=="path"&&(r==="returnValue"&&i.preventDefault||(s[r]=i[r]));if(s.target||(s.target=s.srcElement||le),s.relatedTarget||(s.relatedTarget=s.fromElement===s.target?s.toElement:s.fromElement),s.preventDefault=function(){i.preventDefault&&i.preventDefault(),s.returnValue=!1,i.returnValue=!1,s.defaultPrevented=!0},s.defaultPrevented=!1,s.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),s.cancelBubble=!0,i.cancelBubble=!0,s.isPropagationStopped=e},s.isPropagationStopped=t,s.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),s.isImmediatePropagationStopped=e,s.stopPropagation()},s.isImmediatePropagationStopped=t,s.clientX!==null&&s.clientX!==void 0){var n=le.documentElement,a=le.body;s.pageX=s.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0),s.pageY=s.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}s.which=s.charCode||s.keyCode,s.button!==null&&s.button!==void 0&&(s.button=s.button&1?0:s.button&4?1:s.button&2?2:0)}return s.fixed_=!0,s}var Yu,JO=function(){if(typeof Yu!="boolean"){Yu=!1;try{var e=Object.defineProperty({},"passive",{get:function(){Yu=!0}});D.addEventListener("test",null,e),D.removeEventListener("test",null,e)}catch{}}return Yu},ZO=["touchstart","touchmove"];function tr(s,e,t){if(Array.isArray(e))return wg(tr,s,e,t);Ai.has(s)||Ai.set(s,{});var i=Ai.get(s);if(i.handlers||(i.handlers={}),i.handlers[e]||(i.handlers[e]=[]),t.guid||(t.guid=xn()),i.handlers[e].push(t),i.dispatcher||(i.disabled=!1,i.dispatcher=function(n,a){if(!i.disabled){n=Kh(n);var o=i.handlers[n.type];if(o)for(var l=o.slice(0),u=0,c=l.length;u<c&&!n.isImmediatePropagationStopped();u++)try{l[u].call(s,n,a)}catch(h){Ye.error(h)}}}),i.handlers[e].length===1)if(s.addEventListener){var r=!1;JO()&&ZO.indexOf(e)>-1&&(r={passive:!0}),s.addEventListener(e,i.dispatcher,r)}else s.attachEvent&&s.attachEvent("on"+e,i.dispatcher)}function vi(s,e,t){if(Ai.has(s)){var i=Ai.get(s);if(i.handlers){if(Array.isArray(e))return wg(vi,s,e,t);var r=function(u,c){i.handlers[c]=[],D_(u,c)};if(e===void 0){for(var n in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},n)&&r(s,n);return}var a=i.handlers[e];if(a){if(!t){r(s,e);return}if(t.guid)for(var o=0;o<a.length;o++)a[o].guid===t.guid&&a.splice(o--,1);D_(s,e)}}}}function No(s,e,t){var i=Ai.has(s)?Ai.get(s):{},r=s.parentNode||s.ownerDocument;if(typeof e=="string"?e={type:e,target:s}:e.target||(e.target=s),e=Kh(e),i.dispatcher&&i.dispatcher.call(s,e,t),r&&!e.isPropagationStopped()&&e.bubbles===!0)No.call(null,r,e,t);else if(!r&&!e.defaultPrevented&&e.target&&e.target[e.type]){Ai.has(e.target)||Ai.set(e.target,{});var n=Ai.get(e.target);e.target[e.type]&&(n.disabled=!0,typeof e.target[e.type]=="function"&&e.target[e.type](),n.disabled=!1)}return!e.defaultPrevented}function Xh(s,e,t){if(Array.isArray(e))return wg(Xh,s,e,t);var i=function r(){vi(s,e,r),t.apply(this,arguments)};i.guid=t.guid=t.guid||xn(),tr(s,e,i)}function vC(s,e,t){var i=function r(){vi(s,e,r),t.apply(this,arguments)};i.guid=t.guid=t.guid||xn(),tr(s,e,i)}var eM=Object.freeze({__proto__:null,fixEvent:Kh,on:tr,off:vi,trigger:No,one:Xh,any:vC}),Ar=30,xt=function(e,t,i){t.guid||(t.guid=xn());var r=t.bind(e);return r.guid=i?i+"_"+t.guid:t.guid,r},En=function(e,t){var i=D.performance.now(),r=function(){var a=D.performance.now();a-i>=t&&(e.apply(void 0,arguments),i=a)};return r},tM=function(e,t,i,r){r===void 0&&(r=D);var n,a=function(){r.clearTimeout(n),n=null},o=function(){var u=this,c=arguments,h=function(){n=null,h=null,e.apply(u,c)};r.clearTimeout(n),n=r.setTimeout(h,t)};return o.cancel=a,o},si=function(){};si.prototype.allowedEvents_={};si.prototype.on=function(s,e){var t=this.addEventListener;this.addEventListener=function(){},tr(this,s,e),this.addEventListener=t};si.prototype.addEventListener=si.prototype.on;si.prototype.off=function(s,e){vi(this,s,e)};si.prototype.removeEventListener=si.prototype.off;si.prototype.one=function(s,e){var t=this.addEventListener;this.addEventListener=function(){},Xh(this,s,e),this.addEventListener=t};si.prototype.any=function(s,e){var t=this.addEventListener;this.addEventListener=function(){},vC(this,s,e),this.addEventListener=t};si.prototype.trigger=function(s){var e=s.type||s;typeof s=="string"&&(s={type:e}),s=Kh(s),this.allowedEvents_[e]&&this["on"+e]&&this["on"+e](s),No(this,s)};si.prototype.dispatchEvent=si.prototype.trigger;var nl;si.prototype.queueTrigger=function(s){var e=this;nl||(nl=new Map);var t=s.type||s,i=nl.get(this);i||(i=new Map,nl.set(this,i));var r=i.get(t);i.delete(t),D.clearTimeout(r);var n=D.setTimeout(function(){i.delete(t),i.size===0&&(i=null,nl.delete(e)),e.trigger(s)},0);i.set(t,n)};var Qh=function(e){return typeof e.name=="function"?e.name():typeof e.name=="string"?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e},Sn=function(e){return e instanceof si||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return typeof e[t]=="function"})},iM=function(e,t){Sn(e)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))},Zp=function(e){return typeof e=="string"&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Xc=function(e,t,i){if(!e||!e.nodeName&&!Sn(e))throw new Error("Invalid target for "+Qh(t)+"#"+i+"; must be a DOM node or evented object.")},yC=function(e,t,i){if(!Zp(e))throw new Error("Invalid event type for "+Qh(t)+"#"+i+"; must be a non-empty string or array.")},_C=function(e,t,i){if(typeof e!="function")throw new Error("Invalid listener for "+Qh(t)+"#"+i+"; must be a function.")},Nf=function(e,t,i){var r=t.length<3||t[0]===e||t[0]===e.eventBusEl_,n,a,o;return r?(n=e.eventBusEl_,t.length>=3&&t.shift(),a=t[0],o=t[1]):(n=t[0],a=t[1],o=t[2]),Xc(n,e,i),yC(a,e,i),_C(o,e,i),o=xt(e,o),{isTargetingSelf:r,target:n,type:a,listener:o}},ks=function(e,t,i,r){Xc(e,e,t),e.nodeName?eM[t](e,i,r):e[t](i,r)},rM={on:function(){for(var e=this,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var n=Nf(this,i,"on"),a=n.isTargetingSelf,o=n.target,l=n.type,u=n.listener;if(ks(o,"on",l,u),!a){var c=function(){return e.off(o,l,u)};c.guid=u.guid;var h=function(){return e.off("dispose",c)};h.guid=u.guid,ks(this,"on","dispose",c),ks(o,"on","dispose",h)}},one:function(){for(var e=this,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var n=Nf(this,i,"one"),a=n.isTargetingSelf,o=n.target,l=n.type,u=n.listener;if(a)ks(o,"one",l,u);else{var c=function h(){e.off(o,l,h);for(var f=arguments.length,g=new Array(f),C=0;C<f;C++)g[C]=arguments[C];u.apply(null,g)};c.guid=u.guid,ks(o,"one",l,c)}},any:function(){for(var e=this,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var n=Nf(this,i,"any"),a=n.isTargetingSelf,o=n.target,l=n.type,u=n.listener;if(a)ks(o,"any",l,u);else{var c=function h(){e.off(o,l,h);for(var f=arguments.length,g=new Array(f),C=0;C<f;C++)g[C]=arguments[C];u.apply(null,g)};c.guid=u.guid,ks(o,"any",l,c)}},off:function(e,t,i){if(!e||Zp(e))vi(this.eventBusEl_,e,t);else{var r=e,n=t;Xc(r,this,"off"),yC(n,this,"off"),_C(i,this,"off"),i=xt(this,i),this.off("dispose",i),r.nodeName?(vi(r,n,i),vi(r,"dispose",i)):Sn(r)&&(r.off(n,i),r.off("dispose",i))}},trigger:function(e,t){Xc(this.eventBusEl_,this,"trigger");var i=e&&typeof e!="string"?e.type:e;if(!Zp(i)){var r="Invalid event type for "+Qh(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(e)(this.log||Ye).error(r);else throw new Error(r)}return No(this.eventBusEl_,e,t)}};function kg(s,e){e===void 0&&(e={});var t=e,i=t.eventBusKey;if(i){if(!s[i].nodeName)throw new Error('The eventBusKey "'+i+'" does not refer to an element.');s.eventBusEl_=s[i]}else s.eventBusEl_=it("span",{className:"vjs-event-bus"});return Vt(s,rM),s.eventedCallbacks&&s.eventedCallbacks.forEach(function(r){r()}),s.on("dispose",function(){s.off(),[s,s.el_,s.eventBusEl_].forEach(function(r){r&&Ai.has(r)&&Ai.delete(r)}),D.setTimeout(function(){s.eventBusEl_=null},0)}),s}var nM={state:{},setState:function(e){var t=this;typeof e=="function"&&(e=e());var i;return Qa(e,function(r,n){t.state[n]!==r&&(i=i||{},i[n]={from:t.state[n],to:r}),t.state[n]=r}),i&&Sn(this)&&this.trigger({changes:i,type:"statechanged"}),i}};function TC(s,e){return Vt(s,nM),s.state=Vt({},s.state,e),typeof s.handleStateChanged=="function"&&Sn(s)&&s.on("statechanged",s.handleStateChanged),s}var yc=function(e){return typeof e!="string"?e:e.replace(/./,function(t){return t.toLowerCase()})},Wt=function(e){return typeof e!="string"?e:e.replace(/./,function(t){return t.toUpperCase()})},sM=function(e,t){return Wt(e)===Wt(t)};function kt(){for(var s={},e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return t.forEach(function(r){r&&Qa(r,function(n,a){if(!Ul(n)){s[a]=n;return}Ul(s[a])||(s[a]={}),s[a]=kt(s[a],n)})}),s}var aM=(function(){function s(){this.map_={}}var e=s.prototype;return e.has=function(i){return i in this.map_},e.delete=function(i){var r=this.has(i);return delete this.map_[i],r},e.set=function(i,r){return this.map_[i]=r,this},e.forEach=function(i,r){for(var n in this.map_)i.call(r,this.map_[n],n,this)},s})(),oM=D.Map?D.Map:aM,lM=(function(){function s(){this.set_={}}var e=s.prototype;return e.has=function(i){return i in this.set_},e.delete=function(i){var r=this.has(i);return delete this.set_[i],r},e.add=function(i){return this.set_[i]=1,this},e.forEach=function(i,r){for(var n in this.set_)i.call(r,n,n,this)},s})(),Lf=D.Set?D.Set:lM,be=(function(){function s(t,i,r){var n=this;if(!t&&this.play?this.player_=t=this:this.player_=t,this.isDisposed_=!1,this.parentComponent_=null,this.options_=kt({},this.options_),i=this.options_=kt(this.options_,i),this.id_=i.id||i.el&&i.el.id,!this.id_){var a=t&&t.id&&t.id()||"no_player";this.id_=a+"_component_"+xn()}this.name_=i.name||null,i.el?this.el_=i.el:i.createEl!==!1&&(this.el_=this.createEl()),i.className&&this.el_&&i.className.split(" ").forEach(function(o){return n.addClass(o)}),i.evented!==!1&&(kg(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),TC(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Lf,this.setIntervalIds_=new Lf,this.rafIds_=new Lf,this.namedRafs_=new oM,this.clearingTimersOnDispose_=!1,i.initChildren!==!1&&this.initChildren(),this.ready(r),i.reportTouchActivity!==!1&&this.enableTouchActivity()}var e=s.prototype;return e.dispose=function(i){if(i===void 0&&(i={}),!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var r=this.children_.length-1;r>=0;r--)this.children_[r].dispose&&this.children_[r].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(i.restoreEl?this.el_.parentNode.replaceChild(i.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},e.isDisposed=function(){return!!this.isDisposed_},e.player=function(){return this.player_},e.options=function(i){return i?(this.options_=kt(this.options_,i),this.options_):this.options_},e.el=function(){return this.el_},e.createEl=function(i,r,n){return it(i,r,n)},e.localize=function(i,r,n){n===void 0&&(n=i);var a=this.player_.language&&this.player_.language(),o=this.player_.languages&&this.player_.languages(),l=o&&o[a],u=a&&a.split("-")[0],c=o&&o[u],h=n;return l&&l[i]?h=l[i]:c&&c[i]&&(h=c[i]),r&&(h=h.replace(/\{(\d+)\}/g,function(f,g){var C=r[g-1],p=C;return typeof C>"u"&&(p=f),p})),h},e.handleLanguagechange=function(){},e.contentEl=function(){return this.contentEl_||this.el_},e.id=function(){return this.id_},e.name=function(){return this.name_},e.children=function(){return this.children_},e.getChildById=function(i){return this.childIndex_[i]},e.getChild=function(i){if(i)return this.childNameIndex_[i]},e.getDescendant=function(){for(var i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];r=r.reduce(function(l,u){return l.concat(u)},[]);for(var a=this,o=0;o<r.length;o++)if(a=a.getChild(r[o]),!a||!a.getChild)return;return a},e.addChild=function(i,r,n){r===void 0&&(r={}),n===void 0&&(n=this.children_.length);var a,o;if(typeof i=="string"){o=Wt(i);var l=r.componentClass||o;r.name=o;var u=s.getComponent(l);if(!u)throw new Error("Component "+l+" does not exist");if(typeof u!="function")return null;a=new u(this.player_||this,r)}else a=i;if(a.parentComponent_&&a.parentComponent_.removeChild(a),this.children_.splice(n,0,a),a.parentComponent_=this,typeof a.id=="function"&&(this.childIndex_[a.id()]=a),o=o||a.name&&Wt(a.name()),o&&(this.childNameIndex_[o]=a,this.childNameIndex_[yc(o)]=a),typeof a.el=="function"&&a.el()){var c=null;this.children_[n+1]&&(this.children_[n+1].el_?c=this.children_[n+1].el_:Do(this.children_[n+1])&&(c=this.children_[n+1])),this.contentEl().insertBefore(a.el(),c)}return a},e.removeChild=function(i){if(typeof i=="string"&&(i=this.getChild(i)),!(!i||!this.children_)){for(var r=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===i){r=!0,this.children_.splice(n,1);break}if(r){i.parentComponent_=null,this.childIndex_[i.id()]=null,this.childNameIndex_[Wt(i.name())]=null,this.childNameIndex_[yc(i.name())]=null;var a=i.el();a&&a.parentNode===this.contentEl()&&this.contentEl().removeChild(i.el())}}},e.initChildren=function(){var i=this,r=this.options_.children;if(r){var n=this.options_,a=function(c){var h=c.name,f=c.opts;if(n[h]!==void 0&&(f=n[h]),f!==!1){f===!0&&(f={}),f.playerOptions=i.options_.playerOptions;var g=i.addChild(h,f);g&&(i[h]=g)}},o,l=s.getComponent("Tech");Array.isArray(r)?o=r:o=Object.keys(r),o.concat(Object.keys(this.options_).filter(function(u){return!o.some(function(c){return typeof c=="string"?u===c:u===c.name})})).map(function(u){var c,h;return typeof u=="string"?(c=u,h=r[c]||i.options_[c]||{}):(c=u.name,h=u),{name:c,opts:h}}).filter(function(u){var c=s.getComponent(u.opts.componentClass||Wt(u.name));return c&&!l.isTech(c)}).forEach(a)}},e.buildCSSClass=function(){return""},e.ready=function(i,r){if(r===void 0&&(r=!1),!!i){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(i);return}r?i.call(this):this.setTimeout(i,1)}},e.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var i=this.readyQueue_;this.readyQueue_=[],i&&i.length>0&&i.forEach(function(r){r.call(this)},this),this.trigger("ready")},1)},e.$=function(i,r){return is(i,r||this.contentEl())},e.$$=function(i,r){return hC(i,r||this.contentEl())},e.hasClass=function(i){return Ws(this.el_,i)},e.addClass=function(i){bn(this.el_,i)},e.removeClass=function(i){tu(this.el_,i)},e.toggleClass=function(i,r){rC(this.el_,i,r)},e.show=function(){this.removeClass("vjs-hidden")},e.hide=function(){this.addClass("vjs-hidden")},e.lockShowing=function(){this.addClass("vjs-lock-showing")},e.unlockShowing=function(){this.removeClass("vjs-lock-showing")},e.getAttribute=function(i){return sC(this.el_,i)},e.setAttribute=function(i,r){mo(this.el_,i,r)},e.removeAttribute=function(i){Wh(this.el_,i)},e.width=function(i,r){return this.dimension("width",i,r)},e.height=function(i,r){return this.dimension("height",i,r)},e.dimensions=function(i,r){this.width(i,!0),this.height(r)},e.dimension=function(i,r,n){if(r!==void 0){(r===null||r!==r)&&(r=0),(""+r).indexOf("%")!==-1||(""+r).indexOf("px")!==-1?this.el_.style[i]=r:r==="auto"?this.el_.style[i]="":this.el_.style[i]=r+"px",n||this.trigger("componentresize");return}if(!this.el_)return 0;var a=this.el_.style[i],o=a.indexOf("px");return parseInt(o!==-1?a.slice(0,o):this.el_["offset"+Wt(i)],10)},e.currentDimension=function(i){var r=0;if(i!=="width"&&i!=="height")throw new Error("currentDimension only accepts width or height value");if(r=$l(this.el_,i),r=parseFloat(r),r===0||isNaN(r)){var n="offset"+Wt(i);r=this.el_[n]}return r},e.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},e.currentWidth=function(){return this.currentDimension("width")},e.currentHeight=function(){return this.currentDimension("height")},e.focus=function(){this.el_.focus()},e.blur=function(){this.el_.blur()},e.handleKeyDown=function(i){this.player_&&(Ge.isEventKey(i,"Tab")||i.stopPropagation(),this.player_.handleKeyDown(i))},e.handleKeyPress=function(i){this.handleKeyDown(i)},e.emitTapEvents=function(){var i=0,r=null,n=10,a=200,o;this.on("touchstart",function(u){u.touches.length===1&&(r={pageX:u.touches[0].pageX,pageY:u.touches[0].pageY},i=D.performance.now(),o=!0)}),this.on("touchmove",function(u){if(u.touches.length>1)o=!1;else if(r){var c=u.touches[0].pageX-r.pageX,h=u.touches[0].pageY-r.pageY,f=Math.sqrt(c*c+h*h);f>n&&(o=!1)}});var l=function(){o=!1};this.on("touchleave",l),this.on("touchcancel",l),this.on("touchend",function(u){if(r=null,o===!0){var c=D.performance.now()-i;c<a&&(u.preventDefault(),this.trigger("tap"))}})},e.enableTouchActivity=function(){if(!(!this.player()||!this.player().reportUserActivity)){var i=xt(this.player(),this.player().reportUserActivity),r;this.on("touchstart",function(){i(),this.clearInterval(r),r=this.setInterval(i,250)});var n=function(o){i(),this.clearInterval(r)};this.on("touchmove",i),this.on("touchend",n),this.on("touchcancel",n)}},e.setTimeout=function(i,r){var n=this,a;return i=xt(this,i),this.clearTimersOnDispose_(),a=D.setTimeout(function(){n.setTimeoutIds_.has(a)&&n.setTimeoutIds_.delete(a),i()},r),this.setTimeoutIds_.add(a),a},e.clearTimeout=function(i){return this.setTimeoutIds_.has(i)&&(this.setTimeoutIds_.delete(i),D.clearTimeout(i)),i},e.setInterval=function(i,r){i=xt(this,i),this.clearTimersOnDispose_();var n=D.setInterval(i,r);return this.setIntervalIds_.add(n),n},e.clearInterval=function(i){return this.setIntervalIds_.has(i)&&(this.setIntervalIds_.delete(i),D.clearInterval(i)),i},e.requestAnimationFrame=function(i){var r=this;if(!this.supportsRaf_)return this.setTimeout(i,1e3/60);this.clearTimersOnDispose_();var n;return i=xt(this,i),n=D.requestAnimationFrame(function(){r.rafIds_.has(n)&&r.rafIds_.delete(n),i()}),this.rafIds_.add(n),n},e.requestNamedAnimationFrame=function(i,r){var n=this;if(!this.namedRafs_.has(i)){this.clearTimersOnDispose_(),r=xt(this,r);var a=this.requestAnimationFrame(function(){r(),n.namedRafs_.has(i)&&n.namedRafs_.delete(i)});return this.namedRafs_.set(i,a),i}},e.cancelNamedAnimationFrame=function(i){this.namedRafs_.has(i)&&(this.cancelAnimationFrame(this.namedRafs_.get(i)),this.namedRafs_.delete(i))},e.cancelAnimationFrame=function(i){return this.supportsRaf_?(this.rafIds_.has(i)&&(this.rafIds_.delete(i),D.cancelAnimationFrame(i)),i):this.clearTimeout(i)},e.clearTimersOnDispose_=function(){var i=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(r){var n=r[0],a=r[1];i[n].forEach(function(o,l){return i[a](l)})}),i.clearingTimersOnDispose_=!1}))},s.registerComponent=function(i,r){if(typeof i!="string"||!i)throw new Error('Illegal component name, "'+i+'"; must be a non-empty string.');var n=s.getComponent("Tech"),a=n&&n.isTech(r),o=s===r||s.prototype.isPrototypeOf(r.prototype);if(a||!o){var l;throw a?l="techs must be registered using Tech.registerTech()":l="must be a Component subclass",new Error('Illegal component, "'+i+'"; '+l+".")}i=Wt(i),s.components_||(s.components_={});var u=s.getComponent("Player");if(i==="Player"&&u&&u.players){var c=u.players,h=Object.keys(c);if(c&&h.length>0&&h.map(function(f){return c[f]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return s.components_[i]=r,s.components_[yc(i)]=r,r},s.getComponent=function(i){if(!(!i||!s.components_))return s.components_[i]},s})();be.prototype.supportsRaf_=typeof D.requestAnimationFrame=="function"&&typeof D.cancelAnimationFrame=="function";be.registerComponent("Component",be);function uM(s,e,t){if(typeof e!="number"||e<0||e>t)throw new Error("Failed to execute '"+s+"' on 'TimeRanges': The index provided ("+e+") is non-numeric or out of bounds (0-"+t+").")}function N_(s,e,t,i){return uM(s,i,t.length-1),t[i][e]}function Of(s){var e;return s===void 0||s.length===0?e={length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:e={length:s.length,start:N_.bind(null,"start",0,s),end:N_.bind(null,"end",1,s)},D.Symbol&&D.Symbol.iterator&&(e[D.Symbol.iterator]=function(){return(s||[]).values()}),e}function Gs(s,e){return Array.isArray(s)?Of(s):s===void 0||e===void 0?Of():Of([[s,e]])}function bC(s,e){var t=0,i,r;if(!e)return 0;(!s||!s.length)&&(s=Gs(0,0));for(var n=0;n<s.length;n++)i=s.start(n),r=s.end(n),r>e&&(r=e),t+=r-i;return t/e}function Ii(s){if(s instanceof Ii)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:Cn(s)&&(typeof s.code=="number"&&(this.code=s.code),Vt(this,s)),this.message||(this.message=Ii.defaultMessages[this.code]||"")}Ii.prototype.code=0;Ii.prototype.message="";Ii.prototype.status=null;Ii.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Ii.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 Ia=0;Ia<Ii.errorTypes.length;Ia++)Ii[Ii.errorTypes[Ia]]=Ia,Ii.prototype[Ii.errorTypes[Ia]]=Ia;function xl(s){return s!=null&&typeof s.then=="function"}function Wr(s){xl(s)&&s.then(null,function(e){})}var em=function(e){var t=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(i,r,n){return e[r]&&(i[r]=e[r]),i},{cues:e.cues&&Array.prototype.map.call(e.cues,function(i){return{startTime:i.startTime,endTime:i.endTime,text:i.text,id:i.id}})});return t},cM=function(e){var t=e.$$("track"),i=Array.prototype.map.call(t,function(n){return n.track}),r=Array.prototype.map.call(t,function(n){var a=em(n.track);return n.src&&(a.src=n.src),a});return r.concat(Array.prototype.filter.call(e.textTracks(),function(n){return i.indexOf(n)===-1}).map(em))},hM=function(e,t){return e.forEach(function(i){var r=t.addRemoteTextTrack(i).track;!i.src&&i.cues&&i.cues.forEach(function(n){return r.addCue(n)})}),t.textTracks()},L_={textTracksToJson:cM,jsonToTextTracks:hM,trackToJson_:em},Mf="vjs-modal-dialog",Lo=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.handleKeyDown_=function(a){return n.handleKeyDown(a)},n.close_=function(a){return n.close(a)},n.opened_=n.hasBeenOpened_=n.hasBeenFilled_=!1,n.closeable(!n.options_.uncloseable),n.content(n.options_.content),n.contentEl_=it("div",{className:Mf+"-content"},{role:"document"}),n.descEl_=it("p",{className:Mf+"-description vjs-control-text",id:n.el().getAttribute("aria-describedby")}),ea(n.descEl_,n.description()),n.el_.appendChild(n.descEl_),n.el_.appendChild(n.contentEl_),n}var t=e.prototype;return t.createEl=function(){return s.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.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,s.prototype.dispose.call(this)},t.buildCSSClass=function(){return Mf+" vjs-hidden "+s.prototype.buildCSSClass.call(this)},t.label=function(){return this.localize(this.options_.label||"Modal Window")},t.description=function(){var r=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(r+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),r},t.open=function(){if(!this.opened_){var r=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!r.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&r.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=r.controls(),r.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},t.opened=function(r){return typeof r=="boolean"&&this[r?"open":"close"](),this.opened_},t.close=function(){if(this.opened_){var r=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&r.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&r.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},t.closeable=function(r){if(typeof r=="boolean"){var n=this.closeable_=!!r,a=this.getChild("closeButton");if(n&&!a){var o=this.contentEl_;this.contentEl_=this.el_,a=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=o,this.on(a,"close",this.close_)}!n&&a&&(this.off(a,"close",this.close_),this.removeChild(a),a.dispose())}return this.closeable_},t.fill=function(){this.fillWith(this.content())},t.fillWith=function(r){var n=this.contentEl(),a=n.parentNode,o=n.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,a.removeChild(n),this.empty(),cC(n,r),this.trigger("modalfill"),o?a.insertBefore(n,o):a.appendChild(n);var l=this.getChild("closeButton");l&&a.appendChild(l.el_)},t.empty=function(){this.trigger("beforemodalempty"),Cg(this.contentEl()),this.trigger("modalempty")},t.content=function(r){return typeof r<"u"&&(this.content_=r),this.content_},t.conditionalFocus_=function(){var r=le.activeElement,n=this.player_.el_;this.previouslyActiveEl_=null,(n.contains(r)||n===r)&&(this.previouslyActiveEl_=r,this.focus())},t.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},t.handleKeyDown=function(r){if(r.stopPropagation(),Ge.isEventKey(r,"Escape")&&this.closeable()){r.preventDefault(),this.close();return}if(Ge.isEventKey(r,"Tab")){for(var n=this.focusableEls_(),a=this.el_.querySelector(":focus"),o,l=0;l<n.length;l++)if(a===n[l]){o=l;break}le.activeElement===this.el_&&(o=0),r.shiftKey&&o===0?(n[n.length-1].focus(),r.preventDefault()):!r.shiftKey&&o===n.length-1&&(n[0].focus(),r.preventDefault())}},t.focusableEls_=function(){var r=this.el_.querySelectorAll("*");return Array.prototype.filter.call(r,function(n){return(n instanceof D.HTMLAnchorElement||n instanceof D.HTMLAreaElement)&&n.hasAttribute("href")||(n instanceof D.HTMLInputElement||n instanceof D.HTMLSelectElement||n instanceof D.HTMLTextAreaElement||n instanceof D.HTMLButtonElement)&&!n.hasAttribute("disabled")||n instanceof D.HTMLIFrameElement||n instanceof D.HTMLObjectElement||n instanceof D.HTMLEmbedElement||n.hasAttribute("tabindex")&&n.getAttribute("tabindex")!==-1||n.hasAttribute("contenteditable")})},e})(be);Lo.prototype.options_={pauseOnOpen:!0,temporary:!0};be.registerComponent("ModalDialog",Lo);var vo=(function(s){we(e,s);function e(i){var r;i===void 0&&(i=[]),r=s.call(this)||this,r.tracks_=[],Object.defineProperty(We(r),"length",{get:function(){return this.tracks_.length}});for(var n=0;n<i.length;n++)r.addTrack(i[n]);return r}var t=e.prototype;return t.addTrack=function(r){var n=this,a=this.tracks_.length;""+a in this||Object.defineProperty(this,a,{get:function(){return this.tracks_[a]}}),this.tracks_.indexOf(r)===-1&&(this.tracks_.push(r),this.trigger({track:r,type:"addtrack",target:this})),r.labelchange_=function(){n.trigger({track:r,type:"labelchange",target:n})},Sn(r)&&r.addEventListener("labelchange",r.labelchange_)},t.removeTrack=function(r){for(var n,a=0,o=this.length;a<o;a++)if(this[a]===r){n=this[a],n.off&&n.off(),this.tracks_.splice(a,1);break}n&&this.trigger({track:n,type:"removetrack",target:this})},t.getTrackById=function(r){for(var n=null,a=0,o=this.length;a<o;a++){var l=this[a];if(l.id===r){n=l;break}}return n},e})(si);vo.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(var dM in vo.prototype.allowedEvents_)vo.prototype["on"+dM]=null;var Rf=function(e,t){for(var i=0;i<e.length;i++)!Object.keys(e[i]).length||t.id===e[i].id||(e[i].enabled=!1)},fM=(function(s){we(e,s);function e(i){var r;i===void 0&&(i=[]);for(var n=i.length-1;n>=0;n--)if(i[n].enabled){Rf(i,i[n]);break}return r=s.call(this,i)||this,r.changing_=!1,r}var t=e.prototype;return t.addTrack=function(r){var n=this;r.enabled&&Rf(this,r),s.prototype.addTrack.call(this,r),r.addEventListener&&(r.enabledChange_=function(){n.changing_||(n.changing_=!0,Rf(n,r),n.changing_=!1,n.trigger("change"))},r.addEventListener("enabledchange",r.enabledChange_))},t.removeTrack=function(r){s.prototype.removeTrack.call(this,r),r.removeEventListener&&r.enabledChange_&&(r.removeEventListener("enabledchange",r.enabledChange_),r.enabledChange_=null)},e})(vo),Bf=function(e,t){for(var i=0;i<e.length;i++)!Object.keys(e[i]).length||t.id===e[i].id||(e[i].selected=!1)},pM=(function(s){we(e,s);function e(i){var r;i===void 0&&(i=[]);for(var n=i.length-1;n>=0;n--)if(i[n].selected){Bf(i,i[n]);break}return r=s.call(this,i)||this,r.changing_=!1,Object.defineProperty(We(r),"selectedIndex",{get:function(){for(var o=0;o<this.length;o++)if(this[o].selected)return o;return-1},set:function(){}}),r}var t=e.prototype;return t.addTrack=function(r){var n=this;r.selected&&Bf(this,r),s.prototype.addTrack.call(this,r),r.addEventListener&&(r.selectedChange_=function(){n.changing_||(n.changing_=!0,Bf(n,r),n.changing_=!1,n.trigger("change"))},r.addEventListener("selectedchange",r.selectedChange_))},t.removeTrack=function(r){s.prototype.removeTrack.call(this,r),r.removeEventListener&&r.selectedChange_&&(r.removeEventListener("selectedchange",r.selectedChange_),r.selectedChange_=null)},e})(vo),SC=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.addTrack=function(r){var n=this;s.prototype.addTrack.call(this,r),this.queueChange_||(this.queueChange_=function(){return n.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return n.trigger("selectedlanguagechange")}),r.addEventListener("modechange",this.queueChange_);var a=["metadata","chapters"];a.indexOf(r.kind)===-1&&r.addEventListener("modechange",this.triggerSelectedlanguagechange_)},t.removeTrack=function(r){s.prototype.removeTrack.call(this,r),r.removeEventListener&&(this.queueChange_&&r.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&r.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},e})(vo),mM=(function(){function s(t){t===void 0&&(t=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var i=0,r=t.length;i<r;i++)this.addTrackElement_(t[i])}var e=s.prototype;return e.addTrackElement_=function(i){var r=this.trackElements_.length;""+r in this||Object.defineProperty(this,r,{get:function(){return this.trackElements_[r]}}),this.trackElements_.indexOf(i)===-1&&this.trackElements_.push(i)},e.getTrackElementByTrack_=function(i){for(var r,n=0,a=this.trackElements_.length;n<a;n++)if(i===this.trackElements_[n].track){r=this.trackElements_[n];break}return r},e.removeTrackElement_=function(i){for(var r=0,n=this.trackElements_.length;r<n;r++)if(i===this.trackElements_[r]){this.trackElements_[r].track&&typeof this.trackElements_[r].track.off=="function"&&this.trackElements_[r].track.off(),typeof this.trackElements_[r].off=="function"&&this.trackElements_[r].off(),this.trackElements_.splice(r,1);break}},s})(),O_=(function(){function s(t){s.prototype.setCues_.call(this,t),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var e=s.prototype;return e.setCues_=function(i){var r=this.length||0,n=0,a=i.length;this.cues_=i,this.length_=i.length;var o=function(u){""+u in this||Object.defineProperty(this,""+u,{get:function(){return this.cues_[u]}})};if(r<a)for(n=r;n<a;n++)o.call(this,n)},e.getCueById=function(i){for(var r=null,n=0,a=this.length;n<a;n++){var o=this[n];if(o.id===i){r=o;break}}return r},s})(),gM={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},vM={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},yM={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},M_={disabled:"disabled",hidden:"hidden",showing:"showing"},xg=(function(s){we(e,s);function e(t){var i;t===void 0&&(t={}),i=s.call(this)||this;var r={id:t.id||"vjs_track_"+xn(),kind:t.kind||"",language:t.language||""},n=t.label||"",a=function(u){Object.defineProperty(We(i),u,{get:function(){return r[u]},set:function(){}})};for(var o in r)a(o);return Object.defineProperty(We(i),"label",{get:function(){return n},set:function(u){u!==n&&(n=u,this.trigger("labelchange"))}}),i}return e})(si),Ag=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=le.createElement("a");i.href=e;for(var r={},n=0;n<t.length;n++)r[t[n]]=i[t[n]];return r.protocol==="http:"&&(r.host=r.host.replace(/:80$/,"")),r.protocol==="https:"&&(r.host=r.host.replace(/:443$/,"")),r.protocol||(r.protocol=D.location.protocol),r.host||(r.host=D.location.host),r},CC=function(e){if(!e.match(/^https?:\/\//)){var t=le.createElement("a");t.href=e,e=t.href}return e},Ig=function(e){if(typeof e=="string"){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/,i=t.exec(e);if(i)return i.pop().toLowerCase()}return""},Yh=function(e,t){t===void 0&&(t=D.location);var i=Ag(e),r=i.protocol===":"?t.protocol:i.protocol,n=r+i.host!==t.protocol+t.host;return n},_M=Object.freeze({__proto__:null,parseUrl:Ag,getAbsoluteURL:CC,getFileExtension:Ig,isCrossOrigin:Yh}),R_=function(e,t){var i=new D.WebVTT.Parser(D,D.vttjs,D.WebVTT.StringDecoder()),r=[];i.oncue=function(n){t.addCue(n)},i.onparsingerror=function(n){r.push(n)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),r.length>0&&(D.console&&D.console.groupCollapsed&&D.console.groupCollapsed("Text Track parsing errors for "+t.src),r.forEach(function(n){return Ye.error(n)}),D.console&&D.console.groupEnd&&D.console.groupEnd()),i.flush()},B_=function(e,t){var i={uri:e},r=Yh(e);r&&(i.cors=r);var n=t.tech_.crossOrigin()==="use-credentials";n&&(i.withCredentials=n),A1(i,xt(this,function(a,o,l){if(a)return Ye.error(a,o);t.loaded_=!0,typeof D.WebVTT!="function"?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],function(u){if(u.type==="vttjserror"){Ye.error("vttjs failed to load, stopping trying to process "+t.src);return}return R_(l,t)}):R_(l,t)}))},iu=(function(s){we(e,s);function e(i){var r;if(i===void 0&&(i={}),!i.tech)throw new Error("A tech was not provided.");var n=kt(i,{kind:yM[i.kind]||"subtitles",language:i.language||i.srclang||""}),a=M_[n.mode]||"disabled",o=n.default;(n.kind==="metadata"||n.kind==="chapters")&&(a="hidden"),r=s.call(this,n)||this,r.tech_=n.tech,r.cues_=[],r.activeCues_=[],r.preload_=r.tech_.preloadTextTracks!==!1;var l=new O_(r.cues_),u=new O_(r.activeCues_),c=!1;r.timeupdateHandler=xt(We(r),function(f){if(f===void 0&&(f={}),!this.tech_.isDisposed()){if(!this.tech_.isReady_){f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,c&&(this.trigger("cuechange"),c=!1),f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});var h=function(){r.stopTracking()};return r.tech_.one("dispose",h),a!=="disabled"&&r.startTracking(),Object.defineProperties(We(r),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return a},set:function(g){M_[g]&&a!==g&&(a=g,!this.preload_&&a!=="disabled"&&this.cues.length===0&&B_(this.src,this),this.stopTracking(),a!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?l:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(this.cues.length===0)return u;for(var g=this.tech_.currentTime(),C=[],p=0,b=this.cues.length;p<b;p++){var I=this.cues[p];(I.startTime<=g&&I.endTime>=g||I.startTime===I.endTime&&I.startTime<=g&&I.startTime+.5>=g)&&C.push(I)}if(c=!1,C.length!==this.activeCues_.length)c=!0;else for(var L=0;L<C.length;L++)this.activeCues_.indexOf(C[L])===-1&&(c=!0);return this.activeCues_=C,u.setCues_(this.activeCues_),u},set:function(){}}}),n.src?(r.src=n.src,r.preload_||(r.loaded_=!0),(r.preload_||n.kind!=="subtitles"&&n.kind!=="captions")&&B_(r.src,We(r))):r.loaded_=!0,r}var t=e.prototype;return t.startTracking=function(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)},t.stopTracking=function(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)},t.addCue=function(r){var n=r;if(!("getCueAsHTML"in n)){n=new D.vttjs.VTTCue(r.startTime,r.endTime,r.text);for(var a in r)a in n||(n[a]=r[a]);n.id=r.id,n.originalCue_=r}for(var o=this.tech_.textTracks(),l=0;l<o.length;l++)o[l]!==this&&o[l].removeCue(n);this.cues_.push(n),this.cues.setCues_(this.cues_)},t.removeCue=function(r){for(var n=this.cues_.length;n--;){var a=this.cues_[n];if(a===r||a.originalCue_&&a.originalCue_===r){this.cues_.splice(n,1),this.cues.setCues_(this.cues_);break}}},e})(xg);iu.prototype.allowedEvents_={cuechange:"cuechange"};var EC=(function(s){we(e,s);function e(t){var i;t===void 0&&(t={});var r=kt(t,{kind:vM[t.kind]||""});i=s.call(this,r)||this;var n=!1;return Object.defineProperty(We(i),"enabled",{get:function(){return n},set:function(o){typeof o!="boolean"||o===n||(n=o,this.trigger("enabledchange"))}}),r.enabled&&(i.enabled=r.enabled),i.loaded_=!0,i}return e})(xg),wC=(function(s){we(e,s);function e(t){var i;t===void 0&&(t={});var r=kt(t,{kind:gM[t.kind]||""});i=s.call(this,r)||this;var n=!1;return Object.defineProperty(We(i),"selected",{get:function(){return n},set:function(o){typeof o!="boolean"||o===n||(n=o,this.trigger("selectedchange"))}}),r.selected&&(i.selected=r.selected),i}return e})(xg),kC=0,TM=1,xC=2,bM=3,Oo=(function(s){we(e,s);function e(t){var i;t===void 0&&(t={}),i=s.call(this)||this;var r,n=new iu(t);return i.kind=n.kind,i.src=n.src,i.srclang=n.language,i.label=n.label,i.default=n.default,Object.defineProperties(We(i),{readyState:{get:function(){return r}},track:{get:function(){return n}}}),r=kC,n.addEventListener("loadeddata",function(){r=xC,i.trigger({type:"load",target:We(i)})}),i}return e})(si);Oo.prototype.allowedEvents_={load:"load"};Oo.NONE=kC;Oo.LOADING=TM;Oo.LOADED=xC;Oo.ERROR=bM;var dr={audio:{ListClass:fM,TrackClass:EC,capitalName:"Audio"},video:{ListClass:pM,TrackClass:wC,capitalName:"Video"},text:{ListClass:SC,TrackClass:iu,capitalName:"Text"}};Object.keys(dr).forEach(function(s){dr[s].getterName=s+"Tracks",dr[s].privateName=s+"Tracks_"});var yo={remoteText:{ListClass:SC,TrackClass:iu,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:mM,TrackClass:Oo,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Ei=mt({},dr,yo);yo.names=Object.keys(yo);dr.names=Object.keys(dr);Ei.names=[].concat(yo.names).concat(dr.names);function SM(s,e,t,i,r){r===void 0&&(r={});var n=s.textTracks();r.kind=e,t&&(r.label=t),i&&(r.language=i),r.tech=s;var a=new Ei.text.TrackClass(r);return n.addTrack(a),a}var St=(function(s){we(e,s);function e(i,r){var n;return i===void 0&&(i={}),r===void 0&&(r=function(){}),i.reportTouchActivity=!1,n=s.call(this,null,i,r)||this,n.onDurationChange_=function(a){return n.onDurationChange(a)},n.trackProgress_=function(a){return n.trackProgress(a)},n.trackCurrentTime_=function(a){return n.trackCurrentTime(a)},n.stopTrackingCurrentTime_=function(a){return n.stopTrackingCurrentTime(a)},n.disposeSourceHandler_=function(a){return n.disposeSourceHandler(a)},n.queuedHanders_=new Set,n.hasStarted_=!1,n.on("playing",function(){this.hasStarted_=!0}),n.on("loadstart",function(){this.hasStarted_=!1}),Ei.names.forEach(function(a){var o=Ei[a];i&&i[o.getterName]&&(n[o.privateName]=i[o.getterName])}),n.featuresProgressEvents||n.manualProgressOn(),n.featuresTimeupdateEvents||n.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(a){i["native"+a+"Tracks"]===!1&&(n["featuresNative"+a+"Tracks"]=!1)}),i.nativeCaptions===!1||i.nativeTextTracks===!1?n.featuresNativeTextTracks=!1:(i.nativeCaptions===!0||i.nativeTextTracks===!0)&&(n.featuresNativeTextTracks=!0),n.featuresNativeTextTracks||n.emulateTextTracks(),n.preloadTextTracks=i.preloadTextTracks!==!1,n.autoRemoteTextTracks_=new Ei.text.ListClass,n.initTrackListeners(),i.nativeControlsForTouch||n.emitTapEvents(),n.constructor&&(n.name_=n.constructor.name||"Unknown Tech"),n}var t=e.prototype;return t.triggerSourceset=function(r){var n=this;this.isReady_||this.one("ready",function(){return n.setTimeout(function(){return n.triggerSourceset(r)},1)}),this.trigger({src:r,type:"sourceset"})},t.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},t.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},t.trackProgress=function(r){this.stopTrackingProgress(),this.progressInterval=this.setInterval(xt(this,function(){var n=this.bufferedPercent();this.bufferedPercent_!==n&&this.trigger("progress"),this.bufferedPercent_=n,n===1&&this.stopTrackingProgress()}),500)},t.onDurationChange=function(r){this.duration_=this.duration()},t.buffered=function(){return Gs(0,0)},t.bufferedPercent=function(){return bC(this.buffered(),this.duration_)},t.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},t.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},t.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},t.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},t.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.dispose=function(){this.clearTracks(dr.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),s.prototype.dispose.call(this)},t.clearTracks=function(r){var n=this;r=[].concat(r),r.forEach(function(a){for(var o=n[a+"Tracks"]()||[],l=o.length;l--;){var u=o[l];a==="text"&&n.removeRemoteTextTrack(u),o.removeTrack(u)}})},t.cleanupAutoTextTracks=function(){for(var r=this.autoRemoteTextTracks_||[],n=r.length;n--;){var a=r[n];this.removeRemoteTextTrack(a)}},t.reset=function(){},t.crossOrigin=function(){},t.setCrossOrigin=function(){},t.error=function(r){return r!==void 0&&(this.error_=new Ii(r),this.trigger("error")),this.error_},t.played=function(){return this.hasStarted_?Gs(0,0):Gs()},t.play=function(){},t.setScrubbing=function(){},t.scrubbing=function(){},t.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.initTrackListeners=function(){var r=this;dr.names.forEach(function(n){var a=dr[n],o=function(){r.trigger(n+"trackchange")},l=r[a.getterName]();l.addEventListener("removetrack",o),l.addEventListener("addtrack",o),r.on("dispose",function(){l.removeEventListener("removetrack",o),l.removeEventListener("addtrack",o)})})},t.addWebVttScript_=function(){var r=this;if(!D.WebVTT)if(le.body.contains(this.el())){if(!this.options_["vtt.js"]&&Ul(eo)&&Object.keys(eo).length>0){this.trigger("vttjsloaded");return}var n=le.createElement("script");n.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",n.onload=function(){r.trigger("vttjsloaded")},n.onerror=function(){r.trigger("vttjserror")},this.on("dispose",function(){n.onload=null,n.onerror=null}),D.WebVTT=!0,this.el().parentNode.appendChild(n)}else this.ready(this.addWebVttScript_)},t.emulateTextTracks=function(){var r=this,n=this.textTracks(),a=this.remoteTextTracks(),o=function(f){return n.addTrack(f.track)},l=function(f){return n.removeTrack(f.track)};a.on("addtrack",o),a.on("removetrack",l),this.addWebVttScript_();var u=function(){return r.trigger("texttrackchange")},c=function(){u();for(var f=0;f<n.length;f++){var g=n[f];g.removeEventListener("cuechange",u),g.mode==="showing"&&g.addEventListener("cuechange",u)}};c(),n.addEventListener("change",c),n.addEventListener("addtrack",c),n.addEventListener("removetrack",c),this.on("dispose",function(){a.off("addtrack",o),a.off("removetrack",l),n.removeEventListener("change",c),n.removeEventListener("addtrack",c),n.removeEventListener("removetrack",c);for(var h=0;h<n.length;h++){var f=n[h];f.removeEventListener("cuechange",u)}})},t.addTextTrack=function(r,n,a){if(!r)throw new Error("TextTrack kind is required but was not provided");return SM(this,r,n,a)},t.createRemoteTextTrack=function(r){var n=kt(r,{tech:this});return new yo.remoteTextEl.TrackClass(n)},t.addRemoteTextTrack=function(r,n){var a=this;r===void 0&&(r={});var o=this.createRemoteTextTrack(r);return n!==!0&&n!==!1&&(Ye.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_(o),this.remoteTextTracks().addTrack(o.track),n!==!0&&this.ready(function(){return a.autoRemoteTextTracks_.addTrack(o.track)}),o},t.removeRemoteTextTrack=function(r){var n=this.remoteTextTrackEls().getTrackElementByTrack_(r);this.remoteTextTrackEls().removeTrackElement_(n),this.remoteTextTracks().removeTrack(r),this.autoRemoteTextTracks_.removeTrack(r)},t.getVideoPlaybackQuality=function(){return{}},t.requestPictureInPicture=function(){var r=this.options_.Promise||D.Promise;if(r)return r.reject()},t.disablePictureInPicture=function(){return!0},t.setDisablePictureInPicture=function(){},t.requestVideoFrameCallback=function(r){var n=this,a=xn();return!this.isReady_||this.paused()?(this.queuedHanders_.add(a),this.one("playing",function(){n.queuedHanders_.has(a)&&(n.queuedHanders_.delete(a),r())})):this.requestNamedAnimationFrame(a,r),a},t.cancelVideoFrameCallback=function(r){this.queuedHanders_.has(r)?this.queuedHanders_.delete(r):this.cancelNamedAnimationFrame(r)},t.setPoster=function(){},t.playsinline=function(){},t.setPlaysinline=function(){},t.overrideNativeAudioTracks=function(){},t.overrideNativeVideoTracks=function(){},t.canPlayType=function(){return""},e.canPlayType=function(){return""},e.canPlaySource=function(r,n){return e.canPlayType(r.type)},e.isTech=function(r){return r.prototype instanceof e||r instanceof e||r===e},e.registerTech=function(r,n){if(e.techs_||(e.techs_={}),!e.isTech(n))throw new Error("Tech "+r+" must be a Tech");if(!e.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!e.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return r=Wt(r),e.techs_[r]=n,e.techs_[yc(r)]=n,r!=="Tech"&&e.defaultTechOrder_.push(r),n},e.getTech=function(r){if(r){if(e.techs_&&e.techs_[r])return e.techs_[r];if(r=Wt(r),D&&D.videojs&&D.videojs[r])return Ye.warn("The "+r+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),D.videojs[r]}},e})(be);Ei.names.forEach(function(s){var e=Ei[s];St.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});St.prototype.featuresVolumeControl=!0;St.prototype.featuresMuteControl=!0;St.prototype.featuresFullscreenResize=!1;St.prototype.featuresPlaybackRate=!1;St.prototype.featuresProgressEvents=!1;St.prototype.featuresSourceset=!1;St.prototype.featuresTimeupdateEvents=!1;St.prototype.featuresNativeTextTracks=!1;St.prototype.featuresVideoFrameCallback=!1;St.withSourceHandlers=function(s){s.registerSourceHandler=function(t,i){var r=s.sourceHandlers;r||(r=s.sourceHandlers=[]),i===void 0&&(i=r.length),r.splice(i,0,t)},s.canPlayType=function(t){for(var i=s.sourceHandlers||[],r,n=0;n<i.length;n++)if(r=i[n].canPlayType(t),r)return r;return""},s.selectSourceHandler=function(t,i){for(var r=s.sourceHandlers||[],n,a=0;a<r.length;a++)if(n=r[a].canHandleSource(t,i),n)return r[a];return null},s.canPlaySource=function(t,i){var r=s.selectSourceHandler(t,i);return r?r.canHandleSource(t,i):""};var e=["seekable","seeking","duration"];e.forEach(function(t){var i=this[t];typeof i=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):i.apply(this,arguments)})},s.prototype),s.prototype.setSource=function(t){var i=s.selectSourceHandler(t,this.options_);i||(s.nativeSourceHandler?i=s.nativeSourceHandler:Ye.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==s.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},s.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}};be.registerComponent("Tech",St);St.registerTech("Tech",St);St.defaultTechOrder_=[];var Ks={},tm={},Qc={};function CM(s,e){Ks[s]=Ks[s]||[],Ks[s].push(e)}function EM(s,e,t){s.setTimeout(function(){return As(e,Ks[e.type],t,s)},1)}function wM(s,e){s.forEach(function(t){return t.setTech&&t.setTech(e)})}function kM(s,e,t){return s.reduceRight(Pg(t),e[t]())}function xM(s,e,t,i){return e[t](s.reduce(Pg(t),i))}function F_(s,e,t,i){i===void 0&&(i=null);var r="call"+Wt(t),n=s.reduce(Pg(r),i),a=n===Qc,o=a?null:e[t](n);return PM(s,t,o,a),o}var AM={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},IM={setCurrentTime:1,setMuted:1,setVolume:1},U_={play:1,pause:1};function Pg(s){return function(e,t){return e===Qc?Qc:t[s]?t[s](e):e}}function PM(s,e,t,i){for(var r=s.length-1;r>=0;r--){var n=s[r];n[e]&&n[e](i,t)}}function DM(s){tm[s.id()]=null}function NM(s,e){var t=tm[s.id()],i=null;if(t==null)return i=e(s),tm[s.id()]=[[e,i]],i;for(var r=0;r<t.length;r++){var n=t[r],a=n[0],o=n[1];a===e&&(i=o)}return i===null&&(i=e(s),t.push([e,i])),i}function As(s,e,t,i,r,n){s===void 0&&(s={}),e===void 0&&(e=[]),r===void 0&&(r=[]),n===void 0&&(n=!1);var a=e,o=a[0],l=a.slice(1);if(typeof o=="string")As(s,Ks[o],t,i,r,n);else if(o){var u=NM(i,o);if(!u.setSource)return r.push(u),As(s,l,t,i,r,n);u.setSource(Vt({},s),function(c,h){if(c)return As(s,l,t,i,r,n);r.push(u),As(h,s.type===h.type?l:Ks[h.type],t,i,r,n)})}else l.length?As(s,l,t,i,r,n):n?t(s,r):As(s,Ks["*"],t,i,r,!0)}var LM={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Yc=function(e){e===void 0&&(e="");var t=Ig(e),i=LM[t.toLowerCase()];return i||""},OM=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter(function(o){return o.src===t});if(i.length)return i[0].type;for(var r=e.$$("source"),n=0;n<r.length;n++){var a=r[n];if(a.type&&a.src&&a.src===t)return a.type}return Yc(t)},MM=function s(e){if(Array.isArray(e)){var t=[];e.forEach(function(i){i=s(i),Array.isArray(i)?t=t.concat(i):Cn(i)&&t.push(i)}),e=t}else typeof e=="string"&&e.trim()?e=[$_({src:e})]:Cn(e)&&typeof e.src=="string"&&e.src&&e.src.trim()?e=[$_(e)]:e=[];return e};function $_(s){if(!s.type){var e=Yc(s.src);e&&(s.type=e)}return s}var RM=(function(s){we(e,s);function e(t,i,r){var n,a=kt({createEl:!1},i);if(n=s.call(this,t,a,r)||this,!i.playerOptions.sources||i.playerOptions.sources.length===0)for(var o=0,l=i.playerOptions.techOrder;o<l.length;o++){var u=Wt(l[o]),c=St.getTech(u);if(u||(c=be.getComponent(u)),c&&c.isSupported()){t.loadTech_(u);break}}else t.src(i.playerOptions.sources);return n}return e})(be);be.registerComponent("MediaLoader",RM);var Jh=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.options_.controlText&&n.controlText(n.options_.controlText),n.handleMouseOver_=function(a){return n.handleMouseOver(a)},n.handleMouseOut_=function(a){return n.handleMouseOut(a)},n.handleClick_=function(a){return n.handleClick(a)},n.handleKeyDown_=function(a){return n.handleKeyDown(a)},n.emitTapEvents(),n.enable(),n}var t=e.prototype;return t.createEl=function(r,n,a){r===void 0&&(r="div"),n===void 0&&(n={}),a===void 0&&(a={}),n=Vt({className:this.buildCSSClass(),tabIndex:0},n),r==="button"&&Ye.error("Creating a ClickableComponent with an HTML element of "+r+" is not supported; use a Button instead."),a=Vt({role:"button"},a),this.tabIndex_=n.tabIndex;var o=it(r,n,a);return o.appendChild(it("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(o),o},t.dispose=function(){this.controlTextEl_=null,s.prototype.dispose.call(this)},t.createControlTextEl=function(r){return this.controlTextEl_=it("span",{className:"vjs-control-text"},{"aria-live":"polite"}),r&&r.appendChild(this.controlTextEl_),this.controlText(this.controlText_,r),this.controlTextEl_},t.controlText=function(r,n){if(n===void 0&&(n=this.el()),r===void 0)return this.controlText_||"Need Text";var a=this.localize(r);this.controlText_=r,ea(this.controlTextEl_,a),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&n.setAttribute("title",a)},t.buildCSSClass=function(){return"vjs-control vjs-button "+s.prototype.buildCSSClass.call(this)},t.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))},t.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)},t.handleLanguagechange=function(){this.controlText(this.controlText_)},t.handleClick=function(r){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},t.handleKeyDown=function(r){Ge.isEventKey(r,"Space")||Ge.isEventKey(r,"Enter")?(r.preventDefault(),r.stopPropagation(),this.trigger("click")):s.prototype.handleKeyDown.call(this,r)},e})(be);be.registerComponent("ClickableComponent",Jh);var BM=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.update(),n.update_=function(a){return n.update(a)},i.on("posterchange",n.update_),n}var t=e.prototype;return t.dispose=function(){this.player().off("posterchange",this.update_),s.prototype.dispose.call(this)},t.createEl=function(){var r=it("div",{className:"vjs-poster",tabIndex:-1});return r},t.update=function(r){var n=this.player().poster();this.setSrc(n),n?this.show():this.hide()},t.setSrc=function(r){var n="";r&&(n='url("'+r+'")'),this.el_.style.backgroundImage=n},t.handleClick=function(r){if(this.player_.controls()){var n=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;this.player_.tech(!0)&&!((eu||Zl)&&n)&&this.player_.tech(!0).focus(),this.player_.paused()?Wr(this.player_.play()):this.player_.pause()}},e})(Jh);be.registerComponent("PosterImage",BM);var ur="#222",j_="#ccc",FM={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Ff(s,e){var t;if(s.length===4)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else if(s.length===7)t=s.slice(1);else throw new Error("Invalid color code provided, "+s+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function Uf(s,e,t){try{s.style[e]=t}catch{return}}var UM=(function(s){we(e,s);function e(i,r,n){var a;a=s.call(this,i,r,n)||this;var o=function(u){return a.updateDisplay(u)};return i.on("loadstart",function(l){return a.toggleDisplay(l)}),i.on("texttrackchange",o),i.on("loadedmetadata",function(l){return a.preselectTrack(l)}),i.ready(xt(We(a),function(){if(i.tech_&&i.tech_.featuresNativeTextTracks){this.hide();return}i.on("fullscreenchange",o),i.on("playerresize",o),D.addEventListener("orientationchange",o),i.on("dispose",function(){return D.removeEventListener("orientationchange",o)});for(var l=this.options_.playerOptions.tracks||[],u=0;u<l.length;u++)this.player_.addRemoteTextTrack(l[u],!0);this.preselectTrack()})),a}var t=e.prototype;return t.preselectTrack=function(){for(var r={captions:1,subtitles:1},n=this.player_.textTracks(),a=this.player_.cache_.selectedLanguage,o,l,u,c=0;c<n.length;c++){var h=n[c];a&&a.enabled&&a.language&&a.language===h.language&&h.kind in r?h.kind===a.kind?u=h:u||(u=h):a&&!a.enabled?(u=null,o=null,l=null):h.default&&(h.kind==="descriptions"&&!o?o=h:h.kind in r&&!l&&(l=h))}u?u.mode="showing":l?l.mode="showing":o&&(o.mode="showing")},t.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})},t.clearDisplay=function(){typeof D.WebVTT=="function"&&D.WebVTT.processCues(D,[],this.el_)},t.updateDisplay=function(){var r=this.player_.textTracks(),n=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),n){for(var a=[],o=0;o<r.length;++o){var l=r[o];l.mode==="showing"&&a.push(l)}this.updateForTrack(a);return}for(var u=null,c=null,h=r.length;h--;){var f=r[h];f.mode==="showing"&&(f.kind==="descriptions"?u=f:c=f)}c?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(c)):u&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(u))},t.updateDisplayState=function(r){for(var n=this.player_.textTrackSettings.getValues(),a=r.activeCues,o=a.length;o--;){var l=a[o];if(l){var u=l.displayState;if(n.color&&(u.firstChild.style.color=n.color),n.textOpacity&&Uf(u.firstChild,"color",Ff(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(u.firstChild.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&Uf(u.firstChild,"backgroundColor",Ff(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?Uf(u,"backgroundColor",Ff(n.windowColor,n.windowOpacity)):u.style.backgroundColor=n.windowColor),n.edgeStyle&&(n.edgeStyle==="dropshadow"?u.firstChild.style.textShadow="2px 2px 3px "+ur+", 2px 2px 4px "+ur+", 2px 2px 5px "+ur:n.edgeStyle==="raised"?u.firstChild.style.textShadow="1px 1px "+ur+", 2px 2px "+ur+", 3px 3px "+ur:n.edgeStyle==="depressed"?u.firstChild.style.textShadow="1px 1px "+j_+", 0 1px "+j_+", -1px -1px "+ur+", 0 -1px "+ur:n.edgeStyle==="uniform"&&(u.firstChild.style.textShadow="0 0 4px "+ur+", 0 0 4px "+ur+", 0 0 4px "+ur+", 0 0 4px "+ur)),n.fontPercent&&n.fontPercent!==1){var c=D.parseFloat(u.style.fontSize);u.style.fontSize=c*n.fontPercent+"px",u.style.height="auto",u.style.top="auto"}n.fontFamily&&n.fontFamily!=="default"&&(n.fontFamily==="small-caps"?u.firstChild.style.fontVariant="small-caps":u.firstChild.style.fontFamily=FM[n.fontFamily])}}},t.updateForTrack=function(r){if(Array.isArray(r)||(r=[r]),!(typeof D.WebVTT!="function"||r.every(function(g){return!g.activeCues}))){for(var n=[],a=0;a<r.length;++a)for(var o=r[a],l=0;l<o.activeCues.length;++l)n.push(o.activeCues[l]);D.WebVTT.processCues(D,n,this.el_);for(var u=0;u<r.length;++u){for(var c=r[u],h=0;h<c.activeCues.length;++h){var f=c.activeCues[h].displayState;bn(f,"vjs-text-track-cue"),bn(f,"vjs-text-track-cue-"+(c.language?c.language:u)),c.language&&mo(f,"lang",c.language)}this.player_.textTrackSettings&&this.updateDisplayState(c)}}},e})(be);be.registerComponent("TextTrackDisplay",UM);var $M=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(){var r=this.player_.isAudio(),n=this.localize(r?"Audio Player":"Video Player"),a=it("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[n])}),o=s.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return o.appendChild(a),o},e})(be);be.registerComponent("LoadingSpinner",$M);var xr=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(r,n,a){n===void 0&&(n={}),a===void 0&&(a={}),r="button",n=Vt({className:this.buildCSSClass()},n),a=Vt({type:"button"},a);var o=it(r,n,a);return o.appendChild(it("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(o),o},t.addChild=function(r,n){n===void 0&&(n={});var a=this.constructor.name;return Ye.warn("Adding an actionable (user controllable) child to a Button ("+a+") is not supported; use a ClickableComponent instead."),be.prototype.addChild.call(this,r,n)},t.enable=function(){s.prototype.enable.call(this),this.el_.removeAttribute("disabled")},t.disable=function(){s.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},t.handleKeyDown=function(r){if(Ge.isEventKey(r,"Space")||Ge.isEventKey(r,"Enter")){r.stopPropagation();return}s.prototype.handleKeyDown.call(this,r)},e})(Jh);be.registerComponent("Button",xr);var AC=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.mouseused_=!1,n.on("mousedown",function(a){return n.handleMouseDown(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-big-play-button"},t.handleClick=function(r){var n=this.player_.play();if(this.mouseused_&&r.clientX&&r.clientY){var a=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;Wr(n),this.player_.tech(!0)&&!((eu||Zl)&&a)&&this.player_.tech(!0).focus();return}var o=this.player_.getChild("controlBar"),l=o&&o.getChild("playToggle");if(!l){this.player_.tech(!0).focus();return}var u=function(){return l.focus()};xl(n)?n.then(u,function(){}):this.setTimeout(u,1)},t.handleKeyDown=function(r){this.mouseused_=!1,s.prototype.handleKeyDown.call(this,r)},t.handleMouseDown=function(r){this.mouseused_=!0},e})(xr);AC.prototype.controlText_="Play Video";be.registerComponent("BigPlayButton",AC);var jM=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.controlText(r&&r.controlText||n.localize("Close")),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-close-button "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(r){this.trigger({type:"close",bubbles:!1})},t.handleKeyDown=function(r){Ge.isEventKey(r,"Esc")?(r.preventDefault(),r.stopPropagation(),this.trigger("click")):s.prototype.handleKeyDown.call(this,r)},e})(xr);be.registerComponent("CloseButton",jM);var IC=(function(s){we(e,s);function e(i,r){var n;return r===void 0&&(r={}),n=s.call(this,i,r)||this,r.replay=r.replay===void 0||r.replay,n.on(i,"play",function(a){return n.handlePlay(a)}),n.on(i,"pause",function(a){return n.handlePause(a)}),r.replay&&n.on(i,"ended",function(a){return n.handleEnded(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-play-control "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(r){this.player_.paused()?Wr(this.player_.play()):this.player_.pause()},t.handleSeeked=function(r){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(r):this.handlePlay(r)},t.handlePlay=function(r){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.handlePause=function(r){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.handleEnded=function(r){var n=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(a){return n.handleSeeked(a)})},e})(xr);IC.prototype.controlText_="Play";be.registerComponent("PlayToggle",IC);var PC=function(e,t){e=e<0?0:e;var i=Math.floor(e%60),r=Math.floor(e/60%60),n=Math.floor(e/3600),a=Math.floor(t/60%60),o=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(n=r=i="-"),n=n>0||o>0?n+":":"",r=((n||a>=10)&&r<10?"0"+r:r)+":",i=i<10?"0"+i:i,n+r+i},Dg=PC;function VM(s){Dg=s}function HM(){Dg=PC}function _o(s,e){return e===void 0&&(e=s),Dg(s,e)}var Mo=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.on(i,["timeupdate","ended"],function(a){return n.updateContent(a)}),n.updateTextNode_(),n}var t=e.prototype;return t.createEl=function(){var r=this.buildCSSClass(),n=s.prototype.createEl.call(this,"div",{className:r+" vjs-time-control vjs-control"}),a=it("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return n.appendChild(a),this.contentEl_=it("span",{className:r+"-display"},{"aria-live":"off",role:"presentation"}),n.appendChild(this.contentEl_),n},t.dispose=function(){this.contentEl_=null,this.textNode_=null,s.prototype.dispose.call(this)},t.updateTextNode_=function(r){var n=this;r===void 0&&(r=0),r=_o(r),this.formattedTime_!==r&&(this.formattedTime_=r,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(n.contentEl_){var a=n.textNode_;a&&n.contentEl_.firstChild!==a&&(a=null,Ye.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),n.textNode_=le.createTextNode(n.formattedTime_),n.textNode_&&(a?n.contentEl_.replaceChild(n.textNode_,a):n.contentEl_.appendChild(n.textNode_))}}))},t.updateContent=function(r){},e})(be);Mo.prototype.labelText_="Time";Mo.prototype.controlText_="Time";be.registerComponent("TimeDisplay",Mo);var Ng=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-current-time"},t.updateContent=function(r){var n;this.player_.ended()?n=this.player_.duration():n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(n)},e})(Mo);Ng.prototype.labelText_="Current Time";Ng.prototype.controlText_="Current Time";be.registerComponent("CurrentTimeDisplay",Ng);var Lg=(function(s){we(e,s);function e(i,r){var n;n=s.call(this,i,r)||this;var a=function(l){return n.updateContent(l)};return n.on(i,"durationchange",a),n.on(i,"loadstart",a),n.on(i,"loadedmetadata",a),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-duration"},t.updateContent=function(r){var n=this.player_.duration();this.updateTextNode_(n)},e})(Mo);Lg.prototype.labelText_="Duration";Lg.prototype.controlText_="Duration";be.registerComponent("DurationDisplay",Lg);var qM=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(){var r=s.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),n=s.prototype.createEl.call(this,"div"),a=s.prototype.createEl.call(this,"span",{textContent:"/"});return n.appendChild(a),r.appendChild(n),r},e})(be);be.registerComponent("TimeDivider",qM);var Og=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.on(i,"durationchange",function(a){return n.updateContent(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-remaining-time"},t.createEl=function(){var r=s.prototype.createEl.call(this);return this.options_.displayNegative!==!1&&r.insertBefore(it("span",{},{"aria-hidden":!0},"-"),this.contentEl_),r},t.updateContent=function(r){if(typeof this.player_.duration()=="number"){var n;this.player_.ended()?n=0:this.player_.remainingTimeDisplay?n=this.player_.remainingTimeDisplay():n=this.player_.remainingTime(),this.updateTextNode_(n)}},e})(Mo);Og.prototype.labelText_="Remaining Time";Og.prototype.controlText_="Remaining Time";be.registerComponent("RemainingTimeDisplay",Og);var zM=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.updateShowing(),n.on(n.player(),"durationchange",function(a){return n.updateShowing(a)}),n}var t=e.prototype;return t.createEl=function(){var r=s.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=it("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(it("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(le.createTextNode(this.localize("LIVE"))),r.appendChild(this.contentEl_),r},t.dispose=function(){this.contentEl_=null,s.prototype.dispose.call(this)},t.updateShowing=function(r){this.player().duration()===1/0?this.show():this.hide()},e})(be);be.registerComponent("LiveDisplay",zM);var DC=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.updateLiveEdgeStatus(),n.player_.liveTracker&&(n.updateLiveEdgeStatusHandler_=function(a){return n.updateLiveEdgeStatus(a)},n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatusHandler_)),n}var t=e.prototype;return t.createEl=function(){var r=s.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=it("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),r.appendChild(this.textEl_),r},t.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},t.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},t.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,s.prototype.dispose.call(this)},e})(xr);DC.prototype.controlText_="Seek to live, currently playing live";be.registerComponent("SeekToLive",DC);var Zh=function(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))},Mg=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.handleMouseDown_=function(a){return n.handleMouseDown(a)},n.handleMouseUp_=function(a){return n.handleMouseUp(a)},n.handleKeyDown_=function(a){return n.handleKeyDown(a)},n.handleClick_=function(a){return n.handleClick(a)},n.handleMouseMove_=function(a){return n.handleMouseMove(a)},n.update_=function(a){return n.update(a)},n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}var t=e.prototype;return t.enabled=function(){return this.enabled_},t.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},t.disable=function(){if(this.enabled()){var r=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(r,"mousemove",this.handleMouseMove_),this.off(r,"mouseup",this.handleMouseUp_),this.off(r,"touchmove",this.handleMouseMove_),this.off(r,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},t.createEl=function(r,n,a){return n===void 0&&(n={}),a===void 0&&(a={}),n.className=n.className+" vjs-slider",n=Vt({tabIndex:0},n),a=Vt({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},a),s.prototype.createEl.call(this,r,n,a)},t.handleMouseDown=function(r){var n=this.bar.el_.ownerDocument;r.type==="mousedown"&&r.preventDefault(),r.type==="touchstart"&&!kn&&r.preventDefault(),aC(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(n,"mousemove",this.handleMouseMove_),this.on(n,"mouseup",this.handleMouseUp_),this.on(n,"touchmove",this.handleMouseMove_),this.on(n,"touchend",this.handleMouseUp_),this.handleMouseMove(r,!0)},t.handleMouseMove=function(r){},t.handleMouseUp=function(){var r=this.bar.el_.ownerDocument;oC(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(r,"mousemove",this.handleMouseMove_),this.off(r,"mouseup",this.handleMouseUp_),this.off(r,"touchmove",this.handleMouseMove_),this.off(r,"touchend",this.handleMouseUp_),this.update()},t.update=function(){var r=this;if(!(!this.el_||!this.bar)){var n=this.getProgress();return n===this.progress_||(this.progress_=n,this.requestNamedAnimationFrame("Slider#update",function(){var a=r.vertical()?"height":"width";r.bar.el().style[a]=(n*100).toFixed(2)+"%"})),n}},t.getProgress=function(){return Number(Zh(this.getPercent(),0,1).toFixed(4))},t.calculateDistance=function(r){var n=Gh(this.el_,r);return this.vertical()?n.y:n.x},t.handleKeyDown=function(r){Ge.isEventKey(r,"Left")||Ge.isEventKey(r,"Down")?(r.preventDefault(),r.stopPropagation(),this.stepBack()):Ge.isEventKey(r,"Right")||Ge.isEventKey(r,"Up")?(r.preventDefault(),r.stopPropagation(),this.stepForward()):s.prototype.handleKeyDown.call(this,r)},t.handleClick=function(r){r.stopPropagation(),r.preventDefault()},t.vertical=function(r){if(r===void 0)return this.vertical_||!1;this.vertical_=!!r,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},e})(be);be.registerComponent("Slider",Mg);var $f=function(e,t){return Zh(e/t*100,0,100).toFixed(2)+"%"},WM=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.partEls_=[],n.on(i,"progress",function(a){return n.update(a)}),n}var t=e.prototype;return t.createEl=function(){var r=s.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),n=it("span",{className:"vjs-control-text"}),a=it("span",{textContent:this.localize("Loaded")}),o=le.createTextNode(": ");return this.percentageEl_=it("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),r.appendChild(n),n.appendChild(a),n.appendChild(o),n.appendChild(this.percentageEl_),r},t.dispose=function(){this.partEls_=null,this.percentageEl_=null,s.prototype.dispose.call(this)},t.update=function(r){var n=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var a=n.player_.liveTracker,o=n.player_.buffered(),l=a&&a.isLive()?a.seekableEnd():n.player_.duration(),u=n.player_.bufferedEnd(),c=n.partEls_,h=$f(u,l);n.percent_!==h&&(n.el_.style.width=h,ea(n.percentageEl_,h),n.percent_=h);for(var f=0;f<o.length;f++){var g=o.start(f),C=o.end(f),p=c[f];p||(p=n.el_.appendChild(it()),c[f]=p),!(p.dataset.start===g&&p.dataset.end===C)&&(p.dataset.start=g,p.dataset.end=C,p.style.left=$f(g,u),p.style.width=$f(C-g,u))}for(var b=c.length;b>o.length;b--)n.el_.removeChild(c[b-1]);c.length=o.length})},e})(be);be.registerComponent("LoadProgressBar",WM);var GM=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.update=En(xt(We(n),n.update),Ar),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},t.update=function(r,n,a){var o=jl(this.el_),l=go(this.player_.el()),u=r.width*n;if(!(!l||!o)){var c=r.left-l.left+u,h=r.width-u+(l.right-r.right),f=o.width/2;c<f?f+=f-c:h<f&&(f=h),f<0?f=0:f>o.width&&(f=o.width),f=Math.round(f),this.el_.style.right="-"+f+"px",this.write(a)}},t.write=function(r){ea(this.el_,r)},t.updateTime=function(r,n,a,o){var l=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var u,c=l.player_.duration();if(l.player_.liveTracker&&l.player_.liveTracker.isLive()){var h=l.player_.liveTracker.liveWindow(),f=h-n*h;u=(f<1?"":"-")+_o(f,h)}else u=_o(a,c);l.update(r,n,u),o&&o()})},e})(be);be.registerComponent("TimeTooltip",GM);var Rg=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.update=En(xt(We(n),n.update),Ar),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},t.update=function(r,n){var a=this.getChild("timeTooltip");if(a){var o=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(r,n,o)}},e})(be);Rg.prototype.options_={children:[]};!Di&&!wn&&Rg.prototype.options_.children.push("timeTooltip");be.registerComponent("PlayProgressBar",Rg);var NC=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.update=En(xt(We(n),n.update),Ar),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(r,n){var a=this,o=n*this.player_.duration();this.getChild("timeTooltip").updateTime(r,n,o,function(){a.el_.style.left=r.width*n+"px"})},e})(be);NC.prototype.options_={children:["timeTooltip"]};be.registerComponent("MouseTimeDisplay",NC);var Ju=5,V_=12,Bg=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.setEventHandlers_(),n}var t=e.prototype;return t.setEventHandlers_=function(){var r=this;this.update_=xt(this,this.update),this.update=En(this.update_,Ar),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(n){return r.enableInterval_(n)},this.disableIntervalHandler_=function(n){return r.disableInterval_(n)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in le&&"visibilityState"in le&&this.on(le,"visibilitychange",this.toggleVisibility_)},t.toggleVisibility_=function(r){le.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(r)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())},t.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Ar))},t.disableInterval_=function(r){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&r&&r.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.update=function(r){var n=this;if(le.visibilityState!=="hidden"){var a=s.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var o=n.player_.ended()?n.player_.duration():n.getCurrentTime_(),l=n.player_.liveTracker,u=n.player_.duration();l&&l.isLive()&&(u=n.player_.liveTracker.liveCurrentTime()),n.percent_!==a&&(n.el_.setAttribute("aria-valuenow",(a*100).toFixed(2)),n.percent_=a),(n.currentTime_!==o||n.duration_!==u)&&(n.el_.setAttribute("aria-valuetext",n.localize("progress bar timing: currentTime={1} duration={2}",[_o(o,u),_o(u,u)],"{1} of {2}")),n.currentTime_=o,n.duration_=u),n.bar&&n.bar.update(go(n.el()),n.getProgress())}),a}},t.userSeek_=function(r){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(r)},t.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.getPercent=function(){var r=this.getCurrentTime_(),n,a=this.player_.liveTracker;return a&&a.isLive()?(n=(r-a.seekableStart())/a.liveWindow(),a.atLiveEdge()&&(n=1)):n=r/this.player_.duration(),n},t.handleMouseDown=function(r){Vl(r)&&(r.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),s.prototype.handleMouseDown.call(this,r))},t.handleMouseMove=function(r,n){if(n===void 0&&(n=!1),!!Vl(r)){!n&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);var a,o=this.calculateDistance(r),l=this.player_.liveTracker;if(!l||!l.isLive())a=o*this.player_.duration(),a===this.player_.duration()&&(a=a-.1);else{if(o>=.99){l.seekToLiveEdge();return}var u=l.seekableStart(),c=l.liveCurrentTime();if(a=u+o*l.liveWindow(),a>=c&&(a=c),a<=u&&(a=u+.1),a===1/0)return}this.userSeek_(a)}},t.enable=function(){s.prototype.enable.call(this);var r=this.getChild("mouseTimeDisplay");r&&r.show()},t.disable=function(){s.prototype.disable.call(this);var r=this.getChild("mouseTimeDisplay");r&&r.hide()},t.handleMouseUp=function(r){s.prototype.handleMouseUp.call(this,r),r&&r.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Wr(this.player_.play()):this.update_()},t.stepForward=function(){this.userSeek_(this.player_.currentTime()+Ju)},t.stepBack=function(){this.userSeek_(this.player_.currentTime()-Ju)},t.handleAction=function(r){this.player_.paused()?this.player_.play():this.player_.pause()},t.handleKeyDown=function(r){var n=this.player_.liveTracker;if(Ge.isEventKey(r,"Space")||Ge.isEventKey(r,"Enter"))r.preventDefault(),r.stopPropagation(),this.handleAction(r);else if(Ge.isEventKey(r,"Home"))r.preventDefault(),r.stopPropagation(),this.userSeek_(0);else if(Ge.isEventKey(r,"End"))r.preventDefault(),r.stopPropagation(),n&&n.isLive()?this.userSeek_(n.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(Ge(r))){r.preventDefault(),r.stopPropagation();var a=(Ge.codes[Ge(r)]-Ge.codes[0])*10/100;n&&n.isLive()?this.userSeek_(n.seekableStart()+n.liveWindow()*a):this.userSeek_(this.player_.duration()*a)}else Ge.isEventKey(r,"PgDn")?(r.preventDefault(),r.stopPropagation(),this.userSeek_(this.player_.currentTime()-Ju*V_)):Ge.isEventKey(r,"PgUp")?(r.preventDefault(),r.stopPropagation(),this.userSeek_(this.player_.currentTime()+Ju*V_)):s.prototype.handleKeyDown.call(this,r)},t.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in le&&"visibilityState"in le&&this.off(le,"visibilitychange",this.toggleVisibility_),s.prototype.dispose.call(this)},e})(Mg);Bg.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!Di&&!wn&&Bg.prototype.options_.children.splice(1,0,"mouseTimeDisplay");be.registerComponent("SeekBar",Bg);var LC=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.handleMouseMove=En(xt(We(n),n.handleMouseMove),Ar),n.throttledHandleMouseSeek=En(xt(We(n),n.handleMouseSeek),Ar),n.handleMouseUpHandler_=function(a){return n.handleMouseUp(a)},n.handleMouseDownHandler_=function(a){return n.handleMouseDown(a)},n.enable(),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.handleMouseMove=function(r){var n=this.getChild("seekBar");if(n){var a=n.getChild("playProgressBar"),o=n.getChild("mouseTimeDisplay");if(!(!a&&!o)){var l=n.el(),u=jl(l),c=Gh(l,r).x;c=Zh(c,0,1),o&&o.update(u,c),a&&a.update(u,n.getProgress())}}},t.handleMouseSeek=function(r){var n=this.getChild("seekBar");n&&n.handleMouseMove(r)},t.enabled=function(){return this.enabled_},t.disable=function(){if(this.children().forEach(function(n){return n.disable&&n.disable()}),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var r=this.getChild("seekBar");this.player_.scrubbing(!1),r.videoWasPlaying&&Wr(this.player_.play())}},t.enable=function(){this.children().forEach(function(r){return r.enable&&r.enable()}),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.removeListenersAddedOnMousedownAndTouchstart=function(){var r=this.el_.ownerDocument;this.off(r,"mousemove",this.throttledHandleMouseSeek),this.off(r,"touchmove",this.throttledHandleMouseSeek),this.off(r,"mouseup",this.handleMouseUpHandler_),this.off(r,"touchend",this.handleMouseUpHandler_)},t.handleMouseDown=function(r){var n=this.el_.ownerDocument,a=this.getChild("seekBar");a&&a.handleMouseDown(r),this.on(n,"mousemove",this.throttledHandleMouseSeek),this.on(n,"touchmove",this.throttledHandleMouseSeek),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)},t.handleMouseUp=function(r){var n=this.getChild("seekBar");n&&n.handleMouseUp(r),this.removeListenersAddedOnMousedownAndTouchstart()},e})(be);LC.prototype.options_={children:["seekBar"]};be.registerComponent("ProgressControl",LC);var OC=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.on(i,["enterpictureinpicture","leavepictureinpicture"],function(a){return n.handlePictureInPictureChange(a)}),n.on(i,["disablepictureinpicturechanged","loadedmetadata"],function(a){return n.handlePictureInPictureEnabledChange(a)}),n.on(i,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){var a=i.currentType().substring(0,5)==="audio";a||i.audioPosterMode()||i.audioOnlyMode()?(i.isInPictureInPicture()&&i.exitPictureInPicture(),n.hide()):n.show()}),n.disable(),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-picture-in-picture-control "+s.prototype.buildCSSClass.call(this)},t.handlePictureInPictureEnabledChange=function(){le.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1?this.enable():this.disable()},t.handlePictureInPictureChange=function(r){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},t.handleClick=function(r){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},e})(xr);OC.prototype.controlText_="Picture-in-Picture";be.registerComponent("PictureInPictureToggle",OC);var MC=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.on(i,"fullscreenchange",function(a){return n.handleFullscreenChange(a)}),le[i.fsApi_.fullscreenEnabled]===!1&&n.disable(),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-fullscreen-control "+s.prototype.buildCSSClass.call(this)},t.handleFullscreenChange=function(r){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.handleClick=function(r){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},e})(xr);MC.prototype.controlText_="Fullscreen";be.registerComponent("FullscreenToggle",MC);var KM=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")})},XM=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(){var r=s.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return r.appendChild(s.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),r},e})(be);be.registerComponent("VolumeLevel",XM);var QM=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.update=En(xt(We(n),n.update),Ar),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},t.update=function(r,n,a,o){if(!a){var l=go(this.el_),u=go(this.player_.el()),c=r.width*n;if(!u||!l)return;var h=r.left-u.left+c,f=r.width-c+(u.right-r.right),g=l.width/2;h<g?g+=g-h:f<g&&(g=f),g<0?g=0:g>l.width&&(g=l.width),this.el_.style.right="-"+g+"px"}this.write(o+"%")},t.write=function(r){ea(this.el_,r)},t.updateVolume=function(r,n,a,o,l){var u=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){u.update(r,n,a,o.toFixed(0)),l&&l()})},e})(be);be.registerComponent("VolumeLevelTooltip",QM);var RC=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.update=En(xt(We(n),n.update),Ar),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(r,n,a){var o=this,l=100*n;this.getChild("volumeLevelTooltip").updateVolume(r,n,a,l,function(){a?o.el_.style.bottom=r.height*n+"px":o.el_.style.left=r.width*n+"px"})},e})(be);RC.prototype.options_={children:["volumeLevelTooltip"]};be.registerComponent("MouseVolumeLevelDisplay",RC);var ed=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.on("slideractive",function(a){return n.updateLastVolume_(a)}),n.on(i,"volumechange",function(a){return n.updateARIAAttributes(a)}),i.ready(function(){return n.updateARIAAttributes()}),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.handleMouseDown=function(r){Vl(r)&&s.prototype.handleMouseDown.call(this,r)},t.handleMouseMove=function(r){var n=this.getChild("mouseVolumeLevelDisplay");if(n){var a=this.el(),o=go(a),l=this.vertical(),u=Gh(a,r);u=l?u.y:u.x,u=Zh(u,0,1),n.update(o,u,l)}Vl(r)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(r)))},t.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.updateARIAAttributes=function(r){var n=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",n),this.el_.setAttribute("aria-valuetext",n+"%")},t.volumeAsPercentage_=function(){return Math.round(this.player_.volume()*100)},t.updateLastVolume_=function(){var r=this,n=this.player_.volume();this.one("sliderinactive",function(){r.player_.volume()===0&&r.player_.lastVolume_(n)})},e})(Mg);ed.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!Di&&!wn&&ed.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");ed.prototype.playerEvent="volumechange";be.registerComponent("VolumeBar",ed);var BC=(function(s){we(e,s);function e(i,r){var n;return r===void 0&&(r={}),r.vertical=r.vertical||!1,(typeof r.volumeBar>"u"||Ul(r.volumeBar))&&(r.volumeBar=r.volumeBar||{},r.volumeBar.vertical=r.vertical),n=s.call(this,i,r)||this,KM(We(n),i),n.throttledHandleMouseMove=En(xt(We(n),n.handleMouseMove),Ar),n.handleMouseUpHandler_=function(a){return n.handleMouseUp(a)},n.on("mousedown",function(a){return n.handleMouseDown(a)}),n.on("touchstart",function(a){return n.handleMouseDown(a)}),n.on("mousemove",function(a){return n.handleMouseMove(a)}),n.on(n.volumeBar,["focus","slideractive"],function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")}),n.on(n.volumeBar,["blur","sliderinactive"],function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")}),n}var t=e.prototype;return t.createEl=function(){var r="vjs-volume-horizontal";return this.options_.vertical&&(r="vjs-volume-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+r})},t.handleMouseDown=function(r){var n=this.el_.ownerDocument;this.on(n,"mousemove",this.throttledHandleMouseMove),this.on(n,"touchmove",this.throttledHandleMouseMove),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)},t.handleMouseUp=function(r){var n=this.el_.ownerDocument;this.off(n,"mousemove",this.throttledHandleMouseMove),this.off(n,"touchmove",this.throttledHandleMouseMove),this.off(n,"mouseup",this.handleMouseUpHandler_),this.off(n,"touchend",this.handleMouseUpHandler_)},t.handleMouseMove=function(r){this.volumeBar.handleMouseMove(r)},e})(be);BC.prototype.options_={children:["volumeBar"]};be.registerComponent("VolumeControl",BC);var YM=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")})},FC=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,YM(We(n),i),n.on(i,["loadstart","volumechange"],function(a){return n.update(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-mute-control "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(r){var n=this.player_.volume(),a=this.player_.lastVolume_();if(n===0){var o=a<.1?.1:a;this.player_.volume(o),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},t.update=function(r){this.updateIcon_(),this.updateControlText_()},t.updateIcon_=function(){var r=this.player_.volume(),n=3;Di&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),r===0||this.player_.muted()?n=0:r<.33?n=1:r<.67&&(n=2);for(var a=0;a<4;a++)tu(this.el_,"vjs-vol-"+a);bn(this.el_,"vjs-vol-"+n)},t.updateControlText_=function(){var r=this.player_.muted()||this.player_.volume()===0,n=r?"Unmute":"Mute";this.controlText()!==n&&this.controlText(n)},e})(xr);FC.prototype.controlText_="Mute";be.registerComponent("MuteToggle",FC);var UC=(function(s){we(e,s);function e(i,r){var n;return r===void 0&&(r={}),typeof r.inline<"u"?r.inline=r.inline:r.inline=!0,(typeof r.volumeControl>"u"||Ul(r.volumeControl))&&(r.volumeControl=r.volumeControl||{},r.volumeControl.vertical=!r.inline),n=s.call(this,i,r)||this,n.handleKeyPressHandler_=function(a){return n.handleKeyPress(a)},n.on(i,["loadstart"],function(a){return n.volumePanelState_(a)}),n.on(n.muteToggle,"keyup",function(a){return n.handleKeyPress(a)}),n.on(n.volumeControl,"keyup",function(a){return n.handleVolumeControlKeyUp(a)}),n.on("keydown",function(a){return n.handleKeyPress(a)}),n.on("mouseover",function(a){return n.handleMouseOver(a)}),n.on("mouseout",function(a){return n.handleMouseOut(a)}),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}var t=e.prototype;return t.sliderActive_=function(){this.addClass("vjs-slider-active")},t.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.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.createEl=function(){var r="vjs-volume-panel-horizontal";return this.options_.inline||(r="vjs-volume-panel-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+r})},t.dispose=function(){this.handleMouseOut(),s.prototype.dispose.call(this)},t.handleVolumeControlKeyUp=function(r){Ge.isEventKey(r,"Esc")&&this.muteToggle.focus()},t.handleMouseOver=function(r){this.addClass("vjs-hover"),tr(le,"keyup",this.handleKeyPressHandler_)},t.handleMouseOut=function(r){this.removeClass("vjs-hover"),vi(le,"keyup",this.handleKeyPressHandler_)},t.handleKeyPress=function(r){Ge.isEventKey(r,"Esc")&&this.handleMouseOut()},e})(be);UC.prototype.options_={children:["muteToggle","volumeControl"]};be.registerComponent("VolumePanel",UC);var $C=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,r&&(n.menuButton_=r.menuButton),n.focusedChild_=-1,n.on("keydown",function(a){return n.handleKeyDown(a)}),n.boundHandleBlur_=function(a){return n.handleBlur(a)},n.boundHandleTapClick_=function(a){return n.handleTapClick(a)},n}var t=e.prototype;return t.addEventListenerForItem=function(r){r instanceof be&&(this.on(r,"blur",this.boundHandleBlur_),this.on(r,["tap","click"],this.boundHandleTapClick_))},t.removeEventListenerForItem=function(r){r instanceof be&&(this.off(r,"blur",this.boundHandleBlur_),this.off(r,["tap","click"],this.boundHandleTapClick_))},t.removeChild=function(r){typeof r=="string"&&(r=this.getChild(r)),this.removeEventListenerForItem(r),s.prototype.removeChild.call(this,r)},t.addItem=function(r){var n=this.addChild(r);n&&this.addEventListenerForItem(n)},t.createEl=function(){var r=this.options_.contentElType||"ul";this.contentEl_=it(r,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=s.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),tr(n,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),n},t.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,s.prototype.dispose.call(this)},t.handleBlur=function(r){var n=r.relatedTarget||le.activeElement;if(!this.children().some(function(o){return o.el()===n})){var a=this.menuButton_;a&&a.buttonPressed_&&n!==a.el().firstChild&&a.unpressButton()}},t.handleTapClick=function(r){if(this.menuButton_){this.menuButton_.unpressButton();var n=this.children();if(!Array.isArray(n))return;var a=n.filter(function(o){return o.el()===r.target})[0];if(!a)return;a.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}},t.handleKeyDown=function(r){Ge.isEventKey(r,"Left")||Ge.isEventKey(r,"Down")?(r.preventDefault(),r.stopPropagation(),this.stepForward()):(Ge.isEventKey(r,"Right")||Ge.isEventKey(r,"Up"))&&(r.preventDefault(),r.stopPropagation(),this.stepBack())},t.stepForward=function(){var r=0;this.focusedChild_!==void 0&&(r=this.focusedChild_+1),this.focus(r)},t.stepBack=function(){var r=0;this.focusedChild_!==void 0&&(r=this.focusedChild_-1),this.focus(r)},t.focus=function(r){r===void 0&&(r=0);var n=this.children().slice(),a=n.length&&n[0].hasClass("vjs-menu-title");a&&n.shift(),n.length>0&&(r<0?r=0:r>=n.length&&(r=n.length-1),this.focusedChild_=r,n[r].el_.focus())},e})(be);be.registerComponent("Menu",$C);var Fg=(function(s){we(e,s);function e(i,r){var n;r===void 0&&(r={}),n=s.call(this,i,r)||this,n.menuButton_=new xr(i,r),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var a=xr.prototype.buildCSSClass();n.menuButton_.el_.className=n.buildCSSClass()+" "+a,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0;var o=function(u){return n.handleClick(u)};return n.handleMenuKeyUp_=function(l){return n.handleMenuKeyUp(l)},n.on(n.menuButton_,"tap",o),n.on(n.menuButton_,"click",o),n.on(n.menuButton_,"keydown",function(l){return n.handleKeyDown(l)}),n.on(n.menuButton_,"mouseenter",function(){n.addClass("vjs-hover"),n.menu.show(),tr(le,"keyup",n.handleMenuKeyUp_)}),n.on("mouseleave",function(l){return n.handleMouseLeave(l)}),n.on("keydown",function(l){return n.handleSubmenuKeyDown(l)}),n}var t=e.prototype;return t.update=function(){var r=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=r,this.addChild(r),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))},t.createMenu=function(){var r=new $C(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var n=it("li",{className:"vjs-menu-title",textContent:Wt(this.options_.title),tabIndex:-1}),a=new be(this.player_,{el:n});r.addItem(a)}if(this.items=this.createItems(),this.items)for(var o=0;o<this.items.length;o++)r.addItem(this.items[o]);return r},t.createItems=function(){},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},t.buildWrapperCSSClass=function(){var r="vjs-menu-button";this.options_.inline===!0?r+="-inline":r+="-popup";var n=xr.prototype.buildCSSClass();return"vjs-menu-button "+r+" "+n+" "+s.prototype.buildCSSClass.call(this)},t.buildCSSClass=function(){var r="vjs-menu-button";return this.options_.inline===!0?r+="-inline":r+="-popup","vjs-menu-button "+r+" "+s.prototype.buildCSSClass.call(this)},t.controlText=function(r,n){return n===void 0&&(n=this.menuButton_.el()),this.menuButton_.controlText(r,n)},t.dispose=function(){this.handleMouseLeave(),s.prototype.dispose.call(this)},t.handleClick=function(r){this.buttonPressed_?this.unpressButton():this.pressButton()},t.handleMouseLeave=function(r){this.removeClass("vjs-hover"),vi(le,"keyup",this.handleMenuKeyUp_)},t.focus=function(){this.menuButton_.focus()},t.blur=function(){this.menuButton_.blur()},t.handleKeyDown=function(r){Ge.isEventKey(r,"Esc")||Ge.isEventKey(r,"Tab")?(this.buttonPressed_&&this.unpressButton(),Ge.isEventKey(r,"Tab")||(r.preventDefault(),this.menuButton_.focus())):(Ge.isEventKey(r,"Up")||Ge.isEventKey(r,"Down"))&&(this.buttonPressed_||(r.preventDefault(),this.pressButton()))},t.handleMenuKeyUp=function(r){(Ge.isEventKey(r,"Esc")||Ge.isEventKey(r,"Tab"))&&this.removeClass("vjs-hover")},t.handleSubmenuKeyPress=function(r){this.handleSubmenuKeyDown(r)},t.handleSubmenuKeyDown=function(r){(Ge.isEventKey(r,"Esc")||Ge.isEventKey(r,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),Ge.isEventKey(r,"Tab")||(r.preventDefault(),this.menuButton_.focus()))},t.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Di&&tC())return;this.menu.focus()}},t.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},t.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},t.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},e})(be);be.registerComponent("MenuButton",Fg);var Ug=(function(s){we(e,s);function e(t,i){var r,n=i.tracks;if(r=s.call(this,t,i)||this,r.items.length<=1&&r.hide(),!n)return We(r);var a=xt(We(r),r.update);return n.addEventListener("removetrack",a),n.addEventListener("addtrack",a),n.addEventListener("labelchange",a),r.player_.on("ready",a),r.player_.on("dispose",function(){n.removeEventListener("removetrack",a),n.removeEventListener("addtrack",a),n.removeEventListener("labelchange",a)}),r}return e})(Fg);be.registerComponent("TrackButton",Ug);var JM=["Tab","Esc","Up","Down","Right","Left"],ru=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.selectable=r.selectable,n.isSelected_=r.selected||!1,n.multiSelectable=r.multiSelectable,n.selected(n.isSelected_),n.selectable?n.multiSelectable?n.el_.setAttribute("role","menuitemcheckbox"):n.el_.setAttribute("role","menuitemradio"):n.el_.setAttribute("role","menuitem"),n}var t=e.prototype;return t.createEl=function(r,n,a){this.nonIconControl=!0;var o=s.prototype.createEl.call(this,"li",Vt({className:"vjs-menu-item",tabIndex:-1},n),a);return o.replaceChild(it("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),o.querySelector(".vjs-icon-placeholder")),o},t.handleKeyDown=function(r){JM.some(function(n){return Ge.isEventKey(r,n)})||s.prototype.handleKeyDown.call(this,r)},t.handleClick=function(r){this.selected(!0)},t.selected=function(r){this.selectable&&(r?(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))},e})(Jh);be.registerComponent("MenuItem",ru);var nu=(function(s){we(e,s);function e(i,r){var n,a=r.track,o=i.textTracks();r.label=a.label||a.language||"Unknown",r.selected=a.mode==="showing",n=s.call(this,i,r)||this,n.track=a,n.kinds=(r.kinds||[r.kind||n.track.kind]).filter(Boolean);var l=function(){for(var f=arguments.length,g=new Array(f),C=0;C<f;C++)g[C]=arguments[C];n.handleTracksChange.apply(We(n),g)},u=function(){for(var f=arguments.length,g=new Array(f),C=0;C<f;C++)g[C]=arguments[C];n.handleSelectedLanguageChange.apply(We(n),g)};if(i.on(["loadstart","texttrackchange"],l),o.addEventListener("change",l),o.addEventListener("selectedlanguagechange",u),n.on("dispose",function(){i.off(["loadstart","texttrackchange"],l),o.removeEventListener("change",l),o.removeEventListener("selectedlanguagechange",u)}),o.onchange===void 0){var c;n.on(["tap","click"],function(){if(typeof D.Event!="object")try{c=new D.Event("change")}catch{}c||(c=le.createEvent("Event"),c.initEvent("change",!0,!0)),o.dispatchEvent(c)})}return n.handleTracksChange(),n}var t=e.prototype;return t.handleClick=function(r){var n=this.track,a=this.player_.textTracks();if(s.prototype.handleClick.call(this,r),!!a)for(var o=0;o<a.length;o++){var l=a[o];this.kinds.indexOf(l.kind)!==-1&&(l===n?l.mode!=="showing"&&(l.mode="showing"):l.mode!=="disabled"&&(l.mode="disabled"))}},t.handleTracksChange=function(r){var n=this.track.mode==="showing";n!==this.isSelected_&&this.selected(n)},t.handleSelectedLanguageChange=function(r){if(this.track.mode==="showing"){var n=this.player_.cache_.selectedLanguage;if(n&&n.enabled&&n.language===this.track.language&&n.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},t.dispose=function(){this.track=null,s.prototype.dispose.call(this)},e})(ru);be.registerComponent("TextTrackMenuItem",nu);var jC=(function(s){we(e,s);function e(i,r){return r.track={player:i,kind:r.kind,kinds:r.kinds,default:!1,mode:"disabled"},r.kinds||(r.kinds=[r.kind]),r.label?r.track.label=r.label:r.track.label=r.kinds.join(" and ")+" off",r.selectable=!0,r.multiSelectable=!1,s.call(this,i,r)||this}var t=e.prototype;return t.handleTracksChange=function(r){for(var n=this.player().textTracks(),a=!0,o=0,l=n.length;o<l;o++){var u=n[o];if(this.options_.kinds.indexOf(u.kind)>-1&&u.mode==="showing"){a=!1;break}}a!==this.isSelected_&&this.selected(a)},t.handleSelectedLanguageChange=function(r){for(var n=this.player().textTracks(),a=!0,o=0,l=n.length;o<l;o++){var u=n[o];if(["captions","descriptions","subtitles"].indexOf(u.kind)>-1&&u.mode==="showing"){a=!1;break}}a&&(this.player_.cache_.selectedLanguage={enabled:!1})},e})(nu);be.registerComponent("OffTextTrackMenuItem",jC);var Ro=(function(s){we(e,s);function e(i,r){return r===void 0&&(r={}),r.tracks=i.textTracks(),s.call(this,i,r)||this}var t=e.prototype;return t.createItems=function(r,n){r===void 0&&(r=[]),n===void 0&&(n=nu);var a;this.label_&&(a=this.label_+" off"),r.push(new jC(this.player_,{kinds:this.kinds_,kind:this.kind_,label:a})),this.hideThreshold_+=1;var o=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var l=0;l<o.length;l++){var u=o[l];if(this.kinds_.indexOf(u.kind)>-1){var c=new n(this.player_,{track:u,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});c.addClass("vjs-"+u.kind+"-menu-item"),r.push(c)}}return r},e})(Ug);be.registerComponent("TextTrackButton",Ro);var VC=(function(s){we(e,s);function e(i,r){var n,a=r.track,o=r.cue,l=i.currentTime();return r.selectable=!0,r.multiSelectable=!1,r.label=o.text,r.selected=o.startTime<=l&&l<o.endTime,n=s.call(this,i,r)||this,n.track=a,n.cue=o,n}var t=e.prototype;return t.handleClick=function(r){s.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime)},e})(ru);be.registerComponent("ChaptersTrackMenuItem",VC);var $g=(function(s){we(e,s);function e(i,r,n){var a;return a=s.call(this,i,r,n)||this,a.selectCurrentItem_=function(){a.items.forEach(function(o){o.selected(a.track_.activeCues[0]===o.cue)})},a}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-chapters-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-chapters-button "+s.prototype.buildWrapperCSSClass.call(this)},t.update=function(r){if(!(r&&r.track&&r.track.kind!=="chapters")){var n=this.findChaptersTrack();n!==this.track_?(this.setTrack(n),s.prototype.update.call(this)):(!this.items||n&&n.cues&&n.cues.length!==this.items.length)&&s.prototype.update.call(this)}},t.setTrack=function(r){if(this.track_!==r){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var n=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);n&&n.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=r,this.track_){this.track_.mode="hidden";var a=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);a&&a.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}},t.findChaptersTrack=function(){for(var r=this.player_.textTracks()||[],n=r.length-1;n>=0;n--){var a=r[n];if(a.kind===this.kind_)return a}},t.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(Wt(this.kind_))},t.createMenu=function(){return this.options_.title=this.getMenuCaption(),s.prototype.createMenu.call(this)},t.createItems=function(){var r=[];if(!this.track_)return r;var n=this.track_.cues;if(!n)return r;for(var a=0,o=n.length;a<o;a++){var l=n[a],u=new VC(this.player_,{track:this.track_,cue:l});r.push(u)}return r},e})(Ro);$g.prototype.kind_="chapters";$g.prototype.controlText_="Chapters";be.registerComponent("ChaptersButton",$g);var jg=(function(s){we(e,s);function e(i,r,n){var a;a=s.call(this,i,r,n)||this;var o=i.textTracks(),l=xt(We(a),a.handleTracksChange);return o.addEventListener("change",l),a.on("dispose",function(){o.removeEventListener("change",l)}),a}var t=e.prototype;return t.handleTracksChange=function(r){for(var n=this.player().textTracks(),a=!1,o=0,l=n.length;o<l;o++){var u=n[o];if(u.kind!==this.kind_&&u.mode==="showing"){a=!0;break}}a?this.disable():this.enable()},t.buildCSSClass=function(){return"vjs-descriptions-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+s.prototype.buildWrapperCSSClass.call(this)},e})(Ro);jg.prototype.kind_="descriptions";jg.prototype.controlText_="Descriptions";be.registerComponent("DescriptionsButton",jg);var Vg=(function(s){we(e,s);function e(i,r,n){return s.call(this,i,r,n)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-subtitles-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+s.prototype.buildWrapperCSSClass.call(this)},e})(Ro);Vg.prototype.kind_="subtitles";Vg.prototype.controlText_="Subtitles";be.registerComponent("SubtitlesButton",Vg);var Hg=(function(s){we(e,s);function e(i,r){var n;return r.track={player:i,kind:r.kind,label:r.kind+" settings",selectable:!1,default:!1,mode:"disabled"},r.selectable=!1,r.name="CaptionSettingsMenuItem",n=s.call(this,i,r)||this,n.addClass("vjs-texttrack-settings"),n.controlText(", opens "+r.kind+" settings dialog"),n}var t=e.prototype;return t.handleClick=function(r){this.player().getChild("textTrackSettings").open()},e})(nu);be.registerComponent("CaptionSettingsMenuItem",Hg);var qg=(function(s){we(e,s);function e(i,r,n){return s.call(this,i,r,n)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-captions-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-captions-button "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){var r=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(r.push(new Hg(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),s.prototype.createItems.call(this,r)},e})(Ro);qg.prototype.kind_="captions";qg.prototype.controlText_="Captions";be.registerComponent("CaptionsButton",qg);var HC=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(r,n,a){var o=s.prototype.createEl.call(this,r,n,a),l=o.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(l.appendChild(it("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),l.appendChild(it("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),o},e})(nu);be.registerComponent("SubsCapsMenuItem",HC);var zg=(function(s){we(e,s);function e(i,r){var n;return r===void 0&&(r={}),n=s.call(this,i,r)||this,n.label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(n.player_.language_)>-1&&(n.label_="captions"),n.menuButton_.controlText(Wt(n.label_)),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){var r=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(r.push(new Hg(this.player_,{kind:this.label_})),this.hideThreshold_+=1),r=s.prototype.createItems.call(this,r,HC),r},e})(Ro);zg.prototype.kinds_=["captions","subtitles"];zg.prototype.controlText_="Subtitles";be.registerComponent("SubsCapsButton",zg);var qC=(function(s){we(e,s);function e(i,r){var n,a=r.track,o=i.audioTracks();r.label=a.label||a.language||"Unknown",r.selected=a.enabled,n=s.call(this,i,r)||this,n.track=a,n.addClass("vjs-"+a.kind+"-menu-item");var l=function(){for(var c=arguments.length,h=new Array(c),f=0;f<c;f++)h[f]=arguments[f];n.handleTracksChange.apply(We(n),h)};return o.addEventListener("change",l),n.on("dispose",function(){o.removeEventListener("change",l)}),n}var t=e.prototype;return t.createEl=function(r,n,a){var o=s.prototype.createEl.call(this,r,n,a),l=o.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="main-desc"&&(l.appendChild(it("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),l.appendChild(it("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),o},t.handleClick=function(r){if(s.prototype.handleClick.call(this,r),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks)for(var n=this.player_.audioTracks(),a=0;a<n.length;a++){var o=n[a];o!==this.track&&(o.enabled=o===this.track)}},t.handleTracksChange=function(r){this.selected(this.track.enabled)},e})(ru);be.registerComponent("AudioTrackMenuItem",qC);var zC=(function(s){we(e,s);function e(i,r){return r===void 0&&(r={}),r.tracks=i.audioTracks(),s.call(this,i,r)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-audio-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-audio-button "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(r){r===void 0&&(r=[]),this.hideThreshold_=1;for(var n=this.player_.audioTracks(),a=0;a<n.length;a++){var o=n[a];r.push(new qC(this.player_,{track:o,selectable:!0,multiSelectable:!1}))}return r},e})(Ug);zC.prototype.controlText_="Audio Track";be.registerComponent("AudioTrackButton",zC);var Wg=(function(s){we(e,s);function e(i,r){var n,a=r.rate,o=parseFloat(a,10);return r.label=a,r.selected=o===i.playbackRate(),r.selectable=!0,r.multiSelectable=!1,n=s.call(this,i,r)||this,n.label=a,n.rate=o,n.on(i,"ratechange",function(l){return n.update(l)}),n}var t=e.prototype;return t.handleClick=function(r){s.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},t.update=function(r){this.selected(this.player().playbackRate()===this.rate)},e})(ru);Wg.prototype.contentElType="button";be.registerComponent("PlaybackRateMenuItem",Wg);var WC=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.menuButton_.el_.setAttribute("aria-describedby",n.labelElId_),n.updateVisibility(),n.updateLabel(),n.on(i,"loadstart",function(a){return n.updateVisibility(a)}),n.on(i,"ratechange",function(a){return n.updateLabel(a)}),n.on(i,"playbackrateschange",function(a){return n.handlePlaybackRateschange(a)}),n}var t=e.prototype;return t.createEl=function(){var r=s.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=it("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),r.appendChild(this.labelEl_),r},t.dispose=function(){this.labelEl_=null,s.prototype.dispose.call(this)},t.buildCSSClass=function(){return"vjs-playback-rate "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-playback-rate "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){for(var r=this.playbackRates(),n=[],a=r.length-1;a>=0;a--)n.push(new Wg(this.player(),{rate:r[a]+"x"}));return n},t.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},t.handleClick=function(r){var n=this.player().playbackRate(),a=this.playbackRates(),o=a.indexOf(n),l=(o+1)%a.length;this.player().playbackRate(a[l])},t.handlePlaybackRateschange=function(r){this.update()},t.playbackRates=function(){var r=this.player();return r.playbackRates&&r.playbackRates()||[]},t.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},t.updateVisibility=function(r){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},t.updateLabel=function(r){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},e})(Fg);WC.prototype.controlText_="Playback Rate";be.registerComponent("PlaybackRateMenuButton",WC);var GC=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-spacer "+s.prototype.buildCSSClass.call(this)},t.createEl=function(r,n,a){return r===void 0&&(r="div"),n===void 0&&(n={}),a===void 0&&(a={}),n.className||(n.className=this.buildCSSClass()),s.prototype.createEl.call(this,r,n,a)},e})(be);be.registerComponent("Spacer",GC);var ZM=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-custom-control-spacer "+s.prototype.buildCSSClass.call(this)},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},e})(GC);be.registerComponent("CustomControlSpacer",ZM);var Jc=(function(s){we(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},e})(be);Jc.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]};"exitPictureInPicture"in le&&Jc.prototype.options_.children.splice(Jc.prototype.options_.children.length-1,0,"pictureInPictureToggle");be.registerComponent("ControlBar",Jc);var KC=(function(s){we(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.on(i,"error",function(a){return n.open(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-error-display "+s.prototype.buildCSSClass.call(this)},t.content=function(){var r=this.player().error();return r?this.localize(r.message):""},e})(Lo);KC.prototype.options_=mt({},Lo.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});be.registerComponent("ErrorDisplay",KC);var jf="vjs-text-track-settings",H_=["#000","Black"],q_=["#00F","Blue"],z_=["#0FF","Cyan"],W_=["#0F0","Green"],G_=["#F0F","Magenta"],K_=["#F00","Red"],X_=["#FFF","White"],Q_=["#FF0","Yellow"],Vf=["1","Opaque"],Hf=["0.5","Semi-Transparent"],Y_=["0","Transparent"],Ds={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[H_,X_,K_,W_,q_,Q_,G_,z_]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Vf,Hf,Y_]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[X_,H_,K_,W_,q_,Q_,G_,z_]},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 e==="1.00"?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Vf,Hf]},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:[Y_,Hf,Vf]}};Ds.windowColor.options=Ds.backgroundColor.options;function XC(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function eR(s,e){var t=s.options[s.options.selectedIndex].value;return XC(t,e)}function tR(s,e,t){if(e){for(var i=0;i<s.options.length;i++)if(XC(s.options[i].value,t)===e){s.selectedIndex=i;break}}}var iR=(function(s){we(e,s);function e(i,r){var n;return r.temporary=!1,n=s.call(this,i,r)||this,n.updateDisplay=n.updateDisplay.bind(We(n)),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=it("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")}),n.el().appendChild(n.endDialog),n.setDefaults(),r.persistTextTrackSettings===void 0&&(n.options_.persistTextTrackSettings=n.options_.playerOptions.persistTextTrackSettings),n.on(n.$(".vjs-done-button"),"click",function(){n.saveSettings(),n.close()}),n.on(n.$(".vjs-default-button"),"click",function(){n.setDefaults(),n.updateDisplay()}),Qa(Ds,function(a){n.on(n.$(a.selector),"change",n.updateDisplay)}),n.options_.persistTextTrackSettings&&n.restoreSettings(),n}var t=e.prototype;return t.dispose=function(){this.endDialog=null,s.prototype.dispose.call(this)},t.createElSelect_=function(r,n,a){var o=this;n===void 0&&(n=""),a===void 0&&(a="label");var l=Ds[r],u=l.id.replace("%s",this.id_),c=[n,u].join(" ").trim();return["<"+a+' id="'+u+'" class="'+(a==="label"?"vjs-label":"")+'">',this.localize(l.label),"</"+a+">",'<select aria-labelledby="'+c+'">'].concat(l.options.map(function(h){var f=u+"-"+h[1].replace(/\W+/g,"");return['<option id="'+f+'" value="'+h[0]+'" ','aria-labelledby="'+c+" "+f+'">',o.localize(h[1]),"</option>"].join("")})).concat("</select>").join("")},t.createElFgColor_=function(){var r="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+r+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",r),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",r),"</span>","</fieldset>"].join("")},t.createElBgColor_=function(){var r="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+r+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",r),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",r),"</span>","</fieldset>"].join("")},t.createElWinColor_=function(){var r="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+r+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",r),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",r),"</span>","</fieldset>"].join("")},t.createElColors_=function(){return it("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},t.createElFont_=function(){return it("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.createElControls_=function(){var r=this.localize("restore all settings to the default values");return it("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+r+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+r+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},t.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},t.label=function(){return this.localize("Caption Settings Dialog")},t.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},t.buildCSSClass=function(){return s.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},t.getValues=function(){var r=this;return qO(Ds,function(n,a,o){var l=eR(r.$(a.selector),a.parser);return l!==void 0&&(n[o]=l),n},{})},t.setValues=function(r){var n=this;Qa(Ds,function(a,o){tR(n.$(a.selector),r[o],a.parser)})},t.setDefaults=function(){var r=this;Qa(Ds,function(n){var a=n.hasOwnProperty("default")?n.default:0;r.$(n.selector).selectedIndex=a})},t.restoreSettings=function(){var r;try{r=JSON.parse(D.localStorage.getItem(jf))}catch(n){Ye.warn(n)}r&&this.setValues(r)},t.saveSettings=function(){if(this.options_.persistTextTrackSettings){var r=this.getValues();try{Object.keys(r).length?D.localStorage.setItem(jf,JSON.stringify(r)):D.localStorage.removeItem(jf)}catch(n){Ye.warn(n)}}},t.updateDisplay=function(){var r=this.player_.getChild("textTrackDisplay");r&&r.updateDisplay()},t.conditionalBlur_=function(){this.previouslyActiveEl_=null;var r=this.player_.controlBar,n=r&&r.subsCapsButton,a=r&&r.captionsButton;n?n.focus():a&&a.focus()},e})(Lo);be.registerComponent("TextTrackSettings",iR);var rR=(function(s){we(e,s);function e(i,r){var n,a=r.ResizeObserver||D.ResizeObserver;r.ResizeObserver===null&&(a=!1);var o=kt({createEl:!a,reportTouchActivity:!1},r);return n=s.call(this,i,o)||this,n.ResizeObserver=r.ResizeObserver||D.ResizeObserver,n.loadListener_=null,n.resizeObserver_=null,n.debouncedHandler_=tM(function(){n.resizeHandler()},100,!1,We(n)),a?(n.resizeObserver_=new n.ResizeObserver(n.debouncedHandler_),n.resizeObserver_.observe(i.el())):(n.loadListener_=function(){if(!(!n.el_||!n.el_.contentWindow)){var l=n.debouncedHandler_,u=n.unloadListener_=function(){vi(this,"resize",l),vi(this,"unload",u),u=null};tr(n.el_.contentWindow,"unload",u),tr(n.el_.contentWindow,"resize",l)}},n.one("load",n.loadListener_)),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})},t.resizeHandler=function(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")},t.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,s.prototype.dispose.call(this)},e})(be);be.registerComponent("ResizeManager",rR);var nR={trackingThreshold:20,liveTolerance:15},sR=(function(s){we(e,s);function e(i,r){var n,a=kt(nR,r,{createEl:!1});return n=s.call(this,i,a)||this,n.handleVisibilityChange_=function(o){return n.handleVisibilityChange(o)},n.trackLiveHandler_=function(){return n.trackLive_()},n.handlePlay_=function(o){return n.handlePlay(o)},n.handleFirstTimeupdate_=function(o){return n.handleFirstTimeupdate(o)},n.handleSeeked_=function(o){return n.handleSeeked(o)},n.seekToLiveEdge_=function(o){return n.seekToLiveEdge(o)},n.reset_(),n.on(n.player_,"durationchange",function(o){return n.handleDurationchange(o)}),n.on(n.player_,"canplay",function(){return n.toggleTracking()}),eu&&"hidden"in le&&"visibilityState"in le&&n.on(le,"visibilitychange",n.handleVisibilityChange_),n}var t=e.prototype;return t.handleVisibilityChange=function(){this.player_.duration()===1/0&&(le.hidden?this.stopTracking():this.startTracking())},t.trackLive_=function(){var r=this.player_.seekable();if(!(!r||!r.length)){var n=Number(D.performance.now().toFixed(4)),a=this.lastTime_===-1?0:(n-this.lastTime_)/1e3;this.lastTime_=n,this.pastSeekEnd_=this.pastSeekEnd()+a;var o=this.liveCurrentTime(),l=this.player_.currentTime(),u=this.player_.paused()||this.seekedBehindLive_||Math.abs(o-l)>this.options_.liveTolerance;(!this.timeupdateSeen_||o===1/0)&&(u=!1),u!==this.behindLiveEdge_&&(this.behindLiveEdge_=u,this.trigger("liveedgechange"))}},t.handleDurationchange=function(){this.toggleTracking()},t.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},t.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Ar),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},t.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},t.handleSeeked=function(){var r=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&r>2,this.nextSeekedFromUser_=!1,this.trackLive_()},t.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},t.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},t.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},t.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},t.seekableEnd=function(){for(var r=this.player_.seekable(),n=[],a=r?r.length:0;a--;)n.push(r.end(a));return n.length?n.sort()[n.length-1]:1/0},t.seekableStart=function(){for(var r=this.player_.seekable(),n=[],a=r?r.length:0;a--;)n.push(r.start(a));return n.length?n.sort()[0]:0},t.liveWindow=function(){var r=this.liveCurrentTime();return r===1/0?0:r-this.seekableStart()},t.isLive=function(){return this.isTracking()},t.atLiveEdge=function(){return!this.behindLiveEdge()},t.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},t.pastSeekEnd=function(){var r=this.seekableEnd();return this.lastSeekEnd_!==-1&&r!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=r,this.pastSeekEnd_},t.behindLiveEdge=function(){return this.behindLiveEdge_},t.isTracking=function(){return typeof this.trackingInterval_=="number"},t.seekToLiveEdge=function(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},t.dispose=function(){this.off(le,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),s.prototype.dispose.call(this)},e})(be);be.registerComponent("LiveTracker",sR);var im=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var i=e.$$("source"),r=[],n="";if(!i.length)return!1;for(var a=0;a<i.length;a++){var o=i[a].src;o&&r.indexOf(o)===-1&&r.push(o)}return r.length?(r.length===1&&(n=r[0]),e.triggerSourceset(n),!0):!1},aR=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=le.createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var i=le.createDocumentFragment();t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",D.Element.prototype.appendChild.call(this,i),this.innerHTML}}),QC=function(e,t){for(var i={},r=0;r<e.length&&(i=Object.getOwnPropertyDescriptor(e[r],t),!(i&&i.set&&i.get));r++);return i.enumerable=!0,i.configurable=!0,i},oR=function(e){return QC([e.el(),D.HTMLMediaElement.prototype,D.Element.prototype,aR],"innerHTML")},J_=function(e){var t=e.el();if(!t.resetSourceWatch_){var i={},r=oR(e),n=function(o){return function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];var h=o.apply(t,u);return im(e),h}};["append","appendChild","insertAdjacentHTML"].forEach(function(a){t[a]&&(i[a]=t[a],t[a]=n(i[a]))}),Object.defineProperty(t,"innerHTML",kt(r,{set:n(r.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(i).forEach(function(a){t[a]=i[a]}),Object.defineProperty(t,"innerHTML",r)},e.one("sourceset",t.resetSourceWatch_)}},lR=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?CC(D.Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return D.Element.prototype.setAttribute.call(this,"src",e),e}}),uR=function(e){return QC([e.el(),D.HTMLMediaElement.prototype,lR],"src")},cR=function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var i=uR(e),r=t.setAttribute,n=t.load;Object.defineProperty(t,"src",kt(i,{set:function(o){var l=i.set.call(t,o);return e.triggerSourceset(t.src),l}})),t.setAttribute=function(a,o){var l=r.call(t,a,o);return/src/i.test(a)&&e.triggerSourceset(t.src),l},t.load=function(){var a=n.call(t);return im(e)||(e.triggerSourceset(""),J_(e)),a},t.currentSrc?e.triggerSourceset(t.currentSrc):im(e)||J_(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=n,t.setAttribute=r,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}}}},Gg=function(e,t,i,r){r===void 0&&(r=!0);var n=function(l){return Object.defineProperty(e,t,{value:l,enumerable:!0,writable:!0})},a={configurable:!0,enumerable:!0,get:function(){var l=i();return n(l),l}};return r&&(a.set=n),Object.defineProperty(e,t,a)},Ie=(function(s){we(e,s);function e(i,r){var n;n=s.call(this,i,r)||this;var a=i.source,o=!1;if(n.featuresVideoFrameCallback=n.featuresVideoFrameCallback&&n.el_.tagName==="VIDEO",a&&(n.el_.currentSrc!==a.src||i.tag&&i.tag.initNetworkState_===3)?n.setSource(a):n.handleLateInit_(n.el_),i.enableSourceset&&n.setupSourcesetHandling_(),n.isScrubbing_=!1,n.el_.hasChildNodes()){for(var l=n.el_.childNodes,u=l.length,c=[];u--;){var h=l[u],f=h.nodeName.toLowerCase();f==="track"&&(n.featuresNativeTextTracks?(n.remoteTextTrackEls().addTrackElement_(h),n.remoteTextTracks().addTrack(h.track),n.textTracks().addTrack(h.track),!o&&!n.el_.hasAttribute("crossorigin")&&Yh(h.src)&&(o=!0)):c.push(h))}for(var g=0;g<c.length;g++)n.el_.removeChild(c[g])}return n.proxyNativeTracks_(),n.featuresNativeTextTracks&&o&&Ye.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
258
+ This may prevent text tracks from loading.`),n.restoreMetadataTracksInIOSNativePlayer_(),(po||Sg||Q1)&&i.nativeControlsForTouch===!0&&n.setControls(!0),n.proxyWebkitFullscreen_(),n.triggerReady(),n}var t=e.prototype;return t.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),e.disposeMediaElement(this.el_),this.options_=null,s.prototype.dispose.call(this)},t.setupSourcesetHandling_=function(){cR(this)},t.restoreMetadataTracksInIOSNativePlayer_=function(){var r=this.textTracks(),n,a=function(){n=[];for(var u=0;u<r.length;u++){var c=r[u];c.kind==="metadata"&&n.push({track:c,storedMode:c.mode})}};a(),r.addEventListener("change",a),this.on("dispose",function(){return r.removeEventListener("change",a)});var o=function l(){for(var u=0;u<n.length;u++){var c=n[u];c.track.mode==="disabled"&&c.track.mode!==c.storedMode&&(c.track.mode=c.storedMode)}r.removeEventListener("change",l)};this.on("webkitbeginfullscreen",function(){r.removeEventListener("change",a),r.removeEventListener("change",o),r.addEventListener("change",o)}),this.on("webkitendfullscreen",function(){r.removeEventListener("change",a),r.addEventListener("change",a),r.removeEventListener("change",o)})},t.overrideNative_=function(r,n){var a=this;if(n===this["featuresNative"+r+"Tracks"]){var o=r.toLowerCase();this[o+"TracksListeners_"]&&Object.keys(this[o+"TracksListeners_"]).forEach(function(l){var u=a.el()[o+"Tracks"];u.removeEventListener(l,a[o+"TracksListeners_"][l])}),this["featuresNative"+r+"Tracks"]=!n,this[o+"TracksListeners_"]=null,this.proxyNativeTracksForType_(o)}},t.overrideNativeAudioTracks=function(r){this.overrideNative_("Audio",r)},t.overrideNativeVideoTracks=function(r){this.overrideNative_("Video",r)},t.proxyNativeTracksForType_=function(r){var n=this,a=dr[r],o=this.el()[a.getterName],l=this[a.getterName]();if(!(!this["featuresNative"+a.capitalName+"Tracks"]||!o||!o.addEventListener)){var u={change:function(f){var g={type:"change",target:l,currentTarget:l,srcElement:l};l.trigger(g),r==="text"&&n[yo.remoteText.getterName]().trigger(g)},addtrack:function(f){l.addTrack(f.track)},removetrack:function(f){l.removeTrack(f.track)}},c=function(){for(var f=[],g=0;g<l.length;g++){for(var C=!1,p=0;p<o.length;p++)if(o[p]===l[g]){C=!0;break}C||f.push(l[g])}for(;f.length;)l.removeTrack(f.shift())};this[a.getterName+"Listeners_"]=u,Object.keys(u).forEach(function(h){var f=u[h];o.addEventListener(h,f),n.on("dispose",function(g){return o.removeEventListener(h,f)})}),this.on("loadstart",c),this.on("dispose",function(h){return n.off("loadstart",c)})}},t.proxyNativeTracks_=function(){var r=this;dr.names.forEach(function(n){r.proxyNativeTracksForType_(n)})},t.createEl=function(){var r=this.options_.tag;if(!r||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(r){var n=r.cloneNode(!0);r.parentNode&&r.parentNode.insertBefore(n,r),e.disposeMediaElement(r),r=n}else{r=le.createElement("video");var a=this.options_.tag&&pn(this.options_.tag),o=kt({},a);(!po||this.options_.nativeControlsForTouch!==!0)&&delete o.controls,nC(r,Vt(o,{id:this.options_.techId,class:"vjs-tech"}))}r.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&mo(r,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(r.disablePictureInPicture=this.options_.disablePictureInPicture);for(var l=["loop","muted","playsinline","autoplay"],u=0;u<l.length;u++){var c=l[u],h=this.options_[c];typeof h<"u"&&(h?mo(r,c,c):Wh(r,c),r[c]=h)}return r},t.handleLateInit_=function(r){if(!(r.networkState===0||r.networkState===3)){if(r.readyState===0){var n=!1,a=function(){n=!0};this.on("loadstart",a);var o=function(){n||this.trigger("loadstart")};this.on("loadedmetadata",o),this.ready(function(){this.off("loadstart",a),this.off("loadedmetadata",o),n||this.trigger("loadstart")});return}var l=["loadstart"];l.push("loadedmetadata"),r.readyState>=2&&l.push("loadeddata"),r.readyState>=3&&l.push("canplay"),r.readyState>=4&&l.push("canplaythrough"),this.ready(function(){l.forEach(function(u){this.trigger(u)},this)})}},t.setScrubbing=function(r){this.isScrubbing_=r},t.scrubbing=function(){return this.isScrubbing_},t.setCurrentTime=function(r){try{this.isScrubbing_&&this.el_.fastSeek&&zh?this.el_.fastSeek(r):this.el_.currentTime=r}catch(n){Ye(n,"Video is not ready. (Video.js)")}},t.duration=function(){var r=this;if(this.el_.duration===1/0&&wn&&kn&&this.el_.currentTime===0){var n=function a(){r.el_.currentTime>0&&(r.el_.duration===1/0&&r.trigger("durationchange"),r.off("timeupdate",a))};return this.on("timeupdate",n),NaN}return this.el_.duration||NaN},t.width=function(){return this.el_.offsetWidth},t.height=function(){return this.el_.offsetHeight},t.proxyWebkitFullscreen_=function(){var r=this;if("webkitDisplayingFullscreen"in this.el_){var n=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},a=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",n),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",a),this.on("dispose",function(){r.off("webkitbeginfullscreen",a),r.off("webkitendfullscreen",n)})}},t.supportsFullScreen=function(){if(typeof this.el_.webkitEnterFullScreen=="function"){var r=D.navigator&&D.navigator.userAgent||"";if(/Android/.test(r)||!/Chrome|Mac OS X 10.5/.test(r))return!0}return!1},t.enterFullScreen=function(){var r=this.el_;if(r.paused&&r.networkState<=r.HAVE_METADATA)Wr(this.el_.play()),this.setTimeout(function(){r.pause();try{r.webkitEnterFullScreen()}catch(n){this.trigger("fullscreenerror",n)}},0);else try{r.webkitEnterFullScreen()}catch(n){this.trigger("fullscreenerror",n)}},t.exitFullScreen=function(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()},t.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},t.requestVideoFrameCallback=function(r){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(r):s.prototype.requestVideoFrameCallback.call(this,r)},t.cancelVideoFrameCallback=function(r){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(r):s.prototype.cancelVideoFrameCallback.call(this,r)},t.src=function(r){if(r===void 0)return this.el_.src;this.setSrc(r)},t.reset=function(){e.resetMediaElement(this.el_)},t.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},t.setControls=function(r){this.el_.controls=!!r},t.addTextTrack=function(r,n,a){return this.featuresNativeTextTracks?this.el_.addTextTrack(r,n,a):s.prototype.addTextTrack.call(this,r,n,a)},t.createRemoteTextTrack=function(r){if(!this.featuresNativeTextTracks)return s.prototype.createRemoteTextTrack.call(this,r);var n=le.createElement("track");return r.kind&&(n.kind=r.kind),r.label&&(n.label=r.label),(r.language||r.srclang)&&(n.srclang=r.language||r.srclang),r.default&&(n.default=r.default),r.id&&(n.id=r.id),r.src&&(n.src=r.src),n},t.addRemoteTextTrack=function(r,n){var a=s.prototype.addRemoteTextTrack.call(this,r,n);return this.featuresNativeTextTracks&&this.el().appendChild(a),a},t.removeRemoteTextTrack=function(r){if(s.prototype.removeRemoteTextTrack.call(this,r),this.featuresNativeTextTracks)for(var n=this.$$("track"),a=n.length;a--;)(r===n[a]||r===n[a].track)&&this.el().removeChild(n[a])},t.getVideoPlaybackQuality=function(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();var r={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(r.droppedVideoFrames=this.el().webkitDroppedFrameCount,r.totalVideoFrames=this.el().webkitDecodedFrameCount),D.performance&&typeof D.performance.now=="function"?r.creationTime=D.performance.now():D.performance&&D.performance.timing&&typeof D.performance.timing.navigationStart=="number"&&(r.creationTime=D.Date.now()-D.performance.timing.navigationStart),r},e})(St);Gg(Ie,"TEST_VID",function(){if(Po()){var s=le.createElement("video"),e=le.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s}});Ie.isSupported=function(){try{Ie.TEST_VID.volume=.5}catch{return!1}return!!(Ie.TEST_VID&&Ie.TEST_VID.canPlayType)};Ie.canPlayType=function(s){return Ie.TEST_VID.canPlayType(s)};Ie.canPlaySource=function(s,e){return Ie.canPlayType(s.type)};Ie.canControlVolume=function(){try{var s=Ie.TEST_VID.volume;Ie.TEST_VID.volume=s/2+.1;var e=s!==Ie.TEST_VID.volume;return e&&Di?(D.setTimeout(function(){Ie&&Ie.prototype&&(Ie.prototype.featuresVolumeControl=s!==Ie.TEST_VID.volume)}),!1):e}catch{return!1}};Ie.canMuteVolume=function(){try{var s=Ie.TEST_VID.muted;return Ie.TEST_VID.muted=!s,Ie.TEST_VID.muted?mo(Ie.TEST_VID,"muted","muted"):Wh(Ie.TEST_VID,"muted","muted"),s!==Ie.TEST_VID.muted}catch{return!1}};Ie.canControlPlaybackRate=function(){if(wn&&kn&&J1<58)return!1;try{var s=Ie.TEST_VID.playbackRate;return Ie.TEST_VID.playbackRate=s/2+.1,s!==Ie.TEST_VID.playbackRate}catch{return!1}};Ie.canOverrideAttributes=function(){try{var s=function(){};Object.defineProperty(le.createElement("video"),"src",{get:s,set:s}),Object.defineProperty(le.createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(le.createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(le.createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0};Ie.supportsNativeTextTracks=function(){return zh||Di&&kn};Ie.supportsNativeVideoTracks=function(){return!!(Ie.TEST_VID&&Ie.TEST_VID.videoTracks)};Ie.supportsNativeAudioTracks=function(){return!!(Ie.TEST_VID&&Ie.TEST_VID.audioTracks)};Ie.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(s){var e=s[0],t=s[1];Gg(Ie.prototype,e,function(){return Ie[t]()},!0)});Ie.prototype.featuresVolumeControl=Ie.canControlVolume();Ie.prototype.movingMediaElementInDOM=!Di;Ie.prototype.featuresFullscreenResize=!0;Ie.prototype.featuresProgressEvents=!0;Ie.prototype.featuresTimeupdateEvents=!0;Ie.prototype.featuresVideoFrameCallback=!!(Ie.TEST_VID&&Ie.TEST_VID.requestVideoFrameCallback);var Zc;Ie.patchCanPlayType=function(){_g>=4&&!Y1&&!kn&&(Zc=Ie.TEST_VID&&Ie.TEST_VID.constructor.prototype.canPlayType,Ie.TEST_VID.constructor.prototype.canPlayType=function(s){var e=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;return s&&e.test(s)?"maybe":Zc.call(this,s)})};Ie.unpatchCanPlayType=function(){var s=Ie.TEST_VID.constructor.prototype.canPlayType;return Zc&&(Ie.TEST_VID.constructor.prototype.canPlayType=Zc),s};Ie.patchCanPlayType();Ie.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch{}})()}};Ie.resetMediaElement=function(s){if(s){for(var e=s.querySelectorAll("source"),t=e.length;t--;)s.removeChild(e[t]);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch{}})()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){Ie.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){Ie.prototype["set"+Wt(s)]=function(e){this.el_[s]=e,e?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){Ie.prototype[s]=function(){return this.el_[s]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){Ie.prototype["set"+Wt(s)]=function(e){this.el_[s]=e}});["pause","load","play"].forEach(function(s){Ie.prototype[s]=function(){return this.el_[s]()}});St.withSourceHandlers(Ie);Ie.nativeSourceHandler={};Ie.nativeSourceHandler.canPlayType=function(s){try{return Ie.TEST_VID.canPlayType(s)}catch{return""}};Ie.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return Ie.nativeSourceHandler.canPlayType(s.type);if(s.src){var t=Ig(s.src);return Ie.nativeSourceHandler.canPlayType("video/"+t)}return""};Ie.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)};Ie.nativeSourceHandler.dispose=function(){};Ie.registerSourceHandler(Ie.nativeSourceHandler);St.registerTech("Html5",Ie);var YC=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],qf={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},rm=["tiny","xsmall","small","medium","large","xlarge","huge"],_c={};rm.forEach(function(s){var e=s.charAt(0)==="x"?"x-"+s.substring(1):s;_c[s]="vjs-layout-"+e});var hR={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Kt=(function(s){we(e,s);function e(i,r,n){var a;if(i.id=i.id||r.id||"vjs_video_"+xn(),r=Vt(e.getTagSettings(i),r),r.initChildren=!1,r.createEl=!1,r.evented=!1,r.reportTouchActivity=!1,!r.language)if(typeof i.closest=="function"){var o=i.closest("[lang]");o&&o.getAttribute&&(r.language=o.getAttribute("lang"))}else for(var l=i;l&&l.nodeType===1;){if(pn(l).hasOwnProperty("lang")){r.language=l.getAttribute("lang");break}l=l.parentNode}if(a=s.call(this,null,r,n)||this,a.boundDocumentFullscreenChange_=function(f){return a.documentFullscreenChange_(f)},a.boundFullWindowOnEscKey_=function(f){return a.fullWindowOnEscKey(f)},a.boundUpdateStyleEl_=function(f){return a.updateStyleEl_(f)},a.boundApplyInitTime_=function(f){return a.applyInitTime_(f)},a.boundUpdateCurrentBreakpoint_=function(f){return a.updateCurrentBreakpoint_(f)},a.boundHandleTechClick_=function(f){return a.handleTechClick_(f)},a.boundHandleTechDoubleClick_=function(f){return a.handleTechDoubleClick_(f)},a.boundHandleTechTouchStart_=function(f){return a.handleTechTouchStart_(f)},a.boundHandleTechTouchMove_=function(f){return a.handleTechTouchMove_(f)},a.boundHandleTechTouchEnd_=function(f){return a.handleTechTouchEnd_(f)},a.boundHandleTechTap_=function(f){return a.handleTechTap_(f)},a.isFullscreen_=!1,a.log=G1(a.id_),a.fsApi_=Kc,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,a.audioOnlyMode_=!1,a.audioPosterMode_=!1,a.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!a.options_||!a.options_.techOrder||!a.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(a.tag=i,a.tagAttributes=i&&pn(i),a.language(a.options_.language),r.languages){var u={};Object.getOwnPropertyNames(r.languages).forEach(function(f){u[f.toLowerCase()]=r.languages[f]}),a.languages_=u}else a.languages_=e.prototype.options_.languages;a.resetCache_(),a.poster_=r.poster||"",a.controls_=!!r.controls,i.controls=!1,i.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],i.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),r.plugins&&Object.keys(r.plugins).forEach(function(f){if(typeof a[f]!="function")throw new Error('plugin "'+f+'" does not exist')}),a.scrubbing_=!1,a.el_=a.createEl(),kg(We(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(tr(le,a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var c=kt(a.options_);r.plugins&&Object.keys(r.plugins).forEach(function(f){a[f](r.plugins[f])}),r.debug&&a.debug(!0),a.options_.playerOptions=c,a.middleware_=[],a.playbackRates(r.playbackRates),a.initChildren(),a.isAudio(i.nodeName.toLowerCase()==="audio"),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),po&&a.addClass("vjs-touch-enabled"),Di||a.addClass("vjs-workinghover"),e.players[a.id_]=We(a);var h=q1.split(".")[0];return a.addClass("vjs-v"+h),a.userActive(!0),a.reportUserActivity(),a.one("play",function(f){return a.listenForUserActivity_(f)}),a.on("stageclick",function(f){return a.handleStageClick_(f)}),a.on("keydown",function(f){return a.handleKeyDown(f)}),a.on("languagechange",function(f){return a.handleLanguagechange(f)}),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a.on("ready",function(){a.audioPosterMode(a.options_.audioPosterMode),a.audioOnlyMode(a.options_.audioOnlyMode)}),a}var t=e.prototype;return t.dispose=function(){var r=this;this.trigger("dispose"),this.off("dispose"),vi(le,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),vi(le,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),e.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),DM(this),Ei.names.forEach(function(n){var a=Ei[n],o=r[a.getterName]();o&&o.off&&o.off()}),s.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},t.createEl=function(){var r=this.tag,n,a=this.playerElIngest_=r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player"),o=this.tag.tagName.toLowerCase()==="video-js";a?n=this.el_=r.parentNode:o||(n=this.el_=s.prototype.createEl.call(this,"div"));var l=pn(r);if(o){for(n=this.el_=r,r=this.tag=le.createElement("video");n.children.length;)r.appendChild(n.firstChild);Ws(n,"video-js")||bn(n,"video-js"),n.appendChild(r),a=this.playerElIngest_=n,Object.keys(n).forEach(function(C){try{r[C]=n[C]}catch{}})}if(r.setAttribute("tabindex","-1"),l.tabindex="-1",(eu||kn&&Z1)&&(r.setAttribute("role","application"),l.role="application"),r.removeAttribute("width"),r.removeAttribute("height"),"width"in l&&delete l.width,"height"in l&&delete l.height,Object.getOwnPropertyNames(l).forEach(function(C){o&&C==="class"||n.setAttribute(C,l[C]),o&&r.setAttribute(C,l[C])}),r.playerId=r.id,r.id+="_html5_api",r.className="vjs-tech",r.player=n.player=this,this.addClass("vjs-paused"),D.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=pC("vjs-styles-dimensions");var u=is(".vjs-styles-defaults"),c=is("head");c.insertBefore(this.styleEl_,u?u.nextSibling:c.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var h=r.getElementsByTagName("a"),f=0;f<h.length;f++){var g=h.item(f);bn(g,"vjs-hidden"),g.setAttribute("hidden","hidden")}return r.initNetworkState_=r.networkState,r.parentNode&&!a&&r.parentNode.insertBefore(n,r),Xp(r,n),this.children_.unshift(r),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=n,n},t.crossOrigin=function(r){if(!r)return this.techGet_("crossOrigin");if(r!=="anonymous"&&r!=="use-credentials"){Ye.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+r+'"');return}this.techCall_("setCrossOrigin",r)},t.width=function(r){return this.dimension("width",r)},t.height=function(r){return this.dimension("height",r)},t.dimension=function(r,n){var a=r+"_";if(n===void 0)return this[a]||0;if(n===""||n==="auto"){this[a]=void 0,this.updateStyleEl_();return}var o=parseFloat(n);if(isNaN(o)){Ye.error('Improper value "'+n+'" supplied for for '+r);return}this[a]=o,this.updateStyleEl_()},t.fluid=function(r){var n=this;if(r===void 0)return!!this.fluid_;this.fluid_=!!r,Sn(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),r?(this.addClass("vjs-fluid"),this.fill(!1),iM(this,function(){n.on(["playerreset","resize"],n.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()},t.fill=function(r){if(r===void 0)return!!this.fill_;this.fill_=!!r,r?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},t.aspectRatio=function(r){if(r===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(r))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=r,this.fluid(!0),this.updateStyleEl_()},t.updateStyleEl_=function(){if(D.VIDEOJS_NO_DYNAMIC_STYLE===!0){var r=typeof this.width_=="number"?this.width_:this.options_.width,n=typeof this.height_=="number"?this.height_:this.options_.height,a=this.tech_&&this.tech_.el();a&&(r>=0&&(a.width=r),n>=0&&(a.height=n));return}var o,l,u,c;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?u=this.aspectRatio_:this.videoWidth()>0?u=this.videoWidth()+":"+this.videoHeight():u="16:9";var h=u.split(":"),f=h[1]/h[0];this.width_!==void 0?o=this.width_:this.height_!==void 0?o=this.height_/f:o=this.videoWidth()||300,this.height_!==void 0?l=this.height_:l=o*f,/^[^a-zA-Z]/.test(this.id())?c="dimensions-"+this.id():c=this.id()+"-dimensions",this.addClass(c),mC(this.styleEl_,`
259
+ .`+c+` {
260
+ width: `+o+`px;
261
+ height: `+l+`px;
262
+ }
263
+
264
+ .`+c+`.vjs-fluid:not(.vjs-audio-only-mode) {
265
+ padding-top: `+f*100+`%;
266
+ }
267
+ `)},t.loadTech_=function(r,n){var a=this;this.tech_&&this.unloadTech_();var o=Wt(r),l=r.charAt(0).toLowerCase()+r.slice(1);o!=="Html5"&&this.tag&&(St.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=o,this.isReady_=!1;var u=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(u=!1);var c={source:n,autoplay:u,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+l+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};Ei.names.forEach(function(f){var g=Ei[f];c[g.getterName]=a[g.privateName]}),Vt(c,this.options_[o]),Vt(c,this.options_[l]),Vt(c,this.options_[r.toLowerCase()]),this.tag&&(c.tag=this.tag),n&&n.src===this.cache_.src&&this.cache_.currentTime>0&&(c.startTime=this.cache_.currentTime);var h=St.getTech(r);if(!h)throw new Error("No Tech named '"+o+"' exists! '"+o+"' should be registered using videojs.registerTech()'");this.tech_=new h(c),this.tech_.ready(xt(this,this.handleTechReady_),!0),L_.jsonToTextTracks(this.textTracksJson_||[],this.tech_),YC.forEach(function(f){a.on(a.tech_,f,function(g){return a["handleTech"+Wt(f)+"_"](g)})}),Object.keys(qf).forEach(function(f){a.on(a.tech_,f,function(g){if(a.tech_.playbackRate()===0&&a.tech_.seeking()){a.queuedCallbacks_.push({callback:a["handleTech"+qf[f]+"_"].bind(a),event:g});return}a["handleTech"+qf[f]+"_"](g)})}),this.on(this.tech_,"loadstart",function(f){return a.handleTechLoadStart_(f)}),this.on(this.tech_,"sourceset",function(f){return a.handleTechSourceset_(f)}),this.on(this.tech_,"waiting",function(f){return a.handleTechWaiting_(f)}),this.on(this.tech_,"ended",function(f){return a.handleTechEnded_(f)}),this.on(this.tech_,"seeking",function(f){return a.handleTechSeeking_(f)}),this.on(this.tech_,"play",function(f){return a.handleTechPlay_(f)}),this.on(this.tech_,"firstplay",function(f){return a.handleTechFirstPlay_(f)}),this.on(this.tech_,"pause",function(f){return a.handleTechPause_(f)}),this.on(this.tech_,"durationchange",function(f){return a.handleTechDurationChange_(f)}),this.on(this.tech_,"fullscreenchange",function(f,g){return a.handleTechFullscreenChange_(f,g)}),this.on(this.tech_,"fullscreenerror",function(f,g){return a.handleTechFullscreenError_(f,g)}),this.on(this.tech_,"enterpictureinpicture",function(f){return a.handleTechEnterPictureInPicture_(f)}),this.on(this.tech_,"leavepictureinpicture",function(f){return a.handleTechLeavePictureInPicture_(f)}),this.on(this.tech_,"error",function(f){return a.handleTechError_(f)}),this.on(this.tech_,"posterchange",function(f){return a.handleTechPosterChange_(f)}),this.on(this.tech_,"textdata",function(f){return a.handleTechTextData_(f)}),this.on(this.tech_,"ratechange",function(f){return a.handleTechRateChange_(f)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(o!=="Html5"||!this.tag)&&Xp(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},t.unloadTech_=function(){var r=this;Ei.names.forEach(function(n){var a=Ei[n];r[a.privateName]=r[a.getterName]()}),this.textTracksJson_=L_.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},t.tech=function(r){return r===void 0&&Ye.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
268
+ See https://github.com/videojs/video.js/issues/2617 for more info.
269
+ `),this.tech_},t.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},t.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},t.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},t.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())},t.manualAutoplay_=function(r){var n=this;if(!(!this.tech_||typeof r!="string")){var a=function(){var u=n.muted();n.muted(!0);var c=function(){n.muted(u)};n.playTerminatedQueue_.push(c);var h=n.play();if(xl(h))return h.catch(function(f){throw c(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(f||""))})},o;if(r==="any"&&!this.muted()?(o=this.play(),xl(o)&&(o=o.catch(a))):r==="muted"&&!this.muted()?o=a():o=this.play(),!!xl(o))return o.then(function(){n.trigger({type:"autoplay-success",autoplay:r})}).catch(function(){n.trigger({type:"autoplay-failure",autoplay:r})})}},t.updateSourceCaches_=function(r){r===void 0&&(r="");var n=r,a="";typeof n!="string"&&(n=r.src,a=r.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],n&&!a&&(a=OM(this,n)),this.cache_.source=kt({},r,{src:n,type:a});for(var o=this.cache_.sources.filter(function(g){return g.src&&g.src===n}),l=[],u=this.$$("source"),c=[],h=0;h<u.length;h++){var f=pn(u[h]);l.push(f),f.src&&f.src===n&&c.push(f.src)}c.length&&!o.length?this.cache_.sources=l:o.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=n},t.handleTechSourceset_=function(r){var n=this;if(!this.changingSrc_){var a=function(c){return n.updateSourceCaches_(c)},o=this.currentSource().src,l=r.src;o&&!/^blob:/.test(o)&&/^blob:/.test(l)&&(!this.lastSource_||this.lastSource_.tech!==l&&this.lastSource_.player!==o)&&(a=function(){}),a(l),r.src||this.tech_.any(["sourceset","loadstart"],function(u){if(u.type!=="sourceset"){var c=n.techGet("currentSrc");n.lastSource_.tech=c,n.updateSourceCaches_(c)}})}this.lastSource_={player:this.currentSource().src,tech:r.src},this.trigger({src:r.src,type:"sourceset"})},t.hasStarted=function(r){if(r===void 0)return this.hasStarted_;r!==this.hasStarted_&&(this.hasStarted_=r,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},t.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},t.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(function(r){return r.callback(r.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},t.handleTechWaiting_=function(){var r=this;this.addClass("vjs-waiting"),this.trigger("waiting");var n=this.currentTime(),a=function o(){n!==r.currentTime()&&(r.removeClass("vjs-waiting"),r.off("timeupdate",o))};this.on("timeupdate",a)},t.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},t.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},t.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},t.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},t.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},t.handleTechFirstPlay_=function(){this.options_.starttime&&(Ye.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.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},t.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},t.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},t.handleTechClick_=function(r){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,r):this.paused()?Wr(this.play()):this.pause())},t.handleTechDoubleClick_=function(r){if(this.controls_){var n=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(a){return a.contains(r.target)});n||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,r):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}},t.handleTechTap_=function(){this.userActive(!this.userActive())},t.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},t.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},t.handleTechTouchEnd_=function(r){r.cancelable&&r.preventDefault()},t.handleStageClick_=function(){this.reportUserActivity()},t.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},t.documentFullscreenChange_=function(r){var n=r.target.player;if(!(n&&n!==this)){var a=this.el(),o=le[this.fsApi_.fullscreenElement]===a;!o&&a.matches?o=a.matches(":"+this.fsApi_.fullscreen):!o&&a.msMatchesSelector&&(o=a.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(o)}},t.handleTechFullscreenChange_=function(r,n){var a=this;n&&(n.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){a.removeClass("vjs-ios-native-fs")})),this.isFullscreen(n.isFullscreen))},t.handleTechFullscreenError_=function(r,n){this.trigger("fullscreenerror",n)},t.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},t.handleTechEnterPictureInPicture_=function(r){this.isInPictureInPicture(!0)},t.handleTechLeavePictureInPicture_=function(r){this.isInPictureInPicture(!1)},t.handleTechError_=function(){var r=this.tech_.error();this.error(r)},t.handleTechTextData_=function(){var r=null;arguments.length>1&&(r=arguments[1]),this.trigger("textdata",r)},t.getCache=function(){return this.cache_},t.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},t.techCall_=function(r,n){this.ready(function(){if(r in IM)return xM(this.middleware_,this.tech_,r,n);if(r in U_)return F_(this.middleware_,this.tech_,r,n);try{this.tech_&&this.tech_[r](n)}catch(a){throw Ye(a),a}},!0)},t.techGet_=function(r){if(!(!this.tech_||!this.tech_.isReady_)){if(r in AM)return kM(this.middleware_,this.tech_,r);if(r in U_)return F_(this.middleware_,this.tech_,r);try{return this.tech_[r]()}catch(n){throw this.tech_[r]===void 0?(Ye("Video.js: "+r+" method not defined for "+this.techName_+" playback technology.",n),n):n.name==="TypeError"?(Ye("Video.js: "+r+" unavailable on "+this.techName_+" playback technology element.",n),this.tech_.isReady_=!1,n):(Ye(n),n)}}},t.play=function(){var r=this,n=this.options_.Promise||D.Promise;return n?new n(function(a){r.play_(a)}):this.play_()},t.play_=function(r){var n=this;r===void 0&&(r=Wr),this.playCallbacks_.push(r);var a=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),o=!!(zh||Di);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!a){this.waitToPlay_=function(c){n.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!a&&o&&this.load();return}var l=this.techGet_("play"),u=o&&this.hasClass("vjs-ended");u&&this.resetProgressBar_(),l===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(l)},t.runPlayTerminatedQueue_=function(){var r=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],r.forEach(function(n){n()})},t.runPlayCallbacks_=function(r){var n=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],n.forEach(function(a){a(r)})},t.pause=function(){this.techCall_("pause")},t.paused=function(){return this.techGet_("paused")!==!1},t.played=function(){return this.techGet_("played")||Gs(0,0)},t.scrubbing=function(r){if(typeof r>"u")return this.scrubbing_;this.scrubbing_=!!r,this.techCall_("setScrubbing",this.scrubbing_),r?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},t.currentTime=function(r){if(typeof r<"u"){if(r<0&&(r=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=r,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",r),this.cache_.initTime=0;return}return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime},t.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},t.duration=function(r){if(r===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;r=parseFloat(r),r<0&&(r=1/0),r!==this.cache_.duration&&(this.cache_.duration=r,r===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(r)||this.trigger("durationchange"))},t.remainingTime=function(){return this.duration()-this.currentTime()},t.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},t.buffered=function(){var r=this.techGet_("buffered");return(!r||!r.length)&&(r=Gs(0,0)),r},t.bufferedPercent=function(){return bC(this.buffered(),this.duration())},t.bufferedEnd=function(){var r=this.buffered(),n=this.duration(),a=r.end(r.length-1);return a>n&&(a=n),a},t.volume=function(r){var n;if(r!==void 0){n=Math.max(0,Math.min(1,parseFloat(r))),this.cache_.volume=n,this.techCall_("setVolume",n),n>0&&this.lastVolume_(n);return}return n=parseFloat(this.techGet_("volume")),isNaN(n)?1:n},t.muted=function(r){if(r!==void 0){this.techCall_("setMuted",r);return}return this.techGet_("muted")||!1},t.defaultMuted=function(r){return r!==void 0?this.techCall_("setDefaultMuted",r):this.techGet_("defaultMuted")||!1},t.lastVolume_=function(r){if(r!==void 0&&r!==0){this.cache_.lastVolume=r;return}return this.cache_.lastVolume},t.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},t.isFullscreen=function(r){if(r!==void 0){var n=this.isFullscreen_;this.isFullscreen_=!!r,this.isFullscreen_!==n&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_},t.requestFullscreen=function(r){var n=this.options_.Promise||D.Promise;if(n){var a=this;return new n(function(o,l){function u(){a.off("fullscreenerror",h),a.off("fullscreenchange",c)}function c(){u(),o()}function h(g,C){u(),l(C)}a.one("fullscreenchange",c),a.one("fullscreenerror",h);var f=a.requestFullscreenHelper_(r);f&&(f.then(u,u),f.then(o,l))})}return this.requestFullscreenHelper_()},t.requestFullscreenHelper_=function(r){var n=this,a;if(this.fsApi_.prefixed||(a=this.options_.fullscreen&&this.options_.fullscreen.options||{},r!==void 0&&(a=r)),this.fsApi_.requestFullscreen){var o=this.el_[this.fsApi_.requestFullscreen](a);return o&&o.then(function(){return n.isFullscreen(!0)},function(){return n.isFullscreen(!1)}),o}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},t.exitFullscreen=function(){var r=this.options_.Promise||D.Promise;if(r){var n=this;return new r(function(a,o){function l(){n.off("fullscreenerror",c),n.off("fullscreenchange",u)}function u(){l(),a()}function c(f,g){l(),o(g)}n.one("fullscreenchange",u),n.one("fullscreenerror",c);var h=n.exitFullscreenHelper_();h&&(h.then(l,l),h.then(a,o))})}return this.exitFullscreenHelper_()},t.exitFullscreenHelper_=function(){var r=this;if(this.fsApi_.requestFullscreen){var n=le[this.fsApi_.exitFullscreen]();return n&&Wr(n.then(function(){return r.isFullscreen(!1)})),n}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},t.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=le.documentElement.style.overflow,tr(le,"keydown",this.boundFullWindowOnEscKey_),le.documentElement.style.overflow="hidden",bn(le.body,"vjs-full-window"),this.trigger("enterFullWindow")},t.fullWindowOnEscKey=function(r){Ge.isEventKey(r,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},t.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,vi(le,"keydown",this.boundFullWindowOnEscKey_),le.documentElement.style.overflow=this.docOrigOverflow,tu(le.body,"vjs-full-window"),this.trigger("exitFullWindow")},t.disablePictureInPicture=function(r){if(r===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",r),this.options_.disablePictureInPicture=r,this.trigger("disablepictureinpicturechanged")},t.isInPictureInPicture=function(r){if(r!==void 0){this.isInPictureInPicture_=!!r,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_},t.requestPictureInPicture=function(){if("pictureInPictureEnabled"in le&&this.disablePictureInPicture()===!1)return this.techGet_("requestPictureInPicture")},t.exitPictureInPicture=function(){if("pictureInPictureEnabled"in le)return le.exitPictureInPicture()},t.handleKeyDown=function(r){var n=this.options_.userActions;if(!(!n||!n.hotkeys)){var a=function(l){var u=l.tagName.toLowerCase();if(l.isContentEditable)return!0;var c=["button","checkbox","hidden","radio","reset","submit"];if(u==="input")return c.indexOf(l.type)===-1;var h=["textarea"];return h.indexOf(u)!==-1};a(this.el_.ownerDocument.activeElement)||(typeof n.hotkeys=="function"?n.hotkeys.call(this,r):this.handleHotkeys(r))}},t.handleHotkeys=function(r){var n=this.options_.userActions?this.options_.userActions.hotkeys:{},a=n.fullscreenKey,o=a===void 0?function(p){return Ge.isEventKey(p,"f")}:a,l=n.muteKey,u=l===void 0?function(p){return Ge.isEventKey(p,"m")}:l,c=n.playPauseKey,h=c===void 0?function(p){return Ge.isEventKey(p,"k")||Ge.isEventKey(p,"Space")}:c;if(o.call(this,r)){r.preventDefault(),r.stopPropagation();var f=be.getComponent("FullscreenToggle");le[this.fsApi_.fullscreenEnabled]!==!1&&f.prototype.handleClick.call(this,r)}else if(u.call(this,r)){r.preventDefault(),r.stopPropagation();var g=be.getComponent("MuteToggle");g.prototype.handleClick.call(this,r)}else if(h.call(this,r)){r.preventDefault(),r.stopPropagation();var C=be.getComponent("PlayToggle");C.prototype.handleClick.call(this,r)}},t.canPlayType=function(r){for(var n,a=0,o=this.options_.techOrder;a<o.length;a++){var l=o[a],u=St.getTech(l);if(u||(u=be.getComponent(l)),!u){Ye.error('The "'+l+'" tech is undefined. Skipped browser support check for that tech.');continue}if(u.isSupported()&&(n=u.canPlayType(r),n))return n}return""},t.selectSource=function(r){var n=this,a=this.options_.techOrder.map(function(h){return[h,St.getTech(h)]}).filter(function(h){var f=h[0],g=h[1];return g?g.isSupported():(Ye.error('The "'+f+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),o=function(f,g,C){var p;return f.some(function(b){return g.some(function(I){if(p=C(b,I),p)return!0})}),p},l,u=function(f){return function(g,C){return f(C,g)}},c=function(f,g){var C=f[0],p=f[1];if(p.canPlaySource(g,n.options_[C.toLowerCase()]))return{source:g,tech:C}};return this.options_.sourceOrder?l=o(r,a,u(c)):l=o(a,r,c),l||!1},t.handleSrc_=function(r,n){var a=this;if(typeof r>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var o=MM(r);if(!o.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,n||(this.cache_.sources=o),this.updateSourceCaches_(o[0]),EM(this,o[0],function(c,h){a.middleware_=h,n||(a.cache_.sources=o),a.updateSourceCaches_(c);var f=a.src_(c);if(f){if(o.length>1)return a.handleSrc_(o.slice(1));a.changingSrc_=!1,a.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),a.triggerReady();return}wM(h,a.tech_)}),this.options_.retryOnError&&o.length>1){var l=function(){a.error(null),a.handleSrc_(o.slice(1),!0)},u=function(){a.off("error",l)};this.one("error",l),this.one("playing",u),this.resetRetryOnError_=function(){a.off("error",l),a.off("playing",u)}}},t.src=function(r){return this.handleSrc_(r,!1)},t.src_=function(r){var n=this,a=this.selectSource([r]);return a?sM(a.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",r):this.techCall_("src",r.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(a.tech,a.source),this.tech_.ready(function(){n.changingSrc_=!1}),!1):!0},t.load=function(){this.techCall_("load")},t.reset=function(){var r=this,n=this.options_.Promise||D.Promise;if(this.paused()||!n)this.doReset_();else{var a=this.play();Wr(a.then(function(){return r.doReset_()}))}},t.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Sn(this)&&this.trigger("playerreset")},t.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},t.resetProgressBar_=function(){this.currentTime(0);var r=this.controlBar||{},n=r.durationDisplay,a=r.remainingTimeDisplay;n&&n.updateContent(),a&&a.updateContent()},t.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},t.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},t.currentSources=function(){var r=this.currentSource(),n=[];return Object.keys(r).length!==0&&n.push(r),this.cache_.sources||n},t.currentSource=function(){return this.cache_.source||{}},t.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},t.currentType=function(){return this.currentSource()&&this.currentSource().type||""},t.preload=function(r){if(r!==void 0){this.techCall_("setPreload",r),this.options_.preload=r;return}return this.techGet_("preload")},t.autoplay=function(r){if(r===void 0)return this.options_.autoplay||!1;var n;typeof r=="string"&&/(any|play|muted)/.test(r)||r===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=r,this.manualAutoplay_(typeof r=="string"?r:"play"),n=!1):r?this.options_.autoplay=!0:this.options_.autoplay=!1,n=typeof n>"u"?this.options_.autoplay:n,this.tech_&&this.techCall_("setAutoplay",n)},t.playsinline=function(r){return r!==void 0?(this.techCall_("setPlaysinline",r),this.options_.playsinline=r,this):this.techGet_("playsinline")},t.loop=function(r){if(r!==void 0){this.techCall_("setLoop",r),this.options_.loop=r;return}return this.techGet_("loop")},t.poster=function(r){if(r===void 0)return this.poster_;r||(r=""),r!==this.poster_&&(this.poster_=r,this.techCall_("setPoster",r),this.isPosterFromTech_=!1,this.trigger("posterchange"))},t.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var r=this.tech_.poster()||"";r!==this.poster_&&(this.poster_=r,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},t.controls=function(r){if(r===void 0)return!!this.controls_;r=!!r,this.controls_!==r&&(this.controls_=r,this.usingNativeControls()&&this.techCall_("setControls",r),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.usingNativeControls=function(r){if(r===void 0)return!!this.usingNativeControls_;r=!!r,this.usingNativeControls_!==r&&(this.usingNativeControls_=r,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},t.error=function(r){var n=this;if(r===void 0)return this.error_||null;if(ts("beforeerror").forEach(function(o){var l=o(n,r);if(!(Cn(l)&&!Array.isArray(l)||typeof l=="string"||typeof l=="number"||l===null)){n.log.error("please return a value that MediaError expects in beforeerror hooks");return}r=l}),this.options_.suppressNotSupportedError&&r&&r.code===4){var a=function(){this.error(r)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],a),this.one("loadstart",function(){this.off(["click","touchstart"],a)});return}if(r===null){this.error_=r,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new Ii(r),this.addClass("vjs-error"),Ye.error("(CODE:"+this.error_.code+" "+Ii.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),ts("error").forEach(function(o){return o(n,n.error_)})},t.reportUserActivity=function(r){this.userActivity_=!0},t.userActive=function(r){if(r===void 0)return this.userActive_;if(r=!!r,r!==this.userActive_){if(this.userActive_=r,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(n){n.stopPropagation(),n.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},t.listenForUserActivity_=function(){var r,n,a,o=xt(this,this.reportUserActivity),l=function(C){(C.screenX!==n||C.screenY!==a)&&(n=C.screenX,a=C.screenY,o())},u=function(){o(),this.clearInterval(r),r=this.setInterval(o,250)},c=function(C){o(),this.clearInterval(r)};this.on("mousedown",u),this.on("mousemove",l),this.on("mouseup",c),this.on("mouseleave",c);var h=this.getChild("controlBar");h&&!Di&&!wn&&(h.on("mouseenter",function(g){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),h.on("mouseleave",function(g){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",o),this.on("keyup",o);var f;this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(f);var g=this.options_.inactivityTimeout;g<=0||(f=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},g))}},250)},t.playbackRate=function(r){if(r!==void 0){this.techCall_("setPlaybackRate",r);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1},t.defaultPlaybackRate=function(r){return r!==void 0?this.techCall_("setDefaultPlaybackRate",r):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},t.isAudio=function(r){if(r!==void 0){this.isAudio_=!!r;return}return!!this.isAudio_},t.enableAudioOnlyUI_=function(){var r=this;this.addClass("vjs-audio-only-mode");var n=this.children(),a=this.getChild("ControlBar"),o=a&&a.currentHeight();n.forEach(function(l){l!==a&&l.el_&&!l.hasClass("vjs-hidden")&&(l.hide(),r.audioOnlyCache_.hiddenChildren.push(l))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(o),this.trigger("audioonlymodechange")},t.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(function(r){return r.show()}),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},t.audioOnlyMode=function(r){var n=this;if(typeof r!="boolean"||r===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=r;var a=this.options_.Promise||D.Promise;if(a){if(r){var o=[];return this.isInPictureInPicture()&&o.push(this.exitPictureInPicture()),this.isFullscreen()&&o.push(this.exitFullscreen()),this.audioPosterMode()&&o.push(this.audioPosterMode(!1)),a.all(o).then(function(){return n.enableAudioOnlyUI_()})}return a.resolve().then(function(){return n.disableAudioOnlyUI_()})}r?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},t.enablePosterModeUI_=function(){var r=this.tech_&&this.tech_;r.hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},t.disablePosterModeUI_=function(){var r=this.tech_&&this.tech_;r.show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},t.audioPosterMode=function(r){var n=this;if(typeof r!="boolean"||r===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=r;var a=this.options_.Promise||D.Promise;if(a){if(r){if(this.audioOnlyMode()){var o=this.audioOnlyMode(!1);return o.then(function(){n.enablePosterModeUI_()})}return a.resolve().then(function(){n.enablePosterModeUI_()})}return a.resolve().then(function(){n.disablePosterModeUI_()})}if(r){this.audioOnlyMode()&&this.audioOnlyMode(!1),this.enablePosterModeUI_();return}this.disablePosterModeUI_()},t.addTextTrack=function(r,n,a){if(this.tech_)return this.tech_.addTextTrack(r,n,a)},t.addRemoteTextTrack=function(r,n){if(this.tech_)return this.tech_.addRemoteTextTrack(r,n)},t.removeRemoteTextTrack=function(r){r===void 0&&(r={});var n=r,a=n.track;if(a||(a=r),this.tech_)return this.tech_.removeRemoteTextTrack(a)},t.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},t.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},t.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},t.language=function(r){if(r===void 0)return this.language_;this.language_!==String(r).toLowerCase()&&(this.language_=String(r).toLowerCase(),Sn(this)&&this.trigger("languagechange"))},t.languages=function(){return kt(e.prototype.options_.languages,this.languages_)},t.toJSON=function(){var r=kt(this.options_),n=r.tracks;r.tracks=[];for(var a=0;a<n.length;a++){var o=n[a];o=kt(o),o.player=void 0,r.tracks[a]=o}return r},t.createModal=function(r,n){var a=this;n=n||{},n.content=r||"";var o=new Lo(this,n);return this.addChild(o),o.on("dispose",function(){a.removeChild(o)}),o.open(),o},t.updateCurrentBreakpoint_=function(){if(this.responsive())for(var r=this.currentBreakpoint(),n=this.currentWidth(),a=0;a<rm.length;a++){var o=rm[a],l=this.breakpoints_[o];if(n<=l){if(r===o)return;r&&this.removeClass(_c[r]),this.addClass(_c[o]),this.breakpoint_=o;break}}},t.removeCurrentBreakpoint_=function(){var r=this.currentBreakpointClass();this.breakpoint_="",r&&this.removeClass(r)},t.breakpoints=function(r){return r===void 0?Vt(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=Vt({},hR,r),this.updateCurrentBreakpoint_(),Vt(this.breakpoints_))},t.responsive=function(r){if(r===void 0)return this.responsive_;r=!!r;var n=this.responsive_;if(r!==n)return this.responsive_=r,r?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),r},t.currentBreakpoint=function(){return this.breakpoint_},t.currentBreakpointClass=function(){return _c[this.breakpoint_]||""},t.loadMedia=function(r,n){var a=this;if(!(!r||typeof r!="object")){this.reset(),this.cache_.media=kt(r);var o=this.cache_.media,l=o.artwork,u=o.poster,c=o.src,h=o.textTracks;!l&&u&&(this.cache_.media.artwork=[{src:u,type:Yc(u)}]),c&&this.src(c),u&&this.poster(u),Array.isArray(h)&&h.forEach(function(f){return a.addRemoteTextTrack(f,!1)}),this.ready(n)}},t.getMedia=function(){if(!this.cache_.media){var r=this.poster(),n=this.currentSources(),a=Array.prototype.map.call(this.remoteTextTracks(),function(l){return{kind:l.kind,label:l.label,language:l.language,src:l.src}}),o={src:n,textTracks:a};return r&&(o.poster=r,o.artwork=[{src:o.poster,type:Yc(o.poster)}]),o}return kt(this.cache_.media)},e.getTagSettings=function(r){var n={sources:[],tracks:[]},a=pn(r),o=a["data-setup"];if(Ws(r,"vjs-fill")&&(a.fill=!0),Ws(r,"vjs-fluid")&&(a.fluid=!0),o!==null){var l=tL(o||"{}"),u=l[0],c=l[1];u&&Ye.error(u),Vt(a,c)}if(Vt(n,a),r.hasChildNodes())for(var h=r.childNodes,f=0,g=h.length;f<g;f++){var C=h[f],p=C.nodeName.toLowerCase();p==="source"?n.sources.push(pn(C)):p==="track"&&n.tracks.push(pn(C))}return n},t.flexNotSupported_=function(){var r=le.createElement("i");return!("flexBasis"in r.style||"webkitFlexBasis"in r.style||"mozFlexBasis"in r.style||"msFlexBasis"in r.style||"msFlexOrder"in r.style)},t.debug=function(r){if(r===void 0)return this.debugEnabled_;r?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)},t.playbackRates=function(r){if(r===void 0)return this.cache_.playbackRates;Array.isArray(r)&&r.every(function(n){return typeof n=="number"})&&(this.cache_.playbackRates=r,this.trigger("playbackrateschange"))},e})(be);Ei.names.forEach(function(s){var e=Ei[s];Kt.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});Kt.prototype.crossorigin=Kt.prototype.crossOrigin;Kt.players={};var sl=D.navigator;Kt.prototype.options_={techOrder:St.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:sl&&(sl.languages&&sl.languages[0]||sl.userLanguage||sl.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1};["ended","seeking","seekable","networkState","readyState"].forEach(function(s){Kt.prototype[s]=function(){return this.techGet_(s)}});YC.forEach(function(s){Kt.prototype["handleTech"+Wt(s)+"_"]=function(){return this.trigger(s)}});be.registerComponent("Player",Kt);var eh="plugin",Ya="activePlugins_",Fa={},th=function(e){return Fa.hasOwnProperty(e)},Tc=function(e){return th(e)?Fa[e]:void 0},JC=function(e,t){e[Ya]=e[Ya]||{},e[Ya][t]=!0},ih=function(e,t,i){var r=(i?"before":"")+"pluginsetup";e.trigger(r,t),e.trigger(r+":"+t.name,t)},dR=function(e,t){var i=function(){ih(this,{name:e,plugin:t,instance:null},!0);var n=t.apply(this,arguments);return JC(this,e),ih(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach(function(r){i[r]=t[r]}),i},Z_=function(e,t){return t.prototype.name=e,function(){ih(this,{name:e,plugin:t,instance:null},!0);for(var i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];var a=P1(t,[this].concat(r));return this[e]=function(){return a},ih(this,a.getEventHash()),a}},en=(function(){function s(t){if(this.constructor===s)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,this.log||(this.log=this.player.log.createLogger(this.name)),kg(this),delete this.trigger,TC(this,this.constructor.defaultState),JC(t,this.name),this.dispose=this.dispose.bind(this),t.on("dispose",this.dispose)}var e=s.prototype;return e.version=function(){return this.constructor.VERSION},e.getEventHash=function(i){return i===void 0&&(i={}),i.name=this.name,i.plugin=this.constructor,i.instance=this,i},e.trigger=function(i,r){return r===void 0&&(r={}),No(this.eventBusEl_,i,this.getEventHash(r))},e.handleStateChanged=function(i){},e.dispose=function(){var i=this.name,r=this.player;this.trigger("dispose"),this.off(),r.off("dispose",this.dispose),r[Ya][i]=!1,this.player=this.state=null,r[i]=Z_(i,Fa[i])},s.isBasic=function(i){var r=typeof i=="string"?Tc(i):i;return typeof r=="function"&&!s.prototype.isPrototypeOf(r.prototype)},s.registerPlugin=function(i,r){if(typeof i!="string")throw new Error('Illegal plugin name, "'+i+'", must be a string, was '+typeof i+".");if(th(i))Ye.warn('A plugin named "'+i+'" already exists. You may want to avoid re-registering plugins!');else if(Kt.prototype.hasOwnProperty(i))throw new Error('Illegal plugin name, "'+i+'", cannot share a name with an existing player method!');if(typeof r!="function")throw new Error('Illegal plugin for "'+i+'", must be a function, was '+typeof r+".");return Fa[i]=r,i!==eh&&(s.isBasic(r)?Kt.prototype[i]=dR(i,r):Kt.prototype[i]=Z_(i,r)),r},s.deregisterPlugin=function(i){if(i===eh)throw new Error("Cannot de-register base plugin.");th(i)&&(delete Fa[i],delete Kt.prototype[i])},s.getPlugins=function(i){i===void 0&&(i=Object.keys(Fa));var r;return i.forEach(function(n){var a=Tc(n);a&&(r=r||{},r[n]=a)}),r},s.getPluginVersion=function(i){var r=Tc(i);return r&&r.VERSION||""},s})();en.getPlugin=Tc;en.BASE_PLUGIN_NAME=eh;en.registerPlugin(eh,en);Kt.prototype.usingPlugin=function(s){return!!this[Ya]&&this[Ya][s]===!0};Kt.prototype.hasPlugin=function(s){return!!th(s)};var eT=!1,fR=function(e,t){t===void 0&&(t={}),eT||(Ye.warn("videojs.extend is deprecated as of Video.js 7.22.0 and will be removed in Video.js 8.0.0"),eT=!0);var i=function(){e.apply(this,arguments)},r={};typeof t=="object"?(t.constructor!==Object.prototype.constructor&&(i=t.constructor),r=t):typeof t=="function"&&(i=t),sL(i,e),e&&(i.super_=e);for(var n in r)r.hasOwnProperty(n)&&(i.prototype[n]=r[n]);return i},ZC=function(e){return e.indexOf("#")===0?e.slice(1):e};function re(s,e,t){var i=re.getPlayer(s);if(i)return e&&Ye.warn('Player "'+s+'" is already initialised. Options will not be applied.'),t&&i.ready(t),i;var r=typeof s=="string"?is("#"+ZC(s)):s;if(!Do(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");(!r.ownerDocument.defaultView||!r.ownerDocument.body.contains(r))&&Ye.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),ts("beforesetup").forEach(function(a){var o=a(r,kt(e));if(!Cn(o)||Array.isArray(o)){Ye.error("please return an object in beforesetup hooks");return}e=kt(e,o)});var n=be.getComponent("Player");return i=new n(r,e,t),ts("setup").forEach(function(a){return a(i)}),i}re.hooks_=vn;re.hooks=ts;re.hook=$O;re.hookOnce=jO;re.removeHook=z1;if(D.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Po()){var Zu=is(".vjs-styles-defaults");if(!Zu){Zu=pC("vjs-styles-defaults");var zf=is("head");zf&&zf.insertBefore(Zu,zf.firstChild),mC(Zu,`
270
+ .video-js {
271
+ width: 300px;
272
+ height: 150px;
273
+ }
274
+
275
+ .vjs-fluid:not(.vjs-audio-only-mode) {
276
+ padding-top: 56.25%
277
+ }
278
+ `)}}Yp(1,re);re.VERSION=q1;re.options=Kt.prototype.options_;re.getPlayers=function(){return Kt.players};re.getPlayer=function(s){var e=Kt.players,t;if(typeof s=="string"){var i=ZC(s),r=e[i];if(r)return r;t=is("#"+i)}else t=s;if(Do(t)){var n=t,a=n.player,o=n.playerId;if(a||e[o])return a||e[o]}};re.getAllPlayers=function(){return Object.keys(Kt.players).map(function(s){return Kt.players[s]}).filter(Boolean)};re.players=Kt.players;re.getComponent=be.getComponent;re.registerComponent=function(s,e){St.isTech(e)&&Ye.warn("The "+s+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),be.registerComponent.call(be,s,e)};re.getTech=St.getTech;re.registerTech=St.registerTech;re.use=CM;Object.defineProperty(re,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(re.middleware,"TERMINATOR",{value:Qc,writeable:!1,enumerable:!0});re.browser=GO;re.TOUCH_ENABLED=po;re.extend=fR;re.mergeOptions=kt;re.bind=xt;re.registerPlugin=en.registerPlugin;re.deregisterPlugin=en.deregisterPlugin;re.plugin=function(s,e){return Ye.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),en.registerPlugin(s,e)};re.getPlugins=en.getPlugins;re.getPlugin=en.getPlugin;re.getPluginVersion=en.getPluginVersion;re.addLanguage=function(s,e){var t;return s=(""+s).toLowerCase(),re.options.languages=kt(re.options.languages,(t={},t[s]=e,t)),re.options.languages[s]};re.log=Ye;re.createLogger=G1;re.createTimeRange=re.createTimeRanges=Gs;re.formatTime=_o;re.setFormatTime=VM;re.resetFormatTime=HM;re.parseUrl=Ag;re.isCrossOrigin=Yh;re.EventTarget=si;re.on=tr;re.one=Xh;re.off=vi;re.trigger=No;re.xhr=A1;re.TextTrack=iu;re.AudioTrack=EC;re.VideoTrack=wC;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(s){re[s]=function(){return Ye.warn("videojs."+s+"() is deprecated; use videojs.dom."+s+"() instead"),dC[s].apply(null,arguments)}});re.computedStyle=$l;re.dom=dC;re.url=_M;re.defineLazyProperty=Gg;re.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});/*! @name @videojs/http-streaming @version 2.16.3 @license Apache-2.0 */var wr=jh,rh=function(e,t,i){return e&&i&&i.responseURL&&t!==i.responseURL?i.responseURL:t},Pr=function(e){return re.log.debug?re.log.debug.bind(re,"VHS:",e+" >"):function(){}},rs=1/30,Gr=rs*3,eE=function(e,t){var i=[],r;if(e&&e.length)for(r=0;r<e.length;r++)t(e.start(r),e.end(r))&&i.push([e.start(r),e.end(r)]);return re.createTimeRanges(i)},Ua=function(e,t){return eE(e,function(i,r){return i-Gr<=t&&r+Gr>=t})},ec=function(e,t){return eE(e,function(i){return i-rs>=t})},pR=function(e){if(e.length<2)return re.createTimeRanges();for(var t=[],i=1;i<e.length;i++){var r=e.end(i-1),n=e.start(i);t.push([r,n])}return re.createTimeRanges(t)},mR=function(e,t){var i=null,r=null,n=0,a=[],o=[];if(!e||!e.length||!t||!t.length)return re.createTimeRange();for(var l=e.length;l--;)a.push({time:e.start(l),type:"start"}),a.push({time:e.end(l),type:"end"});for(l=t.length;l--;)a.push({time:t.start(l),type:"start"}),a.push({time:t.end(l),type:"end"});for(a.sort(function(u,c){return u.time-c.time}),l=0;l<a.length;l++)a[l].type==="start"?(n++,n===2&&(i=a[l].time)):a[l].type==="end"&&(n--,n===1&&(r=a[l].time)),i!==null&&r!==null&&(o.push([i,r]),i=null,r=null);return re.createTimeRanges(o)},tE=function(e){var t=[];if(!e||!e.length)return"";for(var i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},gR=function(e,t,i){i===void 0&&(i=1);var r=e.length?e.end(e.length-1):0;return(r-t)/i},Ms=function(e){for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},vR=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e||e.length!==t.length)return!0;for(var i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0;return!1},tT=function(e){if(!(!e||!e.length||!e.end))return e.end(e.length-1)},Kg=function(e,t){var i=0;if(!e||!e.length)return i;for(var r=0;r<e.length;r++){var n=e.start(r),a=e.end(r);if(!(t>a)){if(t>n&&t<=a){i+=a-t;continue}i+=a-n}}return i},iT=re.createTimeRange,Xg=function(e,t){if(!t.preload)return t.duration;var i=0;return(t.parts||[]).forEach(function(r){i+=r.duration}),(t.preloadHints||[]).forEach(function(r){r.type==="PART"&&(i+=e.partTargetDuration)}),i},nm=function(e){return(e.segments||[]).reduce(function(t,i,r){return i.parts?i.parts.forEach(function(n,a){t.push({duration:n.duration,segmentIndex:r,partIndex:a,part:n,segment:i})}):t.push({duration:i.duration,segmentIndex:r,partIndex:null,segment:i,part:null}),t},[])},iE=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},rE=function(e){var t=e.preloadSegment;if(t){var i=t.parts,r=t.preloadHints,n=(r||[]).reduce(function(a,o){return a+(o.type==="PART"?1:0)},0);return n+=i&&i.length?i.length:0,n}},nE=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var i=iE(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?t.partTargetDuration*3:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?t.targetDuration*3:0},yR=function(e,t){var i=0,r=t-e.mediaSequence,n=e.segments[r];if(n){if(typeof n.start<"u")return{result:n.start,precise:!0};if(typeof n.end<"u")return{result:n.end-n.duration,precise:!0}}for(;r--;){if(n=e.segments[r],typeof n.end<"u")return{result:i+n.end,precise:!0};if(i+=Xg(e,n),typeof n.start<"u")return{result:i+n.start,precise:!0}}return{result:i,precise:!1}},_R=function(e,t){for(var i=0,r,n=t-e.mediaSequence;n<e.segments.length;n++){if(r=e.segments[n],typeof r.start<"u")return{result:r.start-i,precise:!0};if(i+=Xg(e,r),typeof r.end<"u")return{result:r.end-i,precise:!0}}return{result:-1,precise:!1}},sE=function(e,t,i){if(typeof t>"u"&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;var r=yR(e,t);if(r.precise)return r.result;var n=_R(e,t);return n.precise?n.result:r.result+i},aE=function(e,t,i){if(!e)return 0;if(typeof i!="number"&&(i=0),typeof t>"u"){if(e.totalDuration)return e.totalDuration;if(!e.endList)return D.Infinity}return sE(e,t,i)},Al=function(e){var t=e.defaultDuration,i=e.durationList,r=e.startIndex,n=e.endIndex,a=0;if(r>n){var o=[n,r];r=o[0],n=o[1]}if(r<0){for(var l=r;l<Math.min(0,n);l++)a+=t;r=0}for(var u=r;u<n;u++)a+=i[u].duration;return a},oE=function(e,t,i,r){if(!e||!e.segments)return null;if(e.endList)return aE(e);if(t===null)return null;t=t||0;var n=sE(e,e.mediaSequence+e.segments.length,t);return i&&(r=typeof r=="number"?r:nE(null,e),n-=r),Math.max(0,n)},TR=function(e,t,i){var r=!0,n=t||0,a=oE(e,t,r,i);return a===null?iT():iT(n,a)},bR=function(e){for(var t=e.playlist,i=e.currentTime,r=e.startingSegmentIndex,n=e.startingPartIndex,a=e.startTime,o=e.experimentalExactManifestTimings,l=i-a,u=nm(t),c=0,h=0;h<u.length;h++){var f=u[h];if(r===f.segmentIndex&&!(typeof n=="number"&&typeof f.partIndex=="number"&&n!==f.partIndex)){c=h;break}}if(l<0){if(c>0)for(var g=c-1;g>=0;g--){var C=u[g];if(l+=C.duration,o){if(l<0)continue}else if(l+rs<=0)continue;return{partIndex:C.partIndex,segmentIndex:C.segmentIndex,startTime:a-Al({defaultDuration:t.targetDuration,durationList:u,startIndex:c,endIndex:g})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:i}}if(c<0){for(var p=c;p<0;p++)if(l-=t.targetDuration,l<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:i};c=0}for(var b=c;b<u.length;b++){var I=u[b];if(l-=I.duration,o){if(l>0)continue}else if(l-rs>=0)continue;return{partIndex:I.partIndex,segmentIndex:I.segmentIndex,startTime:a+Al({defaultDuration:t.targetDuration,durationList:u,startIndex:c,endIndex:b})}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:i}},lE=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},Qg=function(e){return e.excludeUntil&&e.excludeUntil===1/0},td=function(e){var t=lE(e);return!e.disabled&&!t},SR=function(e){return e.disabled},CR=function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},uE=function(e,t){return t.attributes&&t.attributes[e]},ER=function(e,t,i,r){if(r===void 0&&(r=0),!uE("BANDWIDTH",i))return NaN;var n=e*i.attributes.BANDWIDTH;return(n-r*8)/t},sm=function(e,t){if(e.playlists.length===1)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return e.playlists.filter(function(r){return td(r)?(r.attributes.BANDWIDTH||0)<i:!1}).length===0},Yg=function(e,t){return!e&&!t||!e&&t||e&&!t?!1:!!(e===t||e.id&&t.id&&e.id===t.id||e.resolvedUri&&t.resolvedUri&&e.resolvedUri===t.resolvedUri||e.uri&&t.uri&&e.uri===t.uri)},rT=function(e,t){var i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},r=!1;for(var n in i){for(var a in i[n])if(r=t(i[n][a]),r)break;if(r)break}return!!r},su=function(e){if(!e||!e.playlists||!e.playlists.length){var t=rT(e,function(a){return a.playlists&&a.playlists.length||a.uri});return t}for(var i=function(o){var l=e.playlists[o],u=l.attributes&&l.attributes.CODECS;if(u&&u.split(",").every(function(h){return L1(h)}))return"continue";var c=rT(e,function(h){return Yg(l,h)});return c?"continue":{v:!1}},r=0;r<e.playlists.length;r++){var n=i(r);if(n!=="continue"&&typeof n=="object")return n.v}return!0},ji={liveEdgeDelay:nE,duration:aE,seekable:TR,getMediaInfoForTime:bR,isEnabled:td,isDisabled:SR,isBlacklisted:lE,isIncompatible:Qg,playlistEnd:oE,isAes:CR,hasAttribute:uE,estimateSegmentRequestTime:ER,isLowestEnabledRendition:sm,isAudioOnly:su,playlistMatch:Yg,segmentDurationWithParts:Xg},cE=re.log,Jg=function(e,t){return e+"-"+t},wR=function(e,t,i){return"placeholder-uri-"+e+"-"+t+"-"+i},kR=function(e){var t=e.onwarn,i=e.oninfo,r=e.manifestString,n=e.customTagParsers,a=n===void 0?[]:n,o=e.customTagMappers,l=o===void 0?[]:o,u=e.experimentalLLHLS,c=new pL;t&&c.on("warn",t),i&&c.on("info",i),a.forEach(function(p){return c.addParser(p)}),l.forEach(function(p){return c.addTagMapper(p)}),c.push(r),c.end();var h=c.manifest;if(u||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(p){h.hasOwnProperty(p)&&delete h[p]}),h.segments&&h.segments.forEach(function(p){["parts","preloadHints"].forEach(function(b){p.hasOwnProperty(b)&&delete p[b]})})),!h.targetDuration){var f=10;h.segments&&h.segments.length&&(f=h.segments.reduce(function(p,b){return Math.max(p,b.duration)},0)),t&&t("manifest has no targetDuration defaulting to "+f),h.targetDuration=f}var g=iE(h);if(g.length&&!h.partTargetDuration){var C=g.reduce(function(p,b){return Math.max(p,b.duration)},0);t&&(t("manifest has no partTargetDuration defaulting to "+C),cE.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.")),h.partTargetDuration=C}return h},Bo=function(e,t){e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(function(i){if(e.mediaGroups[i])for(var r in e.mediaGroups[i])for(var n in e.mediaGroups[i][r]){var a=e.mediaGroups[i][r][n];t(a,i,r,n)}})},hE=function(e){var t=e.playlist,i=e.uri,r=e.id;t.id=r,t.playlistErrors_=0,i&&(t.uri=i),t.attributes=t.attributes||{}},xR=function(e){for(var t=e.playlists.length;t--;){var i=e.playlists[t];hE({playlist:i,id:Jg(t,i.uri)}),i.resolvedUri=wr(e.uri,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes.BANDWIDTH||cE.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},AR=function(e){Bo(e,function(t){t.uri&&(t.resolvedUri=wr(e.uri,t.uri))})},IR=function(e,t){var i=Jg(0,t),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:D.location.href,resolvedUri:D.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return r.playlists[i]=r.playlists[0],r.playlists[t]=r.playlists[0],r},dE=function(e,t,i){i===void 0&&(i=wR),e.uri=t;for(var r=0;r<e.playlists.length;r++)if(!e.playlists[r].uri){var n="placeholder-uri-"+r;e.playlists[r].uri=n}var a=su(e);Bo(e,function(o,l,u,c){if(!o.playlists||!o.playlists.length){if(a&&l==="AUDIO"&&!o.uri)for(var h=0;h<e.playlists.length;h++){var f=e.playlists[h];if(f.attributes&&f.attributes.AUDIO&&f.attributes.AUDIO===u)return}o.playlists=[mt({},o)]}o.playlists.forEach(function(g,C){var p=i(l,u,c,g),b=Jg(C,p);g.uri?g.resolvedUri=g.resolvedUri||wr(e.uri,g.uri):(g.uri=C===0?p:b,g.resolvedUri=g.uri),g.id=g.id||b,g.attributes=g.attributes||{},e.playlists[g.id]=g,e.playlists[g.uri]=g})}),xR(e),AR(e)},nh=re.mergeOptions,PR=re.EventTarget,DR=function(e,t){if(t.endList||!t.serverControl)return e;var i={};if(t.serverControl.canBlockReload){var r=t.preloadSegment,n=t.mediaSequence+t.segments.length;if(r){var a=r.parts||[],o=rE(t)-1;o>-1&&o!==a.length-1&&(i._HLS_part=o),(o>-1||a.length)&&n--}i._HLS_msn=n}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){var l=new D.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(u){i.hasOwnProperty(u)&&l.searchParams.set(u,i[u])}),e=l.toString()}return e},NR=function(e,t){if(!e)return t;var i=nh(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(var r=0;r<t.parts.length;r++)e.parts&&e.parts[r]&&(i.parts[r]=nh(e.parts[r],t.parts[r]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},LR=function(e,t,i){var r=e.slice(),n=t.slice();i=i||0;for(var a=[],o,l=0;l<n.length;l++){var u=r[l+i],c=n[l];u?(o=u.map||o,a.push(NR(u,c))):(o&&!c.map&&(c.map=o),a.push(c))}return a},fE=function(e,t){!e.resolvedUri&&e.uri&&(e.resolvedUri=wr(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=wr(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=wr(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=wr(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(function(i){i.resolvedUri||(i.resolvedUri=wr(t,i.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(function(i){i.resolvedUri||(i.resolvedUri=wr(t,i.uri))})},pE=function(e){var t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints){for(var r=0;r<i.preloadHints.length;r++)if(i.preloadHints[r].type==="MAP")return t}i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t},mE=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},am=function(e,t,i){i===void 0&&(i=mE);var r=nh(e,{}),n=r.playlists[t.id];if(!n||i(n,t))return null;t.segments=pE(t);var a=nh(n,t);if(a.preloadSegment&&!t.preloadSegment&&delete a.preloadSegment,n.segments){if(t.skip){t.segments=t.segments||[];for(var o=0;o<t.skip.skippedSegments;o++)t.segments.unshift({skipped:!0})}a.segments=LR(n.segments,t.segments,t.mediaSequence-n.mediaSequence)}a.segments.forEach(function(u){fE(u,a.resolvedUri)});for(var l=0;l<r.playlists.length;l++)r.playlists[l].id===t.id&&(r.playlists[l]=a);return r.playlists[t.id]=a,r.playlists[t.uri]=a,Bo(e,function(u,c,h,f){if(u.playlists)for(var g=0;g<u.playlists.length;g++)t.id===u.playlists[g].id&&(u.playlists[g]=a)}),r},om=function(e,t){var i=e.segments||[],r=i[i.length-1],n=r&&r.parts&&r.parts[r.parts.length-1],a=n&&n.duration||r&&r.duration;return t&&a?a*1e3:(e.partTargetDuration||e.targetDuration||10)*500},$a=(function(s){we(e,s);function e(i,r,n){var a;if(n===void 0&&(n={}),a=s.call(this)||this,!i)throw new Error("A non-empty playlist URL or object is required");a.logger_=Pr("PlaylistLoader");var o=n,l=o.withCredentials,u=l===void 0?!1:l,c=o.handleManifestRedirects,h=c===void 0?!1:c;a.src=i,a.vhs_=r,a.withCredentials=u,a.handleManifestRedirects=h;var f=r.options_;return a.customTagParsers=f&&f.customTagParsers||[],a.customTagMappers=f&&f.customTagMappers||[],a.experimentalLLHLS=f&&f.experimentalLLHLS||!1,re.browser.IE_VERSION&&(a.experimentalLLHLS=!1),a.state="HAVE_NOTHING",a.handleMediaupdatetimeout_=a.handleMediaupdatetimeout_.bind(We(a)),a.on("mediaupdatetimeout",a.handleMediaupdatetimeout_),a}var t=e.prototype;return t.handleMediaupdatetimeout_=function(){var r=this;if(this.state==="HAVE_METADATA"){var n=this.media(),a=wr(this.master.uri,n.uri);this.experimentalLLHLS&&(a=DR(a,n)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:a,withCredentials:this.withCredentials},function(o,l){if(r.request){if(o)return r.playlistRequestError(r.request,r.media(),"HAVE_METADATA");r.haveMetadata({playlistString:r.request.responseText,url:r.media().uri,id:r.media().id})}})}},t.playlistRequestError=function(r,n,a){var o=n.uri,l=n.id;this.request=null,a&&(this.state=a),this.error={playlist:this.master.playlists[l],status:r.status,message:"HLS playlist request error at URL: "+o+".",responseText:r.responseText,code:r.status>=500?4:2},this.trigger("error")},t.parseManifest_=function(r){var n=this,a=r.url,o=r.manifestString;return kR({onwarn:function(u){var c=u.message;return n.logger_("m3u8-parser warn for "+a+": "+c)},oninfo:function(u){var c=u.message;return n.logger_("m3u8-parser info for "+a+": "+c)},manifestString:o,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},t.haveMetadata=function(r){var n=r.playlistString,a=r.playlistObject,o=r.url,l=r.id;this.request=null,this.state="HAVE_METADATA";var u=a||this.parseManifest_({url:o,manifestString:n});u.lastRequest=Date.now(),hE({playlist:u,uri:o,id:l});var c=am(this.master,u);this.targetDuration=u.partTargetDuration||u.targetDuration,this.pendingMedia_=null,c?(this.master=c,this.media_=this.master.playlists[l]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(om(this.media(),!!c)),this.trigger("loadedplaylist")},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),D.clearTimeout(this.mediaUpdateTimeout),D.clearTimeout(this.finalRenditionTimeout),this.off()},t.stopRequest=function(){if(this.request){var r=this.request;this.request=null,r.onreadystatechange=null,r.abort()}},t.media=function(r,n){var a=this;if(!r)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof r=="string"){if(!this.master.playlists[r])throw new Error("Unknown playlist URI: "+r);r=this.master.playlists[r]}if(D.clearTimeout(this.finalRenditionTimeout),n){var o=(r.partTargetDuration||r.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=D.setTimeout(this.media.bind(this,r,!1),o);return}var l=this.state,u=!this.media_||r.id!==this.media_.id,c=this.master.playlists[r.id];if(c&&c.endList||r.endList&&r.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=r,u&&(this.trigger("mediachanging"),l==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(om(r,!0)),!!u){if(this.state="SWITCHING_MEDIA",this.request){if(r.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=r,this.request=this.vhs_.xhr({uri:r.resolvedUri,withCredentials:this.withCredentials},function(h,f){if(a.request){if(r.lastRequest=Date.now(),r.resolvedUri=rh(a.handleManifestRedirects,r.resolvedUri,f),h)return a.playlistRequestError(a.request,r,l);a.haveMetadata({playlistString:f.responseText,url:r.uri,id:r.id}),l==="HAVE_MASTER"?a.trigger("loadedmetadata"):a.trigger("mediachange")}})}},t.pause=function(){this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")},t.load=function(r){var n=this;this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var a=this.media();if(r){var o=a?(a.partTargetDuration||a.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=D.setTimeout(function(){n.mediaUpdateTimeout=null,n.load()},o);return}if(!this.started){this.start();return}a&&!a.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")},t.updateMediaUpdateTimeout_=function(r){var n=this;this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=D.setTimeout(function(){n.mediaUpdateTimeout=null,n.trigger("mediaupdatetimeout"),n.updateMediaUpdateTimeout_(r)},r))},t.start=function(){var r=this;if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=D.location.href),this.src.resolvedUri=this.src.uri,setTimeout(function(){r.setupInitialPlaylist(r.src)},0);return}this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(n,a){if(r.request){if(r.request=null,n)return r.error={status:a.status,message:"HLS playlist request error at URL: "+r.src+".",responseText:a.responseText,code:2},r.state==="HAVE_NOTHING"&&(r.started=!1),r.trigger("error");r.src=rh(r.handleManifestRedirects,r.src,a);var o=r.parseManifest_({manifestString:a.responseText,url:r.src});r.setupInitialPlaylist(o)}})},t.srcUri=function(){return typeof this.src=="string"?this.src:this.src.uri},t.setupInitialPlaylist=function(r){if(this.state="HAVE_MASTER",r.playlists){this.master=r,dE(this.master,this.srcUri()),r.playlists.forEach(function(a){a.segments=pE(a),a.segments.forEach(function(o){fE(o,a.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.master.playlists[0]);return}var n=this.srcUri()||D.location.href;this.master=IR(r,n),this.haveMetadata({playlistObject:r,url:n,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},e})(PR),OR=re.xhr,MR=re.mergeOptions,lm=function(e,t,i,r){var n=e.responseType==="arraybuffer"?e.response:e.responseText;!t&&n&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=n.byteLength||n.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&t.code==="ETIMEDOUT"&&(e.timedout=!0),!t&&!e.aborted&&i.statusCode!==200&&i.statusCode!==206&&i.statusCode!==0&&(t=new Error("XHR Failed with a response of: "+(e&&(n||e.responseText)))),r(t,e)},gE=function(){var e=function t(i,r){i=MR({timeout:45e3},i);var n=t.beforeRequest||re.Vhs.xhr.beforeRequest;if(n&&typeof n=="function"){var a=n(i);a&&(i=a)}var o=re.Vhs.xhr.original===!0?OR:re.Vhs.xhr,l=o(i,function(c,h){return lm(l,c,h,r)}),u=l.abort;return l.abort=function(){return l.aborted=!0,u.apply(l,arguments)},l.uri=i.uri,l.requestTime=Date.now(),l};return e.original=!0,e},RR=function(e){var t,i=e.offset;return typeof e.offset=="bigint"||typeof e.length=="bigint"?t=D.BigInt(e.offset)+D.BigInt(e.length)-D.BigInt(1):t=e.offset+e.length-1,"bytes="+i+"-"+t},um=function(e){var t={};return e.byterange&&(t.Range=RR(e.byterange)),t},BR=function(e,t){return e.start(t)+"-"+e.end(t)},FR=function(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},UR=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},vE=function(e){var t={};return Object.keys(e).forEach(function(i){var r=e[i];M1(r)?t[i]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[i]=r}),t},sh=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},yE=function(e){return e.resolvedUri},_E=function(e){for(var t=Array.prototype.slice.call(e),i=16,r="",n,a,o=0;o<t.length/i;o++)n=t.slice(o*i,o*i+i).map(FR).join(""),a=t.slice(o*i,o*i+i).map(UR).join(""),r+=n+" "+a+`
279
+ `;return r},$R=function(e){var t=e.bytes;return _E(t)},jR=function(e){var t="",i;for(i=0;i<e.length;i++)t+=BR(e,i)+" ";return t},VR=Object.freeze({__proto__:null,createTransferableMessage:vE,initSegmentId:sh,segmentKeyId:yE,hexDump:_E,tagDump:$R,textRanges:jR}),TE=.25,HR=function(e,t){if(!t.dateTimeObject)return null;var i=t.videoTimingInfo.transmuxerPrependedSeconds,r=t.videoTimingInfo.transmuxedPresentationStart,n=r+i,a=e-n;return new Date(t.dateTimeObject.getTime()+a*1e3)},qR=function(e){return e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds},zR=function(e,t){var i;try{i=new Date(e)}catch{return null}if(!t||!t.segments||t.segments.length===0)return null;var r=t.segments[0];if(i<r.dateTimeObject)return null;for(var n=0;n<t.segments.length-1;n++){r=t.segments[n];var a=t.segments[n+1].dateTimeObject;if(i<a)break}var o=t.segments[t.segments.length-1],l=o.dateTimeObject,u=o.videoTimingInfo?qR(o.videoTimingInfo):o.duration+o.duration*TE,c=new Date(l.getTime()+u*1e3);return i>c?null:(i>l&&(r=o),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:ji.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})},WR=function(e,t){if(!t||!t.segments||t.segments.length===0)return null;for(var i=0,r,n=0;n<t.segments.length&&(r=t.segments[n],i=r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationEnd:i+r.duration,!(e<=i));n++);var a=t.segments[t.segments.length-1];if(a.videoTimingInfo&&a.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>i){if(e>i+a.duration*TE)return null;r=a}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:i-r.duration,type:r.videoTimingInfo?"accurate":"estimate"}},GR=function(e,t){var i,r;try{i=new Date(e),r=new Date(t)}catch{}var n=i.getTime(),a=r.getTime();return(a-n)/1e3},KR=function(e){if(!e.segments||e.segments.length===0)return!1;for(var t=0;t<e.segments.length;t++){var i=e.segments[t];if(!i.dateTimeObject)return!1}return!0},XR=function(e){var t=e.playlist,i=e.time,r=i===void 0?void 0:i,n=e.callback;if(!n)throw new Error("getProgramTime: callback must be provided");if(!t||r===void 0)return n({message:"getProgramTime: playlist and time must be provided"});var a=WR(r,t);if(!a)return n({message:"valid programTime was not found"});if(a.type==="estimate")return n({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var o={mediaSeconds:r},l=HR(r,a.segment);return l&&(o.programDateTime=l.toISOString()),n(null,o)},QR=function s(e){var t=e.programTime,i=e.playlist,r=e.retryCount,n=r===void 0?2:r,a=e.seekTo,o=e.pauseAfterSeek,l=o===void 0?!0:o,u=e.tech,c=e.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(typeof t>"u"||!i||!a)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!i.endList&&!u.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!KR(i))return c({message:"programDateTime tags must be provided in the manifest "+i.resolvedUri});var h=zR(t,i);if(!h)return c({message:t+" was not found in the stream"});var f=h.segment,g=GR(f.dateTimeObject,t);if(h.type==="estimate"){if(n===0)return c({message:t+" is not buffered yet. Try again"});a(h.estimatedStart+g),u.one("seeked",function(){s({programTime:t,playlist:i,retryCount:n-1,seekTo:a,pauseAfterSeek:l,tech:u,callback:c})});return}var C=f.start+g,p=function(){return c(null,u.currentTime())};u.one("seeked",p),l&&u.pause(),a(C)},Wf=function(e,t){if(e.readyState===4)return t()},YR=function(e,t,i){var r=[],n,a=!1,o=function(f,g,C,p){return g.abort(),a=!0,i(f,g,C,p)},l=function(f,g){if(!a){if(f)return o(f,g,"",r);var C=g.responseText.substring(r&&r.byteLength||0,g.responseText.length);if(r=kL(r,R1(C,!0)),n=n||ml(r),r.length<10||n&&r.length<n+2)return Wf(g,function(){return o(f,g,"",r)});var p=yg(r);return p==="ts"&&r.length<188?Wf(g,function(){return o(f,g,"",r)}):!p&&r.length<376?Wf(g,function(){return o(f,g,"",r)}):o(null,g,p,r)}},u={uri:e,beforeSend:function(f){f.overrideMimeType("text/plain; charset=x-user-defined"),f.addEventListener("progress",function(g){return g.total,g.loaded,lm(f,null,{statusCode:f.status},l)})}},c=t(u,function(h,f){return lm(c,h,f,l)});return c},JR=re.EventTarget,bE=re.mergeOptions,nT=function(e,t){if(!mE(e,t)||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||e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(var i=0;i<e.segments.length;i++){var r=e.segments[i],n=t.segments[i];if(r.uri!==n.uri)return!1;if(!(!r.byterange&&!n.byterange)){var a=r.byterange,o=n.byterange;if(a&&!o||!a&&o||a.offset!==o.offset||a.length!==o.length)return!1}}return!0},ZR=function(e,t,i,r){var n=r.attributes.NAME||i;return"placeholder-uri-"+e+"-"+t+"-"+n},e4=function(e){var t=e.masterXml,i=e.srcUrl,r=e.clientOffset,n=e.sidxMapping,a=e.previousManifest,o=vO(t,{manifestUri:i,clientOffset:r,sidxMapping:n,previousManifest:a});return dE(o,i,ZR),o},t4=function(e,t){Bo(e,function(i,r,n,a){a in t.mediaGroups[r][n]||delete e.mediaGroups[r][n][a]})},i4=function(e,t,i){for(var r=!0,n=bE(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts}),a=0;a<t.playlists.length;a++){var o=t.playlists[a];if(o.sidx){var l=Hh(o.sidx);i&&i[l]&&i[l].sidx&&pg(o,i[l].sidx,o.sidx.resolvedUri)}var u=am(n,o,nT);u&&(n=u,r=!1)}return Bo(t,function(c,h,f,g){if(c.playlists&&c.playlists.length){var C=c.playlists[0].id,p=am(n,c.playlists[0],nT);p&&(n=p,g in n.mediaGroups[h][f]||(n.mediaGroups[h][f][g]=c),n.mediaGroups[h][f][g].playlists[0]=n.playlists[C],r=!1)}}),t4(n,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(r=!1),r?null:n},r4=function(e,t){var i=!e.map&&!t.map,r=i||!!(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length);return r&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length},sT=function(e,t){var i={};for(var r in e){var n=e[r],a=n.sidx;if(a){var o=Hh(a);if(!t[o])break;var l=t[o].sidxInfo;r4(l,a)&&(i[o]=t[o])}}return i},n4=function(e,t){var i=sT(e.playlists,t),r=i;return Bo(e,function(n,a,o,l){if(n.playlists&&n.playlists.length){var u=n.playlists;r=bE(r,sT(u,t))}}),r},cm=(function(s){we(e,s);function e(i,r,n,a){var o;n===void 0&&(n={}),o=s.call(this)||this,o.masterPlaylistLoader_=a||We(o),a||(o.isMaster_=!0);var l=n,u=l.withCredentials,c=u===void 0?!1:u,h=l.handleManifestRedirects,f=h===void 0?!1:h;if(o.vhs_=r,o.withCredentials=c,o.handleManifestRedirects=f,!i)throw new Error("A non-empty playlist URL or object is required");return o.on("minimumUpdatePeriod",function(){o.refreshXml_()}),o.on("mediaupdatetimeout",function(){o.refreshMedia_(o.media().id)}),o.state="HAVE_NOTHING",o.loadedPlaylists_={},o.logger_=Pr("DashPlaylistLoader"),o.isMaster_?(o.masterPlaylistLoader_.srcUrl=i,o.masterPlaylistLoader_.sidxMapping_={}):o.childPlaylist_=i,o}var t=e.prototype;return t.requestErrored_=function(r,n,a){if(!this.request)return!0;if(this.request=null,r)return this.error=typeof r=="object"&&!(r instanceof Error)?r:{status:n.status,message:"DASH request error at URL: "+n.uri,response:n.response,code:2},a&&(this.state=a),this.trigger("error"),!0},t.addSidxSegments_=function(r,n,a){var o=this,l=r.sidx&&Hh(r.sidx);if(!r.sidx||!l||this.masterPlaylistLoader_.sidxMapping_[l]){this.mediaRequest_=D.setTimeout(function(){return a(!1)},0);return}var u=rh(this.handleManifestRedirects,r.sidx.resolvedUri),c=function(f,g){if(!o.requestErrored_(f,g,n)){var C=o.masterPlaylistLoader_.sidxMapping_,p;try{p=SO(je(g.response).subarray(8))}catch(b){o.requestErrored_(b,g,n);return}return C[l]={sidxInfo:r.sidx,sidx:p},pg(r,p,r.sidx.resolvedUri),a(!0)}};this.request=YR(u,this.vhs_.xhr,function(h,f,g,C){if(h)return c(h,f);if(!g||g!=="mp4")return c({status:f.status,message:"Unsupported "+(g||"unknown")+" container type for sidx segment at URL: "+u,response:"",playlist:r,internal:!0,blacklistDuration:1/0,code:2},f);var p=r.sidx.byterange,b=p.offset,I=p.length;if(C.length>=I+b)return c(h,{response:C.subarray(b,b+I),status:f.status,uri:f.uri});o.request=o.vhs_.xhr({uri:u,responseType:"arraybuffer",headers:um({byterange:r.sidx.byterange})},c)})},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},D.clearTimeout(this.minimumUpdatePeriodTimeout_),D.clearTimeout(this.mediaRequest_),D.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()},t.hasPendingRequest=function(){return this.request||this.mediaRequest_},t.stopRequest=function(){if(this.request){var r=this.request;this.request=null,r.onreadystatechange=null,r.abort()}},t.media=function(r){var n=this;if(!r)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);var a=this.state;if(typeof r=="string"){if(!this.masterPlaylistLoader_.master.playlists[r])throw new Error("Unknown playlist URI: "+r);r=this.masterPlaylistLoader_.master.playlists[r]}var o=!this.media_||r.id!==this.media_.id;if(o&&this.loadedPlaylists_[r.id]&&this.loadedPlaylists_[r.id].endList){this.state="HAVE_METADATA",this.media_=r,o&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}o&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(r,a,function(l){n.haveMetadata({startingState:a,playlist:r})}))},t.haveMetadata=function(r){var n=r.startingState,a=r.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[a.id]=a,this.mediaRequest_=null,this.refreshMedia_(a.id),n==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange")},t.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(D.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)},t.load=function(r){var n=this;D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var a=this.media();if(r){var o=a?a.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=D.setTimeout(function(){return n.load()},o);return}if(!this.started){this.start();return}a&&!a.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")},t.start=function(){var r=this;if(this.started=!0,!this.isMaster_){this.mediaRequest_=D.setTimeout(function(){return r.haveMaster_()},0);return}this.requestMaster_(function(n,a){r.haveMaster_(),!r.hasPendingRequest()&&!r.media_&&r.media(r.masterPlaylistLoader_.master.playlists[0])})},t.requestMaster_=function(r){var n=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(a,o){if(n.requestErrored_(a,o)){n.state==="HAVE_NOTHING"&&(n.started=!1);return}var l=o.responseText!==n.masterPlaylistLoader_.masterXml_;if(n.masterPlaylistLoader_.masterXml_=o.responseText,o.responseHeaders&&o.responseHeaders.date?n.masterLoaded_=Date.parse(o.responseHeaders.date):n.masterLoaded_=Date.now(),n.masterPlaylistLoader_.srcUrl=rh(n.handleManifestRedirects,n.masterPlaylistLoader_.srcUrl,o),l){n.handleMaster_(),n.syncClientServerClock_(function(){return r(o,l)});return}return r(o,l)})},t.syncClientServerClock_=function(r){var n=this,a=yO(this.masterPlaylistLoader_.masterXml_);if(a===null)return this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),r();if(a.method==="DIRECT")return this.masterPlaylistLoader_.clientOffset_=a.value-Date.now(),r();this.request=this.vhs_.xhr({uri:wr(this.masterPlaylistLoader_.srcUrl,a.value),method:a.method,withCredentials:this.withCredentials},function(o,l){if(n.request){if(o)return n.masterPlaylistLoader_.clientOffset_=n.masterLoaded_-Date.now(),r();var u;a.method==="HEAD"?!l.responseHeaders||!l.responseHeaders.date?u=n.masterLoaded_:u=Date.parse(l.responseHeaders.date):u=Date.parse(l.responseText),n.masterPlaylistLoader_.clientOffset_=u-Date.now(),r()}})},t.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},t.handleMaster_=function(){this.mediaRequest_=null;var r=this.masterPlaylistLoader_.master,n=e4({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:r});r&&(n=i4(r,n,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=n||r;var a=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return a&&a!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=a),(!r||n&&n.minimumUpdatePeriod!==r.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),!!n},t.updateMinimumUpdatePeriodTimeout_=function(){var r=this.masterPlaylistLoader_;r.createMupOnMedia_&&(r.off("loadedmetadata",r.createMupOnMedia_),r.createMupOnMedia_=null),r.minimumUpdatePeriodTimeout_&&(D.clearTimeout(r.minimumUpdatePeriodTimeout_),r.minimumUpdatePeriodTimeout_=null);var n=r.master&&r.master.minimumUpdatePeriod;if(n===0&&(r.media()?n=r.media().targetDuration*1e3:(r.createMupOnMedia_=r.updateMinimumUpdatePeriodTimeout_,r.one("loadedmetadata",r.createMupOnMedia_))),typeof n!="number"||n<=0){n<0&&this.logger_("found invalid minimumUpdatePeriod of "+n+", not setting a timeout");return}this.createMUPTimeout_(n)},t.createMUPTimeout_=function(r){var n=this.masterPlaylistLoader_;n.minimumUpdatePeriodTimeout_=D.setTimeout(function(){n.minimumUpdatePeriodTimeout_=null,n.trigger("minimumUpdatePeriod"),n.createMUPTimeout_(r)},r)},t.refreshXml_=function(){var r=this;this.requestMaster_(function(n,a){a&&(r.media_&&(r.media_=r.masterPlaylistLoader_.master.playlists[r.media_.id]),r.masterPlaylistLoader_.sidxMapping_=n4(r.masterPlaylistLoader_.master,r.masterPlaylistLoader_.sidxMapping_),r.addSidxSegments_(r.media(),r.state,function(o){r.refreshMedia_(r.media().id)}))})},t.refreshMedia_=function(r){var n=this;if(!r)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var a=this.masterPlaylistLoader_.master.playlists,o=!this.media_||this.media_!==a[r];if(o?this.media_=a[r]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){var l=function u(){n.media().endList||(n.mediaUpdateTimeout=D.setTimeout(function(){n.trigger("mediaupdatetimeout"),u()},om(n.media(),!!o)))};l()}this.trigger("loadedplaylist")},e})(JR),ti={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},s4=function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer},SE=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},a4=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch{var t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}},CE=function(e){return function(){var t=a4(e),i=SE(new Worker(t));i.objURL=t;var r=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),r.call(this)},i}},EE=function(e){return"var browserWorkerPolyFill = "+SE.toString()+`;
280
+ browserWorkerPolyFill(self);
281
+ `+e},wE=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},o4=EE(wE(function(){var s=function(){this.init=function(){var m={};this.on=function(S,y){m[S]||(m[S]=[]),m[S]=m[S].concat(y)},this.off=function(S,y){var E;return m[S]?(E=m[S].indexOf(y),m[S]=m[S].slice(),m[S].splice(E,1),E>-1):!1},this.trigger=function(S){var y,E,x,N;if(y=m[S],!!y)if(arguments.length===2)for(x=y.length,E=0;E<x;++E)y[E].call(this,arguments[1]);else{for(N=[],E=arguments.length,E=1;E<arguments.length;++E)N.push(arguments[E]);for(x=y.length,E=0;E<x;++E)y[E].apply(this,N)}},this.dispose=function(){m={}}}};s.prototype.pipe=function($){return this.on("data",function(m){$.push(m)}),this.on("done",function(m){$.flush(m)}),this.on("partialdone",function(m){$.partialFlush(m)}),this.on("endedtimeline",function(m){$.endTimeline(m)}),this.on("reset",function(m){$.reset(m)}),$},s.prototype.push=function($){this.trigger("data",$)},s.prototype.flush=function($){this.trigger("done",$)},s.prototype.partialFlush=function($){this.trigger("partialdone",$)},s.prototype.endTimeline=function($){this.trigger("endedtimeline",$)},s.prototype.reset=function($){this.trigger("reset",$)};var e=s,t=Math.pow(2,32),i=function(m){var S=new DataView(m.buffer,m.byteOffset,m.byteLength),y;return S.getBigUint64?(y=S.getBigUint64(0),y<Number.MAX_SAFE_INTEGER?Number(y):y):S.getUint32(0)*t+S.getUint32(4)},r={getUint64:i,MAX_UINT32:t},n=r.MAX_UINT32,a,o,l,u,c,h,f,g,C,p,b,I,L,F,V,B,O,M,U,w,P,Q,G,K,ce,de,pe,ne,se,ue,he,ve,Ae,De,Me,Ne;(function(){var $;if(G={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},!(typeof Uint8Array>"u")){for($ in G)G.hasOwnProperty($)&&(G[$]=[$.charCodeAt(0),$.charCodeAt(1),$.charCodeAt(2),$.charCodeAt(3)]);K=new Uint8Array([105,115,111,109]),de=new Uint8Array([97,118,99,49]),ce=new Uint8Array([0,0,0,1]),pe=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]),ne=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]),se={video:pe,audio:ne},ve=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),he=new Uint8Array([0,0,0,0,0,0,0,0]),Ae=new Uint8Array([0,0,0,0,0,0,0,0]),De=Ae,Me=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Ne=Ae,ue=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),a=function(m){var S=[],y=0,E,x,N;for(E=1;E<arguments.length;E++)S.push(arguments[E]);for(E=S.length;E--;)y+=S[E].byteLength;for(x=new Uint8Array(y+8),N=new DataView(x.buffer,x.byteOffset,x.byteLength),N.setUint32(0,x.byteLength),x.set(m,4),E=0,y=8;E<S.length;E++)x.set(S[E],y),y+=S[E].byteLength;return x},o=function(){return a(G.dinf,a(G.dref,ve))},l=function(m){return a(G.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,m.audioobjecttype<<3|m.samplingfrequencyindex>>>1,m.samplingfrequencyindex<<7|m.channelcount<<3,6,1,2]))},u=function(){return a(G.ftyp,K,ce,K,de)},B=function(m){return a(G.hdlr,se[m])},c=function(m){return a(G.mdat,m)},V=function(m){var S=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,m.duration>>>24&255,m.duration>>>16&255,m.duration>>>8&255,m.duration&255,85,196,0,0]);return m.samplerate&&(S[12]=m.samplerate>>>24&255,S[13]=m.samplerate>>>16&255,S[14]=m.samplerate>>>8&255,S[15]=m.samplerate&255),a(G.mdhd,S)},F=function(m){return a(G.mdia,V(m),B(m.type),f(m))},h=function(m){return a(G.mfhd,new Uint8Array([0,0,0,0,(m&4278190080)>>24,(m&16711680)>>16,(m&65280)>>8,m&255]))},f=function(m){return a(G.minf,m.type==="video"?a(G.vmhd,ue):a(G.smhd,he),o(),M(m))},g=function(m,S){for(var y=[],E=S.length;E--;)y[E]=w(S[E]);return a.apply(null,[G.moof,h(m)].concat(y))},C=function(m){for(var S=m.length,y=[];S--;)y[S]=I(m[S]);return a.apply(null,[G.moov,b(4294967295)].concat(y).concat(p(m)))},p=function(m){for(var S=m.length,y=[];S--;)y[S]=P(m[S]);return a.apply(null,[G.mvex].concat(y))},b=function(m){var S=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(m&4278190080)>>24,(m&16711680)>>16,(m&65280)>>8,m&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return a(G.mvhd,S)},O=function(m){var S=m.samples||[],y=new Uint8Array(4+S.length),E,x;for(x=0;x<S.length;x++)E=S[x].flags,y[x+4]=E.dependsOn<<4|E.isDependedOn<<2|E.hasRedundancy;return a(G.sdtp,y)},M=function(m){return a(G.stbl,U(m),a(G.stts,Ne),a(G.stsc,De),a(G.stsz,Me),a(G.stco,Ae))},(function(){var $,m;U=function(y){return a(G.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),y.type==="video"?$(y):m(y))},$=function(y){var E=y.sps||[],x=y.pps||[],N=[],q=[],X,te;for(X=0;X<E.length;X++)N.push((E[X].byteLength&65280)>>>8),N.push(E[X].byteLength&255),N=N.concat(Array.prototype.slice.call(E[X]));for(X=0;X<x.length;X++)q.push((x[X].byteLength&65280)>>>8),q.push(x[X].byteLength&255),q=q.concat(Array.prototype.slice.call(x[X]));if(te=[G.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,(y.width&65280)>>8,y.width&255,(y.height&65280)>>8,y.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a(G.avcC,new Uint8Array([1,y.profileIdc,y.profileCompatibility,y.levelIdc,255].concat([E.length],N,[x.length],q))),a(G.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],y.sarRatio){var Z=y.sarRatio[0],ie=y.sarRatio[1];te.push(a(G.pasp,new Uint8Array([(Z&4278190080)>>24,(Z&16711680)>>16,(Z&65280)>>8,Z&255,(ie&4278190080)>>24,(ie&16711680)>>16,(ie&65280)>>8,ie&255])))}return a.apply(null,te)},m=function(y){return a(G.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(y.channelcount&65280)>>8,y.channelcount&255,(y.samplesize&65280)>>8,y.samplesize&255,0,0,0,0,(y.samplerate&65280)>>8,y.samplerate&255,0,0]),l(y))}})(),L=function(m){var S=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(m.id&4278190080)>>24,(m.id&16711680)>>16,(m.id&65280)>>8,m.id&255,0,0,0,0,(m.duration&4278190080)>>24,(m.duration&16711680)>>16,(m.duration&65280)>>8,m.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(m.width&65280)>>8,m.width&255,0,0,(m.height&65280)>>8,m.height&255,0,0]);return a(G.tkhd,S)},w=function(m){var S,y,E,x,N,q,X;return S=a(G.tfhd,new Uint8Array([0,0,0,58,(m.id&4278190080)>>24,(m.id&16711680)>>16,(m.id&65280)>>8,m.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),q=Math.floor(m.baseMediaDecodeTime/n),X=Math.floor(m.baseMediaDecodeTime%n),y=a(G.tfdt,new Uint8Array([1,0,0,0,q>>>24&255,q>>>16&255,q>>>8&255,q&255,X>>>24&255,X>>>16&255,X>>>8&255,X&255])),N=92,m.type==="audio"?(E=Q(m,N),a(G.traf,S,y,E)):(x=O(m),E=Q(m,x.length+N),a(G.traf,S,y,E,x))},I=function(m){return m.duration=m.duration||4294967295,a(G.trak,L(m),F(m))},P=function(m){var S=new Uint8Array([0,0,0,0,(m.id&4278190080)>>24,(m.id&16711680)>>16,(m.id&65280)>>8,m.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return m.type!=="video"&&(S[S.length-1]=0),a(G.trex,S)},(function(){var $,m,S;S=function(E,x){var N=0,q=0,X=0,te=0;return E.length&&(E[0].duration!==void 0&&(N=1),E[0].size!==void 0&&(q=2),E[0].flags!==void 0&&(X=4),E[0].compositionTimeOffset!==void 0&&(te=8)),[0,0,N|q|X|te,1,(E.length&4278190080)>>>24,(E.length&16711680)>>>16,(E.length&65280)>>>8,E.length&255,(x&4278190080)>>>24,(x&16711680)>>>16,(x&65280)>>>8,x&255]},m=function(E,x){var N,q,X,te,Z,ie;for(te=E.samples||[],x+=20+16*te.length,X=S(te,x),q=new Uint8Array(X.length+te.length*16),q.set(X),N=X.length,ie=0;ie<te.length;ie++)Z=te[ie],q[N++]=(Z.duration&4278190080)>>>24,q[N++]=(Z.duration&16711680)>>>16,q[N++]=(Z.duration&65280)>>>8,q[N++]=Z.duration&255,q[N++]=(Z.size&4278190080)>>>24,q[N++]=(Z.size&16711680)>>>16,q[N++]=(Z.size&65280)>>>8,q[N++]=Z.size&255,q[N++]=Z.flags.isLeading<<2|Z.flags.dependsOn,q[N++]=Z.flags.isDependedOn<<6|Z.flags.hasRedundancy<<4|Z.flags.paddingValue<<1|Z.flags.isNonSyncSample,q[N++]=Z.flags.degradationPriority&61440,q[N++]=Z.flags.degradationPriority&15,q[N++]=(Z.compositionTimeOffset&4278190080)>>>24,q[N++]=(Z.compositionTimeOffset&16711680)>>>16,q[N++]=(Z.compositionTimeOffset&65280)>>>8,q[N++]=Z.compositionTimeOffset&255;return a(G.trun,q)},$=function(E,x){var N,q,X,te,Z,ie;for(te=E.samples||[],x+=20+8*te.length,X=S(te,x),N=new Uint8Array(X.length+te.length*8),N.set(X),q=X.length,ie=0;ie<te.length;ie++)Z=te[ie],N[q++]=(Z.duration&4278190080)>>>24,N[q++]=(Z.duration&16711680)>>>16,N[q++]=(Z.duration&65280)>>>8,N[q++]=Z.duration&255,N[q++]=(Z.size&4278190080)>>>24,N[q++]=(Z.size&16711680)>>>16,N[q++]=(Z.size&65280)>>>8,N[q++]=Z.size&255;return a(G.trun,N)},Q=function(E,x){return E.type==="audio"?$(E,x):m(E,x)}})();var Je={ftyp:u,mdat:c,moof:g,moov:C,initSegment:function(m){var S=u(),y=C(m),E;return E=new Uint8Array(S.byteLength+y.byteLength),E.set(S),E.set(y,S.byteLength),E}},Re=function(m){var S,y,E=[],x=[];for(x.byteLength=0,x.nalCount=0,x.duration=0,E.byteLength=0,S=0;S<m.length;S++)y=m[S],y.nalUnitType==="access_unit_delimiter_rbsp"?(E.length&&(E.duration=y.dts-E.dts,x.byteLength+=E.byteLength,x.nalCount+=E.length,x.duration+=E.duration,x.push(E)),E=[y],E.byteLength=y.data.byteLength,E.pts=y.pts,E.dts=y.dts):(y.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(E.keyFrame=!0),E.duration=y.dts-E.dts,E.byteLength+=y.data.byteLength,E.push(y));return x.length&&(!E.duration||E.duration<=0)&&(E.duration=x[x.length-1].duration),x.byteLength+=E.byteLength,x.nalCount+=E.length,x.duration+=E.duration,x.push(E),x},Oe=function(m){var S,y,E=[],x=[];for(E.byteLength=0,E.nalCount=0,E.duration=0,E.pts=m[0].pts,E.dts=m[0].dts,x.byteLength=0,x.nalCount=0,x.duration=0,x.pts=m[0].pts,x.dts=m[0].dts,S=0;S<m.length;S++)y=m[S],y.keyFrame?(E.length&&(x.push(E),x.byteLength+=E.byteLength,x.nalCount+=E.nalCount,x.duration+=E.duration),E=[y],E.nalCount=y.length,E.byteLength=y.byteLength,E.pts=y.pts,E.dts=y.dts,E.duration=y.duration):(E.duration+=y.duration,E.nalCount+=y.length,E.byteLength+=y.byteLength,E.push(y));return x.length&&E.duration<=0&&(E.duration=x[x.length-1].duration),x.byteLength+=E.byteLength,x.nalCount+=E.nalCount,x.duration+=E.duration,x.push(E),x},He=function(m){var S;return!m[0][0].keyFrame&&m.length>1&&(S=m.shift(),m.byteLength-=S.byteLength,m.nalCount-=S.nalCount,m[0][0].dts=S.dts,m[0][0].pts=S.pts,m[0][0].duration+=S.duration),m},st=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Ct=function(m,S){var y=st();return y.dataOffset=S,y.compositionTimeOffset=m.pts-m.dts,y.duration=m.duration,y.size=4*m.length,y.size+=m.byteLength,m.keyFrame&&(y.flags.dependsOn=2,y.flags.isNonSyncSample=0),y},Nt=function(m,S){var y,E,x,N,q,X=S||0,te=[];for(y=0;y<m.length;y++)for(N=m[y],E=0;E<N.length;E++)q=N[E],x=Ct(q,X),X+=x.size,te.push(x);return te},Ni=function(m){var S,y,E,x,N,q,X=0,te=m.byteLength,Z=m.nalCount,ie=te+4*Z,ge=new Uint8Array(ie),Ee=new DataView(ge.buffer);for(S=0;S<m.length;S++)for(x=m[S],y=0;y<x.length;y++)for(N=x[y],E=0;E<N.length;E++)q=N[E],Ee.setUint32(X,q.data.byteLength),X+=4,ge.set(q.data,X),X+=q.data.byteLength;return ge},Bt=function(m,S){var y,E=S||0,x=[];return y=Ct(m,E),x.push(y),x},Hi=function(m){var S,y,E=0,x=m.byteLength,N=m.length,q=x+4*N,X=new Uint8Array(q),te=new DataView(X.buffer);for(S=0;S<m.length;S++)y=m[S],te.setUint32(E,y.data.byteLength),E+=4,X.set(y.data,E),E+=y.data.byteLength;return X},Te={groupNalsIntoFrames:Re,groupFramesIntoGops:Oe,extendFirstKeyFrame:He,generateSampleTable:Nt,concatenateNalData:Ni,generateSampleTableForFrame:Bt,concatenateNalDataForFrame:Hi},ke=[33,16,5,32,164,27],Fe=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],Be=function(m){for(var S=[];m--;)S.push(0);return S},Ke=function(m){return Object.keys(m).reduce(function(S,y){return S[y]=new Uint8Array(m[y].reduce(function(E,x){return E.concat(x)},[])),S},{})},rt,ut=function(){if(!rt){var m={96e3:[ke,[227,64],Be(154),[56]],88200:[ke,[231],Be(170),[56]],64e3:[ke,[248,192],Be(240),[56]],48e3:[ke,[255,192],Be(268),[55,148,128],Be(54),[112]],44100:[ke,[255,192],Be(268),[55,163,128],Be(84),[112]],32e3:[ke,[255,192],Be(268),[55,234],Be(226),[112]],24e3:[ke,[255,192],Be(268),[55,255,128],Be(268),[111,112],Be(126),[224]],16e3:[ke,[255,192],Be(268),[55,255,128],Be(268),[111,255],Be(269),[223,108],Be(195),[1,192]],12e3:[Fe,Be(268),[3,127,248],Be(268),[6,255,240],Be(268),[13,255,224],Be(268),[27,253,128],Be(259),[56]],11025:[Fe,Be(268),[3,127,248],Be(268),[6,255,240],Be(268),[13,255,224],Be(268),[27,255,192],Be(268),[55,175,128],Be(108),[112]],8e3:[Fe,Be(268),[3,121,16],Be(47),[7]]};rt=Ke(m)}return rt},rr=9e4,qi,gr,nr,sr,vr,An,In;qi=function(m){return m*rr},gr=function(m,S){return m*S},nr=function(m){return m/rr},sr=function(m,S){return m/S},vr=function(m,S){return qi(sr(m,S))},An=function(m,S){return gr(nr(m),S)},In=function(m,S,y){return nr(y?m:m-S)};var tt={ONE_SECOND_IN_TS:rr,secondsToVideoTs:qi,secondsToAudioTs:gr,videoTsToSeconds:nr,audioTsToSeconds:sr,audioTsToVideoTs:vr,videoTsToAudioTs:An,metadataTsToSeconds:In},nt=function(m){var S,y,E=0;for(S=0;S<m.length;S++)y=m[S],E+=y.data.byteLength;return E},ss=function(m,S,y,E){var x,N=0,q=0,X=0,te=0,Z,ie,ge;if(S.length&&(x=tt.audioTsToVideoTs(m.baseMediaDecodeTime,m.samplerate),N=Math.ceil(tt.ONE_SECOND_IN_TS/(m.samplerate/1024)),y&&E&&(q=x-Math.max(y,E),X=Math.floor(q/N),te=X*N),!(X<1||te>tt.ONE_SECOND_IN_TS/2))){for(Z=ut()[m.samplerate],Z||(Z=S[0].data),ie=0;ie<X;ie++)ge=S[0],S.splice(0,0,{data:Z,dts:ge.dts-N,pts:ge.pts-N});return m.baseMediaDecodeTime-=Math.floor(tt.videoTsToAudioTs(te,m.samplerate)),te}},tn=function(m,S,y){return S.minSegmentDts>=y?m:(S.minSegmentDts=1/0,m.filter(function(E){return E.dts>=y?(S.minSegmentDts=Math.min(S.minSegmentDts,E.dts),S.minSegmentPts=S.minSegmentDts,!0):!1}))},ta=function(m){var S,y,E=[];for(S=0;S<m.length;S++)y=m[S],E.push({size:y.data.byteLength,duration:1024});return E},ia=function(m){var S,y,E=0,x=new Uint8Array(nt(m));for(S=0;S<m.length;S++)y=m[S],x.set(y.data,E),E+=y.data.byteLength;return x},Dr={prefixWithSilence:ss,trimAdtsFramesByEarliestDts:tn,generateSampleTable:ta,concatenateFrameData:ia},Nr=tt.ONE_SECOND_IN_TS,ra=function(m,S){typeof S.pts=="number"&&(m.timelineStartInfo.pts===void 0&&(m.timelineStartInfo.pts=S.pts),m.minSegmentPts===void 0?m.minSegmentPts=S.pts:m.minSegmentPts=Math.min(m.minSegmentPts,S.pts),m.maxSegmentPts===void 0?m.maxSegmentPts=S.pts:m.maxSegmentPts=Math.max(m.maxSegmentPts,S.pts)),typeof S.dts=="number"&&(m.timelineStartInfo.dts===void 0&&(m.timelineStartInfo.dts=S.dts),m.minSegmentDts===void 0?m.minSegmentDts=S.dts:m.minSegmentDts=Math.min(m.minSegmentDts,S.dts),m.maxSegmentDts===void 0?m.maxSegmentDts=S.dts:m.maxSegmentDts=Math.max(m.maxSegmentDts,S.dts))},as=function(m){delete m.minSegmentDts,delete m.maxSegmentDts,delete m.minSegmentPts,delete m.maxSegmentPts},na=function(m,S){var y,E,x=m.minSegmentDts;return S||(x-=m.timelineStartInfo.dts),y=m.timelineStartInfo.baseMediaDecodeTime,y+=x,y=Math.max(0,y),m.type==="audio"&&(E=m.samplerate/Nr,y*=E,y=Math.floor(y)),y},j={clearDtsInfo:as,calculateTrackBaseMediaDecodeTime:na,collectDtsInfo:ra},H=4,ee=128,fe=function(m){for(var S=0,y={payloadType:-1,payloadSize:0},E=0,x=0;S<m.byteLength&&m[S]!==ee;){for(;m[S]===255;)E+=255,S++;for(E+=m[S++];m[S]===255;)x+=255,S++;if(x+=m[S++],!y.payload&&E===H){var N=String.fromCharCode(m[S+3],m[S+4],m[S+5],m[S+6]);if(N==="GA94"){y.payloadType=E,y.payloadSize=x,y.payload=m.subarray(S,S+x);break}else y.payload=void 0}S+=x,E=0,x=0}return y},Ce=function(m){return m.payload[0]!==181||(m.payload[1]<<8|m.payload[2])!==49||String.fromCharCode(m.payload[3],m.payload[4],m.payload[5],m.payload[6])!=="GA94"||m.payload[7]!==3?null:m.payload.subarray(8,m.payload.length-1)},Ve=function(m,S){var y=[],E,x,N,q;if(!(S[0]&64))return y;for(x=S[0]&31,E=0;E<x;E++)N=E*3,q={type:S[N+2]&3,pts:m},S[N+2]&4&&(q.ccData=S[N+3]<<8|S[N+4],y.push(q));return y},ct=function(m){for(var S=m.byteLength,y=[],E=1,x,N;E<S-2;)m[E]===0&&m[E+1]===0&&m[E+2]===3?(y.push(E+2),E+=2):E++;if(y.length===0)return m;x=S-y.length,N=new Uint8Array(x);var q=0;for(E=0;E<x;q++,E++)q===y[0]&&(q++,y.shift()),N[E]=m[q];return N},Ft={parseSei:fe,parseUserData:Ce,parseCaptionPackets:Ve,discardEmulationPreventionBytes:ct,USER_DATA_REGISTERED_ITU_T_T35:H},gt=function $(m){m=m||{},$.prototype.init.call(this),this.parse708captions_=typeof m.parse708captions=="boolean"?m.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new ft(0,0),new ft(0,1),new ft(1,0),new ft(1,1)],this.parse708captions_&&(this.cc708Stream_=new Ze({captionServices:m.captionServices})),this.reset(),this.ccStreams_.forEach(function(S){S.on("data",this.trigger.bind(this,"data")),S.on("partialdone",this.trigger.bind(this,"partialdone")),S.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")))};gt.prototype=new e,gt.prototype.push=function($){var m,S,y;if($.nalUnitType==="sei_rbsp"&&(m=Ft.parseSei($.escapedRBSP),!!m.payload&&m.payloadType===Ft.USER_DATA_REGISTERED_ITU_T_T35&&(S=Ft.parseUserData(m),!!S))){if($.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if($.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}y=Ft.parseCaptionPackets($.pts,S),this.captionPackets_=this.captionPackets_.concat(y),this.latestDts_!==$.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=$.dts}},gt.prototype.flushCCStreams=function($){this.ccStreams_.forEach(function(m){return $==="flush"?m.flush():m.partialFlush()},this)},gt.prototype.flushStream=function($){if(!this.captionPackets_.length){this.flushCCStreams($);return}this.captionPackets_.forEach(function(m,S){m.presortIndex=S}),this.captionPackets_.sort(function(m,S){return m.pts===S.pts?m.presortIndex-S.presortIndex:m.pts-S.pts}),this.captionPackets_.forEach(function(m){m.type<2?this.dispatchCea608Packet(m):this.dispatchCea708Packet(m)},this),this.captionPackets_.length=0,this.flushCCStreams($)},gt.prototype.flush=function(){return this.flushStream("flush")},gt.prototype.partialFlush=function(){return this.flushStream("partialFlush")},gt.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function($){$.reset()})},gt.prototype.dispatchCea608Packet=function($){this.setsTextOrXDSActive($)?this.activeCea608Channel_[$.type]=null:this.setsChannel1Active($)?this.activeCea608Channel_[$.type]=0:this.setsChannel2Active($)&&(this.activeCea608Channel_[$.type]=1),this.activeCea608Channel_[$.type]!==null&&this.ccStreams_[($.type<<1)+this.activeCea608Channel_[$.type]].push($)},gt.prototype.setsChannel1Active=function($){return($.ccData&30720)===4096},gt.prototype.setsChannel2Active=function($){return($.ccData&30720)===6144},gt.prototype.setsTextOrXDSActive=function($){return($.ccData&28928)===256||($.ccData&30974)===4138||($.ccData&30974)===6186},gt.prototype.dispatchCea708Packet=function($){this.parse708captions_&&this.cc708Stream_.push($)};var ar={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},Li=function(m){var S=ar[m]||m;return m&4096&&m===S?"":String.fromCharCode(S)},hi=function(m){return 32<=m&&m<=127||160<=m&&m<=255},Ut=function(m){this.windowNum=m,this.reset()};Ut.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},Ut.prototype.getText=function(){return this.rows.join(`
282
+ `)},Ut.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},Ut.prototype.newLine=function($){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow($),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Ut.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},Ut.prototype.addText=function($){this.rows[this.rowIdx]+=$},Ut.prototype.backspace=function(){if(!this.isEmpty()){var $=this.rows[this.rowIdx];this.rows[this.rowIdx]=$.substr(0,$.length-1)}};var vt=function(m,S,y){this.serviceNum=m,this.text="",this.currentWindow=new Ut(-1),this.windows=[],this.stream=y,typeof S=="string"&&this.createTextDecoder(S)};vt.prototype.init=function($,m){this.startPts=$;for(var S=0;S<8;S++)this.windows[S]=new Ut(S),typeof m=="function"&&(this.windows[S].beforeRowOverflow=m)},vt.prototype.setCurrentWindow=function($){this.currentWindow=this.windows[$]},vt.prototype.createTextDecoder=function($){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder($)}catch(m){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+$+" encoding. "+m})}};var Ze=function $(m){m=m||{},$.prototype.init.call(this);var S=this,y=m.captionServices||{},E={},x;Object.keys(y).forEach(function(N){x=y[N],/^SERVICE/.test(N)&&(E[N]=x.encoding)}),this.serviceEncodings=E,this.current708Packet=null,this.services={},this.push=function(N){N.type===3?(S.new708Packet(),S.add708Bytes(N)):(S.current708Packet===null&&S.new708Packet(),S.add708Bytes(N))}};Ze.prototype=new e,Ze.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Ze.prototype.add708Bytes=function($){var m=$.ccData,S=m>>>8,y=m&255;this.current708Packet.ptsVals.push($.pts),this.current708Packet.data.push(S),this.current708Packet.data.push(y)},Ze.prototype.push708Packet=function(){var $=this.current708Packet,m=$.data,S=null,y=null,E=0,x=m[E++];for($.seq=x>>6,$.sizeCode=x&63;E<m.length;E++)x=m[E++],S=x>>5,y=x&31,S===7&&y>0&&(x=m[E++],S=x),this.pushServiceBlock(S,E,y),y>0&&(E+=y-1)},Ze.prototype.pushServiceBlock=function($,m,S){var y,E=m,x=this.current708Packet.data,N=this.services[$];for(N||(N=this.initService($,E));E<m+S&&E<x.length;E++)y=x[E],hi(y)?E=this.handleText(E,N):y===24?E=this.multiByteCharacter(E,N):y===16?E=this.extendedCommands(E,N):128<=y&&y<=135?E=this.setCurrentWindow(E,N):152<=y&&y<=159?E=this.defineWindow(E,N):y===136?E=this.clearWindows(E,N):y===140?E=this.deleteWindows(E,N):y===137?E=this.displayWindows(E,N):y===138?E=this.hideWindows(E,N):y===139?E=this.toggleWindows(E,N):y===151?E=this.setWindowAttributes(E,N):y===144?E=this.setPenAttributes(E,N):y===145?E=this.setPenColor(E,N):y===146?E=this.setPenLocation(E,N):y===143?N=this.reset(E,N):y===8?N.currentWindow.backspace():y===12?N.currentWindow.clearText():y===13?N.currentWindow.pendingNewLine=!0:y===14?N.currentWindow.clearText():y===141&&E++},Ze.prototype.extendedCommands=function($,m){var S=this.current708Packet.data,y=S[++$];return hi(y)&&($=this.handleText($,m,{isExtended:!0})),$},Ze.prototype.getPts=function($){return this.current708Packet.ptsVals[Math.floor($/2)]},Ze.prototype.initService=function($,m){var y="SERVICE"+$,S=this,y,E;return y in this.serviceEncodings&&(E=this.serviceEncodings[y]),this.services[$]=new vt($,E,S),this.services[$].init(this.getPts(m),function(x){S.flushDisplayed(x,S.services[$])}),this.services[$]},Ze.prototype.handleText=function($,m,S){var y=S&&S.isExtended,E=S&&S.isMultiByte,x=this.current708Packet.data,N=y?4096:0,q=x[$],X=x[$+1],te=m.currentWindow,Z,ie;return m.textDecoder_&&!y?(E?(ie=[q,X],$++):ie=[q],Z=m.textDecoder_.decode(new Uint8Array(ie))):Z=Li(N|q),te.pendingNewLine&&!te.isEmpty()&&te.newLine(this.getPts($)),te.pendingNewLine=!1,te.addText(Z),$},Ze.prototype.multiByteCharacter=function($,m){var S=this.current708Packet.data,y=S[$+1],E=S[$+2];return hi(y)&&hi(E)&&($=this.handleText(++$,m,{isMultiByte:!0})),$},Ze.prototype.setCurrentWindow=function($,m){var S=this.current708Packet.data,y=S[$],E=y&7;return m.setCurrentWindow(E),$},Ze.prototype.defineWindow=function($,m){var S=this.current708Packet.data,y=S[$],E=y&7;m.setCurrentWindow(E);var x=m.currentWindow;return y=S[++$],x.visible=(y&32)>>5,x.rowLock=(y&16)>>4,x.columnLock=(y&8)>>3,x.priority=y&7,y=S[++$],x.relativePositioning=(y&128)>>7,x.anchorVertical=y&127,y=S[++$],x.anchorHorizontal=y,y=S[++$],x.anchorPoint=(y&240)>>4,x.rowCount=y&15,y=S[++$],x.columnCount=y&63,y=S[++$],x.windowStyle=(y&56)>>3,x.penStyle=y&7,x.virtualRowCount=x.rowCount+1,$},Ze.prototype.setWindowAttributes=function($,m){var S=this.current708Packet.data,y=S[$],E=m.currentWindow.winAttr;return y=S[++$],E.fillOpacity=(y&192)>>6,E.fillRed=(y&48)>>4,E.fillGreen=(y&12)>>2,E.fillBlue=y&3,y=S[++$],E.borderType=(y&192)>>6,E.borderRed=(y&48)>>4,E.borderGreen=(y&12)>>2,E.borderBlue=y&3,y=S[++$],E.borderType+=(y&128)>>5,E.wordWrap=(y&64)>>6,E.printDirection=(y&48)>>4,E.scrollDirection=(y&12)>>2,E.justify=y&3,y=S[++$],E.effectSpeed=(y&240)>>4,E.effectDirection=(y&12)>>2,E.displayEffect=y&3,$},Ze.prototype.flushDisplayed=function($,m){for(var S=[],y=0;y<8;y++)m.windows[y].visible&&!m.windows[y].isEmpty()&&S.push(m.windows[y].getText());m.endPts=$,m.text=S.join(`
283
+
284
+ `),this.pushCaption(m),m.startPts=$},Ze.prototype.pushCaption=function($){$.text!==""&&(this.trigger("data",{startPts:$.startPts,endPts:$.endPts,text:$.text,stream:"cc708_"+$.serviceNum}),$.text="",$.startPts=$.endPts)},Ze.prototype.displayWindows=function($,m){var S=this.current708Packet.data,y=S[++$],E=this.getPts($);this.flushDisplayed(E,m);for(var x=0;x<8;x++)y&1<<x&&(m.windows[x].visible=1);return $},Ze.prototype.hideWindows=function($,m){var S=this.current708Packet.data,y=S[++$],E=this.getPts($);this.flushDisplayed(E,m);for(var x=0;x<8;x++)y&1<<x&&(m.windows[x].visible=0);return $},Ze.prototype.toggleWindows=function($,m){var S=this.current708Packet.data,y=S[++$],E=this.getPts($);this.flushDisplayed(E,m);for(var x=0;x<8;x++)y&1<<x&&(m.windows[x].visible^=1);return $},Ze.prototype.clearWindows=function($,m){var S=this.current708Packet.data,y=S[++$],E=this.getPts($);this.flushDisplayed(E,m);for(var x=0;x<8;x++)y&1<<x&&m.windows[x].clearText();return $},Ze.prototype.deleteWindows=function($,m){var S=this.current708Packet.data,y=S[++$],E=this.getPts($);this.flushDisplayed(E,m);for(var x=0;x<8;x++)y&1<<x&&m.windows[x].reset();return $},Ze.prototype.setPenAttributes=function($,m){var S=this.current708Packet.data,y=S[$],E=m.currentWindow.penAttr;return y=S[++$],E.textTag=(y&240)>>4,E.offset=(y&12)>>2,E.penSize=y&3,y=S[++$],E.italics=(y&128)>>7,E.underline=(y&64)>>6,E.edgeType=(y&56)>>3,E.fontStyle=y&7,$},Ze.prototype.setPenColor=function($,m){var S=this.current708Packet.data,y=S[$],E=m.currentWindow.penColor;return y=S[++$],E.fgOpacity=(y&192)>>6,E.fgRed=(y&48)>>4,E.fgGreen=(y&12)>>2,E.fgBlue=y&3,y=S[++$],E.bgOpacity=(y&192)>>6,E.bgRed=(y&48)>>4,E.bgGreen=(y&12)>>2,E.bgBlue=y&3,y=S[++$],E.edgeRed=(y&48)>>4,E.edgeGreen=(y&12)>>2,E.edgeBlue=y&3,$},Ze.prototype.setPenLocation=function($,m){var S=this.current708Packet.data,y=S[$],E=m.currentWindow.penLoc;return m.currentWindow.pendingNewLine=!0,y=S[++$],E.row=y&15,y=S[++$],E.column=y&63,$},Ze.prototype.reset=function($,m){var S=this.getPts($);return this.flushDisplayed(S,m),this.initService(m.serviceNum,$)};var yr={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},yi=function(m){return m===null?"":(m=yr[m]||m,String.fromCharCode(m))},at=14,rn=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Xe=function(){for(var m=[],S=at+1;S--;)m.push("");return m},ft=function $(m,S){$.prototype.init.call(this),this.field_=m||0,this.dataChannel_=S||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(y){var E,x,N,q,X;if(E=y.ccData&32639,E===this.lastControlCode_){this.lastControlCode_=null;return}if((E&61440)===4096?this.lastControlCode_=E:E!==this.PADDING_&&(this.lastControlCode_=null),N=E>>>8,q=E&255,E!==this.PADDING_)if(E===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(E===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(y.pts),this.flushDisplayed(y.pts),x=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=x,this.startPts_=y.pts;else if(E===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(y.pts);else if(E===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(y.pts);else if(E===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(y.pts);else if(E===this.CARRIAGE_RETURN_)this.clearFormatting(y.pts),this.flushDisplayed(y.pts),this.shiftRowsUp_(),this.startPts_=y.pts;else if(E===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(E===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(y.pts),this.displayed_=Xe();else if(E===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Xe();else if(E===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(y.pts),this.displayed_=Xe()),this.mode_="paintOn",this.startPts_=y.pts;else if(this.isSpecialCharacter(N,q))N=(N&3)<<8,X=yi(N|q),this[this.mode_](y.pts,X),this.column_++;else if(this.isExtCharacter(N,q))this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),N=(N&3)<<8,X=yi(N|q),this[this.mode_](y.pts,X),this.column_++;else if(this.isMidRowCode(N,q))this.clearFormatting(y.pts),this[this.mode_](y.pts," "),this.column_++,(q&14)===14&&this.addFormatting(y.pts,["i"]),(q&1)===1&&this.addFormatting(y.pts,["u"]);else if(this.isOffsetControlCode(N,q))this.column_+=q&3;else if(this.isPAC(N,q)){var te=rn.indexOf(E&7968);this.mode_==="rollUp"&&(te-this.rollUpRows_+1<0&&(te=this.rollUpRows_-1),this.setRollUp(y.pts,te)),te!==this.row_&&(this.clearFormatting(y.pts),this.row_=te),q&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(y.pts,["u"]),(E&16)===16&&(this.column_=((E&14)>>1)*4),this.isColorPAC(q)&&(q&14)===14&&this.addFormatting(y.pts,["i"])}else this.isNormalChar(N)&&(q===0&&(q=null),X=yi(N),X+=yi(q),this[this.mode_](y.pts,X),this.column_+=X.length)}};ft.prototype=new e,ft.prototype.flushDisplayed=function($){var m=this.displayed_.map(function(S,y){try{return S.trim()}catch{return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+y+"."}),""}},this).join(`
285
+ `).replace(/^\n+|\n+$/g,"");m.length&&this.trigger("data",{startPts:this.startPts_,endPts:$,text:m,stream:this.name_})},ft.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Xe(),this.nonDisplayed_=Xe(),this.lastControlCode_=null,this.column_=0,this.row_=at,this.rollUpRows_=2,this.formatting_=[]},ft.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},ft.prototype.isSpecialCharacter=function($,m){return $===this.EXT_&&m>=48&&m<=63},ft.prototype.isExtCharacter=function($,m){return($===this.EXT_+1||$===this.EXT_+2)&&m>=32&&m<=63},ft.prototype.isMidRowCode=function($,m){return $===this.EXT_&&m>=32&&m<=47},ft.prototype.isOffsetControlCode=function($,m){return $===this.OFFSET_&&m>=33&&m<=35},ft.prototype.isPAC=function($,m){return $>=this.BASE_&&$<this.BASE_+8&&m>=64&&m<=127},ft.prototype.isColorPAC=function($){return $>=64&&$<=79||$>=96&&$<=127},ft.prototype.isNormalChar=function($){return $>=32&&$<=127},ft.prototype.setRollUp=function($,m){if(this.mode_!=="rollUp"&&(this.row_=at,this.mode_="rollUp",this.flushDisplayed($),this.nonDisplayed_=Xe(),this.displayed_=Xe()),m!==void 0&&m!==this.row_)for(var S=0;S<this.rollUpRows_;S++)this.displayed_[m-S]=this.displayed_[this.row_-S],this.displayed_[this.row_-S]="";m===void 0&&(m=this.row_),this.topRow_=m-this.rollUpRows_+1},ft.prototype.addFormatting=function($,m){this.formatting_=this.formatting_.concat(m);var S=m.reduce(function(y,E){return y+"<"+E+">"},"");this[this.mode_]($,S)},ft.prototype.clearFormatting=function($){if(this.formatting_.length){var m=this.formatting_.reverse().reduce(function(S,y){return S+"</"+y+">"},"");this.formatting_=[],this[this.mode_]($,m)}},ft.prototype.popOn=function($,m){var S=this.nonDisplayed_[this.row_];S+=m,this.nonDisplayed_[this.row_]=S},ft.prototype.rollUp=function($,m){var S=this.displayed_[this.row_];S+=m,this.displayed_[this.row_]=S},ft.prototype.shiftRowsUp_=function(){var $;for($=0;$<this.topRow_;$++)this.displayed_[$]="";for($=this.row_+1;$<at+1;$++)this.displayed_[$]="";for($=this.topRow_;$<this.row_;$++)this.displayed_[$]=this.displayed_[$+1];this.displayed_[this.row_]=""},ft.prototype.paintOn=function($,m){var S=this.displayed_[this.row_];S+=m,this.displayed_[this.row_]=S};var nn={CaptionStream:gt,Cea608Stream:ft,Cea708Stream:Ze},$t={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},nd=8589934592,sn=4294967296,yt="shared",sa=function(m,S){var y=1;for(m>S&&(y=-1);Math.abs(S-m)>sn;)m+=y*nd;return m},os=function $(m){var S,y;$.prototype.init.call(this),this.type_=m||yt,this.push=function(E){this.type_!==yt&&E.type!==this.type_||(y===void 0&&(y=E.dts),E.dts=sa(E.dts,y),E.pts=sa(E.pts,y),S=E.dts,this.trigger("data",E))},this.flush=function(){y=S,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){y=void 0,S=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};os.prototype=new e;var ou={TimestampRolloverStream:os,handleRollover:sa},lu=function(m,S,y){var E,x="";for(E=S;E<y;E++)x+="%"+("00"+m[E].toString(16)).slice(-2);return x},aa=function(m,S,y){return decodeURIComponent(lu(m,S,y))},uu=function(m,S,y){return unescape(lu(m,S,y))},Pn=function(m){return m[0]<<21|m[1]<<14|m[2]<<7|m[3]},oa={TXXX:function(m){var S;if(m.data[0]===3){for(S=1;S<m.data.length;S++)if(m.data[S]===0){m.description=aa(m.data,1,S),m.value=aa(m.data,S+1,m.data.length).replace(/\0*$/,"");break}m.data=m.value}},WXXX:function(m){var S;if(m.data[0]===3){for(S=1;S<m.data.length;S++)if(m.data[S]===0){m.description=aa(m.data,1,S),m.url=aa(m.data,S+1,m.data.length);break}}},PRIV:function(m){var S;for(S=0;S<m.data.length;S++)if(m.data[S]===0){m.owner=uu(m.data,0,S);break}m.privateData=m.data.subarray(S+1),m.data=m.privateData}},ls;ls=function(m){var S={descriptor:m&&m.descriptor},y=0,E=[],x=0,N;if(ls.prototype.init.call(this),this.dispatchType=$t.METADATA_STREAM_TYPE.toString(16),S.descriptor)for(N=0;N<S.descriptor.length;N++)this.dispatchType+=("00"+S.descriptor[N].toString(16)).slice(-2);this.push=function(q){var X,te,Z,ie,ge,Ee;if(q.type==="timed-metadata"){if(q.dataAlignmentIndicator&&(x=0,E.length=0),E.length===0&&(q.data.length<10||q.data[0]!==73||q.data[1]!==68||q.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(E.push(q),x+=q.data.byteLength,E.length===1&&(y=Pn(q.data.subarray(6,10)),y+=10),!(x<y)){for(X={data:new Uint8Array(y),frames:[],pts:E[0].pts,dts:E[0].dts},ge=0;ge<y;)X.data.set(E[0].data.subarray(0,y-ge),ge),ge+=E[0].data.byteLength,x-=E[0].data.byteLength,E.shift();te=10,X.data[5]&64&&(te+=4,te+=Pn(X.data.subarray(10,14)),y-=Pn(X.data.subarray(16,20)));do{if(Z=Pn(X.data.subarray(te+4,te+8)),Z<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});return}if(Ee=String.fromCharCode(X.data[te],X.data[te+1],X.data[te+2],X.data[te+3]),ie={id:Ee,data:X.data.subarray(te+10,te+Z+10)},ie.key=ie.id,oa[ie.id]&&(oa[ie.id](ie),ie.owner==="com.apple.streaming.transportStreamTimestamp")){var Pe=ie.data,Se=(Pe[3]&1)<<30|Pe[4]<<22|Pe[5]<<14|Pe[6]<<6|Pe[7]>>>2;Se*=4,Se+=Pe[7]&3,ie.timeStamp=Se,X.pts===void 0&&X.dts===void 0&&(X.pts=ie.timeStamp,X.dts=ie.timeStamp),this.trigger("timestamp",ie)}X.frames.push(ie),te+=10,te+=Z}while(te<y);this.trigger("data",X)}}}},ls.prototype=new e;var sd=ls,ad=ou.TimestampRolloverStream,an,Lr,us,or=188,on=71;an=function(){var m=new Uint8Array(or),S=0;an.prototype.init.call(this),this.push=function(y){var E=0,x=or,N;for(S?(N=new Uint8Array(y.byteLength+S),N.set(m.subarray(0,S)),N.set(y,S),S=0):N=y;x<N.byteLength;){if(N[E]===on&&N[x]===on){this.trigger("data",N.subarray(E,x)),E+=or,x+=or;continue}E++,x++}E<N.byteLength&&(m.set(N.subarray(E),0),S=N.byteLength-E)},this.flush=function(){S===or&&m[0]===on&&(this.trigger("data",m),S=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){S=0,this.trigger("reset")}},an.prototype=new e,Lr=function(){var m,S,y,E;Lr.prototype.init.call(this),E=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,m=function(N,q){var X=0;q.payloadUnitStartIndicator&&(X+=N[X]+1),q.type==="pat"?S(N.subarray(X),q):y(N.subarray(X),q)},S=function(N,q){q.section_number=N[7],q.last_section_number=N[8],E.pmtPid=(N[10]&31)<<8|N[11],q.pmtPid=E.pmtPid},y=function(N,q){var X,te,Z,ie;if(N[5]&1){for(E.programMapTable={video:null,audio:null,"timed-metadata":{}},X=(N[1]&15)<<8|N[2],te=3+X-4,Z=(N[10]&15)<<8|N[11],ie=12+Z;ie<te;){var ge=N[ie],Ee=(N[ie+1]&31)<<8|N[ie+2];ge===$t.H264_STREAM_TYPE&&E.programMapTable.video===null?E.programMapTable.video=Ee:ge===$t.ADTS_STREAM_TYPE&&E.programMapTable.audio===null?E.programMapTable.audio=Ee:ge===$t.METADATA_STREAM_TYPE&&(E.programMapTable["timed-metadata"][Ee]=ge),ie+=((N[ie+3]&15)<<8|N[ie+4])+5}q.programMapTable=E.programMapTable}},this.push=function(x){var N={},q=4;if(N.payloadUnitStartIndicator=!!(x[1]&64),N.pid=x[1]&31,N.pid<<=8,N.pid|=x[2],(x[3]&48)>>>4>1&&(q+=x[q]+1),N.pid===0)N.type="pat",m(x.subarray(q),N),this.trigger("data",N);else if(N.pid===this.pmtPid)for(N.type="pmt",m(x.subarray(q),N),this.trigger("data",N);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([x,q,N]):this.processPes_(x,q,N)},this.processPes_=function(x,N,q){q.pid===this.programMapTable.video?q.streamType=$t.H264_STREAM_TYPE:q.pid===this.programMapTable.audio?q.streamType=$t.ADTS_STREAM_TYPE:q.streamType=this.programMapTable["timed-metadata"][q.pid],q.type="pes",q.data=x.subarray(N),this.trigger("data",q)}},Lr.prototype=new e,Lr.STREAM_TYPES={h264:27,adts:15},us=function(){var m=this,S=!1,y={data:[],size:0},E={data:[],size:0},x={data:[],size:0},N,q=function(Z,ie){var ge,Ee=Z[0]<<16|Z[1]<<8|Z[2];ie.data=new Uint8Array,Ee===1&&(ie.packetLength=6+(Z[4]<<8|Z[5]),ie.dataAlignmentIndicator=(Z[6]&4)!==0,ge=Z[7],ge&192&&(ie.pts=(Z[9]&14)<<27|(Z[10]&255)<<20|(Z[11]&254)<<12|(Z[12]&255)<<5|(Z[13]&254)>>>3,ie.pts*=4,ie.pts+=(Z[13]&6)>>>1,ie.dts=ie.pts,ge&64&&(ie.dts=(Z[14]&14)<<27|(Z[15]&255)<<20|(Z[16]&254)<<12|(Z[17]&255)<<5|(Z[18]&254)>>>3,ie.dts*=4,ie.dts+=(Z[18]&6)>>>1)),ie.data=Z.subarray(9+Z[8]))},X=function(Z,ie,ge){var Ee=new Uint8Array(Z.size),Pe={type:ie},Se=0,ze=0,Lt=!1,ai;if(!(!Z.data.length||Z.size<9)){for(Pe.trackId=Z.data[0].pid,Se=0;Se<Z.data.length;Se++)ai=Z.data[Se],Ee.set(ai.data,ze),ze+=ai.data.byteLength;q(Ee,Pe),Lt=ie==="video"||Pe.packetLength<=Z.size,(ge||Lt)&&(Z.size=0,Z.data.length=0),Lt&&m.trigger("data",Pe)}};us.prototype.init.call(this),this.push=function(te){({pat:function(){},pes:function(){var ie,ge;switch(te.streamType){case $t.H264_STREAM_TYPE:ie=y,ge="video";break;case $t.ADTS_STREAM_TYPE:ie=E,ge="audio";break;case $t.METADATA_STREAM_TYPE:ie=x,ge="timed-metadata";break;default:return}te.payloadUnitStartIndicator&&X(ie,ge,!0),ie.data.push(te),ie.size+=te.data.byteLength},pmt:function(){var ie={type:"metadata",tracks:[]};N=te.programMapTable,N.video!==null&&ie.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+N.video,codec:"avc",type:"video"}),N.audio!==null&&ie.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+N.audio,codec:"adts",type:"audio"}),S=!0,m.trigger("data",ie)}})[te.type]()},this.reset=function(){y.size=0,y.data.length=0,E.size=0,E.data.length=0,this.trigger("reset")},this.flushStreams_=function(){X(y,"video"),X(E,"audio"),X(x,"timed-metadata")},this.flush=function(){if(!S&&N){var te={type:"metadata",tracks:[]};N.video!==null&&te.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+N.video,codec:"avc",type:"video"}),N.audio!==null&&te.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+N.audio,codec:"adts",type:"audio"}),m.trigger("data",te)}S=!1,this.flushStreams_(),this.trigger("done")}},us.prototype=new e;var Dn={PAT_PID:0,MP2T_PACKET_LENGTH:or,TransportPacketStream:an,TransportParseStream:Lr,ElementaryStream:us,TimestampRolloverStream:ad,CaptionStream:nn.CaptionStream,Cea608Stream:nn.Cea608Stream,Cea708Stream:nn.Cea708Stream,MetadataStream:sd};for(var ln in $t)$t.hasOwnProperty(ln)&&(Dn[ln]=$t[ln]);var _r=Dn,cu=tt.ONE_SECOND_IN_TS,la,hu=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];la=function(m){var S,y=0;la.prototype.init.call(this),this.skipWarn_=function(E,x){this.trigger("log",{level:"warn",message:"adts skiping bytes "+E+" to "+x+" in frame "+y+" outside syncword"})},this.push=function(E){var x=0,N,q,X,te,Z;if(m||(y=0),E.type==="audio"){S&&S.length?(X=S,S=new Uint8Array(X.byteLength+E.data.byteLength),S.set(X),S.set(E.data,X.byteLength)):S=E.data;for(var ie;x+7<S.length;){if(S[x]!==255||(S[x+1]&246)!==240){typeof ie!="number"&&(ie=x),x++;continue}if(typeof ie=="number"&&(this.skipWarn_(ie,x),ie=null),q=(~S[x+1]&1)*2,N=(S[x+3]&3)<<11|S[x+4]<<3|(S[x+5]&224)>>5,te=((S[x+6]&3)+1)*1024,Z=te*cu/hu[(S[x+2]&60)>>>2],S.byteLength-x<N)break;this.trigger("data",{pts:E.pts+y*Z,dts:E.dts+y*Z,sampleCount:te,audioobjecttype:(S[x+2]>>>6&3)+1,channelcount:(S[x+2]&1)<<2|(S[x+3]&192)>>>6,samplerate:hu[(S[x+2]&60)>>>2],samplingfrequencyindex:(S[x+2]&60)>>>2,samplesize:16,data:S.subarray(x+7+q,x+N)}),y++,x+=N}typeof ie=="number"&&(this.skipWarn_(ie,x),ie=null),S=S.subarray(x)}},this.flush=function(){y=0,this.trigger("done")},this.reset=function(){S=void 0,this.trigger("reset")},this.endTimeline=function(){S=void 0,this.trigger("endedtimeline")}},la.prototype=new e;var Tr=la,cs;cs=function(m){var S=m.byteLength,y=0,E=0;this.length=function(){return 8*S},this.bitsAvailable=function(){return 8*S+E},this.loadWord=function(){var x=m.byteLength-S,N=new Uint8Array(4),q=Math.min(4,S);if(q===0)throw new Error("no bytes available");N.set(m.subarray(x,x+q)),y=new DataView(N.buffer).getUint32(0),E=q*8,S-=q},this.skipBits=function(x){var N;E>x?(y<<=x,E-=x):(x-=E,N=Math.floor(x/8),x-=N*8,S-=N,this.loadWord(),y<<=x,E-=x)},this.readBits=function(x){var N=Math.min(E,x),q=y>>>32-N;return E-=N,E>0?y<<=N:S>0&&this.loadWord(),N=x-N,N>0?q<<N|this.readBits(N):q},this.skipLeadingZeros=function(){var x;for(x=0;x<E;++x)if((y&2147483648>>>x)!==0)return y<<=x,E-=x,x;return this.loadWord(),x+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var x=this.skipLeadingZeros();return this.readBits(x+1)-1},this.readExpGolomb=function(){var x=this.readUnsignedExpGolomb();return 1&x?1+x>>>1:-1*(x>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var od=cs,Nn,Ln,Oi;Ln=function(){var m=0,S,y;Ln.prototype.init.call(this),this.push=function(E){var x;y?(x=new Uint8Array(y.byteLength+E.data.byteLength),x.set(y),x.set(E.data,y.byteLength),y=x):y=E.data;for(var N=y.byteLength;m<N-3;m++)if(y[m+2]===1){S=m+5;break}for(;S<N;)switch(y[S]){case 0:if(y[S-1]!==0){S+=2;break}else if(y[S-2]!==0){S++;break}m+3!==S-2&&this.trigger("data",y.subarray(m+3,S-2));do S++;while(y[S]!==1&&S<N);m=S-2,S+=3;break;case 1:if(y[S-1]!==0||y[S-2]!==0){S+=3;break}this.trigger("data",y.subarray(m+3,S-2)),m=S-2,S+=3;break;default:S+=3;break}y=y.subarray(m),S-=m,m=0},this.reset=function(){y=null,m=0,this.trigger("reset")},this.flush=function(){y&&y.byteLength>3&&this.trigger("data",y.subarray(m+3)),y=null,m=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Ln.prototype=new e,Oi={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Nn=function(){var m=new Ln,S,y,E,x,N,q,X;Nn.prototype.init.call(this),S=this,this.push=function(te){te.type==="video"&&(y=te.trackId,E=te.pts,x=te.dts,m.push(te))},m.on("data",function(te){var Z={trackId:y,pts:E,dts:x,data:te,nalUnitTypeCode:te[0]&31};switch(Z.nalUnitTypeCode){case 5:Z.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:Z.nalUnitType="sei_rbsp",Z.escapedRBSP=N(te.subarray(1));break;case 7:Z.nalUnitType="seq_parameter_set_rbsp",Z.escapedRBSP=N(te.subarray(1)),Z.config=q(Z.escapedRBSP);break;case 8:Z.nalUnitType="pic_parameter_set_rbsp";break;case 9:Z.nalUnitType="access_unit_delimiter_rbsp";break}S.trigger("data",Z)}),m.on("done",function(){S.trigger("done")}),m.on("partialdone",function(){S.trigger("partialdone")}),m.on("reset",function(){S.trigger("reset")}),m.on("endedtimeline",function(){S.trigger("endedtimeline")}),this.flush=function(){m.flush()},this.partialFlush=function(){m.partialFlush()},this.reset=function(){m.reset()},this.endTimeline=function(){m.endTimeline()},X=function(Z,ie){var ge=8,Ee=8,Pe,Se;for(Pe=0;Pe<Z;Pe++)Ee!==0&&(Se=ie.readExpGolomb(),Ee=(ge+Se+256)%256),ge=Ee===0?ge:Ee},N=function(Z){for(var ie=Z.byteLength,ge=[],Ee=1,Pe,Se;Ee<ie-2;)Z[Ee]===0&&Z[Ee+1]===0&&Z[Ee+2]===3?(ge.push(Ee+2),Ee+=2):Ee++;if(ge.length===0)return Z;Pe=ie-ge.length,Se=new Uint8Array(Pe);var ze=0;for(Ee=0;Ee<Pe;ze++,Ee++)ze===ge[0]&&(ze++,ge.shift()),Se[Ee]=Z[ze];return Se},q=function(Z){var ie=0,ge=0,Ee=0,Pe=0,Se,ze,Lt,ai,Wi,Ho,qo,zo,Pu,Wo,Go,Ot=[1,1],Du,Sr;if(Se=new od(Z),ze=Se.readUnsignedByte(),ai=Se.readUnsignedByte(),Lt=Se.readUnsignedByte(),Se.skipUnsignedExpGolomb(),Oi[ze]&&(Wi=Se.readUnsignedExpGolomb(),Wi===3&&Se.skipBits(1),Se.skipUnsignedExpGolomb(),Se.skipUnsignedExpGolomb(),Se.skipBits(1),Se.readBoolean()))for(Go=Wi!==3?8:12,Sr=0;Sr<Go;Sr++)Se.readBoolean()&&(Sr<6?X(16,Se):X(64,Se));if(Se.skipUnsignedExpGolomb(),Ho=Se.readUnsignedExpGolomb(),Ho===0)Se.readUnsignedExpGolomb();else if(Ho===1)for(Se.skipBits(1),Se.skipExpGolomb(),Se.skipExpGolomb(),qo=Se.readUnsignedExpGolomb(),Sr=0;Sr<qo;Sr++)Se.skipExpGolomb();if(Se.skipUnsignedExpGolomb(),Se.skipBits(1),zo=Se.readUnsignedExpGolomb(),Pu=Se.readUnsignedExpGolomb(),Wo=Se.readBits(1),Wo===0&&Se.skipBits(1),Se.skipBits(1),Se.readBoolean()&&(ie=Se.readUnsignedExpGolomb(),ge=Se.readUnsignedExpGolomb(),Ee=Se.readUnsignedExpGolomb(),Pe=Se.readUnsignedExpGolomb()),Se.readBoolean()&&Se.readBoolean()){switch(Du=Se.readUnsignedByte(),Du){case 1:Ot=[1,1];break;case 2:Ot=[12,11];break;case 3:Ot=[10,11];break;case 4:Ot=[16,11];break;case 5:Ot=[40,33];break;case 6:Ot=[24,11];break;case 7:Ot=[20,11];break;case 8:Ot=[32,11];break;case 9:Ot=[80,33];break;case 10:Ot=[18,11];break;case 11:Ot=[15,11];break;case 12:Ot=[64,33];break;case 13:Ot=[160,99];break;case 14:Ot=[4,3];break;case 15:Ot=[3,2];break;case 16:Ot=[2,1];break;case 255:{Ot=[Se.readUnsignedByte()<<8|Se.readUnsignedByte(),Se.readUnsignedByte()<<8|Se.readUnsignedByte()];break}}Ot&&Ot[0]/Ot[1]}return{profileIdc:ze,levelIdc:Lt,profileCompatibility:ai,width:(zo+1)*16-ie*2-ge*2,height:(2-Wo)*(Pu+1)*16-Ee*2-Pe*2,sarRatio:Ot}}},Nn.prototype=new e;var ld={H264Stream:Nn},ua=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],On=function(m,S){var y=m[S+6]<<21|m[S+7]<<14|m[S+8]<<7|m[S+9],E=m[S+5],x=(E&16)>>4;return y=y>=0?y:0,x?y+20:y+10},ca=function $(m,S){return m.length-S<10||m[S]!==73||m[S+1]!==68||m[S+2]!==51?S:(S+=On(m,S),$(m,S))},Mn=function(m){var S=ca(m,0);return m.length>=S+2&&(m[S]&255)===255&&(m[S+1]&240)===240&&(m[S+1]&22)===16},ha=function(m){return m[0]<<21|m[1]<<14|m[2]<<7|m[3]},du=function(m,S,y){var E,x="";for(E=S;E<y;E++)x+="%"+("00"+m[E].toString(16)).slice(-2);return x},Uo=function(m,S,y){return unescape(du(m,S,y))},ud=function(m,S){var y=(m[S+5]&224)>>5,E=m[S+4]<<3,x=m[S+3]&6144;return x|E|y},cd=function(m,S){return m[S]===73&&m[S+1]===68&&m[S+2]===51?"timed-metadata":m[S]&!0&&(m[S+1]&240)===240?"audio":null},hd=function(m){for(var S=0;S+5<m.length;){if(m[S]!==255||(m[S+1]&246)!==240){S++;continue}return ua[(m[S+2]&60)>>>2]}return null},da=function(m){var S,y,E,x;S=10,m[5]&64&&(S+=4,S+=ha(m.subarray(10,14)));do{if(y=ha(m.subarray(S+4,S+8)),y<1)return null;if(x=String.fromCharCode(m[S],m[S+1],m[S+2],m[S+3]),x==="PRIV"){E=m.subarray(S+10,S+y+10);for(var N=0;N<E.byteLength;N++)if(E[N]===0){var q=Uo(E,0,N);if(q==="com.apple.streaming.transportStreamTimestamp"){var X=E.subarray(N+1),te=(X[3]&1)<<30|X[4]<<22|X[5]<<14|X[6]<<6|X[7]>>>2;return te*=4,te+=X[7]&3,te}break}}S+=10,S+=y}while(S<m.byteLength);return null},hs={isLikelyAacData:Mn,parseId3TagSize:On,parseAdtsSize:ud,parseType:cd,parseSampleRate:hd,parseAacTimestamp:da},fa;fa=function(){var m=new Uint8Array,S=0;fa.prototype.init.call(this),this.setTimestamp=function(y){S=y},this.push=function(y){var E=0,x=0,N,q,X,te;for(m.length?(te=m.length,m=new Uint8Array(y.byteLength+te),m.set(m.subarray(0,te)),m.set(y,te)):m=y;m.length-x>=3;){if(m[x]===73&&m[x+1]===68&&m[x+2]===51){if(m.length-x<10||(E=hs.parseId3TagSize(m,x),x+E>m.length))break;q={type:"timed-metadata",data:m.subarray(x,x+E)},this.trigger("data",q),x+=E;continue}else if((m[x]&255)===255&&(m[x+1]&240)===240){if(m.length-x<7||(E=hs.parseAdtsSize(m,x),x+E>m.length))break;X={type:"audio",data:m.subarray(x,x+E),pts:S,dts:S},this.trigger("data",X),x+=E;continue}x++}N=m.length-x,N>0?m=m.subarray(x):m=new Uint8Array},this.reset=function(){m=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){m=new Uint8Array,this.trigger("endedtimeline")}},fa.prototype=new e;var fu=fa,dd=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],$o=dd,fd=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],ds=fd,pa=ld.H264Stream,pu=hs.isLikelyAacData,pd=tt.ONE_SECOND_IN_TS,ma,Rn,fs,un,mu=function(m,S){S.stream=m,this.trigger("log",S)},gu=function(m,S){for(var y=Object.keys(S),E=0;E<y.length;E++){var x=y[E];x==="headOfPipeline"||!S[x].on||S[x].on("log",mu.bind(m,x))}},vu=function(m,S){var y;if(m.length!==S.length)return!1;for(y=0;y<m.length;y++)if(m[y]!==S[y])return!1;return!0},yu=function(m,S,y,E,x,N){var q=y-S,X=E-S,te=x-y;return{start:{dts:m,pts:m+q},end:{dts:m+X,pts:m+te},prependedContentDuration:N,baseMediaDecodeTime:m}};Rn=function(m,S){var y=[],E,x=0,N=0,q=1/0;S=S||{},E=S.firstSequenceNumber||0,Rn.prototype.init.call(this),this.push=function(X){j.collectDtsInfo(m,X),m&&$o.forEach(function(te){m[te]=X[te]}),y.push(X)},this.setEarliestDts=function(X){x=X},this.setVideoBaseMediaDecodeTime=function(X){q=X},this.setAudioAppendStart=function(X){N=X},this.flush=function(){var X,te,Z,ie,ge,Ee,Pe;if(y.length===0){this.trigger("done","AudioSegmentStream");return}X=Dr.trimAdtsFramesByEarliestDts(y,m,x),m.baseMediaDecodeTime=j.calculateTrackBaseMediaDecodeTime(m,S.keepOriginalTimestamps),Pe=Dr.prefixWithSilence(m,X,N,q),m.samples=Dr.generateSampleTable(X),Z=Je.mdat(Dr.concatenateFrameData(X)),y=[],te=Je.moof(E,[m]),ie=new Uint8Array(te.byteLength+Z.byteLength),E++,ie.set(te),ie.set(Z,te.byteLength),j.clearDtsInfo(m),ge=Math.ceil(pd*1024/m.samplerate),X.length&&(Ee=X.length*ge,this.trigger("segmentTimingInfo",yu(tt.audioTsToVideoTs(m.baseMediaDecodeTime,m.samplerate),X[0].dts,X[0].pts,X[0].dts+Ee,X[0].pts+Ee,Pe||0)),this.trigger("timingInfo",{start:X[0].pts,end:X[0].pts+Ee})),this.trigger("data",{track:m,boxes:ie}),this.trigger("done","AudioSegmentStream")},this.reset=function(){j.clearDtsInfo(m),y=[],this.trigger("reset")}},Rn.prototype=new e,ma=function(m,S){var y,E=[],x=[],N,q;S=S||{},y=S.firstSequenceNumber||0,ma.prototype.init.call(this),delete m.minPTS,this.gopCache_=[],this.push=function(X){j.collectDtsInfo(m,X),X.nalUnitType==="seq_parameter_set_rbsp"&&!N&&(N=X.config,m.sps=[X.data],ds.forEach(function(te){m[te]=N[te]},this)),X.nalUnitType==="pic_parameter_set_rbsp"&&!q&&(q=X.data,m.pps=[X.data]),E.push(X)},this.flush=function(){for(var X,te,Z,ie,ge,Ee,Pe=0,Se,ze;E.length&&E[0].nalUnitType!=="access_unit_delimiter_rbsp";)E.shift();if(E.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(X=Te.groupNalsIntoFrames(E),Z=Te.groupFramesIntoGops(X),Z[0][0].keyFrame||(te=this.getGopForFusion_(E[0],m),te?(Pe=te.duration,Z.unshift(te),Z.byteLength+=te.byteLength,Z.nalCount+=te.nalCount,Z.pts=te.pts,Z.dts=te.dts,Z.duration+=te.duration):Z=Te.extendFirstKeyFrame(Z)),x.length){var Lt;if(S.alignGopsAtEnd?Lt=this.alignGopsAtEnd_(Z):Lt=this.alignGopsAtStart_(Z),!Lt){this.gopCache_.unshift({gop:Z.pop(),pps:m.pps,sps:m.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),E=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}j.clearDtsInfo(m),Z=Lt}j.collectDtsInfo(m,Z),m.samples=Te.generateSampleTable(Z),ge=Je.mdat(Te.concatenateNalData(Z)),m.baseMediaDecodeTime=j.calculateTrackBaseMediaDecodeTime(m,S.keepOriginalTimestamps),this.trigger("processedGopsInfo",Z.map(function(ai){return{pts:ai.pts,dts:ai.dts,byteLength:ai.byteLength}})),Se=Z[0],ze=Z[Z.length-1],this.trigger("segmentTimingInfo",yu(m.baseMediaDecodeTime,Se.dts,Se.pts,ze.dts+ze.duration,ze.pts+ze.duration,Pe)),this.trigger("timingInfo",{start:Z[0].pts,end:Z[Z.length-1].pts+Z[Z.length-1].duration}),this.gopCache_.unshift({gop:Z.pop(),pps:m.pps,sps:m.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),E=[],this.trigger("baseMediaDecodeTime",m.baseMediaDecodeTime),this.trigger("timelineStartInfo",m.timelineStartInfo),ie=Je.moof(y,[m]),Ee=new Uint8Array(ie.byteLength+ge.byteLength),y++,Ee.set(ie),Ee.set(ge,ie.byteLength),this.trigger("data",{track:m,boxes:Ee}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),E=[],this.gopCache_.length=0,x.length=0,this.trigger("reset")},this.resetStream_=function(){j.clearDtsInfo(m),N=void 0,q=void 0},this.getGopForFusion_=function(X){var te=45e3,Z=1/0,ie,ge,Ee,Pe,Se;for(Se=0;Se<this.gopCache_.length;Se++)Pe=this.gopCache_[Se],Ee=Pe.gop,!(!(m.pps&&vu(m.pps[0],Pe.pps[0]))||!(m.sps&&vu(m.sps[0],Pe.sps[0])))&&(Ee.dts<m.timelineStartInfo.dts||(ie=X.dts-Ee.dts-Ee.duration,ie>=-1e4&&ie<=te&&(!ge||Z>ie)&&(ge=Pe,Z=ie)));return ge?ge.gop:null},this.alignGopsAtStart_=function(X){var te,Z,ie,ge,Ee,Pe,Se,ze;for(Ee=X.byteLength,Pe=X.nalCount,Se=X.duration,te=Z=0;te<x.length&&Z<X.length&&(ie=x[te],ge=X[Z],ie.pts!==ge.pts);){if(ge.pts>ie.pts){te++;continue}Z++,Ee-=ge.byteLength,Pe-=ge.nalCount,Se-=ge.duration}return Z===0?X:Z===X.length?null:(ze=X.slice(Z),ze.byteLength=Ee,ze.duration=Se,ze.nalCount=Pe,ze.pts=ze[0].pts,ze.dts=ze[0].dts,ze)},this.alignGopsAtEnd_=function(X){var te,Z,ie,ge,Ee,Pe;for(te=x.length-1,Z=X.length-1,Ee=null,Pe=!1;te>=0&&Z>=0;){if(ie=x[te],ge=X[Z],ie.pts===ge.pts){Pe=!0;break}if(ie.pts>ge.pts){te--;continue}te===x.length-1&&(Ee=Z),Z--}if(!Pe&&Ee===null)return null;var Se;if(Pe?Se=Z:Se=Ee,Se===0)return X;var ze=X.slice(Se),Lt=ze.reduce(function(ai,Wi){return ai.byteLength+=Wi.byteLength,ai.duration+=Wi.duration,ai.nalCount+=Wi.nalCount,ai},{byteLength:0,duration:0,nalCount:0});return ze.byteLength=Lt.byteLength,ze.duration=Lt.duration,ze.nalCount=Lt.nalCount,ze.pts=ze[0].pts,ze.dts=ze[0].dts,ze},this.alignGopsWith=function(X){x=X}},ma.prototype=new e,un=function(m,S){this.numberOfTracks=0,this.metadataStream=S,m=m||{},typeof m.remux<"u"?this.remuxTracks=!!m.remux:this.remuxTracks=!0,typeof m.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=m.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,un.prototype.init.call(this),this.push=function(y){if(y.text)return this.pendingCaptions.push(y);if(y.frames)return this.pendingMetadata.push(y);this.pendingTracks.push(y.track),this.pendingBytes+=y.boxes.byteLength,y.track.type==="video"&&(this.videoTrack=y.track,this.pendingBoxes.push(y.boxes)),y.track.type==="audio"&&(this.audioTrack=y.track,this.pendingBoxes.unshift(y.boxes))}},un.prototype=new e,un.prototype.flush=function($){var m=0,S={captions:[],captionStreams:{},metadata:[],info:{}},y,E,x,N=0,q;if(this.pendingTracks.length<this.numberOfTracks){if($!=="VideoSegmentStream"&&$!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(N=this.videoTrack.timelineStartInfo.pts,ds.forEach(function(X){S.info[X]=this.videoTrack[X]},this)):this.audioTrack&&(N=this.audioTrack.timelineStartInfo.pts,$o.forEach(function(X){S.info[X]=this.audioTrack[X]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?S.type=this.pendingTracks[0].type:S.type="combined",this.emittedTracks+=this.pendingTracks.length,x=Je.initSegment(this.pendingTracks),S.initSegment=new Uint8Array(x.byteLength),S.initSegment.set(x),S.data=new Uint8Array(this.pendingBytes),q=0;q<this.pendingBoxes.length;q++)S.data.set(this.pendingBoxes[q],m),m+=this.pendingBoxes[q].byteLength;for(q=0;q<this.pendingCaptions.length;q++)y=this.pendingCaptions[q],y.startTime=tt.metadataTsToSeconds(y.startPts,N,this.keepOriginalTimestamps),y.endTime=tt.metadataTsToSeconds(y.endPts,N,this.keepOriginalTimestamps),S.captionStreams[y.stream]=!0,S.captions.push(y);for(q=0;q<this.pendingMetadata.length;q++)E=this.pendingMetadata[q],E.cueTime=tt.metadataTsToSeconds(E.pts,N,this.keepOriginalTimestamps),S.metadata.push(E);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),q=0;q<S.captions.length;q++)y=S.captions[q],this.trigger("caption",y);for(q=0;q<S.metadata.length;q++)E=S.metadata[q],this.trigger("id3Frame",E)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},un.prototype.setRemux=function($){this.remuxTracks=$},fs=function(m){var S=this,y=!0,E,x;fs.prototype.init.call(this),m=m||{},this.baseMediaDecodeTime=m.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var N={};this.transmuxPipeline_=N,N.type="aac",N.metadataStream=new _r.MetadataStream,N.aacStream=new fu,N.audioTimestampRolloverStream=new _r.TimestampRolloverStream("audio"),N.timedMetadataTimestampRolloverStream=new _r.TimestampRolloverStream("timed-metadata"),N.adtsStream=new Tr,N.coalesceStream=new un(m,N.metadataStream),N.headOfPipeline=N.aacStream,N.aacStream.pipe(N.audioTimestampRolloverStream).pipe(N.adtsStream),N.aacStream.pipe(N.timedMetadataTimestampRolloverStream).pipe(N.metadataStream).pipe(N.coalesceStream),N.metadataStream.on("timestamp",function(q){N.aacStream.setTimestamp(q.timeStamp)}),N.aacStream.on("data",function(q){q.type!=="timed-metadata"&&q.type!=="audio"||N.audioSegmentStream||(x=x||{timelineStartInfo:{baseMediaDecodeTime:S.baseMediaDecodeTime},codec:"adts",type:"audio"},N.coalesceStream.numberOfTracks++,N.audioSegmentStream=new Rn(x,m),N.audioSegmentStream.on("log",S.getLogTrigger_("audioSegmentStream")),N.audioSegmentStream.on("timingInfo",S.trigger.bind(S,"audioTimingInfo")),N.adtsStream.pipe(N.audioSegmentStream).pipe(N.coalesceStream),S.trigger("trackinfo",{hasAudio:!!x,hasVideo:!!E}))}),N.coalesceStream.on("data",this.trigger.bind(this,"data")),N.coalesceStream.on("done",this.trigger.bind(this,"done")),gu(this,N)},this.setupTsPipeline=function(){var N={};this.transmuxPipeline_=N,N.type="ts",N.metadataStream=new _r.MetadataStream,N.packetStream=new _r.TransportPacketStream,N.parseStream=new _r.TransportParseStream,N.elementaryStream=new _r.ElementaryStream,N.timestampRolloverStream=new _r.TimestampRolloverStream,N.adtsStream=new Tr,N.h264Stream=new pa,N.captionStream=new _r.CaptionStream(m),N.coalesceStream=new un(m,N.metadataStream),N.headOfPipeline=N.packetStream,N.packetStream.pipe(N.parseStream).pipe(N.elementaryStream).pipe(N.timestampRolloverStream),N.timestampRolloverStream.pipe(N.h264Stream),N.timestampRolloverStream.pipe(N.adtsStream),N.timestampRolloverStream.pipe(N.metadataStream).pipe(N.coalesceStream),N.h264Stream.pipe(N.captionStream).pipe(N.coalesceStream),N.elementaryStream.on("data",function(q){var X;if(q.type==="metadata"){for(X=q.tracks.length;X--;)!E&&q.tracks[X].type==="video"?(E=q.tracks[X],E.timelineStartInfo.baseMediaDecodeTime=S.baseMediaDecodeTime):!x&&q.tracks[X].type==="audio"&&(x=q.tracks[X],x.timelineStartInfo.baseMediaDecodeTime=S.baseMediaDecodeTime);E&&!N.videoSegmentStream&&(N.coalesceStream.numberOfTracks++,N.videoSegmentStream=new ma(E,m),N.videoSegmentStream.on("log",S.getLogTrigger_("videoSegmentStream")),N.videoSegmentStream.on("timelineStartInfo",function(te){x&&!m.keepOriginalTimestamps&&(x.timelineStartInfo=te,N.audioSegmentStream.setEarliestDts(te.dts-S.baseMediaDecodeTime))}),N.videoSegmentStream.on("processedGopsInfo",S.trigger.bind(S,"gopInfo")),N.videoSegmentStream.on("segmentTimingInfo",S.trigger.bind(S,"videoSegmentTimingInfo")),N.videoSegmentStream.on("baseMediaDecodeTime",function(te){x&&N.audioSegmentStream.setVideoBaseMediaDecodeTime(te)}),N.videoSegmentStream.on("timingInfo",S.trigger.bind(S,"videoTimingInfo")),N.h264Stream.pipe(N.videoSegmentStream).pipe(N.coalesceStream)),x&&!N.audioSegmentStream&&(N.coalesceStream.numberOfTracks++,N.audioSegmentStream=new Rn(x,m),N.audioSegmentStream.on("log",S.getLogTrigger_("audioSegmentStream")),N.audioSegmentStream.on("timingInfo",S.trigger.bind(S,"audioTimingInfo")),N.audioSegmentStream.on("segmentTimingInfo",S.trigger.bind(S,"audioSegmentTimingInfo")),N.adtsStream.pipe(N.audioSegmentStream).pipe(N.coalesceStream)),S.trigger("trackinfo",{hasAudio:!!x,hasVideo:!!E})}}),N.coalesceStream.on("data",this.trigger.bind(this,"data")),N.coalesceStream.on("id3Frame",function(q){q.dispatchType=N.metadataStream.dispatchType,S.trigger("id3Frame",q)}),N.coalesceStream.on("caption",this.trigger.bind(this,"caption")),N.coalesceStream.on("done",this.trigger.bind(this,"done")),gu(this,N)},this.setBaseMediaDecodeTime=function(N){var q=this.transmuxPipeline_;m.keepOriginalTimestamps||(this.baseMediaDecodeTime=N),x&&(x.timelineStartInfo.dts=void 0,x.timelineStartInfo.pts=void 0,j.clearDtsInfo(x),q.audioTimestampRolloverStream&&q.audioTimestampRolloverStream.discontinuity()),E&&(q.videoSegmentStream&&(q.videoSegmentStream.gopCache_=[]),E.timelineStartInfo.dts=void 0,E.timelineStartInfo.pts=void 0,j.clearDtsInfo(E),q.captionStream.reset()),q.timestampRolloverStream&&q.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(N){x&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(N)},this.setRemux=function(N){var q=this.transmuxPipeline_;m.remux=N,q&&q.coalesceStream&&q.coalesceStream.setRemux(N)},this.alignGopsWith=function(N){E&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(N)},this.getLogTrigger_=function(N){var q=this;return function(X){X.stream=N,q.trigger("log",X)}},this.push=function(N){if(y){var q=pu(N);q&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!q&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),y=!1}this.transmuxPipeline_.headOfPipeline.push(N)},this.flush=function(){y=!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()}},fs.prototype=new e;var md={Transmuxer:fs},gd=function(m){return m>>>0},vd=function(m){return("00"+m.toString(16)).slice(-2)},Bn={toUnsigned:gd,toHexString:vd},yd=function(m){var S="";return S+=String.fromCharCode(m[0]),S+=String.fromCharCode(m[1]),S+=String.fromCharCode(m[2]),S+=String.fromCharCode(m[3]),S},Or=yd,ga=Bn.toUnsigned,_d=function $(m,S){var y=[],E,x,N,q,X;if(!S.length)return null;for(E=0;E<m.byteLength;)x=ga(m[E]<<24|m[E+1]<<16|m[E+2]<<8|m[E+3]),N=Or(m.subarray(E+4,E+8)),q=x>1?E+x:m.byteLength,N===S[0]&&(S.length===1?y.push(m.subarray(E+8,q)):(X=$(m.subarray(E+8,q),S.slice(1)),X.length&&(y=y.concat(X)))),E=q;return y},_t=_d,Td=Bn.toUnsigned,bd=r.getUint64,Sd=function(m){var S={version:m[0],flags:new Uint8Array(m.subarray(1,4))};return S.version===1?S.baseMediaDecodeTime=bd(m.subarray(4)):S.baseMediaDecodeTime=Td(m[4]<<24|m[5]<<16|m[6]<<8|m[7]),S},ps=Sd,ms=function(m){return{isLeading:(m[0]&12)>>>2,dependsOn:m[0]&3,isDependedOn:(m[1]&192)>>>6,hasRedundancy:(m[1]&48)>>>4,paddingValue:(m[1]&14)>>>1,isNonSyncSample:m[1]&1,degradationPriority:m[2]<<8|m[3]}},Fn=ms,va=function(m){var S={version:m[0],flags:new Uint8Array(m.subarray(1,4)),samples:[]},y=new DataView(m.buffer,m.byteOffset,m.byteLength),E=S.flags[2]&1,x=S.flags[2]&4,N=S.flags[1]&1,q=S.flags[1]&2,X=S.flags[1]&4,te=S.flags[1]&8,Z=y.getUint32(4),ie=8,ge;for(E&&(S.dataOffset=y.getInt32(ie),ie+=4),x&&Z&&(ge={flags:Fn(m.subarray(ie,ie+4))},ie+=4,N&&(ge.duration=y.getUint32(ie),ie+=4),q&&(ge.size=y.getUint32(ie),ie+=4),te&&(S.version===1?ge.compositionTimeOffset=y.getInt32(ie):ge.compositionTimeOffset=y.getUint32(ie),ie+=4),S.samples.push(ge),Z--);Z--;)ge={},N&&(ge.duration=y.getUint32(ie),ie+=4),q&&(ge.size=y.getUint32(ie),ie+=4),X&&(ge.flags=Fn(m.subarray(ie,ie+4)),ie+=4),te&&(S.version===1?ge.compositionTimeOffset=y.getInt32(ie):ge.compositionTimeOffset=y.getUint32(ie),ie+=4),S.samples.push(ge);return S},Mi=va,br=function(m){var S=new DataView(m.buffer,m.byteOffset,m.byteLength),y={version:m[0],flags:new Uint8Array(m.subarray(1,4)),trackId:S.getUint32(4)},E=y.flags[2]&1,x=y.flags[2]&2,N=y.flags[2]&8,q=y.flags[2]&16,X=y.flags[2]&32,te=y.flags[0]&65536,Z=y.flags[0]&131072,ie;return ie=8,E&&(ie+=4,y.baseDataOffset=S.getUint32(12),ie+=4),x&&(y.sampleDescriptionIndex=S.getUint32(ie),ie+=4),N&&(y.defaultSampleDuration=S.getUint32(ie),ie+=4),q&&(y.defaultSampleSize=S.getUint32(ie),ie+=4),X&&(y.defaultSampleFlags=S.getUint32(ie)),te&&(y.durationIsEmpty=!0),!E&&Z&&(y.baseDataOffsetIsMoof=!0),y},gs=br,jo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},vs;typeof window<"u"?vs=window:typeof jo<"u"?vs=jo:typeof self<"u"?vs=self:vs={};var ys=vs,Cd=Ft.discardEmulationPreventionBytes,Ed=nn.CaptionStream,_u=function(m,S){for(var y=m,E=0;E<S.length;E++){var x=S[E];if(y<x.size)return x;y-=x.size}return null},Tu=function(m,S,y){var E=new DataView(m.buffer,m.byteOffset,m.byteLength),x={logs:[],seiNals:[]},N,q,X,te;for(q=0;q+4<m.length;q+=X)if(X=E.getUint32(q),q+=4,!(X<=0))switch(m[q]&31){case 6:var Z=m.subarray(q+1,q+1+X),ie=_u(q,S);if(N={nalUnitType:"sei_rbsp",size:X,data:Z,escapedRBSP:Cd(Z),trackId:y},ie)N.pts=ie.pts,N.dts=ie.dts,te=ie;else if(te)N.pts=te.pts,N.dts=te.dts;else{x.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+q+" for trackId "+y+". See mux.js#223."});break}x.seiNals.push(N);break}return x},ya=function(m,S,y){var E=S,x=y.defaultSampleDuration||0,N=y.defaultSampleSize||0,q=y.trackId,X=[];return m.forEach(function(te){var Z=Mi(te),ie=Z.samples;ie.forEach(function(ge){ge.duration===void 0&&(ge.duration=x),ge.size===void 0&&(ge.size=N),ge.trackId=q,ge.dts=E,ge.compositionTimeOffset===void 0&&(ge.compositionTimeOffset=0),typeof E=="bigint"?(ge.pts=E+ys.BigInt(ge.compositionTimeOffset),E+=ys.BigInt(ge.duration)):(ge.pts=E+ge.compositionTimeOffset,E+=ge.duration)}),X=X.concat(ie)}),X},_s=function(m,S){var y=_t(m,["moof","traf"]),E=_t(m,["mdat"]),x={},N=[];return E.forEach(function(q,X){var te=y[X];N.push({mdat:q,traf:te})}),N.forEach(function(q){var X=q.mdat,te=q.traf,Z=_t(te,["tfhd"]),ie=gs(Z[0]),ge=ie.trackId,Ee=_t(te,["tfdt"]),Pe=Ee.length>0?ps(Ee[0]).baseMediaDecodeTime:0,Se=_t(te,["trun"]),ze,Lt;S===ge&&Se.length>0&&(ze=ya(Se,Pe,ie),Lt=Tu(X,ze,ge),x[ge]||(x[ge]={seiNals:[],logs:[]}),x[ge].seiNals=x[ge].seiNals.concat(Lt.seiNals),x[ge].logs=x[ge].logs.concat(Lt.logs))}),x},_a=function(m,S,y){var E;if(S===null)return null;E=_s(m,S);var x=E[S]||{};return{seiNals:x.seiNals,logs:x.logs,timescale:y}},cn=function(){var m=!1,S,y,E,x,N,q;this.isInitialized=function(){return m},this.init=function(X){S=new Ed,m=!0,q=X?X.isPartial:!1,S.on("data",function(te){te.startTime=te.startPts/x,te.endTime=te.endPts/x,N.captions.push(te),N.captionStreams[te.stream]=!0}),S.on("log",function(te){N.logs.push(te)})},this.isNewInit=function(X,te){return X&&X.length===0||te&&typeof te=="object"&&Object.keys(te).length===0?!1:E!==X[0]||x!==te[E]},this.parse=function(X,te,Z){var ie;if(this.isInitialized()){if(!te||!Z)return null;if(this.isNewInit(te,Z))E=te[0],x=Z[E];else if(E===null||!x)return y.push(X),null}else return null;for(;y.length>0;){var ge=y.shift();this.parse(ge,te,Z)}return ie=_a(X,E,x),ie&&ie.logs&&(N.logs=N.logs.concat(ie.logs)),ie===null||!ie.seiNals?N.logs.length?{logs:N.logs,captions:[],captionStreams:[]}:null:(this.pushNals(ie.seiNals),this.flushStream(),N)},this.pushNals=function(X){if(!this.isInitialized()||!X||X.length===0)return null;X.forEach(function(te){S.push(te)})},this.flushStream=function(){if(!this.isInitialized())return null;q?S.partialFlush():S.flush()},this.clearParsedCaptions=function(){N.captions=[],N.captionStreams={},N.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;S.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){y=[],E=null,x=null,N?this.clearParsedCaptions():N={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},wd=cn,Ts=Bn.toUnsigned,Un=Bn.toHexString,bu=r.getUint64,Su,Cu,Eu,bs,wu,Ta;Su=function(m){var S={},y=_t(m,["moov","trak"]);return y.reduce(function(E,x){var N,q,X,te,Z;return N=_t(x,["tkhd"])[0],!N||(q=N[0],X=q===0?12:20,te=Ts(N[X]<<24|N[X+1]<<16|N[X+2]<<8|N[X+3]),Z=_t(x,["mdia","mdhd"])[0],!Z)?null:(q=Z[0],X=q===0?12:20,E[te]=Ts(Z[X]<<24|Z[X+1]<<16|Z[X+2]<<8|Z[X+3]),E)},S)},Cu=function(m,S){var y;y=_t(S,["moof","traf"]);var E=y.reduce(function(x,N){var q=_t(N,["tfhd"])[0],X=Ts(q[4]<<24|q[5]<<16|q[6]<<8|q[7]),te=m[X]||9e4,Z=_t(N,["tfdt"])[0],ie=new DataView(Z.buffer,Z.byteOffset,Z.byteLength),ge;Z[0]===1?ge=bu(Z.subarray(4,12)):ge=ie.getUint32(4);var Ee;return typeof ge=="bigint"?Ee=ge/ys.BigInt(te):typeof ge=="number"&&!isNaN(ge)&&(Ee=ge/te),Ee<Number.MAX_SAFE_INTEGER&&(Ee=Number(Ee)),Ee<x&&(x=Ee),x},1/0);return typeof E=="bigint"||isFinite(E)?E:0},Eu=function(m,S){var y=_t(S,["moof","traf"]),E=0,x=0,N;if(y&&y.length){var q=_t(y[0],["tfhd"])[0],X=_t(y[0],["trun"])[0],te=_t(y[0],["tfdt"])[0];if(q){var Z=gs(q);N=Z.trackId}if(te){var ie=ps(te);E=ie.baseMediaDecodeTime}if(X){var ge=Mi(X);ge.samples&&ge.samples.length&&(x=ge.samples[0].compositionTimeOffset||0)}}var Ee=m[N]||9e4;typeof E=="bigint"&&(x=ys.BigInt(x),Ee=ys.BigInt(Ee));var Pe=(E+x)/Ee;return typeof Pe=="bigint"&&Pe<Number.MAX_SAFE_INTEGER&&(Pe=Number(Pe)),Pe},bs=function(m){var S=_t(m,["moov","trak"]),y=[];return S.forEach(function(E){var x=_t(E,["mdia","hdlr"]),N=_t(E,["tkhd"]);x.forEach(function(q,X){var te=Or(q.subarray(8,12)),Z=N[X],ie,ge,Ee;te==="vide"&&(ie=new DataView(Z.buffer,Z.byteOffset,Z.byteLength),ge=ie.getUint8(0),Ee=ge===0?ie.getUint32(12):ie.getUint32(20),y.push(Ee))})}),y},Ta=function(m){var S=m[0],y=S===0?12:20;return Ts(m[y]<<24|m[y+1]<<16|m[y+2]<<8|m[y+3])},wu=function(m){var S=_t(m,["moov","trak"]),y=[];return S.forEach(function(E){var x={},N=_t(E,["tkhd"])[0],q,X;N&&(q=new DataView(N.buffer,N.byteOffset,N.byteLength),X=q.getUint8(0),x.id=X===0?q.getUint32(12):q.getUint32(20));var te=_t(E,["mdia","hdlr"])[0];if(te){var Z=Or(te.subarray(8,12));Z==="vide"?x.type="video":Z==="soun"?x.type="audio":x.type=Z}var ie=_t(E,["mdia","minf","stbl","stsd"])[0];if(ie){var ge=ie.subarray(8);x.codec=Or(ge.subarray(4,8));var Ee=_t(ge,[x.codec])[0],Pe,Se;Ee&&(/^[asm]vc[1-9]$/i.test(x.codec)?(Pe=Ee.subarray(78),Se=Or(Pe.subarray(4,8)),Se==="avcC"&&Pe.length>11?(x.codec+=".",x.codec+=Un(Pe[9]),x.codec+=Un(Pe[10]),x.codec+=Un(Pe[11])):x.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(x.codec)?(Pe=Ee.subarray(28),Se=Or(Pe.subarray(4,8)),Se==="esds"&&Pe.length>20&&Pe[19]!==0?(x.codec+="."+Un(Pe[19]),x.codec+="."+Un(Pe[20]>>>2&63).replace(/^0/,"")):x.codec="mp4a.40.2"):x.codec=x.codec.toLowerCase())}var ze=_t(E,["mdia","mdhd"])[0];ze&&(x.timescale=Ta(ze)),y.push(x)}),y};var ku={findBox:_t,parseType:Or,timescale:Su,startTime:Cu,compositionStartTime:Eu,videoTrackIds:bs,tracks:wu,getTimescaleFromMediaHeader:Ta},xu=function(m){var S=m[1]&31;return S<<=8,S|=m[2],S},Ss=function(m){return!!(m[1]&64)},$n=function(m){var S=0;return(m[3]&48)>>>4>1&&(S+=m[4]+1),S},kd=function(m,S){var y=xu(m);return y===0?"pat":y===S?"pmt":S?"pes":null},xd=function(m){var S=Ss(m),y=4+$n(m);return S&&(y+=m[y]+1),(m[y+10]&31)<<8|m[y+11]},Ad=function(m){var S={},y=Ss(m),E=4+$n(m);if(y&&(E+=m[E]+1),!!(m[E+5]&1)){var x,N,q;x=(m[E+1]&15)<<8|m[E+2],N=3+x-4,q=(m[E+10]&15)<<8|m[E+11];for(var X=12+q;X<N;){var te=E+X;S[(m[te+1]&31)<<8|m[te+2]]=m[te],X+=((m[te+3]&15)<<8|m[te+4])+5}return S}},Vo=function(m,S){var y=xu(m),E=S[y];switch(E){case $t.H264_STREAM_TYPE:return"video";case $t.ADTS_STREAM_TYPE:return"audio";case $t.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Id=function(m){var S=Ss(m);if(!S)return null;var y=4+$n(m);if(y>=m.byteLength)return null;var E=null,x;return x=m[y+7],x&192&&(E={},E.pts=(m[y+9]&14)<<27|(m[y+10]&255)<<20|(m[y+11]&254)<<12|(m[y+12]&255)<<5|(m[y+13]&254)>>>3,E.pts*=4,E.pts+=(m[y+13]&6)>>>1,E.dts=E.pts,x&64&&(E.dts=(m[y+14]&14)<<27|(m[y+15]&255)<<20|(m[y+16]&254)<<12|(m[y+17]&255)<<5|(m[y+18]&254)>>>3,E.dts*=4,E.dts+=(m[y+18]&6)>>>1)),E},ba=function(m){switch(m){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}},Pd=function(m){for(var S=4+$n(m),y=m.subarray(S),E=0,x=0,N=!1,q;x<y.byteLength-3;x++)if(y[x+2]===1){E=x+5;break}for(;E<y.byteLength;)switch(y[E]){case 0:if(y[E-1]!==0){E+=2;break}else if(y[E-2]!==0){E++;break}x+3!==E-2&&(q=ba(y[x+3]&31),q==="slice_layer_without_partitioning_rbsp_idr"&&(N=!0));do E++;while(y[E]!==1&&E<y.length);x=E-2,E+=3;break;case 1:if(y[E-1]!==0||y[E-2]!==0){E+=3;break}q=ba(y[x+3]&31),q==="slice_layer_without_partitioning_rbsp_idr"&&(N=!0),x=E-2,E+=3;break;default:E+=3;break}return y=y.subarray(x),E-=x,x=0,y&&y.byteLength>3&&(q=ba(y[x+3]&31),q==="slice_layer_without_partitioning_rbsp_idr"&&(N=!0)),N},Dd={parseType:kd,parsePat:xd,parsePmt:Ad,parsePayloadUnitStartIndicator:Ss,parsePesType:Vo,parsePesTime:Id,videoPacketContainsKeyFrame:Pd},hn=ou.handleRollover,ot={};ot.ts=Dd,ot.aac=hs;var Mr=tt.ONE_SECOND_IN_TS,Jt=188,zi=71,Nd=function(m,S){for(var y=0,E=Jt,x,N;E<m.byteLength;){if(m[y]===zi&&m[E]===zi){switch(x=m.subarray(y,E),N=ot.ts.parseType(x,S.pid),N){case"pat":S.pid=ot.ts.parsePat(x);break;case"pmt":var q=ot.ts.parsePmt(x);S.table=S.table||{},Object.keys(q).forEach(function(X){S.table[X]=q[X]});break}y+=Jt,E+=Jt;continue}y++,E++}},Au=function(m,S,y){for(var E=0,x=Jt,N,q,X,te,Z,ie=!1;x<=m.byteLength;){if(m[E]===zi&&(m[x]===zi||x===m.byteLength)){switch(N=m.subarray(E,x),q=ot.ts.parseType(N,S.pid),q){case"pes":X=ot.ts.parsePesType(N,S.table),te=ot.ts.parsePayloadUnitStartIndicator(N),X==="audio"&&te&&(Z=ot.ts.parsePesTime(N),Z&&(Z.type="audio",y.audio.push(Z),ie=!0));break}if(ie)break;E+=Jt,x+=Jt;continue}E++,x++}for(x=m.byteLength,E=x-Jt,ie=!1;E>=0;){if(m[E]===zi&&(m[x]===zi||x===m.byteLength)){switch(N=m.subarray(E,x),q=ot.ts.parseType(N,S.pid),q){case"pes":X=ot.ts.parsePesType(N,S.table),te=ot.ts.parsePayloadUnitStartIndicator(N),X==="audio"&&te&&(Z=ot.ts.parsePesTime(N),Z&&(Z.type="audio",y.audio.push(Z),ie=!0));break}if(ie)break;E-=Jt,x-=Jt;continue}E--,x--}},Sa=function(m,S,y){for(var E=0,x=Jt,N,q,X,te,Z,ie,ge,Ee,Pe=!1,Se={data:[],size:0};x<m.byteLength;){if(m[E]===zi&&m[x]===zi){switch(N=m.subarray(E,x),q=ot.ts.parseType(N,S.pid),q){case"pes":if(X=ot.ts.parsePesType(N,S.table),te=ot.ts.parsePayloadUnitStartIndicator(N),X==="video"&&(te&&!Pe&&(Z=ot.ts.parsePesTime(N),Z&&(Z.type="video",y.video.push(Z),Pe=!0)),!y.firstKeyFrame)){if(te&&Se.size!==0){for(ie=new Uint8Array(Se.size),ge=0;Se.data.length;)Ee=Se.data.shift(),ie.set(Ee,ge),ge+=Ee.byteLength;if(ot.ts.videoPacketContainsKeyFrame(ie)){var ze=ot.ts.parsePesTime(ie);ze?(y.firstKeyFrame=ze,y.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.")}Se.size=0}Se.data.push(N),Se.size+=N.byteLength}break}if(Pe&&y.firstKeyFrame)break;E+=Jt,x+=Jt;continue}E++,x++}for(x=m.byteLength,E=x-Jt,Pe=!1;E>=0;){if(m[E]===zi&&m[x]===zi){switch(N=m.subarray(E,x),q=ot.ts.parseType(N,S.pid),q){case"pes":X=ot.ts.parsePesType(N,S.table),te=ot.ts.parsePayloadUnitStartIndicator(N),X==="video"&&te&&(Z=ot.ts.parsePesTime(N),Z&&(Z.type="video",y.video.push(Z),Pe=!0));break}if(Pe)break;E-=Jt,x-=Jt;continue}E--,x--}},Ld=function(m,S){if(m.audio&&m.audio.length){var y=S;(typeof y>"u"||isNaN(y))&&(y=m.audio[0].dts),m.audio.forEach(function(N){N.dts=hn(N.dts,y),N.pts=hn(N.pts,y),N.dtsTime=N.dts/Mr,N.ptsTime=N.pts/Mr})}if(m.video&&m.video.length){var E=S;if((typeof E>"u"||isNaN(E))&&(E=m.video[0].dts),m.video.forEach(function(N){N.dts=hn(N.dts,E),N.pts=hn(N.pts,E),N.dtsTime=N.dts/Mr,N.ptsTime=N.pts/Mr}),m.firstKeyFrame){var x=m.firstKeyFrame;x.dts=hn(x.dts,E),x.pts=hn(x.pts,E),x.dtsTime=x.dts/Mr,x.ptsTime=x.pts/Mr}}},Od=function(m){for(var S=!1,y=0,E=null,x=null,N=0,q=0,X;m.length-q>=3;){var te=ot.aac.parseType(m,q);switch(te){case"timed-metadata":if(m.length-q<10){S=!0;break}if(N=ot.aac.parseId3TagSize(m,q),N>m.length){S=!0;break}x===null&&(X=m.subarray(q,q+N),x=ot.aac.parseAacTimestamp(X)),q+=N;break;case"audio":if(m.length-q<7){S=!0;break}if(N=ot.aac.parseAdtsSize(m,q),N>m.length){S=!0;break}E===null&&(X=m.subarray(q,q+N),E=ot.aac.parseSampleRate(X)),y++,q+=N;break;default:q++;break}if(S)return null}if(E===null||x===null)return null;var Z=Mr/E,ie={audio:[{type:"audio",dts:x,pts:x},{type:"audio",dts:x+y*1024*Z,pts:x+y*1024*Z}]};return ie},Md=function(m){var S={pid:null,table:null},y={};Nd(m,S);for(var E in S.table)if(S.table.hasOwnProperty(E)){var x=S.table[E];switch(x){case $t.H264_STREAM_TYPE:y.video=[],Sa(m,S,y),y.video.length===0&&delete y.video;break;case $t.ADTS_STREAM_TYPE:y.audio=[],Au(m,S,y),y.audio.length===0&&delete y.audio;break}}return y},Rd=function(m,S){var y=ot.aac.isLikelyAacData(m),E;return y?E=Od(m):E=Md(m),!E||!E.audio&&!E.video?null:(Ld(E,S),E)},Iu={inspect:Rd,parseAudioPes_:Au},Bd=function(m,S){S.on("data",function(y){var E=y.initSegment;y.initSegment={data:E.buffer,byteOffset:E.byteOffset,byteLength:E.byteLength};var x=y.data;y.data=x.buffer,m.postMessage({action:"data",segment:y,byteOffset:x.byteOffset,byteLength:x.byteLength},[y.data])}),S.on("done",function(y){m.postMessage({action:"done"})}),S.on("gopInfo",function(y){m.postMessage({action:"gopInfo",gopInfo:y})}),S.on("videoSegmentTimingInfo",function(y){var E={start:{decode:tt.videoTsToSeconds(y.start.dts),presentation:tt.videoTsToSeconds(y.start.pts)},end:{decode:tt.videoTsToSeconds(y.end.dts),presentation:tt.videoTsToSeconds(y.end.pts)},baseMediaDecodeTime:tt.videoTsToSeconds(y.baseMediaDecodeTime)};y.prependedContentDuration&&(E.prependedContentDuration=tt.videoTsToSeconds(y.prependedContentDuration)),m.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:E})}),S.on("audioSegmentTimingInfo",function(y){var E={start:{decode:tt.videoTsToSeconds(y.start.dts),presentation:tt.videoTsToSeconds(y.start.pts)},end:{decode:tt.videoTsToSeconds(y.end.dts),presentation:tt.videoTsToSeconds(y.end.pts)},baseMediaDecodeTime:tt.videoTsToSeconds(y.baseMediaDecodeTime)};y.prependedContentDuration&&(E.prependedContentDuration=tt.videoTsToSeconds(y.prependedContentDuration)),m.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:E})}),S.on("id3Frame",function(y){m.postMessage({action:"id3Frame",id3Frame:y})}),S.on("caption",function(y){m.postMessage({action:"caption",caption:y})}),S.on("trackinfo",function(y){m.postMessage({action:"trackinfo",trackInfo:y})}),S.on("audioTimingInfo",function(y){m.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:tt.videoTsToSeconds(y.start),end:tt.videoTsToSeconds(y.end)}})}),S.on("videoTimingInfo",function(y){m.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:tt.videoTsToSeconds(y.start),end:tt.videoTsToSeconds(y.end)}})}),S.on("log",function(y){m.postMessage({action:"log",log:y})})},jn=(function(){function $(S,y){this.options=y||{},this.self=S,this.init()}var m=$.prototype;return m.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new md.Transmuxer(this.options),Bd(this.self,this.transmuxer)},m.pushMp4Captions=function(y){this.captionParser||(this.captionParser=new wd,this.captionParser.init());var E=new Uint8Array(y.data,y.byteOffset,y.byteLength),x=this.captionParser.parse(E,y.trackIds,y.timescales);this.self.postMessage({action:"mp4Captions",captions:x&&x.captions||[],logs:x&&x.logs||[],data:E.buffer},[E.buffer])},m.probeMp4StartTime=function(y){var E=y.timescales,x=y.data,N=ku.startTime(E,x);this.self.postMessage({action:"probeMp4StartTime",startTime:N,data:x},[x.buffer])},m.probeMp4Tracks=function(y){var E=y.data,x=ku.tracks(E);this.self.postMessage({action:"probeMp4Tracks",tracks:x,data:E},[E.buffer])},m.probeTs=function(y){var E=y.data,x=y.baseStartTime,N=typeof x=="number"&&!isNaN(x)?x*tt.ONE_SECOND_IN_TS:void 0,q=Iu.inspect(E,N),X=null;q&&(X={hasVideo:q.video&&q.video.length===2||!1,hasAudio:q.audio&&q.audio.length===2||!1},X.hasVideo&&(X.videoStart=q.video[0].ptsTime),X.hasAudio&&(X.audioStart=q.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:X,data:E},[E.buffer])},m.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},m.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},m.push=function(y){var E=new Uint8Array(y.data,y.byteOffset,y.byteLength);this.transmuxer.push(E)},m.reset=function(){this.transmuxer.reset()},m.setTimestampOffset=function(y){var E=y.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(tt.secondsToVideoTs(E)))},m.setAudioAppendStart=function(y){this.transmuxer.setAudioAppendStart(Math.ceil(tt.secondsToVideoTs(y.appendStart)))},m.setRemux=function(y){this.transmuxer.setRemux(y.remux)},m.flush=function(y){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},m.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},m.alignGopsWith=function(y){this.transmuxer.alignGopsWith(y.gopsToAlignWith.slice())},$})();self.onmessage=function($){if($.data.action==="init"&&$.data.options){this.messageHandlers=new jn(self,$.data.options);return}this.messageHandlers||(this.messageHandlers=new jn(self)),$.data&&$.data.action&&$.data.action!=="init"&&this.messageHandlers[$.data.action]&&this.messageHandlers[$.data.action]($.data)}})),l4=CE(o4),u4=function(e,t,i){var r=e.data.segment,n=r.type,a=r.initSegment,o=r.captions,l=r.captionStreams,u=r.metadata,c=r.videoFrameDtsTime,h=r.videoFramePtsTime;t.buffer.push({captions:o,captionStreams:l,metadata:u});var f=e.data.segment.boxes||{data:e.data.segment.data},g={type:n,data:new Uint8Array(f.data,f.data.byteOffset,f.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};typeof c<"u"&&(g.videoFrameDtsTime=c),typeof h<"u"&&(g.videoFramePtsTime=h),i(g)},c4=function(e){var t=e.transmuxedData,i=e.callback;t.buffer=[],i(t)},h4=function(e,t){t.gopInfo=e.data.gopInfo},kE=function(e){var t=e.transmuxer,i=e.bytes,r=e.audioAppendStart,n=e.gopsToAlignWith,a=e.remux,o=e.onData,l=e.onTrackInfo,u=e.onAudioTimingInfo,c=e.onVideoTimingInfo,h=e.onVideoSegmentTimingInfo,f=e.onAudioSegmentTimingInfo,g=e.onId3,C=e.onCaptions,p=e.onDone,b=e.onEndedTimeline,I=e.onTransmuxerLog,L=e.isEndOfTimeline,F={buffer:[]},V=L,B=function(w){t.currentTransmux===e&&(w.data.action==="data"&&u4(w,F,o),w.data.action==="trackinfo"&&l(w.data.trackInfo),w.data.action==="gopInfo"&&h4(w,F),w.data.action==="audioTimingInfo"&&u(w.data.audioTimingInfo),w.data.action==="videoTimingInfo"&&c(w.data.videoTimingInfo),w.data.action==="videoSegmentTimingInfo"&&h(w.data.videoSegmentTimingInfo),w.data.action==="audioSegmentTimingInfo"&&f(w.data.audioSegmentTimingInfo),w.data.action==="id3Frame"&&g([w.data.id3Frame],w.data.id3Frame.dispatchType),w.data.action==="caption"&&C(w.data.caption),w.data.action==="endedtimeline"&&(V=!1,b()),w.data.action==="log"&&I(w.data.log),w.data.type==="transmuxed"&&(V||(t.onmessage=null,c4({transmuxedData:F,callback:p}),xE(t))))};if(t.onmessage=B,r&&t.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(n)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:n}),typeof a<"u"&&t.postMessage({action:"setRemux",remux:a}),i.byteLength){var O=i instanceof ArrayBuffer?i:i.buffer,M=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:O,byteOffset:M,byteLength:i.byteLength},[O])}L&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},xE=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),typeof e.currentTransmux=="function"?e.currentTransmux():kE(e.currentTransmux))},aT=function(e,t){e.postMessage({action:t}),xE(e)},AE=function(e,t){if(!t.currentTransmux){t.currentTransmux=e,aT(t,e);return}t.transmuxQueue.push(aT.bind(null,t,e))},d4=function(e){AE("reset",e)},f4=function(e){AE("endTimeline",e)},IE=function(e){if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e,kE(e);return}e.transmuxer.transmuxQueue.push(e)},p4=function(e){var t=new l4;t.currentTransmux=null,t.transmuxQueue=[];var i=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)},t.postMessage({action:"init",options:e}),t},Gf={reset:d4,endTimeline:f4,transmux:IE,createTransmuxer:p4},ah=function(e){var t=e.transmuxer,i=e.endAction||e.action,r=e.callback,n=mt({},e,{endAction:null,transmuxer:null,callback:null}),a=function u(c){c.data.action===i&&(t.removeEventListener("message",u),c.data.data&&(c.data.data=new Uint8Array(c.data.data,e.byteOffset||0,e.byteLength||c.data.data.byteLength),e.data&&(e.data=c.data.data)),r(c.data))};if(t.addEventListener("message",a),e.data){var o=e.data instanceof ArrayBuffer;n.byteOffset=o?0:e.data.byteOffset,n.byteLength=e.data.byteLength;var l=[o?e.data:e.data.buffer];t.postMessage(n,l)}else t.postMessage(n)},Kr={FAILURE:2,TIMEOUT:-101,ABORTED:-102},hm=function(e){e.forEach(function(t){t.abort()})},m4=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}},g4=function(e){var t=e.target,i=Date.now()-t.requestTime,r={bandwidth:1/0,bytesReceived:0,roundTripTime:i||0};return r.bytesReceived=e.loaded,r.bandwidth=Math.floor(r.bytesReceived/r.roundTripTime*8*1e3),r},Zg=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Kr.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Kr.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Kr.FAILURE,xhr:t}:t.responseType==="arraybuffer"&&t.response.byteLength===0?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:Kr.FAILURE,xhr:t}:null},oT=function(e,t,i){return function(r,n){var a=n.response,o=Zg(r,n);if(o)return i(o,e);if(a.byteLength!==16)return i({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Kr.FAILURE,xhr:n},e);for(var l=new DataView(a),u=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]),c=0;c<t.length;c++)t[c].bytes=u;return i(null,e)}},PE=function(e,t){var i=yg(e.map.bytes);if(i!=="mp4"){var r=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:"Found unsupported "+(i||"unknown")+" container for initialization segment at URL: "+r,code:Kr.FAILURE})}ah({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:function(a){var o=a.tracks,l=a.data;return e.map.bytes=l,o.forEach(function(u){e.map.tracks=e.map.tracks||{},!e.map.tracks[u.type]&&(e.map.tracks[u.type]=u,typeof u.id=="number"&&u.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[u.id]=u.timescale))}),t(null)}})},v4=function(e){var t=e.segment,i=e.finishProcessingFn;return function(r,n){var a=Zg(r,n);if(a)return i(a,t);var o=new Uint8Array(n.response);if(t.map.key)return t.map.encryptedBytes=o,i(null,t);t.map.bytes=o,PE(t,function(l){if(l)return l.xhr=n,l.status=n.status,i(l,t);i(null,t)})}},y4=function(e){var t=e.segment,i=e.finishProcessingFn,r=e.responseType;return function(n,a){var o=Zg(n,a);if(o)return i(o,t);var l=r==="arraybuffer"||!a.responseText?a.response:s4(a.responseText.substring(t.lastReachedChar||0));return t.stats=m4(a),t.key?t.encryptedBytes=new Uint8Array(l):t.bytes=new Uint8Array(l),i(null,t)}},_4=function(e){var t=e.segment,i=e.bytes,r=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,h=e.endedTimelineFn,f=e.dataFn,g=e.doneFn,C=e.onTransmuxerLog,p=t.map&&t.map.tracks||{},b=!!(p.audio&&p.video),I=n.bind(null,t,"audio","start"),L=n.bind(null,t,"audio","end"),F=n.bind(null,t,"video","start"),V=n.bind(null,t,"video","end"),B=function(){return IE({bytes:i,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:b,onData:function(U){U.type=U.type==="combined"?"video":U.type,f(t,U)},onTrackInfo:function(U){r&&(b&&(U.isMuxed=!0),r(t,U))},onAudioTimingInfo:function(U){I&&typeof U.start<"u"&&(I(U.start),I=null),L&&typeof U.end<"u"&&L(U.end)},onVideoTimingInfo:function(U){F&&typeof U.start<"u"&&(F(U.start),F=null),V&&typeof U.end<"u"&&V(U.end)},onVideoSegmentTimingInfo:function(U){a(U)},onAudioSegmentTimingInfo:function(U){o(U)},onId3:function(U,w){l(t,U,w)},onCaptions:function(U){u(t,[U])},isEndOfTimeline:c,onEndedTimeline:function(){h()},onTransmuxerLog:C,onDone:function(U){g&&(U.type=U.type==="combined"?"video":U.type,g(null,t,U))}})};ah({action:"probeTs",transmuxer:t.transmuxer,data:i,baseStartTime:t.baseStartTime,callback:function(M){t.bytes=i=M.data;var U=M.result;U&&(r(t,{hasAudio:U.hasAudio,hasVideo:U.hasVideo,isMuxed:b}),r=null,U.hasAudio&&!b&&I(U.audioStart),U.hasVideo&&F(U.videoStart),I=null,F=null),B()}})},DE=function(e){var t=e.segment,i=e.bytes,r=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,h=e.endedTimelineFn,f=e.dataFn,g=e.doneFn,C=e.onTransmuxerLog,p=new Uint8Array(i);if(BO(p)){t.isFmp4=!0;var b=t.map.tracks,I={isFmp4:!0,hasVideo:!!b.video,hasAudio:!!b.audio};b.audio&&b.audio.codec&&b.audio.codec!=="enca"&&(I.audioCodec=b.audio.codec),b.video&&b.video.codec&&b.video.codec!=="encv"&&(I.videoCodec=b.video.codec),b.video&&b.audio&&(I.isMuxed=!0),r(t,I);var L=function(V){f(t,{data:p,type:I.hasAudio&&!I.isMuxed?"audio":"video"}),V&&V.length&&u(t,V),g(null,t,{})};ah({action:"probeMp4StartTime",timescales:t.map.timescales,data:p,transmuxer:t.transmuxer,callback:function(V){var B=V.data,O=V.startTime;if(i=B.buffer,t.bytes=p=B,I.hasAudio&&!I.isMuxed&&n(t,"audio","start",O),I.hasVideo&&n(t,"video","start",O),!b.video||!B.byteLength||!t.transmuxer){L();return}ah({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:p,timescales:t.map.timescales,trackIds:[b.video.id],callback:function(U){i=U.data.buffer,t.bytes=p=U.data,U.logs.forEach(function(w){C(re.mergeOptions(w,{stream:"mp4CaptionParser"}))}),L(U.captions)}})}});return}if(!t.transmuxer){g(null,t,{});return}if(typeof t.container>"u"&&(t.container=yg(p)),t.container!=="ts"&&t.container!=="aac"){r(t,{hasAudio:!1,hasVideo:!1}),g(null,t,{});return}_4({segment:t,bytes:i,trackInfoFn:r,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:h,dataFn:f,doneFn:g,onTransmuxerLog:C})},NE=function(e,t){var i=e.id,r=e.key,n=e.encryptedBytes,a=e.decryptionWorker,o=function u(c){if(c.data.source===i){a.removeEventListener("message",u);var h=c.data.decrypted;t(new Uint8Array(h.bytes,h.byteOffset,h.byteLength))}};a.addEventListener("message",o);var l;r.bytes.slice?l=r.bytes.slice():l=new Uint32Array(Array.prototype.slice.call(r.bytes)),a.postMessage(vE({source:i,encrypted:n,key:l,iv:r.iv}),[n.buffer,l.buffer])},T4=function(e){var t=e.decryptionWorker,i=e.segment,r=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,h=e.endedTimelineFn,f=e.dataFn,g=e.doneFn,C=e.onTransmuxerLog;NE({id:i.requestId,key:i.key,encryptedBytes:i.encryptedBytes,decryptionWorker:t},function(p){i.bytes=p,DE({segment:i,bytes:i.bytes,trackInfoFn:r,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:h,dataFn:f,doneFn:g,onTransmuxerLog:C})})},b4=function(e){var t=e.activeXhrs,i=e.decryptionWorker,r=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,h=e.endedTimelineFn,f=e.dataFn,g=e.doneFn,C=e.onTransmuxerLog,p=0,b=!1;return function(I,L){if(!b){if(I)return b=!0,hm(t),g(I,L);if(p+=1,p===t.length){var F=function(){if(L.encryptedBytes)return T4({decryptionWorker:i,segment:L,trackInfoFn:r,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:h,dataFn:f,doneFn:g,onTransmuxerLog:C});DE({segment:L,bytes:L.bytes,trackInfoFn:r,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:h,dataFn:f,doneFn:g,onTransmuxerLog:C})};if(L.endOfAllRequests=Date.now(),L.map&&L.map.encryptedBytes&&!L.map.bytes)return NE({decryptionWorker:i,id:L.requestId+"-init",encryptedBytes:L.map.encryptedBytes,key:L.map.key},function(V){L.map.bytes=V,PE(L,function(B){if(B)return hm(t),g(B,L);F()})});F()}}}},S4=function(e){var t=e.loadendState,i=e.abortFn;return function(r){var n=r.target;n.aborted&&i&&!t.calledAbortFn&&(i(),t.calledAbortFn=!0)}},C4=function(e){var t=e.segment,i=e.progressFn;return function(r){var n=r.target;if(!n.aborted)return t.stats=re.mergeOptions(t.stats,g4(r)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),i(r,t)}},E4=function(e){var t=e.xhr,i=e.xhrOptions,r=e.decryptionWorker,n=e.segment,a=e.abortFn,o=e.progressFn,l=e.trackInfoFn,u=e.timingInfoFn,c=e.videoSegmentTimingInfoFn,h=e.audioSegmentTimingInfoFn,f=e.id3Fn,g=e.captionsFn,C=e.isEndOfTimeline,p=e.endedTimelineFn,b=e.dataFn,I=e.doneFn,L=e.onTransmuxerLog,F=[],V=b4({activeXhrs:F,decryptionWorker:r,trackInfoFn:l,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:h,id3Fn:f,captionsFn:g,isEndOfTimeline:C,endedTimelineFn:p,dataFn:b,doneFn:I,onTransmuxerLog:L});if(n.key&&!n.key.bytes){var B=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&B.push(n.map.key);var O=re.mergeOptions(i,{uri:n.key.resolvedUri,responseType:"arraybuffer"}),M=oT(n,B,V),U=t(O,M);F.push(U)}if(n.map&&!n.map.bytes){var w=n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri);if(w){var P=re.mergeOptions(i,{uri:n.map.key.resolvedUri,responseType:"arraybuffer"}),Q=oT(n,[n.map.key],V),G=t(P,Q);F.push(G)}var K=re.mergeOptions(i,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:um(n.map)}),ce=v4({segment:n,finishProcessingFn:V}),de=t(K,ce);F.push(de)}var pe=re.mergeOptions(i,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:um(n)}),ne=y4({segment:n,finishProcessingFn:V,responseType:pe.responseType}),se=t(pe,ne);se.addEventListener("progress",C4({segment:n,progressFn:o})),F.push(se);var ue={};return F.forEach(function(he){he.addEventListener("loadend",S4({loadendState:ue,abortFn:a}))}),function(){return hm(F)}},w4=Pr("CodecUtils"),k4=function(e){var t=e.attributes||{};if(t.CODECS)return Ur(t.CODECS)},LE=function(e,t){var i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},x4=function(e,t){if(!LE(e,t))return!0;var i=t.attributes||{},r=e.mediaGroups.AUDIO[i.AUDIO];for(var n in r)if(!r[n].uri&&!r[n].playlists)return!0;return!1},oh=function(e){var t={};return e.forEach(function(i){var r=i.mediaType,n=i.type,a=i.details;t[r]=t[r]||[],t[r].push(N1(""+n+a))}),Object.keys(t).forEach(function(i){if(t[i].length>1){w4("multiple "+i+" codecs found as attributes: "+t[i].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),t[i]=null;return}t[i]=t[i][0]}),t},lT=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},Il=function(e,t){var i=t.attributes||{},r=oh(k4(t)||[]);if(LE(e,t)&&!r.audio&&!x4(e,t)){var n=oh(gL(e,i.AUDIO)||[]);n.audio&&(r.audio=n.audio)}return r},tc=Pr("PlaylistSelector"),uT=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||""})}},lh=function(e,t){if(!e)return"";var i=D.getComputedStyle(e);return i?i[t]:""},Ja=function(e,t){var i=e.slice();e.sort(function(r,n){var a=t(r,n);return a===0?i.indexOf(r)-i.indexOf(n):a})},ev=function(e,t){var i,r;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||D.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),r=r||D.Number.MAX_VALUE,i-r},A4=function(e,t){var i,r;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||D.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),r=r||D.Number.MAX_VALUE,i===r&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-r},OE=function(e,t,i,r,n,a){if(e){var o={bandwidth:t,width:i,height:r,limitRenditionByPlayerDimensions:n},l=e.playlists;ji.isAudioOnly(e)&&(l=a.getAudioTrackPlaylists_(),o.audioOnly=!0);var u=l.map(function(P){var Q,G=P.attributes&&P.attributes.RESOLUTION&&P.attributes.RESOLUTION.width,K=P.attributes&&P.attributes.RESOLUTION&&P.attributes.RESOLUTION.height;return Q=P.attributes&&P.attributes.BANDWIDTH,Q=Q||D.Number.MAX_VALUE,{bandwidth:Q,width:G,height:K,playlist:P}});Ja(u,function(P,Q){return P.bandwidth-Q.bandwidth}),u=u.filter(function(P){return!ji.isIncompatible(P.playlist)});var c=u.filter(function(P){return ji.isEnabled(P.playlist)});c.length||(c=u.filter(function(P){return!ji.isDisabled(P.playlist)}));var h=c.filter(function(P){return P.bandwidth*ti.BANDWIDTH_VARIANCE<t}),f=h[h.length-1],g=h.filter(function(P){return P.bandwidth===f.bandwidth})[0];if(n===!1){var C=g||c[0]||u[0];if(C&&C.playlist){var p="sortedPlaylistReps";return g&&(p="bandwidthBestRep"),c[0]&&(p="enabledPlaylistReps"),tc("choosing "+uT(C)+" using "+p+" with options",o),C.playlist}return tc("could not choose a playlist with options",o),null}var b=h.filter(function(P){return P.width&&P.height});Ja(b,function(P,Q){return P.width-Q.width});var I=b.filter(function(P){return P.width===i&&P.height===r});f=I[I.length-1];var L=I.filter(function(P){return P.bandwidth===f.bandwidth})[0],F,V,B;L||(F=b.filter(function(P){return P.width>i||P.height>r}),V=F.filter(function(P){return P.width===F[0].width&&P.height===F[0].height}),f=V[V.length-1],B=V.filter(function(P){return P.bandwidth===f.bandwidth})[0]);var O;if(a.experimentalLeastPixelDiffSelector){var M=b.map(function(P){return P.pixelDiff=Math.abs(P.width-i)+Math.abs(P.height-r),P});Ja(M,function(P,Q){return P.pixelDiff===Q.pixelDiff?Q.bandwidth-P.bandwidth:P.pixelDiff-Q.pixelDiff}),O=M[0]}var U=O||B||L||g||c[0]||u[0];if(U&&U.playlist){var w="sortedPlaylistReps";return O?w="leastPixelDiffRep":B?w="resolutionPlusOneRep":L?w="resolutionBestRep":g?w="bandwidthBestRep":c[0]&&(w="enabledPlaylistReps"),tc("choosing "+uT(U)+" using "+w+" with options",o),U.playlist}return tc("could not choose a playlist with options",o),null}},cT=function(){var e=this.useDevicePixelRatio&&D.devicePixelRatio||1;return OE(this.playlists.master,this.systemBandwidth,parseInt(lh(this.tech_.el(),"width"),10)*e,parseInt(lh(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},I4=function(e){var t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var r=this.useDevicePixelRatio&&D.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),OE(this.playlists.master,t,parseInt(lh(this.tech_.el(),"width"),10)*r,parseInt(lh(this.tech_.el(),"height"),10)*r,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},P4=function(e){var t=e.master,i=e.currentTime,r=e.bandwidth,n=e.duration,a=e.segmentDuration,o=e.timeUntilRebuffer,l=e.currentTimeline,u=e.syncController,c=t.playlists.filter(function(p){return!ji.isIncompatible(p)}),h=c.filter(ji.isEnabled);h.length||(h=c.filter(function(p){return!ji.isDisabled(p)}));var f=h.filter(ji.hasAttribute.bind(null,"BANDWIDTH")),g=f.map(function(p){var b=u.getSyncPoint(p,n,l,i),I=b?1:2,L=ji.estimateSegmentRequestTime(a,r,p),F=L*I-o;return{playlist:p,rebufferingImpact:F}}),C=g.filter(function(p){return p.rebufferingImpact<=0});return Ja(C,function(p,b){return ev(b.playlist,p.playlist)}),C.length?C[0]:(Ja(g,function(p,b){return p.rebufferingImpact-b.rebufferingImpact}),g[0]||null)},D4=function(){var e=this,t=this.playlists.master.playlists.filter(ji.isEnabled);Ja(t,function(r,n){return ev(r,n)});var i=t.filter(function(r){return!!Il(e.playlists.master,r).video});return i[0]||null},N4=function(e){var t=0,i;return e.bytes&&(i=new Uint8Array(e.bytes),e.segments.forEach(function(r){i.set(r,t),t+=r.byteLength})),i},L4=function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var r=i;/^cc708_/.test(i)&&(r="SERVICE"+i.split("_")[1]);var n=t.textTracks().getTrackById(r);if(n)e[i]=n;else{var a=t.options_.vhs&&t.options_.vhs.captionServices||{},o=i,l=i,u=!1,c=a[r];c&&(o=c.label,l=c.language,u=c.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:r,default:u,label:o,language:l},!1).track}}},O4=function(e){var t=e.inbandTextTracks,i=e.captionArray,r=e.timestampOffset;if(i){var n=D.WebKitDataCue||D.VTTCue;i.forEach(function(a){var o=a.stream;t[o].addCue(new n(a.startTime+r,a.endTime+r,a.text))})}},M4=function(e){Object.defineProperties(e.frame,{id:{get:function(){return re.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return re.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return re.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},R4=function(e){var t=e.inbandTextTracks,i=e.metadataArray,r=e.timestampOffset,n=e.videoDuration;if(i){var a=D.WebKitDataCue||D.VTTCue,o=t.metadataTrack_;if(o&&(i.forEach(function(g){var C=g.cueTime+r;typeof C!="number"||D.isNaN(C)||C<0||!(C<1/0)||g.frames.forEach(function(p){var b=new a(C,C,p.value||p.url||p.data||"");b.frame=p,b.value=p,M4(b),o.addCue(b)})}),!(!o.cues||!o.cues.length))){for(var l=o.cues,u=[],c=0;c<l.length;c++)l[c]&&u.push(l[c]);var h=u.reduce(function(g,C){var p=g[C.startTime]||[];return p.push(C),g[C.startTime]=p,g},{}),f=Object.keys(h).sort(function(g,C){return Number(g)-Number(C)});f.forEach(function(g,C){var p=h[g],b=Number(f[C+1])||n;p.forEach(function(I){I.endTime=b})})}}},B4=function(e,t,i){e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)},vl=function(e,t,i){var r,n;if(i&&i.cues)for(r=i.cues.length;r--;)n=i.cues[r],n.startTime>=e&&n.endTime<=t&&i.removeCue(n)},F4=function(e){var t=e.cues;if(t)for(var i=0;i<t.length;i++){for(var r=[],n=0,a=0;a<t.length;a++)t[i].startTime===t[a].startTime&&t[i].endTime===t[a].endTime&&t[i].text===t[a].text&&(n++,n>1&&r.push(t[a]));r.length&&r.forEach(function(o){return e.removeCue(o)})}},U4=function(e,t,i){if(typeof t>"u"||t===null||!e.length)return[];var r=Math.ceil((t-i+3)*Gc.ONE_SECOND_IN_TS),n;for(n=0;n<e.length&&!(e[n].pts>r);n++);return e.slice(n)},$4=function(e,t,i){if(!t.length)return e;if(i)return t.slice();var r=t[0].pts,n=0;for(n;n<e.length&&!(e[n].pts>=r);n++);return e.slice(0,n).concat(t)},j4=function(e,t,i,r){for(var n=Math.ceil((t-r)*Gc.ONE_SECOND_IN_TS),a=Math.ceil((i-r)*Gc.ONE_SECOND_IN_TS),o=e.slice(),l=e.length;l--&&!(e[l].pts<=a););if(l===-1)return o;for(var u=l+1;u--&&!(e[u].pts<=n););return u=Math.max(u,0),o.splice(u,l-u+1),o},V4=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;var i=Object.keys(e).sort(),r=Object.keys(t).sort();if(i.length!==r.length)return!1;for(var n=0;n<i.length;n++){var a=i[n];if(a!==r[n]||e[a]!==t[a])return!1}return!0},ME=22,H4=function(e,t,i){t=t||[];for(var r=[],n=0,a=0;a<t.length;a++){var o=t[a];if(e===o.timeline&&(r.push(a),n+=o.duration,n>i))return a}return r.length===0?0:r[r.length-1]},al=1,q4=500,hT=function(e){return typeof e=="number"&&isFinite(e)},ic=1/60,z4=function(e,t,i){return e!=="main"||!t||!i?null:!i.hasAudio&&!i.hasVideo?"Neither audio nor video found in segment.":t.hasVideo&&!i.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&&i.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},W4=function(e,t,i){var r=t-ti.BACK_BUFFER_LENGTH;e.length&&(r=Math.max(r,e.start(0)));var n=t-i;return Math.min(n,r)},Pa=function(e){var t=e.startOfSegment,i=e.duration,r=e.segment,n=e.part,a=e.playlist,o=a.mediaSequence,l=a.id,u=a.segments,c=u===void 0?[]:u,h=e.mediaIndex,f=e.partIndex,g=e.timeline,C=c.length-1,p="mediaIndex/partIndex increment";e.getMediaInfoForTime?p="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(p="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(p+=" with independent "+e.independent);var b=typeof f=="number",I=e.segment.uri?"segment":"pre-segment",L=b?rE({preloadSegment:r})-1:0;return I+" ["+(o+h)+"/"+(o+C)+"]"+(b?" part ["+f+"/"+L+"]":"")+(" segment start/end ["+r.start+" => "+r.end+"]")+(b?" part start/end ["+n.start+" => "+n.end+"]":"")+(" startOfSegment ["+t+"]")+(" duration ["+i+"]")+(" timeline ["+g+"]")+(" selected by ["+p+"]")+(" playlist ["+l+"]")},dT=function(e){return e+"TimingInfo"},G4=function(e){var t=e.segmentTimeline,i=e.currentTimeline,r=e.startOfSegment,n=e.buffered,a=e.overrideCheck;return!a&&t===i?null:t<i?r:n.length?n.end(n.length-1):r},fT=function(e){var t=e.timelineChangeController,i=e.currentTimeline,r=e.segmentTimeline,n=e.loaderType,a=e.audioDisabled;if(i===r)return!1;if(n==="audio"){var o=t.lastTimelineChange({type:"main"});return!o||o.to!==r}if(n==="main"&&a){var l=t.pendingTimelineChange({type:"audio"});return!(l&&l.to===r)}return!1},K4=function(e){var t=0;return["video","audio"].forEach(function(i){var r=e[i+"TimingInfo"];if(r){var n=r.start,a=r.end,o;typeof n=="bigint"||typeof a=="bigint"?o=D.BigInt(a)-D.BigInt(n):typeof n=="number"&&typeof a=="number"&&(o=a-n),typeof o<"u"&&o>t&&(t=o)}}),typeof t=="bigint"&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t},pT=function(e){var t=e.segmentDuration,i=e.maxDuration;return t?Math.round(t)>i+rs:!1},X4=function(e,t){if(t!=="hls")return null;var i=K4({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i)return null;var r=e.playlist.targetDuration,n=pT({segmentDuration:i,maxDuration:r*2}),a=pT({segmentDuration:i,maxDuration:r}),o="Segment with index "+e.mediaIndex+" "+("from playlist "+e.playlist.id+" ")+("has a duration of "+i+" ")+("when the reported duration is "+e.duration+" ")+("and the target duration is "+r+". ")+"For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return n||a?{severity:n?"warn":"info",message:o}:null},dm=(function(s){we(e,s);function e(i,r){var n;if(n=s.call(this)||this,!i)throw new TypeError("Initialization settings are required");if(typeof i.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!i.mediaSource)throw new TypeError("No MediaSource specified");return n.bandwidth=i.bandwidth,n.throughput={rate:0,count:0},n.roundTrip=NaN,n.resetStats_(),n.mediaIndex=null,n.partIndex=null,n.hasPlayed_=i.hasPlayed,n.currentTime_=i.currentTime,n.seekable_=i.seekable,n.seeking_=i.seeking,n.duration_=i.duration,n.mediaSource_=i.mediaSource,n.vhs_=i.vhs,n.loaderType_=i.loaderType,n.currentMediaInfo_=void 0,n.startingMediaInfo_=void 0,n.segmentMetadataTrack_=i.segmentMetadataTrack,n.goalBufferLength_=i.goalBufferLength,n.sourceType_=i.sourceType,n.sourceUpdater_=i.sourceUpdater,n.inbandTextTracks_=i.inbandTextTracks,n.state_="INIT",n.timelineChangeController_=i.timelineChangeController,n.shouldSaveSegmentTimingInfo_=!0,n.parse708captions_=i.parse708captions,n.useDtsForTimestampOffset_=i.useDtsForTimestampOffset,n.captionServices_=i.captionServices,n.experimentalExactManifestTimings=i.experimentalExactManifestTimings,n.checkBufferTimeout_=null,n.error_=void 0,n.currentTimeline_=-1,n.pendingSegment_=null,n.xhrOptions_=null,n.pendingSegments_=[],n.audioDisabled_=!1,n.isPendingTimestampOffset_=!1,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=re.browser.IE_VERSION>=11,n.appendInitSegment_={audio:!0,video:!0},n.playlistOfLastInitSegment_={audio:null,video:null},n.callQueue_=[],n.loadQueue_=[],n.metadataQueue_={id3:[],caption:[]},n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=null,n.activeInitSegmentId_=null,n.initSegments_={},n.cacheEncryptionKeys_=i.cacheEncryptionKeys,n.keyCache_={},n.decrypter_=i.decrypter,n.syncController_=i.syncController,n.syncPoint_={segmentIndex:0,time:0},n.transmuxer_=n.createTransmuxer_(),n.triggerSyncInfoUpdate_=function(){return n.trigger("syncinfoupdate")},n.syncController_.on("syncinfoupdate",n.triggerSyncInfoUpdate_),n.mediaSource_.addEventListener("sourceopen",function(){n.isEndOfStream_()||(n.ended_=!1)}),n.fetchAtBuffer_=!1,n.logger_=Pr("SegmentLoader["+n.loaderType_+"]"),Object.defineProperty(We(n),"state",{get:function(){return this.state_},set:function(o){o!==this.state_&&(this.logger_(this.state_+" -> "+o),this.state_=o,this.trigger("statechange"))}}),n.sourceUpdater_.on("ready",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),n.loaderType_==="main"&&n.timelineChangeController_.on("pendingtimelinechange",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),n.loaderType_==="audio"&&n.timelineChangeController_.on("timelinechange",function(){n.hasEnoughInfoToLoad_()&&n.processLoadQueue_(),n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),n}var t=e.prototype;return t.createTransmuxer_=function(){return Gf.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},t.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},t.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},t.setAudio=function(r){this.audioDisabled_=!r,r?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},t.abort=function(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()},t.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.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},t.checkForAbort_=function(r){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==r},t.error=function(r){return typeof r<"u"&&(this.logger_("error occurred:",r),this.error_=r),this.pendingSegment_=null,this.error_},t.endOfStream=function(){this.ended_=!0,this.transmuxer_&&Gf.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},t.buffered_=function(){var r=this.getMediaInfo_();if(!this.sourceUpdater_||!r)return re.createTimeRanges();if(this.loaderType_==="main"){var n=r.hasAudio,a=r.hasVideo,o=r.isMuxed;if(a&&n&&!this.audioDisabled_&&!o)return this.sourceUpdater_.buffered();if(a)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},t.initSegmentForMap=function(r,n){if(n===void 0&&(n=!1),!r)return null;var a=sh(r),o=this.initSegments_[a];return n&&!o&&r.bytes&&(this.initSegments_[a]=o={resolvedUri:r.resolvedUri,byterange:r.byterange,bytes:r.bytes,tracks:r.tracks,timescales:r.timescales}),o||r},t.segmentKey=function(r,n){if(n===void 0&&(n=!1),!r)return null;var a=yE(r),o=this.keyCache_[a];this.cacheEncryptionKeys_&&n&&!o&&r.bytes&&(this.keyCache_[a]=o={resolvedUri:r.resolvedUri,bytes:r.bytes});var l={resolvedUri:(o||r).resolvedUri};return o&&(l.bytes=o.bytes),l},t.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},t.load=function(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}},t.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},t.playlist=function(r,n){if(n===void 0&&(n={}),!!r){var a=this.playlist_,o=this.pendingSegment_;this.playlist_=r,this.xhrOptions_=n,this.state==="INIT"&&(r.syncInfo={mediaSequence:r.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(r));var l=null;if(a&&(a.id?l=a.id:a.uri&&(l=a.uri)),this.logger_("playlist update ["+l+" => "+(r.id||r.uri)+"]"),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!a||a.uri!==r.uri){this.mediaIndex!==null&&(r.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}var u=r.mediaSequence-a.mediaSequence;if(this.logger_("live window shift ["+u+"]"),this.mediaIndex!==null)if(this.mediaIndex-=u,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var c=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!c.parts||!c.parts.length||!c.parts[this.partIndex])){var h=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=h}}o&&(o.mediaIndex-=u,o.mediaIndex<0?(o.mediaIndex=null,o.partIndex=null):(o.mediaIndex>=0&&(o.segment=r.segments[o.mediaIndex]),o.partIndex>=0&&o.segment.parts&&(o.part=o.segment.parts[o.partIndex]))),this.syncController_.saveExpiredSegmentInfo(a,r)}},t.pause=function(){this.checkBufferTimeout_&&(D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},t.paused=function(){return this.checkBufferTimeout_===null},t.resetEverything=function(r){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,r),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},t.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},t.resyncLoader=function(){this.transmuxer_&&Gf.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"})},t.remove=function(r,n,a,o){if(a===void 0&&(a=function(){}),o===void 0&&(o=!1),n===1/0&&(n=this.duration_()),n<=r){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}var l=1,u=function(){l--,l===0&&a()};(o||!this.audioDisabled_)&&(l++,this.sourceUpdater_.removeAudio(r,n,u)),(o||this.loaderType_==="main")&&(this.gopBuffer_=j4(this.gopBuffer_,r,n,this.timeMapping_),l++,this.sourceUpdater_.removeVideo(r,n,u));for(var c in this.inbandTextTracks_)vl(r,n,this.inbandTextTracks_[c]);vl(r,n,this.segmentMetadataTrack_),u()},t.monitorBuffer_=function(){this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=D.setTimeout(this.monitorBufferTick_.bind(this),1)},t.monitorBufferTick_=function(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=D.setTimeout(this.monitorBufferTick_.bind(this),q4)},t.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var r=this.chooseNextRequest_();r&&(typeof r.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:r.timeline})),this.loadSegment_(r))}},t.isEndOfStream_=function(r,n,a){if(r===void 0&&(r=this.mediaIndex),n===void 0&&(n=this.playlist_),a===void 0&&(a=this.partIndex),!n||!this.mediaSource_)return!1;var o=typeof r=="number"&&n.segments[r],l=r+1===n.segments.length,u=!o||!o.parts||a+1===o.parts.length;return n.endList&&this.mediaSource_.readyState==="open"&&l&&u},t.chooseNextRequest_=function(){var r=this.buffered_(),n=tT(r)||0,a=Kg(r,this.currentTime_()),o=!this.hasPlayed_()&&a>=1,l=a>=this.goalBufferLength_(),u=this.playlist_.segments;if(!u.length||o||l)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var c={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(c.isSyncRequest)c.mediaIndex=H4(this.currentTimeline_,u,n);else if(this.mediaIndex!==null){var h=u[this.mediaIndex],f=typeof this.partIndex=="number"?this.partIndex:-1;c.startOfSegment=h.end?h.end:n,h.parts&&h.parts[f+1]?(c.mediaIndex=this.mediaIndex,c.partIndex=f+1):c.mediaIndex=this.mediaIndex+1}else{var g=ji.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?n:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),C=g.segmentIndex,p=g.startTime,b=g.partIndex;c.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+n:"currentTime "+this.currentTime_(),c.mediaIndex=C,c.startOfSegment=p,c.partIndex=b}var I=u[c.mediaIndex],L=I&&typeof c.partIndex=="number"&&I.parts&&I.parts[c.partIndex];if(!I||typeof c.partIndex=="number"&&!L)return null;if(typeof c.partIndex!="number"&&I.parts&&(c.partIndex=0,L=I.parts[0]),!a&&L&&!L.independent)if(c.partIndex===0){var F=u[c.mediaIndex-1],V=F.parts&&F.parts.length&&F.parts[F.parts.length-1];V&&V.independent&&(c.mediaIndex-=1,c.partIndex=F.parts.length-1,c.independent="previous segment")}else I.parts[c.partIndex-1].independent&&(c.partIndex-=1,c.independent="previous part");var B=this.mediaSource_&&this.mediaSource_.readyState==="ended";return c.mediaIndex>=u.length-1&&B&&!this.seeking_()?null:this.generateSegmentInfo_(c)},t.generateSegmentInfo_=function(r){var n=r.independent,a=r.playlist,o=r.mediaIndex,l=r.startOfSegment,u=r.isSyncRequest,c=r.partIndex,h=r.forceTimestampOffset,f=r.getMediaInfoForTime,g=a.segments[o],C=typeof c=="number"&&g.parts[c],p={requestId:"segment-loader-"+Math.random(),uri:C&&C.resolvedUri||g.resolvedUri,mediaIndex:o,partIndex:C?c:null,isSyncRequest:u,startOfSegment:l,playlist:a,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:g.timeline,duration:C&&C.duration||g.duration,segment:g,part:C,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:f,independent:n},b=typeof h<"u"?h:this.isPendingTimestampOffset_;p.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:g.timeline,currentTimeline:this.currentTimeline_,startOfSegment:l,buffered:this.buffered_(),overrideCheck:b});var I=tT(this.sourceUpdater_.audioBuffered());return typeof I=="number"&&(p.audioAppendStart=I-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(p.gopsToAlignWith=U4(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),p},t.timestampOffsetForSegment_=function(r){return G4(r)},t.earlyAbortWhenNeeded_=function(r){if(!(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)&&!(Date.now()-(r.firstBytesReceivedAt||Date.now())<1e3)){var n=this.currentTime_(),a=r.bandwidth,o=this.pendingSegment_.duration,l=ji.estimateSegmentRequestTime(o,a,this.playlist_,r.bytesReceived),u=gR(this.buffered_(),n,this.vhs_.tech_.playbackRate())-1;if(!(l<=u)){var c=P4({master:this.vhs_.playlists.master,currentTime:n,bandwidth:a,duration:this.duration_(),segmentDuration:o,timeUntilRebuffer:u,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(c){var h=l-u,f=h-c.rebufferingImpact,g=.5;u<=rs&&(g=1),!(!c.playlist||c.playlist.uri===this.playlist_.uri||f<g)&&(this.bandwidth=c.playlist.attributes.BANDWIDTH*ti.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},t.handleAbort_=function(r){this.logger_("Aborting "+Pa(r)),this.mediaRequestsAborted+=1},t.handleProgress_=function(r,n){this.earlyAbortWhenNeeded_(n.stats),!this.checkForAbort_(n.requestId)&&this.trigger("progress")},t.handleTrackInfo_=function(r,n){this.earlyAbortWhenNeeded_(r.stats),!this.checkForAbort_(r.requestId)&&(this.checkForIllegalMediaSwitch(n)||(n=n||{},V4(this.currentMediaInfo_,n)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=n,this.currentMediaInfo_=n,this.logger_("trackinfo update",n),this.trigger("trackinfo")),!this.checkForAbort_(r.requestId)&&(this.pendingSegment_.trackInfo=n,this.hasEnoughInfoToAppend_()&&this.processCallQueue_())))},t.handleTimingInfo_=function(r,n,a,o){if(this.earlyAbortWhenNeeded_(r.stats),!this.checkForAbort_(r.requestId)){var l=this.pendingSegment_,u=dT(n);l[u]=l[u]||{},l[u][a]=o,this.logger_("timinginfo: "+n+" - "+a+" - "+o),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},t.handleCaptions_=function(r,n){var a=this;if(this.earlyAbortWhenNeeded_(r.stats),!this.checkForAbort_(r.requestId)){if(n.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}var o=this.pendingSegment_;if(!o.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,r,n));return}var l=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),u={};n.forEach(function(c){u[c.stream]=u[c.stream]||{startTime:1/0,captions:[],endTime:0};var h=u[c.stream];h.startTime=Math.min(h.startTime,c.startTime+l),h.endTime=Math.max(h.endTime,c.endTime+l),h.captions.push(c)}),Object.keys(u).forEach(function(c){var h=u[c],f=h.startTime,g=h.endTime,C=h.captions,p=a.inbandTextTracks_;a.logger_("adding cues from "+f+" -> "+g+" for "+c),L4(p,a.vhs_.tech_,c),vl(f,g,p[c]),O4({captionArray:C,inbandTextTracks:p,timestampOffset:l})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},t.handleId3_=function(r,n,a){if(this.earlyAbortWhenNeeded_(r.stats),!this.checkForAbort_(r.requestId)){var o=this.pendingSegment_;if(!o.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,r,n,a));return}var l=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();B4(this.inbandTextTracks_,a,this.vhs_.tech_),R4({inbandTextTracks:this.inbandTextTracks_,metadataArray:n,timestampOffset:l,videoDuration:this.duration_()})}},t.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(r){return r()}),this.metadataQueue_.caption.forEach(function(r){return r()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},t.processCallQueue_=function(){var r=this.callQueue_;this.callQueue_=[],r.forEach(function(n){return n()})},t.processLoadQueue_=function(){var r=this.loadQueue_;this.loadQueue_=[],r.forEach(function(n){return n()})},t.hasEnoughInfoToLoad_=function(){if(this.loaderType_!=="audio")return!0;var r=this.pendingSegment_;return r?this.getCurrentMediaInfo_()?!fT({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:r.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1},t.getCurrentMediaInfo_=function(r){return r===void 0&&(r=this.pendingSegment_),r&&r.trackInfo||this.currentMediaInfo_},t.getMediaInfo_=function(r){return r===void 0&&(r=this.pendingSegment_),this.getCurrentMediaInfo_(r)||this.startingMediaInfo_},t.getPendingSegmentPlaylist=function(){return this.pendingSegment_?this.pendingSegment_.playlist:null},t.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var r=this.pendingSegment_,n=this.getCurrentMediaInfo_();if(!r||!n)return!1;var a=n.hasAudio,o=n.hasVideo,l=n.isMuxed;return!(o&&!r.videoTimingInfo||a&&!this.audioDisabled_&&!l&&!r.audioTimingInfo||fT({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:r.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},t.handleData_=function(r,n){if(this.earlyAbortWhenNeeded_(r.stats),!this.checkForAbort_(r.requestId)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,r,n));return}var a=this.pendingSegment_;if(this.setTimeMapping_(a.timeline),this.updateMediaSecondsLoaded_(a.part||a.segment),this.mediaSource_.readyState!=="closed"){if(r.map&&(r.map=this.initSegmentForMap(r.map,!0),a.segment.map=r.map),r.key&&this.segmentKey(r.key,!0),a.isFmp4=r.isFmp4,a.timingInfo=a.timingInfo||{},a.isFmp4)this.trigger("fmp4"),a.timingInfo.start=a[dT(n.type)].start;else{var o=this.getCurrentMediaInfo_(),l=this.loaderType_==="main"&&o&&o.hasVideo,u;l&&(u=a.videoTimingInfo.start),a.timingInfo.start=this.trueSegmentStart_({currentStart:a.timingInfo.start,playlist:a.playlist,mediaIndex:a.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:l,firstVideoFrameTimeForData:u,videoTimingInfo:a.videoTimingInfo,audioTimingInfo:a.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(a,n.type),this.updateSourceBufferTimestampOffset_(a),a.isSyncRequest){this.updateTimingInfoEnd_(a),this.syncController_.saveSegmentTimingInfo({segmentInfo:a,shouldSaveTimelineMapping:this.loaderType_==="main"});var c=this.chooseNextRequest_();if(c.mediaIndex!==a.mediaIndex||c.partIndex!==a.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}a.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(a,n)}}},t.updateAppendInitSegmentStatus=function(r,n){this.loaderType_==="main"&&typeof r.timestampOffset=="number"&&!r.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[n]!==r.playlist&&(this.appendInitSegment_[n]=!0)},t.getInitSegmentAndUpdateState_=function(r){var n=r.type,a=r.initSegment,o=r.map,l=r.playlist;if(o){var u=sh(o);if(this.activeInitSegmentId_===u)return null;a=this.initSegmentForMap(o,!0).bytes,this.activeInitSegmentId_=u}return a&&this.appendInitSegment_[n]?(this.playlistOfLastInitSegment_[n]=l,this.appendInitSegment_[n]=!1,this.activeInitSegmentId_=null,a):null},t.handleQuotaExceededError_=function(r,n){var a=this,o=r.segmentInfo,l=r.type,u=r.bytes,c=this.sourceUpdater_.audioBuffered(),h=this.sourceUpdater_.videoBuffered();c.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Ms(c).join(", ")),h.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ms(h).join(", "));var f=c.length?c.start(0):0,g=c.length?c.end(c.length-1):0,C=h.length?h.start(0):0,p=h.length?h.end(h.length-1):0;if(g-f<=al&&p-C<=al){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. "+("Appended byte length: "+u.byteLength+", ")+("audio buffer: "+Ms(c).join(", ")+", ")+("video buffer: "+Ms(h).join(", ")+", ")),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:o,type:l,bytes:u}));var b=this.currentTime_(),I=b-al;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+I),this.remove(0,I,function(){a.logger_("On QUOTA_EXCEEDED_ERR, retrying append in "+al+"s"),a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=D.setTimeout(function(){a.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),a.quotaExceededErrorRetryTimeout_=null,a.processCallQueue_()},al*1e3)},!0)},t.handleAppendError_=function(r,n){var a=r.segmentInfo,o=r.type,l=r.bytes;if(n){if(n.code===ME){this.handleQuotaExceededError_({segmentInfo:a,type:o,bytes:l});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",n),this.error(o+" append of "+l.length+"b failed for segment "+("#"+a.mediaIndex+" in playlist "+a.playlist.id)),this.trigger("appenderror")}},t.appendToSourceBuffer_=function(r){var n=r.segmentInfo,a=r.type,o=r.initSegment,l=r.data,u=r.bytes;if(!u){var c=[l],h=l.byteLength;o&&(c.unshift(o),h+=o.byteLength),u=N4({bytes:h,segments:c})}this.sourceUpdater_.appendBuffer({segmentInfo:n,type:a,bytes:u},this.handleAppendError_.bind(this,{segmentInfo:n,type:a,bytes:u}))},t.handleSegmentTimingInfo_=function(r,n,a){if(!(!this.pendingSegment_||n!==this.pendingSegment_.requestId)){var o=this.pendingSegment_.segment,l=r+"TimingInfo";o[l]||(o[l]={}),o[l].transmuxerPrependedSeconds=a.prependedContentDuration||0,o[l].transmuxedPresentationStart=a.start.presentation,o[l].transmuxedDecodeStart=a.start.decode,o[l].transmuxedPresentationEnd=a.end.presentation,o[l].transmuxedDecodeEnd=a.end.decode,o[l].baseMediaDecodeTime=a.baseMediaDecodeTime}},t.appendData_=function(r,n){var a=n.type,o=n.data;if(!(!o||!o.byteLength)&&!(a==="audio"&&this.audioDisabled_)){var l=this.getInitSegmentAndUpdateState_({type:a,initSegment:n.initSegment,playlist:r.playlist,map:r.isFmp4?r.segment.map:null});this.appendToSourceBuffer_({segmentInfo:r,type:a,initSegment:l,data:o})}},t.loadSegment_=function(r){var n=this;if(this.state="WAITING",this.pendingSegment_=r,this.trimBackBuffer_(r),typeof r.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(function(){var a=mt({},r,{forceTimestampOffset:!0});mt(r,n.generateSegmentInfo_(a)),n.isPendingTimestampOffset_=!1,n.updateTransmuxerAndRequestSegment_(r)});return}this.updateTransmuxerAndRequestSegment_(r)},t.updateTransmuxerAndRequestSegment_=function(r){var n=this;this.shouldUpdateTransmuxerTimestampOffset_(r.timestampOffset)&&(this.gopBuffer_.length=0,r.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:r.timestampOffset}));var a=this.createSimplifiedSegmentObj_(r),o=this.isEndOfStream_(r.mediaIndex,r.playlist,r.partIndex),l=this.mediaIndex!==null,u=r.timeline!==this.currentTimeline_&&r.timeline>0,c=o||l&&u;this.logger_("Requesting "+Pa(r)),a.map&&!a.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),r.abortRequests=E4({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:a,abortFn:this.handleAbort_.bind(this,r),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",r.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",r.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:c,endedTimelineFn:function(){n.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(f){var g=f.message,C=f.level,p=f.stream;n.logger_(Pa(r)+" logged from transmuxer stream "+p+" as a "+C+": "+g)}})},t.trimBackBuffer_=function(r){var n=W4(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);n>0&&this.remove(0,n)},t.createSimplifiedSegmentObj_=function(r){var n=r.segment,a=r.part,o={resolvedUri:a?a.resolvedUri:n.resolvedUri,byterange:a?a.byterange:n.byterange,requestId:r.requestId,transmuxer:r.transmuxer,audioAppendStart:r.audioAppendStart,gopsToAlignWith:r.gopsToAlignWith,part:r.part},l=r.playlist.segments[r.mediaIndex-1];if(l&&l.timeline===n.timeline&&(l.videoTimingInfo?o.baseStartTime=l.videoTimingInfo.transmuxedDecodeEnd:l.audioTimingInfo&&(o.baseStartTime=l.audioTimingInfo.transmuxedDecodeEnd)),n.key){var u=n.key.iv||new Uint32Array([0,0,0,r.mediaIndex+r.playlist.mediaSequence]);o.key=this.segmentKey(n.key),o.key.iv=u}return n.map&&(o.map=this.initSegmentForMap(n.map)),o},t.saveTransferStats_=function(r){this.mediaRequests+=1,r&&(this.mediaBytesTransferred+=r.bytesReceived,this.mediaTransferDuration+=r.roundTripTime)},t.saveBandwidthRelatedStats_=function(r,n){if(this.pendingSegment_.byteLength=n.bytesReceived,r<ic){this.logger_("Ignoring segment's bandwidth because its duration of "+r+(" is less than the min to record "+ic));return}this.bandwidth=n.bandwidth,this.roundTrip=n.roundTripTime},t.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")},t.segmentRequestFinished_=function(r,n,a){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,r,n,a));return}if(this.saveTransferStats_(n.stats),!!this.pendingSegment_&&n.requestId===this.pendingSegment_.requestId){if(r){if(this.pendingSegment_=null,this.state="READY",r.code===Kr.ABORTED)return;if(this.pause(),r.code===Kr.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(r),this.trigger("error");return}var o=this.pendingSegment_;this.saveBandwidthRelatedStats_(o.duration,n.stats),o.endOfAllRequests=n.endOfAllRequests,a.gopInfo&&(this.gopBuffer_=$4(this.gopBuffer_,a.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(o)}},t.setTimeMapping_=function(r){var n=this.syncController_.mappingForTimeline(r);n!==null&&(this.timeMapping_=n)},t.updateMediaSecondsLoaded_=function(r){typeof r.start=="number"&&typeof r.end=="number"?this.mediaSecondsLoaded+=r.end-r.start:this.mediaSecondsLoaded+=r.duration},t.shouldUpdateTransmuxerTimestampOffset_=function(r){return r===null?!1:this.loaderType_==="main"&&r!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&r!==this.sourceUpdater_.audioTimestampOffset()},t.trueSegmentStart_=function(r){var n=r.currentStart,a=r.playlist,o=r.mediaIndex,l=r.firstVideoFrameTimeForData,u=r.currentVideoTimestampOffset,c=r.useVideoTimingInfo,h=r.videoTimingInfo,f=r.audioTimingInfo;if(typeof n<"u")return n;if(!c)return f.start;var g=a.segments[o-1];return o===0||!g||typeof g.start>"u"||g.end!==l+u?l:h.start},t.waitForAppendsToComplete_=function(r){var n=this.getCurrentMediaInfo_(r);if(!n){this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),this.trigger("error");return}var a=n.hasAudio,o=n.hasVideo,l=n.isMuxed,u=this.loaderType_==="main"&&o,c=!this.audioDisabled_&&a&&!l;if(r.waitingOnAppends=0,!r.hasAppendedData_){!r.timingInfo&&typeof r.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),r.timingInfo={start:0},r.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(r),this.processMetadataQueue_()),this.checkAppendsDone_(r);return}u&&r.waitingOnAppends++,c&&r.waitingOnAppends++,u&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,r)),c&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,r))},t.checkAppendsDone_=function(r){this.checkForAbort_(r.requestId)||(r.waitingOnAppends--,r.waitingOnAppends===0&&this.handleAppendsDone_())},t.checkForIllegalMediaSwitch=function(r){var n=z4(this.loaderType_,this.getCurrentMediaInfo_(),r);return n?(this.error({message:n,blacklistDuration:1/0}),this.trigger("error"),!0):!1},t.updateSourceBufferTimestampOffset_=function(r){if(!(r.timestampOffset===null||typeof r.timingInfo.start!="number"||r.changedTimestampOffset||this.loaderType_!=="main")){var n=!1;r.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:r.segment.videoTimingInfo,audioTimingInfo:r.segment.audioTimingInfo,timingInfo:r.timingInfo}),r.changedTimestampOffset=!0,r.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(r.timestampOffset),n=!0),r.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(r.timestampOffset),n=!0),n&&this.trigger("timestampoffset")}},t.getSegmentStartTimeForTimestampOffsetCalculation_=function(r){var n=r.videoTimingInfo,a=r.audioTimingInfo,o=r.timingInfo;return this.useDtsForTimestampOffset_?n&&typeof n.transmuxedDecodeStart=="number"?n.transmuxedDecodeStart:a&&typeof a.transmuxedDecodeStart=="number"?a.transmuxedDecodeStart:o.start:o.start},t.updateTimingInfoEnd_=function(r){r.timingInfo=r.timingInfo||{};var n=this.getMediaInfo_(),a=this.loaderType_==="main"&&n&&n.hasVideo,o=a&&r.videoTimingInfo?r.videoTimingInfo:r.audioTimingInfo;o&&(r.timingInfo.end=typeof o.end=="number"?o.end:o.start+r.duration)},t.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}var r=this.pendingSegment_;this.updateTimingInfoEnd_(r),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:r,shouldSaveTimelineMapping:this.loaderType_==="main"});var n=X4(r,this.sourceType_);if(n&&(n.severity==="warn"?re.log.warn(n.message):this.logger_(n.message)),this.recordThroughput_(r),this.pendingSegment_=null,this.state="READY",r.isSyncRequest&&(this.trigger("syncinfoupdate"),!r.hasAppendedData_)){this.logger_("Throwing away un-appended sync request "+Pa(r));return}this.logger_("Appended "+Pa(r)),this.addSegmentMetadataCue_(r),this.fetchAtBuffer_=!0,this.currentTimeline_!==r.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:r.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:r.timeline})),this.currentTimeline_=r.timeline,this.trigger("syncinfoupdate");var a=r.segment,o=r.part,l=a.end&&this.currentTime_()-a.end>r.playlist.targetDuration*3,u=o&&o.end&&this.currentTime_()-o.end>r.playlist.partTargetDuration*3;if(l||u){this.logger_("bad "+(l?"segment":"part")+" "+Pa(r)),this.resetEverything();return}var c=this.mediaIndex!==null;c&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=r.mediaIndex,this.partIndex=r.partIndex,this.isEndOfStream_(r.mediaIndex,r.playlist,r.partIndex)&&this.endOfStream(),this.trigger("appended"),r.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()},t.recordThroughput_=function(r){if(r.duration<ic){this.logger_("Ignoring segment's throughput because its duration of "+r.duration+(" is less than the min to record "+ic));return}var n=this.throughput.rate,a=Date.now()-r.endOfAllRequests+1,o=Math.floor(r.byteLength/a*8*1e3);this.throughput.rate+=(o-n)/++this.throughput.count},t.addSegmentMetadataCue_=function(r){if(this.segmentMetadataTrack_){var n=r.segment,a=n.start,o=n.end;if(!(!hT(a)||!hT(o))){vl(a,o,this.segmentMetadataTrack_);var l=D.WebKitDataCue||D.VTTCue,u={custom:n.custom,dateTimeObject:n.dateTimeObject,dateTimeString:n.dateTimeString,bandwidth:r.playlist.attributes.BANDWIDTH,resolution:r.playlist.attributes.RESOLUTION,codecs:r.playlist.attributes.CODECS,byteLength:r.byteLength,uri:r.uri,timeline:r.timeline,playlist:r.playlist.id,start:a,end:o},c=JSON.stringify(u),h=new l(a,o,c);h.value=u,this.segmentMetadataTrack_.addCue(h)}}},e})(re.EventTarget);function yn(){}var RE=function(e){return typeof e!="string"?e:e.replace(/./,function(t){return t.toUpperCase()})},Q4=["video","audio"],fm=function(e,t){var i=t[e+"Buffer"];return i&&i.updating||t.queuePending[e]},Y4=function(e,t){for(var i=0;i<t.length;i++){var r=t[i];if(r.type==="mediaSource")return null;if(r.type===e)return i}return null},tv=function s(e,t){if(t.queue.length!==0){var i=0,r=t.queue[i];if(r.type==="mediaSource"){!t.updating()&&t.mediaSource.readyState!=="closed"&&(t.queue.shift(),r.action(t),r.doneFn&&r.doneFn(),s("audio",t),s("video",t));return}if(e!=="mediaSource"&&!(!t.ready()||t.mediaSource.readyState==="closed"||fm(e,t))){if(r.type!==e){if(i=Y4(e,t.queue),i===null)return;r=t.queue[i]}if(t.queue.splice(i,1),t.queuePending[e]=r,r.action(e,t),!r.doneFn){t.queuePending[e]=null,s(e,t);return}}}},BE=function(e,t){var i=t[e+"Buffer"],r=RE(e);i&&(i.removeEventListener("updateend",t["on"+r+"UpdateEnd_"]),i.removeEventListener("error",t["on"+r+"Error_"]),t.codecs[e]=null,t[e+"Buffer"]=null)},jr=function(e,t){return e&&t&&Array.prototype.indexOf.call(e.sourceBuffers,t)!==-1},Qi={appendBuffer:function(e,t,i){return function(r,n){var a=n[r+"Buffer"];if(jr(n.mediaSource,a)){n.logger_("Appending segment "+t.mediaIndex+"'s "+e.length+" bytes to "+r+"Buffer");try{a.appendBuffer(e)}catch(o){n.logger_("Error with code "+o.code+" "+(o.code===ME?"(QUOTA_EXCEEDED_ERR) ":"")+("when appending segment "+t.mediaIndex+" to "+r+"Buffer")),n.queuePending[r]=null,i(o)}}}},remove:function(e,t){return function(i,r){var n=r[i+"Buffer"];if(jr(r.mediaSource,n)){r.logger_("Removing "+e+" to "+t+" from "+i+"Buffer");try{n.remove(e,t)}catch{r.logger_("Remove "+e+" to "+t+" from "+i+"Buffer failed")}}}},timestampOffset:function(e){return function(t,i){var r=i[t+"Buffer"];jr(i.mediaSource,r)&&(i.logger_("Setting "+t+"timestampOffset to "+e),r.timestampOffset=e)}},callback:function(e){return function(t,i){e()}},endOfStream:function(e){return function(t){if(t.mediaSource.readyState==="open"){t.logger_("Calling mediaSource endOfStream("+(e||"")+")");try{t.mediaSource.endOfStream(e)}catch(i){re.log.warn("Failed to call media source endOfStream",i)}}}},duration:function(e){return function(t){t.logger_("Setting mediaSource duration to "+e);try{t.mediaSource.duration=e}catch(i){re.log.warn("Failed to set media source duration",i)}}},abort:function(){return function(e,t){if(t.mediaSource.readyState==="open"){var i=t[e+"Buffer"];if(jr(t.mediaSource,i)){t.logger_("calling abort on "+e+"Buffer");try{i.abort()}catch(r){re.log.warn("Failed to abort on "+e+"Buffer",r)}}}}},addSourceBuffer:function(e,t){return function(i){var r=RE(e),n=Bl(t);i.logger_("Adding "+e+"Buffer with codec "+t+" to mediaSource");var a=i.mediaSource.addSourceBuffer(n);a.addEventListener("updateend",i["on"+r+"UpdateEnd_"]),a.addEventListener("error",i["on"+r+"Error_"]),i.codecs[e]=t,i[e+"Buffer"]=a}},removeSourceBuffer:function(e){return function(t){var i=t[e+"Buffer"];if(BE(e,t),!!jr(t.mediaSource,i)){t.logger_("Removing "+e+"Buffer with codec "+t.codecs[e]+" from mediaSource");try{t.mediaSource.removeSourceBuffer(i)}catch(r){re.log.warn("Failed to removeSourceBuffer "+e+"Buffer",r)}}}},changeType:function(e){return function(t,i){var r=i[t+"Buffer"],n=Bl(e);if(jr(i.mediaSource,r)&&i.codecs[t]!==e){i.logger_("changing "+t+"Buffer codec from "+i.codecs[t]+" to "+e);try{r.changeType(n),i.codecs[t]=e}catch(a){re.log.warn("Failed to changeType on "+t+"Buffer",a)}}}}},Yi=function(e){var t=e.type,i=e.sourceUpdater,r=e.action,n=e.doneFn,a=e.name;i.queue.push({type:t,action:r,doneFn:n,name:a}),tv(t,i)},mT=function(e,t){return function(i){if(t.queuePending[e]){var r=t.queuePending[e].doneFn;t.queuePending[e]=null,r&&r(t[e+"Error_"])}tv(e,t)}},FE=(function(s){we(e,s);function e(i){var r;return r=s.call(this)||this,r.mediaSource=i,r.sourceopenListener_=function(){return tv("mediaSource",We(r))},r.mediaSource.addEventListener("sourceopen",r.sourceopenListener_),r.logger_=Pr("SourceUpdater"),r.audioTimestampOffset_=0,r.videoTimestampOffset_=0,r.queue=[],r.queuePending={audio:null,video:null},r.delayedAudioAppendQueue_=[],r.videoAppendQueued_=!1,r.codecs={},r.onVideoUpdateEnd_=mT("video",We(r)),r.onAudioUpdateEnd_=mT("audio",We(r)),r.onVideoError_=function(n){r.videoError_=n},r.onAudioError_=function(n){r.audioError_=n},r.createdSourceBuffers_=!1,r.initializedEme_=!1,r.triggeredReady_=!1,r}var t=e.prototype;return t.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},t.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},t.hasInitializedAnyEme=function(){return this.initializedEme_},t.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},t.createSourceBuffers=function(r){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(r),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},t.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},t.addSourceBuffer=function(r,n){Yi({type:"mediaSource",sourceUpdater:this,action:Qi.addSourceBuffer(r,n),name:"addSourceBuffer"})},t.abort=function(r){Yi({type:r,sourceUpdater:this,action:Qi.abort(r),name:"abort"})},t.removeSourceBuffer=function(r){if(!this.canRemoveSourceBuffer()){re.log.error("removeSourceBuffer is not supported!");return}Yi({type:"mediaSource",sourceUpdater:this,action:Qi.removeSourceBuffer(r),name:"removeSourceBuffer"})},t.canRemoveSourceBuffer=function(){return!re.browser.IE_VERSION&&!re.browser.IS_FIREFOX&&D.MediaSource&&D.MediaSource.prototype&&typeof D.MediaSource.prototype.removeSourceBuffer=="function"},e.canChangeType=function(){return D.SourceBuffer&&D.SourceBuffer.prototype&&typeof D.SourceBuffer.prototype.changeType=="function"},t.canChangeType=function(){return this.constructor.canChangeType()},t.changeType=function(r,n){if(!this.canChangeType()){re.log.error("changeType is not supported!");return}Yi({type:r,sourceUpdater:this,action:Qi.changeType(n),name:"changeType"})},t.addOrChangeSourceBuffers=function(r){var n=this;if(!r||typeof r!="object"||Object.keys(r).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(r).forEach(function(a){var o=r[a];if(!n.hasCreatedSourceBuffers())return n.addSourceBuffer(a,o);n.canChangeType()&&n.changeType(a,o)})},t.appendBuffer=function(r,n){var a=this,o=r.segmentInfo,l=r.type,u=r.bytes;if(this.processedAppend_=!0,l==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([r,n]),this.logger_("delayed audio append of "+u.length+" until video append");return}var c=n;if(Yi({type:l,sourceUpdater:this,action:Qi.appendBuffer(u,o||{mediaIndex:-1},c),doneFn:n,name:"appendBuffer"}),l==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var h=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+h.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,h.forEach(function(f){a.appendBuffer.apply(a,f)})}},t.audioBuffered=function(){return jr(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:re.createTimeRange()},t.videoBuffered=function(){return jr(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:re.createTimeRange()},t.buffered=function(){var r=jr(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,n=jr(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return n&&!r?this.audioBuffered():r&&!n?this.videoBuffered():mR(this.audioBuffered(),this.videoBuffered())},t.setDuration=function(r,n){n===void 0&&(n=yn),Yi({type:"mediaSource",sourceUpdater:this,action:Qi.duration(r),name:"duration",doneFn:n})},t.endOfStream=function(r,n){r===void 0&&(r=null),n===void 0&&(n=yn),typeof r!="string"&&(r=void 0),Yi({type:"mediaSource",sourceUpdater:this,action:Qi.endOfStream(r),name:"endOfStream",doneFn:n})},t.removeAudio=function(r,n,a){if(a===void 0&&(a=yn),!this.audioBuffered().length||this.audioBuffered().end(0)===0){a();return}Yi({type:"audio",sourceUpdater:this,action:Qi.remove(r,n),doneFn:a,name:"remove"})},t.removeVideo=function(r,n,a){if(a===void 0&&(a=yn),!this.videoBuffered().length||this.videoBuffered().end(0)===0){a();return}Yi({type:"video",sourceUpdater:this,action:Qi.remove(r,n),doneFn:a,name:"remove"})},t.updating=function(){return!!(fm("audio",this)||fm("video",this))},t.audioTimestampOffset=function(r){return typeof r<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==r&&(Yi({type:"audio",sourceUpdater:this,action:Qi.timestampOffset(r),name:"timestampOffset"}),this.audioTimestampOffset_=r),this.audioTimestampOffset_},t.videoTimestampOffset=function(r){return typeof r<"u"&&this.videoBuffer&&this.videoTimestampOffset!==r&&(Yi({type:"video",sourceUpdater:this,action:Qi.timestampOffset(r),name:"timestampOffset"}),this.videoTimestampOffset_=r),this.videoTimestampOffset_},t.audioQueueCallback=function(r){this.audioBuffer&&Yi({type:"audio",sourceUpdater:this,action:Qi.callback(r),name:"callback"})},t.videoQueueCallback=function(r){this.videoBuffer&&Yi({type:"video",sourceUpdater:this,action:Qi.callback(r),name:"callback"})},t.dispose=function(){var r=this;this.trigger("dispose"),Q4.forEach(function(n){r.abort(n),r.canRemoveSourceBuffer()?r.removeSourceBuffer(n):r[n+"QueueCallback"](function(){return BE(n,r)})}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},e})(re.EventTarget),gT=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},vT=new Uint8Array(`
286
+
287
+ `.split("").map(function(s){return s.charCodeAt(0)})),J4=(function(s){we(e,s);function e(){return s.call(this,"Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")||this}return e})(Kp(Error)),Z4=(function(s){we(e,s);function e(i,r){var n;return r===void 0&&(r={}),n=s.call(this,i,r)||this,n.mediaSource_=null,n.subtitlesTrack_=null,n.loaderType_="subtitle",n.featuresNativeTextTracks_=i.featuresNativeTextTracks,n.loadVttJs=i.loadVttJs,n.shouldSaveSegmentTimingInfo_=!1,n}var t=e.prototype;return t.createTransmuxer_=function(){return null},t.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return re.createTimeRanges();var r=this.subtitlesTrack_.cues,n=r[0].startTime,a=r[r.length-1].startTime;return re.createTimeRanges([[n,a]])},t.initSegmentForMap=function(r,n){if(n===void 0&&(n=!1),!r)return null;var a=sh(r),o=this.initSegments_[a];if(n&&!o&&r.bytes){var l=vT.byteLength+r.bytes.byteLength,u=new Uint8Array(l);u.set(r.bytes),u.set(vT,r.bytes.byteLength),this.initSegments_[a]=o={resolvedUri:r.resolvedUri,byterange:r.byterange,bytes:u}}return o||r},t.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},t.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},t.track=function(r){return typeof r>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=r,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)},t.remove=function(r,n){vl(r,n,this.subtitlesTrack_)},t.fillBuffer_=function(){var r=this,n=this.chooseNextRequest_();if(n){if(this.syncController_.timestampOffsetForTimeline(n.timeline)===null){var a=function(){r.state="READY",r.paused()||r.monitorBuffer_()};this.syncController_.one("timestampoffset",a),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(n)}},t.timestampOffsetForSegment_=function(){return null},t.chooseNextRequest_=function(){return this.skipEmptySegments_(s.prototype.chooseNextRequest_.call(this))},t.skipEmptySegments_=function(r){for(;r&&r.segment.empty;){if(r.mediaIndex+1>=r.playlist.segments.length){r=null;break}r=this.generateSegmentInfo_({playlist:r.playlist,mediaIndex:r.mediaIndex+1,startOfSegment:r.startOfSegment+r.duration,isSyncRequest:r.isSyncRequest})}return r},t.stopForError=function(r){this.error(r),this.state="READY",this.pause(),this.trigger("error")},t.segmentRequestFinished_=function(r,n,a){var o=this;if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(n.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(r){r.code===Kr.TIMEOUT&&this.handleTimeout_(),r.code===Kr.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(r);return}var l=this.pendingSegment_;this.saveBandwidthRelatedStats_(l.duration,n.stats),n.key&&this.segmentKey(n.key,!0),this.state="APPENDING",this.trigger("appending");var u=l.segment;if(u.map&&(u.map.bytes=n.map.bytes),l.bytes=n.bytes,typeof D.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(function(){return o.segmentRequestFinished_(r,n,a)},function(){return o.stopForError({message:"Error loading vtt.js"})});return}u.requested=!0;try{this.parseVTTCues_(l)}catch(c){this.stopForError({message:c.message});return}if(this.updateTimeMapping_(l,this.syncController_.timelines[l.timeline],this.playlist_),l.cues.length?l.timingInfo={start:l.cues[0].startTime,end:l.cues[l.cues.length-1].endTime}:l.timingInfo={start:l.startOfSegment,end:l.startOfSegment+l.duration},l.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}l.byteLength=l.bytes.byteLength,this.mediaSecondsLoaded+=u.duration,l.cues.forEach(function(c){o.subtitlesTrack_.addCue(o.featuresNativeTextTracks_?new D.VTTCue(c.startTime,c.endTime,c.text):c)}),F4(this.subtitlesTrack_),this.handleAppendsDone_()},t.handleData_=function(){},t.updateTimingInfoEnd_=function(){},t.parseVTTCues_=function(r){var n,a=!1;if(typeof D.WebVTT!="function")throw new J4;typeof D.TextDecoder=="function"?n=new D.TextDecoder("utf8"):(n=D.WebVTT.StringDecoder(),a=!0);var o=new D.WebVTT.Parser(D,D.vttjs,n);if(r.cues=[],r.timestampmap={MPEGTS:0,LOCAL:0},o.oncue=r.cues.push.bind(r.cues),o.ontimestampmap=function(c){r.timestampmap=c},o.onparsingerror=function(c){re.log.warn("Error encountered when parsing cues: "+c.message)},r.segment.map){var l=r.segment.map.bytes;a&&(l=gT(l)),o.parse(l)}var u=r.bytes;a&&(u=gT(u)),o.parse(u),o.flush()},t.updateTimeMapping_=function(r,n,a){var o=r.segment;if(n){if(!r.cues.length){o.empty=!0;return}var l=r.timestampmap,u=l.MPEGTS/Gc.ONE_SECOND_IN_TS-l.LOCAL+n.mapping;if(r.cues.forEach(function(f){f.startTime+=u,f.endTime+=u}),!a.syncInfo){var c=r.cues[0].startTime,h=r.cues[r.cues.length-1].startTime;a.syncInfo={mediaSequence:a.mediaSequence+r.mediaIndex,time:Math.min(c,h-o.duration)}}}},e})(dm),e3=function(e,t){for(var i=e.cues,r=0;r<i.length;r++){var n=i[r];if(t>=n.adStartTime&&t<=n.adEndTime)return n}return null},t3=function(e,t,i){if(i===void 0&&(i=0),!!e.segments)for(var r=i,n,a=0;a<e.segments.length;a++){var o=e.segments[a];if(n||(n=e3(t,r+o.duration/2)),n){if("cueIn"in o){n.endTime=r,n.adEndTime=r,r+=o.duration,n=null;continue}if(r<n.endTime){r+=o.duration;continue}n.endTime+=o.duration}else if("cueOut"in o&&(n=new D.VTTCue(r,r+o.duration,o.cueOut),n.adStartTime=r,n.adEndTime=r+parseFloat(o.cueOut),t.addCue(n)),"cueOutCont"in o){var l=o.cueOutCont.split("/").map(parseFloat),u=l[0],c=l[1];n=new D.VTTCue(r,r+o.duration,""),n.adStartTime=r-u,n.adEndTime=n.adStartTime+c,t.addCue(n)}r+=o.duration}},i3=86400,yT=[{name:"VOD",run:function(e,t,i,r,n){if(i!==1/0){var a={time:0,segmentIndex:0,partIndex:null};return a}return null}},{name:"ProgramDateTime",run:function(e,t,i,r,n){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,o=null,l=nm(t);n=n||0;for(var u=0;u<l.length;u++){var c=t.endList||n===0?u:l.length-(u+1),h=l[c],f=h.segment,g=e.timelineToDatetimeMappings[f.timeline];if(!(!g||!f.dateTimeObject)){var C=f.dateTimeObject.getTime()/1e3,p=C+g;if(f.parts&&typeof h.partIndex=="number")for(var b=0;b<h.partIndex;b++)p+=f.parts[b].duration;var I=Math.abs(n-p);if(o!==null&&(I===0||o<I))break;o=I,a={time:p,segmentIndex:h.segmentIndex,partIndex:h.partIndex}}}return a}},{name:"Segment",run:function(e,t,i,r,n){var a=null,o=null;n=n||0;for(var l=nm(t),u=0;u<l.length;u++){var c=t.endList||n===0?u:l.length-(u+1),h=l[c],f=h.segment,g=h.part&&h.part.start||f&&f.start;if(f.timeline===r&&typeof g<"u"){var C=Math.abs(n-g);if(o!==null&&o<C)break;(!a||o===null||o>=C)&&(o=C,a={time:g,segmentIndex:h.segmentIndex,partIndex:h.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,i,r,n){var a=null;if(n=n||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var o=null,l=0;l<t.discontinuityStarts.length;l++){var u=t.discontinuityStarts[l],c=t.discontinuitySequence+l+1,h=e.discontinuities[c];if(h){var f=Math.abs(n-h.time);if(o!==null&&o<f)break;(!a||o===null||o>=f)&&(o=f,a={time:h.time,segmentIndex:u,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,i,r,n){if(t.syncInfo){var a={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null};return a}return null}}],r3=(function(s){we(e,s);function e(i){var r;return r=s.call(this)||this,r.timelines=[],r.discontinuities=[],r.timelineToDatetimeMappings={},r.logger_=Pr("SyncController"),r}var t=e.prototype;return t.getSyncPoint=function(r,n,a,o){var l=this.runStrategies_(r,n,a,o);return l.length?this.selectSyncPoint_(l,{key:"time",value:o}):null},t.getExpiredTime=function(r,n){if(!r||!r.segments)return null;var a=this.runStrategies_(r,n,r.discontinuitySequence,0);if(!a.length)return null;var o=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return o.segmentIndex>0&&(o.time*=-1),Math.abs(o.time+Al({defaultDuration:r.targetDuration,durationList:r.segments,startIndex:o.segmentIndex,endIndex:0}))},t.runStrategies_=function(r,n,a,o){for(var l=[],u=0;u<yT.length;u++){var c=yT[u],h=c.run(this,r,n,a,o);h&&(h.strategy=c.name,l.push({strategy:c.name,syncPoint:h}))}return l},t.selectSyncPoint_=function(r,n){for(var a=r[0].syncPoint,o=Math.abs(r[0].syncPoint[n.key]-n.value),l=r[0].strategy,u=1;u<r.length;u++){var c=Math.abs(r[u].syncPoint[n.key]-n.value);c<o&&(o=c,a=r[u].syncPoint,l=r[u].strategy)}return this.logger_("syncPoint for ["+n.key+": "+n.value+"] chosen with strategy"+(" ["+l+"]: [time:"+a.time+",")+(" segmentIndex:"+a.segmentIndex)+(typeof a.partIndex=="number"?",partIndex:"+a.partIndex:"")+"]"),a},t.saveExpiredSegmentInfo=function(r,n){var a=n.mediaSequence-r.mediaSequence;if(a>i3){re.log.warn("Not saving expired segment info. Media sequence gap "+a+" is too large.");return}for(var o=a-1;o>=0;o--){var l=r.segments[o];if(l&&typeof l.start<"u"){n.syncInfo={mediaSequence:r.mediaSequence+o,time:l.start},this.logger_("playlist refresh sync: [time:"+n.syncInfo.time+","+(" mediaSequence: "+n.syncInfo.mediaSequence+"]")),this.trigger("syncinfoupdate");break}}},t.setDateTimeMappingForStart=function(r){if(this.timelineToDatetimeMappings={},r.segments&&r.segments.length&&r.segments[0].dateTimeObject){var n=r.segments[0],a=n.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[n.timeline]=-a}},t.saveSegmentTimingInfo=function(r){var n=r.segmentInfo,a=r.shouldSaveTimelineMapping,o=this.calculateSegmentTimeMapping_(n,n.timingInfo,a),l=n.segment;o&&(this.saveDiscontinuitySyncInfo_(n),n.playlist.syncInfo||(n.playlist.syncInfo={mediaSequence:n.playlist.mediaSequence+n.mediaIndex,time:l.start}));var u=l.dateTimeObject;l.discontinuity&&a&&u&&(this.timelineToDatetimeMappings[l.timeline]=-(u.getTime()/1e3))},t.timestampOffsetForTimeline=function(r){return typeof this.timelines[r]>"u"?null:this.timelines[r].time},t.mappingForTimeline=function(r){return typeof this.timelines[r]>"u"?null:this.timelines[r].mapping},t.calculateSegmentTimeMapping_=function(r,n,a){var o=r.segment,l=r.part,u=this.timelines[r.timeline],c,h;if(typeof r.timestampOffset=="number")u={time:r.startOfSegment,mapping:r.startOfSegment-n.start},a&&(this.timelines[r.timeline]=u,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+r.timeline+": "+("[time: "+u.time+"] [mapping: "+u.mapping+"]"))),c=r.startOfSegment,h=n.end+u.mapping;else if(u)c=n.start+u.mapping,h=n.end+u.mapping;else return!1;return l&&(l.start=c,l.end=h),(!o.start||c<o.start)&&(o.start=c),o.end=h,!0},t.saveDiscontinuitySyncInfo_=function(r){var n=r.playlist,a=r.segment;if(a.discontinuity)this.discontinuities[a.timeline]={time:a.start,accuracy:0};else if(n.discontinuityStarts&&n.discontinuityStarts.length)for(var o=0;o<n.discontinuityStarts.length;o++){var l=n.discontinuityStarts[o],u=n.discontinuitySequence+o+1,c=l-r.mediaIndex,h=Math.abs(c);if(!this.discontinuities[u]||this.discontinuities[u].accuracy>h){var f=void 0;c<0?f=a.start-Al({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:r.mediaIndex,endIndex:l}):f=a.end+Al({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:r.mediaIndex+1,endIndex:l}),this.discontinuities[u]={time:f,accuracy:h}}}},t.dispose=function(){this.trigger("dispose"),this.off()},e})(re.EventTarget),n3=(function(s){we(e,s);function e(){var i;return i=s.call(this)||this,i.pendingTimelineChanges_={},i.lastTimelineChanges_={},i}var t=e.prototype;return t.clearPendingTimelineChange=function(r){this.pendingTimelineChanges_[r]=null,this.trigger("pendingtimelinechange")},t.pendingTimelineChange=function(r){var n=r.type,a=r.from,o=r.to;return typeof a=="number"&&typeof o=="number"&&(this.pendingTimelineChanges_[n]={type:n,from:a,to:o},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[n]},t.lastTimelineChange=function(r){var n=r.type,a=r.from,o=r.to;return typeof a=="number"&&typeof o=="number"&&(this.lastTimelineChanges_[n]={type:n,from:a,to:o},delete this.pendingTimelineChanges_[n],this.trigger("timelinechange")),this.lastTimelineChanges_[n]},t.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},e})(re.EventTarget),s3=EE(wE(function(){var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function e(V,B,O){return O={path:B,exports:{},require:function(U,w){return t(U,w??O.path)}},V(O,O.exports),O.exports}function t(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var i=e(function(V){function B(M,U){for(var w=0;w<U.length;w++){var P=U[w];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(M,P.key,P)}}function O(M,U,w){return U&&B(M.prototype,U),w&&B(M,w),M}V.exports=O,V.exports.default=V.exports,V.exports.__esModule=!0}),r=e(function(V){function B(O,M){return V.exports=B=Object.setPrototypeOf||function(w,P){return w.__proto__=P,w},V.exports.default=V.exports,V.exports.__esModule=!0,B(O,M)}V.exports=B,V.exports.default=V.exports,V.exports.__esModule=!0}),n=e(function(V){function B(O,M){O.prototype=Object.create(M.prototype),O.prototype.constructor=O,r(O,M)}V.exports=B,V.exports.default=V.exports,V.exports.__esModule=!0}),a=(function(){function V(){this.listeners={}}var B=V.prototype;return B.on=function(M,U){this.listeners[M]||(this.listeners[M]=[]),this.listeners[M].push(U)},B.off=function(M,U){if(!this.listeners[M])return!1;var w=this.listeners[M].indexOf(U);return this.listeners[M]=this.listeners[M].slice(0),this.listeners[M].splice(w,1),w>-1},B.trigger=function(M){var U=this.listeners[M];if(U)if(arguments.length===2)for(var w=U.length,P=0;P<w;++P)U[P].call(this,arguments[1]);else for(var Q=Array.prototype.slice.call(arguments,1),G=U.length,K=0;K<G;++K)U[K].apply(this,Q)},B.dispose=function(){this.listeners={}},B.pipe=function(M){this.on("data",function(U){M.push(U)})},V})();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function o(V){return V.subarray(0,V.byteLength-V[V.byteLength-1])}/*! @name aes-decrypter @version 3.1.3 @license Apache-2.0 */var l=function(){var B=[[[],[],[],[],[]],[[],[],[],[],[]]],O=B[0],M=B[1],U=O[4],w=M[4],P,Q,G,K=[],ce=[],de,pe,ne,se,ue,he;for(P=0;P<256;P++)ce[(K[P]=P<<1^(P>>7)*283)^P]=P;for(Q=G=0;!U[Q];Q^=de||1,G=ce[G]||1)for(se=G^G<<1^G<<2^G<<3^G<<4,se=se>>8^se&255^99,U[Q]=se,w[se]=Q,ne=K[pe=K[de=K[Q]]],he=ne*16843009^pe*65537^de*257^Q*16843008,ue=K[se]*257^se*16843008,P=0;P<4;P++)O[P][Q]=ue=ue<<24^ue>>>8,M[P][se]=he=he<<24^he>>>8;for(P=0;P<5;P++)O[P]=O[P].slice(0),M[P]=M[P].slice(0);return B},u=null,c=(function(){function V(O){u||(u=l()),this._tables=[[u[0][0].slice(),u[0][1].slice(),u[0][2].slice(),u[0][3].slice(),u[0][4].slice()],[u[1][0].slice(),u[1][1].slice(),u[1][2].slice(),u[1][3].slice(),u[1][4].slice()]];var M,U,w,P=this._tables[0][4],Q=this._tables[1],G=O.length,K=1;if(G!==4&&G!==6&&G!==8)throw new Error("Invalid aes key size");var ce=O.slice(0),de=[];for(this._key=[ce,de],M=G;M<4*G+28;M++)w=ce[M-1],(M%G===0||G===8&&M%G===4)&&(w=P[w>>>24]<<24^P[w>>16&255]<<16^P[w>>8&255]<<8^P[w&255],M%G===0&&(w=w<<8^w>>>24^K<<24,K=K<<1^(K>>7)*283)),ce[M]=ce[M-G]^w;for(U=0;M;U++,M--)w=ce[U&3?M:M-4],M<=4||U<4?de[U]=w:de[U]=Q[0][P[w>>>24]]^Q[1][P[w>>16&255]]^Q[2][P[w>>8&255]]^Q[3][P[w&255]]}var B=V.prototype;return B.decrypt=function(M,U,w,P,Q,G){var K=this._key[1],ce=M^K[0],de=P^K[1],pe=w^K[2],ne=U^K[3],se,ue,he,ve=K.length/4-2,Ae,De=4,Me=this._tables[1],Ne=Me[0],Je=Me[1],Re=Me[2],Oe=Me[3],He=Me[4];for(Ae=0;Ae<ve;Ae++)se=Ne[ce>>>24]^Je[de>>16&255]^Re[pe>>8&255]^Oe[ne&255]^K[De],ue=Ne[de>>>24]^Je[pe>>16&255]^Re[ne>>8&255]^Oe[ce&255]^K[De+1],he=Ne[pe>>>24]^Je[ne>>16&255]^Re[ce>>8&255]^Oe[de&255]^K[De+2],ne=Ne[ne>>>24]^Je[ce>>16&255]^Re[de>>8&255]^Oe[pe&255]^K[De+3],De+=4,ce=se,de=ue,pe=he;for(Ae=0;Ae<4;Ae++)Q[(3&-Ae)+G]=He[ce>>>24]<<24^He[de>>16&255]<<16^He[pe>>8&255]<<8^He[ne&255]^K[De++],se=ce,ce=de,de=pe,pe=ne,ne=se},V})(),h=(function(V){n(B,V);function B(){var M;return M=V.call(this,a)||this,M.jobs=[],M.delay=1,M.timeout_=null,M}var O=B.prototype;return O.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},O.push=function(U){this.jobs.push(U),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},B})(a),f=function(B){return B<<24|(B&65280)<<8|(B&16711680)>>8|B>>>24},g=function(B,O,M){var U=new Int32Array(B.buffer,B.byteOffset,B.byteLength>>2),w=new c(Array.prototype.slice.call(O)),P=new Uint8Array(B.byteLength),Q=new Int32Array(P.buffer),G,K,ce,de,pe,ne,se,ue,he;for(G=M[0],K=M[1],ce=M[2],de=M[3],he=0;he<U.length;he+=4)pe=f(U[he]),ne=f(U[he+1]),se=f(U[he+2]),ue=f(U[he+3]),w.decrypt(pe,ne,se,ue,Q,he),Q[he]=f(Q[he]^G),Q[he+1]=f(Q[he+1]^K),Q[he+2]=f(Q[he+2]^ce),Q[he+3]=f(Q[he+3]^de),G=pe,K=ne,ce=se,de=ue;return P},C=(function(){function V(O,M,U,w){var P=V.STEP,Q=new Int32Array(O.buffer),G=new Uint8Array(O.byteLength),K=0;for(this.asyncStream_=new h,this.asyncStream_.push(this.decryptChunk_(Q.subarray(K,K+P),M,U,G)),K=P;K<Q.length;K+=P)U=new Uint32Array([f(Q[K-4]),f(Q[K-3]),f(Q[K-2]),f(Q[K-1])]),this.asyncStream_.push(this.decryptChunk_(Q.subarray(K,K+P),M,U,G));this.asyncStream_.push(function(){w(null,o(G))})}var B=V.prototype;return B.decryptChunk_=function(M,U,w,P){return function(){var Q=g(M,U,w);P.set(Q,M.byteOffset)}},i(V,null,[{key:"STEP",get:function(){return 32e3}}]),V})(),p;typeof window<"u"?p=window:typeof s<"u"?p=s:typeof self<"u"?p=self:p={};var b=p,I=function(B){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(B):B&&B.buffer instanceof ArrayBuffer},L=b.BigInt||Number;L("0x1"),L("0x100"),L("0x10000"),L("0x1000000"),L("0x100000000"),L("0x10000000000"),L("0x1000000000000"),L("0x100000000000000"),L("0x10000000000000000");var F=function(B){var O={};return Object.keys(B).forEach(function(M){var U=B[M];I(U)?O[M]={bytes:U.buffer,byteOffset:U.byteOffset,byteLength:U.byteLength}:O[M]=U}),O};self.onmessage=function(V){var B=V.data,O=new Uint8Array(B.encrypted.bytes,B.encrypted.byteOffset,B.encrypted.byteLength),M=new Uint32Array(B.key.bytes,B.key.byteOffset,B.key.byteLength/4),U=new Uint32Array(B.iv.bytes,B.iv.byteOffset,B.iv.byteLength/4);new C(O,M,U,function(w,P){self.postMessage(F({source:B.source,decrypted:P}),[P.buffer])})}})),a3=CE(s3),o3=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},uh=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},pm=function(e,t){t.activePlaylistLoader=e,e.load()},l3=function(e,t){return function(){var i=t.segmentLoaders,r=i[e],n=i.main,a=t.mediaTypes[e],o=a.activeTrack(),l=a.getActiveGroup(),u=a.activePlaylistLoader,c=a.lastGroup_;if(!(l&&c&&l.id===c.id)&&(a.lastGroup_=l,a.lastTrack_=o,uh(r,a),!(!l||l.isMasterPlaylist))){if(!l.playlistLoader){u&&n.resetEverything();return}r.resyncLoader(),pm(l.playlistLoader,a)}}},u3=function(e,t){return function(){var i=t.segmentLoaders[e],r=t.mediaTypes[e];r.lastGroup_=null,i.abort(),i.pause()}},c3=function(e,t){return function(){var i=t.masterPlaylistLoader,r=t.segmentLoaders,n=r[e],a=r.main,o=t.mediaTypes[e],l=o.activeTrack(),u=o.getActiveGroup(),c=o.activePlaylistLoader,h=o.lastTrack_;if(!(h&&l&&h.id===l.id)&&(o.lastGroup_=u,o.lastTrack_=l,uh(n,o),!!u)){if(u.isMasterPlaylist){if(!l||!h||l.id===h.id)return;var f=t.vhs.masterPlaylistController_,g=f.selectPlaylist();if(f.media()===g)return;o.logger_("track change. Switching master audio from "+h.id+" to "+l.id),i.pause(),a.resetEverything(),f.fastQualityChange_(g);return}if(e==="AUDIO"){if(!u.playlistLoader){a.setAudio(!0),a.resetEverything();return}n.setAudio(!0),a.setAudio(!1)}if(c===u.playlistLoader){pm(u.playlistLoader,o);return}n.track&&n.track(l),n.resetEverything(),pm(u.playlistLoader,o)}}},ch={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],r=t.mediaTypes[e],n=t.blacklistCurrentPlaylist;uh(i,r);var a=r.activeTrack(),o=r.activeGroup(),l=(o.filter(function(h){return h.default})[0]||o[0]).id,u=r.tracks[l];if(a===u){n({message:"Problem encountered loading the default audio track."});return}re.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(var c in r.tracks)r.tracks[c].enabled=r.tracks[c]===u;r.onTrackChanged()}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],r=t.mediaTypes[e];re.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),uh(i,r);var n=r.activeTrack();n&&(n.mode="disabled"),r.onTrackChanged()}}},_T={AUDIO:function(e,t,i){if(t){var r=i.tech,n=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",function(){var o=t.media();a.playlist(o,n),(!r.paused()||o.endList&&r.preload()!=="none")&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),n),r.paused()||a.load()}),t.on("error",ch[e](e,i))}},SUBTITLES:function(e,t,i){var r=i.tech,n=i.requestOptions,a=i.segmentLoaders[e],o=i.mediaTypes[e];t.on("loadedmetadata",function(){var l=t.media();a.playlist(l,n),a.track(o.activeTrack()),(!r.paused()||l.endList&&r.preload()!=="none")&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),n),r.paused()||a.load()}),t.on("error",ch[e](e,i))}},h3={AUDIO:function(e,t){var i=t.vhs,r=t.sourceType,n=t.segmentLoaders[e],a=t.requestOptions,o=t.master.mediaGroups,l=t.mediaTypes[e],u=l.groups,c=l.tracks,h=l.logger_,f=t.masterPlaylistLoader,g=su(f.master);(!o[e]||Object.keys(o[e]).length===0)&&(o[e]={main:{default:{default:!0}}},g&&(o[e].main.default.playlists=f.master.playlists));for(var C in o[e]){u[C]||(u[C]=[]);for(var p in o[e][C]){var b=o[e][C][p],I=void 0;if(g?(h("AUDIO group '"+C+"' label '"+p+"' is a master playlist"),b.isMasterPlaylist=!0,I=null):r==="vhs-json"&&b.playlists?I=new $a(b.playlists[0],i,a):b.resolvedUri?I=new $a(b.resolvedUri,i,a):b.playlists&&r==="dash"?I=new cm(b.playlists[0],i,a,f):I=null,b=re.mergeOptions({id:p,playlistLoader:I},b),_T[e](e,b.playlistLoader,t),u[C].push(b),typeof c[p]>"u"){var L=new re.AudioTrack({id:p,kind:o3(b),enabled:!1,language:b.language,default:b.default,label:p});c[p]=L}}}n.on("error",ch[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,r=t.vhs,n=t.sourceType,a=t.segmentLoaders[e],o=t.requestOptions,l=t.master.mediaGroups,u=t.mediaTypes[e],c=u.groups,h=u.tracks,f=t.masterPlaylistLoader;for(var g in l[e]){c[g]||(c[g]=[]);for(var C in l[e][g])if(!l[e][g][C].forced){var p=l[e][g][C],b=void 0;if(n==="hls")b=new $a(p.resolvedUri,r,o);else if(n==="dash"){var I=p.playlists.filter(function(F){return F.excludeUntil!==1/0});if(!I.length)return;b=new cm(p.playlists[0],r,o,f)}else n==="vhs-json"&&(b=new $a(p.playlists?p.playlists[0]:p.resolvedUri,r,o));if(p=re.mergeOptions({id:C,playlistLoader:b},p),_T[e](e,p.playlistLoader,t),c[g].push(p),typeof h[C]>"u"){var L=i.addRemoteTextTrack({id:C,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:C},!1).track;h[C]=L}}}a.on("error",ch[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,r=t.master.mediaGroups,n=t.mediaTypes[e],a=n.groups,o=n.tracks;for(var l in r[e]){a[l]||(a[l]=[]);for(var u in r[e][l]){var c=r[e][l][u];if(/^(?:CC|SERVICE)/.test(c.instreamId)){var h=i.options_.vhs&&i.options_.vhs.captionServices||{},f={label:u,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(h[f.instreamId]&&(f=re.mergeOptions(f,h[f.instreamId])),f.default===void 0&&delete f.default,a[l].push(re.mergeOptions({id:u},c)),typeof o[u]>"u"){var g=i.addRemoteTextTrack({id:f.instreamId,kind:"captions",default:f.default,language:f.language,label:f.label},!1).track;o[u]=g}}}}}},d3=function s(e,t){for(var i=0;i<e.length;i++)if(Yg(t,e[i])||e[i].playlists&&s(e[i].playlists,t))return!0;return!1},f3=function(e,t){return function(i){var r=t.masterPlaylistLoader,n=t.mediaTypes[e].groups,a=r.media();if(!a)return null;var o=null;a.attributes[e]&&(o=n[a.attributes[e]]);var l=Object.keys(n);if(!o)if(e==="AUDIO"&&l.length>1&&su(t.master))for(var u=0;u<l.length;u++){var c=n[l[u]];if(d3(c,a)){o=c;break}}else n.main?o=n.main:l.length===1&&(o=n[l[0]]);return typeof i>"u"?o:i===null||!o?null:o.filter(function(h){return h.id===i.id})[0]||null}},p3={AUDIO:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var r in i)if(i[r].enabled)return i[r];return null}},SUBTITLES:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var r in i)if(i[r].mode==="showing"||i[r].mode==="hidden")return i[r];return null}}},m3=function(e,t){var i=t.mediaTypes;return function(){var r=i[e].activeTrack();return r?i[e].activeGroup(r):null}},g3=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(C){h3[C](C,e)});var t=e.mediaTypes,i=e.masterPlaylistLoader,r=e.tech,n=e.vhs,a=e.segmentLoaders,o=a.AUDIO,l=a.main;["AUDIO","SUBTITLES"].forEach(function(C){t[C].activeGroup=f3(C,e),t[C].activeTrack=p3[C](C,e),t[C].onGroupChanged=l3(C,e),t[C].onGroupChanging=u3(C,e),t[C].onTrackChanged=c3(C,e),t[C].getActiveGroup=m3(C,e)});var u=t.AUDIO.activeGroup();if(u){var c=(u.filter(function(C){return C.default})[0]||u[0]).id;t.AUDIO.tracks[c].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged();var h=t.AUDIO.getActiveGroup();h.playlistLoader?(l.setAudio(!1),o.setAudio(!0)):l.setAudio(!0)}i.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(C){return t[C].onGroupChanged()})}),i.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(C){return t[C].onGroupChanging()})});var f=function(){t.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"}),r.trigger({type:"usage",name:"hls-audio-change"})};r.audioTracks().addEventListener("change",f),r.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),n.on("dispose",function(){r.audioTracks().removeEventListener("change",f),r.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),r.clearTracks("audio");for(var g in t.AUDIO.tracks)r.audioTracks().addTrack(t.AUDIO.tracks[g])},v3=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:yn,activeTrack:yn,getActiveGroup:yn,onGroupChanged:yn,onTrackChanged:yn,lastTrack_:null,logger_:Pr("MediaGroups["+t+"]")}}),e},y3=120,fn,_3=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],T3=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},b3=function(e){var t=e.currentPlaylist,i=e.buffered,r=e.currentTime,n=e.nextPlaylist,a=e.bufferLowWaterLine,o=e.bufferHighWaterLine,l=e.duration,u=e.experimentalBufferBasedABR,c=e.log;if(!n)return re.log.warn("We received no playlist to switch to. Please check your stream."),!1;var h="allowing switch "+(t&&t.id||"null")+" -> "+n.id;if(!t)return c(h+" as current playlist is not set"),!0;if(n.id===t.id)return!1;var f=!!Ua(i,r).length;if(!t.endList)return!f&&typeof t.partTargetDuration=="number"?(c("not "+h+" as current playlist is live llhls, but currentTime isn't in buffered."),!1):(c(h+" as current playlist is live"),!0);var g=Kg(i,r),C=u?ti.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ti.MAX_BUFFER_LOW_WATER_LINE;if(l<C)return c(h+" as duration < max low water line ("+l+" < "+C+")"),!0;var p=n.attributes.BANDWIDTH,b=t.attributes.BANDWIDTH;if(p<b&&(!u||g<o)){var I=h+" as next bandwidth < current bandwidth ("+p+" < "+b+")";return u&&(I+=" and forwardBuffer < bufferHighWaterLine ("+g+" < "+o+")"),c(I),!0}if((!u||p>b)&&g>=a){var L=h+" as forwardBuffer >= bufferLowWaterLine ("+g+" >= "+a+")";return u&&(L+=" and next bandwidth > current bandwidth ("+p+" > "+b+")"),c(L),!0}return c("not "+h+" as no switching criteria met"),!1},S3=(function(s){we(e,s);function e(i){var r;r=s.call(this)||this;var n=i.src,a=i.handleManifestRedirects,o=i.withCredentials,l=i.tech,u=i.bandwidth,c=i.externVhs,h=i.useCueTags,f=i.blacklistDuration,g=i.enableLowInitialPlaylist,C=i.sourceType,p=i.cacheEncryptionKeys,b=i.experimentalBufferBasedABR,I=i.experimentalLeastPixelDiffSelector,L=i.captionServices;if(!n)throw new Error("A non-empty playlist URL or JSON manifest string is required");var F=i.maxPlaylistRetries;(F===null||typeof F>"u")&&(F=1/0),fn=c,r.experimentalBufferBasedABR=!!b,r.experimentalLeastPixelDiffSelector=!!I,r.withCredentials=o,r.tech_=l,r.vhs_=l.vhs,r.sourceType_=C,r.useCueTags_=h,r.blacklistDuration=f,r.maxPlaylistRetries=F,r.enableLowInitialPlaylist=g,r.useCueTags_&&(r.cueTagsTrack_=r.tech_.addTextTrack("metadata","ad-cues"),r.cueTagsTrack_.inBandMetadataTrackDispatchType=""),r.requestOptions_={withCredentials:o,handleManifestRedirects:a,maxPlaylistRetries:F,timeout:null},r.on("error",r.pauseLoading),r.mediaTypes_=v3(),r.mediaSource=new D.MediaSource,r.handleDurationChange_=r.handleDurationChange_.bind(We(r)),r.handleSourceOpen_=r.handleSourceOpen_.bind(We(r)),r.handleSourceEnded_=r.handleSourceEnded_.bind(We(r)),r.mediaSource.addEventListener("durationchange",r.handleDurationChange_),r.mediaSource.addEventListener("sourceopen",r.handleSourceOpen_),r.mediaSource.addEventListener("sourceended",r.handleSourceEnded_),r.seekable_=re.createTimeRanges(),r.hasPlayed_=!1,r.syncController_=new r3(i),r.segmentMetadataTrack_=l.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,r.decrypter_=new a3,r.sourceUpdater_=new FE(r.mediaSource),r.inbandTextTracks_={},r.timelineChangeController_=new n3;var V={vhs:r.vhs_,parse708captions:i.parse708captions,useDtsForTimestampOffset:i.useDtsForTimestampOffset,captionServices:L,mediaSource:r.mediaSource,currentTime:r.tech_.currentTime.bind(r.tech_),seekable:function(){return r.seekable()},seeking:function(){return r.tech_.seeking()},duration:function(){return r.duration()},hasPlayed:function(){return r.hasPlayed_},goalBufferLength:function(){return r.goalBufferLength()},bandwidth:u,syncController:r.syncController_,decrypter:r.decrypter_,sourceType:r.sourceType_,inbandTextTracks:r.inbandTextTracks_,cacheEncryptionKeys:p,sourceUpdater:r.sourceUpdater_,timelineChangeController:r.timelineChangeController_,experimentalExactManifestTimings:i.experimentalExactManifestTimings};r.masterPlaylistLoader_=r.sourceType_==="dash"?new cm(n,r.vhs_,r.requestOptions_):new $a(n,r.vhs_,r.requestOptions_),r.setupMasterPlaylistLoaderListeners_(),r.mainSegmentLoader_=new dm(re.mergeOptions(V,{segmentMetadataTrack:r.segmentMetadataTrack_,loaderType:"main"}),i),r.audioSegmentLoader_=new dm(re.mergeOptions(V,{loaderType:"audio"}),i),r.subtitleSegmentLoader_=new Z4(re.mergeOptions(V,{loaderType:"vtt",featuresNativeTextTracks:r.tech_.featuresNativeTextTracks,loadVttJs:function(){return new Promise(function(M,U){function w(){l.off("vttjserror",P),M()}function P(){l.off("vttjsloaded",w),U()}l.one("vttjsloaded",w),l.one("vttjserror",P),l.addWebVttScript_()})}}),i),r.setupSegmentLoaderListeners_(),r.experimentalBufferBasedABR&&(r.masterPlaylistLoader_.one("loadedplaylist",function(){return r.startABRTimer_()}),r.tech_.on("pause",function(){return r.stopABRTimer_()}),r.tech_.on("play",function(){return r.startABRTimer_()})),_3.forEach(function(O){r[O+"_"]=T3.bind(We(r),O)}),r.logger_=Pr("MPC"),r.triggeredFmp4Usage=!1,r.tech_.preload()==="none"?(r.loadOnPlay_=function(){r.loadOnPlay_=null,r.masterPlaylistLoader_.load()},r.tech_.one("play",r.loadOnPlay_)):r.masterPlaylistLoader_.load(),r.timeToLoadedData__=-1,r.mainAppendsToLoadedData__=-1,r.audioAppendsToLoadedData__=-1;var B=r.tech_.preload()==="none"?"play":"loadstart";return r.tech_.one(B,function(){var O=Date.now();r.tech_.one("loadeddata",function(){r.timeToLoadedData__=Date.now()-O,r.mainAppendsToLoadedData__=r.mainSegmentLoader_.mediaAppends,r.audioAppendsToLoadedData__=r.audioSegmentLoader_.mediaAppends})}),r}var t=e.prototype;return t.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},t.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},t.appendsToLoadedData_=function(){var r=this.mainAppendsToLoadedData_(),n=this.audioAppendsToLoadedData_();return r===-1||n===-1?-1:r+n},t.timeToLoadedData_=function(){return this.timeToLoadedData__},t.checkABR_=function(r){r===void 0&&(r="abr");var n=this.selectPlaylist();n&&this.shouldSwitchToMedia_(n)&&this.switchMedia_(n,r)},t.switchMedia_=function(r,n,a){var o=this.media(),l=o&&(o.id||o.uri),u=r.id||r.uri;l&&l!==u&&(this.logger_("switch media "+l+" -> "+u+" from "+n),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+n})),this.masterPlaylistLoader_.media(r,a)},t.startABRTimer_=function(){var r=this;this.stopABRTimer_(),this.abrTimer_=D.setInterval(function(){return r.checkABR_()},250)},t.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(D.clearInterval(this.abrTimer_),this.abrTimer_=null)},t.getAudioTrackPlaylists_=function(){var r=this.master(),n=r&&r.playlists||[];if(!r||!r.mediaGroups||!r.mediaGroups.AUDIO)return n;var a=r.mediaGroups.AUDIO,o=Object.keys(a),l;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)l=this.mediaTypes_.AUDIO.activeTrack();else{var u=a.main||o.length&&a[o[0]];for(var c in u)if(u[c].default){l={label:c};break}}if(!l)return n;var h=[];for(var f in a)if(a[f][l.label]){var g=a[f][l.label];if(g.playlists&&g.playlists.length)h.push.apply(h,g.playlists);else if(g.uri)h.push(g);else if(r.playlists.length)for(var C=0;C<r.playlists.length;C++){var p=r.playlists[C];p.attributes&&p.attributes.AUDIO&&p.attributes.AUDIO===f&&h.push(p)}}return h.length?h:n},t.setupMasterPlaylistLoaderListeners_=function(){var r=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var n=r.masterPlaylistLoader_.media(),a=n.targetDuration*1.5*1e3;sm(r.masterPlaylistLoader_.master,r.masterPlaylistLoader_.media())?r.requestOptions_.timeout=0:r.requestOptions_.timeout=a,n.endList&&r.tech_.preload()!=="none"&&(r.mainSegmentLoader_.playlist(n,r.requestOptions_),r.mainSegmentLoader_.load()),g3({sourceType:r.sourceType_,segmentLoaders:{AUDIO:r.audioSegmentLoader_,SUBTITLES:r.subtitleSegmentLoader_,main:r.mainSegmentLoader_},tech:r.tech_,requestOptions:r.requestOptions_,masterPlaylistLoader:r.masterPlaylistLoader_,vhs:r.vhs_,master:r.master(),mediaTypes:r.mediaTypes_,blacklistCurrentPlaylist:r.blacklistCurrentPlaylist.bind(r)}),r.triggerPresenceUsage_(r.master(),n),r.setupFirstPlay(),!r.mediaTypes_.AUDIO.activePlaylistLoader||r.mediaTypes_.AUDIO.activePlaylistLoader.media()?r.trigger("selectedinitialmedia"):r.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){r.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){r.loadOnPlay_&&r.tech_.off("play",r.loadOnPlay_);var n=r.masterPlaylistLoader_.media();if(!n){r.excludeUnsupportedVariants_();var a;if(r.enableLowInitialPlaylist&&(a=r.selectInitialPlaylist()),a||(a=r.selectPlaylist()),!a||!r.shouldSwitchToMedia_(a))return;r.initialMedia_=a,r.switchMedia_(r.initialMedia_,"initial");var o=r.sourceType_==="vhs-json"&&r.initialMedia_.segments;if(!o)return;n=r.initialMedia_}r.handleUpdatedMediaPlaylist(n)}),this.masterPlaylistLoader_.on("error",function(){r.blacklistCurrentPlaylist(r.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){r.mainSegmentLoader_.abort(),r.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var n=r.masterPlaylistLoader_.media(),a=n.targetDuration*1.5*1e3;sm(r.masterPlaylistLoader_.master,r.masterPlaylistLoader_.media())?r.requestOptions_.timeout=0:r.requestOptions_.timeout=a,r.masterPlaylistLoader_.load(),r.mainSegmentLoader_.playlist(n,r.requestOptions_),r.mainSegmentLoader_.load(),r.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var n=r.masterPlaylistLoader_.media();if(n.lastExcludeReason_!=="playlist-unchanged"){var a=r.stuckAtPlaylistEnd_(n);a&&(r.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),r.tech_.trigger("playliststuck"))}}),this.masterPlaylistLoader_.on("renditiondisabled",function(){r.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),r.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){r.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),r.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})},t.handleUpdatedMediaPlaylist=function(r){this.useCueTags_&&this.updateAdCues_(r),this.mainSegmentLoader_.playlist(r,this.requestOptions_),this.updateDuration(!r.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},t.triggerPresenceUsage_=function(r,n){var a=r.mediaGroups||{},o=!0,l=Object.keys(a.AUDIO);for(var u in a.AUDIO)for(var c in a.AUDIO[u]){var h=a.AUDIO[u][c];h.uri||(o=!1)}o&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(a.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),fn.Playlist.isAes(n)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),l.length&&Object.keys(a.AUDIO[l[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"}))},t.shouldSwitchToMedia_=function(r){var n=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,a=this.tech_.currentTime(),o=this.bufferLowWaterLine(),l=this.bufferHighWaterLine(),u=this.tech_.buffered();return b3({buffered:u,currentTime:a,currentPlaylist:n,nextPlaylist:r,bufferLowWaterLine:o,bufferHighWaterLine:l,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},t.setupSegmentLoaderListeners_=function(){var r=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){r.checkABR_("bandwidthupdate"),r.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",function(){r.experimentalBufferBasedABR&&r.mainSegmentLoader_.load()}),this.experimentalBufferBasedABR||this.mainSegmentLoader_.on("progress",function(){r.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){r.blacklistCurrentPlaylist(r.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){r.error=r.mainSegmentLoader_.error_,r.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){r.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){r.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),r.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){r.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){r.error=r.audioSegmentLoader_.error_,r.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){r.logger_("main segment loader ended"),r.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(a){r.experimentalBufferBasedABR||(r.delegateLoaders_("all",["abort"]),r.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},y3))});var n=function(){if(!r.sourceUpdater_.hasCreatedSourceBuffers())return r.tryToCreateSourceBuffers_();var o=r.getCodecsOrExclude_();o&&r.sourceUpdater_.addOrChangeSourceBuffers(o)};this.mainSegmentLoader_.on("trackinfo",n),this.audioSegmentLoader_.on("trackinfo",n),this.mainSegmentLoader_.on("fmp4",function(){r.triggeredFmp4Usage||(r.tech_.trigger({type:"usage",name:"vhs-fmp4"}),r.tech_.trigger({type:"usage",name:"hls-fmp4"}),r.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){r.triggeredFmp4Usage||(r.tech_.trigger({type:"usage",name:"vhs-fmp4"}),r.tech_.trigger({type:"usage",name:"hls-fmp4"}),r.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){r.logger_("audioSegmentLoader ended"),r.onEndOfStream()})},t.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},t.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},t.smoothQualityChange_=function(r){r===void 0&&(r=this.selectPlaylist()),this.fastQualityChange_(r)},t.fastQualityChange_=function(r){var n=this;if(r===void 0&&(r=this.selectPlaylist()),r===this.masterPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(r,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){re.browser.IE_VERSION||re.browser.IS_EDGE?n.tech_.setCurrentTime(n.tech_.currentTime()+.04):n.tech_.setCurrentTime(n.tech_.currentTime())})},t.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var r=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<r.start(0))return this.tech_.setCurrentTime(r.end(r.length-1))}},t.setupFirstPlay=function(){var r=this,n=this.masterPlaylistLoader_.media();if(!n||this.tech_.paused()||this.hasPlayed_)return!1;if(!n.endList){var a=this.seekable();if(!a.length)return!1;if(re.browser.IE_VERSION&&this.tech_.readyState()===0)return this.tech_.one("loadedmetadata",function(){r.trigger("firstplay"),r.tech_.setCurrentTime(a.end(0)),r.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(a.end(0))}return this.hasPlayed_=!0,this.load(),!0},t.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var r=this.tech_.play();typeof r<"u"&&typeof r.then=="function"&&r.then(null,function(n){})}this.trigger("sourceopen")},t.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var r=this.inbandTextTracks_.metadataTrack_.cues;if(!(!r||!r.length)){var n=this.duration();r[r.length-1].endTime=isNaN(n)||Math.abs(n)===1/0?Number.MAX_VALUE:n}}},t.handleDurationChange_=function(){this.tech_.trigger("durationchange")},t.onEndOfStream=function(){var r=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var n=this.mainSegmentLoader_.getCurrentMediaInfo_();!n||n.hasVideo?r=r&&this.audioSegmentLoader_.ended_:r=this.audioSegmentLoader_.ended_}r&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},t.stuckAtPlaylistEnd_=function(r){var n=this.seekable();if(!n.length)return!1;var a=this.syncController_.getExpiredTime(r,this.duration());if(a===null)return!1;var o=fn.Playlist.playlistEnd(r,a),l=this.tech_.currentTime(),u=this.tech_.buffered();if(!u.length)return o-l<=Gr;var c=u.end(u.length-1);return c-l<=Gr&&o-c<=Gr},t.blacklistCurrentPlaylist=function(r,n){r===void 0&&(r={});var a=r.playlist||this.masterPlaylistLoader_.media();if(n=n||r.blacklistDuration||this.blacklistDuration,!a){this.error=r,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}a.playlistErrors_++;var o=this.masterPlaylistLoader_.master.playlists,l=o.filter(td),u=l.length===1&&l[0]===a;if(o.length===1&&n!==1/0)return re.log.warn("Problem encountered with playlist "+a.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(u);if(u){var c=!1;o.forEach(function(I){if(I!==a){var L=I.excludeUntil;typeof L<"u"&&L!==1/0&&(c=!0,delete I.excludeUntil)}}),c&&(re.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}var h;a.playlistErrors_>this.maxPlaylistRetries?h=1/0:h=Date.now()+n*1e3,a.excludeUntil=h,r.reason&&(a.lastExcludeReason_=r.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var f=this.selectPlaylist();if(!f){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}var g=r.internal?this.logger_:re.log.warn,C=r.message?" "+r.message:"";g((r.internal?"Internal problem":"Problem")+" encountered with playlist "+a.id+"."+(C+" Switching to playlist "+f.id+".")),f.attributes.AUDIO!==a.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),f.attributes.SUBTITLES!==a.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var p=f.targetDuration/2*1e3||5*1e3,b=typeof f.lastRequest=="number"&&Date.now()-f.lastRequest<=p;return this.switchMedia_(f,"exclude",u||b)},t.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},t.delegateLoaders_=function(r,n){var a=this,o=[],l=r==="all";(l||r==="main")&&o.push(this.masterPlaylistLoader_);var u=[];(l||r==="audio")&&u.push("AUDIO"),(l||r==="subtitle")&&(u.push("CLOSED-CAPTIONS"),u.push("SUBTITLES")),u.forEach(function(c){var h=a.mediaTypes_[c]&&a.mediaTypes_[c].activePlaylistLoader;h&&o.push(h)}),["main","audio","subtitle"].forEach(function(c){var h=a[c+"SegmentLoader_"];h&&(r===c||r==="all")&&o.push(h)}),o.forEach(function(c){return n.forEach(function(h){typeof c[h]=="function"&&c[h]()})})},t.setCurrentTime=function(r){var n=Ua(this.tech_.buffered(),r);if(!(this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media())||!this.masterPlaylistLoader_.media().segments)return 0;if(n&&n.length)return r;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()),this.load()},t.duration=function(){if(!this.masterPlaylistLoader_)return 0;var r=this.masterPlaylistLoader_.media();return r?r.endList?this.mediaSource?this.mediaSource.duration:fn.Playlist.duration(r):1/0:0},t.seekable=function(){return this.seekable_},t.onSyncInfoUpdate_=function(){var r;if(this.masterPlaylistLoader_){var n=this.masterPlaylistLoader_.media();if(n){var a=this.syncController_.getExpiredTime(n,this.duration());if(a!==null){var o=this.masterPlaylistLoader_.master,l=fn.Playlist.seekable(n,a,fn.Playlist.liveEdgeDelay(o,n));if(l.length!==0&&!(this.mediaTypes_.AUDIO.activePlaylistLoader&&(n=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),a=this.syncController_.getExpiredTime(n,this.duration()),a===null||(r=fn.Playlist.seekable(n,a,fn.Playlist.liveEdgeDelay(o,n)),r.length===0)))){var u,c;this.seekable_&&this.seekable_.length&&(u=this.seekable_.end(0),c=this.seekable_.start(0)),r?r.start(0)>l.end(0)||l.start(0)>r.end(0)?this.seekable_=l:this.seekable_=re.createTimeRanges([[r.start(0)>l.start(0)?r.start(0):l.start(0),r.end(0)<l.end(0)?r.end(0):l.end(0)]]):this.seekable_=l,!(this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===u&&this.seekable_.start(0)===c)&&(this.logger_("seekable updated ["+tE(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},t.updateDuration=function(r){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,r),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(r){var n=this.seekable();if(!n.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<n.end(n.length-1))&&this.sourceUpdater_.setDuration(n.end(n.length-1));return}var a=this.tech_.buffered(),o=fn.Playlist.duration(this.masterPlaylistLoader_.media());a.length>0&&(o=Math.max(o,a.end(a.length-1))),this.mediaSource.duration!==o&&this.sourceUpdater_.setDuration(o)},t.dispose=function(){var r=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(n){var a=r.mediaTypes_[n].groups;for(var o in a)a[o].forEach(function(l){l.playlistLoader&&l.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()},t.master=function(){return this.masterPlaylistLoader_.master},t.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},t.areMediaTypesKnown_=function(){var r=!!this.mediaTypes_.AUDIO.activePlaylistLoader,n=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),a=r?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!n||!a)},t.getCodecsOrExclude_=function(){var r=this,n={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},a=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();n.video=n.main;var o=Il(this.master(),a),l={},u=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(n.main.hasVideo&&(l.video=o.video||n.main.videoCodec||yL),n.main.isMuxed&&(l.video+=","+(o.audio||n.main.audioCodec||p_)),(n.main.hasAudio&&!n.main.isMuxed||n.audio.hasAudio||u)&&(l.audio=o.audio||n.main.audioCodec||n.audio.audioCodec||p_,n.audio.isFmp4=n.main.hasAudio&&!n.main.isMuxed?n.main.isFmp4:n.audio.isFmp4),!l.audio&&!l.video){this.blacklistCurrentPlaylist({playlist:a,message:"Could not determine codecs for playlist.",blacklistDuration:1/0});return}var c=function(I,L){return I?gc(L):xf(L)},h={},f;if(["video","audio"].forEach(function(b){if(l.hasOwnProperty(b)&&!c(n[b].isFmp4,l[b])){var I=n[b].isFmp4?"browser":"muxer";h[I]=h[I]||[],h[I].push(l[b]),b==="audio"&&(f=I)}}),u&&f&&a.attributes.AUDIO){var g=a.attributes.AUDIO;this.master().playlists.forEach(function(b){var I=b.attributes&&b.attributes.AUDIO;I===g&&b!==a&&(b.excludeUntil=1/0)}),this.logger_("excluding audio group "+g+" as "+f+' does not support codec(s): "'+l.audio+'"')}if(Object.keys(h).length){var C=Object.keys(h).reduce(function(b,I){return b&&(b+=", "),b+=I+' does not support codec(s): "'+h[I].join(",")+'"',b},"")+".";this.blacklistCurrentPlaylist({playlist:a,internal:!0,message:C,blacklistDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var p=[];if(["video","audio"].forEach(function(b){var I=(Ur(r.sourceUpdater_.codecs[b]||"")[0]||{}).type,L=(Ur(l[b]||"")[0]||{}).type;I&&L&&I.toLowerCase()!==L.toLowerCase()&&p.push('"'+r.sourceUpdater_.codecs[b]+'" -> "'+l[b]+'"')}),p.length){this.blacklistCurrentPlaylist({playlist:a,message:"Codec switching not supported: "+p.join(", ")+".",blacklistDuration:1/0,internal:!0});return}}return l},t.tryToCreateSourceBuffers_=function(){if(!(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers())&&this.areMediaTypesKnown_()){var r=this.getCodecsOrExclude_();if(r){this.sourceUpdater_.createSourceBuffers(r);var n=[r.video,r.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(n)}}},t.excludeUnsupportedVariants_=function(){var r=this,n=this.master().playlists,a=[];Object.keys(n).forEach(function(o){var l=n[o];if(a.indexOf(l.id)===-1){a.push(l.id);var u=Il(r.master,l),c=[];u.audio&&!xf(u.audio)&&!gc(u.audio)&&c.push("audio codec "+u.audio),u.video&&!xf(u.video)&&!gc(u.video)&&c.push("video codec "+u.video),u.text&&u.text==="stpp.ttml.im1t"&&c.push("text codec "+u.text),c.length&&(l.excludeUntil=1/0,r.logger_("excluding "+l.id+" for unsupported: "+c.join(", ")))}})},t.excludeIncompatibleVariants_=function(r){var n=this,a=[],o=this.master().playlists,l=oh(Ur(r)),u=lT(l),c=l.video&&Ur(l.video)[0]||null,h=l.audio&&Ur(l.audio)[0]||null;Object.keys(o).forEach(function(f){var g=o[f];if(!(a.indexOf(g.id)!==-1||g.excludeUntil===1/0)){a.push(g.id);var C=[],p=Il(n.masterPlaylistLoader_.master,g),b=lT(p);if(!(!p.audio&&!p.video)){if(b!==u&&C.push('codec count "'+b+'" !== "'+u+'"'),!n.sourceUpdater_.canChangeType()){var I=p.video&&Ur(p.video)[0]||null,L=p.audio&&Ur(p.audio)[0]||null;I&&c&&I.type.toLowerCase()!==c.type.toLowerCase()&&C.push('video codec "'+I.type+'" !== "'+c.type+'"'),L&&h&&L.type.toLowerCase()!==h.type.toLowerCase()&&C.push('audio codec "'+L.type+'" !== "'+h.type+'"')}C.length&&(g.excludeUntil=1/0,n.logger_("blacklisting "+g.id+": "+C.join(" && ")))}}})},t.updateAdCues_=function(r){var n=0,a=this.seekable();a.length&&(n=a.start(0)),t3(r,this.cueTagsTrack_,n)},t.goalBufferLength=function(){var r=this.tech_.currentTime(),n=ti.GOAL_BUFFER_LENGTH,a=ti.GOAL_BUFFER_LENGTH_RATE,o=Math.max(n,ti.MAX_GOAL_BUFFER_LENGTH);return Math.min(n+r*a,o)},t.bufferLowWaterLine=function(){var r=this.tech_.currentTime(),n=ti.BUFFER_LOW_WATER_LINE,a=ti.BUFFER_LOW_WATER_LINE_RATE,o=Math.max(n,ti.MAX_BUFFER_LOW_WATER_LINE),l=Math.max(n,ti.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(n+r*a,this.experimentalBufferBasedABR?l:o)},t.bufferHighWaterLine=function(){return ti.BUFFER_HIGH_WATER_LINE},e})(re.EventTarget),C3=function(e,t,i){return function(r){var n=e.master.playlists[t],a=Qg(n),o=td(n);return typeof r>"u"?o:(r?delete n.disabled:n.disabled=!0,r!==o&&!a&&(i(),r?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),r)}},E3=function(e,t,i){var r=e.masterPlaylistController_,n=e.options_.smoothQualityChange,a=n?"smooth":"fast",o=r[a+"QualityChange_"].bind(r);if(t.attributes){var l=t.attributes.RESOLUTION;this.width=l&&l.width,this.height=l&&l.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Il(r.master(),t),this.playlist=t,this.id=i,this.enabled=C3(e.playlists,t.id,o)},w3=function(e){e.representations=function(){var t=e.masterPlaylistController_.master(),i=su(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(function(r){return!Qg(r)}).map(function(r,n){return new E3(e,r,r.id)}):[]}},TT=["seeking","seeked","pause","playing","error"],k3=(function(){function s(t){var i=this;this.masterPlaylistController_=t.masterPlaylistController,this.tech_=t.tech,this.seekable=t.seekable,this.allowSeeksWithinUnsafeLiveWindow=t.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=t.liveRangeSafeTimeDelta,this.media=t.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=Pr("PlaybackWatcher"),this.logger_("initialize");var r=function(){return i.monitorCurrentTime_()},n=function(){return i.monitorCurrentTime_()},a=function(){return i.techWaiting_()},o=function(){return i.cancelTimer_()},l=this.masterPlaylistController_,u=["main","subtitle","audio"],c={};u.forEach(function(f){c[f]={reset:function(){return i.resetSegmentDownloads_(f)},updateend:function(){return i.checkSegmentDownloads_(f)}},l[f+"SegmentLoader_"].on("appendsdone",c[f].updateend),l[f+"SegmentLoader_"].on("playlistupdate",c[f].reset),i.tech_.on(["seeked","seeking"],c[f].reset)});var h=function(g){["main","audio"].forEach(function(C){l[C+"SegmentLoader_"][g]("appended",i.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){i.fixesBadSeeks_()&&(i.consecutiveUpdates=0,i.lastRecordedTime=i.tech_.currentTime(),h("off"))},this.clearSeekingAppendCheck_=function(){return h("off")},this.watchForBadSeeking_=function(){i.clearSeekingAppendCheck_(),h("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",a),this.tech_.on(TT,o),this.tech_.on("canplay",n),this.tech_.one("play",r),this.dispose=function(){i.clearSeekingAppendCheck_(),i.logger_("dispose"),i.tech_.off("waiting",a),i.tech_.off(TT,o),i.tech_.off("canplay",n),i.tech_.off("play",r),i.tech_.off("seeking",i.watchForBadSeeking_),i.tech_.off("seeked",i.clearSeekingAppendCheck_),u.forEach(function(f){l[f+"SegmentLoader_"].off("appendsdone",c[f].updateend),l[f+"SegmentLoader_"].off("playlistupdate",c[f].reset),i.tech_.off(["seeked","seeking"],c[f].reset)}),i.checkCurrentTimeTimeout_&&D.clearTimeout(i.checkCurrentTimeTimeout_),i.cancelTimer_()}}var e=s.prototype;return e.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&D.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=D.setTimeout(this.monitorCurrentTime_.bind(this),250)},e.resetSegmentDownloads_=function(i){var r=this.masterPlaylistController_[i+"SegmentLoader_"];this[i+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+i+" loader"),this[i+"StalledDownloads_"]=0,this[i+"Buffered_"]=r.buffered_()},e.checkSegmentDownloads_=function(i){var r=this.masterPlaylistController_,n=r[i+"SegmentLoader_"],a=n.buffered_(),o=vR(this[i+"Buffered_"],a);if(this[i+"Buffered_"]=a,o){this.resetSegmentDownloads_(i);return}this[i+"StalledDownloads_"]++,this.logger_("found #"+this[i+"StalledDownloads_"]+" "+i+" appends that did not increase buffer (possible stalled download)",{playlistId:n.playlist_&&n.playlist_.id,buffered:Ms(a)}),!(this[i+"StalledDownloads_"]<10)&&(this.logger_(i+" loader stalled download exclusion"),this.resetSegmentDownloads_(i),this.tech_.trigger({type:"usage",name:"vhs-"+i+"-download-exclusion"}),i!=="subtitle"&&r.blacklistCurrentPlaylist({message:"Excessive "+i+" segment downloading detected."},1/0))},e.checkCurrentTime_=function(){if(!(this.tech_.paused()||this.tech_.seeking())){var i=this.tech_.currentTime(),r=this.tech_.buffered();if(this.lastRecordedTime===i&&(!r.length||i+Gr>=r.end(r.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&i===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):i===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=i)}},e.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},e.fixesBadSeeks_=function(){var i=this.tech_.seeking();if(!i)return!1;var r=this.seekable(),n=this.tech_.currentTime(),a=this.afterSeekableWindow_(r,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow),o;if(a){var l=r.end(r.length-1);o=l}if(this.beforeSeekableWindow_(r,n)){var u=r.start(0);o=u+(u===r.end(0)?0:Gr)}if(typeof o<"u")return this.logger_("Trying to seek outside of seekable at time "+n+" with "+("seekable range "+tE(r)+". Seeking to ")+(o+".")),this.tech_.setCurrentTime(o),!0;for(var c=this.masterPlaylistController_.sourceUpdater_,h=this.tech_.buffered(),f=c.audioBuffer?c.audioBuffered():null,g=c.videoBuffer?c.videoBuffered():null,C=this.media(),p=C.partTargetDuration?C.partTargetDuration:(C.targetDuration-rs)*2,b=[f,g],I=0;I<b.length;I++)if(b[I]){var L=Kg(b[I],n);if(L<p)return!1}var F=ec(h,n);return F.length===0?!1:(o=F.start(0)+Gr,this.logger_("Buffered region starts ("+F.start(0)+") "+(" just beyond seek point ("+n+"). Seeking to "+o+".")),this.tech_.setCurrentTime(o),!0)},e.waiting_=function(){if(!this.techWaiting_()){var i=this.tech_.currentTime(),r=this.tech_.buffered(),n=Ua(r,i);if(n.length&&i+3<=n.end(0)){this.cancelTimer_(),this.tech_.setCurrentTime(i),this.logger_("Stopped at "+i+" 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"}),this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"});return}}},e.techWaiting_=function(){var i=this.seekable(),r=this.tech_.currentTime();if(this.tech_.seeking()||this.timer_!==null)return!0;if(this.beforeSeekableWindow_(i,r)){var n=i.end(i.length-1);return this.logger_("Fell out of live window at time "+r+". 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 a=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered(),l=this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.videoBuffered(),currentTime:r});if(l)return this.cancelTimer_(),this.tech_.setCurrentTime(r),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var u=ec(o,r);if(u.length>0){var c=u.start(0)-r;return this.logger_("Stopped at "+r+", setting timer for "+c+", seeking "+("to "+u.start(0))),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),c*1e3,r),!0}return!1},e.afterSeekableWindow_=function(i,r,n,a){if(a===void 0&&(a=!1),!i.length)return!1;var o=i.end(i.length-1)+Gr,l=!n.endList;return l&&a&&(o=i.end(i.length-1)+n.targetDuration*3),r>o},e.beforeSeekableWindow_=function(i,r){return!!(i.length&&i.start(0)>0&&r<i.start(0)-this.liveRangeSafeTimeDelta)},e.videoUnderflow_=function(i){var r=i.videoBuffered,n=i.audioBuffered,a=i.currentTime;if(r){var o;if(r.length&&n.length){var l=Ua(r,a-3),u=Ua(r,a),c=Ua(n,a);c.length&&!u.length&&l.length&&(o={start:l.end(0),end:c.end(0)})}else{var h=ec(r,a);h.length||(o=this.gapFromVideoUnderflow_(r,a))}return o?(this.logger_("Encountered a gap in video from "+o.start+" to "+o.end+". "+("Seeking to current time "+a)),!0):!1}},e.skipTheGap_=function(i){var r=this.tech_.buffered(),n=this.tech_.currentTime(),a=ec(r,n);this.cancelTimer_(),!(a.length===0||n!==i)&&(this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",i,"nextRange start:",a.start(0)),this.tech_.setCurrentTime(a.start(0)+rs),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},e.gapFromVideoUnderflow_=function(i,r){for(var n=pR(i),a=0;a<n.length;a++){var o=n.start(a),l=n.end(a);if(r-o<4&&r-o>2)return{start:o,end:l}}return null},s})(),x3={errorInterval:30,getSource:function(e){var t=this.tech({IWillNotUseThisInPlugins:!0}),i=t.currentSource_||this.currentSource();return e(i)}},A3=function s(e,t){var i=0,r=0,n=re.mergeOptions(x3,t);e.ready(function(){e.trigger({type:"usage",name:"vhs-error-reload-initialized"}),e.trigger({type:"usage",name:"hls-error-reload-initialized"})});var a=function(){r&&e.currentTime(r)},o=function(f){f!=null&&(r=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",a),e.src(f),e.trigger({type:"usage",name:"vhs-error-reload"}),e.trigger({type:"usage",name:"hls-error-reload"}),e.play())},l=function(){if(Date.now()-i<n.errorInterval*1e3){e.trigger({type:"usage",name:"vhs-error-reload-canceled"}),e.trigger({type:"usage",name:"hls-error-reload-canceled"});return}if(!n.getSource||typeof n.getSource!="function"){re.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return i=Date.now(),n.getSource.call(e,o)},u=function h(){e.off("loadedmetadata",a),e.off("error",l),e.off("dispose",h)},c=function(f){u(),s(e,f)};e.on("error",l),e.on("dispose",u),e.reloadSourceOnError=c},I3=function(e){A3(this,e)},UE="2.16.3",P3="6.0.1",D3="0.22.1",N3="4.8.0",L3="3.1.3",ui={PlaylistLoader:$a,Playlist:ji,utils:VR,STANDARD_PLAYLIST_SELECTOR:cT,INITIAL_PLAYLIST_SELECTOR:D4,lastBandwidthSelector:cT,movingAverageBandwidthSelector:I4,comparePlaylistBandwidth:ev,comparePlaylistResolution:A4,xhr:gE()};Object.keys(ti).forEach(function(s){Object.defineProperty(ui,s,{get:function(){return re.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),ti[s]},set:function(t){if(re.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),typeof t!="number"||t<0){re.log.warn("value of Vhs."+s+" must be greater than or equal to 0");return}ti[s]=t}})});var $E="videojs-vhs",jE=function(e,t){for(var i=t.media(),r=-1,n=0;n<e.length;n++)if(e[n].id===i.id){r=n;break}e.selectedIndex_=r,e.trigger({selectedIndex:r,type:"change"})},O3=function(e,t){t.representations().forEach(function(i){e.addQualityLevel(i)}),jE(e,t.playlists)};ui.canPlaySource=function(){return re.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var M3=function(e,t,i){if(!e)return e;var r={};t&&t.attributes&&t.attributes.CODECS&&(r=oh(Ur(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(r.audio=i.attributes.CODECS);var n=Bl(r.video),a=Bl(r.audio),o={};for(var l in e)o[l]={},a&&(o[l].audioContentType=a),n&&(o[l].videoContentType=n),t.contentProtection&&t.contentProtection[l]&&t.contentProtection[l].pssh&&(o[l].pssh=t.contentProtection[l].pssh),typeof e[l]=="string"&&(o[l].url=e[l]);return re.mergeOptions(e,o)},R3=function(e,t){return e.reduce(function(i,r){if(!r.contentProtection)return i;var n=t.reduce(function(a,o){var l=r.contentProtection[o];return l&&l.pssh&&(a[o]={pssh:l.pssh}),a},{});return Object.keys(n).length&&i.push(n),i},[])},B3=function(e){var t=e.player,i=e.sourceKeySystems,r=e.audioMedia,n=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var a=r?n.concat([r]):n,o=R3(a,Object.keys(i)),l=[],u=[];return o.forEach(function(c){u.push(new Promise(function(h,f){t.tech_.one("keysessioncreated",h)})),l.push(new Promise(function(h,f){t.eme.initializeMediaKeys({keySystems:c},function(g){if(g){f(g);return}h()})}))}),Promise.race([Promise.all(l),Promise.race(u)])},F3=function(e){var t=e.player,i=e.sourceKeySystems,r=e.media,n=e.audioMedia,a=M3(i,r,n);return a?(t.currentSource().keySystems=a,a&&!t.eme?(re.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},VE=function(){if(!D.localStorage)return null;var e=D.localStorage.getItem($E);if(!e)return null;try{return JSON.parse(e)}catch{return null}},U3=function(e){if(!D.localStorage)return!1;var t=VE();t=t?re.mergeOptions(t,e):e;try{D.localStorage.setItem($E,JSON.stringify(t))}catch{return!1}return t},$3=function(e){return e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(e.substring(e.indexOf(",")+1)):e};ui.supportsNativeHls=(function(){if(!le||!le.createElement)return!1;var s=le.createElement("video");if(!re.getTech("Html5").isSupported())return!1;var e=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return e.some(function(t){return/maybe|probably/i.test(s.canPlayType(t))})})();ui.supportsNativeDash=(function(){return!le||!le.createElement||!re.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(le.createElement("video").canPlayType("application/dash+xml"))})();ui.supportsTypeNatively=function(s){return s==="hls"?ui.supportsNativeHls:s==="dash"?ui.supportsNativeDash:!1};ui.isSupported=function(){return re.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var j3=re.getComponent("Component"),iv=(function(s){we(e,s);function e(i,r,n){var a;if(a=s.call(this,r,re.mergeOptions(n.hls,n.vhs))||this,n.hls&&Object.keys(n.hls).length&&re.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object."),typeof n.initialBandwidth=="number"&&(a.options_.bandwidth=n.initialBandwidth),a.logger_=Pr("VhsHandler"),r.options_&&r.options_.playerId){var o=re(r.options_.playerId);o.hasOwnProperty("hls")||Object.defineProperty(o,"hls",{get:function(){return re.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),r.trigger({type:"usage",name:"hls-player-access"}),We(a)},configurable:!0}),o.hasOwnProperty("vhs")||Object.defineProperty(o,"vhs",{get:function(){return re.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),r.trigger({type:"usage",name:"vhs-player-access"}),We(a)},configurable:!0}),o.hasOwnProperty("dash")||Object.defineProperty(o,"dash",{get:function(){return re.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),We(a)},configurable:!0}),a.player_=o}if(a.tech_=r,a.source_=i,a.stats={},a.ignoreNextSeekingEvent_=!1,a.setOptions_(),a.options_.overrideNative&&r.overrideNativeAudioTracks&&r.overrideNativeVideoTracks)r.overrideNativeAudioTracks(!0),r.overrideNativeVideoTracks(!0);else if(a.options_.overrideNative&&(r.featuresNativeVideoTracks||r.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return a.on(le,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(l){var u=le.fullscreenElement||le.webkitFullscreenElement||le.mozFullScreenElement||le.msFullscreenElement;u&&u.contains(a.tech_.el())?a.masterPlaylistController_.fastQualityChange_():a.masterPlaylistController_.checkABR_()}),a.on(a.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),a.on(a.tech_,"error",function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),a.on(a.tech_,"play",a.play),a}var t=e.prototype;return t.setOptions_=function(){var r=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=this.options_.handleManifestRedirects!==!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?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,typeof this.options_.blacklistDuration!="number"&&(this.options_.blacklistDuration=300),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){var n=VE();n&&n.bandwidth&&(this.options_.bandwidth=n.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),n&&n.throughput&&(this.options_.throughput=n.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=ti.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===ti.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","useDtsForTimestampOffset","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach(function(a){typeof r.source_[a]<"u"&&(r.options_[a]=r.source_[a])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},t.src=function(r,n){var a=this;if(r){this.setOptions_(),this.options_.src=$3(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=ui,this.options_.sourceType=O1(n),this.options_.seekTo=function(u){a.tech_.setCurrentTime(u)},this.options_.smoothQualityChange&&re.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new S3(this.options_);var o=re.mergeOptions({liveRangeSafeTimeDelta:Gr},this.options_,{seekable:function(){return a.seekable()},media:function(){return a.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new k3(o),this.masterPlaylistController_.on("error",function(){var u=re.players[a.tech_.options_.playerId],c=a.masterPlaylistController_.error;typeof c=="object"&&!c.code?c.code=3:typeof c=="string"&&(c={message:c,code:3}),u.error(c)});var l=this.options_.experimentalBufferBasedABR?ui.movingAverageBandwidthSelector(.55):ui.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):l.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(c){this.masterPlaylistController_.selectPlaylist=c.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=c,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var c=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,h=D.navigator.connection||D.navigator.mozConnection||D.navigator.webkitConnection,f=1e7;if(this.options_.useNetworkInformationApi&&h){var g=h.downlink*1e3*1e3;g>=f&&c>=f?c=Math.max(c,g):c=g}return c},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=c,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var c=1/(this.bandwidth||1),h;this.throughput>0?h=1/this.throughput:h=0;var f=Math.floor(1/(c+h));return f},set:function(){re.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 a.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return a.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return a.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return a.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return a.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return a.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return a.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return a.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return a.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return a.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return a.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return Ms(a.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return a.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return a.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return a.tech_.name_},enumerable:!0},duration:{get:function(){return a.tech_.duration()},enumerable:!0},master:{get:function(){return a.playlists.master},enumerable:!0},playerDimensions:{get:function(){return a.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return Ms(a.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return a.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){a.options_.useBandwidthFromLocalStorage&&U3({bandwidth:a.bandwidth,throughput:Math.round(a.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){w3(a)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){a.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.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},t.createKeySessions_=function(){var r=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),B3({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:n&&n.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){r.logger_("created EME key session"),r.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(a){r.logger_("error while creating EME key session",a),r.player_.error({message:"Failed to initialize media keys for EME",code:3})})},t.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},t.setupEme_=function(){var r=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,a=F3({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:n&&n.media()});if(this.player_.tech_.on("keystatuschange",function(o){if(o.status==="output-restricted"){var l=r.masterPlaylistController_.master();if(!(!l||!l.playlists)){var u=[];if(l.playlists.forEach(function(h){h&&h.attributes&&h.attributes.RESOLUTION&&h.attributes.RESOLUTION.height>=720&&(!h.excludeUntil||h.excludeUntil<1/0)&&(h.excludeUntil=1/0,u.push(h))}),u.length){var c;(c=re.log).warn.apply(c,['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(u)),r.masterPlaylistController_.fastQualityChange_()}}}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),re.browser.IE_VERSION===11||!a){this.masterPlaylistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()},t.setupQualityLevels_=function(){var r=this,n=re.players[this.tech_.options_.playerId];!n||!n.qualityLevels||this.qualityLevels_||(this.qualityLevels_=n.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){O3(r.qualityLevels_,r)}),this.playlists.on("mediachange",function(){jE(r.qualityLevels_,r.playlists)}))},e.version=function(){return{"@videojs/http-streaming":UE,"mux.js":P3,"mpd-parser":D3,"m3u8-parser":N3,"aes-decrypter":L3}},t.version=function(){return this.constructor.version()},t.canChangeType=function(){return FE.canChangeType()},t.play=function(){this.masterPlaylistController_.play()},t.setCurrentTime=function(r){this.masterPlaylistController_.setCurrentTime(r)},t.duration=function(){return this.masterPlaylistController_.duration()},t.seekable=function(){return this.masterPlaylistController_.seekable()},t.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.URL.revokeObjectURL&&(D.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),s.prototype.dispose.call(this)},t.convertToProgramTime=function(r,n){return XR({playlist:this.masterPlaylistController_.media(),time:r,callback:n})},t.seekToProgramTime=function(r,n,a,o){return a===void 0&&(a=!0),o===void 0&&(o=2),QR({programTime:r,playlist:this.masterPlaylistController_.media(),retryCount:o,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:n})},e})(j3),Hl={name:"videojs-http-streaming",VERSION:UE,canHandleSource:function(e,t){t===void 0&&(t={});var i=re.mergeOptions(re.options,t);return Hl.canPlayType(e.type,i)},handleSource:function(e,t,i){i===void 0&&(i={});var r=re.mergeOptions(re.options,i);return t.vhs=new iv(e,t,r),re.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return re.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=gE(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){var i=O1(e);if(!i)return"";var r=Hl.getOverrideNative(t),n=ui.supportsTypeNatively(i),a=!n||r;return a?"maybe":""},getOverrideNative:function(e){e===void 0&&(e={});var t=e,i=t.vhs,r=i===void 0?{}:i,n=t.hls,a=n===void 0?{}:n,o=!(re.browser.IS_ANY_SAFARI||re.browser.IS_IOS),l=r.overrideNative,u=l===void 0?o:l,c=a.overrideNative,h=c===void 0?!1:c;return h||u}},V3=function(){return gc("avc1.4d400d,mp4a.40.2")};V3()&&re.getTech("Html5").registerSourceHandler(Hl,0);re.VhsHandler=iv;Object.defineProperty(re,"HlsHandler",{get:function(){return re.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),iv},configurable:!0});re.VhsSourceHandler=Hl;Object.defineProperty(re,"HlsSourceHandler",{get:function(){return re.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Hl},configurable:!0});re.Vhs=ui;Object.defineProperty(re,"Hls",{get:function(){return re.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),ui},configurable:!0});re.use||(re.registerComponent("Hls",ui),re.registerComponent("Vhs",ui));re.options.vhs=re.options.vhs||{};re.options.hls=re.options.hls||{};if(!re.getPlugin||!re.getPlugin("reloadSourceOnError")){var H3=re.registerPlugin||re.plugin;H3("reloadSourceOnError",I3)}/*! @name videojs-contrib-quality-levels @version 2.0.9 @license Apache-2.0 */function q3(s,e){s.prototype=Object.create(e.prototype),s.prototype.constructor=s,s.__proto__=e}function Kf(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}var z3=(function s(e){var t=this;if(re.browser.IS_IE8){t=le.createElement("custom");for(var i in s.prototype)i!=="constructor"&&(t[i]=s.prototype[i])}return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:function(){return t.enabled_()},set:function(n){t.enabled_(n)}}),t}),hh=(function(s){q3(e,s);function e(){var i;i=s.call(this)||this;var r=Kf(Kf(i));if(re.browser.IS_IE8){r=le.createElement("custom");for(var n in e.prototype)n!=="constructor"&&(r[n]=e.prototype[n])}return r.levels_=[],r.selectedIndex_=-1,Object.defineProperty(r,"selectedIndex",{get:function(){return r.selectedIndex_}}),Object.defineProperty(r,"length",{get:function(){return r.levels_.length}}),r||Kf(i)}var t=e.prototype;return t.addQualityLevel=function(r){var n=this.getQualityLevelById(r.id);if(n)return n;var a=this.levels_.length;return n=new z3(r),""+a in this||Object.defineProperty(this,a,{get:function(){return this.levels_[a]}}),this.levels_.push(n),this.trigger({qualityLevel:n,type:"addqualitylevel"}),n},t.removeQualityLevel=function(r){for(var n=null,a=0,o=this.length;a<o;a++)if(this[a]===r){n=this.levels_.splice(a,1)[0],this.selectedIndex_===a?this.selectedIndex_=-1:this.selectedIndex_>a&&this.selectedIndex_--;break}return n&&this.trigger({qualityLevel:r,type:"removequalitylevel"}),n},t.getQualityLevelById=function(r){for(var n=0,a=this.length;n<a;n++){var o=this[n];if(o.id===r)return o}return null},t.dispose=function(){this.selectedIndex_=-1,this.levels_.length=0},e})(re.EventTarget);hh.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(var W3 in hh.prototype.allowedEvents_)hh.prototype["on"+W3]=null;var HE="2.0.9",G3=re.registerPlugin||re.plugin,K3=function(e,t){var i=e.qualityLevels,r=new hh,n=function a(){r.dispose(),e.qualityLevels=i,e.off("dispose",a)};return e.on("dispose",n),e.qualityLevels=function(){return r},e.qualityLevels.VERSION=HE,r},qE=function(e){return K3(this,re.mergeOptions({},e))};G3("qualityLevels",qE);qE.VERSION=HE;const X3={SMALL:450},Q3=R.getPlugin("plugin");class Y3 extends Q3{constructor(e,t){super(e),this.options=t,this.configureMenuDimensions=this.configureMenuDimensions.bind(this),this.initialize()}initialize(){this.player.ready(this.configureMenuDimensions),this.player.one("play",this.configureMenuDimensions),this.player.on("resize",this.configureMenuDimensions),this.player.on("fullscreenchange",this.configureMenuDimensions),this.player.on("resizemenus",this.configureMenuDimensions),this.player.on("ready",this.configureMenuDimensions)}dispose(){this.player.off("resize",this.configureMenuDimensions),this.player.off("fullscreenchange",this.configureMenuDimensions),this.player.off("resizemenus",this.configureMenuDimensions),this.player.off("ready",this.configureMenuDimensions),super.dispose()}configureMenuDimensions(){const e=u=>{if(this.options.mobile)return;const c=this.player.getChild("collapserator"),h=c.getChild("volumePanel"),f=c.children_.indexOf(h);c.removeChild(h),c.addChild("volumePanel",{inline:u},f),this.player.trigger("volumechange")},t=this.player.isFullscreen();if(t&&!this.options.mobile){const u=this.player.whiteboardModePlugin().side;if(e(u!=="top"),u==="left"||u==="right"||u==="top"){const c=this.player.currentWidth();this.player.el().querySelectorAll(".vjs-menu").forEach(f=>{f.style.paddingTop=null,f.style.marginBottom=null,f.style.width=`calc(${c}px - 4em)`});return}}t||e(!0);const i=this.player.currentWidth(),n=this.player.currentHeight()/i*100,a=this.player.el().querySelector(".cv-collapsorator"),o=this.player.el().querySelectorAll(".vjs-menu");let l=a&&a.offsetHeight;if(!l){this.player.one("play",this.configureMenuDimensions);return}this.options.seekBarName==="CreateClipSeekBar"&&(l+=22),!(!o||!o.length)&&o.forEach(u=>{!t&&this.options.overflowControls?u.style.paddingTop="80%":u.style.paddingTop=`calc(${n}% - ${l}px)`,u.style.marginBottom=`${l}px`,u.style.width=null,u.querySelector(".vjs-menu-content")&&(i<=X3.SMALL?this.player.addClass("cv-player-small"):this.player.removeClass("cv-player-small"))})}}R.registerPlugin("configureMenuDimensionsPlugin",Y3);const bT="cv-persisttest",dt={hasLocalStorage:()=>{try{return window.localStorage.setItem(bT,"cv-player-storage-test"),window.localStorage.removeItem(bT),!0}catch{return!1}},get:s=>window.localStorage.getItem(s),set:(s,e)=>{window.localStorage.setItem(s,e)},remove:s=>{window.localStorage.removeItem(s)}},J3=R.getPlugin("plugin"),ST="cvplayer-volume",CT="cvplayer-mute";class Z3 extends J3{constructor(e){super(e),this.enabled=!0,this.player.ready(()=>this.initialize())}initialize(){if(this.player.options_.mobile){this.removeVolumeControl();return}dt.hasLocalStorage()&&(this.saveVolumeState=this.saveVolumeState.bind(this),this.player.on("volumechange",this.saveVolumeState),this.applyUserPreferences())}applyUserPreferences(){const e=dt.get(ST),t=dt.get(CT);e&&this.player.volume(+e),t&&this.player.muted(t==="true")}saveVolumeState(){this.enabled&&(dt.set(ST,this.player.volume().toString()),dt.set(CT,this.player.muted().toString()))}removeVolumeControl(){this.player.volume(1);const e=this.player.getChild("collapserator"),t=e.getChild("volumePanel");e.removeChild(t)}enable(){this.enabled=!0}disable(){this.enabled=!1}dispose(){this.player.off("volumechange",this.saveVolumeState),super.dispose()}}R.registerPlugin("persistVolumePlugin",Z3);const e5=R.getPlugin("plugin"),ET="cvplayer-playback-rate";class t5 extends e5{constructor(e,t){super(e),this.options=t,this.player.dataLoaded(()=>this.initialize())}initialize(){var i;if(!dt.hasLocalStorage())return;this.savePlaybackRate=this.savePlaybackRate.bind(this),this.player.on("ratechange",this.savePlaybackRate),this.one("dispose",()=>{this.player.off("ratechange",this.savePlaybackRate)});const e=+dt.get(ET);((i=this.player.playbackRates())==null?void 0:i.some(r=>r===e))&&this.player.playbackRate(e)}savePlaybackRate(){var t;const e=this.player.playbackRate().toString();this.setDefaultPlaybackRate(+e),dt.set(ET,e),(t=this.options.analyticsService)==null||t.logUserAction({rate:e},{actionType:ci.Select,workflowPhase:Dl.Complete,descriptor:Ys.ChangeSpeed,entity:wi.PlaybackSpeed,eventVersion:Fs.V3})}setDefaultPlaybackRate(e){this.player.defaultPlaybackRate(e)}setPlaybackRateWithoutPersisting(e){this.player.off("ratechange",this.savePlaybackRate),this.player.playbackRate(e),this.setDefaultPlaybackRate(e),this.player.on("ratechange",this.savePlaybackRate)}}R.registerPlugin("persistPlaybackRatePlugin",t5);const i5=R.getPlugin("plugin");class r5 extends i5{constructor(e){super(e),this.fullscreenBecauseOfRotate=!1,this.player.supportsFullScreen()&&(this.onRotate=this.onRotate.bind(this),this.onFullscreenChange=this.onFullscreenChange.bind(this),this.player.ready(()=>this.initialize()))}initialize(){this.player.on("fullscreenchange",this.onFullscreenChange),window.addEventListener("orientationchange",this.onRotate)}dispose(){this.player.off("fullscreenchange",this.onFullscreenChange),window.removeEventListener("orientationchange",this.onRotate)}onFullscreenChange(){this.player.isFullscreen()||(this.fullscreenBecauseOfRotate=!1)}onRotate(){const e=this.getAngle();if(e!==90&&e!==-90&&e!==270){this.fullscreenBecauseOfRotate&&this.player.isFullscreen()&&this.player.exitFullscreen();return}this.player.requestFullscreen(),this.fullscreenBecauseOfRotate=!0}getAngle(){var e,t;return typeof((t=(e=window.screen)==null?void 0:e.orientation)==null?void 0:t.angle)=="number"?window.screen.orientation.angle:0}}R.registerPlugin("fullscreenOnRotatePlugin",r5);const zE=`
288
+ <svg viewBox='0 0 434 71'>
289
+ <g>
290
+ <path fill='#FFFFFF' d='M114.44 56.57l3.5 3.5a32.87 32.87 0 0 1-25.16 11.26c-19.63 0-33.62-15.54-33.62-35.16C59.16 16.55 73.16 1 92.78 1a32.31 32.31 0 0 1 24.19 10.4l-3.6 3.3a27.32 27.32 0 0 0-20.59-8.74c-16.91 0-28.39 13.5-28.39 30.21s11.48 30.21 28.39 30.21a28.08 28.08 0 0 0 21.66-9.81zM126.64 1h4.55v70.22h-4.73L126.64 1zm17.3 10.6a3.7 3.7 0 1 1 0 7.4 3.7 3.7 0 0 1 0-7.4zm-2.41 15.07h4.81v44.56h-4.81V26.67zm48 33.15l3.33 3.15a21.8 21.8 0 0 1-17.31 8.61c-12.59 0-21.76-10-21.76-22.22 0-12.22 9.17-22.22 21.76-22.22a21.84 21.84 0 0 1 16.85 8l-3.43 3.06a17.15 17.15 0 0 0-13.42-6.3c-10.09 0-16.76 8.15-16.76 17.5s6.67 17.5 16.76 17.5a17.38 17.38 0 0 0 13.98-7.08zm14.99-9.33v20.74h-4.73V1.01h4.73v47.75l20.74-19.02h6.64l-21.56 19.84L234 71.23h-7.01l-22.47-20.74z'/>
291
+ <path fill='#F8981D' d='M304.09 19.4a5.56 5.56 0 1 1 0-11.12 5.56 5.56 0 0 1 0 11.12zm-5.56 7.27h11.11v44.56h-11.11V26.67zm61.42 22.15c0 .81 0 2.42-.09 4h-31.75c.8 3.77 5.2 8.61 11.93 8.61a17.11 17.11 0 0 0 11.66-4.31l5.38 8.16a27.23 27.23 0 0 1-17 6.1c-12.92 0-22.88-9.87-22.88-22.34s9.06-22.33 21.35-22.33c11.62-.04 21.4 9.02 21.4 22.11zm-10.77-3.76c-.18-3.68-3.58-8.62-10.67-8.62-6.91 0-10.05 4.85-10.4 8.62h21.07zM385.92 71h-6.42l-19.64-44.37h13.97l9.16 23.98 9.72-23.98h8.31l9.63 23.98 9.16-23.98h13.97L414.24 71h-6.52l-10.85-23.7L385.92 71zm-120.22.35h-6L226.11 1.01h17.01l19.42 44.18 18.08-44.18h16.91L265.7 71.35zM0 1l41 35L0 71V1z'/>
292
+ </g>
293
+ </svg>
294
+ `,n5=R.getComponent("Button");class WE extends n5{constructor(e,t){super(e,t),this.update=IN(this.update.bind(this),1e3),e.on("timeupdate",this.update),e.one("dispose",()=>{e.off("timeupdate",this.update),this.el_.removeEventListener("click",this.pause)})}update(){const e=this.player_.currentTime();this.el_.href=this.options_.getExternalLink({currentTime:Math.round(e)})}buildCSSClass(){return"cv-open-externally-button"}createEl(){const t={innerHTML:zE,className:this.buildCSSClass()},i={type:"button",href:this.options_.getExternalLink({currentTime:0}),target:"_blank"},r=R.dom.createEl("a",t,i);return this.createControlTextEl(r),r.addEventListener("click",this.pause.bind(this)),r}pause(){this.player_.pause()}}WE.prototype.controlText_="Open in ClickView";R.registerComponent("OpenExternallyButton",WE);const s5=R.getPlugin("plugin");class a5 extends s5{constructor(e,t){super(e,t),this.options=t,e.ready(()=>this.onReady())}onReady(){const e=this.player.getChild("collapserator"),t=e.getChild("customControlSpacer"),i=e.children_.indexOf(t);e.addChild("OpenExternallyButton",{getExternalLink:this.options.getExternalLink},i+1)}}R.registerPlugin("openExternallyPlugin",a5);const o5=R.getComponent("component");class l5 extends o5{constructor(e,t){super(e,t)}buildCSSClass(){return`cv-touch-control-ui ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}setUi(e,t){const i=e>0,r=i?"cv-touch-right":"cv-touch-left";this.el_.className=this.buildCSSClass()+" cv-ui-touch-active",this.el_.innerHTML=`
295
+ <div class='${r}'>
296
+ <div class='cv-touch-text'>
297
+ ${i?"+":""}${e*10}s
298
+ </div>
299
+ </div>
300
+ `,window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.removeText()},t)}removeText(){this.el_.className=this.buildCSSClass(),this.el_.innerHTML=""}}R.registerComponent("TouchControls",l5);const u5=R.getPlugin("plugin"),ol=300;class c5 extends u5{constructor(e){super(e),this.doubleTouchCount=0,this.seekStartTime=0,this.directionModifier=0,this.bindFunctions(),this.player.ready(()=>this.initialize())}bindFunctions(){this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.reBindEventListeners=this.reBindEventListeners.bind(this),this.unBindEventListeners=this.unBindEventListeners.bind(this)}initialize(){this.player.addChild("TouchControls"),this.touchControls=this.player.getChild("TouchControls"),this.player.on("ready",this.reBindEventListeners),this.one("dispose",()=>{this.player.off("ready",this.reBindEventListeners)}),this.reBindEventListeners()}reBindEventListeners(){this.unBindEventListeners(),this.tech=this.player.tech(!0),this.tech.name()==="Html5"&&(this.tech.on("touchstart",this.onTouchStart),this.tech.on("touchend",this.onTouchEnd))}unBindEventListeners(){this.tech&&this.tech.name()==="Html5"&&(this.tech.off("touchstart",this.onTouchStart),this.tech.off("touchend",this.onTouchEnd))}dispose(){super.dispose(),this.unBindEventListeners()}onTouchStart(e){this.touchStartTime=e.timeStamp,this.userActive=this.player.userActive()}onTouchEnd(e){if(e.changedTouches.length){if(e.timeStamp-this.lastTouchTime<ol){this.onDoubleTouch(e),this.lastTouchTime=e.timeStamp;return}if(this.resetProperties(),this.lastTouchTime=e.timeStamp,e.timeStamp-this.touchStartTime<ol){window.setTimeout(()=>{this.doubleTouchCount||(this.player.paused()?this.player.play():this.userActive&&this.player.pause())},ol);return}}}resetProperties(){this.doubleTouchCount=0,this.seekStartTime=0,this.directionModifier=0}onDoubleTouch(e){const t=this.player.el().getBoundingClientRect(),i=t.left+t.width/2;if(this.doubleTouchCount===0&&(this.seekStartTime=this.player.currentTime(),e.changedTouches[0].pageX<i?this.directionModifier=-1:this.directionModifier=1),this.doubleTouchCount++,this.directionModifier<0){if(this.doubleTouchCount*10>this.seekStartTime+10)return;this.touchControls.setUi(-this.doubleTouchCount,ol*3),this.player.currentTime(this.player.currentTime()-10);return}const r=this.player.duration()-this.seekStartTime;this.doubleTouchCount*10>r+10||(this.touchControls.setUi(this.doubleTouchCount,ol*3),this.player.currentTime(this.player.currentTime()+10))}}R.registerPlugin("touchControls",c5);class h5{constructor(e,t){this.id=t.id,this.plugin=e,this.source=t,this.enabled=this.enabled.bind(this)}enabled(e){return e===void 0?this.plugin.currentSource===this.source:(e&&this.plugin.setSource(this.source.id),e)}}const d5=R.getPlugin("plugin");class f5 extends d5{constructor(e,t){super(e),this.options_=t,this.player.ready(()=>this.initialize())}initialize(){this.sources=[],this.qualityLevels=this.player.qualityLevels(),this.populateSources(this.options_.sources),this.onQualityChange=this.onQualityChange.bind(this),this.qualityLevels.on("change",this.onQualityChange),this.player.one("dispose",()=>{this.qualityLevels.off("change",this.onQualityChange)})}get currentSource(){return this._currentSource}onQualityChange(){const e=this.qualityLevels[this.qualityLevels.selectedIndex];this.player.trigger("cv-quality-change",e.id)}setSource(e){const t=this.getSourceById(e);if(t===null)return this.currentSource;const i=this.player.currentTime(),r=!this.player.paused();this._currentSource=t;const n=this.player.hasStarted();this.player.src({src:t.url,type:t.mimeType});const a=()=>{this.player.currentTime()!==i&&this.player.currentTime(i),r&&this.player.play(),n&&this.player.hasStarted(!0)};return this.player.one("loadedmetadata",a),this.trigger({event:"sourcechange",source:t}),this.sourceChangeUpdateQualityLevels(t),t}getSourceById(e){return this.sources.find(t=>t.id===e)}repopulateSources(e){let t=null;for(;this.qualityLevels.length;)this.qualityLevels[0].enabled&&(t=this.qualityLevels[0].id),this.qualityLevels.removeQualityLevel(this.qualityLevels[0]);this.sources=[],this.populateSources(e,t)}sortSources(e){return e.sort((t,i)=>t.id===i.id?0:+t.id>+i.id?-1:1)}populateSources(e,t=null){let i=null;e=this.sortSources(e),e.forEach(r=>{if(this.qualityLevels.addQualityLevel(new h5(this,r)),this.sources.push(r),this.trigger({event:"addsource",source:r}),t!==null){r.id===t&&(i=r);return}r.default&&(i=r)}),i===null&&(i=this.sources[0]),i!==null&&this.setSource(i.id)}sourceChangeUpdateQualityLevels(e){const t=this.qualityLevels;let i=-1;for(let r=0;r<t.length;r++)if(t[r].id===e.id){i=r;break}t.selectedIndex_=i,t.trigger({selectedIndex:i,type:"change"})}}R.registerPlugin("progressiveFiles",f5);class GE{static getKnownProfiles(){return["1080","720","480","360","240"]}static enableProfileOrNextBest(e,t){let i=e.getQualityLevelById(t);if(i||(i=this.getNextBestQuality(e,t)),!i)return null;for(let r=0;r<e.length;r++){const n=e[r];n.enabled=i.id===n.id}return i}static getNextBestQuality(e,t){const i=this.getKnownProfiles(),r=i.indexOf(t);if(r>=0){for(let n=r+1;n<i.length;n++){const a=i[n],o=e.getQualityLevelById(a);if(o)return o}for(let n=r-1;n>0;n--){const a=i[n],o=e.getQualityLevelById(a);if(o)return o}}return null}}class p5{constructor(e){this.name=e.name,this.playbackProfile=e.playbackProfile,this.address=new URL(e.httpsAddress)}getUrl(e){return e?this.address+"cache?file="+encodeURIComponent(e):null}async ping(){const t=new AbortController,i=setTimeout(()=>t.abort(),1e3);try{const n=await(await fetch(this.address+"ping",{method:"GET",mode:"cors",signal:t.signal})).text();return clearTimeout(i),n==="PONG"}catch{return!1}}}class m5{constructor(e){this.player=e,this.logger=R.log.createLogger("localcache")}async setSource(e,t){if(this.player.localCache&&(e==null?void 0:e.src)!==void 0){const i=await this.player.localCache().getActiveLocalCache();i!==null&&(this.logger.debug("Using Local Cache",i),e.src=i.getUrl(e.src))}t(null,e)}}R.use("*",s=>new m5(s));const KE='<?xml version="1.0" encoding="UTF-8"?><svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.9"><g id="Local-Cache" transform="translate(2.000000, 2.000000)"><rect id="Rectangle" fill="#FFFFFF" x="0" y="2.4" width="18.8" height="15.2"></rect><ellipse id="Oval" fill="#FFFFFF" cx="9.4" cy="2.4" rx="9.4" ry="2.4"></ellipse><ellipse id="Oval-Copy" fill="#FFFFFF" cx="9.4" cy="17.6" rx="9.4" ry="2.4"></ellipse><g id="Logo/Circle" transform="translate(2.500000, 3.000000)"><circle id="Oval" fill="#FFFFFF" cx="7" cy="7" r="7"></circle><polygon id="Fill-1" fill="#F8981D" points="4.66666667 2.33333333 4.66666667 11.4245258 10.0383286 6.87866667"></polygon></g></g></g></svg>',g5=R.getComponent("Component");class v5 extends g5{constructor(e,t){super(e,t),this.hide(),this.onLocalCacheChange=this.onLocalCacheChange.bind(this),e.ready(()=>{this.initialize()})}createEl(){return super.createEl("div",{className:"vjs-local-cache-indicator",innerHTML:`<div class="vjs-local-cache-indicator-icon">${KE}</div>`},{title:"Streaming from ClickView Local Cache"})}initialize(){this.localCachePlugin=this.player_.localCache(),this.localCachePlugin&&(this.localCachePlugin.on("localcachechanged",this.onLocalCacheChange),this.player_.on("dispose",()=>{this.localCachePlugin.off("localcachechanged",this.onLocalCacheChange)}),this.onLocalCacheChange())}async onLocalCacheChange(){await this.localCachePlugin.getActiveLocalCache()?this.show():this.hide()}}R.registerComponent("localCacheIndicator",v5);const y5=R.getPlugin("plugin");class _5 extends y5{constructor(e,t){if(super(e),this.logger_=R.log.createLogger("localcache"),t===void 0)throw Error("no options defined");this.localCaches_=t.localCacheAddresses.map(i=>new p5(i)),this.player.ready(()=>{this.initialize(),t.enabled&&this.enable()})}get isEnabled(){return this.enabled_}enable(){this.enabled_=!0,this.resetActiveLocalCache()}disable(){this.enabled_=!1}getActiveLocalCache(){return this.enabled_?this.activeLocalCache_:null}resetActiveLocalCache(){this.clearActiveLocalCache(),this.activeLocalCache_=this.getActiveLocalCacheInternal()}clearActiveLocalCache(){this.activeLocalCache_&&(this.activeLocalCache_=null,this.onLocalCacheChange(null))}removeLocalCache(e){this.localCaches_=this.localCaches_.filter(t=>t!==e)}dispose(){super.dispose()}initialize(){this.player.controlBar.addChild("localCacheIndicator")}async handleNetworkError(){const e=await this.getActiveLocalCache();return e&&await e.ping()&&this.removeLocalCache(e),this.resetActiveLocalCache(),await this.getActiveLocalCache(),this.resetSource(),!0}resetSource(){const e=this.player.qualityLevels();for(let t=0;t<e.length;t++)e[t].enabled&&(e[t].enabled=!0)}async getActiveLocalCacheInternal(){const e=[],t=async i=>{await i.ping()&&e.push(i)};if(await Promise.all(this.localCaches_.map(i=>t(i))),e.length>0){const i=e[0];return this.onLocalCacheChange(i),i}return null}onLocalCacheChange(e){this.logger_.debug("Local Cache changed",e),this.trigger("localcachechanged",{localCache:e});let t=!1;e&&e.playbackProfile&&(this.logger_.debug("Changing active profile for local cache",e.playbackProfile),GE.enableProfileOrNextBest(this.player.qualityLevels(),e.playbackProfile),t=!0),t||this.player.src(this.player.src())}}R.registerPlugin("localCache",_5);const T5=9e5,b5=R.getPlugin("plugin");class S5 extends b5{constructor(e,t){super(e),this.playerApi=t.playerApi,this.fileToken=t.fileToken,this.logger=R.log.createLogger("video-signature-expiry-plugin"),this.bindErrorHandlers()}bindErrorHandlers(){this.onError=this.onError.bind(this),this.player.on("error",this.onError)}dispose(){this.player.off("error",this.onError),super.dispose()}async onError(){const e=this.player.error().code;if(!(e!==MediaError.MEDIA_ERR_NETWORK&&e!==MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)){if(await this.player.localCache().getActiveLocalCache()){this.callErrorHandler(()=>this.player.localCache().handleNetworkError());return}this.callErrorHandler(()=>this.handleVideoSignatureExpiry())}}async handleVideoSignatureExpiry(){if(!this.playerApi||!this.fileToken||this.refetchedSourcesTimestamp+T5>Date.now())return!1;this.refetchedSourcesTimestamp=Date.now();let e=null;try{this.logger.debug("Detected expired mp4 urls, attempting to refetch");const t=`${this.playerApi.origin}/api/files?fileToken=${this.fileToken}`;e=await Vp.get(t)}catch{return this.logger.error("Failed to refetch expired mp4 urls"),!1}return this.logger.debug("Mp4 urls successfully refetched"),this.player.progressiveFiles().repopulateSources(e.progressive.map(t=>({id:t.profile,mimeType:t.mimeType,url:t.url}))),this.fileToken=e.fileToken,!0}async callErrorHandler(e){const t=this.player.currentTime(),i=!this.player.paused(),r=()=>{this.player.currentTime(t),i&&this.player.play(),this.player.error(null)};this.player.one("loadedmetadata",r),!await e()&&this.player.off("loadedmetadata",r)}}R.registerPlugin("handleNetworkErrors",S5);const C5=R.getPlugin("plugin"),Xf="cvplayer-show-subtitles",Qf="cvplayer-selected-language",wT="cvplayer-subtitle-size";class E5 extends C5{constructor(e,t){super(e),this.options=t,this.initialize()}initialize(){this.applyUserPreferences=this.applyUserPreferences.bind(this),this.player.textTracks().length&&(this.applyUserPreferences(),this.bindEventListeners())}applyUserPreferences(){let e=!!this.options.showSubtitles;const t=this.safeGet(Xf);if(t==="true"&&(e=!0),t==="false"&&(e=!1),e){const r=this.guessWhichTrack();r&&(r.mode="showing",this.player.trigger("cv:languageselected"))}else this.hideSubtitles();let i=this.safeGet(wT);i||(i=this.options.subtitleSize),this.player.options_.mobile&&(i="medium"),i&&this.player.textTrackSettings.setSizeSetting(i)}safeGet(e){if(dt.hasLocalStorage())return dt.get(e)}onSelectedLanguageChange(){var t,i;const e=this.player.textTracks();for(let r=0;r<e.length;r++){const n=e[r];if(n.kind==="subtitles"&&n.mode==="showing"){dt.set(Xf,"true"),dt.set(Qf,n.language),(t=this.options.analyticsService)==null||t.logUserAction({language:n.language},{actionType:ci.Select,entity:wi.Subtitle,workflowPhase:Dl.Complete,descriptor:mv.On});return}}dt.set(Xf,"false"),dt.remove(Qf),(i=this.options.analyticsService)==null||i.logUserAction({language:""},{actionType:ci.Select,entity:wi.Subtitle,workflowPhase:Dl.Complete,descriptor:mv.Off,eventVersion:Fs.V3})}bindEventListeners(){dt.hasLocalStorage()&&(this.onSelectedLanguageChange=this.onSelectedLanguageChange.bind(this),this.onChangeSubtitleSize=this.onChangeSubtitleSize.bind(this),this.player.on("cv:languageselected",this.onSelectedLanguageChange),this.player.on("changesubtitlesize",this.onChangeSubtitleSize),this.one("dispose",()=>{this.player.off("cv:languageselected",this.onSelectedLanguageChange),this.player.off("changesubtitlesize",this.onChangeSubtitleSize)}))}onChangeSubtitleSize(){const t=this.player.textTrackSettings.getSizeSetting();dt.set(wT,t)}guessWhichTrack(){const e=this.safeGet(Qf)||window.navigator.language,{language:t,country:i}=this.getLanguageParts(e);let r,n;const a=this.player.textTracks();for(let o=0;o<a.length;o++){const l=a[o];if(l.kind!=="subtitles")continue;const{language:u,country:c}=this.getLanguageParts(l.language);if(u===t&&(r=l,c||(n=l),c===i))return r}return n||r||null}getLanguageParts(e){const t=e.toLowerCase().split("-"),i=t[0],r=t[1];return{language:i,country:r}}hideSubtitles(){const e=this.player.textTracks();for(let t=0;t<e.length;t++){const i=e[t];if(i.kind!=="subtitles")return;i.mode="disabled"}}previewModeSubtitles(){const e=this.guessWhichTrack();e&&(e.mode="showing"),this.player.off("changesubtitlesize",this.onChangeSubtitleSize),this.player.textTrackSettings.setSizeSetting("large"),this.player.on("changesubtitlesize",this.onChangeSubtitleSize)}}R.registerPlugin("persistSubtitleSettingsPlugin",E5);const w5=R.getPlugin("plugin"),k5="cvplayer-playback-quality",x5="cvplayer-localcache-playback-quality",A5="1080";class I5 extends w5{constructor(e,t){super(e),this.options=t,this.player.ready(()=>this.initialize())}async initialize(){const e=await this.getActiveLocalCache();let t=e?this.options.playbackProfileLocalCache:this.options.playbackProfile;if(t||(t=A5),dt.hasLocalStorage()){const r=dt.get(this.getStorageKey(!!e));r&&(t=r)}const i=this.player.qualityLevels();e!=null&&e.playbackProfile||GE.enableProfileOrNextBest(i,t),dt.hasLocalStorage()&&(this.onQualityLevelsChange=this.onQualityLevelsChange.bind(this),i.on("change",this.onQualityLevelsChange),this.on("dispose",()=>{i.off("change",this.onQualityLevelsChange)}))}async onQualityLevelsChange(){var r;const e=await this.isLocalCacheActive(),t=this.player.qualityLevels(),i=t[t.selectedIndex];dt.set(this.getStorageKey(e),i.id),(r=this.options.analyticsService)==null||r.logUserAction({quality:i.id},{actionType:ci.Select,workflowPhase:Dl.Complete,descriptor:Ys.ChangeResolution,entity:wi.Resolution,eventVersion:Fs.V3})}async isLocalCacheActive(){return!!await this.player.localCache().getActiveLocalCache()}getActiveLocalCache(){return this.player.localCache().getActiveLocalCache()}getStorageKey(e){return e?x5:k5}}R.registerPlugin("persistQualitySettingsPlugin",I5);const XE=R.getComponent("Component");class P5 extends XE{constructor(e,t){super(e,t)}createEl(){return R.dom.createEl("div",{className:"cv-progress-reporter-item"})}update(){const e=this.options_.event,t=this.player_.duration(),r=(e.end.time-e.start.time)/t;this.el_.style.width=r*100+"%";const n=e.start.time/t;this.el_.style.left=n*100+"%"}}class D5 extends XE{constructor(){super(...arguments),this.events_=[]}update(){const e=this.children();for(let t=e.length;t>0;t--)this.removeChild(e[t]);this.events_.forEach(t=>{const i=new P5(this.player(),{event:t});this.addChild(i),i.update()})}addEvents(e){this.events_.push(...e),this.update()}createEl(){return R.dom.createEl("div",{className:"cv-progress-reporter-display"})}}const N5=R.getPlugin("plugin"),kT=5e3,L5="ArrowUpArrowUpArrowDownArrowDownArrowLeftArrowRightArrowLeftArrowRightba",jt={PLAY:"play",PLAYING:"playing",PAUSE:"pause",SEEKING:"seeking",SEEK_START:"seekstart",SEEK_END:"seekend",ENDED:"ended",PAUSED_SEEK:"pausedseek",TIME_UPDATE:"timeupdate"};class O5 extends N5{constructor(e,t){super(e,t),this.eventBuffer=[],this.latestTime=0,this.lastPlayingTime=0,this.isPlaying=!1,this.isSeeking=!1,this.hasEnded=!1,this.shouldLogPlayOnTimeUpdate=!1,this.options=t,this.player.ready(()=>this.initialize())}initialize(){this.validateOptions(),this.bindListeners(),this.startInterval(),this.addEasterEgg()}validateOptions(){if(typeof this.options.onFlush!="function")throw new Error("Please provide the onFlush option")}bindListeners(){const e={[jt.PLAY]:()=>this.onPlay(),[jt.PAUSE]:()=>this.onPause(),[jt.TIME_UPDATE]:()=>this.onTimeUpdate(),[jt.SEEKING]:()=>this.onSeeking(),[jt.ENDED]:()=>this.onEnded(),[jt.PLAYING]:()=>this.onPlaying()},t=Object.keys(e);t.forEach(i=>this.player.on(i,e[i])),this.one("dispose",()=>{t.forEach(i=>this.player.off(i,e[i]))})}startInterval(){const e=this.options.interval||kT;this.interval=window.setInterval(()=>this.flushBuffer(),e),this.player.one("dispose",()=>window.clearInterval(this.interval))}addEasterEgg(){let e="",t;const i=u=>{e=e+u.key,e===L5&&this.addDisplay(),window.clearTimeout(t),t=window.setTimeout(()=>{e=""},500)};let r=!1,n;const a=()=>{r=!0,n=window.setTimeout(()=>{r&&this.addDisplay()},1e4)};function o(){r=!1,window.clearTimeout(n)}this.player.el().addEventListener("keyup",i);const l=this.player.getChild("Collapserator").getChild("PlayToggle");l.on("touchstart",a),l.on("touchend",o),this.player.one("dispose",()=>{var u,c;(c=(u=this.player)==null?void 0:u.el())==null||c.removeEventListener("keyup",i),l.off("touchstart",a),l.off("touchend",o)})}addDisplay(){this.progressReporterDisplay||(this.progressReporterDisplay=new D5(this.player),this.player.addChild(this.progressReporterDisplay),this.player.options_.inactivityTimeout=0,this.player.one("dispose",()=>{this.progressReporterDisplay=void 0}))}onPlay(){if(this.isPlaying=!0,this.isSeeking){this.logEvent(jt.SEEK_END),this.isSeeking=!1;return}if(this.hasEnded){this.shouldLogPlayOnTimeUpdate=!0,this.hasEnded=!1;return}this.logEvent(jt.PLAY)}onPause(){this.isSeeking||(this.pauseTimeout=window.setTimeout(()=>{this.isPlaying=!1,this.logEvent(jt.PAUSE),delete this.pauseTimeout},50))}onTimeUpdate(){this.shouldLogPlayOnTimeUpdate&&(this.shouldLogPlayOnTimeUpdate=!1,this.logEvent(jt.PLAY)),!(!this.isPlaying||this.isSeeking)&&this.logEvent(jt.PLAYING)}onSeeking(){this.pauseTimeout&&(this.latestTime=this.previousLatestTime,window.clearTimeout(this.pauseTimeout),delete this.pauseTimeout),this.isPlaying||this.logEvent(jt.PAUSED_SEEK),!(this.isSeeking||!this.isPlaying)&&(this.isSeeking=!0,this.logEvent(jt.SEEK_START))}onEnded(){this.hasEnded=!0,this.logEvent(jt.ENDED)}onPlaying(){this.isSeeking=!1,this.isPlaying=!0}logEvent(e){if(!this.player)return;let t=this.player.currentTime();e===jt.SEEK_START&&(t=this.latestTime),this.previousLatestTime=this.latestTime,this.latestTime=this.player.currentTime(),this.eventBuffer.push({time:t,type:e})}shouldUseCarriedOverTime(e){return this.lastPlayingTime&&(e===jt.PLAYING||e===jt.PLAY)}shouldSaveCarriedOverTime(e){return e===jt.PLAYING||e===jt.PAUSE}shouldClearCarriedOverTime(e){return e===jt.ENDED||e===jt.PAUSED_SEEK}flushBuffer(){var i,r;const e=[];let t={};for(;this.eventBuffer.length;){const n=this.eventBuffer.shift();if(this.shouldClearCarriedOverTime(n.type)){delete this.lastPlayingTime;continue}if(!t.start){this.shouldUseCarriedOverTime(n.type)&&(n.time=this.lastPlayingTime,delete this.lastPlayingTime),t.start=n;continue}n.type===jt.PLAYING&&this.eventBuffer.length>0||(this.shouldSaveCarriedOverTime(n.type)&&(this.lastPlayingTime=n.time),t.end=n,e.push(t),t={})}this.eventBuffer=[],e.length&&this.validateEvents(e)&&(this.options.onFlush(e),(i=this.player)==null||i.trigger("progressflush"),(r=this.progressReporterDisplay)==null||r.addEvents(e))}validateEvents(e){let t=0;e.forEach(r=>{t+=r.end.time-r.start.time});let i=this.options.interval||kT;return i=i/1e3,i+=.5,i=i*this.player.playbackRate(),t<i}}R.registerPlugin("progressReporterPlugin",O5);const M5=R.getComponent("Component");class R5 extends M5{createEl(){const e="span",t={innerHTML:'<span class="vjs-icon-placeholder"></span>',className:"cv-drag-handle vjs-control vjs-button"};return R.dom.createEl(e,t,{})}}const QE=["top","left","right","bottom"],xT={top:"Top",left:"Left",right:"Right",bottom:"Bottom"},YE=R.getComponent("Component");class B5 extends YE{constructor(e,t){super(e,t),this.bindEventListeners()}createEl(){return super.createEl("div",{},{class:`cv-drop-target cv-drop-${this.options_.side}`})}bindEventListeners(){const e=this.el(),t=n=>{n.preventDefault(),n.dataTransfer.dropEffect="move",this.addClass("cv-drag-over")},i=n=>{n.preventDefault(),this.removeClass("cv-drag-over"),this.player_.whiteboardModePlugin().setWhiteboardMode(this.options_.side)},r=()=>{this.removeClass("cv-drag-over")};e.addEventListener("dragover",t),e.addEventListener("drop",i),e.addEventListener("dragleave",r),this.on("dispose",()=>{e.removeEventListener("dragover",t),e.removeEventListener("drop",i),e.removeEventListener("dragleave",r)})}}class F5 extends YE{constructor(e,t){super(e,t),this.addChildren()}addChildren(){QE.forEach(e=>{this.addChild(new B5(this.player_,{side:e}))})}}const U5=R.getComponent("MenuItem");class $5 extends U5{constructor(e,t){super(e,t)}handleClick(){this.player_.whiteboardModePlugin().setWhiteboardMode(this.options_.side)}}const AT=R.getComponent("MenuButton");class j5 extends AT{constructor(){super(...arguments),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0}createItems(){const e=this.player_.whiteboardModePlugin().side,t=[new Zs(this.player_,{label:"Video Controls"})];return QE.forEach(i=>{t.push(new $5(this.player_,{side:i,label:xT[i],selectable:!0,multiSelectable:!1,selected:i===e}))}),t}buildWrapperCSSClass(){return`cv-menu-small cv-has-left-icons ${super.buildWrapperCSSClass()}`}getCollabsibleName(){return"Video Controls"}getCollabsibleValue(){const e=this.player_.whiteboardModePlugin().side;return xT[e]}showInCollabsibleMenu(){return this.player_.whiteboardModePlugin().isEnabled()?this.player_.isFullscreen():!1}showCollapsibleMenu(){AT.prototype.handleClick.apply(this)}}const IT="cv-whiteboard-side",V5=R.getPlugin("plugin");class H5 extends V5{constructor(e){super(e),this.side="bottom",this.enabled=!0,this.player.ready(()=>{this.initialize()})}initialize(){if(!this.player.options_.mobile){if(dt.hasLocalStorage()){const e=dt.get(IT);e&&(this.side=e)}this.initCollapserator(),this.initDragTargets(),this.initFullscreenListener()}}initCollapserator(){var a,o;if((o=(a=this.player).viewTranscriptPlugin)!=null&&o.call(a).isTranscriptOn())return;const e=this.player.getChild("collapserator");this.dragHandle=new R5(this.player),this.button=new j5(this.player),e.addChild(this.dragHandle),e.addChild(this.button),this.player.trigger("cv-updatecog");const t=()=>{this.player.isFullscreen()&&e.el().setAttribute("draggable","true")},i=()=>{this.player.isFullscreen()&&e.el().setAttribute("draggable","false")},r=l=>{this.player.isFullscreen()&&(this.player.addClass("cv-dragging"),l.dataTransfer.setData("text/plain","handle"))},n=()=>{this.player.isFullscreen()&&(this.player.removeClass("cv-dragging"),e.el().setAttribute("draggable","false"))};this.dragHandle.el().addEventListener("mousedown",t),this.dragHandle.el().addEventListener("mouseup",i),e.el().addEventListener("dragstart",r),e.el().addEventListener("dragend",n),this.on("dispose",()=>{this.dragHandle.el().removeEventListener("mousedown",t),this.dragHandle.el().removeEventListener("mouseup",i),e.el().removeEventListener("dragstart",r),e.el().removeEventListener("dragend",n)})}initDragTargets(){this.player.addChild(new F5(this.player))}initFullscreenListener(){this.update=this.update.bind(this),this.player.on("fullscreenchange",this.update),this.player.on("cv-transcript-toggle",this.update),this.one("dispose",()=>{this.player.off("fullscreenchange",this.update)})}setWhiteboardMode(e){this.side=e,this.button.update(),dt.hasLocalStorage()&&dt.set(IT,e),this.player.trigger("cv-whiteboard-change"),this.update()}setEnabled(e){this.enabled=e,this.update()}isEnabled(){return this.enabled}getSide(){return this.isEnabled()?this.side:"bottom"}update(){var t,i;if(this.player.removeClass("cv-whiteboard-top"),this.player.removeClass("cv-whiteboard-left"),this.player.removeClass("cv-whiteboard-right"),R.dom.removeClass(window.document.documentElement,"cv-whiteboard-html-font-size"),this.player.trigger("resizemenus"),this.player.trigger("cv-updatecog"),!this.isEnabled()){(t=this.dragHandle)==null||t.hide();return}(i=this.dragHandle)==null||i.show();const e=this.getSide();!this.player.isFullscreen()||e==="bottom"||(this.player.addClass(`cv-whiteboard-${e}`),R.dom.addClass(window.document.documentElement,"cv-whiteboard-html-font-size"))}}R.registerPlugin("whiteboardModePlugin",H5);const q5=R.getPlugin("plugin");class z5 extends q5{constructor(e){super(e)}deferMenu(){const e={subtitles:this.buildSubtitles(),qualities:this.buildQualities(),playbackSpeeds:this.buildPlaybackSpeeds()};this.player.trigger("cv-defer-menus",e)}buildSubtitles(){const e=[];let t=!1;const i=this.player.textTracks();for(let r=0;r<i.length;r++){const n=i[r],a=n.mode==="showing";e.unshift({id:n.label,name:n.label,selected:a}),a&&(t=!0)}return e.push({id:null,name:"Off",selected:!t}),e}buildQualities(){const e=[],t=this.player.qualityLevels();for(let i=0;i<t.length;i++){const r=t[i];e.push({id:r.id,name:r.id+"p",selected:r.enabled})}return e}buildPlaybackSpeeds(){const e=this.player.playbackRate();return this.player.options_.playbackRates.map(t=>({id:t,name:t+"x"+(t===1?" (Normal)":""),selected:e===t}))}}R.registerPlugin("deferMenusPlugin",z5);const W5="No skipping ahead!",dh="PreventScrubbingTooltip",JE=1e3,G5=R.getComponent("Component"),PT="cv-prevent-scrubbing-tooltip-show",DT="cv-prevent-scrubbing-tooltip-remove-transition";class K5 extends G5{constructor(){super(...arguments),this.isShowing=!1}buildCSSClass(){return`cv-prevent-scrubbing-tooltip ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass(),innerText:W5},i)}show(){this.isShowing||(this.player_.userActive(!0),this.addClass(PT),this.isShowing=!0)}hide(e=!1){this.isShowing&&(e&&(this.addClass(DT),window.requestAnimationFrame(()=>{this.removeClass(DT)})),this.player_.userActive(!1),this.removeClass(PT),this.isShowing=!1)}}R.registerComponent(dh,K5);const X5=R.getPlugin("plugin"),NT=1.25;class Q5 extends X5{constructor(e,t){super(e),this.originalPlaybackRates=[],this.isEnabled=!1,this.isPreviewing=!1;const{furthestVisitedTime:i=0,isEnabled:r=!1}=t??{};this.playerCurrentTimeFn=this.player.currentTime.bind(e),this.player.currentTime=this.currentTime.bind(this),this.onTimeUpdate=this.onTimeUpdate.bind(this),this.furthestVisitedTime=i,this.isEnabled=r,r&&this.enable()}dispose(){this.player.currentTime=this.playerCurrentTimeFn,this.isEnabled&&(this.disable(),super.dispose())}togglePreview(e){if(e){if(this.configurePreview(),this.isEnabled)return;this.enable(),this.isPreviewing=!0}else this.disable(),this.isPreviewing=!1}configurePreview(){this.player.currentTime(0),this.furthestVisitedTime=0}enable(){this.player.on("timeupdate",this.onTimeUpdate),this.getProgressControl().addChild(dh),this.isEnabled=!0,this.setLimitedPlaybackRates()}disable(){this.player.off("timeupdate",this.onTimeUpdate),this.getProgressControl().removeChild(this.getPreventScrubbingTooltip()),this.isEnabled=!1,this.restorePlaybackRates()}setLimitedPlaybackRates(){var i,r;this.originalPlaybackRates=this.player.playbackRates();const e=this.originalPlaybackRates.filter(n=>n<=NT);this.player.playbackRates(e),this.player.playbackRate()>NT&&((r=(i=this.player).persistPlaybackRatePlugin)==null||r.call(i).setPlaybackRateWithoutPersisting(1)),this.player.trigger("resizemenus")}restorePlaybackRates(){this.player.playbackRates(this.originalPlaybackRates),this.player.trigger("resizemenus")}getProgressControl(){return this.player.controlBar.getChild("progressControl")}onTimeUpdate(){const e=this.playerCurrentTimeFn();e>this.furthestVisitedTime&&(this.furthestVisitedTime=e)}currentTime(e,...t){var n;if(typeof e!="number")return this.playerCurrentTimeFn(e,...t);if(!this.isEnabled){this.playerCurrentTimeFn(e,...t);return}const i=this.getPreventScrubbingTooltip(),r=(n=this.getSeekBar())==null?void 0:n.getChild("MouseTimeDisplay");if(e>this.furthestVisitedTime){i.show(),Jl(i.hide,JE,!1,i)(),r==null||r.hide(),this.playerCurrentTimeFn(this.furthestVisitedTime,t);return}r==null||r.show(),i.hide(!0),this.playerCurrentTimeFn(e,t)}getPreventScrubbingTooltip(){return this.getProgressControl().getChild(dh)}getSeekBar(){var e;return(e=this.player.controlBar.getChild("ProgressControl"))==null?void 0:e.getChild("SeekBar")}}R.registerPlugin("preventScrubbingPlugin",Q5);const Y5=R.getComponent("Button"),LT="cv-muted";class rv extends Y5{constructor(e){super(e),this.update(),this.update=this.update.bind(this),e.on("volumechange",this.update),e.on("dispose",()=>e.off("volumechange",this.update))}handleClick(){this.player_.muted(!this.player_.muted()),this.update()}update(){this.player_.muted()?this.addClass(LT):this.removeClass(LT)}buildCSSClass(){return"cv-mute-button cv-muted"}}R.registerComponent("muteButton",rv);rv.prototype.controlText_="Mute";const J5=R.getComponent("Component");class ZE extends J5{constructor(e,t){super(e,t),this._onClickHandler=t.onClickHandler,this.bindEventListeners()}createEl(){return R.dom.createEl("div",{className:"cv-player-overlay"})}handleClick(e){typeof this._onClickHandler=="function"&&(e.stopImmediatePropagation(),this._onClickHandler())}dispose(){this.off("click",this.handleClick),super.dispose()}bindEventListeners(){this.on("click",this.handleClick)}}R.registerComponent("playerOverlay",ZE);var e2=(s=>(s.Default="play",s.Hover="hover",s))(e2||{});const Z5=R.getPlugin("plugin"),OT="cv-preview-mode";class eB extends Z5{constructor(e){super(e),this.buttonAdded=!1,this.mode=null}getMode(){return this.mode}setPlayerMode(e,t){const i=this.mode;if(this.mode=e,e==="hover"){this.buttonAdded||this.addButtons(t),this.player.addClass(OT),this.enableSubtites(),this.mute(),this.removeActivityTimeout(),this.player.trigger("resize");return}i==="hover"&&(this.player.removeClass(OT),this.disableSubtitles(),this.unmute(),this.restoreActivityTimeout(),this.player.trigger("resize"))}addButtons(e){const t=new rv(this.player),i=new ZE(this.player,{onClickHandler:e});this.player.addChild(t),this.player.addChild(i),this.buttonAdded=!0}enableSubtites(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().previewModeSubtitles())}disableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().applyUserPreferences())}mute(){this.player.ready(()=>{this.player.persistVolumePlugin().disable(),this.player.muted(!0)})}unmute(){this.player.ready(()=>{this.player.persistVolumePlugin().applyUserPreferences(),this.player.persistVolumePlugin().enable()})}removeActivityTimeout(){this.player.cache_.inactivityTimeout=this.player.options_.inactivityTimeout,this.player.options_.inactivityTimeout=0}restoreActivityTimeout(){this.player.options_.inactivityTimeout=this.player.cache_.inactivityTimeout}}R.registerPlugin("playerModePlugin",eB);const mm=R.getComponent("Component"),tB=R.getComponent("ClickableComponent"),iB=`
301
+ <svg version="1.1" viewBox="0 0 24 24">
302
+ <path id="Heart-Filled" d="m18.833 5.9735c-0.78916-0.95022-1.8839-1.4735-3.0826-1.4735-1.6859 0-2.7532 1.0685-3.3517 1.9648-0.15528 0.2326-0.28738 0.46582-0.39828 0.68529-0.11091-0.21946-0.24297-0.45269-0.39828-0.68529-0.5985-0.89636-1.6658-1.9648-3.3517-1.9648-1.1987 0-2.2935 0.52333-3.0827 1.4735-0.75275 0.90644-1.1673 2.1204-1.1673 3.4183 0 1.4128 0.51978 2.7268 1.6358 4.1353 0.99741 1.2588 2.4323 2.5564 4.0939 4.0589 0.61916 0.5599 1.2594 1.1389 1.9411 1.7718l0.02047 0.01903c0.08837 0.08211 0.19856 0.12313 0.30875 0.12313s0.22038-0.04105 0.30875-0.12313l0.02047-0.01903c0.68166-0.63289 1.3219-1.2119 1.9412-1.7719 1.6615-1.5024 3.0964-2.8 4.0938-4.0588 1.116-1.4085 1.6358-2.7225 1.6358-4.1353 0-1.2979-0.41459-2.5119-1.1674-3.4183z"/>
303
+ </svg>
304
+ `,rB=`
305
+ <svg version="1.1" viewBox="0 0 24 24">
306
+ <path id="Shape" d="m18.959 5.9741c-0.76992-0.92705-1.9357-1.5351-3.1052-1.5351-1.6448 0-2.8808 0.74937-3.4647 1.6238-0.15149 0.22693-0.28074 0.55125-0.38894 0.76537-0.10821-0.21411-0.23718-0.53844-0.38871-0.76537-0.58391-0.87451-1.8205-1.6238-3.4653-1.6238-1.1695 0-2.2376 0.60808-3.0075 1.5351-0.7344 0.88434-1.1388 1.9712-1.1388 3.2374 0 1.3784 0.50711 3.0509 1.5959 4.4251 0.97309 1.2281 2.373 2.4941 3.9941 3.9599 0.60406 0.54625 1.2285 1.1104 1.8936 1.7278l0.01997 0.01934c0.08622 0.08011 0.38931 0.21727 0.49681 0.21727 0.1075 0 0.40992-0.13796 0.49614-0.21804l0.0201-0.0178c0.66504-0.61746 1.2897-1.1824 1.8939-1.7287 1.621-1.4658 3.0209-2.7317 3.994-3.9598 1.0888-1.3742 1.5955-3.0467 1.5955-4.4251 0-1.2663-0.30646-2.3531-1.0409-3.2374zm-5.337 10.688c-0.51948 0.47226-1.0567 0.95549-1.6218 1.4768-0.56507-0.52124-1.101-1.0059-1.6219-1.4769-3.1725-2.8689-5.2684-4.7641-5.2684-7.2556 0-1.0298 0.32333-1.9863 0.91044-2.6933 0.59385-0.71497 1.4183-1.1088 2.3213-1.1088 1.254 0 2.0645 0.81976 2.5237 1.5074 0.41187 0.61679 0.62678 1.2385 0.70006 1.4772 0.06131 0.19978 0.23683 0.33499 0.43482 0.33499s0.37351-0.1352 0.43482-0.33499c0.07329-0.23867 0.28821-0.86044 0.70006-1.4773 0.45914-0.68766 1.2698-1.5074 2.5237-1.5074 0.90309 0 1.7274 0.39377 2.3213 1.1088 0.58714 0.70695 0.91047 1.6634 0.91047 2.6933 0 2.4914-2.1035 4.3783-5.2685 7.2557z" stroke-width=".97562"/>
307
+ </svg>
308
+ `;class nB extends mm{createEl(){return mm.prototype.createEl.call(this,"span",{className:"cv-favourite-button-svg",innerHTML:`<span class='cv-favourite-heart'>${iB}</span><span class='cv-favourite-outline'>${rB}</span>`})}}class t2 extends tB{constructor(e,t){super(e,t),this.isFavourited=t.isFavourited,this.renderIcon(),this.update()}renderIcon(){this.icon&&this.removeChild(this.icon),this.icon=new nB(this.player_),this.addChild(this.icon)}update(){this.isFavourited?this.addClass("cv-favourited"):this.removeClass("cv-favourited")}createEl(e,t,i){e="button",t={innerHTML:"",className:"cv-favourite-button",...t},i={type:"button",...i};const r=mm.prototype.createEl.call(this,e,t,i);return this.createControlTextEl(r),r}handleClick(){this.isFavourited=!this.isFavourited,this.update(),this.options_.onClick&&this.options_.onClick(this.isFavourited)}}t2.prototype.controlText_="Favourite";const sB=R.getPlugin("plugin");class aB extends sB{setFavourite(e,t){if(this.initialized)return;const i=new t2(this.player,{isFavourited:e,onClick:t});this.player.addChild(i),this.initialized=!0}}R.registerPlugin("favouritePlugin",aB);const oB=R.getComponent("MenuButton"),lB=992,i2="Theatre mode (t)",r2="Default view (t)",MT="cv-theatre-mode-button";class uB extends oB{constructor(e,t){super(e,t),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0,this.updateControlText()}getCollabsibleName(){return""}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!(window.innerWidth<lB)}showCollapsibleMenu(){super.handleClick(null)}buildCSSClass(){return`cv-default-mode-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`cv-menu-big ${super.buildWrapperCSSClass()}`}handleClick(){this.player_.theatreModePlugin().toggleTheatreMode(void 0,{shouldLog:!0}),this.updateControlText()}updateControlText(){this.player().theatreModePlugin().getTheatreMode()?this.controlText(r2):this.controlText(i2)}}R.registerComponent("theatreModeButton",uB);const cB=R.getPlugin("plugin"),RT=992;class hB extends cB{constructor(e,t){super(e,t),this.options=t,this.bindListeners(),e.ready(()=>this.onReady())}bindListeners(){this.onResize=this.onResize.bind(this),this.onFullscreenChange=this.onFullscreenChange.bind(this),this.player.on("playerresize",this.onResize),this.player.on("fullscreenchange",this.onFullscreenChange)}onReady(){if(!this.options||window.innerWidth<RT||!this.getCollapserator())return;this.button=this.createButton();const t=this.options.theatreMode;t&&(this.toggleButton(!0),this.options.onRequestTheatreMode(t))}dispose(){this.player.off("playerresize",this.onResize),this.player.off("fullscreenchange",this.onFullscreenChange),super.dispose()}toggleTheatreMode(e,t){var n;if(!this.options)return;const i=this.options.theatreMode,r=e!==void 0?e:!i;if(this.options.onRequestTheatreMode(r),this.options.theatreMode=r,window.requestAnimationFrame(()=>this.player.trigger("resize")),!!this.button)return i!==r&&(t!=null&&t.shouldLog)&&((n=this.analyticsService)==null||n.logUserAction({id:this.options.playbackObject.videoId,name:this.options.playbackObject.title},{actionType:ci.Click,descriptor:r?Ys.EnableTheatreMode:Ys.DisableTheatreMode,entity:wi.Video})),r?(i||this.player.fill(!0),this.toggleButton(!0),r):(i&&this.player.fluid(!0),this.toggleButton(!1),this.player.viewTranscriptPlugin&&this.player.viewTranscriptPlugin().toggleTranscript(!1,{shouldLog:!1}),r)}onResize(){var e,t;window.innerWidth<RT?(e=this.button)==null||e.hide():this.player.isFullscreen()||(this.button||(this.button=this.createButton()),(t=this.button)==null||t.show())}createButton(){const e=this.getCollapserator();return(e==null?void 0:e.getChild("theatreModeButton"))||e.addChild("theatreModeButton",{},e.children_.length-3),e==null?void 0:e.getChild("theatreModeButton")}onFullscreenChange(){var e,t;this.player.isFullscreen()?(e=this.button)==null||e.hide():(t=this.button)==null||t.show()}getCollapserator(){return this.player.getChild("collapserator")}getTheatreMode(){return this.options.theatreMode}registerAnalytics(e){this.analyticsService=e}toggleButton(e){var t;this.button&&(e?(this.button.addClass(MT),this.button.updateControlText(i2),this.button.setActive(!0)):((t=this.button)==null||t.removeClass(MT),this.button.updateControlText(r2),this.button.setActive(!1)))}}R.registerPlugin("theatreModePlugin",hB);mw();gw();var Yf,BT;function dB(){if(BT)return Yf;BT=1;var s=!!(typeof window<"u"&&window.document&&window.document.createElement);return Yf=s,Yf}var fB=dB();const nv=Vi(fB);vw();yw();_w();Tw();bw();Sw();Cw();Ew();var Jf,FT;function pB(){if(FT)return Jf;FT=1;var s="Expected a function",e=NaN,t="[object Symbol]",i=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt,l=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,u=typeof self=="object"&&self&&self.Object===Object&&self,c=l||u||Function("return this")(),h=Object.prototype,f=h.toString,g=Math.max,C=Math.min,p=function(){return c.Date.now()};function b(O,M,U){var w,P,Q,G,K,ce,de=0,pe=!1,ne=!1,se=!0;if(typeof O!="function")throw new TypeError(s);M=B(M)||0,L(U)&&(pe=!!U.leading,ne="maxWait"in U,Q=ne?g(B(U.maxWait)||0,M):Q,se="trailing"in U?!!U.trailing:se);function ue(Oe){var He=w,st=P;return w=P=void 0,de=Oe,G=O.apply(st,He),G}function he(Oe){return de=Oe,K=setTimeout(De,M),pe?ue(Oe):G}function ve(Oe){var He=Oe-ce,st=Oe-de,Ct=M-He;return ne?C(Ct,Q-st):Ct}function Ae(Oe){var He=Oe-ce,st=Oe-de;return ce===void 0||He>=M||He<0||ne&&st>=Q}function De(){var Oe=p();if(Ae(Oe))return Me(Oe);K=setTimeout(De,ve(Oe))}function Me(Oe){return K=void 0,se&&w?ue(Oe):(w=P=void 0,G)}function Ne(){K!==void 0&&clearTimeout(K),de=0,w=ce=P=K=void 0}function Je(){return K===void 0?G:Me(p())}function Re(){var Oe=p(),He=Ae(Oe);if(w=arguments,P=this,ce=Oe,He){if(K===void 0)return he(ce);if(ne)return K=setTimeout(De,M),ue(ce)}return K===void 0&&(K=setTimeout(De,M)),G}return Re.cancel=Ne,Re.flush=Je,Re}function I(O,M,U){var w=!0,P=!0;if(typeof O!="function")throw new TypeError(s);return L(U)&&(w="leading"in U?!!U.leading:w,P="trailing"in U?!!U.trailing:P),b(O,M,{leading:w,maxWait:M,trailing:P})}function L(O){var M=typeof O;return!!O&&(M=="object"||M=="function")}function F(O){return!!O&&typeof O=="object"}function V(O){return typeof O=="symbol"||F(O)&&f.call(O)==t}function B(O){if(typeof O=="number")return O;if(V(O))return e;if(L(O)){var M=typeof O.valueOf=="function"?O.valueOf():O;O=L(M)?M+"":M}if(typeof O!="string")return O===0?O:+O;O=O.replace(i,"");var U=n.test(O);return U||a.test(O)?o(O.slice(2),U?2:8):r.test(O)?e:+O}return Jf=I,Jf}var mB=pB();const UT=Vi(mB);var Zf,$T;function gB(){if($T)return Zf;$T=1;var s="Expected a function",e=NaN,t="[object Symbol]",i=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt,l=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,u=typeof self=="object"&&self&&self.Object===Object&&self,c=l||u||Function("return this")(),h=Object.prototype,f=h.toString,g=Math.max,C=Math.min,p=function(){return c.Date.now()};function b(B,O,M){var U,w,P,Q,G,K,ce=0,de=!1,pe=!1,ne=!0;if(typeof B!="function")throw new TypeError(s);O=V(O)||0,I(M)&&(de=!!M.leading,pe="maxWait"in M,P=pe?g(V(M.maxWait)||0,O):P,ne="trailing"in M?!!M.trailing:ne);function se(Re){var Oe=U,He=w;return U=w=void 0,ce=Re,Q=B.apply(He,Oe),Q}function ue(Re){return ce=Re,G=setTimeout(Ae,O),de?se(Re):Q}function he(Re){var Oe=Re-K,He=Re-ce,st=O-Oe;return pe?C(st,P-He):st}function ve(Re){var Oe=Re-K,He=Re-ce;return K===void 0||Oe>=O||Oe<0||pe&&He>=P}function Ae(){var Re=p();if(ve(Re))return De(Re);G=setTimeout(Ae,he(Re))}function De(Re){return G=void 0,ne&&U?se(Re):(U=w=void 0,Q)}function Me(){G!==void 0&&clearTimeout(G),ce=0,U=K=w=G=void 0}function Ne(){return G===void 0?Q:De(p())}function Je(){var Re=p(),Oe=ve(Re);if(U=arguments,w=this,K=Re,Oe){if(G===void 0)return ue(K);if(pe)return G=setTimeout(Ae,O),se(K)}return G===void 0&&(G=setTimeout(Ae,O)),Q}return Je.cancel=Me,Je.flush=Ne,Je}function I(B){var O=typeof B;return!!B&&(O=="object"||O=="function")}function L(B){return!!B&&typeof B=="object"}function F(B){return typeof B=="symbol"||L(B)&&f.call(B)==t}function V(B){if(typeof B=="number")return B;if(F(B))return e;if(I(B)){var O=typeof B.valueOf=="function"?B.valueOf():B;B=I(O)?O+"":O}if(typeof B!="string")return B===0?B:+B;B=B.replace(i,"");var M=n.test(B);return M||a.test(B)?o(B.slice(2),M?2:8):r.test(B)?e:+B}return Zf=b,Zf}var vB=gB();const jT=Vi(vB);var ep,VT;function yB(){if(VT)return ep;VT=1;var s="Expected a function",e="__lodash_hash_undefined__",t="[object Function]",i="[object GeneratorFunction]",r=/[\\^$.*+?()[\]{}|]/g,n=/^\[object .+?Constructor\]$/,a=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,o=typeof self=="object"&&self&&self.Object===Object&&self,l=a||o||Function("return this")();function u(Te,ke){return Te==null?void 0:Te[ke]}function c(Te){var ke=!1;if(Te!=null&&typeof Te.toString!="function")try{ke=!!(Te+"")}catch{}return ke}var h=Array.prototype,f=Function.prototype,g=Object.prototype,C=l["__core-js_shared__"],p=(function(){var Te=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||"");return Te?"Symbol(src)_1."+Te:""})(),b=f.toString,I=g.hasOwnProperty,L=g.toString,F=RegExp("^"+b.call(I).replace(r,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),V=h.splice,B=Oe(l,"Map"),O=Oe(Object,"create");function M(Te){var ke=-1,Fe=Te?Te.length:0;for(this.clear();++ke<Fe;){var Be=Te[ke];this.set(Be[0],Be[1])}}function U(){this.__data__=O?O(null):{}}function w(Te){return this.has(Te)&&delete this.__data__[Te]}function P(Te){var ke=this.__data__;if(O){var Fe=ke[Te];return Fe===e?void 0:Fe}return I.call(ke,Te)?ke[Te]:void 0}function Q(Te){var ke=this.__data__;return O?ke[Te]!==void 0:I.call(ke,Te)}function G(Te,ke){var Fe=this.__data__;return Fe[Te]=O&&ke===void 0?e:ke,this}M.prototype.clear=U,M.prototype.delete=w,M.prototype.get=P,M.prototype.has=Q,M.prototype.set=G;function K(Te){var ke=-1,Fe=Te?Te.length:0;for(this.clear();++ke<Fe;){var Be=Te[ke];this.set(Be[0],Be[1])}}function ce(){this.__data__=[]}function de(Te){var ke=this.__data__,Fe=Ne(ke,Te);if(Fe<0)return!1;var Be=ke.length-1;return Fe==Be?ke.pop():V.call(ke,Fe,1),!0}function pe(Te){var ke=this.__data__,Fe=Ne(ke,Te);return Fe<0?void 0:ke[Fe][1]}function ne(Te){return Ne(this.__data__,Te)>-1}function se(Te,ke){var Fe=this.__data__,Be=Ne(Fe,Te);return Be<0?Fe.push([Te,ke]):Fe[Be][1]=ke,this}K.prototype.clear=ce,K.prototype.delete=de,K.prototype.get=pe,K.prototype.has=ne,K.prototype.set=se;function ue(Te){var ke=-1,Fe=Te?Te.length:0;for(this.clear();++ke<Fe;){var Be=Te[ke];this.set(Be[0],Be[1])}}function he(){this.__data__={hash:new M,map:new(B||K),string:new M}}function ve(Te){return Re(this,Te).delete(Te)}function Ae(Te){return Re(this,Te).get(Te)}function De(Te){return Re(this,Te).has(Te)}function Me(Te,ke){return Re(this,Te).set(Te,ke),this}ue.prototype.clear=he,ue.prototype.delete=ve,ue.prototype.get=Ae,ue.prototype.has=De,ue.prototype.set=Me;function Ne(Te,ke){for(var Fe=Te.length;Fe--;)if(Ni(Te[Fe][0],ke))return Fe;return-1}function Je(Te){if(!Hi(Te)||st(Te))return!1;var ke=Bt(Te)||c(Te)?F:n;return ke.test(Ct(Te))}function Re(Te,ke){var Fe=Te.__data__;return He(ke)?Fe[typeof ke=="string"?"string":"hash"]:Fe.map}function Oe(Te,ke){var Fe=u(Te,ke);return Je(Fe)?Fe:void 0}function He(Te){var ke=typeof Te;return ke=="string"||ke=="number"||ke=="symbol"||ke=="boolean"?Te!=="__proto__":Te===null}function st(Te){return!!p&&p in Te}function Ct(Te){if(Te!=null){try{return b.call(Te)}catch{}try{return Te+""}catch{}}return""}function Nt(Te,ke){if(typeof Te!="function"||ke&&typeof ke!="function")throw new TypeError(s);var Fe=function(){var Be=arguments,Ke=ke?ke.apply(this,Be):Be[0],rt=Fe.cache;if(rt.has(Ke))return rt.get(Ke);var ut=Te.apply(this,Be);return Fe.cache=rt.set(Ke,ut),ut};return Fe.cache=new(Nt.Cache||ue),Fe}Nt.Cache=ue;function Ni(Te,ke){return Te===ke||Te!==Te&&ke!==ke}function Bt(Te){var ke=Hi(Te)?L.call(Te):"";return ke==t||ke==i}function Hi(Te){var ke=typeof Te;return!!Te&&(ke=="object"||ke=="function")}return ep=Nt,ep}var _B=yB();const TB=Vi(_B);var n2=(function(){if(typeof Map<"u")return Map;function s(e,t){var i=-1;return e.some(function(r,n){return r[0]===t?(i=n,!0):!1}),i}return(function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(t){var i=s(this.__entries__,t),r=this.__entries__[i];return r&&r[1]},e.prototype.set=function(t,i){var r=s(this.__entries__,t);~r?this.__entries__[r][1]=i:this.__entries__.push([t,i])},e.prototype.delete=function(t){var i=this.__entries__,r=s(i,t);~r&&i.splice(r,1)},e.prototype.has=function(t){return!!~s(this.__entries__,t)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,i){i===void 0&&(i=null);for(var r=0,n=this.__entries__;r<n.length;r++){var a=n[r];t.call(i,a[1],a[0])}},e})()})(),gm=typeof window<"u"&&typeof document<"u"&&window.document===document,fh=(function(){return typeof globalThis<"u"&&globalThis.Math===Math?globalThis:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()})(),bB=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(fh):function(s){return setTimeout(function(){return s(Date.now())},1e3/60)}})(),SB=2;function CB(s,e){var t=!1,i=!1,r=0;function n(){t&&(t=!1,s()),i&&o()}function a(){bB(n)}function o(){var l=Date.now();if(t){if(l-r<SB)return;i=!0}else t=!0,i=!1,setTimeout(a,e);r=l}return o}var EB=20,wB=["top","right","bottom","left","width","height","size","weight"],kB=typeof MutationObserver<"u",xB=(function(){function s(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=CB(this.refresh.bind(this),EB)}return s.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},s.prototype.removeObserver=function(e){var t=this.observers_,i=t.indexOf(e);~i&&t.splice(i,1),!t.length&&this.connected_&&this.disconnect_()},s.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},s.prototype.updateObservers_=function(){var e=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return e.forEach(function(t){return t.broadcastActive()}),e.length>0},s.prototype.connect_=function(){!gm||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),kB?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},s.prototype.disconnect_=function(){!gm||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},s.prototype.onTransitionEnd_=function(e){var t=e.propertyName,i=t===void 0?"":t,r=wB.some(function(n){return!!~i.indexOf(n)});r&&this.refresh()},s.getInstance=function(){return this.instance_||(this.instance_=new s),this.instance_},s.instance_=null,s})(),s2=(function(s,e){for(var t=0,i=Object.keys(e);t<i.length;t++){var r=i[t];Object.defineProperty(s,r,{value:e[r],enumerable:!1,writable:!1,configurable:!0})}return s}),To=(function(s){var e=s&&s.ownerDocument&&s.ownerDocument.defaultView;return e||fh}),a2=id(0,0,0,0);function ph(s){return parseFloat(s)||0}function HT(s){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(i,r){var n=s["border-"+r+"-width"];return i+ph(n)},0)}function AB(s){for(var e=["top","right","bottom","left"],t={},i=0,r=e;i<r.length;i++){var n=r[i],a=s["padding-"+n];t[n]=ph(a)}return t}function IB(s){var e=s.getBBox();return id(0,0,e.width,e.height)}function PB(s){var e=s.clientWidth,t=s.clientHeight;if(!e&&!t)return a2;var i=To(s).getComputedStyle(s),r=AB(i),n=r.left+r.right,a=r.top+r.bottom,o=ph(i.width),l=ph(i.height);if(i.boxSizing==="border-box"&&(Math.round(o+n)!==e&&(o-=HT(i,"left","right")+n),Math.round(l+a)!==t&&(l-=HT(i,"top","bottom")+a)),!NB(s)){var u=Math.round(o+n)-e,c=Math.round(l+a)-t;Math.abs(u)!==1&&(o-=u),Math.abs(c)!==1&&(l-=c)}return id(r.left,r.top,o,l)}var DB=(function(){return typeof SVGGraphicsElement<"u"?function(s){return s instanceof To(s).SVGGraphicsElement}:function(s){return s instanceof To(s).SVGElement&&typeof s.getBBox=="function"}})();function NB(s){return s===To(s).document.documentElement}function LB(s){return gm?DB(s)?IB(s):PB(s):a2}function OB(s){var e=s.x,t=s.y,i=s.width,r=s.height,n=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,a=Object.create(n.prototype);return s2(a,{x:e,y:t,width:i,height:r,top:t,right:e+i,bottom:r+t,left:e}),a}function id(s,e,t,i){return{x:s,y:e,width:t,height:i}}var MB=(function(){function s(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=id(0,0,0,0),this.target=e}return s.prototype.isActive=function(){var e=LB(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},s.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},s})(),RB=(function(){function s(e,t){var i=OB(t);s2(this,{target:e,contentRect:i})}return s})(),BB=(function(){function s(e,t,i){if(this.activeObservations_=[],this.observations_=new n2,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=i}return s.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof To(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new MB(e)),this.controller_.addObserver(this),this.controller_.refresh())}},s.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof To(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},s.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},s.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},s.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(i){return new RB(i.target,i.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},s.prototype.clearActive=function(){this.activeObservations_.splice(0)},s.prototype.hasActive=function(){return this.activeObservations_.length>0},s})(),o2=typeof WeakMap<"u"?new WeakMap:new n2,l2=(function(){function s(e){if(!(this instanceof s))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=xB.getInstance(),i=new BB(e,t,this);o2.set(this,i)}return s})();["observe","unobserve","disconnect"].forEach(function(s){l2.prototype[s]=function(){var e;return(e=o2.get(this))[s].apply(e,arguments)}});var FB=(function(){return typeof fh.ResizeObserver<"u"?fh.ResizeObserver:l2})();ww();kw();xw();Aw();Iw();var Oa=null,qT=null;nv&&window.addEventListener("resize",function(){qT!==window.devicePixelRatio&&(qT=window.devicePixelRatio,Oa=null)});function zT(){if(Oa===null){if(typeof document>"u")return Oa=0,Oa;var s=document.body,e=document.createElement("div");e.classList.add("simplebar-hide-scrollbar"),s.appendChild(e);var t=e.getBoundingClientRect().right;s.removeChild(e),Oa=t}return Oa}var mh=function(e){var t=Array.prototype.reduce.call(e,function(i,r){var n=r.name.match(/data-simplebar-(.+)/);if(n){var a=n[1].replace(/\W+(.)/g,function(o,l){return l.toUpperCase()});switch(r.value){case"true":i[a]=!0;break;case"false":i[a]=!1;break;case void 0:i[a]=!0;break;default:i[a]=r.value}}return i},{});return t};function Kn(s){return!s||!s.ownerDocument||!s.ownerDocument.defaultView?window:s.ownerDocument.defaultView}function tp(s){return!s||!s.ownerDocument?document:s.ownerDocument}var qt=(function(){function s(t,i){var r=this;this.onScroll=function(){var n=Kn(r.el);r.scrollXTicking||(n.requestAnimationFrame(r.scrollX),r.scrollXTicking=!0),r.scrollYTicking||(n.requestAnimationFrame(r.scrollY),r.scrollYTicking=!0)},this.scrollX=function(){r.axis.x.isOverflowing&&(r.showScrollbar("x"),r.positionScrollbar("x")),r.scrollXTicking=!1},this.scrollY=function(){r.axis.y.isOverflowing&&(r.showScrollbar("y"),r.positionScrollbar("y")),r.scrollYTicking=!1},this.onMouseEnter=function(){r.showScrollbar("x"),r.showScrollbar("y")},this.onMouseMove=function(n){r.mouseX=n.clientX,r.mouseY=n.clientY,(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&r.onMouseMoveForAxis("x"),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&r.onMouseMoveForAxis("y")},this.onMouseLeave=function(){r.onMouseMove.cancel(),(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&r.onMouseLeaveForAxis("x"),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&r.onMouseLeaveForAxis("y"),r.mouseX=-1,r.mouseY=-1},this.onWindowResize=function(){r.scrollbarWidth=r.getScrollbarWidth(),r.hideNativeScrollbar()},this.hideScrollbars=function(){r.axis.x.track.rect=r.axis.x.track.el.getBoundingClientRect(),r.axis.y.track.rect=r.axis.y.track.el.getBoundingClientRect(),r.isWithinBounds(r.axis.y.track.rect)||(r.axis.y.scrollbar.el.classList.remove(r.classNames.visible),r.axis.y.isVisible=!1),r.isWithinBounds(r.axis.x.track.rect)||(r.axis.x.scrollbar.el.classList.remove(r.classNames.visible),r.axis.x.isVisible=!1)},this.onPointerEvent=function(n){var a,o;r.axis.x.track.rect=r.axis.x.track.el.getBoundingClientRect(),r.axis.y.track.rect=r.axis.y.track.el.getBoundingClientRect(),(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&(a=r.isWithinBounds(r.axis.x.track.rect)),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&(o=r.isWithinBounds(r.axis.y.track.rect)),(a||o)&&(n.preventDefault(),n.stopPropagation(),n.type==="mousedown"&&(a&&(r.axis.x.scrollbar.rect=r.axis.x.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.x.scrollbar.rect)?r.onDragStart(n,"x"):r.onTrackClick(n,"x")),o&&(r.axis.y.scrollbar.rect=r.axis.y.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.y.scrollbar.rect)?r.onDragStart(n,"y"):r.onTrackClick(n,"y"))))},this.drag=function(n){var a,o=r.axis[r.draggedAxis].track,l=o.rect[r.axis[r.draggedAxis].sizeAttr],u=r.axis[r.draggedAxis].scrollbar,c=r.contentWrapperEl[r.axis[r.draggedAxis].scrollSizeAttr],h=parseInt(r.elStyles[r.axis[r.draggedAxis].sizeAttr],10);n.preventDefault(),n.stopPropagation(),r.draggedAxis==="y"?a=n.pageY:a=n.pageX;var f=a-o.rect[r.axis[r.draggedAxis].offsetAttr]-r.axis[r.draggedAxis].dragOffset,g=f/(l-u.size),C=g*(c-h);r.draggedAxis==="x"&&(C=r.isRtl&&s.getRtlHelpers().isRtlScrollbarInverted?C-(l+u.size):C,C=r.isRtl&&s.getRtlHelpers().isRtlScrollingInverted?-C:C),r.contentWrapperEl[r.axis[r.draggedAxis].scrollOffsetAttr]=C},this.onEndDrag=function(n){var a=tp(r.el),o=Kn(r.el);n.preventDefault(),n.stopPropagation(),r.el.classList.remove(r.classNames.dragging),a.removeEventListener("mousemove",r.drag,!0),a.removeEventListener("mouseup",r.onEndDrag,!0),r.removePreventClickId=o.setTimeout(function(){a.removeEventListener("click",r.preventClick,!0),a.removeEventListener("dblclick",r.preventClick,!0),r.removePreventClickId=null})},this.preventClick=function(n){n.preventDefault(),n.stopPropagation()},this.el=t,this.minScrollbarWidth=20,this.options=Object.assign({},s.defaultOptions,{},i),this.classNames=Object.assign({},s.defaultOptions.classNames,{},this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,!s.instances.has(this.el)&&(this.recalculate=UT(this.recalculate.bind(this),64),this.onMouseMove=UT(this.onMouseMove.bind(this),64),this.hideScrollbars=jT(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=jT(this.onWindowResize.bind(this),64,{leading:!0}),s.getRtlHelpers=TB(s.getRtlHelpers),this.init())}s.getRtlHelpers=function(){var i=document.createElement("div");i.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>';var r=i.firstElementChild;document.body.appendChild(r);var n=r.firstElementChild;r.scrollLeft=0;var a=s.getOffset(r),o=s.getOffset(n);r.scrollLeft=999;var l=s.getOffset(n);return{isRtlScrollingInverted:a.left!==o.left&&o.left-l.left!==0,isRtlScrollbarInverted:a.left!==o.left}},s.getOffset=function(i){var r=i.getBoundingClientRect(),n=tp(i),a=Kn(i);return{top:r.top+(a.pageYOffset||n.documentElement.scrollTop),left:r.left+(a.pageXOffset||n.documentElement.scrollLeft)}};var e=s.prototype;return e.init=function(){s.instances.set(this.el,this),nv&&(this.initDOM(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},e.initDOM=function(){var i=this;if(Array.prototype.filter.call(this.el.children,function(a){return a.classList.contains(i.classNames.wrapper)}).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var r=document.createElement("div"),n=document.createElement("div");r.classList.add(this.classNames.track),n.classList.add(this.classNames.scrollbar),r.appendChild(n),this.axis.x.track.el=r.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=r.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-simplebar","init")},e.initListeners=function(){var i=this,r=Kn(this.el);this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(function(o){i.el.addEventListener(o,i.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(function(o){i.el.addEventListener(o,i.onPointerEvent,{capture:!0,passive:!0})}),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),r.addEventListener("resize",this.onWindowResize);var n=!1,a=r.ResizeObserver||FB;this.resizeObserver=new a(function(){n&&i.recalculate()}),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),r.requestAnimationFrame(function(){n=!0}),this.mutationObserver=new r.MutationObserver(this.recalculate),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},e.recalculate=function(){var i=Kn(this.el);this.elStyles=i.getComputedStyle(this.el),this.isRtl=this.elStyles.direction==="rtl";var r=this.heightAutoObserverEl.offsetHeight<=1,n=this.heightAutoObserverEl.offsetWidth<=1,a=this.contentEl.offsetWidth,o=this.contentWrapperEl.offsetWidth,l=this.elStyles.overflowX,u=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft,this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var c=this.contentEl.scrollHeight,h=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=r?"auto":"100%",this.placeholderEl.style.width=n?a+"px":"auto",this.placeholderEl.style.height=c+"px";var f=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=h>a,this.axis.y.isOverflowing=c>f,this.axis.x.isOverflowing=l==="hidden"?!1:this.axis.x.isOverflowing,this.axis.y.isOverflowing=u==="hidden"?!1:this.axis.y.isOverflowing,this.axis.x.forceVisible=this.options.forceVisible==="x"||this.options.forceVisible===!0,this.axis.y.forceVisible=this.options.forceVisible==="y"||this.options.forceVisible===!0,this.hideNativeScrollbar();var g=this.axis.x.isOverflowing?this.scrollbarWidth:0,C=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&h>o-C,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&c>f-g,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px",this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px",this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")},e.getScrollbarSize=function(i){if(i===void 0&&(i="y"),!this.axis[i].isOverflowing)return 0;var r=this.contentEl[this.axis[i].scrollSizeAttr],n=this.axis[i].track.el[this.axis[i].offsetSizeAttr],a,o=n/r;return a=Math.max(~~(o*n),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(a=Math.min(a,this.options.scrollbarMaxSize)),a},e.positionScrollbar=function(i){if(i===void 0&&(i="y"),!!this.axis[i].isOverflowing){var r=this.contentWrapperEl[this.axis[i].scrollSizeAttr],n=this.axis[i].track.el[this.axis[i].offsetSizeAttr],a=parseInt(this.elStyles[this.axis[i].sizeAttr],10),o=this.axis[i].scrollbar,l=this.contentWrapperEl[this.axis[i].scrollOffsetAttr];l=i==="x"&&this.isRtl&&s.getRtlHelpers().isRtlScrollingInverted?-l:l;var u=l/(r-a),c=~~((n-o.size)*u);c=i==="x"&&this.isRtl&&s.getRtlHelpers().isRtlScrollbarInverted?c+(n-o.size):c,o.el.style.transform=i==="x"?"translate3d("+c+"px, 0, 0)":"translate3d(0, "+c+"px, 0)"}},e.toggleTrackVisibility=function(i){i===void 0&&(i="y");var r=this.axis[i].track.el,n=this.axis[i].scrollbar.el;this.axis[i].isOverflowing||this.axis[i].forceVisible?(r.style.visibility="visible",this.contentWrapperEl.style[this.axis[i].overflowAttr]="scroll"):(r.style.visibility="hidden",this.contentWrapperEl.style[this.axis[i].overflowAttr]="hidden"),this.axis[i].isOverflowing?n.style.display="block":n.style.display="none"},e.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0,this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},e.onMouseMoveForAxis=function(i){i===void 0&&(i="y"),this.axis[i].track.rect=this.axis[i].track.el.getBoundingClientRect(),this.axis[i].scrollbar.rect=this.axis[i].scrollbar.el.getBoundingClientRect();var r=this.isWithinBounds(this.axis[i].scrollbar.rect);r?this.axis[i].scrollbar.el.classList.add(this.classNames.hover):this.axis[i].scrollbar.el.classList.remove(this.classNames.hover),this.isWithinBounds(this.axis[i].track.rect)?(this.showScrollbar(i),this.axis[i].track.el.classList.add(this.classNames.hover)):this.axis[i].track.el.classList.remove(this.classNames.hover)},e.onMouseLeaveForAxis=function(i){i===void 0&&(i="y"),this.axis[i].track.el.classList.remove(this.classNames.hover),this.axis[i].scrollbar.el.classList.remove(this.classNames.hover)},e.showScrollbar=function(i){i===void 0&&(i="y");var r=this.axis[i].scrollbar.el;this.axis[i].isVisible||(r.classList.add(this.classNames.visible),this.axis[i].isVisible=!0),this.options.autoHide&&this.hideScrollbars()},e.onDragStart=function(i,r){r===void 0&&(r="y");var n=tp(this.el),a=Kn(this.el),o=this.axis[r].scrollbar,l=r==="y"?i.pageY:i.pageX;this.axis[r].dragOffset=l-o.rect[this.axis[r].offsetAttr],this.draggedAxis=r,this.el.classList.add(this.classNames.dragging),n.addEventListener("mousemove",this.drag,!0),n.addEventListener("mouseup",this.onEndDrag,!0),this.removePreventClickId===null?(n.addEventListener("click",this.preventClick,!0),n.addEventListener("dblclick",this.preventClick,!0)):(a.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},e.onTrackClick=function(i,r){var n=this;if(r===void 0&&(r="y"),!!this.options.clickOnTrack){var a=Kn(this.el);this.axis[r].scrollbar.rect=this.axis[r].scrollbar.el.getBoundingClientRect();var o=this.axis[r].scrollbar,l=o.rect[this.axis[r].offsetAttr],u=parseInt(this.elStyles[this.axis[r].sizeAttr],10),c=this.contentWrapperEl[this.axis[r].scrollOffsetAttr],h=r==="y"?this.mouseY-l:this.mouseX-l,f=h<0?-1:1,g=f===-1?c-u:c+u,C=function p(){if(f===-1){if(c>g){var b;c-=n.options.clickOnTrackSpeed,n.contentWrapperEl.scrollTo((b={},b[n.axis[r].offsetAttr]=c,b)),a.requestAnimationFrame(p)}}else if(c<g){var I;c+=n.options.clickOnTrackSpeed,n.contentWrapperEl.scrollTo((I={},I[n.axis[r].offsetAttr]=c,I)),a.requestAnimationFrame(p)}};C()}},e.getContentElement=function(){return this.contentEl},e.getScrollElement=function(){return this.contentWrapperEl},e.getScrollbarWidth=function(){try{return getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display==="none"||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:zT()}catch{return zT()}},e.removeListeners=function(){var i=this,r=Kn(this.el);this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(function(n){i.el.removeEventListener(n,i.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(function(n){i.el.removeEventListener(n,i.onPointerEvent,{capture:!0,passive:!0})}),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),r.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.recalculate.cancel(),this.onMouseMove.cancel(),this.hideScrollbars.cancel(),this.onWindowResize.cancel()},e.unMount=function(){this.removeListeners(),s.instances.delete(this.el)},e.isWithinBounds=function(i){return this.mouseX>=i.left&&this.mouseX<=i.left+i.width&&this.mouseY>=i.top&&this.mouseY<=i.top+i.height},e.findChild=function(i,r){var n=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector;return Array.prototype.filter.call(i.children,function(a){return n.call(a,r)})[0]},s})();qt.defaultOptions={autoHide:!0,forceVisible:!1,clickOnTrack:!0,clickOnTrackSpeed:40,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3};qt.instances=new WeakMap;qt.initDOMLoadedElements=function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.removeEventListener("load",this.initDOMLoadedElements),Array.prototype.forEach.call(document.querySelectorAll("[data-simplebar]"),function(s){s.getAttribute("data-simplebar")!=="init"&&!qt.instances.has(s)&&new qt(s,mh(s.attributes))})};qt.removeObserver=function(){this.globalObserver.disconnect()};qt.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this),typeof MutationObserver<"u"&&(this.globalObserver=new MutationObserver(qt.handleMutations),this.globalObserver.observe(document,{childList:!0,subtree:!0})),document.readyState==="complete"||document.readyState!=="loading"&&!document.documentElement.doScroll?window.setTimeout(this.initDOMLoadedElements):(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements))};qt.handleMutations=function(s){s.forEach(function(e){Array.prototype.forEach.call(e.addedNodes,function(t){t.nodeType===1&&(t.hasAttribute("data-simplebar")?!qt.instances.has(t)&&new qt(t,mh(t.attributes)):Array.prototype.forEach.call(t.querySelectorAll("[data-simplebar]"),function(i){i.getAttribute("data-simplebar")!=="init"&&!qt.instances.has(i)&&new qt(i,mh(i.attributes))}))}),Array.prototype.forEach.call(e.removedNodes,function(t){t.nodeType===1&&(t.hasAttribute('[data-simplebar="init"]')?qt.instances.has(t)&&qt.instances.get(t).unMount():Array.prototype.forEach.call(t.querySelectorAll('[data-simplebar="init"]'),function(i){qt.instances.has(i)&&qt.instances.get(i).unMount()}))})})};qt.getOptions=mh;nv&&qt.initHtmlApi();const ir=R.getComponent("Menu"),u2=ir.prototype.createEl;ir.prototype.createEl=function(){const e=u2.call(this);return this.simpleBar=new qt(this.contentEl(),{autoHide:!1}),e};const UB=ir.prototype.contentEl;ir.prototype.contentEl=function(){return this.simpleBar?this.simpleBar.getContentElement():UB.call(this)};const $B=ir.prototype.dispose;ir.prototype.dispose=function(){this.simpleBar&&(this.simpleBar.unMount(),delete this.simpleBar),$B.call(this)};const jB=ir.prototype.addItem;ir.prototype.addItem=function(e){jB.call(this,e),this.simpleBar.recalculate()};const VB=ir.prototype.lockShowing;ir.prototype.lockShowing=function(){VB.call(this),this.simpleBar.recalculate()};ir.prototype.recalculateScrollBar=function(){this.simpleBar.recalculate()};const HB=ir.prototype.handleBlur;ir.prototype.handleBlur=function(e){const t=e.relatedTarget||document.activeElement;this.el().contains(t)||HB.call(this,e)};const WT="cv-active-button",qB=R.getComponent("Menu"),zB=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},WB=R.getComponent("Component"),Fo=R.getComponent("MenuButton");let GB=class extends Fo{createMenu(){const e=new qB(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=R.dom.createEl("li",{className:"vjs-menu-title",innerHTML:zB(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;const i=new WB(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}};const KB=Fo.prototype.pressButton;Fo.prototype.pressButton=function(){KB.call(this),this.inactivityTimeout=this.player_.cache_.inactivityTimeout,this.player_.cache_.inactivityTimeout=0,this.player_.options_.inactivityTimeout=0};const XB=Fo.prototype.unpressButton;Fo.prototype.unpressButton=function(){XB.call(this),this.player_.cache_.inactivityTimeout=this.inactivityTimeout,this.player_.options_.inactivityTimeout=this.inactivityTimeout,this.player_.reportUserActivity()};Fo.prototype.setActive=function(e){e?this.addClass(WT):this.removeClass(WT)};R.registerComponent("MenuButton",GB);const QB=R.getComponent("Component");class c2 extends QB{buildCSSClass(){return`cv-time-wrapper ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}}c2.prototype.options_={children:["currentTimeDisplay","remainingTimeDisplay"]};R.registerComponent("TimeWrapper",c2);const ll=R.getComponent("SeekBar");let YB=class extends ll{handleMouseDown(e){const t=this.player_.preventScrubbingPlugin();t.isEnabled&&this.getMouseTime(e)>t.furthestVisitedTime||(ll.prototype.handleMouseDown.call(this,e),this.player_.addClass("cv-disable-play-pause-feedback"))}handleMouseMove(e){ll.prototype.handleMouseMove.call(this,e),this.update()}getPercent(){const t=this.player_.currentTime()/this.player_.duration();return t>=1?1:t}handleMouseUp(e){ll.prototype.handleMouseUp.call(this,e),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.player_.removeClass("cv-disable-play-pause-feedback")},500)}clamp(e,t,i){return Math.min(Math.max(e,t),i)}getMouseTime(e){return this.clamp(ll.prototype.calculateDistance.call(this,e).x,0,1)*this.player_.duration()}};R.registerComponent("SeekBar",YB);const JB=R.getComponent("Component");class ZB extends JB{buildCSSClass(){return`cv-chapter-bar-load-progress ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}update(e){this.el_.style.width=e*100+"%"}}const e8=R.getComponent("Component");class t8 extends e8{buildCSSClass(){return`cv-chapter-bar-play-progress ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}update(e){e>0&&e<1?this.addClass("cv-current"):this.removeClass("cv-current"),this.el_.style.width=e*100+"%"}}const i8=R.getComponent("Component");class GT extends i8{constructor(e,t){super(e,t),this.playProgress=new t8(this.player_),this.addChild(this.playProgress),this.loadProgress=new ZB(this.player_),this.addChild(this.loadProgress),this.update(),this.updateBuffered(0)}buildCSSClass(){return`cv-chapter-bar-item ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}getCurrentTime(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}update(){const e=this.player_.duration()||3600,t=this.options_.endTime-this.options_.startTime;if(e!==this.duration_){const r=t/e;this.el_.style.width=r*100+"%";const n=this.options_.startTime/e;this.el_.style.left=n*100+"%",this.duration_=e}const i=this.getCurrentTime();i<this.options_.startTime?this.playProgress.update(0):i>this.options_.endTime?this.playProgress.update(1):this.playProgress.update((i-this.options_.startTime)/t)}updateBuffered(e){const t=this.options_.endTime-this.options_.startTime;e<this.options_.startTime?this.loadProgress.update(0):e>this.options_.endTime?this.loadProgress.update(1):this.loadProgress.update((e-this.options_.startTime)/t)}}function h2(s){const e=s.buffered(),t=s.currentTime();let i=0;for(let r=0;r<e.length;r++){const n=e.start(r),a=e.end(r);if(n<=t&&a>=t){i=a;break}}return i}const r8=R.getComponent("Component");class n8 extends r8{buildCSSClass(){return`cv-chapter-bar-items ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}update(){this.children_.forEach(e=>{e.update()})}updateBuffered(){this.children_.forEach(e=>{e.updateBuffered(h2(this.player_))})}}const s8=R.getComponent("SeekBar");class sv extends s8{constructor(e,t){super(e,t),this.onDurationChange=this.onDurationChange.bind(this),this.createChapterItems=this.createChapterItems.bind(this),this.updateBuffered=this.updateBuffered.bind(this),Yt.useChapters(this.player_,this.createChapterItems),this.player_.on("durationchange",this.onDurationChange),this.player_.on("progress",this.updateBuffered),this.createChapterItems(),this.update()}dispose(){this.player_.off("durationchange",this.onDurationChange),this.player_.off("progress",this.updateBuffered),super.dispose()}createEl(){return R.dom.createEl("div",{className:"vjs-progress-holder cv-chapter-seek-bar"},{"aria-label":this.localize("Progress Bar"),role:"progressbar"})}onDurationChange(){this.createChapterItems(),this.update()}update(){const e=super.update();return this.chapterBarItems&&this.chapterBarItems.update(),e}updateBuffered(){this.chapterBarItems.updateBuffered()}bindUpdateListener(e){const t=()=>{this.createChapterItems(),this.updateBuffered()};e.addEventListener("cv:cuechange",t),this.player_.one("dispose",()=>e.removeEventListener("cv:cuechange",t))}createChapterItems(e){var i,r;e&&(this.track_||this.bindUpdateListener(e),this.track_=e);const t=new n8(this.player_);if((r=(i=this.track_)==null?void 0:i.cues)!=null&&r.length&&!this.options_.ignoreChapters)for(let n=0;n<this.track_.cues.length;n++){const a=this.track_.cues[n],o=a.startTime;let l=a.endTime;const u=this.player_.duration();u&&(n===this.track_.cues.length-1&&a.endTime<this.player_.duration()&&(l=this.player_.duration()),l>u&&(l=u));const c=new GT(this.player_,{startTime:o,endTime:l});if(t.addChild(c),u&&l===u)break}else t.addChild(new GT(this.player_,{startTime:0,endTime:this.player_.duration()||3600}));this.chapterBarItems&&this.removeChild(this.chapterBarItems),this.chapterBarItems=t,this.addChild(this.chapterBarItems)}}sv.prototype.options_={children:["playProgressBar"],barName:"playProgressBar"};!R.browser.IS_IOS&&!R.browser.IS_ANDROID&&sv.prototype.options_.children.splice(1,0,"mouseTimeDisplay");R.registerComponent("ChapterSeekBar",sv);const a8=R.getComponent("ProgressControl"),KT="seekBar";class d2 extends a8{constructor(){super(...arguments),this.seekBarName_=KT}setSeekBarName(e){this.seekBarName_=e}getChild(e){return(e==null?void 0:e.toLowerCase())===KT.toLowerCase()&&(e=this.seekBarName_),super.getChild(e)}}d2.prototype.options_={children:[]};R.registerComponent("ProgressControl",d2);function f2(s,e=s){s=s<0?0:s;let t=Math.floor(s%60),i=Math.floor(s/60%60),r=Math.floor(s/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(s)||s===1/0)&&(r=i=t="-"),r=r>0||a>0?r+":":"",i=((r||n>=10)&&i<10?"0"+i:i)+":",t=t<10?"0"+t:t,r+i+t}const o8=R.getComponent("TimeTooltip");class l8 extends o8{constructor(e,t){super(e,t),this.hasCustomChapterText=!1,Yt.useChapters(this.player_,i=>{this.track_=i})}createEl(){const e=super.createEl();return this.chapter_=R.dom.createEl("div"),e.appendChild(this.chapter_),this.time_=R.dom.createEl("div"),e.appendChild(this.time_),e}updateTime(e){const t=this.player_.duration();if(R.dom.textContent(this.time_,f2(e,t)),!(!this.track_||this.hasCustomChapterText)){for(let i=0;i<this.track_.cues.length;i++){const r=this.track_.cues[i],n=r.endTime||t;if(r.startTime<=e&&n>=e){R.dom.textContent(this.chapter_,r.text);return}}R.dom.textContent(this.chapter_,"")}}clearChapterContent(){R.dom.textContent(this.chapter_,"")}updateText(e){R.dom.textContent(this.time_,e)}setCustomChapterText(e){this.hasCustomChapterText=!!e,R.dom.textContent(this.chapter_,e??"")}}R.registerComponent("TimeTooltip",l8);const u8=R.getComponent("Component");class av extends u8{constructor(e,t){super(e,t)}setTrack(e){this.track_=e}createEl(){const e=super.createEl("div",{className:"cv-thumbnail-display"});return this.img_=R.dom.createEl("img"),e.appendChild(this.img_),e}enable(){this.addClass("cv-thumbnail-display-enabled")}disable(){this.removeClass("cv-thumbnail-display-enabled")}parseImageLink(e){const t=e.indexOf("#");if(t===-1)return{src:e,w:0,h:0,x:0,y:0};const i=e.substr(0,t),r=e.substr(t+1);if(r.substr(0,5)!=="xywh=")return{src:e,w:0,h:0,x:0,y:0};const n=this.getScale(),a=r.substr(5).split(",");return{src:i,w:parseInt(a[2])*n,h:parseInt(a[3])*n,x:parseInt(a[0])*n,y:parseInt(a[1])*n}}getScale(){let e=this.options_.scaleFactor;const t=this.player_.whiteboardModePlugin().side;return this.player_.isFullscreen()&&t!=="bottom"&&(e=e*2),e}update(e){var h,f;if(!((f=(h=this.track_)==null?void 0:h.cues)!=null&&f.length))return;const t=e;let i,r=0;for(;r<this.track_.cues.length;){const g=this.track_.cues[r];if(g.startTime<=t&&g.endTime>=t){i=this.parseImageLink(g.text);break}r++}if(!(i!=null&&i.src)){this.disable();return}this.enable();const{src:n,w:a,h:o,x:l,y:u}=i,c=this.getScale();this.img_.src=n,this.img_.style.left=-l+"px",this.img_.style.top=-u+"px",this.img_.style.transformOrigin="0 0",this.img_.style.transform=`scale(${c})`,this.el_.style.width=a+"px",this.el_.style.height=o+"px"}}av.prototype.options_={scaleFactor:1};R.registerComponent("ThumbnailDisplay",av);const c8=R.getComponent("MouseTimeDisplay"),XT="cv-mouse-time-display-force-show";class p2 extends c8{constructor(e,t){super(e,t),Yt.useMetadataTrack(this.player_,"thumbnails",i=>{this.getChild("ThumbnailDisplay").setTrack(i)}),this.update=this.update.bind(this),this.player_.on("durationchange",this.update),this.player_.one("dispose",()=>{this.player_.off("durationchange",this.update)})}update(e,t){this.requestAnimationFrame(()=>{const i=this.getChild("TimeTooltip"),r=this.getChild("ThumbnailDisplay"),n=t*this.player_.duration(),a=this.player_.preventScrubbingPlugin(),o=this.player_.controlBar.getChild("progressControl").getChild(dh);let l=!1;a.isEnabled&&(l=n>a.furthestVisitedTime),l?(this.hide(),o.show(),Jl(o.hide,JE,!1,o)()):(this.show(),o&&o.hide(!0),r.update(n),i.updateTime(n));const u=this.el_.getBoundingClientRect();this.el_.style.marginLeft=-(u.width/2)+"px";const c=e.width*t;c<u.width/2?this.el_.style.left=u.width/2+"px":c>e.width-u.width/2?this.el_.style.left=e.width-u.width/2+"px":this.el_.style.left=e.width*t+"px"})}forceShow(){this.addClass(XT)}removeForceShow(){this.removeClass(XT)}}p2.prototype.options_={children:["ThumbnailDisplay","TimeTooltip"]};R.registerComponent("MouseTimeDisplay",p2);const QT=R.getComponent("ChaptersTrackMenuItem");class h8 extends QT{constructor(e,t){super(e,t),this.nonIconControl=!1,this.thumbnailDisplay=new av(this.player_,{scaleFactor:.5}),this.el().insertBefore(this.thumbnailDisplay.el(),this.el().firstChild),Yt.useMetadataTrack(this.player_,"thumbnails",i=>{this.addClass("cv-has-thumbnails"),this.thumbnailDisplay.setTrack(i),this.thumbnailDisplay.update(this.options_.cue.startTime)})}update(){this.player_&&QT.prototype.update.call(this)}buildCSSClass(){return"vjs-menu-item cv-chapter-menu-item"}createEl(e,t,i){return this.nonIconControl=!0,super.createEl("li",Object.assign({className:this.buildCSSClass(),innerHTML:this.getInnerHTML(),tabIndex:-1},t),i)}getInnerHTML(){const e=this.player_.duration();return`<span class="vjs-menu-item-text cv-chapter-menu-item-text"><p>${this.localize(this.options_.label)}</p><p>(${f2(this.options_.cue.startTime,e)})</p></span>`}}const d8=R.getComponent("ChaptersButton");class f8 extends d8{constructor(e,t,i){super(e,t,i),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0,this.update=this.update.bind(this),this.player_.on("cv-whiteboard-change",this.update),this.player_.on("fullscreenchange",this.update),this.player_.on("dispose",()=>{this.player_.off("cv-whiteboard-change",this.update),this.player_.off("fullscreenchange",this.update)})}buildCSSClass(){return`cv-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`cv-menu-big ${super.buildWrapperCSSClass()}`}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t||t.length<2)return e;for(let i=0,r=t.length;i<r;i++){const n=t[i],a=new h8(this.player_,{track:this.track_,cue:n});e.push(a)}return e}setTrack(e){if(super.setTrack(e),this.track_&&this.track_.kind==="chapters"){e.one("loadeddata",this.update);const t=()=>{this.update(),this.player_.trigger("resizemenus")};e.on("cv:cuechange",t),this.player_.one("dispose",()=>e.off("cv:cueupdate",t))}}update(e){super.update(e)}getCollabsibleName(){return"Chapters"}getCollabsibleValue(){const e=this.track_.activeCues[0];return(e==null?void 0:e.text)||""}showInCollabsibleMenu(){if(!this.track_)return!1;const e=this.track_.cues;return!(!e||!e.length)}showCollapsibleMenu(){this.handleClick(null)}}R.registerComponent("ChaptersButton",f8);const YT=R.getComponent("OffTextTrackMenuItem");let p8=class extends YT{handleClick(e){YT.prototype.handleClick.call(this,e),this.player_.trigger("cv:languageselected")}createEl(e,t,i){return super.createEl("li",{className:"vjs-menu-item",tabIndex:-1,...t,innerHTML:'<span class="vjs-menu-item-text">Off</span>'},i)}};R.registerComponent("OffTextTrackMenuItem",p8);const m8=R.getComponent("TextTrackButton"),g8=R.getComponent("TextTrackMenuItem"),v8=R.getComponent("OffTextTrackMenuItem");let y8=class extends m8{createItems(e=[],t=g8){let i;this.label_&&(i=`${this.label_} off`),e.push(new v8(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<r.length;n++){const a=r[n];if(this.kinds_.indexOf(a.kind)>-1){const o=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return this.player().trigger("resizemenus"),e}};R.registerComponent("TextTrackButton",y8);const JT=R.getComponent("SubsCapsMenuItem");class _8 extends JT{handleClick(e){JT.prototype.handleClick.call(this,e),this.player_.trigger("cv:languageselected")}}const T8=R.getComponent("TextTrackMenuItem");class b8 extends T8{constructor(e){const t={};t.track={player:e,kind:"subtitle",label:"Search Captions",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="SubtitleSearchMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.addClass("cv-subtitle-search-menu-item"),this.controlText(", opens subtitle search"),this.toggleEnabled=this.toggleEnabled.bind(this);const i=this.player_.textTracks();i.addEventListener("selectedlanguagechange",this.toggleEnabled),this.player_.one("dispose",()=>{i.removeEventListener("selectedlanguagechange",this.toggleEnabled)}),this.toggleEnabled()}toggleEnabled(){var t;if(!this.player_)return;const e=Yt.getCurrentTextTrack(this.player_);if(!e){this.addClass("vjs-disabled");return}(t=e.cues)!=null&&t.length?this.removeClass("vjs-disabled"):(this.bindTrackEvents(e),this.addClass("vjs-disabled"))}bindTrackEvents(e){e.removeEventListener("loadeddata",this.toggleEnabled),e.addEventListener("loadeddata",this.toggleEnabled),this.player_.one("dispose",()=>{e.removeEventListener("loadeddata",this.toggleEnabled)})}handleClick(){var t;const e=Yt.getCurrentTextTrack(this.player_);(t=e==null?void 0:e.cues)!=null&&t.length&&this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("subtitleSearchButton").showCollapsibleMenu()})}}const S8=R.getComponent("TextTrackMenuItem");class C8 extends S8{constructor(e){const t={};t.track={player:e,kind:"subtitle",label:"Caption Text Size",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="SubtitleSizeMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.addClass("cv-divider-after-menu-item"),this.addClass("cv-subtitle-size-menu-item"),this.controlText(", opens subtitle size settings")}handleClick(){this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("subtitleSizeButton").showCollapsibleMenu()})}}class E8 extends Pw{constructor(e){super(e)}get name(){return"FormatError"}}const w8={englishName:"Afar",nativeName:"Qafar"},k8={englishName:"Afrikaans",nativeName:"Afrikaans"},x8={englishName:"Aghem",nativeName:"Aghem"},A8={englishName:"Akan",nativeName:"Akan"},I8={englishName:"Amharic",nativeName:"�� ማርኛ"},P8={englishName:"Arabic",nativeName:"العربية"},D8={englishName:"Mapudungun",nativeName:"Mapudungun"},N8={englishName:"Assamese",nativeName:"অসমীয়া"},L8={englishName:"Asu",nativeName:"Kipare"},O8={englishName:"Asturian",nativeName:"asturianu"},M8={englishName:"Azerbaijani",nativeName:"azÉ™rbaycan dili"},R8={englishName:"Bashkir",nativeName:"Башҡорт"},B8={englishName:"Basaa",nativeName:"Ɓ� s� a"},F8={englishName:"Belarusian",nativeName:"Беларуская"},U8={englishName:"Bemba",nativeName:"Ichibemba"},$8={englishName:"Bena",nativeName:"Hibena"},j8={englishName:"Bulgarian",nativeName:"български"},V8={englishName:"Edo",nativeName:"Ẹ̀dó"},H8={englishName:"Bamanankan",nativeName:"bamanakan"},q8={englishName:"Bangla",nativeName:"বাংলা"},z8={englishName:"Tibetan",nativeName:"བོད་ཡིག"},W8={englishName:"Breton",nativeName:"brezhoneg"},G8={englishName:"Bodo",nativeName:"बड़ो"},K8={englishName:"Bosnian",nativeName:"bosanski"},X8={englishName:"Blin",nativeName:"ብሊን"},Q8={englishName:"Catalan",nativeName:"catal� "},Y8={englishName:"Chechen",nativeName:"нохчийн"},J8={englishName:"Chiga",nativeName:"Rukiga"},Z8={englishName:"Cherokee",nativeName:"ᏣᎳᎩ"},e6={englishName:"Corsican",nativeName:"Corsu"},t6={englishName:"Czech",nativeName:"čeÅ¡tina"},i6={englishName:"Church Slavic",nativeName:"церковнослове́нскїй"},r6={englishName:"Welsh",nativeName:"Cymraeg"},n6={englishName:"Danish",nativeName:"dansk"},s6={englishName:"Taita",nativeName:"Kitaita"},a6={englishName:"German",nativeName:"Deutsch"},o6={englishName:"Zarma",nativeName:"Zarmaciine"},l6={englishName:"Lower Sorbian",nativeName:"dolnoserbšćina"},u6={englishName:"Duala",nativeName:"duálá"},c6={englishName:"Divehi",nativeName:"ދިވެހިބަސް"},h6={englishName:"Jola-Fonyi",nativeName:"joola"},d6={englishName:"Dzongkha",nativeName:"རྫོང་ཁ"},f6={englishName:"Embu",nativeName:"KÄ©embu"},p6={englishName:"Ewe",nativeName:"EÊ‹egbe"},m6={englishName:"Greek",nativeName:"Ελληνικά"},g6={englishName:"English",nativeName:"English"},v6={englishName:"Esperanto",nativeName:"esperanto"},y6={englishName:"Spanish",nativeName:"español"},_6={englishName:"Estonian",nativeName:"eesti"},T6={englishName:"Basque",nativeName:"euskara"},b6={englishName:"Ewondo",nativeName:"ewondo"},S6={englishName:"Persian",nativeName:"فارسى"},C6={englishName:"Fulah",nativeName:"Fulah"},E6={englishName:"Finnish",nativeName:"suomi"},w6={englishName:"Filipino",nativeName:"Filipino"},k6={englishName:"Faroese",nativeName:"føroyskt"},x6={englishName:"French",nativeName:"français"},A6={englishName:"Friulian",nativeName:"furlan"},I6={englishName:"Western Frisian",nativeName:"Frysk"},P6={englishName:"Irish",nativeName:"Gaeilge"},D6={englishName:"Scottish Gaelic",nativeName:"G� idhlig"},N6={englishName:"Galician",nativeName:"galego"},L6={englishName:"Guarani",nativeName:"Avañe’ẽ"},O6={englishName:"Alsatian",nativeName:"Elsässisch"},M6={englishName:"Gujarati",nativeName:"ગુજરાતી"},R6={englishName:"Gusii",nativeName:"Ekegusii"},B6={englishName:"Manx",nativeName:"Gaelg"},F6={englishName:"Hausa",nativeName:"Hausa"},U6={englishName:"Hawaiian",nativeName:"ʻŌlelo HawaiÊ»i"},$6={englishName:"Hebrew",nativeName:"עברית"},j6={englishName:"Hindi",nativeName:"हिंदी"},V6={englishName:"Croatian",nativeName:"hrvatski"},H6={englishName:"Upper Sorbian",nativeName:"hornjoserbšćina"},q6={englishName:"Hungarian",nativeName:"magyar"},z6={englishName:"Armenian",nativeName:"Õ€Õ¡ÕµÕ¥Ö€Õ¥Õ¶"},W6={englishName:"Interlingua",nativeName:"interlingua"},G6={englishName:"Ibibio",nativeName:"Ibibio-Efik"},K6={englishName:"Indonesian",nativeName:"Indonesia"},X6={englishName:"Igbo",nativeName:"Igbo"},Q6={englishName:"Yi",nativeName:"ꆈ�� ꁱꂷ"},Y6={englishName:"Icelandic",nativeName:"íslenska"},J6={englishName:"Italian",nativeName:"italiano"},Z6={englishName:"Inuktitut",nativeName:"Inuktitut"},eF={englishName:"Japanese",nativeName:"日本語"},tF={englishName:"Ngomba",nativeName:"Ndaꞌa"},iF={englishName:"Machame",nativeName:"Kimachame"},rF={englishName:"Javanese",nativeName:"Basa Jawa"},nF={englishName:"Georgian",nativeName:"ქა�� თული"},sF={englishName:"Kabyle",nativeName:"Taqbaylit"},aF={englishName:"Kamba",nativeName:"Kikamba"},oF={englishName:"Makonde",nativeName:"Chimakonde"},lF={englishName:"Kabuverdianu",nativeName:"kabuverdianu"},uF={englishName:"Koyra Chiini",nativeName:"Koyra ciini"},cF={englishName:"Kikuyu",nativeName:"Gikuyu"},hF={englishName:"Kazakh",nativeName:"қазақ тілі"},dF={englishName:"Kako",nativeName:"kakÉ”"},fF={englishName:"Greenlandic",nativeName:"kalaallisut"},pF={englishName:"Kalenjin",nativeName:"Kalenjin"},mF={englishName:"Khmer",nativeName:"ភាសាខ្មែរ"},gF={englishName:"Kannada",nativeName:"ಕನ್ನಡ"},vF={englishName:"Korean",nativeName:"한국어"},yF={englishName:"Konkani",nativeName:"कोंकणी"},_F={englishName:"Kanuri",nativeName:"Kanuri"},TF={englishName:"Kashmiri",nativeName:"کٲشُر"},bF={englishName:"Shambala",nativeName:"Kishambaa"},SF={englishName:"Bafia",nativeName:"rikpa"},CF={englishName:"Ripuarian",nativeName:"Kölsch"},EF={englishName:"Central Kurdish",nativeName:"کوردیی ناوەڕاست"},wF={englishName:"Cornish",nativeName:"kernewek"},kF={englishName:"Kyrgyz",nativeName:"Кыргыз"},xF={englishName:"Latin",nativeName:"lingua latÄ«na"},AF={englishName:"Langi",nativeName:"Kɨlaangi"},IF={englishName:"Luxembourgish",nativeName:"Lëtzebuergesch"},PF={englishName:"Ganda",nativeName:"Luganda"},DF={englishName:"Lakota",nativeName:"Lakȟólʼiyapi"},NF={englishName:"Lingala",nativeName:"lingála"},LF={englishName:"Lao",nativeName:"ລາວ"},OF={englishName:"Northern Luri",nativeName:"لۊری شومالی"},MF={englishName:"Lithuanian",nativeName:"lietuvių"},RF={englishName:"Luba-Katanga",nativeName:"Tshiluba"},BF={englishName:"Luo",nativeName:"Dholuo"},FF={englishName:"Luyia",nativeName:"Luluhia"},UF={englishName:"Latvian",nativeName:"latvieÅ¡u"},$F={englishName:"Masai",nativeName:"Maa"},jF={englishName:"Meru",nativeName:"KÄ©mÄ©rÅ©"},VF={englishName:"Morisyen",nativeName:"kreol morisien"},HF={englishName:"Malagasy",nativeName:"Malagasy"},qF={englishName:"Makhuwa-Meetto",nativeName:"Makua"},zF={englishName:"Metaʼ",nativeName:"metaʼ"},WF={englishName:"Maori",nativeName:"Reo Māori"},GF={englishName:"Macedonian",nativeName:"македонски"},KF={englishName:"Malayalam",nativeName:"മലയാളം"},XF={englishName:"Mongolian",nativeName:"Монгол хэл"},QF={englishName:"Manipuri",nativeName:"মৈতৈলোন্"},YF={englishName:"Mohawk",nativeName:"Kanien’kéha"},JF={englishName:"Marathi",nativeName:"मरा�� ी"},ZF={englishName:"Malay",nativeName:"Bahasa Melayu"},eU={englishName:"Maltese",nativeName:"Malti"},tU={englishName:"Mundang",nativeName:"MUNDAÅŠ"},iU={englishName:"Burmese",nativeName:"ဗမာ"},rU={englishName:"Mazanderani",nativeName:"مازرونی"},nU={englishName:"Nama",nativeName:"Khoekhoegowab"},sU={englishName:"Norwegian BokmÃ¥l",nativeName:"norsk bokmÃ¥l"},aU={englishName:"North Ndebele",nativeName:"isiNdebele"},oU={englishName:"Nepali",nativeName:"नेपाली"},lU={englishName:"Dutch",nativeName:"Nederlands"},uU={englishName:"Kwasio",nativeName:"Kwasio"},cU={englishName:"Norwegian Nynorsk",nativeName:"nynorsk"},hU={englishName:"Ngiemboon",nativeName:"Shwóŋò ngiembɔɔn"},dU={englishName:"Norwegian",nativeName:"norsk"},fU={englishName:"N'ko",nativeName:"ߒߞߏ"},pU={englishName:"South Ndebele",nativeName:"isiNdebele"},mU={englishName:"Sesotho sa Leboa",nativeName:"Sesotho sa Leboa"},gU={englishName:"Nuer",nativeName:"Thok Nath"},vU={englishName:"Nyankole",nativeName:"Runyankore"},yU={englishName:"Occitan",nativeName:"Occitan"},_U={englishName:"Oromo",nativeName:"Oromoo"},TU={englishName:"Odia",nativeName:"ଓଡ଼ିଆ"},bU={englishName:"Ossetian",nativeName:"Ирон æвзаг"},SU={englishName:"Punjabi",nativeName:"ਪੰਜਾਬੀ"},CU={englishName:"Papiamento",nativeName:"Papiamentu"},EU={englishName:"Polish",nativeName:"polski"},wU={englishName:"Prussian",nativeName:"prÅ«siskan"},kU={englishName:"Dari",nativeName:"درى"},xU={englishName:"Pashto",nativeName:"پښتو"},AU={englishName:"Portuguese",nativeName:"português"},IU={englishName:"K'iche'",nativeName:"K'iche'"},PU={englishName:"Quechua",nativeName:"runasimi"},DU={englishName:"Romansh",nativeName:"rumantsch"},NU={englishName:"Rundi",nativeName:"Ikirundi"},LU={englishName:"Romanian",nativeName:"română"},OU={englishName:"Rombo",nativeName:"Kihorombo"},MU={englishName:"Russian",nativeName:"русский"},RU={englishName:"Kinyarwanda",nativeName:"Kinyarwanda"},BU={englishName:"Rwa",nativeName:"Kiruwa"},FU={englishName:"Sanskrit",nativeName:"संस्कृत"},UU={englishName:"Sakha",nativeName:"Саха"},$U={englishName:"Samburu",nativeName:"Kisampur"},jU={englishName:"Sangu",nativeName:"Ishisangu"},VU={englishName:"Sindhi",nativeName:"سنڌي"},HU={englishName:"Northern Sami",nativeName:"davvisámegiella"},qU={englishName:"Sena",nativeName:"sena"},zU={englishName:"Koyraboro Senni",nativeName:"Koyraboro senni"},WU={englishName:"Sango",nativeName:"Sängö"},GU={englishName:"Tachelhit",nativeName:"ⵜⴰⵛⵍⵃⵉⵜ"},KU={englishName:"Sinhala",nativeName:"සිංහල"},XU={englishName:"Slovak",nativeName:"slovenčina"},QU={englishName:"Slovenian",nativeName:"slovenščina"},YU={englishName:"Sami (Southern)",nativeName:"Ã¥arjelsaemiengïele"},JU={englishName:"Sami (Lule)",nativeName:"julevusámegiella"},ZU={englishName:"Sami (Inari)",nativeName:"anarâškielâ"},e7={englishName:"Sami (Skolt)",nativeName:"sää´mÇ©iõll"},t7={englishName:"Shona",nativeName:"chiShona"},i7={englishName:"Somali",nativeName:"Soomaali"},r7={englishName:"Albanian",nativeName:"shqip"},n7={englishName:"Serbian",nativeName:"srpski"},s7={englishName:"siSwati",nativeName:"Siswati"},a7={englishName:"Saho",nativeName:"Saho"},o7={englishName:"Sesotho",nativeName:"Sesotho"},l7={englishName:"Swedish",nativeName:"svenska"},u7={englishName:"Kiswahili",nativeName:"Kiswahili"},c7={englishName:"Syriac",nativeName:"ܣܘܪܝܝܐ"},h7={englishName:"Tamil",nativeName:"தமிழ்"},d7={englishName:"Telugu",nativeName:"తెలుగు"},f7={englishName:"Teso",nativeName:"Kiteso"},p7={englishName:"Tajik",nativeName:"Тоҷикӣ"},m7={englishName:"Thai",nativeName:"ไทย"},g7={englishName:"Tigrinya",nativeName:"ትግርኛ"},v7={englishName:"Tigre",nativeName:"ትግረ"},y7={englishName:"Turkmen",nativeName:"Türkmen dili"},_7={englishName:"Setswana",nativeName:"Setswana"},T7={englishName:"Tongan",nativeName:"lea fakatonga"},b7={englishName:"Turkish",nativeName:"Türkçe"},S7={englishName:"Tsonga",nativeName:"Xitsonga"},C7={englishName:"Tatar",nativeName:"Татар"},E7={englishName:"Tasawaq",nativeName:"Tasawaq senni"},w7={englishName:"Central Atlas Tamazight",nativeName:"TamaziÉ£t n laá¹­laá¹£"},k7={englishName:"Uyghur",nativeName:"ئۇيغۇرچە"},x7={englishName:"Ukrainian",nativeName:"українська"},A7={englishName:"Urdu",nativeName:"اُردو"},I7={englishName:"Uzbek",nativeName:"o‘zbek"},P7={englishName:"Vai",nativeName:"ꕙꔤ"},D7={englishName:"Venda",nativeName:"Tshivenḓa"},N7={englishName:"Vietnamese",nativeName:"Tiếng Việt"},L7={englishName:"Volapük",nativeName:"Volapük"},O7={englishName:"Vunjo",nativeName:"Kyivunjo"},M7={englishName:"Walser",nativeName:"Walser"},R7={englishName:"Wolaytta",nativeName:"ወላይታቱ"},B7={englishName:"Wolof",nativeName:"Wolof"},F7={englishName:"isiXhosa",nativeName:"isiXhosa"},U7={englishName:"Soga",nativeName:"Olusoga"},$7={englishName:"Yangben",nativeName:"nuasue"},j7={englishName:"Yiddish",nativeName:"ייִדיש"},V7={englishName:"Yoruba",nativeName:"Èdè Yorùbá"},H7={englishName:"Standard Moroccan Tamazight",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ"},q7={englishName:"Chinese",nativeName:"中文"},z7={englishName:"isiZulu",nativeName:"isiZulu"},vm={aa:w8,"aa-dj":{englishName:"Afar (Djibouti)",nativeName:"Qafar (Yabuuti)"},"aa-er":{englishName:"Afar (Eritrea)",nativeName:"Qafar (Eretria)"},"aa-et":{englishName:"Afar (Ethiopia)",nativeName:"Qafar (Otobbia)"},af:k8,"af-na":{englishName:"Afrikaans (Namibia)",nativeName:"Afrikaans (Namibië)"},"af-za":{englishName:"Afrikaans (South Africa)",nativeName:"Afrikaans (Suid-Afrika)"},agq:x8,"agq-cm":{englishName:"Aghem (Cameroon)",nativeName:"Aghem (K� m� lûŋ)"},ak:A8,"ak-gh":{englishName:"Akan (Ghana)",nativeName:"Akan (Gaana)"},am:I8,"am-et":{englishName:"Amharic (Ethiopia)",nativeName:"�� ማርኛ (ኢትዮጵያ)"},ar:P8,"ar-001":{englishName:"Arabic (World)",nativeName:"العربية (العالم)"},"ar-ae":{englishName:"Arabic (United Arab Emirates)",nativeName:"العربية (الإمارات العربية المتحدة)"},"ar-bh":{englishName:"Arabic (Bahrain)",nativeName:"العربية (البحرين)"},"ar-dj":{englishName:"Arabic (Djibouti)",nativeName:"العربية (جيبوتي)"},"ar-dz":{englishName:"Arabic (Algeria)",nativeName:"العربية (الجزائر)"},"ar-eg":{englishName:"Arabic (Egypt)",nativeName:"العربية (مصر)"},"ar-er":{englishName:"Arabic (Eritrea)",nativeName:"العربية (إريتريا)"},"ar-il":{englishName:"Arabic (Israel)",nativeName:"العربية (إسرائيل)"},"ar-iq":{englishName:"Arabic (Iraq)",nativeName:"العربية (العراق)"},"ar-jo":{englishName:"Arabic (Jordan)",nativeName:"العربية (الأردن)"},"ar-km":{englishName:"Arabic (Comoros)",nativeName:"العربية (جزر القمر)"},"ar-kw":{englishName:"Arabic (Kuwait)",nativeName:"العربية (الكويت)"},"ar-lb":{englishName:"Arabic (Lebanon)",nativeName:"العربية (لبنان)"},"ar-ly":{englishName:"Arabic (Libya)",nativeName:"العربية (ليبيا)"},"ar-ma":{englishName:"Arabic (Morocco)",nativeName:"العربية (المملكة المغربية)"},"ar-mr":{englishName:"Arabic (Mauritania)",nativeName:"العربية (موريتانيا)"},"ar-om":{englishName:"Arabic (Oman)",nativeName:"العربية (عمان)"},"ar-ps":{englishName:"Arabic (Palestinian Authority)",nativeName:"العربية (السلطة الفلسطينية)"},"ar-qa":{englishName:"Arabic (Qatar)",nativeName:"العربية (قطر)"},"ar-sa":{englishName:"Arabic (Saudi Arabia)",nativeName:"العربية (المملكة العربية السعودية)"},"ar-sd":{englishName:"Arabic (Sudan)",nativeName:"العربية (السودان)"},"ar-so":{englishName:"Arabic (Somalia)",nativeName:"العربية (الصومال)"},"ar-ss":{englishName:"Arabic (South Sudan)",nativeName:"العربية (جنوب السودان)"},"ar-sy":{englishName:"Arabic (Syria)",nativeName:"العربية (سوريا)"},"ar-td":{englishName:"Arabic (Chad)",nativeName:"العربية (تشاد)"},"ar-tn":{englishName:"Arabic (Tunisia)",nativeName:"العربية (تونس)"},"ar-ye":{englishName:"Arabic (Yemen)",nativeName:"العربية (اليمن)"},arn:D8,"arn-cl":{englishName:"Mapudungun (Chile)",nativeName:"Mapudungun (Chile)"},as:N8,"as-in":{englishName:"Assamese (India)",nativeName:"অসমীয়া (ভাৰত)"},asa:L8,"asa-tz":{englishName:"Asu (Tanzania)",nativeName:"Kipare (Tadhania)"},ast:O8,"ast-es":{englishName:"Asturian (Spain)",nativeName:"asturianu (España)"},az:M8,"az-cyrl":{englishName:"Azerbaijani (Cyrillic)",nativeName:"Азәрбајҹан дили"},"az-cyrl-az":{englishName:"Azerbaijani (Cyrillic, Azerbaijan)",nativeName:"Азәрбајҹан дили (Азәрбајҹан)"},"az-latn":{englishName:"Azerbaijani (Latin)",nativeName:"AzÉ™rbaycan dili"},"az-latn-az":{englishName:"Azerbaijani (Latin, Azerbaijan)",nativeName:"AzÉ™rbaycan dili (AzÉ™rbaycan)"},ba:R8,"ba-ru":{englishName:"Bashkir (Russia)",nativeName:"Башҡорт (� әсәй)"},bas:B8,"bas-cm":{englishName:"Basaa (Cameroon)",nativeName:"Ɓ� s� a (K� mɛ̀rûn)"},be:F8,"be-by":{englishName:"Belarusian (Belarus)",nativeName:"Беларуская (Беларусь)"},bem:U8,"bem-zm":{englishName:"Bemba (Zambia)",nativeName:"Ichibemba (Zambia)"},bez:$8,"bez-tz":{englishName:"Bena (Tanzania)",nativeName:"Hibena (Hutanzania)"},bg:j8,"bg-bg":{englishName:"Bulgarian (Bulgaria)",nativeName:"български (България)"},bin:V8,"bin-ng":{englishName:"Edo (Nigeria)",nativeName:"Ẹ̀dó (Nigeria)"},bm:H8,"bm-latn":{englishName:"Bamanankan (Latin)",nativeName:"bamanakan"},"bm-latn-ml":{englishName:"Bamanankan (Latin, Mali)",nativeName:"bamanakan (Mali)"},bn:q8,"bn-bd":{englishName:"Bangla (Bangladesh)",nativeName:"বাংলা (বাংলাদেশ)"},"bn-in":{englishName:"Bangla (India)",nativeName:"বাংলা (ভারত)"},bo:z8,"bo-cn":{englishName:"Tibetan (China)",nativeName:"བོད་ཡིག (ཀྲུང་ཧྭ་མི་དམངས་སྤྱི་མཐུན་རྒྱལ་ཁབ།)"},"bo-in":{englishName:"Tibetan (India)",nativeName:"བོད་སྐད་ (རྒྱ་གར་)"},br:W8,"br-fr":{englishName:"Breton (France)",nativeName:"brezhoneg (Frañs)"},brx:G8,"brx-in":{englishName:"Bodo (India)",nativeName:"बड़ो (भारत)"},bs:K8,"bs-cyrl":{englishName:"Bosnian (Cyrillic)",nativeName:"босански"},"bs-cyrl-ba":{englishName:"Bosnian (Cyrillic, Bosnia and Herzegovina)",nativeName:"босански (Босна и Херцеговина)"},"bs-latn":{englishName:"Bosnian (Latin)",nativeName:"bosanski"},"bs-latn-ba":{englishName:"Bosnian (Latin, Bosnia and Herzegovina)",nativeName:"bosanski (Bosna i Hercegovina)"},byn:X8,"byn-er":{englishName:"Blin (Eritrea)",nativeName:"ብሊን (ኤርትራ)"},ca:Q8,"ca-ad":{englishName:"Catalan (Andorra)",nativeName:"catal� (Andorra)"},"ca-es":{englishName:"Catalan (Catalan)",nativeName:"catal� (catal� )"},"ca-es-valencia":{englishName:"Valencian (Spain)",nativeName:"valenci� (Espanya)"},"ca-fr":{englishName:"Catalan (France)",nativeName:"catal� (França)"},"ca-it":{englishName:"Catalan (Italy)",nativeName:"catal� (It� lia)"},ce:Y8,"ce-ru":{englishName:"Chechen (Russia)",nativeName:"нохчийн (� осси)"},cgg:J8,"cgg-ug":{englishName:"Chiga (Uganda)",nativeName:"Rukiga (Uganda)"},chr:Z8,"chr-cher":{englishName:"Cherokee",nativeName:"ᏣᎳᎩ"},"chr-cher-us":{englishName:"Cherokee (Cherokee)",nativeName:"ᏣᎳᎩ (ᏣᎳᎩ)"},co:e6,"co-fr":{englishName:"Corsican (France)",nativeName:"Corsu (Francia)"},cs:t6,"cs-cz":{englishName:"Czech (Czech Republic)",nativeName:"čeÅ¡tina (ÄŒeská republika)"},cu:i6,"cu-ru":{englishName:"Church Slavic (Russia)",nativeName:"церковнослове́нскїй (рѡссі́а)"},cy:r6,"cy-gb":{englishName:"Welsh (United Kingdom)",nativeName:"Cymraeg (Y Deyrnas Unedig)"},da:n6,"da-dk":{englishName:"Danish (Denmark)",nativeName:"dansk (Danmark)"},"da-gl":{englishName:"Danish (Greenland)",nativeName:"dansk (Grønland)"},dav:s6,"dav-ke":{englishName:"Taita (Kenya)",nativeName:"Kitaita (Kenya)"},de:a6,"de-at":{englishName:"German (Austria)",nativeName:"Deutsch (Österreich)"},"de-be":{englishName:"German (Belgium)",nativeName:"Deutsch (Belgien)"},"de-ch":{englishName:"German (Switzerland)",nativeName:"Deutsch (Schweiz)"},"de-de":{englishName:"German (Germany)",nativeName:"Deutsch (Deutschland)"},"de-li":{englishName:"German (Liechtenstein)",nativeName:"Deutsch (Liechtenstein)"},"de-lu":{englishName:"German (Luxembourg)",nativeName:"Deutsch (Luxemburg)"},dje:o6,"dje-ne":{englishName:"Zarma (Niger)",nativeName:"Zarmaciine (Nižer)"},dsb:l6,"dsb-de":{englishName:"Lower Sorbian (Germany)",nativeName:"dolnoserbšćina (Nimska)"},dua:u6,"dua-cm":{englishName:"Duala (Cameroon)",nativeName:"duálá (Cameroun)"},dv:c6,"dv-mv":{englishName:"Divehi (Maldives)",nativeName:"ދިވެހިބަސް (Þ‹Þ¨ÞˆÞ¬Þ€Þ¨ ÞƒÞ§Þ‡Þ°Þ–Þ¬)"},dyo:h6,"dyo-sn":{englishName:"Jola-Fonyi (Senegal)",nativeName:"joola (Senegal)"},dz:d6,"dz-bt":{englishName:"Dzongkha (Bhutan)",nativeName:"རྫོང་ཁ (�� བྲུག)"},ebu:f6,"ebu-ke":{englishName:"Embu (Kenya)",nativeName:"KÄ©embu (Kenya)"},ee:p6,"ee-gh":{englishName:"Ewe (Ghana)",nativeName:"EÊ‹egbe (Ghana nutome)"},"ee-tg":{englishName:"Ewe (Togo)",nativeName:"EÊ‹egbe (Togo nutome)"},el:m6,"el-cy":{englishName:"Greek (Cyprus)",nativeName:"Ελληνικά (Κύπρος)"},"el-gr":{englishName:"Greek (Greece)",nativeName:"Ελληνικά (Ελλάδα)"},en:g6,"en-001":{englishName:"English (World)",nativeName:"English (World)"},"en-029":{englishName:"English (Caribbean)",nativeName:"English (Caribbean)"},"en-150":{englishName:"English (Europe)",nativeName:"English (Europe)"},"en-ag":{englishName:"English (Antigua and Barbuda)",nativeName:"English (Antigua and Barbuda)"},"en-ai":{englishName:"English (Anguilla)",nativeName:"English (Anguilla)"},"en-as":{englishName:"English (American Samoa)",nativeName:"English (American Samoa)"},"en-at":{englishName:"English (Austria)",nativeName:"English (Austria)"},"en-au":{englishName:"English (Australia)",nativeName:"English (Australia)"},"en-bb":{englishName:"English (Barbados)",nativeName:"English (Barbados)"},"en-be":{englishName:"English (Belgium)",nativeName:"English (Belgium)"},"en-bi":{englishName:"English (Burundi)",nativeName:"English (Burundi)"},"en-bm":{englishName:"English (Bermuda)",nativeName:"English (Bermuda)"},"en-bs":{englishName:"English (Bahamas)",nativeName:"English (Bahamas)"},"en-bw":{englishName:"English (Botswana)",nativeName:"English (Botswana)"},"en-bz":{englishName:"English (Belize)",nativeName:"English (Belize)"},"en-ca":{englishName:"English (Canada)",nativeName:"English (Canada)"},"en-cc":{englishName:"English (Cocos (Keeling) Islands)",nativeName:"English (Cocos (Keeling) Islands)"},"en-ch":{englishName:"English (Switzerland)",nativeName:"English (Switzerland)"},"en-ck":{englishName:"English (Cook Islands)",nativeName:"English (Cook Islands)"},"en-cm":{englishName:"English (Cameroon)",nativeName:"English (Cameroon)"},"en-cx":{englishName:"English (Christmas Island)",nativeName:"English (Christmas Island)"},"en-cy":{englishName:"English (Cyprus)",nativeName:"English (Cyprus)"},"en-de":{englishName:"English (Germany)",nativeName:"English (Germany)"},"en-dk":{englishName:"English (Denmark)",nativeName:"English (Denmark)"},"en-dm":{englishName:"English (Dominica)",nativeName:"English (Dominica)"},"en-er":{englishName:"English (Eritrea)",nativeName:"English (Eritrea)"},"en-fi":{englishName:"English (Finland)",nativeName:"English (Finland)"},"en-fj":{englishName:"English (Fiji)",nativeName:"English (Fiji)"},"en-fk":{englishName:"English (Falkland Islands)",nativeName:"English (Falkland Islands)"},"en-fm":{englishName:"English (Micronesia)",nativeName:"English (Micronesia)"},"en-gb":{englishName:"English (United Kingdom)",nativeName:"English (United Kingdom)"},"en-gd":{englishName:"English (Grenada)",nativeName:"English (Grenada)"},"en-gg":{englishName:"English (Guernsey)",nativeName:"English (Guernsey)"},"en-gh":{englishName:"English (Ghana)",nativeName:"English (Ghana)"},"en-gi":{englishName:"English (Gibraltar)",nativeName:"English (Gibraltar)"},"en-gm":{englishName:"English (Gambia)",nativeName:"English (Gambia)"},"en-gu":{englishName:"English (Guam)",nativeName:"English (Guam)"},"en-gy":{englishName:"English (Guyana)",nativeName:"English (Guyana)"},"en-hk":{englishName:"English (Hong Kong SAR)",nativeName:"English (Hong Kong SAR)"},"en-id":{englishName:"English (Indonesia)",nativeName:"English (Indonesia)"},"en-ie":{englishName:"English (Ireland)",nativeName:"English (Ireland)"},"en-il":{englishName:"English (Israel)",nativeName:"English (Israel)"},"en-im":{englishName:"English (Isle of Man)",nativeName:"English (Isle of Man)"},"en-in":{englishName:"English (India)",nativeName:"English (India)"},"en-io":{englishName:"English (British Indian Ocean Territory)",nativeName:"English (British Indian Ocean Territory)"},"en-je":{englishName:"English (Jersey)",nativeName:"English (Jersey)"},"en-jm":{englishName:"English (Jamaica)",nativeName:"English (Jamaica)"},"en-ke":{englishName:"English (Kenya)",nativeName:"English (Kenya)"},"en-ki":{englishName:"English (Kiribati)",nativeName:"English (Kiribati)"},"en-kn":{englishName:"English (Saint Kitts and Nevis)",nativeName:"English (Saint Kitts and Nevis)"},"en-ky":{englishName:"English (Cayman Islands)",nativeName:"English (Cayman Islands)"},"en-lc":{englishName:"English (Saint Lucia)",nativeName:"English (Saint Lucia)"},"en-lr":{englishName:"English (Liberia)",nativeName:"English (Liberia)"},"en-ls":{englishName:"English (Lesotho)",nativeName:"English (Lesotho)"},"en-mg":{englishName:"English (Madagascar)",nativeName:"English (Madagascar)"},"en-mh":{englishName:"English (Marshall Islands)",nativeName:"English (Marshall Islands)"},"en-mo":{englishName:"English (Macao SAR)",nativeName:"English (Macao SAR)"},"en-mp":{englishName:"English (Northern Mariana Islands)",nativeName:"English (Northern Mariana Islands)"},"en-ms":{englishName:"English (Montserrat)",nativeName:"English (Montserrat)"},"en-mt":{englishName:"English (Malta)",nativeName:"English (Malta)"},"en-mu":{englishName:"English (Mauritius)",nativeName:"English (Mauritius)"},"en-mw":{englishName:"English (Malawi)",nativeName:"English (Malawi)"},"en-my":{englishName:"English (Malaysia)",nativeName:"English (Malaysia)"},"en-na":{englishName:"English (Namibia)",nativeName:"English (Namibia)"},"en-nf":{englishName:"English (Norfolk Island)",nativeName:"English (Norfolk Island)"},"en-ng":{englishName:"English (Nigeria)",nativeName:"English (Nigeria)"},"en-nl":{englishName:"English (Netherlands)",nativeName:"English (Netherlands)"},"en-nr":{englishName:"English (Nauru)",nativeName:"English (Nauru)"},"en-nu":{englishName:"English (Niue)",nativeName:"English (Niue)"},"en-nz":{englishName:"English (New Zealand)",nativeName:"English (New Zealand)"},"en-pg":{englishName:"English (Papua New Guinea)",nativeName:"English (Papua New Guinea)"},"en-ph":{englishName:"English (Philippines)",nativeName:"English (Philippines)"},"en-pk":{englishName:"English (Pakistan)",nativeName:"English (Pakistan)"},"en-pn":{englishName:"English (Pitcairn Islands)",nativeName:"English (Pitcairn Islands)"},"en-pr":{englishName:"English (Puerto Rico)",nativeName:"English (Puerto Rico)"},"en-pw":{englishName:"English (Palau)",nativeName:"English (Palau)"},"en-rw":{englishName:"English (Rwanda)",nativeName:"English (Rwanda)"},"en-sb":{englishName:"English (Solomon Islands)",nativeName:"English (Solomon Islands)"},"en-sc":{englishName:"English (Seychelles)",nativeName:"English (Seychelles)"},"en-sd":{englishName:"English (Sudan)",nativeName:"English (Sudan)"},"en-se":{englishName:"English (Sweden)",nativeName:"English (Sweden)"},"en-sg":{englishName:"English (Singapore)",nativeName:"English (Singapore)"},"en-sh":{englishName:"English (St Helena, Ascension, Tristan da Cunha)",nativeName:"English (St Helena, Ascension, Tristan da Cunha)"},"en-si":{englishName:"English (Slovenia)",nativeName:"English (Slovenia)"},"en-sl":{englishName:"English (Sierra Leone)",nativeName:"English (Sierra Leone)"},"en-ss":{englishName:"English (South Sudan)",nativeName:"English (South Sudan)"},"en-sx":{englishName:"English (Sint Maarten)",nativeName:"English (Sint Maarten)"},"en-sz":{englishName:"English (Swaziland)",nativeName:"English (Swaziland)"},"en-tc":{englishName:"English (Turks and Caicos Islands)",nativeName:"English (Turks and Caicos Islands)"},"en-tk":{englishName:"English (Tokelau)",nativeName:"English (Tokelau)"},"en-to":{englishName:"English (Tonga)",nativeName:"English (Tonga)"},"en-tt":{englishName:"English (Trinidad and Tobago)",nativeName:"English (Trinidad and Tobago)"},"en-tv":{englishName:"English (Tuvalu)",nativeName:"English (Tuvalu)"},"en-tz":{englishName:"English (Tanzania)",nativeName:"English (Tanzania)"},"en-ug":{englishName:"English (Uganda)",nativeName:"English (Uganda)"},"en-um":{englishName:"English (U.S. Outlying Islands)",nativeName:"English (U.S. Outlying Islands)"},"en-us":{englishName:"English (United States)",nativeName:"English (United States)"},"en-vc":{englishName:"English (Saint Vincent and the Grenadines)",nativeName:"English (Saint Vincent and the Grenadines)"},"en-vg":{englishName:"English (British Virgin Islands)",nativeName:"English (British Virgin Islands)"},"en-vi":{englishName:"English (U.S. Virgin Islands)",nativeName:"English (U.S. Virgin Islands)"},"en-vu":{englishName:"English (Vanuatu)",nativeName:"English (Vanuatu)"},"en-ws":{englishName:"English (Samoa)",nativeName:"English (Samoa)"},"en-za":{englishName:"English (South Africa)",nativeName:"English (South Africa)"},"en-zm":{englishName:"English (Zambia)",nativeName:"English (Zambia)"},"en-zw":{englishName:"English (Zimbabwe)",nativeName:"English (Zimbabwe)"},eo:v6,"eo-001":{englishName:"Esperanto (World)",nativeName:"esperanto (World)"},es:y6,"es-419":{englishName:"Spanish (Latin America)",nativeName:"español (Latinoamérica)"},"es-ar":{englishName:"Spanish (Argentina)",nativeName:"español (Argentina)"},"es-bo":{englishName:"Spanish (Bolivia)",nativeName:"español (Bolivia)"},"es-cl":{englishName:"Spanish (Chile)",nativeName:"español (Chile)"},"es-co":{englishName:"Spanish (Colombia)",nativeName:"español (Colombia)"},"es-cr":{englishName:"Spanish (Costa Rica)",nativeName:"español (Costa Rica)"},"es-cu":{englishName:"Spanish (Cuba)",nativeName:"español (Cuba)"},"es-do":{englishName:"Spanish (Dominican Republic)",nativeName:"español (República Dominicana)"},"es-ec":{englishName:"Spanish (Ecuador)",nativeName:"español (Ecuador)"},"es-es":{englishName:"Spanish (Spain, International Sort)",nativeName:"español (España, alfabetización internacional)"},"es-gq":{englishName:"Spanish (Equatorial Guinea)",nativeName:"español (Guinea Ecuatorial)"},"es-gt":{englishName:"Spanish (Guatemala)",nativeName:"español (Guatemala)"},"es-hn":{englishName:"Spanish (Honduras)",nativeName:"español (Honduras)"},"es-mx":{englishName:"Spanish (Mexico)",nativeName:"español (México)"},"es-ni":{englishName:"Spanish (Nicaragua)",nativeName:"español (Nicaragua)"},"es-pa":{englishName:"Spanish (Panama)",nativeName:"español (Panamá)"},"es-pe":{englishName:"Spanish (Peru)",nativeName:"español (Perú)"},"es-ph":{englishName:"Spanish (Philippines)",nativeName:"español (Filipinas)"},"es-pr":{englishName:"Spanish (Puerto Rico)",nativeName:"español (Puerto Rico)"},"es-py":{englishName:"Spanish (Paraguay)",nativeName:"español (Paraguay)"},"es-sv":{englishName:"Spanish (El Salvador)",nativeName:"español (El Salvador)"},"es-us":{englishName:"Spanish (United States)",nativeName:"español (Estados Unidos)"},"es-uy":{englishName:"Spanish (Uruguay)",nativeName:"español (Uruguay)"},"es-ve":{englishName:"Spanish (Venezuela)",nativeName:"español (Venezuela)"},et:_6,"et-ee":{englishName:"Estonian (Estonia)",nativeName:"eesti (Eesti)"},eu:T6,"eu-es":{englishName:"Basque (Basque)",nativeName:"euskara (euskara)"},ewo:b6,"ewo-cm":{englishName:"Ewondo (Cameroon)",nativeName:"ewondo (KamÉ™rún)"},fa:S6,"fa-ir":{englishName:"Persian (Iran)",nativeName:"فارسى (ایران)"},ff:C6,"ff-cm":{englishName:"Fulah (Cameroon)",nativeName:"Pulaar (Kameruun)"},"ff-gn":{englishName:"Fulah (Guinea)",nativeName:"Pulaar (Gine)"},"ff-latn":{englishName:"Fulah",nativeName:"Fulah"},"ff-latn-sn":{englishName:"Fulah (Latin, Senegal)",nativeName:"Fulah (Sénégal)"},"ff-mr":{englishName:"Fulah (Mauritania)",nativeName:"Pulaar (Muritani)"},"ff-ng":{englishName:"Fulah (Nigeria)",nativeName:"Pulaar (Nigeria)"},fi:E6,"fi-fi":{englishName:"Finnish (Finland)",nativeName:"suomi (Suomi)"},fil:w6,"fil-ph":{englishName:"Filipino (Philippines)",nativeName:"Filipino (Pilipinas)"},fo:k6,"fo-dk":{englishName:"Faroese (Denmark)",nativeName:"føroyskt (Danmark)"},"fo-fo":{englishName:"Faroese (Faroe Islands)",nativeName:"føroyskt (Føroyar)"},fr:x6,"fr-029":{englishName:"French (Caribbean)",nativeName:"français (caraïbes)"},"fr-be":{englishName:"French (Belgium)",nativeName:"français (Belgique)"},"fr-bf":{englishName:"French (Burkina Faso)",nativeName:"français (Burkina Faso)"},"fr-bi":{englishName:"French (Burundi)",nativeName:"français (Burundi)"},"fr-bj":{englishName:"French (Benin)",nativeName:"français (Bénin)"},"fr-bl":{englishName:"French (Saint Barthélemy)",nativeName:"français (Saint-Barthélemy)"},"fr-ca":{englishName:"French (Canada)",nativeName:"français (Canada)"},"fr-cd":{englishName:"French (Congo DRC)",nativeName:"français (Congo, République démocratique du)"},"fr-cf":{englishName:"French (Central African Republic)",nativeName:"français (République centrafricaine)"},"fr-cg":{englishName:"French (Congo)",nativeName:"français (Congo)"},"fr-ch":{englishName:"French (Switzerland)",nativeName:"français (Suisse)"},"fr-ci":{englishName:"French (Côte d’Ivoire)",nativeName:"français (Côte d’Ivoire)"},"fr-cm":{englishName:"French (Cameroon)",nativeName:"français (Cameroun)"},"fr-dj":{englishName:"French (Djibouti)",nativeName:"français (Djibouti)"},"fr-dz":{englishName:"French (Algeria)",nativeName:"français (Algérie)"},"fr-fr":{englishName:"French (France)",nativeName:"français (France)"},"fr-ga":{englishName:"French (Gabon)",nativeName:"français (Gabon)"},"fr-gf":{englishName:"French (French Guiana)",nativeName:"français (Guyane française)"},"fr-gn":{englishName:"French (Guinea)",nativeName:"français (Guinée)"},"fr-gp":{englishName:"French (Guadeloupe)",nativeName:"français (Guadeloupe)"},"fr-gq":{englishName:"French (Equatorial Guinea)",nativeName:"français (Guinée équatoriale)"},"fr-ht":{englishName:"French (Haiti)",nativeName:"français (Haïti)"},"fr-km":{englishName:"French (Comoros)",nativeName:"français (Comores)"},"fr-lu":{englishName:"French (Luxembourg)",nativeName:"français (Luxembourg)"},"fr-ma":{englishName:"French (Morocco)",nativeName:"français (Maroc)"},"fr-mc":{englishName:"French (Monaco)",nativeName:"français (Monaco)"},"fr-mf":{englishName:"French (Saint Martin)",nativeName:"français (Saint-Martin)"},"fr-mg":{englishName:"French (Madagascar)",nativeName:"français (Madagascar)"},"fr-ml":{englishName:"French (Mali)",nativeName:"français (Mali)"},"fr-mq":{englishName:"French (Martinique)",nativeName:"français (Martinique)"},"fr-mr":{englishName:"French (Mauritania)",nativeName:"français (Mauritanie)"},"fr-mu":{englishName:"French (Mauritius)",nativeName:"français (Maurice)"},"fr-nc":{englishName:"French (New Caledonia)",nativeName:"français (Nouvelle-Calédonie)"},"fr-ne":{englishName:"French (Niger)",nativeName:"français (Niger)"},"fr-pf":{englishName:"French (French Polynesia)",nativeName:"français (Polynésie française)"},"fr-pm":{englishName:"French (Saint Pierre and Miquelon)",nativeName:"français (Saint-Pierre-et-Miquelon)"},"fr-re":{englishName:"French (Réunion)",nativeName:"français (La Réunion)"},"fr-rw":{englishName:"French (Rwanda)",nativeName:"français (Rwanda)"},"fr-sc":{englishName:"French (Seychelles)",nativeName:"français (Seychelles)"},"fr-sn":{englishName:"French (Senegal)",nativeName:"français (Sénégal)"},"fr-sy":{englishName:"French (Syria)",nativeName:"français (Syrie)"},"fr-td":{englishName:"French (Chad)",nativeName:"français (Tchad)"},"fr-tg":{englishName:"French (Togo)",nativeName:"français (Togo)"},"fr-tn":{englishName:"French (Tunisia)",nativeName:"français (Tunisie)"},"fr-vu":{englishName:"French (Vanuatu)",nativeName:"français (Vanuatu)"},"fr-wf":{englishName:"French (Wallis and Futuna)",nativeName:"français (Wallis-et-Futuna)"},"fr-yt":{englishName:"French (Mayotte)",nativeName:"français (Mayotte)"},fur:A6,"fur-it":{englishName:"Friulian (Italy)",nativeName:"furlan (Italie)"},fy:I6,"fy-nl":{englishName:"Western Frisian (Netherlands)",nativeName:"Frysk (Nederlân)"},ga:P6,"ga-ie":{englishName:"Irish (Ireland)",nativeName:"Gaeilge (Éire)"},gd:D6,"gd-gb":{englishName:"Scottish Gaelic (United Kingdom)",nativeName:"G� idhlig (An Rìoghachd Aonaichte)"},gl:N6,"gl-es":{englishName:"Galician (Galician)",nativeName:"galego (galego)"},gn:L6,"gn-py":{englishName:"Guarani (Paraguay)",nativeName:"Avañe’ẽ (Paraguái)"},gsw:O6,"gsw-ch":{englishName:"Alsatian (Switzerland)",nativeName:"Elsässisch (Schwiiz)"},"gsw-fr":{englishName:"Alsatian (France)",nativeName:"Elsässisch (Fr� nkrisch)"},"gsw-li":{englishName:"Alsatian (Liechtenstein)",nativeName:"Elsässisch (Liächteschtäi)"},gu:M6,"gu-in":{englishName:"Gujarati (India)",nativeName:"ગુજરાતી (ભારત)"},guz:R6,"guz-ke":{englishName:"Gusii (Kenya)",nativeName:"Ekegusii (Kenya)"},gv:B6,"gv-im":{englishName:"Manx (Isle of Man)",nativeName:"Gaelg (Ellan Vannin)"},ha:F6,"ha-latn":{englishName:"Hausa (Latin)",nativeName:"Hausa"},"ha-latn-gh":{englishName:"Hausa (Latin, Ghana)",nativeName:"Hausa (Gana)"},"ha-latn-ne":{englishName:"Hausa (Latin, Niger)",nativeName:"Hausa (Nijar)"},"ha-latn-ng":{englishName:"Hausa (Latin, Nigeria)",nativeName:"Hausa (Najeriya)"},haw:U6,"haw-us":{englishName:"Hawaiian (United States)",nativeName:"ʻŌlelo HawaiÊ»i (Ê»Amelika Hui PÅ« Ê»Ia)"},he:$6,"he-il":{englishName:"Hebrew (Israel)",nativeName:"עברית (ישראל)"},hi:j6,"hi-in":{englishName:"Hindi (India)",nativeName:"हिंदी (भारत)"},hr:V6,"hr-ba":{englishName:"Croatian (Bosnia and Herzegovina)",nativeName:"hrvatski (Bosna i Hercegovina)"},"hr-hr":{englishName:"Croatian (Croatia)",nativeName:"hrvatski (Hrvatska)"},hsb:H6,"hsb-de":{englishName:"Upper Sorbian (Germany)",nativeName:"hornjoserbšćina (NÄ›mska)"},hu:q6,"hu-hu":{englishName:"Hungarian (Hungary)",nativeName:"magyar (Magyarország)"},hy:z6,"hy-am":{englishName:"Armenian (Armenia)",nativeName:"Õ€Õ¡ÕµÕ¥Ö€Õ¥Õ¶ (Õ€Õ¡ÕµÕ¡Õ½Õ¿Õ¡Õ¶)"},ia:W6,"ia-001":{englishName:"Interlingua (World)",nativeName:"interlingua (World)"},"ia-fr":{englishName:"Interlingua (France)",nativeName:"interlingua (Francia)"},ibb:G6,"ibb-ng":{englishName:"Ibibio (Nigeria)",nativeName:"Ibibio-Efik (Nigeria)"},id:K6,"id-id":{englishName:"Indonesian (Indonesia)",nativeName:"Indonesia (Indonesia)"},ig:X6,"ig-ng":{englishName:"Igbo (Nigeria)",nativeName:"Igbo (Nigeria)"},ii:Q6,"ii-cn":{englishName:"Yi (China)",nativeName:"ꆈ�� ꁱꂷ (ꍏꉸꏓꂱꇭꉼꇩ)"},is:Y6,"is-is":{englishName:"Icelandic (Iceland)",nativeName:"íslenska (Ísland)"},it:J6,"it-ch":{englishName:"Italian (Switzerland)",nativeName:"italiano (Svizzera)"},"it-it":{englishName:"Italian (Italy)",nativeName:"italiano (Italia)"},"it-sm":{englishName:"Italian (San Marino)",nativeName:"italiano (San Marino)"},iu:Z6,"iu-cans":{englishName:"Inuktitut (Syllabics)",nativeName:"ᐃᓄᒃᑎᑐᑦ"},"iu-cans-ca":{englishName:"Inuktitut (Syllabics, Canada)",nativeName:"ᐃᓄᒃᑎᑐᑦ (ᑲᓇᑕᒥ)"},"iu-latn":{englishName:"Inuktitut (Latin)",nativeName:"Inuktitut"},"iu-latn-ca":{englishName:"Inuktitut (Latin, Canada)",nativeName:"Inuktitut (Kanatami)"},ja:eF,"ja-jp":{englishName:"Japanese (Japan)",nativeName:"日本語 (日本)"},jgo:tF,"jgo-cm":{englishName:"Ngomba (Cameroon)",nativeName:"Ndaꞌa (KamÉ›lûn)"},jmc:iF,"jmc-tz":{englishName:"Machame (Tanzania)",nativeName:"Kimachame (Tanzania)"},jv:rF,"jv-java":{englishName:"Javanese (Javanese)",nativeName:"ꦧꦱꦗꦮ"},"jv-java-id":{englishName:"Javanese (Javanese, Indonesia)",nativeName:"ꦧꦱꦗꦮ (Indonesia)"},"jv-latn":{englishName:"Javanese",nativeName:"Basa Jawa"},"jv-latn-id":{englishName:"Javanese (Indonesia)",nativeName:"Basa Jawa (Indonesia)"},ka:nF,"ka-ge":{englishName:"Georgian (Georgia)",nativeName:"ქა�� თული (საქა�� თველო)"},kab:sF,"kab-dz":{englishName:"Kabyle (Algeria)",nativeName:"Taqbaylit (Lezzayer)"},kam:aF,"kam-ke":{englishName:"Kamba (Kenya)",nativeName:"Kikamba (Kenya)"},kde:oF,"kde-tz":{englishName:"Makonde (Tanzania)",nativeName:"Chimakonde (Tanzania)"},kea:lF,"kea-cv":{englishName:"Kabuverdianu (Cabo Verde)",nativeName:"kabuverdianu (Kabu Verdi)"},khq:uF,"khq-ml":{englishName:"Koyra Chiini (Mali)",nativeName:"Koyra ciini (Maali)"},ki:cF,"ki-ke":{englishName:"Kikuyu (Kenya)",nativeName:"Gikuyu (Kenya)"},kk:hF,"kk-kz":{englishName:"Kazakh (Kazakhstan)",nativeName:"қазақ тілі (Қазақстан)"},kkj:dF,"kkj-cm":{englishName:"Kako (Cameroon)",nativeName:"kakÉ” (KamÉ›run)"},kl:fF,"kl-gl":{englishName:"Greenlandic (Greenland)",nativeName:"kalaallisut (Kalaallit Nunaat)"},kln:pF,"kln-ke":{englishName:"Kalenjin (Kenya)",nativeName:"Kalenjin (Emetab Kenya)"},km:mF,"km-kh":{englishName:"Khmer (Cambodia)",nativeName:"ភាសាខ្មែរ (កម្ពុជា)"},kn:gF,"kn-in":{englishName:"Kannada (India)",nativeName:"ಕನ್ನಡ (ಭಾರತ)"},ko:vF,"ko-kp":{englishName:"Korean (North Korea)",nativeName:"한국어 (조�� 민주주의인민공화국)"},"ko-kr":{englishName:"Korean (Korea)",nativeName:"한국어(대한민국)"},kok:yF,"kok-in":{englishName:"Konkani (India)",nativeName:"कोंकणी (भारत)"},kr:_F,"kr-ng":{englishName:"Kanuri (Nigeria)",nativeName:"Kanuri (Nigeria)"},ks:TF,"ks-arab":{englishName:"Kashmiri (Perso-Arabic)",nativeName:"کٲشُر"},"ks-arab-in":{englishName:"Kashmiri (Perso-Arabic)",nativeName:"کٲشُر (اَربی)"},"ks-deva":{englishName:"Kashmiri (Devanagari)",nativeName:"कॉशुर"},"ks-deva-in":{englishName:"Kashmiri (Devanagari, India)",nativeName:"कॉशुर (India)"},ksb:bF,"ksb-tz":{englishName:"Shambala (Tanzania)",nativeName:"Kishambaa (Tanzania)"},ksf:SF,"ksf-cm":{englishName:"Bafia (Cameroon)",nativeName:"rikpa (kamÉ›rún)"},ksh:CF,"ksh-de":{englishName:"Ripuarian (Germany)",nativeName:"Kölsch (Doütschland)"},ku:EF,"ku-arab":{englishName:"Central Kurdish",nativeName:"کوردیی ناوەڕاست"},"ku-arab-iq":{englishName:"Central Kurdish (Iraq)",nativeName:"کوردیی ناوەڕاست (کوردستان)"},"ku-arab-ir":{englishName:"Kurdish (Perso-Arabic, Iran)",nativeName:"کوردی (ئێران)"},kw:wF,"kw-gb":{englishName:"Cornish (United Kingdom)",nativeName:"kernewek (Rywvaneth Unys)"},ky:kF,"ky-kg":{englishName:"Kyrgyz (Kyrgyzstan)",nativeName:"Кыргыз (Кыргызстан)"},la:xF,"la-001":{englishName:"Latin (World)",nativeName:"lingua latÄ«na (World)"},lag:AF,"lag-tz":{englishName:"Langi (Tanzania)",nativeName:"Kɨlaangi (Taansanía)"},lb:IF,"lb-lu":{englishName:"Luxembourgish (Luxembourg)",nativeName:"Lëtzebuergesch (Lëtzebuerg)"},lg:PF,"lg-ug":{englishName:"Ganda (Uganda)",nativeName:"Luganda (Yuganda)"},lkt:DF,"lkt-us":{englishName:"Lakota (United States)",nativeName:"Lakȟólʼiyapi (MílahaÅ‹ska TÈŸamákÈŸočhe)"},ln:NF,"ln-ao":{englishName:"Lingala (Angola)",nativeName:"lingála (Angóla)"},"ln-cd":{englishName:"Lingala (Congo DRC)",nativeName:"lingála (Repibiki demokratiki ya Kongó)"},"ln-cf":{englishName:"Lingala (Central African Republic)",nativeName:"lingála (Repibiki ya Afríka ya Káti)"},"ln-cg":{englishName:"Lingala (Congo)",nativeName:"lingála (Kongo)"},lo:LF,"lo-la":{englishName:"Lao (Laos)",nativeName:"ລາວ (ລາວ)"},lrc:OF,"lrc-iq":{englishName:"Northern Luri (Iraq)",nativeName:"لۊری شومالی (Iraq)"},"lrc-ir":{englishName:"Northern Luri (Iran)",nativeName:"لۊری شومالی (Iran)"},lt:MF,"lt-lt":{englishName:"Lithuanian (Lithuania)",nativeName:"lietuvių (Lietuva)"},lu:RF,"lu-cd":{englishName:"Luba-Katanga (Congo DRC)",nativeName:"Tshiluba (Ditunga wa Kongu)"},luo:BF,"luo-ke":{englishName:"Luo (Kenya)",nativeName:"Dholuo (Kenya)"},luy:FF,"luy-ke":{englishName:"Luyia (Kenya)",nativeName:"Luluhia (Kenya)"},lv:UF,"lv-lv":{englishName:"Latvian (Latvia)",nativeName:"latvieÅ¡u (Latvija)"},mas:$F,"mas-ke":{englishName:"Masai (Kenya)",nativeName:"Maa (Kenya)"},"mas-tz":{englishName:"Masai (Tanzania)",nativeName:"Maa (Tansania)"},mer:jF,"mer-ke":{englishName:"Meru (Kenya)",nativeName:"KÄ©mÄ©rÅ© (Kenya)"},mfe:VF,"mfe-mu":{englishName:"Morisyen (Mauritius)",nativeName:"kreol morisien (Moris)"},mg:HF,"mg-mg":{englishName:"Malagasy (Madagascar)",nativeName:"Malagasy (Madagasikara)"},mgh:qF,"mgh-mz":{englishName:"Makhuwa-Meetto (Mozambique)",nativeName:"Makua (Umozambiki)"},mgo:zF,"mgo-cm":{englishName:"Metaʼ (Cameroon)",nativeName:"metaʼ (Kamalun)"},mi:WF,"mi-nz":{englishName:"Maori (New Zealand)",nativeName:"Reo Māori (Aotearoa)"},mk:GF,"mk-mk":{englishName:"Macedonian (Macedonia, FYRO)",nativeName:"македонски (� епублика Македонија)"},ml:KF,"ml-in":{englishName:"Malayalam (India)",nativeName:"മലയാളം (ഇന്ത്യ)"},mn:XF,"mn-cyrl":{englishName:"Mongolian",nativeName:"монгол"},"mn-mn":{englishName:"Mongolian (Mongolia)",nativeName:"монгол (Монгол)"},"mn-mong":{englishName:"Mongolian (Traditional Mongolian)",nativeName:"� �� �� �� �� �� �� � � �� �� �� �"},"mn-mong-cn":{englishName:"Mongolian (Traditional Mongolian, China)",nativeName:"� �� �� �� �� �� �� � � �� �� �� � (� �� �� �� �� �� � � �� � �� �� � �� �� � �� � � �� �� �� �� � �� � � � �� � � � �� �� �� �)"},"mn-mong-mn":{englishName:"Mongolian (Traditional Mongolian, Mongolia)",nativeName:"� �� �� �� �� �� �� � � �� �� �� � (� �� �� �� �� �� �� � � �� �� �� �)"},mni:QF,"mni-in":{englishName:"Manipuri (India)",nativeName:"মৈতৈলোন্ (India)"},moh:YF,"moh-ca":{englishName:"Mohawk (Mohawk)",nativeName:"Kanien'kéha"},mr:JF,"mr-in":{englishName:"Marathi (India)",nativeName:"मरा�� ी (भारत)"},ms:ZF,"ms-bn":{englishName:"Malay (Brunei)",nativeName:"Bahasa Melayu (Brunei)"},"ms-my":{englishName:"Malay (Malaysia)",nativeName:"Bahasa Melayu (Malaysia)"},"ms-sg":{englishName:"Malay (Singapore)",nativeName:"Bahasa Melayu (Singapura)"},mt:eU,"mt-mt":{englishName:"Maltese (Malta)",nativeName:"Malti (Malta)"},mua:tU,"mua-cm":{englishName:"Mundang (Cameroon)",nativeName:"MUNDAÅŠ (kameruÅ‹)"},my:iU,"my-mm":{englishName:"Burmese (Myanmar)",nativeName:"ဗမာ (မြန်မာ)"},mzn:rU,"mzn-ir":{englishName:"Mazanderani (Iran)",nativeName:"مازرونی (ایران)"},naq:nU,"naq-na":{englishName:"Nama (Namibia)",nativeName:"Khoekhoegowab (Namibiab)"},nb:sU,"nb-no":{englishName:"Norwegian BokmÃ¥l (Norway)",nativeName:"norsk bokmÃ¥l (Norge)"},"nb-sj":{englishName:"Norwegian BokmÃ¥l (Svalbard and Jan Mayen)",nativeName:"norsk bokmÃ¥l (Svalbard og Jan Mayen)"},nd:aU,"nd-zw":{englishName:"North Ndebele (Zimbabwe)",nativeName:"isiNdebele (Zimbabwe)"},ne:oU,"ne-in":{englishName:"Nepali (India)",nativeName:"नेपाली (भारत)"},"ne-np":{englishName:"Nepali (Nepal)",nativeName:"नेपाली (नेपाल)"},nl:lU,"nl-aw":{englishName:"Dutch (Aruba)",nativeName:"Nederlands (Aruba)"},"nl-be":{englishName:"Dutch (Belgium)",nativeName:"Nederlands (België)"},"nl-bq":{englishName:"Dutch (Bonaire, Sint Eustatius and Saba)",nativeName:"Nederlands (Bonaire, Sint Eustatius en Saba)"},"nl-cw":{englishName:"Dutch (Curaçao)",nativeName:"Nederlands (Curaçao)"},"nl-nl":{englishName:"Dutch (Netherlands)",nativeName:"Nederlands (Nederland)"},"nl-sr":{englishName:"Dutch (Suriname)",nativeName:"Nederlands (Suriname)"},"nl-sx":{englishName:"Dutch (Sint Maarten)",nativeName:"Nederlands (Sint-Maarten)"},nmg:uU,"nmg-cm":{englishName:"Kwasio (Cameroon)",nativeName:"Kwasio (Kamerun)"},nn:cU,"nn-no":{englishName:"Norwegian Nynorsk (Norway)",nativeName:"nynorsk (Noreg)"},nnh:hU,"nnh-cm":{englishName:"Ngiemboon (Cameroon)",nativeName:"Shwóŋò ngiembɔɔn (K� malûm)"},no:dU,nqo:fU,"nqo-gn":{englishName:"N'ko (Guinea)",nativeName:"ߒߞߏ (ߖߌ߬ߣߍ߬ ߞߊ߲ߓߍ߲)"},nr:pU,"nr-za":{englishName:"South Ndebele (South Africa)",nativeName:"isiNdebele (South Africa)"},nso:mU,"nso-za":{englishName:"Sesotho sa Leboa (South Africa)",nativeName:"Sesotho sa Leboa (Afrika Borwa)"},nus:gU,"nus-ss":{englishName:"Nuer (South Sudan)",nativeName:"Thok Nath (South Sudan)"},nyn:vU,"nyn-ug":{englishName:"Nyankole (Uganda)",nativeName:"Runyankore (Uganda)"},oc:yU,"oc-fr":{englishName:"Occitan (France)",nativeName:"Occitan (França)"},om:_U,"om-et":{englishName:"Oromo (Ethiopia)",nativeName:"Oromoo (Itoophiyaa)"},"om-ke":{englishName:"Oromo (Kenya)",nativeName:"Oromoo (Keeniyaa)"},or:TU,"or-in":{englishName:"Odia (India)",nativeName:"ଓଡ଼ିଆ (ଭାରତ)"},os:bU,"os-ge":{englishName:"Ossetian (Georgia)",nativeName:"Ирон æвзаг (Гуырдзыстон)"},"os-ru":{englishName:"Ossetian (Russia)",nativeName:"Ирон æвзаг (Уӕрӕсе)"},pa:SU,"pa-arab":{englishName:"Punjabi",nativeName:"پنجابی"},"pa-arab-pk":{englishName:"Punjabi (Pakistan)",nativeName:"پنجابی (پاکستان)"},"pa-in":{englishName:"Punjabi (India)",nativeName:"ਪੰਜਾਬੀ (ਭਾਰਤ)"},pap:CU,"pap-029":{englishName:"Papiamento (Caribbean)",nativeName:"Papiamentu (Caribbean)"},pl:EU,"pl-pl":{englishName:"Polish (Poland)",nativeName:"polski (Polska)"},prg:wU,"prg-001":{englishName:"Prussian (World)",nativeName:"prÅ«siskan (swÄ«tai)"},prs:kU,"prs-af":{englishName:"Dari (Afghanistan)",nativeName:"درى (افغانستان)"},ps:xU,"ps-af":{englishName:"Pashto (Afghanistan)",nativeName:"پښتو (افغانستان)"},pt:AU,"pt-ao":{englishName:"Portuguese (Angola)",nativeName:"português (Angola)"},"pt-br":{englishName:"Portuguese (Brazil)",nativeName:"português (Brasil)"},"pt-cv":{englishName:"Portuguese (Cabo Verde)",nativeName:"português (Cabo Verde)"},"pt-gw":{englishName:"Portuguese (Guinea-Bissau)",nativeName:"português (Guiné-Bissau)"},"pt-mo":{englishName:"Portuguese (Macao SAR)",nativeName:"português (RAE de Macau)"},"pt-mz":{englishName:"Portuguese (Mozambique)",nativeName:"português (Moçambique)"},"pt-pt":{englishName:"Portuguese (Portugal)",nativeName:"português (Portugal)"},"pt-st":{englishName:"Portuguese (São Tomé and Príncipe)",nativeName:"português (São Tomé e Príncipe)"},"pt-tl":{englishName:"Portuguese (Timor-Leste)",nativeName:"português (Timor-Leste)"},quc:IU,"quc-latn":{englishName:"K'iche'",nativeName:"K'iche'"},"quc-latn-gt":{englishName:"K'iche' (Guatemala)",nativeName:"K'iche' (Guatemala)"},quz:PU,"quz-bo":{englishName:"Quechua (Bolivia)",nativeName:"runasimi (Qullasuyu)"},"quz-ec":{englishName:"Quichua (Ecuador)",nativeName:"runa shimi (Ecuador Suyu)"},"quz-pe":{englishName:"Quechua (Peru)",nativeName:"runasimi (Peru)"},rm:DU,"rm-ch":{englishName:"Romansh (Switzerland)",nativeName:"rumantsch (Svizra)"},rn:NU,"rn-bi":{englishName:"Rundi (Burundi)",nativeName:"Ikirundi (Uburundi)"},ro:LU,"ro-md":{englishName:"Romanian (Moldova)",nativeName:"română (Republica Moldova)"},"ro-ro":{englishName:"Romanian (Romania)",nativeName:"română (România)"},rof:OU,"rof-tz":{englishName:"Rombo (Tanzania)",nativeName:"Kihorombo (Tanzania)"},ru:MU,"ru-by":{englishName:"Russian (Belarus)",nativeName:"русский (Беларусь)"},"ru-kg":{englishName:"Russian (Kyrgyzstan)",nativeName:"русский (Киргизия)"},"ru-kz":{englishName:"Russian (Kazakhstan)",nativeName:"русский (Казахстан)"},"ru-md":{englishName:"Russian (Moldova)",nativeName:"русский (Молдова)"},"ru-ru":{englishName:"Russian (Russia)",nativeName:"русский (� оссия)"},"ru-ua":{englishName:"Russian (Ukraine)",nativeName:"русский (Украина)"},rw:RU,"rw-rw":{englishName:"Kinyarwanda (Rwanda)",nativeName:"Kinyarwanda (Rwanda)"},rwk:BU,"rwk-tz":{englishName:"Rwa (Tanzania)",nativeName:"Kiruwa (Tanzania)"},sa:FU,"sa-in":{englishName:"Sanskrit (India)",nativeName:"संस्कृत (भारतम्)"},sah:UU,"sah-ru":{englishName:"Sakha (Russia)",nativeName:"Саха (� оссия)"},saq:$U,"saq-ke":{englishName:"Samburu (Kenya)",nativeName:"Kisampur (Kenya)"},sbp:jU,"sbp-tz":{englishName:"Sangu (Tanzania)",nativeName:"Ishisangu (Tansaniya)"},sd:VU,"sd-arab":{englishName:"Sindhi",nativeName:"سنڌي"},"sd-arab-pk":{englishName:"Sindhi (Pakistan)",nativeName:"سنڌي (پاکستان)"},"sd-deva":{englishName:"Sindhi (Devanagari)",nativeName:"सिन्धी"},"sd-deva-in":{englishName:"Sindhi (Devanagari, India)",nativeName:"सिन्धी (India)"},se:HU,"se-fi":{englishName:"Sami, Northern (Finland)",nativeName:"davvisámegiella (Suopma)"},"se-no":{englishName:"Sami, Northern (Norway)",nativeName:"davvisámegiella (Norga)"},"se-se":{englishName:"Sami, Northern (Sweden)",nativeName:"davvisámegiella (Ruoŧŧa)"},seh:qU,"seh-mz":{englishName:"Sena (Mozambique)",nativeName:"sena (Moçambique)"},ses:zU,"ses-ml":{englishName:"Koyraboro Senni (Mali)",nativeName:"Koyraboro senni (Maali)"},sg:WU,"sg-cf":{englishName:"Sango (Central African Republic)",nativeName:"Sängö (Ködörösêse tî Bêafrîka)"},shi:GU,"shi-latn":{englishName:"Tachelhit (Latin)",nativeName:"Tashelḥiyt"},"shi-latn-ma":{englishName:"Tachelhit (Latin, Morocco)",nativeName:"Tashelḥiyt (lmÉ£rib)"},"shi-tfng":{englishName:"Tachelhit (Tifinagh)",nativeName:"ⵜⴰⵛⵍⵃⵉⵜ"},"shi-tfng-ma":{englishName:"Tachelhit (Tifinagh, Morocco)",nativeName:"ⵜⴰⵛⵍⵃⵉⵜ (ⵍⵎⵖⵔⵉⴱ)"},si:KU,"si-lk":{englishName:"Sinhala (Sri Lanka)",nativeName:"සිංහල (ශ්‍රී ලංකාව)"},sk:XU,"sk-sk":{englishName:"Slovak (Slovakia)",nativeName:"slovenčina (Slovensko)"},sl:QU,"sl-si":{englishName:"Slovenian (Slovenia)",nativeName:"slovenščina (Slovenija)"},sma:YU,"sma-no":{englishName:"Sami, Southern (Norway)",nativeName:"Ã¥arjelsaemiengïele (Nöörje)"},"sma-se":{englishName:"Sami, Southern (Sweden)",nativeName:"Ã¥arjelsaemiengïele (Sveerje)"},smj:JU,"smj-no":{englishName:"Sami, Lule (Norway)",nativeName:"julevusámegiella (Vuodna)"},"smj-se":{englishName:"Sami, Lule (Sweden)",nativeName:"julevusámegiella (Svierik)"},smn:ZU,"smn-fi":{englishName:"Sami, Inari (Finland)",nativeName:"anarâškielâ (Suomâ)"},sms:e7,"sms-fi":{englishName:"Sami, Skolt (Finland)",nativeName:"sää´mÇ©iõll (Lää´ddjânnam)"},sn:t7,"sn-latn":{englishName:"Shona (Latin)",nativeName:"chiShona (Latin)"},"sn-latn-zw":{englishName:"Shona (Latin, Zimbabwe)",nativeName:"chiShona (Zimbabwe)"},so:i7,"so-dj":{englishName:"Somali (Djibouti)",nativeName:"Soomaali (Jabuuti)"},"so-et":{englishName:"Somali (Ethiopia)",nativeName:"Soomaali (Itoobiya)"},"so-ke":{englishName:"Somali (Kenya)",nativeName:"Soomaali (Kiiniya)"},"so-so":{englishName:"Somali (Somalia)",nativeName:"Soomaali (Soomaaliya)"},sq:r7,"sq-al":{englishName:"Albanian (Albania)",nativeName:"shqip (Shqipëri)"},"sq-mk":{englishName:"Albanian (Macedonia, FYRO)",nativeName:"shqip (Republika e Maqedonisë)"},"sq-xk":{englishName:"Albanian (Kosovo)",nativeName:"shqip (Kosovë)"},sr:n7,"sr-cyrl":{englishName:"Serbian (Cyrillic)",nativeName:"српски"},"sr-cyrl-ba":{englishName:"Serbian (Cyrillic, Bosnia and Herzegovina)",nativeName:"српски (Босна и Херцеговина)"},"sr-cyrl-me":{englishName:"Serbian (Cyrillic, Montenegro)",nativeName:"српски (Црна Гора)"},"sr-cyrl-rs":{englishName:"Serbian (Cyrillic, Serbia)",nativeName:"српски (Србија)"},"sr-cyrl-xk":{englishName:"Serbian (Cyrillic, Kosovo)",nativeName:"српски (Косово)"},"sr-latn":{englishName:"Serbian (Latin)",nativeName:"srpski"},"sr-latn-ba":{englishName:"Serbian (Latin, Bosnia and Herzegovina)",nativeName:"srpski (Bosna i Hercegovina)"},"sr-latn-me":{englishName:"Serbian (Latin, Montenegro)",nativeName:"srpski (Crna Gora)"},"sr-latn-rs":{englishName:"Serbian (Latin, Serbia)",nativeName:"srpski (Srbija)"},"sr-latn-xk":{englishName:"Serbian (Latin, Kosovo)",nativeName:"srpski (Kosovo)"},ss:s7,"ss-sz":{englishName:"siSwati (Swaziland)",nativeName:"siSwati (Swaziland)"},"ss-za":{englishName:"siSwati (South Africa)",nativeName:"siSwati (South Africa)"},ssy:a7,"ssy-er":{englishName:"Saho (Eritrea)",nativeName:"Saho (Eretria)"},st:o7,"st-ls":{englishName:"Sesotho (Lesotho)",nativeName:"Sesotho (Lesotho)"},"st-za":{englishName:"Sesotho (South Africa)",nativeName:"Sesotho (South Africa)"},sv:l7,"sv-ax":{englishName:"Swedish (Ã…land Islands)",nativeName:"svenska (Ã…land)"},"sv-fi":{englishName:"Swedish (Finland)",nativeName:"svenska (Finland)"},"sv-se":{englishName:"Swedish (Sweden)",nativeName:"svenska (Sverige)"},sw:u7,"sw-cd":{englishName:"Kiswahili (Congo DRC)",nativeName:"Kiswahili (Jamhuri ya Kidemokrasia ya Kongo)"},"sw-ke":{englishName:"Kiswahili (Kenya)",nativeName:"Kiswahili (Kenya)"},"sw-tz":{englishName:"Kiswahili (Tanzania)",nativeName:"Kiswahili (Tanzania)"},"sw-ug":{englishName:"Kiswahili (Uganda)",nativeName:"Kiswahili (Uganda)"},syr:c7,"syr-sy":{englishName:"Syriac (Syria)",nativeName:"ܣܘܪܝܝܐ (ܣܘܪܝܐ)"},ta:h7,"ta-in":{englishName:"Tamil (India)",nativeName:"தமிழ் (இந்தியா)"},"ta-lk":{englishName:"Tamil (Sri Lanka)",nativeName:"தமிழ் (இலங்கை)"},"ta-my":{englishName:"Tamil (Malaysia)",nativeName:"தமிழ் (மலேசியா)"},"ta-sg":{englishName:"Tamil (Singapore)",nativeName:"தமிழ் (சிங்கப்பூர்)"},te:d7,"te-in":{englishName:"Telugu (India)",nativeName:"తెలుగు (భారత దేశం)"},teo:f7,"teo-ke":{englishName:"Teso (Kenya)",nativeName:"Kiteso (Kenia)"},"teo-ug":{englishName:"Teso (Uganda)",nativeName:"Kiteso (Uganda)"},tg:p7,"tg-cyrl":{englishName:"Tajik (Cyrillic)",nativeName:"Тоҷикӣ"},"tg-cyrl-tj":{englishName:"Tajik (Cyrillic, Tajikistan)",nativeName:"Тоҷикӣ (Тоҷикистон)"},th:m7,"th-th":{englishName:"Thai (Thailand)",nativeName:"ไทย (ไทย)"},ti:g7,"ti-er":{englishName:"Tigrinya (Eritrea)",nativeName:"ትግርኛ (ኤርትራ)"},"ti-et":{englishName:"Tigrinya (Ethiopia)",nativeName:"ትግርኛ (ኢትዮጵያ)"},tig:v7,"tig-er":{englishName:"Tigre (Eritrea)",nativeName:"ትግረ (ኤርትራ)"},tk:y7,"tk-tm":{englishName:"Turkmen (Turkmenistan)",nativeName:"Türkmen dili (Türkmenistan)"},tn:_7,"tn-bw":{englishName:"Setswana (Botswana)",nativeName:"Setswana (Botswana)"},"tn-za":{englishName:"Setswana (South Africa)",nativeName:"Setswana (Aforika Borwa)"},to:T7,"to-to":{englishName:"Tongan (Tonga)",nativeName:"lea fakatonga (Tonga)"},tr:b7,"tr-cy":{englishName:"Turkish (Cyprus)",nativeName:"Türkçe (Kıbrıs)"},"tr-tr":{englishName:"Turkish (Turkey)",nativeName:"Türkçe (Türkiye)"},ts:S7,"ts-za":{englishName:"Xitsonga (South Africa)",nativeName:"Xitsonga (South Africa)"},tt:C7,"tt-ru":{englishName:"Tatar (Russia)",nativeName:"Татар (� оссия)"},twq:E7,"twq-ne":{englishName:"Tasawaq (Niger)",nativeName:"Tasawaq senni (Nižer)"},tzm:w7,"tzm-arab":{englishName:"Central Atlas Tamazight (Arabic)",nativeName:"أطلس المركزية التامازيتية"},"tzm-arab-ma":{englishName:"Central Atlas Tamazight (Arabic, Morocco)",nativeName:"أطلس المركزية التامازيتية (Morocco)"},"tzm-latn":{englishName:"Central Atlas Tamazight (Latin)",nativeName:"TamaziÉ£t n laá¹­laá¹£"},"tzm-latn-dz":{englishName:"Central Atlas Tamazight (Latin, Algeria)",nativeName:"TamaziÉ£t n laá¹­laá¹£ (Djazaïr)"},"tzm-latn-ma":{englishName:"Central Atlas Tamazight (Latin, Morocco)",nativeName:"TamaziÉ£t n laá¹­laá¹£ (Meṛṛuk)"},"tzm-tfng":{englishName:"Central Atlas Tamazight (Tifinagh)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ"},"tzm-tfng-ma":{englishName:"Central Atlas Tamazight (Tifinagh, Morocco)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ (ⵍⵎⵖⵔⵉⴱ)"},ug:k7,"ug-cn":{englishName:"Uyghur (China)",nativeName:"ئۇيغۇرچە (جۇڭخۇا خەلق جۇمھۇرىيىتى)"},uk:x7,"uk-ua":{englishName:"Ukrainian (Ukraine)",nativeName:"українська (Україна)"},ur:A7,"ur-in":{englishName:"Urdu (India)",nativeName:"اردو (بھارت)"},"ur-pk":{englishName:"Urdu (Pakistan)",nativeName:"اُردو (پاکستان)"},uz:I7,"uz-arab":{englishName:"Uzbek (Perso-Arabic)",nativeName:"اوزبیک"},"uz-arab-af":{englishName:"Uzbek (Perso-Arabic, Afghanistan)",nativeName:"اوزبیک (افغانستان)"},"uz-cyrl":{englishName:"Uzbek (Cyrillic)",nativeName:"Ўзбек"},"uz-cyrl-uz":{englishName:"Uzbek (Cyrillic, Uzbekistan)",nativeName:"Ўзбек (Ўзбекистон)"},"uz-latn":{englishName:"Uzbek (Latin)",nativeName:"o‘zbek"},"uz-latn-uz":{englishName:"Uzbek (Latin, Uzbekistan)",nativeName:"o‘zbek (OÊ»zbekiston)"},vai:P7,"vai-latn":{englishName:"Vai (Latin)",nativeName:"Vai"},"vai-latn-lr":{englishName:"Vai (Latin, Liberia)",nativeName:"Vai (Laibhiya)"},"vai-vaii":{englishName:"Vai (Vai)",nativeName:"ꕙꔤ"},"vai-vaii-lr":{englishName:"Vai (Vai, Liberia)",nativeName:"ꕙꔤ (ꕞꔤꔫꕩ)"},ve:D7,"ve-za":{englishName:"Venda (South Africa)",nativeName:"Tshivenḓa (South Africa)"},vi:N7,"vi-vn":{englishName:"Vietnamese (Vietnam)",nativeName:"Tiếng Việt (Việt Nam)"},vo:L7,"vo-001":{englishName:"Volapük (World)",nativeName:"Volapük (World)"},vun:O7,"vun-tz":{englishName:"Vunjo (Tanzania)",nativeName:"Kyivunjo (Tanzania)"},wae:M7,"wae-ch":{englishName:"Walser (Switzerland)",nativeName:"Walser (Schwiz)"},wal:R7,"wal-et":{englishName:"Wolaytta (Ethiopia)",nativeName:"ወላይታቱ (ኢትዮጵያ)"},wo:B7,"wo-sn":{englishName:"Wolof (Senegal)",nativeName:"Wolof (Senegaal)"},xh:F7,"xh-za":{englishName:"isiXhosa (South Africa)",nativeName:"isiXhosa (eMzantsi Afrika)"},xog:U7,"xog-ug":{englishName:"Soga (Uganda)",nativeName:"Olusoga (Yuganda)"},yav:$7,"yav-cm":{englishName:"Yangben (Cameroon)",nativeName:"nuasue (Kemelún)"},yi:j7,"yi-001":{englishName:"Yiddish (World)",nativeName:"ייִדיש (וועלט)"},yo:V7,"yo-bj":{englishName:"Yoruba (Benin)",nativeName:"Èdè Yorùbá (Orílɛ́ède Bɛ̀nɛ̀)"},"yo-ng":{englishName:"Yoruba (Nigeria)",nativeName:"Èdè Yorùbá (Orílẹ́ède N� ìjírí� )"},zgh:H7,"zgh-tfng":{englishName:"Standard Moroccan Tamazight (Tifinagh)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ"},"zgh-tfng-ma":{englishName:"Standard Moroccan Tamazight (Tifinagh, Morocco)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ (ⵍⵎⵖⵔⵉⴱ)"},zh:q7,"zh-cn":{englishName:"Chinese (Simplified, China)",nativeName:"中文(中国)"},"zh-hans":{englishName:"Chinese (Simplified)",nativeName:"中文(简体)"},"zh-hans-hk":{englishName:"Chinese (Simplified Han, Hong Kong SAR)",nativeName:"中文 (香港特别行政区)"},"zh-hans-mo":{englishName:"Chinese (Simplified Han, Macao SAR)",nativeName:"中文 (澳门特别行政区)"},"zh-hant":{englishName:"Chinese (Traditional)",nativeName:"中文(繁體)"},"zh-hk":{englishName:"Chinese (Traditional, Hong Kong SAR)",nativeName:"中文(香港特別行政區)"},"zh-mo":{englishName:"Chinese (Traditional, Macao SAR)",nativeName:"中文(澳門特別行政區)"},"zh-sg":{englishName:"Chinese (Simplified, Singapore)",nativeName:"中文(新�� 坡)"},"zh-tw":{englishName:"Chinese (Traditional, Taiwan)",nativeName:"中文(台灣)"},zu:z7,"zu-za":{englishName:"isiZulu (South Africa)",nativeName:"isiZulu (i-South Africa)"},"zh-chs":{englishName:"Chinese (Simplified) Legacy",nativeName:"中文(简体) 旧版"},"zh-cht":{englishName:"Chinese (Traditional) Legacy",nativeName:"中文(繁體) 舊版"}};function gh(s){return vm[s.toLowerCase()]}function ZT(s){const e=s.indexOf("-");if(e===-1)return gh(s);const t=s.substring(0,e);return gh(t)}function W7(s){const e={},t=s.toLowerCase();for(const i in vm){const r=vm[i];r.englishName.toLowerCase().indexOf(t)>-1&&(e[i]=r)}return e}const bc={getEnglishName(s){var e;return(e=ZT(s))==null?void 0:e.englishName},getNativeName(s){var e;return(e=ZT(s))==null?void 0:e.nativeName},getFullEnglishName(s){var e;return(e=gh(s))==null?void 0:e.englishName},getFullNativeName(s){var e;return(e=gh(s))==null?void 0:e.nativeName},getEnglishNameContains(s){return W7(s)},VERSION:"1.2.0"},G7={ALLOWED_TAGS:["i","b","u","ruby","rt"]},K7="en-US",X7="English",Q7="subtitles",ip=new Map,ym={getLanguagesOptions:s=>s?s.map(e=>({label:s.length>1?bc.getFullEnglishName(e.language):bc.getEnglishName(e.language),value:e.language,id:e.id,url:e.src})).sort((e,t)=>{const i=e.value.includes(ql)?1:0;return(t.value.includes(ql)?1:0)-i}):[],transformVtt:s=>{if(!s)return[];const e=[],t=new eo.WebVTT.Parser(window,eo.WebVTT.StringDecoder()),i=[];if(t.oncue=function(r){i.push(r)},t.onparsingerror=function(r){e.push(r)},t.parse(s),t.flush(),e.length>0){const r=e.map(n=>n.message).join(", ");Nw.throw(new E8(`Failed to parse WebVTT format: ${r}`))}return i},createTextTrackList:(s,e)=>{const t=document.createElement("video"),i=t.addTextTrack(Q7,e?bc.getEnglishName(e):X7,e||K7);return s.forEach(r=>{i.addCue(r)}),t.textTracks},transformVttToTextTrackList:(s,e,t)=>{const i=`${t}-${e}`;if(ip.has(i))return ip.get(i);if(!s)return null;const r=ym.transformVtt(s),n=ym.createTextTrackList(r,e);return ip.set(i,n),n},sanitizeCueText:s=>Dw.sanitize(s,G7)},eb="transcript-selected-language",ql="en";function tb(s){var e,t;return((e=s.find(i=>i.language.includes(ql)))==null?void 0:e.language)||((t=s[0])==null?void 0:t.language)}function Da(s,e,t){let i=t.initialDeps??[],r;return()=>{var n,a,o,l;let u;t.key&&((n=t.debug)!=null&&n.call(t))&&(u=Date.now());const c=s();if(!(c.length!==i.length||c.some((g,C)=>i[C]!==g)))return r;i=c;let f;if(t.key&&((a=t.debug)!=null&&a.call(t))&&(f=Date.now()),r=e(...c),t.key&&((o=t.debug)!=null&&o.call(t))){const g=Math.round((Date.now()-u)*100)/100,C=Math.round((Date.now()-f)*100)/100,p=C/16,b=(I,L)=>{for(I=String(I);I.length<L;)I=" "+I;return I};console.info(`%c⏱ ${b(C,5)} /${b(g,5)} ms`,`
309
+ font-size: .6rem;
310
+ font-weight: bold;
311
+ color: hsl(${Math.max(0,Math.min(120-120*p,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(l=t==null?void 0:t.onChange)==null||l.call(t,r),r}}function rp(s,e){if(s===void 0)throw new Error("Unexpected undefined");return s}const Y7=(s,e)=>Math.abs(s-e)<1,J7=(s,e,t)=>{let i;return function(...r){s.clearTimeout(i),i=s.setTimeout(()=>e.apply(this,r),t)}},Z7=s=>s,e9=s=>{const e=Math.max(s.startIndex-s.overscan,0),t=Math.min(s.endIndex+s.overscan,s.count-1),i=[];for(let r=e;r<=t;r++)i.push(r);return i},t9=(s,e)=>{const t=s.scrollElement;if(!t)return;const i=s.targetWindow;if(!i)return;const r=a=>{const{width:o,height:l}=a;e({width:Math.round(o),height:Math.round(l)})};if(r(t.getBoundingClientRect()),!i.ResizeObserver)return()=>{};const n=new i.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){r({width:u.inlineSize,height:u.blockSize});return}}r(t.getBoundingClientRect())};s.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return n.observe(t,{box:"border-box"}),()=>{n.unobserve(t)}},ib={passive:!0},rb=typeof window>"u"?!0:"onscrollend"in window,i9=(s,e)=>{const t=s.scrollElement;if(!t)return;const i=s.targetWindow;if(!i)return;let r=0;const n=s.options.useScrollendEvent&&rb?()=>{}:J7(i,()=>{e(r,!1)},s.options.isScrollingResetDelay),a=c=>()=>{const{horizontal:h,isRtl:f}=s.options;r=h?t.scrollLeft*(f&&-1||1):t.scrollTop,n(),e(r,c)},o=a(!0),l=a(!1);l(),t.addEventListener("scroll",o,ib);const u=s.options.useScrollendEvent&&rb;return u&&t.addEventListener("scrollend",l,ib),()=>{t.removeEventListener("scroll",o),u&&t.removeEventListener("scrollend",l)}},r9=(s,e,t)=>{if(e!=null&&e.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[t.options.horizontal?"inlineSize":"blockSize"])}return Math.round(s.getBoundingClientRect()[t.options.horizontal?"width":"height"])},n9=(s,{adjustments:e=0,behavior:t},i)=>{var r,n;const a=s+e;(n=(r=i.scrollElement)==null?void 0:r.scrollTo)==null||n.call(r,{[i.options.horizontal?"left":"top"]:a,behavior:t})};class s9{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const i=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(r=>{r.forEach(n=>{const a=()=>{this._measureElement(n.target,n)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var r;(r=i())==null||r.disconnect(),t=null},observe:r=>{var n;return(n=i())==null?void 0:n.observe(r,{box:"border-box"})},unobserve:r=>{var n;return(n=i())==null?void 0:n.unobserve(r)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([i,r])=>{typeof r>"u"&&delete t[i]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Z7,rangeExtractor:e9,onChange:()=>{},measureElement:r9,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var i,r;(r=(i=this.options).onChange)==null||r.call(i,this,t)},this.maybeNotify=Da(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,n)=>{this.scrollAdjustments=0,this.scrollDirection=n?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=n,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,i)=>{const r=new Map,n=new Map;for(let a=i-1;a>=0;a--){const o=t[a];if(r.has(o.lane))continue;const l=n.get(o.lane);if(l==null||o.end>l.end?n.set(o.lane,o):o.end<l.end&&r.set(o.lane,!0),r.size===this.options.lanes)break}return n.size===this.options.lanes?Array.from(n.values()).sort((a,o)=>a.end===o.end?a.index-o.index:a.end-o.end)[0]:void 0},this.getMeasurementOptions=Da(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,i,r,n,a)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:i,scrollMargin:r,getItemKey:n,enabled:a}),{key:!1}),this.getMeasurements=Da(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:i,scrollMargin:r,getItemKey:n,enabled:a},o)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(c=>{this.itemSizeCache.set(c.key,c.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,l);for(let c=l;c<t;c++){const h=n(c),f=this.options.lanes===1?u[c-1]:this.getFurthestMeasurement(u,c),g=f?f.end+this.options.gap:i+r,C=o.get(h),p=typeof C=="number"?C:this.options.estimateSize(c),b=g+p,I=f?f.lane:c%this.options.lanes;u[c]={index:c,start:g,size:p,end:b,key:h,lane:I}}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Da(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,i,r,n)=>this.range=t.length>0&&i>0?a9({measurements:t,outerSize:i,scrollOffset:r,lanes:n}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Da(()=>{let t=null,i=null;const r=this.calculateRange();return r&&(t=r.startIndex,i=r.endIndex),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,i]},(t,i,r,n,a)=>n===null||a===null?[]:t({startIndex:n,endIndex:a,overscan:i,count:r}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const i=this.options.indexAttribute,r=t.getAttribute(i);return r?parseInt(r,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this._measureElement=(t,i)=>{const r=this.indexFromElement(t),n=this.measurementsCache[r];if(!n)return;const a=n.key,o=this.elementsCache.get(a);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(a,t)),t.isConnected&&this.resizeItem(r,this.options.measureElement(t,i,this))},this.resizeItem=(t,i)=>{const r=this.measurementsCache[t];if(!r)return;const n=this.itemSizeCache.get(r.key)??r.size,a=i-n;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,a,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,i)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((i,r)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(r))});return}this._measureElement(t,void 0)},this.getVirtualItems=Da(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,i)=>{const r=[];for(let n=0,a=t.length;n<a;n++){const o=t[n],l=i[o];r.push(l)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const i=this.getMeasurements();if(i.length!==0)return rp(i[m2(0,i.length-1,r=>rp(i[r]).start,t)])},this.getOffsetForAlignment=(t,i,r=0)=>{const n=this.getSize(),a=this.getScrollOffset();i==="auto"&&(i=t>=a+n?"end":"start"),i==="center"?t+=(r-n)/2:i==="end"&&(t-=n);const o=this.options.horizontal?"scrollWidth":"scrollHeight",u=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[o]:this.scrollElement[o]:0)-n;return Math.max(Math.min(u,t),0)},this.getOffsetForIndex=(t,i="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const r=this.measurementsCache[t];if(!r)return;const n=this.getSize(),a=this.getScrollOffset();if(i==="auto")if(r.end>=a+n-this.options.scrollPaddingEnd)i="end";else if(r.start<=a+this.options.scrollPaddingStart)i="start";else return[a,i];const o=i==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,i,r.size),i]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(t,{align:i="start",behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,i),{adjustments:void 0,behavior:r})},this.scrollToIndex=(t,{align:i="auto",behavior:r}={})=>{t=Math.max(0,Math.min(t,this.options.count-1)),this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const n=this.getOffsetForIndex(t,i);if(!n)return;const[a,o]=n;this._scrollToOffset(a,{adjustments:void 0,behavior:r}),r!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(t))){const[u]=rp(this.getOffsetForIndex(t,o));Y7(u,this.getScrollOffset())||this.scrollToIndex(t,{align:o,behavior:r})}else this.scrollToIndex(t,{align:o,behavior:r})}))},this.scrollBy=(t,{behavior:i}={})=>{this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:i})},this.getTotalSize=()=>{var t;const i=this.getMeasurements();let r;return i.length===0?r=this.options.paddingStart:r=this.options.lanes===1?((t=i[i.length-1])==null?void 0:t.end)??0:Math.max(...i.slice(-this.options.lanes).map(n=>n.end)),Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:i,behavior:r})=>{this.options.scrollToFn(t,{behavior:r,adjustments:i},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const m2=(s,e,t,i)=>{for(;s<=e;){const r=(s+e)/2|0,n=t(r);if(n<i)s=r+1;else if(n>i)e=r-1;else return r}return s>0?s-1:0};function a9({measurements:s,outerSize:e,scrollOffset:t,lanes:i}){const r=s.length-1;let a=m2(0,r,l=>s[l].start,t),o=a;for(;o<r&&s[o].end<t+e;)o++;return i>1&&(a=Math.max(0,a-a%i),o=Math.min(r,o+(i-1-o%i))),{startIndex:a,endIndex:o}}const nb=typeof document<"u"?Us.useLayoutEffect:Us.useEffect;function o9(s){const e=Us.useReducer(()=>({}),{})[1],t={...s,onChange:(r,n)=>{var a;n?Lw.flushSync(e):e(),(a=s.onChange)==null||a.call(s,r,n)}},[i]=Us.useState(()=>new s9(t));return i.setOptions(t),nb(()=>i._didMount(),[]),nb(()=>i._willUpdate()),i}function l9(s){return o9({observeElementRect:t9,observeElementOffset:i9,scrollToFn:n9,...s})}function u9(s){function e(i){const r=Array.from((i==null?void 0:i.activeCues)||[]);if(!r.length)return;const n=s.cuesToDisplay.findIndex(a=>a.startTime===Ow.last(r).startTime);if(n===-1){s.setCurrentCueIndex(null);return}s.setCurrentCueIndex(n)}Pt.useEffect(()=>{s.hasStarted&&e(s.currentTranscriptTrack)},[s.hasStarted]);function t(){e(s.currentTranscriptTrack)}Pt.useEffect(()=>(s.currentTranscriptTrack&&s.currentTranscriptTrack.addEventListener("cuechange",t),()=>{var i;return(i=s.currentTranscriptTrack)==null?void 0:i.removeEventListener("cuechange",t)}),[s.currentTranscriptTrack])}function c9(s,e,t){function i(r){t&&t.scrollToIndex(r,{align:"start"})}return Pt.useEffect(()=>{!e||typeof s!="number"||i(s)},[s,e,t]),i}const sb=/\n/g;function h9({cuesToDisplay:s,resetHighlightedCues:e,setHighlightedCues:t,scrollToCue:i}){const[r,n]=Pt.useState(""),[a,o]=Pt.useState(null),[l,u]=Pt.useState(0),[,c]=Pt.useTransition();function h(p){n(p),l!==0&&u(0),c(()=>{f(p)})}function f(p){if(!p.length){o(null),e();return}const b=new RegExp(p.replace(sb," "),"gi"),I=[];let L=0;const F=s.map((V,B)=>{const O=V.text,M=O.replace(sb," ").matchAll(b);if(M.length===0)return Object.assign(V,{nodes:[{text:O,searchResultIndex:null}]});const U=[];let w=0;return M.forEach((P,Q)=>{const G=P[0],K=P.index;K>w&&U.push({text:O.substring(w,K),searchResultIndex:null}),U.push({text:G,searchResultIndex:L}),L++,I.push({cueIndex:B,cueMatchIndex:Q}),w=K+G.length}),w<O.length&&U.push({text:O.substring(w),searchResultIndex:null}),Object.assign(V,{nodes:U})});o(I),t(F),I.length&&i(I[0].cueIndex)}function g(p){const b=a[p];b&&(u(p),i(b.cueIndex))}function C(){o(null),n(""),u(0),e()}return{isSearching:a!==null,searchQuery:r,onSearch:h,jumpToSearchResult:g,totalSearchResults:a==null?void 0:a.length,currentSearchResultIndex:l,resetSearchResults:C}}function d9(s){return oe.jsx("svg",{...s,children:oe.jsx("path",{fill:"currentColor",d:"M4 5.5A1.5 1.5 0 0 1 5.5 4h9A1.5 1.5 0 0 1 16 5.5v1a.5.5 0 0 1-1 0v-1a.5.5 0 0 0-.5-.5h-9a.5.5 0 0 0-.5.5V15a.5.5 0 0 0 .5.5h1a.5.5 0 0 1 0 1h-1A1.5 1.5 0 0 1 4 15zM7.5 9A1.5 1.5 0 0 1 9 7.5h9.5A1.5 1.5 0 0 1 20 9v9.5a1.5 1.5 0 0 1-1.5 1.5H9a1.5 1.5 0 0 1-1.5-1.5zM9 8.5a.5.5 0 0 0-.5.5v9.5a.5.5 0 0 0 .5.5h9.5a.5.5 0 0 0 .5-.5V9a.5.5 0 0 0-.5-.5z"})})}const f9="_hide_i94hz_1",p9="_show_i94hz_4",ab={hide:f9,show:p9},m9="shared.copyContentIconButton",ob=Th.encloseNamespace(m9);function g9(s){const[e,t]=Pt.useState(!1);return Pt.useEffect(()=>{if(!e)return;const i=window.setTimeout(()=>{t(!1)},1e3);return()=>window.clearTimeout(i)},[e]),oe.jsx(Cm,{title:ob(e?"copied":"copy"),spanHack:!0,spanHackClassName:s.tooltipClassName||"",children:oe.jsx(ja,{"aria-label":"Copy to clipboard",className:s.visible?ab.show:ab.hide,onClick:i=>{i.stopPropagation(),navigator.clipboard.writeText(s.copyableContent).then(()=>{var r;t(!0),(r=s.onClick)==null||r.call(s)})},children:oe.jsx(_n,{svg:d9,size:s.iconSize||dp.Small})})})}const v9="_timePoint_1jw83_1",y9="_wide_1jw83_6",_9="_item_1jw83_9",T9="_inPlayer_1jw83_9",ul={timePoint:v9,wide:y9,item:_9,inPlayer:T9};function b9(s){const e=s.currentTimePoint===s.timePoint,[t,i]=Ub(),r=ak.ToDisplayDuration(s.timePoint*1e3);return oe.jsxs("section",{...s.isAuthenticated&&{role:"button"},className:`d-flex p-2 align-items-center cursor-pointer rounded text-dark ${s.inPlayer?ul.inPlayer:""} ${s.isAuthenticated?"cursor-pointer":""} ${ul.item} ${e?"bg-gray-100":""}`,id:s.timePoint.toString(),onClick:()=>{s.onClick(),Jn.logUserAction({...s.analyticsData,cueIndex:s.cueIndex},{...s.analyticsOptions,descriptor:Mw.TranscriptTimepoint,actionType:ci.Click})},ref:t,children:[oe.jsx("p",{className:"mb-0 d-flex flex-column align-items-center",children:oe.jsx("time",{dateTime:`PT${s.timePoint}S`,"aria-label":`time-stamp-${r}`,className:`bg-light-blue text-info rounded-pill d-inline py-1 text-center ${ul.timePoint} ${s.wideTimeTag?ul.wide:""} ${e?"bg-white":""}`,children:r})}),oe.jsx("p",{className:"ms-3 w-100 mb-0",children:s.nodes.map((n,a)=>{const o=ym.sanitizeCueText(n.text);return n.searchResultIndex===null?oe.jsx("span",{dangerouslySetInnerHTML:{__html:o}},a):oe.jsx("mark",{className:`${ul.mark} ${n.searchResultIndex===s.currentSearchResultIndex?"bg-orange":"bg-yellow"}`,dangerouslySetInnerHTML:{__html:o}},a)})}),oe.jsx(g9,{copyableContent:s.transcript,visible:i,onClick:()=>{Jn.logUserAction({...s.analyticsData,cueIndex:s.cueIndex},{...s.analyticsOptions,actionType:ci.Copy})}})]})}function S9(s){var i;const e=s.cuesToDisplay.some(r=>r.startTime>=3600),t=new Map;return s.chapters.forEach((r,n)=>{const a=s.cuesToDisplay.findIndex(o=>o.startTime>r.startTime);t.set(a,n)}),oe.jsx("article",{"aria-label":"transcript",className:"w-100 position-relative",style:{height:s.virtualizer.getTotalSize()},children:oe.jsx("div",{className:"w-100 position-absolute top-0 start-0",style:{transform:`translateY(${((i=s.items[0])==null?void 0:i.start)??0}px)`},children:s.items.map(r=>{var u;const n=r.index,a=s.cuesToDisplay[n];let o=!1,l="";return t.has(n)&&(o=!0,l=s.chapters[t.get(n)].name),oe.jsxs("section",{className:s.inPlayer?"":"px-3",ref:s.virtualizer.measureElement,"data-index":n,children:[o&&oe.jsx("h3",{className:`${t.get(n)!==0?"mt-2":""} my-2 h6 ${s.inPlayer?"px-2":""}`,children:oe.jsx("span",{children:l})}),oe.jsx(b9,{timePoint:a.startTime,transcript:a.text,nodes:a.nodes,onClick:()=>s.onClickTranscriptionItem(a),currentTimePoint:(u=s.timepoint)==null?void 0:u.startTime,currentSearchResultIndex:s.currentSearchResultIndex,wideTimeTag:!!e,inPlayer:s.inPlayer,analyticsOptions:s.analyticsOptions,analyticsData:s.analyticsData,cueIndex:n,isAuthenticated:s.isAuthenticated})]},a.startTime)})})})}function C9(s){return oe.jsx("svg",{...s,children:oe.jsx("path",{d:"m12.733 8.305 5.963 5.906a1.046 1.046 0 0 1 0 1.473l-.01.011a1.034 1.034 0 0 1-1.467 0L12 10.526l-5.22 5.17a1.034 1.034 0 0 1-1.465 0l-.011-.012a1.046 1.046 0 0 1 0-1.473l5.963-5.906a1.034 1.034 0 0 1 1.466 0",fill:"currentColor"})})}const E9="_inputWithoutHighlight_1bbmu_1",w9="_inputFocus_1bbmu_5",k9="_inputBlur_1bbmu_9",x9="_cursor_1bbmu_13",rc={inputWithoutHighlight:E9,inputFocus:w9,inputBlur:k9,cursor:x9},A9="playPage.transcriptSearchBar",nc=Th.encloseNamespace(A9);function I9(s){const e=Pt.useRef(null),[t,i]=Pt.useState(!1);function r(C){Jn.logUserAction({...s.analyticsData,query:C},{...s.analyticsOptions,actionType:ci.Search,descriptor:C?Mu.SearchTranscript:Mu.ResetResults})}const n=Pt.useCallback(Rw.debounce(C=>r(C),500),[]);function a(){Jn.logUserAction({...s.analyticsData,query:s.query},{...s.analyticsOptions,actionType:ci.Search,descriptor:Mu.NextResult}),s.currentSearchResultIndex===s.totalSearchResults-1?s.jumpToSearchResult(0):s.jumpToSearchResult(s.currentSearchResultIndex+1)}function o(){Jn.logUserAction({...s.analyticsData,query:s.query},{...s.analyticsOptions,actionType:ci.Search,descriptor:Mu.PreviousResult}),s.currentSearchResultIndex===0?s.jumpToSearchResult(s.totalSearchResults-1):s.jumpToSearchResult(s.currentSearchResultIndex-1)}function l(C){n(C.target.value),s.onSearch(C.target.value)}function u(C){var p;C.keepFocus||(p=e.current)==null||p.focus(),a()}function c(C){var p;C.keepFocus||(p=e.current)==null||p.focus(),o()}function h(){var C;r(""),(C=e.current)==null||C.focus(),s.onSearch("")}function f(C){C.key==="Enter"&&(C.preventDefault(),C.shiftKey?o():a())}function g(C){if(C==="focus"){i(!0);return}i(!1)}return oe.jsxs("div",{className:Bw("form-control py-0 px-1 d-flex align-items-center",t?rc.inputFocus:rc.inputBlur,rc.cursor),onClick:()=>{var C;return(C=e.current)==null?void 0:C.focus()},role:"search",children:[oe.jsx("div",{"aria-hidden":"true",children:oe.jsx(_n,{svg:tk})}),oe.jsx("input",{className:`form-control border-0 px-1 ${rc.inputWithoutHighlight}`,value:s.query,onChange:l,autoComplete:"off",placeholder:nc("searchPlaceholder"),ref:e,onKeyDown:f,onFocus:()=>g("focus"),onBlur:()=>g("blur")}),!!s.query&&oe.jsxs("div",{className:"d-flex align-items-center",children:[oe.jsx("div",{children:s.totalSearchResults?`${s.currentSearchResultIndex+1}/${s.totalSearchResults}`:"0/0"}),oe.jsx(ja,{"aria-label":nc("previousResult"),onClick:()=>c({keepFocus:!1}),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&c({keepFocus:!0})},children:oe.jsx(_n,{svg:C9})}),oe.jsx(ja,{"aria-label":nc("nextResult"),onClick:()=>u({keepFocus:!1}),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&u({keepFocus:!0})},children:oe.jsx(_n,{svg:ik})}),oe.jsx(ja,{"aria-label":nc("clearSearch"),onClick:h,children:oe.jsx(_n,{svg:Em})})]})]})}function g2(s){return oe.jsx("svg",{...s,children:oe.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16m0-15a7 7 0 1 1 0 14 7 7 0 0 1 0-14m.5 4a.5.5 0 0 0-1 0v5.293l-2.146-2.147a.5.5 0 0 0-.708.708l3 3a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L12.5 14.293z",clipRule:"evenodd"})})}function P9(s){return oe.jsx("svg",{...s,children:oe.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0M5.493 14.585a7 7 0 0 0 9.244 3.86l-.59-.591c-.008-.008-.062-.05-.232-.068a2.7 2.7 0 0 0-.603.023c-.205.025-.41.062-.61.098l-.083.015c-.203.036-.44.078-.619.078a.72.72 0 0 1-.544-.261 1.2 1.2 0 0 1-.215-.39 4 4 0 0 1-.175-.856C11 15.903 11 15.256 11 15.005V15c0-.209.088-.397.245-.528a.9.9 0 0 1 .394-.18c.2-.042.45-.042.644-.042h.03c.226 0 .422-.001.59-.026.176-.026.233-.067.243-.078.187-.187.282-.37.407-.62l.006-.013c.124-.248.28-.559.587-.867a1.14 1.14 0 0 1 .667-.345 1.15 1.15 0 0 1 .66.127c.325.162.624.462.851.689l.023.023c.043-.01.103-.033.24-.088l.04-.016c.352-.141.9-.331 1.597.017.267.133.459.326.594.54a7.003 7.003 0 0 0-5.136-8.389.4.4 0 0 0-.026.108c.006.01.021.033.073.084q.022.022.059.057c.103.097.278.26.41.457.182.274.302.622.302 1.09 0 .357-.081.667-.264.925-.18.253-.423.405-.652.51-.191.09-.409.16-.605.223l-.09.03c-.23.075-.45.152-.665.26l-.066.035.04.102.016.042c.063.158.17.426.144.749q-.039.51-.504.978c-.573.572-1.07.771-1.604.771-.215 0-.426-.033-.605-.06l-.05-.008a4 4 0 0 0-.567-.057c-.023.096-.028.249-.028.5v.036c0 .221 0 .543-.088.81a.96.96 0 0 1-.316.463A.95.95 0 0 1 8 13.5c-.384 0-.7-.146-.956-.323a5 5 0 0 1-.633-.56l-.015-.013a4 4 0 0 0-.509-.458.74.74 0 0 0-.325-.142l-.012.03q-.08.204-.1.673c-.012.3 0 .63.015.948l.011.215c.012.233.024.458.024.63a1 1 0 0 1-.007.085M12 5a7 7 0 0 0-6.945 6.118A.85.85 0 0 1 5.5 11c.384 0 .7.146.956.323.241.167.456.382.633.56l.015.013c.194.195.35.348.509.458a.7.7 0 0 0 .359.145C7.995 12.403 8 12.25 8 12v-.036c0-.221 0-.543.088-.81a.96.96 0 0 1 .316-.463A.95.95 0 0 1 9 10.5c.291 0 .542.037.748.068l.03.005c.2.03.338.052.472.052.215 0 .469-.051.896-.479.188-.188.211-.3.215-.35.005-.068-.013-.143-.075-.298l-.012-.03c-.026-.063-.061-.15-.087-.235a1 1 0 0 1-.043-.409c.044-.378.319-.614.632-.771.285-.143.565-.238.803-.316l.097-.032a5 5 0 0 0 .49-.177c.146-.068.215-.127.255-.182.035-.05.079-.144.079-.346 0-.282-.068-.434-.135-.535a1.2 1.2 0 0 0-.207-.23q-.059-.054-.136-.131c-.153-.153-.366-.4-.366-.792q0-.137.035-.278A7 7 0 0 0 12 5m3.651 12.944.018.018a7.04 7.04 0 0 0 2.34-2.369.5.5 0 0 1 .044-.317l.007-.018.016-.053q.019-.067.033-.17c.019-.136.024-.296.007-.454-.038-.335-.16-.544-.34-.634-.303-.152-.505-.092-.778.017l-.023.01-.025.01c-.125.051-.319.13-.509.153a.93.93 0 0 1-.795-.283c-.27-.27-.458-.451-.62-.532a.3.3 0 0 0-.07-.027q-.02-.003-.019-.002h-.003l-.012.006a.3.3 0 0 0-.068.055c-.187.187-.282.37-.407.62l-.006.013c-.124.248-.28.559-.587.867-.24.239-.558.323-.804.36-.248.036-.513.036-.722.036h-.015q-.195-.001-.312.004c.003.3.014.733.058 1.128.029.254.067.461.113.6q.105-.015.271-.044l.081-.015c.197-.035.43-.077.664-.107.264-.033.559-.054.834-.024.268.029.59.112.832.354l.795.796zm-1.098-9.293c.23-.46.53-.776.91-.873a.93.93 0 0 1 .82.18c.19.1.445.259.668.45.124.107.252.236.353.384.099.145.196.345.196.583 0 .267-.123.521-.239.709a3.3 3.3 0 0 1-.47.582 3.3 3.3 0 0 1-.582.47c-.188.116-.442.239-.709.239-.065 0-.157.017-.337.05l-.027.004c-.172.032-.399.071-.636.071a1.6 1.6 0 0 1-.786-.186 1.6 1.6 0 0 1-.661-.715c-.15-.3-.251-.688-.007-1.03a.96.96 0 0 1 .349-.29c.108-.055.226-.096.322-.128l.057-.02c.404-.134.646-.214.779-.48m1.13.114c-.043.034-.129.12-.236.334-.329.658-.975.862-1.322.971q-.051.015-.092.03l-.095.033.01.018c.085.171.174.246.245.285a.63.63 0 0 0 .307.064c.138 0 .286-.023.457-.054l.052-.01a3 3 0 0 1 .491-.061q-.006 0 .001-.002c.016-.004.075-.022.181-.087.125-.077.267-.192.402-.327s.25-.277.327-.402a.8.8 0 0 0 .085-.172l-.019-.03a1 1 0 0 0-.178-.188 2.8 2.8 0 0 0-.523-.345l-.072-.036z",clipRule:"evenodd"})})}const D9="shared.playPageTranscription";Th.encloseNamespace(D9);function N9(s){return s.map(e=>Object.assign(e,{nodes:[{text:e.text,searchResultIndex:null}]}))}const L9="_languageSelect_1ws0w_1",lb={languageSelect:L9};function O9(s){var n,a;const e=(n=s.languageOptions[0])==null?void 0:n.label,t=s.track.src,i=ok();async function r(){Jn.logUserAction(s.analyticsData,{...s.analyticsOptions,actionType:ci.Download});try{await lk.downloadBlob(t,`Subtitles-${s.selectedLanguage}.vtt`)}catch{i.error("Error downloading transcript")}}return oe.jsxs("div",{className:"d-flex px-1 mb-3",children:[oe.jsx(I9,{query:s.searchQuery,currentSearchResultIndex:s.currentSearchResultIndex,onSearch:s.onSearch,totalSearchResults:s.totalSearchResults,jumpToSearchResult:s.jumpToSearchResult,analyticsData:s.analyticsData,analyticsOptions:s.analyticsOptions}),oe.jsx(Cm,{spanHack:!0,title:s.languageOptions.length>1?"":`Only available in ${e}`,children:oe.jsxs(Ru,{children:[oe.jsx(Ru.Toggle,{className:`text-dark ${lb.languageSelect}`,id:"language-select",disabled:((a=s.languageOptions)==null?void 0:a.length)<=1,variant:"outline-dark",children:oe.jsx(_n,{svg:P9})}),oe.jsx(Ru.Menu,{className:lb.menu,"aria-labelledby":"language-select",children:s.languageOptions.map((o,l)=>oe.jsx(Ru.Item,{onClick:()=>{var u;(u=s.onChangeLanguage)==null||u.call(s,o.value),Jn.logUserAction({...s.analyticsData,language:o.value,previousLanguageName:s.selectedLanguage},{...s.analyticsOptions,actionType:ci.Select})},className:"cursor-pointer",active:o.value===s.selectedLanguage,children:o.label},l))})]})}),oe.jsx(Mb,{svg:g2,onClick:r,className:"position-relative d-flex align-items-center text-dark"})]})}const M9=R.getComponent("Component");class R9 extends M9{constructor(e,t){super(e,t)}dispose(){setImmediate(()=>{var e;(e=this.root)==null||e.unmount()}),super.dispose()}}const B9={tagName:"div"};function rd(s,e=B9){if(!s)throw new Error("componentCtor is required");class t extends R9{createEl(){const r=R.dom.createEl(e.tagName,e.properties,e.attributes),n=Fw.createRoot(r);return n.render(s(this.player_,this.options_)),this.root=n,r}}return t}function F9(s){const e=dt.get(eb)||tb(s.allTracks);function t(){return s.allTracks.find(ue=>ue.language===e)||s.allTracks.find(ue=>ue.language===tb(s.allTracks))}const[i,r]=Pt.useState(()=>t()),[n,a]=Pt.useState(e),[o,l]=Pt.useState(-1),[u,c]=Pt.useState(!0),[h,f]=Pt.useState([]),g=Pt.useMemo(()=>Array.from((i==null?void 0:i.cues)||[]),[n]),C={videoId:s.playbackObject.videoId,videoName:s.playbackObject.title,language:n},p={location:_l.Player,entity:wi.Transcript},b=s.player.hasStarted();u9({currentTranscriptTrack:i,cuesToDisplay:g,setCurrentCueIndex:l,hasStarted:b});const I=Pt.useRef(),L=l9({count:h.length,getScrollElement:()=>{var ue;return(ue=I.current)==null?void 0:ue.view},estimateSize:()=>40,enabled:h.length>0}),F=L.getVirtualItems(),V=c9(o,u,L),{isSearching:B,searchQuery:O,totalSearchResults:M,jumpToSearchResult:U,onSearch:w,currentSearchResultIndex:P,resetSearchResults:Q}=h9({cuesToDisplay:g,resetHighlightedCues:de,setHighlightedCues:f,scrollToCue:V}),G=s.player.paused(),[K,ce]=Ub();Pt.useEffect(()=>{c(!ce&&!B&&b&&!G)},[ce,B,b,G]);function de(){f(N9(g))}Pt.useEffect(()=>{de()},[g]);function pe(){s.toggleTranscript(!1)}function ne(ue){r(s.allTracks.find(he=>he.language===ue)),a(ue),dt.set(eb,ue),Q()}function se(ue){var he;(he=s.setStartTime)==null||he.call(s,ue.startTime)}return!i||!g.length?oe.jsx(oe.Fragment,{}):oe.jsxs("div",{ref:K,className:`cv-transcript py-3 px-2 ${s.showTranscript?"cv-open":""}`,children:[oe.jsxs("div",{className:"text-dark d-flex justify-content-between px-1",children:[oe.jsx("h3",{children:"Transcript"}),oe.jsx(Mb,{svg:Em,onClick:pe,ariaLabel:"Close transcript"})]}),oe.jsx(O9,{selectedLanguage:n,languageOptions:s.languageOptions,onChangeLanguage:ne,track:i,onSearch:w,searchQuery:O,currentSearchResultIndex:P,totalSearchResults:M,jumpToSearchResult:U,analyticsData:C,analyticsOptions:p}),oe.jsx("div",{className:"cv-transcript-list-wrapper text-dark",children:oe.jsx(Xw,{ref:I,children:oe.jsx(S9,{timepoint:g[o],onClickTranscriptionItem:se,cuesToDisplay:h,chapters:s.chapters,currentSearchResultIndex:P,inPlayer:!0,virtualizer:L,items:F,analyticsOptions:p,analyticsData:C,isAuthenticated:!1})})})]})}R.registerComponent("Transcript",rd((s,e)=>oe.jsx(F9,{player:s,...e})));const U9=R.getPlugin("plugin"),v2=992;class $9 extends U9{constructor(e){super(e),this.allClickViewTracks=[],this.player=e,this.bindListeners(),e.ready(()=>this.initialize())}bindListeners(){this.onResize=this.onResize.bind(this),Yt.useMetadataTracks(this.player,"transcript",()=>this.player.trigger("resizemenus")),this.player.on("playerresize",this.onResize)}dispose(){this.player.off("playerresize",this.onResize),super.dispose()}initialize(){Yt.useMetadataTracks(this.player,"transcript",this.onTranscriptLoaded.bind(this)),Yt.useChapters(this.player,this.onChaptersLoaded.bind(this))}onChaptersLoaded(e){this.chapterTrack=e}onTranscriptLoaded(e){const t=e.isClickViewProduced;!this.allClickViewTracks.find(i=>i.language===e.language)&&t&&this.allClickViewTracks.push(e),this.languageOptions=this.buildOptions(this.allClickViewTracks)}buildOptions(e){return e.map(t=>({label:bc.getFullEnglishName(t.language),value:t.language})).sort((t,i)=>{const r=t.value.includes(ql)?1:0;return(i.value.includes(ql)?1:0)-r})}buildComponentProps(e,t,i){var n;const r=Array.from(((n=this.chapterTrack)==null?void 0:n.cues)||[]).map(a=>({endTimestamp:a.endTime,startTime:a.startTime,name:a.text}));return{showTranscript:e,languageOptions:this.languageOptions,toggleTranscript:a=>t(a,{shouldLog:!0}),allTracks:this.allClickViewTracks,setStartTime:i,chapters:r,playbackObject:this.playbackObject}}addChildren(e){if(this.component)return this.component.show(),this.component;const t=this.toggleTranscript.bind(this),i=this.setStartTime.bind(this),r=this.buildComponentProps(e,t,i);this.component=this.player.addChild("Transcript",r)}toggleTranscript(e,t){var r,n,a;const i=e!==void 0?e:!this.showTranscript;this.showTranscript=i,i?((r=this.player.theatreModePlugin())==null||r.toggleTheatreMode(!0,{shouldLog:!1}),this.addChildren(!0),this.player.addClass("cv-transcript-plugin")):((n=this.component)==null||n.hide(),this.player.removeClass("cv-transcript-plugin")),this.player.whiteboardModePlugin&&this.player.whiteboardModePlugin().setEnabled(!i),this.player.trigger("cv-transcript-toggle",i),this.player.trigger("resizemenus"),this.player.trigger("playerresize"),t!=null&&t.shouldLog&&((a=this.analyticsService)==null||a.logUserAction({videoId:this.playbackObject.videoId,videoName:this.playbackObject.title},{actionType:ci.Click,descriptor:i?Ys.ShowTranscript:Ys.HideTranscript,entity:wi.Transcript}))}setStartTime(e){this.player.currentTime(e)}isTranscriptOn(){return!!this.showTranscript}onResize(){if(window.innerWidth<v2){this.player.addClass("hide-transcript");return}this.showTranscript&&this.player.removeClass("hide-transcript")}registerAnalytics(e,t){this.analyticsService=e,this.playbackObject=t}}R.registerPlugin("viewTranscriptPlugin",$9);const j9=R.getComponent("TextTrackMenuItem");class y2 extends j9{constructor(e){const t={};t.track={player:e,kind:"subtitle",label:"Video Transcript",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="TranscriptMenuItem",super(e,t),this.transcriptOn=this.player_.viewTranscriptPlugin&&this.player_.viewTranscriptPlugin().isTranscriptOn(),this.bindEventListeners()}bindEventListeners(){const e=this.toggleListener.bind(this),t=this.onResize.bind(this);this.player_.on("cv-transcript-toggle",e),this.player_.on("playerresize",t),this.on("dispose",()=>{this.player_.off("cv-transcript-toggle",e),this.player_.off("playerresize",t)})}onResize(){const e=window.innerWidth<v2;this.item&&(this.item.style.display=e?"none":"block")}handleToggleListener(){this.transcriptOn?this.toggleOff():this.toggleOn()}toggleListener(e,t){var i,r;t?(this.transcriptOn=!0,R.dom.addClass(this.toggleEl,"on")):(this.transcriptOn=!1,(r=(i=R.dom).removeClass)==null||r.call(i,this.toggleEl,"on"))}toggleOn(){var e,t;this.transcriptOn=!0,R.dom.addClass(this.toggleEl,"on"),this.player_.viewTranscriptPlugin&&((t=(e=this.player_.viewTranscriptPlugin())==null?void 0:e.toggleTranscript)==null||t.call(e,!0,{shouldLog:!0})),this.player_.whiteboardModePlugin&&this.player_.whiteboardModePlugin().setEnabled(!1)}toggleOff(){var e,t,i,r;this.transcriptOn=!1,(t=(e=R.dom).removeClass)==null||t.call(e,this.toggleEl,"on"),this.player_.viewTranscriptPlugin&&((r=(i=this.player_.viewTranscriptPlugin())==null?void 0:i.toggleTranscript)==null||r.call(i,!1,{shouldLog:!0}))}createEl(e,t,i){this.handlerBound||(this.handleToggleListener=this.handleToggleListener.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggleListener),this.toggleEl=R.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggleListener);const r=`
312
+ <span class="vjs-menu-item-text">Video Transcript</span>
313
+ <span class="cv-toggle-container"></span>
314
+ <span class="vjs-control-text" aria-live="polite">, opens transcript</span>
315
+ `;return this.item=R.dom.createEl("li",{className:"vjs-menu-item cv-transcript-toggle",innerHTML:r,tabIndex:-1},i),this.item.children[1].appendChild(this.toggleEl),this.item}}R.registerComponent("ToggleTranscriptMenuItem",y2);const V9=R.getComponent("TextTrackButton"),ub=R.getComponent("SubsCapsButton");class H9 extends ub{constructor(e,t){super(e,t),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0,this.className="cv-subs-caps-menu-button",this.onSelectedLanguageChange=this.onSelectedLanguageChange.bind(this),this.player_.on("cv:languageselected",this.onSelectedLanguageChange),this.player_.one("dispose",()=>this.player_.off("cv:languageselected",this.onSelectedLanguageChange))}buildWrapperCSSClass(){return`cv-menu-small cv-has-left-icons ${super.buildWrapperCSSClass()}`}createItems(){const e=[];if(!this.player_.options_.mobile){const t=this.player().textTracks(),i=Array.from(t||[]).some(n=>n.kind==="subtitles");this.player_.options_.allowTranscript&&!!i&&this.player_.viewTranscriptPlugin&&e.push(new y2(this.player_)),this.player_.options_.allowTranscript||e.push(new b8(this.player_)),e.push(new C8(this.player_)),this.hideThreshold_=e.length}return this.player().trigger("resizemenus"),V9.prototype.createItems.call(this,e,_8)}onSelectedLanguageChange(){const e=this.player_.textTracks();for(let t=0;t<e.length;t++){const i=e[t];if(i.kind==="subtitles"&&i.mode==="showing"){this.setActive(!0);return}}this.setActive(!1)}getCollabsibleName(){return"Subtitles"}getCollabsibleValue(){const e=this.player_.textTracks();for(let t=0;t<e.length;t++){const i=e[t];if(this.kinds_.indexOf(i.kind)>-1&&i.mode==="showing")return i.label}return"Off"}showInCollabsibleMenu(){const e=this.player_.textTracks();for(let t=0;t<e.length;t++){const i=e[t];if(this.kinds_.indexOf(i.kind)>-1)return!0}return!1}showCollapsibleMenu(){ub.prototype.handleClick.apply(this)}}R.registerComponent("SubsCapsButton",H9);const q9=`<span class='vjs-local-cache-indicator-icon' title='Streaming from ClickView Local Cache'>${KE}</span>`,z9=R.getComponent("MenuItem");class W9 extends z9{constructor(e,t){super(e,t),this.qualityId=t.qualityId;const i=e.qualityLevels(),r=this.handleQualityChange.bind(this);i.on("change",r),e.one("dispose",()=>{i.off("change",r)}),this.handleLocalCacheChange=this.handleLocalCacheChange.bind(this),this.player_.ready(()=>{this.player_&&(this.player_.on("localcachechanged",this.handleLocalCacheChange),this.player_.one("dispose",()=>{var n;(n=this.player_)==null||n.off("localcachechanged",this.handleLocalCacheChange)}),this.handleLocalCacheChange())})}async handleLocalCacheChange(){const t=await this.player_.localCache().getActiveLocalCache();if(!(t!=null&&t.playbackProfile)){this.show(),this.enable(),this.setLabel(this.options_.label);return}t.playbackProfile!==this.qualityId?this.disable():this.setLabel(this.options_.label+q9)}setLabel(e){const t=this.$(".vjs-menu-item-text");t&&(t.innerHTML=e)}buildCSSClass(){return"vjs-menu-item cv-quality-menu-item"}handleClick(){const e=this.player_.qualityLevels();for(let t=0;t<e.length;t++){const i=e[t];i.enabled=i.id===this.qualityId}}handleQualityChange(){if(!this.player_)return;const e=this.player_.qualityLevels(),t=e[e.selectedIndex],i=t&&t.id===this.qualityId;i!==this.isSelected_&&this.selected(i)}}const cb={144:"144p (Preview)",240:"240p",360:"360p",480:"480p",720:"720p",1080:"1080p"},hb=R.getComponent("MenuButton");class G9 extends hb{constructor(e,t){super(e,t),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0,this.className="cv-quality-menu-button";const i=this.player_.qualityLevels(),r=this.update.bind(this);i.on("addqualitylevel",r),i.on("removequalitylevel",r),e.one("dispose",()=>{i.removeEventListener("addqualitylevel",r),i.removeEventListener("removequalitylevel",r)})}buildCSSClass(){return`cv-quality-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`cv-menu-small vjs-quality-button cv-has-left-icons ${super.buildWrapperCSSClass()}`}createItems(){const e=[],t=this.player_.qualityLevels();e.push(new Zs(this.player_,{label:"Quality"}));for(let i=0;i<t.length;i++){const r=t[i];if(!r)continue;const n=cb[r.id];n&&e.push(new W9(this.player_,{qualityId:r.id,label:n,selectable:!0,multiSelectable:!1}))}return e}getCollabsibleName(){return"Quality"}getCollabsibleValue(){const e=this.player_.qualityLevels(),t=e[e.selectedIndex];return t?cb[t.id]:""}showInCollabsibleMenu(){return!!this.player_.qualityLevels().length}showCollapsibleMenu(){hb.prototype.handleClick.apply(this)}}R.registerComponent("QualityButton",G9);const K9=R.getComponent("Menu"),db=R.getComponent("MenuButton"),X9=R.getComponent("PlaybackRateMenuItem"),fb=R.getComponent("PlaybackRateMenuButton");class Q9 extends fb{constructor(){super(...arguments),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0,this.className="cv-playback-rate-menu-button"}createEl(...e){return db.prototype.createEl.apply(this,...e)}buildWrapperCSSClass(){return`cv-menu-small cv-has-left-icons ${super.buildWrapperCSSClass()}`}createMenu(){const e=new K9(this.player(),{menuButton:this});e.addItem(new Zs(this.player_,{label:"Playback speed"}));const t=this.playbackRates();if(t)for(let i=0;i<t.length;i++){let r=t[i]+"x";t[i]===1&&(r+=" (Normal)"),e.addItem(new X9(this.player(),{rate:r}))}return e}handleClick(...e){return db.prototype.handleClick.apply(this,...e)}updateLabel(...e){return this.setupLabelEl(),fb.prototype.updateLabel.apply(this,...e)}setupLabelEl(){if(this.labelEl_)return;const e=this.$("button");e&&(this.labelEl_=R.dom.createEl("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),e.appendChild(this.labelEl_))}getCollabsibleName(){return"Playback speed"}getCollabsibleValue(){return this.player().playbackRate()+"x"}showInCollabsibleMenu(){return!!this.playbackRates()}showCollapsibleMenu(){this.handleClick(null)}}R.registerComponent("PlaybackRateMenuButton",Q9);const Y9=R.getComponent("TextTrackSettings"),Sc={backgroundColor:"#000",backgroundOpacity:"1",color:"#FFF",edgeStyle:void 0,fontFamily:"proportionalSansSerif",fontPercent:1,textOpacity:"1",windowColor:"#000",windowOpacity:"0"},pb={small:Sc,medium:{...Sc,fontPercent:1.5},large:{...Sc,fontPercent:2}};class J9 extends Y9{setSizeSetting(e){this.size_=e,this.player_.getChild("textTrackDisplay").updateDisplay();const i=this.player_.getChild("collapserator").getChild("subtitleSizeButton");this.player_.trigger("changesubtitlesize",this.size_),window.requestAnimationFrame(()=>{i.update(),this.player_.trigger("resizemenus")})}getSizeSetting(){return this.size_||"small"}getValues(){return pb[this.size_]?pb[this.size_]:Sc}}R.registerComponent("TextTrackSettings",J9);const Z9="cv-video-wrapper",Cc=R.getComponent("Player");class _2 extends Cc{constructor(e,t){super(e,t),this._dataLoaded=!1,t.mobile&&this.addClass("cv-mobile-player");const i=()=>this._dataLoaded=!0;this.on("cv-playback-data-loaded",i),this.on("dispose",()=>this.off("cv-playback-data-loaded",i))}dataLoaded(e){if(this._dataLoaded){e();return}this.one("cv-playback-data-loaded",e),this.one("dispose",()=>{this.off("cv-playback-data-loaded",e)})}lock(e){this.callback_=e}unlock(){delete this.callback_}currentTime(e,t){if(typeof e!="number"||!this.callback_||t)return super.currentTime(e);this.callback_(()=>{this.unlock(),this.currentTime(e)})}play(){if(!this.callback_)return super.play();this.callback_(()=>{this.unlock(),this.play()})}createEl(){const e=super.createEl();return this.videoContainer||(this.videoContainer=R.dom.createEl("div",{className:Z9}),e.appendChild(this.videoContainer)),Array.from(e.childNodes).forEach(t=>t!==this.videoContainer&&this.videoContainer.appendChild(t)),e}addChild(e,t={},i=this.children_.length){const r=super.addChild(e,t,i),n=r.el();return n&&this.videoContainer.appendChild(n),r}updateStyleEl_(){if(Cc.prototype.updateStyleEl_.call(this),!this.options_.fluid)return;const e=this.el_.parentNode;if(!e||!this.options_.setMaxHeight)return;let t=this.aspectRatio();if((t===void 0||t==="auto")&&(this.videoWidth()>0?t=this.videoWidth()+":"+this.videoHeight():t="16:9"),this.player_.playerModePlugin().getMode()===e2.Hover){e.style.removeProperty("maxWidth"),e.style.removeProperty("margin");return}const i=t.split(":"),r=+i[1]/+i[0];e.style.maxWidth=85/r+"vh",e.style.margin="0 auto"}listenForUserActivity_(){Cc.prototype.listenForUserActivity_.call(this);const e=this.getChild("collapserator");e.on("mouseenter",()=>{this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout,this.player().options_.inactivityTimeout=0}),e.on("mouseleave",()=>{this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})}}_2.prototype.options_={...Cc.prototype.options_,setMaxHeight:!0};R.registerComponent("player",_2);const e$=R.getComponent("Component");class t$ extends e${constructor(e,t){super(e,t),this.player_.addClass("cv-disable-play-pause-feedback"),this.onFirstPlay=this.onFirstPlay.bind(this),this.player_.one("play",this.onFirstPlay)}dispose(){this.player_.off("play",this.onFirstPlay)}onFirstPlay(){window.setTimeout(()=>{this.player_.isDisposed()||this.player_.removeClass("cv-disable-play-pause-feedback")},500)}createEl(){return R.dom.createEl("div",{className:"cv-play-pause-feedback"})}}R.registerComponent("PlayPauseFeedback",t$);const sc=R.getComponent("PlayToggle"),T2="Play (space)",i$="Pause (space)";let b2=class extends sc{handlePlay(){sc.prototype.handlePlay.call(this),this.controlText(i$)}handlePause(){sc.prototype.handlePause.call(this),this.controlText(T2)}handleClick(e){sc.prototype.handleClick.call(this,e),this.player_.addClass("cv-disable-play-pause-feedback"),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.player_.removeClass("cv-disable-play-pause-feedback")},500)}};R.registerComponent("PlayToggle",b2);b2.prototype.controlText_=T2;const mb=R.getComponent("TextTrackDisplay"),r$=.025;class n$ extends mb{constructor(e,t){super(e,t),this.bindListeners()}bindListeners(){this.onResize=this.onResize.bind(this),this.player_.on("resize",this.onResize)}onResize(){this.updateDisplay()}updateDisplayState(e){mb.prototype.updateDisplayState.call(this,e);const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let r=i.length;for(;r--;){const n=i[r];if(!n)continue;const a=n.displayState;if(t.fontPercent&&t.fontPercent!==1){const l=this.el().getBoundingClientRect().width*r$*100/100;a.style.fontSize=l*t.fontPercent+"px"}}}}R.registerComponent("TextTrackDisplay",n$);const s$=R.getComponent("Component");class a$ extends s${createEl(){return R.dom.createEl("div",{className:"cv-control-bar-gradient-container",innerHTML:'<div class="cv-control-bar-gradient"></div>'})}}R.registerComponent("ControlBarGradient",a$);const o$=R.getComponent("Component");class l$ extends o${constructor(e,t){super(e,t),this.options_=t}createEl(){let e=this.options_.title;if(!this.options_.seriesName)return super.createEl("h1",{innerHTML:e});const t=this.buildSeasonEpisodeString();return t?(e=`<div class='cv-splash-series'>${this.options_.seriesName.toUpperCase()} ${t}</div>`+e,super.createEl("h1",{innerHTML:e})):(e=`<div class='cv-splash-series'>${this.options_.seriesName.toUpperCase()}</div>`+e,super.createEl("h1",{innerHTML:e}))}buildSeasonEpisodeString(){if(!this.options_.seasonNumber||!this.options_.episodeNumber)return"";const e=this.padNumber(this.options_.seasonNumber,2),t=this.padNumber(this.options_.episodeNumber,2);return`S${e} • E${t}`}padNumber(e,t){let i=e.toString();if(i.length>=t)return i;for(t=t-i.length;t>0;)i="0"+i,t--;return i}}function u$(s){return s?(t=>{switch(!0){case t<32:return"cv-rating-purple";case t<48:return"cv-rating-green";case t<80:return"cv-rating-blue";case t<96:return"cv-rating-red";case t<128:return"cv-rating-pink";case t>=128:return"cv-rating-yellow";default:return""}})(s):""}const c$=R.getComponent("Component");class h$ extends c${constructor(e,t){super(e,t),this.options_=t}buildCSSClass(){return`cv-splash-rating ${u$(this.options_.ratingValue)}`}createEl(e,t,i){return this.options_.ratingCode?super.createEl(e,{...t,className:this.buildCSSClass(),innerHTML:this.options_.ratingCode},i):null}}const d$=R.getComponent("Component");class f$ extends d${constructor(e,t){if(super(e,t),!t.embed)return this;this.addChild(new l$(e,t)),this.addChild(new h$(e,t))}createEl(){return R.dom.createEl("div",{className:"cv-splash-metadata"})}}const p$=R.getComponent("posterImage");class m$ extends p${constructor(e,t){super(e,t),this.addChild(new f$(e,t))}createEl(){let e="<div class='cv-splash-mask'></div>";return this.options_.embed&&(e+=`<div class='cv-splash-logo'>${zE}</div>`),R.dom.createEl("div",{className:"vjs-poster cv-embed-splash cv-embed-splash-black",tabIndex:-1,innerHTML:e})}setSrc(e){let t="";e&&(t=`url("${e}")`),this.el_.style.backgroundImage=t}}R.registerComponent("posterImage",m$);const g$=R.getComponent("ErrorDisplay");class v$ extends g${constructor(e,t){super(e,t),this.el().prepend(this.getErrorImage())}getErrorImage(){return R.dom.createEl("div",{className:"cv-error-image",innerHTML:`
316
+ <svg viewBox="0 0 301 185" xmlns="http://www.w3.org/2000/svg">
317
+ <path d="M267.393 36.6514V167.906C267.393 168.182 267.169 168.406 266.893 168.406H32C31.7239 168.406 31.5 168.182 31.5 167.906V36.6514C31.5 36.3752 31.7239 36.1514 32 36.1514H80.5C80.7761 36.1514 81 36.3752 81 36.6514V57.7196C81 58.7622 82.0375 59.4868 83.0164 59.1279L95.7377 54.4634C95.9961 54.3687 96.2825 54.5006 96.3785 54.7585L102.094 70.1194C102.677 71.6866 105 71.2685 105 69.5964V48.4925C105 47.7632 104.475 47.1396 103.757 47.0146L94.2479 45.3609C93.9436 45.308 93.7596 44.9946 93.8616 44.7031L96.7376 36.4862C96.8077 36.2856 96.997 36.1514 97.2095 36.1514H266.893C267.169 36.1514 267.393 36.3752 267.393 36.6514Z" stroke="white"/>
318
+ <path d="M163.296 101.777L149.437 90.1217C148.275 89.1441 146.5 89.9705 146.5 91.4894V113.664C146.5 115.141 148.191 115.98 149.367 115.087L163.226 104.569C164.139 103.876 164.173 102.515 163.296 101.777Z" stroke="white" stroke-linecap="round"/>
319
+ <path d="M295.53 23.0783L277.524 26.2801L283.252 32.7192L274.855 38.9079L292.861 35.7061L287.133 29.2671L295.53 23.0783Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
320
+ <path d="M268.06 2.91764L254.192 14.8403L262.401 17.4661L258.324 27.0679L272.192 15.1453L263.983 12.5194L268.06 2.91764Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
321
+ </svg>
322
+ `})}}R.registerComponent("ErrorDisplay",v$);const gb=R.getComponent("FullscreenToggle"),S2="Fullscreen (f)";class C2 extends gb{handleFullscreenChange(){gb.prototype.handleFullscreenChange.call(this),this.controlText(S2)}}R.registerComponent("FullscreenToggle",C2);C2.prototype.controlText_=S2;const y$=R.getComponent("MuteToggle"),E2="Mute (m)",_$="Unmute (m)";class w2 extends y${updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?_$:E2;this.controlText_!==t&&this.controlText(t)}}R.registerComponent("MuteToggle",w2);w2.prototype.controlText_=E2;const T$=R.getComponent("Player"),b$=s=>s.indexOf("#")===0?s.slice(1):s,S$=3;let cl;const yh=class yh{constructor(e,t){if(this.streamLogged=!1,this.options=R.obj.merge({},yh.options_,t),this.options.playerApi===null)throw new Error("PlayerApi required");this.initialize(),this.createEl(e),this.buildVideoJs(),this.options.splash&&this.setupSplash(this.options.splash),this.bindEventListeners(),this.setupSeekBar(),this.fetchConfig(),this.logStream=this.logStream.bind(this),this.player.ready(()=>{this._configurePlugins(),this.options.setup&&this.options.setup(this.options,this.player),this.fetch().catch(i=>this.handleFetchError(i))})}initialize(){}_configurePlugins(){this.player.configureMenuDimensionsPlugin({mobile:this.options.mobile,overflowControls:this.options.overflowControls,seekBarName:this.getSeekBarName()}),this.player.progressReporterPlugin({onFlush:this.onFlushProgress=this.onFlushProgress.bind(this)}),this.player.persistVolumePlugin(),!this.options.mobile&&this.options.allowFullscreen&&this.player.fullscreenOnRotatePlugin(),this.player.touchControls(),this.options.getExternalLink&&this.player.openExternallyPlugin({getExternalLink:this.options.getExternalLink}),this.configurePlugins()}configurePlugins(){}onFlushProgress(e){var t;(t=this.analyticsService)==null||t.logVideoProgress(e)}buildVideoJs(){return this.player=R(this.el,this.getPlayerOptions())}getInactivityTimeout(){if(typeof this.options.inactivityTimeout=="number")return this.options.inactivityTimeout;let e=500;return(this.options.mobile||R.browser.IS_IOS||R.browser.IS_ANDROID)&&(e=3e3),e}getFluid(){return!(this.options.theatreMode||this.options.embed||this.options.mobile)}getFill(){return!!(this.options.theatreMode||this.options.embed||this.options.mobile)}getPlayerOptions(){let e=T$.prototype.options_.children;return e=e.filter(t=>!(t==="bigPlayButton"||t==="posterImage")),{controls:this.options.controls,fluid:this.getFluid(),fill:this.getFill(),inactivityTimeout:this.getInactivityTimeout(),controlBar:{children:["timeWrapper","progressControl"]},children:[...e,{name:"collapserator",children:jN.filter(t=>{var i;return!(t==="fullscreenToggle"&&!this.options.allowFullscreen||t==="playbackRateMenuButton"&&!((i=this.options.playbackRates)!=null&&i.length))})},"playPauseFeedback","controlBarGradient"],userActions:{hotkeys:t=>QN(t,this.player,this.options)},playbackRates:this.options.playbackRates,techOrder:["html5"],html5:{nativeTextTracks:!1},playsinline:!0,aspectRatio:this.options.aspectRatio,mobile:this.options.mobile,allowTheatreMode:this.options.allowTheatreMode,deferMenus:this.options.deferMenus,muted:this.options.muted,devicesConfig:this.options.devicesConfig}}async getPlaybackObject(){if(this.options.offlinePlaybackObject)return this.options.offlinePlaybackObject;let e=this.options.fetch;if(this.options.fetch===void 0&&(e=i=>{const r=`${this.options.playerApi.origin}/api/playback?viewKey=${i}`;return Vp.get(r)}),!this.options.viewKey)throw new Error("Please specify a viewKey or a fetch function");const t=await e(this.options.viewKey);if(!t)throw new Error("Error fetching playback object");return t}setChaptersInternal(e,t){let i=Yt.getTrack(this.player,"chapters",null);i||(i=this.player.addTextTrack("chapters")),[...i.cues.cues_].forEach(n=>i.removeCue(n)),e.forEach(n=>{i.addCue({startTime:n.timestamp,endTime:n.endTimestamp,text:n.name})}),t&&i.trigger({type:"cv:cuechange",target:i}),i.trigger({type:"loadeddata",target:i})}setChapters(e){this.setChaptersInternal(e,!0)}setPlayerMode(e,t){this.player.playerModePlugin().setPlayerMode(e,t)}setFavourite(e,t){this.player.favouritePlugin().setFavourite(e,t)}async fetch(){var r,n,a;const e=await this.getPlaybackObject();if(this.isDisposed())return;const t=e.mediaType==="MasterClip",i=(r=e.additionalData)==null?void 0:r.clipData;((a=(n=e.chapters)==null?void 0:n.list)==null?void 0:a.length)>0&&!t&&!i&&this.setChaptersInternal(e.chapters.list,!1),this.player.localCache({localCacheAddresses:e.localCacheAddresses??[],enabled:this.options.enableLocalCache??!0}),this.player.progressiveFiles({sources:e.files.progressive.map(o=>({id:o.profile,mimeType:o.mimeType,url:o.url}))}),this.player.handleNetworkErrors({playerApi:this.options.playerApi,fileToken:e.files.fileToken}),e.subtitles.list.length>0&&e.subtitles.list.forEach(o=>{if(o.mimeType!=="text/vtt")return;const l=this.player.addRemoteTextTrack({kind:"subtitles",src:o.url,language:o.language,label:o.label},!0);if(Yt.sanitizeTrack(l.track,this.player),this.options.allowTranscript){const u=this.player.addRemoteTextTrack({kind:"metadata",src:o.url+(o.url.includes("?")?"&":"?")+"fullSentences=true",language:o.language,label:"transcript"},!0);u.track.isClickViewProduced=o.isClickViewProduced,Yt.sanitizeTrack(u.track,this.player)}}),e.posterUrl&&this.player.poster(Na.createUrl(e.posterUrl,{size:Rb.Large})),this.setupSplash({title:e.title,posterUrl:e.posterUrl,episodeNumber:e.episodeNumber,ratingCode:e.ratingCode,seasonNumber:e.seasonNumber,seriesName:e.seriesName}),this.additionalSetup(e),this.handleAutoplay(e),this.options.startTime&&(this.player.currentTime(this.options.startTime),this.player.one("canplay",()=>{this.player.currentTime(this.options.startTime)})),this.player.trigger("cv-playback-data-loaded",e)}handleFetchError(e){var i;let t=e.message;e instanceof jp&&((i=e.response)==null?void 0:i.type)===x1.PhysicallyChapteredVideo&&(t="Video cannot be played because it is either corrupt or damaged."),this.player.error(t),this.options.onError&&this.options.onError(e)}async fetchConfig(){if(cl||this.options.fetch||this.options.offlinePlaybackObject)return;const e=`${this.options.playerApi.origin}/api/config`;cl=await Vp.get(e),!this.isDisposed()&&this.trigger("config:loaded")}additionalSetup(e){var i;this.player.whiteboardModePlugin(),this.player.deferMenusPlugin();const t=this.options.enableLocalCache&&!!((i=e.localCacheAddresses)!=null&&i.length);cl?this.setupAnalyticsService(e,t):this.one("config:loaded",()=>this.setupAnalyticsService(e,t)),this.analyticsService||!this.isAnalyticsEnabled()?this.setupAnalyticsDependentPlugins(e):this.one("analytics:loaded",()=>this.setupAnalyticsDependentPlugins(e))}setupAnalyticsService(e,t){this.options.eventLogging&&(this.analyticsService=new VN({player:this.player,collectionApiUrls:cl.collectionApi.urls,collectionApiClientId:cl.collectionApi.clientId,productVersion:JN.version,authSessionId:e.viewerAuthSessionId,videoId:e.videoId,mediaId:e.mediaId,userId:e.viewerId,shareId:e.shareId,customerId:e.viewerCustomerId,mediaType:e.mediaType,playerType:this.getAnalyticsPlayerType(),isEmbedded:this.options.embed,isUsingLocalCache:t,additionalAnalyticsData:this.getAdditionalAnalyticsData(e),regionName:e.instanceRegion||this.options.sharerInstanceRegion||Uw.CvApSoutheast1}),this.on("timeupdate",this.logStream),this.trigger("analytics:loaded"))}setupAnalyticsDependentPlugins(e){var t,i,r,n;this.player.persistSubtitleSettingsPlugin({showSubtitles:(t=e.settings)==null?void 0:t.showSubtitles,subtitleSize:(i=e.settings)==null?void 0:i.playbackSubtitleSizeDefault,analyticsService:this.analyticsService}),this.player.persistQualitySettingsPlugin({playbackProfile:(r=e.settings)==null?void 0:r.playbackProfile,playbackProfileLocalCache:(n=e.settings)==null?void 0:n.playbackProfileLocalCache,analyticsService:this.analyticsService}),this.player.persistPlaybackRatePlugin({analyticsService:this.analyticsService})}getAdditionalAnalyticsData(e){return{}}isAnalyticsEnabled(){return this.options.fetch||this.options.offlinePlaybackObject?!1:this.options.eventLogging}handleAutoplay(e){this.options.autoplay&&this.player.ready(()=>{this.player.play().catch(()=>{this.isDisposed()||this.showSplash()})})}logStream(){this.analyticsService&&(this.player.currentTime()<S$||this.streamLogged||(this.analyticsService.logStream(),this.streamLogged=!0,this.off("timeupdate",this.logStream)))}getAnalyticsPlayerType(){return"player"}createEl(e){let t;typeof e=="string"?(e=b$(e),t=R.dom.$("#"+e)):t=e;let i="video-js";return this.getPlayerClassName()&&(i+=` ${this.getPlayerClassName()}`),this.el=R.dom.createEl("video",{},{class:i}),t.appendChild(this.el),this.el}getPlayerClassName(){return""}on(e,t){this.player.on(e,t)}one(e,t){this.player.one(e,t)}off(e,t){this.player.off(e,t)}trigger(e,t){return this.player.trigger(e,t)}dispose(){this.player.dispose()}ready(e){this.player.ready(e)}isDisposed(){return this.player.isDisposed()}play(){this.player.play()}pause(){this.player.pause()}isPaused(){return this.player.paused()}currentTime(e){return this.player.currentTime(e)}muted(e){return this.player.muted(e)}duration(){return this.player.duration()}isFullscreen(){return this.player.isFullscreen()}requestFullscreen(){this.player.requestFullscreen()}exitFullscreen(){this.player.exitFullscreen()}playbackRate(e){return this.player.playbackRate(e)}quality(e){const t=this.player.qualityLevels();for(let i=0;i<t.length;i++){const r=t[i];if(e){r.enabled=r.id===e.toString();continue}if(r.enabled)return r.id}}subtitles(e){const t=this.player.textTracks();for(let i=0;i<t.length;i++){const r=t[i];if(r.kind==="subtitles"){if(e!==void 0){r.label===e?r.mode="showing":r.mode="disabled";continue}if(r.mode==="showing")return r.label}}}bindEventListeners(){const e=i=>i.preventDefault();if(this.showSplash=this.showSplash.bind(this),this.hideSplash=this.hideSplash.bind(this),this.player.on("ended",this.showSplash),this.player.on("play",this.hideSplash),this.player.tech(!0).on("contextmenu",e),this.player.one("dispose",()=>{this.off("ended",this.showSplash),this.off("play",this.hideSplash),this.player.tech(!0).off("contextmenu",e)}),!this.options.hotkeyElQuerySelector)return;const t=R.dom.$(this.options.hotkeyElQuerySelector);t&&(this.player.on(t,"keydown",this.player.handleKeyDown),this.player.one("dispose",()=>{this.player.off(t,"keydown",this.player.handleKeyDown)}))}setupSeekBar(){const e=this.getSeekBarName(),t=this.player.controlBar.getChild("progressControl");t.addChild(e,this.getSeekBarOptions()),t.setSeekBarName(e)}setupSplash(e){this._splashAdded||(this._splashAdded=!0,this.player.addChild("posterImage",{embed:this.options.embed,...e}),this.player.addChild("bigPlayButton"),this.options.autoplay?this.hideSplash():this.showSplash())}showSplash(){this.player.hasStarted(!1),this.player.getChild("posterImage").show(),this.player.getChild("bigPlayButton").show()}hideSplash(){this.player.getChild("posterImage").hide(),this.player.getChild("bigPlayButton").hide()}getSeekBarOptions(){return{}}getSeekBarName(){return"ChapterSeekBar"}};yh.options_={viewKey:null,controls:!0,playbackRates:[.25,.5,.75,1,1.25,1.5,1.75,2],playerApi:new URL("http://localhost:52000"),enableLocalCache:!0,eventLogging:!0,allowFullscreen:!0};let _m=yh;const C$=R.getPlugin("plugin"),E$=10;class w$ extends C${constructor(e,t){if(super(e),t.startTime===void 0)throw Error("Invalid clip start");if(t.endTime===void 0)throw Error("Invalid clip end");if(t.startTime>t.endTime)throw Error("Clip start cannot be greater than clip end");this._clipStart=parseFloat(t.startTime.toPrecision(4)),this._clipEnd=parseFloat(t.endTime.toPrecision(4)),this.playerEndedFn=this.player.ended.bind(e),this.playerDurationFn=this.player.duration.bind(e),this.playerCurrentTimeFn=this.player.currentTime.bind(e),this.playerbufferedFn=this.player.buffered.bind(e),this.player.ended=this.ended.bind(this),this.player.duration=this.duration.bind(this),this.player.currentTime=this.currentTime.bind(this),this.player.buffered=this.buffered.bind(this),this.initialize(),this.player.ready(()=>{this.player.trigger("durationchange")})}get clipStart(){const e=this.playerDurationFn();return this._clipStart>e?e:this._clipStart}get clipEnd(){const e=this.playerDurationFn();return e<=0?this._clipEnd:this._clipEnd>e?e:this._clipEnd}dispose(){this.player.off("timeupdate",this.onTimeUpdate),this.player.off("play",this.onPlay),this.player.ended=this.playerEndedFn,this.player.duration=this.playerDurationFn,this.player.currentTime=this.playerCurrentTimeFn,this.player.buffered=this.playerbufferedFn,this.player.trigger("durationchange"),super.dispose()}initialize(){this.onTimeUpdate=this.onTimeUpdate.bind(this),this.onPlay=this.onPlay.bind(this),this.player.on("timeupdate",this.onTimeUpdate),this.player.on("play",this.onPlay)}onPlay(){this._isEnded&&this.player.currentTime(0)}onTimeUpdate(){const e=this.getCurrentTime(!1);if(e>this.clipEnd){this._isEnded||(this.player.pause(),this.player.trigger("ended"),this._isEnded=!0);return}this._isEnded=!1,e<this.clipStart-E$&&this.playerCurrentTimeFn(this.clipStart,!0)}ended(){return this.getCurrentTime(!1)>this.clipEnd}duration(e){return e&&e>0&&(this.playerDurationFn()?console.info("The duration of the player has already been set. This is a no-op."):this.playerDurationFn(e)),this.clipEnd-this.clipStart}currentTime(e,...t){if(typeof e!="number")return this.getCurrentTime(!0);const i=e+this.clipStart;this.playerCurrentTimeFn(i,t)}getCurrentTime(e){const t=this.playerCurrentTimeFn();let i=0;return t>=this.clipStart&&(i=t-this.clipStart),this.player.getCache().currentTime=i,e?i:t}buffered(){const e=this.playerbufferedFn(),t=[];for(let i=0;i<e.length;i++)t[i]=[Math.max(0,e.start(i)-this.clipStart),Math.min(Math.max(0,e.end(i)-this.clipStart),this.player.duration())];return R.createTimeRanges(t)}}R.registerPlugin("clipPlugin",w$);const k$=R.getComponent("Button");class k2 extends k${constructor(){super(...arguments),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0}buildCSSClass(){return"cv-create-clip-button"}getCollabsibleName(){return this.controlText_}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!0}showCollapsibleMenu(){super.handleClick(null)}}k2.prototype.controlText_="Create clip";R.registerComponent("CreateClipButton",k2);const x$=R.getPlugin("plugin");class A$ extends x${constructor(e,t){super(e,t),this.options=t,e.ready(()=>this.onReady())}onReady(){var i;const e=this.player.getChild("collapserator"),t=(i=e==null?void 0:e.children())==null?void 0:i.findIndex(r=>r.name()==="CustomControlSpacer");!t||t===-1||e.addChild("CreateClipButton",{clickHandler:this.options.onClick},t+1)}}R.registerPlugin("createClipButtonPlugin",A$);const I$=R.getComponent("PictureInPictureToggle");class P$ extends I${handlePictureInPictureEnabledChange(){this.enable()}}R.registerComponent("PictureInPictureToggle",P$);const D$=R.getComponent("PlayToggle"),N$=R.getPlugin("plugin"),L$=800;class O$ extends N${constructor(e,t){super(e,t),this.options=t,this.bindFunctions(),e.ready(()=>this.initialize())}bindFunctions(){this.requestPictureInPicture=this.requestPictureInPicture.bind(this),this.exitPictureInPicture=this.exitPictureInPicture.bind(this),this.onPlayerResize=this.onPlayerResize.bind(this),this.playerRequestPictureInPictureFn=this.player.requestPictureInPicture,this.playerExitPictureInPictureFn=this.player.exitPictureInPicture,this.player.requestPictureInPicture=this.requestPictureInPicture,this.player.exitPictureInPicture=this.exitPictureInPicture}initialize(){const e=this.player.getChild("collapserator");let t=e.children().findIndex(i=>{var r;return((r=i.name())==null?void 0:r.toLowerCase())==="fullscreentoggle"});t===-1&&(t=e.children().length-1),this.toggle=e.addChild("pictureInPictureToggle",{},t),this.toggle.enable(),this.player.on("playerresize",this.onPlayerResize),this.player.on("dispose",()=>{var i;(i=this.player)==null||i.off("playerresize",this.onPlayerResize)})}togglePictureInPicture(e){if(e===this.player.isInPictureInPicture())return;const t=e?"enterpictureinpicture":"leavepictureinpicture";this.player.isInPictureInPicture(e),this.player.trigger(t),e?this.addPipStyles():this.removePipStyles()}onPlayerResize(){var t,i;if(this.player.isInPictureInPicture())return;const e=this.player.el().getBoundingClientRect();e.width!==0&&(e.width<L$?(t=this.toggle)==null||t.hide():(i=this.toggle)==null||i.show())}addPipStyles(){this.player.addClass("cv-picture-in-picture"),this.playToggle=new D$(this.player),this.playToggle.addClass("cv-pip-play-toggle"),this.player.addChild(this.playToggle),this.player.paused()?this.playToggle.handlePause():this.playToggle.handlePlay()}removePipStyles(){this.player.removeClass("cv-picture-in-picture"),this.player.removeChild(this.playToggle),delete this.playToggle}requestPictureInPicture(){var e;this.togglePictureInPicture(!0),typeof((e=this.options)==null?void 0:e.onRequestPictureInPicture)=="function"&&this.options.onRequestPictureInPicture(!0)}async exitPictureInPicture(){this.togglePictureInPicture(!1),this.options.onRequestPictureInPicture(!1),this.removePipStyles()}dispose(){this.player.requestPictureInPicture=this.playerRequestPictureInPictureFn,this.player.exitPictureInPicture=this.playerExitPictureInPictureFn,super.dispose()}}R.registerPlugin("pictureInPicture",O$);class M${constructor(){this.listeners={}}subscribe(e,t){this.registerListener(e,t)}subscribeOnce(e,t){this.registerListener(e,t,1)}unsubscribe(e,t){this.deregisterListener(e,t)}trigger(e,...t){this.triggerCallbacks(e,t)}registerListener(e,t,i){if(typeof e!="string")throw new Error("Event name must be a string");if(typeof t!="function")throw new Error("Event callback must be a function");if(i&&typeof i!="number")throw new Error("Execution limit must be a number or undefined");this.listeners[e]=this.listeners[e]??[],this.listeners[e].push({callback:t,executionLimit:i})}deregisterListener(e,t){var r;if(typeof e!="string")throw new Error("Event name must be a string");if(t&&typeof t!="function")throw new Error("Event callback must be a function");if(!t){this.listeners[e]=[];return}const i=(r=this.listeners[e])==null?void 0:r.findIndex(n=>n.callback===t);typeof i!="number"||i===-1||(this.listeners[e].splice(i,1),this.listeners[e].length===0&&delete this.listeners[e])}triggerCallbacks(e,...t){if(!this.listeners[e])return;const i=[];this.listeners[e].forEach(r=>{typeof r.executionLimit=="number"&&(r.executionCount=r.executionCount??0,r.executionCount++,r.executionCount===r.executionLimit&&i.push(r.callback)),r.callback.apply(null,...t)}),i.length&&i.forEach(r=>this.deregisterListener(e,r))}}const R$=new M$,B$=R.getComponent("Component");class F$ extends B${constructor(e,t){super(e,t),this.hasBuffered=!1,this.hasPlayed=!1,this.eventsService=R$,this.pointOfInterest=t.pointOfInterest,this.onMouseOver=this.onMouseOver.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onGlancePointOfInterestMouseEnter=this.onGlancePointOfInterestMouseEnter.bind(this),this.onGlancePointOfInterestMouseLeave=this.onGlancePointOfInterestMouseLeave.bind(this),this.initialize()}initialize(){this.setPosition(),this.bindListeners()}buildCSSClass(){return`cv-point-of-interest-indicator ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}bindListeners(){this.on("mouseover",this.onMouseOver),this.on("mouseleave",this.onMouseLeave),this.eventsService.subscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.subscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}dispose(){this.eventsService.unsubscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.unsubscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}getPointOfInterestTime(){return this.pointOfInterest.startTime}setPosition(){const e=this.player().duration();this.el_.style.left=this.getPointOfInterestTime()/e*100+"%"}updateBuffered(e){const t=this.getPointOfInterestTime()<=e;if(t===this.hasBuffered)return;this.hasBuffered=t;const i="cv-point-of-interest-indicator-buffered";this.hasBuffered?this.addClass(i):this.removeClass(i)}updatePlaybackProgress(e){const t=this.getPointOfInterestTime()<=e;if(t===this.hasPlayed)return;this.hasPlayed=t;const i="cv-point-of-interest-indicator-played";t?this.addClass(i):this.removeClass(i)}toggleVisibility(e){const t="cv-point-of-interest-indicator-hidden";e?this.removeClass(t):this.addClass(t)}onMouseOver(){this.setTimeTooltipText(),this.eventsService.trigger("player:poi:mouseover",this.pointOfInterest)}onMouseLeave(){this.clearTimeTooltipText(),this.eventsService.trigger("player:poi:mouseleave")}onGlancePointOfInterestMouseEnter(e){e.id===this.pointOfInterest.id&&(this.addClass("cv-point-of-interest-indicator-highlight"),this.setTimeTooltipTime(),this.setTimeTooltipText(),this.positionMouseTimeDisplay(),this.showMouseTimeDisplay())}onGlancePointOfInterestMouseLeave(){this.removeClass("cv-point-of-interest-indicator-highlight"),this.hideMouseTimeDisplay()}setTimeTooltipText(){var e;(e=this.getTimeTooltip())==null||e.setCustomChapterText(this.pointOfInterest.description)}clearTimeTooltipText(){var e;(e=this.getTimeTooltip())==null||e.setCustomChapterText()}setTimeTooltipTime(){const e=this.getTimeTooltip();e==null||e.updateTime(this.getPointOfInterestTime())}positionMouseTimeDisplay(){var r,n;const e=(r=this.getSeekBar())==null?void 0:r.el();if(!e)return;const t=R.dom.findPosition(e),i=this.getPointOfInterestTime()/this.player().duration();(n=this.getMouseTimeDisplay())==null||n.update(t,i)}showMouseTimeDisplay(){var e;(e=this.getMouseTimeDisplay())==null||e.forceShow()}hideMouseTimeDisplay(){var e;(e=this.getMouseTimeDisplay())==null||e.removeForceShow()}getSeekBar(){var e;return(e=this.player().controlBar.getChild("ProgressControl"))==null?void 0:e.getChild("SeekBar")}getMouseTimeDisplay(){var e;return(e=this.getSeekBar())==null?void 0:e.getChild("MouseTimeDisplay")}getTimeTooltip(){var e;return(e=this.getMouseTimeDisplay())==null?void 0:e.getChild("TimeTooltip")}}const U$=R.getComponent("MenuItem");class x2 extends U${constructor(e,t){super(e,t),this.pointsOfInterestVisible=t.pointsOfInterestVisible,this.toggle(this.pointsOfInterestVisible)}handleToggle(){this.toggle(!this.pointsOfInterestVisible)}toggle(e){e?this.toggleOn():this.toggleOff()}toggleOn(){R.dom.addClass(this.toggleEl,"on"),R.dom.setAttribute(this.toggleEl,"aria-checked","true"),this.pointsOfInterestVisible=!0,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}toggleOff(){R.dom.removeClass(this.toggleEl,"on"),R.dom.setAttribute(this.toggleEl,"aria-checked","false"),this.pointsOfInterestVisible=!1,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}handleClick(e){e.stopImmediatePropagation()}createEl(e,t,i){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=R.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),R.dom.setAttribute(this.toggleEl,"id","poi-toggle"),R.dom.setAttribute(this.toggleEl,"role","switch"),this.toggleEl.addEventListener("click",this.handleToggle);const n=super.createEl(e,{className:"vjs-menu-item cv-cog-menu-item cv-poi-toggle",innerHTML:`
323
+ <span for="poi-toggle" class="vjs-menu-item-text">Points of Interest</span>
324
+ <span class="cv-toggle-container"></span>`},i);return n.children[1].appendChild(this.toggleEl),n}}R.registerComponent("PointsOfInterestMenuItem",x2);const $$=R.getPlugin("plugin"),vb="cvplayer-points-of-interest";class j$ extends $${constructor(e,t){super(e),this.pointOfInterestIndicators=[],this.enabled=!0,this.pointsOfInterest=t==null?void 0:t.pointsOfInterest,this.initialize=this.initialize.bind(this),this.updateBuffered=this.updateBuffered.bind(this),this.updatePlaybackProgress=this.updatePlaybackProgress.bind(this),this.player.one("loadedmetadata",()=>this.player.ready(this.initialize))}initialize(){this.pointsOfInterest&&(dt.hasLocalStorage()&&dt.get(vb)==="false"&&(this.enabled=!1),this.setupTrack(),this.createPointOfInterestIndicators(),this.addMenuItem(),this.bindListeners())}bindListeners(){this.player.on("progress",this.updateBuffered),this.player.on("timeupdate",this.updatePlaybackProgress),this.player.on("dispose",()=>{var e,t;(e=this.player)==null||e.off("progress",this.updateBuffered),(t=this.player)==null||t.off("timeupdate",this.updatePlaybackProgress)})}togglePointsOfInterest(e){dt.set(vb,e.toString()),this.pointOfInterestIndicators.forEach(t=>t.toggleVisibility(e))}setupTrack(){const e=this.player.addTextTrack("metadata","pointsofinterest");this.pointsOfInterest.forEach(t=>{e.addCue({startTime:t.startTime,endTime:t.endTime,text:t.description})}),e.trigger({type:"loadeddata",target:e})}createPointOfInterestIndicators(){var t;const e=(t=this.player.controlBar.getChild("ProgressControl"))==null?void 0:t.getChild("SeekBar");this.pointsOfInterest.forEach(i=>{const r=new F$(this.player,{pointOfInterest:i});this.pointOfInterestIndicators.push(r),e.addChild(r)})}addMenuItem(){var t;((t=this.player.getChild("collapserator"))==null?void 0:t.getChild("cogButton")).addItem({ctor:x2,name:"PointsOfInterestMenuItem",options:{pointsOfInterestVisible:this.enabled}})}updateBuffered(){this.pointOfInterestIndicators.forEach(e=>e.updateBuffered(h2(this.player)))}updatePlaybackProgress(){this.pointOfInterestIndicators.forEach(e=>e.updatePlaybackProgress(this.player.currentTime()))}}R.registerPlugin("pointsOfInterestPlugin",j$);var Is=(s=>(s.None="None",s.Complete="Complete",s.Incomplete="Incomplete",s))(Is||{});const V$=R.getComponent("Button");class A2 extends V${constructor(e,t){super(e,t),this.update()}update(){this.options_.activityStatus===Is.Complete?this.addClass("cv-activity-completed"):this.removeClass("cv-activity-completed")}handleClick(...e){this.options_.activityStatus=this.getToggledActivityStatus(),this.update(),this.options_.clickHandler&&this.options_.clickHandler.call(this,e)}buildCSSClass(){return"cv-activity-status-button"}getToggledActivityStatus(){if(this.options_.activityStatus===Is.None||this.options_.activityStatus===Is.Incomplete)return Is.Complete;if(this.options_.activityStatus===Is.Complete)return Is.Incomplete}}A2.prototype.controlText_="Complete";const H$=R.getPlugin("plugin");class q$ extends H${setActivityStatus(e,t){e!==this.activityStatus&&(this.activityStatus=e,this.onToggleStatus=t,this.player.ready(()=>{this.renderActivityStatusButton()}))}renderActivityStatusButton(){this.button&&this.player.removeChild(this.button),this.button=new A2(this.player,{activityStatus:this.activityStatus,clickHandler:this.onToggleStatus}),this.player.addChild(this.button)}}R.registerPlugin("activityStatusPlugin",q$);const z$=R.getComponent("Component");class yb extends z${constructor(e,t){super(e,t),this.initialize()}initialize(){this.setPosition()}buildCSSClass(){return`cv-range-indicator ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}setPosition(){const e=this.player().duration();this.el_.style.left=this.options_.time/e*100+"%"}}const W$=R.getComponent("ClickableComponent");class _b extends W${constructor(e,t){super(e,t)}buildCSSClass(){return`cv-replay-view-button ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,innerHTML:`<span class="${this.options_.iconClassName}"></span><span>${this.options_.label}</span>`,className:this.buildCSSClass()},i)}handleClick(){this.options_.onPress()}}const G$=R.getComponent("Component");class K$ extends G${constructor(e,t){super(e,t)}buildCSSClass(){return`cv-replay-view ${super.buildCSSClass()}`}createEl(e,t,i){const r=super.createEl(e,{...t,className:this.buildCSSClass()},i),n=R.dom.createEl("h5",{innerHTML:this.localize("This clip has finished"),className:"cv-replay-heading"}),a=R.dom.createEl("div",{className:"cv-button-container"}),o=new _b(this.player_,{label:this.localize("Replay clip"),iconClassName:"cv-replay-icon",onPress:this.options_.onReplayPress}),l=new _b(this.player_,{label:this.localize("Continue watching"),iconClassName:"cv-continue-icon",onPress:this.options_.onContinuePress});return r.appendChild(n),r.appendChild(a),a.appendChild(o.el()),a.appendChild(l.el()),r}}const X$=R.getPlugin("plugin");class Q$ extends X${constructor(e,t){if(super(e,t),this.startTime=parseFloat(t.startTime.toPrecision(4)),this.endTime=parseFloat(t.endTime.toPrecision(4)),this.dismissed=!1,this.startTime>this.endTime)throw Error("Range start cannot be greater than range end");this.bindFunctions(),this.initialize()}bindFunctions(){this.onReady=this.onReady.bind(this),this.onTimeUpdateOrSeeked=this.onTimeUpdateOrSeeked.bind(this),this.onReplayPress=this.onReplayPress.bind(this),this.onContinuePress=this.onContinuePress.bind(this)}initialize(){this.player.one("loadedmetadata",()=>this.player.ready(this.onReady)),this.player.on("timeupdate",this.onTimeUpdateOrSeeked),this.player.on("seeked",this.onTimeUpdateOrSeeked)}onReady(){this.addCssClasses(),this.showRangeIndicators(),this.addMaskToProgressBar()}onTimeUpdateOrSeeked(){if(this.dismissed)return;const e=this.player.currentTime();if(e<this.startTime){this.player.currentTime(this.startTime);return}if(e>this.endTime){this.showReplayView(),this.disablePlayToggle(),this.player.pause(),this.player.currentTime(this.endTime);return}}onReplayPress(){this.player.currentTime(this.startTime),this.player.play(),this.hideReplayView(),this.enablePlayToggle()}onContinuePress(){this.dismissed=!0,this.player.play(),this.hideRangeIndicators(),this.removeMaskFromProgressBar(),this.hideReplayView(),this.enablePlayToggle(),this.removeCssClasses()}showRangeIndicators(){var t;const e=(t=this.player.controlBar.getChild("ProgressControl"))==null?void 0:t.getChild("SeekBar");this.startTimeIndicator||(this.startTimeIndicator=new yb(this.player,{time:this.startTime}),e==null||e.addChild(this.startTimeIndicator)),this.endTimeIndicator||(this.endTimeIndicator=new yb(this.player,{time:this.endTime}),e==null||e.addChild(this.endTimeIndicator))}hideRangeIndicators(){var e,t;(e=this.startTimeIndicator)==null||e.hide(),(t=this.endTimeIndicator)==null||t.hide()}addMaskToProgressBar(){var i;const e=(i=this.player.controlBar.getChild("ProgressControl"))==null?void 0:i.getChild("SeekBar"),t=e==null?void 0:e.el().getElementsByClassName("cv-chapter-bar-items");if(t&&t.length){const r=t[0],n=this.player.duration(),a=this.startTime/n*100,o=100-this.endTime/n*100,l=-5;r.style.clipPath=`inset(${l}em ${o}% ${l}em ${a}%)`}}removeMaskFromProgressBar(){var i;const e=(i=this.player.controlBar.getChild("ProgressControl"))==null?void 0:i.getChild("SeekBar"),t=e==null?void 0:e.el().getElementsByClassName("cv-chapter-bar-items");if(t&&t.length){const r=t[0];r.style.clipPath=""}}showReplayView(){this.replayView||(this.replayView=new K$(this.player,{onContinuePress:this.onContinuePress,onReplayPress:this.onReplayPress}),this.player.addChild(this.replayView)),this.replayView.show()}hideReplayView(){var e;(e=this.replayView)==null||e.hide()}getPlayToggle(){const e=this.player.getChild("collapserator");return e==null?void 0:e.getChild("PlayToggle")}enablePlayToggle(){const e=this.getPlayToggle();e&&e.enable()}disablePlayToggle(){const e=this.getPlayToggle();e&&e.disable()}addCssClasses(){this.player.addClass("cv-range-indicator-plugin")}removeCssClasses(){this.player.removeClass("cv-range-indicator-plugin")}dispose(){var e,t,i;this.removeCssClasses(),this.player.off("timeupdate",this.onTimeUpdateOrSeeked),this.player.off("seeked",this.onTimeUpdateOrSeeked),(e=this.startTimeIndicator)==null||e.dispose(),(t=this.endTimeIndicator)==null||t.dispose(),(i=this.replayView)==null||i.dispose(),super.dispose()}}R.registerPlugin("rangeIndicatorPlugin",Q$);const Y$=R.getComponent("MenuItem");let J$=class extends Y${constructor(e,t){super(e,t),this.onLoopVideoChange=this.onLoopVideoChange.bind(this),this.player_.on("cv:loopvideo",this.onLoopVideoChange),this.onLoopVideoChange(null,this.player_.loopVideoPlugin().loop())}onLoopVideoChange(e,t){t?this.toggleOn():this.toggleOff()}handleToggle(){const e=this.player_.loopVideoPlugin().loop();this.player_.loopVideoPlugin().loop(!e)}toggleOn(){R.dom.addClass(this.toggleEl,"on")}toggleOff(){R.dom.removeClass(this.toggleEl,"on")}handleClick(e){e.stopImmediatePropagation()}createEl(e,t,i){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=R.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);const n=super.createEl(e,{className:"vjs-menu-item cv-cog-menu-item cv-loop-video-toggle",innerHTML:`
325
+ <span class="vjs-menu-item-text">Loop video</span>
326
+ <span class="cv-toggle-container"></span>`},i);return n.children[1].appendChild(this.toggleEl),n}dispose(){this.player_.off("cv:loopvideo",this.onLoopVideoChange),super.dispose()}};R.registerComponent("LoopVideoMenuItem",J$);const Z$=R.getPlugin("plugin");R.getComponent("MenuItem");const ej=R.getComponent("LoopVideoMenuItem");class tj extends Z${constructor(e,t){super(e),t.allowLoop&&this.player.ready(()=>this.addButton()),this.onEnded=this.onEnded.bind(this),this.player.on("ended",this.onEnded)}addButton(){var t;((t=this.player.getChild("collapserator"))==null?void 0:t.getChild("cogButton")).addItem({ctor:ej,name:"LoopVideoMenuItem"})}onEnded(){this.player.loop()&&this.player.play()}loop(e){var t,i,r;if(typeof e!="boolean")return this.player.loop();e&&((r=(i=(t=this.player).nextVideoPlugin)==null?void 0:i.call(t))==null||r.setShouldPlayNext(!1,!1)),this.player.trigger("cv:loopvideo",e),this.player.loop(e)}dispose(){this.player.off("ended",this.onEnded),super.dispose()}}R.registerPlugin("loopVideoPlugin",tj);const I2={generateRandomId:()=>{var s,e;return((e=(s=window.crypto)==null?void 0:s.randomUUID)==null?void 0:e.call(s))??Math.random().toString()}};class ij extends _m{constructor(e,t){super(e,t)}getPlayerOptions(){var t;const e=super.getPlayerOptions();return this.options.allowTranscript&&(e.allowTranscript=!0),(t=e.devicesConfig)!=null&&t.canUserCastToDevices?{...e,techOrder:["devices",...e.techOrder],devices:{instanceId:I2.generateRandomId()}}:e}configurePlugins(){var e;try{this.options.onClickCreateClip&&this.player.createClipButtonPlugin({onClick:this.options.onClickCreateClip}),this.options.onRequestPictureInPicture&&this.player.pictureInPicture({onRequestPictureInPicture:this.options.onRequestPictureInPicture}),(e=this.options.pointsOfInterest)!=null&&e.length&&this.player.pointsOfInterestPlugin({pointsOfInterest:this.options.pointsOfInterest}),this.player.loopVideoPlugin({allowLoop:this.options.allowLoop})}catch(t){console.log("failed to register plugins",t)}}setNextVideo(e,t,i){if(!this.player.nextVideoPlugin)return;this.player.nextVideoPlugin().setNextVideo(e,t,i)}togglePictureInPicture(e){const t=this.player.pictureInPicture();t&&t.togglePictureInPicture(e)}toggleTheatreMode(e){const t=this.player.theatreModePlugin();t&&t.toggleTheatreMode(e,{shouldLog:!0})}toggleTranscript(e){if(!this.player.viewTranscriptPlugin)return;const t=this.player.viewTranscriptPlugin();t&&t.toggleTranscript(e)}hasStarted(){return this.player.hasStarted()}async additionalSetup(e){if(this.options.onRequestTheatreMode&&this.options.allowTheatreMode&&this.player.theatreModePlugin&&this.player.theatreModePlugin({onRequestTheatreMode:this.options.onRequestTheatreMode,theatreMode:this.options.theatreMode,playbackObject:e}),super.additionalSetup(e),this.options.showResources&&e.resources&&this.player.resourcesPlugin&&this.player.resourcesPlugin({resources:e.resources.list,imageCdnUrl:this.options.imageCdnUrl}),e.mediaType==="MasterClip"){const t=e.additionalData;if(t===null)throw Error("Invalid clip data");this.player.clipPlugin({startTime:t.startTime,endTime:t.endTime})}e.mediaType==="MasterVideo"&&this.options.startTime&&this.options.endTime&&this.player.rangeIndicatorPlugin({startTime:this.options.startTime,endTime:this.options.endTime})}setupAnalyticsDependentPlugins(e){var t;super.setupAnalyticsDependentPlugins(e),this.options.allowTranscript&&this.player.viewTranscriptPlugin().registerAnalytics(this.analyticsService,e),this.options.onRequestTheatreMode&&this.options.allowTheatreMode&&this.player.theatreModePlugin&&this.player.theatreModePlugin().registerAnalytics(this.analyticsService),(t=this.options.devicesConfig)!=null&&t.canUserCastToDevices&&this.player.devicesPlugin&&this.player.devicesPlugin({...this.options.devicesConfig,userId:parseInt(e.viewerId),title:e.title,analyticsService:this.analyticsService})}setActivityStatus(e,t){this.player.activityStatusPlugin().setActivityStatus(e,t)}useCurrentTranscript(e,t){Yt.useMetadataTracks(this.player,"transcript",e,t)}useChapters(e){Yt.useChapters(this.player,e)}}function rj(s){return new Proxy(s,{get(e,t,i){if(!(t!=="off"&&e.isDisposed()))return Reflect.get(e,t,i)}})}var hl={},np={exports:{}},sp={exports:{}},ap={exports:{}},Tb;function nj(){if(Tb)return ap.exports;Tb=1;var s=ap.exports={type:i,isArray:n,isFunction:r,isPlainObject:o,each:a,extend:l,noop:function(){}},e=Object.prototype.toString,t={};"Boolean Number String Function Array Date RegExp Object".split(" ").forEach(function(u){t["[object "+u+"]"]=u.toLowerCase()});function i(u){return u==null?String(u):t[e.call(u)]||"object"}function r(u){return s.type(u)==="function"}function n(u){return s.type(u)==="array"}function a(u,c,h){var f,g=0,C=u.length,p=C===void 0||r(u);if(h)if(p){for(f in u)if(c.apply(u[f],h)===!1)break}else for(;g<C&&c.apply(u[g++],h)!==!1;);else if(p){for(f in u)if(c.call(u[f],f,u[f])===!1)break}else for(;g<C&&c.call(u[g],g,u[g++])!==!1;);return u}function o(u){return!(!u||s.type(u)!=="object")}function l(){var u,c,h,f,g,C,p=arguments[0]||{},b=1,I=arguments.length,L=!1;for(typeof p=="boolean"&&(L=p,p=arguments[1]||{},b=2),typeof p!="object"&&!s.isFunction(p)&&(p={}),I===b&&(p=this,--b);b<I;b++)if((u=arguments[b])!=null)for(c in u)h=p[c],f=u[c],p!==f&&(L&&f&&(s.isPlainObject(f)||(g=s.isArray(f)))?(g?(g=!1,C=h&&s.isArray(h)?h:[]):C=h&&s.isPlainObject(h)?h:{},p[c]=s.extend(L,C,f)):f!==void 0&&(p[c]=f));return p}return ap.exports}var bb;function sj(){if(bb)return sp.exports;bb=1;var s=sp.exports=nj(),e=/\s+/,t={};function i(r){var n=t[r]={};return s.each(r.split(e),function(a,o){n[o]=!0}),n}return s.Callbacks=function(r){r=typeof r=="string"?t[r]||i(r):s.extend({},r);var n,a,o,l,u,c,h=[],f=!r.once&&[],g=function(p){for(n=r.memory&&p,a=!0,c=l||0,l=0,u=h.length,o=!0;h&&c<u;c++)if(h[c].apply(p[0],p[1])===!1&&r.stopOnFalse){n=!1;break}o=!1,h&&(f?f.length&&g(f.shift()):n?h=[]:C.disable())},C={add:function(){if(h){var p=h.length;(function b(I){s.each(I,function(L,F){var V=s.type(F);V==="function"?(!r.unique||!C.has(F))&&h.push(F):F&&F.length&&V!=="string"&&b(F)})})(arguments),o?u=h.length:n&&(l=p,g(n))}return this},remove:function(){return h&&s.each(arguments,function(p,b){for(var I;(I=s.inArray(b,h,I))>-1;)h.splice(I,1),o&&(I<=u&&u--,I<=c&&c--)}),this},has:function(p){return s.inArray(p,h)>-1},empty:function(){return h=[],this},disable:function(){return h=f=n=void 0,this},disabled:function(){return!h},lock:function(){return f=void 0,n||C.disable(),this},locked:function(){return!f},fireWith:function(p,b){return b=b||[],b=[p,b.slice?b.slice():b],h&&(!a||f)&&(o?f.push(b):g(b)),this},fire:function(){return C.fireWith(this,arguments),this},fired:function(){return!!a}};return C},sp.exports}var Sb;function aj(){if(Sb)return np.exports;Sb=1;/*!
327
+ * jquery-deferred
328
+ * Copyright(c) 2011 Hidden <zzdhidden@gmail.com>
329
+ * MIT Licensed
330
+ */var s=np.exports=sj(),e=Array.prototype.slice;return s.extend({Deferred:function(t){var i=[["resolve","done",s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory")]],r="pending",n={state:function(){return r},always:function(){return a.done(arguments).fail(arguments),this},then:function(){var o=arguments;return s.Deferred(function(l){s.each(i,function(u,c){var h=c[0],f=o[u];a[c[1]](s.isFunction(f)?function(){var g=f.apply(this,arguments);g&&s.isFunction(g.promise)?g.promise().done(l.resolve).fail(l.reject).progress(l.notify):l[h+"With"](this===a?l:this,[g])}:l[h])}),o=null}).promise()},promise:function(o){return o!=null?s.extend(o,n):n}},a={};return n.pipe=n.then,s.each(i,function(o,l){var u=l[2],c=l[3];n[l[1]]=u.add,c&&u.add(function(){r=c},i[o^1][2].disable,i[2][2].lock),a[l[0]]=u.fire,a[l[0]+"With"]=u.fireWith}),n.promise(a),t&&t.call(a,a),a},when:function(t){var i=0,r=e.call(arguments),n=r.length,a=n!==1||t&&s.isFunction(t.promise)?n:0,o=a===1?t:s.Deferred(),l=function(f,g,C){return function(p){g[f]=this,C[f]=arguments.length>1?e.call(arguments):p,C===u?o.notifyWith(g,C):--a||o.resolveWith(g,C)}},u,c,h;if(n>1)for(u=new Array(n),c=new Array(n),h=new Array(n);i<n;i++)r[i]&&s.isFunction(r[i].promise)?r[i].promise().done(l(i,h,r)).fail(o.reject).progress(l(i,c,u)):--a;return a||o.resolveWith(h,r),o.promise()}}),np.exports}var op,Cb;function oj(){return Cb||(Cb=1,op=aj()),op}var lp={exports:{}};/**
331
+ * @preserve jquery-param (c) 2015 KNOWLEDGECODE | MIT
332
+ */var Eb;function lj(){return Eb||(Eb=1,(function(s){(function(e){var t=function(i){var r=[],n=/\[\]$/,a=function(u){return Object.prototype.toString.call(u)==="[object Array]"},o=function(u,c){c=typeof c=="function"?c():c===null||c===void 0?"":c,r[r.length]=encodeURIComponent(u)+"="+encodeURIComponent(c)},l=function(u,c){var h,f,g;if(u)if(a(c))for(h=0,f=c.length;h<f;h++)n.test(u)?o(u,c[h]):l(u+"["+(typeof c[h]=="object"?h:"")+"]",c[h]);else if(c&&String(c)==="[object Object]")for(g in c)l(u+"["+g+"]",c[g]);else o(u,c);else if(a(c))for(h=0,f=c.length;h<f;h++)o(c[h].name,c[h].value);else for(g in c)l(g,c[g]);return r};return l("",i).join("&").replace(/%20/g,"+")};s.exports=t})()})(lp)),lp.exports}var up,wb;function uj(){if(wb)return up;wb=1;var s=oj(),e=lj(),t=function(a){var o=a.events||{};return a&&a===a.window?{0:a,load:function(u){return a.addEventListener("load",u,!1)},bind:function(u,c){return a.addEventListener(u,c,!1)},unbind:function(u,c){return a.removeEventListener(u,c,!1)}}:{0:a,unbind:function(u,c){var h=o[u]||[];if(c){var f=h.indexOf(c);f!==-1&&h.splice(f,1)}else h=[];o[u]=h,a.events=o},bind:function(u,c){var h=o[u]||[];o[u]=h.concat(c),a.events=o},triggerHandler:function(u,c){var h=this,f=o[u]||[];f.forEach(function(g){c&&c[0]&&c[0].type===void 0?c=[{type:u}].concat(c||[]):c=c||[],g.apply(h,c)})}}},i=function(){try{return new window.XMLHttpRequest}catch{}},r=function(a){var o=i();a.xhrFields&&a.xhrFields.withCredentials&&(o.withCredentials=!0),o.onreadystatechange=function(){if(o.readyState===4)if(o.status===200&&!o._hasError)try{a.success&&a.success(JSON.parse(o.responseText))}catch{a.error&&a.error(o)}else a.error&&a.error(o)},o.withCredentials=a.xhrFields.withCredentials;var l="_="+new Date().getTime();return a.url.indexOf("?")===-1?a.url+="?"+l:a.url.indexOf("_=")===-1?a.url+="&"+l:a.url=a.url.replace(/_=\d+/,l),o.open(a.type,a.url),o.setRequestHeader("content-type",a.contentType),a.headers&&Object.keys(a.headers).forEach(function(u){var c=a.headers[u];o.setRequestHeader(u,c)}),o.send(a.data.data&&"data="+encodeURIComponent(a.data.data)),{abort:function(c){return o.abort(c)}}};return up=s.extend(t,s,{defaultAjaxHeaders:null,ajax:r,inArray:function(a,o){return a.indexOf(o)!==-1},trim:function(a){return a&&a.trim()},isEmptyObject:function(a){return!a||Object.keys(a).length===0},makeArray:function(a){return[].slice.call(a,0)},param:function(a){return e(a)},support:{cors:(function(){var n=i();return!!n&&"withCredentials"in n})()}}),up}var kb;function cj(){if(kb)return hl;kb=1,Object.defineProperty(hl,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e=uj();/*!
333
+ * ASP.NET SignalR JavaScript Library 2.4.1
334
+ * http://signalr.net/
335
+ *
336
+ * Copyright (c) .NET Foundation. All rights reserved.
337
+ * Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
338
+ *
339
+ */return(function(t,i,r){var n={nojQuery:"jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.",noTransportOnInit:"No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.",errorOnNegotiate:"Error during negotiation request.",stoppedWhileLoading:"The connection was stopped during page load.",stoppedWhileNegotiating:"The connection was stopped during the negotiate request.",errorParsingNegotiateResponse:"Error parsing negotiate response.",errorRedirectionExceedsLimit:"Negotiate redirection limit exceeded.",errorDuringStartRequest:"Error during start request. Stopping the connection.",errorFromServer:"Error message received from the server: '{0}'.",stoppedDuringStartRequest:"The connection was stopped during the start request.",errorParsingStartResponse:"Error parsing start response: '{0}'. Stopping the connection.",invalidStartResponse:"Invalid start response: '{0}'. Stopping the connection.",protocolIncompatible:"You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.",aspnetCoreSignalrServer:"Detected a connection attempt to an ASP.NET Core SignalR Server. This client only supports connecting to an ASP.NET SignalR Server. See https://aka.ms/signalr-core-differences for details.",sendFailed:"Send failed.",parseFailed:"Failed at parsing response: {0}",longPollFailed:"Long polling request failed.",eventSourceFailedToConnect:"EventSource failed to connect.",eventSourceError:"Error raised by EventSource",webSocketClosed:"WebSocket closed.",pingServerFailedInvalidResponse:"Invalid ping response when pinging server: '{0}'.",pingServerFailed:"Failed to ping server.",pingServerFailedStatusCode:"Failed to ping server. Server responded with status code {0}, stopping the connection.",pingServerFailedParse:"Failed to parse ping server response, stopping the connection.",noConnectionTransport:"Connection is in an invalid state, there is no transport active.",webSocketsInvalidState:"The Web Socket transport is in an invalid state, transitioning into reconnecting.",reconnectTimeout:"Couldn't reconnect within the configured timeout of {0} ms, disconnecting.",reconnectWindowTimeout:"The client has been inactive since {0} and it has exceeded the inactivity timeout of {1} ms. Stopping the connection.",jsonpNotSupportedWithAccessToken:"The JSONP protocol does not support connections that require a Bearer token to connect, such as the Azure SignalR Service."};if(typeof t!="function")throw new Error(n.nojQuery);var a,o,l=i.document.readyState==="complete",u=t(i),c="__Negotiate Aborted__",h={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},f={processData:!0,timeout:null,async:!0,global:!1,cache:!1},g=function(M,U){if(U!==!1){var w;typeof i.console>"u"||(w="["+new Date().toTimeString()+"] SignalR: "+M,i.console.debug?i.console.debug(w):i.console.log&&i.console.log(w))}},C=function(M,U,w){return U===M.state?(M.state=w,t(M).triggerHandler(h.onStateChanged,[{oldState:U,newState:w}]),!0):!1},p=function(M){return M.state===a.connectionState.disconnected},b=function(M){return M._.keepAliveData.activated&&M.transport.supportsKeepAlive(M)},I=function(M){var U,w;M._.configuredStopReconnectingTimeout||(w=function(Q){var G=a._.format(a.resources.reconnectTimeout,Q.disconnectTimeout);Q.log(G),t(Q).triggerHandler(h.onError,[a._.error(G,"TimeoutException")]),Q.stop(!1,!1)},M.reconnecting(function(){var P=this;P.state===a.connectionState.reconnecting&&(U=i.setTimeout(function(){w(P)},P.disconnectTimeout))}),M.stateChanged(function(P){P.oldState===a.connectionState.reconnecting&&i.clearTimeout(U)}),M._.configuredStopReconnectingTimeout=!0)};a=function(M,U,w){return new a.fn.init(M,U,w)},a._={defaultContentType:"application/x-www-form-urlencoded; charset=UTF-8",ieVersion:(function(){var O,M;return i.navigator.appName==="Microsoft Internet Explorer"&&(M=/MSIE ([0-9]+\.[0-9]+)/.exec(i.navigator.userAgent),M&&(O=i.parseFloat(M[1]))),O})(),error:function(M,U,w){var P=new Error(M);return P.source=U,typeof w<"u"&&(P.context=w),P},transportError:function(M,U,w,P){var Q=this.error(M,w,P);return Q.transport=U?U.name:r,Q},format:function(){for(var M=arguments[0],U=0;U<arguments.length-1;U++)M=M.replace("{"+U+"}",arguments[U+1]);return M},firefoxMajorVersion:function(M){var U=M.match(/Firefox\/(\d+)/);return!U||!U.length||U.length<2?0:parseInt(U[1],10)},configurePingInterval:function(M){var U=M._.config,w=function(Q){t(M).triggerHandler(h.onError,[Q])};U&&!M._.pingIntervalId&&U.pingInterval&&(M._.pingIntervalId=i.setInterval(function(){a.transports._logic.pingServer(M).fail(w)},U.pingInterval))}},a.events=h,a.resources=n,a.ajaxDefaults=f,a.changeState=C,a.isDisconnecting=p,a.connectionState={connecting:0,connected:1,reconnecting:2,disconnected:4},a.hub={start:function(){throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/js'><\/script>.")}},typeof u.on=="function"?u.on("load",function(){l=!0}):u.load(function(){l=!0});function L(O,M){if(t.isArray(O)){for(var U=O.length-1;U>=0;U--){var w=O[U];(t.type(w)!=="string"||!a.transports[w])&&(M.log("Invalid transport: "+w+", removing it from the transports list."),O.splice(U,1))}O.length===0&&(M.log("No transports remain within the specified transport array."),O=null)}else if(!a.transports[O]&&O!=="auto")M.log("Invalid transport: "+O.toString()+"."),O=null;else if(O==="auto"&&a._.ieVersion<=8)return["longPolling"];return O}function F(O){if(O==="http:")return 80;if(O==="https:")return 443}function V(O,M){return M.match(/:\d+$/)?M:M+":"+F(O)}function B(O,M){var U=this,w=[];U.tryBuffer=function(P){return O.state===t.signalR.connectionState.connecting?(w.push(P),!0):!1},U.drain=function(){if(O.state===t.signalR.connectionState.connected)for(;w.length>0;)M(w.shift())},U.clear=function(){w=[]}}a.fn=a.prototype={init:function(M,U,w){var P=t(this);this.url=M,this.qs=U,this.lastError=null,this._={keepAliveData:{},connectingMessageBuffer:new B(this,function(Q){P.triggerHandler(h.onReceived,[Q])}),lastMessageAt:new Date().getTime(),lastActiveAt:new Date().getTime(),beatInterval:5e3,beatHandle:null,totalTransportConnectTimeout:0,redirectQs:null},typeof w=="boolean"&&(this.logging=w)},_parseResponse:function(M){var U=this;return M&&(typeof M=="string"?U.json.parse(M):M)},_originalJson:i.JSON,json:i.JSON,isCrossDomain:function(M,U){var w;return M=t.trim(M),U=U||i.location,M.indexOf("http")!==0?!1:(w=i.document.createElement("a"),w.href=M,w.protocol+V(w.protocol,w.host)!==U.protocol+V(U.protocol,U.host))},ajaxDataType:"text",contentType:"application/json; charset=UTF-8",logging:!1,state:a.connectionState.disconnected,clientProtocol:"2.1",supportedProtocols:["1.5","2.0","2.1"],negotiateRedirectSupportedProtocols:["2.0","2.1"],reconnectDelay:2e3,transportConnectTimeout:0,disconnectTimeout:3e4,reconnectWindow:3e4,keepAliveWarnAt:2/3,start:function(M,U){var w=this,P={pingInterval:3e5,waitForPageLoad:!0,transport:"auto",jsonp:!1},Q,G=w._deferral||t.Deferred(),K=i.document.createElement("a"),ce=function(se,ue){se.url===ue&&se.baseUrl||(se.url=ue,K.href=se.url,!K.protocol||K.protocol===":"?(se.protocol=i.document.location.protocol,se.host=K.host||i.document.location.host):(se.protocol=K.protocol,se.host=K.host),se.baseUrl=se.protocol+"//"+se.host,se.wsProtocol=se.protocol==="https:"?"wss://":"ws://",se.url.indexOf("//")===0&&(se.url=i.location.protocol+se.url,se.log("Protocol relative URL detected, normalizing it to '"+se.url+"'.")),se.isCrossDomain(se.url)&&(se.log("Auto detected cross domain url."),P.transport==="auto"&&(P.transport=["webSockets","serverSentEvents","longPolling"]),typeof se.withCredentials>"u"&&(se.withCredentials=!0),t.support.cors||(se.ajaxDataType="jsonp",se.log("Using jsonp because this browser doesn't support CORS.")),se.contentType=a._.defaultContentType))};if(w.lastError=null,w._deferral=G,!w.json)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");if(t.type(M)==="function"?U=M:t.type(M)==="object"&&(t.extend(P,M),t.type(P.callback)==="function"&&(U=P.callback)),P.transport=L(P.transport,w),!P.transport)throw new Error("SignalR: Invalid transport(s) specified, aborting start.");if(w._.config=P,!l&&P.waitForPageLoad===!0)return w._.deferredStartHandler=function(){w.start(M,U)},u.bind("load",w._.deferredStartHandler),G.promise();if(w.state===a.connectionState.connecting)return G.promise();if(C(w,a.connectionState.disconnected,a.connectionState.connecting)===!1)return G.resolve(w),G.promise();I(w),P.transport==="auto"&&P.jsonp===!0&&(P.transport="longPolling"),w.withCredentials=P.withCredentials,w._originalUrl=w.url,w.ajaxDataType=P.jsonp?"jsonp":"text",ce(w,w.url),t(w).bind(h.onStart,function(ne,se){t.type(U)==="function"&&U.call(w),G.resolve(w)}),w._.initHandler=a.transports._logic.initHandler(w),Q=function(se,ue){var he=a._.error(n.noTransportOnInit);if(ue=ue||0,ue>=se.length){ue===0?w.log("No transports supported by the server were selected."):ue===1?w.log("No fallback transports were selected."):w.log("Fallback transports exhausted."),t(w).triggerHandler(h.onError,[he]),G.reject(he),w.stop();return}if(w.state!==a.connectionState.disconnected){var ve=se[ue],Ae=a.transports[ve],De=function(){Q(se,ue+1)};w.transport=Ae;try{w._.initHandler.start(Ae,function(){var Me=a._.firefoxMajorVersion(i.navigator.userAgent)>=11,Ne=!0;w.log("The start request succeeded. Transitioning to the connected state."),b(w)&&a.transports._logic.monitorKeepAlive(w),a.transports._logic.startHeartbeat(w),a._.configurePingInterval(w),C(w,a.connectionState.connecting,a.connectionState.connected)||w.log("WARNING! The connection was not in the connecting state."),w._.connectingMessageBuffer.drain(),t(w).triggerHandler(h.onStart),u.bind("unload",function(){w.log("Window unloading, stopping the connection."),w.stop(Ne)}),Me&&u.bind("beforeunload",function(){i.setTimeout(function(){w.stop(Ne)},0)})},De)}catch(Me){w.log(Ae.name+" transport threw '"+Me.message+"' when attempting to start."),De()}}};var de=w.url+"/negotiate",pe=function(se,ue){var he=a._.error(n.errorOnNegotiate,se,ue._.negotiateRequest);t(ue).triggerHandler(h.onError,he),G.reject(he),ue.stop()};return t(w).triggerHandler(h.onStarting),de=a.transports._logic.prepareQueryString(w,de),w.log("Negotiating with '"+de+"'."),w._.negotiateRequest=(function(){var ne,se=0,ue=100,he,ve,Ae=[],De=[],Me=function(Re,Oe){var He=a.transports._logic.prepareQueryString(Re,Re.url+"/negotiate");Re.log("Negotiating with '"+He+"'.");var st={url:He,error:function(Nt,Ni){Ni!==c?pe(Nt,Re):G.reject(a._.error(n.stoppedWhileNegotiating,null,Re._.negotiateRequest))},success:Oe};return Re.accessToken&&(st.headers={Authorization:"Bearer "+Re.accessToken}),a.transports._logic.ajax(Re,st)},Ne=function Je(Re){try{ne=w._parseResponse(Re)}catch(He){pe(a._.error(n.errorParsingNegotiateResponse,He),w);return}if(ne.availableTransports){ve=a._.error(n.aspnetCoreSignalrServer),t(w).triggerHandler(h.onError,[ve]),G.reject(ve);return}if(!ne.ProtocolVersion||w.supportedProtocols.indexOf(ne.ProtocolVersion)===-1){ve=a._.error(a._.format(n.protocolIncompatible,w.clientProtocol,ne.ProtocolVersion)),t(w).triggerHandler(h.onError,[ve]),G.reject(ve);return}if(w.negotiateRedirectSupportedProtocols.indexOf(ne.ProtocolVersion)!==-1){if(ne.Error){ve=a._.error(a._.format(n.errorFromServer,ne.Error)),t(w).triggerHandler(h.onError,[ve]),G.reject(ve);return}else if(ne.RedirectUrl){if(se===ue){pe(a._.error(n.errorRedirectionExceedsLimit),w);return}P.transport==="auto"&&(P.transport=["webSockets","serverSentEvents","longPolling"]),w.log("Received redirect to: "+ne.RedirectUrl),w.accessToken=ne.AccessToken;var Oe=ne.RedirectUrl.split("?",2);if(ce(w,Oe[0]),w._.redirectQs=Oe.length===2?Oe[1]:null,w.ajaxDataType==="jsonp"&&w.accessToken){pe(a._.error(n.jsonpNotSupportedWithAccessToken),w);return}se++,Me(w,Je);return}}he=w._.keepAliveData,w.appRelativeUrl=ne.Url,w.id=ne.ConnectionId,w.token=ne.ConnectionToken,w.webSocketServerUrl=ne.WebSocketServerUrl,w._.pollTimeout=ne.ConnectionTimeout*1e3+1e4,w.disconnectTimeout=ne.DisconnectTimeout*1e3,w._.totalTransportConnectTimeout=w.transportConnectTimeout+ne.TransportConnectTimeout*1e3,ne.KeepAliveTimeout?(he.activated=!0,he.timeout=ne.KeepAliveTimeout*1e3,he.timeoutWarning=he.timeout*w.keepAliveWarnAt,w._.beatInterval=(he.timeout-he.timeoutWarning)/3):he.activated=!1,w.reconnectWindow=w.disconnectTimeout+(he.timeout||0),t.each(a.transports,function(He){if(He.indexOf("_")===0||He==="webSockets"&&!ne.TryWebSockets)return!0;De.push(He)}),t.isArray(P.transport)?t.each(P.transport,function(He,st){t.inArray(st,De)>=0&&Ae.push(st)}):P.transport==="auto"?Ae=De:t.inArray(P.transport,De)>=0&&Ae.push(P.transport),Q(Ae)};return Me(w,Ne)})(),G.promise()},starting:function(M){var U=this;return t(U).bind(h.onStarting,function(w,P){M.call(U)}),U},send:function(M){var U=this;if(U.state===a.connectionState.disconnected)throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()");if(U.state===a.connectionState.connecting)throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.");return U.transport.send(U,M),U},received:function(M){var U=this;return t(U).bind(h.onReceived,function(w,P){M.call(U,P)}),U},stateChanged:function(M){var U=this;return t(U).bind(h.onStateChanged,function(w,P){M.call(U,P)}),U},error:function(M){var U=this;return t(U).bind(h.onError,function(w,P,Q){U.lastError=P,M.call(U,P,Q)}),U},disconnected:function(M){var U=this;return t(U).bind(h.onDisconnect,function(w,P){M.call(U)}),U},connectionSlow:function(M){var U=this;return t(U).bind(h.onConnectionSlow,function(w,P){M.call(U)}),U},reconnecting:function(M){var U=this;return t(U).bind(h.onReconnecting,function(w,P){M.call(U)}),U},reconnected:function(M){var U=this;return t(U).bind(h.onReconnect,function(w,P){M.call(U)}),U},stop:function(M,U){var w=this,P=w._deferral;if(w._.deferredStartHandler&&u.unbind("load",w._.deferredStartHandler),delete w._.config,delete w._.deferredStartHandler,!l&&(!w._.config||w._.config.waitForPageLoad===!0)){w.log("Stopping connection prior to negotiate."),P&&P.reject(a._.error(n.stoppedWhileLoading));return}if(w.state!==a.connectionState.disconnected)return w.log("Stopping connection."),i.clearTimeout(w._.beatHandle),i.clearInterval(w._.pingIntervalId),w.transport&&(w.transport.stop(w),U!==!1&&w.transport.abort(w,M),b(w)&&a.transports._logic.stopMonitoringKeepAlive(w),w.transport=null),w._.negotiateRequest&&(w._.negotiateRequest.abort(c),delete w._.negotiateRequest),w._.initHandler&&w._.initHandler.stop(),delete w._deferral,delete w.messageId,delete w.groupsToken,delete w.id,delete w._.pingIntervalId,delete w._.lastMessageAt,delete w._.lastActiveAt,w._.connectingMessageBuffer.clear(),t(w).unbind(h.onStart),delete w.accessToken,delete w.protocol,delete w.host,delete w.baseUrl,delete w.wsProtocol,delete w.contentType,w.url=w._originalUrl,w._.redirectQs=null,C(w,w.state,a.connectionState.disconnected),t(w).triggerHandler(h.onDisconnect),w},log:function(M){g(M,this.logging)}},a.fn.init.prototype=a.fn,a.noConflict=function(){return t.connection===a&&(t.connection=o),a},t.connection&&(o=t.connection),t.connection=t.signalR=a})(e,window),(function(t,i,r){var n=t.signalR,a=t.signalR.events,o=t.signalR.changeState,l="__Start Aborted__",u;n.transports={};function c(C){C._.keepAliveData.monitoring&&h(C),u.markActive(C)&&(C._.beatHandle=i.setTimeout(function(){c(C)},C._.beatInterval))}function h(C){var p=C._.keepAliveData,b;C.state===n.connectionState.connected&&(b=new Date().getTime()-C._.lastMessageAt,b>=p.timeout?(C.log("Keep alive timed out. Notifying transport that connection has been lost."),C.transport.lostConnection(C)):b>=p.timeoutWarning?p.userNotified||(C.log("Keep alive has been missed, connection may be dead/slow."),t(C).triggerHandler(a.onConnectionSlow),p.userNotified=!0):p.userNotified=!1)}function f(C,p){var b=C.url+p;return C.transport&&(b+="?transport="+C.transport.name),u.prepareQueryString(C,b)}function g(C){this.connection=C,this.startRequested=!1,this.startCompleted=!1,this.connectionStopped=!1}g.prototype={start:function(p,b,I){var L=this,F=L.connection,V=!1;if(L.startRequested||L.connectionStopped){F.log("WARNING! "+p.name+" transport cannot be started. Initialization ongoing or completed.");return}F.log(p.name+" transport starting."),p.start(F,function(){V||L.initReceived(p,b)},function(B){return V||(V=!0,L.transportFailed(p,B,I)),!L.startCompleted||L.connectionStopped}),L.transportTimeoutHandle=i.setTimeout(function(){V||(V=!0,F.log(p.name+" transport timed out when trying to connect."),L.transportFailed(p,r,I))},F._.totalTransportConnectTimeout)},stop:function(){this.connectionStopped=!0,i.clearTimeout(this.transportTimeoutHandle),n.transports._logic.tryAbortStartRequest(this.connection)},initReceived:function(p,b){var I=this,L=I.connection;if(I.startRequested){L.log("WARNING! The client received multiple init messages.");return}I.connectionStopped||(I.startRequested=!0,i.clearTimeout(I.transportTimeoutHandle),L.log(p.name+" transport connected. Initiating start request."),n.transports._logic.ajaxStart(L,function(){I.startCompleted=!0,b()}))},transportFailed:function(p,b,I){var L=this.connection,F=L._deferral,V;this.connectionStopped||(i.clearTimeout(this.transportTimeoutHandle),this.startRequested?this.startCompleted||(V=n._.error(n.resources.errorDuringStartRequest,b),L.log(p.name+" transport failed during the start request. Stopping the connection."),t(L).triggerHandler(a.onError,[V]),F&&F.reject(V),L.stop()):(p.stop(L),L.log(p.name+" transport failed to connect. Attempting to fall back."),I()))}},u=n.transports._logic={ajax:function(p,b){return t.ajax(t.extend(!0,{},t.signalR.ajaxDefaults,{type:"GET",data:{},xhrFields:{withCredentials:p.withCredentials},contentType:p.contentType,dataType:p.ajaxDataType},b))},pingServer:function(p){var b,I,L=t.Deferred();return p.transport?(b=p.url+"/ping",b=u.addQs(b,p.qs),I=u.ajax(p,{url:b,headers:p.accessToken?{Authorization:"Bearer "+p.accessToken}:{},success:function(V){var B;try{B=p._parseResponse(V)}catch(O){L.reject(n._.transportError(n.resources.pingServerFailedParse,p.transport,O,I)),p.stop();return}B.Response==="pong"?L.resolve():L.reject(n._.transportError(n._.format(n.resources.pingServerFailedInvalidResponse,V),p.transport,null,I))},error:function(V){V.status===401||V.status===403?(L.reject(n._.transportError(n._.format(n.resources.pingServerFailedStatusCode,V.status),p.transport,V,I)),p.stop()):L.reject(n._.transportError(n.resources.pingServerFailed,p.transport,V,I))}})):L.reject(n._.transportError(n.resources.noConnectionTransport,p.transport)),L.promise()},prepareQueryString:function(p,b){var I;return I=u.addQs(b,"clientProtocol="+p.clientProtocol),typeof p._.redirectQs=="string"?I=u.addQs(I,p._.redirectQs):I=u.addQs(I,p.qs),p.token&&(I+="&connectionToken="+i.encodeURIComponent(p.token)),p.data&&(I+="&connectionData="+i.encodeURIComponent(p.data)),I},addQs:function(p,b){var I=p.indexOf("?")!==-1?"&":"?",L;if(!b)return p;if((typeof b>"u"?"undefined":s(b))==="object")return p+I+t.param(b);if(typeof b=="string")return L=b.charAt(0),(L==="?"||L==="&")&&(I=""),p+I+b;throw new Error("Query string property must be either a string or object.")},getUrl:function(p,b,I,L,F){var V=b==="webSockets"?"":p.baseUrl,B=V+p.appRelativeUrl,O="transport="+b;return!F&&p.groupsToken&&(O+="&groupsToken="+i.encodeURIComponent(p.groupsToken)),I?(L?B+="/poll":B+="/reconnect",!F&&p.messageId&&(O+="&messageId="+i.encodeURIComponent(p.messageId))):B+="/connect",B+="?"+O,B=u.prepareQueryString(p,B),p.transport&&p.accessToken&&(p.transport.name==="serverSentEvents"||p.transport.name==="webSockets")&&(B+="&access_token="+i.encodeURIComponent(p.accessToken)),F||(B+="&tid="+Math.floor(Math.random()*11)),B},maximizePersistentResponse:function(p){return{MessageId:p.C,Messages:p.M,Initialized:typeof p.S<"u",ShouldReconnect:typeof p.T<"u",LongPollDelay:p.L,GroupsToken:p.G,Error:p.E}},updateGroups:function(p,b){b&&(p.groupsToken=b)},stringifySend:function(p,b){return typeof b=="string"||typeof b>"u"||b===null?b:p.json.stringify(b)},ajaxSend:function(p,b){var I=u.stringifySend(p,b),L=f(p,"/send"),F,V=function(O,M){t(M).triggerHandler(a.onError,[n._.transportError(n.resources.sendFailed,M.transport,O,F),b])};return F=u.ajax(p,{url:L,type:p.ajaxDataType==="jsonp"?"GET":"POST",contentType:n._.defaultContentType,headers:p.accessToken?{Authorization:"Bearer "+p.accessToken}:{},data:{data:I},success:function(O){var M;if(O){try{M=p._parseResponse(O)}catch(U){V(U,p),p.stop();return}u.triggerReceived(p,M)}},error:function(O,M){M==="abort"||M==="parsererror"||V(O,p)}}),F},ajaxAbort:function(p,b){if(!(typeof p.transport>"u")){b=typeof b>"u"?!0:b;var I=f(p,"/abort");u.ajax(p,{url:I,async:b,timeout:1e3,type:"POST",headers:p.accessToken?{Authorization:"Bearer "+p.accessToken}:{},dataType:"text"}),p.log("Fired ajax abort async = "+b+".")}},ajaxStart:function(p,b){var I=function(V){var B=p._deferral;B&&B.reject(V)},L=function(V){p.log("The start request failed. Stopping the connection."),t(p).triggerHandler(a.onError,[V]),I(V),p.stop()};p._.startRequest=u.ajax(p,{url:f(p,"/start"),headers:p.accessToken?{Authorization:"Bearer "+p.accessToken}:{},success:function(V,B,O){var M;try{M=p._parseResponse(V)}catch(U){L(n._.error(n._.format(n.resources.errorParsingStartResponse,V),U,O));return}M.Response==="started"?b():L(n._.error(n._.format(n.resources.invalidStartResponse,V),null,O))},error:function(V,B,O){B!==l?L(n._.error(n.resources.errorDuringStartRequest,O,V)):(p.log("The start request aborted because connection.stop() was called."),I(n._.error(n.resources.stoppedDuringStartRequest,null,V)))}})},tryAbortStartRequest:function(p){p._.startRequest&&(p._.startRequest.abort(l),delete p._.startRequest)},tryInitialize:function(p,b,I){b.Initialized&&I?I():b.Initialized&&p.log("WARNING! The client received an init message after reconnecting.")},triggerReceived:function(p,b){p._.connectingMessageBuffer.tryBuffer(b)||t(p).triggerHandler(a.onReceived,[b])},processMessages:function(p,b,I){var L;if(b&&typeof b.I<"u"){u.triggerReceived(p,b);return}if(u.markLastMessage(p),b){if(L=u.maximizePersistentResponse(b),L.Error){p.log("Received an error message from the server: "+b.E),t(p).triggerHandler(n.events.onError,[n._.error(b.E,"ServerError")]),p.stop(!1,!1);return}u.updateGroups(p,L.GroupsToken),L.MessageId&&(p.messageId=L.MessageId),L.Messages&&(t.each(L.Messages,function(F,V){u.triggerReceived(p,V)}),u.tryInitialize(p,L,I))}},monitorKeepAlive:function(p){var b=p._.keepAliveData;b.monitoring?p.log("Tried to monitor keep alive but it's already being monitored."):(b.monitoring=!0,u.markLastMessage(p),p._.keepAliveData.reconnectKeepAliveUpdate=function(){u.markLastMessage(p)},t(p).bind(a.onReconnect,p._.keepAliveData.reconnectKeepAliveUpdate),p.log("Now monitoring keep alive with a warning timeout of "+b.timeoutWarning+", keep alive timeout of "+b.timeout+" and disconnecting timeout of "+p.disconnectTimeout))},stopMonitoringKeepAlive:function(p){var b=p._.keepAliveData;b.monitoring&&(b.monitoring=!1,t(p).unbind(a.onReconnect,p._.keepAliveData.reconnectKeepAliveUpdate),p._.keepAliveData={},p.log("Stopping the monitoring of the keep alive."))},startHeartbeat:function(p){p._.lastActiveAt=new Date().getTime(),c(p)},markLastMessage:function(p){p._.lastMessageAt=new Date().getTime()},markActive:function(p){return u.verifyLastActive(p)?(p._.lastActiveAt=new Date().getTime(),!0):!1},isConnectedOrReconnecting:function(p){return p.state===n.connectionState.connected||p.state===n.connectionState.reconnecting},ensureReconnectingState:function(p){return o(p,n.connectionState.connected,n.connectionState.reconnecting)===!0&&t(p).triggerHandler(a.onReconnecting),p.state===n.connectionState.reconnecting},clearReconnectTimeout:function(p){p&&p._.reconnectTimeout&&(i.clearTimeout(p._.reconnectTimeout),delete p._.reconnectTimeout)},verifyLastActive:function(p){if(new Date().getTime()-p._.lastActiveAt>=p.reconnectWindow){var b=n._.format(n.resources.reconnectWindowTimeout,new Date(p._.lastActiveAt),p.reconnectWindow);return p.log(b),t(p).triggerHandler(a.onError,[n._.error(b,"TimeoutException")]),p.stop(!1,!1),!1}return!0},reconnect:function(p,b){var I=n.transports[b];if(u.isConnectedOrReconnecting(p)&&!p._.reconnectTimeout){if(!u.verifyLastActive(p))return;p._.reconnectTimeout=i.setTimeout(function(){u.verifyLastActive(p)&&(I.stop(p),u.ensureReconnectingState(p)&&(p.log(b+" reconnecting."),I.start(p)))},p.reconnectDelay)}},handleParseFailure:function(p,b,I,L,F){var V=n._.transportError(n._.format(n.resources.parseFailed,b),p.transport,I,F);L&&L(V)?p.log("Failed to parse server response while attempting to connect."):(t(p).triggerHandler(a.onError,[V]),p.stop())},initHandler:function(p){return new g(p)},foreverFrame:{count:0,connections:{}}}})(e,window),(function(t,i,r){var n=t.signalR,a=t.signalR.events,o=t.signalR.changeState,l=n.transports._logic;n.transports.webSockets={name:"webSockets",supportsKeepAlive:function(){return!0},send:function(c,h){var f=l.stringifySend(c,h);try{c.socket.send(f)}catch(g){t(c).triggerHandler(a.onError,[n._.transportError(n.resources.webSocketsInvalidState,c.transport,g,c.socket),h])}},start:function(c,h,f){var g,C=!1,p=this,b=!h,I=t(c);if(!i.WebSocket){f();return}c.socket||(c.webSocketServerUrl?g=c.webSocketServerUrl:g=c.wsProtocol+c.host,g+=l.getUrl(c,this.name,b),c.log("Connecting to websocket endpoint '"+g+"'."),c.socket=new i.WebSocket(g),c.socket.onopen=function(){C=!0,c.log("Websocket opened."),l.clearReconnectTimeout(c),o(c,n.connectionState.reconnecting,n.connectionState.connected)===!0&&I.triggerHandler(a.onReconnect)},c.socket.onclose=function(L){var F;this===c.socket&&(C&&typeof L.wasClean<"u"&&L.wasClean===!1?(F=n._.transportError(n.resources.webSocketClosed,c.transport,L),c.log("Unclean disconnect from websocket: "+(L.reason||"[no reason given]."))):c.log("Websocket closed."),(!f||!f(F))&&(F&&t(c).triggerHandler(a.onError,[F]),p.reconnect(c)))},c.socket.onmessage=function(L){var F;try{F=c._parseResponse(L.data)}catch(V){l.handleParseFailure(c,L.data,V,f,L);return}F&&l.processMessages(c,F,h)})},reconnect:function(c){l.reconnect(c,this.name)},lostConnection:function(c){this.reconnect(c)},stop:function(c){l.clearReconnectTimeout(c),c.socket&&(c.log("Closing the Websocket."),c.socket.close(),c.socket=null)},abort:function(c,h){l.ajaxAbort(c,h)}}})(e,window),(function(t,i,r){var n=t.signalR,a=t.signalR.events,o=t.signalR.changeState,l=n.transports._logic,u=function(h){i.clearTimeout(h._.reconnectAttemptTimeoutHandle),delete h._.reconnectAttemptTimeoutHandle};n.transports.serverSentEvents={name:"serverSentEvents",supportsKeepAlive:function(){return!0},timeOut:3e3,start:function(h,f,g){var C=this,p=!1,b=t(h),I=!f,L;if(h.eventSource&&(h.log("The connection already has an event source. Stopping it."),h.stop()),!i.EventSource){g&&(h.log("This browser doesn't support SSE."),g());return}L=l.getUrl(h,this.name,I);try{h.log("Attempting to connect to SSE endpoint '"+L+"'."),h.eventSource=new i.EventSource(L,{withCredentials:h.withCredentials})}catch(F){h.log("EventSource failed trying to connect with error "+F.Message+"."),g?g():(b.triggerHandler(a.onError,[n._.transportError(n.resources.eventSourceFailedToConnect,h.transport,F)]),I&&C.reconnect(h));return}I&&(h._.reconnectAttemptTimeoutHandle=i.setTimeout(function(){p===!1&&h.eventSource.readyState!==i.EventSource.OPEN&&C.reconnect(h)},C.timeOut)),h.eventSource.addEventListener("open",function(F){h.log("EventSource connected."),u(h),l.clearReconnectTimeout(h),p===!1&&(p=!0,o(h,n.connectionState.reconnecting,n.connectionState.connected)===!0&&b.triggerHandler(a.onReconnect))},!1),h.eventSource.addEventListener("message",function(F){var V;if(F.data!=="initialized"){try{V=h._parseResponse(F.data)}catch(B){l.handleParseFailure(h,F.data,B,g,F);return}l.processMessages(h,V,f)}},!1),h.eventSource.addEventListener("error",function(F){var V=n._.transportError(n.resources.eventSourceError,h.transport,F);this===h.eventSource&&(g&&g(V)||(h.log("EventSource readyState: "+h.eventSource.readyState+"."),F.eventPhase===i.EventSource.CLOSED?(h.log("EventSource reconnecting due to the server connection ending."),C.reconnect(h)):(h.log("EventSource error."),b.triggerHandler(a.onError,[V]))))},!1)},reconnect:function(h){l.reconnect(h,this.name)},lostConnection:function(h){this.reconnect(h)},send:function(h,f){l.ajaxSend(h,f)},stop:function(h){u(h),l.clearReconnectTimeout(h),h&&h.eventSource&&(h.log("EventSource calling close()."),h.eventSource.close(),h.eventSource=null,delete h.eventSource)},abort:function(h,f){l.ajaxAbort(h,f)}}})(e,window),(function(t,i,r){var n=t.signalR,a=t.signalR.events,o=t.signalR.changeState,l=n.transports._logic,u=function(){var f=i.document.createElement("iframe");return f.setAttribute("style","position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;"),f},c=(function(){var h=null,f=1e3,g=0;return{prevent:function(){n._.ieVersion<=8&&(g===0&&(h=i.setInterval(function(){var p=u();i.document.body.appendChild(p),i.document.body.removeChild(p),p=null},f)),g++)},cancel:function(){g===1&&i.clearInterval(h),g>0&&g--}}})();n.transports.foreverFrame={name:"foreverFrame",supportsKeepAlive:function(){return!0},iframeClearThreshold:50,start:function(f,g,C){if(f.accessToken){C&&(f.log("Forever Frame does not support connections that require a Bearer token to connect, such as the Azure SignalR Service."),C());return}var p=this,b=l.foreverFrame.count+=1,I,L=u(),F=function(){f.log("Forever frame iframe finished loading and is no longer receiving messages."),(!C||!C())&&p.reconnect(f)};if(i.EventSource){C&&(f.log("Forever Frame is not supported by SignalR on browsers with SSE support."),C());return}L.setAttribute("data-signalr-connection-id",f.id),c.prevent(),I=l.getUrl(f,this.name),I+="&frameId="+b,i.document.documentElement.appendChild(L),f.log("Binding to iframe's load event."),L.addEventListener?L.addEventListener("load",F,!1):L.attachEvent&&L.attachEvent("onload",F),L.src=I,l.foreverFrame.connections[b]=f,f.frame=L,f.frameId=b,g&&(f.onSuccess=function(){f.log("Iframe transport started."),g()})},reconnect:function(f){var g=this;l.isConnectedOrReconnecting(f)&&l.verifyLastActive(f)&&i.setTimeout(function(){if(l.verifyLastActive(f)&&f.frame&&l.ensureReconnectingState(f)){var C=f.frame,p=l.getUrl(f,g.name,!0)+"&frameId="+f.frameId;f.log("Updating iframe src to '"+p+"'."),C.src=p}},f.reconnectDelay)},lostConnection:function(f){this.reconnect(f)},send:function(f,g){l.ajaxSend(f,g)},receive:function(f,g){var C,p,b;if(f.json!==f._originalJson&&(g=f._originalJson.stringify(g)),b=f._parseResponse(g),l.processMessages(f,b,f.onSuccess),f.state===t.signalR.connectionState.connected&&(f.frameMessageCount=(f.frameMessageCount||0)+1,f.frameMessageCount>n.transports.foreverFrame.iframeClearThreshold&&(f.frameMessageCount=0,C=f.frame.contentWindow||f.frame.contentDocument,C&&C.document&&C.document.body)))for(p=C.document.body;p.firstChild;)p.removeChild(p.firstChild)},stop:function(f){var g=null;if(c.cancel(),f.frame){if(f.frame.stop)f.frame.stop();else try{g=f.frame.contentWindow||f.frame.contentDocument,g.document&&g.document.execCommand&&g.document.execCommand("Stop")}catch(C){f.log("Error occurred when stopping foreverFrame transport. Message = "+C.message+".")}f.frame.parentNode===i.document.documentElement&&i.document.documentElement.removeChild(f.frame),delete l.foreverFrame.connections[f.frameId],f.frame=null,f.frameId=null,delete f.frame,delete f.frameId,delete f.onSuccess,delete f.frameMessageCount,f.log("Stopping forever frame.")}},abort:function(f,g){l.ajaxAbort(f,g)},getConnection:function(f){return l.foreverFrame.connections[f]},started:function(f){o(f,n.connectionState.reconnecting,n.connectionState.connected)===!0&&t(f).triggerHandler(a.onReconnect)}}})(e,window),(function(t,i,r){var n=t.signalR,a=t.signalR.events,o=t.signalR.changeState,l=t.signalR.isDisconnecting,u=n.transports._logic;n.transports.longPolling={name:"longPolling",supportsKeepAlive:function(){return!1},reconnectDelay:3e3,start:function(h,f,g){var C=this,p=function(){p=t.noop,h.log("LongPolling connected."),f?f():h.log("WARNING! The client received an init message after reconnecting.")},b=function(O){return g(O)?(h.log("LongPolling failed to connect."),!0):!1},I=h._,L=0,F=function(O){i.clearTimeout(I.reconnectTimeoutId),I.reconnectTimeoutId=null,o(O,n.connectionState.reconnecting,n.connectionState.connected)===!0&&(O.log("Raising the reconnect event"),t(O).triggerHandler(a.onReconnect))},V=36e5;h.pollXhr&&(h.log("Polling xhr requests already exists, aborting."),h.stop()),h.messageId=null,I.reconnectTimeoutId=null,I.pollTimeoutId=i.setTimeout(function(){(function B(O,M){var U=O.messageId,w=U===null,P=!w,Q=!M,G=u.getUrl(O,C.name,P,Q,!0),K={};O.messageId&&(K.messageId=O.messageId),O.groupsToken&&(K.groupsToken=O.groupsToken),l(O)!==!0&&(h.log("Opening long polling request to '"+G+"'."),O.pollXhr=u.ajax(h,{xhrFields:{onprogress:function(){u.markLastMessage(h)}},url:G,type:"POST",contentType:n._.defaultContentType,data:K,timeout:h._.pollTimeout,headers:h.accessToken?{Authorization:"Bearer "+h.accessToken}:{},success:function(de){var pe,ne=0,se,ue;h.log("Long poll complete."),L=0;try{pe=h._parseResponse(de)}catch(he){u.handleParseFailure(O,de,he,b,O.pollXhr);return}I.reconnectTimeoutId!==null&&F(O),pe&&(se=u.maximizePersistentResponse(pe)),u.processMessages(O,pe,p),se&&t.type(se.LongPollDelay)==="number"&&(ne=se.LongPollDelay),l(O)!==!0&&(ue=se&&se.ShouldReconnect,!(ue&&!u.ensureReconnectingState(O))&&(ne>0?I.pollTimeoutId=i.setTimeout(function(){B(O,ue)},ne):B(O,ue)))},error:function(de,pe){var ne=n._.transportError(n.resources.longPollFailed,h.transport,de,O.pollXhr);if(i.clearTimeout(I.reconnectTimeoutId),I.reconnectTimeoutId=null,pe==="abort"){h.log("Aborted xhr request.");return}if(!b(ne)){if(L++,h.state!==n.connectionState.reconnecting&&(h.log("An error occurred using longPolling. Status = "+pe+". Response = "+de.responseText+"."),t(O).triggerHandler(a.onError,[ne])),(h.state===n.connectionState.connected||h.state===n.connectionState.reconnecting)&&!u.verifyLastActive(h)||!u.ensureReconnectingState(O))return;I.pollTimeoutId=i.setTimeout(function(){B(O,!0)},C.reconnectDelay)}}}),P&&M===!0&&(I.reconnectTimeoutId=i.setTimeout(function(){F(O)},Math.min(1e3*(Math.pow(2,L)-1),V))))})(h)},250)},lostConnection:function(h){h.pollXhr&&h.pollXhr.abort("lostConnection")},send:function(h,f){u.ajaxSend(h,f)},stop:function(h){i.clearTimeout(h._.pollTimeoutId),i.clearTimeout(h._.reconnectTimeoutId),delete h._.pollTimeoutId,delete h._.reconnectTimeoutId,h.pollXhr&&(h.pollXhr.abort(),h.pollXhr=null,delete h.pollXhr)},abort:function(h,f){u.ajaxAbort(h,f)}}})(e,window),(function(t,i,r){var n=0,a=".hubProxy",o=t.signalR;function l(b){return b+a}function u(b,I,L){var F,V=b.length,B=[];for(F=0;F<V;F+=1)b.hasOwnProperty(F)&&(B[F]=I.call(L,b[F],F,b));return B}function c(b){return t.isFunction(b)||t.type(b)==="undefined"?null:b}function h(b){for(var I in b)if(b.hasOwnProperty(I))return!0;return!1}function f(b,I){var L=b._.invocationCallbacks,F;h(L)&&b.log("Clearing hub invocation callbacks with error: "+I+"."),b._.invocationCallbackId=0,delete b._.invocationCallbacks,b._.invocationCallbacks={};for(var V in L)F=L[V],F.method.call(F.scope,{E:I})}function g(b){return t.isFunction(b)&&b.toString().slice(0,256).indexOf("// Call the client hub method")>=0}function C(b,I){return new C.fn.init(b,I)}C.fn=C.prototype={init:function(I,L){this.state={},this.connection=I,this.hubName=L,this._={callbackMap:{}}},constructor:C,hasSubscriptions:function(){return h(this._.callbackMap)},on:function(I,L,F){var V=this,B=V._.callbackMap,O=!F&&g(L);F=F||L,F._signalRGuid||(F._signalRGuid=n++),I=I.toLowerCase();var M=B[I];M||(M=[],B[I]=M);for(var U,w=0;w<M.length;w++)(M[w].guid===F._signalRGuid||O&&M[w].isFromOldGeneratedHubProxy)&&(U=M[w]);U||(U={guid:F._signalRGuid,eventHandlers:[],isFromOldGeneratedHubProxy:O},B[I].push(U));var P=function(G,K){L.apply(V,K)};return U.eventHandlers.push(P),t(V).bind(l(I),P),V},off:function(I,L,F){var V=this,B=V._.callbackMap,O,M=!F&&g(L);if(F=F||L,I=I.toLowerCase(),O=B[I],O)if(L){for(var U,w=0;w<O.length;w++)(O[w].guid===F._signalRGuid||M&&O[w].isFromOldGeneratedHubProxy)&&(U=O[w]);if(U){for(var P=0;P<U.eventHandlers.length;P++)t(V).unbind(l(I),U.eventHandlers[P]);O.splice(w,1),O.length===0&&delete B[I]}}else L||(t(V).unbind(l(I)),delete B[I]);return V},invoke:function(I){var L=this,F=L.connection,V=t.makeArray(arguments).slice(1),B=u(V,c),O={H:L.hubName,M:I,A:B,I:F._.invocationCallbackId},M=t.Deferred(),U=function(P){var Q=L._maximizeHubResponse(P),G,K;t.extend(L.state,Q.State),Q.Progress?M.notifyWith?M.notifyWith(L,[Q.Progress.Data]):F._.progressjQueryVersionLogged||(F.log("A hub method invocation progress update was received but the version of jQuery in use ("+t.prototype.jquery+") does not support progress updates. Upgrade to jQuery 1.7+ to receive progress notifications."),F._.progressjQueryVersionLogged=!0):Q.Error?(Q.StackTrace&&F.log(Q.Error+`
340
+ `+Q.StackTrace+"."),G=Q.IsHubException?"HubException":"Exception",K=o._.error(Q.Error,G),K.data=Q.ErrorData,F.log(L.hubName+"."+I+" failed to execute. Error: "+K.message),M.rejectWith(L,[K])):(F.log("Invoked "+L.hubName+"."+I),M.resolveWith(L,[Q.Result]))};return F._.invocationCallbacks[F._.invocationCallbackId.toString()]={scope:L,method:U},F._.invocationCallbackId+=1,t.isEmptyObject(L.state)||(O.S=L.state),F.log("Invoking "+L.hubName+"."+I),F.send(O),M.promise()},_maximizeHubResponse:function(I){return{State:I.S,Result:I.R,Progress:I.P?{Id:I.P.I,Data:I.P.D}:null,Id:I.I,IsHubException:I.H,Error:I.E,StackTrace:I.T,ErrorData:I.D}}},C.fn.init.prototype=C.fn;function p(b,I){var L={qs:null,logging:!1,useDefaultPath:!0};return t.extend(L,I),(!b||L.useDefaultPath)&&(b=(b||"")+"/signalr"),new p.fn.init(b,L)}p.fn=p.prototype=t.connection(),p.fn.init=function(b,I){var L={qs:null,logging:!1,useDefaultPath:!0},F=this;t.extend(L,I),t.signalR.fn.init.call(F,b,L.qs,L.logging),F.proxies={},F._.invocationCallbackId=0,F._.invocationCallbacks={},F.received(function(V){var B,O,M,U,w,P;V&&(typeof V.P<"u"?(M=V.P.I.toString(),U=F._.invocationCallbacks[M],U&&U.method.call(U.scope,V)):typeof V.I<"u"?(M=V.I.toString(),U=F._.invocationCallbacks[M],U&&(F._.invocationCallbacks[M]=null,delete F._.invocationCallbacks[M],U.method.call(U.scope,V))):(B=this._maximizeClientHubInvocation(V),F.log("Triggering client hub event '"+B.Method+"' on hub '"+B.Hub+"'."),w=B.Hub.toLowerCase(),P=B.Method.toLowerCase(),O=this.proxies[w],t.extend(O.state,B.State),t(O).triggerHandler(l(P),[B.Args])))}),F.error(function(V,B){var O,M;B&&(O=B.I,M=F._.invocationCallbacks[O],M&&(F._.invocationCallbacks[O]=null,delete F._.invocationCallbacks[O],M.method.call(M.scope,{E:V})))}),F.reconnecting(function(){F.transport&&F.transport.name==="webSockets"&&f(F,"Connection started reconnecting before invocation result was received.")}),F.disconnected(function(){f(F,"Connection was disconnected before invocation result was received.")})},p.fn._maximizeClientHubInvocation=function(b){return{Hub:b.H,Method:b.M,Args:b.A,State:b.S}},p.fn._registerSubscribedHubs=function(){var b=this;b._subscribedToHubs||(b._subscribedToHubs=!0,b.starting(function(){var I=[];t.each(b.proxies,function(L){this.hasSubscriptions()&&(I.push({name:L}),b.log("Client subscribed to hub '"+L+"'."))}),I.length===0&&b.log("No hubs have been subscribed to. The client will not receive data from hubs. To fix, declare at least one client side function prior to connection start for each hub you wish to subscribe to."),b.data=b.json.stringify(I)}))},p.fn.createHubProxy=function(b){b=b.toLowerCase();var I=this.proxies[b];return I||(I=C(this,b),this.proxies[b]=I),this._registerSubscribedHubs(),I},p.fn.init.prototype=p.fn,t.hubConnection=p})(e),(function(t,i){t.signalR.version="2.4.1"})(e),hl.hubConnection=e.hubConnection,hl.signalR=e.signalR,hl}var hj=cj(),Ji=(s=>(s.AppleTv="apple-tv",s.Vivi="vivi",s))(Ji||{}),Xs=(s=>(s.Available="available",s.Offline="offline",s.Busy="busy",s))(Xs||{});const dj=class Tm{constructor(e,t){this[Symbol.toStringTag]=e[Symbol.toStringTag],this.innerPromise=e,this.onTimeout=t,this.bindFunctions()}bindFunctions(){this.timeout=this.timeout.bind(this),this.then=this.then.bind(this),this.catch=this.catch.bind(this),this.finally=this.finally.bind(this)}timeout(e){return new Promise((t,i)=>{this.then(t).catch(i).finally(()=>clearTimeout(r));const r=setTimeout(()=>{var n;(n=this.onTimeout)==null||n.call(this),i(new Error("Promise timed out"))},e)})}then(e,t){return this.innerPromise.then(e,t)}catch(e){return this.innerPromise.catch(e)}finally(e){return this.innerPromise.finally(e)}static reject(e){return new Tm(Promise.reject(e))}static fromPromise(e){return new Tm(e)}};let bm=dj;class fj{constructor(){this.callbacks=[],this.predicates=[],this.controller=new AbortController,this.signal=this.controller.signal,this.trigger=this.trigger.bind(this),this.on=this.on.bind(this),this.one=this.one.bind(this),this.off=this.off.bind(this),this.dispose=this.dispose.bind(this),this.isDisposed=this.isDisposed.bind(this)}trigger(e){this.callbacks.forEach((t,i)=>{const r=this.predicates[i];r&&!r(e)||t(e)})}on(e){this.isDisposed()&&console.warn("This EventChannel instance been disposed - this is a no-op");const t=this.callbacks.length;this.callbacks[t]=e,this.predicates[t]=()=>!0;const i=()=>{this.off(e)};return{off:i,filter:n=>(this.predicates[t]=n,i)}}one(e=()=>!0){if(this.isDisposed())return bm.reject(new Error("This EventChannel instance has been disposed"));let t;return new bm(new Promise((i,r)=>{t=this.on(a=>{this.signal.removeEventListener("abort",n),t(),i(a)}).filter(e);const n=()=>{t(),r(new Error("Aborted while waiting for message"))};this.signal.addEventListener("abort",n,{once:!0})}),()=>{t()})}off(e){const t=this.callbacks.indexOf(e);t!==-1&&(this.callbacks.splice(t,1),this.predicates.splice(t,1))}dispose(){this.callbacks.length=0,this.predicates.length=0,this.controller.abort()}isDisposed(){return this.signal.aborted}}class au{constructor(){this.channels={},this.trigger=this.trigger.bind(this),this.on=this.on.bind(this),this.one=this.one.bind(this),this.off=this.off.bind(this),this.dispose=this.dispose.bind(this),this.getChannel=this.getChannel.bind(this)}trigger(e,t){this.getChannel(e).trigger(t)}on(e,t){return this.getChannel(e).on(t)}one(e,t){return this.getChannel(e).one(t)}off(e,t){this.getChannel(e).off(t)}dispose(){this.trigger("dispose",pt.void),Object.values(this.channels).forEach(e=>e.dispose()),this.channels={}}getChannel(e){return this.channels[e]||(this.channels[e]=new fj),this.channels[e]}}const pt={void:void 0};class ov{constructor(){this.bindFunctions()}bindFunctions(){this.schedule=this.schedule.bind(this),this.every=this.every.bind(this),this.trigger=this.trigger.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this)}schedule(e){return this.task=e,this}every(e){return this.intervalInMilliseconds=e,this}trigger(){var e;return(e=this.task)==null||e.call(this,this),this}start(){return this.intervalId||(this.intervalId=setInterval(()=>this.trigger(),this.intervalInMilliseconds)),this}stop(){return this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this}}function pj(s,e){return s._lastModified||(s._lastModified={}),new Proxy(s,{set:(t,i,r,n)=>{const a=s._lastModified[i.toString()];return a&&Date.now()<a+e?!0:Reflect.set(t,i,r,n)}})}function mj(s){return s._lastModified||(s._lastModified={}),new Proxy(s,{set:(e,t,i,r)=>(s._lastModified[t.toString()]=Date.now(),Reflect.set(e,t,i,r))})}const vh={withDebouncedSetters:pj,withTimestampedSetters:mj};var yl=(s=>(s[s.Offline=0]="Offline",s[s.Online=1]="Online",s[s.Locked=2]="Locked",s[s.Suspended=3]="Suspended",s))(yl||{}),zl=(s=>(s[s.PlaybackStatusChange=0]="PlaybackStatusChange",s[s.PositionChange=1]="PositionChange",s))(zl||{}),fi=(s=>(s.Begin="BEGIN",s.Play="PLAY",s.Pause="PAUSE",s.Load="LOAD",s.Scan="SCAN",s.Stop="STOP",s))(fi||{});const gj=2e3;class vj{constructor(e,t){return this.title=e,this.device=t,this.locked=!1,this.position=0,this.playbackStatus=fi.Load,this.debounced=vh.withDebouncedSetters(this,gj),vh.withTimestampedSetters(this)}}class yj extends au{constructor(e,t){super(),this.client=e,this.localState=new vj(t.title,t.device),this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.dispose=this.dispose.bind(this),this.handleDisconnected=this.handleDisconnected.bind(this),this.handleAllVideoMessages=this.handleAllVideoMessages.bind(this),this.handlePlaybackChange=this.handlePlaybackChange.bind(this),this.handlePositionChange=this.handlePositionChange.bind(this),this.loadSource=this.loadSource.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.isPlaying=this.isPlaying.bind(this),this.getPosition=this.getPosition.bind(this),this.getDuration=this.getDuration.bind(this),this.getVolume=this.getVolume.bind(this)}initialize(){this.client.on("dispose",this.dispose),this.client.on("disconnected",this.handleDisconnected),this.client.on("message",this.handleAllVideoMessages)}dispose(){this.client.off("dispose",this.dispose),this.client.off("disconnected",this.handleDisconnected),this.client.off("message",this.handleAllVideoMessages),this.client.stop(this.getDevice().id).catch(e=>console.error(e)),super.dispose()}handleDisconnected(){this.trigger("error",new Error("The connection to the Apple TV has been lost and cannot be recovered"))}handleAllVideoMessages(e){if(e.deviceId!==this.getDevice().id)return;const t=this.localState.debounced;switch(e.event){case zl.PlaybackStatusChange:this.handlePlaybackChange(t,e);break;case zl.PositionChange:this.handlePositionChange(t,e);break}}handlePlaybackChange(e,t){e.playbackStatus!==t.params.playbackStatus&&(e.playbackStatus=t.params.playbackStatus,this.trigger("playingchange",pt.void),e.playbackStatus===fi.Stop&&this.dispose())}handlePositionChange(e,t){e.position!==t.params.position&&(e.position=t.params.position,this.trigger("positionchange",pt.void))}async loadSource(){try{if(this.localState.locked)return;await this.client.lock(this.getDevice().id),this.localState.locked=!0,await this.client.loadVideo(this.getDevice().id),this.trigger("sourceloaded",pt.void)}catch(e){console.error(e),this.trigger("error",new Error("Could not load video on Apple TV device"))}}play(){this.localState.locked&&this.localState.playbackStatus!==fi.Play&&(this.localState.playbackStatus=fi.Play,this.client.play(this.getDevice().id),this.trigger("playingchange",pt.void))}pause(){this.localState.locked&&this.localState.playbackStatus!==fi.Pause&&(this.localState.playbackStatus=fi.Pause,this.client.pause(this.getDevice().id),this.trigger("playingchange",pt.void))}seek(e){this.localState.locked&&this.localState.position!==e&&(this.localState.position=e,this.client.seek(this.getDevice().id,e),this.trigger("positionchange",pt.void))}setVolume(){console.info("Setting the volume is not supported on Apple TV")}setMuted(){console.info("Muting is not supported on Apple TV")}setSubtitles(){console.info("Subtitles are not supported on Apple TV")}isPlaying(){return this.localState.playbackStatus===fi.Play||this.localState.playbackStatus===fi.Begin||this.localState.playbackStatus===fi.Load}isPlaybackFinished(){return this.localState.playbackStatus===fi.Stop}getPosition(){return this.localState.position}getDuration(){}getVolume(){return 1}getMuted(){return!1}getSubtitles(){}getDevice(){return this.localState.device}getTitle(){return this.localState.title}}const _j=2e4,Tj=500,bj="DeviceUserHub",Sj=5e3;class Rs extends au{constructor(e){super(),this.options=e,this.accessToken=void 0,this.devices=[],this.heartbeat=new ov,this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.connect=this.connect.bind(this),this.subscribe=this.subscribe.bind(this),this.tryFixConnection=this.tryFixConnection.bind(this),this.invoke=this.invoke.bind(this),this.invokeDebounced=Jl(this.invoke,Tj,!0),this.handleDeviceList=this.handleDeviceList.bind(this),this.handleDeviceStateChange=this.handleDeviceStateChange.bind(this),this.handleDevicePaired=this.handleDevicePaired.bind(this),this.handleDeviceUnpaired=this.handleDeviceUnpaired.bind(this),this.handlePlayStatusChange=this.handlePlayStatusChange.bind(this),this.handleTimeSync=this.handleTimeSync.bind(this),this.dispose=this.dispose.bind(this),this.canCastToDevice=this.canCastToDevice.bind(this),this.getDevices=this.getDevices.bind(this),this.startCastSession=this.startCastSession.bind(this),this.lock=this.lock.bind(this),this.loadVideo=this.loadVideo.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.stop=this.stop.bind(this),this.pair=this.pair.bind(this),this.unpair=this.unpair.bind(this),this.renameDevice=this.renameDevice.bind(this)}async initialize(){try{this.accessToken=await this.options.fetchAccessToken(),this.connection=hj.hubConnection(this.accessToken.host,{logging:!1}),this.hubProxy=this.connection.createHubProxy(bj),this.hubProxy.on("DeviceList",this.handleDeviceList),this.hubProxy.on("DeviceStateChange",this.handleDeviceStateChange),this.hubProxy.on("Paired",this.handleDevicePaired),this.hubProxy.on("Unpaired",this.handleDeviceUnpaired),this.hubProxy.on("PlayStatusChange",this.handlePlayStatusChange),this.hubProxy.on("TimeSync",this.handleTimeSync),await this.connect(),await this.subscribe(this.accessToken.token),this.heartbeat.schedule(this.tryFixConnection).every(Sj).start()}catch(e){console.error(e),this.trigger("error",new Error("Could not connect to Online API"))}}async connect(){return new Promise((e,t)=>{this.connection.start({jsonp:!1,withCredentials:!1}).done(()=>e()).fail(()=>t(new Error("Could not connect to SignalR hub")))})}async subscribe(e){if(!await this.invoke("Subscribe",e))throw new Error("The subscription request was rejected by Online API")}async tryFixConnection(){if(this.connection.state===4)try{this.heartbeat.stop(),this.accessToken=await this.options.fetchAccessToken(),await this.connect(),await this.subscribe(this.accessToken.token)}catch(e){console.warn(e),console.warn("Could not reconnect to Online API")}finally{this.heartbeat.start()}}async invoke(e,...t){const i=new Promise((r,n)=>{var a;((a=this.hubProxy)==null?void 0:a.invoke(e,...t)).done(r).fail(n)});return bm.fromPromise(i).timeout(_j)}handleDeviceList(e){this.devices=e.filter(t=>t.type!=="vivi").map(Rs.convertToGenericDevice),this.trigger("deviceschange",pt.void)}handleDeviceStateChange(e){const t=this.devices.findIndex(i=>i.id===e.deviceId);t>=0&&(this.devices[t]=Rs.convertToGenericDevice(e),this.trigger("deviceschange",pt.void))}handleDevicePaired(e){e.type!=="vivi"&&(this.devices.push(Rs.convertToGenericDevice(e)),this.trigger("deviceschange",pt.void))}handleDeviceUnpaired(e){this.devices=this.devices.filter(t=>t.id!==e),this.trigger("deviceschange",pt.void)}handlePlayStatusChange(e,t){this.trigger("message",{event:zl.PlaybackStatusChange,deviceId:e,params:{playbackStatus:t.commandType}})}handleTimeSync(e,t){this.trigger("message",{event:zl.PositionChange,deviceId:e,params:{position:t}})}dispose(){this.hubProxy.off("DeviceList",this.handleDeviceList),this.hubProxy.off("DeviceStateChange",this.handleDeviceStateChange),this.hubProxy.off("Paired",this.handleDevicePaired),this.hubProxy.off("Unpaired",this.handleDeviceUnpaired),this.hubProxy.off("PlayStatusChange",this.handlePlayStatusChange),this.hubProxy.off("TimeSync",this.handleTimeSync),this.hubProxy.connection.stop(!1,!0),this.heartbeat.stop(),super.dispose()}canCastToDevice(e){return e===Ji.AppleTv}getDevices(){return this.devices}startCastSession(e){return new yj(this,e)}async lock(e){if(!await this.invoke("Lock",e,this.options.userId,this.options.username??""))throw new Error("Could not lock device")}async loadVideo(e){if(!this.options.trackingCode)throw new Error("Tracking code must be provided to cast videos");await this.invoke("Command",{DeviceId:e,CommandType:fi.Play,Data:this.options.trackingCode})}async play(e){await this.invoke("Command",{DeviceId:e,CommandType:fi.Play})}async pause(e){await this.invoke("Command",{DeviceId:e,CommandType:fi.Pause})}seek(e,t){this.invokeDebounced("Command",{DeviceId:e,CommandType:fi.Play,Params:`1,${Math.trunc(t)}`})}async stop(e){await this.invoke("Command",{DeviceId:e,CommandType:fi.Stop})}async pair(e){const t=await this.invoke("Pair",e);if(!t)throw new Error("Could not pair device");return t}async unpair(e){await this.invoke("Unpair",e)}async renameDevice({deviceId:e,deviceName:t}){if(!await this.invoke("Renamedevice",e,t))throw new Error("Could not rename device")}static convertToGenericDeviceStatus(e){switch(e){case yl.Online:return Xs.Available;case yl.Locked:return Xs.Busy;case yl.Suspended:case yl.Offline:return Xs.Offline}}static convertToGenericDevice(e){return{id:e.deviceId,name:e.name,type:Ji.AppleTv,status:Rs.convertToGenericDeviceStatus(e.status)}}}const xb={reconnectIntervalInMilliseconds:3e3,heartbeatEnabled:!1,heartbeatIntervalInMillseconds:1e4,heartbeatMessage:""};class Cj{constructor(e,t=xb){this.bindFunctions(),this.url=e,this.options={...xb,...t},this.webSocket=this.connect(),this.heartbeat=new ov().schedule(()=>this.send(this.options.heartbeatMessage)).every(this.options.heartbeatIntervalInMillseconds)}bindFunctions(){this.cleanup=this.cleanup.bind(this),this.handleOpen=this.handleOpen.bind(this),this.handleMessage=this.handleMessage.bind(this),this.handleClose=this.handleClose.bind(this),this.handleError=this.handleError.bind(this),this.connect=this.connect.bind(this),this.send=this.send.bind(this),this.dipose=this.dipose.bind(this)}cleanup(){this.heartbeat.stop(),this.webSocket.removeEventListener("error",this.handleError),this.webSocket.removeEventListener("message",this.handleMessage),this.webSocket.removeEventListener("open",this.handleOpen),this.webSocket.removeEventListener("close",this.handleClose)}handleOpen(e){var t;(t=this.onOpen)==null||t.call(this,e),this.options.heartbeatEnabled&&this.heartbeat.start()}handleMessage(e){var t;(t=this.onMessage)==null||t.call(this,e)}handleClose(e){var t;(t=this.onClose)==null||t.call(this,e),this.cleanup(),setTimeout(()=>{this.webSocket=this.connect()},this.options.reconnectIntervalInMilliseconds)}handleError(e){var t;(t=this.onError)==null||t.call(this,e),this.handleClose()}connect(){const e=new WebSocket(this.url);return e.addEventListener("open",this.handleOpen),e.addEventListener("message",this.handleMessage),e.addEventListener("close",this.handleClose),e.addEventListener("error",this.handleError),e}send(e){this.webSocket.send(e)}dipose(){this.cleanup(),this.webSocket.close()}}const Ej=2e3;class wj{constructor(e,t){return this._timerStartedAt=0,this.position=0,this.duration=void 0,this.playing=!1,this.mute=!1,this.videoSource="",this.subtitleSource="",this.subtitles=!1,this.volume=0,this.title=e,this.device=t,this.ready=!1,this.playbackFinished=!1,this.debounced=vh.withDebouncedSetters(this,Ej),vh.withTimestampedSetters(this)}get position(){return this._position+this.getTimerDurationInSeconds()}set position(e){this._position=e,this.restartTimer()}get playing(){return this._playing}set playing(e){this._playing=e,e?this.restartTimer():(this._position+=this.getTimerDurationInSeconds(),this.stopTimer())}restartTimer(){this._timerStartedAt=Date.now()}stopTimer(){this._timerStartedAt=0}getTimerDurationInSeconds(){return this._timerStartedAt?(Date.now()-this._timerStartedAt)/1e3:0}}var Xn=(s=>(s.Update="update",s.Volume="volume",s.Playing="playing",s.Paused="paused",s.NewChapter="new_chapter",s.Stopped="stopped",s.Ready="ready",s.Mute="mute",s.Finished="finished",s.Subtitles="subtitles",s))(Xn||{});class kj extends au{constructor(e,t){super(),this.client=e,this.localState=new wj(t.title,t.device),this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.dispose=this.dispose.bind(this),this.handleClientConnected=this.handleClientConnected.bind(this),this.handleDisconnectMessage=this.handleDisconnectMessage.bind(this),this.handleAllVideoMessages=this.handleAllVideoMessages.bind(this),this.handleUpdateMessage=this.handleUpdateMessage.bind(this),this.handleVolumeMessage=this.handleVolumeMessage.bind(this),this.handlePlayingMessage=this.handlePlayingMessage.bind(this),this.handlePausedMessage=this.handlePausedMessage.bind(this),this.handleFinishedMessage=this.handleFinishedMessage.bind(this),this.handleNewChapterMessage=this.handleNewChapterMessage.bind(this),this.handleStoppedMessage=this.handleStoppedMessage.bind(this),this.loadSource=this.loadSource.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.isPlaying=this.isPlaying.bind(this),this.getPosition=this.getPosition.bind(this),this.getDuration=this.getDuration.bind(this),this.getVolume=this.getVolume.bind(this)}initialize(){this.client.on("dispose",this.dispose),this.client.on("connected",this.handleClientConnected),this.client.on("message",this.handleDisconnectMessage).filter(e=>e.source===this.getDevice().id&&e.message.type==="disconnect"),this.client.on("message",this.handleAllVideoMessages).filter(e=>e.source===this.getDevice().id&&e.message.type==="video_event")}dispose(){this.client.off("dispose",this.dispose),this.client.off("connected",this.handleClientConnected),this.client.off("message",this.handleDisconnectMessage),this.client.off("message",this.handleAllVideoMessages),this.client.stop(this.getDevice().id).catch(e=>console.error(e)),super.dispose()}async handleClientConnected(){try{await this.client.joinRoom(this.getDevice().id)}catch(e){this.trigger("error",e)}}handleDisconnectMessage(){this.dispose()}handleAllVideoMessages(e){const t=this.localState.debounced,i=e.message.payload.params||{};switch(e.message.payload.event){case Xn.Update:this.handleUpdateMessage(t,i);break;case Xn.NewChapter:this.handleNewChapterMessage(t,i);break;case Xn.Volume:this.handleVolumeMessage(t,i);break;case Xn.Playing:this.handlePlayingMessage(t);break;case Xn.Paused:this.handlePausedMessage(t);break;case Xn.Finished:this.handleFinishedMessage(t);break;case Xn.Stopped:this.handleStoppedMessage();break}}handleUpdateMessage(e,t){e.duration!==t.duration&&(e.duration=t.duration,this.trigger("durationchange",pt.void)),e.position!==t.position&&(e.position=t.position,this.trigger("positionchange",pt.void)),e.subtitles!==t.subtitles&&(e.subtitles=t.subtitles,this.trigger("subtitleschange",pt.void))}handleVolumeMessage(e,t){e.volume!==t.level&&(e.volume=t.level,e.mute=t.level===0,this.trigger("volumechange",pt.void))}handlePlayingMessage(e){e.playing!==!0&&(e.playing=!0,e.playbackFinished=!1,this.trigger("playingchange",pt.void))}handlePausedMessage(e){e.playing!==!1&&(e.playing=!1,this.trigger("playingchange",pt.void))}handleFinishedMessage(e){e.playbackFinished!==!0&&(e.playing=!1,e.playbackFinished=!0,this.trigger("playingchange",pt.void))}handleNewChapterMessage(e,t){const r=(t.queue??[]).find(n=>n.url===e.videoSource);if(!r){console.info("The device is no longer playing the source we loaded - disposing the session"),this.dispose();return}e.subtitleSource!==r.suburl&&(e.subtitleSource=r.suburl,this.trigger("subtitleschange",pt.void))}handleStoppedMessage(){this.dispose()}async loadSource(e,t){if(!(this.localState.videoSource===e&&this.localState.subtitleSource===t))try{const i=this.getDevice().id,r=this.getPosition();this.localState.videoSource=e,this.localState.subtitleSource=t,this.localState.ready=!1,await this.client.joinRoom(i),await this.client.loadQueue({title:this.getTitle(),roomId:i,videoSource:e,subtitleSource:t}),this.localState.ready=!0,this.trigger("sourceloaded",pt.void),r>0&&this.seek(r),t&&this.setSubtitles(t)}catch(i){console.error(i),this.trigger("error",new Error("Could not load video on Vivi device"))}}play(){this.localState.ready&&this.localState.playing!==!0&&(this.localState.playing=!0,this.client.play(this.getDevice().id),this.trigger("playingchange",pt.void))}pause(){this.localState.ready&&this.localState.playing!==!1&&(this.localState.playing=!1,this.client.pause(this.getDevice().id),this.trigger("playingchange",pt.void))}seek(e){this.localState.ready&&this.localState.position!==e&&(this.localState.position=e,this.client.seek(this.getDevice().id,e),this.trigger("positionchange",pt.void))}setVolume(e){this.localState.ready&&this.localState.volume!==e&&(this.localState.volume=e,this.client.setVolume(this.getDevice().id,e),this.trigger("volumechange",pt.void))}setMuted(e){this.localState.ready&&this.localState.mute!==e&&(this.localState.mute=e,this.client.setMuted(this.getDevice().id,e),this.trigger("volumechange",pt.void))}async setSubtitles(e){if(!this.localState.ready)return;e&&await this.loadSource(this.localState.videoSource,e);const t=!!e;this.localState.subtitles!==t&&(this.localState.subtitles=t,this.client.setSubtitles(this.getDevice().id,t),this.trigger("subtitleschange",pt.void))}isPlaying(){return this.localState.playing}isPlaybackFinished(){return this.localState.playbackFinished}getPosition(){return this.localState.position}getDuration(){return this.localState.duration}getVolume(){return this.localState.volume}getMuted(){return this.localState.mute}getSubtitles(){if(this.localState.subtitles)return this.localState.subtitleSource}getDevice(){return this.localState.device}getTitle(){return this.localState.title}}const cr=1e4,xj=500,Aj=1e4;class Bs extends au{constructor(e){super(),this.options=e,this.accessToken="",this.devices=[],this.devicesFingerprint="",this.deviceDiscovery=new ov,this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.sendMessage=this.sendMessage.bind(this),this.sendMessageDebounced=Jl(this.sendMessage,xj,!0),this.beginDeviceDiscovery=this.beginDeviceDiscovery.bind(this),this.dispose=this.dispose.bind(this),this.canCastToDevice=this.canCastToDevice.bind(this),this.getDevices=this.getDevices.bind(this),this.startCastSession=this.startCastSession.bind(this),this.authenticateWithVivi=this.authenticateWithVivi.bind(this),this.getRoomList=this.getRoomList.bind(this),this.joinRoom=this.joinRoom.bind(this),this.query=this.query.bind(this),this.loadQueue=this.loadQueue.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.stop=this.stop.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.setMuted=this.setMuted.bind(this),this.setSubtitles=this.setSubtitles.bind(this)}initialize(){this.webSocket=new Cj(this.options.url),this.webSocket.onMessage=e=>this.trigger("message",JSON.parse(e.data)),this.webSocket.onOpen=async()=>{try{this.accessToken=await this.options.fetchAccessToken(),await this.authenticateWithVivi(),this.beginDeviceDiscovery(),this.trigger("connected",pt.void)}catch(e){console.error(e),this.trigger("error",new Error("Could not connect to Vivi"))}}}sendMessage(e){var t;(t=this.webSocket)==null||t.send(JSON.stringify(e))}beginDeviceDiscovery(){this.deviceDiscovery.every(Aj).schedule(async()=>{try{const e=await this.getRoomList(),t=Bs.calculateFingerprint(e);if(t===this.devicesFingerprint)return;const i=new Set(e.map(n=>n.organisation??"")).size,r=new Set(e.map(n=>n.location??"")).size;this.devices=e.map(n=>({id:n.id,name:n.name,schoolName:i>1?n.organisation:"",description:r>1?n.location:"",type:Ji.Vivi,status:Xs.Available})),this.devicesFingerprint=t,this.trigger("deviceschange",pt.void)}catch(e){console.warn(e)}}).trigger().start()}dispose(){var e;this.deviceDiscovery.stop(),(e=this.webSocket)==null||e.dipose(),super.dispose()}canCastToDevice(e){return e===Ji.Vivi}getDevices(){return this.devices}startCastSession(e){return new kj(this,e)}async authenticateWithVivi(){this.sendMessage({destination:"relay",message:{token:this.accessToken,type:"identify_video_api"}}),await this.one("message",e=>e.message.type==="video_api_identified").timeout(cr).catch(()=>{throw new Error("Failed to authenticate with Vivi")})}async getRoomList(){return this.sendMessage({destination:"relay",message:{type:"video_api_rooms"}}),(await this.one("message",t=>t.message.type==="video_api_rooms").timeout(cr).catch(()=>{throw new Error("Failed to fetch rooms")})).message.rooms||[]}async joinRoom(e){this.sendMessage({destination:"relay",message:{destination_type:"box",new_destination:e,token:this.accessToken,type:"connect"}}),await this.one("message",t=>{if(t.source===e&&t.message.type==="connect"||t.message.type==="error"&&t.message.error_type==="already_connected")return!0}).timeout(cr).catch(()=>{throw new Error("Failed to join room")})}async query(e){const t=Bs.createAckId();return this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:t,name:"query"}}),await this.one("message",i=>i.message.ack_id===t).timeout(cr).catch(()=>{throw new Error("Failed to fetch query")})}async loadQueue({roomId:e,title:t,videoSource:i,subtitleSource:r}){this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:Bs.createAckId(),name:"queue_load",payload:{urls:[{title:t,url:i,suburl:r}]}}}),await this.one("message",n=>{var a;return n.source===e&&((a=n.message.payload)==null?void 0:a.event)==="ready"}).timeout(cr).catch(()=>{throw new Error("Failed to load media")})}async play(e){this.sendMessage({destination:e,message:{type:"message",name:"video_play",payload:{}}}),await this.one("message",t=>{var i;return t.source===e&&((i=t.message.payload)==null?void 0:i.event)==="playing"}).timeout(cr).catch(()=>{throw new Error("Failed to play video")})}async pause(e){this.sendMessage({destination:e,message:{type:"message",name:"video_pause"}}),await this.one("message",t=>{var i;return t.source===e&&((i=t.message.payload)==null?void 0:i.event)==="paused"}).timeout(cr).catch(()=>{throw new Error("Failed to pause video")})}async stop(e){this.sendMessage({destination:e,message:{type:"message",name:"video_stop"}}),await this.one("message",t=>{var i;return t.source===e&&((i=t.message.payload)==null?void 0:i.event)==="stopped"}).timeout(cr).catch(()=>{throw new Error("Failed to stop video")})}async seek(e,t){this.sendMessageDebounced({destination:e,message:{type:"message",name:"video_seek",payload:{position:t}}})&&await this.one("message",r=>{var n;return r.source===e&&((n=r.message.payload)==null?void 0:n.event)==="playing"}).timeout(cr).catch(()=>{throw new Error("Failed to seek video")})}async setVolume(e,t){this.sendMessageDebounced({destination:e,message:{type:"message",name:"set_volume",payload:{volume:t}}})&&await this.one("message",r=>{var n;return r.source===e&&((n=r.message.payload)==null?void 0:n.event)==="volume"}).timeout(cr).catch(()=>{throw new Error("Failed to set volume")})}async setMuted(e,t){this.sendMessage({destination:e,message:{type:"message",name:"set_mute",payload:{mute:t}}}),await this.one("message",i=>{var r;return i.source===e&&((r=i.message.payload)==null?void 0:r.event)==="mute"}).timeout(cr).catch(()=>{throw new Error("Failed to set mute")})}async setSubtitles(e,t){const i=Bs.createAckId();this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:i,name:"set_subtitles",payload:{subtitles:t}}}),await this.one("message",r=>{var n;return r.source===e&&((n=r.message.payload)==null?void 0:n.event)==="subtitles"}).timeout(cr).catch(()=>{throw new Error("Failed to set subtitles")})}static createAckId(){return I2.generateRandomId()}static calculateFingerprint(e){return e.map(t=>t.id).sort().join(",")}}const _h=class _h extends au{constructor(e){super(),this.instanceId=e,this.clients=[],this.bindFunctions()}bindFunctions(){this.addClient=this.addClient.bind(this),this.hasInstanceOfClient=this.hasInstanceOfClient.bind(this),this.startCastSession=this.startCastSession.bind(this),this.gatherAndPublishDevices=this.gatherAndPublishDevices.bind(this),this.dispose=this.dispose.bind(this)}addClient(e){e.on("deviceschange",this.gatherAndPublishDevices),e.on("error",t=>this.trigger("error",t)),this.clients.push(e)}hasInstanceOfClient(e){return this.clients.some(t=>t instanceof e)}startCastSession(e){if(this.castSession)if(this.castSession.getDevice().id!==e.device.id)this.castSession.dispose();else{console.info(`A session with device ${e.device.id} already exists - this is a no-op`);return}const t=this.clients.find(i=>i.canCastToDevice(e.device.type));t&&(this.castSession=t.startCastSession(e),this.castSession.on("error",i=>{this.castSession.dispose(),this.trigger("error",i)}),this.castSession.on("dispose",()=>{this.castSession=void 0,this.trigger("castsessionchange",void 0)}),this.trigger("castsessionchange",this.castSession))}getCastSession(){return this.castSession}gatherAndPublishDevices(){const t=this.clients.map(i=>i.getDevices()).reduce((i,r)=>[...i,...r],[]);this.trigger("deviceschange",t)}dispose(){var e;(e=this.castSession)==null||e.dispose(),this.clients.forEach(t=>t.dispose()),this.castSession=void 0,this.clients=[],super.dispose()}static getOrCreateInstance(e){if(!e)throw new Error("instanceId is required");return this.instances[e]||(this.instances[e]=new _h(e)),this.instances[e]}static disposeAndRemoveInstance(e){e.dispose(),delete this.instances[e.instanceId]}static isActive(){return Object.keys(this.instances).length>0}};_h.instances={};let Qs=_h;const Ij=R.getComponent("MenuItem");class Ab extends Ij{constructor(e,t){super(e,t),this.isVisible=this.isVisible.bind(this)}createEl(){const e={vivi:"cv-vivi-icon","apple-tv":"cv-apple-icon"},t=super.createEl("li",{className:"vjs-menu-item cv-device-menu-item"}),i=R.dom.createEl("div",{className:"cv-device-menu-item-body",innerHTML:`
341
+ <span class="cv-device-icon ${e[this.options_.type]}"></span>
342
+ <div>
343
+ <span class="vjs-menu-item-text">${this.options_.label}</span>
344
+ <span class="vjs-menu-item-text cv-device-truncated-text">${this.options_.schoolName??""}</span>
345
+ <span class="vjs-menu-item-text cv-device-truncated-text cv-device-description">${this.options_.description??""}</span>
346
+ </div>
347
+ `});return t.replaceChildren(i),t}handleClick(){this.options_.onClick()}show(){super.show()}hide(){super.hide()}isVisible(){return!super.hasClass("vjs-hidden")}}const Pj=R.getComponent("Menu");class P2 extends Pj{createEl(){const e=u2.apply(this),t=this.contentEl_;return this.contentWrapper=R.dom.createEl("div",{className:"vjs-menu-content"}),e.className="vjs-menu cv-devices-menu",t.className="cv-devices-menu-item-list",e.removeChild(t),e.appendChild(this.contentWrapper),this.contentWrapper.appendChild(t),this.simpleBar=new qt(t,{autoHide:!1}),e}addCta(e){if(this.ctaElement){console.warn("CTA has already been added to the menu - this is a no-op");return}this.ctaElement=e.el(),this.contentWrapper.prepend(this.ctaElement),this.el().classList.add("has-cta")}removeCta(){this.ctaElement&&(this.contentWrapper.removeChild(this.ctaElement),this.el().classList.remove("has-cta"))}}R.registerComponent("DevicesMenu",P2);function Dj({inactiveIntegrations:s,canUserManageIntegrations:e,player:t,onDismiss:i,onInstall:r,onLearnMore:n,onContactSupport:a}){if(s.length===0)return oe.jsx(oe.Fragment,{});const o=c=>t.localize(c),l=c=>s.indexOf(c)!==-1;let u;return l(Ji.AppleTv)&&l(Ji.Vivi)?u="vivi_and_apple_tv":l(Ji.Vivi)?u="vivi":u="apple_tv",oe.jsxs("div",{className:"cv-devices-cta",tabIndex:-1,children:[oe.jsx(Nj,{context:u,localize:o,onDismiss:()=>i(u)}),oe.jsx(Lj,{context:u}),oe.jsx(Oj,{context:u,canUserManageIntegrations:e,localize:o,onContactSupport:()=>a(u),onInstall:()=>r(u),onLearnMore:()=>n(u)})]})}function Nj({context:s,localize:e,onDismiss:t}){return oe.jsxs("div",{className:"cv-devices-cta-header",children:[oe.jsx("span",{className:"cv-devices-badge",children:e("New")}),oe.jsxs("span",{className:"cv-devices-title",children:[s==="vivi_and_apple_tv"&&e("Cast to Vivi and Apple TV"),s==="vivi"&&e("Cast to Vivi"),s==="apple_tv"&&e("Cast to Apple TV")]}),oe.jsx("span",{className:"cv-devices-close",onClick:t,children:oe.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:oe.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"white",d:"M11.9588 10.6413L16.3612 6.34478C16.7361 5.97191 17.3439 5.97191 17.7188 6.34478C18.0937 6.71764 18.0937 7.32218 17.7188 7.69505L13.3165 11.9916L17.7188 16.3701C18.0937 16.7429 18.0937 17.3475 17.7188 17.7203C17.3439 18.0932 16.7361 18.0932 16.3612 17.7203L11.9588 13.3419L7.63882 17.7203C7.26392 18.0932 6.65608 18.0932 6.28118 17.7203C5.90627 17.3475 5.90627 16.7429 6.28118 16.3701L10.6012 11.9916L6.28118 7.62993C5.90627 7.25706 5.90627 6.65252 6.28118 6.27965C6.65608 5.90678 7.26392 5.90678 7.63882 6.27965L11.9588 10.6413Z"})})})]})}function Lj({context:s}){const e=s==="vivi_and_apple_tv"?"bg-vivi-and-apple":s==="vivi"?"bg-vivi":"bg-apple";return oe.jsxs("div",{className:`cv-devices-cta-body ${e}`,children:[(s==="vivi_and_apple_tv"||s==="apple_tv")&&oe.jsx("div",{className:"cv-devices-icon-container",children:oe.jsx("span",{className:"cv-devices-icon apple"})}),(s==="vivi_and_apple_tv"||s==="vivi")&&oe.jsx("div",{className:"cv-devices-icon-container",children:oe.jsx("span",{className:"cv-devices-icon vivi"})})]})}function Oj({context:s,canUserManageIntegrations:e,localize:t,onInstall:i,onLearnMore:r,onContactSupport:n}){return e?oe.jsxs("div",{className:"cv-devices-cta-footer",children:[oe.jsxs("span",{children:[s==="vivi_and_apple_tv"&&t("Discover our new device integrations to make presenting in the classroom easy!"),s==="vivi"&&t("Discover our new Vivi integration."),s==="apple_tv"&&t("Discover our new Apple TV integration.")]}),oe.jsx("br",{}),oe.jsx("span",{className:"cv-devices-link",onClick:i,children:t("Click here to install")})]}):oe.jsxs("div",{className:"cv-devices-cta-footer",children:[oe.jsxs("span",{children:[s==="vivi_and_apple_tv"&&t("Cast to Vivi and Apple TV is now available! Please contact "),s==="vivi"&&t("Cast to Vivi is now available! Please contact "),s==="apple_tv"&&t("Cast to Apple TV is now available! Please contact ")]}),oe.jsx("span",{className:"cv-devices-link",onClick:n,children:"ClickView Support"}),oe.jsxs("span",{children:[s==="vivi_and_apple_tv"&&t(" or your administrator to set up Apple TV and Vivi."),s==="vivi"&&t(" or your administrator to set up Vivi."),s==="apple_tv"&&t(" or your administrator to set up Apple TV.")]}),oe.jsx("br",{}),oe.jsx("span",{className:"cv-devices-link",onClick:r,children:"Learn more"})]})}R.registerComponent("DevicesCta",rd((s,e)=>oe.jsx(Dj,{player:s,...e}),{properties:{className:"cv-devices-cta-wrapper"}}));const Mj=20,Rj=R.getComponent("DevicesCta"),Ib=R.getComponent("MenuButton");class D2 extends Ib{constructor(e,t){super(e,t),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0,this.className="cv-devices-menu-button",this.searchText="",this.devices=[],this.castSession=void 0,this.bindFunctions(),this.bindEventListeners()}bindFunctions(){this.bindEventListeners=this.bindEventListeners.bind(this),this.setDevices=this.setDevices.bind(this),this.setCastSession=this.setCastSession.bind(this),this.setSearchText=this.setSearchText.bind(this),this.getDeviceMenuItems=this.getDeviceMenuItems.bind(this),this.showNotificationBadge=this.showNotificationBadge.bind(this),this.hideNotificationBadge=this.hideNotificationBadge.bind(this),this.render=this.render.bind(this),this.removeMenuItems=this.removeMenuItems.bind(this),this.addMenuItemsForDevices=this.addMenuItemsForDevices.bind(this),this.shouldShowSearchInput=this.shouldShowSearchInput.bind(this),this.toggleSearchInput=this.toggleSearchInput.bind(this),this.toggleDeviceMenuItems=this.toggleDeviceMenuItems.bind(this),this.toggleEmptyStatePlaceholder=this.toggleEmptyStatePlaceholder.bind(this)}bindEventListeners(){const e=this.$("button"),t=i=>{this.menu.handleBlur(i)};e.addEventListener("blur",t),this.one("dispose",()=>{var i;e.removeEventListener("blur",t),(i=this.cta)==null||i.dispose()})}createEl(...e){return Ib.prototype.createEl.apply(this,...e)}buildWrapperCSSClass(){return`cv-menu-small cv-devices-button ${super.buildWrapperCSSClass()}`}createMenu(){const e=new P2(this.player_,{menuButton:this});if(!this.options_.ctaOptions.hasBeenDismissed&&this.options_.ctaOptions.inactiveIntegrations.length>0){const{onDismiss:i,...r}=this.options_.ctaOptions;this.cta=new Rj(this.player(),{...r,onDismiss:n=>{this.hideNotificationBadge(),e.removeCta(),i(n)}}),this.showNotificationBadge(),e.addCta(this.cta)}return this.createItems().forEach(i=>e.addItem(i)),e}createItems(){const e=[];return this.headingItem=new Zs(this.player_,{label:this.localize("Select a device"),selectable:!1}),this.searchInputItem=new cg(this.player_,{menuButton:this,search:t=>this.setSearchText(t),className:"cv-devices-search-input"}),this.emptyPlaceholder=new hg(this.player_,{label:"No devices found",selected:!1,selectable:!1,multiSelectable:!1}),this.headingItem.show(),this.searchInputItem.hide(),this.emptyPlaceholder.show(),e.push(this.headingItem,this.searchInputItem,this.emptyPlaceholder),e}pressButton(){var e;super.pressButton(),this.shouldShowSearchInput()&&((e=this.searchInputItem)==null||e.focus())}setDevices(e){this.devices=e,this.render()}setCastSession(e){this.castSession=e,this.render()}setSearchText(e){this.searchText=e,this.render()}getDeviceMenuItems(){return this.menu.children_.filter(e=>e instanceof Ab)}showNotificationBadge(){this.addClass("notification-badge")}hideNotificationBadge(){this.removeClass("notification-badge")}render(){this.removeMenuItems(this.getDeviceMenuItems()),this.addMenuItemsForDevices(this.devices),this.toggleSearchInput(),this.toggleDeviceMenuItems(),this.toggleEmptyStatePlaceholder()}removeMenuItems(e){e.forEach(t=>{this.menu.removeChild(t),t.dispose()})}addMenuItemsForDevices(e){e.sort((i,r)=>{const n=`${i.type}${i.schoolName??""}${i.description??""}${i.name}`,a=`${r.type}${r.schoolName??""}${r.description??""}${r.name}`;return n.localeCompare(a)}).forEach(i=>{const r=new Ab(this.player(),{id:i.id,label:i.name,schoolName:i.schoolName,description:i.description,selected:!1,multiSelectable:!1,selectable:!0,available:i.status===Xs.Available,type:i.type,onClick:()=>{this.options_.onDeviceMenuItemClick(r,i)}});this.menu.addItem(r)})}shouldShowSearchInput(){return this.getDeviceMenuItems().length>=Mj}toggleSearchInput(){this.shouldShowSearchInput()?(this.searchInputItem.show(),this.menu.addClass("vertical-fill")):(this.searchInputItem.hide(),this.menu.removeClass("vertical-fill"))}toggleDeviceMenuItems(){const e=this.getDeviceMenuItems(),t=this.shouldShowSearchInput(),i=this.searchText.toLowerCase();e.forEach(r=>{var u;const n=this.devices.find(c=>c.id===r.options_.id);if(!n)return;const a=n.status===Xs.Available,o=n.id===((u=this.castSession)==null?void 0:u.getDevice().id),l=t?`${n.name} ${n.schoolName??""} ${n.description??""}`.trim().toLowerCase().indexOf(i)!==-1:!0;a?r.enable():r.disable(),l?r.show():r.hide(),o?r.selected(!0):r.selected(!1)})}toggleEmptyStatePlaceholder(){const e=this.getDeviceMenuItems();e.filter(i=>i.isVisible()).length?this.emptyPlaceholder.hide():this.emptyPlaceholder.show(),e.length?this.emptyPlaceholder.setLabel(this.localize("No matching results")):this.emptyPlaceholder.setLabel(this.localize("No devices found"))}getCollabsibleName(){return this.controlText_}getCollabsibleValue(){var e;return((e=this.castSession)==null?void 0:e.getDevice().name)??" "}showInCollabsibleMenu(){return!0}showCollapsibleMenu(){this.handleClick()}handleClick(){super.handleClick(null),this.options_.onClick()}}D2.prototype.controlText_="Devices";R.registerComponent("DevicesButton",D2);const Bj=R.getComponent("Component");class Fj extends Bj{constructor(e){super(null,e)}createEl(){return super.createEl("div",{className:"cv-devices-tech"})}setPoster(e){this.poster=e,this.update()}setDevice(e){this.device=e,this.update()}update(){var r,n;const e={vivi:"cv-vivi-icon","apple-tv":"cv-apple-icon"};this.el_.innerHTML=`
348
+ <div class="cv-devices-content">
349
+ <p>${this.localize("Currently playing on")}</p>
350
+ <h2><span class="cv-device-icon ${e[((r=this.device)==null?void 0:r.type)??Ji.Vivi]}"></span>${((n=this.device)==null?void 0:n.name)??""}</h2>
351
+ </div>
352
+ <div class="cv-devices-background" style="background-image: url(${this.poster})"></div>
353
+ `;const t=document.createElement("button"),i=a=>{a.stopPropagation(),this.options_.onStopCasting()};t.onclick=i,t.ontouchstart=i,t.className="stop-casting-button",t.innerHTML=this.localize("Stop casting"),this.el_.querySelector(".cv-devices-content").appendChild(t)}play(){}}const Uj=R.getComponent("Tech");class $j extends Uj{constructor(e,t){super(e,t),this.featuresVolumeControl=!0,this.featuresPlaybackRate=!1,this.movingMediaElementInDOM=!1,this.featuresFullscreenResize=!0,this.featuresTimeupdateEvents=!0,this.featuresProgressEvents=!1,this.featuresNativeTextTracks=!1,this.featuresNativeAudioTracks=!1,this.featuresNativeVideoTracks=!1,this.featuresMuteControl=!0,this.featuresSourceset=!1,this.videojsPlayer=R(this.options_.playerId),this.bindFunctions(),this.bindEventListeners(),this.ready(()=>{this.setSource(this.options_.source)}),this.triggerReady()}bindFunctions(){this.bindEventListeners=this.bindEventListeners.bind(this),this.onTextTrackChanged=this.onTextTrackChanged.bind(this),this.getSelectedTextTrack=this.getSelectedTextTrack.bind(this),this.setSelectedTextTrack=this.setSelectedTextTrack.bind(this),this.showUI=this.showUI.bind(this),this.hideUI=this.hideUI.bind(this),this.dispose=this.dispose.bind(this),this.setSource=this.setSource.bind(this),this.getCastSession=this.getCastSession.bind(this)}bindEventListeners(){const e=this.getCastSession();e&&(this.textTracks().on("change",this.onTextTrackChanged),this.videojsPlayer.one("ended",()=>{e.dispose()}),e.on("durationchange",()=>{this.trigger("durationchange")}),e.on("dispose",()=>{this.trigger("ended"),this.hideUI()}),e.on("playingchange",()=>{e.isPlaying()?(this.trigger("play"),this.trigger("playing")):this.trigger("pause")}),e.on("volumechange",()=>{this.trigger("volumechange")}),e.on("sourceloaded",()=>{this.trigger("loadeddata")}),e.on("subtitleschange",()=>{this.setSelectedTextTrack(e.getSubtitles())}))}onTextTrackChanged(){var t;const e=this.getSelectedTextTrack();(t=this.getCastSession())==null||t.setSubtitles(e==null?void 0:e.src)}getSelectedTextTrack(){return Yt.findTrackByPredicate(this.videojsPlayer.player_,e=>e.mode==="showing"&&!!e.src)}setSelectedTextTrack(e){Yt.forEachTrack(this.videojsPlayer.player_,t=>{t.kind==="subtitles"&&(t.src===e?t.mode="showing":t.mode="disabled")})}showUI(e){this.ui&&(this.ui.setPoster(this.options_.poster),this.ui.setDevice(e),this.ui.show())}hideUI(){var e;(e=this.ui)==null||e.hide()}dispose(){this.textTracks().off("change",this.onTextTrackChanged);const e=this.getCastSession();e&&e.dispose(),super.cleanupAutoTextTracks(),super.dispose()}createEl(){return this.ui=this.ui||new Fj({onStopCasting:()=>{var e;(e=this.getCastSession())==null||e.dispose()}}),this.ui.el()}setSource(e){const t=this.getCastSession();if(!t)return;this.showUI(t.getDevice()),this.trigger("loadstart");const i=this.getSelectedTextTrack();t.loadSource(e.src,i==null?void 0:i.src)}addRemoteTextTrack(e){return super.addRemoteTextTrack(e,!0)}getCastSession(){return Qs.getOrCreateInstance(this.options_.instanceId??"").getCastSession()}play(){var e;(e=this.getCastSession())==null||e.play()}pause(){var e;(e=this.getCastSession())==null||e.pause()}paused(){var e;return((e=this.getCastSession())==null?void 0:e.isPlaying())===!1}ended(){var e;return((e=this.getCastSession())==null?void 0:e.isPlaybackFinished())??!1}setCurrentTime(e){var t;(t=this.getCastSession())==null||t.seek(e??0)}currentTime(){var e;return((e=this.getCastSession())==null?void 0:e.getPosition())??0}duration(){var e;return((e=this.getCastSession())==null?void 0:e.getDuration())??this.videojsPlayer.duration()}volume(){var e;return((e=this.getCastSession())==null?void 0:e.getVolume())??1}setVolume(e){var t;(t=this.getCastSession())==null||t.setVolume(e)}muted(){var e;return((e=this.getCastSession())==null?void 0:e.getMuted())??!1}setMuted(e){var t;(t=this.getCastSession())==null||t.setMuted(e)}buffered(){}seekable(){return R.createTimeRanges(0,this.duration())}playbackRate(){return 1}readyState(){return 4}controls(){return!1}playsinline(){return!0}supportsFullScreen(){return!0}setAutoplay(){}preload(){}load(){}setPlaybackRate(){}static canPlayType(){return""}static canPlaySource(e,t){return!!Qs.getOrCreateInstance((t==null?void 0:t.instanceId)??"").getCastSession()}static isSupported(){return Qs.isActive()}}R.registerTech("devices",$j);const jj=R.getPlugin("plugin");class Vj extends jj{constructor(e,t){var i;super(e,t),this.options=t,this.instanceId=((i=this.player.options_.devices)==null?void 0:i.instanceId)??"",this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.onReady=this.onReady.bind(this),this.onDevicesChanged=this.onDevicesChanged.bind(this),this.onCastSessionChanged=this.onCastSessionChanged.bind(this),this.onDevicesError=this.onDevicesError.bind(this),this.addViviClient=this.addViviClient.bind(this),this.addAppleTvClient=this.addAppleTvClient.bind(this),this.reloadTech=this.reloadTech.bind(this),this.getSessionManager=this.getSessionManager.bind(this),this.dispose=this.dispose.bind(this)}initialize(){this.player.ready(this.onReady)}onReady(){const e=this.player.getChild("collapserator"),t=e==null?void 0:e.children().findIndex(g=>g.name()==="CustomControlSpacer"),i=e==null?void 0:e.children().findIndex(g=>g.name()==="OpenExternallyButton"),r=Math.max(t,i)+1,n=this.getSessionManager();if(!e||!t||t===-1||!n)return;n.on("deviceschange",this.onDevicesChanged),n.on("castsessionchange",this.onCastSessionChanged),n.on("error",this.onDevicesError);const a=()=>{this.addViviClient(n),this.addAppleTvClient(n)},o=(g,C)=>{var p;n.startCastSession({device:C,title:this.options.title}),(p=this.options.analyticsService)==null||p.logUserAction(C,{actionType:ci.Select,workflowPhase:Dl.Complete,descriptor:Ys.ChangeDevice,entity:wi.Device,eventVersion:Fs.V3})},l=this.options.ctaOptions,u=this.options.vivi,c=this.options.appleTv,h=[];c.enabled||h.push(Ji.AppleTv),(!u.enabled||!u.accountConnected)&&h.push(Ji.Vivi);const f={onClick:a,onDeviceMenuItemClick:o,ctaOptions:{...l,inactiveIntegrations:h}};this.devicesButton=e.addChild("DevicesButton",f,r)}onDevicesChanged(e){var t;(t=this.devicesButton)==null||t.setDevices(e)}onCastSessionChanged(e){var t;(t=this.devicesButton)==null||t.setCastSession(e),this.reloadTech(),e?(this.player.addClass("cv-device-casting"),this.player.addClass(`cv-device-${e.getDevice().type}`),this.player.isFullscreen()&&this.player.exitFullscreen()):(this.player.removeClass("cv-device-casting"),this.player.removeClass(`cv-device-${Ji.AppleTv}`),this.player.removeClass(`cv-device-${Ji.Vivi}`))}onDevicesError(e){this.player.error(e.message),this.player.pause()}addViviClient(e){if(!this.options.vivi.enabled||!this.options.vivi.accountConnected||!this.options.vivi.apiUrl||e.hasInstanceOfClient(Bs))return;const t=new Bs({url:this.options.vivi.apiUrl,fetchAccessToken:this.options.vivi.fetchAccessToken});e.addClient(t)}addAppleTvClient(e){if(!this.options.appleTv.enabled||!this.options.trackingCode||!this.options.userId||e.hasInstanceOfClient(Rs))return;const t=new Rs({fetchAccessToken:this.options.appleTv.fetchAccessToken,trackingCode:this.options.trackingCode,userId:this.options.userId});e.addClient(t)}reloadTech(){const e=this.player,t=e.currentSources(),i=e.volume(),r=e.muted(),n=e.currentTime(),a=e.paused();e.src(t),e.one("playing",()=>{e.volume(i),e.muted(r),e.currentTime(n),a?e.pause():e.play()})}getSessionManager(){if(this.instanceId)return Qs.getOrCreateInstance(this.instanceId)}dispose(){const e=this.getSessionManager();e&&(e.off("deviceschange",this.onDevicesChanged),e.off("castsessionchange",this.onCastSessionChanged),e.off("error",this.onDevicesError),Qs.disposeAndRemoveInstance(e),super.dispose())}}R.registerPlugin("devicesPlugin",Vj);function Hj(s){var n;const[e,t]=Us.useState(5);if(Us.useEffect(()=>{const a=setInterval(()=>{t(o=>o-1)},1e3);return()=>{clearInterval(a)}},[]),Us.useEffect(()=>{e===0&&s.onPlayNext()},[e]),!s.nextVideo||!s.onPlayNext)return oe.jsx(oe.Fragment,{});const i=Math.ceil(e),r=i===1?"second":"seconds";return oe.jsx(oe.Fragment,{children:oe.jsxs("div",{className:"cv-up-next-container",children:[oe.jsx("div",{className:"cv-cancel-up-next cursor-pointer",role:"button",onClick:s.onCancel,children:"×"}),oe.jsxs("div",{className:"cv-up-next-heading",children:["Up next in ",i," ",r,":"]}),oe.jsx("div",{className:"cv-up-next-image cursor-pointer",onClick:s.onPlayNext,style:{backgroundImage:`url(${(n=s.nextVideo)==null?void 0:n.thumbnailUrl})`}}),oe.jsx("div",{className:"cv-up-next-title",children:s.nextVideo.name})]})})}R.registerComponent("UpNext",rd((s,e)=>oe.jsx(Hj,{player:s,...e})));const qj=R.getComponent("MenuItem");let zj=class extends qj{constructor(e,t){super(e,t),this.bindListeners(),this.player_.nextVideoPlugin().getShouldPlayNext()&&this.toggleOn()}bindListeners(){this.onPlayNextChange=this.onPlayNextChange.bind(this),this.player_.on("cv:playnext",this.onPlayNextChange)}handleToggle(){const e=this.player_.nextVideoPlugin().getShouldPlayNext();this.player_.nextVideoPlugin().setShouldPlayNext(!e,!0)}onPlayNextChange(e,t){t?this.toggleOn():this.toggleOff()}toggleOn(){R.dom.addClass(this.toggleEl,"on")}toggleOff(){R.dom.removeClass(this.toggleEl,"on")}handleClick(e){e.stopImmediatePropagation()}createEl(e,t,i){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=R.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);const n=super.createEl(e,{className:"vjs-menu-item cv-cog-menu-item cv-play-next-toggle",innerHTML:`
354
+ <span class="vjs-menu-item-text">Play next video</span>
355
+ <span class="cv-toggle-container"></span>`},i);return n.children[1].appendChild(this.toggleEl),n}dispose(){this.player_.off("cv:playnext",this.onPlayNextChange),super.dispose()}};R.registerComponent("NextVideoMenuItem",zj);const Pb="cv-persisttest",Db="cv-play-next-video",Wj=R.getPlugin("plugin");R.getComponent("MenuItem");const Gj=R.getComponent("NextVideoMenuItem");class Kj extends Wj{constructor(e){if(super(e),this.setShouldPlayNext=this.setShouldPlayNext.bind(this),this.getShouldPlayNext=this.getShouldPlayNext.bind(this),this.getChapterTrack=this.getChapterTrack.bind(this),this.onTimeUpdate=this.onTimeUpdate.bind(this),this.hasLocalStorage=this.testHasLocalStorage(),this.shouldPlayNextVideo=!1,this.hasLocalStorage){const t=window.localStorage.getItem(Db);this.shouldPlayNextVideo=t==="true"}e.ready(()=>{this.initialize()})}initialize(){this.player.isDisposed()||this.bindListeners()}getChapterTrack(){return Yt.getTrack(this.player,"chapters",null)}setNextVideo(e,t,i){var n;this.nextVideo=e,this.callback=i,t&&this.setShouldPlayNext(!0),((n=this.player.getChild("collapserator"))==null?void 0:n.getChild("cogButton")).addItem({ctor:Gj,name:"NextVideoMenuItem"})}getShouldPlayNext(){return this.shouldPlayNextVideo}setShouldPlayNext(e,t){this.shouldPlayNextVideo=e,this.player.trigger("cv:playnext",e),this.hasLocalStorage&&t&&window.localStorage.setItem(Db,e.toString()),e&&this.player.loopVideoPlugin().loop(!1)}bindListeners(){this.player.on("timeupdate",this.onTimeUpdate)}dispose(){this.player.off("timeupdate",this.onTimeUpdate),this.hideUpNext(),super.dispose()}onTimeUpdate(){if(!(this.player.pictureInPicture&&this.player.isInPictureInPicture())){if(!this.getShouldPlayNext()){this.hideUpNext();return}if(this.upNextRendered&&this.player.currentTime()<this.player.duration()){this.hideUpNext();return}this.player.ended()&&this.showUpNext()}}showUpNext(){this.upNextRendered||(this.upNextRendered=!0,this.player.addChild("UpNext",{nextVideo:this.nextVideo,onPlayNext:this.callback,onCancel:()=>{this.hideUpNext(),this.setShouldPlayNext(!1)}}))}hideUpNext(){if(!this.upNextRendered)return;this.upNextRendered=!1;const e=this.player.getChild("UpNext");e&&(this.player.removeChild(e),e.dispose())}testHasLocalStorage(){try{return window.localStorage.setItem(Pb,"persistPlayNext"),window.localStorage.removeItem(Pb),!0}catch{return!1}}}R.registerPlugin("nextVideoPlugin",Kj);const Xj="_imageStyle_9s5en_1",Qj="_imageTypeResource_9s5en_6",Yj="_fallBackImage_9s5en_12",cp={imageStyle:Xj,imageTypeResource:Qj,fallBackImage:Yj},Jj={width:200,resizeType:Bb.Cover};function Zj(s,e,t=Jj){var n,a,o;const i=N2(e);if("thumbnail"in e&&((n=e.thumbnail)!=null&&n.url))return Na.createUrl((a=e.thumbnail)==null?void 0:a.url,{...t});const r=$w.safeUrlConcat(s,"/v1/previews");return Nl.isResource(e)?i===uc.Pdf?e.metadata.type===Za.Pdf?Na.createResourceImage(r,e.url,{...t}):Na.createResourceImage(r,(o=e.pdf)==null?void 0:o.url,{...t}):e.metadata.type!==Za.Zip?Na.createUrl(e.url,{size:Rb.Medium,resizeType:Bb.Cover}):"/images/zip-resource.png":Na.createResourceImage(r,e.url,{...t})}function N2(s){var e;return Nl.isResource(s)?s.metadata.type===Za.Pdf||(e=s.pdf)!=null&&e.url?uc.Pdf:uc.Thumbnails:uc.Link}function eV(s){var r,n;let e=null,t=0;Nl.isResource(s.resource)&&(e=s.resource.metadata,t=((n=(r=s.resource.thumbnail)==null?void 0:r.metadata)==null?void 0:n.rotation)??0);const i=Zj(s.imageCdnUrl,s.resource,s.dynamicRatioImageOptions);return oe.jsx(uk,{data:i,imageType:N2(s.resource),imageStyle:{transform:`rotate(${t}deg)`},alt:s.resource.name,errorFallbackImageSrc:s.imageErrorFallbackUrl,errorFallbackImageClassName:cp.fallBackImage,imageClassName:(e==null?void 0:e.type)===Za.Image?`${cp.imageTypeResource} ${cp.imageStyle}`:"",preload:s.preloadImage,preventLoad:!s.preloadImage})}const tV={getResourceTypeName(s){switch(s){case"additional-materials":return"Additional Materials";case"atom-guide":return"ATOM Guide";case"teacher-pack":return"Teacher Pack";case"student-activity":return"Student Activity";default:return"N/A"}}},iV="_imageStyle_lemx6_1",rV="_item_lemx6_6",nV="_dashboard_lemx6_10",sV="_playPage_lemx6_25",aV="_aspectRatio_lemx6_34",oV="_outerContainer_lemx6_39",lV="_innerContainer_lemx6_46",uV="_actions_lemx6_46",cV="_titleBelow_lemx6_56",hV="_thumbnailContainer_lemx6_59",dV="_titleAbove_lemx6_62",fV="_teacherPack_lemx6_65",pV="_text_lemx6_68",mV="_hoverState_lemx6_71",gV="_atomGuide_lemx6_74",vV="_studentActivity_lemx6_83",yV="_additionalMaterials_lemx6_92",_V="_userUploaded_lemx6_101",TV="_download_lemx6_116",Xt={imageStyle:iV,item:rV,dashboard:nV,playPage:sV,aspectRatio:aV,outerContainer:oV,innerContainer:lV,actions:uV,titleBelow:cV,thumbnailContainer:hV,titleAbove:dV,teacherPack:fV,text:pV,hoverState:mV,atomGuide:gV,studentActivity:vV,additionalMaterials:yV,userUploaded:_V,download:TV};function bV(s){switch(s){case"atom-guide":return Xt.atomGuide;case"student-activity":return Xt.studentActivity;case"teacher-pack":return Xt.teacherPack;case"additional-materials":return Xt.additionalMaterials;default:return Xt.userUploaded}}function SV(s,e){var i;const t=qw();return e==="public"?!0:t.xs||t.sm||s.type!=="resource"||!("metadata"in s)?!1:s.metadata.type===Za.Image?!0:s.metadata.type===Za.Pdf?!!s.url:!!((i=s.pdf)!=null&&i.url)}Ns.defaultProps={preloadImage:!0,actionBehaviour:"normal"};function Ns(s){var r,n,a;let e=null;"metadata"in s.data&&(e=s.data.metadata);const t=Nl.isType(s.data,cc.Resource);function i(o){var u;let l=`
356
+ d-flex flex-column align-items-center justify-content-end rounded-3 h-100
357
+ position-relative ${bV(o)} ${Xt.innerContainer}`;return(u=s.theme)!=null&&u.containerClass?l+=` ${s.theme.containerClass}`:l+=" pt-3 px-3",s.applyHoverState&&(l+=` ${Xt.hoverState}`),l}return oe.jsxs(oe.Fragment,{children:[oe.jsx("div",{className:Xt.aspectRatio,children:oe.jsx("div",{className:Xt.outerContainer,children:oe.jsxs("div",{className:i(e==null?void 0:e.resourceType),children:[s.titlePosition==="above"&&oe.jsx(Cm,{title:s.data.name,children:oe.jsx("h3",{className:`text-center text-break h5 mb-3 ${Xt.text}`,children:oe.jsx("span",{className:"clamp-1",children:s.data.name})})}),oe.jsx("div",{className:`
358
+ ${((r=s.theme)==null?void 0:r.thumbnailContainerClass)??""} w-75 overflow-hidden
359
+ ${Xt.thumbnailContainer} ${s.titlePosition==="above"?Xt.titleAbove:""}
360
+ ${Xt.imageStyle}
361
+ `,children:oe.jsx(eV,{resource:s.data,imageCdnUrl:s.imageCdnUrl,imageErrorFallbackUrl:s.imageErrorFallbackUrl,preloadImage:s.preloadImage})}),t&&s.onClickDownload&&s.actionBehaviour==="normal"&&oe.jsx("div",{className:Xt.actions,children:oe.jsx(ja,{onClick:o=>s.onClickDownload(o,s.data),className:`${Xt.download} d-flex align-items-center justify-content-center`,children:oe.jsx(_n,{svg:g2})})}),!s.hideTypeBadge&&t&&oe.jsx(Yw,{typeId:cc.Resource})]})})}),s.titlePosition==="below"&&oe.jsxs("div",{className:`mt-1 ${Xt.titleBelow}`,children:[Nl.isType(s.data,cc.Resource)&&!!((a=(n=s.data)==null?void 0:n.metadata)!=null&&a.resourceType)&&oe.jsx(Jw,{children:tV.getResourceTypeName(s.data.metadata.resourceType)}),oe.jsx("h3",{className:"h6 clamp-2",children:s.data.name})]})]})}Pt.memo(function(s){const e=SV(s.data,s.actionBehaviour);function t(){return s.location==="play-page"?Xt.playPage:Xt.dashboard}const i={...s.analyticsData,...s.data},r={...s.analyticsOptions,actionType:ci.Click,entity:s.data.typeId===cc.Resource?wi.Resource:wi.Link};function n(){Jn.logUserAction(i,r)}const a={...s,applyHoverState:e||!!s.data.url};return oe.jsx("div",{className:`px-1 flex-shrink-0 ${Xt.item} ${t()} ${jw.RESOURCE_ITEM_SELECTOR}`,children:(()=>{const o="d-block no-decoration";return s.data.type==="link"?oe.jsx("a",{href:s.data.url,target:"_blank",className:o,onClick:n,children:oe.jsx(Ns,{...a})}):e?s.actionBehaviour==="public"?oe.jsx("div",{className:`${o} cursor-pointer d-inline`,onClick:()=>{n(),Vw.trigger(s.getAppLink(s.data))},children:oe.jsx(Ns,{...a})}):oe.jsx(Hw,{appLink:s.getAppLink(s.data),className:o,analyticsData:i,analyticsOptions:r,children:oe.jsx(Ns,{...a})}):s.data.url?oe.jsx("a",{href:s.data.url,className:o,onClick:n,children:oe.jsx(Ns,{...a})}):oe.jsx("div",{className:o,children:oe.jsx(Ns,{...a})})})()})});function CV(s){return oe.jsx("div",{className:"cv-resource-item",children:oe.jsx(Ns,{data:s.resource,imageCdnUrl:s.imageCdnUrl,titlePosition:"above",hideTypeBadge:!0})})}const EV=rd((s,e)=>oe.jsx(CV,{...e})),wV=R.getComponent("MenuItem");class kV extends wV{constructor(e,t){super(e,t);const i=new EV(e,{resource:t.resource,imageCdnUrl:t.imageCdnUrl});this.addChild(i)}createEl(e,t={},i){return super.createEl(e,{...t,className:`${t.className} cv-resource-menu-item`},i)}handleClick(e){e.stopImmediatePropagation(),this.options_.downloadResource(this.options_.resource)}}const xV=R.getComponent("MenuButton");class L2 extends xV{constructor(){super(...arguments),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0}buildWrapperCSSClass(){return`cv-menu-small cv-resources-button-wrapper ${super.buildWrapperCSSClass()}`}buildCSSClass(){return`cv-resources-button ${super.buildCSSClass()}`}update(){super.update()}createItems(){const e=[];return e.push(new Zs(this.player_,{label:"Resources"})),this.options_.resources.forEach(t=>{const i=new kV(this.player(),{resource:t,imageCdnUrl:this.options_.imageCdnUrl,downloadResource:r=>this.downloadResource(r),label:t.name});e.push(i)}),e}downloadResource(e){if(e.type==="link"){zw.PageLoad(e.url,!0);return}this.getDownloadIframe().src=e.url}getDownloadIframe(){return this.downloadIframe?this.downloadIframe:(this.downloadIframe=R.dom.createEl("iframe"),this.downloadIframe.style.display="none",R.dom.appendContent(R.dom.$("body"),this.downloadIframe),this.downloadIframe)}getCollabsibleName(){return this.controlText_}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!0}showCollapsibleMenu(){super.handleClick(null)}}L2.prototype.controlText_="Resources";R.registerComponent("ResourcesButton",L2);const AV=R.getPlugin("plugin");class IV extends AV{constructor(e,t){super(e,t),this.options=t,e.ready(()=>this.onReady())}onReady(){if(!this.options.resources.length)return;const e=this.player.getChild("collapserator");e.addChild("ResourcesButton",{resources:this.options.resources,imageCdnUrl:this.options.imageCdnUrl},e.children_.length-4)}}R.registerPlugin("resourcesPlugin",IV);function Yq(s){const{className:e="",playerApi:t,onReady:i,onDispose:r,...n}=s,a=Pt.useRef(null);return Pt.useEffect(()=>{if(!a)return;const o=new ij(a.current,{...n,playerApi:t});return i&&o.ready(()=>{i(rj(o))}),r&&o.one("dispose",r),()=>{o==null||o.dispose()}},[s.viewKey]),oe.jsx("div",{ref:a,className:e})}const PV="_overlay_rtlcs_1",DV="_close_rtlcs_10",NV="_preview_rtlcs_15",ac={overlay:PV,close:DV,preview:NV};function Jq(s){return oe.jsxs(oe.Fragment,{children:[oe.jsx("div",{className:`${ac.overlay} ${ac.preview} d-flex align-items-center justify-content-start`,children:oe.jsx(_n,{svg:Kw,size:dp.Large})}),oe.jsx(ja,{className:`${ac.overlay} ${ac.close} d-flex align-items-center justify-content-center`,onClick:s.closePopup,children:oe.jsx(_n,{svg:Em,size:dp.Large})})]})}const LV="_copyrightDisclaimer_yyjul_1",OV="_overlayContainer_yyjul_4",Nb={copyrightDisclaimer:LV,overlayContainer:OV},hp="shared.copyrightDisclaimer",MV=150;function RV(s){const[e,t]=sk({});function i(){var n;return document.documentElement.clientHeight-((n=e.current)==null?void 0:n.getBoundingClientRect().bottom)<MV}return oe.jsxs("div",{ref:e,className:s.className,children:[oe.jsx("p",{className:`${Nb.copyrightDisclaimer} ${s.phraseClassName??"mb-1"}`,children:oe.jsx(Tl,{namespace:hp,phrase:"copyrightDisclaimer"})}),oe.jsx(Ww,{target:e.current,show:t,placement:s.overflowPlacement&&i()?s.overflowPlacement:s.placement,children:oe.jsxs("div",{className:`${Nb.overlayContainer} mw-100 bg-white border rounded-3 p-2`,children:[oe.jsx("p",{children:oe.jsx(Tl,{namespace:hp,phrase:"warning"})}),oe.jsx("p",{className:"fw-semibold mb-0",children:oe.jsx(Tl,{namespace:hp,phrase:"sharing"})})]})})]})}function BV(s){const{page:e,totalPages:t}=s,i=_v.isNumber(e)&&e>0&&e<t&&e+1,r=_v.isNumber(e)&&e>1&&e-1,n={};if(i&&i<=t&&(n.next=i.toString()),r&&(n.previous=r.toString()),!Gw.isEmpty(n))return n}const O2={isEmpty(s){return s&&!(s.data&&s.data.length)},length(s){return s&&s.data&&s.data.length},at(s,e){if(!(!s||!s.data||!s.data.length||e>s.data.length))return s.data[e]},get(s,e){if(!(!s||!s.data||!s.data.length))return s.data.find(t=>t.id&&t.id.toString()===e)},flattenCollections(s){if(!s||!s.length)return;let e=[];return s.forEach(t=>{e=[...e,...t.data]}),e},getNextCursor(s){return s.pagination&&s.pagination.cursors&&s.pagination.cursors.next},convertLegacyPaginatedCollection(s){if(s)return{data:s.data,pagination:{cursors:BV(s.pagination),limit:s.pagination.pageSize}}},hasData(s){return!O2.isEmpty(s)}};function Lb(s){var e;switch((e=s.tagType)==null?void 0:e.toLowerCase()){case gv.Pedagogy:return 0;case gv.Skill:return 1;default:return 2}}function FV(s){if(!s.tags)return oe.jsx(oe.Fragment,{});const e=[...s.tags].sort((t,i)=>Lb(t)-Lb(i));return oe.jsx("div",{className:`${rk.tagList} ${s.className}`,children:e.map(t=>{const i=typeof s.getAppLink=="function"?s.getAppLink(t):null,r=typeof s.onRemove=="function"?()=>s.onRemove(t):null,n=typeof s.onClick=="function"?()=>s.onClick(t):null;return oe.jsx(nk,{tag:t,appLink:i,themeColours:s.themeColours,onRemove:r,onClick:n},t.id||t.name)})})}function oc(s){const{label:e,items:t}=s;if(!(t&&t.data&&t.data.length))return oe.jsx(oe.Fragment,{});const r=t.data.map(n=>n.name).join(", ");return oe.jsxs("div",{className:"mb-2",children:[e,": ",r]})}const M2="exchange.detailsSection",lc=Th.encloseNamespace(M2);function UV(s){var r,n,a,o,l,u,c,h,f,g;const{video:e,hasPPDD:t,description:i}=s;return oe.jsxs("div",{className:i?"col-md-5 ps-md-3 pt-3 pt-md-0":"col-12",children:[oe.jsx("h2",{className:"h6 mb-2",children:oe.jsx(Tl,{namespace:M2,phrase:"details"})}),t&&oe.jsxs("div",{children:[oe.jsx(oc,{label:lc("productionCompanies",{smartCount:(n=(r=e.productionCompanies)==null?void 0:r.data)==null?void 0:n.length}),items:e.productionCompanies}),oe.jsx(oc,{label:lc("distributors",{smartCount:(o=(a=e.distributors)==null?void 0:a.data)==null?void 0:o.length}),items:e.distributors}),oe.jsx(oc,{label:lc("producers",{smartCount:(u=(l=e.producers)==null?void 0:l.data)==null?void 0:u.length}),items:e.producers}),oe.jsx(oc,{label:lc("directors",{smartCount:(h=(c=e.directors)==null?void 0:c.data)==null?void 0:h.length}),items:e.directors})]}),!!((g=(f=e.tags)==null?void 0:f.data)!=null&&g.length)&&oe.jsx(FV,{tags:e.tags.data})]})}const $V="_previewBadge_1mq7j_1",Ob={previewBadge:$V},jV="exchange.previewVideoDetails",VV=200;function Zq(s){var h,f,g,C,p;const{title:e,description:t,video:i,videoActions:r}=s,n=b=>b?!O2.isEmpty(b):!1,a=!!(i!=null&&i.series),o=!!((h=Tv.getRating(i))!=null&&h.value)||!!(i!=null&&i.productionYear)||s.program,l=n(i==null?void 0:i.productionCompanies)||n(i==null?void 0:i.producers)||n(i==null?void 0:i.distributors)||n(i==null?void 0:i.directors),u=!!t,c=l||!!((g=(f=i==null?void 0:i.tags)==null?void 0:f.data)!=null&&g.length);return oe.jsxs("div",{className:"p-3",children:[oe.jsxs("div",{className:`${!a&&!o?"mb-2":"mb-3"} position-relative`,children:[oe.jsxs("div",{className:"w-100",children:[oe.jsx("div",{className:"ms-2 float-end",children:oe.jsx(ck,{actions:r,actionsDropdownClassName:"btn btn-outline-dark px-1"})}),!!i&&oe.jsx(Zw,{type:"series",video:i,appLink:dk(i.series),className:"text-wrap",analyticsOptions:{location:_l.PlayPage}}),oe.jsx("h1",{className:`h4 mb-1 ${!a&&!o?"mb-0 pt-2":""}`,children:oe.jsx("span",{className:"align-self-center",children:e})})]}),o&&oe.jsxs(hk,{children:[oe.jsx(vv,{type:yv.Rating,data:Tv.getRating(i),className:`${Ob.previewBadge} fw-semibold py-0 font-size-normal align-items-center px-2`}),oe.jsx(vv,{type:yv.ProductionYear,data:i==null?void 0:i.productionYear,className:`${Ob.previewBadge} fw-semibold font-size-sm align-items-center px-1`}),((C=s.program)==null?void 0:C.channelLogoUrl)&&oe.jsx(pk,{logoUrl:s.program.channelLogoUrl,className:"me-1"}),((p=s.program)==null?void 0:p.hasAdsFree)&&oe.jsx(fk,{className:"me-1"}),s.program&&oe.jsx(mk,{program:s.program,showDate:!0,showEndTime:!0})]})]}),oe.jsxs("div",{children:[oe.jsx(Qw.Scrollbars,{autoHeight:!0,autoHeightMax:VV,children:oe.jsxs("div",{className:"row g-0",children:[u&&oe.jsxs("div",{className:c?"border-end pe-3 col-md-7":"col-12",children:[oe.jsx("div",{className:"d-flex align-items-center",children:oe.jsx("h2",{className:"h6 mb-2",children:oe.jsx(Tl,{namespace:jV,phrase:"description"})})}),oe.jsx("p",{className:"mb-2",dangerouslySetInnerHTML:{__html:ek.linkifyText(t,{nl2br:!0})}})]}),c&&oe.jsx(UV,{video:i,hasPPDD:l,description:t})]})}),s.video&&oe.jsxs("div",{className:"row",children:[oe.jsx("div",{className:`${l?"d-md-block col-7":""} d-none`}),oe.jsx("div",{className:`${l?"col-md-5 ps-md-3":"ps-2 "} `,children:oe.jsx(RV,{placement:l?"bottom-end":"bottom-start",overflowPlacement:l?"top-end":"top-start"})})]})]})]})}export{Yq as C,Zq as P,Jq as a};
362
+ //# sourceMappingURL=CHPVU_Qn.chunk.js.map