@viewlift/player-backup 2.1.48 → 2.1.58

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 (334) hide show
  1. package/cjs/{autoNextVideo-bb95ca91.js → autoNextVideo-ba0e980c.js} +1 -1
  2. package/cjs/bundle.css +854 -314
  3. package/cjs/{caption-settings-544fd444.js → caption-settings-749e3991.js} +1 -1
  4. package/cjs/captions-0ca41a03.js +1 -0
  5. package/cjs/{features-2c74940a.js → features-a9b106b1.js} +1 -1
  6. package/cjs/generic-11fbe54f.js +1 -0
  7. package/cjs/index-3c8cc926.js +1 -0
  8. package/cjs/{index-0cb8083b.js → index-58f88daa.js} +1 -1
  9. package/cjs/{index-f174f7e4.js → index-c265b095.js} +1 -1
  10. package/cjs/{index-96aad351.js → index-ca6ed680.js} +1 -1
  11. package/cjs/index.js +1 -1
  12. package/cjs/{multicamv2-58240e3c.js → multicamv2-0a607f96.js} +1 -1
  13. package/cjs/{multicamv2-d716f3bf.js → multicamv2-d7921aa4.js} +1 -1
  14. package/cjs/{nextEpisodeButton-381f9550.js → nextEpisodeButton-6586c080.js} +1 -1
  15. package/cjs/playlist-d6d47ce3.js +1 -0
  16. package/cjs/relatedVideosManager-0a220d05.js +1 -0
  17. package/cjs/{renditions-d28715a3.js → renditions-627bdfad.js} +1 -1
  18. package/cjs/{resolution-dbd4c97b.js → resolution-3af2cf1b.js} +1 -1
  19. package/cjs/{series-b45c14ac.js → series-928c71ca.js} +1 -1
  20. package/cjs/{series-v2-73ce2001.js → series-v2-67f83149.js} +1 -1
  21. package/cjs/{series-v2-5f591643.js → series-v2-ba776119.js} +1 -1
  22. package/cjs/{settings-icon-f75ddcd4.js → settings-icon-8bb0d3f0.js} +1 -1
  23. package/cjs/skin-00e8f3ce.js +1 -0
  24. package/cjs/{skin-73e09182.js → skin-2a0db90e.js} +1 -1
  25. package/cjs/{skin-4f7a8f34.js → skin-2eb334a3.js} +1 -1
  26. package/cjs/{skin-3e6492cd.js → skin-2f79a725.js} +1 -1
  27. package/cjs/skin-66dce245.js +1 -0
  28. package/cjs/skin-69ef3035.js +1 -0
  29. package/cjs/skin-6f208a68.js +1 -0
  30. package/cjs/skin-7f60cfe9.js +1 -0
  31. package/cjs/{skin-3696c831.js → skin-ad961a34.js} +1 -1
  32. package/cjs/skin-ce7f39da.js +1 -0
  33. package/cjs/skin-e2f642f7.js +1 -0
  34. package/cjs/skin-e974dad9.js +1 -0
  35. package/cjs/videoSelector-b5e2084e.js +1 -0
  36. package/cjs/videoSelector-ffad15a8.js +1 -0
  37. package/cjs/{videojs-dash5.es-072614bc.js → videojs-dash5.es-874b887d.js} +1 -1
  38. package/esm/autoNextVideo-cb262c5f.js +1 -0
  39. package/esm/bundle.css +854 -314
  40. package/esm/{caption-settings-106547c2.js → caption-settings-567b8533.js} +1 -1
  41. package/esm/captions-15915fce.js +1 -0
  42. package/esm/components/auto-next-video/autoNextVideo.d.ts +1 -0
  43. package/esm/components/chapters/bootstrap.d.ts +2 -0
  44. package/esm/components/chapters/events.d.ts +15 -0
  45. package/esm/components/chapters/index.d.ts +14 -0
  46. package/esm/components/chapters/markers.d.ts +16 -0
  47. package/esm/components/chapters/store.d.ts +5 -0
  48. package/esm/components/chapters/timelineMapper.d.ts +35 -0
  49. package/esm/components/video-selector/videoSelector.d.ts +5 -0
  50. package/esm/components/video-selector_TEMP/videoSelector.d.ts +4 -0
  51. package/esm/core/captions.d.ts +1 -0
  52. package/esm/features/scheduleWindow/index.d.ts +4 -0
  53. package/esm/{features-816fec29.js → features-9098e71f.js} +1 -1
  54. package/esm/generic-d0f5d86c.js +1 -0
  55. package/esm/helpers/apiErrorTracker.d.ts +1 -0
  56. package/esm/helpers/drmErrorDetection.d.ts +6 -0
  57. package/esm/helpers/skin.d.ts +1 -1
  58. package/esm/{icons-699e8cf0.js → icons-262bef63.js} +1 -1
  59. package/esm/{index-98a3c17e.js → index-255be282.js} +1 -1
  60. package/esm/{index-903c9102.js → index-85c4eeac.js} +1 -1
  61. package/esm/index-acddb9d9.js +1 -0
  62. package/esm/index-edd84bad.js +1 -0
  63. package/esm/index.d.ts +16 -0
  64. package/esm/index.js +1 -1
  65. package/esm/{multicamv2-38017415.js → multicamv2-3fbbac57.js} +1 -1
  66. package/esm/{multicamv2-dc7223f4.js → multicamv2-5fcf237e.js} +1 -1
  67. package/esm/{nextEpisodeButton-cd12f4d9.js → nextEpisodeButton-ada37c7c.js} +1 -1
  68. package/esm/{playlist-36a94502.js → playlist-7dc11330.js} +1 -1
  69. package/esm/plugins/chromecast.d.ts +2 -0
  70. package/esm/relatedVideosManager-81661348.js +1 -0
  71. package/esm/{renditions-19f0b3a9.js → renditions-620d93b3.js} +1 -1
  72. package/esm/{resolution-8cbda37b.js → resolution-2ee017b4.js} +1 -1
  73. package/esm/{series-ea1a7c31.js → series-85520747.js} +1 -1
  74. package/esm/{series-v2-527af959.js → series-v2-63ae5ed6.js} +1 -1
  75. package/esm/{series-v2-93acf14e.js → series-v2-da905faf.js} +1 -1
  76. package/esm/{settings-icon-2e8d0bdf.js → settings-icon-c65eb622.js} +1 -1
  77. package/esm/skin/cn_news/skin.d.ts +1 -0
  78. package/esm/{skin-e89be703.js → skin-24466443.js} +1 -1
  79. package/{cjs/skin-a9f57f44.js → esm/skin-34a22ce2.js} +1 -1
  80. package/esm/skin-3653c5b3.js +1 -0
  81. package/esm/skin-78f45035.js +1 -0
  82. package/esm/skin-87abea35.js +1 -0
  83. package/esm/{skin-3d204d96.js → skin-954a4a36.js} +1 -1
  84. package/esm/{skin-ad96739a.js → skin-b16f97c4.js} +1 -1
  85. package/esm/skin-b5db4100.js +1 -0
  86. package/esm/skin-c4d10b91.js +1 -0
  87. package/esm/skin-dfd6326a.js +1 -0
  88. package/esm/skin-e42eefa2.js +1 -0
  89. package/{cjs/skin-0b2674c0.js → esm/skin-f7e1a520.js} +1 -1
  90. package/esm/utilities/relatedVideosManager.d.ts +11 -0
  91. package/esm/videoSelector-3715144e.js +1 -0
  92. package/esm/videoSelector-e70b1dd5.js +1 -0
  93. package/esm/{videojs-dash5.es-e31d9fb5.js → videojs-dash5.es-640f7001.js} +1 -1
  94. package/package.json +5 -2
  95. package/cjs/autoNextVideo-20e859e6.js +0 -1
  96. package/cjs/autoNextVideo-4484bfe2.js +0 -1
  97. package/cjs/autoNextVideo-a6863387.js +0 -1
  98. package/cjs/autoNextVideo-b1e2e401.js +0 -1
  99. package/cjs/browser-77c57718.js +0 -1
  100. package/cjs/caption-settings-8301e454.js +0 -1
  101. package/cjs/captions-4465c0cf.js +0 -1
  102. package/cjs/captions-80f6eb66.js +0 -1
  103. package/cjs/features-4d2cdab9.js +0 -1
  104. package/cjs/features-59c7237e.js +0 -1
  105. package/cjs/features-75a6eda6.js +0 -1
  106. package/cjs/features-d9e42442.js +0 -1
  107. package/cjs/generic-0d09b7b6.js +0 -1
  108. package/cjs/generic-124edde3.js +0 -1
  109. package/cjs/generic-575ba973.js +0 -1
  110. package/cjs/generic-b9186e76.js +0 -1
  111. package/cjs/generic-ee6cb3e8.js +0 -1
  112. package/cjs/index-164faacf.js +0 -1
  113. package/cjs/index-22349e69.js +0 -1
  114. package/cjs/index-3543baa5.js +0 -1
  115. package/cjs/index-a161f2a5.js +0 -1
  116. package/cjs/index-a61f9f05.js +0 -1
  117. package/cjs/index-b3ee1389.js +0 -1
  118. package/cjs/index-c2a0dc54.js +0 -1
  119. package/cjs/index-c2cf8d32.js +0 -1
  120. package/cjs/index-d2ade9be.js +0 -1
  121. package/cjs/index-f3db22a6.js +0 -1
  122. package/cjs/multicamv2-37e52f80.js +0 -1
  123. package/cjs/multicamv2-391677d8.js +0 -1
  124. package/cjs/multicamv2-3ea717fe.js +0 -1
  125. package/cjs/multicamv2-4ac35af7.js +0 -1
  126. package/cjs/multicamv2-5a5fd8ba.js +0 -1
  127. package/cjs/multicamv2-70762562.js +0 -1
  128. package/cjs/multicamv2-7172297d.js +0 -1
  129. package/cjs/multicamv2-e078cad1.js +0 -1
  130. package/cjs/nextEpisodeButton-0a083fc8.js +0 -1
  131. package/cjs/nextEpisodeButton-14e0d641.js +0 -1
  132. package/cjs/nextEpisodeButton-51babfd6.js +0 -1
  133. package/cjs/nextEpisodeButton-de159f7d.js +0 -1
  134. package/cjs/playlist-2e64c4e0.js +0 -1
  135. package/cjs/playlist-4f907336.js +0 -1
  136. package/cjs/playlist-ebbf614e.js +0 -1
  137. package/cjs/playlist-f3a79f49.js +0 -1
  138. package/cjs/playlist-f59b8707.js +0 -1
  139. package/cjs/resolution-948774b8.js +0 -1
  140. package/cjs/series-049e7062.js +0 -1
  141. package/cjs/series-36d9bd8c.js +0 -1
  142. package/cjs/series-7515df02.js +0 -1
  143. package/cjs/series-d3db48b0.js +0 -1
  144. package/cjs/series-v2-2c4bc935.js +0 -1
  145. package/cjs/series-v2-2c90319e.js +0 -1
  146. package/cjs/series-v2-74b40be3.js +0 -1
  147. package/cjs/series-v2-81ca3bdb.js +0 -1
  148. package/cjs/series-v2-910436af.js +0 -1
  149. package/cjs/series-v2-9efb55f0.js +0 -1
  150. package/cjs/series-v2-b636184b.js +0 -1
  151. package/cjs/series-v2-f47444e8.js +0 -1
  152. package/cjs/settings-icon-7a7e7810.js +0 -1
  153. package/cjs/settings-icon-f7387d3f.js +0 -1
  154. package/cjs/skin-00c13fb7.js +0 -1
  155. package/cjs/skin-0549b6c1.js +0 -1
  156. package/cjs/skin-07aa6ed9.js +0 -1
  157. package/cjs/skin-09ad7b11.js +0 -1
  158. package/cjs/skin-0e1d9860.js +0 -1
  159. package/cjs/skin-0e7714d5.js +0 -1
  160. package/cjs/skin-14cfc5f9.js +0 -1
  161. package/cjs/skin-160a1e0d.js +0 -1
  162. package/cjs/skin-179d4a10.js +0 -1
  163. package/cjs/skin-36bd79ee.js +0 -1
  164. package/cjs/skin-3a643152.js +0 -1
  165. package/cjs/skin-42c7ecb1.js +0 -1
  166. package/cjs/skin-49aac6be.js +0 -1
  167. package/cjs/skin-49d2095c.js +0 -1
  168. package/cjs/skin-4b2bd296.js +0 -1
  169. package/cjs/skin-55e70f90.js +0 -1
  170. package/cjs/skin-5df50924.js +0 -1
  171. package/cjs/skin-63cd3771.js +0 -1
  172. package/cjs/skin-6e38d04b.js +0 -1
  173. package/cjs/skin-6e93679a.js +0 -1
  174. package/cjs/skin-757345a6.js +0 -1
  175. package/cjs/skin-821fa239.js +0 -1
  176. package/cjs/skin-86fac85d.js +0 -1
  177. package/cjs/skin-92520302.js +0 -1
  178. package/cjs/skin-94081c42.js +0 -1
  179. package/cjs/skin-98e675b3.js +0 -1
  180. package/cjs/skin-9b1b4ebb.js +0 -1
  181. package/cjs/skin-ab124109.js +0 -1
  182. package/cjs/skin-ac1ab4b6.js +0 -1
  183. package/cjs/skin-b7a60794.js +0 -1
  184. package/cjs/skin-ba8bab4c.js +0 -1
  185. package/cjs/skin-c348b669.js +0 -1
  186. package/cjs/skin-c5c6aa2f.js +0 -1
  187. package/cjs/skin-c79dfd38.js +0 -1
  188. package/cjs/skin-c97f0eea.js +0 -1
  189. package/cjs/skin-cd8d15bd.js +0 -1
  190. package/cjs/skin-d59521f5.js +0 -1
  191. package/cjs/skin-d8f52969.js +0 -1
  192. package/cjs/skin-da51cdf5.js +0 -1
  193. package/cjs/skin-e06ecec7.js +0 -1
  194. package/cjs/skin-eafac525.js +0 -1
  195. package/cjs/skin-f1b75fa4.js +0 -1
  196. package/cjs/skin-fc1e7e52.js +0 -1
  197. package/cjs/util-0700f7a8.js +0 -1
  198. package/cjs/util-58eb642b.js +0 -1
  199. package/cjs/util-8f98ab44.js +0 -1
  200. package/cjs/videoSelector-2dd6dcd2.js +0 -1
  201. package/cjs/videoSelector-8750e2d9.js +0 -1
  202. package/cjs/videoSelector-88f38fd8.js +0 -1
  203. package/cjs/videoSelector-9b4383fc.js +0 -1
  204. package/cjs/videoSelector-9cfb5ac1.js +0 -1
  205. package/cjs/videoSelector-b43bbdc0.js +0 -1
  206. package/cjs/videoSelector-c2f201ae.js +0 -1
  207. package/cjs/videoSelector-dd8f9f5a.js +0 -1
  208. package/cjs/videoSelector-f240a285.js +0 -1
  209. package/cjs/videoSelector-fb869bd6.js +0 -1
  210. package/cjs/videojs-dash5.es-75637b78.js +0 -1
  211. package/cjs/videojs-dash5.es-8bc4e9b4.js +0 -1
  212. package/esm/autoNextVideo-0e191368.js +0 -1
  213. package/esm/autoNextVideo-30031d4d.js +0 -1
  214. package/esm/autoNextVideo-52137799.js +0 -1
  215. package/esm/autoNextVideo-a73988b8.js +0 -1
  216. package/esm/autoNextVideo-f6dc4d9f.js +0 -1
  217. package/esm/browser-d4613b36.js +0 -1
  218. package/esm/caption-settings-2f3a51f7.js +0 -1
  219. package/esm/captions-2b4caf69.js +0 -1
  220. package/esm/captions-6528f589.js +0 -1
  221. package/esm/cnbc-test.html +0 -119
  222. package/esm/features-82917e98.js +0 -1
  223. package/esm/features-8b7b0c27.js +0 -1
  224. package/esm/features-93b7fd57.js +0 -1
  225. package/esm/features-c38dfb0c.js +0 -1
  226. package/esm/generic-64133bf6.js +0 -1
  227. package/esm/generic-8344606d.js +0 -1
  228. package/esm/generic-9e05e2df.js +0 -1
  229. package/esm/generic-aa51d117.js +0 -1
  230. package/esm/generic-b3c3a40b.js +0 -1
  231. package/esm/index-0b9cdc35.js +0 -1
  232. package/esm/index-0f069fa2.js +0 -1
  233. package/esm/index-1b1ab24b.js +0 -1
  234. package/esm/index-1ecd51a1.js +0 -1
  235. package/esm/index-4138a407.js +0 -1
  236. package/esm/index-53767d75.js +0 -1
  237. package/esm/index-78f30ecd.js +0 -1
  238. package/esm/index-7f9c8eec.js +0 -1
  239. package/esm/index-882f3135.js +0 -1
  240. package/esm/index-e2eff229.js +0 -1
  241. package/esm/index-e418d70e.js +0 -1
  242. package/esm/index-fd0a3b1f.js +0 -1
  243. package/esm/multicamv2-024f31c8.js +0 -1
  244. package/esm/multicamv2-24c7d272.js +0 -1
  245. package/esm/multicamv2-406bc3de.js +0 -1
  246. package/esm/multicamv2-408a92a1.js +0 -1
  247. package/esm/multicamv2-49437845.js +0 -1
  248. package/esm/multicamv2-8d211282.js +0 -1
  249. package/esm/multicamv2-cc057851.js +0 -1
  250. package/esm/multicamv2-cd20a34b.js +0 -1
  251. package/esm/nextEpisodeButton-00b25e47.js +0 -1
  252. package/esm/nextEpisodeButton-422a0dee.js +0 -1
  253. package/esm/nextEpisodeButton-475dea60.js +0 -1
  254. package/esm/nextEpisodeButton-5d07949e.js +0 -1
  255. package/esm/playlist-21a8cb78.js +0 -1
  256. package/esm/playlist-69fc2bea.js +0 -1
  257. package/esm/playlist-ac18a51a.js +0 -1
  258. package/esm/playlist-c3a07912.js +0 -1
  259. package/esm/resolution-56c85eaf.js +0 -1
  260. package/esm/series-3a866e2b.js +0 -1
  261. package/esm/series-5fa2292e.js +0 -1
  262. package/esm/series-61f7b649.js +0 -1
  263. package/esm/series-d30abb68.js +0 -1
  264. package/esm/series-v2-0bdea653.js +0 -1
  265. package/esm/series-v2-0fd07cc7.js +0 -1
  266. package/esm/series-v2-45e98202.js +0 -1
  267. package/esm/series-v2-566365e5.js +0 -1
  268. package/esm/series-v2-8424b53a.js +0 -1
  269. package/esm/series-v2-854f39bd.js +0 -1
  270. package/esm/series-v2-88790381.js +0 -1
  271. package/esm/series-v2-8ab40c01.js +0 -1
  272. package/esm/settings-icon-0de53818.js +0 -1
  273. package/esm/settings-icon-d7dfe9a5.js +0 -1
  274. package/esm/skin-02526c6e.js +0 -1
  275. package/esm/skin-0b3a968b.js +0 -1
  276. package/esm/skin-10ebb508.js +0 -1
  277. package/esm/skin-12ab4ad8.js +0 -1
  278. package/esm/skin-13a1ba23.js +0 -1
  279. package/esm/skin-14d8e0c1.js +0 -1
  280. package/esm/skin-1a3524b1.js +0 -1
  281. package/esm/skin-2590ddbc.js +0 -1
  282. package/esm/skin-2595787f.js +0 -1
  283. package/esm/skin-259cded3.js +0 -1
  284. package/esm/skin-271fa63f.js +0 -1
  285. package/esm/skin-2c7f1eac.js +0 -1
  286. package/esm/skin-302d5d6b.js +0 -1
  287. package/esm/skin-3178a2cf.js +0 -1
  288. package/esm/skin-37399353.js +0 -1
  289. package/esm/skin-390a9a8d.js +0 -1
  290. package/esm/skin-39370b18.js +0 -1
  291. package/esm/skin-492e26b2.js +0 -1
  292. package/esm/skin-499ad160.js +0 -1
  293. package/esm/skin-4b9be959.js +0 -1
  294. package/esm/skin-4d643917.js +0 -1
  295. package/esm/skin-4f84b841.js +0 -1
  296. package/esm/skin-5ba78150.js +0 -1
  297. package/esm/skin-5c164c7e.js +0 -1
  298. package/esm/skin-657566d5.js +0 -1
  299. package/esm/skin-7f9e8fc1.js +0 -1
  300. package/esm/skin-99b2454f.js +0 -1
  301. package/esm/skin-9a077430.js +0 -1
  302. package/esm/skin-9aafbd0f.js +0 -1
  303. package/esm/skin-9bd6db1a.js +0 -1
  304. package/esm/skin-a5929341.js +0 -1
  305. package/esm/skin-aff772d7.js +0 -1
  306. package/esm/skin-b640d630.js +0 -1
  307. package/esm/skin-b8ce5df8.js +0 -1
  308. package/esm/skin-b9dc58df.js +0 -1
  309. package/esm/skin-beafef7f.js +0 -1
  310. package/esm/skin-c270d768.js +0 -1
  311. package/esm/skin-c6b4c796.js +0 -1
  312. package/esm/skin-d48928ad.js +0 -1
  313. package/esm/skin-dcd7768c.js +0 -1
  314. package/esm/skin-e5aa76de.js +0 -1
  315. package/esm/skin-e6b8b3e8.js +0 -1
  316. package/esm/skin-ea5277f2.js +0 -1
  317. package/esm/skin-f1c932a5.js +0 -1
  318. package/esm/skin-f9727077.js +0 -1
  319. package/esm/skin-f9759186.js +0 -1
  320. package/esm/util-06cf5ddd.js +0 -1
  321. package/esm/util-9000529b.js +0 -1
  322. package/esm/util-f0cd0445.js +0 -1
  323. package/esm/videoSelector-35a6ab81.js +0 -1
  324. package/esm/videoSelector-53e02750.js +0 -1
  325. package/esm/videoSelector-5624224c.js +0 -1
  326. package/esm/videoSelector-71192c3f.js +0 -1
  327. package/esm/videoSelector-78fbdde8.js +0 -1
  328. package/esm/videoSelector-7bc15e01.js +0 -1
  329. package/esm/videoSelector-832e8ff1.js +0 -1
  330. package/esm/videoSelector-835f2fb0.js +0 -1
  331. package/esm/videoSelector-837225cb.js +0 -1
  332. package/esm/videoSelector-d6fd4eb9.js +0 -1
  333. package/esm/videojs-dash5.es-1a1bf509.js +0 -1
  334. package/esm/videojs-dash5.es-600b6231.js +0 -1
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import i from"video.js";import r from"axios";import{g as o,t as a,c as l}from"./skin-4f84b841.js";import{i as s,d}from"./browser-d4613b36.js";import u from"md5";import c from"js-cookie";import{a as v,r as f}from"./captions-2b4caf69.js";import m from"@babel/runtime/helpers/typeof";import p from"@babel/runtime/helpers/toConsumableArray";import h from"@babel/runtime/helpers/slicedToArray";import{destroyComscoreTag as g,formulateComscorePayload as y,createComscoreStreamingTag as w,setComscorePlayerInstance as T}from"@viewlift/comscore/index.js";import _ from"@babel/runtime/helpers/classCallCheck";import I from"@babel/runtime/helpers/createClass";function b(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function E(e){window.dataLayer=window.dataLayer||[],b("js",new Date),b("config",e)}function S(e,n){b("event",e,n)}var k={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function A(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function O(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?A(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):A(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var D={name:"@viewlift/player",version:"2.1.44",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",scripts:{prepublishOnly:"release-assistant"},dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1","@viewlift/sse":"^0.0.1","broadcast-channel":"^7.3.0","@viewlift/comscore":"^1.0.18",axios:"^1.2.3",md5:"^2.3.0",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","jwt-decode":"^4.0.0","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"},overrides:{"min-document":"^2.19.1"}};window.vl_player_version=D.version;var L,P=function(){var e,n,t,i;return null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.overrideEntitlementBaseUrl?(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementBaseUrl)+"/video/status":W.get()+"".concat(null==k?void 0:k.getVideoDetails)},C=function(e,n){var t,i,o,a,l,s,d=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):r({url:P(),params:O({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:d},null===(o=window)||void 0===o||null===(a=o.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":D.version,"x-player-name":"videojs",adbTempToken:null===(l=window)||void 0===l||null===(s=l.customData)||void 0===s?void 0:s.adbTempToken},withCredentials:!0})},F=function(e,n){var t,i,o,a,l,s,d=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):r({url:W.get()+k.getLinearChannelDetails,params:O(O(O(O(O({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:d},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(o=window)||void 0===o||null===(a=o.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO",adbTempToken:null===(l=window)||void 0===l||null===(s=l.customData)||void 0===s?void 0:s.adbTempToken}})},j=function(e,n){var t,i,o=ee(n),a=(null==o?void 0:o.site)||null;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.seriesData?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.seriesData})}):r({url:W.get()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:n}})},R=function(){var e=n(t.mark(function e(n){var i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$();case 2:return i=e.sent,e.abrupt("return",r({url:W.get()+"".concat(null==k?void 0:k.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:O({},n),params:O({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),V=function(e,n){var t,i,o=window.contentType;return r({method:"GET",url:W.get()+"".concat(null==k?void 0:k.getVideoInfoV2,"/").concat(o,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(i=t.watchHistory)||void 0===i?void 0:i.xApiKey},timeout:15e3})},N=function(e){var n=e.videoId;return r({method:"GET",url:W.get()+"".concat(null==k?void 0:k.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},W=(L=null==k?void 0:k.apiBaseUrl,{set:function(e){e&&(L=e)},get:function(){return L}}),x=function(e,n,t,i){var o,a;return r({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==i?void 0:i.latitude,longitude:null==i?void 0:i.longitude},method:"GET",headers:{Authorization:n,adbTempToken:null===(o=window)||void 0===o||null===(a=o.customData)||void 0===a?void 0:a.adbTempToken},withCredentials:!0})},U=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},B=null;function M(){return{set:function(e){e&&(B=e)},get:function(){return B}}}var H,G,q,Q,Y,z,K,X=function(){var e=n(t.mark(function e(){var n,i,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=M().get(),i=W.get(),e.prev=2,e.next=5,r({method:"GET",url:"".concat(i,"/identity/refresh/").concat(n)});case 5:return o=e.sent,e.abrupt("return",o);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return e.apply(this,arguments)}}(),J=null,$=function(){var e=n(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!U(n)){e.next=6;break}return J||(J=X().then(function(e){var t,i,r=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,o=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return r&&sessionStorage.setItem("vlp_token",r),o&&M().set(o),r||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){J=null})),e.abrupt("return",J);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Z=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return t&&!i&&(n=!1),n},ee=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},ne=function(e){e&&"undefined"!=typeof window&&window.sessionStorage&&window.sessionStorage.setItem("uid",e)},te=(z=new Map,{set:function(e){var n,t=(null==e||null===(n=e.video)||void 0===n?void 0:n.id)||e||null;z.set(t,(z.get(t)||0)+1)},get:function(e){return z.get(e)},clear:function(){z.clear()}}),ie=function(e){G=e},re=function(){return G},oe=function(e){H=e},ae=function(){return H},le=function(){return q},se=function(e){q=e},de=function(){return Y},ue=function(e){Q=new Map,e.map(function(e,n){Q.set(e.id,n)})},ce=function(e){if(Q){var n=Q.get(e);se(n+1)}},ve=(K=0,{set:function(e){e>=0&&(K=e)},get:function(){return K}});function fe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function me(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):fe(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var pe,he=(pe={},{setConfig:function(e){pe=me(me({},pe),e)},getConfig:function(){return pe}});function ge(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function ye(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):ge(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var we=0,Te=null,_e=function(){var e,n,t,i,r,o,a,l=re();return"linearchannel"==((null==l?void 0:l.contentType)||"video")?null==l||null===(e=l.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find(function(e){return(null==e?void 0:e.id)===(null==l?void 0:l.channelId)}))||void 0===t||null===(i=t.content)||void 0===i?void 0:i.id:(null==l||null===(r=l.video)||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.id)||(null==l||null===(a=l.video)||void 0===a?void 0:a.id)||(null==l?void 0:l.id)};function Ie(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function be(){return Te||window.sessionStorage.getItem("uid")}function Ee(){return Se.apply(this,arguments)}function Se(){return(Se=n(t.mark(function e(){var n,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ke(e){return e?String(e):""}window.initialise=function(e){window.sid=Ie(),window.environment="production",window.platform="WEBSITE",window.failedToStartTimer=null,window.droppedStreamTimer=null,window.firstFrameFired=!1,streamFailures(e),buffering(e),ads(e),ping(e)},window.cleanupTimers=function(){clearInterval(window.bufferingTimer),clearInterval(window.ttFirstFrameTimer),clearTimeout(window.failedToStartTimer),clearTimeout(window.droppedStreamTimer),window.failedToStartTimer=null,window.droppedStreamTimer=null},window.fireStreamFailure=function(e){var n,t,i,r=o(),a=null!=r&&r.el_?Math.floor(r.currentTime()):0;window.cleanupTimers(),S(e,ye({pfm:window.platform,uid:be(),vid:_e(),videoPosition:a},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:e,videoPosition:a,isAdEvent:!1})},window.streamFailures=function(e){e.on("error",function(){var e=window.firstFrameFired?"DROPPED_STREAM":"FAILED_TO_START";window.fireStreamFailure(e)})},window.firstFrame=function(e,n,t){e.one("play",tryCatch(function(){var i,r,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),window.failedToStartTimer=setTimeout(function(){window.firstFrameFired||window.fireStreamFailure("FAILED_TO_START")},3e4),S("PLAY",ye({pfm:window.platform,uid:be(),vid:_e(),videoPosition:Math.floor(e.currentTime())},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(o=r.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",ye({"Video ID":_e(),watchTime:Math.floor(e.currentTime())},t))}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:(clearInterval(window.bufferingTimer),clearTimeout(window.droppedStreamTimer),window.droppedStreamTimer=null)},100),window.firstFrameFired&&(clearTimeout(window.droppedStreamTimer),window.droppedStreamTimer=setTimeout(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()&&window.fireStreamFailure("DROPPED_STREAM")},45e3)))}))},window.handleBufferTimer=function(e,n){var t,i;if(n.el_){var r,o,a,l=e+.1;if(+l.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(i=t.className)&&void 0!==i&&i.includes("vjs-waiting")&&we<4)we++,S("BUFFERING",ye({pfm:window.platform,uid:be(),vid:_e(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(r=window)||void 0===r||null===(o=r.customData)||void 0===o||null===(a=o.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return l}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var n,t,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),clearTimeout(window.failedToStartTimer),window.failedToStartTimer=null,window.firstFrameFired=!0,window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,S("FIRST_FRAME",ye({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:be(),vid:_e()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var n,t,i,r,o,a;S("AD_REQUEST",ye({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:be(),vid:_e(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),S("AD_IMPRESSION",ye({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:be(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:_e()},null===(r=window)||void 0===r||null===(o=r.customData)||void 0===o||null===(a=o.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var n=[];e.on("timeupdate",function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(we=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),i=e.buffered(),r=0;r<i.length;r++){var o=i.start(r),a=i.end(r);if(Ae(n,o,a)){var l=Math.round(t-a);if(isFinite(l))return l}}})()};var Ae=function(e,n,t){return e>=n&&e<=t},Oe=function(){var e,n=re(),t=(null==n?void 0:n.contentType)||"video";return(null==n||null===(e=n[t])||void 0===e?void 0:e.network)||null};function De(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var t=he.getConfig();if(null==t||!t.disableBeacon){null!=n&&n.userId&&(Te=n.userId);var i=o(e);window.initialise(i,null==n?void 0:n.analyticsCb),window.firstFrame(i,null==n?void 0:n.analyticsCb,null==n?void 0:n.analyticsEventParams),i.on("loadedmetadata",function(){window.endFirstFrame(i)})}}}window.fireEvent=function(){var e=n(t.mark(function e(n){var i,o,a,l,s,d,u,c,v,f,m,p,h,g,y,w,T,_,I,b,E;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$();case 2:return T=e.sent,_=ee(T),I=null==_?void 0:_.site,b=null==_?void 0:_.siteId,e.t0=ye,e.t1=ye,e.t2=ye({aid:I,cid:b,pfm:window.platform},null===(i=window)||void 0===i||null===(o=i.customData)||void 0===o||null===(a=o.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=be(),e.t5=_e(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=null!==(l=n.videoPosition)&&void 0!==l?l:null,e.t10=window.environment,e.t11=n.dp1||"",e.t12=n.dp2||"",e.t13=n.dp3||"",e.t14=n.dp4||"",e.t15=n.dp5||"",e.t16=!0===n.isAdEvent?n.videoPosition:null,e.t17=!0===n.isAdEvent?ke(n.adPosition):"",e.next=26,Ee();case 26:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(s=n.ttFirstFrame)&&void 0!==s?s:null,e.t23=null!==(d=n.bitrate)&&void 0!==d?d:null,e.t24=null!==(u=n.resHeight)&&void 0!==u?u:null,e.t25=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t26=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t27=null!==(f=Oe())&&void 0!==f?f:null,e.t28=null!=I?I:null,e.t29={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26,networkname:e.t27,brandname:e.t28},e.t30=(null==n?void 0:n.duration)&&{duration:n.duration},e.t31=(0,e.t1)(e.t2,e.t3,e.t29,e.t30),e.t32=null===(m=window)||void 0===m||null===(p=m.customData)||void 0===p||null===(h=p.beacon)||void 0===h?void 0:h.params,e.t33=(0,e.t0)(e.t31,e.t32),E=[e.t33],r({url:(null===(g=window)||void 0===g||null===(y=g.customData)||void 0===y||null===(w=y.beacon)||void 0===w?void 0:w.url)||W.get()+k.getBeaconUrl,method:"post",headers:{Authorization:T},contentType:"application/x-www-form-urlencoded",dataType:"text",data:E}).catch(function(e){console.error(e)});case 44:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var Le=function(e,n){var t=new Map;N({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),Y=t}).catch(function(e){return console.log(e)})},Pe=function(){var e=ve.get();return e>=0?e+1:1},Ce=function(){var e,n,t,i=ae(),r=re(),o=null==r||null===(e=r.video)||void 0===e?void 0:e.id,a=ve.get(),l=null==i||null===(n=i[a])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===o});return l>=0?l+1:1};function Fe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function je(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Fe(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Fe(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var Re=u,Ve=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},Ne=function(e){var n=We(e,"video.tags",[]),t=We(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},We=function(e,n,t){for(var i=0,r=(n=n.split(".")).length;i<r;i++){var o;e=null===(o=e)||void 0===o?void 0:o[n[i]]}return e||t},xe=function(){var e,n,t,i,r,a,l,s,d,u,v,f,m,p,h,g,y,w,T,_,I,b,E,S,k,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",O=arguments.length>1?arguments[1]:void 0,D=arguments.length>2?arguments[2]:void 0;if(null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.disableMacros)return A;var L=(null==D?void 0:D.siteName)||(null==D?void 0:D.site)||"",P=(null==D?void 0:D.contentType)||"video",C=(null==D||null===(t=D[P])||void 0===t?void 0:t.metadata)||(null==D||null===(i=D[P])||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.metadata),F=o(O);if(!A.includes("VIEWLIFT_"))return A;var j,R=window.getComputedStyle(document.getElementById(O),null),V=Math.trunc(R.getPropertyValue("height").slice(0,-2)),N=Math.trunc(R.getPropertyValue("width").slice(0,-2)),W="linearchannel"===P?null==D||null===(a=D.linearchannel)||void 0===a||null===(l=a.channels)||void 0===l||null===(s=l.find(function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)}))||void 0===s||null===(d=s.content)||void 0===d?void 0:d.id:We(D,"video.gist.id",""),x="linearchannel"===P?null==D||null===(u=D.linearchannel)||void 0===u||null===(v=u.channels)||void 0===v||null===(f=v.find(function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)}))||void 0===f?void 0:f.title:We(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),U=null,B=null;"function"==typeof window.__gpp&&(null===(j=window)||void 0===j||j.__gpp("ping",function(e){U=null==e?void 0:e.gppString,B=null==e?void 0:e.sectionList[0]}));var M=c.get("us_privacy")||c.get("usprivacy"),H=void 0!==M?M:"1YNN",G=null!==(m=null===(p=JSON.parse(localStorage.getItem("selectedMvpdProvider")||"{}"))||void 0===p?void 0:p.fwIdentifier)&&void 0!==m?m:null,q=je(je({},Ue(C)),{},{VIEWLIFT_WIDTH:N,VIEWLIFT_HEIGHT:V,VIEWLIFT_SIZE:Ve(N,V),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(h=window)||void 0===h?void 0:h.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:We(D,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:We(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:We(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==F||null===(g=F.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==F||null===(y=F.options_)||void 0===y?void 0:y.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==L||"usanetwork"==L?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:Ne(D),VIEWLIFT_MEDIA_ID:W,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(We(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:W,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+We(D,"video.gist.permalink","")),VIEWLIFT_CONSENT:c.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:We(null===(w=window)||void 0===w||null===(T=w.app_data)||void 0===T||null===(_=T.site)||void 0===_?void 0:_.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==L||"usanetwork"==L||"golfchannel"==L?"":We(null===(I=window)||void 0===I||null===(b=I.app_data)||void 0===b||null===(E=b.site)||void 0===E?void 0:E.settings,"compliance.gdpr")?1:0,VIEWLIFT_US_PRIVACY:H,VIEWLIFT_TVE_PROVIDER:G?Re(G):"",VIEWLIFT_CONTENT_DURATION_MS:1e3*We(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:We(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:W,VIEWLIFT_CONTENT_TITLE:x,VIEWLIFT_CONTENT_SERIES_TITLE:We(D,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:We(D,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:Ce(),VIEWLIFT_SEASON_NUMBER:Pe(),VIEWLIFT_CONTENT_TAGS:Ne(D),VIEWLIFT_GPP_SID:B||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:U||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:"",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:""},null===(S=window)||void 0===S||null===(k=S.customData)||void 0===k?void 0:k.macros);for(var Q in q){var Y=new RegExp(Q,"g");A=A.replace(Y,q[Q])}return A},Ue=function(e){var n,t,i,r,o,a,l,d,u,c={},v=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){v.set(e.name,e.value)}));var f=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.subscription)||void 0===i?void 0:i.SVOD)||!1,m=(null===(r=window)||void 0===r||null===(o=r.customData)||void 0===o||null===(a=o.subscription)||void 0===a?void 0:a.TVE)||!1;return f||m?(s()?f?c=je(je({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.dtc.csai")||""}):m&&(c=je(je({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.tve.csai")||""})):f?c=je(je({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.dtc.csai")||""}):m&&(c=je(je({},c),{},{VIEWLIFT_CSID:v.get("csid.web.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.tve.csai")||""})),f?c=je(je({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||"",VIEWLIFT_SFID_CSAI:v.get(s()?"sfid.mweb.dtc.csai":"sfid.web.dtc.csai")||""}):m&&(c=je(je({},c),{},{VIEWLIFT_SFID:v.get("sfid.tve")||v.get("sfid.web.tve")||"",VIEWLIFT_SFID_CSAI:v.get(s()?"sfid.mweb.tve.csai":"sfid.web.tve.csai")||""})),c=s()?je(je({},c),{},{VIEWLIFT_PROF:v.get("prof.mweb")||"",VIEWLIFT_PROF_CSAI:v.get("prof.mweb.csai")||""}):je(je({},c),{},{VIEWLIFT_PROF:v.get("prof.web")||"",VIEWLIFT_PROF_CSAI:v.get("prof.web.csai")||""})):(c=je(je({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||"",VIEWLIFT_SFID_CSAI:v.get(s()?"sfid.mweb.dtc.csai":"sfid.web.dtc.csai")||""}),c=s()?je(je({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:v.get("prof.mweb")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.dtc.csai")||"",VIEWLIFT_PROF_CSAI:v.get("prof.mweb.csai")||""}):je(je({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_PROF:v.get("prof.web")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.dtc.csai")||"",VIEWLIFT_PROF_CSAI:v.get("prof.web.csai")||""})),c=je(je({},c),{},{VIEWLIFT_AFID:v.get("afid"),VIEWLIFT_NIELSEN_APP_ID:We(null===(l=window)||void 0===l||null===(d=l.app_data)||void 0===d||null===(u=d.appcmsMain)||void 0===u?void 0:u.analytics,"nielsen.id")||v.get("VIEWLIFT_NIELSEN_APP_ID")||"",VIEWLIFT_CHANNEL:v.get("VIEWLIFT_CHANNEL")||"",VIEWLIFT_GRACE_NOTE_ID:v.get("VIEWLIFT_GRACE_NOTE_ID")||"",VIEWLIFT_EXTERNAL_AD_ID:v.get("VIEWLIFT_EXTERNAL_AD_ID")||""})},Be=function(e,n){var t,i,r,o,a,l,s,u,c,v,f,m,p,h=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[h])||void 0===t?void 0:t.drmEnabled,y=null==e||null===(i=e[h])||void 0===i||null===(r=i.streamingInfo)||void 0===r?void 0:r.videoAssets,w=null==e||null===(o=e[h])||void 0===o||null===(a=o.streamingInfo)||void 0===a?void 0:a.audioAssets,T=(null==e||null===(l=e[h])||void 0===l||null===(s=l.streamingInfo)||void 0===s||null===(u=s.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(c=e[h])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var _=(null==e||null===(f=e[h])||void 0===f||null===(m=f.streamingInfo)||void 0===m||null===(p=m.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=w&&w.hls)return He(w);if(g){var I=Ge(y,n);return I.src=xe(I.src,n,e),I}if("Safari"!==d()&&_)return Me(y);if(T){var b=He(y);return b.src=xe(b.src,n,e),b}if(null!=y&&y.mpeg){var E=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(y);return E.src=xe(E.src,n,e),E}return null},Me=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},He=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},Ge=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,r=e.fairPlayCmaf||e.fairPlay,a=e.widevine,l=e.playReady,s=d();if(o(n),"Safari"===s){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var r={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(r,function(e,n,i){console.log(e),e&&t(e),t(null,new Uint8Array(i))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,r,o){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:r,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};i.xhr(a,function(e,n,t){console.log(e),e&&o(e),o(null,t)})}}}}}(r);return qe(n),u}var c,v={src:a.url,type:"application/dash+xml"};return"caliente"==(null===(c=window)||void 0===c?void 0:c.siteName)?(qe(n),v.keySystems={"com.widevine.alpha":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==l?void 0:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),v};var qe=function(e){var n=o(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==d()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Qe=function(e,n){var t=e.src,i=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:i};n=n.replace(/\/$/,"");var r=t.split(".com")[1]||"";return{src:r?"".concat(n).concat(r):t,type:i}},Ye=function(e,n){if(import("./error-2395864b.js").then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var i=document.getElementById(e);if(i){var r=document.createElement("div");r.className="error-container";var o=document.createElement("div");o.className="error-message",o.innerHTML="".concat(n),r.appendChild(o),i.append(r)}}},ze=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Ke=!1,Xe=function(e,n,t){var i=xe(n,e,t),r=o(e);if(n&&window.google){if("function"!=typeof r.ima&&"object"!==m(r.ima))return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,i,r,a=o(e);if(null!==a.el_){Ke=!0;var l={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};a.ima.initializeAdDisplayContainer&&a.ima.initializeAdDisplayContainer(),Ke&&null!==a.el_&&("function"==typeof a.ima?a.ima(l):setTimeout(function(){a.ima.setContentWithAdTag(null,n,!0),a.ima.requestAds()},1e3));var s=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&s.hasAttribute("controls")&&s.removeAttribute("controls");var d="click",u=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(u=!0,d="touchend"),a.one(d,function(){u&&a.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.adEventHandler)||null;a.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),a.one("ads-manager",function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})}),n.addEventListener(google.ima.AdEvent.Type.LOADED,function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})})}),a.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,i)}};function Je(e,n){var t,i,r,a=o(e),l=null==a||null===(t=a.controlBar)||void 0===t||null===(i=t.playToggle)||void 0===i?void 0:i.el_,s=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(t){var i,r,o,d,u,c,v,f,m;if(Ze.enabled&&!t.metaKey&&!t.ctrlKey&&"input"!=t.target.localName&&"textarea"!=t.target.localName){var p=t.key,h=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(p)&&(t.preventDefault(),null==s||s.focus()),p){case" ":null==l||l.click();break;case"m":case"M":a.muted(!a.muted());break;case"f":case"F":null===(i=document.querySelector(".vjs-fullscreen-control"))||void 0===i||i.click();break;case"ArrowLeft":h&&!1===n.liveui||Mt(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(o=r.app_data)||void 0===o||null===(d=o.appcmsMain)||void 0===d||null===(u=d.adsConfig)||void 0===u?void 0:u.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(f=v.appcmsMain)&&void 0!==f&&null!==(m=f.adsConfig)&&void 0!==m&&m.vodAdClientSideTracking)return;h||Bt(e,10)}}},!0)}var $e,Ze=($e=!0,{enable:function(){$e=!0},disable:function(){$e=!1},get enabled(){return $e}}),en="ssai-breakStart",nn="ssai-adImpression",tn="ssai-firstQuartile",rn="ssai-midpoint",on="ssai-thirdQuartile",an="ssai-complete",ln="ssai-breakEnd",sn={breakStart:en,impression:nn,firstQuartile:tn,midpoint:rn,thirdQuartile:on,complete:an,breakEnd:ln};function dn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=o(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var i=n.eventType,r=sn[i];r&&t.trigger(r,n)}function un(e){var n=o(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var i=function(e,n){return t(n)};return n.on(e,i),function(){return n.off(e,i)}};return{adBreakStart:function(e){return t(en,e)},adImpression:function(e){return t(nn,e)},adFirstQuartile:function(e){return t(tn,e)},adMidpoint:function(e){return t(rn,e)},adThirdQuartile:function(e){return t(on,e)},adComplete:function(e){return t(an,e)},adBreakEnd:function(e){return t(ln,e)}}}function cn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function vn(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?cn(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):cn(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var fn,mn=(fn={},{get:function(){return fn},set:function(e){fn=e}});function pn(e,n){var t,i,r,a,l,s,d,u,c,v,f,m,p,h,_,I,b,E,S,k,A,O=null==e?void 0:e.playerId,D=o(O);if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var L=re(),P=(null==L||null===(i=L.video)||void 0===i?void 0:i.metadata)||[],C=(null==P?void 0:P.length)&&P.filter(function(e){return"advertisingGenre"===e.name});if(null!==(r=C)&&void 0!==r&&r.length){var F=C.map(function(e){return e.value});C=null==F?void 0:F.join(",")}g();var j,R,V,N=null===(a=window)||void 0===a?void 0:a.lcProgrammeDetails,W=Array.isArray(null==N?void 0:N.category)?null==N||null===(l=N.category)||void 0===l?void 0:l.join(","):(null==N?void 0:N.category)||null,x=vn(vn(vn({},null==L?void 0:L.video),null==L?void 0:L.linearchannel),{},{siteName:(null==e||null===(s=e.comscore)||void 0===s?void 0:s.applicationName)||(null==e||null===(d=e.comscore)||void 0===d||null===(u=d.metadata)||void 0===u?void 0:u.siteName)||(null==L?void 0:L.site)||null,programId:(null==N?void 0:N.videotmsid)||null,programTitle:(null==N?void 0:N.lcProgrammeName)||null,episodeId:(null==N?void 0:N.videotmsid)||null,seasonNumber:(null==L||null===(c=L.video)||void 0===c||null===(v=c.series)||void 0===v?void 0:v.seasonNumber)||(null==N||null===(f=N.seriesDetails)||void 0===f?void 0:f.season)||null,episodeNumber:(null==L||null===(m=L.video)||void 0===m||null===(p=m.series)||void 0===p?void 0:p.episodeNumber)||(null==N||null===(h=N.seriesDetails)||void 0===h?void 0:h.episode)||null,episodeTitle:(null==N?void 0:N.lcSubTitle)||null,isCompleteEpisode:!!(null!=L&&null!==(_=L.video)&&void 0!==_&&_.series||null!=N&&null!==(I=N.seriesDetails)&&void 0!==I&&I.episode),genre:C||W,comscoreConfig:{implementationId:(null==e||null===(b=e.comscore)||void 0===b?void 0:b.implementationId)||null,projectId:(null==e||null===(E=e.comscore)||void 0===E?void 0:E.projectId)||null}}),U=null==e||null===(S=e.comscore)||void 0===S||null===(k=S.metadata)||void 0===k?void 0:k.contentType;if(null!=x&&null!==(A=x.streamingInfo)&&void 0!==A&&A.isLiveStream?x.contentType="Live":x.contentType=U||"LongFormOnDemand",null==x||!x.network){var B,M=(null==x?void 0:x.metadata)||[],H=null==M||null===(B=M.find(function(e){return"network"===e.name}))||void 0===B?void 0:B.value;x.network=H||null}null!=x&&x.network&&null!=x&&x.genre&&(x.customGenre="".concat(x.network,"_").concat((null==x?void 0:x.programTitle)||(j=x,null!=j&&j.series?null==j||null===(V=j.series)||void 0===V?void 0:V.title:null==j||null===(R=j.gist)||void 0===R?void 0:R.title),"_").concat(x.genre)),null!=N&&N.airDate&&(x.publishDate=N.airDate),null!=x&&x.runtime&&"function"==typeof D.duration&&(x.runtime=1e3*Math.ceil(D.duration()));var G=y(x,D);console.log("comscoreOptions player data",G),w(vn({playerName:"Video.js"},G)),T(D)}}function hn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function gn(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?hn(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):hn(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}function yn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return wn(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?wn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function wn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=Array(n);t<n;t++)i[t]=e[t];return i}var Tn,_n=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),In=(Tn=null,{set:function(e){Tn=e},get position(){return Tn}});function bn(e,n){return En.apply(this,arguments)}function En(){return(En=n(t.mark(function e(n,i){var r,a,l,s,d,u,c,v,f,m,p,g,y,w,T,_,I,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o(n),l=Be(i,n),s=l.src,d=(null==i?void 0:i.contentType)||"video",null==i||null===(r=i[d])||void 0===r||null===(a=r.streamingInfo)||void 0===a||a.isLiveStream,u=s.replace("/dash/","/session/").replace("/master/","/session/"),u=xe(u,n,i),c=kn(u),v=h(c,2),f=v[0],m=v[1],p=Sn(m)||{},u=new URL(u.split("?")[0]),Object.keys(m).length>0&&Object.entries(m).forEach(function(e){var n=h(e,2),t=n[0],i=n[1];u.searchParams.set(t,i)}),e.prev=11,e.next=14,fetch(u,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(gn({adsParams:gn({},f)},p))});case 14:return g=e.sent,e.next=17,g.json();case 17:return y=e.sent,w="https://"+new URL(u).hostname,T=y.trackingUrl,_=y.manifestUrl,I=w+T,b=w+_,_n.set(I),console.log("%c TRACKING URL","background: #bdf369; color: #000",I),l.src=b,e.abrupt("return",l);case 29:return e.prev=29,e.t0=e.catch(11),e.abrupt("return",l);case 32:case"end":return e.stop()}},e,null,[[11,29]])}))).apply(this,arguments)}function Sn(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map(function(e){var n=h(e,2),t=n[0],i=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(i)]}))||{}}function kn(e){var n={};if(!e.split("?")[1])return[{},{}];var t,i=new URL(e,window.location.origin),r=yn((null==i?void 0:i.searchParams)||[]);try{for(r.s();!(t=r.n()).done;){var o=h(t.value,2),a=o[0],l=o[1];n[decodeURIComponent(a)]=decodeURIComponent(l||"")}}catch(e){r.e(e)}finally{r.f()}for(var s={},d={},u=0,c=Object.entries(n);u<c.length;u++){var v=h(c[u],2),f=v[0],m=v[1];if(f.startsWith("ads."))s[f.replace(/^ads\./,"")]=m;else d[f]=m}return[s,d]}var An,On,Dn,Ln=new Map;function Pn(e,n){return Cn.apply(this,arguments)}function Cn(){return Cn=n(t.mark(function e(i,r){var l,s,d,u,c,v,f,m,h,g,y,w,T,_,I,b,E,S,k,A,O,D,L,P,C;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:C=function(e,n,t,r,a,l){var s,d,u=o(i);if(!u.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds,e<L&&D.clear(),L=e;var v=(null==n||null===(s=n.ads)||void 0===s||null===(d=s[r])||void 0===d?void 0:d.adId)||c;Math.floor(u.currentTime());var f,m=yn(t);try{var p=function(){var t,o,s,d=f.value,c=d.eventType,m=d.beaconUrls,p=d.startTimeInSeconds,h=d.startTime,g=d.durationInSeconds,y=p||0,w=m,T=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(s=o.ads)||void 0===s?void 0:s.adEventHandler)||null,_="".concat(y,"_").concat(c),I=Ln.get("pod-".concat(a))||[];if(console.warn(e,y,"map:",c,"condition1:",e>=y,"map:",Ln),e>=y&&!I.includes(_)){I.push(_),Ln.set("pod-".concat(a),I);try{P(c,n,w,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,c,n)}if("breakEnd"==c){var b=In.position;In.set(null),setTimeout(function(){null!=b&&(u.currentTime(b),l())},500)}if("function"==typeof T)try{var E,S={eventType:c,startTimeInSeconds:p,startTime:h,durationInSeconds:g,ad:null==n||null===(E=n.ads)||void 0===E?void 0:E[r],adIndex:r};T({adsData:S}),dn(i,S)}catch(e){console.error("Error when calling ads callback:",e)}var k=mn.get();if(k&&0!==Object.keys(k).length){var A=k.formulateComscoreAdPayload,O=k.startComscoreAdTracking,L=k.finishComscoreAdTracking,C=k.endComscoreAdTracking,F="".concat(y,"_").concat(v,"_").concat(c);if(!D.has(F))if(D.set(F,!0),"impression"===c){var j,R=_n.get();O(A(gn(gn({},null==n||null===(j=n.ads)||void 0===j?void 0:j[r]),{},{trackingUrl:R})))}else"complete"===c?L():"breakEnd"===c&&C()}}};for(m.s();!(f=m.n()).done;)p()}catch(e){m.e(e)}finally{m.f()}}},P=function(e,n,t,i){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(i.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(i.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},O=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},Ln.clear(),In.set(r),h=_n.get(),(g=o(i)).one("loadeddata",function(){h&&A(h)}),y=new Map,w=new Map,T=-1,_=(null===(l=document)||void 0===l||null===(s=l.getElementsByClassName("tvProviderImage"))||void 0===s?void 0:s[0])||null,I=(null==g||null===(d=g.controlBar)||void 0===d?void 0:d.getChild("videoSelector"))||null,b=(null==g||null===(u=g.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,E=(null==g||null===(c=g.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===v?void 0:v[0])||null,S=(null==g||null===(f=g.el())||void 0===f||null===(m=f.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===m?void 0:m[0])||null,k=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return p(i);var r=[],o=null==i?void 0:i.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),a=(null==o||null===(e=o.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,l=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],s=null==l||null===(n=l.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),d=(null==s?void 0:s.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!d&&a){var u=null==s?void 0:s.map(function(e){return gn(gn({},e),{},{eventType:"videoView",beaconUrls:[a]})});null!=u&&u[0]&&r.push(null==u?void 0:u[0])}return r},A=function(){var e=n(t.mark(function e(n){var l,s,d,u,c,v,f,m,h,g,A,D,L,P,F,j,R,V,N,W,x,U,B,M;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return W=function(e){document.removeEventListener("pointermove",N),document.removeEventListener("pointerup",W),0===e.button&&R()},N=function(e){},V=function(){var e,n=g.currentTime(),t=null,i=yn(h);try{for(i.s();!(e=i.n()).done;){var r=e.value,o=r.startTimeInSeconds,a=r.durationInSeconds,l=(r.ads,Math.floor(o+a));n>=o&&n<=l&&(t=l,y.set(o,!0))}}catch(e){i.e(e)}finally{i.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){g.currentTime(t+2.2)},100))},R=function(){var e,n=g.currentTime(),t=null,i=yn(h);try{for(i.s();!(e=i.n()).done;){var r=e.value,o=r.startTimeInSeconds,a=r.durationInSeconds,l=r.ads,s=Math.floor(o+a);(Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n>s||n>o)&&!y.has(o)||n>=o&&n<=s)&&(t=o,y.set(o,!0),w.set(o,!0))}}catch(e){i.e(e)}finally{i.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){g.currentTime(t+.4)},100))},c=!1,e.next=7,fetch(n);case 7:return v=e.sent,e.next=10,v.json();case 10:f=e.sent,m=f.avails,h=[],g=o(i),A=g.controlBar.progressControl,D=A.seekBar.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),m.map(function(e,n){var t;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(c=!0),h.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:k(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),!c&&r&&(g.currentTime(r),V()),null!=h&&h.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",h),window.adsQueueList=h,"function"==typeof(j=(null===(L=window)||void 0===L||null===(P=L.customData)||void 0===P||null===(F=P.ads)||void 0===F?void 0:F.onAdBreaksLoaded)||null)&&j(h)),console.log(h,"data"),h.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,i=g.duration();if(!(n>i||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/i*100,o=document.createElement("div");o.className="vjs-seekbar-marker",o.style.left="".concat(r,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="2px",o.style.backgroundColor="#fecc09",o.style.left="".concat(r,"%"),o.style.pointerEvents="none",D.appendChild(o)}}),g._timeUpdateHandler&&g.off("timeupdate",g._timeUpdateHandler),g._timeUpdateHandler=a(function(){var e=g.currentTime();if(e!==T){T=e;for(var n=!1,t=function(){var t=h[i],r=t.startTimeInSeconds,o=t.durationInSeconds,a=t.ads,l=r+o;if(e>=r-1.2&&e<=l+1.2){var s;e>=r&&e<=l&&Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n=!0),e>l&&y.set(r,!0),Ze.disable(),_&&_.classList.add("vjs-hidden"),E&&(E.style.pointerEvents="none",E.classList.add("vjs-hidden")),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),I&&(I.el().style.pointerEvents="none",I.el().classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),A.el().classList.add("hide-progress-bar");for(var d=e-r,u=0,c=0,v=0;v<a.length;v++){var f,m=null==a||null===(f=a[v])||void 0===f?void 0:f.durationInSeconds;if(d<u+m){c=v;break}u+=m}a[c];var g=Math.max(0,o-d),T=Math.round(g);x.style.display="block",M.textContent="".concat(c+1," of ").concat(a.length," • ").concat(O(T));var k=[];return null==a||a.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});k.push.apply(k,p(n))}),(null==t||null===(s=t.podSlotImpressionBeacon)||void 0===s?void 0:s.length)>0&&k.push.apply(k,p(null==t?void 0:t.podSlotImpressionBeacon)),C(e,t,k,c,i,V),"break"}w.delete(r)},i=0;i<h.length;i++){if("break"===t())break}n||(x.style.display="none",A.el().classList.remove("hide-progress-bar"),I&&(I.el().style.pointerEvents="auto",I.el().classList.remove("vjs-hidden")),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),_&&_.classList.remove("vjs-hidden"),E&&(E.style.pointerEvents="auto",E.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),Ze.enable())}},1e3),g.on("timeupdate",g._timeUpdateHandler),null===(s=document)||void 0===s||s.addEventListener("keydown",function(e){Ze.enabled&&"ArrowRight"==e.key&&(R(),Bt(i,10),e.stopPropagation())}),A.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",N),document.addEventListener("pointerup",W))}),null===(d=document)||void 0===d||null===(u=d.querySelectorAll(".ssai-ad-container"))||void 0===u||u.forEach(function(e){return null==e?void 0:e.remove()}),(x=document.createElement("div")).className="ssai-ad-container",(U=document.createElement("div")).className="sponsored-adbox",(B=document.createElement("div")).className="sponsored-text",B.textContent="Sponsored Ad",U.append(B),(M=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",x.append(U),x.append(M),g.el().appendChild(x);case 44:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),D=new Map,L=-1;case 21:case"end":return e.stop()}},e)})),Cn.apply(this,arguments)}function Fn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return jn(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?jn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function jn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=Array(n);t<n;t++)i[t]=e[t];return i}function Rn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Vn(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Rn(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Rn(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var Nn={},Wn=(null===(An=window)||void 0===An||null===(On=An.location)||void 0===On||null===(Dn=On.search)||void 0===Dn?void 0:Dn.includes("debug=true"))||!1,xn=null;function Un(e){return Bn.apply(this,arguments)}function Bn(){return Bn=n(t.mark(function e(i){var r,l,s,d,u,c,v,f,m,h,g,y,w,T,_,I,b,E,S,k,A,O,D,L,P,C,F;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:F=function(e,n,t,r,a){var l,s,d=o(i);if(!d.seeking()){var u=n.startTimeInSeconds;n.durationInSeconds;var c=(null==n||null===(l=n.ads)||void 0===l||null===(s=l[r])||void 0===s?void 0:s.adId)||u;Math.floor(d.currentTime());var v,f=Fn(t);try{for(f.s();!(v=f.n()).done;){var m,p,h,g=v.value,y=g.eventType,w=g.beaconUrls,T=g.startTimeInSeconds,_=g.startTime,I=g.durationInSeconds,b=(g.eventId,T||u),E=w,S=(null===(m=window)||void 0===m||null===(p=m.customData)||void 0===p||null===(h=p.ads)||void 0===h?void 0:h.adEventHandler)||null,k="".concat(c,"_").concat(y),A="pod-".concat(u);L.has(A)||L.set(A,new Set);var O=L.get(A);if(Wn&&console.warn(e,b,"map:",y,"condition1:",e>=b,"map:",L),e>=b&&e<=b+P&&!O.has(k)){O.add(k);try{C(y,n,E,d)}catch(e){console.error("Error when calling triggerAdBeacon:",e,y,n)}if("function"==typeof S)try{var D,F={eventType:y,startTimeInSeconds:T,startTime:_,durationInSeconds:I,ad:null==n||null===(D=n.ads)||void 0===D?void 0:D[r],adIndex:r};S({adsData:F}),dn(i,F)}catch(e){console.error("Error when calling ads callback:",e)}var j=mn.get();if(j&&0!==Object.keys(j).length){var R=j.formulateComscoreAdPayload,V=j.startComscoreAdTracking,N=j.finishComscoreAdTracking,W=j.endComscoreAdTracking;if("impression"===y){var x,U=_n.get();V(R(Vn(Vn({},null==n||null===(x=n.ads)||void 0===x?void 0:x[r]),{},{trackingUrl:U})))}else"complete"===y?N():"breakEnd"===y&&W()}}}}catch(e){f.e(e)}finally{f.f()}}},C=function(e,n,t,i){var r,o,a;"breakEnd"===e&&(null===(r=Nn)||void 0===r?void 0:r.currentAdIndex)+1!=(null===(o=Nn)||void 0===o?void 0:o.totalAds)&&(null==n||null===(a=n.ads)||void 0===a?void 0:a.length)>0||(Wn&&console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(i.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})}))},g=function(){xn&&clearInterval(xn)},m=_n.get(),(h=o(i)).one("loadeddata",function(){g(),xn=setInterval(function(){m&&!h.paused()&&D(m)},2e3)}),h.on("dispose",function(){g()}),y=new Map,w=new Map,T=-1,_=null,I=(null===(r=document)||void 0===r||null===(l=r.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,b=(null==h||null===(s=h.controlBar)||void 0===s?void 0:s.getChild("videoSelector"))||null,E=(null==h||null===(d=h.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,S=(null==h||null===(u=h.el())||void 0===u||null===(c=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,k=(null==h||null===(v=h.el())||void 0===v||null===(f=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===f?void 0:f[0])||null,A=!1,O=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return p(i);var r=[],o=null==i?void 0:i.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),a=(null==o||null===(e=o.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,l=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],s=null==l||null===(n=l.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),d=(null==s?void 0:s.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!d&&a){var u=null==s?void 0:s.map(function(e){return Vn(Vn({},e),{},{eventType:"videoView",beaconUrls:[a]})});null!=u&&u[0]&&r.push(null==u?void 0:u[0])}return r},D=function(){var e=n(t.mark(function e(n){var r,l,s,d,u,c,v,f,m,h,g,D;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return d=new URL(n),_&&d.searchParams.append("nextToken",_),e.next=4,fetch(d.toString(),{method:"GET"});case 4:return u=e.sent,e.next=7,u.json();case 7:c=e.sent,v=c.avails,f=c.nextToken||null,_=f,m=[],h=o(i),g=null==h||null===(r=h.controlBar)||void 0===r?void 0:r.progressControl,D=null==g||null===(l=g.seekBar)||void 0===l?void 0:l.el(),null===(s=document)||void 0===s||s.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),v.map(function(e,n){m.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:O(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),Wn&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",m),null!=m&&m.length&&(window.adsQueueList=m),m.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,i=h.duration();if(!(n>i||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/i*100,o=document.createElement("div");o.className="vjs-seekbar-marker",o.style.left="".concat(r,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="2px",o.style.backgroundColor="#fecc09",o.style.left="".concat(r,"%"),o.style.pointerEvents="none",D.appendChild(o)}}),h._timeUpdateHandler&&h.off("timeupdate",null==h?void 0:h._timeUpdateHandler),h._timeUpdateHandler=a(function(){if(Ht(i)){var e=null==h?void 0:h.currentTime();if(e!==T){T=e;for(var n=function(){var n=m[t],i=n.startTimeInSeconds,r=n.durationInSeconds,o=n.ads,a=i+r;if(e>=i-1.2&&e<=a+1.2){var l;A=!!(e>=i&&e<=a&&Array.isArray(o)&&(null==o?void 0:o.length)>0),e>a&&y.set(i,!0),Ze.disable(),I&&I.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),k&&(k.style.pointerEvents="none",k.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),E&&(E.el().style.pointerEvents="none",E.el().classList.add("vjs-hidden")),g.el().classList.add("hide-progress-bar");for(var s=e-i,d=0,u=0,c=0;c<o.length;c++){var v,f=null==o||null===(v=o[c])||void 0===v?void 0:v.durationInSeconds;if(s<d+f){u=c;break}d+=f}setTimeout(function(){Nn.totalAds=null==o?void 0:o.length,Nn.currentAdIndex=u},1e3);var h=[];return null==o||o.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});h.push.apply(h,p(n))}),(null==n||null===(l=n.podSlotImpressionBeacon)||void 0===l?void 0:l.length)>0&&h.push.apply(h,p(null==n?void 0:n.podSlotImpressionBeacon)),F(e,n,h,u),"break"}w.delete(i)},t=0;t<m.length;t++){if("break"===n())break}A||(Nn={},g.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),E&&(E.el().style.pointerEvents="auto",E.el().classList.remove("vjs-hidden")),I&&I.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),k&&(k.style.pointerEvents="auto",k.classList.remove("vjs-hidden")),Ze.enable())}}},1e3),h.on("timeupdate",h._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),L=new Map,P=2.5;case 22:case"end":return e.stop()}},e)})),Bn.apply(this,arguments)}var Mn=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function Hn(e){return JSON.stringify((e||[]).map(function(e){return{availId:e.availId,startTimeInSeconds:e.startTimeInSeconds,durationInSeconds:e.durationInSeconds,ads:(e.ads||[]).map(function(e){return{adId:e.adId,startTimeInSeconds:e.startTimeInSeconds,durationInSeconds:e.durationInSeconds}})}}))}var Gn=function(){function e(n,t,i,r){_(this,e),this.video_=r,this.ad_=n,this.skipOffset_=function(e){if(!e)return null;var n=new RegExp(Mn.source,"g");n.lastIndex=0;var t=n.exec(e);if(!t)return null;var i=Number(t[1])||0,r=Number(t[2]),o=Number(t[3]),a=Number(t[6])||0;return r>59||o>59?null:a/1e3+o+60*r+3600*i}(null==n?void 0:n.skipOffset),this.adPosition_=t,this.totalAds_=i,this.isSkipped_=!1}return I(e,[{key:"isClientRendering",value:function(){return!1}},{key:"getDuration",value:function(){var e,n;return null!==(e=null===(n=this.ad_)||void 0===n?void 0:n.durationInSeconds)&&void 0!==e?e:0}},{key:"getRemainingTime",value:function(){var e,n,t,i,r,o;return(null!==(e=null===(n=this.ad_)||void 0===n?void 0:n.startTimeInSeconds)&&void 0!==e?e:0)+(null!==(t=null===(i=this.ad_)||void 0===i?void 0:i.durationInSeconds)&&void 0!==t?t:0)-(null!==(r=null===(o=this.video_)||void 0===o?void 0:o.currentTime)&&void 0!==r?r:0)}},{key:"isSkippable",value:function(){return"number"==typeof this.skipOffset_}},{key:"getTimeUntilSkippable",value:function(){if("number"!=typeof this.skipOffset_)return this.getRemainingTime();var e=this.getRemainingTime()+this.skipOffset_-this.getDuration();return Math.max(e,0)}},{key:"canSkipNow",value:function(){return 0===this.getTimeUntilSkippable()}},{key:"skip",value:function(){this.isSkipped_=!0,this.video_&&(this.video_.currentTime+=this.getRemainingTime())}},{key:"isLinear",value:function(){return!0}},{key:"getSequenceLength",value:function(){return this.totalAds_||1}},{key:"getPositionInSequence",value:function(){return this.adPosition_||1}},{key:"getTitle",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.adTitle)||""}},{key:"getVastAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.vastAdId)||""}},{key:"getAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.adId)||""}},{key:"getCreativeAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.creativeId)||""}},{key:"getTimeOffset",value:function(){var e,n;return null!==(e=null===(n=this.ad_)||void 0===n?void 0:n.startTimeInSeconds)&&void 0!==e?e:0}},{key:"release",value:function(){this.ad_=null,this.adPosition_=null,this.totalAds_=null}},{key:"isSkipped",value:function(){return this.isSkipped_}}]),e}(),qn="impression",Qn="start",Yn="mute",zn="unmute",Kn="resume",Xn="pause",Jn="firstQuartile",$n="midpoint",Zn="thirdQuartile",et="complete",nt="skip",tt="breakStart",it="breakEnd",rt="skipStateChanged",ot="ad_impression",at="ad_started",lt="ad_muted",st="ad_volume_changed",dt="ad_resumed",ut="ad_paused",ct="ad_first_quartile",vt="ad_midpoint",ft="ad_third_quartile",mt="ad_complete",pt="ad_stopped",ht="ad_skipped",gt="ad_skip_state_changed",yt="ad_break_started",wt="ad_break_ended",Tt="ads_loaded",_t="ad_cuepoints_changed";function It(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function bt(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?It(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):It(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}function Et(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return St(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?St(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function St(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=Array(n);t<n;t++)i[t]=e[t];return i}var kt="[Transmit]";function At(e){var n,t,i;if(null==e)return{avails:[],nextToken:null,dashAvailabilityStartTime:null};var r=null!==(n=e.dashAvailabilityStartTime)&&void 0!==n?n:null,o=null!==(t=e.nextToken)&&void 0!==t?t:null,a=[];if(Array.isArray(e.avails))a=e.avails;else if(Array.isArray(e)){var l,s,d,u,c=e[0];if(c&&Array.isArray(c.avails))a=c.avails,r=null!==(l=null!==(s=r)&&void 0!==s?s:c.dashAvailabilityStartTime)&&void 0!==l?l:null,o=null!==(d=null!==(u=o)&&void 0!==u?u:c.nextToken)&&void 0!==d?d:null;else a=e}else if(Array.isArray(null==e||null===(i=e.data)||void 0===i?void 0:i.avails)){var v,f,m,p;a=e.data.avails,o=null!==(v=null!==(f=o)&&void 0!==f?f:e.data.nextToken)&&void 0!==v?v:null,r=null!==(m=null!==(p=r)&&void 0!==p?p:e.data.dashAvailabilityStartTime)&&void 0!==m?m:null}else Array.isArray(null==e?void 0:e.data)&&(a=e.data);return{avails:a,nextToken:o,dashAvailabilityStartTime:r}}var Ot=function(){function e(n,t,i){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};_(this,e),this.video_=n,this.player_=t,this.onEvent_="function"==typeof i?i:function(){},this.dashManifestUrl_=o.dashManifestUrl||null,this.config_=null,this.trackingUrl_="",this.firstTrackingRequest_=!0,this.nextToken_=null,this.dashAvailabilityStartTime_=0,this.dashAvailabilityStartTimeResolved_=!1,this.pollIntervalMs_=2e3,this.pollId_=null,this.adBreaks_=[],this.ad_=null,this.transmitAd_=null,this.transmitAdBreak_=null,this.eventsSent_=new Set,this.firedBeacons_=new Set,this.adBreakListenersAttached_=!1,this.globalListeners_=[],this.adListeners_=[],this.videoTimeupdate_=null,this.lastMutedForAd_=null,this.onDispose_=function(){return r.release()},this.apiTimelineAbsolute_=!1}var i,r,o;return I(e,[{key:"configure",value:function(e){this.config_=e}},{key:"addTrackingUrl",value:function(e){this.trackingUrl_=e||"",this.onEvent_({type:Tt,loadTime:0})}},{key:"getCuePoints",value:function(){var e,n=new Map,t=Et(this.adBreaks_);try{for(t.s();!(e=t.n()).done;){var i,r=Et(e.value.ads||[]);try{for(r.s();!(i=r.n()).done;){var o=i.value,a=o.startTimeInSeconds,l=a+o.durationInSeconds;if(isFinite(a)&&isFinite(l)&&!(l<=a)){var s="".concat(a.toFixed(1),"|").concat(l.toFixed(1));n.has(s)||n.set(s,{start:a,end:l})}}}catch(e){r.e(e)}finally{r.f()}}}catch(e){t.e(e)}finally{t.f()}return Array.from(n.values()).sort(function(e,n){return e.start-n.start})}},{key:"onManifestUpdated",value:function(){this.trackingUrl_&&(this.requestTrackingInfo_(this.firstTrackingRequest_),this.firstTrackingRequest_=!1,this.ensurePolling_())}},{key:"stop",value:function(){this.onEnded_(),this.detachAllListeners_(),this.eventsSent_.clear(),this.firedBeacons_.clear(),this.trackingUrl_="",this.firstTrackingRequest_=!0,this.nextToken_=null,this.dashAvailabilityStartTime_=0,this.dashAvailabilityStartTimeResolved_=!1,this.apiTimelineAbsolute_=!1,this.adBreaks_=[],this.adBreakListenersAttached_=!1,this.pollId_&&(clearInterval(this.pollId_),this.pollId_=null)}},{key:"release",value:function(){this.stop()}},{key:"ensurePolling_",value:function(){var e=this;this.pollId_||(this.pollId_=setInterval(function(){var n,t;e.trackingUrl_&&(null!==(n=e.player_)&&void 0!==n&&null!==(t=n.paused)&&void 0!==t&&t.call(n)||e.requestTrackingInfo_(!1))},this.pollIntervalMs_))}},{key:"requestTrackingInfo_",value:(o=n(t.mark(function e(n){var i,r,o,a,l,s,d,u,c,v,f,m,p,h,g,y,w;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,r=new Map,o=0,a=null;case 4:if(!(o<10)){e.next=25;break}return l=new URL(this.trackingUrl_),this.nextToken_&&l.searchParams.set("nextToken",this.nextToken_),e.next=9,fetch(l.toString(),{method:"GET"});case 9:return s=e.sent,e.next=12,s.json();case 12:d=e.sent,o++,(u=At(d)).dashAvailabilityStartTime&&!a&&(a=u.dashAvailabilityStartTime),c=Et(u.avails);try{for(c.s();!(v=c.n()).done;)f=v.value,m=(null==f?void 0:f.availId)||"".concat(null==f?void 0:f.startTimeInSeconds),r.set(m,f)}catch(e){c.e(e)}finally{c.f()}if((p=u.nextToken||null)&&p!==this.nextToken_){e.next=22;break}return this.nextToken_=p,e.abrupt("break",25);case 22:this.nextToken_=p,e.next=4;break;case 25:if(h=Array.from(r.values()),this.updateApiTimelineAbsoluteFlag_(h),g=(null==h||null===(i=h[0])||void 0===i?void 0:i.startTimeInSeconds)||0,this.apiTimelineAbsolute_){e.next=33;break}return e.next=31,this.resolveDashAvailabilityStartTime_(a,g);case 31:e.next=35;break;case 33:this.dashAvailabilityStartTimeResolved_=!0,this.dashAvailabilityStartTime_=0;case 35:h.length?(y=this.normalizeAvails_(h),Hn(this.adBreaks_)!==Hn(y)&&(this.adBreaks_=y,w=this.getCuePoints(),this.onEvent_({type:_t,cuepoints:w}))):this.adBreaks_.length&&(this.onEvent_({type:_t,cuepoints:[]}),this.onEnded_(),this.adBreaks_=[]),n&&this.setupAdBreakListeners_(),e.next=42;break;case 39:e.prev=39,e.t0=e.catch(0),console.warn(kt,"tracking info fetch failed",e.t0);case 42:case"end":return e.stop()}},e,this,[[0,39]])})),function(e){return o.apply(this,arguments)})},{key:"updateApiTimelineAbsoluteFlag_",value:function(e){this.apiTimelineAbsolute_=!1;var n,t=1e6,i=Et(e||[]);try{for(i.s();!(n=i.n()).done;){var r,o=n.value;if((null!==(r=null==o?void 0:o.startTimeInSeconds)&&void 0!==r?r:0)>t)return void(this.apiTimelineAbsolute_=!0);var a,l=Et((null==o?void 0:o.ads)||[]);try{for(l.s();!(a=l.n()).done;){var s,d=a.value;if((null!==(s=null==d?void 0:d.startTimeInSeconds)&&void 0!==s?s:0)>t)return void(this.apiTimelineAbsolute_=!0)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){i.e(e)}finally{i.f()}}},{key:"normalizeAvails_",value:function(e){var n=this,t=this.apiTimelineAbsolute_?0:this.dashAvailabilityStartTime_||0;return e.map(function(e){var i=n.resolveAbsoluteStart_(e,t,null);return bt(bt({},e),{},{startTimeInSeconds:i,ads:(e.ads||[]).map(function(r){return bt(bt({},r),{},{startTimeInSeconds:n.resolveAbsoluteStart_(r,t,e,i)})})})})}},{key:"resolveAbsoluteStart_",value:function(e,n,t,i){var r=null==e?void 0:e.adProgramDateTime;if(r){var o=new Date(r).getTime()/1e3;if(isFinite(o)&&o>0)return o}return null!=t&&t.adProgramDateTime&&"number"==typeof i?i+((e.startTimeInSeconds||0)-(t.startTimeInSeconds||0)):(e.startTimeInSeconds||0)+n}},{key:"resolveDashAvailabilityStartTime_",value:(r=n(t.mark(function e(n,i){var r,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.dashAvailabilityStartTimeResolved_){e.next=2;break}return e.abrupt("return");case 2:if(!n){e.next=8;break}if(r=new Date(n).getTime()/1e3,!(isFinite(r)&&r>0)){e.next=8;break}return this.dashAvailabilityStartTime_=r,this.dashAvailabilityStartTimeResolved_=!0,e.abrupt("return");case 8:if(!(i>0)){e.next=13;break}return e.next=11,this.fetchDashAvailabilityStartTimeFromMpd_();case 11:(o=e.sent)>0&&(this.dashAvailabilityStartTime_=o,this.dashAvailabilityStartTimeResolved_=!0);case 13:case"end":return e.stop()}},e,this)})),function(e,n){return r.apply(this,arguments)})},{key:"fetchDashAvailabilityStartTimeFromMpd_",value:(i=n(t.mark(function e(){var n,i,r,o,a,l;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,(i=this.dashManifestUrl_||this.getCurrentSourceUrl_())&&i.includes(".mpd")){e.next=4;break}return e.abrupt("return",0);case 4:return e.next=6,fetch(i);case 6:return r=e.sent,e.next=9,r.text();case 9:return o=e.sent,a=(new DOMParser).parseFromString(o,"application/xml"),l=null===(n=a.querySelector("MPD"))||void 0===n?void 0:n.getAttribute("availabilityStartTime"),e.abrupt("return",l?new Date(l).getTime()/1e3:0);case 15:return e.prev=15,e.t0=e.catch(0),console.warn(kt,"MPD availabilityStartTime parse failed",e.t0),e.abrupt("return",0);case 19:case"end":return e.stop()}},e,this,[[0,15]])})),function(){return i.apply(this,arguments)})},{key:"getCurrentSourceUrl_",value:function(){try{var e,n,t,i,r=(null===(e=this.player_)||void 0===e||null===(n=e.currentSrc)||void 0===n?void 0:n.call(e))||(null===(t=this.player_)||void 0===t||null===(i=t.src)||void 0===i?void 0:i.call(t));return"string"==typeof r?r:(null==r?void 0:r.src)||""}catch(e){return""}}},{key:"setupAdBreakListeners_",value:function(){var e=this;if(!this.adBreakListenersAttached_){this.adBreakListenersAttached_=!0,this.onTimeupdate_();this.attachGlobalListener_("timeupdate",function(){return e.onTimeupdate_()}),this.attachGlobalListener_("dispose",this.onDispose_),this.video_&&(this.videoTimeupdate_=function(){return e.onTimeupdate_()},this.video_.addEventListener("timeupdate",this.videoTimeupdate_))}}},{key:"isHlsSource_",value:function(){var e,n,t=this.getCurrentSourceUrl_().toLowerCase(),i=((null===(e=this.player_)||void 0===e||null===(n=e.currentType)||void 0===n?void 0:n.call(e))||"").toLowerCase();return t.includes(".m3u8")||"application/x-mpegurl"===i||"application/vnd.apple.mpegurl"===i}},{key:"isDashSource_",value:function(){var e,n,t=this.getCurrentSourceUrl_().toLowerCase();return"application/dash+xml"===((null===(e=this.player_)||void 0===e||null===(n=e.currentType)||void 0===n?void 0:n.call(e))||"").toLowerCase()||t.includes(".mpd")}},{key:"getDashMediaPlayerTimelineSeconds_",value:function(){try{var e,n,t=null===(e=this.player_)||void 0===e||null===(n=e.dash)||void 0===n?void 0:n.mediaPlayer;if(!t||"function"!=typeof t.time)return null;var i=t.time();return"number"==typeof i&&isFinite(i)&&i>1e6?i:null}catch(e){return null}}},{key:"getCurrentTime_",value:function(){var e,n,t,i=null!==(e=null===(n=this.video_)||void 0===n?void 0:n.currentTime)&&void 0!==e?e:0,r=d();if(this.isHlsSource_()){var o,a,l=i,s=null===(o=this.player_)||void 0===o||null===(a=o.seekable)||void 0===a?void 0:a.call(o);return s&&s.length>0&&(l=s.end(s.length-1)),Date.now()/1e3-(l-i)}if(this.isDashSource_()){var u,c,v,f=this.getDashMediaPlayerTimelineSeconds_();if(null!=f)return f;var m=null===(u=this.player_)||void 0===u||null===(c=u.seekable)||void 0===c?void 0:c.call(u),p="function"==typeof(null===(v=this.player_)||void 0===v?void 0:v.currentTime)?this.player_.currentTime():i;if(m&&m.length>0){var h=m.start(0);if(h>1e6&&h+p>1e6)return h+p}if(this.apiTimelineAbsolute_&&(this.dashAvailabilityStartTime_||0)>1e9)return(this.dashAvailabilityStartTime_||0)+p}return"Safari"===r?i:"function"==typeof(null===(t=this.player_)||void 0===t?void 0:t.currentTime)?this.player_.currentTime():i}},{key:"onTimeupdate_",value:function(){if(this.ad_||this.adBreaks_.length){var e=this.getCurrentTime_();if(this.ad_){var n,t;this.sendInProgressEvents_(e,this.transmitAd_);var i=this.ad_.getDuration(),r=(null!==(n=null===(t=this.transmitAd_)||void 0===t?void 0:t.startTimeInSeconds)&&void 0!==n?n:0)+i,o=r-e;this.ad_.canSkipNow()&&o>0&&i>0&&this.sendTrackingEvent_(rt),i>0&&e>=r&&this.onEnded_()}this.ad_||this.checkLinearAds_(e)}}},{key:"sendInProgressEvents_",value:function(e,n){if(n){var t=n.startTimeInSeconds+.25*n.durationInSeconds,i=n.startTimeInSeconds+.5*n.durationInSeconds,r=n.startTimeInSeconds+.75*n.durationInSeconds;e>=t&&!this.eventsSent_.has(Jn)&&(this.eventsSent_.add(Jn),this.sendTrackingEvent_(Jn)),e>=i&&!this.eventsSent_.has($n)&&(this.eventsSent_.add($n),this.sendTrackingEvent_($n)),e>=r&&!this.eventsSent_.has(Zn)&&(this.eventsSent_.add(Zn),this.sendTrackingEvent_(Zn))}}},{key:"flushPendingQuartiles_",value:function(){for(var e=0,n=[Jn,$n,Zn];e<n.length;e++){var t=n[e];this.eventsSent_.has(t)||(this.eventsSent_.add(t),this.sendTrackingEvent_(t))}}},{key:"checkLinearAds_",value:function(e){var n,t=Et(this.adBreaks_);try{for(t.s();!(n=t.n()).done;){var i=n.value;if(this.ad_)break;for(var r=i.ads||[],o=0;o<r.length;o++){var a=r[o],l=a.startTimeInSeconds,s=l+a.durationInSeconds;if(l<=e&&s>e){this.onEnded_(),this.transmitAdBreak_=i,this.transmitAd_=a,this.ad_=new Gn(a,o+1,r.length,this.video_),0===o&&this.sendTrackingEvent_(tt),this.setupCurrentAdListeners_();break}}}}catch(e){t.e(e)}finally{t.f()}}},{key:"onEnded_",value:function(){this.ad_&&this.transmitAd_&&(this.ad_.isSkipped()||this.flushPendingQuartiles_(),this.removeCurrentAdListeners_(this.ad_.isSkipped()),this.ad_.getPositionInSequence()===this.ad_.getSequenceLength()&&this.sendTrackingEvent_(it),this.ad_=null,this.transmitAd_=null,this.transmitAdBreak_=null)}},{key:"setupCurrentAdListeners_",value:function(){var e,n,t,i,r,o=this,a=!1;null!==(e=this.player_)&&void 0!==e&&null!==(n=e.paused)&&void 0!==n&&n.call(e)?a=!0:(this.sendTrackingEvent_(qn),this.sendTrackingEvent_(Qn)),this.lastMutedForAd_=null!==(t=null===(i=this.player_)||void 0===i||null===(r=i.muted)||void 0===r?void 0:r.call(i))&&void 0!==t&&t,this.attachAdListener_("volumechange",function(){var e,n,t,i=null!==(e=null===(n=o.player_)||void 0===n||null===(t=n.muted)||void 0===t?void 0:t.call(n))&&void 0!==e&&e;i!==o.lastMutedForAd_&&(o.lastMutedForAd_=i,i?o.sendTrackingEvent_(Yn):o.sendTrackingEvent_(zn))}),this.attachAdListener_("play",function(){a?(o.sendTrackingEvent_(qn),o.sendTrackingEvent_(Qn),a=!1):o.sendTrackingEvent_(Kn)}),this.attachAdListener_("pause",function(){o.sendTrackingEvent_(Xn)})}},{key:"removeCurrentAdListeners_",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.sendTrackingEvent_(e?nt:et),this.detachAdListeners_(),this.eventsSent_.clear()}},{key:"attachGlobalListener_",value:function(e,n){this.player_&&(this.player_.on(e,n),this.globalListeners_.push({event:e,handler:n}))}},{key:"attachAdListener_",value:function(e,n){this.player_&&(this.player_.on(e,n),this.adListeners_.push({event:e,handler:n}))}},{key:"detachAdListeners_",value:function(){var e,n=Et(this.adListeners_);try{for(n.s();!(e=n.n()).done;){var t,i,r=e.value,o=r.event,a=r.handler;null===(t=this.player_)||void 0===t||null===(i=t.off)||void 0===i||i.call(t,o,a)}}catch(e){n.e(e)}finally{n.f()}this.adListeners_=[]}},{key:"detachAllListeners_",value:function(){this.detachAdListeners_();var e,n=Et(this.globalListeners_);try{for(n.s();!(e=n.n()).done;){var t,i,r=e.value,o=r.event,a=r.handler;null===(t=this.player_)||void 0===t||null===(i=t.off)||void 0===i||i.call(t,o,a)}}catch(e){n.e(e)}finally{n.f()}this.globalListeners_=[],this.video_&&this.videoTimeupdate_&&(this.video_.removeEventListener("timeupdate",this.videoTimeupdate_),this.videoTimeupdate_=null)}},{key:"startComscoreForCurrentAd_",value:function(){try{var e=mn.get();if(!e||0===Object.keys(e).length)return;var n=e.formulateComscoreAdPayload,t=e.startComscoreAdTracking,i=_n.get();t(n(bt(bt({},this.transmitAd_),{},{trackingUrl:i})))}catch(e){console.warn(kt,"comscore start failed",e)}}},{key:"sendTrackingEvent_",value:function(e){var n,t=this;if(this.transmitAd_&&this.transmitAdBreak_){var i=(this.transmitAd_.trackingEvents||[]).find(function(n){return n.eventType===e});if(i||(i=(this.transmitAdBreak_.adBreakTrackingEvents||[]).find(function(n){return n.eventType===e})),i&&(null===(n=this.config_)||void 0===n||!n.disableTrackingEvents)){var r,o,a,l=(null===(r=this.transmitAd_)||void 0===r?void 0:r.adId)||(null===(o=this.transmitAdBreak_)||void 0===o?void 0:o.availId)||"unknown",s=Et(i.beaconUrls||[]);try{var d=function(){var n=a.value;if(!n)return"continue";var i="".concat(l,"|").concat(e,"|").concat(n);if(t.firedBeacons_.has(i))return"continue";t.firedBeacons_.add(i),fetch(n,{mode:"no-cors"}).catch(function(e){console.warn(kt,"beacon failed",n,e)})};for(s.s();!(a=s.n()).done;)d()}catch(e){s.e(e)}finally{s.f()}}var u=mn.get(),c=u&&Object.keys(u).length?u:null;switch(e){case qn:this.onEvent_({type:ot}),this.startComscoreForCurrentAd_();break;case Qn:this.onEvent_({type:at,ad:this.ad_});break;case Yn:this.onEvent_({type:lt});break;case zn:this.onEvent_({type:st});break;case Kn:this.onEvent_({type:dt});break;case Xn:this.onEvent_({type:ut});break;case Jn:this.onEvent_({type:ct});break;case $n:this.onEvent_({type:vt});break;case Zn:this.onEvent_({type:ft});break;case et:this.onEvent_({type:mt}),this.onEvent_({type:pt}),null!=c&&c.finishComscoreAdTracking&&c.finishComscoreAdTracking();break;case nt:this.onEvent_({type:ht}),this.onEvent_({type:pt});break;case tt:this.onEvent_({type:yt});break;case it:this.onEvent_({type:wt}),null!=c&&c.endComscoreAdTracking&&c.endComscoreAdTracking();break;case rt:this.onEvent_({type:gt})}}else console.warn(kt,"sendTrackingEvent_ skipped — no active ad",{eventType:e})}}]),e}();function Dt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Lt(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Dt(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Dt(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var Pt={dash:"tracking/initialize/dash",hls:"tracking/initialize/hls"};function Ct(e){if(null==e||!e.src)return null;var n=(e.type||"").toLowerCase(),t=String(e.src).toLowerCase();return"application/dash+xml"===n||t.includes(".mpd")?"dash":"application/x-mpegurl"===n||"application/vnd.apple.mpegurl"===n||t.includes(".m3u8")?"hls":null}function Ft(e,n,t){return jt.apply(this,arguments)}function jt(){return(jt=n(t.mark(function e(n,i,r){var o,a,l,s,d,u,c,v,f,m,p;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=Ct(n)){e.next=3;break}return e.abrupt("return",n);case 3:return a=xe(n.src,r,i),l=a.replace(o,Pt[o]),console.log("[Transmit] session init →",l),e.prev=6,e.next=9,fetch(l,{method:"GET",redirect:"follow"});case 9:return s=e.sent,e.next=12,s.json();case 12:if(d=e.sent,console.log("[Transmit] session response",d),u="dash"===o?null==d?void 0:d.dashUrl:null==d?void 0:d.hlsUrl,c=null==d?void 0:d.trackingUrl,u&&c){e.next=18;break}return e.abrupt("return",n);case 18:return v=new URL(l),f=v.hostname,m="https://".concat(f).concat(u),p="https://".concat(f).concat(c),_n.set(p),console.log("[Transmit] session ready",{manifestUrl:m,trackingUrl:p}),e.abrupt("return",Lt(Lt({},n),{},{src:m}));case 26:return e.prev=26,e.t0=e.catch(6),console.warn("[Transmit] session init failed",e.t0),e.abrupt("return",n);case 30:case"end":return e.stop()}},e,null,[[6,26]])}))).apply(this,arguments)}var Rt=null;function Vt(e,n){var t;if(Rt)return console.log("[Transmit] initializeTransmit skipped — manager already initialised"),Rt;var i=_n.get();if(!i)return console.warn("[Transmit] initializeTransmit skipped — no tracking URL"),null;var r=o(e);if(!r)return console.warn("[Transmit] initializeTransmit skipped — no player"),null;var a=(null===(t=r.el())||void 0===t?void 0:t.querySelector("video"))||null,l=function(e){try{var n="function"==typeof(null==e?void 0:e.currentSrc)&&e.currentSrc()||"function"==typeof(null==e?void 0:e.src)&&e.src()||"";if("application/dash+xml"===("function"==typeof(null==e?void 0:e.currentType)&&e.currentType()||"")||String(n).includes(".mpd"))return n}catch(e){}return null}(r);return(Rt=new Ot(a,r,function(e){var t,i;console.log("[Transmit] ad event",e);var r=null==n||null===(t=n.customData)||void 0===t||null===(i=t.ads)||void 0===i?void 0:i.adEventHandler;if("function"==typeof r)try{r(e)}catch(e){console.warn("[Transmit] adEventHandler threw",e)}},{dashManifestUrl:l})).configure({disableTrackingEvents:!1}),Rt.addTrackingUrl(i),Rt.onManifestUpdated(),Rt}function Nt(){Rt&&(Rt.release(),Rt=null)}function Wt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}var xt=function(e){i(e).play()},Ut=function(e){i(e).pause()},Bt=function(e,n){var t=i(e),r=t.currentTime()+n;t.currentTime(r)},Mt=function(e,n){var t=i(e),r=t.currentTime(),o=r<=n?0:r-n;t.currentTime(o)},Ht=function(e){return!!i.getPlayer("".concat(e))},Gt=function(e){return i(e).paused()},qt=function(){var e=n(t.mark(function e(i,r){var a,l,s,d=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=d.length>2&&void 0!==d[2]&&d[2],e.next=3,$();case 3:return l=e.sent,s=o(i),e.abrupt("return",new Promise(function(e,o){F(r,l).then(function(){var o=n(t.mark(function n(o){var l,d,u,c,v,f,m,p,h,g,y;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(Nt(),f=null==o?void 0:o.data,window.sid=Ie(),f.contentType="linearchannel",f.channelId=null==r?void 0:r.channelId,m=(null===(l=window.customData)||void 0===l?void 0:l.ads)||(null===(d=window)||void 0===d||null===(u=d.app_data)||void 0===u||null===(c=u.appcmsMain)||void 0===c?void 0:c.adsConfig)||{},p=!(null==f||null===(v=f.linearchannel)||void 0===v||!v.isSSAIEnabled),h=p&&"MEDIA_TAILOR"==(null==m?void 0:m.vodAdSticherProvider),g=p&&"TRANSMIT"==(null==m?void 0:m.liveAdSticherProvider)&&!(null==m||!m.liveAdClientSideTracking),y=Be(f,i),!h){n.next=17;break}return n.next=13,bn(i,f);case 13:y=n.sent,a=!0,n.next=22;break;case 17:if(!g){n.next=22;break}return n.next=20,Ft(y,f,i);case 20:y=n.sent,a=!0;case 22:ie(f),y&&a?(Xt(i,y),g?Vt(i,{customData:window.customData||{ads:m}}):h&&Un(i),s.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:f})})):(mn.get()&&0!==Object.keys(mn.get()).length&&pn({playerId:i,comscore:{enable:!0}}),e({status:!0,msg:"Feed authenticated",response:f}));case 24:case"end":return n.stop()}},n)}));return function(e){return o.apply(this,arguments)}}()).catch(function(e){o({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Qt=function(){var e=n(t.mark(function e(i,r,a){var l,s,d,u,c,m,p;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$();case 2:return u=e.sent,console.log("load video"),(ae()||null)&&ce(r),c=0,m=0,p=null,null!==(l=window)&&void 0!==l&&l.watchHistory&&null!==(s=window)&&void 0!==s&&null!==(d=s.watchHistory)&&void 0!==d&&d.enable&&V(r,u).then(function(e){var n,t,i,r,o,a,l;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),c=(null==e||null===(o=e.data)||void 0===o?void 0:o.watchedTime)||null,(m=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null)<95)&&(p=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null)}).catch(function(e){var n,t,i,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(e))}),e.abrupt("return",new Promise(function(e,a){C(r,u).then(function(){var r=n(t.mark(function n(r){var l,s,d,u,h,g,y,w,T,_,I,b,E,S,k,A,O,D,L,P,C,F,j,R,V,N,W,x,U,B,M,H,G,q,Q,Y,z,K,X,J,$;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(A=null==r?void 0:r.data,O=(null==A?void 0:A.contentType)||"video",D=(null===(l=window.customData)||void 0===l?void 0:l.ads)||(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(u=d.appcmsMain)||void 0===u?void 0:u.adsConfig)||{},L=!(null==A||null===(h=A[O])||void 0===h||!h.isSSAIEnabled),P=L&&"MEDIA_TAILOR"==(null==D?void 0:D.vodAdSticherProvider),C=L&&"TRANSMIT"==(null==D?void 0:D.liveAdSticherProvider)&&!(null==D||!D.liveAdClientSideTracking),F=!(null==A||null===(g=A[O])||void 0===g||null===(y=g.streamingInfo)||void 0===y||!y.isLiveStream)||"linearchannel"===O,ie(r.data),(j=(null==A||null===(w=A.ads)||void 0===w||null===(T=w.preRoll)||void 0===T||null===(_=T.adTags)||void 0===_||null===(I=_.web)||void 0===I?void 0:I.active)&&(null==A||null===(b=A.ads)||void 0===b||null===(E=b.preRoll)||void 0===E||null===(S=E.adTags)||void 0===S||null===(k=S.web)||void 0===k?void 0:k.url))&&Xe(i,j,A),R=Be(A,i),!P){n.next=17;break}return n.next=14,bn(i,A);case 14:R=n.sent,n.next=22;break;case 17:if(!C||!F){n.next=22;break}return Nt(),n.next=21,Ft(R,A,i);case 21:R=n.sent;case 22:R?(Q=(null==A||null===(V=A.video)||void 0===V||null===(N=V.gist)||void 0===N?void 0:N.videoImageUrl)||(null==A||null===(W=A.video)||void 0===W||null===(x=W.gist)||void 0===x||null===(U=x.imageGist)||void 0===U?void 0:U.r16x9),(Y=o(i)).poster(Q),Xt(i,R),C&&F?Vt(i,{customData:window.customData||{ads:D}}):P&&Pn(i,p),Y.on("loadstart",function(){F&&e({status:!0,msg:"Video Loaded",response:A})}),Y.on("loadeddata",function(){ze(),e({status:!0,msg:"Video Loaded",response:A})}),Y.one("play",function(){!c||P||C&&F||m<95&&setTimeout(function(){Y.currentTime(c)},0)}),Y.one("error",function(){var e;a({status:!1,msg:(null==Y||null===(e=Y.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==A||null===(B=A.video)||void 0===B||null===(M=B.contentDetails)||void 0===M||null===(H=M.closedCaptions)||void 0===H?void 0:H.length)>0||(null==A||null===(G=A.video)||void 0===G||null===(q=G.closedCaptions)||void 0===q?void 0:q.length)>0?($=(null==A||null===(K=A.video)||void 0===K||null===(X=K.contentDetails)||void 0===X?void 0:X.closedCaptions)||(null==A||null===(J=A.video)||void 0===J?void 0:J.closedCaptions),z=$.filter(function(e){return"VTT"===e.format}),v(i,z)):f(i)):(Ye(i,"Incompatible Source, only hls,mp4,drm content is allowed"),a("Incompatible Source, only hls,mp4,drm content is allowed"));case 23:case"end":return n.stop()}},n)}));return function(e){return r.apply(this,arguments)}}()).catch(function(e){Jt(e,i,a,r)})}));case 11:case"end":return e.stop()}},e)}));return function(n,t,i){return e.apply(this,arguments)}}(),Yt=function(e,n,t){var i=o(e);return i.src(n),new Promise(function(e,n){var r=0;i.one("loadedmetadata",function(){clearTimeout(r),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){r=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},zt=function(e){Nt();var n=o(e),t=(mn.get()||{}).destroyComscoreTag;if(Kt(),t&&t(),l(),window.onresize=null,n)n.dispose();else{var i=document.getElementById(e);i&&i.remove()}},Kt=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},Xt=function(e,n){console.log("load video in core",n);var t=o(e);t&&t.src(n)},Jt=function(n,t,i,r){var o,a,l,s,d,u,c=null==n||null===(o=n.response)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(s=l.data)||void 0===s?void 0:s.errorMessage)||(null==n?void 0:n.message);Ht(t)&&Ye(t,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[c])||"".concat(v)),i&&i(function(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Wt(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Wt(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}({status:!1,response:n,msg:"".concat(v)},r&&{videoId:r}))},$t=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var i=n.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var r=n.getElementsByClassName("vjs-fullscreen-control")[0];r&&(r.style.display="none")};export{Gt as $,Jt as A,$ as B,F as C,j as D,Le as E,ve as F,oe as G,Yt as H,Bt as I,xt as J,Ut as K,Mt as L,Qt as M,qt as N,zt as O,x as P,un as Q,ne as R,W as S,he as T,Z as U,M as V,U as W,E as X,Ln as Y,Je as Z,le as _,Ce as a,se as a0,Vt as a1,Un as a2,Pn as a3,N as a4,ue as a5,ce as a6,ae as b,mn as c,Pe as d,re as e,Be as f,be as g,ie as h,pn as i,ze as j,Ye as k,Xt as l,de as m,$t as n,Ft as o,De as p,Xe as q,Qe as r,R as s,_n as t,bn as u,te as v,ee as w,Ht as x,C as y,V as z};
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import i from"video.js";import r from"axios";import{g as o,t as a,c as l}from"./skin-4f84b841.js";import{i as s,a as d,d as u}from"./browser-de5f6a74.js";import c from"md5";import v from"js-cookie";import{r as f,a as m}from"./captions-2b4caf69.js";import p from"@babel/runtime/helpers/typeof";import h from"@babel/runtime/helpers/toConsumableArray";import g from"@babel/runtime/helpers/slicedToArray";import{destroyComscoreTag as y,formulateComscorePayload as w,createComscoreStreamingTag as T,setComscorePlayerInstance as _}from"@viewlift/comscore/index.js";import I from"@babel/runtime/helpers/classCallCheck";import b from"@babel/runtime/helpers/createClass";function E(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function S(e){window.dataLayer=window.dataLayer||[],E("js",new Date),E("config",e)}function k(e,n){E("event",e,n)}var A={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function O(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function D(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?O(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):O(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var L={name:"@viewlift/player",version:"2.1.46",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",scripts:{prepublishOnly:"release-assistant"},dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1","@viewlift/sse":"^0.0.3","broadcast-channel":"^7.3.0","@viewlift/comscore":"^1.0.18",axios:"^1.2.3",md5:"^2.3.0",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","jwt-decode":"^4.0.0","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"},overrides:{"min-document":"^2.19.1"}};window.vl_player_version=L.version;var P,C=function(){var e,n,t,i;return null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.overrideEntitlementBaseUrl?(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementBaseUrl)+"/video/status":W.get()+"".concat(null==A?void 0:A.getVideoDetails)},F=function(e,n){var t,i,o,a,l,s,d=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):r({url:C(),params:D({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:d},null===(o=window)||void 0===o||null===(a=o.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":L.version,"x-player-name":"videojs",adbTempToken:null===(l=window)||void 0===l||null===(s=l.customData)||void 0===s?void 0:s.adbTempToken},withCredentials:!0})},j=function(e,n){var t,i,o,a,l,s,d=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):r({url:W.get()+A.getLinearChannelDetails,params:D(D(D(D(D({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:d},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(o=window)||void 0===o||null===(a=o.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO",adbTempToken:null===(l=window)||void 0===l||null===(s=l.customData)||void 0===s?void 0:s.adbTempToken}})},R=function(e,n){var t,i,o=ne(n),a=(null==o?void 0:o.site)||null;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.seriesData?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.seriesData})}):r({url:W.get()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:n}})},V=function(){var e=n(t.mark(function e(n){var i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Z();case 2:return i=e.sent,e.abrupt("return",r({url:W.get()+"".concat(null==A?void 0:A.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:D({},n),params:D({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),N=function(e,n){var t,i,o=window.contentType;return r({method:"GET",url:W.get()+"".concat(null==A?void 0:A.getVideoInfoV2,"/").concat(o,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(i=t.watchHistory)||void 0===i?void 0:i.xApiKey},timeout:15e3})},x=function(e){var n=e.videoId;return r({method:"GET",url:W.get()+"".concat(null==A?void 0:A.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},W=(P=null==A?void 0:A.apiBaseUrl,{set:function(e){e&&(P=e)},get:function(){return P}}),U=function(e,n,t,i){var o,a;return r({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==i?void 0:i.latitude,longitude:null==i?void 0:i.longitude},method:"GET",headers:{Authorization:n,adbTempToken:null===(o=window)||void 0===o||null===(a=o.customData)||void 0===a?void 0:a.adbTempToken},withCredentials:!0})},B=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},M=null;function H(){return{set:function(e){e&&(M=e)},get:function(){return M}}}var G,q,Q,Y,z,K,X,J=function(){var e=n(t.mark(function e(){var n,i,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=H().get(),i=W.get(),e.prev=2,e.next=5,r({method:"GET",url:"".concat(i,"/identity/refresh/").concat(n)});case 5:return o=e.sent,e.abrupt("return",o);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return e.apply(this,arguments)}}(),$=null,Z=function(){var e=n(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!B(n)){e.next=6;break}return $||($=J().then(function(e){var t,i,r=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,o=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return r&&sessionStorage.setItem("vlp_token",r),o&&H().set(o),r||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){$=null})),e.abrupt("return",$);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),ee=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return t&&!i&&(n=!1),n},ne=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},te=function(e){e&&"undefined"!=typeof window&&window.sessionStorage&&window.sessionStorage.setItem("uid",e)},ie=(K=new Map,{set:function(e){var n,t=(null==e||null===(n=e.video)||void 0===n?void 0:n.id)||e||null;K.set(t,(K.get(t)||0)+1)},get:function(e){return K.get(e)},clear:function(){K.clear()}}),re=function(e){q=e},oe=function(){return q},ae=function(e){G=e},le=function(){return G},se=function(){return Q},de=function(e){Q=e},ue=function(){return z},ce=function(e){Y=new Map,e.map(function(e,n){Y.set(e.id,n)})},ve=function(e){if(Y){var n=Y.get(e);de(n+1)}},fe=(X=0,{set:function(e){e>=0&&(X=e)},get:function(){return X}});function me(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function pe(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?me(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):me(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var he,ge=(he={},{setConfig:function(e){he=pe(pe({},he),e)},getConfig:function(){return he}});function ye(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function we(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):ye(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var Te=0,_e=null,Ie=function(){var e,n,t,i,r,o,a,l=oe();return"linearchannel"==((null==l?void 0:l.contentType)||"video")?null==l||null===(e=l.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find(function(e){return(null==e?void 0:e.id)===(null==l?void 0:l.channelId)}))||void 0===t||null===(i=t.content)||void 0===i?void 0:i.id:(null==l||null===(r=l.video)||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.id)||(null==l||null===(a=l.video)||void 0===a?void 0:a.id)||(null==l?void 0:l.id)};function be(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function Ee(){return _e||window.sessionStorage.getItem("uid")}function Se(){return ke.apply(this,arguments)}function ke(){return(ke=n(t.mark(function e(){var n,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Z();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ae(e){return e?String(e):""}window.initialise=function(e){window.sid=be(),window.environment="production",window.platform="WEBSITE",window.failedToStartTimer=null,window.droppedStreamTimer=null,window.firstFrameFired=!1,streamFailures(e),buffering(e),ads(e),ping(e)},window.cleanupTimers=function(){clearInterval(window.bufferingTimer),clearInterval(window.ttFirstFrameTimer),clearTimeout(window.failedToStartTimer),clearTimeout(window.droppedStreamTimer),window.failedToStartTimer=null,window.droppedStreamTimer=null},window.fireStreamFailure=function(e){var n,t,i,r=o(),a=null!=r&&r.el_?Math.floor(r.currentTime()):0;window.cleanupTimers(),k(e,we({pfm:window.platform,uid:Ee(),vid:Ie(),videoPosition:a},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:e,videoPosition:a,isAdEvent:!1})},window.streamFailures=function(e){e.on("error",function(){var e=window.firstFrameFired?"DROPPED_STREAM":"FAILED_TO_START";window.fireStreamFailure(e)})},window.firstFrame=function(e,n,t){e.one("play",tryCatch(function(){var i,r,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),window.failedToStartTimer=setTimeout(function(){window.firstFrameFired||window.fireStreamFailure("FAILED_TO_START")},3e4),k("PLAY",we({pfm:window.platform,uid:Ee(),vid:Ie(),videoPosition:Math.floor(e.currentTime())},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(o=r.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",we({"Video ID":Ie(),watchTime:Math.floor(e.currentTime())},t))}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:(clearInterval(window.bufferingTimer),clearTimeout(window.droppedStreamTimer),window.droppedStreamTimer=null)},100),window.firstFrameFired&&(clearTimeout(window.droppedStreamTimer),window.droppedStreamTimer=setTimeout(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()&&window.fireStreamFailure("DROPPED_STREAM")},45e3)))}))},window.handleBufferTimer=function(e,n){var t,i;if(n.el_){var r,o,a,l=e+.1;if(+l.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(i=t.className)&&void 0!==i&&i.includes("vjs-waiting")&&Te<4)Te++,k("BUFFERING",we({pfm:window.platform,uid:Ee(),vid:Ie(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(r=window)||void 0===r||null===(o=r.customData)||void 0===o||null===(a=o.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return l}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var n,t,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),clearTimeout(window.failedToStartTimer),window.failedToStartTimer=null,window.firstFrameFired=!0,window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,k("FIRST_FRAME",we({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:Ee(),vid:Ie()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var n,t,i,r,o,a;k("AD_REQUEST",we({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:Ee(),vid:Ie(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),k("AD_IMPRESSION",we({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:Ee(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:Ie()},null===(r=window)||void 0===r||null===(o=r.customData)||void 0===o||null===(a=o.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})};var Oe=function(e,n,t){var i;fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:t,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:(null===(i=e.tech_)||void 0===i?void 0:i.vhs)&&window.getBitrate(e)})};window.fireExitPing=function(e){if(!window.isAdPlaying){var n=null!=e&&e.el_?Math.floor(e.currentTime()):0;n<=0||Oe(e,n,n)}},window.ping=function(e){var n=[];e.on("dispose",tryCatch(function(){console.log('Player DISPOSED >> "dispose" event fired >>> firing exit PING'),window.fireExitPing(e)})),e.on("timeupdate",function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(Te=0,n.push(t),Oe(e,t,30))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),i=e.buffered(),r=0;r<i.length;r++){var o=i.start(r),a=i.end(r);if(De(n,o,a)){var l=Math.round(t-a);if(isFinite(l))return l}}})()};var De=function(e,n,t){return e>=n&&e<=t},Le=function(){var e,n=oe(),t=(null==n?void 0:n.contentType)||"video";return(null==n||null===(e=n[t])||void 0===e?void 0:e.network)||null};function Pe(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname&&!s()){var t=ge.getConfig();if(null==t||!t.disableBeacon){null!=n&&n.userId&&(_e=n.userId);var i=o(e);window.initialise(i,null==n?void 0:n.analyticsCb),window.firstFrame(i,null==n?void 0:n.analyticsCb,null==n?void 0:n.analyticsEventParams),i.on("loadedmetadata",function(){window.endFirstFrame(i)})}}}window.fireEvent=function(){var e=n(t.mark(function e(n){var i,o,a,l,d,u,c,v,f,m,p,h,g,y,w,T,_,I,b,E,S;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!s()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,Z();case 4:return _=e.sent,I=ne(_),b=null==I?void 0:I.site,E=null==I?void 0:I.siteId,e.t0=we,e.t1=we,e.t2=we({aid:b,cid:E,pfm:window.platform},null===(i=window)||void 0===i||null===(o=i.customData)||void 0===o||null===(a=o.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=Ee(),e.t5=Ie(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=null!==(l=n.videoPosition)&&void 0!==l?l:null,e.t10=window.environment,e.t11=n.dp1||"",e.t12=n.dp2||"",e.t13=n.dp3||"",e.t14=n.dp4||"",e.t15=n.dp5||"",e.t16=!0===n.isAdEvent?n.videoPosition:null,e.t17=!0===n.isAdEvent?Ae(n.adPosition):"",e.next=28,Se();case 28:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t24=null!==(c=n.resHeight)&&void 0!==c?c:null,e.t25=null!==(v=n.resWidth)&&void 0!==v?v:null,e.t26=null!==(f=n.bufferHealth)&&void 0!==f?f:null,e.t27=null!==(m=Le())&&void 0!==m?m:null,e.t28=null!=b?b:null,e.t29={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26,networkname:e.t27,brandname:e.t28},e.t30=(null==n?void 0:n.duration)&&{duration:n.duration},e.t31=(0,e.t1)(e.t2,e.t3,e.t29,e.t30),e.t32=null===(p=window)||void 0===p||null===(h=p.customData)||void 0===h||null===(g=h.beacon)||void 0===g?void 0:g.params,e.t33=(0,e.t0)(e.t31,e.t32),S=[e.t33],r({url:(null===(y=window)||void 0===y||null===(w=y.customData)||void 0===w||null===(T=w.beacon)||void 0===T?void 0:T.url)||W.get()+A.getBeaconUrl,method:"post",headers:{Authorization:_},contentType:"application/x-www-form-urlencoded",dataType:"text",data:S}).catch(function(e){console.error(e)});case 46:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var Ce=function(e,n){var t=new Map;x({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),z=t}).catch(function(e){return console.log(e)})},Fe=function(){var e=fe.get();return e>=0?e+1:1},je=function(){var e,n,t,i=le(),r=oe(),o=null==r||null===(e=r.video)||void 0===e?void 0:e.id,a=fe.get(),l=null==i||null===(n=i[a])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===o});return l>=0?l+1:1};function Re(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Ve(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Re(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Re(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var Ne=c,xe=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},We=function(e){var n=Ue(e,"video.tags",[]),t=Ue(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},Ue=function(e,n,t){for(var i=0,r=(n=n.split(".")).length;i<r;i++){var o;e=null===(o=e)||void 0===o?void 0:o[n[i]]}return e||t},Be=function(){var e,n,t,i,r,a,l,s,d,u,c,f,m,p,h,g,y,w,T,_,I,b,E,S,k,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",O=arguments.length>1?arguments[1]:void 0,D=arguments.length>2?arguments[2]:void 0;if(null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.disableMacros)return A;var L=(null==D?void 0:D.siteName)||(null==D?void 0:D.site)||"",P=(null==D?void 0:D.contentType)||"video",C=(null==D||null===(t=D[P])||void 0===t?void 0:t.metadata)||(null==D||null===(i=D[P])||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.metadata),F=o(O);if(!A.includes("VIEWLIFT_"))return A;var j,R=window.getComputedStyle(document.getElementById(O),null),V=Math.trunc(R.getPropertyValue("height").slice(0,-2)),N=Math.trunc(R.getPropertyValue("width").slice(0,-2)),x="linearchannel"===P?null==D||null===(a=D.linearchannel)||void 0===a||null===(l=a.channels)||void 0===l||null===(s=l.find(function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)}))||void 0===s||null===(d=s.content)||void 0===d?void 0:d.id:Ue(D,"video.gist.id",""),W="linearchannel"===P?null==D||null===(u=D.linearchannel)||void 0===u||null===(c=u.channels)||void 0===c||null===(f=c.find(function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)}))||void 0===f?void 0:f.title:Ue(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),U=null,B=null;"function"==typeof window.__gpp&&(null===(j=window)||void 0===j||j.__gpp("ping",function(e){U=null==e?void 0:e.gppString,B=null==e?void 0:e.sectionList[0]}));var M=v.get("us_privacy")||v.get("usprivacy"),H=void 0!==M?M:"1YNN",G=null!==(m=null===(p=JSON.parse(localStorage.getItem("selectedMvpdProvider")||"{}"))||void 0===p?void 0:p.fwIdentifier)&&void 0!==m?m:null,q=Ve(Ve({},Me(C)),{},{VIEWLIFT_WIDTH:N,VIEWLIFT_HEIGHT:V,VIEWLIFT_SIZE:xe(N,V),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(h=window)||void 0===h?void 0:h.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Ue(D,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Ue(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Ue(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==F||null===(g=F.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==F||null===(y=F.options_)||void 0===y?void 0:y.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==L||"usanetwork"==L||"golfchannel"==L?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:We(D),VIEWLIFT_MEDIA_ID:x,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Ue(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:x,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Ue(D,"video.gist.permalink","")),VIEWLIFT_CONSENT:v.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Ue(null===(w=window)||void 0===w||null===(T=w.app_data)||void 0===T||null===(_=T.site)||void 0===_?void 0:_.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==L||"usanetwork"==L||"golfchannel"==L?"":Ue(null===(I=window)||void 0===I||null===(b=I.app_data)||void 0===b||null===(E=b.site)||void 0===E?void 0:E.settings,"compliance.gdpr")?1:0,VIEWLIFT_US_PRIVACY:H,VIEWLIFT_TVE_PROVIDER:G?Ne(G):"",VIEWLIFT_CONTENT_DURATION_MS:1e3*Ue(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Ue(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:x,VIEWLIFT_CONTENT_TITLE:W,VIEWLIFT_CONTENT_SERIES_TITLE:Ue(D,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Ue(D,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:je(),VIEWLIFT_SEASON_NUMBER:Fe(),VIEWLIFT_CONTENT_TAGS:We(D),VIEWLIFT_GPP_SID:B||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:U||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:"",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:""},null===(S=window)||void 0===S||null===(k=S.customData)||void 0===k?void 0:k.macros);for(var Q in q){var Y=new RegExp(Q,"g");A=A.replace(Y,q[Q])}return A},Me=function(e){var n,t,i,r,o,a,l,s,u,c={},v=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){v.set(e.name,e.value)}));var f=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.subscription)||void 0===i?void 0:i.SVOD)||!1,m=(null===(r=window)||void 0===r||null===(o=r.customData)||void 0===o||null===(a=o.subscription)||void 0===a?void 0:a.TVE)||!1;return f||m?(d()?f?c=Ve(Ve({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.dtc.csai")||""}):m&&(c=Ve(Ve({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.tve.csai")||""})):f?c=Ve(Ve({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.dtc.csai")||""}):m&&(c=Ve(Ve({},c),{},{VIEWLIFT_CSID:v.get("csid.web.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.tve.csai")||""})),f?c=Ve(Ve({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||"",VIEWLIFT_SFID_CSAI:v.get(d()?"sfid.mweb.dtc.csai":"sfid.web.dtc.csai")||""}):m&&(c=Ve(Ve({},c),{},{VIEWLIFT_SFID:v.get("sfid.tve")||v.get("sfid.web.tve")||"",VIEWLIFT_SFID_CSAI:v.get(d()?"sfid.mweb.tve.csai":"sfid.web.tve.csai")||""})),c=d()?Ve(Ve({},c),{},{VIEWLIFT_PROF:v.get("prof.mweb")||"",VIEWLIFT_PROF_CSAI:v.get("prof.mweb.csai")||""}):Ve(Ve({},c),{},{VIEWLIFT_PROF:v.get("prof.web")||"",VIEWLIFT_PROF_CSAI:v.get("prof.web.csai")||""})):(c=Ve(Ve({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||"",VIEWLIFT_SFID_CSAI:v.get(d()?"sfid.mweb.dtc.csai":"sfid.web.dtc.csai")||""}),c=d()?Ve(Ve({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:v.get("prof.mweb")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.dtc.csai")||"",VIEWLIFT_PROF_CSAI:v.get("prof.mweb.csai")||""}):Ve(Ve({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_PROF:v.get("prof.web")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.dtc.csai")||"",VIEWLIFT_PROF_CSAI:v.get("prof.web.csai")||""})),c=Ve(Ve({},c),{},{VIEWLIFT_AFID:v.get("afid"),VIEWLIFT_NIELSEN_APP_ID:Ue(null===(l=window)||void 0===l||null===(s=l.app_data)||void 0===s||null===(u=s.appcmsMain)||void 0===u?void 0:u.analytics,"nielsen.id")||v.get("VIEWLIFT_NIELSEN_APP_ID")||"",VIEWLIFT_CHANNEL:v.get("VIEWLIFT_CHANNEL")||"",VIEWLIFT_GRACE_NOTE_ID:v.get("VIEWLIFT_GRACE_NOTE_ID")||"",VIEWLIFT_EXTERNAL_AD_ID:v.get("VIEWLIFT_EXTERNAL_AD_ID")||""})},He=function(e,n){var t,i,r,o,a,l,s,d,c,v,f,m,p,h=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[h])||void 0===t?void 0:t.drmEnabled,y=null==e||null===(i=e[h])||void 0===i||null===(r=i.streamingInfo)||void 0===r?void 0:r.videoAssets,w=null==e||null===(o=e[h])||void 0===o||null===(a=o.streamingInfo)||void 0===a?void 0:a.audioAssets,T=(null==e||null===(l=e[h])||void 0===l||null===(s=l.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.hls)||!1;null==e||null===(c=e[h])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var _=(null==e||null===(f=e[h])||void 0===f||null===(m=f.streamingInfo)||void 0===m||null===(p=m.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=w&&w.hls)return qe(w);if(g){var I=Qe(y,n);return I.src=Be(I.src,n,e),I}if("Safari"!==u()&&_)return Ge(y);if(T){var b=qe(y);return b.src=Be(b.src,n,e),b}if(null!=y&&y.mpeg){var E=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(y);return E.src=Be(E.src,n,e),E}return null},Ge=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},qe=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},Qe=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,r=e.fairPlayCmaf||e.fairPlay,a=e.widevine,l=e.playReady,s=u();if(o(n),"Safari"===s){var d=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var r={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(r,function(e,n,i){console.log(e),e&&t(e),t(null,new Uint8Array(i))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,r,o){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:r,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};i.xhr(a,function(e,n,t){console.log(e),e&&o(e),o(null,t)})}}}}}(r);return Ye(n),d}var c,v={src:a.url,type:"application/dash+xml"};return"caliente"==(null===(c=window)||void 0===c?void 0:c.siteName)?(Ye(n),v.keySystems={"com.widevine.alpha":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==l?void 0:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),v};var Ye=function(e){var n=o(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==u()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},ze=function(e,n){var t=e.src,i=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:i};n=n.replace(/\/$/,"");var r=t.split(".com")[1]||"";return{src:r?"".concat(n).concat(r):t,type:i}},Ke=function(e,n){if(import("./error-2395864b.js").then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var i=document.getElementById(e);if(i){var r=document.createElement("div");r.className="error-container";var o=document.createElement("div");o.className="error-message",o.innerHTML="".concat(n),r.appendChild(o),i.append(r)}}},Xe=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Je=!1,$e=function(e,n,t){var i=Be(n,e,t),r=o(e);if(n&&window.google){if("function"!=typeof r.ima&&"object"!==p(r.ima))return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,i,r,a=o(e);if(null!==a.el_){Je=!0;var l={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};a.ima.initializeAdDisplayContainer&&a.ima.initializeAdDisplayContainer(),Je&&null!==a.el_&&("function"==typeof a.ima?a.ima(l):setTimeout(function(){a.ima.setContentWithAdTag(null,n,!0),a.ima.requestAds()},1e3));var s=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&s.hasAttribute("controls")&&s.removeAttribute("controls");var d="click",u=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(u=!0,d="touchend"),a.one(d,function(){u&&a.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.adEventHandler)||null;a.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),a.one("ads-manager",function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})}),n.addEventListener(google.ima.AdEvent.Type.LOADED,function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})})}),a.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,i)}};function Ze(e,n){var t,i,r,a=o(e),l=null==a||null===(t=a.controlBar)||void 0===t||null===(i=t.playToggle)||void 0===i?void 0:i.el_,s=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(t){var i,r,o,d,u,c,v,f,m;if(nn.enabled&&!t.metaKey&&!t.ctrlKey&&"input"!=t.target.localName&&"textarea"!=t.target.localName){var p=t.key,h=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(p)&&(t.preventDefault(),null==s||s.focus()),p){case" ":null==l||l.click();break;case"m":case"M":a.muted(!a.muted());break;case"f":case"F":null===(i=document.querySelector(".vjs-fullscreen-control"))||void 0===i||i.click();break;case"ArrowLeft":h&&!1===n.liveui||Gt(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(o=r.app_data)||void 0===o||null===(d=o.appcmsMain)||void 0===d||null===(u=d.adsConfig)||void 0===u?void 0:u.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(f=v.appcmsMain)&&void 0!==f&&null!==(m=f.adsConfig)&&void 0!==m&&m.vodAdClientSideTracking)return;h||Ht(e,10)}}},!0)}var en,nn=(en=!0,{enable:function(){en=!0},disable:function(){en=!1},get enabled(){return en}}),tn="ssai-breakStart",rn="ssai-adImpression",on="ssai-firstQuartile",an="ssai-midpoint",ln="ssai-thirdQuartile",sn="ssai-complete",dn="ssai-breakEnd",un={breakStart:tn,impression:rn,firstQuartile:on,midpoint:an,thirdQuartile:ln,complete:sn,breakEnd:dn};function cn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=o(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var i=n.eventType,r=un[i];r&&t.trigger(r,n)}function vn(e){var n=o(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var i=function(e,n){return t(n)};return n.on(e,i),function(){return n.off(e,i)}};return{adBreakStart:function(e){return t(tn,e)},adImpression:function(e){return t(rn,e)},adFirstQuartile:function(e){return t(on,e)},adMidpoint:function(e){return t(an,e)},adThirdQuartile:function(e){return t(ln,e)},adComplete:function(e){return t(sn,e)},adBreakEnd:function(e){return t(dn,e)}}}function fn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function mn(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?fn(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):fn(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var pn,hn=(pn={},{get:function(){return pn},set:function(e){pn=e}});function gn(e,n){var t,i,r,a,l,s,d,u,c,v,f,m,p,h,g,I,b,E,S,k,A,O=null==e?void 0:e.playerId,D=o(O);if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var L=oe(),P=(null==L||null===(i=L.video)||void 0===i?void 0:i.metadata)||[],C=(null==P?void 0:P.length)&&P.filter(function(e){return"advertisingGenre"===e.name});if(null!==(r=C)&&void 0!==r&&r.length){var F=C.map(function(e){return e.value});C=null==F?void 0:F.join(",")}y();var j,R,V,N=null===(a=window)||void 0===a?void 0:a.lcProgrammeDetails,x=Array.isArray(null==N?void 0:N.category)?null==N||null===(l=N.category)||void 0===l?void 0:l.join(","):(null==N?void 0:N.category)||null,W=mn(mn(mn({},null==L?void 0:L.video),null==L?void 0:L.linearchannel),{},{siteName:(null==e||null===(s=e.comscore)||void 0===s?void 0:s.applicationName)||(null==e||null===(d=e.comscore)||void 0===d||null===(u=d.metadata)||void 0===u?void 0:u.siteName)||(null==L?void 0:L.site)||null,programId:(null==N?void 0:N.videotmsid)||null,programTitle:(null==N?void 0:N.lcProgrammeName)||null,episodeId:(null==N?void 0:N.videotmsid)||null,seasonNumber:(null==L||null===(c=L.video)||void 0===c||null===(v=c.series)||void 0===v?void 0:v.seasonNumber)||(null==N||null===(f=N.seriesDetails)||void 0===f?void 0:f.season)||null,episodeNumber:(null==L||null===(m=L.video)||void 0===m||null===(p=m.series)||void 0===p?void 0:p.episodeNumber)||(null==N||null===(h=N.seriesDetails)||void 0===h?void 0:h.episode)||null,episodeTitle:(null==N?void 0:N.lcSubTitle)||null,isCompleteEpisode:!!(null!=L&&null!==(g=L.video)&&void 0!==g&&g.series||null!=N&&null!==(I=N.seriesDetails)&&void 0!==I&&I.episode),genre:C||x,comscoreConfig:{implementationId:(null==e||null===(b=e.comscore)||void 0===b?void 0:b.implementationId)||null,projectId:(null==e||null===(E=e.comscore)||void 0===E?void 0:E.projectId)||null}}),U=null==e||null===(S=e.comscore)||void 0===S||null===(k=S.metadata)||void 0===k?void 0:k.contentType;if(null!=W&&null!==(A=W.streamingInfo)&&void 0!==A&&A.isLiveStream?W.contentType="Live":W.contentType=U||"LongFormOnDemand",null==W||!W.network){var B,M=(null==W?void 0:W.metadata)||[],H=null==M||null===(B=M.find(function(e){return"network"===e.name}))||void 0===B?void 0:B.value;W.network=H||null}null!=W&&W.network&&null!=W&&W.genre&&(W.customGenre="".concat(W.network,"_").concat((null==W?void 0:W.programTitle)||(j=W,null!=j&&j.series?null==j||null===(V=j.series)||void 0===V?void 0:V.title:null==j||null===(R=j.gist)||void 0===R?void 0:R.title),"_").concat(W.genre)),null!=N&&N.airDate&&(W.publishDate=N.airDate),null!=W&&W.runtime&&"function"==typeof D.duration&&(W.runtime=1e3*Math.ceil(D.duration()));var G=w(W,D);console.log("comscoreOptions player data",G),T(mn({playerName:"Video.js"},G)),_(D)}}function yn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function wn(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?yn(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):yn(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}function Tn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return _n(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_n(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function _n(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=Array(n);t<n;t++)i[t]=e[t];return i}var In,bn=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),En=(In=null,{set:function(e){In=e},get position(){return In}});function Sn(e,n){return kn.apply(this,arguments)}function kn(){return(kn=n(t.mark(function e(n,i){var r,a,l,s,d,u,c,v,f,m,p,h,y,w,T,_,I,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o(n),l=He(i,n),s=l.src,d=(null==i?void 0:i.contentType)||"video",null==i||null===(r=i[d])||void 0===r||null===(a=r.streamingInfo)||void 0===a||a.isLiveStream,u=s.replace("/dash/","/session/").replace("/master/","/session/"),u=Be(u,n,i),c=On(u),v=g(c,2),f=v[0],m=v[1],p=An(m)||{},u=new URL(u.split("?")[0]),Object.keys(m).length>0&&Object.entries(m).forEach(function(e){var n=g(e,2),t=n[0],i=n[1];u.searchParams.set(t,i)}),e.prev=11,e.next=14,fetch(u,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(wn({adsParams:wn({},f)},p))});case 14:return h=e.sent,e.next=17,h.json();case 17:return y=e.sent,w="https://"+new URL(u).hostname,T=y.trackingUrl,_=y.manifestUrl,I=w+T,b=w+_,bn.set(I),console.log("%c TRACKING URL","background: #bdf369; color: #000",I),l.src=b,e.abrupt("return",l);case 29:return e.prev=29,e.t0=e.catch(11),e.abrupt("return",l);case 32:case"end":return e.stop()}},e,null,[[11,29]])}))).apply(this,arguments)}function An(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map(function(e){var n=g(e,2),t=n[0],i=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(i)]}))||{}}function On(e){var n={};if(!e.split("?")[1])return[{},{}];var t,i=new URL(e,window.location.origin),r=Tn((null==i?void 0:i.searchParams)||[]);try{for(r.s();!(t=r.n()).done;){var o=g(t.value,2),a=o[0],l=o[1];n[decodeURIComponent(a)]=decodeURIComponent(l||"")}}catch(e){r.e(e)}finally{r.f()}for(var s={},d={},u=0,c=Object.entries(n);u<c.length;u++){var v=g(c[u],2),f=v[0],m=v[1];if(f.startsWith("ads."))s[f.replace(/^ads\./,"")]=m;else d[f]=m}return[s,d]}var Dn,Ln,Pn,Cn=new Map;function Fn(e,n){return jn.apply(this,arguments)}function jn(){return jn=n(t.mark(function e(i,r){var l,s,d,u,c,v,f,m,p,g,y,w,T,_,I,b,E,S,k,A,O,D,L,P,C;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:C=function(e,n,t,r,a,l){var s,d,u=o(i);if(!u.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds,e<L&&D.clear(),L=e;var v=(null==n||null===(s=n.ads)||void 0===s||null===(d=s[r])||void 0===d?void 0:d.adId)||c;Math.floor(u.currentTime());var f,m=Tn(t);try{var p=function(){var t,o,s,d=f.value,c=d.eventType,m=d.beaconUrls,p=d.startTimeInSeconds,h=d.startTime,g=d.durationInSeconds,y=p||0,w=m,T=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(s=o.ads)||void 0===s?void 0:s.adEventHandler)||null,_="".concat(y,"_").concat(c),I=Cn.get("pod-".concat(a))||[];if(console.warn(e,y,"map:",c,"condition1:",e>=y,"map:",Cn),e>=y&&!I.includes(_)){I.push(_),Cn.set("pod-".concat(a),I);try{P(c,n,w,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,c,n)}if("breakEnd"==c){var b=En.position;En.set(null),setTimeout(function(){null!=b&&(u.currentTime(b),l())},500)}if("function"==typeof T)try{var E,S={eventType:c,startTimeInSeconds:p,startTime:h,durationInSeconds:g,ad:null==n||null===(E=n.ads)||void 0===E?void 0:E[r],adIndex:r};T({adsData:S}),cn(i,S)}catch(e){console.error("Error when calling ads callback:",e)}var k=hn.get();if(k&&0!==Object.keys(k).length){var A=k.formulateComscoreAdPayload,O=k.startComscoreAdTracking,L=k.finishComscoreAdTracking,C=k.endComscoreAdTracking,F="".concat(y,"_").concat(v,"_").concat(c);if(!D.has(F))if(D.set(F,!0),"impression"===c){var j,R=bn.get();O(A(wn(wn({},null==n||null===(j=n.ads)||void 0===j?void 0:j[r]),{},{trackingUrl:R})))}else"complete"===c?L():"breakEnd"===c&&C()}}};for(m.s();!(f=m.n()).done;)p()}catch(e){m.e(e)}finally{m.f()}}},P=function(e,n,t,i){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(i.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(i.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},O=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},Cn.clear(),En.set(r),p=bn.get(),(g=o(i)).one("loadeddata",function(){p&&A(p)}),y=new Map,w=new Map,T=-1,_=(null===(l=document)||void 0===l||null===(s=l.getElementsByClassName("tvProviderImage"))||void 0===s?void 0:s[0])||null,I=(null==g||null===(d=g.controlBar)||void 0===d?void 0:d.getChild("videoSelector"))||null,b=(null==g||null===(u=g.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,E=(null==g||null===(c=g.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===v?void 0:v[0])||null,S=(null==g||null===(f=g.el())||void 0===f||null===(m=f.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===m?void 0:m[0])||null,k=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return h(i);var r=[],o=null==i?void 0:i.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),a=(null==o||null===(e=o.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,l=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],s=null==l||null===(n=l.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),d=(null==s?void 0:s.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!d&&a){var u=null==s?void 0:s.map(function(e){return wn(wn({},e),{},{eventType:"videoView",beaconUrls:[a]})});null!=u&&u[0]&&r.push(null==u?void 0:u[0])}return r},A=function(){var e=n(t.mark(function e(n){var l,s,d,u,c,v,f,m,p,g,A,D,L,P,F,j,R,V,N,x,W,U,B,M;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return x=function(e){document.removeEventListener("pointermove",N),document.removeEventListener("pointerup",x),0===e.button&&R()},N=function(e){},V=function(){var e,n=g.currentTime(),t=null,i=Tn(p);try{for(i.s();!(e=i.n()).done;){var r=e.value,o=r.startTimeInSeconds,a=r.durationInSeconds,l=(r.ads,Math.floor(o+a));n>=o&&n<=l&&(t=l,y.set(o,!0))}}catch(e){i.e(e)}finally{i.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){g.currentTime(t+2.2)},100))},R=function(){var e,n=g.currentTime(),t=null,i=Tn(p);try{for(i.s();!(e=i.n()).done;){var r=e.value,o=r.startTimeInSeconds,a=r.durationInSeconds,l=r.ads,s=Math.floor(o+a);(Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n>s||n>o)&&!y.has(o)||n>=o&&n<=s)&&(t=o,y.set(o,!0),w.set(o,!0))}}catch(e){i.e(e)}finally{i.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){g.currentTime(t+.4)},100))},c=!1,e.next=7,fetch(n);case 7:return v=e.sent,e.next=10,v.json();case 10:f=e.sent,m=f.avails,p=[],g=o(i),A=g.controlBar.progressControl,D=A.seekBar.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),m.map(function(e,n){var t;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(c=!0),p.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:k(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),!c&&r&&(g.currentTime(r),V()),null!=p&&p.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",p),window.adsQueueList=p,"function"==typeof(j=(null===(L=window)||void 0===L||null===(P=L.customData)||void 0===P||null===(F=P.ads)||void 0===F?void 0:F.onAdBreaksLoaded)||null)&&j(p)),console.log(p,"data"),p.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,i=g.duration();if(!(n>i||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/i*100,o=document.createElement("div");o.className="vjs-seekbar-marker",o.style.left="".concat(r,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="2px",o.style.backgroundColor="#fecc09",o.style.left="".concat(r,"%"),o.style.pointerEvents="none",D.appendChild(o)}}),g._timeUpdateHandler&&g.off("timeupdate",g._timeUpdateHandler),g._timeUpdateHandler=a(function(){var e=g.currentTime();if(e!==T){T=e;for(var n=!1,t=function(){var t=p[i],r=t.startTimeInSeconds,o=t.durationInSeconds,a=t.ads,l=r+o;if(e>=r-1.2&&e<=l+1.2){var s;e>=r&&e<=l&&Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n=!0),e>l&&y.set(r,!0),nn.disable(),_&&_.classList.add("vjs-hidden"),E&&(E.style.pointerEvents="none",E.classList.add("vjs-hidden")),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),I&&(I.el().style.pointerEvents="none",I.el().classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),A.el().classList.add("hide-progress-bar");for(var d=e-r,u=0,c=0,v=0;v<a.length;v++){var f,m=null==a||null===(f=a[v])||void 0===f?void 0:f.durationInSeconds;if(d<u+m){c=v;break}u+=m}a[c];var g=Math.max(0,o-d),T=Math.round(g);W.style.display="block",M.textContent="".concat(c+1," of ").concat(a.length," • ").concat(O(T));var k=[];return null==a||a.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});k.push.apply(k,h(n))}),(null==t||null===(s=t.podSlotImpressionBeacon)||void 0===s?void 0:s.length)>0&&k.push.apply(k,h(null==t?void 0:t.podSlotImpressionBeacon)),C(e,t,k,c,i,V),"break"}w.delete(r)},i=0;i<p.length;i++){if("break"===t())break}n||(W.style.display="none",A.el().classList.remove("hide-progress-bar"),I&&(I.el().style.pointerEvents="auto",I.el().classList.remove("vjs-hidden")),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),_&&_.classList.remove("vjs-hidden"),E&&(E.style.pointerEvents="auto",E.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),nn.enable())}},1e3),g.on("timeupdate",g._timeUpdateHandler),null===(s=document)||void 0===s||s.addEventListener("keydown",function(e){nn.enabled&&"ArrowRight"==e.key&&(R(),Ht(i,10),e.stopPropagation())}),A.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",N),document.addEventListener("pointerup",x))}),null===(d=document)||void 0===d||null===(u=d.querySelectorAll(".ssai-ad-container"))||void 0===u||u.forEach(function(e){return null==e?void 0:e.remove()}),(W=document.createElement("div")).className="ssai-ad-container",(U=document.createElement("div")).className="sponsored-adbox",(B=document.createElement("div")).className="sponsored-text",B.textContent="Sponsored Ad",U.append(B),(M=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",W.append(U),W.append(M),g.el().appendChild(W);case 44:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),D=new Map,L=-1;case 21:case"end":return e.stop()}},e)})),jn.apply(this,arguments)}function Rn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Vn(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Vn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function Vn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=Array(n);t<n;t++)i[t]=e[t];return i}function Nn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function xn(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Nn(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Nn(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var Wn={},Un=(null===(Dn=window)||void 0===Dn||null===(Ln=Dn.location)||void 0===Ln||null===(Pn=Ln.search)||void 0===Pn?void 0:Pn.includes("debug=true"))||!1,Bn=null;function Mn(e){return Hn.apply(this,arguments)}function Hn(){return Hn=n(t.mark(function e(i){var r,l,s,d,u,c,v,f,m,p,g,y,w,T,_,I,b,E,S,k,A,O,D,L,P,C,F;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:F=function(e,n,t,r,a){var l,s,d=o(i);if(!d.seeking()){var u=n.startTimeInSeconds;n.durationInSeconds;var c=(null==n||null===(l=n.ads)||void 0===l||null===(s=l[r])||void 0===s?void 0:s.adId)||u;Math.floor(d.currentTime());var v,f=Rn(t);try{for(f.s();!(v=f.n()).done;){var m,p,h,g=v.value,y=g.eventType,w=g.beaconUrls,T=g.startTimeInSeconds,_=g.startTime,I=g.durationInSeconds,b=(g.eventId,T||u),E=w,S=(null===(m=window)||void 0===m||null===(p=m.customData)||void 0===p||null===(h=p.ads)||void 0===h?void 0:h.adEventHandler)||null,k="".concat(c,"_").concat(y),A="pod-".concat(u);L.has(A)||L.set(A,new Set);var O=L.get(A);if(Un&&console.warn(e,b,"map:",y,"condition1:",e>=b,"map:",L),e>=b&&e<=b+P&&!O.has(k)){O.add(k);try{C(y,n,E,d)}catch(e){console.error("Error when calling triggerAdBeacon:",e,y,n)}if("function"==typeof S)try{var D,F={eventType:y,startTimeInSeconds:T,startTime:_,durationInSeconds:I,ad:null==n||null===(D=n.ads)||void 0===D?void 0:D[r],adIndex:r};S({adsData:F}),cn(i,F)}catch(e){console.error("Error when calling ads callback:",e)}var j=hn.get();if(j&&0!==Object.keys(j).length){var R=j.formulateComscoreAdPayload,V=j.startComscoreAdTracking,N=j.finishComscoreAdTracking,x=j.endComscoreAdTracking;if("impression"===y){var W,U=bn.get();V(R(xn(xn({},null==n||null===(W=n.ads)||void 0===W?void 0:W[r]),{},{trackingUrl:U})))}else"complete"===y?N():"breakEnd"===y&&x()}}}}catch(e){f.e(e)}finally{f.f()}}},C=function(e,n,t,i){var r,o,a;"breakEnd"===e&&(null===(r=Wn)||void 0===r?void 0:r.currentAdIndex)+1!=(null===(o=Wn)||void 0===o?void 0:o.totalAds)&&(null==n||null===(a=n.ads)||void 0===a?void 0:a.length)>0||(Un&&console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(i.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})}))},g=function(){Bn&&clearInterval(Bn)},m=bn.get(),(p=o(i)).one("loadeddata",function(){g(),Bn=setInterval(function(){m&&!p.paused()&&D(m)},2e3)}),p.on("dispose",function(){g()}),y=new Map,w=new Map,T=-1,_=null,I=(null===(r=document)||void 0===r||null===(l=r.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,b=(null==p||null===(s=p.controlBar)||void 0===s?void 0:s.getChild("videoSelector"))||null,E=(null==p||null===(d=p.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,S=(null==p||null===(u=p.el())||void 0===u||null===(c=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,k=(null==p||null===(v=p.el())||void 0===v||null===(f=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===f?void 0:f[0])||null,A=!1,O=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return h(i);var r=[],o=null==i?void 0:i.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),a=(null==o||null===(e=o.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,l=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],s=null==l||null===(n=l.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),d=(null==s?void 0:s.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!d&&a){var u=null==s?void 0:s.map(function(e){return xn(xn({},e),{},{eventType:"videoView",beaconUrls:[a]})});null!=u&&u[0]&&r.push(null==u?void 0:u[0])}return r},D=function(){var e=n(t.mark(function e(n){var r,l,s,d,u,c,v,f,m,p,g,D;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return d=new URL(n),_&&d.searchParams.append("nextToken",_),e.next=4,fetch(d.toString(),{method:"GET"});case 4:return u=e.sent,e.next=7,u.json();case 7:c=e.sent,v=c.avails,f=c.nextToken||null,_=f,m=[],p=o(i),g=null==p||null===(r=p.controlBar)||void 0===r?void 0:r.progressControl,D=null==g||null===(l=g.seekBar)||void 0===l?void 0:l.el(),null===(s=document)||void 0===s||s.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),v.map(function(e,n){m.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:O(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),Un&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",m),null!=m&&m.length&&(window.adsQueueList=m),m.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,i=p.duration();if(!(n>i||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/i*100,o=document.createElement("div");o.className="vjs-seekbar-marker",o.style.left="".concat(r,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="2px",o.style.backgroundColor="#fecc09",o.style.left="".concat(r,"%"),o.style.pointerEvents="none",D.appendChild(o)}}),p._timeUpdateHandler&&p.off("timeupdate",null==p?void 0:p._timeUpdateHandler),p._timeUpdateHandler=a(function(){if(qt(i)){var e=null==p?void 0:p.currentTime();if(e!==T){T=e;for(var n=function(){var n=m[t],i=n.startTimeInSeconds,r=n.durationInSeconds,o=n.ads,a=i+r;if(e>=i-1.2&&e<=a+1.2){var l;A=!!(e>=i&&e<=a&&Array.isArray(o)&&(null==o?void 0:o.length)>0),e>a&&y.set(i,!0),nn.disable(),I&&I.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),k&&(k.style.pointerEvents="none",k.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),E&&(E.el().style.pointerEvents="none",E.el().classList.add("vjs-hidden")),g.el().classList.add("hide-progress-bar");for(var s=e-i,d=0,u=0,c=0;c<o.length;c++){var v,f=null==o||null===(v=o[c])||void 0===v?void 0:v.durationInSeconds;if(s<d+f){u=c;break}d+=f}setTimeout(function(){Wn.totalAds=null==o?void 0:o.length,Wn.currentAdIndex=u},1e3);var p=[];return null==o||o.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});p.push.apply(p,h(n))}),(null==n||null===(l=n.podSlotImpressionBeacon)||void 0===l?void 0:l.length)>0&&p.push.apply(p,h(null==n?void 0:n.podSlotImpressionBeacon)),F(e,n,p,u),"break"}w.delete(i)},t=0;t<m.length;t++){if("break"===n())break}A||(Wn={},g.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),E&&(E.el().style.pointerEvents="auto",E.el().classList.remove("vjs-hidden")),I&&I.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),k&&(k.style.pointerEvents="auto",k.classList.remove("vjs-hidden")),nn.enable())}}},1e3),p.on("timeupdate",p._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),L=new Map,P=2.5;case 22:case"end":return e.stop()}},e)})),Hn.apply(this,arguments)}var Gn=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function qn(e){return JSON.stringify((e||[]).map(function(e){return{availId:e.availId,startTimeInSeconds:e.startTimeInSeconds,durationInSeconds:e.durationInSeconds,ads:(e.ads||[]).map(function(e){return{adId:e.adId,startTimeInSeconds:e.startTimeInSeconds,durationInSeconds:e.durationInSeconds}})}}))}var Qn=function(){function e(n,t,i,r){I(this,e),this.video_=r,this.ad_=n,this.skipOffset_=function(e){if(!e)return null;var n=new RegExp(Gn.source,"g");n.lastIndex=0;var t=n.exec(e);if(!t)return null;var i=Number(t[1])||0,r=Number(t[2]),o=Number(t[3]),a=Number(t[6])||0;return r>59||o>59?null:a/1e3+o+60*r+3600*i}(null==n?void 0:n.skipOffset),this.adPosition_=t,this.totalAds_=i,this.isSkipped_=!1}return b(e,[{key:"isClientRendering",value:function(){return!1}},{key:"getDuration",value:function(){var e,n;return null!==(e=null===(n=this.ad_)||void 0===n?void 0:n.durationInSeconds)&&void 0!==e?e:0}},{key:"getRemainingTime",value:function(){var e,n,t,i,r,o;return(null!==(e=null===(n=this.ad_)||void 0===n?void 0:n.startTimeInSeconds)&&void 0!==e?e:0)+(null!==(t=null===(i=this.ad_)||void 0===i?void 0:i.durationInSeconds)&&void 0!==t?t:0)-(null!==(r=null===(o=this.video_)||void 0===o?void 0:o.currentTime)&&void 0!==r?r:0)}},{key:"isSkippable",value:function(){return"number"==typeof this.skipOffset_}},{key:"getTimeUntilSkippable",value:function(){if("number"!=typeof this.skipOffset_)return this.getRemainingTime();var e=this.getRemainingTime()+this.skipOffset_-this.getDuration();return Math.max(e,0)}},{key:"canSkipNow",value:function(){return 0===this.getTimeUntilSkippable()}},{key:"skip",value:function(){this.isSkipped_=!0,this.video_&&(this.video_.currentTime+=this.getRemainingTime())}},{key:"isLinear",value:function(){return!0}},{key:"getSequenceLength",value:function(){return this.totalAds_||1}},{key:"getPositionInSequence",value:function(){return this.adPosition_||1}},{key:"getTitle",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.adTitle)||""}},{key:"getVastAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.vastAdId)||""}},{key:"getAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.adId)||""}},{key:"getCreativeAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.creativeId)||""}},{key:"getTimeOffset",value:function(){var e,n;return null!==(e=null===(n=this.ad_)||void 0===n?void 0:n.startTimeInSeconds)&&void 0!==e?e:0}},{key:"release",value:function(){this.ad_=null,this.adPosition_=null,this.totalAds_=null}},{key:"isSkipped",value:function(){return this.isSkipped_}}]),e}(),Yn="impression",zn="start",Kn="mute",Xn="unmute",Jn="resume",$n="pause",Zn="firstQuartile",et="midpoint",nt="thirdQuartile",tt="complete",it="skip",rt="breakStart",ot="breakEnd",at="skipStateChanged",lt="ad_impression",st="ad_started",dt="ad_muted",ut="ad_volume_changed",ct="ad_resumed",vt="ad_paused",ft="ad_first_quartile",mt="ad_midpoint",pt="ad_third_quartile",ht="ad_complete",gt="ad_stopped",yt="ad_skipped",wt="ad_skip_state_changed",Tt="ad_break_started",_t="ad_break_ended",It="ads_loaded",bt="ad_cuepoints_changed";function Et(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function St(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Et(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Et(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}function kt(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return At(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?At(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function At(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=Array(n);t<n;t++)i[t]=e[t];return i}var Ot="[Transmit]";function Dt(e){var n,t,i;if(null==e)return{avails:[],nextToken:null,dashAvailabilityStartTime:null};var r=null!==(n=e.dashAvailabilityStartTime)&&void 0!==n?n:null,o=null!==(t=e.nextToken)&&void 0!==t?t:null,a=[];if(Array.isArray(e.avails))a=e.avails;else if(Array.isArray(e)){var l,s,d,u,c=e[0];if(c&&Array.isArray(c.avails))a=c.avails,r=null!==(l=null!==(s=r)&&void 0!==s?s:c.dashAvailabilityStartTime)&&void 0!==l?l:null,o=null!==(d=null!==(u=o)&&void 0!==u?u:c.nextToken)&&void 0!==d?d:null;else a=e}else if(Array.isArray(null==e||null===(i=e.data)||void 0===i?void 0:i.avails)){var v,f,m,p;a=e.data.avails,o=null!==(v=null!==(f=o)&&void 0!==f?f:e.data.nextToken)&&void 0!==v?v:null,r=null!==(m=null!==(p=r)&&void 0!==p?p:e.data.dashAvailabilityStartTime)&&void 0!==m?m:null}else Array.isArray(null==e?void 0:e.data)&&(a=e.data);return{avails:a,nextToken:o,dashAvailabilityStartTime:r}}var Lt=function(){function e(n,t,i){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};I(this,e),this.video_=n,this.player_=t,this.onEvent_="function"==typeof i?i:function(){},this.dashManifestUrl_=o.dashManifestUrl||null,this.config_=null,this.trackingUrl_="",this.firstTrackingRequest_=!0,this.nextToken_=null,this.dashAvailabilityStartTime_=0,this.dashAvailabilityStartTimeResolved_=!1,this.pollIntervalMs_=2e3,this.pollId_=null,this.adBreaks_=[],this.ad_=null,this.transmitAd_=null,this.transmitAdBreak_=null,this.eventsSent_=new Set,this.firedBeacons_=new Set,this.adBreakListenersAttached_=!1,this.globalListeners_=[],this.adListeners_=[],this.videoTimeupdate_=null,this.lastMutedForAd_=null,this.onDispose_=function(){return r.release()},this.apiTimelineAbsolute_=!1}var i,r,o;return b(e,[{key:"configure",value:function(e){this.config_=e}},{key:"addTrackingUrl",value:function(e){this.trackingUrl_=e||"",this.onEvent_({type:It,loadTime:0})}},{key:"getCuePoints",value:function(){var e,n=new Map,t=kt(this.adBreaks_);try{for(t.s();!(e=t.n()).done;){var i,r=kt(e.value.ads||[]);try{for(r.s();!(i=r.n()).done;){var o=i.value,a=o.startTimeInSeconds,l=a+o.durationInSeconds;if(isFinite(a)&&isFinite(l)&&!(l<=a)){var s="".concat(a.toFixed(1),"|").concat(l.toFixed(1));n.has(s)||n.set(s,{start:a,end:l})}}}catch(e){r.e(e)}finally{r.f()}}}catch(e){t.e(e)}finally{t.f()}return Array.from(n.values()).sort(function(e,n){return e.start-n.start})}},{key:"onManifestUpdated",value:function(){this.trackingUrl_&&(this.requestTrackingInfo_(this.firstTrackingRequest_),this.firstTrackingRequest_=!1,this.ensurePolling_())}},{key:"stop",value:function(){this.onEnded_(),this.detachAllListeners_(),this.eventsSent_.clear(),this.firedBeacons_.clear(),this.trackingUrl_="",this.firstTrackingRequest_=!0,this.nextToken_=null,this.dashAvailabilityStartTime_=0,this.dashAvailabilityStartTimeResolved_=!1,this.apiTimelineAbsolute_=!1,this.adBreaks_=[],this.adBreakListenersAttached_=!1,this.pollId_&&(clearInterval(this.pollId_),this.pollId_=null)}},{key:"release",value:function(){this.stop()}},{key:"ensurePolling_",value:function(){var e=this;this.pollId_||(this.pollId_=setInterval(function(){var n,t;e.trackingUrl_&&(null!==(n=e.player_)&&void 0!==n&&null!==(t=n.paused)&&void 0!==t&&t.call(n)||e.requestTrackingInfo_(!1))},this.pollIntervalMs_))}},{key:"requestTrackingInfo_",value:(o=n(t.mark(function e(n){var i,r,o,a,l,s,d,u,c,v,f,m,p,h,g,y,w;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,r=new Map,o=0,a=null;case 4:if(!(o<10)){e.next=25;break}return l=new URL(this.trackingUrl_),this.nextToken_&&l.searchParams.set("nextToken",this.nextToken_),e.next=9,fetch(l.toString(),{method:"GET"});case 9:return s=e.sent,e.next=12,s.json();case 12:d=e.sent,o++,(u=Dt(d)).dashAvailabilityStartTime&&!a&&(a=u.dashAvailabilityStartTime),c=kt(u.avails);try{for(c.s();!(v=c.n()).done;)f=v.value,m=(null==f?void 0:f.availId)||"".concat(null==f?void 0:f.startTimeInSeconds),r.set(m,f)}catch(e){c.e(e)}finally{c.f()}if((p=u.nextToken||null)&&p!==this.nextToken_){e.next=22;break}return this.nextToken_=p,e.abrupt("break",25);case 22:this.nextToken_=p,e.next=4;break;case 25:if(h=Array.from(r.values()),this.updateApiTimelineAbsoluteFlag_(h),g=(null==h||null===(i=h[0])||void 0===i?void 0:i.startTimeInSeconds)||0,this.apiTimelineAbsolute_){e.next=33;break}return e.next=31,this.resolveDashAvailabilityStartTime_(a,g);case 31:e.next=35;break;case 33:this.dashAvailabilityStartTimeResolved_=!0,this.dashAvailabilityStartTime_=0;case 35:h.length?(y=this.normalizeAvails_(h),qn(this.adBreaks_)!==qn(y)&&(this.adBreaks_=y,w=this.getCuePoints(),this.onEvent_({type:bt,cuepoints:w}))):this.adBreaks_.length&&(this.onEvent_({type:bt,cuepoints:[]}),this.onEnded_(),this.adBreaks_=[]),n&&this.setupAdBreakListeners_(),e.next=42;break;case 39:e.prev=39,e.t0=e.catch(0),console.warn(Ot,"tracking info fetch failed",e.t0);case 42:case"end":return e.stop()}},e,this,[[0,39]])})),function(e){return o.apply(this,arguments)})},{key:"updateApiTimelineAbsoluteFlag_",value:function(e){this.apiTimelineAbsolute_=!1;var n,t=1e6,i=kt(e||[]);try{for(i.s();!(n=i.n()).done;){var r,o=n.value;if((null!==(r=null==o?void 0:o.startTimeInSeconds)&&void 0!==r?r:0)>t)return void(this.apiTimelineAbsolute_=!0);var a,l=kt((null==o?void 0:o.ads)||[]);try{for(l.s();!(a=l.n()).done;){var s,d=a.value;if((null!==(s=null==d?void 0:d.startTimeInSeconds)&&void 0!==s?s:0)>t)return void(this.apiTimelineAbsolute_=!0)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){i.e(e)}finally{i.f()}}},{key:"normalizeAvails_",value:function(e){var n=this,t=this.apiTimelineAbsolute_?0:this.dashAvailabilityStartTime_||0;return e.map(function(e){var i=n.resolveAbsoluteStart_(e,t,null);return St(St({},e),{},{startTimeInSeconds:i,ads:(e.ads||[]).map(function(r){return St(St({},r),{},{startTimeInSeconds:n.resolveAbsoluteStart_(r,t,e,i)})})})})}},{key:"resolveAbsoluteStart_",value:function(e,n,t,i){var r=null==e?void 0:e.adProgramDateTime;if(r){var o=new Date(r).getTime()/1e3;if(isFinite(o)&&o>0)return o}return null!=t&&t.adProgramDateTime&&"number"==typeof i?i+((e.startTimeInSeconds||0)-(t.startTimeInSeconds||0)):(e.startTimeInSeconds||0)+n}},{key:"resolveDashAvailabilityStartTime_",value:(r=n(t.mark(function e(n,i){var r,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.dashAvailabilityStartTimeResolved_){e.next=2;break}return e.abrupt("return");case 2:if(!n){e.next=8;break}if(r=new Date(n).getTime()/1e3,!(isFinite(r)&&r>0)){e.next=8;break}return this.dashAvailabilityStartTime_=r,this.dashAvailabilityStartTimeResolved_=!0,e.abrupt("return");case 8:if(!(i>0)){e.next=13;break}return e.next=11,this.fetchDashAvailabilityStartTimeFromMpd_();case 11:(o=e.sent)>0&&(this.dashAvailabilityStartTime_=o,this.dashAvailabilityStartTimeResolved_=!0);case 13:case"end":return e.stop()}},e,this)})),function(e,n){return r.apply(this,arguments)})},{key:"fetchDashAvailabilityStartTimeFromMpd_",value:(i=n(t.mark(function e(){var n,i,r,o,a,l;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,(i=this.dashManifestUrl_||this.getCurrentSourceUrl_())&&i.includes(".mpd")){e.next=4;break}return e.abrupt("return",0);case 4:return e.next=6,fetch(i);case 6:return r=e.sent,e.next=9,r.text();case 9:return o=e.sent,a=(new DOMParser).parseFromString(o,"application/xml"),l=null===(n=a.querySelector("MPD"))||void 0===n?void 0:n.getAttribute("availabilityStartTime"),e.abrupt("return",l?new Date(l).getTime()/1e3:0);case 15:return e.prev=15,e.t0=e.catch(0),console.warn(Ot,"MPD availabilityStartTime parse failed",e.t0),e.abrupt("return",0);case 19:case"end":return e.stop()}},e,this,[[0,15]])})),function(){return i.apply(this,arguments)})},{key:"getCurrentSourceUrl_",value:function(){try{var e,n,t,i,r=(null===(e=this.player_)||void 0===e||null===(n=e.currentSrc)||void 0===n?void 0:n.call(e))||(null===(t=this.player_)||void 0===t||null===(i=t.src)||void 0===i?void 0:i.call(t));return"string"==typeof r?r:(null==r?void 0:r.src)||""}catch(e){return""}}},{key:"setupAdBreakListeners_",value:function(){var e=this;if(!this.adBreakListenersAttached_){this.adBreakListenersAttached_=!0,this.onTimeupdate_();this.attachGlobalListener_("timeupdate",function(){return e.onTimeupdate_()}),this.attachGlobalListener_("dispose",this.onDispose_),this.video_&&(this.videoTimeupdate_=function(){return e.onTimeupdate_()},this.video_.addEventListener("timeupdate",this.videoTimeupdate_))}}},{key:"isHlsSource_",value:function(){var e,n,t=this.getCurrentSourceUrl_().toLowerCase(),i=((null===(e=this.player_)||void 0===e||null===(n=e.currentType)||void 0===n?void 0:n.call(e))||"").toLowerCase();return t.includes(".m3u8")||"application/x-mpegurl"===i||"application/vnd.apple.mpegurl"===i}},{key:"isDashSource_",value:function(){var e,n,t=this.getCurrentSourceUrl_().toLowerCase();return"application/dash+xml"===((null===(e=this.player_)||void 0===e||null===(n=e.currentType)||void 0===n?void 0:n.call(e))||"").toLowerCase()||t.includes(".mpd")}},{key:"getDashMediaPlayerTimelineSeconds_",value:function(){try{var e,n,t=null===(e=this.player_)||void 0===e||null===(n=e.dash)||void 0===n?void 0:n.mediaPlayer;if(!t||"function"!=typeof t.time)return null;var i=t.time();return"number"==typeof i&&isFinite(i)&&i>1e6?i:null}catch(e){return null}}},{key:"getCurrentTime_",value:function(){var e,n,t,i=null!==(e=null===(n=this.video_)||void 0===n?void 0:n.currentTime)&&void 0!==e?e:0,r=u();if(this.isHlsSource_()){var o,a,l=i,s=null===(o=this.player_)||void 0===o||null===(a=o.seekable)||void 0===a?void 0:a.call(o);return s&&s.length>0&&(l=s.end(s.length-1)),Date.now()/1e3-(l-i)}if(this.isDashSource_()){var d,c,v,f=this.getDashMediaPlayerTimelineSeconds_();if(null!=f)return f;var m=null===(d=this.player_)||void 0===d||null===(c=d.seekable)||void 0===c?void 0:c.call(d),p="function"==typeof(null===(v=this.player_)||void 0===v?void 0:v.currentTime)?this.player_.currentTime():i;if(m&&m.length>0){var h=m.start(0);if(h>1e6&&h+p>1e6)return h+p}if(this.apiTimelineAbsolute_&&(this.dashAvailabilityStartTime_||0)>1e9)return(this.dashAvailabilityStartTime_||0)+p}return"Safari"===r?i:"function"==typeof(null===(t=this.player_)||void 0===t?void 0:t.currentTime)?this.player_.currentTime():i}},{key:"onTimeupdate_",value:function(){if(this.ad_||this.adBreaks_.length){var e=this.getCurrentTime_();if(this.ad_){var n,t;this.sendInProgressEvents_(e,this.transmitAd_);var i=this.ad_.getDuration(),r=(null!==(n=null===(t=this.transmitAd_)||void 0===t?void 0:t.startTimeInSeconds)&&void 0!==n?n:0)+i,o=r-e;this.ad_.canSkipNow()&&o>0&&i>0&&this.sendTrackingEvent_(at),i>0&&e>=r&&this.onEnded_()}this.ad_||this.checkLinearAds_(e)}}},{key:"sendInProgressEvents_",value:function(e,n){if(n){var t=n.startTimeInSeconds+.25*n.durationInSeconds,i=n.startTimeInSeconds+.5*n.durationInSeconds,r=n.startTimeInSeconds+.75*n.durationInSeconds;e>=t&&!this.eventsSent_.has(Zn)&&(this.eventsSent_.add(Zn),this.sendTrackingEvent_(Zn)),e>=i&&!this.eventsSent_.has(et)&&(this.eventsSent_.add(et),this.sendTrackingEvent_(et)),e>=r&&!this.eventsSent_.has(nt)&&(this.eventsSent_.add(nt),this.sendTrackingEvent_(nt))}}},{key:"flushPendingQuartiles_",value:function(){for(var e=0,n=[Zn,et,nt];e<n.length;e++){var t=n[e];this.eventsSent_.has(t)||(this.eventsSent_.add(t),this.sendTrackingEvent_(t))}}},{key:"checkLinearAds_",value:function(e){var n,t=kt(this.adBreaks_);try{for(t.s();!(n=t.n()).done;){var i=n.value;if(this.ad_)break;for(var r=i.ads||[],o=0;o<r.length;o++){var a=r[o],l=a.startTimeInSeconds,s=l+a.durationInSeconds;if(l<=e&&s>e){this.onEnded_(),this.transmitAdBreak_=i,this.transmitAd_=a,this.ad_=new Qn(a,o+1,r.length,this.video_),0===o&&this.sendTrackingEvent_(rt),this.setupCurrentAdListeners_();break}}}}catch(e){t.e(e)}finally{t.f()}}},{key:"onEnded_",value:function(){this.ad_&&this.transmitAd_&&(this.ad_.isSkipped()||this.flushPendingQuartiles_(),this.removeCurrentAdListeners_(this.ad_.isSkipped()),this.ad_.getPositionInSequence()===this.ad_.getSequenceLength()&&this.sendTrackingEvent_(ot),this.ad_=null,this.transmitAd_=null,this.transmitAdBreak_=null)}},{key:"setupCurrentAdListeners_",value:function(){var e,n,t,i,r,o=this,a=!1;null!==(e=this.player_)&&void 0!==e&&null!==(n=e.paused)&&void 0!==n&&n.call(e)?a=!0:(this.sendTrackingEvent_(Yn),this.sendTrackingEvent_(zn)),this.lastMutedForAd_=null!==(t=null===(i=this.player_)||void 0===i||null===(r=i.muted)||void 0===r?void 0:r.call(i))&&void 0!==t&&t,this.attachAdListener_("volumechange",function(){var e,n,t,i=null!==(e=null===(n=o.player_)||void 0===n||null===(t=n.muted)||void 0===t?void 0:t.call(n))&&void 0!==e&&e;i!==o.lastMutedForAd_&&(o.lastMutedForAd_=i,i?o.sendTrackingEvent_(Kn):o.sendTrackingEvent_(Xn))}),this.attachAdListener_("play",function(){a?(o.sendTrackingEvent_(Yn),o.sendTrackingEvent_(zn),a=!1):o.sendTrackingEvent_(Jn)}),this.attachAdListener_("pause",function(){o.sendTrackingEvent_($n)})}},{key:"removeCurrentAdListeners_",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.sendTrackingEvent_(e?it:tt),this.detachAdListeners_(),this.eventsSent_.clear()}},{key:"attachGlobalListener_",value:function(e,n){this.player_&&(this.player_.on(e,n),this.globalListeners_.push({event:e,handler:n}))}},{key:"attachAdListener_",value:function(e,n){this.player_&&(this.player_.on(e,n),this.adListeners_.push({event:e,handler:n}))}},{key:"detachAdListeners_",value:function(){var e,n=kt(this.adListeners_);try{for(n.s();!(e=n.n()).done;){var t,i,r=e.value,o=r.event,a=r.handler;null===(t=this.player_)||void 0===t||null===(i=t.off)||void 0===i||i.call(t,o,a)}}catch(e){n.e(e)}finally{n.f()}this.adListeners_=[]}},{key:"detachAllListeners_",value:function(){this.detachAdListeners_();var e,n=kt(this.globalListeners_);try{for(n.s();!(e=n.n()).done;){var t,i,r=e.value,o=r.event,a=r.handler;null===(t=this.player_)||void 0===t||null===(i=t.off)||void 0===i||i.call(t,o,a)}}catch(e){n.e(e)}finally{n.f()}this.globalListeners_=[],this.video_&&this.videoTimeupdate_&&(this.video_.removeEventListener("timeupdate",this.videoTimeupdate_),this.videoTimeupdate_=null)}},{key:"startComscoreForCurrentAd_",value:function(){try{var e=hn.get();if(!e||0===Object.keys(e).length)return;var n=e.formulateComscoreAdPayload,t=e.startComscoreAdTracking,i=bn.get();t(n(St(St({},this.transmitAd_),{},{trackingUrl:i})))}catch(e){console.warn(Ot,"comscore start failed",e)}}},{key:"sendTrackingEvent_",value:function(e){var n,t=this;if(this.transmitAd_&&this.transmitAdBreak_){var i=(this.transmitAd_.trackingEvents||[]).find(function(n){return n.eventType===e});if(i||(i=(this.transmitAdBreak_.adBreakTrackingEvents||[]).find(function(n){return n.eventType===e})),i&&(null===(n=this.config_)||void 0===n||!n.disableTrackingEvents)){var r,o,a,l=(null===(r=this.transmitAd_)||void 0===r?void 0:r.adId)||(null===(o=this.transmitAdBreak_)||void 0===o?void 0:o.availId)||"unknown",s=kt(i.beaconUrls||[]);try{var d=function(){var n=a.value;if(!n)return"continue";var i="".concat(l,"|").concat(e,"|").concat(n);if(t.firedBeacons_.has(i))return"continue";t.firedBeacons_.add(i),fetch(n,{mode:"no-cors"}).catch(function(e){console.warn(Ot,"beacon failed",n,e)})};for(s.s();!(a=s.n()).done;)d()}catch(e){s.e(e)}finally{s.f()}}var u=hn.get(),c=u&&Object.keys(u).length?u:null;switch(e){case Yn:this.onEvent_({type:lt}),this.startComscoreForCurrentAd_();break;case zn:this.onEvent_({type:st,ad:this.ad_});break;case Kn:this.onEvent_({type:dt});break;case Xn:this.onEvent_({type:ut});break;case Jn:this.onEvent_({type:ct});break;case $n:this.onEvent_({type:vt});break;case Zn:this.onEvent_({type:ft});break;case et:this.onEvent_({type:mt});break;case nt:this.onEvent_({type:pt});break;case tt:this.onEvent_({type:ht}),this.onEvent_({type:gt}),null!=c&&c.finishComscoreAdTracking&&c.finishComscoreAdTracking();break;case it:this.onEvent_({type:yt}),this.onEvent_({type:gt});break;case rt:this.onEvent_({type:Tt});break;case ot:this.onEvent_({type:_t}),null!=c&&c.endComscoreAdTracking&&c.endComscoreAdTracking();break;case at:this.onEvent_({type:wt})}}else console.warn(Ot,"sendTrackingEvent_ skipped — no active ad",{eventType:e})}}]),e}();function Pt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Ct(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Pt(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Pt(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var Ft={dash:"tracking/initialize/dash",hls:"tracking/initialize/hls"};function jt(e){if(null==e||!e.src)return null;var n=(e.type||"").toLowerCase(),t=String(e.src).toLowerCase();return"application/dash+xml"===n||t.includes(".mpd")?"dash":"application/x-mpegurl"===n||"application/vnd.apple.mpegurl"===n||t.includes(".m3u8")?"hls":null}function Rt(e,n,t){return Vt.apply(this,arguments)}function Vt(){return(Vt=n(t.mark(function e(n,i,r){var o,a,l,s,d,u,c,v,f,m,p;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=jt(n)){e.next=3;break}return e.abrupt("return",n);case 3:return a=Be(n.src,r,i),l=a.replace(o,Ft[o]),console.log("[Transmit] session init →",l),e.prev=6,e.next=9,fetch(l,{method:"GET",redirect:"follow"});case 9:return s=e.sent,e.next=12,s.json();case 12:if(d=e.sent,console.log("[Transmit] session response",d),u="dash"===o?null==d?void 0:d.dashUrl:null==d?void 0:d.hlsUrl,c=null==d?void 0:d.trackingUrl,u&&c){e.next=18;break}return e.abrupt("return",n);case 18:return v=new URL(l),f=v.hostname,m="https://".concat(f).concat(u),p="https://".concat(f).concat(c),bn.set(p),console.log("[Transmit] session ready",{manifestUrl:m,trackingUrl:p}),e.abrupt("return",Ct(Ct({},n),{},{src:m}));case 26:return e.prev=26,e.t0=e.catch(6),console.warn("[Transmit] session init failed",e.t0),e.abrupt("return",n);case 30:case"end":return e.stop()}},e,null,[[6,26]])}))).apply(this,arguments)}var Nt=null;function xt(e,n){var t;if(Nt)return console.log("[Transmit] initializeTransmit skipped — manager already initialised"),Nt;var i=bn.get();if(!i)return console.warn("[Transmit] initializeTransmit skipped — no tracking URL"),null;var r=o(e);if(!r)return console.warn("[Transmit] initializeTransmit skipped — no player"),null;var a=(null===(t=r.el())||void 0===t?void 0:t.querySelector("video"))||null,l=function(e){try{var n="function"==typeof(null==e?void 0:e.currentSrc)&&e.currentSrc()||"function"==typeof(null==e?void 0:e.src)&&e.src()||"";if("application/dash+xml"===("function"==typeof(null==e?void 0:e.currentType)&&e.currentType()||"")||String(n).includes(".mpd"))return n}catch(e){}return null}(r);return(Nt=new Lt(a,r,function(e){var t,i;console.log("[Transmit] ad event",e);var r=null==n||null===(t=n.customData)||void 0===t||null===(i=t.ads)||void 0===i?void 0:i.adEventHandler;if("function"==typeof r)try{r(e)}catch(e){console.warn("[Transmit] adEventHandler threw",e)}},{dashManifestUrl:l})).configure({disableTrackingEvents:!1}),Nt.addTrackingUrl(i),Nt.onManifestUpdated(),Nt}function Wt(){Nt&&(Nt.release(),Nt=null)}function Ut(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}var Bt=function(e){i(e).play()},Mt=function(e){i(e).pause()},Ht=function(e,n){var t=i(e),r=t.currentTime()+n;t.currentTime(r)},Gt=function(e,n){var t=i(e),r=t.currentTime(),o=r<=n?0:r-n;t.currentTime(o)},qt=function(e){return!!i.getPlayer("".concat(e))},Qt=function(e){return i(e).paused()},Yt=function(){var e=n(t.mark(function e(i,r){var a,l,d,u=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=u.length>2&&void 0!==u[2]&&u[2],e.next=3,Z();case 3:return l=e.sent,d=o(i),e.abrupt("return",new Promise(function(e,o){j(r,l).then(function(){var o=n(t.mark(function n(o){var l,u,c,v,f,m,p,h,g,y,w;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(Wt(),m=null==o?void 0:o.data,s()||(window.sid=be()),m.contentType="linearchannel",m.channelId=null==r?void 0:r.channelId,p=(null===(l=window.customData)||void 0===l?void 0:l.ads)||(null===(u=window)||void 0===u||null===(c=u.app_data)||void 0===c||null===(v=c.appcmsMain)||void 0===v?void 0:v.adsConfig)||{},h=!(null==m||null===(f=m.linearchannel)||void 0===f||!f.isSSAIEnabled),g=h&&"MEDIA_TAILOR"==(null==p?void 0:p.vodAdSticherProvider),y=h&&"TRANSMIT"==(null==p?void 0:p.liveAdSticherProvider)&&!(null==p||!p.liveAdClientSideTracking),w=He(m,i),!g){n.next=17;break}return n.next=13,Sn(i,m);case 13:w=n.sent,a=!0,n.next=22;break;case 17:if(!y){n.next=22;break}return n.next=20,Rt(w,m,i);case 20:w=n.sent,a=!0;case 22:re(m),w&&a?($t(i,w),y?xt(i,{customData:window.customData||{ads:p}}):g&&Mn(i),d.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:m})})):(hn.get()&&0!==Object.keys(hn.get()).length&&gn({playerId:i,comscore:{enable:!0}}),e({status:!0,msg:"Feed authenticated",response:m}));case 24:case"end":return n.stop()}},n)}));return function(e){return o.apply(this,arguments)}}()).catch(function(e){o({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),zt=function(){var e=n(t.mark(function e(i,r,a){var l,s,d,u,c,v,p;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Z();case 2:return u=e.sent,console.log("load video"),(le()||null)&&ve(r),c=0,v=0,p=null,null!==(l=window)&&void 0!==l&&l.watchHistory&&null!==(s=window)&&void 0!==s&&null!==(d=s.watchHistory)&&void 0!==d&&d.enable&&N(r,u).then(function(e){var n,t,i,r,o,a,l;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),c=(null==e||null===(o=e.data)||void 0===o?void 0:o.watchedTime)||null,(v=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null)<95)&&(p=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null)}).catch(function(e){var n,t,i,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(e))}),e.abrupt("return",new Promise(function(e,a){F(r,u).then(function(){var r=n(t.mark(function n(r){var l,s,d,u,h,g,y,w,T,_,I,b,E,S,k,A,O,D,L,P,C,F,j,R,V,N,x,W,U,B,M,H,G,q,Q,Y,z,K,X,J;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(A=null==r?void 0:r.data,O=(null==A?void 0:A.contentType)||"video",D=(null===(l=window.customData)||void 0===l?void 0:l.ads)||(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(u=d.appcmsMain)||void 0===u?void 0:u.adsConfig)||{},L=!(null==A||null===(h=A[O])||void 0===h||!h.isSSAIEnabled),P=L&&"MEDIA_TAILOR"==(null==D?void 0:D.vodAdSticherProvider),C=L&&"TRANSMIT"==(null==D?void 0:D.liveAdSticherProvider)&&!(null==D||!D.liveAdClientSideTracking),F=!(null==A||null===(g=A[O])||void 0===g||null===(y=g.streamingInfo)||void 0===y||!y.isLiveStream)||"linearchannel"===O,re(r.data),(j=(null==A||null===(w=A.ads)||void 0===w||null===(T=w.preRoll)||void 0===T||null===(_=T.adTags)||void 0===_||null===(I=_.web)||void 0===I?void 0:I.active)&&(null==A||null===(b=A.ads)||void 0===b||null===(E=b.preRoll)||void 0===E||null===(S=E.adTags)||void 0===S||null===(k=S.web)||void 0===k?void 0:k.url))&&$e(i,j,A),R=He(A,i),!P){n.next=17;break}return n.next=14,Sn(i,A);case 14:R=n.sent,n.next=22;break;case 17:if(!C||!F){n.next=22;break}return Wt(),n.next=21,Rt(R,A,i);case 21:R=n.sent;case 22:if(!R){n.next=37;break}if((null==A||null===(V=A.video)||void 0===V||null===(N=V.gist)||void 0===N?void 0:N.videoImageUrl)||null==A||null===(x=A.video)||void 0===x||null===(W=x.gist)||void 0===W||null===(U=W.imageGist)||void 0===U||U.r16x9,Q=o(i)){n.next=28;break}return console.error("[VL][player-core] player not found for id=".concat(i),{player:Q}),n.abrupt("return",a({status:!1,msg:"Player not found",response:{}}));case 28:$t(i,R),C&&F?xt(i,{customData:window.customData||{ads:D}}):P&&Fn(i,p),Q.on("loadstart",function(){F&&e({status:!0,msg:"Video Loaded",response:A})}),Q.on("loadeddata",function(){Xe(),e({status:!0,msg:"Video Loaded",response:A})}),Q.one("play",function(){!c||P||C&&F||v<95&&setTimeout(function(){Q.currentTime(c)},0)}),Q.one("error",function(){var e;a({status:!1,msg:(null==Q||null===(e=Q.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==A||null===(B=A.video)||void 0===B||null===(M=B.contentDetails)||void 0===M||null===(H=M.closedCaptions)||void 0===H?void 0:H.length)>0||(null==A||null===(G=A.video)||void 0===G||null===(q=G.closedCaptions)||void 0===q?void 0:q.length)>0?(J=(null==A||null===(z=A.video)||void 0===z||null===(K=z.contentDetails)||void 0===K?void 0:K.closedCaptions)||(null==A||null===(X=A.video)||void 0===X?void 0:X.closedCaptions),Y=J.filter(function(e){return"VTT"===e.format}),m(i,Y)):f(i),n.next=39;break;case 37:Ke(i,"Incompatible Source, only hls,mp4,drm content is allowed"),a("Incompatible Source, only hls,mp4,drm content is allowed");case 39:case"end":return n.stop()}},n)}));return function(e){return r.apply(this,arguments)}}()).catch(function(e){Zt(e,i,a,r)})}));case 11:case"end":return e.stop()}},e)}));return function(n,t,i){return e.apply(this,arguments)}}(),Kt=function(e,n,t){var i=o(e);return i.src(n),new Promise(function(e,n){var r=0;i.one("loadedmetadata",function(){clearTimeout(r),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){r=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},Xt=function(e){Wt();var n=o(e),t=(hn.get()||{}).destroyComscoreTag;if(Jt(),t&&t(),l(),window.onresize=null,n)n.dispose();else{var i=document.getElementById(e);i&&i.remove()}},Jt=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},$t=function(e,n){console.log("load video in core",n);var t=o(e);t&&t.src(n)},Zt=function(n,t,i,r){var o,a,l,s,d,u,c=null==n||null===(o=n.response)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(s=l.data)||void 0===s?void 0:s.errorMessage)||(null==n?void 0:n.message);qt(t)&&Ke(t,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[c])||"".concat(v)),i&&i(function(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ut(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Ut(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}({status:!1,response:n,msg:"".concat(v)},r&&{videoId:r}))},ei=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var i=n.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var r=n.getElementsByClassName("vjs-fullscreen-control")[0];r&&(r.style.display="none")};export{Qt as $,Z as A,j as B,R as C,Ce as D,fe as E,ae as F,Kt as G,Ht as H,Bt as I,Mt as J,Gt as K,qt as L,zt as M,Yt as N,Xt as O,U as P,vn as Q,te as R,W as S,ge as T,ee as U,H as V,B as W,S as X,Cn as Y,Ze as Z,se as _,je as a,de as a0,xt as a1,Mn as a2,Fn as a3,x as a4,ce as a5,ve as a6,le as b,hn as c,Fe as d,oe as e,He as f,Ee as g,re as h,gn as i,Xe as j,Ke as k,$t as l,ue as m,ei as n,Rt as o,Pe as p,$e as q,ze as r,V as s,bn as t,Sn as u,ie as v,ne as w,F as x,N as y,Zt as z};
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import{g as t,p as n,d as i}from"./skin-4f84b841.js";import{_ as a,b as l}from"./generic-8344606d.js";import{s as o}from"./autoNextVideo-a73988b8.js";import{e as r}from"./icons-699e8cf0.js";import d from"@babel/runtime/helpers/typeof";import s from"video.js";var c,u,m,p,v=[],f=!1,h=null,g=!1,x=null,y=null,C=function(){null!=h&&(clearInterval(h),h=null),g=!1},E="next-ep-preview-player-thumb",N=function(e,t){if(e){var n,i,a,l,o;(null==(n=t)||null===(i=n.gist)||void 0===i||null===(a=i.imageGist)||void 0===a?void 0:a.r16x9)||(null==n?void 0:n.img)||null===(l=window)||void 0===l||null===(o=l.customData)||void 0===o||o.fallbackImage;var r=e.getElementsByClassName(E)[0];r||((r=document.createElement("div")).className=E,r.setAttribute("aria-hidden","true"),e.appendChild(r))}},b=function(e,t){if(e){var n=e.getElementsByClassName(E)[0];n&&(n.style.visibility=t?"visible":"hidden")}},w=function(){var e=document.createElement("div");e.className="next-heading-wrapper";var t=document.createElement("div");t.className="next-ep-header";var i=document.createElement("span");i.className="next-ep-header-text",i.textContent="UP NEXT CLIP in";var a=document.createElement("span");a.className="next-ep-duration",a.textContent="10",t.append(i,a);var l=document.createElement("div");return l.className="next-ep-close",l.appendChild(n(r())),e.append(t),e.append(l),e},A=function(e,t,n,a){var l,o,r,d,s,c=null==e?void 0:e.title,u=(null==e||null===(l=e.gist)||void 0===l?void 0:l.description)||(null==e?void 0:e.description)||"",m=document.createElement("div");m.className="next-ep-content";var p=document.createElement("div");p.className="next-ep-thumb-wrap";var v=document.createElement("img");v.className="next-ep-img",v.alt="",v.src=(null==e||null===(o=e.gist)||void 0===o||null===(r=o.imageGist)||void 0===r?void 0:r.r16x9)||(null==e?void 0:e.img)||(null===(d=window)||void 0===d||null===(s=d.customData)||void 0===s?void 0:s.fallbackImage);var h=function(e){if(null==e||Number.isNaN(Number(e)))return"";var t=Math.floor(Number(e)),n=Math.floor(t/60),i=t%60;return"".concat(n,":").concat(String(i).padStart(2,"0"))}(null==e?void 0:e.runtime),g=document.createElement("div");g.className="next-ep-thumb-runtime",g.textContent=h,h||g.classList.add("next-ep-thumb-runtime--empty"),p.appendChild(v),p.appendChild(g);var x=document.createElement("div");x.className="next-ep-meta";var y=document.createElement("div");y.className="next-ep-title",y.textContent="".concat(c||"");var E=document.createElement("div");E.className="next-ep-desc",E.textContent=u||"",String(u||"").trim()||E.classList.add("next-ep-desc--empty");var N=document.createElement("div");N.className="next-ep-meta-row";var b=document.createElement("span");b.className="next-ep-badge";var w=function(e){if(null==e?void 0:e.isClip)return"CLIP"}(e);b.textContent=w,w||b.classList.add("next-ep-badge--empty");var A=document.createElement("span");A.className="next-ep-episode",A.textContent=function(e){if(!e||"string"!=typeof e)return"";var t=e.match(/^S(\d+)\s*E(\d+)$/i)||e.match(/^S(\d+)E(\d+)$/i);return t?"S".concat(t[1]," E").concat(Number(t[2])):e}(null==e?void 0:e.episodeDisplayAttribute)||"";var L=document.createElement("div");L.className="next-ep-meta-row-left",L.appendChild(b),L.appendChild(A);var B=document.createElement("img");B.className="next-ep-network-logo",B.alt="";var I=function(e){var t,n,i,a=null===(t=window)||void 0===t||null===(n=t.app_data)||void 0===n||null===(i=n.appcmsMain)||void 0===i?void 0:i.networks;if(e&&a)return a.find(function(t){if(t.identifier==e)return t}).badgeImage}(null==e?void 0:e.network);I?B.src=I:B.classList.add("next-ep-network-logo--empty"),N.appendChild(L),x.appendChild(y),x.appendChild(E),x.appendChild(N);var P=document.createElement("div");return P.className="next-ep-meta-with-logo",P.appendChild(x),P.appendChild(B),m.appendChild(p),m.appendChild(P),m.onclick=i(function(){C(),null==t||t.remove(),f=!0,S(n)},400),m},L=function(n,i){var o;if(f=!1,null!=i&&null!==(o=i.series)&&void 0!==o&&o.enable){var r;v=[];var d=l();null==d||d.map(function(t){var n;return(n=v).push.apply(n,e(t.episodes))}),null==i||null===(r=i.series)||void 0===r||r.cb}else{var s,c;v=(null==i||null===(s=i.relatedVideos)||void 0===s?void 0:s.content)||[],null==i||null===(c=i.relatedVideos)||void 0===c||c.cb}var u=t(n);if(u){!function(e){e&&y&&(e.off("timeupdate",y),y=null)}(t(x)),C(),x=n,y=function(){var e,t;if(!f){var i=u.duration(),l=u.currentTime(),o=Number.isFinite(i)&&i>0?i-l:1/0,r=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0],d=document.getElementById(n),s=a()<=(null===(t=v)||void 0===t?void 0:t.length)-1;if(o>1){if(null!=h||g){C();var c=null==r?void 0:r.querySelector(".next-ep-header .next-ep-duration");c&&(c.textContent="10")}return r&&(r.style.visibility="hidden"),void b(d,!1)}s?(r&&(r.style.visibility="visible"),b(d,!0),g||null!=h||(u.pause(n),g=!0,function(e){var t;if(null==h){var n=null===(t=document.getElementsByClassName("next-ep-preview"))||void 0===t?void 0:t[0],i=null==n?void 0:n.querySelector(".next-ep-header .next-ep-duration");if(i){var l=10;i.textContent="10",h=setInterval(function(){l--,i.textContent=String(l),0===l&&(clearInterval(h),h=null,g=!1,v.filter(function(e,t){return t==a()}),S(e))},1e3)}}}(n))):b(d,!1)}},u.on("timeupdate",y);var m,p=v.filter(function(e,t){return t==a()});if((null==p?void 0:p.length)>0)if(null!==(m=document.getElementsByClassName("next-ep-preview"))&&void 0!==m&&m[0]){var E,L,B=null===(E=document.getElementsByClassName("next-ep-preview"))||void 0===E?void 0:E[0];B.style.visibility="hidden",null===(L=B.querySelector(".next-ep-preview-inner"))||void 0===L||L.remove(),Array.from(B.children).forEach(function(e){e.classList.contains("next-ep-content")&&e.remove()});var I=B.querySelector(".next-heading-wrapper");if(I){var P=I.querySelector(".next-ep-header"),k=null==P?void 0:P.querySelector(".next-ep-duration");if(!k&&P){P.textContent="";var j=document.createElement("span");j.className="next-ep-header-text",j.textContent="UP NEXT CLIP in",(k=document.createElement("span")).className="next-ep-duration",k.textContent="10",P.append(j,k)}else k&&(k.textContent="10")}else I=w(),B.insertBefore(I,B.firstChild);B.appendChild(A(p[0],B,n));var q=document.getElementById(n);N(q,p[0]),b(q,!1);var F=B.querySelector(".next-ep-close");F&&(F.onclick=function(){C(),B.style.visibility="hidden",f=!0,b(q,!1)})}else{var O=document.createElement("div");O.className="next-ep-preview",O.style.visibility="hidden";var T=document.getElementById(n);T.append(O);var X=w();X.querySelector(".next-ep-close").onclick=function(){C(),O.style.visibility="hidden",f=!0,b(T,!1)},O.append(X);var M=A(p[0],O,n);O.append(M),N(T,p[0]),b(T,!1)}}},S=function(e,n){var i=t(e);if(i){var l=i.duration();if(Number.isFinite(l)&&!(l<=0)){i.pause(e);var r=a();o(r,e,v)}}};function B(e,n){var i=t(e),a=null==n?void 0:n.tvProviderLogoUrl;if(a){var l=document.createElement("div");l.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(a),o.alt="Provider Image",l.append(o),i.el().appendChild(l),i.on("useractive",function(){l.classList.remove("vjs-fade")}),i.on("userinactive",function(){i.paused()||l.classList.add("vjs-fade")}),i.on("fullscreenchange",function(){i.isFullscreen_?l.style.top="3.2rem":l.style.top="1rem"})}}c={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},u=function e(){var t,n,i,a,l;for(i in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in a=t[i])a.hasOwnProperty(l)&&("object"===d(a[l])?n[l]=e(n[l],a[l]):n[l]=a[l]);return n},m=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},p=function e(t){return"HTML"!==t.nodeName&&"static"===m(t)("position")?e(t.offsetParent):t},s.registerPlugin("thumbnails",function(e){var t,n,i,a,l,o,r,d;function s(){document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",s),d()}n=u({},c,e),a=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=a.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",i=document.createElement("img"),t.appendChild(i),i.src=n[0].src,i.className="vjs-thumbnail",u(i.style,n[0].style),i.style.left||i.style.right||(i.onload=function(){i.style.left=-i.naturalWidth/2+"px"}),o=a.duration(),a.on("durationchange",function(e){o=a.duration()}),a.on("loadedmetadata",function(e){o=a.duration()}),(l=a.controlBar.progressControl).el().appendChild(t),r=function(e){var a,r,d,s,c,v,f,h,g,x;for(r in d=0,g=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((x=p(l.el()).getBoundingClientRect()).width||x.right)+g,v=e.pageX,e.changedTouches&&(v=e.changedTouches[0].pageX),s=v||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=p(l.el()).getBoundingClientRect().left+g,a=Math.floor((s-l.el().offsetLeft)/l.width()*o),n)a>r&&(d=Math.max(d,r));(c=n[d]).src&&i.src!=c.src&&(i.src=c.src),c.style&&i.style!=c.style&&u(i.style,c.style),s+(h=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=m(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(i,c.width||n[0].width)/2)>f?s-=s+h-f:s<h&&(s=h),t.style.left=s+"px"},l.on("mousemove",r),l.on("touchmove",r),l.on("pointerdown",function(e){document.addEventListener("pointermove",r),document.addEventListener("pointerup",s)}),d=function(e){t.style.left="-1000px"},l.on("mouseout",d),l.on("touchcancel",d),l.on("touchend",d),a.on("userinactive",d)});export{L as a,B as b};
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import{g as t,p as n,d as o}from"./skin-4f84b841.js";import{_ as i,b as l}from"./generic-aa51d117.js";import{s as a}from"./autoNextVideo-0e191368.js";import{e as r}from"./icons-699e8cf0.js";import s from"@babel/runtime/helpers/typeof";import d from"video.js";var c,u,m,v,p=[],f=!1,g=function(a,s){var d;if(f=!1,null!=s&&null!==(d=s.series)&&void 0!==d&&d.enable){var c;p=[];var u=l();null==u||u.map(function(t){var n;return(n=p).push.apply(n,e(t.episodes))}),null==s||null===(c=s.series)||void 0===c||c.cb}else{var m,v;p=(null==s||null===(m=s.relatedVideos)||void 0===m?void 0:m.content)||[],null==s||null===(v=s.relatedVideos)||void 0===v||v.cb}var g=t(a);g.on("timeupdate",function(){var e,t;if(!f){var n=Math.floor(g.currentTime()),o=g.duration(),l=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];o-n<=10&&i()<=(null===(t=p)||void 0===t?void 0:t.length)-1?l&&(l.style.visibility="visible"):l&&(l.style.visibility="hidden")}});var y,A=p.filter(function(e,t){return t==i()});if((null==A?void 0:A.length)>0)if(null!==(y=document.getElementsByClassName("next-ep-preview"))&&void 0!==y&&y[0]){var x,w,E,b,C,N,B,L,j,k,P,O;(null===(x=document.getElementsByClassName("next-ep-preview"))||void 0===x?void 0:x[0]).style.visibility="hidden";var I=null===(w=document.getElementsByClassName("next-ep-title"))||void 0===w?void 0:w[0],M=null===(E=document.getElementsByClassName("next-ep-img"))||void 0===E?void 0:E[0],T=null===(b=document.getElementsByClassName("next-ep-content"))||void 0===b?void 0:b[0],F=null===(C=A[0])||void 0===C?void 0:C.title;(null===(N=F)||void 0===N?void 0:N.length)>60&&(F=F.substr(0,60)+"..."),I.textContent="".concat(F),M.src=(null===(B=A[0])||void 0===B||null===(L=B.gist)||void 0===L||null===(j=L.imageGist)||void 0===j?void 0:j.r16x9)||(null==A||null===(k=A[0])||void 0===k?void 0:k.img)||(null===(P=window)||void 0===P||null===(O=P.customData)||void 0===O?void 0:O.fallbackImage),T.onclick=function(){return h(a)}}else{var X,R,D,G,S,V,H,_,Q=document.createElement("div");Q.className="next-ep-preview",Q.style.visibility="hidden",document.getElementById(a).append(Q);var U=document.createElement("div");U.className="next-heading-wrapper";var W=document.createElement("div");W.className="next-ep-header",W.textContent="Next up";var Y=document.createElement("div");Y.className="next-ep-close",Y.onclick=function(){Q.style.visibility="hidden",f=!0},Y.appendChild(n(r())),U.append(W),U.append(Y);var q=null===(X=A[0])||void 0===X?void 0:X.title,z=document.createElement("img");z.className="next-ep-img",z.src=(null===(R=A[0])||void 0===R||null===(D=R.gist)||void 0===D||null===(G=D.imageGist)||void 0===G?void 0:G.r16x9)||(null==A||null===(S=A[0])||void 0===S?void 0:S.img)||(null===(V=window)||void 0===V||null===(H=V.customData)||void 0===H?void 0:H.fallbackImage);var J=document.createElement("div");J.className="next-ep-title",(null===(_=q)||void 0===_?void 0:_.length)>60&&(q=q.substr(0,60)+"..."),J.textContent="".concat(q);var K=document.createElement("div");K.className="next-ep-content",K.append(z),K.append(J),K.onclick=o(function(){null==Q||Q.remove(),f=!0,h(a)},400),Q.append(U),Q.append(K)}},h=function(e,n){var o=t(e),l=Math.floor(o.currentTime());if(Math.floor(o.duration())!=l){o.pause(e);var r=i();a(r,e,p)}};function y(e,n){var o=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var l=document.createElement("div");l.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",l.append(a),o.el().appendChild(l),o.on("useractive",function(){l.classList.remove("vjs-fade")}),o.on("userinactive",function(){o.paused()||l.classList.add("vjs-fade")}),o.on("fullscreenchange",function(){o.isFullscreen_?l.style.top="3.2rem":l.style.top="1rem"})}}c={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},u=function e(){var t,n,o,i,l;for(o in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[o])i.hasOwnProperty(l)&&("object"===s(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);return n},m=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},v=function e(t){return"HTML"!==t.nodeName&&"static"===m(t)("position")?e(t.offsetParent):t},d.registerPlugin("thumbnails",function(e){var t,n,o,i,l,a,r,s;function d(){document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",d),s()}n=u({},c,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",o=document.createElement("img"),t.appendChild(o),o.src=n[0].src,o.className="vjs-thumbnail",u(o.style,n[0].style),o.style.left||o.style.right||(o.onload=function(){o.style.left=-o.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",function(e){a=i.duration()}),i.on("loadedmetadata",function(e){a=i.duration()}),(l=i.controlBar.progressControl).el().appendChild(t),r=function(e){var i,r,s,d,c,p,f,g,h,y;for(r in s=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((y=v(l.el()).getBoundingClientRect()).width||y.right)+h,p=e.pageX,e.changedTouches&&(p=e.changedTouches[0].pageX),d=p||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,d-=v(l.el()).getBoundingClientRect().left+h,i=Math.floor((d-l.el().offsetLeft)/l.width()*a),n)i>r&&(s=Math.max(s,r));(c=n[s]).src&&o.src!=c.src&&(o.src=c.src),c.style&&o.style!=c.style&&u(o.style,c.style),d+(g=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=m(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(o,c.width||n[0].width)/2)>f?d-=d+g-f:d<g&&(d=g),t.style.left=d+"px"},l.on("mousemove",r),l.on("touchmove",r),l.on("pointerdown",function(e){document.addEventListener("pointermove",r),document.addEventListener("pointerup",d)}),s=function(e){t.style.left="-1000px"},l.on("mouseout",s),l.on("touchcancel",s),l.on("touchend",s),i.on("userinactive",s)});export{g as a,y as b};
@@ -1 +0,0 @@
1
- import"./index-0f069fa2.js";import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{t as r,g as n}from"./skin-4f84b841.js";import i from"@babel/runtime/helpers/defineProperty";import a from"@babel/runtime/helpers/slicedToArray";import{e as u}from"./generic-aa51d117.js";function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var l="my-player";function c(e){var t=e.split("\n"),r=[];return t.forEach(function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),n={resolution:null,uri:null};t.forEach(function(e){e.includes("RESOLUTION")&&(n.resolution=e.split("=")[1]),e.includes("URI")&&(n.uri=e.split("=")[1].replace(/"/g,""))}),r.push(n)}}),r}function p(){return(p=e(t.mark(function e(r){var n,i,u,o,s,l,c,p,d,m,f,b,g,v,h,x,y,w,k,E,j,N,A,T;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r._tiles){e.next=2;break}return e.abrupt("return",r._tiles);case 2:return e.prev=2,e.next=5,fetch(r.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return i=e.sent,e.next=11,createImageBitmap(i);case 11:for(u=e.sent,o=r.layout.split("x").map(Number),s=a(o,2),l=s[0],c=s[1],p=u.width/c,d=u.height/l,m=[],f=0;f<l;f++)for(b=0;b<c;b++)(g=document.createElement("canvas")).width=p,g.height=d,g.getContext("2d").drawImage(u,b*p,f*d,p,d,0,0,p,d),v=g.toDataURL("image/png"),m.push({uri:v,duration:r.duration}),r._tiles=m;return e.abrupt("return",m);case 20:for(e.prev=20,e.t0=e.catch(2),h=r.layout.split("x").map(Number),x=a(h,2),y=x[0],w=x[1],k=[],E=0;E<y*w;E++)k.push({uri:null===(j=window)||void 0===j||null===(N=j.app_data)||void 0===N||null===(A=N.appcmsMain)||void 0===A||null===(T=A.images)||void 0===T?void 0:T.placeholderCover,duration:r.duration});return e.abrupt("return",k);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function d(e,t){return m.apply(this,arguments)}function m(){return(m=e(t.mark(function e(r,n){var i,a;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=n,e.prev=1,e.next=4,fetch(r);case 4:return i=e.sent,e.next=7,i.text();case 7:return a=e.sent,e.abrupt("return",c(a));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function f(e,t,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=n(l);if(i&&a){var u=i.getBoundingClientRect(),o=(e.clientX-u.left)/u.width,s=function(e,t){var r,n;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var u=Math.floor((i+a)/2),o=t[u];if(o===e)return o;o<e?i=u+1:a=u-1}var s=null!==(r=t[i])&&void 0!==r?r:1/0,l=null!==(n=t[a])&&void 0!==n?n:-1/0;return Math.abs(s-e)<Math.abs(l-e)?s:l}(Math.round(o*a.duration()),r),c=t[s];c&&!c.loading&&(c.loading=!0,function(e){return p.apply(this,arguments)}(c).then(function(e){var t=e[c.tileIndex],r=document.querySelector(".vjs-thumbnail-holder img");r&&t.uri&&(r.src=t.uri),c.loading=!1,c.src=t.uri}))}}function b(e){return g.apply(this,arguments)}function g(){return(g=e(t.mark(function e(n){var u,o,l,c;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u={},n.forEach(function(e,t){for(var r=e.layout.split("x").map(Number),n=a(r,2),o=n[0]*n[1],l=e.duration,c=0;c<o;c++){var p,d=Math.round((t*o+c)*l);u[d]=s(s({},e),{},{duration:e.duration,tileIndex:c,loading:!1,style:(p={left:"-60px",height:"85px",width:"130px"},i(p,"left","-60px"),i(p,"border","1px solid transparent"),i(p,"borderRadius","4px"),p)})}}),o=Object.keys(u).map(Number).sort(function(e,t){return e-t}),null==(l=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||l.addEventListener("mousemove",r(function(e){return f(e,u,o)},500)),null==(c=document.querySelector(".vjs-progress-control.vjs-control"))||c.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",r(function(e){return f(e,u,o)},500))}),e.abrupt("return",u);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var v=function(){var r=e(t.mark(function e(r,n){var i,u,o,s,l,c,p,d;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(r+n);case 2:return i=e.sent,e.next=5,i.text();case 5:u=e.sent,o=u.split("\n").map(function(e){return e.trim()}),s=[],l=null,c=0;case 10:if(!(c<(null==o?void 0:o.length))){e.next=27;break}if(!(p=o[c]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},d=p.split(":")[1]||"",d.split(",").forEach(function(e){var t=e.split("="),r=a(t,2),n=r[0],i=r[1];n&&i&&(l[n.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!p.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(p.includes("jpg")||p.includes("png")||p.includes("jpeg"))&&(l.uri=p.includes("http")?p:r+p,s.push(l),l=null);case 24:c++,e.next=10;break;case 27:return e.abrupt("return",s);case 28:case"end":return e.stop()}},e)}));return function(e,t){return r.apply(this,arguments)}}();function h(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function x(e,t){return y.apply(this,arguments)}function y(){return(y=e(t.mark(function e(r,i){var o,s,c,p,d,m,f,b,g,v,x,y,E,j,N,A,T,O,I,S,M,P,R,$,B,D,L,U,C,X,q,_,F,W,z,G,H,J,K,Q,V,Y,Z,ee,te,re,ne,ie,ae,ue,oe,se,le,ce,pe,de,me,fe;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=i,o=n(i),s=r.split("/"),c=s.findIndex(function(e){return"dash"===e.toLowerCase()}),p=h(-1!==c?s.slice(0,c+1).join("/"):new URL(r).origin),e.prev=5,e.next=8,fetch(r);case 8:return b=e.sent,e.next=11,b.text();case 11:g=e.sent,v=new DOMParser,x=v.parseFromString(g,"application/xml"),y=(null==o?void 0:o.duration())||(null===(d=u())||void 0===d||null===(m=d.video)||void 0===m?void 0:m.runtime),E=(null==x||null===(f=x.querySelector("MPD > BaseURL"))||void 0===f?void 0:f.textContent)||p+"/",j=x.getElementsByTagName("AdaptationSet"),N=0;case 18:if(!(N<j.length)){e.next=72;break}if(("image"!==(A=j[N]).getAttribute("contentType")||"image/png"!==A.getAttribute("mimeType"))&&"image/jpeg"!==A.getAttribute("mimeType")){e.next=69;break}if(O=A.getElementsByTagName("SegmentTemplate")[0],I=null===(T=O.getElementsByTagName("SegmentTimeline"))||void 0===T?void 0:T[0],!O||!I){e.next=48;break}if(P=I.getElementsByTagName("S"),R=parseInt(null===(S=P[0])||void 0===S?void 0:S.getAttribute("t")),$=parseInt(null===(M=P[0])||void 0===M?void 0:M.getAttribute("d")),B=A.getElementsByTagName("Representation")[0],D=B.getElementsByTagName("EssentialProperty")[0],L=D.getAttribute("value"),U=null==L?void 0:L.split("x"),C=a(U,2),X=C[0],q=C[1],!O){e.next=46;break}if(O.getAttribute("media"),_=O.getAttribute("timescale"),F=(_?$/_:$)/(X*q),W=B.getAttribute("id"),z=Math.round(y/F),G=Math.ceil(z/(X*q)),H=O.getAttribute("media"),parseInt(O.getAttribute("startNumber")),!isNaN(parseInt(G))){e.next=43;break}return e.abrupt("return");case 43:for(J=[],N=0;N<G;N++)Q="/"==(K=H)[0]?new URL(p).origin:p+"/",J.push({duration:F,layout:L,uri:Q+K.replace("$Time$",R+N*$).replace("$RepresentationID$",W)});return e.abrupt("return",J);case 46:e.next=69;break;case 48:if(V=A.getElementsByTagName("Representation")[0],Y=V.getElementsByTagName("EssentialProperty")[0],Z=Y.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=a(ee,2),re=te[0],ne=te[1],!O){e.next=69;break}if(O.getAttribute("media"),ie=O.getAttribute("duration"),ae=O.getAttribute("timescale"),ue=(ae?ie/ae:ie)/(re*ne),oe=V.getAttribute("id"),se=Math.round(y/ue),le=Math.ceil(se/(re*ne)),ce=O.getAttribute("media"),pe=parseInt(O.getAttribute("startNumber"))||0,!isNaN(parseInt(le))){e.next=65;break}return e.abrupt("return");case 65:for(de=[],me=w(ce),N=0;N<le;N++)fe=me?k(me,N+pe):ce,de.push({duration:ue,layout:Z,uri:E+fe.replace("$Number$",N+pe).replace("$RepresentationID$",oe)});return e.abrupt("return",de);case 69:N++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}},e,null,[[5,76]])}))).apply(this,arguments)}function w(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function k(e,t){var r=e.match(/%0(\d+)d/);if(!r)return e;var n=parseInt(r[1],10),i=String(t).padStart(n,"0");return e.replace(/\$Number%0\d+d\$/,i)}function E(e){return j.apply(this,arguments)}function j(){return(j=e(t.mark(function e(r){var i,a,u,o,s,l,c,p,m,f,g,h,y,w,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s=n(r),l=s.currentSource(),c=l.src,c=null!==(i=c)&&void 0!==i&&i.includes("blob")?null==s||null===(a=s.getSource)||void 0===a?void 0:a.call(s):c,null===(u=c)||void 0===u||!u.includes("m3u8")){e.next=19;break}return e.next=6,d(c,r);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return m=(null==p?void 0:p[0])||null,f=m.uri,g=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,v(g,f);case 12:return h=e.sent,e.next=15,b(h);case 15:y=e.sent,s.thumbnails(y);case 17:e.next=28;break;case 19:if(null===(o=c)||void 0===o||!o.includes("mpd")){e.next=28;break}return e.next=22,x(c,r);case 22:if(!((null==(w=e.sent)?void 0:w.length)>0)){e.next=28;break}return e.next=26,b(w);case 26:k=e.sent,s.thumbnails(k);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}export{E as i};