@viewlift/player-backup 2.0.272-backup → 2.0.273-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 (69) hide show
  1. package/cjs/{autoNextVideo-d1bc37e9.js → autoNextVideo-0de0c99f.js} +1 -1
  2. package/cjs/bundle.css +742 -742
  3. package/cjs/{features-ac06de4d.js → features-37a04894.js} +1 -1
  4. package/cjs/generic-ae574c9a.js +1 -0
  5. package/cjs/{index-3ab7e3cb.js → index-1a998ebc.js} +1 -1
  6. package/cjs/{index-cbd8333d.js → index-752fb705.js} +1 -1
  7. package/cjs/index.js +1 -1
  8. package/cjs/{multicamv2-7a5e0da3.js → multicamv2-ae7ad18b.js} +1 -1
  9. package/cjs/{multicamv2-ff275d29.js → multicamv2-b929ee52.js} +1 -1
  10. package/cjs/{nextEpisodeButton-43dfe981.js → nextEpisodeButton-9c276bae.js} +1 -1
  11. package/cjs/{playlist-356ff361.js → playlist-cbca04c1.js} +1 -1
  12. package/cjs/{series-fdd93923.js → series-ff8ba498.js} +1 -1
  13. package/cjs/{series-v2-13fa8a68.js → series-v2-67043b16.js} +1 -1
  14. package/cjs/{series-v2-d47e2c65.js → series-v2-d10e780c.js} +1 -1
  15. package/cjs/{skin-4b695a83.js → skin-34188947.js} +1 -1
  16. package/cjs/{skin-a56fc816.js → skin-479b7ff2.js} +1 -1
  17. package/cjs/{skin-93eaf0b9.js → skin-67a053be.js} +1 -1
  18. package/cjs/{skin-dd1150d3.js → skin-743ea67a.js} +1 -1
  19. package/cjs/skin-a57ec2d4.js +1 -0
  20. package/cjs/{skin-e6c74bca.js → skin-dbd0eb85.js} +1 -1
  21. package/cjs/skin-ee093670.js +1 -0
  22. package/cjs/{skin-5af20e5f.js → skin-f0acf681.js} +1 -1
  23. package/cjs/{skin-859c65bd.js → skin-f8d0355f.js} +1 -1
  24. package/cjs/{util-0552a53e.js → util-bdbdb756.js} +1 -1
  25. package/cjs/{videoSelector-ab53b5ca.js → videoSelector-69edac48.js} +1 -1
  26. package/cjs/{videoSelector-f0356447.js → videoSelector-f5ed50a7.js} +1 -1
  27. package/esm/{autoNextVideo-e8df1a63.js → autoNextVideo-b5a0e7f2.js} +1 -1
  28. package/esm/bundle.css +742 -742
  29. package/esm/{features-cb3674ee.js → features-6789d00a.js} +1 -1
  30. package/esm/generic-33a5f6db.js +1 -0
  31. package/esm/{index-5bab022d.js → index-21baa8fb.js} +1 -1
  32. package/esm/{index-0c364075.js → index-367f32c7.js} +1 -1
  33. package/esm/index.js +1 -1
  34. package/esm/{multicamv2-7f7a8900.js → multicamv2-38526af8.js} +1 -1
  35. package/esm/{multicamv2-e1099dc7.js → multicamv2-63c414c7.js} +1 -1
  36. package/esm/{nextEpisodeButton-2ce1e3df.js → nextEpisodeButton-6f748f3c.js} +1 -1
  37. package/esm/{playlist-74219367.js → playlist-0354b5d9.js} +1 -1
  38. package/esm/{series-715a9f84.js → series-9ae8159d.js} +1 -1
  39. package/esm/{series-v2-1cb33a14.js → series-v2-0cc8f758.js} +1 -1
  40. package/esm/{series-v2-d3355275.js → series-v2-70023e34.js} +1 -1
  41. package/esm/{skin-4770cb4a.js → skin-272c9ee0.js} +1 -1
  42. package/esm/skin-30aad0cd.js +1 -0
  43. package/esm/skin-584ab22b.js +1 -0
  44. package/esm/skin-5dcf4810.js +1 -0
  45. package/esm/skin-8d8c5654.js +1 -0
  46. package/esm/skin-a29e48d8.js +1 -0
  47. package/esm/{skin-d32b190c.js → skin-b3b3b287.js} +1 -1
  48. package/esm/skin-b67cc4f1.js +1 -0
  49. package/esm/{skin-eb3c788b.js → skin-fa83e953.js} +1 -1
  50. package/esm/{util-a0ce1bd0.js → util-66a380dd.js} +1 -1
  51. package/esm/{videoSelector-42263fa9.js → videoSelector-26401bd6.js} +1 -1
  52. package/esm/{videoSelector-560bf4de.js → videoSelector-df3d0d5d.js} +1 -1
  53. package/package.json +4 -1
  54. package/cjs/generic-853f89bd.js +0 -1
  55. package/cjs/skin-25eba125.js +0 -1
  56. package/cjs/skin-8919623f.js +0 -1
  57. package/esm/components/transmit/constants.d.ts +0 -42
  58. package/esm/components/transmit/index.d.ts +0 -9
  59. package/esm/components/transmit/session.d.ts +0 -4
  60. package/esm/components/transmit/transmitAd.d.ts +0 -26
  61. package/esm/components/transmit/transmitAdManager.d.ts +0 -66
  62. package/esm/components/transmit/utils.d.ts +0 -2
  63. package/esm/generic-6bd18e7c.js +0 -1
  64. package/esm/skin-0f0b158c.js +0 -1
  65. package/esm/skin-adec58f3.js +0 -1
  66. package/esm/skin-b4b45ad3.js +0 -1
  67. package/esm/skin-d6db5c40.js +0 -1
  68. package/esm/skin-e659efe9.js +0 -1
  69. package/esm/skin-ea3284a6.js +0 -1
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{K as a,H as s}from"./generic-6bd18e7c.js";import{g as c}from"./renditions-19f0b3a9.js";import{g as d,p as u}from"./skin-4f84b841.js";import{g as p}from"./localisation-0bf399a1.js";function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?m(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function f(e){var t=v();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}var g=function(e){var o=function(e){r(i,e);var o=f(i);function i(e,n){var r;t(this,i);var l=(r=o.call(this,e,n)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=p("slowMoText")||"Slow Mo",r}return n(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},C=function(e,o,l){var s=function(o){r(s,o);var i=f(s);function s(e,n){var r;t(this,s);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-rewind-button");var a=u(l);return o.append(a),r}return n(s,[{key:"handleClick",value:function(){a(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},y=function(e,o,l){var a=function(o){r(a,o);var i=f(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-skip-button");var s=u(l);return o.append(s),r}return n(a,[{key:"handleClick",value:function(){s(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},B=function(e,t,n){import("./resolution-56c85eaf.js").then(function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=d(e),a=c(e);(null==a?void 0:a.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:n,renditions:a},l.controlBar.children().length-4))})},b=function(e,t,n){import("./nextEpisodeButton-2ce1e3df.js").then(function(r){var o=r.default,l=d(n);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:n,sres:e,res:t},l.controlBar.children().length-5)})},j=function(e,t,n){import("./series-715a9f84.js").then(function(r){var o=r.seriesModule,l=d(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var a=document.querySelectorAll(".season-title-sdk"),s=function(e){a[e].addEventListener("click",function(){t[e]&&r.handleSeasonChange(t[e],e,l,n)})},c=0;c<a.length;c++)s(c)})},k=function(e,t){import("./videoSelector-560bf4de.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},S=function(e,t){import("./caption-settings-106547c2.js").then(function(n){var r,o,l,a,s=n.default,c=d(e);i.registerComponent("captionSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)})},E=function(e,t){import("./settings-icon-0de53818.js").then(function(n){var r,o,l,a,s=n.default,c=d(e);i.registerComponent("settingsSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)})},O=function(e,t){import("./playlist-74219367.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)})},I=function(e,t){import("./series-v2-1cb33a14.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},w=function(e,t){import("./multicamv2-7f7a8900.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})},M=function(e,t){var n=d(e).el(),r=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});n.append(r)},P=function(e){var t=d(e).el(),n=0,r=d(e);r.addChild("fullscreenToggle");var o=function(){var e,n=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];n&&n.click()};r.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;r.el().addEventListener("touchend",function(){var e=(new Date).getTime(),r=e-n;if(r<300&&r>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}n=e}),window._multiplayer_dbTapHandler=o},x=function(e,t){import("./videoSelector-42263fa9.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},L=function(e,t){import("./series-v2-d3355275.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},N=function(e,t){import("./multicamv2-e1099dc7.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})},_=function(e,t){import("./index-7f9c8eec.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("MuteButton",r),o.addChild("MuteButton",h({playerId:e},t))})};export{B as a,j as b,b as c,y as d,C as e,E as f,S as g,M as h,g as i,x as j,N as k,O as l,L as m,P as n,k as o,I as p,w as q,_ as r};
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{I as a,F as s}from"./generic-33a5f6db.js";import{g as c}from"./renditions-19f0b3a9.js";import{g as d,p as u}from"./skin-4f84b841.js";import{g as p}from"./localisation-0bf399a1.js";function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?m(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function f(e){var t=v();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}var g=function(e){var o=function(e){r(i,e);var o=f(i);function i(e,n){var r;t(this,i);var l=(r=o.call(this,e,n)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=p("slowMoText")||"Slow Mo",r}return n(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},C=function(e,o,l){var s=function(o){r(s,o);var i=f(s);function s(e,n){var r;t(this,s);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-rewind-button");var a=u(l);return o.append(a),r}return n(s,[{key:"handleClick",value:function(){a(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},y=function(e,o,l){var a=function(o){r(a,o);var i=f(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-skip-button");var s=u(l);return o.append(s),r}return n(a,[{key:"handleClick",value:function(){s(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},B=function(e,t,n){import("./resolution-56c85eaf.js").then(function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=d(e),a=c(e);(null==a?void 0:a.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:n,renditions:a},l.controlBar.children().length-4))})},b=function(e,t,n){import("./nextEpisodeButton-6f748f3c.js").then(function(r){var o=r.default,l=d(n);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:n,sres:e,res:t},l.controlBar.children().length-5)})},j=function(e,t,n){import("./series-9ae8159d.js").then(function(r){var o=r.seriesModule,l=d(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var a=document.querySelectorAll(".season-title-sdk"),s=function(e){a[e].addEventListener("click",function(){t[e]&&r.handleSeasonChange(t[e],e,l,n)})},c=0;c<a.length;c++)s(c)})},k=function(e,t){import("./videoSelector-df3d0d5d.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},S=function(e,t){import("./caption-settings-106547c2.js").then(function(n){var r,o,l,a,s=n.default,c=d(e);i.registerComponent("captionSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)})},E=function(e,t){import("./settings-icon-0de53818.js").then(function(n){var r,o,l,a,s=n.default,c=d(e);i.registerComponent("settingsSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)})},O=function(e,t){import("./playlist-0354b5d9.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)})},I=function(e,t){import("./series-v2-0cc8f758.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},w=function(e,t){import("./multicamv2-38526af8.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})},M=function(e,t){var n=d(e).el(),r=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});n.append(r)},P=function(e){var t=d(e).el(),n=0,r=d(e);r.addChild("fullscreenToggle");var o=function(){var e,n=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];n&&n.click()};r.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;r.el().addEventListener("touchend",function(){var e=(new Date).getTime(),r=e-n;if(r<300&&r>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}n=e}),window._multiplayer_dbTapHandler=o},x=function(e,t){import("./videoSelector-26401bd6.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},L=function(e,t){import("./series-v2-70023e34.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},N=function(e,t){import("./multicamv2-63c414c7.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})},_=function(e,t){import("./index-7f9c8eec.js").then(function(n){var r=n.default,o=d(e);i.registerComponent("MuteButton",r),o.addChild("MuteButton",h({playerId:e},t))})};export{B as a,j as b,b as c,y as d,C as e,E as f,S as g,M as h,g as i,x as j,N as k,O as l,L as m,P as n,k as o,I as p,w as q,_ as r};
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import i from"axios";import{g as r,t as l,c as a}from"./skin-4f84b841.js";import{i as d,d as u}from"./browser-d4613b36.js";import s from"md5";import c from"js-cookie";import{a as v,r as m}from"./captions-2b4caf69.js";import f from"@babel/runtime/helpers/typeof";import p from"@babel/runtime/helpers/toConsumableArray";import w from"@babel/runtime/helpers/slicedToArray";import{destroyComscoreTag as g,formulateComscorePayload as I,createComscoreStreamingTag as h,setComscorePlayerInstance as E}from"@viewlift/comscore/index.js";function y(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function T(e){window.dataLayer=window.dataLayer||[],y("js",new Date),y("config",e)}function b(e,n){y("event",e,n)}var _={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 S(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function O(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?S(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):S(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var D={name:"@viewlift/player",version:"2.1.38",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/comscore":"^1.0.13",axios:"^1.2.3",md5:"^2.3.0",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"},overrides:{"min-document":"^2.19.1"}};window.vl_player_version=D.version;var A,L=function(){var e,n,t,o;return null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.overrideEntitlementBaseUrl?(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementBaseUrl)+"/video/status":V.get()+"".concat(null==_?void 0:_.getVideoDetails)},F=function(e,n){var t,o,r,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):i({url:L(),params:O({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":D.version,"x-player-name":"videojs",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken},withCredentials:!0})},P=function(e,n){var t,o,r,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):i({url:V.get()+_.getLinearChannelDetails,params:O(O(O(O(O({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},(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===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken}})},C=function(e,n){var t,o,r=$(n),l=(null==r?void 0:r.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})}):i({url:V.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},k=function(){var e=n(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X();case 2:return o=e.sent,e.abrupt("return",i({url:V.get()+"".concat(null==_?void 0:_.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:O({},n),params:O({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),R=function(e,n){var t,o,r=window.contentType;return i({method:"GET",url:V.get()+"".concat(null==_?void 0:_.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},j=function(e){var n=e.videoId;return i({method:"GET",url:V.get()+"".concat(null==_?void 0:_.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},V=(A=null==_?void 0:_.apiBaseUrl,{set:function(e){e&&(A=e)},get:function(){return A}}),W=function(e,n,t,o){var r,l;return i({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n,adbTempToken:null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.adbTempToken},withCredentials:!0})},N=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},U=null;function B(){return{set:function(e){e&&(U=e)},get:function(){return U}}}var M,x,H,G,Y,Q,z,q=function(){var e=n(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=B().get(),o=V.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);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)}}(),K=null,X=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"))||!N(n)){e.next=6;break}return K||(K=q().then(function(e){var t,o,i=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return i&&sessionStorage.setItem("vlp_token",i),r&&B().set(r),i||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){K=null})),e.abrupt("return",K);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),J=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,o=null==e?void 0:e.asat;return t&&!o&&(n=!1),n},$=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},Z=function(e){e&&"undefined"!=typeof window&&window.sessionStorage&&window.sessionStorage.setItem("uid",e)},ee=(Q=new Map,{set:function(e){var n,t=(null==e||null===(n=e.video)||void 0===n?void 0:n.id)||e||null;Q.set(t,(Q.get(t)||0)+1)},get:function(e){return Q.get(e)},clear:function(){Q.clear()}}),ne=function(e){x=e},te=function(){return x},oe=function(e){M=e},ie=function(){return M},re=function(){return H},le=function(e){H=e},ae=function(){return Y},de=function(e){G=new Map,e.map(function(e,n){G.set(e.id,n)})},ue=function(e){if(G){var n=G.get(e);le(n+1)}},se=(z=0,{set:function(e){e>=0&&(z=e)},get:function(){return z}});function ce(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function ve(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ce(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var me=0,fe=null,pe=function(){var e,n,t,o,i,r,l,a=te();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.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==a?void 0:a.channelId)}))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==a||null===(i=a.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function we(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function ge(){return fe||window.sessionStorage.getItem("uid")}function Ie(){return he.apply(this,arguments)}function he(){return(he=n(t.mark(function e(){var n,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(o=JSON.parse(atob(n.split(".")[1])))||!o.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==o?void 0:o.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ee(e){return e?String(e):""}window.initialise=function(e){window.sid=we(),window.environment="production",window.platform="WEBSITE",window.failedToStartTimer=null,window.droppedStreamTimer=null,window.firstFrameFired=!1,streamFailures(e),buffering(e),ads(e),ping(e)},window.cleanupTimers=function(){clearInterval(window.bufferingTimer),clearInterval(window.ttFirstFrameTimer),clearTimeout(window.failedToStartTimer),clearTimeout(window.droppedStreamTimer),window.failedToStartTimer=null,window.droppedStreamTimer=null},window.fireStreamFailure=function(e){var n,t,o,i=r(),l=null!=i&&i.el_?Math.floor(i.currentTime()):0;window.cleanupTimers(),b(e,ve({pfm:window.platform,uid:ge(),vid:pe(),videoPosition:l},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:e,videoPosition:l,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 o,i,r;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),window.failedToStartTimer=setTimeout(function(){window.firstFrameFired||window.fireStreamFailure("FAILED_TO_START")},3e4),b("PLAY",ve({pfm:window.platform,uid:ge(),vid:pe(),videoPosition:Math.floor(e.currentTime())},null===(o=window)||void 0===o||null===(i=o.customData)||void 0===i||null===(r=i.beacon)||void 0===r?void 0:r.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",ve({"Video ID":pe(),watchTime:Math.floor(e.currentTime())},t))}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:(clearInterval(window.bufferingTimer),clearTimeout(window.droppedStreamTimer),window.droppedStreamTimer=null)},100),window.firstFrameFired&&(clearTimeout(window.droppedStreamTimer),window.droppedStreamTimer=setTimeout(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()&&window.fireStreamFailure("DROPPED_STREAM")},45e3)))}))},window.handleBufferTimer=function(e,n){var t,o;if(n.el_){var i,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(o=t.className)&&void 0!==o&&o.includes("vjs-waiting")&&me<4)me++,b("BUFFERING",ve({pfm:window.platform,uid:ge(),vid:pe(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var n,t,o;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),clearTimeout(window.failedToStartTimer),window.failedToStartTimer=null,window.firstFrameFired=!0,window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,b("FIRST_FRAME",ve({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ge(),vid:pe()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var n,t,o,i,r,l;b("AD_REQUEST",ve({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ge(),vid:pe(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),b("AD_IMPRESSION",ve({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ge(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:pe()},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var n=[];e.on("timeupdate",function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(me=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),o=e.buffered(),i=0;i<o.length;i++){var r=o.start(i),l=o.end(i);if(ye(n,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var ye=function(e,n,t){return e>=n&&e<=t},Te=function(){var e,n=te(),t=(null==n?void 0:n.contentType)||"video";return(null==n||null===(e=n[t])||void 0===e?void 0:e.network)||null};function be(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){null!=n&&n.userId&&(fe=n.userId);var t=r(e);window.initialise(t,null==n?void 0:n.analyticsCb),window.firstFrame(t,null==n?void 0:n.analyticsCb,null==n?void 0:n.analyticsEventParams),t.on("loadedmetadata",function(){window.endFirstFrame(t)})}}window.fireEvent=function(){var e=n(t.mark(function e(n){var o,r,l,a,d,u,s,c,v,m,f,p,w,g,I,h,E,y,T,b,S;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X();case 2:return E=e.sent,y=$(E),T=null==y?void 0:y.site,b=null==y?void 0:y.siteId,e.t0=ve,e.t1=ve,e.t2=ve({aid:T,cid:b,pfm:window.platform},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params),e.t3={},e.t4=ge(),e.t5=pe(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=null!==(a=n.videoPosition)&&void 0!==a?a: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?Ee(n.adPosition):"",e.next=26,Ie();case 26: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!==(s=n.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t26=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t27=null!==(m=Te())&&void 0!==m?m:null,e.t28=null!=T?T: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===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(w=p.beacon)||void 0===w?void 0:w.params,e.t33=(0,e.t0)(e.t31,e.t32),S=[e.t33],i({url:(null===(g=window)||void 0===g||null===(I=g.customData)||void 0===I||null===(h=I.beacon)||void 0===h?void 0:h.url)||V.get()+_.getBeaconUrl,method:"post",headers:{Authorization:E},contentType:"application/x-www-form-urlencoded",dataType:"text",data:S}).catch(function(e){console.error(e)});case 44:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var _e=function(e,n){var t=new Map;j({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),Y=t}).catch(function(e){return console.log(e)})},Se=function(){var e=se.get();return e>=0?e+1:1},Oe=function(){var e,n,t,o=ie(),i=te(),r=null==i||null===(e=i.video)||void 0===e?void 0:e.id,l=se.get(),a=null==o||null===(n=o[l])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};function De(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Ae(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?De(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):De(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Le=s,Fe=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},Pe=function(e){var n=Ce(e,"video.tags",[]),t=Ce(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},Ce=function(e,n,t){for(var o=0,i=(n=n.split(".")).length;o<i;o++){var r;e=null===(r=e)||void 0===r?void 0:r[n[o]]}return e||t},ke=function(){var e,n,t,o,i,l,a,d,u,s,v,m,f,p,w,g,I,h,E,y,T,b,_,S,O,D=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",A=arguments.length>1?arguments[1]:void 0,L=arguments.length>2?arguments[2]:void 0;if(null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.disableMacros)return D;var F=(null==L?void 0:L.siteName)||(null==L?void 0:L.site)||"",P=(null==L?void 0:L.contentType)||"video",C=(null==L||null===(t=L[P])||void 0===t?void 0:t.metadata)||(null==L||null===(o=L[P])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.metadata),k=r(A);if(!D.includes("VIEWLIFT_"))return D;var R,j=window.getComputedStyle(document.getElementById(A),null),V=Math.trunc(j.getPropertyValue("height").slice(0,-2)),W=Math.trunc(j.getPropertyValue("width").slice(0,-2)),N="linearchannel"===P?null==L||null===(l=L.linearchannel)||void 0===l||null===(a=l.channels)||void 0===a||null===(d=a.find(function(e){return(null==e?void 0:e.id)===(null==L?void 0:L.channelId)}))||void 0===d||null===(u=d.content)||void 0===u?void 0:u.id:Ce(L,"video.gist.id",""),U="linearchannel"===P?null==L||null===(s=L.linearchannel)||void 0===s||null===(v=s.channels)||void 0===v||null===(m=v.find(function(e){return(null==e?void 0:e.id)===(null==L?void 0:L.channelId)}))||void 0===m?void 0:m.title:Ce(L,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),B=null,M=null;"function"==typeof window.__gpp&&(null===(R=window)||void 0===R||R.__gpp("ping",function(e){B=null==e?void 0:e.gppString,M=null==e?void 0:e.sectionList[0]}));var x=c.get("us_privacy")||c.get("usprivacy"),H=void 0!==x?x:"1YNN",G=null!==(f=null===(p=JSON.parse(localStorage.getItem("selectedMvpdProvider")||"{}"))||void 0===p?void 0:p.fwIdentifier)&&void 0!==f?f:null,Y=Ae(Ae({},Re(C)),{},{VIEWLIFT_WIDTH:W,VIEWLIFT_HEIGHT:V,VIEWLIFT_SIZE:Fe(W,V),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(w=window)||void 0===w?void 0:w.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Ce(L,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Ce(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Ce(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==k||null===(g=k.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==k||null===(I=k.options_)||void 0===I?void 0:I.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==F||"usanetwork"==F?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:Pe(L),VIEWLIFT_MEDIA_ID:N,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Ce(L,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:N,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Ce(L,"video.gist.permalink","")),VIEWLIFT_CONSENT:c.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Ce(null===(h=window)||void 0===h||null===(E=h.app_data)||void 0===E||null===(y=E.site)||void 0===y?void 0:y.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==F||"usanetwork"==F||"golfchannel"==F?"":Ce(null===(T=window)||void 0===T||null===(b=T.app_data)||void 0===b||null===(_=b.site)||void 0===_?void 0:_.settings,"compliance.gdpr")?1:0,VIEWLIFT_US_PRIVACY:H,VIEWLIFT_TVE_PROVIDER:G?Le(G):"",VIEWLIFT_CONTENT_DURATION_MS:1e3*Ce(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Ce(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:N,VIEWLIFT_CONTENT_TITLE:U,VIEWLIFT_CONTENT_SERIES_TITLE:Ce(L,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Ce(L,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:Oe(),VIEWLIFT_SEASON_NUMBER:Se(),VIEWLIFT_CONTENT_TAGS:Pe(L),VIEWLIFT_GPP_SID:M||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:B||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:"",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:""},null===(S=window)||void 0===S||null===(O=S.customData)||void 0===O?void 0:O.macros);for(var Q in Y){var z=new RegExp(Q,"g");D=D.replace(z,Y[Q])}return D},Re=function(e){var n,t,o,i,r,l,a,u,s,c={},v=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){v.set(e.name,e.value)}));var m=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,f=(null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return m||f?(d()?m?c=Ae(Ae({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.dtc.csai")||""}):f&&(c=Ae(Ae({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.tve.csai")||""})):m?c=Ae(Ae({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.dtc.csai")||""}):f&&(c=Ae(Ae({},c),{},{VIEWLIFT_CSID:v.get("csid.web.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.tve.csai")||""})),m?c=Ae(Ae({},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")||""}):f&&(c=Ae(Ae({},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()?Ae(Ae({},c),{},{VIEWLIFT_PROF:v.get("prof.mweb")||"",VIEWLIFT_PROF_CSAI:v.get("prof.mweb.csai")||""}):Ae(Ae({},c),{},{VIEWLIFT_PROF:v.get("prof.web")||"",VIEWLIFT_PROF_CSAI:v.get("prof.web.csai")||""})):(c=Ae(Ae({},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()?Ae(Ae({},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")||""}):Ae(Ae({},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=Ae(Ae({},c),{},{VIEWLIFT_AFID:v.get("afid"),VIEWLIFT_NIELSEN_APP_ID:Ce(null===(a=window)||void 0===a||null===(u=a.app_data)||void 0===u||null===(s=u.appcmsMain)||void 0===s?void 0:s.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")||""})},je=function(e,n){var t,o,i,r,l,a,d,s,c,v,m,f,p,w=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[w])||void 0===t?void 0:t.drmEnabled,I=null==e||null===(o=e[w])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,h=null==e||null===(r=e[w])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,E=(null==e||null===(a=e[w])||void 0===a||null===(d=a.streamingInfo)||void 0===d||null===(s=d.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[w])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var y=(null==e||null===(m=e[w])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(p=f.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!=h&&h.hls)return We(h);if(g){var T=Ne(I,n);return T.src=ke(T.src,n,e),T}if("Safari"!==u()&&y)return Ve(I);if(E){var b=We(I);return b.src=ke(b.src,n,e),b}if(null!=I&&I.mpeg){var _=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(I);return _.src=ke(_.src,n,e),_}return null},Ve=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},We=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},Ne=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,i=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=u();if(r(n),"Safari"===d){var s=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(i,function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,i,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,function(e,n,t){console.log(e),e&&r(e),r(null,t)})}}}}}(i);return Ue(n),s}var c,v={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(c=window)||void 0===c?void 0:c.siteName)?(Ue(n),v.keySystems={"com.widevine.alpha":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==a?void 0:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.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==a?void 0:a.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:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),v};var Ue=function(e){var n=r(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==u()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Be=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var i=t.split(".com")[1]||"";return{src:i?"".concat(n).concat(i):t,type:o}},Me=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 o=document.getElementById(e);if(o){var i=document.createElement("div");i.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),i.appendChild(r),o.append(i)}}},xe=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var He=!1,Ge=function(e,n,t){var o=ke(n,e,t),i=r(e);if(n&&window.google){if("function"!=typeof i.ima&&"object"!==f(i.ima))return;i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,n){var t,o,i,l=r(e);if(null!==l.el_){He=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),He&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.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})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,o)}};function Ye(e,n){var t,o,i,l=r(e),a=null==l||null===(t=l.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,d=document.getElementsByTagName("video")[0];null===(i=document)||void 0===i||i.addEventListener("keydown",function(t){var o,i,r,u,s,c,v,m,f;if(ze.enabled&&!t.metaKey&&!t.ctrlKey&&"input"!=t.target.localName&&"textarea"!=t.target.localName){var p=t.key,w=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(p)&&(t.preventDefault(),null==d||d.focus()),p){case" ":null==a||a.click();break;case"m":case"M":l.muted(!l.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":w&&!1===n.liveui||Bn(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(i=window)||void 0===i||null===(r=i.app_data)||void 0===r||null===(u=r.appcmsMain)||void 0===u||null===(s=u.adsConfig)||void 0===s?void 0:s.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(m=v.appcmsMain)&&void 0!==m&&null!==(f=m.adsConfig)&&void 0!==f&&f.vodAdClientSideTracking)return;w||Un(e,10)}}},!0)}var Qe,ze=(Qe=!0,{enable:function(){Qe=!0},disable:function(){Qe=!1},get enabled(){return Qe}}),qe="ssai-breakStart",Ke="ssai-adImpression",Xe="ssai-firstQuartile",Je="ssai-midpoint",$e="ssai-thirdQuartile",Ze="ssai-complete",en="ssai-breakEnd",nn={breakStart:qe,impression:Ke,firstQuartile:Xe,midpoint:Je,thirdQuartile:$e,complete:Ze,breakEnd:en};function tn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,i=nn[o];i&&t.trigger(i,n)}function on(e){var n=r(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var o=function(e,n){return t(n)};return n.on(e,o),function(){return n.off(e,o)}};return{adBreakStart:function(e){return t(qe,e)},adImpression:function(e){return t(Ke,e)},adFirstQuartile:function(e){return t(Xe,e)},adMidpoint:function(e){return t(Je,e)},adThirdQuartile:function(e){return t($e,e)},adComplete:function(e){return t(Ze,e)},adBreakEnd:function(e){return t(en,e)}}}function rn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function ln(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?rn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):rn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var an,dn=(an={},{get:function(){return an},set:function(e){an=e}});function un(e,n){var t,o,i,l,a,d,u,s,c,v,m,f,p,w,y,T,b,_,S,O,D,A=null==e?void 0:e.playerId,L=r(A);if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var F=te(),P=(null==F||null===(o=F.video)||void 0===o?void 0:o.metadata)||[],C=(null==P?void 0:P.length)&&P.filter(function(e){return"advertisingGenre"===e.name});if(null!==(i=C)&&void 0!==i&&i.length){var k=C.map(function(e){return e.value});C=null==k?void 0:k.join(",")}g();var R,j,V,W=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,N=Array.isArray(null==W?void 0:W.category)?null==W||null===(a=W.category)||void 0===a?void 0:a.join(","):(null==W?void 0:W.category)||null,U=ln(ln(ln({},null==F?void 0:F.video),null==F?void 0:F.linearchannel),{},{siteName:(null==e||null===(d=e.comscore)||void 0===d?void 0:d.applicationName)||(null==e||null===(u=e.comscore)||void 0===u||null===(s=u.metadata)||void 0===s?void 0:s.siteName)||(null==F?void 0:F.site)||null,programId:(null==W?void 0:W.videotmsid)||null,programTitle:(null==W?void 0:W.lcProgrammeName)||null,episodeId:(null==W?void 0:W.videotmsid)||null,seasonNumber:(null==F||null===(c=F.video)||void 0===c||null===(v=c.series)||void 0===v?void 0:v.seasonNumber)||(null==W||null===(m=W.seriesDetails)||void 0===m?void 0:m.season)||null,episodeNumber:(null==F||null===(f=F.video)||void 0===f||null===(p=f.series)||void 0===p?void 0:p.episodeNumber)||(null==W||null===(w=W.seriesDetails)||void 0===w?void 0:w.episode)||null,episodeTitle:(null==W?void 0:W.lcSubTitle)||null,isCompleteEpisode:!!(null!=F&&null!==(y=F.video)&&void 0!==y&&y.series||null!=W&&null!==(T=W.seriesDetails)&&void 0!==T&&T.episode),genre:C||N,comscoreConfig:{implementationId:(null==e||null===(b=e.comscore)||void 0===b?void 0:b.implementationId)||null,projectId:(null==e||null===(_=e.comscore)||void 0===_?void 0:_.projectId)||null}}),B=null==e||null===(S=e.comscore)||void 0===S||null===(O=S.metadata)||void 0===O?void 0:O.contentType;if(null!=U&&null!==(D=U.streamingInfo)&&void 0!==D&&D.isLiveStream?U.contentType="Live":U.contentType=B||"LongFormOnDemand",null==U||!U.network){var M,x=(null==U?void 0:U.metadata)||[],H=null==x||null===(M=x.find(function(e){return"network"===e.name}))||void 0===M?void 0:M.value;U.network=H||null}null!=U&&U.network&&null!=U&&U.genre&&(U.customGenre="".concat(U.network,"_").concat((null==U?void 0:U.programTitle)||(R=U,null!=R&&R.series?null==R||null===(V=R.series)||void 0===V?void 0:V.title:null==R||null===(j=R.gist)||void 0===j?void 0:j.title),"_").concat(U.genre)),null!=W&&W.airDate&&(U.publishDate=W.airDate),null!=U&&U.runtime&&"function"==typeof L.duration&&(U.runtime=1e3*Math.ceil(L.duration()));var G=I(U,L);console.log("comscoreOptions player data",G),h(ln({playerName:"Video.js"},G)),E(L)}}function sn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function cn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?sn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):sn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function vn(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 mn(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)?mn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}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 r,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,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function mn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var fn,pn=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),wn=(fn=null,{set:function(e){fn=e},get position(){return fn}});function gn(e,n){return In.apply(this,arguments)}function In(){return(In=n(t.mark(function e(n,o){var i,l,a,d,u,s,c,v,m,f,p,g,I,h,E,y,T,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r(n),a=je(o,n),d=a.src,u=(null==o?void 0:o.contentType)||"video",null==o||null===(i=o[u])||void 0===i||null===(l=i.streamingInfo)||void 0===l||l.isLiveStream,s=d.replace("/dash/","/session/").replace("/master/","/session/"),s=ke(s,n,o),c=En(s),v=w(c,2),m=v[0],f=v[1],p=hn(f)||{},s=new URL(s.split("?")[0]),Object.keys(f).length>0&&Object.entries(f).forEach(function(e){var n=w(e,2),t=n[0],o=n[1];s.searchParams.set(t,o)}),e.prev=11,e.next=14,fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(cn({adsParams:cn({},m)},p))});case 14:return g=e.sent,e.next=17,g.json();case 17:return I=e.sent,h="https://"+new URL(s).hostname,E=I.trackingUrl,y=I.manifestUrl,T=h+E,b=h+y,pn.set(T),console.log("%c TRACKING URL","background: #bdf369; color: #000",T),a.src=b,e.abrupt("return",a);case 29:return e.prev=29,e.t0=e.catch(11),e.abrupt("return",a);case 32:case"end":return e.stop()}},e,null,[[11,29]])}))).apply(this,arguments)}function hn(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map(function(e){var n=w(e,2),t=n[0],o=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(o)]}))||{}}function En(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),i=vn((null==o?void 0:o.searchParams)||[]);try{for(i.s();!(t=i.n()).done;){var r=w(t.value,2),l=r[0],a=r[1];n[decodeURIComponent(l)]=decodeURIComponent(a||"")}}catch(e){i.e(e)}finally{i.f()}for(var d={},u={},s=0,c=Object.entries(n);s<c.length;s++){var v=w(c[s],2),m=v[0],f=v[1];if(m.startsWith("ads."))d[m.replace(/^ads\./,"")]=f;else u[m]=f}return[d,u]}var yn,Tn,bn,_n=new Map;function Sn(e,n){return On.apply(this,arguments)}function On(){return On=n(t.mark(function e(o,i){var a,d,u,s,c,v,m,f,w,g,I,h,E,y,T,b,_,S,O,D,A,L,F,P,C;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:C=function(e,n,t,i,l,a){var d,u,s=r(o);if(!s.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds,e<F&&L.clear(),F=e;var v=(null==n||null===(d=n.ads)||void 0===d||null===(u=d[i])||void 0===u?void 0:u.adId)||c;Math.floor(s.currentTime());var m,f=vn(t);try{var p=function(){var t,r,d,u=m.value,c=u.eventType,f=u.beaconUrls,p=u.startTimeInSeconds,w=u.startTime,g=u.durationInSeconds,I=p||0,h=f,E=(null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r||null===(d=r.ads)||void 0===d?void 0:d.adEventHandler)||null,y="".concat(I,"_").concat(c),T=_n.get("pod-".concat(l))||[];if(console.warn(e,I,"map:",c,"condition1:",e>=I,"map:",_n),e>=I&&!T.includes(y)){T.push(y),_n.set("pod-".concat(l),T);try{P(c,n,h,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,c,n)}if("breakEnd"==c){var b=wn.position;wn.set(null),setTimeout(function(){null!=b&&(s.currentTime(b),a())},500)}if("function"==typeof E)try{var _,S={eventType:c,startTimeInSeconds:p,startTime:w,durationInSeconds:g,ad:null==n||null===(_=n.ads)||void 0===_?void 0:_[i],adIndex:i};E({adsData:S}),tn(o,S)}catch(e){console.error("Error when calling ads callback:",e)}var O=dn.get();if(O&&0!==Object.keys(O).length){var D=O.formulateComscoreAdPayload,A=O.startComscoreAdTracking,F=O.finishComscoreAdTracking,C=O.endComscoreAdTracking,k="".concat(I,"_").concat(v,"_").concat(c);if(!L.has(k))if(L.set(k,!0),"impression"===c){var R,j=pn.get();A(D(cn(cn({},null==n||null===(R=n.ads)||void 0===R?void 0:R[i]),{},{trackingUrl:j})))}else"complete"===c?F():"breakEnd"===c&&C()}}};for(f.s();!(m=f.n()).done;)p()}catch(e){f.e(e)}finally{f.f()}}},P=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},A=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},_n.clear(),wn.set(i),w=pn.get(),(g=r(o)).one("loadeddata",function(){w&&D(w)}),I=new Map,h=new Map,E=-1,y=(null===(a=document)||void 0===a||null===(d=a.getElementsByClassName("tvProviderImage"))||void 0===d?void 0:d[0])||null,T=(null==g||null===(u=g.controlBar)||void 0===u?void 0:u.getChild("videoSelector"))||null,b=(null==g||null===(s=g.controlBar)||void 0===s?void 0:s.getChild("seriesV2"))||null,_=(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===(m=g.el())||void 0===m||null===(f=m.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===f?void 0:f[0])||null,O=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return p(o);var i=[],r=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==r||null===(e=r.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,a=(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],d=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),u=(null==d?void 0:d.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(!u&&l){var s=null==d?void 0:d.map(function(e){return cn(cn({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&i.push(null==s?void 0:s[0])}return i},D=function(){var e=n(t.mark(function e(n){var a,d,u,s,c,v,m,f,w,g,D,L,F,P,k,R,j,V,W,N,U,B,M,x;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return N=function(e){document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",N),0===e.button&&j()},W=function(e){},V=function(){var e,n=g.currentTime(),t=null,o=vn(w);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=(i.ads,Math.floor(r+l));n>=r&&n<=a&&(t=a,I.set(r,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){g.currentTime(t+2.2)},100))},j=function(){var e,n=g.currentTime(),t=null,o=vn(w);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=i.ads,d=Math.floor(r+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>d||n>r)&&!I.has(r)||n>=r&&n<=d)&&(t=r,I.set(r,!0),h.set(r,!0))}}catch(e){o.e(e)}finally{o.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:m=e.sent,f=m.avails,w=[],g=r(o),D=g.controlBar.progressControl,L=D.seekBar.el(),null===(a=document)||void 0===a||a.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),f.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),w.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)})}),!c&&i&&(g.currentTime(i),V()),null!=w&&w.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",w),window.adsQueueList=w,"function"==typeof(R=(null===(F=window)||void 0===F||null===(P=F.customData)||void 0===P||null===(k=P.ads)||void 0===k?void 0:k.onAdBreaksLoaded)||null)&&R(w)),console.log(w,"data"),w.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=g.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(i,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(i,"%"),r.style.pointerEvents="none",L.appendChild(r)}}),g._timeUpdateHandler&&g.off("timeupdate",g._timeUpdateHandler),g._timeUpdateHandler=l(function(){var e=g.currentTime();if(e!==E){E=e;for(var n=!1,t=function(){var t=w[o],i=t.startTimeInSeconds,r=t.durationInSeconds,l=t.ads,a=i+r;if(e>=i-1.2&&e<=a+1.2){var d;e>=i&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&I.set(i,!0),ze.disable(),y&&y.classList.add("vjs-hidden"),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),T&&(T.el().style.pointerEvents="none",T.el().classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),D.el().classList.add("hide-progress-bar");for(var u=e-i,s=0,c=0,v=0;v<l.length;v++){var m,f=null==l||null===(m=l[v])||void 0===m?void 0:m.durationInSeconds;if(u<s+f){c=v;break}s+=f}l[c];var g=Math.max(0,r-u),E=Math.round(g);U.style.display="block",x.textContent="".concat(c+1," of ").concat(l.length," • ").concat(A(E));var O=[];return null==l||l.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});O.push.apply(O,p(n))}),(null==t||null===(d=t.podSlotImpressionBeacon)||void 0===d?void 0:d.length)>0&&O.push.apply(O,p(null==t?void 0:t.podSlotImpressionBeacon)),C(e,t,O,c,o,V),"break"}h.delete(i)},o=0;o<w.length;o++){if("break"===t())break}n||(U.style.display="none",D.el().classList.remove("hide-progress-bar"),T&&(T.el().style.pointerEvents="auto",T.el().classList.remove("vjs-hidden")),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),y&&y.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),ze.enable())}},1e3),g.on("timeupdate",g._timeUpdateHandler),null===(d=document)||void 0===d||d.addEventListener("keydown",function(e){ze.enabled&&"ArrowRight"==e.key&&(j(),Un(o,10),e.stopPropagation())}),D.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",W),document.addEventListener("pointerup",N))}),null===(u=document)||void 0===u||null===(s=u.querySelectorAll(".ssai-ad-container"))||void 0===s||s.forEach(function(e){return null==e?void 0:e.remove()}),(U=document.createElement("div")).className="ssai-ad-container",(B=document.createElement("div")).className="sponsored-adbox",(M=document.createElement("div")).className="sponsored-text",M.textContent="Sponsored Ad",B.append(M),(x=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",U.append(B),U.append(x),g.el().appendChild(U);case 44:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),L=new Map,F=-1;case 21:case"end":return e.stop()}},e)})),On.apply(this,arguments)}function Dn(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 An(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)?An(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}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 r,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,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function An(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function Ln(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Fn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ln(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ln(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Pn={},Cn=(null===(yn=window)||void 0===yn||null===(Tn=yn.location)||void 0===Tn||null===(bn=Tn.search)||void 0===bn?void 0:bn.includes("debug=true"))||!1,kn=null;function Rn(e){return jn.apply(this,arguments)}function jn(){return jn=n(t.mark(function e(o){var i,a,d,u,s,c,v,m,f,w,g,I,h,E,y,T,b,_,S,O,D,A,L,F,P,C,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:k=function(e,n,t,i,l){var a,d,u=r(o);if(!u.seeking()){var s=n.startTimeInSeconds;n.durationInSeconds;var c=(null==n||null===(a=n.ads)||void 0===a||null===(d=a[i])||void 0===d?void 0:d.adId)||s;Math.floor(u.currentTime());var v,m=Dn(t);try{for(m.s();!(v=m.n()).done;){var f,p,w,g=v.value,I=g.eventType,h=g.beaconUrls,E=g.startTimeInSeconds,y=g.startTime,T=g.durationInSeconds,b=(g.eventId,E||s),_=h,S=(null===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(w=p.ads)||void 0===w?void 0:w.adEventHandler)||null,O="".concat(c,"_").concat(I),D="pod-".concat(s);F.has(D)||F.set(D,new Set);var A=F.get(D);if(Cn&&console.warn(e,b,"map:",I,"condition1:",e>=b,"map:",F),e>=b&&e<=b+P&&!A.has(O)){A.add(O);try{C(I,n,_,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,I,n)}if("function"==typeof S)try{var L,k={eventType:I,startTimeInSeconds:E,startTime:y,durationInSeconds:T,ad:null==n||null===(L=n.ads)||void 0===L?void 0:L[i],adIndex:i};S({adsData:k}),tn(o,k)}catch(e){console.error("Error when calling ads callback:",e)}var R=dn.get();if(R&&0!==Object.keys(R).length){var j=R.formulateComscoreAdPayload,V=R.startComscoreAdTracking,W=R.finishComscoreAdTracking,N=R.endComscoreAdTracking;if("impression"===I){var U,B=pn.get();V(j(Fn(Fn({},null==n||null===(U=n.ads)||void 0===U?void 0:U[i]),{},{trackingUrl:B})))}else"complete"===I?W():"breakEnd"===I&&N()}}}}catch(e){m.e(e)}finally{m.f()}}},C=function(e,n,t,o){var i,r,l;"breakEnd"===e&&(null===(i=Pn)||void 0===i?void 0:i.currentAdIndex)+1!=(null===(r=Pn)||void 0===r?void 0:r.totalAds)&&(null==n||null===(l=n.ads)||void 0===l?void 0:l.length)>0||(Cn&&console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.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(){kn&&clearInterval(kn)},f=pn.get(),(w=r(o)).one("loadeddata",function(){g(),kn=setInterval(function(){f&&!w.paused()&&L(f)},2e3)}),w.on("dispose",function(){g()}),I=new Map,h=new Map,E=-1,y=null,T=(null===(i=document)||void 0===i||null===(a=i.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,b=(null==w||null===(d=w.controlBar)||void 0===d?void 0:d.getChild("videoSelector"))||null,_=(null==w||null===(u=w.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,S=(null==w||null===(s=w.el())||void 0===s||null===(c=s.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,O=(null==w||null===(v=w.el())||void 0===v||null===(m=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===m?void 0:m[0])||null,D=!1,A=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return p(o);var i=[],r=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==r||null===(e=r.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,a=(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],d=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),u=(null==d?void 0:d.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(!u&&l){var s=null==d?void 0:d.map(function(e){return Fn(Fn({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&i.push(null==s?void 0:s[0])}return i},L=function(){var e=n(t.mark(function e(n){var i,a,d,u,s,c,v,m,f,w;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=new URL(n),y&&a.searchParams.append("nextToken",y),e.next=4,fetch(a.toString(),{method:"GET"});case 4:return d=e.sent,e.next=7,d.json();case 7:u=e.sent,s=u.avails,c=u.nextToken||null,y=c,v=[],m=r(o),f=m.controlBar.progressControl,w=f.seekBar.el(),null===(i=document)||void 0===i||i.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),s.map(function(e,n){v.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:A(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),Cn&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",v),null!=v&&v.length&&(window.adsQueueList=v),v.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=m.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(i,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(i,"%"),r.style.pointerEvents="none",w.appendChild(r)}}),m._timeUpdateHandler&&m.off("timeupdate",m._timeUpdateHandler),m._timeUpdateHandler=l(function(){var e=m.currentTime();if(e!==E){E=e;for(var n=function(){var n=v[t],o=n.startTimeInSeconds,i=n.durationInSeconds,r=n.ads,l=o+i;if(e>=o-1.2&&e<=l+1.2){var a;D=!!(e>=o&&e<=l&&Array.isArray(r)&&(null==r?void 0:r.length)>0),e>l&&I.set(o,!0),ze.disable(),T&&T.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),O&&(O.style.pointerEvents="none",O.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),f.el().classList.add("hide-progress-bar");for(var d=e-o,u=0,s=0,c=0;c<r.length;c++){var m,w=null==r||null===(m=r[c])||void 0===m?void 0:m.durationInSeconds;if(d<u+w){s=c;break}u+=w}setTimeout(function(){Pn.totalAds=null==r?void 0:r.length,Pn.currentAdIndex=s},1e3);var g=[];return null==r||r.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});g.push.apply(g,p(n))}),(null==n||null===(a=n.podSlotImpressionBeacon)||void 0===a?void 0:a.length)>0&&g.push.apply(g,p(null==n?void 0:n.podSlotImpressionBeacon)),k(e,n,g,s),"break"}h.delete(o)},t=0;t<v.length;t++){if("break"===n())break}D||(Pn={},f.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),O&&(O.style.pointerEvents="auto",O.classList.remove("vjs-hidden")),ze.enable())}},1e3),m.on("timeupdate",m._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),F=new Map,P=2.5;case 22:case"end":return e.stop()}},e)})),jn.apply(this,arguments)}function Vn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}var Wn=function(e){o(e).play()},Nn=function(e){o(e).pause()},Un=function(e,n){var t=o(e),i=t.currentTime()+n;t.currentTime(i)},Bn=function(e,n){var t=o(e),i=t.currentTime(),r=i<=n?0:i-n;t.currentTime(r)},Mn=function(e){return!!o.getPlayer("".concat(e))},xn=function(e){return o(e).paused()},Hn=function(){var e=n(t.mark(function e(o,i){var l,a,d,u=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=u.length>2&&void 0!==u[2]&&u[2],e.next=3,X();case 3:return a=e.sent,d=r(o),e.abrupt("return",new Promise(function(e,r){P(i,a).then(function(){var r=n(t.mark(function n(r){var a,u,s,c,v,m,f,p;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(m=null==r?void 0:r.data,window.sid=we(),m.contentType="linearchannel",m.channelId=null==i?void 0:i.channelId,f=(null==m||null===(a=m.linearchannel)||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(u=window)||void 0===u||null===(s=u.app_data)||void 0===s||null===(c=s.appcmsMain)||void 0===c||null===(v=c.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)||!1,p=je(m,o),!f){n.next=11;break}return n.next=9,gn(o,m);case 9:p=n.sent,l=!0;case 11:ne(m),p&&l?(qn(o,p),f&&Rn(o),d.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:m})})):(dn.get()&&0!==Object.keys(dn.get()).length&&un({playerId:o,comscore:{enable:!0}}),e({status:!0,msg:"Feed authenticated",response:m}));case 13:case"end":return n.stop()}},n)}));return function(e){return r.apply(this,arguments)}}()).catch(function(e){r({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)}}(),Gn=function(){var e=n(t.mark(function e(o,i,l){var a,d,u,s,c,f,p;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X();case 2:return s=e.sent,(ie()||null)&&ue(i),c=0,f=0,p=null,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(d=window)&&void 0!==d&&null!==(u=d.watchHistory)&&void 0!==u&&u.enable&&R(i,s).then(function(e){var n,t,o,i,r,l,a;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),c=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,(f=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null)<95)&&(p=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedTime)||null)}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}),e.abrupt("return",new Promise(function(e,l){F(i,s).then(function(){var i=n(t.mark(function n(i){var a,d,u,s,w,g,I,h,E,y,T,b,_,S,O,D,A,L,F,P,C,k,R,j,V,W,N,U,B,M,x,H,G,Y,Q,z,q,K;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(D=null==i?void 0:i.data,A=(null==D?void 0:D.contentType)||"video",L=(null==D||null===(a=D[A])||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(d=window)||void 0===d||null===(u=d.app_data)||void 0===u||null===(s=u.appcmsMain)||void 0===s||null===(w=s.adsConfig)||void 0===w?void 0:w.vodAdSticherProvider)||!1,F=(null==D||null===(g=D.video)||void 0===g||null===(I=g.streamingInfo)||void 0===I?void 0:I.isLiveStream)||!1,ne(i.data),(P=(null==D||null===(h=D.ads)||void 0===h||null===(E=h.preRoll)||void 0===E||null===(y=E.adTags)||void 0===y||null===(T=y.web)||void 0===T?void 0:T.active)&&(null==D||null===(b=D.ads)||void 0===b||null===(_=b.preRoll)||void 0===_||null===(S=_.adTags)||void 0===S||null===(O=S.web)||void 0===O?void 0:O.url))&&Ge(o,P,D),C=je(D,o),!L){n.next=12;break}return n.next=11,gn(o,D);case 11:C=n.sent;case 12:C?(H=(null==D||null===(k=D.video)||void 0===k||null===(R=k.gist)||void 0===R?void 0:R.videoImageUrl)||(null==D||null===(j=D.video)||void 0===j||null===(V=j.gist)||void 0===V||null===(W=V.imageGist)||void 0===W?void 0:W.r16x9),(G=r(o)).poster(H),qn(o,C),L&&Sn(o,p),G.on("loadstart",function(){F&&e({status:!0,msg:"Video Loaded",response:D})}),G.on("loadeddata",function(){xe(),e({status:!0,msg:"Video Loaded",response:D})}),G.one("play",function(){c&&!L&&f<95&&setTimeout(function(){G.currentTime(c)},0)}),G.one("error",function(){var e;l({status:!1,msg:(null==G||null===(e=G.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==D||null===(N=D.video)||void 0===N||null===(U=N.contentDetails)||void 0===U||null===(B=U.closedCaptions)||void 0===B?void 0:B.length)>0||(null==D||null===(M=D.video)||void 0===M||null===(x=M.closedCaptions)||void 0===x?void 0:x.length)>0?(K=(null==D||null===(Q=D.video)||void 0===Q||null===(z=Q.contentDetails)||void 0===z?void 0:z.closedCaptions)||(null==D||null===(q=D.video)||void 0===q?void 0:q.closedCaptions),Y=K.filter(function(e){return"VTT"===e.format}),v(o,Y)):m(o)):(Me(o,"Incompatible Source, only hls,mp4,drm content is allowed"),l("Incompatible Source, only hls,mp4,drm content is allowed"));case 13:case"end":return n.stop()}},n)}));return function(e){return i.apply(this,arguments)}}()).catch(function(e){Kn(e,o,l,i)})}));case 10:case"end":return e.stop()}},e)}));return function(n,t,o){return e.apply(this,arguments)}}(),Yn=function(e,n,t){var o=r(e);return o.src(n),new Promise(function(e,n){var i=0;o.one("loadedmetadata",function(){clearTimeout(i),e({status:!0,msg:"video loaded"})}),o.one("loadstart",function(e){i=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},Qn=function(e){var n=r(e),t=(dn.get()||{}).destroyComscoreTag;if(zn(),t&&t(),a(),window.onresize=null,n)n.dispose();else{var o=document.getElementById(e);o&&o.remove()}},zn=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()},qn=function(e,n){var t=r(e);t&&t.src(n)},Kn=function(n,t,o,i){var r,l,a,d,u,s,c=null==n||null===(r=n.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==n||null===(a=n.response)||void 0===a||null===(d=a.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);Mn(t)&&Me(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),o&&o(function(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Vn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Vn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}({status:!1,response:n,msg:"".concat(v)},i&&{videoId:i}))},Xn=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var i=n.getElementsByClassName("vjs-fullscreen-control")[0];i&&(i.style.display="none")};export{Sn as $,C as A,_e as B,se as C,oe as D,Yn as E,Un as F,Wn as G,Nn as H,Bn as I,Mn as J,Gn as K,Hn as L,Qn as M,W as N,on as O,Z as P,V as Q,J as R,B as S,N as T,T as U,_n as V,Ye as W,re as X,xn as Y,le as Z,Rn as _,Oe as a,j as a0,de as a1,ue as a2,ie as b,dn as c,Se as d,te as e,je as f,ge as g,ne as h,un as i,xe as j,Me as k,qn as l,ae as m,Xn as n,be as o,Ge as p,Be as q,gn as r,k as s,$ as t,F as u,ee as v,R as w,Kn as x,X as y,P as z};
@@ -1 +1 @@
1
- import"./index-0c364075.js";import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{t as r,g as n}from"./skin-4f84b841.js";import i from"@babel/runtime/helpers/defineProperty";import a from"@babel/runtime/helpers/slicedToArray";import{e as u}from"./generic-6bd18e7c.js";function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var l="my-player";function c(e){var t=e.split("\n"),r=[];return t.forEach(function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),n={resolution:null,uri:null};t.forEach(function(e){e.includes("RESOLUTION")&&(n.resolution=e.split("=")[1]),e.includes("URI")&&(n.uri=e.split("=")[1].replace(/"/g,""))}),r.push(n)}}),r}function p(){return(p=e(t.mark(function e(r){var n,i,u,o,s,l,c,p,d,m,f,b,g,v,h,x,y,w,k,E,j,N,A,T;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r._tiles){e.next=2;break}return e.abrupt("return",r._tiles);case 2:return e.prev=2,e.next=5,fetch(r.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return i=e.sent,e.next=11,createImageBitmap(i);case 11:for(u=e.sent,o=r.layout.split("x").map(Number),s=a(o,2),l=s[0],c=s[1],p=u.width/c,d=u.height/l,m=[],f=0;f<l;f++)for(b=0;b<c;b++)(g=document.createElement("canvas")).width=p,g.height=d,g.getContext("2d").drawImage(u,b*p,f*d,p,d,0,0,p,d),v=g.toDataURL("image/png"),m.push({uri:v,duration:r.duration}),r._tiles=m;return e.abrupt("return",m);case 20:for(e.prev=20,e.t0=e.catch(2),h=r.layout.split("x").map(Number),x=a(h,2),y=x[0],w=x[1],k=[],E=0;E<y*w;E++)k.push({uri:null===(j=window)||void 0===j||null===(N=j.app_data)||void 0===N||null===(A=N.appcmsMain)||void 0===A||null===(T=A.images)||void 0===T?void 0:T.placeholderCover,duration:r.duration});return e.abrupt("return",k);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function d(e,t){return m.apply(this,arguments)}function m(){return(m=e(t.mark(function e(r,n){var i,a;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=n,e.prev=1,e.next=4,fetch(r);case 4:return i=e.sent,e.next=7,i.text();case 7:return a=e.sent,e.abrupt("return",c(a));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function f(e,t,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=n(l);if(i&&a){var u=i.getBoundingClientRect(),o=(e.clientX-u.left)/u.width,s=function(e,t){var r,n;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var u=Math.floor((i+a)/2),o=t[u];if(o===e)return o;o<e?i=u+1:a=u-1}var s=null!==(r=t[i])&&void 0!==r?r:1/0,l=null!==(n=t[a])&&void 0!==n?n:-1/0;return Math.abs(s-e)<Math.abs(l-e)?s:l}(Math.round(o*a.duration()),r),c=t[s];c&&!c.loading&&(c.loading=!0,function(e){return p.apply(this,arguments)}(c).then(function(e){var t=e[c.tileIndex],r=document.querySelector(".vjs-thumbnail-holder img");r&&t.uri&&(r.src=t.uri),c.loading=!1,c.src=t.uri}))}}function b(e){return g.apply(this,arguments)}function g(){return(g=e(t.mark(function e(n){var u,o,l,c;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u={},n.forEach(function(e,t){for(var r=e.layout.split("x").map(Number),n=a(r,2),o=n[0]*n[1],l=e.duration,c=0;c<o;c++){var p,d=Math.round((t*o+c)*l);u[d]=s(s({},e),{},{duration:e.duration,tileIndex:c,loading:!1,style:(p={left:"-60px",height:"85px",width:"130px"},i(p,"left","-60px"),i(p,"border","1px solid transparent"),i(p,"borderRadius","4px"),p)})}}),o=Object.keys(u).map(Number).sort(function(e,t){return e-t}),null==(l=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||l.addEventListener("mousemove",r(function(e){return f(e,u,o)},500)),null==(c=document.querySelector(".vjs-progress-control.vjs-control"))||c.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",r(function(e){return f(e,u,o)},500))}),e.abrupt("return",u);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var v=function(){var r=e(t.mark(function e(r,n){var i,u,o,s,l,c,p,d;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(r+n);case 2:return i=e.sent,e.next=5,i.text();case 5:u=e.sent,o=u.split("\n").map(function(e){return e.trim()}),s=[],l=null,c=0;case 10:if(!(c<(null==o?void 0:o.length))){e.next=27;break}if(!(p=o[c]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},d=p.split(":")[1]||"",d.split(",").forEach(function(e){var t=e.split("="),r=a(t,2),n=r[0],i=r[1];n&&i&&(l[n.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!p.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(p.includes("jpg")||p.includes("png")||p.includes("jpeg"))&&(l.uri=p.includes("http")?p:r+p,s.push(l),l=null);case 24:c++,e.next=10;break;case 27:return e.abrupt("return",s);case 28:case"end":return e.stop()}},e)}));return function(e,t){return r.apply(this,arguments)}}();function h(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function x(e,t){return y.apply(this,arguments)}function y(){return(y=e(t.mark(function e(r,i){var o,s,c,p,d,m,f,b,g,v,x,y,E,j,N,A,T,O,I,S,M,P,R,$,B,D,L,U,C,X,q,_,F,W,z,G,H,J,K,Q,V,Y,Z,ee,te,re,ne,ie,ae,ue,oe,se,le,ce,pe,de,me,fe;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=i,o=n(i),s=r.split("/"),c=s.findIndex(function(e){return"dash"===e.toLowerCase()}),p=h(-1!==c?s.slice(0,c+1).join("/"):new URL(r).origin),e.prev=5,e.next=8,fetch(r);case 8:return b=e.sent,e.next=11,b.text();case 11:g=e.sent,v=new DOMParser,x=v.parseFromString(g,"application/xml"),y=(null==o?void 0:o.duration())||(null===(d=u())||void 0===d||null===(m=d.video)||void 0===m?void 0:m.runtime),E=(null==x||null===(f=x.querySelector("MPD > BaseURL"))||void 0===f?void 0:f.textContent)||p+"/",j=x.getElementsByTagName("AdaptationSet"),N=0;case 18:if(!(N<j.length)){e.next=72;break}if(("image"!==(A=j[N]).getAttribute("contentType")||"image/png"!==A.getAttribute("mimeType"))&&"image/jpeg"!==A.getAttribute("mimeType")){e.next=69;break}if(O=A.getElementsByTagName("SegmentTemplate")[0],I=null===(T=O.getElementsByTagName("SegmentTimeline"))||void 0===T?void 0:T[0],!O||!I){e.next=48;break}if(P=I.getElementsByTagName("S"),R=parseInt(null===(S=P[0])||void 0===S?void 0:S.getAttribute("t")),$=parseInt(null===(M=P[0])||void 0===M?void 0:M.getAttribute("d")),B=A.getElementsByTagName("Representation")[0],D=B.getElementsByTagName("EssentialProperty")[0],L=D.getAttribute("value"),U=null==L?void 0:L.split("x"),C=a(U,2),X=C[0],q=C[1],!O){e.next=46;break}if(O.getAttribute("media"),_=O.getAttribute("timescale"),F=(_?$/_:$)/(X*q),W=B.getAttribute("id"),z=Math.round(y/F),G=Math.ceil(z/(X*q)),H=O.getAttribute("media"),parseInt(O.getAttribute("startNumber")),!isNaN(parseInt(G))){e.next=43;break}return e.abrupt("return");case 43:for(J=[],N=0;N<G;N++)Q="/"==(K=H)[0]?new URL(p).origin:p+"/",J.push({duration:F,layout:L,uri:Q+K.replace("$Time$",R+N*$).replace("$RepresentationID$",W)});return e.abrupt("return",J);case 46:e.next=69;break;case 48:if(V=A.getElementsByTagName("Representation")[0],Y=V.getElementsByTagName("EssentialProperty")[0],Z=Y.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=a(ee,2),re=te[0],ne=te[1],!O){e.next=69;break}if(O.getAttribute("media"),ie=O.getAttribute("duration"),ae=O.getAttribute("timescale"),ue=(ae?ie/ae:ie)/(re*ne),oe=V.getAttribute("id"),se=Math.round(y/ue),le=Math.ceil(se/(re*ne)),ce=O.getAttribute("media"),pe=parseInt(O.getAttribute("startNumber"))||0,!isNaN(parseInt(le))){e.next=65;break}return e.abrupt("return");case 65:for(de=[],me=w(ce),N=0;N<le;N++)fe=me?k(me,N+pe):ce,de.push({duration:ue,layout:Z,uri:E+fe.replace("$Number$",N+pe).replace("$RepresentationID$",oe)});return e.abrupt("return",de);case 69:N++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}},e,null,[[5,76]])}))).apply(this,arguments)}function w(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function k(e,t){var r=e.match(/%0(\d+)d/);if(!r)return e;var n=parseInt(r[1],10),i=String(t).padStart(n,"0");return e.replace(/\$Number%0\d+d\$/,i)}function E(e){return j.apply(this,arguments)}function j(){return(j=e(t.mark(function e(r){var i,a,u,o,s,l,c,p,m,f,g,h,y,w,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s=n(r),l=s.currentSource(),c=l.src,c=null!==(i=c)&&void 0!==i&&i.includes("blob")?null==s||null===(a=s.getSource)||void 0===a?void 0:a.call(s):c,null===(u=c)||void 0===u||!u.includes("m3u8")){e.next=19;break}return e.next=6,d(c,r);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return m=(null==p?void 0:p[0])||null,f=m.uri,g=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,v(g,f);case 12:return h=e.sent,e.next=15,b(h);case 15:y=e.sent,s.thumbnails(y);case 17:e.next=28;break;case 19:if(null===(o=c)||void 0===o||!o.includes("mpd")){e.next=28;break}return e.next=22,x(c,r);case 22:if(!((null==(w=e.sent)?void 0:w.length)>0)){e.next=28;break}return e.next=26,b(w);case 26:k=e.sent,s.thumbnails(k);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}export{E as i};
1
+ import"./index-367f32c7.js";import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{t as r,g as n}from"./skin-4f84b841.js";import i from"@babel/runtime/helpers/defineProperty";import a from"@babel/runtime/helpers/slicedToArray";import{e as u}from"./generic-33a5f6db.js";function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var l="my-player";function c(e){var t=e.split("\n"),r=[];return t.forEach(function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),n={resolution:null,uri:null};t.forEach(function(e){e.includes("RESOLUTION")&&(n.resolution=e.split("=")[1]),e.includes("URI")&&(n.uri=e.split("=")[1].replace(/"/g,""))}),r.push(n)}}),r}function p(){return(p=e(t.mark(function e(r){var n,i,u,o,s,l,c,p,d,m,f,b,g,v,h,x,y,w,k,E,j,N,A,T;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r._tiles){e.next=2;break}return e.abrupt("return",r._tiles);case 2:return e.prev=2,e.next=5,fetch(r.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return i=e.sent,e.next=11,createImageBitmap(i);case 11:for(u=e.sent,o=r.layout.split("x").map(Number),s=a(o,2),l=s[0],c=s[1],p=u.width/c,d=u.height/l,m=[],f=0;f<l;f++)for(b=0;b<c;b++)(g=document.createElement("canvas")).width=p,g.height=d,g.getContext("2d").drawImage(u,b*p,f*d,p,d,0,0,p,d),v=g.toDataURL("image/png"),m.push({uri:v,duration:r.duration}),r._tiles=m;return e.abrupt("return",m);case 20:for(e.prev=20,e.t0=e.catch(2),h=r.layout.split("x").map(Number),x=a(h,2),y=x[0],w=x[1],k=[],E=0;E<y*w;E++)k.push({uri:null===(j=window)||void 0===j||null===(N=j.app_data)||void 0===N||null===(A=N.appcmsMain)||void 0===A||null===(T=A.images)||void 0===T?void 0:T.placeholderCover,duration:r.duration});return e.abrupt("return",k);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function d(e,t){return m.apply(this,arguments)}function m(){return(m=e(t.mark(function e(r,n){var i,a;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=n,e.prev=1,e.next=4,fetch(r);case 4:return i=e.sent,e.next=7,i.text();case 7:return a=e.sent,e.abrupt("return",c(a));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function f(e,t,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=n(l);if(i&&a){var u=i.getBoundingClientRect(),o=(e.clientX-u.left)/u.width,s=function(e,t){var r,n;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var u=Math.floor((i+a)/2),o=t[u];if(o===e)return o;o<e?i=u+1:a=u-1}var s=null!==(r=t[i])&&void 0!==r?r:1/0,l=null!==(n=t[a])&&void 0!==n?n:-1/0;return Math.abs(s-e)<Math.abs(l-e)?s:l}(Math.round(o*a.duration()),r),c=t[s];c&&!c.loading&&(c.loading=!0,function(e){return p.apply(this,arguments)}(c).then(function(e){var t=e[c.tileIndex],r=document.querySelector(".vjs-thumbnail-holder img");r&&t.uri&&(r.src=t.uri),c.loading=!1,c.src=t.uri}))}}function b(e){return g.apply(this,arguments)}function g(){return(g=e(t.mark(function e(n){var u,o,l,c;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u={},n.forEach(function(e,t){for(var r=e.layout.split("x").map(Number),n=a(r,2),o=n[0]*n[1],l=e.duration,c=0;c<o;c++){var p,d=Math.round((t*o+c)*l);u[d]=s(s({},e),{},{duration:e.duration,tileIndex:c,loading:!1,style:(p={left:"-60px",height:"85px",width:"130px"},i(p,"left","-60px"),i(p,"border","1px solid transparent"),i(p,"borderRadius","4px"),p)})}}),o=Object.keys(u).map(Number).sort(function(e,t){return e-t}),null==(l=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||l.addEventListener("mousemove",r(function(e){return f(e,u,o)},500)),null==(c=document.querySelector(".vjs-progress-control.vjs-control"))||c.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",r(function(e){return f(e,u,o)},500))}),e.abrupt("return",u);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var v=function(){var r=e(t.mark(function e(r,n){var i,u,o,s,l,c,p,d;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(r+n);case 2:return i=e.sent,e.next=5,i.text();case 5:u=e.sent,o=u.split("\n").map(function(e){return e.trim()}),s=[],l=null,c=0;case 10:if(!(c<(null==o?void 0:o.length))){e.next=27;break}if(!(p=o[c]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},d=p.split(":")[1]||"",d.split(",").forEach(function(e){var t=e.split("="),r=a(t,2),n=r[0],i=r[1];n&&i&&(l[n.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!p.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(p.includes("jpg")||p.includes("png")||p.includes("jpeg"))&&(l.uri=p.includes("http")?p:r+p,s.push(l),l=null);case 24:c++,e.next=10;break;case 27:return e.abrupt("return",s);case 28:case"end":return e.stop()}},e)}));return function(e,t){return r.apply(this,arguments)}}();function h(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function x(e,t){return y.apply(this,arguments)}function y(){return(y=e(t.mark(function e(r,i){var o,s,c,p,d,m,f,b,g,v,x,y,E,j,N,A,T,O,I,S,M,P,R,$,B,D,L,U,C,X,q,_,F,W,z,G,H,J,K,Q,V,Y,Z,ee,te,re,ne,ie,ae,ue,oe,se,le,ce,pe,de,me,fe;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=i,o=n(i),s=r.split("/"),c=s.findIndex(function(e){return"dash"===e.toLowerCase()}),p=h(-1!==c?s.slice(0,c+1).join("/"):new URL(r).origin),e.prev=5,e.next=8,fetch(r);case 8:return b=e.sent,e.next=11,b.text();case 11:g=e.sent,v=new DOMParser,x=v.parseFromString(g,"application/xml"),y=(null==o?void 0:o.duration())||(null===(d=u())||void 0===d||null===(m=d.video)||void 0===m?void 0:m.runtime),E=(null==x||null===(f=x.querySelector("MPD > BaseURL"))||void 0===f?void 0:f.textContent)||p+"/",j=x.getElementsByTagName("AdaptationSet"),N=0;case 18:if(!(N<j.length)){e.next=72;break}if(("image"!==(A=j[N]).getAttribute("contentType")||"image/png"!==A.getAttribute("mimeType"))&&"image/jpeg"!==A.getAttribute("mimeType")){e.next=69;break}if(O=A.getElementsByTagName("SegmentTemplate")[0],I=null===(T=O.getElementsByTagName("SegmentTimeline"))||void 0===T?void 0:T[0],!O||!I){e.next=48;break}if(P=I.getElementsByTagName("S"),R=parseInt(null===(S=P[0])||void 0===S?void 0:S.getAttribute("t")),$=parseInt(null===(M=P[0])||void 0===M?void 0:M.getAttribute("d")),B=A.getElementsByTagName("Representation")[0],D=B.getElementsByTagName("EssentialProperty")[0],L=D.getAttribute("value"),U=null==L?void 0:L.split("x"),C=a(U,2),X=C[0],q=C[1],!O){e.next=46;break}if(O.getAttribute("media"),_=O.getAttribute("timescale"),F=(_?$/_:$)/(X*q),W=B.getAttribute("id"),z=Math.round(y/F),G=Math.ceil(z/(X*q)),H=O.getAttribute("media"),parseInt(O.getAttribute("startNumber")),!isNaN(parseInt(G))){e.next=43;break}return e.abrupt("return");case 43:for(J=[],N=0;N<G;N++)Q="/"==(K=H)[0]?new URL(p).origin:p+"/",J.push({duration:F,layout:L,uri:Q+K.replace("$Time$",R+N*$).replace("$RepresentationID$",W)});return e.abrupt("return",J);case 46:e.next=69;break;case 48:if(V=A.getElementsByTagName("Representation")[0],Y=V.getElementsByTagName("EssentialProperty")[0],Z=Y.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=a(ee,2),re=te[0],ne=te[1],!O){e.next=69;break}if(O.getAttribute("media"),ie=O.getAttribute("duration"),ae=O.getAttribute("timescale"),ue=(ae?ie/ae:ie)/(re*ne),oe=V.getAttribute("id"),se=Math.round(y/ue),le=Math.ceil(se/(re*ne)),ce=O.getAttribute("media"),pe=parseInt(O.getAttribute("startNumber"))||0,!isNaN(parseInt(le))){e.next=65;break}return e.abrupt("return");case 65:for(de=[],me=w(ce),N=0;N<le;N++)fe=me?k(me,N+pe):ce,de.push({duration:ue,layout:Z,uri:E+fe.replace("$Number$",N+pe).replace("$RepresentationID$",oe)});return e.abrupt("return",de);case 69:N++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}},e,null,[[5,76]])}))).apply(this,arguments)}function w(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function k(e,t){var r=e.match(/%0(\d+)d/);if(!r)return e;var n=parseInt(r[1],10),i=String(t).padStart(n,"0");return e.replace(/\$Number%0\d+d\$/,i)}function E(e){return j.apply(this,arguments)}function j(){return(j=e(t.mark(function e(r){var i,a,u,o,s,l,c,p,m,f,g,h,y,w,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s=n(r),l=s.currentSource(),c=l.src,c=null!==(i=c)&&void 0!==i&&i.includes("blob")?null==s||null===(a=s.getSource)||void 0===a?void 0:a.call(s):c,null===(u=c)||void 0===u||!u.includes("m3u8")){e.next=19;break}return e.next=6,d(c,r);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return m=(null==p?void 0:p[0])||null,f=m.uri,g=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,v(g,f);case 12:return h=e.sent,e.next=15,b(h);case 15:y=e.sent,s.thumbnails(y);case 17:e.next=28;break;case 19:if(null===(o=c)||void 0===o||!o.includes("mpd")){e.next=28;break}return e.next=22,x(c,r);case 22:if(!((null==(w=e.sent)?void 0:w.length)>0)){e.next=28;break}return e.next=26,b(w);case 26:k=e.sent,s.thumbnails(k);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}export{E as i};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import{g as t,p as n,d as o}from"./skin-4f84b841.js";import{Z as i,b as l}from"./generic-6bd18e7c.js";import{s as a}from"./autoNextVideo-e8df1a63.js";import{e as r}from"./icons-699e8cf0.js";import s from"@babel/runtime/helpers/typeof";import d from"video.js";var c,u,m,v,p=[],f=!1,g=function(a,s){var d;if(f=!1,null!=s&&null!==(d=s.series)&&void 0!==d&&d.enable){var c;p=[];var u=l();null==u||u.map(function(t){var n;return(n=p).push.apply(n,e(t.episodes))}),null==s||null===(c=s.series)||void 0===c||c.cb}else{var m,v;p=(null==s||null===(m=s.relatedVideos)||void 0===m?void 0:m.content)||[],null==s||null===(v=s.relatedVideos)||void 0===v||v.cb}var g=t(a);g.on("timeupdate",function(){var e,t;if(!f){var n=Math.floor(g.currentTime()),o=g.duration(),l=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];o-n<=10&&i()<=(null===(t=p)||void 0===t?void 0:t.length)-1?l&&(l.style.visibility="visible"):l&&(l.style.visibility="hidden")}});var y,A=p.filter(function(e,t){return t==i()});if((null==A?void 0:A.length)>0)if(null!==(y=document.getElementsByClassName("next-ep-preview"))&&void 0!==y&&y[0]){var x,w,E,b,C,N,B,L,j,k,P,O;(null===(x=document.getElementsByClassName("next-ep-preview"))||void 0===x?void 0:x[0]).style.visibility="hidden";var I=null===(w=document.getElementsByClassName("next-ep-title"))||void 0===w?void 0:w[0],M=null===(E=document.getElementsByClassName("next-ep-img"))||void 0===E?void 0:E[0],T=null===(b=document.getElementsByClassName("next-ep-content"))||void 0===b?void 0:b[0],F=null===(C=A[0])||void 0===C?void 0:C.title;(null===(N=F)||void 0===N?void 0:N.length)>60&&(F=F.substr(0,60)+"..."),I.textContent="".concat(F),M.src=(null===(B=A[0])||void 0===B||null===(L=B.gist)||void 0===L||null===(j=L.imageGist)||void 0===j?void 0:j.r16x9)||(null==A||null===(k=A[0])||void 0===k?void 0:k.img)||(null===(P=window)||void 0===P||null===(O=P.customData)||void 0===O?void 0:O.fallbackImage),T.onclick=function(){return h(a)}}else{var X,R,D,G,S,V,H,Q,U=document.createElement("div");U.className="next-ep-preview",U.style.visibility="hidden",document.getElementById(a).append(U);var W=document.createElement("div");W.className="next-heading-wrapper";var Y=document.createElement("div");Y.className="next-ep-header",Y.textContent="Next up";var Z=document.createElement("div");Z.className="next-ep-close",Z.onclick=function(){U.style.visibility="hidden",f=!0},Z.appendChild(n(r())),W.append(Y),W.append(Z);var _=null===(X=A[0])||void 0===X?void 0:X.title,q=document.createElement("img");q.className="next-ep-img",q.src=(null===(R=A[0])||void 0===R||null===(D=R.gist)||void 0===D||null===(G=D.imageGist)||void 0===G?void 0:G.r16x9)||(null==A||null===(S=A[0])||void 0===S?void 0:S.img)||(null===(V=window)||void 0===V||null===(H=V.customData)||void 0===H?void 0:H.fallbackImage);var z=document.createElement("div");z.className="next-ep-title",(null===(Q=_)||void 0===Q?void 0:Q.length)>60&&(_=_.substr(0,60)+"..."),z.textContent="".concat(_);var J=document.createElement("div");J.className="next-ep-content",J.append(q),J.append(z),J.onclick=o(function(){null==U||U.remove(),f=!0,h(a)},400),U.append(W),U.append(J)}},h=function(e,n){var o=t(e),l=Math.floor(o.currentTime());if(Math.floor(o.duration())!=l){o.pause(e);var r=i();a(r,e,p)}};function y(e,n){var o=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var l=document.createElement("div");l.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",l.append(a),o.el().appendChild(l),o.on("useractive",function(){l.classList.remove("vjs-fade")}),o.on("userinactive",function(){o.paused()||l.classList.add("vjs-fade")}),o.on("fullscreenchange",function(){o.isFullscreen_?l.style.top="3.2rem":l.style.top="1rem"})}}c={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},u=function e(){var t,n,o,i,l;for(o in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[o])i.hasOwnProperty(l)&&("object"===s(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);return n},m=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},v=function e(t){return"HTML"!==t.nodeName&&"static"===m(t)("position")?e(t.offsetParent):t},d.registerPlugin("thumbnails",function(e){var t,n,o,i,l,a,r,s;function d(){document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",d),s()}n=u({},c,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",o=document.createElement("img"),t.appendChild(o),o.src=n[0].src,o.className="vjs-thumbnail",u(o.style,n[0].style),o.style.left||o.style.right||(o.onload=function(){o.style.left=-o.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",function(e){a=i.duration()}),i.on("loadedmetadata",function(e){a=i.duration()}),(l=i.controlBar.progressControl).el().appendChild(t),r=function(e){var i,r,s,d,c,p,f,g,h,y;for(r in s=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((y=v(l.el()).getBoundingClientRect()).width||y.right)+h,p=e.pageX,e.changedTouches&&(p=e.changedTouches[0].pageX),d=p||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,d-=v(l.el()).getBoundingClientRect().left+h,i=Math.floor((d-l.el().offsetLeft)/l.width()*a),n)i>r&&(s=Math.max(s,r));(c=n[s]).src&&o.src!=c.src&&(o.src=c.src),c.style&&o.style!=c.style&&u(o.style,c.style),d+(g=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=m(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(o,c.width||n[0].width)/2)>f?d-=d+g-f:d<g&&(d=g),t.style.left=d+"px"},l.on("mousemove",r),l.on("touchmove",r),l.on("pointerdown",function(e){document.addEventListener("pointermove",r),document.addEventListener("pointerup",d)}),s=function(e){t.style.left="-1000px"},l.on("mouseout",s),l.on("touchcancel",s),l.on("touchend",s),i.on("userinactive",s)});export{g as a,y as b};
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import{g as t,p as n,d as o}from"./skin-4f84b841.js";import{X as i,b as l}from"./generic-33a5f6db.js";import{s as a}from"./autoNextVideo-b5a0e7f2.js";import{e as r}from"./icons-699e8cf0.js";import s from"@babel/runtime/helpers/typeof";import d from"video.js";var c,u,m,v,p=[],f=!1,g=function(a,s){var d;if(f=!1,null!=s&&null!==(d=s.series)&&void 0!==d&&d.enable){var c;p=[];var u=l();null==u||u.map(function(t){var n;return(n=p).push.apply(n,e(t.episodes))}),null==s||null===(c=s.series)||void 0===c||c.cb}else{var m,v;p=(null==s||null===(m=s.relatedVideos)||void 0===m?void 0:m.content)||[],null==s||null===(v=s.relatedVideos)||void 0===v||v.cb}var g=t(a);g.on("timeupdate",function(){var e,t;if(!f){var n=Math.floor(g.currentTime()),o=g.duration(),l=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];o-n<=10&&i()<=(null===(t=p)||void 0===t?void 0:t.length)-1?l&&(l.style.visibility="visible"):l&&(l.style.visibility="hidden")}});var y,A=p.filter(function(e,t){return t==i()});if((null==A?void 0:A.length)>0)if(null!==(y=document.getElementsByClassName("next-ep-preview"))&&void 0!==y&&y[0]){var x,w,E,b,C,N,B,L,j,k,P,O;(null===(x=document.getElementsByClassName("next-ep-preview"))||void 0===x?void 0:x[0]).style.visibility="hidden";var I=null===(w=document.getElementsByClassName("next-ep-title"))||void 0===w?void 0:w[0],M=null===(E=document.getElementsByClassName("next-ep-img"))||void 0===E?void 0:E[0],T=null===(b=document.getElementsByClassName("next-ep-content"))||void 0===b?void 0:b[0],X=null===(C=A[0])||void 0===C?void 0:C.title;(null===(N=X)||void 0===N?void 0:N.length)>60&&(X=X.substr(0,60)+"..."),I.textContent="".concat(X),M.src=(null===(B=A[0])||void 0===B||null===(L=B.gist)||void 0===L||null===(j=L.imageGist)||void 0===j?void 0:j.r16x9)||(null==A||null===(k=A[0])||void 0===k?void 0:k.img)||(null===(P=window)||void 0===P||null===(O=P.customData)||void 0===O?void 0:O.fallbackImage),T.onclick=function(){return h(a)}}else{var F,R,D,G,S,V,H,Q,U=document.createElement("div");U.className="next-ep-preview",U.style.visibility="hidden",document.getElementById(a).append(U);var W=document.createElement("div");W.className="next-heading-wrapper";var Y=document.createElement("div");Y.className="next-ep-header",Y.textContent="Next up";var _=document.createElement("div");_.className="next-ep-close",_.onclick=function(){U.style.visibility="hidden",f=!0},_.appendChild(n(r())),W.append(Y),W.append(_);var q=null===(F=A[0])||void 0===F?void 0:F.title,z=document.createElement("img");z.className="next-ep-img",z.src=(null===(R=A[0])||void 0===R||null===(D=R.gist)||void 0===D||null===(G=D.imageGist)||void 0===G?void 0:G.r16x9)||(null==A||null===(S=A[0])||void 0===S?void 0:S.img)||(null===(V=window)||void 0===V||null===(H=V.customData)||void 0===H?void 0:H.fallbackImage);var J=document.createElement("div");J.className="next-ep-title",(null===(Q=q)||void 0===Q?void 0:Q.length)>60&&(q=q.substr(0,60)+"..."),J.textContent="".concat(q);var K=document.createElement("div");K.className="next-ep-content",K.append(z),K.append(J),K.onclick=o(function(){null==U||U.remove(),f=!0,h(a)},400),U.append(W),U.append(K)}},h=function(e,n){var o=t(e),l=Math.floor(o.currentTime());if(Math.floor(o.duration())!=l){o.pause(e);var r=i();a(r,e,p)}};function y(e,n){var o=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var l=document.createElement("div");l.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",l.append(a),o.el().appendChild(l),o.on("useractive",function(){l.classList.remove("vjs-fade")}),o.on("userinactive",function(){o.paused()||l.classList.add("vjs-fade")}),o.on("fullscreenchange",function(){o.isFullscreen_?l.style.top="3.2rem":l.style.top="1rem"})}}c={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},u=function e(){var t,n,o,i,l;for(o in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[o])i.hasOwnProperty(l)&&("object"===s(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);return n},m=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},v=function e(t){return"HTML"!==t.nodeName&&"static"===m(t)("position")?e(t.offsetParent):t},d.registerPlugin("thumbnails",function(e){var t,n,o,i,l,a,r,s;function d(){document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",d),s()}n=u({},c,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",o=document.createElement("img"),t.appendChild(o),o.src=n[0].src,o.className="vjs-thumbnail",u(o.style,n[0].style),o.style.left||o.style.right||(o.onload=function(){o.style.left=-o.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",function(e){a=i.duration()}),i.on("loadedmetadata",function(e){a=i.duration()}),(l=i.controlBar.progressControl).el().appendChild(t),r=function(e){var i,r,s,d,c,p,f,g,h,y;for(r in s=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((y=v(l.el()).getBoundingClientRect()).width||y.right)+h,p=e.pageX,e.changedTouches&&(p=e.changedTouches[0].pageX),d=p||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,d-=v(l.el()).getBoundingClientRect().left+h,i=Math.floor((d-l.el().offsetLeft)/l.width()*a),n)i>r&&(s=Math.max(s,r));(c=n[s]).src&&o.src!=c.src&&(o.src=c.src),c.style&&o.style!=c.style&&u(o.style,c.style),d+(g=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=m(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(o,c.width||n[0].width)/2)>f?d-=d+g-f:d<g&&(d=g),t.style.left=d+"px"},l.on("mousemove",r),l.on("touchmove",r),l.on("pointerdown",function(e){document.addEventListener("pointermove",r),document.addEventListener("pointerup",d)}),s=function(e){t.style.left="-1000px"},l.on("mouseout",s),l.on("touchcancel",s),l.on("touchend",s),i.on("userinactive",s)});export{g as a,y as b};
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import{t as e,r as n,c as t,g as o,a as i,b as l,d as r,e as a,s as u,f as s,l as d,h as c,v,i as p,j as f,k as m,m as g,n as h,o as y,p as b,q as w,u as k,w as O,x as j,y as S,z as I,A as D,B as T,C as E,D as P,E as x,F as C,G as A,H as R,I as N,J as L,K as M,L as _,M as V,N as U,O as B,P as H,Q as F,R as G,S as K,T as z,U as Y,V as q,W}from"./generic-6bd18e7c.js";import J from"@babel/runtime/helpers/defineProperty";import X from"@babel/runtime/helpers/asyncToGenerator";import Q from"@babel/runtime/regenerator";import $ from"video.js";import{o as Z,g as ee,a as ne,s as te,b as oe,p as ie,c as le}from"./util-a0ce1bd0.js";import{g as re,d as ae,a as ue,e as se}from"./captions-2b4caf69.js";import{g as de}from"./renditions-19f0b3a9.js";import{playSelectedResolution as ce}from"./resolution-56c85eaf.js";import{g as ve,i as pe,a as fe}from"./skin-4f84b841.js";import{d as me}from"./browser-d4613b36.js";import{g as ge,s as he}from"./localisation-0bf399a1.js";import ye from"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@viewlift/comscore/index.js";import be from"@babel/runtime/helpers/toConsumableArray";import we from"@babel/runtime/helpers/slicedToArray";import"axios";import"md5";import"js-cookie";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";var ke=function(e){return new Promise(function(n,t){if(Oe(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}})},Oe=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0};function je(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Se(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?je(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):je(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Ie={dash:"tracking/initialize/dash",hls:"tracking/initialize/hls"};function De(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 Te(e,n,t){return Ee.apply(this,arguments)}function Ee(){return(Ee=X(Q.mark(function t(o,i,l){var r,a,u,s,d,c,v,p,f,m,g;return Q.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=De(o)){t.next=3;break}return t.abrupt("return",o);case 3:return a=n(o.src,l,i),u=a.replace(r,Ie[r]),console.log("[Transmit] session init →",u),t.prev=6,t.next=9,fetch(u,{method:"GET",redirect:"follow"});case 9:return s=t.sent,t.next=12,s.json();case 12:if(d=t.sent,console.log("[Transmit] session response",d),c="dash"===r?null==d?void 0:d.dashUrl:null==d?void 0:d.hlsUrl,v=null==d?void 0:d.trackingUrl,c&&v){t.next=18;break}return t.abrupt("return",o);case 18:return p=new URL(u),f=p.hostname,m="https://".concat(f).concat(c),g="https://".concat(f).concat(v),e.set(g),console.log("[Transmit] session ready",{manifestUrl:m,trackingUrl:g}),t.abrupt("return",Se(Se({},o),{},{src:m}));case 26:return t.prev=26,t.t0=t.catch(6),console.warn("[Transmit] session init failed",t.t0),t.abrupt("return",o);case 30:case"end":return t.stop()}},t,null,[[6,26]])}))).apply(this,arguments)}var Pe=function(e,n,t){var o=ve(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),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,"'")})},xe=function(e){var n=ve(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Ce=function(){var e=X(Q.mark(function e(n){var t,o,i,l,r;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=ve(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 l=e.sent,e.prev=5,e.next=8,ke("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,l.default($),e.finish(13);case 16:(r=$.getTech("chromecast"))&&!r.prototype.seeking&&(r.prototype.seeking=function(){}),null!==(i=window)&&void 0!==i&&i.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.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"==me()?null==o||o.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)}}(),Ae=function(e,n){var t=ve(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,i,l,r,a=this.el(),u=$.dom.getPointerPosition(a,n).x;$.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var s=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S;if(console.log(s),s&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*u,c.seek()}})};var Re=function(){var e=X(Q.mark(function e(){return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),ke("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)}}(),Ne=function(){var e=X(Q.mark(function e(){return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("@viewlift/comscore/index.js").then(function(e){t.set(e)});case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Le=function(){var e=X(Q.mark(function e(){return Q.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){$.getPlugin("eme")||$.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Me=function(){var e=X(Q.mark(function e(){var n;return Q.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($),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)}}(),_e=function(){var e=X(Q.mark(function e(){return Q.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)}}(),Ve=function(){var e=X(Q.mark(function e(){return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-1a1bf509.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)}}(),Ue=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){ke("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default($)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default($)})},loadAdsLibrary:Re,loadEMELibrary:Le,loadMuxPlugin:Me,loadDvrSeekbar:_e,loadContribDash:Ve,loadComscorePlugin:Ne});function Be(e){return He.apply(this,arguments)}function He(){return(He=X(Q.mark(function e(n){var t;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,Re();case 3:t&&"Safari"==me()&&Promise.resolve().then(function(){return Ue}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Fe(e){return Ge.apply(this,arguments)}function Ge(){return(Ge=X(Q.mark(function e(n){var t,o,i,l,r,a,u,s,d,c;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return c=ve(n.playerId),e.next=3,Ne();case 3:c.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(o=n.comscore)||void 0===o?void 0:o.endpoint,applicationName:(null==n||null===(i=n.comscore)||void 0===i?void 0:i.applicationName)||(null===(l=window)||void 0===l?void 0:l.siteName)||null,implementationId:null==n||null===(r=n.comscore)||void 0===r?void 0:r.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===(d=n.comscore)||void 0===d?void 0:d.metadata)||{}});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ke(e,n){return ze.apply(this,arguments)}function ze(){return(ze=X(Q.mark(function e(n,t){var o,i,l,r,a,u,s,d,c,v,p,f,m,g;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return c=(null==t?void 0:t.contentType)||"video",v=null==t||null===(o=t[c])||void 0===o?void 0:o.drmEnabled,null==t||null===(i=t[c])||void 0===i||null===(l=i.liveDetails)||void 0===l||l.isDvrEnabled,null==n||n.showPositiveSeekbar,p=(null==t||null===(r=t[c])||void 0===r||null===(a=r.streamingInfo)||void 0===a||null===(u=a.videoAssets)||void 0===u?void 0:u.dash)||null,f=(null==n||null===(s=n.comscore)||void 0===s?void 0:s.enable)||!1,m=!(null==n||null===(d=n.analytics)||void 0===d||!d.muxKey),e.prev=7,e.next=10,Promise.allSettled([v?"Safari"==me()?Le():"caliente"!=(null===(g=window)||void 0===g?void 0:g.siteName)?Ve():Le():"Safari"!=me()&&p?Ve():null,f?Fe(n):null,m?Me():null,Ce(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 Ye(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function qe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ye(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ye(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var We=new Set,Je=null,Xe=function(e,n,t,i){var r,a,u,s,d,c,v,p={},f=(null==e?void 0:e.contentType)||"video";p["c3.cm.id"]=(null===(r=e[f])||void 0===r?void 0:r.id)||"Null",p["c3.cm.contentType"]=on(e),p[null==t||null===(a=t.Constants)||void 0===a?void 0:a.IS_LIVE]=!(null==e||!e.linearchannel),p[null==t||null===(u=t.Constants)||void 0===u?void 0:u.STREAM_URL]=n.currentSrc(),p[null==t||null===(s=t.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===o()?"NULL":o(),p["c3.cm.categoryType"]=en(e),p["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"}}(),p.DRMEnabled=(null===(d=e[f])||void 0===d?void 0:d.drmEnabled)||"None",p.DAIStream=null!==(c=e[f])&&void 0!==c&&null!==(v=c.gist)&&void 0!==v&&v.isSSAIEnabled?"YES":"NO",p[t.Constants.DEFAULT_RESOURCE]="AKAMAI",p["c3.cm.brand"]="NULL",p.CDVREnabled=nn(e),p["c3.cm.genreList"]=$e(e),p["c3.cm.genre"]=Qe(e),p["c3.cm.channel"]=Ze(e,i);var m=an(l(),e);return p=qe(qe({},p),m)},Qe=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},$e=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"},Ze=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";return"video"===i?"VOD":(null===(o=((null==e||null===(t=e[i])||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===o?void 0:o.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"},nn=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},tn=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var l=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(t=e[l])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(r)},on=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var ln,rn,an=function(e,n){var t,o,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 d=r(),c=i();return s["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(o=t.series)||void 0===o?void 0:o.title)||"Null",s["c3.cm.seasonNumber"]=(null==d?void 0:d.toString())||"Null",s["c3.cm.showTitle"]=(null==e||null===(l=e[d-1])||void 0===l||null===(a=l.episodes)||void 0===a||null===(u=a[c-1])||void 0===u?void 0:u.title)||"Null",s["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",s},un=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"}},sn=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},dn=function(){var e=X(Q.mark(function e(n,t){var o,i,l,r,u,s,d,c,v,p,f,m;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(null==t?void 0:t.convivaConfig)||{},i=o.trackConvivaPlayerEvent,l=o.paymentHandler,r=o.tveProvider,u=o.enable,s=o.appName,c=(d=t||{}).token,v=d.epg,u){e.next=4;break}return e.abrupt("return");case 4:if(p=ve(n),"function"==typeof(f=i)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,f("getConvivaObject");case 10:if(m=e.sent){e.next=13;break}return e.abrupt("return");case 13:p.ready(function(){var e=p.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=un(t.keySystem);f("contentInfo",{DRMEnabled:o})}else f("contentInfo",{DRMEnabled:"None"})}),n||f("contentInfo",{DRMEnabled:"None"})}),p.on("loadstart",function(){var e,n;Je&&Je!==p.currentSrc()&&f("playbackEnded"),f("setPlayer",p),We.clear(),Je=p.currentSrc();var o=sn(p.currentType()),i=a(),u=Xe(i,p,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]=tn(i,t),u.authToken=c||"NULL",u.streamType=o,u.D2CType=l||"NONE",u.subscriberType=r?"MVPD":"FREE"!==l?"D2C":"FREE",u["c3.cm.affiliate"]=r||"NULL",cn.setData(u),f("contentInfo",u)}),p.on("loadedmetadata",function(){var e,n=p.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),f("contentInfo",{screenResolution:e})}),p.on("play",function(){We.has(p.currentSrc())||(We.add(p.currentSrc()),f("playbackStarted",null))}),p.on("ended",function(){We.has(p.currentSrc())&&We.delete(p.currentSrc()),f("playbackEnded")}),p.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&f("initAdSensor",{player:p,adsLoader:null==e?void 0:e.adsLoader})}),p.on("dispose",function(){null==We||We.clear(),f("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),cn=(ln={},{setData:function(e){ln=qe(qe({},ln),e)},getData:function(){return ln}}),vn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-d32b190c.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-adec58f3.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-eb3c788b.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-4770cb4a.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-d6db5c40.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?import("./skin-b4b45ad3.js").then(function(t){t.initialiseSkin(e,n)}):"news"==t?import("./skin-0f0b158c.js").then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?import("./skin-ea3284a6.js").then(function(t){t.initialiseSkin(e,n)}):"mini"==t&&import("./skin-e659efe9.js").then(function(t){t.initialiseSkin(e,n)})};function pn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function fn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?pn(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var mn=[],gn=0,hn=null;function yn(){rn=null,mn=[],gn=0,hn=null}function bn(e,n,t){var o,i,l,r,s,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(o=n.watchHistory)||void 0===o||o.apiVersion;var c=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,v=Math.floor(e.currentTime()),p=Math.floor(e.duration());null==n||null===(l=n.watchHistory)||void 0===l||l.xapiKey;var f=(null==n||null===(r=n.video)||void 0===r?void 0:r.originalObjectId)||null,m=(null==n||null===(s=n.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,g=Math.floor(e.currentTime()),h=d?100:Math.floor(v/p*100),y={};m?function(e,n,t){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),i=wn(o),l=(new Date).getTime(),r=a(),u=(null==r?void 0:r.video)||{},s=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,n){return fn(fn({},e),{},J({},n,u[n]))},{}),d=i.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===rn});d<0?i.push(fn(fn({content:s},e),{},{addedDate:l,updateDate:l})):i[d]=fn(fn(fn({},i[d]),e),{},{updateDate:l});localStorage.setItem("".concat(o),JSON.stringify(i))}(y={completed:d,watchedTime:g,watchedPercentage:h},c,n.siteOwner):(y=fn(fn({videoId:rn,watchedTime:g,watchedPercentage:h,doneWatching:d,profileId:c},hn&&{seriesId:hn}),f&&{originalObjectId:f}),u(y).then(function(e){}).catch(function(e){})),gn=v+t}function wn(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function kn(e,n,t){var o=wn(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),i}var On=!1,jn=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!On){var l=Sn(e,"videoAssets","secondaryVideoAssets"),r=s(l,n);return r&&d(n,r),On=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Sn(e,n,t){if(Array.isArray(e))return e.map(function(e){return Sn(e,n,t)});if(null!==e&&"object"===ye(e)){var o={};return Object.keys(e).forEach(function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=Sn(e[i],n,t)}),o}return e}function In(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 Dn(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)?Dn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}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 l,r=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){a=!0,l=e},f:function(){try{r||null==t.return||t.return()}finally{if(a)throw l}}}}function Dn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function Tn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function En(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Tn(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Tn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Pn=function(e,n,t,o){var i,l,r,u,s,d=o.res,h=o.sres,y=ve(e),b=(null==d?void 0:d.contentType)||"video",w=(null==d||null===(i=d[b])||void 0===i?void 0:i.drmEnabled)||!1,k=(null==d||null===(l=d[b])||void 0===l||null===(r=l.streamingInfo)||void 0===r?void 0:r.isLiveStream)||!1,O=(null==d||null===(u=d[b])||void 0===u||null===(s=u.liveDetails)||void 0===s?void 0:s.isDvrEnabled)||!1;c(d),v.set(d),y&&(y.on("loadstart",function(){k?t.resolve({status:!0,msg:"Video Loaded",response:d}):t.resolve(En({status:!0,msg:"Player Initialised"},h?{seriesResponse:h,response:d}:{response:d}))}),y.on("loadeddata",function(){var t,o,i,l=re(e);if(null==l||l.map(function(n){return ae(e,n.id)}),O&&"Safari"===me())try{var r;null==y||null===(r=y.liveTracker)||void 0===r||r.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==y||!y.muted())&&Pe(e,sessionStorage.getItem("volume")||"100");var u=a();if(p(n),f(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(o=n.watchHistory)&&void 0!==o&&o.saveOffline)){var s,c,v=En(En({},n),d);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(hn=null==n||null===(i=n.series)||void 0===i?void 0:i.id),mn=[],gn=0,rn=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=ve(e);a&&(a.on("dispose",yn),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());mn.includes(gn)||(e!=gn||e<r?e>gn&&(gn=e+r):(mn.push(e),bn(a,n,r)))}}),a.one("ended",function(){bn(a,n,r,!0)}))}(e,v,null==u||null===(s=u.video)||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.id)}if(null!=n&&null!==(i=n.analytics)&&void 0!==i&&i.muxKey&&null!=y&&y.mux){var m,g,h,b,w,k,j=(null===(m=a())||void 0===m?void 0:m.video)||(null==d?void 0:d.video),S=null==j?void 0:j.gist,I={env_key:null==n||null===(g=n.analytics)||void 0===g?void 0:g.muxKey,player_name:"vl-web-player",player_version:null===(h=window)||void 0===h?void 0:h.vl_player_version,video_id:null==S?void 0:S.id,video_title:null==S?void 0:S.title,video_series:null==j||null===(b=j.series)||void 0===b?void 0:b.title,video_stream_type:null!=j&&null!==(w=j.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==n||null===(k=n.analytics)||void 0===k?void 0:k.userId};y.mux({debug:!1,data:I})}}),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,o,i,l,r,a,u,s,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,f=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(d=s.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),h=g.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}}),y.tech_.on("retryplaylist",function(){k&&jn(d,e)}),y.on("error",function(){var n,o;(console.log("ERROR",y.error(),y.error().code),4===y.error().code&&k)?jn(d,e):(m(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===(o=y.error())||void 0===o?void 0:o.message)||"Some error occured",response:d}))}),y.one("play",function(){var e,t,o,i,l;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(o=t.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=n&&null!==(l=n.series)&&void 0!==l&&l.enable){var r,u,s,d=null===(r=a())||void 0===r||null===(u=r.video)||void 0===u||null===(s=u.gist)||void 0===s?void 0:s.id,c=g(),v=(null==c?void 0:c.get(d))||{t:0,p:0},p=v.t,f=v.p;p&&f<95&&setTimeout(function(){y.currentTime(p)},0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout(function(){y.currentTime(null==n?void 0:n.watchHistoryResumeTime)},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(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0}),"object"==ye(y.dash)){var t,o,i,l=null==y||null===(t=y.dash)||void 0===t||null===(o=t.mediaPlayer)||void 0===o?void 0:o.getTracksFor("audio"),r=null==l?void 0:l.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),a=In(n);try{for(a.s();!(i=a.n()).done;){var u=i.value;if(r&&(null==u?void 0:u.id)=="dash-audio-".concat(r.index)){u.enabled=!0;break}}}catch(e){a.e(e)}finally{a.f()}}else{var s,d=In(n);try{for(d.s();!(s=d.n()).done;){var c,v,p,f=s.value;if(("Chrome"==me()||"Edge"==me()&&(null!==(c=navigator)&&void 0!==c&&null!==(v=c.userAgent)&&void 0!==v&&v.includes("Macintosh")||!w))&&null!=f&&null!==(p=f.label)&&void 0!==p&&p.includes("5.1"))y.audioTracks().removeTrack(f);else{if("main"==f.kind){f.enabled=!0;break}f.enabled=!1}}}catch(e){d.e(e)}finally{d.f()}}}))};function xn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Cn(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){J(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 An=function(n,t,o,i){var l,r,a,u,c,v,p,f,g,O,j,S,I,D,T,E,P,x,C,A,R,N,L,M,_,V,U,B,H,F,G,K,z,Y,q,W,Z,ee,ne,te=t.res,oe=void 0===te?null:te,ie=t.sres,le=void 0===ie?null:ie,re=null!=o&&o.chromecastReceiverId?["chromecast","html5"]:["html5"],ae=(null===(l=oe)||void 0===l?void 0:l.contentType)||"video",se=pe(null===(r=oe)||void 0===r||null===(a=r[ae])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.videoImageUrl)||pe(null===(c=oe)||void 0===c||null===(v=c[ae])||void 0===v||null===(p=v.gist)||void 0===p||null===(f=p.imageGist)||void 0===f?void 0:f.r16x9),de=(null===(g=oe)||void 0===g||null===(O=g[ae])||void 0===O||null===(j=O.liveDetails)||void 0===j?void 0:j.isDvrEnabled)||!1,ce=(null===(S=oe)||void 0===S||null===(I=S[ae])||void 0===I||null===(D=I.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,fe=(null===(T=oe)||void 0===T||null===(E=T.ads)||void 0===E||null===(P=E.preRoll)||void 0===P||null===(x=P.adTags)||void 0===x||null===(C=x.web)||void 0===C?void 0:C.active)&&(null===(A=oe)||void 0===A||null===(R=A.ads)||void 0===R||null===(N=R.preRoll)||void 0===N||null===(L=N.adTags)||void 0===L||null===(M=L.web)||void 0===M?void 0:M.url);oe=Cn(Cn({},oe),{},{audioAssetSource:null==o?void 0:o.audioAssetSource});var ge=(null==o||null===(_=o.customData)||void 0===_?void 0:_.ads)||{},he=(null===(V=oe)||void 0===V||null===(U=V[ae])||void 0===U?void 0:U.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==ge?void 0:ge.vodAdSticherProvider)||!1,ye=!(null===(B=oe)||void 0===B||null===(H=B[ae])||void 0===H||!H.isSSAIEnabled)&&"TRANSMIT"==(null==ge?void 0:ge.liveAdSticherProvider)&&!(null==ge||!ge.liveAdClientSideTracking),be=(null==o?void 0:o.latency)||6,we=(null==o?void 0:o.skin_settings)||{},ke=(ee={enableSmoothSeeking:!0,controls:0!=(null==o?void 0:o.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==o?void 0:o.muted)||!1,autoplay:(null==o?void 0:o.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"==o.skin,liveui:de},J(ee,"autoplay",null==o?void 0:o.autoplay),J(ee,"normalizeAutoplay",(null==o?void 0:o.autoplay)&&!fe),J(ee,"loop",(null==o?void 0:o.loop)||!1),J(ee,"audioPosterMode",null==o?void 0:o.audioPosterMode),J(ee,"html5",Cn(Cn({dash:Cn(Cn(Cn({},!$.browser.IS_SAFARI&&{useTTML:!0}),(null==o?void 0:o.debugConfig)&&(null==o||null===(F=o.debugConfig)||void 0===F?void 0:F.enable)&&{debug:!0,logLevel:null!=o&&null!==(G=o.debugConfig)&&void 0!==G&&G.logLevel?null==o||null===(K=o.debugConfig)||void 0===K?void 0:K.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:be},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:Cn({},"IE"==me()&&{enableStallFix:!0,stallSeek:1}),abr:Cn(Cn({},(null==o?void 0:o.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==o?void 0:o.initialBandwidth)/1e3}}),{},{autoSwitchBitrate:{video:!0,audio:!0}})}}}),vhs:Cn(Cn(Cn({},(null==o?void 0:o.initialBandwidth)&&{bandwidth:o.initialBandwidth}),{},{liveRangeSafeTimeDelta:be,useDevicePixelRatio:!0,experimentalLLHLS:(null==o?void 0:o.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==o||!o.initialBandwidth},(null==o||null===(z=o.customData)||void 0===z?void 0:z.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(Y=null==o?void 0:o.enableLowInitialPlaylist)&&void 0!==Y&&Y}),debug:(null==o?void 0:o.debugConfig)&&(null==o||null===(q=o.debugConfig)||void 0===q?void 0:q.enable)||!1,nativeTextTracks:"Safari"==me()},0==(null==o||null===(W=o.customData)||void 0===W?void 0:W.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==o||null===(Z=o.customData)||void 0===Z?void 0:Z.nativeVideoTracks)&&{nativeVideoTracks:!1})),J(ee,"poster",se),J(ee,"techOrder",re),J(ee,"chromecast",{requestCustomDataFn:function(t){var i,l,r=ve(n),a=((null==r?void 0:r.textTracksJson_)||r.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),u=function(e,n,t){var o,i,l,r,a,u,s,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,g,h,y,b,w,k,O;f.isDrmEnabled=!0;var j=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,S=(null==j?void 0:j.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(h=g[0])||void 0===h||null===(y=h.options)||void 0===y?void 0:y.serverURL);f.licenseUrl=S;var I=(null==j?void 0:j.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===(O=k.httpRequestHeaders)||void 0===O?void 0:O["X-AxDRM-Message"]);f.licenseToken=I}var D=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=D;var T=null==e||null===(l=e[p])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;f.duration=T;var E=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;f.mediaTitle=E;var P=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=P,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(oe,t,a);return Cn(Cn({},u),{},{transmitTrackingUrl:e.get()||null,convivaMetaData:Cn({customerKey:(null==o||null===(i=o.convivaConfig)||void 0===i?void 0:i.customerKey)||null,debug:(null==o||null===(l=o.convivaConfig)||void 0===l?void 0:l.debug)||!1},cn.getData())})},modifyLoadRequestFn:function(e){var t,o,i,l,r,a=ve(n),u=(null==a?void 0:a.currentSource())||{};!(null===(t=oe)||void 0===t||null===(o=t[ae])||void 0===o||null===(i=o.streamingInfo)||void 0===i||null===(l=i.videoAssets)||void 0===l?void 0:l.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(r=u.src)&&void 0!==r&&r.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),ee);if(!$.getPlayers()[n]){null!=o&&o.debugConfig&&null!=o&&null!==(ne=o.debugConfig)&&void 0!==ne&&ne.enable&&$.log.level("debug");var Oe=$(n,ke,function(){var e=X(Q.mark(function e(){var t,l,r,a,u,c,v,p,f,g,O,j,S,I,D,T,E,P,x,C;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(Oe),console.log($.VERSION),console.log($.getPlugins()),e.next=5,Ke(o,oe);case 5:if(j=null===(t=oe)||void 0===t||null===(l=t[ae])||void 0===l||null===(r=l.liveDetails)||void 0===r?void 0:r.startOverTime,ce&&i.resolve(Cn({status:!0,msg:"Player Initialised"},le?{seriesResponse:le,response:oe}:{response:oe})),y(n,{analyticsCb:null==o?void 0:o.analyticsCb,analyticsEventParams:null==o?void 0:o.analyticsEventParams,userId:null==o?void 0:o.userId}),dn(n,o),/Android/i.test(navigator.userAgent)&&($.options.vhs.overrideNative=!0),de&&Ae(n,j),!fe||null!=o&&null!==(a=o.customData)&&void 0!==a&&a.disableAds||b(n,fe,oe),S=s(oe,n),console.log(S),null!=o&&o.nearestClusterUrl&&(S=w(S,o.nearestClusterUrl)),!he){e.next=21;break}return e.next=18,k(n,oe);case 18:S=e.sent,e.next=25;break;case 21:if(!ye){e.next=25;break}return e.next=24,Te(S,oe,n);case 24:S=e.sent;case 25:S?d(n,S):(i.reject({status:!1,msg:"Incompatible / Missing Source",response:oe}),m(n,"Incompatible / Missing Source")),((null===(u=oe)||void 0===u||null===(c=u[ae])||void 0===c||null===(v=c.contentDetails)||void 0===v||null===(p=v.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(f=oe)||void 0===f||null===(g=f[ae])||void 0===g||null===(O=g.closedCaptions)||void 0===O?void 0:O.length)>0)&&(C=(null===(D=oe)||void 0===D||null===(T=D[ae])||void 0===T||null===(E=T.contentDetails)||void 0===E?void 0:E.closedCaptions)||(null===(P=oe)||void 0===P||null===(x=P[ae])||void 0===x?void 0:x.closedCaptions),I=C.filter(function(e){return"VTT"===e.format}),ue(n,I)),null!=o&&o.disableControls?h(n):vn(n,Cn(Cn(Cn({},o),ke),{},{liveVideo:ce,isDvrEnabled:de,res:oe,sres:le})),Pn(n,Cn(Cn(Cn({},o),ke),{},{liveVideo:ce}),i,{res:oe,sres:le});case 29:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}())}};function Rn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Nn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Rn(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Rn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Ln=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,l=Mn(e);An(i,{res:l},e,{resolve:t,reject:o})},Mn=function(e){var n,t,o,i,l,r,a,u,s,d,c,v,p,f=null==e?void 0:e.streamingInfo,m=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,g=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,h=(null==e||null===(o=e.streamingInfo)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.url)||null,y=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,b=(null==e||null===(r=e.streamingInfo)||void 0===r?void 0:r.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)||[],j=(null==e||null===(d=e.customData)||void 0===d||null===(c=d.ads)||void 0===c?void 0:c.isSSAIEnabled)||!1,S=null==e?void 0:e.token,I=O(S);null==I||I.site;var D=null==I?void 0:I.siteId,T=(null==e||null===(v=e.customData)||void 0===v||null===(p=v.comscore)||void 0===p?void 0:p.video)||null,E=Nn(Nn({id:"".concat(D,"_external")},!g&&{directPlaybackUrl:null==m?void 0:m.url}),{},{video:Nn(Nn(Nn(Nn(Nn({drmEnabled:g,streamingInfo:Nn(Nn({videoAssets:Nn(Nn({},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==f?void 0:f.isDvrEnabled)&&{isLiveStream:!0}),(null==T?void 0:T.isLiveStream)&&{isLiveStream:null==T?void 0:T.isLiveStream})},j&&{isSSAIEnabled:j}),{},{metadata:k,liveDetails:{isDvrEnabled:null==f?void 0:f.isDvrEnabled},gist:Nn(Nn(Nn({},y&&{videoImageUrl:y}),(null==T?void 0:T.videoId)&&{id:null==T?void 0:T.videoId}),(null==T?void 0:T.videoTitle)&&{title:null==T?void 0:T.videoTitle}),contentDetails:Nn({},(null==b?void 0:b.length)>0&&{closedCaptions:be(b)})},(null==T?void 0:T.runtime)&&{runtime:null==T?void 0:T.runtime}),(null==T?void 0:T.publishDate)&&{publishDate:null==T?void 0:T.publishDate}),(null==T?void 0:T.platform)&&{platform:null==T?void 0:T.platform}),(null==T?void 0:T.series)&&{series:null==T?void 0:T.series}),ads:{preRoll:{adTags:{web:Nn(Nn({},h&&{active:!0}),h&&{url:h})}}}});return T&&(null!=T&&T.isDvrEnabled&&(E.video.liveDetails=Nn(Nn({},E.video.liveDetails),{},{isDvrEnabled:null==T?void 0:T.isDvrEnabled})),null!=T&&T.metadata&&(E.video.metadata=[].concat(be(E.video.metadata),be(null==T?void 0:T.metadata)))),E},_n=function(e,n){(new Date).getMonth(),new Date(n).getMonth(),(new Date).getFullYear(),new Date(n).getFullYear();var t=Math.floor(e/6048e5),o=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)),i=o>0&&t>4?o:0,l=function(e,n){var t=new Date(n).getFullYear()-new Date(e).getFullYear(),o=new Date(n).getMonth()-new Date(e).getMonth();return new Date(n).getDay()-new Date(e).getDay()<0&&(o-=1),o<0&&(t-=1),t}(new Date,new Date(n));return[l>0&&i>0?l:0,i,t,Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]},Vn=function(e){var n,t=we(e,8),o=t[0],i=t[1],l=t[2],r=t[3],a=t[4],u=t[5],s=t[6],d=t[7];n=o>=1?" ".concat(o," Year"):i>=1?" ".concat(i," month"):l>=1?" ".concat(l," week"):r>=1?" ".concat(r," day"):a<24&&a>=12?" ".concat(a," hour"):a>0?"".concat(a," hours ").concat(u," minutes ").concat(s," seconds"):u>0?"".concat(u," minutes ").concat(s," seconds"):"".concat(s," seconds"),d.textContent="".concat(n),console.log("Time left:",n)};function Un(e,n,t,o){if(e){var i=function(){var i=e-Date.now();if(i/1e3<=0)return clearInterval(l),null==n||n([0,0,0,0,0,0,0,o]),void(null==t||t());var r=_n(i,e);null==n||n([].concat(be(r),[o]))};i();var l=setInterval(i,1e3);return l}}var Bn,Hn=function(e,n,t){var o,i,l,r,a,u,s,d,c,v=null==n||null===(o=n.response)||void 0===o||null===(i=o.data)||void 0===i?void 0:i.errorCode,p=(null==n||null===(l=n.response)||void 0===l||null===(r=l.data)||void 0===r?void 0:r.errorMessage)||(null==n?void 0:n.message)||null,f=Date.now(),m=null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.scheduleStartDate,g=f-(null==n||null===(s=n.response)||void 0===s||null===(d=s.data)||void 0===d?void 0:d.scheduleEndDate);if(f-m<0?c=ge("eventNotStarted")||p||"Game starts in":(g>0||"VIDEO_NOT_EXISTS"==v)&&(c=ge("eventEnded")||p||"Game has ended"),document.getElementsByClassName("error-container")[0]){var h=document.getElementsByClassName("error-message")[0];h&&(h.textContent="".concat(c));var y=document.getElementsByClassName("error-timer-message")[0];y&&Un(Math.abs(m),Vn,t,y)}else{var b=document.getElementById(e).parentElement;if(b){var w=document.createElement("div");w.className="error-container";var k=document.createElement("div");k.className="error-message";var O=document.createElement("div");O.className="error-timer-message",k.textContent="".concat(c),w.appendChild(k),w.appendChild(O),b.append(w),Un(Math.abs(m),Vn,t,O)}}};function Fn(e,n){return Gn.apply(this,arguments)}function Gn(){return(Gn=X(Q.mark(function e(n,t){var o,i,l,r,a,u,s,d,v;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=t.resolve,r=t.reject,a=null==n?void 0:n.videoId,u=null==n?void 0:n.playerId,s=!(null==n||!n.anonymousId),e.next=6,D();case 6:d=e.sent,v=!1===(null==n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.isSSAIEnabled),j(a,d,v).then(function(e){var t,o,i,v;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,c(null==e?void 0:e.data);var p,f=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(v=n.watchHistory)&&void 0!==v&&v.enable&&!s)if((null===(p=n.watchHistory)||void 0===p?void 0:p.saveOffline)||!1){var m,g,h,y=kn((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",a,null==n?void 0:n.siteOwner);if(y&&y.length)n.watchHistoryResumeTime=(null===(g=y[0])||void 0===g?void 0:g.watchedTime)||null,n.watchedPercentage=(null===(h=y[0])||void 0===h?void 0:h.watchedPercentage)||null;f.contentType="video",An(u,{res:f},n,{resolve:l,reject:r})}else S(a,d).then(function(e){var t,o,i,l,r,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(l=i.watchHistory)||void 0===l||l.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,f.contentType="video"}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}).finally(function(){An(u,{res:f},n,{resolve:l,reject:r})});else An(u,{res:f},n,{resolve:l,reject:r})}).catch(function(e){var t,o,i=(null==n||null===(t=n.event)||void 0===t?void 0:t.showScheduleTimer)||!1,l=(null==n||null===(o=n.event)||void 0===o?void 0:o.onCountdownComplete)||null;i&&Hn(u,e,l),I(e,u,r,a)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Kn(e,n){return zn.apply(this,arguments)}function zn(){return(zn=X(Q.mark(function e(n,t){var o,i,l,r,a,u,s,d;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=t.resolve,r=t.reject,e.next=3,D();case 3:a=e.sent,u=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,d=!1===(null==n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.isSSAIEnabled),T(s,a,d).then(function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,An(u,{res:t},n,{resolve:l,reject:r})}).catch(function(e){I(e,u,r,videoId)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Yn(e,n){return qn.apply(this,arguments)}function qn(){return(qn=X(Q.mark(function e(n,t){var o,i,l,r,a,u,s;return Q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,l=t.reject,e.next=3,D();case 3:r=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,x.set(parseInt(u)),s=null==n||null===(o=n.series)||void 0===o?void 0:o.id,E(s,r).then(function(e){var t,o,u,d=e.data,v=e.data.seasons;C(v);var p=videoId||(null==v||null===(t=v[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(u=o[0])||void 0===u?void 0:u.id);P(s,r),j(p,r).then(function(e){var t,o,r;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType,c(e.data),An(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:i,reject:l})}).catch(function(e){I(e,a,l,videoId)})}).catch(function(e){I(e,a,l)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Wn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Jn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Wn(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Wn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Xn(){return{loadVideoInstantly:A,onTimeUpdate:Z,getVideoDuration:ee,onVideoEnded:ne,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=X(Q.mark(function n(t,o){var i,l,r,a,u,s,d,c,v,p,f,m,g,h,y,b,w,k,O,S,D,T,E,P,x,C;return Q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!_(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(h=(null==e?void 0:e.videoSourceUrl)||!1,y=null==e?void 0:e.asat,b=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,w=null==e?void 0:e.videoId,k=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,O=(null==e?void 0:e.streamingInfo)||!1,window.videoId=w,S=null==e?void 0:e.token,!z(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",S),Y().set(null==e?void 0:e.refreshToken),S&&!q(S)){n.next=16;break}return o({status:!1,msg:"".concat(S?"Token is expired !":"Missing Authorization Token"),response:{token:S}}),n.abrupt("return");case 16:Bn=JSON.parse(atob(S.split(".")[1]));case 17:return window.siteName=null===(r=Bn)||void 0===r?void 0:r.site,window.siteId=null===(a=Bn)||void 0===a?void 0:a.siteId,e.isAnonymousUser=!(null===(u=Bn)||void 0===u||!u.anonymousId),e.siteOwner=(null===(s=Bn)||void 0===s?void 0:s.site)||null,e.userId=(null===(d=Bn)||void 0===d?void 0:d.userId)||null,G((null===(c=Bn)||void 0===c?void 0:c.userId)||(null===(v=Bn)||void 0===v?void 0:v.anonymousId)||null),window.watchHistory=e.watchHistory||null,D=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(p=e.series)&&void 0!==p&&p.enable?null:null==e?void 0:e.chromecastReceiverId,T=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,(E=null==e?void 0:e.errors)&&(window.customErrors=E),window.customData=null==e?void 0:e.customData,he(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),K.set(e.apiBaseUrl),null!=e&&e.skin&&!fe(e.skin)||(e.skin="VL_ONE"),n.next=35,Be(e);case 35:T&&ke("https://www.googletagmanager.com/gtag/js?id=".concat(T)).then(function(){return W(T)}).catch(function(e){}),(P=null===(g=document)||void 0===g?void 0:g.getElementById("".concat(D)))&&P.addEventListener("contextmenu",function(e){return e.preventDefault()}),h?(C={directPlaybackUrl:h,id:x="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},y?j(x,S).then(function(n){var i=(null==n?void 0:n.data)||{};An(D,{res:Jn(Jn({},i),C)},e,{resolve:t,reject:o})}).catch(function(e){I(e,D,o,x)}):An(D,{res:C},e,{resolve:t,reject:o})):O?Ln(e,{resolve:t,reject:o}):k?Yn(e,{resolve:t,reject:o}):b?Kn(e,{resolve:t,reject:o}):Fn(e,{resolve:t,reject:o});case 39:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:de,skip:R,getPlayer:ve,play:N,pause:L,detectBrowser:me,rewind:M,loadVideo:d,seekToTimeStamp:te,isPlayerInitialised:_,load:V,authenticateLC:U,dispose:B,enableCaptions:se,disableCaptions:ae,getCaptions:re,playSelectedResolution:ce,getSource:s,setVolume:Pe,getVolume:xe,disableControls:h,setPlaybackSpeed:oe,getEntitlementData:H,getSsaiEvents:F,playerEvents:ie,onReplay:le}}export{Xn as default};
1
+ import"video.js/dist/video-js.min.css";import{c as e,g as n,a as t,b as o,d as i,e as l,s as r,f as a,l as u,h as s,v as d,i as c,j as v,k as p,m as f,n as m,o as g,p as y,q as h,r as b,t as w,u as k,w as O,x as I,y as S,z as j,A as D,B as E,C as T,D as P,E as x,F as C,G as R,H as A,I as N,J as L,K as M,L as _,M as V,N as B,O as U,P as H,Q as F,R as K,S as G,T as Y,U as q}from"./generic-33a5f6db.js";import z from"@babel/runtime/helpers/defineProperty";import J from"@babel/runtime/helpers/asyncToGenerator";import W from"@babel/runtime/regenerator";import X from"video.js";import{o as Q,g as $,a as Z,s as ee,b as ne,p as te,c as oe}from"./util-66a380dd.js";import{g as ie,d as le,a as re,e as ae}from"./captions-2b4caf69.js";import{g as ue}from"./renditions-19f0b3a9.js";import{playSelectedResolution as se}from"./resolution-56c85eaf.js";import{g as de,i as ce,a as ve}from"./skin-4f84b841.js";import{d as pe}from"./browser-d4613b36.js";import{g as fe,s as me}from"./localisation-0bf399a1.js";import ge from"@babel/runtime/helpers/typeof";import ye from"@babel/runtime/helpers/toConsumableArray";import he from"@babel/runtime/helpers/slicedToArray";import"axios";import"md5";import"js-cookie";import"@viewlift/comscore/index.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";var be=function(e){return new Promise(function(n,t){if(we(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}})},we=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},ke=function(e,n,t){var o=de(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),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,"'")})},Oe=function(e){var n=de(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Ie=function(){var e=J(W.mark(function e(n){var t,o,i,l,r;return W.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=de(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 l=e.sent,e.prev=5,e.next=8,be("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,l.default(X),e.finish(13);case 16:(r=X.getTech("chromecast"))&&!r.prototype.seeking&&(r.prototype.seeking=function(){}),null!==(i=window)&&void 0!==i&&i.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.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"==pe()?null==o||o.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)}}(),Se=function(e,n){var t=de(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,i,l,r,a=this.el(),u=X.dom.getPointerPosition(a,n).x;X.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var s=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S;if(console.log(s),s&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*u,c.seek()}})};var je=function(){var e=J(W.mark(function e(){return W.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),be("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)}}(),De=function(){var n=J(W.mark(function n(){return W.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)}}(),Ee=function(){var e=J(W.mark(function e(){return W.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){X.getPlugin("eme")||X.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Te=function(){var e=J(W.mark(function e(){var n;return W.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(X),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)}}(),Pe=function(){var e=J(W.mark(function e(){return W.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)}}(),xe=function(){var e=J(W.mark(function e(){return W.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-1a1bf509.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)}}(),Ce=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){be("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(X)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(X)})},loadAdsLibrary:je,loadEMELibrary:Ee,loadMuxPlugin:Te,loadDvrSeekbar:Pe,loadContribDash:xe,loadComscorePlugin:De});function Re(e){return Ae.apply(this,arguments)}function Ae(){return(Ae=J(W.mark(function e(n){var t;return W.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,je();case 3:t&&"Safari"==pe()&&Promise.resolve().then(function(){return Ce}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ne(e){return Le.apply(this,arguments)}function Le(){return(Le=J(W.mark(function e(n){var t,o,i,l,r,a,u,s,d,c;return W.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return c=de(n.playerId),e.next=3,De();case 3:c.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(o=n.comscore)||void 0===o?void 0:o.endpoint,applicationName:(null==n||null===(i=n.comscore)||void 0===i?void 0:i.applicationName)||(null===(l=window)||void 0===l?void 0:l.siteName)||null,implementationId:null==n||null===(r=n.comscore)||void 0===r?void 0:r.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===(d=n.comscore)||void 0===d?void 0:d.metadata)||{}});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Me(e,n){return _e.apply(this,arguments)}function _e(){return(_e=J(W.mark(function e(n,t){var o,i,l,r,a,u,s,d,c,v,p,f,m,g;return W.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return c=(null==t?void 0:t.contentType)||"video",v=null==t||null===(o=t[c])||void 0===o?void 0:o.drmEnabled,null==t||null===(i=t[c])||void 0===i||null===(l=i.liveDetails)||void 0===l||l.isDvrEnabled,null==n||n.showPositiveSeekbar,p=(null==t||null===(r=t[c])||void 0===r||null===(a=r.streamingInfo)||void 0===a||null===(u=a.videoAssets)||void 0===u?void 0:u.dash)||null,f=(null==n||null===(s=n.comscore)||void 0===s?void 0:s.enable)||!1,m=!(null==n||null===(d=n.analytics)||void 0===d||!d.muxKey),e.prev=7,e.next=10,Promise.allSettled([v?"Safari"==pe()?Ee():"caliente"!=(null===(g=window)||void 0===g?void 0:g.siteName)?xe():Ee():"Safari"!=pe()&&p?xe():null,f?Ne(n):null,m?Te():null,Ie(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 Ve(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Be(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ve(Object(t),!0).forEach(function(n){z(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ve(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Ue=new Set,He=null,Fe=function(e,t,i,l){var r,a,u,s,d,c,v,p={},f=(null==e?void 0:e.contentType)||"video";p["c3.cm.id"]=(null===(r=e[f])||void 0===r?void 0:r.id)||"Null",p["c3.cm.contentType"]=We(e),p[null==i||null===(a=i.Constants)||void 0===a?void 0:a.IS_LIVE]=!(null==e||!e.linearchannel),p[null==i||null===(u=i.Constants)||void 0===u?void 0:u.STREAM_URL]=t.currentSrc(),p[null==i||null===(s=i.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===n()?"NULL":n(),p["c3.cm.categoryType"]=qe(e),p["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"}}(),p.DRMEnabled=(null===(d=e[f])||void 0===d?void 0:d.drmEnabled)||"None",p.DAIStream=null!==(c=e[f])&&void 0!==c&&null!==(v=c.gist)&&void 0!==v&&v.isSSAIEnabled?"YES":"NO",p[i.Constants.DEFAULT_RESOURCE]="AKAMAI",p["c3.cm.brand"]="NULL",p.CDVREnabled=ze(e),p["c3.cm.genreList"]=Ge(e),p["c3.cm.genre"]=Ke(e),p["c3.cm.channel"]=Ye(e,l);var m=$e(o(),e);return p=Be(Be({},p),m)},Ke=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},Ge=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"},Ye=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";return"video"===i?"VOD":(null===(o=((null==e||null===(t=e[i])||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===o?void 0:o.title)||"NULL"},qe=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"},ze=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},Je=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var l=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(t=e[l])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(r)},We=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Xe,Qe,$e=function(e,n){var o,l,r,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 d=i(),c=t();return s["c3.cm.seriesName"]=(null==n||null===(o=n.video)||void 0===o||null===(l=o.series)||void 0===l?void 0:l.title)||"Null",s["c3.cm.seasonNumber"]=(null==d?void 0:d.toString())||"Null",s["c3.cm.showTitle"]=(null==e||null===(r=e[d-1])||void 0===r||null===(a=r.episodes)||void 0===a||null===(u=a[c-1])||void 0===u?void 0:u.title)||"Null",s["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",s},Ze=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"}},en=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},nn=function(){var e=J(W.mark(function e(n,t){var o,i,r,a,u,s,d,c,v,p,f,m;return W.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(null==t?void 0:t.convivaConfig)||{},i=o.trackConvivaPlayerEvent,r=o.paymentHandler,a=o.tveProvider,u=o.enable,s=o.appName,c=(d=t||{}).token,v=d.epg,u){e.next=4;break}return e.abrupt("return");case 4:if(p=de(n),"function"==typeof(f=i)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,f("getConvivaObject");case 10:if(m=e.sent){e.next=13;break}return e.abrupt("return");case 13:p.ready(function(){var e=p.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=Ze(t.keySystem);f("contentInfo",{DRMEnabled:o})}else f("contentInfo",{DRMEnabled:"None"})}),n||f("contentInfo",{DRMEnabled:"None"})}),p.on("loadstart",function(){var e,n;He&&He!==p.currentSrc()&&f("playbackEnded"),f("setPlayer",p),Ue.clear(),He=p.currentSrc();var o=en(p.currentType()),i=l(),u=Fe(i,p,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]=Je(i,t),u.authToken=c||"NULL",u.streamType=o,u.D2CType=r||"NONE",u.subscriberType=a?"MVPD":"FREE"!==r?"D2C":"FREE",u["c3.cm.affiliate"]=a||"NULL",tn.setData(u),f("contentInfo",u)}),p.on("loadedmetadata",function(){var e,n=p.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),f("contentInfo",{screenResolution:e})}),p.on("play",function(){Ue.has(p.currentSrc())||(Ue.add(p.currentSrc()),f("playbackStarted",null))}),p.on("ended",function(){Ue.has(p.currentSrc())&&Ue.delete(p.currentSrc()),f("playbackEnded")}),p.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&f("initAdSensor",{player:p,adsLoader:null==e?void 0:e.adsLoader})}),p.on("dispose",function(){null==Ue||Ue.clear(),f("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),tn=(Xe={},{setData:function(e){Xe=Be(Be({},Xe),e)},getData:function(){return Xe}}),on=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-b3b3b287.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-b67cc4f1.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-fa83e953.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-272c9ee0.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-a29e48d8.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?import("./skin-5dcf4810.js").then(function(t){t.initialiseSkin(e,n)}):"news"==t?import("./skin-30aad0cd.js").then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?import("./skin-584ab22b.js").then(function(t){t.initialiseSkin(e,n)}):"mini"==t&&import("./skin-8d8c5654.js").then(function(t){t.initialiseSkin(e,n)})};function ln(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function rn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ln(Object(t),!0).forEach(function(n){z(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ln(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var an=[],un=0,sn=null;function dn(){Qe=null,an=[],un=0,sn=null}function cn(e,n,t){var o,i,a,u,s,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(o=n.watchHistory)||void 0===o||o.apiVersion;var c=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,v=Math.floor(e.currentTime()),p=Math.floor(e.duration());null==n||null===(a=n.watchHistory)||void 0===a||a.xapiKey;var f=(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,g=Math.floor(e.currentTime()),y=d?100:Math.floor(v/p*100),h={};m?function(e,n,t){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),i=vn(o),r=(new Date).getTime(),a=l(),u=(null==a?void 0:a.video)||{},s=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,n){return rn(rn({},e),{},z({},n,u[n]))},{}),d=i.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===Qe});d<0?i.push(rn(rn({content:s},e),{},{addedDate:r,updateDate:r})):i[d]=rn(rn(rn({},i[d]),e),{},{updateDate:r});localStorage.setItem("".concat(o),JSON.stringify(i))}(h={completed:d,watchedTime:g,watchedPercentage:y},c,n.siteOwner):(h=rn(rn({videoId:Qe,watchedTime:g,watchedPercentage:y,doneWatching:d,profileId:c},sn&&{seriesId:sn}),f&&{originalObjectId:f}),r(h).then(function(e){}).catch(function(e){})),un=v+t}function vn(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function pn(e,n,t){var o=vn(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),i}var fn=!1,mn=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!fn){var l=gn(e,"videoAssets","secondaryVideoAssets"),r=a(l,n);return r&&u(n,r),fn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function gn(e,n,t){if(Array.isArray(e))return e.map(function(e){return gn(e,n,t)});if(null!==e&&"object"===ge(e)){var o={};return Object.keys(e).forEach(function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=gn(e[i],n,t)}),o}return e}function yn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return 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 o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}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 l,r=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){a=!0,l=e},f:function(){try{r||null==t.return||t.return()}finally{if(a)throw l}}}}function hn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function bn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function wn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?bn(Object(t),!0).forEach(function(n){z(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):bn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var kn=function(e,n,t,o){var i,r,a,u,m,g=o.res,y=o.sres,h=de(e),b=(null==g?void 0:g.contentType)||"video",w=(null==g||null===(i=g[b])||void 0===i?void 0:i.drmEnabled)||!1,k=(null==g||null===(r=g[b])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,O=(null==g||null===(u=g[b])||void 0===u||null===(m=u.liveDetails)||void 0===m?void 0:m.isDvrEnabled)||!1;s(g),d.set(g),h&&(h.on("loadstart",function(){k?t.resolve({status:!0,msg:"Video Loaded",response:g}):t.resolve(wn({status:!0,msg:"Player Initialised"},y?{seriesResponse:y,response:g}:{response:g}))}),h.on("loadeddata",function(){var t,o,i,r=ie(e);if(null==r||r.map(function(n){return le(e,n.id)}),O&&"Safari"===pe())try{var a;null==h||null===(a=h.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==h||!h.muted())&&ke(e,sessionStorage.getItem("volume")||"100");var u=l();if(c(n),v(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(o=n.watchHistory)&&void 0!==o&&o.saveOffline)){var s,d,p=wn(wn({},n),g);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(sn=null==n||null===(i=n.series)||void 0===i?void 0:i.id),an=[],un=0,Qe=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=de(e);a&&(a.on("dispose",dn),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());an.includes(un)||(e!=un||e<r?e>un&&(un=e+r):(an.push(e),cn(a,n,r)))}}),a.one("ended",function(){cn(a,n,r,!0)}))}(e,p,null==u||null===(s=u.video)||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.id)}if(null!=n&&null!==(i=n.analytics)&&void 0!==i&&i.muxKey&&null!=h&&h.mux){var f,m,y,b,w,k,I=(null===(f=l())||void 0===f?void 0:f.video)||(null==g?void 0:g.video),S=null==I?void 0:I.gist,j={env_key:null==n||null===(m=n.analytics)||void 0===m?void 0:m.muxKey,player_name:"vl-web-player",player_version:null===(y=window)||void 0===y?void 0:y.vl_player_version,video_id:null==S?void 0:S.id,video_title:null==S?void 0:S.title,video_series:null==I||null===(b=I.series)||void 0===b?void 0:b.title,video_stream_type:null!=I&&null!==(w=I.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==n||null===(k=n.analytics)||void 0===k?void 0:k.userId};h.mux({debug:!1,data:j})}}),h.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];h.trigger("subtitlechanged",n)}),h.on("subtitlechanged",function(e,n){var t,o,i,l,r,a,u,s,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,f=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(d=s.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}}),h.tech_.on("retryplaylist",function(){k&&mn(g,e)}),h.on("error",function(){var n,o;(console.log("ERROR",h.error(),h.error().code),4===h.error().code&&k)?mn(g,e):(p(e,(null==h||null===(n=h.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==h||null===(o=h.error())||void 0===o?void 0:o.message)||"Some error occured",response:g}))}),h.one("play",function(){var e,t,o,i,r;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(o=t.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable){var a,u,s,d=null===(a=l())||void 0===a||null===(u=a.video)||void 0===u||null===(s=u.gist)||void 0===s?void 0:s.id,c=f(),v=(null==c?void 0:c.get(d))||{t:0,p:0},p=v.t,m=v.p;p&&m<95&&setTimeout(function(){h.currentTime(p)},0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout(function(){h.currentTime(null==n?void 0:n.watchHistoryResumeTime)},0);if(null!=h&&h.dvrSeekbar)try{h.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),h.on("volumechange",function(){var e=100*h.volume().toFixed(2);h.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),h.on("chromecastDisconnected",function(){if(k){h.currentSource();for(var e=h.textTracks(),n=e.length-1;n>=0;n--)h.removeRemoteTextTrack(e[n])}}),h.one("loadeddata",function(){var e,n=(null==h||null===(e=h.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0}),"object"==ge(h.dash)){var t,o,i,l=null==h||null===(t=h.dash)||void 0===t||null===(o=t.mediaPlayer)||void 0===o?void 0:o.getTracksFor("audio"),r=null==l?void 0:l.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),a=yn(n);try{for(a.s();!(i=a.n()).done;){var u=i.value;if(r&&(null==u?void 0:u.id)=="dash-audio-".concat(r.index)){u.enabled=!0;break}}}catch(e){a.e(e)}finally{a.f()}}else{var s,d=yn(n);try{for(d.s();!(s=d.n()).done;){var c,v,p,f=s.value;if(("Chrome"==pe()||"Edge"==pe()&&(null!==(c=navigator)&&void 0!==c&&null!==(v=c.userAgent)&&void 0!==v&&v.includes("Macintosh")||!w))&&null!=f&&null!==(p=f.label)&&void 0!==p&&p.includes("5.1"))h.audioTracks().removeTrack(f);else{if("main"==f.kind){f.enabled=!0;break}f.enabled=!1}}}catch(e){d.e(e)}finally{d.f()}}}))};function On(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function In(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?On(Object(t),!0).forEach(function(n){z(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):On(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Sn=function(e,n,t,o){var i,l,r,s,d,c,v,f,w,k,O,I,S,j,D,E,T,P,x,C,R,A,N,L,M,_,V,B,U,H,F,K,G,Y,q,Q,$,Z=n.res,ee=void 0===Z?null:Z,ne=n.sres,te=void 0===ne?null:ne,oe=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],ie=(null===(i=ee)||void 0===i?void 0:i.contentType)||"video",le=ce(null===(l=ee)||void 0===l||null===(r=l[ie])||void 0===r||null===(s=r.gist)||void 0===s?void 0:s.videoImageUrl)||ce(null===(d=ee)||void 0===d||null===(c=d[ie])||void 0===c||null===(v=c.gist)||void 0===v||null===(f=v.imageGist)||void 0===f?void 0:f.r16x9),ae=(null===(w=ee)||void 0===w||null===(k=w[ie])||void 0===k||null===(O=k.liveDetails)||void 0===O?void 0:O.isDvrEnabled)||!1,ue=(null===(I=ee)||void 0===I||null===(S=I[ie])||void 0===S||null===(j=S.streamingInfo)||void 0===j?void 0:j.isLiveStream)||!1,se=(null===(D=ee)||void 0===D||null===(E=D.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(P=T.adTags)||void 0===P||null===(x=P.web)||void 0===x?void 0:x.active)&&(null===(C=ee)||void 0===C||null===(R=C.ads)||void 0===R||null===(A=R.preRoll)||void 0===A||null===(N=A.adTags)||void 0===N||null===(L=N.web)||void 0===L?void 0:L.url);ee=In(In({},ee),{},{audioAssetSource:null==t?void 0:t.audioAssetSource});var ve=(null==t||null===(M=t.customData)||void 0===M?void 0:M.ads)||{},fe=(null===(_=ee)||void 0===_||null===(V=_[ie])||void 0===V?void 0:V.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==ve?void 0:ve.vodAdSticherProvider)||!1,me=(null==t?void 0:t.latency)||6,ge=(null==t?void 0:t.skin_settings)||{},ye=(Q={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==ge?void 0:ge.pictureInPictureToggle)||!1},playbackRates:null!=ge&&ge.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==t.skin,liveui:ae},z(Q,"autoplay",null==t?void 0:t.autoplay),z(Q,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!se),z(Q,"loop",(null==t?void 0:t.loop)||!1),z(Q,"audioPosterMode",null==t?void 0:t.audioPosterMode),z(Q,"html5",In(In({dash:In(In(In({},!X.browser.IS_SAFARI&&{useTTML:!0}),(null==t?void 0:t.debugConfig)&&(null==t||null===(B=t.debugConfig)||void 0===B?void 0:B.enable)&&{debug:!0,logLevel:null!=t&&null!==(U=t.debugConfig)&&void 0!==U&&U.logLevel?null==t||null===(H=t.debugConfig)||void 0===H?void 0:H.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:me},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:In({},"IE"==pe()&&{enableStallFix:!0,stallSeek:1}),abr:In(In(In(In({},(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:In(In(In({},(null==t?void 0:t.initialBandwidth)&&{bandwidth:t.initialBandwidth}),{},{liveRangeSafeTimeDelta:me,useDevicePixelRatio:!0,experimentalLLHLS:(null==t?void 0:t.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==t||!t.initialBandwidth},(null==t||null===(F=t.customData)||void 0===F?void 0:F.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(K=null==t?void 0:t.enableLowInitialPlaylist)&&void 0!==K&&K}),debug:(null==t?void 0:t.debugConfig)&&(null==t||null===(G=t.debugConfig)||void 0===G?void 0:G.enable)||!1,nativeTextTracks:"Safari"==pe()},0==(null==t||null===(Y=t.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==t||null===(q=t.customData)||void 0===q?void 0:q.nativeVideoTracks)&&{nativeVideoTracks:!1})),z(Q,"poster",le),z(Q,"techOrder",oe),z(Q,"chromecast",{requestCustomDataFn:function(n){var o,i,l=de(e),r=((null==l?void 0:l.textTracksJson_)||l.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),a=function(e,n,t){var o,i,l,r,a,u,s,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,g,y,h,b,w,k,O;f.isDrmEnabled=!0;var I=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,S=(null==I?void 0:I.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(y=g[0])||void 0===y||null===(h=y.options)||void 0===h?void 0:h.serverURL);f.licenseUrl=S;var j=(null==I?void 0:I.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===(O=k.httpRequestHeaders)||void 0===O?void 0:O["X-AxDRM-Message"]);f.licenseToken=j}var D=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=D;var E=null==e||null===(l=e[p])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;f.duration=E;var T=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;f.mediaTitle=T;var P=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=P,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(ee,n,r);return In(In({},a),{},{convivaMetaData:In({customerKey:(null==t||null===(o=t.convivaConfig)||void 0===o?void 0:o.customerKey)||null,debug:(null==t||null===(i=t.convivaConfig)||void 0===i?void 0:i.debug)||!1},tn.getData())})},modifyLoadRequestFn:function(n){var t,o,i,l,r,a=de(e),u=(null==a?void 0:a.currentSource())||{};!(null===(t=ee)||void 0===t||null===(o=t[ie])||void 0===o||null===(i=o.streamingInfo)||void 0===i||null===(l=i.videoAssets)||void 0===l?void 0:l.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(r=u.src)&&void 0!==r&&r.includes(".m3u8")&&(n.media.hlsSegmentFormat="fmp4",n.media.hlsVideoSegmentFormat="fmp4");return n}}),Q);if(!X.getPlayers()[e]){null!=t&&t.debugConfig&&null!=t&&null!==($=t.debugConfig)&&void 0!==$&&$.enable&&X.log.level("debug");var he=X(e,ye,function(){var n=J(W.mark(function n(){var i,l,r,s,d,c,v,f,w,k,O,I,S,j,D,E,T,P,x,C;return W.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(he),console.log(X.VERSION),console.log(X.getPlugins()),n.next=5,Me(t,ee);case 5:if(I=null===(i=ee)||void 0===i||null===(l=i[ie])||void 0===l||null===(r=l.liveDetails)||void 0===r?void 0:r.startOverTime,ue&&o.resolve(In({status:!0,msg:"Player Initialised"},te?{seriesResponse:te,response:ee}:{response:ee})),g(e,{analyticsCb:null==t?void 0:t.analyticsCb,analyticsEventParams:null==t?void 0:t.analyticsEventParams,userId:null==t?void 0:t.userId}),nn(e,t),/Android/i.test(navigator.userAgent)&&(X.options.vhs.overrideNative=!0),ae&&Se(e,I),!se||null!=t&&null!==(s=t.customData)&&void 0!==s&&s.disableAds||y(e,se,ee),S=a(ee,e),console.log(S),null!=t&&t.nearestClusterUrl&&(S=h(S,t.nearestClusterUrl)),!fe){n.next=19;break}return n.next=18,b(e,ee);case 18:S=n.sent;case 19:S?u(e,S):(o.reject({status:!1,msg:"Incompatible / Missing Source",response:ee}),p(e,"Incompatible / Missing Source")),((null===(d=ee)||void 0===d||null===(c=d[ie])||void 0===c||null===(v=c.contentDetails)||void 0===v||null===(f=v.closedCaptions)||void 0===f?void 0:f.length)>0||(null===(w=ee)||void 0===w||null===(k=w[ie])||void 0===k||null===(O=k.closedCaptions)||void 0===O?void 0:O.length)>0)&&(C=(null===(D=ee)||void 0===D||null===(E=D[ie])||void 0===E||null===(T=E.contentDetails)||void 0===T?void 0:T.closedCaptions)||(null===(P=ee)||void 0===P||null===(x=P[ie])||void 0===x?void 0:x.closedCaptions),j=C.filter(function(e){return"VTT"===e.format}),re(e,j)),null!=t&&t.disableControls?m(e):on(e,In(In(In({},t),ye),{},{liveVideo:ue,isDvrEnabled:ae,res:ee,sres:te})),kn(e,In(In(In({},t),ye),{},{liveVideo:ue}),o,{res:ee,sres:te});case 23:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}};function jn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Dn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?jn(Object(t),!0).forEach(function(n){z(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):jn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var En=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,l=Tn(e);Sn(i,{res:l},e,{resolve:t,reject:o})},Tn=function(e){var n,t,o,i,l,r,a,u,s,d,c,v,p,f=null==e?void 0:e.streamingInfo,m=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,g=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,y=(null==e||null===(o=e.streamingInfo)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.url)||null,h=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,b=(null==e||null===(r=e.streamingInfo)||void 0===r?void 0:r.subtitles)||[],k=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(u=a.videoAssets)||void 0===u?void 0:u.drmProvider)||null,O=(null==e||null===(s=e.streamingInfo)||void 0===s?void 0:s.macroMap)||[],I=(null==e||null===(d=e.customData)||void 0===d||null===(c=d.ads)||void 0===c?void 0:c.isSSAIEnabled)||!1,S=null==e?void 0:e.token,j=w(S);null==j||j.site;var D=null==j?void 0:j.siteId,E=(null==e||null===(v=e.customData)||void 0===v||null===(p=v.comscore)||void 0===p?void 0:p.video)||null,T=Dn(Dn({id:"".concat(D,"_external")},!g&&{directPlaybackUrl:null==m?void 0:m.url}),{},{video:Dn(Dn(Dn(Dn(Dn({drmEnabled:g,streamingInfo:Dn(Dn({videoAssets:Dn(Dn({},k&&{drmProvider:k}),{},{widevine:null==m?void 0:m.widevine,fairPlay:null==m?void 0:m.fairPlay,playReady:null==m?void 0:m.playReady})},(null==f?void 0:f.isDvrEnabled)&&{isLiveStream:!0}),(null==E?void 0:E.isLiveStream)&&{isLiveStream:null==E?void 0:E.isLiveStream})},I&&{isSSAIEnabled:I}),{},{metadata:O,liveDetails:{isDvrEnabled:null==f?void 0:f.isDvrEnabled},gist:Dn(Dn(Dn({},h&&{videoImageUrl:h}),(null==E?void 0:E.videoId)&&{id:null==E?void 0:E.videoId}),(null==E?void 0:E.videoTitle)&&{title:null==E?void 0:E.videoTitle}),contentDetails:Dn({},(null==b?void 0:b.length)>0&&{closedCaptions:ye(b)})},(null==E?void 0:E.runtime)&&{runtime:null==E?void 0:E.runtime}),(null==E?void 0:E.publishDate)&&{publishDate:null==E?void 0:E.publishDate}),(null==E?void 0:E.platform)&&{platform:null==E?void 0:E.platform}),(null==E?void 0:E.series)&&{series:null==E?void 0:E.series}),ads:{preRoll:{adTags:{web:Dn(Dn({},y&&{active:!0}),y&&{url:y})}}}});return E&&(null!=E&&E.isDvrEnabled&&(T.video.liveDetails=Dn(Dn({},T.video.liveDetails),{},{isDvrEnabled:null==E?void 0:E.isDvrEnabled})),null!=E&&E.metadata&&(T.video.metadata=[].concat(ye(T.video.metadata),ye(null==E?void 0:E.metadata)))),T},Pn=function(e,n){(new Date).getMonth(),new Date(n).getMonth(),(new Date).getFullYear(),new Date(n).getFullYear();var t=Math.floor(e/6048e5),o=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)),i=o>0&&t>4?o:0,l=function(e,n){var t=new Date(n).getFullYear()-new Date(e).getFullYear(),o=new Date(n).getMonth()-new Date(e).getMonth();return new Date(n).getDay()-new Date(e).getDay()<0&&(o-=1),o<0&&(t-=1),t}(new Date,new Date(n));return[l>0&&i>0?l:0,i,t,Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]},xn=function(e){var n,t=he(e,8),o=t[0],i=t[1],l=t[2],r=t[3],a=t[4],u=t[5],s=t[6],d=t[7];n=o>=1?" ".concat(o," Year"):i>=1?" ".concat(i," month"):l>=1?" ".concat(l," week"):r>=1?" ".concat(r," day"):a<24&&a>=12?" ".concat(a," hour"):a>0?"".concat(a," hours ").concat(u," minutes ").concat(s," seconds"):u>0?"".concat(u," minutes ").concat(s," seconds"):"".concat(s," seconds"),d.textContent="".concat(n),console.log("Time left:",n)};function Cn(e,n,t,o){if(e){var i=function(){var i=e-Date.now();if(i/1e3<=0)return clearInterval(l),null==n||n([0,0,0,0,0,0,0,o]),void(null==t||t());var r=Pn(i,e);null==n||n([].concat(ye(r),[o]))};i();var l=setInterval(i,1e3);return l}}var Rn,An=function(e,n,t){var o,i,l,r,a,u,s,d,c,v=null==n||null===(o=n.response)||void 0===o||null===(i=o.data)||void 0===i?void 0:i.errorCode,p=(null==n||null===(l=n.response)||void 0===l||null===(r=l.data)||void 0===r?void 0:r.errorMessage)||(null==n?void 0:n.message)||null,f=Date.now(),m=null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.scheduleStartDate,g=f-(null==n||null===(s=n.response)||void 0===s||null===(d=s.data)||void 0===d?void 0:d.scheduleEndDate);if(f-m<0?c=fe("eventNotStarted")||p||"Game starts in":(g>0||"VIDEO_NOT_EXISTS"==v)&&(c=fe("eventEnded")||p||"Game has ended"),document.getElementsByClassName("error-container")[0]){var y=document.getElementsByClassName("error-message")[0];y&&(y.textContent="".concat(c));var h=document.getElementsByClassName("error-timer-message")[0];h&&Cn(Math.abs(m),xn,t,h)}else{var b=document.getElementById(e).parentElement;if(b){var w=document.createElement("div");w.className="error-container";var k=document.createElement("div");k.className="error-message";var O=document.createElement("div");O.className="error-timer-message",k.textContent="".concat(c),w.appendChild(k),w.appendChild(O),b.append(w),Cn(Math.abs(m),xn,t,O)}}};function Nn(e,n){return Ln.apply(this,arguments)}function Ln(){return(Ln=J(W.mark(function e(n,t){var o,i,l,r,a,u,d,c,v;return W.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=t.resolve,r=t.reject,a=null==n?void 0:n.videoId,u=null==n?void 0:n.playerId,d=!(null==n||!n.anonymousId),e.next=6,S();case 6:c=e.sent,v=!1===(null==n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.isSSAIEnabled),k(a,c,v).then(function(e){var t,o,i,v;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,s(null==e?void 0:e.data);var p,f=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(v=n.watchHistory)&&void 0!==v&&v.enable&&!d)if((null===(p=n.watchHistory)||void 0===p?void 0:p.saveOffline)||!1){var m,g,y,h=pn((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",a,null==n?void 0:n.siteOwner);if(h&&h.length)n.watchHistoryResumeTime=(null===(g=h[0])||void 0===g?void 0:g.watchedTime)||null,n.watchedPercentage=(null===(y=h[0])||void 0===y?void 0:y.watchedPercentage)||null;f.contentType="video",Sn(u,{res:f},n,{resolve:l,reject:r})}else O(a,c).then(function(e){var t,o,i,l,r,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(l=i.watchHistory)||void 0===l||l.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,f.contentType="video"}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}).finally(function(){Sn(u,{res:f},n,{resolve:l,reject:r})});else Sn(u,{res:f},n,{resolve:l,reject:r})}).catch(function(e){var t,o,i=(null==n||null===(t=n.event)||void 0===t?void 0:t.showScheduleTimer)||!1,l=(null==n||null===(o=n.event)||void 0===o?void 0:o.onCountdownComplete)||null;i&&An(u,e,l),I(e,u,r,a)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Mn(e,n){return _n.apply(this,arguments)}function _n(){return(_n=J(W.mark(function e(n,t){var o,i,l,r,a,u,s,d;return W.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=t.resolve,r=t.reject,e.next=3,S();case 3:a=e.sent,u=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,d=!1===(null==n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.isSSAIEnabled),j(s,a,d).then(function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,Sn(u,{res:t},n,{resolve:l,reject:r})}).catch(function(e){I(e,u,r,videoId)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Vn(e,n){return Bn.apply(this,arguments)}function Bn(){return(Bn=J(W.mark(function e(n,t){var o,i,l,r,a,u,d;return W.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,l=t.reject,e.next=3,S();case 3:r=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,T.set(parseInt(u)),d=null==n||null===(o=n.series)||void 0===o?void 0:o.id,D(d,r).then(function(e){var t,o,u,c=e.data,v=e.data.seasons;P(v);var p=videoId||(null==v||null===(t=v[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(u=o[0])||void 0===u?void 0:u.id);E(d,r),k(p,r).then(function(e){var t,o,r;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType,s(e.data),Sn(a,{res:null==e?void 0:e.data,sres:c},n,{resolve:i,reject:l})}).catch(function(e){I(e,a,l,videoId)})}).catch(function(e){I(e,a,l)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Un(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Hn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Un(Object(t),!0).forEach(function(n){z(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Un(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Fn(){return{loadVideoInstantly:x,onTimeUpdate:Q,getVideoDuration:$,onVideoEnded:Z,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=J(W.mark(function n(t,o){var i,l,r,a,u,s,d,c,v,p,f,m,g,y,h,b,w,O,S,j,D,E,T,P,x,C;return W.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!L(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(y=(null==e?void 0:e.videoSourceUrl)||!1,h=null==e?void 0:e.asat,b=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,w=null==e?void 0:e.videoId,O=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,S=(null==e?void 0:e.streamingInfo)||!1,window.videoId=w,j=null==e?void 0:e.token,!K(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",j),G().set(null==e?void 0:e.refreshToken),j&&!Y(j)){n.next=16;break}return o({status:!1,msg:"".concat(j?"Token is expired !":"Missing Authorization Token"),response:{token:j}}),n.abrupt("return");case 16:Rn=JSON.parse(atob(j.split(".")[1]));case 17:return window.siteName=null===(r=Rn)||void 0===r?void 0:r.site,window.siteId=null===(a=Rn)||void 0===a?void 0:a.siteId,e.isAnonymousUser=!(null===(u=Rn)||void 0===u||!u.anonymousId),e.siteOwner=(null===(s=Rn)||void 0===s?void 0:s.site)||null,e.userId=(null===(d=Rn)||void 0===d?void 0:d.userId)||null,H((null===(c=Rn)||void 0===c?void 0:c.userId)||(null===(v=Rn)||void 0===v?void 0:v.anonymousId)||null),window.watchHistory=e.watchHistory||null,D=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(p=e.series)&&void 0!==p&&p.enable?null:null==e?void 0:e.chromecastReceiverId,E=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,(T=null==e?void 0:e.errors)&&(window.customErrors=T),window.customData=null==e?void 0:e.customData,me(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),F.set(e.apiBaseUrl),null!=e&&e.skin&&!ve(e.skin)||(e.skin="VL_ONE"),n.next=35,Re(e);case 35:E&&be("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then(function(){return q(E)}).catch(function(e){}),(P=null===(g=document)||void 0===g?void 0:g.getElementById("".concat(D)))&&P.addEventListener("contextmenu",function(e){return e.preventDefault()}),y?(C={directPlaybackUrl:y,id:x="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},h?k(x,j).then(function(n){var i=(null==n?void 0:n.data)||{};Sn(D,{res:Hn(Hn({},i),C)},e,{resolve:t,reject:o})}).catch(function(e){I(e,D,o,x)}):Sn(D,{res:C},e,{resolve:t,reject:o})):S?En(e,{resolve:t,reject:o}):O?Vn(e,{resolve:t,reject:o}):b?Mn(e,{resolve:t,reject:o}):Nn(e,{resolve:t,reject:o});case 39:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:ue,skip:C,getPlayer:de,play:R,pause:A,detectBrowser:pe,rewind:N,loadVideo:u,seekToTimeStamp:ee,isPlayerInitialised:L,load:M,authenticateLC:_,dispose:V,enableCaptions:ae,disableCaptions:le,getCaptions:ie,playSelectedResolution:se,getSource:a,setVolume:ke,getVolume:Oe,disableControls:m,setPlaybackSpeed:ne,getEntitlementData:B,getSsaiEvents:U,playerEvents:te,onReplay:oe}}export{Fn as default};