@viewlift/player-backup 2.0.297-backup → 2.0.299-backup

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 (117) hide show
  1. package/cjs/autoNextVideo-fd60262d.js +1 -0
  2. package/cjs/bundle.css +480 -1123
  3. package/cjs/{caption-settings-8f59beca.js → caption-settings-544fd444.js} +1 -1
  4. package/cjs/{captions-6cbd3375.js → captions-80f6eb66.js} +1 -1
  5. package/cjs/{features-41c9fbc0.js → features-0ed32b63.js} +1 -1
  6. package/cjs/generic-ccfc8514.js +1 -0
  7. package/cjs/{index-58f88daa.js → index-0cb8083b.js} +1 -1
  8. package/cjs/index-467ad153.js +1 -0
  9. package/cjs/{index-3356fe8c.js → index-5698f530.js} +1 -1
  10. package/cjs/index.js +1 -1
  11. package/cjs/{multicamv2-405def83.js → multicamv2-25c95b47.js} +1 -1
  12. package/cjs/{multicamv2-4c36a4b6.js → multicamv2-cff7b8b7.js} +1 -1
  13. package/cjs/{nextEpisodeButton-06b4237d.js → nextEpisodeButton-8a0fd7c1.js} +1 -1
  14. package/cjs/playlist-2093b46a.js +1 -0
  15. package/cjs/{renditions-627bdfad.js → renditions-d28715a3.js} +1 -1
  16. package/cjs/{resolution-3af2cf1b.js → resolution-dbd4c97b.js} +1 -1
  17. package/cjs/{series-57af68b1.js → series-1e91f9ac.js} +1 -1
  18. package/cjs/series-v2-12c69b00.js +1 -0
  19. package/cjs/series-v2-e4df211a.js +1 -0
  20. package/cjs/{settings-icon-0642c8ef.js → settings-icon-f75ddcd4.js} +1 -1
  21. package/cjs/{skin-689e558c.js → skin-013d66cd.js} +1 -1
  22. package/cjs/skin-354f0a37.js +1 -0
  23. package/cjs/{skin-84d51e1a.js → skin-37723483.js} +1 -1
  24. package/cjs/{skin-08943309.js → skin-54cd0769.js} +1 -1
  25. package/{esm/skin-5aa955ae.js → cjs/skin-621e7720.js} +1 -1
  26. package/cjs/skin-79fa9c1d.js +1 -0
  27. package/cjs/skin-adc603f8.js +1 -0
  28. package/cjs/skin-c97f0eea.js +1 -0
  29. package/cjs/{skin-176ab1b5.js → skin-f8d5ccde.js} +1 -1
  30. package/cjs/skin-f9bdaa28.js +1 -0
  31. package/cjs/util-54e01671.js +1 -0
  32. package/cjs/videoSelector-72f75918.js +1 -0
  33. package/cjs/videoSelector-e93dfeda.js +1 -0
  34. package/esm/autoNextVideo-5a58fda1.js +1 -0
  35. package/esm/bundle.css +480 -1123
  36. package/esm/{caption-settings-7e20f930.js → caption-settings-106547c2.js} +1 -1
  37. package/esm/{captions-7e8712e5.js → captions-2b4caf69.js} +1 -1
  38. package/esm/components/auto-next-video/autoNextVideo.d.ts +0 -1
  39. package/esm/components/video-selector/videoSelector.d.ts +0 -4
  40. package/esm/components/video-selector_TEMP/videoSelector.d.ts +0 -4
  41. package/esm/components/watch-history/handleWatchHistory.d.ts +0 -1
  42. package/esm/{features-64dca26b.js → features-ce3dd24e.js} +1 -1
  43. package/esm/generic-585e9a5b.js +1 -0
  44. package/esm/helpers/skin.d.ts +1 -1
  45. package/esm/{icons-262bef63.js → icons-699e8cf0.js} +1 -1
  46. package/esm/index-0b88f09f.js +1 -0
  47. package/esm/{index-bb2d5dcb.js → index-6665f3a3.js} +1 -1
  48. package/esm/{index-ec92c082.js → index-7f9c8eec.js} +1 -1
  49. package/esm/index.d.ts +0 -16
  50. package/esm/index.js +1 -1
  51. package/esm/{multicamv2-9f875b4b.js → multicamv2-1279caf9.js} +1 -1
  52. package/esm/{multicamv2-2f4829b6.js → multicamv2-6604d8ad.js} +1 -1
  53. package/esm/{nextEpisodeButton-ac6afcd4.js → nextEpisodeButton-3eceb957.js} +1 -1
  54. package/esm/playlist-2ccec51c.js +1 -0
  55. package/esm/{renditions-620d93b3.js → renditions-19f0b3a9.js} +1 -1
  56. package/esm/{resolution-2ee017b4.js → resolution-8cbda37b.js} +1 -1
  57. package/esm/{series-5ddcd5da.js → series-991c6b60.js} +1 -1
  58. package/esm/series-v2-5ef2d921.js +1 -0
  59. package/esm/series-v2-bf3a1b5a.js +1 -0
  60. package/esm/{settings-icon-c65eb622.js → settings-icon-d7dfe9a5.js} +1 -1
  61. package/esm/{skin-7d5ba59b.js → skin-2803a6e0.js} +1 -1
  62. package/esm/skin-2bf3a2e2.js +1 -0
  63. package/esm/{skin-c9f7f5a9.js → skin-30bb7f84.js} +1 -1
  64. package/esm/skin-3d3bb91f.js +1 -0
  65. package/esm/skin-4d3a08d2.js +1 -0
  66. package/esm/skin-4f84b841.js +1 -0
  67. package/esm/skin-70f86676.js +1 -0
  68. package/esm/{skin-6dd7871e.js → skin-a45c710d.js} +1 -1
  69. package/esm/skin-a9fb0c5e.js +1 -0
  70. package/esm/{skin-a3b2c49d.js → skin-fed5e057.js} +1 -1
  71. package/esm/util-36d2ab03.js +1 -0
  72. package/esm/videoSelector-03b3ffcb.js +1 -0
  73. package/esm/videoSelector-bc53c149.js +1 -0
  74. package/package.json +1 -1
  75. package/viewlift-player-backup-2.0.299-backup.tgz +0 -0
  76. package/cjs/autoNextVideo-fa3874dd.js +0 -1
  77. package/cjs/generic-801833b3.js +0 -1
  78. package/cjs/index-0c4eda18.js +0 -1
  79. package/cjs/index-322d6c89.js +0 -1
  80. package/cjs/index-8a9a9d4f.js +0 -1
  81. package/cjs/playlist-85bada7f.js +0 -1
  82. package/cjs/relatedVideosManager-eeeaf32c.js +0 -1
  83. package/cjs/series-v2-3beafe90.js +0 -1
  84. package/cjs/series-v2-b9736535.js +0 -1
  85. package/cjs/skin-0ab416f5.js +0 -1
  86. package/cjs/skin-2d394a3c.js +0 -1
  87. package/cjs/skin-66dce245.js +0 -1
  88. package/cjs/skin-82457814.js +0 -1
  89. package/cjs/skin-9a8dd48d.js +0 -1
  90. package/cjs/skin-ba5e2587.js +0 -1
  91. package/cjs/skin-bea108bd.js +0 -1
  92. package/cjs/videoSelector-d1329ec3.js +0 -1
  93. package/cjs/videoSelector-ec9b4d4b.js +0 -1
  94. package/esm/autoNextVideo-24cb6191.js +0 -1
  95. package/esm/components/chapters/events.d.ts +0 -15
  96. package/esm/components/chapters/index.d.ts +0 -13
  97. package/esm/components/chapters/markers.d.ts +0 -16
  98. package/esm/components/chapters/store.d.ts +0 -5
  99. package/esm/components/chapters/timelineMapper.d.ts +0 -35
  100. package/esm/generic-90eeea98.js +0 -1
  101. package/esm/index-362fad37.js +0 -1
  102. package/esm/index-5c79c125.js +0 -1
  103. package/esm/index-b4d31515.js +0 -1
  104. package/esm/playlist-a9e0c098.js +0 -1
  105. package/esm/relatedVideosManager-8dd9aa24.js +0 -1
  106. package/esm/series-v2-87d9cd76.js +0 -1
  107. package/esm/series-v2-f8c95b76.js +0 -1
  108. package/esm/skin/cn_news/skin.d.ts +0 -1
  109. package/esm/skin-2114817e.js +0 -1
  110. package/esm/skin-3653c5b3.js +0 -1
  111. package/esm/skin-578253c6.js +0 -1
  112. package/esm/skin-7260af27.js +0 -1
  113. package/esm/skin-e1f32725.js +0 -1
  114. package/esm/skin-ebecbb07.js +0 -1
  115. package/esm/utilities/relatedVideosManager.d.ts +0 -11
  116. package/esm/videoSelector-c2f3514d.js +0 -1
  117. package/esm/videoSelector-dea33c02.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-3653c5b3.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-7e8712e5.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 b from"@babel/runtime/helpers/classCallCheck";import I 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={name:"@viewlift/player",version:"2.1.49",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"}},O={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 D(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 P(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?D(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):D(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var L,C=(L={},{setConfig:function(e){L=P(P({},L),e)},getConfig:function(){return L}}),F=function(e){return!!e&&"drm"===function(e){var n;if(5===Number(null==e?void 0:e.code))return"drm";var t="".concat(null!==(n=null==e?void 0:e.code)&&void 0!==n?n:""," ").concat(function(e){var n,t,i,r,o;return(null==e||null===(n=e.response)||void 0===n||null===(t=n.data)||void 0===t?void 0:t.errorMessage)||(null==e||null===(i=e.response)||void 0===i||null===(r=i.data)||void 0===r?void 0:r.message)||(null==e||null===(o=e.response)||void 0===o?void 0:o.statusText)||(null==e?void 0:e.message)||"unknown_error"}(e)).toLowerCase();return/(drm|license|widevine|playready|fairplay|eme|key|hdcp)/.test(t)?"drm":/(network|manifest|segment|playlist|http|xhr|fetch|timeout)/.test(t)?"network":/(decode|mediaerror|mediasource|appendbuffer|sourcebuffer)/.test(t)?"decode":"player"}(e)},j=function(e,n){var t=String(n||"").toLowerCase();if(t.includes("license"))return"license";if(t.includes("certificate"))return"server_certificate";if(t.includes("manifest"))return"manifest";if(t.includes("key"))return"key";if(t.includes("segment")||t.includes("media"))return"segment";var i=String(e||"").split("?")[0].toLowerCase();return i.endsWith(".mpd")||i.endsWith(".m3u8")||i.endsWith(".ism/manifest")?"manifest":/\.(m4s|mp4|m4a|m4v|ts|aac|webm|cmf[av]|mp4a)$/.test(i)?"segment":/license|widevine|playready|fairplay|drm/.test(i)?"license":/cert|certificate/.test(i)?"server_certificate":/\.key($|\?)/.test(i)||/\/key\//.test(i)?"key":"other"},R=new Set(["license","key","server_certificate"]),N=function(e){return R.has(e)},V=function(e,n){for(var t=0,i=[null==e?void 0:e.statusCode,null==e?void 0:e.status,null==e?void 0:e.code,null==n?void 0:n.statusCode,null==n?void 0:n.status,null==n?void 0:n.code];t<i.length;t++){var r=Number(i[t]);if(Number.isFinite(r)&&r>0)return r}return null},W=function(e){return null==e||e>=200&&e<400};function x(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 M="asset_not_found",U="geo_blocking_issue",B="entitlement_mismatch",H="DRM/License Failures",G=[/geo[\s_-]?block/i,/geo[\s_-]?restrict/i,/geographic/i,/not available in your/i,/outside.*(?:region|country|territory)/i,/\bcountry\b/i,/\bterritory\b/i],q=[/entitlement/i,/not entitled/i,/subscription/i,/not subscribed/i,/access denied/i,/\bunauthorized\b/i,/\bforbidden\b/i,/\bpremium\b/i,/upgrade required/i],z=[/not found/i,/no content/i,/does not exist/i,/\bmissing\b/i,/not available/i],Q=function(n,t,i){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};console.log("emitApiErrorEvent",{apiName:n,error:t,errorCategory:i,meta:o});var a=function(){var e,n,t,i,r=C.getConfig()||{};return(null==r?void 0:r.apiErrorCb)||(null==r?void 0:r.onApiError)||(null==r||null===(e=r.customData)||void 0===e?void 0:e.apiErrorCb)||(null==r||null===(n=r.customData)||void 0===n?void 0:n.onApiError)||(null==r||null===(t=r.customData)||void 0===t||null===(i=t.callbacks)||void 0===i?void 0:i.onApiError)||null}();if("function"==typeof a){var l=(null==t||null===(r=t.response)||void 0===r?void 0:r.status)||(null==t?void 0:t.status)||"unknown",s=function(e){var n,t,i,r,o;return(null==e||null===(n=e.response)||void 0===n||null===(t=n.data)||void 0===t?void 0:t.errorMessage)||(null==e||null===(i=e.response)||void 0===i||null===(r=i.data)||void 0===r?void 0:r.message)||(null==e||null===(o=e.response)||void 0===o?void 0:o.statusText)||(null==e?void 0:e.message)||"unknown_error"}(t),d=function(e,n,t){var i=Number(e),r=String(n||"");return F(t)?H:G.some(function(e){return e.test(r)})?U:q.some(function(e){return e.test(r)})?B:z.some(function(e){return e.test(r)})||404===i?M:451===i?U:B}(l,s,t),u=function(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?x(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):x(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}({errorcode:l,errormessage:s,errorcategory:i||d},o);n&&(u.apiPath=n);try{a(d,u)}catch(e){console.warn("[VLPlayer] apiError callback failed:",e)}}};function Y(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 K(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Y(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var X=A;window.vl_player_version=X.version;var J,$=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":oe.get()+"".concat(null==O?void 0:O.getVideoDetails)},Z=function(e,n){var t,i,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse)return 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})});var a,l,s,d,u=$();return r({url:$(),params:K({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:o},null===(a=window)||void 0===a||null===(l=a.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":X.version,"x-player-name":"videojs",adbTempToken:null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d?void 0:d.adbTempToken},withCredentials:!0}).catch(function(n){throw Q(u,n,"content",{id:e}),n})},ee=function(e,n){var t,i,o,a,l,s,d=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse)return 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})});var u=oe.get()+O.getLinearChannelDetails;return r({url:u,params:K(K(K(K(K({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}}).catch(function(n){throw Q(u,n,"content",{id:null==e?void 0:e.id,channelId:null==e?void 0:e.channelId,programId:null==e?void 0:e.programId}),n})},ne=function(e,n){var t,i,o=_e(n),a=(null==o?void 0:o.site)||null;if(null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.seriesData)return 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})});var l=oe.get()+"/v3/content/series/".concat(e);return r({url:l,params:{site:a},method:"GET",headers:{Authorization:n}}).catch(function(n){throw Q(l,n,"content",{id:e}),n})},te=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,we();case 2:return i=e.sent,e.abrupt("return",r({url:oe.get()+"".concat(null==O?void 0:O.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:K({},n),params:K({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}).catch(function(e){throw Q("saveWatchHistory",e,"content",{videoId:null==n?void 0:n.videoId,profileId:null==n?void 0:n.profileId}),e}));case 4:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),ie=function(e,n){var t,i,o=window.contentType,a=oe.get()+"".concat(null==O?void 0:O.getVideoInfoV2,"/").concat(o,"/").concat(e);return r({method:"GET",url:a,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}).catch(function(n){throw Q(a,n,"content",{videoId:e,contentType:o}),n})},re=function(e){var n=e.videoId,t=oe.get()+"".concat(null==O?void 0:O.getSeriesWatchHistoryV2,"/").concat(n);return r({method:"GET",url:t,headers:{Authorization:e.token},timeout:15e3}).catch(function(i){throw Q(t,i,"content",{seriesId:n,videoId:null==e?void 0:e.videoId}),i})},oe=(J=null==O?void 0:O.apiBaseUrl,{set:function(e){e&&(J=e)},get:function(){return J}}),ae=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}).catch(function(n){throw Q(t,n,"content",{id:e,url:t}),n})},le=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},se=null;function de(){return{set:function(e){e&&(se=e)},get:function(){return se}}}var ue,ce,ve,fe,me,pe,he,ge=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=de().get(),i=oe.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)}}(),ye=null,we=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"))||!le(n)){e.next=6;break}return ye||(ye=ge().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&&de().set(o),r||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){ye=null})),e.abrupt("return",ye);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Te=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},_e=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},be=function(e){e&&"undefined"!=typeof window&&window.sessionStorage&&window.sessionStorage.setItem("uid",e)},Ie=(pe=new Map,{set:function(e){var n,t=(null==e||null===(n=e.video)||void 0===n?void 0:n.id)||e||null;pe.set(t,(pe.get(t)||0)+1)},get:function(e){return pe.get(e)},clear:function(){pe.clear()}}),Ee=function(e){ce=e},Se=function(){return ce},ke=function(e){ue=e},Ae=function(){return ue},Oe=function(){return ve},De=function(e){ve=e},Pe=function(){return me},Le=function(e){fe=new Map,e.map(function(e,n){fe.set(e.id,n)})},Ce=function(e){if(fe){var n=fe.get(e);De(n+1)}},Fe=(he=0,{set:function(e){e>=0&&(he=e)},get:function(){return he}});function je(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 Re(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?je(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):je(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var Ne=0,Ve=null,We=null,xe=!1,Me=!1,Ue=function(){var e,n,t,i,r,o,a,l=Se();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 He(){return Ve||window.sessionStorage.getItem("uid")}function Ge(){return qe.apply(this,arguments)}function qe(){return(qe=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,we();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 ze(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,window.isAdPlaying=!1,streamFailures(e),buffering(e),ads(e),ping(e),Qe(e),Ye(e)};var Qe=function(e){e.on("play",function(){"pause"!==We||e.scrubbing()||(We="play",k("RESUME",{pfm:window.platform,uid:He(),vid:Ue(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:"RESUME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}))}),e.on("pause",function(){setTimeout(function(){xe||(We="pause",k("PAUSE",{pfm:window.platform,uid:He(),vid:Ue(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:"PAUSE",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}))},50)})},Ye=function(e){if(e){var n=0,t=0,i=0,r=0;e.on("timeupdate",o),e.on("seeking",function(){if(xe)return;xe=!0,e.off("timeupdate",o),e.one("seeked",a)}),e.on("seeked",a)}function o(){n=t,t=Math.floor(e.currentTime()),n<t&&(r=n,n=t)}function a(){if(Me)Me=!1;else{i=Math.floor(e.currentTime());var n=Math.floor(i-r);if(0!==n&&window.firstFrameFired){var t=n>0?"SEEK_FORWARD":"SEEK_BACKWARD";k(t,{pfm:window.platform,uid:He(),vid:Ue(),videoPosition:Math.floor(e.currentTime())}),fireEvent({eventName:t,videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}r=Math.floor(e.currentTime()),setTimeout(function(){xe=!1},50),e.on("timeupdate",o)}}};window.cleanupTimers=function(){clearInterval(window.bufferingTimer),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,Re({pfm:window.platform,uid:He(),vid:Ue(),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.ttFirstFrameStartTime_In_MS=performance.now(),We="play",window.failedToStartTimer=setTimeout(function(){window.firstFrameFired||window.fireStreamFailure("FAILED_TO_START")},3e4),k("PLAY",Re({pfm:window.platform,uid:He(),vid:Ue(),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",Re({"Video ID":Ue(),watchTime:Math.floor(e.currentTime())},t))}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.firstFrameFired&&(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")&&Ne<4)Ne++,k("BUFFERING",Re({pfm:window.platform,uid:He(),vid:Ue(),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}window.ttFirstFrameStartTime_In_MS=null},window.endFirstFrame=function(e){var n=tryCatch(function(){var t,i,r;if(window.ttFirstFrameStartTime_In_MS&&!window.firstFrameFired)if(window.isAdPlaying)console.log("'playing' event ignored during ad playback.");else{clearInterval(window.bufferingTimer),clearTimeout(window.failedToStartTimer),window.failedToStartTimer=null,window.firstFrameFired=!0;var o=(performance.now()-window.ttFirstFrameStartTime_In_MS)/1e3;window.ttFirstFrameStartTime_In_MS=null,window.totalBufferTime=o||0,k("FIRST_FRAME",Re({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:parseFloat(null==o?void 0:o.toFixed(2)),bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:He(),vid:Ue()},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(r=i.beacon)||void 0===r?void 0:r.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:parseFloat(null==o?void 0:o.toFixed(2)),bufferHealth:window.getRemainingBufferTime(e)}),e.off("timeupdate",n)}});e.on("timeupdate",n)},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;window.isAdPlaying=!0,!window.firstFrameFired&&window.failedToStartTimer&&clearTimeout(window.failedToStartTimer),k("AD_REQUEST",Re({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:He(),vid:Ue(),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",Re({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:He(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:Ue()},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.isAdPlaying=!1,window.firstFrameFired||(window.failedToStartTimer=setTimeout(function(){window.firstFrameFired||window.fireStreamFailure("FAILED_TO_START")},3e4))}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.isAdPlaying=!1,window.firstFrameFired||(window.failedToStartTimer=setTimeout(function(){window.firstFrameFired||window.fireStreamFailure("FAILED_TO_START")},3e4))})})};var Ke=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||n%30==0||Ke(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)&&(Ne=0,n.push(t),Ke(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(Xe(n,o,a)){var l=Math.round(t-a);if(isFinite(l))return l}}})()};var Xe=function(e,n,t){return e>=n&&e<=t},Je=function(){var e,n=Se(),t=(null==n?void 0:n.contentType)||"video";return(null==n||null===(e=n[t])||void 0===e?void 0:e.network)||null};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,_,b,I,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,we();case 4:return _=e.sent,b=_e(_),I=null==b?void 0:b.site,E=null==b?void 0:b.siteId,e.t0=Re,e.t1=Re,e.t2=Re({aid:I,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=He(),e.t5=Ue(),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?ze(n.adPosition):"",e.next=28,Ge();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=Je())&&void 0!==m?m: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===(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)||oe.get()+O.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}}};function $e(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname&&!s()){var t=C.getConfig();if(null==t||!t.disableBeacon){null!=n&&n.userId&&(Ve=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),window.endFirstFrame(i),window.watchLive(i)}}}window.watchLive=function(e){var n;if(e){var t=null==e||null===(n=e.controlBar)||void 0===n?void 0:n.getChild("SeekToLive");if(t){var i=t.handleClick;t.handleClick=function(n){var t,r;return null!==(t=e.liveTracker)&&void 0!==t&&null!==(r=t.atLiveEdge)&&void 0!==r&&r.call(t)||(!function(e){var n,t,i;k("WATCH_LIVE",Re({eventName:"WATCH_LIVE",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:He(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:Ue()},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:"WATCH_LIVE",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!1})}(e),Me=!0),i.call(this,n)}}}};var Ze=function(e,n){var t=new Map;re({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),me=t}).catch(function(e){return console.log(e)})},en=function(){var e=Fe.get();return e>=0?e+1:1},nn=function(){var e,n,t,i=Ae(),r=Se(),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 tn(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 rn(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?tn(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):tn(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var on=c,an=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},ln=function(e){var n=sn(e,"video.tags",[]),t=sn(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},sn=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},dn=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID";return e?n:n.includes("browser-")?n.replace("browser-",""):n},un=function(){var e,n,t,i,r,a,l,s,d,u,c,f,m,p,h,g,y,w,T,_,b,I,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 P=(null==D?void 0:D.siteName)||(null==D?void 0:D.site)||"",L=(null==D?void 0:D.contentType)||"video",C=(null==D||null===(t=D[L])||void 0===t?void 0:t.metadata)||(null==D||null===(i=D[L])||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),N=Math.trunc(R.getPropertyValue("height").slice(0,-2)),V=Math.trunc(R.getPropertyValue("width").slice(0,-2)),W="linearchannel"===L?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:sn(D,"video.gist.id",""),x="linearchannel"===L?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:sn(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),M=null,U=null;"function"==typeof window.__gpp&&(null===(j=window)||void 0===j||j.__gpp("ping",function(e){M=null==e?void 0:e.gppString,U=null==e?void 0:e.sectionList[0]}));var B=v.get("us_privacy")||v.get("usprivacy"),H=void 0!==B?B:"1YNN",G=null!==(m=null===(p=JSON.parse(localStorage.getItem("selectedMvpdProvider")||"{}"))||void 0===p?void 0:p.fwIdentifier)&&void 0!==m?m:null,q=rn(rn({},cn(C)),{},{VIEWLIFT_WIDTH:V,VIEWLIFT_HEIGHT:N,VIEWLIFT_SIZE:an(V,N),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:sn(D,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:sn(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:sn(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"==P||"usanetwork"==P||"golfchannel"==P?"":dn(!1),VIEWLIFT_DID:"spinco"==P||"usanetwork"==P||"golfchannel"==P?"":dn(),VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ln(D),VIEWLIFT_MEDIA_ID:W,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(sn(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:W,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+sn(D,"video.gist.permalink","")),VIEWLIFT_CONSENT:v.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:sn(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"==P||"usanetwork"==P||"golfchannel"==P?"":sn(null===(b=window)||void 0===b||null===(I=b.app_data)||void 0===I||null===(E=I.site)||void 0===E?void 0:E.settings,"compliance.gdpr")?1:0,VIEWLIFT_US_PRIVACY:H,VIEWLIFT_TVE_PROVIDER:G?on(G):"",VIEWLIFT_CONTENT_DURATION_MS:1e3*sn(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:sn(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:W,VIEWLIFT_CONTENT_TITLE:x,VIEWLIFT_CONTENT_SERIES_TITLE:sn(D,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:sn(D,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:nn(),VIEWLIFT_SEASON_NUMBER:en(),VIEWLIFT_CONTENT_TAGS:ln(D),VIEWLIFT_GPP_SID:U||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:M||"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 z in q){var Q=new RegExp(z,"g");A=A.replace(Q,q[z])}return A},cn=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=rn(rn({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.dtc.csai")||""}):m&&(c=rn(rn({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.tve.csai")||""})):f?c=rn(rn({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.dtc.csai")||""}):m&&(c=rn(rn({},c),{},{VIEWLIFT_CSID:v.get("csid.web.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.tve.csai")||""})),f?c=rn(rn({},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=rn(rn({},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()?rn(rn({},c),{},{VIEWLIFT_PROF:v.get("prof.mweb")||"",VIEWLIFT_PROF_CSAI:v.get("prof.mweb.csai")||""}):rn(rn({},c),{},{VIEWLIFT_PROF:v.get("prof.web")||"",VIEWLIFT_PROF_CSAI:v.get("prof.web.csai")||""})):(c=rn(rn({},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()?rn(rn({},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")||""}):rn(rn({},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=rn(rn({},c),{},{VIEWLIFT_AFID:v.get("afid"),VIEWLIFT_NIELSEN_APP_ID:sn(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")||""})},vn=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 mn(w);if(g){var b=pn(y,n);return b.src=un(b.src,n,e),b}if("Safari"!==u()&&_)return fn(y);if(T){var I=mn(y);return I.src=un(I.src,n,e),I}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=un(E.src,n,e),E}return null},fn=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},mn=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},pn=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",__vlLicenseUrl:(null==e?void 0:e.licenseUrl)||"",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 hn(n),d}var c,v={src:a.url,type:"application/dash+xml"};return"caliente"==(null===(c=window)||void 0===c?void 0:c.siteName)?(hn(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 hn=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)}},gn=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}},yn=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)}}},wn=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Tn=!1,_n=function(e,n,t){var i=un(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_){Tn=!0;var l={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};a.ima.initializeAdDisplayContainer&&a.ima.initializeAdDisplayContainer(),Tn&&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 bn(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(En.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||vi(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||ci(e,10)}}},!0)}var In,En=(In=!0,{enable:function(){In=!0},disable:function(){In=!1},get enabled(){return In}}),Sn="ssai-breakStart",kn="ssai-adImpression",An="ssai-firstQuartile",On="ssai-midpoint",Dn="ssai-thirdQuartile",Pn="ssai-complete",Ln="ssai-breakEnd",Cn={breakStart:Sn,impression:kn,firstQuartile:An,midpoint:On,thirdQuartile:Dn,complete:Pn,breakEnd:Ln};function Fn(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=Cn[i];r&&t.trigger(r,n)}function jn(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(Sn,e)},adImpression:function(e){return t(kn,e)},adFirstQuartile:function(e){return t(An,e)},adMidpoint:function(e){return t(On,e)},adThirdQuartile:function(e){return t(Dn,e)},adComplete:function(e){return t(Pn,e)},adBreakEnd:function(e){return t(Ln,e)}}}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 Nn(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 Vn,Wn=(Vn={},{get:function(){return Vn},set:function(e){Vn=e}});function xn(e,n){var t,i,r,a,l,s,d,u,c,v,f,m,p,h,g,b,I,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 P=Se(),L=(null==P||null===(i=P.video)||void 0===i?void 0:i.metadata)||[],C=(null==L?void 0:L.length)&&L.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,N,V=null===(a=window)||void 0===a?void 0:a.lcProgrammeDetails,W=Array.isArray(null==V?void 0:V.category)?null==V||null===(l=V.category)||void 0===l?void 0:l.join(","):(null==V?void 0:V.category)||null,x=Nn(Nn(Nn({},null==P?void 0:P.video),null==P?void 0:P.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==P?void 0:P.site)||null,programId:(null==V?void 0:V.videotmsid)||null,programTitle:(null==V?void 0:V.lcProgrammeName)||null,episodeId:(null==V?void 0:V.videotmsid)||null,seasonNumber:(null==P||null===(c=P.video)||void 0===c||null===(v=c.series)||void 0===v?void 0:v.seasonNumber)||(null==V||null===(f=V.seriesDetails)||void 0===f?void 0:f.season)||null,episodeNumber:(null==P||null===(m=P.video)||void 0===m||null===(p=m.series)||void 0===p?void 0:p.episodeNumber)||(null==V||null===(h=V.seriesDetails)||void 0===h?void 0:h.episode)||null,episodeTitle:(null==V?void 0:V.lcSubTitle)||null,isCompleteEpisode:!!(null!=P&&null!==(g=P.video)&&void 0!==g&&g.series||null!=V&&null!==(b=V.seriesDetails)&&void 0!==b&&b.episode),genre:C||W,comscoreConfig:{implementationId:(null==e||null===(I=e.comscore)||void 0===I?void 0:I.implementationId)||null,projectId:(null==e||null===(E=e.comscore)||void 0===E?void 0:E.projectId)||null}}),M=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=M||"LongFormOnDemand",null==x||!x.network){var U,B=(null==x?void 0:x.metadata)||[],H=null==B||null===(U=B.find(function(e){return"network"===e.name}))||void 0===U?void 0:U.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===(N=j.series)||void 0===N?void 0:N.title:null==j||null===(R=j.gist)||void 0===R?void 0:R.title),"_").concat(x.genre)),null!=V&&V.airDate&&(x.publishDate=V.airDate),null!=x&&x.runtime&&"function"==typeof D.duration&&(x.runtime=1e3*Math.ceil(D.duration()));var G=w(x,D);console.log("comscoreOptions player data",G),T(Nn({playerName:"Video.js"},G)),_(D)}}function Mn(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 Un(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Mn(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Mn(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}function Bn(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 Hn(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)?Hn(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 Hn(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 Gn,qn=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),zn=(Gn=null,{set:function(e){Gn=e},get position(){return Gn}});function Qn(e,n){return Yn.apply(this,arguments)}function Yn(){return(Yn=n(t.mark(function e(n,i){var r,a,l,s,d,u,c,v,f,m,p,h,y,w,T,_,b,I;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o(n),l=vn(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=un(u,n,i),c=Xn(u),v=g(c,2),f=v[0],m=v[1],p=Kn(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(Un({adsParams:Un({},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,b=w+T,I=w+_,qn.set(b),console.log("%c TRACKING URL","background: #bdf369; color: #000",b),l.src=I,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 Kn(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 Xn(e){var n={};if(!e.split("?")[1])return[{},{}];var t,i=new URL(e,window.location.origin),r=Bn((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 Jn,$n,Zn,et=new Map;function nt(e,n){return tt.apply(this,arguments)}function tt(){return tt=n(t.mark(function e(i,r){var l,s,d,u,c,v,f,m,p,g,y,w,T,_,b,I,E,S,k,A,O,D,P,L,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<P&&D.clear(),P=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=Bn(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),b=et.get("pod-".concat(a))||[];if(console.warn(e,y,"map:",c,"condition1:",e>=y,"map:",et),e>=y&&!b.includes(_)){b.push(_),et.set("pod-".concat(a),b);try{L(c,n,w,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,c,n)}if("breakEnd"==c){var I=zn.position;zn.set(null),setTimeout(function(){null!=I&&(u.currentTime(I),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}),Fn(i,S)}catch(e){console.error("Error when calling ads callback:",e)}var k=Wn.get();if(k&&0!==Object.keys(k).length){var A=k.formulateComscoreAdPayload,O=k.startComscoreAdTracking,P=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=qn.get();O(A(Un(Un({},null==n||null===(j=n.ads)||void 0===j?void 0:j[r]),{},{trackingUrl:R})))}else"complete"===c?P():"breakEnd"===c&&C()}}};for(m.s();!(f=m.n()).done;)p()}catch(e){m.e(e)}finally{m.f()}}},L=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"))},et.clear(),zn.set(r),p=qn.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,b=(null==g||null===(d=g.controlBar)||void 0===d?void 0:d.getChild("videoSelector"))||null,I=(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 Un(Un({},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,P,L,F,j,R,N,V,W,x,M,U,B;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return W=function(e){document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",W),0===e.button&&R()},V=function(e){},N=function(){var e,n=g.currentTime(),t=null,i=Bn(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=Bn(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),N()),null!=p&&p.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",p),window.adsQueueList=p,"function"==typeof(j=(null===(P=window)||void 0===P||null===(L=P.customData)||void 0===L||null===(F=L.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),En.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")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),I&&(I.el().style.pointerEvents="none",I.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",B.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,N),"break"}w.delete(r)},i=0;i<p.length;i++){if("break"===t())break}n||(x.style.display="none",A.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),I&&(I.el().style.pointerEvents="auto",I.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")),En.enable())}},1e3),g.on("timeupdate",g._timeUpdateHandler),null===(s=document)||void 0===s||s.addEventListener("keydown",function(e){En.enabled&&"ArrowRight"==e.key&&(R(),ci(i,10),e.stopPropagation())}),A.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",V),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",(M=document.createElement("div")).className="sponsored-adbox",(U=document.createElement("div")).className="sponsored-text",U.textContent="Sponsored Ad",M.append(U),(B=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",x.append(M),x.append(B),g.el().appendChild(x);case 44:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),D=new Map,P=-1;case 21:case"end":return e.stop()}},e)})),tt.apply(this,arguments)}function it(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 rt(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)?rt(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 rt(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 ot(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 at(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):ot(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var lt={},st=(null===(Jn=window)||void 0===Jn||null===($n=Jn.location)||void 0===$n||null===(Zn=$n.search)||void 0===Zn?void 0:Zn.includes("debug=true"))||!1,dt=null;function ut(e){return ct.apply(this,arguments)}function ct(){return ct=n(t.mark(function e(i){var r,l,s,d,u,c,v,f,m,p,g,y,w,T,_,b,I,E,S,k,A,O,D,P,L,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=it(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,b=g.durationInSeconds,I=(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);P.has(A)||P.set(A,new Set);var O=P.get(A);if(st&&console.warn(e,I,"map:",y,"condition1:",e>=I,"map:",P),e>=I&&e<=I+L&&!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:b,ad:null==n||null===(D=n.ads)||void 0===D?void 0:D[r],adIndex:r};S({adsData:F}),Fn(i,F)}catch(e){console.error("Error when calling ads callback:",e)}var j=Wn.get();if(j&&0!==Object.keys(j).length){var R=j.formulateComscoreAdPayload,N=j.startComscoreAdTracking,V=j.finishComscoreAdTracking,W=j.endComscoreAdTracking;if("impression"===y){var x,M=qn.get();N(R(at(at({},null==n||null===(x=n.ads)||void 0===x?void 0:x[r]),{},{trackingUrl:M})))}else"complete"===y?V():"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=lt)||void 0===r?void 0:r.currentAdIndex)+1!=(null===(o=lt)||void 0===o?void 0:o.totalAds)&&(null==n||null===(a=n.ads)||void 0===a?void 0:a.length)>0||(st&&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(){dt&&clearInterval(dt)},m=qn.get(),(p=o(i)).one("loadeddata",function(){g(),dt=setInterval(function(){m&&!p.paused()&&D(m)},2e3)}),p.on("dispose",function(){g()}),y=new Map,w=new Map,T=-1,_=null,b=(null===(r=document)||void 0===r||null===(l=r.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,I=(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 at(at({},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)})}),st&&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(fi(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),En.disable(),b&&b.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),k&&(k.style.pointerEvents="none",k.classList.add("vjs-hidden")),I&&(I.el().style.pointerEvents="none",I.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(){lt.totalAds=null==o?void 0:o.length,lt.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||(lt={},g.el().classList.remove("hide-progress-bar"),I&&(I.el().style.pointerEvents="auto",I.el().classList.remove("vjs-hidden")),E&&(E.el().style.pointerEvents="auto",E.el().classList.remove("vjs-hidden")),b&&b.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),k&&(k.style.pointerEvents="auto",k.classList.remove("vjs-hidden")),En.enable())}}},1e3),p.on("timeupdate",p._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),P=new Map,L=2.5;case 22:case"end":return e.stop()}},e)})),ct.apply(this,arguments)}var vt=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function ft(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 mt=function(){function e(n,t,i,r){b(this,e),this.video_=r,this.ad_=n,this.skipOffset_=function(e){if(!e)return null;var n=new RegExp(vt.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}(),pt="impression",ht="start",gt="mute",yt="unmute",wt="resume",Tt="pause",_t="firstQuartile",bt="midpoint",It="thirdQuartile",Et="complete",St="skip",kt="breakStart",At="breakEnd",Ot="skipStateChanged",Dt="ad_impression",Pt="ad_started",Lt="ad_muted",Ct="ad_volume_changed",Ft="ad_resumed",jt="ad_paused",Rt="ad_first_quartile",Nt="ad_midpoint",Vt="ad_third_quartile",Wt="ad_complete",xt="ad_stopped",Mt="ad_skipped",Ut="ad_skip_state_changed",Bt="ad_break_started",Ht="ad_break_ended",Gt="ads_loaded",qt="ad_cuepoints_changed";function zt(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 Qt(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?zt(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):zt(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}function Yt(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 Kt(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)?Kt(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 Kt(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 Xt="[Transmit]";function Jt(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 $t=function(){function e(n,t,i){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};b(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:Gt,loadTime:0})}},{key:"getCuePoints",value:function(){var e,n=new Map,t=Yt(this.adBreaks_);try{for(t.s();!(e=t.n()).done;){var i,r=Yt(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=Jt(d)).dashAvailabilityStartTime&&!a&&(a=u.dashAvailabilityStartTime),c=Yt(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),ft(this.adBreaks_)!==ft(y)&&(this.adBreaks_=y,w=this.getCuePoints(),this.onEvent_({type:qt,cuepoints:w}))):this.adBreaks_.length&&(this.onEvent_({type:qt,cuepoints:[]}),this.onEnded_(),this.adBreaks_=[]),n&&this.setupAdBreakListeners_(),e.next=42;break;case 39:e.prev=39,e.t0=e.catch(0),console.warn(Xt,"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=Yt(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=Yt((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 Qt(Qt({},e),{},{startTimeInSeconds:i,ads:(e.ads||[]).map(function(r){return Qt(Qt({},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(Xt,"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_(Ot),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(_t)&&(this.eventsSent_.add(_t),this.sendTrackingEvent_(_t)),e>=i&&!this.eventsSent_.has(bt)&&(this.eventsSent_.add(bt),this.sendTrackingEvent_(bt)),e>=r&&!this.eventsSent_.has(It)&&(this.eventsSent_.add(It),this.sendTrackingEvent_(It))}}},{key:"flushPendingQuartiles_",value:function(){for(var e=0,n=[_t,bt,It];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=Yt(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 mt(a,o+1,r.length,this.video_),0===o&&this.sendTrackingEvent_(kt),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_(At),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_(pt),this.sendTrackingEvent_(ht)),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_(gt):o.sendTrackingEvent_(yt))}),this.attachAdListener_("play",function(){a?(o.sendTrackingEvent_(pt),o.sendTrackingEvent_(ht),a=!1):o.sendTrackingEvent_(wt)}),this.attachAdListener_("pause",function(){o.sendTrackingEvent_(Tt)})}},{key:"removeCurrentAdListeners_",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.sendTrackingEvent_(e?St: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=Yt(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=Yt(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=Wn.get();if(!e||0===Object.keys(e).length)return;var n=e.formulateComscoreAdPayload,t=e.startComscoreAdTracking,i=qn.get();t(n(Qt(Qt({},this.transmitAd_),{},{trackingUrl:i})))}catch(e){console.warn(Xt,"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=Yt(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(Xt,"beacon failed",n,e)})};for(s.s();!(a=s.n()).done;)d()}catch(e){s.e(e)}finally{s.f()}}var u=Wn.get(),c=u&&Object.keys(u).length?u:null;switch(e){case pt:this.onEvent_({type:Dt}),this.startComscoreForCurrentAd_();break;case ht:this.onEvent_({type:Pt,ad:this.ad_});break;case gt:this.onEvent_({type:Lt});break;case yt:this.onEvent_({type:Ct});break;case wt:this.onEvent_({type:Ft});break;case Tt:this.onEvent_({type:jt});break;case _t:this.onEvent_({type:Rt});break;case bt:this.onEvent_({type:Nt});break;case It:this.onEvent_({type:Vt});break;case Et:this.onEvent_({type:Wt}),this.onEvent_({type:xt}),null!=c&&c.finishComscoreAdTracking&&c.finishComscoreAdTracking();break;case St:this.onEvent_({type:Mt}),this.onEvent_({type:xt});break;case kt:this.onEvent_({type:Bt});break;case At:this.onEvent_({type:Ht}),null!=c&&c.endComscoreAdTracking&&c.endComscoreAdTracking();break;case Ot:this.onEvent_({type:Ut})}}else console.warn(Xt,"sendTrackingEvent_ skipped — no active ad",{eventType:e})}}]),e}();function Zt(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 ei(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Zt(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Zt(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var ni={dash:"tracking/initialize/dash",hls:"tracking/initialize/hls"};function ti(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 ii(e,n,t){return ri.apply(this,arguments)}function ri(){return(ri=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=ti(n)){e.next=3;break}return e.abrupt("return",n);case 3:return a=un(n.src,r,i),l=a.replace(o,ni[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),qn.set(p),console.log("[Transmit] session ready",{manifestUrl:m,trackingUrl:p}),e.abrupt("return",ei(ei({},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 oi=null;function ai(e,n){var t;if(oi)return console.log("[Transmit] initializeTransmit skipped — manager already initialised"),oi;var i=qn.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(oi=new $t(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}),oi.addTrackingUrl(i),oi.onManifestUpdated(),oi}function li(){oi&&(oi.release(),oi=null)}function si(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 di=function(e){i(e).play()},ui=function(e){i(e).pause()},ci=function(e,n){var t=i(e),r=t.currentTime()+n;t.currentTime(r)},vi=function(e,n){var t=i(e),r=t.currentTime(),o=r<=n?0:r-n;t.currentTime(o)},fi=function(e){return!!i.getPlayer("".concat(e))},mi=function(e){return i(e).paused()},pi=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,we();case 3:return l=e.sent,d=o(i),e.abrupt("return",new Promise(function(e,o){ee(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(li(),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=vn(m,i),!g){n.next=17;break}return n.next=13,Qn(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,ii(w,m,i);case 20:w=n.sent,a=!0;case 22:Ee(m),w&&a?(Ti(i,w),y?ai(i,{customData:window.customData||{ads:p}}):g&&ut(i),d.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:m})})):(Wn.get()&&0!==Object.keys(Wn.get()).length&&xn({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)}}(),hi=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,we();case 2:return u=e.sent,console.log("load video"),(Ae()||null)&&Ce(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&&ie(r,u).then(function(e){var n,t,i,r,o,a,l,s,d;(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.isExternal||null===(o=window)||void 0===o||null===(a=o.watchHistory)||void 0===a||a.cb(null==e?void 0:e.data),c=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,(v=(null==e||null===(s=e.data)||void 0===s?void 0:s.watchedPercentage)||null)<95)&&(p=(null==e||null===(d=e.data)||void 0===d?void 0:d.watchedTime)||null)}).catch(function(){}),e.abrupt("return",new Promise(function(e,a){Z(r,u).then(function(){var r=n(t.mark(function n(r){var l,s,d,u,h,g,y,w,T,_,b,I,E,S,k,A,O,D,P,L,C,F,j,R,N,V,W,x,M,U,B,H,G,q,z,Q,Y,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)||{},P=!(null==A||null===(h=A[O])||void 0===h||!h.isSSAIEnabled),L=P&&"MEDIA_TAILOR"==(null==D?void 0:D.vodAdSticherProvider),C=P&&"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,Ee(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===(b=_.web)||void 0===b?void 0:b.active)&&(null==A||null===(I=A.ads)||void 0===I||null===(E=I.preRoll)||void 0===E||null===(S=E.adTags)||void 0===S||null===(k=S.web)||void 0===k?void 0:k.url))&&_n(i,j,A),R=vn(A,i),!L){n.next=17;break}return n.next=14,Qn(i,A);case 14:R=n.sent,n.next=22;break;case 17:if(!C||!F){n.next=22;break}return li(),n.next=21,ii(R,A,i);case 21:R=n.sent;case 22:if(!R){n.next=37;break}if((null==A||null===(N=A.video)||void 0===N||null===(V=N.gist)||void 0===V?void 0:V.videoImageUrl)||null==A||null===(W=A.video)||void 0===W||null===(x=W.gist)||void 0===x||null===(M=x.imageGist)||void 0===M||M.r16x9,z=o(i)){n.next=28;break}return console.error("[VL][player-core] player not found for id=".concat(i),{player:z}),n.abrupt("return",a({status:!1,msg:"Player not found",response:{}}));case 28:Ti(i,R),C&&F?ai(i,{customData:window.customData||{ads:D}}):L&&nt(i,p),z.on("loadstart",function(){F&&e({status:!0,msg:"Video Loaded",response:A})}),z.on("loadeddata",function(){wn(),e({status:!0,msg:"Video Loaded",response:A})}),z.one("play",function(){!c||L||C&&F||v<95&&setTimeout(function(){z.currentTime(c)},0)}),z.one("error",function(){var e;a({status:!1,msg:(null==z||null===(e=z.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==A||null===(U=A.video)||void 0===U||null===(B=U.contentDetails)||void 0===B||null===(H=B.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===(Y=A.video)||void 0===Y||null===(K=Y.contentDetails)||void 0===K?void 0:K.closedCaptions)||(null==A||null===(X=A.video)||void 0===X?void 0:X.closedCaptions),Q=J.filter(function(e){return"VTT"===e.format}),m(i,Q)):f(i),n.next=39;break;case 37:yn(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){_i(e,i,a,r)})}));case 11:case"end":return e.stop()}},e)}));return function(n,t,i){return e.apply(this,arguments)}}(),gi=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)})})},yi=function(e){li();var n=o(e),t=(Wn.get()||{}).destroyComscoreTag;if(wi(),t&&t(),l(),window.onresize=null,n)n.dispose();else{var i=document.getElementById(e);i&&i.remove()}},wi=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()},Ti=function(e,n){console.log("load video in core",n);var t=o(e);t&&t.src(n)},_i=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);fi(t)&&yn(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?si(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):si(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}))},bi=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{de as $,V as A,W as B,_e as C,Z as D,ie as E,_i as F,we as G,ee as H,ne as I,Ze as J,Fe as K,ke as L,gi as M,ci as N,di as O,ui as P,vi as Q,fi as R,hi as S,pi as T,yi as U,ae as V,jn as W,be as X,oe as Y,C as Z,Te as _,nn as a,le as a0,S as a1,et as a2,bn as a3,Oe as a4,mi as a5,De as a6,ai as a7,ut as a8,nt as a9,re as aa,Le as ab,Ce as ac,Ae as b,Wn as c,en as d,Se as e,vn as f,He as g,Ee as h,xn as i,wn as j,yn as k,Ti as l,Pe as m,bi as n,ii as o,$e as p,_n as q,gn as r,te as s,qn as t,Qn as u,Ie as v,F as w,Q as x,j as y,N as z};
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/typeof";import{e as n,v as t,a2 as a,R as o}from"./generic-90eeea98.js";import{g as r}from"./skin-3653c5b3.js";import i from"@babel/runtime/helpers/toConsumableArray";import l from"@babel/runtime/helpers/slicedToArray";import{g as c}from"./localisation-0bf399a1.js";var s=!1,u=function(e,n,t){var a=r(e);a?n>=0&&n<=a.duration()?(t({status:!0,msg:"Successfully seeked to timestamp : ".concat(n)}),a.currentTime(n)):t({status:!1,msg:"Out of bounds, please provide a valid timestamp"}):t("Cannot find player with id: '".concat(e,"'"))},d=function(e,n){var t=r(e);if(!t)return"Cannot find player with id: '".concat(e,"'");try{return t.playbackRate(n),"Playback speed set to ".concat(n,"x")}catch(e){return"Error: ".concat(e)}},v=function(e,o){var i=r(e);i?(i.on("ended",function(){return s=!0}),i.on("timeupdate",function(){if(!i.paused()&&s){var e,r,l=null===(e=n())||void 0===e||null===(r=e.video)||void 0===r?void 0:r.id;t.get(l)?(t.clear(),a.clear(),o(),t.set(l)):(t.clear(),t.set(l)),s=!1}})):o("Cannot find player with id: '".concat(e,"'"))},m=function(e,n){var t=r(e);t?t.on("timeupdate",function(){return n(t.currentTime())}):n("Cannot find player with id: '".concat(e,"'"))},f=function(e,n){var t=r(e);t?t.on("ended",function(){return n(!0)}):n("Cannot find player with id: '".concat(e,"'"))},h=function(e){var n=r(e);return n?n.duration():"Cannot find player with id: '".concat(e,"'")};function g(){var n=function(e,n){var t=r(e);if(!t)throw"Cannot find player with id: '".concat(e,"'");if("function"!=typeof n)throw"Callback function (cb) is missing or not a function";return t};return{onPlay:function(e,t){n(e,t).on("play",function(){return t()})},onPause:function(e,t){n(e,t).on("pause",function(){return t()})},onMute:function(e,t){var a=n(e,t);a.on("volumechange",function(){a.muted()?t({muted:!0}):t({muted:!1})})},onPictureInPictureChange:function(e,t){var a=n(e,t);a.on("enterpictureinpicture",function(){t({pip:!0})}),a.on("leavepictureinpicture",function(){t({pip:!1})})},onFullScreenChange:function(e,t){var a=n(e,t);a.on("fullscreenchange",function(e){a.isFullscreen_?t({isFullscreen:!0}):t({isFullscreen:!1})})},onSetVolume:function(e,t){var a=n(e,t);a.on("volumechange",function(){var e=100*a.volume().toFixed(2);a.muted()?t({vol:0}):t({vol:e})})},onSeeked:function(e,t){var a=n(e,t);a.on("seeked",function(){t({seeked:a.currentTime()})})},onSubtitleEnable:function(e,t){var a=n(e,t);a.textTracks().on("change",function(e){console.log(a.textTracks());var n=a.textTracks().tracks_.filter(function(e){return("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode});n.length>0&&t({enabled:n[0]})})},onDisableSubtitles:function(e,t){var a=n(e,t);a.textTracks().on("change",function(e){var n,o;console.log(a.textTracks()),(null==a||null===(n=a.textTracks())||void 0===n||null===(o=n.tracks_)||void 0===o?void 0:o.every(function(e){return"showing"!=e.mode}))&&t({captions_disabled:!0})})},onSubtitleCueChange:function(t,a){var o=n(t,a);o.on("loadeddata",function(){var n,t,r,i,l,c=o.textTracks();"object"==e(o.dash)&&null!=o.dash&&o.dash.mediaPlayer.on(null===(t=window)||void 0===t||null===(r=t.dashjs)||void 0===r||null===(i=r.MediaPlayer)||void 0===i||null===(l=i.events)||void 0===l?void 0:l.CAPTION_RENDERED,function(e){a(e)});for(var s=0;s<c.length;s++){var u=c[s];"metadata"===u.kind&&(u.mode="hidden",n=u)}n&&n.addEventListener("cuechange",function(){var e=n.activeCues;if(e&&e.length>0)for(var t=0;t<e.length;t++){var o=e[t];a(o)}else console.log("no active cue at this moment")})})},onError:function(e,t){var a=n(e,t);a.on("error",function(){var e,n;t({error:null==a||null===(e=a.error())||void 0===e?void 0:e.code,msg:null==a||null===(n=a.error())||void 0===n?void 0:n.message})})}}}var p,E=null,y=function(e,n){(new Date).getMonth(),new Date(n).getMonth(),(new Date).getFullYear(),new Date(n).getFullYear();var t=Math.floor(e/6048e5),a=function(e,n){var t;return t=12*(n.getFullYear()-e.getFullYear()),t-=e.getMonth(),(t+=n.getMonth())<=0?0:t}(new Date,new Date(n)),o=a>0&&t>4?a:0,r=function(e,n){var t=new Date(n).getFullYear()-new Date(e).getFullYear(),a=new Date(n).getMonth()-new Date(e).getMonth();return new Date(n).getDay()-new Date(e).getDay()<0&&(a-=1),a<0&&(t-=1),t}(new Date,new Date(n));return[r>0&&o>0?r:0,o,t,Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]},C=function(e){var n,t=l(e,8),a=t[0],o=t[1],r=t[2],i=t[3],c=t[4],s=t[5],u=t[6],d=t[7];n=a>=1?" ".concat(a," Year"):o>=1?" ".concat(o," month"):r>=1?" ".concat(r," week"):i>=1?" ".concat(i," day"):c<24&&c>=12?" ".concat(c," hour"):c>0?"".concat(c," hours ").concat(s," minutes ").concat(u," seconds"):s>0?"".concat(s," minutes ").concat(u," seconds"):"".concat(u," seconds"),d.textContent="".concat(n)},D=(p={scheduleStartTimeMs:0,scheduleEndTimeMs:0},{get:function(){return p},set:function(e){p={scheduleStartTimeMs:null==e?void 0:e.startDateTime,scheduleEndTimeMs:null==e?void 0:e.endDateTime}}});function w(e,n,t,a){if(e){var o=function(){var e,o,l=null===(e=D.get())||void 0===e?void 0:e.scheduleStartTimeMs,s=null===(o=D.get())||void 0===o?void 0:o.scheduleEndTimeMs,u=Date.now();if(u-s>0){var d=document.getElementsByClassName("error-message")[0];return d&&(d.textContent=c("eventEnded")||"Game has ended",a.textContent=""),clearInterval(r),void(null==t||t())}var v=l-u;if(v/1e3<=0)return clearInterval(r),null==n||n([0,0,0,0,0,0,0,a]),void(null==t||t());var m=y(v,l);null==n||n([].concat(i(m),[a]))};o();var r=setInterval(o,1e3);return r}}var T=function(e,n,t){var a,o,r,i,l,s,u,d,v=null==n||null===(a=n.response)||void 0===a||null===(o=a.data)||void 0===o?void 0:o.errorCode,m=(null==n||null===(r=n.response)||void 0===r||null===(i=r.data)||void 0===i?void 0:i.errorMessage)||(null==n?void 0:n.message)||null;D.set({startDateTime:null==n||null===(l=n.response)||void 0===l||null===(s=l.data)||void 0===s?void 0:s.scheduleStartDate,endDateTime:null==n||null===(u=n.response)||void 0===u||null===(d=u.data)||void 0===d?void 0:d.scheduleEndDate}),function(e,n,t,a){var o,r,i=Date.now(),l=null===(o=D.get())||void 0===o?void 0:o.scheduleStartTimeMs,s=null===(r=D.get())||void 0===r?void 0:r.scheduleEndTimeMs,u=function(e,n,t,a){var o;e<0?o=c("eventNotStarted")||a||"Game starts in":(n>0||"VIDEO_NOT_EXISTS"==t)&&(o=c("eventEnded")||a||"Game has ended");return o||a}(i-l,i-s,n,t);if(document.getElementsByClassName("error-container")[0]){var d=document.getElementsByClassName("error-message")[0];d&&(d.textContent="".concat(u));var v=document.getElementsByClassName("error-timer-message")[0];v&&w(Math.abs(l),C,a,v)}else{var m=document.getElementById(e).parentElement;if(m){var f=document.createElement("div");f.className="error-container";var h=document.createElement("div");h.className="error-message";var g=document.createElement("div");g.className="error-timer-message",h.textContent="".concat(u),f.appendChild(h),f.appendChild(g),m.append(f),w(Math.abs(l),C,a,g)}}}(e,v,m,t)};function M(e,n){var t=n.scheduleEndDate,a=n.scheduleStartDate;D.set({startDateTime:a,endDateTime:t}),E&&clearInterval(E),E=setInterval(function(){var n,t=Date.now(),a=null===(n=D.get())||void 0===n?void 0:n.scheduleEndTimeMs;if(console.log("scheduleEndTimeMs",a),a&&t>a){var i;console.log("Game ended");var l=r(e);if(o(e)&&l){var s;l.dispose(),console.log("Player disposed");var u=null===(s=document.getElementsByClassName("vl-container"))||void 0===s?void 0:s[0],d=document.createElement("video");d.id=e,d.className="video-js",d.style.width="100%",d.style.height="100%",u&&u.appendChild(d)}var v=c("eventEnded")||"Game has ended",m=null===(i=document.getElementsByClassName("error-container"))||void 0===i?void 0:i[0];if(m){var f=m.querySelector(".error-message");f&&(f.textContent=v)}else{var h=document.getElementById(e),g=null==h?void 0:h.parentElement;if(g){(m=document.createElement("div")).className="error-container";var p=document.createElement("div");p.className="error-message",p.textContent=v,m.appendChild(p),g.append(m)}}clearInterval(E)}},1e3)}export{T as a,f as b,u as c,d,v as e,h as g,M as h,m as o,g as p,D as s};
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import{g as t,d as n}from"./skin-3653c5b3.js";import{a4 as a,b as i}from"./generic-90eeea98.js";import{s as l}from"./autoNextVideo-24cb6191.js";import{r as o}from"./relatedVideosManager-8dd9aa24.js";import r from"@babel/runtime/helpers/typeof";import d from"video.js";var s,u,c,m,p=[],v=!1,f=null,h=!1,g=null,x=null,y=null,C=null,E=null,b=function(){null!=f&&(clearInterval(f),f=null),h=!1},w="next-ep-preview-player-thumb",N=function(e,t){if(e){var n,a,i,l,o;(null==(n=t)||null===(a=n.gist)||void 0===a||null===(i=a.imageGist)||void 0===i?void 0:i.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(w)[0];r||((r=document.createElement("div")).className=w,r.setAttribute("aria-hidden","true"),e.appendChild(r))}},A=function(e,t){if(e){var n=e.getElementsByClassName(w)[0];n&&(n.style.visibility=t?"visible":"hidden")}},L=function(){var e=document.createElement("div");e.className="next-heading-wrapper";var t=document.createElement("div");t.className="next-ep-header";var n=document.createElement("span");n.className="next-ep-header-text",n.textContent="Next up in";var a=document.createElement("span");return a.className="next-ep-duration",a.textContent="10",t.append(n,a),e.append(t),e},B=function(e,t,a,i){var l,o,r,d,s,u=null==e?void 0:e.title,c=(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 f=document.createElement("img");f.className="next-ep-img",f.alt="",f.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),a=t%60;return"".concat(n,":").concat(String(a).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(f),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(u||"");var C=document.createElement("div");C.className="next-ep-desc",C.textContent=c||"",String(c||"").trim()||C.classList.add("next-ep-desc--empty");var E=document.createElement("div");E.className="next-ep-meta-row";var w=document.createElement("span");w.className="next-ep-badge";var N=function(e){if(null==e?void 0:e.isClip)return"CLIP"}(e);w.textContent=N,N||w.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(w),L.appendChild(A);var B=document.createElement("img");B.className="next-ep-network-logo",B.alt="";var S=function(e){var t,n,a;if(e){var i=null===(t=window)||void 0===t||null===(n=t.app_data)||void 0===n||null===(a=n.appcmsMain)||void 0===a?void 0:a.networks;if(e&&i){var l=null==i?void 0:i.find(function(t){if(t.identifier==e)return t});return null==l?void 0:l.badgeImage}}}(null==e?void 0:e.network);S?B.src=S:B.classList.add("next-ep-network-logo--empty"),E.appendChild(L),x.appendChild(y),x.appendChild(C),x.appendChild(E);var j=document.createElement("div");return j.className="next-ep-meta-with-logo",j.appendChild(x),j.appendChild(B),m.appendChild(p),m.appendChild(j),m.onclick=n(function(){b(),null==t||t.remove(),v=!0,I(a)},400),m},S=function n(l,r){var d;if(v=!1,C=l,E=r,y&&(y(),y=null),null!=r&&null!==(d=r.series)&&void 0!==d&&d.enable){var s;p=[];var u=i();null==u||u.map(function(t){var n;return(n=p).push.apply(n,e(t.episodes))}),null==r||null===(s=r.series)||void 0===s||s.cb}else{var c=o.get();p=(null==c?void 0:c.content)||[],null==c||c.cb,y=o.subscribe(function(){y&&(y(),y=null),C&&E&&n(C,E)})}var m=t(l);if(m){!function(e){e&&x&&(e.off("timeupdate",x),x=null)}(t(g)),b(),g=l,x=function(){var e,t;if(!v){var n=m.duration(),i=m.currentTime(),o=Number.isFinite(n)&&n>0?n-i:1/0,r=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0],d=document.getElementById(l),s=a()<=(null===(t=p)||void 0===t?void 0:t.length)-1;if(o>1){if(null!=f||h){b();var u=null==r?void 0:r.querySelector(".next-ep-header .next-ep-duration");u&&(u.textContent="10")}return r&&(r.style.visibility="hidden"),void A(d,!1)}s?(r&&(r.style.visibility="visible"),A(d,!0),h||null!=f||(m.pause(l),h=!0,function(e){var t;if(null==f){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",f=setInterval(function(){l--,i.textContent=String(l),0===l&&(clearInterval(f),f=null,h=!1,p.filter(function(e,t){return t==a()}),I(e))},1e3)}}}(l))):A(d,!1)}},m.on("timeupdate",x);var w,S=p.filter(function(e,t){return t==a()});if((null==S?void 0:S.length)>0)if(null!==(w=document.getElementsByClassName("next-ep-preview"))&&void 0!==w&&w[0]){var j,k,P=null===(j=document.getElementsByClassName("next-ep-preview"))||void 0===j?void 0:j[0];P.style.visibility="hidden",null===(k=P.querySelector(".next-ep-preview-inner"))||void 0===k||k.remove(),Array.from(P.children).forEach(function(e){e.classList.contains("next-ep-content")&&e.remove()});var M=P.querySelector(".next-heading-wrapper");if(M){var O=M.querySelector(".next-ep-header"),q=null==O?void 0:O.querySelector(".next-ep-duration");if(!q&&O){O.textContent="";var F=document.createElement("span");F.className="next-ep-header-text",F.textContent="Next up in",(q=document.createElement("span")).className="next-ep-duration",q.textContent="10",O.append(F,q)}else q&&(q.textContent="10")}else M=L(),P.insertBefore(M,P.firstChild);P.appendChild(B(S[0],P,l));var T=document.getElementById(l);N(T,S[0]),A(T,!1)}else{var X=document.createElement("div");X.className="next-ep-preview",X.style.visibility="hidden";var D=document.getElementById(l);D.append(X);var R=L();X.append(R);var G=B(S[0],X,l);X.append(G),N(D,S[0]),A(D,!1)}}},I=function(e,n){var i=t(e);if(i){var o=i.duration();if(Number.isFinite(o)&&!(o<=0)){i.pause(e);var r=a();l(r,e,p)}}};function j(e,n){var a=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var l=document.createElement("div");l.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(i),o.alt="Provider Image",l.append(o),a.el().appendChild(l),a.on("useractive",function(){l.classList.remove("vjs-fade")}),a.on("userinactive",function(){a.paused()||l.classList.add("vjs-fade")}),a.on("fullscreenchange",function(){a.isFullscreen_?l.style.top="3.2rem":l.style.top="1rem"})}}s={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},u=function e(){var t,n,a,i,l;for(a in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[a])i.hasOwnProperty(l)&&("object"===r(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);return n},c=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},m=function e(t){return"HTML"!==t.nodeName&&"static"===c(t)("position")?e(t.offsetParent):t},d.registerPlugin("thumbnails",function(e){var t,n,a,i,l,o,r,d;function p(){document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",p),d()}n=u({},s,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",a=document.createElement("img"),t.appendChild(a),a.src=n[0].src,a.className="vjs-thumbnail",u(a.style,n[0].style),a.style.left||a.style.right||(a.onload=function(){a.style.left=-a.naturalWidth/2+"px"}),o=i.duration(),i.on("durationchange",function(e){o=i.duration()}),i.on("loadedmetadata",function(e){o=i.duration()}),(l=i.controlBar.progressControl).el().appendChild(t),r=function(e){var i,r,d,s,p,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=m(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-=m(l.el()).getBoundingClientRect().left+g,i=Math.floor((s-l.el().offsetLeft)/l.width()*o),n)i>r&&(d=Math.max(d,r));(p=n[d]).src&&a.src!=p.src&&(a.src=p.src),p.style&&a.style!=p.style&&u(a.style,p.style),s+(h=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=c(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(a,p.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",p)}),d=function(e){t.style.left="-1000px"},l.on("mouseout",d),l.on("touchcancel",d),l.on("touchend",d),i.on("userinactive",d)});export{S as a,j as b};
@@ -1 +0,0 @@
1
- import"video.js/dist/video-js.min.css";import{c as e,g as n,a as t,b as r,d as o,e as i,s as l,f as a,l as u,h as s,v as c,i as d,j as v,k as f,m as p,t as m,n as h,o as g,p as y,q as b,r as w,u as k,w as S,x as T,y as I,z as E,A as D,B as O,C as j,D as P,E as C,F as x,G as _,H as A,I as R,J as L,K as N,L as M,M as U,N as B,O as F,P as H,Q as V,R as z,S as q,T as G,U as W,V as K,W as Y,X as $,Y as J,Z as X,_ as Q,$ as Z,a0 as ee,a1 as ne}from"./generic-90eeea98.js";import te from"@babel/runtime/helpers/defineProperty";import re from"@babel/runtime/helpers/asyncToGenerator";import oe from"@babel/runtime/regenerator";import ie from"video.js";import le from"@babel/runtime/helpers/classCallCheck";import ae from"@babel/runtime/helpers/createClass";import ue from"@babel/runtime/helpers/get";import se from"@babel/runtime/helpers/inherits";import ce from"@babel/runtime/helpers/possibleConstructorReturn";import de from"@babel/runtime/helpers/getPrototypeOf";import{h as ve,a as fe,s as pe,o as me,g as he,b as ge,c as ye,d as be,p as we,e as ke}from"./index-362fad37.js";import{g as Se,d as Te,a as Ie,e as Ee}from"./captions-7e8712e5.js";import{g as De}from"./renditions-620d93b3.js";import{playSelectedResolution as Oe}from"./resolution-2ee017b4.js";import{g as je,i as Pe,t as Ce,p as xe,a as _e}from"./skin-3653c5b3.js";import{d as Ae}from"./browser-de5f6a74.js";import{s as Re}from"./localisation-0bf399a1.js";import Le from"@babel/runtime/helpers/typeof";import"@viewlift/comscore/index.js";import Ne from"@babel/runtime/helpers/toConsumableArray";import{createSSETransport as Me}from"@viewlift/sse";import{r as Ue}from"./relatedVideosManager-8dd9aa24.js";function Be(e,n,t,r){var o=ue(de(1&r?e.prototype:e),n,t);return 2&r&&"function"==typeof o?function(e){return o.apply(t,e)}:o}function Fe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Fe=function(){return!!e})()}var He=ie.getComponent("TextTrackSettings"),Ve=ie.dom,ze=[{value:"12",label:"12px"},{value:"14",label:"14px"},{value:"16",label:"16px"},{value:"18",label:"18px"},{value:"20",label:"20px"},{value:"24",label:"24px"},{value:"28",label:"28px"},{value:"32",label:"32px"}],qe=ze.map(function(e){return e.value}),Ge="16",We="vlp-caption-font-size-px",Ke="vlp-caption-font-size-style",Ye=".vjs-font-percent > select",$e=function(e){return-1!==qe.indexOf(e)?e:Ge},Je=null;He?(Je=function(){se(r,He);var e,n,t=(e=r,n=Fe(),function(){var t,r=de(e);if(n){var o=de(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return ce(this,t)});function r(e,n){var o;return le(this,r),(o=t.call(this,e,n)).customUiReady_=!0,o.applyCustomFontSizeUI_(),o}return ae(r,[{key:"applyCustomFontSizeUI_",value:function(){this.replaceFontSizeOptions_(),this.bindFontSizeChange_(),this.restoreCustomFontSize_()}},{key:"replaceFontSizeOptions_",value:function(){var e=this.$(Ye);if(e){for(;e.firstChild;)e.removeChild(e.firstChild);ze.forEach(function(n){e.appendChild(Ve.createEl("option",{value:n.value,textContent:n.label}))}),e.value=Ge}}},{key:"bindFontSizeChange_",value:function(){var e=this,n=this.$(Ye);n&&this.on(n,"change",function(){return e.applyFontSize_(n.value)})}},{key:"applyFontSize_",value:function(e){var n=$e(e);if("undefined"!=typeof document){var t=document.getElementById(Ke);t||((t=document.createElement("style")).id=Ke,document.head.appendChild(t)),t.textContent=[".vjs-text-track-cue,",".vjs-text-track-cue > div,",".vjs-text-track-display-ttml,",".vjs-text-track-display-ttml span,",".vjs-text-track-display-ttml div","{ font-size: ".concat(n,"px !important; line-height: normal !important; }")].join(" ")}}},{key:"restoreCustomFontSize_",value:function(){var e=null;try{e=window.localStorage.getItem(We)}catch(e){}var n=$e(e),t=this.$(Ye);t&&(t.value=n),this.applyFontSize_(n)}},{key:"getValues",value:function(){var e=Be(r,"getValues",this,3)([]);return e&&delete e.fontPercent,e||{}}},{key:"setDefaults",value:function(){if(Be(r,"setDefaults",this,3)([]),this.customUiReady_){var e=this.$(Ye);e&&(e.value=Ge),this.applyFontSize_(Ge)}}},{key:"saveSettings",value:function(){if(Be(r,"saveSettings",this,3)([]),this.options_&&this.options_.persistTextTrackSettings){var e=this.$(Ye);if(e)try{window.localStorage.setItem(We,$e(e.value))}catch(e){}}}},{key:"handleLanguagechange",value:function(){Be(r,"handleLanguagechange",this,3)([]),this.applyCustomFontSizeUI_()}}]),r}(),ie.registerComponent("TextTrackSettings",Je)):console.warn("[vlp] CustomTextTrackSettings: video.js TextTrackSettings is not registered; skipping override.");var Xe=function(e){return new Promise(function(n,t){if(Qe(e))t("".concat(e," is alread initialised"));else{var r=document.createElement("script");r.async=!0,r.src=e,r.onload=function(){n()},r.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(r)}})},Qe=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Ze=function(e,n,t){var r=je(e);if(r)if(n>=0&&n<=100){r.muted()&&r.muted(!1);var o=parseFloat(n)/100;r.volume(o),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},en=function(e){var n=je(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},nn=function(){var e=re(oe.mark(function e(n){var t,r,o,i,l;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=je(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return i=e.sent,e.prev=5,e.next=8,Xe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,i.default(ie),e.finish(13);case 16:(l=ie.getTech("chromecast"))&&!l.prototype.seeking&&(l.prototype.seeking=function(){}),null!==(o=window)&&void 0!==o&&o.cast?null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.chromecastReceiverId&&null!=n&&n.airplay&&"Safari"==Ae()?null==r||r.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}},e,null,[[5,10,13,16]])}));return function(n){return e.apply(this,arguments)}}(),tn=function(e,n){var t=je(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,r,o,i,l,a=this.el(),u=ie.dom.getPointerPosition(a,n).x;ie.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var s=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(o=r.framework)||void 0===o||null===(i=o.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S;if(console.log(s),s&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*u,d.seek()}})};var rn=function(){var e=re(oe.mark(function e(){return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),Xe("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then(function(){}).catch(function(e){return console.log(e)})]);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),on=function(){var n=re(oe.mark(function n(){return oe.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,import("@viewlift/comscore/index.js").then(function(n){e.set(n)});case 2:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}(),ln=function(){var e=re(oe.mark(function e(){return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){ie.getPlugin("eme")||ie.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),an=function(){var e=re(oe.mark(function e(){var n;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(ie),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),un=function(){var e=re(oe.mark(function e(){return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-5d92eaa3.js");case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),sn=function(){var e=re(oe.mark(function e(){return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-e31d9fb5.js");case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),cn=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){Xe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(ie)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(ie)})},loadAdsLibrary:rn,loadEMELibrary:ln,loadMuxPlugin:an,loadDvrSeekbar:un,loadContribDash:sn,loadComscorePlugin:on});function dn(e){return vn.apply(this,arguments)}function vn(){return(vn=re(oe.mark(function e(n){var t;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,rn();case 3:t&&"Safari"==Ae()&&Promise.resolve().then(function(){return cn}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function fn(e){return pn.apply(this,arguments)}function pn(){return(pn=re(oe.mark(function e(n){var t,r,o,i,l,a,u,s,c,d;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return d=je(n.playerId),e.next=3,on();case 3:d.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(r=n.comscore)||void 0===r?void 0:r.endpoint,applicationName:(null==n||null===(o=n.comscore)||void 0===o?void 0:o.applicationName)||(null===(i=window)||void 0===i?void 0:i.siteName)||null,implementationId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.implementationId,projectId:null==n||null===(a=n.comscore)||void 0===a?void 0:a.projectId,debug:(null==n||null===(u=n.comscore)||void 0===u?void 0:u.debug)||!1,persistentLabels:(null==n||null===(s=n.comscore)||void 0===s?void 0:s.persistentLabels)||{},metadata:(null==n||null===(c=n.comscore)||void 0===c?void 0:c.metadata)||{}});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function mn(e,n){return hn.apply(this,arguments)}function hn(){return(hn=re(oe.mark(function e(n,t){var r,o,i,l,a,u,s,c,d,v,f,p,m,h;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return d=(null==t?void 0:t.contentType)||"video",v=null==t||null===(r=t[d])||void 0===r?void 0:r.drmEnabled,null==t||null===(o=t[d])||void 0===o||null===(i=o.liveDetails)||void 0===i||i.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==t||null===(l=t[d])||void 0===l||null===(a=l.streamingInfo)||void 0===a||null===(u=a.videoAssets)||void 0===u?void 0:u.dash)||null,p=(null==n||null===(s=n.comscore)||void 0===s?void 0:s.enable)||!1,m=!(null==n||null===(c=n.analytics)||void 0===c||!c.muxKey),e.prev=7,e.next=10,Promise.allSettled([v?"Safari"==Ae()?ln():"caliente"!=(null===(h=window)||void 0===h?void 0:h.siteName)?sn():ln():"Safari"!=Ae()&&f?sn():null,p?fn(n):null,m?an():null,nn(n)]);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(7),console.log("Error",e.t0);case 15:case"end":return e.stop()}},e,null,[[7,12]])}))).apply(this,arguments)}function gn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function yn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?gn(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):gn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var bn=new Set,wn=null,kn=function(e,t,o,i){var l,a,u,s,c,d,v,f={},p=(null==e?void 0:e.contentType)||"video";f["c3.cm.id"]=(null===(l=e[p])||void 0===l?void 0:l.id)||"Null",f["c3.cm.contentType"]=jn(e),f[null==o||null===(a=o.Constants)||void 0===a?void 0:a.IS_LIVE]=!(null==e||!e.linearchannel),f[null==o||null===(u=o.Constants)||void 0===u?void 0:u.STREAM_URL]=t.currentSrc(),f[null==o||null===(s=o.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===n()?"NULL":n(),f["c3.cm.categoryType"]=En(e),f["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),f.DRMEnabled=(null===(c=e[p])||void 0===c?void 0:c.drmEnabled)||"None",f.DAIStream=null!==(d=e[p])&&void 0!==d&&null!==(v=d.gist)&&void 0!==v&&v.isSSAIEnabled?"YES":"NO",f[o.Constants.DEFAULT_RESOURCE]="AKAMAI",f["c3.cm.brand"]="NULL",f.CDVREnabled=Dn(e),f["c3.cm.genreList"]=Tn(e),f["c3.cm.genre"]=Sn(e),f["c3.cm.channel"]=In(e,i);var m=xn(r(),e);return f=yn(yn({},f),m)},Sn=function(e){var n,t,r,o=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[o])||void 0===n||null===(t=n.gist)||void 0===t||null===(r=t.primaryCategory)||void 0===r?void 0:r.title)||"Null"},Tn=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},In=function(e,n){var t,r,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null===(r=((null==e||null===(t=e[o])||void 0===t?void 0:t.channels)||[]).find(function(e){return(null==e?void 0:e.id)===(null==n?void 0:n.channelId)}))||void 0===r?void 0:r.title)||"NULL"},En=function(e){var n,t;return null!=e&&e.linearchannel?"Linear Channel":null!=e&&null!==(n=e.video)&&void 0!==n&&null!==(t=n.streamingInfo)&&void 0!==t&&t.isLiveStream?"Live Event":"VOD"},Dn=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video",o=(null==e||null===(n=e[r])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return o?"YES":"NO"},On=function(e,n){var t,r,o=(n||{}).epg;if(o&&null!=o&&o.enable&&null!=o&&o.programTitle)return o.programTitle;var i=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[i])||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.title)||"Null";return"".concat(l)},jn=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Pn,Cn,xn=function(e,n){var r,i,l,a,u,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return s;var c=o(),d=t();return s["c3.cm.seriesName"]=(null==n||null===(r=n.video)||void 0===r||null===(i=r.series)||void 0===i?void 0:i.title)||"Null",s["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",s["c3.cm.showTitle"]=(null==e||null===(l=e[c-1])||void 0===l||null===(a=l.episodes)||void 0===a||null===(u=a[d-1])||void 0===u?void 0:u.title)||"Null",s["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",s},_n=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},An=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Rn=function(){var e=re(oe.mark(function e(n,t){var r,o,l,a,u,s,c,d,v,f,p,m;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(null==t?void 0:t.convivaConfig)||{},o=r.trackConvivaPlayerEvent,l=r.paymentHandler,a=r.tveProvider,u=r.enable,s=r.appName,d=(c=t||{}).token,v=c.epg,u){e.next=4;break}return e.abrupt("return");case 4:if(f=je(n),"function"==typeof(p=o)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,p("getConvivaObject");case 10:if(m=e.sent){e.next=13;break}return e.abrupt("return");case 13:f.ready(function(){var e=f.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var r=_n(t.keySystem);p("contentInfo",{DRMEnabled:r})}else p("contentInfo",{DRMEnabled:"None"})}),n||p("contentInfo",{DRMEnabled:"None"})}),f.on("loadstart",function(){var e,n;wn&&wn!==f.currentSrc()&&p("playbackEnded"),p("setPlayer",f),bn.clear(),wn=f.currentSrc();var r=An(f.currentType()),o=i(),u=kn(o,f,m,v);u[null==m||null===(e=m.Constants)||void 0===e?void 0:e.PLAYER_NAME]=s||"WEB",u[null==m||null===(n=m.Constants)||void 0===n?void 0:n.ASSET_NAME]=On(o,t),u.authToken=d||"NULL",u.streamType=r,u.D2CType=l||"NONE",u.subscriberType=a?"MVPD":"FREE"!==l?"D2C":"FREE",u["c3.cm.affiliate"]=a||"NULL",Ln.setData(u),p("contentInfo",u)}),f.on("loadedmetadata",function(){var e,n=f.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),p("contentInfo",{screenResolution:e})}),f.on("play",function(){bn.has(f.currentSrc())||(bn.add(f.currentSrc()),p("playbackStarted",null))}),f.on("ended",function(){bn.has(f.currentSrc())&&bn.delete(f.currentSrc()),p("playbackEnded")}),f.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&p("initAdSensor",{player:f,adsLoader:null==e?void 0:e.adsLoader})}),f.on("dispose",function(){null==bn||bn.clear(),p("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Ln=(Pn={},{setData:function(e){Pn=yn(yn({},Pn),e)},getData:function(){return Pn}}),Nn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-c9f7f5a9.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-a3b2c49d.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-7260af27.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-7d5ba59b.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-6dd7871e.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?import("./skin-578253c6.js").then(function(t){t.initialiseSkin(e,n)}):"news"==t?import("./skin-2114817e.js").then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?import("./skin-5aa955ae.js").then(function(t){t.initialiseSkin(e,n)}):"mini"==t?import("./skin-ebecbb07.js").then(function(t){t.initialiseSkin(e,n)}):"CN_NEWS"==t&&import("./skin-e1f32725.js").then(function(t){t.initialiseSkin(e,n)})};function Mn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Un(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Mn(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Mn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Bn=[],Fn=0,Hn=null;function Vn(){Cn=null,Bn=[],Fn=0,Hn=null}function zn(e,n,t){var r,o,a,u,s,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(r=n.watchHistory)||void 0===r||r.apiVersion;var d=null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.profileId,v=Math.floor(e.currentTime()),f=Math.floor(e.duration());null==n||null===(a=n.watchHistory)||void 0===a||a.xapiKey;var p=(null==n||null===(u=n.video)||void 0===u?void 0:u.originalObjectId)||null,m=(null==n||null===(s=n.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,h=Math.floor(e.currentTime()),g=c?100:Math.floor(v/f*100),y={};m?function(e,n,t){var r=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),o=qn(r),l=(new Date).getTime(),a=i(),u=(null==a?void 0:a.video)||{},s=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,n){return Un(Un({},e),{},te({},n,u[n]))},{}),c=o.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===Cn});c<0?o.push(Un(Un({content:s},e),{},{addedDate:l,updateDate:l})):o[c]=Un(Un(Un({},o[c]),e),{},{updateDate:l});localStorage.setItem("".concat(r),JSON.stringify(o))}(y={completed:c,watchedTime:h,watchedPercentage:g},d,n.siteOwner):(y=Un(Un({videoId:Cn,watchedTime:h,watchedPercentage:g,doneWatching:c,profileId:d},Hn&&{seriesId:Hn}),p&&{originalObjectId:p}),l(y).then(function(e){}).catch(function(e){})),Fn=v+t}function qn(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Gn(e,n,t){var r=qn(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),o=[];return r&&Array.isArray(r)&&(o=r.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),o}var Wn=!1,Kn=function(e,n){var t,r,o=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[o])||void 0===t||null===(r=t.streamingInfo)||void 0===r?void 0:r.secondaryVideoAssets)||null)&&!Wn){var i=Yn(e,"videoAssets","secondaryVideoAssets"),l=a(i,n);return l&&u(n,l),Wn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Yn(e,n,t){if(Array.isArray(e))return e.map(function(e){return Yn(e,n,t)});if(null!==e&&"object"===Le(e)){var r={};return Object.keys(e).forEach(function(o){o===n&&void 0!==e[t]?r[o]=e[t]:o===t&&void 0!==e[n]?r[o]=e[n]:r[o]=Yn(e[o],n,t)}),r}return e}function $n(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 r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function Jn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function Xn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Qn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Xn(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Xn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Zn=function(e,n,t,r){var o,l,a,u,m,h=r.res,g=r.sres,y=je(e),b=(null==h?void 0:h.contentType)||"video",w=(null==h||null===(o=h[b])||void 0===o?void 0:o.drmEnabled)||!1,k=!(null==h||null===(l=h[b])||void 0===l||null===(a=l.streamingInfo)||void 0===a||!a.isLiveStream)||"linearchannel"===b,S=(null==h||null===(u=h[b])||void 0===u||null===(m=u.liveDetails)||void 0===m?void 0:m.isDvrEnabled)||!1;s(h),c.set(h),y&&(y.on("loadstart",function(){k?t.resolve({status:!0,msg:"Video Loaded",response:h}):t.resolve(Qn({status:!0,msg:"Player Initialised"},g?{seriesResponse:g,response:h}:{response:h}))}),y.on("loadeddata",function(){var t,r,o,l,a=Se(e);if(null==a||a.map(function(n){return Te(e,n.id)}),S&&"Safari"===Ae())try{var u;null==y||null===(u=y.liveTracker)||void 0===u||u.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==y||!y.muted())&&Ze(e,sessionStorage.getItem("volume")||"100");var s=i();if(d(n),v(),null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.isExternal){var c=Qn(Qn({},n),h);!function(e,n){var t,r,o;if(null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.cb&&"function"==typeof(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.cb)){var i,l,a,u=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,s=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.completionThreshold)||95,c=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.cb,d=-1;e.on("seeked",function(){var n=Math.floor(e.currentTime()),t=n-n%u;if(d=t,t>0){var r=Math.floor(n/e.duration()*100);c({watchedTime:n,watchedPercentage:r,doneWatching:r>=s})}}),e.on("timeupdate",function(){var n=Math.floor(e.currentTime()),t=n-n%u;if(n%u===0&&t!==d){d=t;var r=Math.floor(n/e.duration()*100);c({watchedTime:n,watchedPercentage:r,doneWatching:r>=s||!1})}}),e.on("ended",function(){c({watchedTime:Math.floor(e.duration()),watchedPercentage:100,doneWatching:!0})})}}(y,c)}else if(null!=n&&n.watchHistory&&null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.enable&&(!n.isAnonymousUser||null!=n&&null!==(o=n.watchHistory)&&void 0!==o&&o.saveOffline)){var f,p,m=Qn(Qn({},n),h);!function(e,n,t){var r,o,i;null!=n&&n.series&&null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable&&(Hn=null==n||null===(o=n.series)||void 0===o?void 0:o.id),Bn=[],Fn=0,Cn=t;var l=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,a=je(e);a&&(a.on("dispose",Vn),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());Bn.includes(Fn)||(e!=Fn||e<l?e>Fn&&(Fn=e+l):(Bn.push(e),zn(a,n,l)))}}),a.one("ended",function(){zn(a,n,l,!0)}))}(e,m,null==s||null===(f=s.video)||void 0===f||null===(p=f.gist)||void 0===p?void 0:p.id)}if(null!=n&&null!==(l=n.analytics)&&void 0!==l&&l.muxKey&&null!=y&&y.mux){var g,b,w,k,T,I,E=(null===(g=i())||void 0===g?void 0:g.video)||(null==h?void 0:h.video),D=null==E?void 0:E.gist,O={env_key:null==n||null===(b=n.analytics)||void 0===b?void 0:b.muxKey,player_name:"vl-web-player",player_version:null===(w=window)||void 0===w?void 0:w.vl_player_version,video_id:null==D?void 0:D.id,video_title:null==D?void 0:D.title,video_series:null==E||null===(k=E.series)||void 0===k?void 0:k.title,video_stream_type:null!=E&&null!==(T=E.streamingInfo)&&void 0!==T&&T.isLiveStream?"live":"video",viewer_user_id:null==n||null===(I=n.analytics)||void 0===I?void 0:I.userId};y.mux({debug:!1,data:O})}}),y.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];y.trigger("subtitlechanged",n)}),y.on("subtitlechanged",function(e,n){var t,r,o,i,l,a,u,s,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(o=r.framework)||void 0===o||null===(i=o.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S,p=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(c=s.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===f){var m,h=p.getMediaSession(),g=h.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),h.editTracksInfo(m)}}),y.tech_.on("retryplaylist",function(){k&&Kn(h,e)}),y.on("error",function(){var n,r;(console.log("ERROR",y.error(),y.error().code),4===y.error().code&&k)?Kn(h,e):(f(e,(null==y||null===(n=y.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==y||null===(r=y.error())||void 0===r?void 0:r.message)||"Some error occured",response:h}))}),y.one("play",function(){var e,t,r,o,l;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(r=t.appcmsMain)||void 0===r||null===(o=r.adsConfig)||void 0===o||!o.vodAdClientSideTracking){if(null!=n&&null!==(l=n.series)&&void 0!==l&&l.enable){var a,u,s,c=null===(a=i())||void 0===a||null===(u=a.video)||void 0===u||null===(s=u.gist)||void 0===s?void 0:s.id,d=p(),v=(null==d?void 0:d.get(c))||{t:0,p:0},f=v.t,m=v.p;f&&m<95&&setTimeout(function(){y.currentTime(f)},0)}else{var h,g,b,w,k,S,T,I=null!==(h=null==n?void 0:n.watchHistoryResumeTime)&&void 0!==h?h:null==n||null===(g=n.watchHistory)||void 0===g?void 0:g.watchedTime,E=null!==(b=null!==(w=null==n?void 0:n.watchedPercentage)&&void 0!==w?w:null==n||null===(k=n.watchHistory)||void 0===k?void 0:k.watchedPercentage)&&void 0!==b?b:0,D=null!==(S=null==n||null===(T=n.watchHistory)||void 0===T?void 0:T.completionThreshold)&&void 0!==S?S:95;I&&E<D&&setTimeout(function(){y.currentTime(I)},0)}if(null!=y&&y.dvrSeekbar)try{y.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),y.on("volumechange",function(){var e=100*y.volume().toFixed(2);y.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),y.on("chromecastDisconnected",function(){if(k){y.currentSource();for(var e=y.textTracks(),n=e.length-1;n>=0;n--)y.removeRemoteTextTrack(e[n])}}),y.one("loadeddata",function(){var e,n=(null==y||null===(e=y.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),r=(n.language||n.label||"").toUpperCase();return t<r?-1:t>r?1:0}),"object"==Le(y.dash)){var t,r,o,i=null==y||null===(t=y.dash)||void 0===t||null===(r=t.mediaPlayer)||void 0===r?void 0:r.getTracksFor("audio"),l=null==i?void 0:i.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),a=$n(n);try{for(a.s();!(o=a.n()).done;){var u=o.value;if(l&&(null==u?void 0:u.id)=="dash-audio-".concat(l.index)){u.enabled=!0;break}}}catch(e){a.e(e)}finally{a.f()}}else{var s,c=$n(n);try{for(c.s();!(s=c.n()).done;){var d,v,f,p=s.value;if(("Chrome"==Ae()||"Edge"==Ae()&&(null!==(d=navigator)&&void 0!==d&&null!==(v=d.userAgent)&&void 0!==v&&v.includes("Macintosh")||!w))&&null!=p&&null!==(f=p.label)&&void 0!==f&&f.includes("5.1"))y.audioTracks().removeTrack(p);else{if("main"==p.kind){p.enabled=!0;break}p.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}}))};function et(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function nt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?et(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):et(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function tt(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 rt(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)?rt(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function rt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var ot={debug:5,info:4,warn:3,error:2,fatal:1,none:0,off:0,DEBUG:5,INFO:4,WARN:3,ERROR:2,FATAL:1,NONE:0,OFF:0};function it(e,n,t){T(e,{status:t,message:"DRM ".concat(n," request failed")},"Playback Errors",{requestKind:n})}function lt(e){try{if(null!=e&&e.__vlLicenseUrl)return e.__vlLicenseUrl;var n=null==e?void 0:e.keySystems;if(n)for(var t=0,r=Object.keys(n);t<r.length;t++){var o=n[r[t]];if("string"==typeof o)return o;if(null!=o&&o.url)return o.url;if(null!=o&&o.licenseUri)return o.licenseUri}var i=null==e?void 0:e.keySystemOptions;if(Array.isArray(i)){var l,a=tt(i);try{for(a.s();!(l=a.n()).done;){var u,s,c,d=l.value,v=(null==d||null===(u=d.options)||void 0===u?void 0:u.serverURL)||(null==d||null===(s=d.options)||void 0===s?void 0:s.licenseUri)||(null==d||null===(c=d.options)||void 0===c?void 0:c.url);if(v)return v}}catch(e){a.e(e)}finally{a.f()}}}catch(e){}return""}function at(e){if(null!=e&&e.__vlDrmLicenseUrl)return e.__vlDrmLicenseUrl;try{return lt("function"==typeof e.currentSource?e.currentSource():null)}catch(e){return""}}function ut(e,n){n&&!n.__vlDrmDashHooksInstalled&&(n.__vlDrmDashHooksInstalled=!0,"function"==typeof n.addResponseInterceptor&&n.addResponseInterceptor(function(e){try{var n=(null==e?void 0:e.request)||{},t=(null==e?void 0:e.url)||(null==n?void 0:n.url)||"",r=I(t,(null==n?void 0:n.type)||(null==e?void 0:e.type));if(E(r)){var o=D(e,null);O(o)||it(t,r,o)}}catch(e){}return Promise.resolve(e)}),"function"==typeof n.registerLicenseRequestFilter&&n.registerLicenseRequestFilter(function(e){try{null!=e&&e.url&&(n.__vlLastLicenseUrl=e.url)}catch(e){}return Promise.resolve()}),"function"==typeof n.on&&n.on("public_licenseRequestComplete",function(t){try{var r,o,i,l;if(null==t||!t.error)return;var a=null!==(r=null==t||null===(o=t.error)||void 0===o||null===(i=o.data)||void 0===i?void 0:i.responseCode)&&void 0!==r?r:D(null,t.error);it((null==t||null===(l=t.data)||void 0===l?void 0:l.url)||n.__vlLastLicenseUrl||at(e)||"","license",a)}catch(e){}}))}var st=!1,ct=null,dt=new Set;function vt(e){if(e&&!e.__vlDrmDashRegistered){e.__vlDrmDashRegistered=!0,dt.add(e),e.__vlDrmDashEnabled=!0;var n=function(){e.__vlDrmDashRegistered&&(e.__vlDrmDashRegistered=!1,e.__vlDrmDashEnabled=!1,dt.delete(e),function(){if(st&&!(dt.size>0)){var e=null==ie?void 0:ie.Html5DashJS;e&&"function"==typeof e.removeHook&&"function"==typeof ct&&e.removeHook("beforeinitialize",ct),st=!1,ct=null}}())};"function"==typeof e.one?e.one("dispose",n):"function"==typeof e.on&&e.on("dispose",n)}}function ft(e){if(e){vt(e),function(){if(!st){var e=null==ie?void 0:ie.Html5DashJS;e&&"function"==typeof e.hook&&(ct=function(e,n){null!=e&&e.__vlDrmDashEnabled&&ut(e,n)},st=!0,e.hook("beforeinitialize",ct))}}(),function(e){e&&!e.__vlEmeDrmErrorInstalled&&(e.__vlEmeDrmErrorInstalled=!0,e.on("error",function(){try{var n,t="function"==typeof e.error?e.error():null;if(!t||!S(t))return;if(null!=e&&null!==(n=e.dash)&&void 0!==n&&n.mediaPlayer)return;it(at(e),"license",null)}catch(e){}}))}(e);var n=function(){var n;!function(e){var n,t,r=null==e||null===(n=e.tech_)||void 0===n||null===(t=n.vhs)||void 0===t?void 0:t.xhr;r&&"function"==typeof r.onResponse&&!e.__vlDrmVhsHooksInstalled&&(e.__vlDrmVhsHooksInstalled=!0,r.onResponse(function(e,n,t){try{var r=function(e){return(null==e?void 0:e.uri)||(null==e?void 0:e.url)||(null==e?void 0:e.src)||""}(e),o=I(r,null==e?void 0:e.type);if(!E(o))return;var i=D(t,n);O(i)&&!n||it(r,o,i)}catch(e){}}))}(e),ut(e,null==e||null===(n=e.dash)||void 0===n?void 0:n.mediaPlayer)};n(),e.on("xhr-hooks-ready",n),e.on("loadstart",function(){setTimeout(n,0)})}}var pt=function(e,n,t,r){var o,i,l,s,c,d,v,p,S,T,I,E,D,O,j,P,C,x,_,A,R,L,N,M,U,B,F,H,V,z,q,G,W,K,Y,$,J,X,Q=n.res,Z=void 0===Q?null:Q,ee=n.sres,ne=void 0===ee?null:ee,le=function(){try{var e,n,t=new URLSearchParams((null===(e=window)||void 0===e||null===(n=e.location)||void 0===n?void 0:n.search)||""),r=t.get("loglevel")||null;return{playerDebug:"true"===t.get("playerdebug"),logLevel:r,dashLogLevel:null!=r&&null!=ot[r]?ot[r]:5}}catch(e){return{playerDebug:!1,logLevel:null,dashLogLevel:5}}}(),ae=le.playerDebug,ue=le.logLevel,se=le.dashLogLevel;ae&&(console.log("[PLAYER DEBUG] config:",t),console.log("[PLAYER DEBUG] entitlement (res):",Z),ne&&console.log("[PLAYER DEBUG] series response (sres):",ne));var ce=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],de=(null===(o=Z)||void 0===o?void 0:o.contentType)||"video",ve=Pe(null===(i=Z)||void 0===i||null===(l=i[de])||void 0===l||null===(s=l.gist)||void 0===s?void 0:s.videoImageUrl)||Pe(null===(c=Z)||void 0===c||null===(d=c[de])||void 0===d||null===(v=d.gist)||void 0===v||null===(p=v.imageGist)||void 0===p?void 0:p.r16x9),fe=(null===(S=Z)||void 0===S||null===(T=S[de])||void 0===T||null===(I=T.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,pe=!(null===(E=Z)||void 0===E||null===(D=E[de])||void 0===D||null===(O=D.streamingInfo)||void 0===O||!O.isLiveStream)||"linearchannel"===de,me=(null===(j=Z)||void 0===j||null===(P=j.ads)||void 0===P||null===(C=P.preRoll)||void 0===C||null===(x=C.adTags)||void 0===x||null===(_=x.web)||void 0===_?void 0:_.active)&&(null===(A=Z)||void 0===A||null===(R=A.ads)||void 0===R||null===(L=R.preRoll)||void 0===L||null===(N=L.adTags)||void 0===N||null===(M=N.web)||void 0===M?void 0:M.url);Z=nt(nt({},Z),{},{audioAssetSource:null==t?void 0:t.audioAssetSource});var he=(null==t||null===(U=t.customData)||void 0===U?void 0:U.ads)||{},ge=(null===(B=Z)||void 0===B||null===(F=B[de])||void 0===F?void 0:F.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==he?void 0:he.vodAdSticherProvider)||!1,ye=!(null===(H=Z)||void 0===H||null===(V=H[de])||void 0===V||!V.isSSAIEnabled)&&"TRANSMIT"==(null==he?void 0:he.liveAdSticherProvider)&&!(null==he||!he.liveAdClientSideTracking),be=(null==t?void 0:t.latency)||6,we=(null==t?void 0:t.skin_settings)||{},ke=(J={enableSmoothSeeking:!0,controls:0!=(null==t?void 0:t.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==t?void 0:t.muted)||!1,autoplay:(null==t?void 0:t.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==we?void 0:we.pictureInPictureToggle)||!1},playbackRates:null!=we&&we.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==t.skin,liveui:fe},te(J,"autoplay",null==t?void 0:t.autoplay),te(J,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!me),te(J,"loop",(null==t?void 0:t.loop)||!1),te(J,"audioPosterMode",null==t?void 0:t.audioPosterMode),te(J,"html5",nt(nt({dash:nt(nt({},!ie.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:nt(nt({},((null==t?void 0:t.debugConfig)&&(null==t||null===(z=t.debugConfig)||void 0===z?void 0:z.enable)||ae)&&{debug:{logLevel:se}}),{},{streaming:{delay:{liveDelay:be},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:nt({},"IE"==Ae()&&{enableStallFix:!0,stallSeek:1}),abr:nt(nt(nt(nt({},(null==t?void 0:t.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==t?void 0:t.initialBandwidth)/1e3}}),(null==t?void 0:t.maxBitrate)&&{maxBitrate:{audio:-1,video:(null==t?void 0:t.maxBitrate)/1e3}}),(null==t?void 0:t.minBitrate)&&{minBitrate:{audio:-1,video:(null==t?void 0:t.minBitrate)/1e3}}),{},{rules:{throughputRule:{active:!0},bolaRule:{active:!1},insufficientBufferRule:{active:!1},switchHistoryRule:{active:!1},droppedFramesRule:{active:!1},abandonRequestsRule:{active:!1}},autoSwitchBitrate:{video:!0,audio:!0}})}})}),vhs:nt(nt(nt({},(null==t?void 0:t.initialBandwidth)&&{bandwidth:t.initialBandwidth}),{},{liveRangeSafeTimeDelta:be,useDevicePixelRatio:!0,experimentalLLHLS:(null==t?void 0:t.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==t||!t.initialBandwidth},(null==t||null===(q=t.customData)||void 0===q?void 0:q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(G=null==t?void 0:t.enableLowInitialPlaylist)&&void 0!==G&&G},((null==t?void 0:t.debugConfig)&&(null==t||null===(W=t.debugConfig)||void 0===W?void 0:W.enable)||ae)&&{debug:!0}),debug:(null==t?void 0:t.debugConfig)&&(null==t||null===(K=t.debugConfig)||void 0===K?void 0:K.enable)||ae||!1,nativeTextTracks:"Safari"==Ae()},0==(null==t||null===(Y=t.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==t||null===($=t.customData)||void 0===$?void 0:$.nativeVideoTracks)&&{nativeVideoTracks:!1})),te(J,"poster",ve),te(J,"techOrder",ce),te(J,"chromecast",{requestCustomDataFn:function(n){var r,o,i=je(e),l=((null==i?void 0:i.textTracksJson_)||i.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),a=function(e,n,t){var r,o,i,l,a,u,s,c,d,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,h,g,y,b,w,k,S;p.isDrmEnabled=!0;var T=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,I=(null==T?void 0:T.url)||(null==n||null===(h=n.keySystemOptions)||void 0===h||null===(g=h[0])||void 0===g||null===(y=g.options)||void 0===y?void 0:y.serverURL);p.licenseUrl=I;var E=(null==T?void 0:T.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);p.licenseToken=E}var D=(null==e||null===(r=e[f])||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.contentType)||"VIDEO";p.contentType=D;var O=null==e||null===(i=e[f])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;p.duration=O;var j=null==e||null===(a=e[f])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;p.mediaTitle=j;var P=null==e||null===(s=e[f])||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=P,p.subTitles=t,p.DVR=(null==e||null===(d=e[f])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(Z,n,l);return nt(nt({},a),{},{transmitTrackingUrl:m.get()||null,convivaMetaData:nt({customerKey:(null==t||null===(r=t.convivaConfig)||void 0===r?void 0:r.customerKey)||null,debug:(null==t||null===(o=t.convivaConfig)||void 0===o?void 0:o.debug)||!1},Ln.getData())})},modifyLoadRequestFn:function(n){var t,r,o,i,l,a=je(e),u=(null==a?void 0:a.currentSource())||{};!(null===(t=Z)||void 0===t||null===(r=t[de])||void 0===r||null===(o=r.streamingInfo)||void 0===o||null===(i=o.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(l=u.src)&&void 0!==l&&l.includes(".m3u8")&&(n.media.hlsSegmentFormat="fmp4",n.media.hlsVideoSegmentFormat="fmp4");return n}}),J);if(!ie.getPlayers()[e]){(null!=t&&t.debugConfig&&null!=t&&null!==(X=t.debugConfig)&&void 0!==X&&X.enable||ae)&&ie.log.level(ue||"debug");var Se=ie(e,ke,function(){var n=re(oe.mark(function n(){var o,i,l,s,c,d,v,p,m,S,T,I,E,D,O,j,P,C,x,_,A,R;return oe.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return ft(Se),console.log(Se),console.log(ie.VERSION),console.log(ie.getPlugins()),n.next=6,mn(t,Z);case 6:if(null!=t&&t.debugConfig&&null!=t&&null!==(o=t.debugConfig)&&void 0!==o&&o.enable||ae){try{ie.log.level(ue||"debug")}catch(e){}(E=function(){try{var e,n,t;null==Se||null===(e=Se.dash)||void 0===e||null===(n=e.mediaPlayer)||void 0===n||null===(t=n.updateSettings)||void 0===t||t.call(n,{debug:{logLevel:se}})}catch(e){}})(),Se.one("loadedmetadata",E)}if(D=null===(i=Z)||void 0===i||null===(l=i[de])||void 0===l||null===(s=l.liveDetails)||void 0===s?void 0:s.startOverTime,pe&&r.resolve(nt({status:!0,msg:"Player Initialised"},ne?{seriesResponse:ne,response:Z}:{response:Z})),y(e,{analyticsCb:null==t?void 0:t.analyticsCb,analyticsEventParams:null==t?void 0:t.analyticsEventParams,userId:null==t?void 0:t.userId}),Rn(e,t),/Android/i.test(navigator.userAgent)&&(ie.options.vhs.overrideNative=!0),fe&&tn(e,D),!me||null!=t&&null!==(c=t.customData)&&void 0!==c&&c.disableAds||b(e,me,Z),O=a(Z,e),console.log(O),ae&&(console.log("[PLAYER DEBUG] source:",O),console.log("[PLAYER DEBUG] videojs options:",ke)),null!=t&&t.nearestClusterUrl&&(O=w(O,t.nearestClusterUrl)),!ge){n.next=24;break}return n.next=21,k(e,Z);case 21:O=n.sent,n.next=28;break;case 24:if(!ye){n.next=28;break}return n.next=27,g(O,Z,e);case 27:O=n.sent;case 28:Se&&(Se.__vlDrmLicenseUrl=lt(O)),O?u(e,O):(r.reject({status:!1,msg:"Incompatible / Missing Source",response:Z}),f(e,"Incompatible / Missing Source")),((null===(d=Z)||void 0===d||null===(v=d[de])||void 0===v||null===(p=v.contentDetails)||void 0===p||null===(m=p.closedCaptions)||void 0===m?void 0:m.length)>0||(null===(S=Z)||void 0===S||null===(T=S[de])||void 0===T||null===(I=T.closedCaptions)||void 0===I?void 0:I.length)>0)&&(R=(null===(P=Z)||void 0===P||null===(C=P[de])||void 0===C||null===(x=C.contentDetails)||void 0===x?void 0:x.closedCaptions)||(null===(_=Z)||void 0===_||null===(A=_[de])||void 0===A?void 0:A.closedCaptions),j=R.filter(function(e){return"VTT"===e.format}),Ie(e,j)),null!=t&&t.disableControls?h(e):Nn(e,nt(nt(nt({},t),ke),{},{liveVideo:pe,isDvrEnabled:fe,res:Z,sres:ne})),Zn(e,nt(nt(nt({},t),ke),{},{liveVideo:pe}),r,{res:Z,sres:ne});case 33:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}};function mt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function ht(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?mt(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):mt(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var gt=function(e,n){var t=n.resolve,r=n.reject,o=null==e?void 0:e.playerId,i=yt(e);pt(o,{res:i},e,{resolve:t,reject:r})},yt=function(e){var n,t,r,o,i,l,a,u,s,c,d,v,f,p=null==e?void 0:e.streamingInfo,m=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,h=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,g=(null==e||null===(r=e.streamingInfo)||void 0===r||null===(o=r.ads)||void 0===o?void 0:o.url)||null,y=(null==e||null===(i=e.streamingInfo)||void 0===i?void 0:i.posterUrl)||null,b=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.subtitles)||[],w=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(u=a.videoAssets)||void 0===u?void 0:u.drmProvider)||null,k=(null==e||null===(s=e.streamingInfo)||void 0===s?void 0:s.macroMap)||[],S=(null==e||null===(c=e.customData)||void 0===c||null===(d=c.ads)||void 0===d?void 0:d.isSSAIEnabled)||!1,T=null==e?void 0:e.token,I=j(T);null==I||I.site;var E=null==I?void 0:I.siteId,D=(null==e||null===(v=e.customData)||void 0===v||null===(f=v.comscore)||void 0===f?void 0:f.video)||null,O=ht(ht({id:"".concat(E,"_external")},!h&&{directPlaybackUrl:null==m?void 0:m.url}),{},{video:ht(ht(ht(ht(ht({drmEnabled:h,streamingInfo:ht(ht({videoAssets:ht(ht({},w&&{drmProvider:w}),{},{widevine:null==m?void 0:m.widevine,fairPlay:null==m?void 0:m.fairPlay,playReady:null==m?void 0:m.playReady})},(null==p?void 0:p.isDvrEnabled)&&{isLiveStream:!0}),(null==D?void 0:D.isLiveStream)&&{isLiveStream:null==D?void 0:D.isLiveStream})},S&&{isSSAIEnabled:S}),{},{metadata:k,liveDetails:{isDvrEnabled:null==p?void 0:p.isDvrEnabled},gist:ht(ht(ht({},y&&{videoImageUrl:y}),(null==D?void 0:D.videoId)&&{id:null==D?void 0:D.videoId}),(null==D?void 0:D.videoTitle)&&{title:null==D?void 0:D.videoTitle}),contentDetails:ht({},(null==b?void 0:b.length)>0&&{closedCaptions:Ne(b)})},(null==D?void 0:D.runtime)&&{runtime:null==D?void 0:D.runtime}),(null==D?void 0:D.publishDate)&&{publishDate:null==D?void 0:D.publishDate}),(null==D?void 0:D.platform)&&{platform:null==D?void 0:D.platform}),(null==D?void 0:D.series)&&{series:null==D?void 0:D.series}),ads:{preRoll:{adTags:{web:ht(ht({},g&&{active:!0}),g&&{url:g})}}}});return D&&(null!=D&&D.isDvrEnabled&&(O.video.liveDetails=ht(ht({},O.video.liveDetails),{},{isDvrEnabled:null==D?void 0:D.isDvrEnabled})),null!=D&&D.metadata&&(O.video.metadata=[].concat(Ne(O.video.metadata),Ne(null==D?void 0:D.metadata)))),O};function bt(e,n){return wt.apply(this,arguments)}function wt(){return(wt=re(oe.mark(function e(n,t){var r,o,i,l,a,u,c,d,v;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,l=t.reject,a=null==n?void 0:n.videoId,u=null==n?void 0:n.playerId,c=!(null==n||!n.anonymousId),e.next=6,_();case 6:d=e.sent,v=!1===(null==n||null===(r=n.customData)||void 0===r||null===(o=r.ads)||void 0===o?void 0:o.isSSAIEnabled),P(a,d,v).then(function(e){var t,r,o,v,f,p,m,h,g,y,b;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(r=t.video)||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.contentType,s(null==e?void 0:e.data);var w=null==e||null===(v=e.data)||void 0===v||null===(f=v.video)||void 0===f||null===(p=f.gist)||void 0===p?void 0:p.scheduleEndDate,k=null==e||null===(m=e.data)||void 0===m||null===(h=m.video)||void 0===h||null===(g=h.gist)||void 0===g?void 0:g.scheduleStartDate;ve(u,{scheduleEndDate:w,scheduleStartDate:k});var S=null==e?void 0:e.data;if(null!=n&&null!==(y=n.watchHistory)&&void 0!==y&&y.isExternal)S.contentType="video",pt(u,{res:S},n,{resolve:i,reject:l});else if(null!=n&&n.watchHistory&&null!=n&&null!==(b=n.watchHistory)&&void 0!==b&&b.enable&&!c){var T;if((null===(T=n.watchHistory)||void 0===T?void 0:T.saveOffline)||!1){var I,E,D,O=Gn((null===(I=n.watchHistory)||void 0===I?void 0:I.profileId)||"",a,null==n?void 0:n.siteOwner);if(O&&O.length)n.watchHistoryResumeTime=(null===(E=O[0])||void 0===E?void 0:E.watchedTime)||null,n.watchedPercentage=(null===(D=O[0])||void 0===D?void 0:D.watchedPercentage)||null;S.contentType="video",pt(u,{res:S},n,{resolve:i,reject:l})}else C(a,d).then(function(e){var t,r,o,i,l,a;null!==(t=window)&&void 0!==t&&null!==(r=t.watchHistory)&&void 0!==r&&r.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,S.contentType="video"}).catch(function(){}).finally(function(){pt(u,{res:S},n,{resolve:i,reject:l})})}else pt(u,{res:S},n,{resolve:i,reject:l})}).catch(function(e){var t,r,o=(null==n||null===(t=n.event)||void 0===t?void 0:t.showScheduleTimer)||!1,i=(null==n||null===(r=n.event)||void 0===r?void 0:r.onCountdownComplete)||null;o&&fe(u,e,i),x(e,u,l,a)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function kt(e,n){return St.apply(this,arguments)}function St(){return(St=re(oe.mark(function e(n,t){var r,o,i,l,a,u,s,c;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,l=t.reject,e.next=3,_();case 3:a=e.sent,u=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,c=!1===(null==n||null===(r=n.customData)||void 0===r||null===(o=r.ads)||void 0===o?void 0:o.isSSAIEnabled),A(s,a,c).then(function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,pt(u,{res:t},n,{resolve:i,reject:l})}).catch(function(e){x(e,u,l,videoId)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Tt(e,n){return It.apply(this,arguments)}function It(){return(It=re(oe.mark(function e(n,t){var r,o,i,l,a,u,c;return oe.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,e.next=3,_();case 3:l=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,N.set(parseInt(u)),c=null==n||null===(r=n.series)||void 0===r?void 0:r.id,R(c,l).then(function(e){var t,r,u,d=e.data,v=e.data.seasons;M(v);var f=videoId||(null==v||null===(t=v[0])||void 0===t||null===(r=t.episodes)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.id);L(c,l),P(f,l).then(function(e){var t,r,l;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(r=t.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,s(e.data),pt(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:o,reject:i})}).catch(function(e){x(e,a,i,videoId)})}).catch(function(e){x(e,a,i)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}var Et,Dt=(Et=new Map,{set:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=Array.isArray(n)?n:[];return Et.set(e,t),t},get:function(e){return Et.get(e)||[]},remove:function(e){Et.delete(e)}});function Ot(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function jt(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 Pt(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)?Pt(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function Pt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var Ct=function(e){var n=Date.parse(null==e?void 0:e.eventStartUtc),t=Number.isFinite(n)?n/1e3:0;return{start:t+(Number(null==e?void 0:e.startTime)||0),end:t+(Number(null==e?void 0:e.endTime)||0)}},xt=function(e){var n;try{var t,r,o=null==e||null===(t=e.liveTracker)||void 0===t||null===(r=t.seekableEnd)||void 0===r?void 0:r.call(t);if(Number.isFinite(o))return o}catch(e){}var i=null==e||null===(n=e.seekable)||void 0===n?void 0:n.call(e);return i&&i.length?i.end(i.length-1):NaN};function _t(e){var n=null,t=null,r="none",o=function(o){var i=je(e);if(!i)return null;if("pdt"===r&&null!=n)return t+(o-n);var l=xt(i);return Number.isFinite(l)?l-(Date.now()/1e3-o):null},i=function(){var n=je(e),t=n&&n.seekable();return t&&t.length?{start:t.start(0),end:t.end(t.length-1)}:{start:0,end:0}};return{refreshAnchor:function(){var o=je(e);if(o){var i=function(e){try{var n=e.tech(!0),t=n&&n.vhs,r=t&&t.playlists,o=r&&"function"==typeof r.media&&r.media();return o&&o.segments||null}catch(e){return null}}(o),l=o.currentTime()||0;if(i&&i.length){var a,u=null,s=1/0,c=jt(i);try{for(c.s();!(a=c.n()).done;){var d=a.value;if(d&&"number"==typeof d.programDateTime&&"number"==typeof d.start&&Number.isFinite(d.start)){var v=Math.abs(d.start-l);v<s&&(s=v,u=d)}}}catch(e){c.e(e)}finally{c.f()}if(u)return n=u.programDateTime/1e3,t=u.start,void(r="pdt")}n=null,t=null,r="now"}},anchorInfo:function(){return function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ot(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ot(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}({anchorPdtSec:n,anchorPlayerT:t,source:r},i())},chapterToPlayerTime:function(e){return o(Ct(e).start)},chapterStartPercent:function(e){return function(e){var n=i(),t=n.start,r=n.end;if(!(r>t))return null;var l=o(e);return null==l||l<t||l>r?null:(l-t)/(r-t)*100}(Ct(e).start)},playerTimeToChapterIndex:function(o,i){var l=function(o){var i=je(e);if(!i)return null;if("pdt"===r&&null!=n)return n+(o-t);var l=xt(i);return Number.isFinite(l)?Date.now()/1e3-(l-o):null}(o);if(null==l)return-1;for(var a=-1,u=0;u<i.length;u++){var s=Ct(i[u]),c=s.start,d=s.end,v=Math.max(d,c+.001);l>=c&&l<v&&(a=u)}return a},windowBounds:i}}function At(e){return"livedvr"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).timeMode?_t(e):function(e){var n=function(e){return Number(null==e?void 0:e.startTime)||0},t=function(e){var t=Number(null==e?void 0:e.endTime);return Number.isFinite(t)?t:n(e)};return{chapterToPlayerTime:function(e){return n(e)},chapterStartPercent:function(t){var r=je(e),o=r&&r.duration();if(!Number.isFinite(o)||o<=0)return null;var i,l=n(t);return l<0||l>o?null:100*((i=l/o)<0?0:i>1?1:i)},playerTimeToChapterIndex:function(e,r){for(var o=-1,i=0;i<r.length;i++){var l=n(r[i]),a=Math.max(t(r[i]),l+.001);e>=l&&e<a&&(o=i)}return o},windowBounds:function(){var n=je(e),t=n&&n.duration();return{start:0,end:Number.isFinite(t)?t:0}},refreshAnchor:function(){},anchorInfo:function(){return{source:"vod"}}}}(e)}var Rt="chapter-change",Lt="chapter-click",Nt="chapters-updated";function Mt(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=je(e);r?r.trigger(n,t):console.error("[CHAPTERS] Player instance not found")}function Ut(e){var n=je(e);if(!n)return console.error("[CHAPTERS] Player instance not found"),{};var t=function(e,t){var r=function(e,n){return t(n)};return n.on(e,r),function(){return n.off(e,r)}};return{onChapterChange:function(e){return t(Rt,e)},onChapterClick:function(e){return t(Lt,e)},onChaptersUpdated:function(e){return t(Nt,e)}}}var Bt="vjs-chapter-marker",Ft="vjs-chapter-preview",Ht=function(e){try{var n,t,r;return(null==e||null===(n=e.controlBar)||void 0===n||null===(t=n.progressControl)||void 0===t||null===(r=t.seekBar)||void 0===r?void 0:r.el())||null}catch(e){return null}};function Vt(e,n){var t=n.store,r=n.mapper,o=n.chaptersConfig,i=void 0===o?{}:o,l=n.seek,a=je(e);if(!a)return{render:function(){},reposition:function(){},destroy:function(){}};var u=new Map,s=null,c=-1,d=function(){return!0===(null==i?void 0:i.enable)},v=function(n,t){var o=je(e),i=Ht(o);if(i){var l=function(e){if(s&&s.isConnected)return s;(s=document.createElement("div")).className=Ft;var n=document.createElement("div");n.className="vjs-chapter-preview__time";var t=document.createElement("div");t.className="vjs-chapter-preview__label",s.appendChild(n),s.appendChild(t);var r=document.createElement("span");return r.className="vjs-chapter-preview__pointer",s.appendChild(r),s._time=n,s._label=t,s._pointer=r,e.appendChild(s),s}(i);l._time.textContent=function(e){try{var n=r.chapterToPlayerTime(e);if(null==n||!Number.isFinite(n))return"";if("vod"===("function"==typeof r.anchorInfo?r.anchorInfo():{}).source)return ie.formatTime(n,n);var t=(r.windowBounds()||{}).end;if(!Number.isFinite(t))return"";var o=Math.max(0,t-n);return"-".concat(ie.formatTime(o,o))}catch(e){return""}}(n),l._label.textContent=(null==n?void 0:n.label)||"",l.classList.add("vjs-chapter-preview--visible");var a="function"==typeof(null==o?void 0:o.el)?o.el():null;a&&a.classList.add("vlp-chapter-preview-open"),function(e,n,t,r){var o="function"==typeof(null==t?void 0:t.el)?t.el():null;if(o){var i=o.getBoundingClientRect(),l=n.getBoundingClientRect(),a=e.offsetWidth||300,u=a/2,s=l.left+r/100*l.width,c=i.left+8+u,d=i.right-8-u,v=s;d>=c&&(v=Math.min(Math.max(s,c),d));var f=v-u-l.left;if(e.style.left="".concat(f,"px"),e.style.transform="none",e._pointer){var p=Math.min(Math.max(s-(l.left+f),8),a-8);e._pointer.style.left="".concat(p,"px")}}else e.style.left="".concat(r,"%")}(l,i,o,t)}},f=function(){s&&s.classList.remove("vjs-chapter-preview--visible");var n=je(e),t="function"==typeof(null==n?void 0:n.el)?n.el():null;t&&t.classList.remove("vlp-chapter-preview-open")},p=function(n){var t=document.createElement("div");t.className=Bt,t.dataset.segmentId=String(n.segmentId);var o=function(e){var n=null!=e&&e.icon?String(e.icon).trim():"";if(!n)return null;var t=document.createElement("span");if(t.className="vjs-chapter-marker__icon","<"===n.charAt(0)){var r=xe(n);r&&t.appendChild(r)}else{var o=document.createElement("img");o.src=n,o.alt="",t.appendChild(o)}return t}(n);return o&&t.appendChild(o),t.addEventListener("click",function(t){t.stopPropagation(),"function"==typeof l&&l(n.segmentId),Mt(e,Lt,{chapter:n})}),t.addEventListener("mouseenter",function(){var e=r.chapterStartPercent(n);null!=e&&v(n,e)}),t.addEventListener("mouseleave",f),t},m=function(){d()&&0!==u.size&&(r.refreshAnchor(),t.get(e).forEach(function(e){var n=u.get(String(e.segmentId));if(n){var t=r.chapterStartPercent(e);null==t?n.style.display="none":(n.style.display="",n.style.left="".concat(t,"%"))}}))},h=0,g=function(n){u.forEach(function(e){return e.classList.remove("".concat(Bt,"--active"))});var r=t.get(e),o=n>=0?r[n]:null;if(o){var i=u.get(String(o.segmentId));i&&i.classList.add("".concat(Bt,"--active"))}},y=function(){var n=je(e);if(n){var o=t.get(e),i=r.playerTimeToChapterIndex(n.currentTime()||0,o);-1===i&&Date.now()<h||i!==c&&(c=i,g(i),Mt(e,Rt,{chapter:i>=0?o[i]:null}))}},b=Ce(function(){m(),y()},1e3),w=function(){m(),y()};a.on("timeupdate",b),a.on("seeked",w);var k=!1;try{a.liveTracker&&"function"==typeof a.liveTracker.on&&(a.liveTracker.on("liveedgechange",m),k=!0)}catch(e){}var S=null;(function(){try{return"function"==typeof r.anchorInfo&&"vod"!==r.anchorInfo().source}catch(e){return!1}})()&&(S=setInterval(m,500));return{render:function(){var n=je(e),o=Ht(n);o&&(o.querySelectorAll(".".concat(Bt)).forEach(function(e){return e.remove()}),u.clear(),d()&&(r.refreshAnchor(),t.get(e).forEach(function(e){var n=p(e);o.appendChild(n),u.set(String(e.segmentId),n)}),m(),g(c),y()))},reposition:m,destroy:function(){try{a.off("timeupdate",b),a.off("seeked",w),k&&a.liveTracker.off("liveedgechange",m)}catch(e){}S&&(clearInterval(S),S=null);var n=Ht(je(e));n&&n.querySelectorAll(".".concat(Bt,", .").concat(Ft)).forEach(function(e){return e.remove()}),u.clear(),s=null},setActiveBySegment:function(n){var r=t.get(e),o=r.findIndex(function(e){return String(e.segmentId)===String(n)});o<0||(h=Date.now()+1500,o!==c&&(c=o,g(o),Mt(e,Rt,{chapter:r[o]})))}}}var zt=new Map,qt=function(e){try{var n,t,r;return!(null==e||null===(n=e.controlBar)||void 0===n||null===(t=n.progressControl)||void 0===t||null===(r=t.seekBar)||void 0===r||!r.el())}catch(e){return!1}},Gt=function(e){var n=zt.get(e);if(n)return n;n={mapper:At(e,{timeMode:"vod"}),markers:null,chaptersConfig:{},timeMode:"vod"},zt.set(e,n);var t=je(e);return t&&t.on("dispose",function(){return Qt(e)}),n},Wt=function(e){var n=zt.get(e),t=function(e){var n=zt.get(e);if(!n||n.markers)return(null==n?void 0:n.markers)||null;var t=je(e);return t&&qt(t)?(n.markers=Vt(e,{store:Dt,mapper:n.mapper,chaptersConfig:n.chaptersConfig,seek:function(n){return Xt(e,n)}}),n.markers):null}(e);t&&n&&t.render()};function Kt(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.chapters,r=void 0===t?[]:t,o=n.timeMode,i=void 0===o?"vod":o;n.res;var l=n.chaptersConfig,a=void 0===l?{}:l,u=je(e);if(!u)return!1;Array.isArray(r)&&r.length&&Dt.set(e,r);var s=zt.get(e);null!=s&&s.markers&&s.markers.destroy();var c={mapper:At(e,{timeMode:i}),markers:null,chaptersConfig:a||{},timeMode:i,disposed:!1};zt.set(e,c);var d=function(){c.disposed||Wt(e)};return u.one("loadeddata",d),qt(u)&&d(),u.on("dispose",function(){return Qt(e)}),!0}function Yt(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Gt(e),Dt.set(e,n),Wt(e),Mt(e,Nt,{chapters:Dt.get(e)}),!0}function $t(e){return Dt.get(e)}function Jt(e){Dt.set(e,[]);var n=zt.get(e);return null!=n&&n.markers&&n.markers.render(),Mt(e,Nt,{chapters:[]}),!0}function Xt(e,n){var t,r,o=je(e),i=Gt(e);if(!o)return!1;var l=Dt.get(e).find(function(e){return e.segmentId===n});if(!l)return!1;i.mapper.refreshAnchor();var a=i.mapper.chapterToPlayerTime(l);if(null==a||!Number.isFinite(a))return!1;var u=i.mapper.windowBounds(),s=u.start,c=u.end;return Number.isFinite(s)&&Number.isFinite(c)&&c>s&&(a=Math.min(Math.max(a,s),c-.1)),o.currentTime(a),null===(t=i.markers)||void 0===t||null===(r=t.setActiveBySegment)||void 0===r||r.call(t,n),!0}function Qt(e){var n=zt.get(e);n&&(n.disposed=!0,n.markers&&n.markers.destroy()),zt.delete(e),Dt.remove(e)}var Zt,er=function(e){var n=e.enable,t=e.site,r=e.sseBaseUrl,o=e.sseEndpoint,l=e.debug;if(n){var a=function(e){var n=e.site,t=e.sseBaseUrl,r=e.sseEndpoint,o=e.debug,l=void 0!==o&&o;return Me({site:n,sseBaseUrl:t,getToken:_,sseEndpoint:r,onOpen:function(e){var n=e.userId,t=e.endpoint;l&&console.log("SSE Connected:",n,t)},onMessage:function(e){var n,t,r,o,a,u,s,c,d,v;if(l&&console.log("SSE Message:",e),(null===(n=i())||void 0===n||null===(t=n.video)||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.id)===(null==e||null===(o=e.payload)||void 0===o?void 0:o.id)&&"GAME_STATE_CHANGE"===(null==e?void 0:e.notificationType)){var f=1e3*(null==e||null===(a=e.payload)||void 0===a||null===(u=a.states)||void 0===u||null===(s=u.live)||void 0===s?void 0:s.startDateTime),p=1e3*(null==e||null===(c=e.payload)||void 0===c||null===(d=c.states)||void 0===d||null===(v=d.end)||void 0===v?void 0:v.endDateTime);f&&p&&(console.log("Setting schedule timer",f,p),pe.set({startDateTime:f,endDateTime:p}))}},onReconnectAttempt:function(e){l&&console.log("Reconnect attempt:",e)},onHeartbeatTimeout:function(e){var n=e.elapsed;l&&console.warn("Heartbeat timeout after:",n)},onTokenInvalid:function(e){l&&console.error("Invalid token:",e),window.location.href="/login"},onError:function(e,n){l&&console.error("SSE Error:",e,n)},onClose:function(){l&&console.log("SSE Closed")}})}({site:t,sseBaseUrl:r,sseEndpoint:o,debug:void 0!==l&&l});return a._sseBaseUrl=r,a._site=t,a._sseEndpoint=o,a}};function nr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function tr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?nr(Object(t),!0).forEach(function(n){te(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nr(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function rr(){return{loadVideoInstantly:U,onTimeUpdate:me,getVideoDuration:he,onVideoEnded:ge,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=re(oe.mark(function n(t,r){var o,i,l,a,u,s,c,d,v,f,p,m,h,g,y,b,w,k,S,T,I,E,D,O,j,C,_,A,R,L,N,M;return oe.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!z(null==e?void 0:e.playerId)){n.next=3;break}return t({status:!0,msg:"Player already initialised",skipped:!0}),n.abrupt("return");case 3:if(S=(null==e?void 0:e.videoSourceUrl)||!1,T=null==e?void 0:e.asat,I=(null==e||null===(o=e.epg)||void 0===o?void 0:o.enable)||!1,E=null==e?void 0:e.videoId,D=(null==e||null===(i=e.series)||void 0===i?void 0:i.enable)||!1,O=(null==e?void 0:e.streamingInfo)||!1,window.videoId=E,j=null==e?void 0:e.token,!Q(e)){n.next=18;break}if(sessionStorage.setItem("vlp_token",j),Z().set(null==e?void 0:e.refreshToken),j&&!ee(j)){n.next=17;break}return r({status:!1,msg:"".concat(j?"Token is expired !":"Missing Authorization Token"),response:{token:j}}),n.abrupt("return");case 17:Zt=JSON.parse(atob(j.split(".")[1]));case 18:return window.siteName=null===(l=Zt)||void 0===l?void 0:l.site,window.siteId=null===(a=Zt)||void 0===a?void 0:a.siteId,e.isAnonymousUser=!(null===(u=Zt)||void 0===u||!u.anonymousId),e.siteOwner=(null===(s=Zt)||void 0===s?void 0:s.site)||null,e.userId=(null===(c=Zt)||void 0===c?void 0:c.userId)||null,$((null===(d=Zt)||void 0===d?void 0:d.userId)||(null===(v=Zt)||void 0===v?void 0:v.anonymousId)||null),window.watchHistory=e.watchHistory||null,C=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(f=e.series)&&void 0!==f&&f.enable?null:null==e?void 0:e.chromecastReceiverId,_=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,(A=null==e?void 0:e.errors)&&(window.customErrors=A),window.customData=null==e?void 0:e.customData,Re(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),J.set(e.apiBaseUrl),null!=e&&e.skin&&!_e(e.skin)||(e.skin="VL_ONE"),X.setConfig(e),Ue.reset(),Ue.set(null==e?void 0:e.relatedVideos),n.next=39,dn(e);case 39:_&&Xe("https://www.googletagmanager.com/gtag/js?id=".concat(_)).then(function(){return ne(_)}).catch(function(e){}),(R=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(C)))&&R.addEventListener("contextmenu",function(e){return e.preventDefault()}),(L=er({enable:null==e||null===(g=e.sse)||void 0===g?void 0:g.enable,site:null==e||null===(y=e.sse)||void 0===y?void 0:y.siteName,sseBaseUrl:null==e||null===(b=e.sse)||void 0===b?void 0:b.sseBaseUrl,sseEndpoint:null==e||null===(w=e.sse)||void 0===w?void 0:w.sseEndpoint,debug:null==e||null===(k=e.sse)||void 0===k?void 0:k.debug}))&&!L.isConnectionActive()&&L.connect(),S?(M={directPlaybackUrl:S,id:N="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},T?P(N,j).then(function(n){var o=(null==n?void 0:n.data)||{};pt(C,{res:tr(tr({},o),M)},e,{resolve:t,reject:r})}).catch(function(e){x(e,C,r,N)}):pt(C,{res:M},e,{resolve:t,reject:r})):O?gt(e,{resolve:t,reject:r}):D?Tt(e,{resolve:t,reject:r}):I?kt(e,{resolve:t,reject:r}):bt(e,{resolve:t,reject:r});case 45:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:De,skip:B,getPlayer:je,play:F,pause:H,detectBrowser:Ae,rewind:V,loadVideo:u,seekToTimeStamp:ye,isPlayerInitialised:z,load:q,authenticateLC:G,dispose:W,enableCaptions:Ee,disableCaptions:Te,getCaptions:Se,playSelectedResolution:Oe,getSource:a,setVolume:Ze,getVolume:en,disableControls:h,setPlaybackSpeed:be,getEntitlementData:K,getSsaiEvents:Y,playerEvents:we,onReplay:ke,relatedVideosManager:Ue,setChapters:Yt,getChapters:$t,clearChapters:Jt,seekToChapter:Xt,getChapterEvents:Ut}}export{rr as V,Kt as i};
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/classCallCheck";import o from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import l from"@babel/runtime/helpers/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";import a from"video.js";import{E as s,g as r}from"./icons-262bef63.js";import{S as c,a6 as d}from"./generic-90eeea98.js";import{a as p}from"./autoNextVideo-24cb6191.js";import{j as m,g as u}from"./skin-3653c5b3.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./browser-de5f6a74.js";import"md5";import"js-cookie";import"./captions-7e8712e5.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/slicedToArray";import"@viewlift/comscore/index.js";import"./index-362fad37.js";import"./localisation-0bf399a1.js";function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}var y=a.getComponent("Component"),h=function(){n(g,y);var h,f,b=(h=g,f=v(),function(){var e,t=i(h);if(f){var o=i(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return l(this,e)});function g(e){var o,n,l,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t(this,g),(i=b.call(this,e,a)).playerId=a.playerId,i.seriesData=a.sres,i.videos=null==a||null===(o=a.playlist)||void 0===o?void 0:o.content,i.cb=(null==a||null===(n=a.playlist)||void 0===n?void 0:n.cb)||null,i.autoNext=(null==a||null===(l=a.playlist)||void 0===l?void 0:l.autoNext)||!1,i.currentVideoData=a.res,i.initialiseStructure(),i.loadCSS(),i.autoNext&&p({playerId:i.playerId,content:i.videos,cb:i.cb}),i}return o(g,[{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"playlist-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("div",{className:"playlist-selector-icon",innerHTML:"".concat(s())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./playlist-7ecf432a.js").then(function(e){var t=document.createElement("style");t.id="playlist-selection",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this.el(),t=a.dom.createEl("div",{className:"selection-container hidden"});a.dom.$(".playlist-selector-icon",this.el()).onclick=function(){var o;null!==(o=t.classList)&&void 0!==o&&o.contains("hidden")?(m(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var o=document.getElementById(this.playerId);if(o){var n=window.getComputedStyle(o,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(n,"px"),a.dom.appendContent(e,t),o.style.overflow="hidden",this.addFunctionality(t)}}},{key:"addFunctionality",value:function(t){var o=this,n=this.el(),l=a.dom.createEl("div",{className:"playlist-selector-head"}),i=a.dom.createEl("div",{className:"playlist-selector-cross-icon",innerHTML:"".concat(r())});i.onclick=function(){t.classList.add("hidden"),n.classList.remove("open"),t.style.right="-350px"};for(var s=a.dom.createEl("div",{className:"playlist-selector-title",innerHTML:"Playlist"}),p=a.dom.createEl("div",{className:"playlist-selector-content"}),m=function(t){var n,l,i=a.dom.createEl("div",{className:"playlist-container"}),s=a.dom.createEl("div",{className:"playlist-section",index:t}),r=a.dom.createEl("div",{className:"playlist-title",innerHTML:"".concat((null===(n=o.videos[t])||void 0===n?void 0:n.title)||"")}),m=a.dom.createEl("div",{className:"playlist-progress-bar",innerHTML:"<div style='width:".concat(o.videos[t].watchedPercentage,"%' class='playlist-progress-bar-value'></div>")});a.dom.appendContent(s,r),a.dom.appendContent(s,m),a.dom.appendContent(i,s),a.dom.appendContent(p,i);var u=a.dom.createEl("div",{className:"playlist-section-expanded hidden"}),v=a.dom.createEl("div",{className:"playlist-description",innerHTML:"".concat((null===(l=o.videos[t])||void 0===l?void 0:l.description)||"")}),y=a.dom.createEl("div",{className:"playlist-image"});y.style.backgroundImage="url(".concat(o.videos[t].img,")"),a.dom.appendContent(u,y),a.dom.appendContent(u,v),a.dom.appendContent(i,u),a.dom.appendContent(p,i),u.onclick=function(e){e.stopPropagation(),d(t+1),c(o.playerId,o.videos[t].id).then(function(e){null!=o&&o.cb&&o.cb(e)}).catch(function(e){null!=o&&o.cb&&o.cb(e)})},s.onclick=function(t){var o,n,l,a=document.getElementsByClassName("playlist-selector-content")[0].childNodes,s=(a=e(a))[t.target.index].getElementsByClassName("playlist-section-expanded")[0];null!=s&&null!==(o=s.classList)&&void 0!==o&&o.contains("hidden")?(i.style.backgroundColor="#0000007d",null==s||null===(n=s.classList)||void 0===n||n.remove("hidden")):(null==s||null===(l=s.classList)||void 0===l||l.add("hidden"),i.style.backgroundColor="unset")}},v=0;v<this.videos.length;v++)m(v);a.dom.appendContent(l,i),a.dom.appendContent(l,s),a.dom.appendContent(t,l),a.dom.appendContent(t,p),u(this.playerId).on("fullscreenchange",function(){var e=document.getElementById(o.playerId);if(e){var n=window.getComputedStyle(e,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(n,"px")}})}}]),g}();export{h as default};
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import r from"@babel/runtime/helpers/defineProperty";function t(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function n(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach(function(t){r(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}var o,c,i=(o=null,c=[],{set:function(r){var t;r&&(o=o?n(n({},o),{},{content:[].concat(e((null===(t=o)||void 0===t?void 0:t.content)||[]),e((null==r?void 0:r.content)||[]))}):n(n({},r),{},{content:e((null==r?void 0:r.content)||[])}),c.forEach(function(e){try{e(o)}catch(e){console.error("relatedVideosManager subscriber error",e)}}))},get:function(){return o},reset:function(){o=null,c=[]},subscribe:function(e){return c.push(e),function(){c=c.filter(function(r){return r!==e})}}});export{i as r};
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/classCallCheck";import o from"@babel/runtime/helpers/createClass";import s from"@babel/runtime/helpers/assertThisInitialized";import n from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import a from"video.js";import{E as r,g as d,B as c}from"./icons-262bef63.js";import{m,ab as u,ac as p,b as v,K as h,S as f}from"./generic-90eeea98.js";import{j as C,p as g,g as y}from"./skin-3653c5b3.js";import{a as b}from"./autoNextVideo-24cb6191.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./browser-de5f6a74.js";import"md5";import"js-cookie";import"./captions-7e8712e5.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/slicedToArray";import"@viewlift/comscore/index.js";import"./index-362fad37.js";import"./localisation-0bf399a1.js";function N(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(N=function(){return!!e})()}var E=a.getComponent("Component"),k=function(){n(L,E);var k,S,x=(k=L,S=N(),function(){var e,t=l(k);if(S){var o=l(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return i(this,e)});function L(o){var n,i,l,a,r,d,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(this,L),(d=x.call(this,o,c)).playerId=c.playerId,d.seriesData=c.sres,d.videos=null==c||null===(n=c.sres)||void 0===n?void 0:n.seasons,d.currentVideoData=c.res,d.initialiseStructure(),d.loadCSS(),d.selectedSeason=0,d.cb=null==c||null===(i=c.series)||void 0===i?void 0:i.cb,d.autoPlayNext=(null==c||null===(l=c.series)||void 0===l?void 0:l.autoPlayNext)||!1,sessionStorage.getItem("token"),d.watchMap=m(),null!==(a=s(d))&&void 0!==a&&a.autoPlayNext&&null!=c&&null!==(r=c.series)&&void 0!==r&&r.enable){var v,h,f,C,g=null==c||null===(v=c.sres)||void 0===v?void 0:v.seasons,y=[];g.map(function(t){y.push.apply(y,e(t.episodes))}),u(y),p(null===(h=d.options_)||void 0===h||null===(f=h.res)||void 0===f||null===(C=f.video)||void 0===C?void 0:C.id),b({playerId:d.playerId,content:y,cb:d.cb,series:null==c?void 0:c.sres})}return d}return o(L,[{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"series-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("div",{className:"series-selector-icon",innerHTML:"".concat(r())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./series-v2-87343239.js").then(function(e){var t=document.createElement("style");t.id="series-v2",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"toggleOpenClose",value:function(e){var t,o=this.el();null!=e&&null!==(t=e.classList)&&void 0!==t&&t.contains("hidden")?(C(),e.classList.remove("hidden"),o.classList.add("open"),e.style.right="0px"):(e.classList.add("hidden"),o.classList.remove("open"),e.style.right="-350px")}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),o=a.dom.createEl("div",{className:"series-selection-container hidden"});a.dom.$(".series-selector-icon",this.el()).onclick=function(){return e.toggleOpenClose(o)};var s=document.getElementById(this.playerId);if(s){var n=window.getComputedStyle(s,null).getPropertyValue("height").slice(0,-2);o.style.height="".concat(n,"px"),a.dom.appendContent(t,o),s.style.overflow="hidden",this.addFunctionality(o)}}},{key:"addFunctionality",value:function(e){var t=this,o=this.el(),s=a.dom.createEl("div",{className:"series-selector-head"}),n=a.dom.createEl("div",{className:"series-selector-cross-icon",innerHTML:"".concat(d())});n.onclick=function(){if("series-selector-cross-icon"===n.className)e.classList.add("hidden"),o.classList.remove("open"),e.style.right="-350px";else if("series-selector-back-icon"===n.className){var s=a.dom.$(".series-selector-content",t.el());for(a.dom.$(".series-selector-cross-icon",t.el()),n.className="series-selector-cross-icon";null!=s&&s.firstChild;)s.removeChild(s.firstChild);var i=t.createSeasonLister();for(a.dom.appendContent(s,i),a.dom.$(".series-selector-title",t.el()).textContent="Seasons";null!=n&&n.firstChild;)n.removeChild(n.firstChild);var l=g(d());n.appendChild(l)}};var i=a.dom.createEl("div",{className:"series-selector-title",innerHTML:"Seasons"}),l=a.dom.createEl("div",{className:"series-selector-content"}),r=this.createSeasonLister();a.dom.appendContent(l,r),a.dom.appendContent(s,n),a.dom.appendContent(s,i),a.dom.appendContent(e,s),a.dom.appendContent(e,l),y(this.playerId).on("fullscreenchange",function(){var o=document.getElementById(t.playerId);if(o){var s=window.getComputedStyle(o,null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(s,"px")}})}},{key:"createSeasonLister",value:function(){var e=this;y(this.playerId);for(var t=v(),o=a.dom.createEl("div",{className:"season-container"}),s=function(s){var n,i=document.createElement("label");i.className="season-holder",i.setAttribute("for","season-".concat(s));var l=document.createElement("div");l.className="season - ".concat(s),l.textContent=null===(n=t[s])||void 0===n?void 0:n.title;var r=a.dom.createEl("input",{className:"radio - ".concat(s),id:"season-".concat(s),name:"season-radio"});r.setAttribute("type","radio"),e.selectedSeason==s&&(r.checked=!0),r.onclick=function(t){h.set(s),e.showSeasonDetails(s)},a.dom.appendContent(i,r),a.dom.appendContent(i,l),a.dom.appendContent(o,i)},n=0;n<t.length;n++)s(n);return o}},{key:"getSeasonDetailsContainer",value:function(t,o){var s=this;t=t.map(function(e){var t,o,n,i,l;return{id:null==e?void 0:e.id,title:null==e?void 0:e.title,description:null==e||null===(t=e.gist)||void 0===t?void 0:t.description,img:null==e||null===(o=e.gist)||void 0===o||null===(n=o.imageGist)||void 0===n?void 0:n.r16x9,watchedPercentage:(null==s||null===(i=s.watchMap)||void 0===i||null===(l=i.get(null==e?void 0:e.id))||void 0===l?void 0:l.p)||0}});for(var n=function(n){var i,l,r,d,c,m,u,v=a.dom.createEl("div",{className:"series-container"}),h=a.dom.createEl("div",{className:"series-section",index:n}),C=a.dom.createEl("div",{className:"series-title",innerHTML:"".concat((null===(i=t[n])||void 0===i?void 0:i.title)||"")}),g=a.dom.createEl("div",{className:"series-progress-bar",innerHTML:"<div style='width:".concat(t[n].watchedPercentage,"%' class='series-progress-bar-value'></div>")});a.dom.appendContent(h,C),a.dom.appendContent(h,g),a.dom.appendContent(v,h),a.dom.appendContent(o,v);var y=a.dom.createEl("div",{className:"series-section-expanded hidden"}),b=(null===(l=t[n])||void 0===l?void 0:l.description)||"";(null===(r=b)||void 0===r?void 0:r.length)>170&&(b=b.substr(0,170)+"...");var N=a.dom.createEl("div",{className:"series-description",innerHTML:"".concat(b||"")}),E=a.dom.createEl("img",{className:"series-image"});E.src="".concat((null===(d=t[n])||void 0===d?void 0:d.img)||(null===(c=window)||void 0===c||null===(m=c.customData)||void 0===m?void 0:m.fallbackImage)),E.alt="".concat(null===(u=t[n])||void 0===u?void 0:u.title),a.dom.appendContent(y,E),a.dom.appendContent(y,N),a.dom.appendContent(v,y),a.dom.appendContent(o,v),y.onclick=function(e){var o;e.stopPropagation(),p(null===(o=t[n])||void 0===o?void 0:o.id),f(s.playerId,t[n].id).then(function(e){null!=s&&s.cb&&s.cb(e)}).catch(function(e){null!=s&&s.cb&&s.cb(e)})},h.onclick=function(t){var o,s,n,i=document.getElementsByClassName("series-selector-content")[0].childNodes,l=(i=e(i))[t.target.index].getElementsByClassName("series-section-expanded")[0];null!=l&&null!==(o=l.classList)&&void 0!==o&&o.contains("hidden")?(v.style.backgroundColor="#0000007d",null==l||null===(s=l.classList)||void 0===s||s.remove("hidden")):(null==l||null===(n=l.classList)||void 0===n||n.add("hidden"),v.style.backgroundColor="unset")}},i=0;i<t.length;i++)n(i);return parent}},{key:"showSeasonDetails",value:function(e){this.selectedSeason=e;for(var t=a.dom.$(".series-selector-content",this.el());null!=t&&t.firstChild;)t.removeChild(t.firstChild);var o=v()[e].episodes;this.getSeasonDetailsContainer(o,t);var s=a.dom.$(".series-selector-cross-icon",this.el());for(s.className="series-selector-back-icon";null!=s&&s.firstChild;)s.removeChild(s.firstChild);var n=g(c());s.appendChild(n),a.dom.$(".series-selector-title",this.el()).textContent="Season ".concat(e+1)}}]),L}();export{k as default};