@viewlift/player-backup 1.0.97-backup → 1.0.99-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 (56) hide show
  1. package/cjs/{autoNextVideo-6c2cc63d.js → autoNextVideo-731fc1fc.js} +1 -1
  2. package/cjs/bundle.css +33 -1
  3. package/cjs/{caption-settings-9975aa4f.js → caption-settings-228fb391.js} +1 -1
  4. package/cjs/{features-6c341397.js → features-b6adcbb7.js} +1 -1
  5. package/cjs/generic-77cbda56.js +1 -0
  6. package/cjs/index.js +1 -1
  7. package/cjs/{keyboardShortcuts-3ac9a37b.js → keyboardShortcuts-68f50a7b.js} +1 -1
  8. package/cjs/{multicam-3e202f2a.js → multicam-8db80bb4.js} +1 -1
  9. package/cjs/{multicamv2-b0d86b34.js → multicamv2-97272ade.js} +1 -1
  10. package/cjs/{mwebPotraitTray-53743e17.js → mwebPotraitTray-0585b077.js} +1 -1
  11. package/cjs/{nextEpisodeButton-baa5c48d.js → nextEpisodeButton-9a867b2d.js} +1 -1
  12. package/cjs/{playlist-a877f18d.js → playlist-7a3723b0.js} +1 -1
  13. package/cjs/{renditions-fbaf9ed4.js → renditions-0c58cc3d.js} +1 -1
  14. package/cjs/{resolution-0e52631e.js → resolution-816e03de.js} +1 -1
  15. package/cjs/{series-849c5c04.js → series-66cf6a00.js} +1 -1
  16. package/cjs/series-v2-acaae556.js +1 -0
  17. package/cjs/{settings-icon-7f2ca371.js → settings-icon-5257d3dc.js} +1 -1
  18. package/cjs/{skin-0d151e90.js → skin-0c8cce11.js} +1 -1
  19. package/cjs/{skin-550cf84f.js → skin-1fe41038.js} +1 -1
  20. package/cjs/{skin-e1671a81.js → skin-3740d1ef.js} +1 -1
  21. package/cjs/skin-386e995b.js +1 -0
  22. package/cjs/{skin-6350f905.js → skin-db967a8f.js} +1 -1
  23. package/cjs/{skin-4c85165c.js → skin-e7ad0365.js} +1 -1
  24. package/cjs/{util-462eea7f.js → util-1f90e4a3.js} +1 -1
  25. package/cjs/{videoSelector-a1bfbb8a.js → videoSelector-23b9e00e.js} +1 -1
  26. package/esm/{autoNextVideo-f070f6bd.js → autoNextVideo-ba5ab337.js} +1 -1
  27. package/esm/bundle.css +33 -1
  28. package/esm/{caption-settings-a2feea30.js → caption-settings-0d1646dc.js} +1 -1
  29. package/esm/{features-e13a7a55.js → features-077306aa.js} +1 -1
  30. package/esm/generic-fa98f0cf.js +1 -0
  31. package/esm/index.js +1 -1
  32. package/esm/{keyboardShortcuts-30b74bad.js → keyboardShortcuts-05852259.js} +1 -1
  33. package/esm/{multicam-6ddc9f8e.js → multicam-4aa3b524.js} +1 -1
  34. package/esm/{multicamv2-dc13e606.js → multicamv2-0a0bd570.js} +1 -1
  35. package/esm/{mwebPotraitTray-42c0ac47.js → mwebPotraitTray-996f3b57.js} +1 -1
  36. package/esm/{nextEpisodeButton-87a189d1.js → nextEpisodeButton-a9fa2ed8.js} +1 -1
  37. package/esm/{playlist-1a60af58.js → playlist-6d69772d.js} +1 -1
  38. package/esm/{renditions-e3fe9bf6.js → renditions-ebec6a8e.js} +1 -1
  39. package/esm/{resolution-596d214c.js → resolution-d5382170.js} +1 -1
  40. package/esm/{series-e6bc255c.js → series-34e9687a.js} +1 -1
  41. package/esm/{series-v2-a8841193.js → series-v2-6ab0649f.js} +1 -1
  42. package/esm/{settings-icon-31693384.js → settings-icon-f1b36d3e.js} +1 -1
  43. package/esm/{skin-80dfe0b7.js → skin-1353ed4d.js} +1 -1
  44. package/esm/{skin-01839bbf.js → skin-26f13cdd.js} +1 -1
  45. package/esm/{skin-8a01ff24.js → skin-382addb2.js} +1 -1
  46. package/esm/skin-ce6ea8d3.js +1 -0
  47. package/esm/{skin-17aa9c7f.js → skin-f46d9762.js} +1 -1
  48. package/esm/{skin-fc2c2b9a.js → skin-f4ab493c.js} +1 -1
  49. package/esm/{util-536c46af.js → util-c301d76a.js} +1 -1
  50. package/esm/{videoSelector-cf1e1fef.js → videoSelector-ceaa49d3.js} +1 -1
  51. package/package.json +1 -1
  52. package/cjs/generic-513fe379.js +0 -1
  53. package/cjs/series-v2-8eb5a774.js +0 -1
  54. package/cjs/skin-2fdf2de5.js +0 -1
  55. package/esm/generic-735b9e62.js +0 -1
  56. package/esm/skin-a0ca0063.js +0 -1
@@ -0,0 +1 @@
1
+ import{i as e,j as t,k as n,g as l,h as o,d as r,l as i,m as a,n as s,o as u}from"./features-077306aa.js";import{M as c,a as d,c as m,d as v}from"./icons-3e9a1686.js";import{R as p,b as f,S as h,y as g,Q as y,d as x}from"./generic-fa98f0cf.js";import{g as w}from"./renditions-ebec6a8e.js";import b from"@babel/runtime/helpers/toConsumableArray";import{s as C}from"./autoNextVideo-ba5ab337.js";import E from"@babel/runtime/helpers/typeof";import j from"video.js";import N from"@babel/runtime/helpers/asyncToGenerator";import k from"@babel/runtime/regenerator";import B from"@babel/runtime/helpers/slicedToArray";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./localisation-0bf399a1.js";import"axios";import"js-cookie";import"ua-parser-js";import"./util-c301d76a.js";var T=p(),I=[];null==T||T.map((function(e){return I.push.apply(I,b(e.episodes))}));var L,O,M,V,R=function(e,t){var n=f(e),l=Math.floor(n.currentTime());if(Math.floor(n.duration())!=l){n.pause(e);var o=h();C(o,e,I)}};function P(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),l={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(l.resolution=e.split("=")[1]),e.includes("URI")&&(l.uri=e.split("=")[1].replace(/"/g,""))})),n.push(l)}})),n}function X(e){return S.apply(this,arguments)}function S(){return(S=N(k.mark((function e(t){return k.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var l=[],o=t.layout.split("x"),r=B(o,2),i=r[0],a=r[1];n.onload=function(){var o=document.createElement("canvas");o.width=n.width,o.height=n.height,o.getContext("2d").drawImage(n,0,0,o.width,o.height);for(var r=o.width/a,s=o.height/i,u=0;u<i;u++)for(var c=0;c<a;c++){var d=document.createElement("canvas");d.width=r,d.height=s,d.getContext("2d").drawImage(o,c*r,u*s,r,s,0,0,r,s);var m=d.toDataURL("image/png");l.push({uri:m,duration:t.duration})}e(l)}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function A(e){return F.apply(this,arguments)}function F(){return(F=N(k.mark((function e(t){var n,l;return k.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return l=e.sent,e.abrupt("return",P(l));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function U(e){return D.apply(this,arguments)}function D(){return(D=N(k.mark((function e(t){var n,l;return k.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return X(e)})));case 2:return n=e.sent.flat(),l={},n.map((function(e,t){var n=e.duration;l[n*t]={src:e.uri,style:{left:"-60px",height:"68px",width:"120px"}}})),e.abrupt("return",l);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}L={0:{src:"example-thumbnail.png"}},O=function e(){var t,n,l,o,r;for(l in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(r in o=t[l])o.hasOwnProperty(r)&&("object"===E(o[r])?n[r]=e(n[r],o[r]):n[r]=o[r]);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},j.plugin("thumbnails",(function(e){var t,n,l,o,r,i,a,s;n=O({},L,e),o=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=o.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",l=document.createElement("img"),t.appendChild(l),l.src=n[0].src,l.className="vjs-thumbnail",O(l.style,n[0].style),l.style.left||l.style.right||(l.onload=function(){l.style.left=-l.naturalWidth/2+"px"}),i=o.duration(),o.on("durationchange",(function(e){i=o.duration()})),o.on("loadedmetadata",(function(e){i=o.duration()})),(r=o.controlBar.progressControl).el().appendChild(t),a=function(e){var o,a,s,u,c,d,m,v,p,f;for(a in s=0,p=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,m=((f=V(r.el()).getBoundingClientRect()).width||f.right)+p,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),u=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,u-=V(r.el()).getBoundingClientRect().left+p,o=Math.floor((u-r.el().offsetLeft)/r.width()*i),n)o>a&&(s=Math.max(s,a));(c=n[s]).src&&l.src!=c.src&&(l.src=c.src),c.style&&l.style!=c.style&&O(l.style,c.style),u+(v=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}(l,c.width||n[0].width)/2)>m?u-=u+v-m:u<v&&(u=v),t.style.left=u+"px"},r.on("mousemove",a),r.on("touchmove",a),s=function(e){t.style.left="-1000px"},r.on("mouseout",s),r.on("touchcancel",s),r.on("touchend",s),o.on("userinactive",s)}));var G=function(){var e=N(k.mark((function e(t,n){var l,o,r,i;return k.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return l=e.sent,e.next=5,l.text();case 5:return o=e.sent,r=o.split("\n"),i=[],r.forEach((function(e,n){e=e.trim();var l={resolution:null,duration:null,uri:null,layout:null};n>0&&r[n-1].includes("#EXT-X-TILES")&&(r[n-1]=r[n-1].split(","),l.uri=t+e,r[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=B(t,2),o=n[0],r=n[1];o=o.toLowerCase(),l[o]=r}))})),i.push(l))})),e.abrupt("return",i);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function W(){return(W=N(k.mark((function e(t){var n,l,o,r,i,a,s,u,c;return k.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=f(t),l=n.currentSource(),o=l.src,e.next=4,A(o);case 4:if(!((null==(r=e.sent)?void 0:r.length)>0)){e.next=15;break}return i=(null==r?void 0:r[0])||null,a=i.uri,s=n.tech().vhs.playlists.master.uri.substring(0,n.tech().vhs.playlists.master.uri.lastIndexOf("/"))+"/",e.next=10,G(s,a);case 10:return u=e.sent,e.next=13,U(u);case 13:c=e.sent,n.thumbnails(c);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(l,o){var r=f(l);r&&(r.on("loadeddata",(function(){var n,i,a;(null===(n=w(l))||void 0===n?void 0:n.length)>0&&e(l,o),(null===(i=g(l))||void 0===i?void 0:i.length)>0&&t(l,o),null!=o&&null!==(a=o.series)&&void 0!==a&&a.enable&&function(e,t){var n;null==t||null===(n=t.series)||void 0===n||n.cb;var l=f(e);l.on("timeupdate",(function(){var e,t=Math.floor(l.currentTime()),n=l.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];n-t<=10&&h()<=(null==I?void 0:I.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var o,r=I.filter((function(e,t){return t==h()}));if((null==r?void 0:r.length)>0)if(null!==(o=document.getElementsByClassName("next-ep-preview"))&&void 0!==o&&o[0]){var i,a,s,u,c,d,m,v,p,g,y;(null===(i=document.getElementsByClassName("next-ep-preview"))||void 0===i?void 0:i[0]).style.visibility="hidden";var x=null===(a=document.getElementsByClassName("next-ep-title"))||void 0===a?void 0:a[0],w=null===(s=document.getElementsByClassName("next-ep-img"))||void 0===s?void 0:s[0],b=null===(u=document.getElementsByClassName("next-ep-content"))||void 0===u?void 0:u[0],C=null===(c=r[0])||void 0===c?void 0:c.title;(null===(d=C)||void 0===d?void 0:d.length)>60&&(C=C.substr(0,60)+"..."),x.textContent="".concat(C),w.src=(null===(m=r[0])||void 0===m||null===(v=m.gist)||void 0===v||null===(p=v.imageGist)||void 0===p?void 0:p.r16x9)||(null===(g=window)||void 0===g||null===(y=g.customData)||void 0===y?void 0:y.fallbackImage),b.onclick=function(){return R(e)}}else{var E,j,N,k,B,T,L,O=document.createElement("div");O.className="next-ep-preview",O.style.visibility="hidden",document.getElementById(e).append(O);var M=document.createElement("div");M.className="next-ep-header",M.textContent="Next up";var V=null===(E=r[0])||void 0===E?void 0:E.title,P=document.createElement("img");P.className="next-ep-img",P.src=(null===(j=r[0])||void 0===j||null===(N=j.gist)||void 0===N||null===(k=N.imageGist)||void 0===k?void 0:k.r16x9)||(null===(B=window)||void 0===B||null===(T=B.customData)||void 0===T?void 0:T.fallbackImage);var X=document.createElement("div");X.className="next-ep-title",(null===(L=V)||void 0===L?void 0:L.length)>60&&(V=V.substr(0,60)+"..."),X.textContent="".concat(V);var S=document.createElement("div");S.className="next-ep-content",S.append(P),S.append(X),S.onclick=function(){return R(e)},O.append(M),O.append(S)}}(l,o),function(e,t){var n,l=Math.floor(e/60),o=null===(n=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===n?void 0:n[0];o&&(o.style.marginRight=l>60?"56px":"41px");var r=document.getElementsByClassName("vjs-live-control")[0],i=document.getElementsByClassName("vjs-time-control");t&&r.classList.value.includes("vjs-hidden")&&(i[0].style.display="block",o&&(o.style.marginRight="56px"))}(r.duration(),(null==o?void 0:o.liveVideo)||!1),null!=o&&o.liveVideo||function(e){W.apply(this,arguments)}(l)})),r.one("play",(function(){var e,t,o,r;null!==(e=window)&&void 0!==e&&null!==(t=e.customData)&&void 0!==t&&t.iframeOverlayUrl&&n(l,null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r?void 0:r.iframeOverlayUrl)})))}function z(e,t){!function(){"Chrome"==x()&&import("./chromett-a3cbb2e1.js").then((function(e){var t=document.createElement("style");t.id="chromett",t.append("".concat(e.default)),document.head.appendChild(t)}));import("./skin-808893ac.js").then((function(e){var t=document.createElement("style");t.id="default_v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}(),_(e,t),function(e,t){var n,l,o,r,i,a,s=f(e);null==s||null===(n=s.controlBar)||void 0===n||null===(l=n.getChild("FullscreenToggle"))||void 0===l||null===(o=l.el())||void 0===o||o.appendChild(y(c(window.controlsColor))),null==s||null===(r=s.controlBar)||void 0===r||null===(i=r.getChild("FullscreenToggle"))||void 0===i||null===(a=i.el())||void 0===a||a.appendChild(y(d(window.controlsColor)));var u=document.getElementsByClassName("vjs-time-control");t.liveVideo&&u[0]&&(u[0].style.display="none")}(e,t),function(e,t){var n,c,d,p,f,h;0==(null==t?void 0:t.liveVideo)&&0==(null==t?void 0:t.liveui)&&l(e,"defaultV2",m());(0==(null==t?void 0:t.liveVideo)&&0==(null==t?void 0:t.liveui)||1==(null==t?void 0:t.liveui))&&o(e,"defaultV2",v());t.liveVideo||r(e);(null==t||null===(n=t.relatedVideos)||void 0===n||null===(c=n.content)||void 0===c?void 0:c.length)>0&&i(e,null==t?void 0:t.relatedVideos);(null==t||null===(d=t.streams)||void 0===d?void 0:d.length)>1&&a(e,null==t?void 0:t.streams);(null==t||null===(p=t.playlist)||void 0===p||null===(f=p.content)||void 0===f?void 0:f.length)>0&&s(e,null==t?void 0:t.playlist);null!=t&&null!==(h=t.series)&&void 0!==h&&h.enable&&u(e,t)}(e,t),function(e,t){var n=f(e),l=null==t?void 0:t.tvProviderLogoUrl;if(!l)return;var o=document.createElement("div");o.className="tvProviderImage";var r=document.createElement("img");r.src="".concat(l),r.alt="Provider Image",o.append(r),n.el().appendChild(o),n.on("useractive",(function(){o.classList.remove("vjs-fade")})),n.on("userinactive",(function(){n.paused()||o.classList.add("vjs-fade")})),n.on("fullscreenchange",(function(){n.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}(e,t)}export{z as initialiseSkin};
@@ -1 +1 @@
1
- import{b as e,p as r,o as t}from"./generic-735b9e62.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"video.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function o(e){i(e),n(e)}var n=function(o){var n=e(o),i=document.getElementById("".concat(o));i&&i.addEventListener("touchstart",(function(){n.paused()?r(o):t(o)}))},i=function(r){var t=e(r);t.requestFullscreen=function(){},t.controlBar.hide()};export{o as initaliseSkin};
1
+ import{b as e,p as r,o as t}from"./generic-fa98f0cf.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"video.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function o(e){i(e),n(e)}var n=function(o){var n=e(o),i=document.getElementById("".concat(o));i&&i.addEventListener("touchstart",(function(){n.paused()?r(o):t(o)}))},i=function(r){var t=e(r);t.requestFullscreen=function(){},t.controlBar.hide()};export{o as initaliseSkin};
@@ -1 +1 @@
1
- import{b as e,e as t,f as o,g as s,h as n}from"./features-e13a7a55.js";import{i}from"./keyboardShortcuts-30b74bad.js";import{S as r,M as l,a,N as d,b as m,R as u}from"./icons-3e9a1686.js";import{b as p,a as c,Q as b}from"./generic-735b9e62.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./renditions-e3fe9bf6.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function v(v,h){i(v,h),import("./skin-cd537931.js").then((function(e){var t=document.createElement("style");t.id="def_skin",t.append("".concat(e.default)),document.head.appendChild(t)})),function(e,t){0==t.liveVideo&&0==t.liveui&&s(e,"default",m());(0==t.liveVideo&&0==t.liveui||1==t.liveui)&&n(e,"default",u())}(v,h),function(s,n){var i=p(s),l=(null==n?void 0:n.sres)||null;i.on("loadeddata",(function(){e(s,"default",r()),l&&import("./nextEpisodeButton-87a189d1.js").then((function(e){e.initaliseFunctionality(n.sres.seasons,c())}))})),i.one("loadedmetadata",(function(){var e;l&&(t(s,null==n||null===(e=n.sres)||void 0===e?void 0:e.seasons,n),o(n.sres,n.res,s))}))}(v,h),function(e,t){var o,s,n,i,r=p(e),m=document.getElementsByClassName("vjs-current-time")[0],u=document.getElementsByClassName("vjs-duration")[0],c=document.getElementsByClassName("vjs-time-divider")[0];t.liveVideo&&(m&&(m.style.display="none"),u&&(u.style.display="none"),c&&(c.style.display="none"));null===(o=r.controlBar.getChild("FullscreenToggle"))||void 0===o||null===(s=o.el())||void 0===s||s.appendChild(b(l(window.controlsColor))),null===(n=r.controlBar.getChild("FullscreenToggle"))||void 0===n||null===(i=n.el())||void 0===i||i.appendChild(b(a(window.controlsColor)));var v=r.controlBar.getChild("SubsCapsButton").el();document.getElementById(e).getElementsByClassName("vjs-subs-caps-button")[1].appendChild(b(d()));var h=document.createElement("div");h.classList.add("caption-header"),v.querySelector(".vjs-menu-content").insertBefore(h,v.querySelector(".vjs-menu-item"))}(v,h)}export{v as initialiseSkin};
1
+ import{b as e,e as t,f as o,g as s,h as n}from"./features-077306aa.js";import{i}from"./keyboardShortcuts-05852259.js";import{S as r,M as l,a,N as d,b as m,R as u}from"./icons-3e9a1686.js";import{b as p,a as c,Q as b}from"./generic-fa98f0cf.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./renditions-ebec6a8e.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function v(v,h){i(v,h),import("./skin-cd537931.js").then((function(e){var t=document.createElement("style");t.id="def_skin",t.append("".concat(e.default)),document.head.appendChild(t)})),function(e,t){0==t.liveVideo&&0==t.liveui&&s(e,"default",m());(0==t.liveVideo&&0==t.liveui||1==t.liveui)&&n(e,"default",u())}(v,h),function(s,n){var i=p(s),l=(null==n?void 0:n.sres)||null;i.on("loadeddata",(function(){e(s,"default",r()),l&&import("./nextEpisodeButton-a9fa2ed8.js").then((function(e){e.initaliseFunctionality(n.sres.seasons,c())}))})),i.one("loadedmetadata",(function(){var e;l&&(t(s,null==n||null===(e=n.sres)||void 0===e?void 0:e.seasons,n),o(n.sres,n.res,s))}))}(v,h),function(e,t){var o,s,n,i,r=p(e),m=document.getElementsByClassName("vjs-current-time")[0],u=document.getElementsByClassName("vjs-duration")[0],c=document.getElementsByClassName("vjs-time-divider")[0];t.liveVideo&&(m&&(m.style.display="none"),u&&(u.style.display="none"),c&&(c.style.display="none"));null===(o=r.controlBar.getChild("FullscreenToggle"))||void 0===o||null===(s=o.el())||void 0===s||s.appendChild(b(l(window.controlsColor))),null===(n=r.controlBar.getChild("FullscreenToggle"))||void 0===n||null===(i=n.el())||void 0===i||i.appendChild(b(a(window.controlsColor)));var v=r.controlBar.getChild("SubsCapsButton").el();document.getElementById(e).getElementsByClassName("vjs-subs-caps-button")[1].appendChild(b(d()));var h=document.createElement("div");h.classList.add("caption-header"),v.querySelector(".vjs-menu-content").insertBefore(h,v.querySelector(".vjs-menu-item"))}(v,h)}export{v as initialiseSkin};
@@ -1 +1 @@
1
- import{b as t}from"./generic-735b9e62.js";var n=function(n,a,r){var e=t(n);e?a>=0&&a<=e.duration()?(r({status:!0,msg:"Successfully seeked to timestamp : ".concat(a)}),e.currentTime(a)):r({status:!1,msg:"Out of bounds, please provide a valid timestamp"}):r("Cannot find player with id: '".concat(n,"'"))},a=function(n,a){var r=t(n);if(!r)return"Cannot find player with id: '".concat(n,"'");try{return r.playbackRate(a),"Playback speed set to ".concat(a,"x")}catch(t){return"Error: ".concat(t)}},r=function(n,a){var r=t(n);r?r.on("timeupdate",(function(){return a(r.currentTime())})):a("Cannot find player with id: '".concat(n,"'"))},e=function(n,a){var r=t(n);r?r.on("ended",(function(){return a(!0)})):a("Cannot find player with id: '".concat(n,"'"))},i=function(n){var a=t(n);return a?a.duration():"Cannot find player with id: '".concat(n,"'")};export{e as a,a as b,i as g,r as o,n as s};
1
+ import{b as t}from"./generic-fa98f0cf.js";var n=function(n,a,r){var e=t(n);e?a>=0&&a<=e.duration()?(r({status:!0,msg:"Successfully seeked to timestamp : ".concat(a)}),e.currentTime(a)):r({status:!1,msg:"Out of bounds, please provide a valid timestamp"}):r("Cannot find player with id: '".concat(n,"'"))},a=function(n,a){var r=t(n);if(!r)return"Cannot find player with id: '".concat(n,"'");try{return r.playbackRate(a),"Playback speed set to ".concat(a,"x")}catch(t){return"Error: ".concat(t)}},r=function(n,a){var r=t(n);r?r.on("timeupdate",(function(){return a(r.currentTime())})):a("Cannot find player with id: '".concat(n,"'"))},e=function(n,a){var r=t(n);r?r.on("ended",(function(){return a(!0)})):a("Cannot find player with id: '".concat(n,"'"))},i=function(n){var a=t(n);return a?a.duration():"Cannot find player with id: '".concat(n,"'")};export{e as a,a as b,i as g,r as o,n as s};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/inherits";import n from"@babel/runtime/helpers/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";import a from"video.js";import{E as r,e as l}from"./icons-3e9a1686.js";import{Y as s,Z as d,_ as c,$ as m,T as u,t as p,V as v}from"./generic-735b9e62.js";import{a as h}from"./autoNextVideo-f070f6bd.js";import{g as f}from"./localisation-0bf399a1.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"./util-536c46af.js";function b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(b=function(){return!!e})()}var y=a.getComponent("Component"),g=function(){o(E,y);var g,C,N=(g=E,C=b(),function(){var e,t=i(g);if(C){var o=i(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return n(this,e)});function E(t){var o,n,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,E),(i=N.call(this,t,a)).playerId=a.playerId,i.seriesData=a.sres,i.videos=a.related.content,i.cb=(null==a||null===(o=a.related)||void 0===o?void 0:o.cb)||null,i.autoNext=(null==a||null===(n=a.related)||void 0===n?void 0:n.autoNext)||!1,i.currentVideoData=a.res,i.initialiseStructure(),i.loadCSS(),i.autoNext&&(v(0),h({playerId:i.playerId,content:i.videos,cb:i.cb})),i}return t(E,[{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"video-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("div",{className:"video-selector-icon",innerHTML:"".concat(r())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./videoSelector-8e258d45.js").then((function(e){var t=document.createElement("style");t.id="video-selection",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),o=a.dom.createEl("div",{className:"video-selection-container hidden"});a.dom.$(".video-selector-icon",this.el()).onclick=function(){var n;null!==(n=o.classList)&&void 0!==n&&n.contains("hidden")?(s(),o.classList.remove("hidden"),t.classList.add("open"),o.style.right="0px",d(e.playerId,o)):(o.classList.add("hidden"),t.classList.remove("open"),o.style.right="-350px")};var n=document.getElementById(this.playerId);if(n){var i=window.getComputedStyle(n,null).getPropertyValue("height");o.style.height="".concat(i),a.dom.appendContent(t,o),n.style.overflow="hidden",this.addFunctionality(o),c(this.playerId,o)}}},{key:"toggleOpenClose",value:function(){}},{key:"addFunctionality",value:function(e){var t=this,o=this.el(),n=a.dom.createEl("div",{className:"video-selector-head"}),i=a.dom.createEl("div",{className:"video-selector-cross-icon",innerHTML:"".concat(l())});i.onclick=function(){e.classList.add("hidden"),o.classList.remove("open"),e.style.right="-350px"};for(var r=a.dom.createEl("div",{className:"video-selector-title",innerHTML:f("relatedVideoTitle")||"Recommended"}),s=a.dom.createEl("div",{className:"video-selector-content"}),d=a.dom.createEl("div",{className:"video-container"}),c=function(e){var o,n,i,r,l,c=a.dom.createEl("div",{className:"video -".concat(e)}),m=a.dom.createEl("div",{className:"recommended -".concat(e)});m.setAttribute("video-idx",e),m.onclick=function(){v(e+1);for(var o=a.dom.$$(".recommended"),n=0;n<o.length;n++)o[n].style.border="none";u(e),p(t.playerId,t.videos[e].id).then((function(e){t.cb&&t.cb(e)})).catch((function(e){t.cb&&t.cb(e)}))};var h=document.createElement("img");h.className="related-thumbnail-image",h.src="".concat((null==t||null===(o=t.videos)||void 0===o||null===(n=o[e])||void 0===n?void 0:n.img)||(null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r?void 0:r.fallbackImage)),h.alt="No Thumbnail Available",m.append(h);var f=a.dom.createEl("div",{className:"info -".concat(e),innerHTML:"".concat((null==t||null===(l=t.videos[e])||void 0===l?void 0:l.title)||"")});a.dom.appendContent(c,m),a.dom.appendContent(c,f),a.dom.appendContent(d,c),a.dom.appendContent(s,d)},h=0;h<this.videos.length;h++)c(h);a.dom.appendContent(n,i),a.dom.appendContent(n,r),a.dom.appendContent(e,n),a.dom.appendContent(e,s),m(this.playerId,e)}}]),E}();export{g as default};
1
+ import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/inherits";import n from"@babel/runtime/helpers/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";import a from"video.js";import{E as r,e as l}from"./icons-3e9a1686.js";import{Y as s,Z as d,_ as c,$ as m,T as u,t as p,V as v}from"./generic-fa98f0cf.js";import{a as h}from"./autoNextVideo-ba5ab337.js";import{g as f}from"./localisation-0bf399a1.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"./util-c301d76a.js";function b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(b=function(){return!!e})()}var y=a.getComponent("Component"),g=function(){o(E,y);var g,C,N=(g=E,C=b(),function(){var e,t=i(g);if(C){var o=i(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return n(this,e)});function E(t){var o,n,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,E),(i=N.call(this,t,a)).playerId=a.playerId,i.seriesData=a.sres,i.videos=a.related.content,i.cb=(null==a||null===(o=a.related)||void 0===o?void 0:o.cb)||null,i.autoNext=(null==a||null===(n=a.related)||void 0===n?void 0:n.autoNext)||!1,i.currentVideoData=a.res,i.initialiseStructure(),i.loadCSS(),i.autoNext&&(v(0),h({playerId:i.playerId,content:i.videos,cb:i.cb})),i}return t(E,[{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"video-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("div",{className:"video-selector-icon",innerHTML:"".concat(r())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./videoSelector-8e258d45.js").then((function(e){var t=document.createElement("style");t.id="video-selection",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),o=a.dom.createEl("div",{className:"video-selection-container hidden"});a.dom.$(".video-selector-icon",this.el()).onclick=function(){var n;null!==(n=o.classList)&&void 0!==n&&n.contains("hidden")?(s(),o.classList.remove("hidden"),t.classList.add("open"),o.style.right="0px",d(e.playerId,o)):(o.classList.add("hidden"),t.classList.remove("open"),o.style.right="-350px")};var n=document.getElementById(this.playerId);if(n){var i=window.getComputedStyle(n,null).getPropertyValue("height");o.style.height="".concat(i),a.dom.appendContent(t,o),n.style.overflow="hidden",this.addFunctionality(o),c(this.playerId,o)}}},{key:"toggleOpenClose",value:function(){}},{key:"addFunctionality",value:function(e){var t=this,o=this.el(),n=a.dom.createEl("div",{className:"video-selector-head"}),i=a.dom.createEl("div",{className:"video-selector-cross-icon",innerHTML:"".concat(l())});i.onclick=function(){e.classList.add("hidden"),o.classList.remove("open"),e.style.right="-350px"};for(var r=a.dom.createEl("div",{className:"video-selector-title",innerHTML:f("relatedVideoTitle")||"Recommended"}),s=a.dom.createEl("div",{className:"video-selector-content"}),d=a.dom.createEl("div",{className:"video-container"}),c=function(e){var o,n,i,r,l,c=a.dom.createEl("div",{className:"video -".concat(e)}),m=a.dom.createEl("div",{className:"recommended -".concat(e)});m.setAttribute("video-idx",e),m.onclick=function(){v(e+1);for(var o=a.dom.$$(".recommended"),n=0;n<o.length;n++)o[n].style.border="none";u(e),p(t.playerId,t.videos[e].id).then((function(e){t.cb&&t.cb(e)})).catch((function(e){t.cb&&t.cb(e)}))};var h=document.createElement("img");h.className="related-thumbnail-image",h.src="".concat((null==t||null===(o=t.videos)||void 0===o||null===(n=o[e])||void 0===n?void 0:n.img)||(null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r?void 0:r.fallbackImage)),h.alt="No Thumbnail Available",m.append(h);var f=a.dom.createEl("div",{className:"info -".concat(e),innerHTML:"".concat((null==t||null===(l=t.videos[e])||void 0===l?void 0:l.title)||"")});a.dom.appendContent(c,m),a.dom.appendContent(c,f),a.dom.appendContent(d,c),a.dom.appendContent(s,d)},h=0;h<this.videos.length;h++)c(h);a.dom.appendContent(n,i),a.dom.appendContent(n,r),a.dom.appendContent(e,n),a.dom.appendContent(e,s),m(this.playerId,e)}}]),E}();export{g as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "1.0.97-backup",
3
+ "version": "1.0.99-backup",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "amdName": "_playerCore",
6
6
  "dependencies": {
@@ -1 +0,0 @@
1
- "use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),o=require("video.js"),i=require("axios");require("js-cookie");var r=require("ua-parser-js"),l=require("@babel/runtime/helpers/toConsumableArray"),a={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel"};function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function d(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?s(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var u={name:"@viewlift/player",version:"1.0.102",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.2.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3","js-cookie":"^3.0.5","video.js":"^7.20.3","videojs-contrib-ads":"^6.9.0","videojs-contrib-dash":"^5.1.1","videojs-contrib-eme":"^3.11.1","videojs-ima":"^2.1.0"}},c=function(e,t){var n,o,r,l;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,t){var n,o;return e({data:null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):i({url:w(),params:d({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:t,"Sdk-Version":u.version},withCredentials:!0})},v=function(e,t){var n,o;return i({url:T()+a.getLinearChannelDetails,params:d(d(d(d(d({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(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===(n=window)||void 0===n||null===(o=n.customData)||void 0===o?void 0:o.entitlement),method:"GET",headers:{Authorization:t}})},m=function(){var e=t(n.mark((function e(t,o){var r,l;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,A();case 2:if(r=e.sent,"v1"!=o){e.next=8;break}return l={siteOwner:null==t?void 0:t.siteOwner,userId:null==t?void 0:t.userId,videoId:null==t?void 0:t.videoId,watchedPercentage:null==t?void 0:t.watchedPercentage,watchedTime:null==t?void 0:t.watchedTime},e.abrupt("return",i({url:y(),method:"POST",headers:{Authorization:r,"x-api-key":t.xApiKey},params:{version:"v2"},data:JSON.stringify(l),withCredentials:!0}));case 8:if("v2"!=o){e.next=10;break}return e.abrupt("return",i({url:h(),method:"POST",headers:{Authorization:r},data:d({},t),params:d({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}));case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),p=function(e,t){var n,o,r=(null===(n=window)||void 0===n||null===(o=n.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";if("v1"==r){var l,a,s=JSON.parse(atob(t.split(".")[1])),d=(null==s?void 0:s.site)||null;return i({method:"GET",url:I(e),params:{site:d},headers:{Authorization:t,"x-api-key":null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a?void 0:a.xApiKey},timeout:15e3})}if("v2"==r){var u,c;JSON.parse(atob(t.split(".")[1]));var v=window.contentType;return i({method:"GET",url:E(e,v),headers:{Authorization:t,"x-api-key":null===(u=window)||void 0===u||null===(c=u.watchHistory)||void 0===c?void 0:c.xApiKey},timeout:15e3})}},f=function(e){return T()+"".concat(null==a?void 0:a.getSeriesWatchHistoryV2,"/").concat(e)},g=function(){return T()+"".concat(null==a?void 0:a.getSeriesWatchHistoryV1)},I=function(e){return T()+"".concat(null==a?void 0:a.getVideoInfoV1,"/").concat(e)},E=function(e,t){return T()+"".concat(null==a?void 0:a.getVideoInfoV2,"/").concat(t,"/").concat(e)},y=function(){return T()+"".concat(null==a?void 0:a.saveWatchHistoryV1)},h=function(){return T()+"".concat(null==a?void 0:a.saveWatchHistoryV2)},w=function(){var e,t,n,o,i=T()+"".concat(null==a?void 0:a.getVideoDetails);return null!==(e=window)&&void 0!==e&&null!==(t=e.customData)&&void 0!==t&&t.overrideEntitlementBaseUrl?(null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o?void 0:o.overrideEntitlementBaseUrl)+"/video/status":i},T=function(){var e;return(null===(e=window)||void 0===e?void 0:e.playerEntitlementUrl)||(null==a?void 0:a.apiBaseUrl)},_=function(e){var t=JSON.parse(atob(null==e?void 0:e.split(".")[1])),n=null==t?void 0:t.exp;if(new Date(1e3*n).getTime()<(new Date).getTime())return!0},b=null;function O(){return{set:function(e){e&&(b=e)},get:function(){return b}}}var x,D,V,S,C,L,k=function(){var e=t(n.mark((function e(){var t,o,r;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=O().get(),o=T(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(t)});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)}}(),W=null,A=function(){var e=t(n.mark((function e(){var t;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=sessionStorage.getItem("vlp_token"))||!_(t)){e.next=6;break}return W||(W=k().then((function(e){var n,o,i=null==e||null===(n=e.data)||void 0===n?void 0:n.authorizationToken,r=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return i&&sessionStorage.setItem("vlp_token",i),r&&O().set(r),i||t})).catch((function(e){return console.error("Error fetching refresh token",e),t})).finally((function(){W=null}))),e.abrupt("return",W);case 6:return e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),R=function(e){D=e},P=function(){return D},F=function(){return x},N=function(e){V=e},U=function(e){if(S){var t=S.get(e);N(t+1)}},j=(L=0,{set:function(e){e>=0&&(L=e)},get:function(){return L}}),B=function(e,t){if(Promise.resolve().then((function(){return require("./error-26d5a3c3.js")})).then((function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)})),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}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(t),i.appendChild(r),o.append(i)}}},M=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var H=function(){var e,t;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(t=e.userAgentData)||void 0===t?void 0:t.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"};function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function G(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?z(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):z(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}window._deviceInfo=r(navigator.userAgent);var q=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},Y=function(e){var t=X(e,"video.tags",[]),n=X(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map((function(e){return e.title})).join(","):n},X=function(e,t,n){for(var o=0,i=(t=t.split(".")).length;o<i;o++){var r;e=null===(r=e)||void 0===r?void 0:r[t[o]]}return e||n},J=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},K=function(){var e,t,n,o,i,r,l,a,s,d,u,c,v,m,p,f,g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",I=arguments.length>1?arguments[1]:void 0,E=arguments.length>2?arguments[2]:void 0,y=(null==E?void 0:E.contentType)||"video",h=null==E||null===(e=E[y])||void 0===e?void 0:e.metadata,w=fe(I);if(!g.includes("VIEWLIFT_"))return g;var T=window.getComputedStyle(document.getElementById(I),null),_=Math.trunc(T.getPropertyValue("height").slice(0,-2)),b=Math.trunc(T.getPropertyValue("width").slice(0,-2)),O="linearchannel"===y?null==E||null===(t=E.linearchannel)||void 0===t||null===(n=t.channels)||void 0===n||null===(o=n.find((function(e){return(null==e?void 0:e.id)===(null==E?void 0:E.channelId)})))||void 0===o||null===(i=o.content)||void 0===i?void 0:i.id:X(E,"video.gist.id",""),x=G(G({},Q(h)),{},{VIEWLIFT_WIDTH:b,VIEWLIFT_HEIGHT:_,VIEWLIFT_SIZE:q(b,_),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===(r=window)||void 0===r?void 0:r.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:X(E,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:X(E,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:X(E,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==w||null===(l=w.options_)||void 0===l?void 0:l.autoplay)||1,VIEWLIFT_MUTE:(null==w||null===(a=w.options_)||void 0===a?void 0:a.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_KEYWORDS:Y(E),VIEWLIFT_MEDIA_ID:O,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(X(E,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:O,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+X(E,"video.gist.permalink","")),VIEWLIFT_COPPA:X(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(u=d.site)||void 0===u?void 0:u.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:X(null===(c=window)||void 0===c||null===(v=c.app_data)||void 0===v||null===(m=v.site)||void 0===m?void 0:m.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*X(E,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:X(E,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:O,VIEWLIFT_CONTENT_TITLE:X(E,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:X(E,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:X(E,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:$(),VIEWLIFT_SEASON_NUMBER:Z(),VIEWLIFT_CONTENT_TAGS:Y(E)},null===(p=window)||void 0===p||null===(f=p.customData)||void 0===f?void 0:f.macros);for(var D in x){var V=new RegExp("\\b("+D+")\\b","g");g=g.replace(V,x[D])}return g},Z=function(){var e=j.get();return e>=0?e+1:1},$=function(){var e,t,n,o=F(),i=P(),r=null==i||null===(e=i.video)||void 0===e?void 0:e.id,l=j.get(),a=null==o||null===(t=o[l])||void 0===t||null===(n=t.episodes)||void 0===n?void 0:n.findIndex((function(e){return(null==e?void 0:e.id)===r}));return a>=0?a+1:1},Q=function(e){var t,n,o,i,r,l,a={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){s.set(e.name,e.value)})));var d=(null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(o=n.subscription)||void 0===o?void 0:o.SVOD)||!1,u=(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 d||u?(J()?d?a=G(G({},a),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):u&&(a=G(G({},a),{},{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):d?a=G(G({},a),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):u&&(a=G(G({},a),{},{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),d?a=G(G({},a),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||""}):u&&(a=G(G({},a),{},{VIEWLIFT_SFID:s.get("sfid.tve")||""})),a=J()?G(G({},a),{},{VIEWLIFT_PROF:s.get("prof.mweb")||""}):G(G({},a),{},{VIEWLIFT_PROF:s.get("prof.web")||""})):(a=G(G({},a),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||""}),a=J()?G(G({},a),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):G(G({},a),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),a},ee=function(e,t){var n,o,i,r,l,a,s,d,u,c,v,m,p,f=(null==e?void 0:e.contentType)||"video",g=null==e||null===(n=e[f])||void 0===n?void 0:n.drmEnabled,I=null==e||null===(o=e[f])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,E=null==e||null===(r=e[f])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,y=(null==e||null===(a=e[f])||void 0===a||null===(s=a.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.hls)||!1;null==e||null===(u=e[f])||void 0===u||null===(c=u.liveDetails)||void 0===c||c.isDvrEnabled;var h=(null==e||null===(v=e[f])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(p=m.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return null==e?void 0:e.directPlaybackUrl;if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return ne(E);if(g){var w=oe(I,t);return w.src=K(w.src,t,e),w}if("Safari"!==H()&&h)return te(I);if(y){var T=ne(I);return T.src=K(T.src,t,e),T}if(null!=I&&I.mpeg){var _=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(I);return _.src=K(_.src,t,e),_}return null},te=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},ne=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},oe=function(e,t){var n=e.fairPlay,i=e.widevine,r=e.playReady,l=H();if(fe(t),"Safari"===l){var a=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,n){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(i,(function(e,t,o){console.log(e),e&&n(e),n(null,new Uint8Array(o))}))},getContentId:function(e,t){if(t)return new TextDecoder("utf-16").decode(t.slice(16))},getLicense:function(t,n,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,t,n){console.log(e),e&&r(e),r(null,n)}))}}}}}(n);return ie(t),a}var s,d={src:i.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(ie(t),d.keySystems={"com.widevine.alpha":{url:i.licenseUrl,licenseHeaders:{"X-AxDRM-Message":i.licenseToken}},"com.microsoft.playready":{url:r.licenseUrl,licenseHeaders:{"X-AxDRM-Message":r.licenseToken}}}):(d.keySystemOptions=[],d.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:i.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":i.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),d.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:r.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),d};var ie=function(e){var t=fe(e);if("function"==typeof t.eme)try{t.eme()}catch(e){console.log("EME ERROR :",e)}},re=function(e){var t=fe(e);t.remoteTextTracks().tracks_.map((function(e){"subtitles"==(null==e?void 0:e.kind)||null==e||e.kind,t.removeRemoteTextTrack(e)}))},le=function(e,t){var n=fe(e);n.remoteTextTracks().tracks_.map((function(e){n.removeRemoteTextTrack(e)})),t.map((function(e){n.addRemoteTextTrack({src:e.url,srcLang:e.language,label:e.language})}))},ae=!1,se=function(e,t,n){var o=K(t,e,n),i=fe(e);t&&window.google&&(i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,t){var n,o,i,r=fe(e);if(null!==r.el_){ae=!0;var l={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),ae&&null!==r.el_&&("function"==typeof r.ima?r.ima(l):setTimeout((function(){r.ima.setContentWithAdTag(null,t,!0),r.ima.requestAds()}),1e3));var a=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&a.hasAttribute("controls")&&a.removeAttribute("controls");var s="click",d=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(d=!0,s="touchend"),r.one(s,(function(){d&&r.ima.initializeAdDisplayContainer()}));var u=(null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.adEventHandler)||null;r.one("ads-ad-started",(function(){u&&u({status:"STARTED",msg:"Advertisement Started"})})),r.one("ads-manager",(function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){u&&u({status:"ENDED",msg:"Advertisement Ended"})}))})),r.on("adserror",(function(e){u&&u({status:"ERROR",msg:"Advertisement Error"})}))}}(e,o))},de=["live","carousel","V2","defaultV2","multiplayer","minimalist"],ue=function(e){var t=(new DOMParser).parseFromString(e,"image/svg+xml");return null==t?void 0:t.querySelector("svg")},ce="",ve=function(e,t){var n;if(t){var o=document.getElementById(e),i=null===(n=window.getComputedStyle(o,null))||void 0===n?void 0:n.height;t.style.height!==i&&(t.style.height="".concat(i))}};function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}var pe=function(e){return!!o.getPlayer("".concat(e))},fe=function(e){return!!o.getPlayer("".concat(e))&&o.getPlayer("".concat(e))},ge=function(){var e=t(n.mark((function e(t,o){var i,r,l,a=arguments;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>2&&void 0!==a[2]&&a[2],e.next=3,A();case 3:return r=e.sent,l=fe(t),e.abrupt("return",new Promise((function(e,n){v(o,r).then((function(n){var r=null==n?void 0:n.data;r.contentType="linearchannel",r.channelId=null==o?void 0:o.channelId;var a=ee(r,t);a&&i?(ye(t,a),l.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:r})}))):e({status:!0,msg:"Feed authenticated",response:r})})).catch((function(e){n({status:!1,msg:"Cannot load feed",response:e})}))})));case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Ie=function(){var e=t(n.mark((function e(t,o,i){var r,l,a,s,d,u;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,A();case 2:return s=e.sent,U(o),d=0,u=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&p(o,s).then((function(e){var t,n,o,i,r,l;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),d=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,u=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null})).catch((function(e){var t,n,o,i;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})),e.abrupt("return",new Promise((function(e,n){c(o,s).then((function(o){var i,r,l,a,s,c,v,m,p,f,g=null==o?void 0:o.data,I=(null==g||null===(i=g.video)||void 0===i||null===(r=i.streamingInfo)||void 0===r?void 0:r.isLiveStream)||!1;R(o.data);var E=(null==g||null===(l=g.ads)||void 0===l||null===(a=l.preRoll)||void 0===a||null===(s=a.adTags)||void 0===s||null===(c=s.web)||void 0===c?void 0:c.active)&&(null==g||null===(v=g.ads)||void 0===v||null===(m=v.preRoll)||void 0===m||null===(p=m.adTags)||void 0===p||null===(f=p.web)||void 0===f?void 0:f.url);E&&se(t,E,g);var y=ee(g,t);if(y){var h,w,T,_,b,O,x,D,V,S,C,L,k,W,A=(null==g||null===(h=g.video)||void 0===h||null===(w=h.gist)||void 0===w?void 0:w.videoImageUrl)||(null==g||null===(T=g.video)||void 0===T||null===(_=T.gist)||void 0===_||null===(b=_.imageGist)||void 0===b?void 0:b.r16x9),P=fe(t);if(P.poster(A),ye(t,y),P.on("loadstart",(function(){I&&e({status:!0,msg:"Video Loaded",response:g})})),P.on("loadeddata",(function(){M(),e({status:!0,msg:"Video Loaded",response:g})})),P.one("play",(function(){d&&u<95&&setTimeout((function(){P.currentTime(d)}),0)})),P.one("error",(function(){var e;n({status:!1,msg:(null==P||null===(e=P.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==g||null===(O=g.video)||void 0===O||null===(x=O.contentDetails)||void 0===x||null===(D=x.closedCaptions)||void 0===D?void 0:D.length)>0||(null==g||null===(V=g.video)||void 0===V||null===(S=V.closedCaptions)||void 0===S?void 0:S.length)>0)C=((null==g||null===(L=g.video)||void 0===L||null===(k=L.contentDetails)||void 0===k?void 0:k.closedCaptions)||(null==g||null===(W=g.video)||void 0===W?void 0:W.closedCaptions)).filter((function(e){return"VTT"===e.format})),le(t,C);else re(t)}else B(t,"Incompatible Source, only hls,mp4,drm content is allowed"),n("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(e){he(e,t,n,o)}))})));case 8:case"end":return e.stop()}}),e)})));return function(t,n,o){return e.apply(this,arguments)}}(),Ee=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()},ye=function(e,t){var n=fe(e);n&&n.src(t)},he=function(t,n,o,i){var r,l,a,s,d,u,c=null==t||null===(r=t.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==t||null===(a=t.response)||void 0===a||null===(s=a.data)||void 0===s?void 0:s.errorMessage)||(null==t?void 0:t.message);pe(n)&&B(n,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[c])||"".concat(v)),o&&o(function(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?me(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):me(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({status:!1,response:t,msg:"".concat(v)},i&&{videoId:i}))};exports.addCaptions=le,exports.authenticateLC=ge,exports.clearError=M,exports.closeOpenDrawers=function(){var e=l(document.getElementsByClassName("vjs-control vjs-button open"));null==e||e.map((function(e){var t,n;null==e||null===(t=e.childNodes)||void 0===t||null===(n=t[0])||void 0===n||n.click()}))},exports.createIconMarkup=function(e){return ue(e)},exports.createIdxMapping=function(e){S=new Map,e.map((function(e,t){S.set(e.id,t)}))},exports.detectBrowser=H,exports.detectOrientationChange=function(e,t){var n,o=function(){return function(e,t){var n=window.matchMedia("(orientation: portrait)").matches?"potrait":"landscape",o=document.getElementById(e);if(o&&ce!==n){var i=window.getComputedStyle(o,null).getPropertyValue("height");t&&(t.style.height="".concat(i)),ce=n}}(e,t)};window._orientationChangeHandler=o;window.addEventListener("resize",(function(){clearTimeout(n),n=setTimeout((function(){o()}),100)}))},exports.disableCaptions=function(e,t){for(var n=fe(e).textTracks(),o=0;o<n.length;o++){var i=n[o];"subtitles"!==i.kind&&"captions"!==i.kind||i.id!==t||(i.mode="hidden")}},exports.disableControls=function(e){var t=document.getElementById(e),n=t.getElementsByClassName("vjs-control-bar")[0];n&&(n.style.visibility="hidden");var o=t.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var i=t.getElementsByClassName("vjs-fullscreen-control")[0];i&&(i.style.display="none")},exports.dispose=function(e){var t=fe(e);if(Ee(),window._orientationChangeHandler&&(window.removeEventListener("resize",window._orientationChangeHandler),delete window._orientationChangeHandler),window._multiplayer_dbClickHandler&&(window.removeEventListener("dblclick",window._multiplayer_dbClickHandler),delete window._multiplayer_dbClickHandler),window._multiplayer_dbTapHandler&&(window.removeEventListener("touchend",window._multiplayer_dbTapHandler),delete window._multiplayer_dbTapHandler),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},exports.enableCaptions=function(e,t){var n,o,i;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(o=n[0])||void 0===o||null===(i=o.style)||void 0===i||i.setProperty("display","flex"));for(var r=fe(e).textTracks(),l=0;l<r.length;l++){var a=r[l];"subtitles"!==a.kind&&"captions"!==a.kind||a.id!=t||(a.mode="showing")}},exports.getCaptions=function(e){var t,n=fe(e);return(null==n||null===(t=n.textTracks())||void 0===t?void 0:t.tracks_.filter((function(e){return"subtitles"==e.kind||"captions"===e.kind})))||[]},exports.getCurrentSeries=F,exports.getCurrentVideo=P,exports.getLinearChannelDetails=v,exports.getPlayer=fe,exports.getSeriesDetails=function(e,t){var n,o,r=JSON.parse(atob(t.split(".")[1])),l=(null==r?void 0:r.site)||null;return r&&r.countryCode,null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.seriesData?new Promise((function(e,t){var n,o;return e({data:null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o?void 0:o.seriesData})})):i({url:T()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:t}})},exports.getSeriesWatchHistory=function(e){var t,n;if("v1"==((null===(t=window)||void 0===t||null===(n=t.watchHistory)||void 0===n?void 0:n.apiVersion)||"v1"))return i({method:"GET",url:g(),params:{site:null==e?void 0:e.siteOwner,version:"v2",seriesId:e.videoId},headers:{Authorization:e.token},timeout:15e3});var o=e.videoId;return i({method:"GET",url:f(o),headers:{Authorization:e.token},timeout:15e3})},exports.getSeriesWatchMap=function(){return C},exports.getSource=ee,exports.getToken=A,exports.getUpdatedClusterSource=function(e,t){var n=e.src,o=e.type;if(!n||"string"!=typeof n||!n.includes(".com"))return{src:n,type:o};t=t.replace(/\/$/,"");var i=n.split(".com")[1]||"";return{src:i?"".concat(t).concat(i):n,type:o}},exports.getVideoDetails=c,exports.getVideoIdx=function(){return V},exports.getVideoInfo=p,exports.handleDrawerResizing=function(e,t){var n,o=fe(e),i=fe(e).el(),r=new ResizeObserver((function(){var o;null!==(o=t.classList)&&void 0!==o&&o.contains("hidden")||(n&&clearTimeout(n),n=setTimeout((function(){ve(e,t)}),200))}));r.observe(i),o.on("dispose",(function(){r.disconnect()})),o.on("fullscreenchange",(function(){setTimeout((function(){ve(e,t)}),50)}))},exports.handleError=B,exports.highlightVideo=function(e){l(document.querySelectorAll("[video-idx]")).map((function(t){var n=t.getAttribute("video-idx");t.style.border=n==e?"2px solid white":"none"}))},exports.impolicy16x9=function(e){return e?e+"?impolicy=resize&w=1920&h=1080":null},exports.initialiseAdvertisement=se,exports.initiateErrorHandling=he,exports.isNotAValidSkin=function(e){return!de.includes(e)},exports.isPaused=function(e){return o(e).paused()},exports.isPlayerInitialised=pe,exports.isTokenExpired=_,exports.load=Ie,exports.loadVideo=ye,exports.loadVideoInstantly=function(e,t,n){var o=fe(e);return o.src(t),new Promise((function(e,t){var i=0;o.one("loadedmetadata",(function(){clearTimeout(i),e({status:!0,msg:"video loaded"})})),o.one("loadstart",(function(e){i=setTimeout((function(){t("FAILED: Took too long to load")}),n)}))}))},exports.parseHtmlString=function(e){var t=(new DOMParser).parseFromString(e,"text/html");return null==t?void 0:t.querySelector("body")},exports.parseSvgString=ue,exports.pause=function(e){o(e).pause()},exports.play=function(e){o(e).play()},exports.refreshTokenManager=O,exports.removeCaptions=re,exports.rewind=function(e,t){var n=o(e),i=n.currentTime(),r=i<=t?0:i-t;n.currentTime(r)},exports.saveWatchHistory=m,exports.seasonIdxManager=j,exports.setCurrentSeries=function(e){x=e},exports.setCurrentVideo=R,exports.setSeriesWatchMap=function(e){C=e},exports.setUpdatedElHeight=ve,exports.setVideoIdx=N,exports.setVideoIdxById=U,exports.skip=function(e,t){var n=o(e),i=n.currentTime()+t;n.currentTime(i)},exports.token_authentication_enabled=function(e){var t=!0,n=null==e?void 0:e.videoSourceUrl,o=null==e?void 0:e.asat;return n&&!o&&(t=!1),t};
@@ -1 +0,0 @@
1
- "use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),s=require("@babel/runtime/helpers/assertThisInitialized"),i=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),r=require("@babel/runtime/helpers/getPrototypeOf"),l=require("video.js"),a=require("./icons-515b2da0.js"),d=require("./generic-513fe379.js");require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/regenerator"),require("axios");var c=require("./autoNextVideo-6c2cc63d.js");function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}require("js-cookie"),require("ua-parser-js"),require("./util-462eea7f.js");var v=l.getComponent("Component"),p=function(){i(g,v);var p,m,h=(p=g,m=u(),function(){var e,t=r(p);if(m){var n=r(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return o(this,e)});function g(n){var i,o,r,l,a,u,v=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(this,g),(u=h.call(this,n,v)).playerId=v.playerId,u.seriesData=v.sres,u.videos=null==v||null===(i=v.sres)||void 0===i?void 0:i.seasons,u.currentVideoData=v.res,u.initialiseStructure(),u.loadCSS(),u.selectedSeason=0,u.cb=null==v||null===(o=v.series)||void 0===o?void 0:o.cb,u.autoPlayNext=(null==v||null===(r=v.series)||void 0===r?void 0:r.autoPlayNext)||!1,sessionStorage.getItem("token"),u.watchMap=d.getSeriesWatchMap(),null!==(l=s(u))&&void 0!==l&&l.autoPlayNext&&null!=v&&null!==(a=v.series)&&void 0!==a&&a.enable){var p,m,f,C,y=null==v||null===(p=v.sres)||void 0===p?void 0:p.seasons,b=[];y.map((function(t){b.push.apply(b,e(t.episodes))})),d.createIdxMapping(b),d.setVideoIdxById(null===(m=u.options_)||void 0===m||null===(f=m.res)||void 0===f||null===(C=f.video)||void 0===C?void 0:C.id),c.autoPlayNext({playerId:u.playerId,content:b,cb:u.cb,series:null==v?void 0:v.sres})}return u}return n(g,[{key:"createEl",value:function(){var e=l.dom.createEl("div",{className:"series-selection vjs-control vjs-button"});e.style.position="unset";var t=l.dom.createEl("div",{className:"series-selector-icon",innerHTML:"".concat(a.EpisodesSvg())});return l.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./series-v2-70137d8c.js")})).then((function(e){var t=document.createElement("style");t.id="series-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"toggleOpenClose",value:function(e){var t,n=this.el();null!=e&&null!==(t=e.classList)&&void 0!==t&&t.contains("hidden")?(d.closeOpenDrawers(),e.classList.remove("hidden"),n.classList.add("open"),e.style.right="0px"):(e.classList.add("hidden"),n.classList.remove("open"),e.style.right="-350px")}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),n=l.dom.createEl("div",{className:"series-selection-container hidden"});l.dom.$(".series-selector-icon",this.el()).onclick=function(){return e.toggleOpenClose(n)};var s=document.getElementById(this.playerId);if(s){var i=window.getComputedStyle(s,null).getPropertyValue("height").slice(0,-2);n.style.height="".concat(i,"px"),l.dom.appendContent(t,n),s.style.overflow="hidden",this.addFunctionality(n)}}},{key:"addFunctionality",value:function(e){var t=this,n=this.el(),s=l.dom.createEl("div",{className:"series-selector-head"}),i=l.dom.createEl("div",{className:"series-selector-cross-icon",innerHTML:"".concat(a.crossIconSvg())});i.onclick=function(){if("series-selector-cross-icon"===i.className)e.classList.add("hidden"),n.classList.remove("open"),e.style.right="-350px";else if("series-selector-back-icon"===i.className){var s=l.dom.$(".series-selector-content",t.el());for(l.dom.$(".series-selector-cross-icon",t.el()),i.className="series-selector-cross-icon";null!=s&&s.firstChild;)s.removeChild(s.firstChild);var o=t.createSeasonLister();for(l.dom.appendContent(s,o),l.dom.$(".series-selector-title",t.el()).textContent="Seasons";null!=i&&i.firstChild;)i.removeChild(i.firstChild);var r=d.parseSvgString(a.crossIconSvg());i.appendChild(r)}};var o=l.dom.createEl("div",{className:"series-selector-title",innerHTML:"Seasons"}),r=l.dom.createEl("div",{className:"series-selector-content"}),c=this.createSeasonLister();l.dom.appendContent(r,c),l.dom.appendContent(s,i),l.dom.appendContent(s,o),l.dom.appendContent(e,s),l.dom.appendContent(e,r),d.getPlayer(this.playerId).on("fullscreenchange",(function(){var n=document.getElementById(t.playerId);if(n){var s=window.getComputedStyle(n,null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(s,"px")}}))}},{key:"createSeasonLister",value:function(){var e=this;d.getPlayer(this.playerId);for(var t=d.getCurrentSeries(),n=l.dom.createEl("div",{className:"season-container"}),s=function(s){var i,o=document.createElement("label");o.className="season-holder",o.setAttribute("for","season-".concat(s));var r=document.createElement("div");r.className="season - ".concat(s),r.textContent=null===(i=t[s])||void 0===i?void 0:i.title;var a=l.dom.createEl("input",{className:"radio - ".concat(s),id:"season-".concat(s),name:"season-radio"});a.setAttribute("type","radio"),e.selectedSeason==s&&(a.checked=!0),a.onclick=function(t){d.seasonIdxManager.set(s),e.showSeasonDetails(s)},l.dom.appendContent(o,a),l.dom.appendContent(o,r),l.dom.appendContent(n,o)},i=0;i<t.length;i++)s(i);return n}},{key:"getSeasonDetailsContainer",value:function(t,n){var s=this;t=t.map((function(e){var t,n,i,o,r;return{id:null==e?void 0:e.id,title:null==e?void 0:e.title,description:null==e||null===(t=e.gist)||void 0===t?void 0:t.description,img:null==e||null===(n=e.gist)||void 0===n||null===(i=n.imageGist)||void 0===i?void 0:i.r16x9,watchedPercentage:(null==s||null===(o=s.watchMap)||void 0===o||null===(r=o.get(null==e?void 0:e.id))||void 0===r?void 0:r.p)||0}}));for(var i=function(i){var o,r,a,c,u,v,p,m=l.dom.createEl("div",{className:"series-container"}),h=l.dom.createEl("div",{className:"series-section",index:i}),g=l.dom.createEl("div",{className:"series-title",innerHTML:"".concat((null===(o=t[i])||void 0===o?void 0:o.title)||"")}),f=l.dom.createEl("div",{className:"series-progress-bar",innerHTML:"<div style='width:".concat(t[i].watchedPercentage,"%' class='series-progress-bar-value'></div>")});l.dom.appendContent(h,g),l.dom.appendContent(h,f),l.dom.appendContent(m,h),l.dom.appendContent(n,m);var C=l.dom.createEl("div",{className:"series-section-expanded hidden"}),y=(null===(r=t[i])||void 0===r?void 0:r.description)||"";(null===(a=y)||void 0===a?void 0:a.length)>170&&(y=y.substr(0,170)+"...");var b=l.dom.createEl("div",{className:"series-description",innerHTML:"".concat(y||"")}),S=l.dom.createEl("img",{className:"series-image"});S.src="".concat((null===(c=t[i])||void 0===c?void 0:c.img)||(null===(u=window)||void 0===u||null===(v=u.customData)||void 0===v?void 0:v.fallbackImage)),S.alt="".concat(null===(p=t[i])||void 0===p?void 0:p.title),l.dom.appendContent(C,S),l.dom.appendContent(C,b),l.dom.appendContent(m,C),l.dom.appendContent(n,m),C.onclick=function(e){var n;e.stopPropagation(),d.setVideoIdxById(null===(n=t[i])||void 0===n?void 0:n.id),d.load(s.playerId,t[i].id).then((function(e){null!=s&&s.cb&&s.cb(e)})).catch((function(e){null!=s&&s.cb&&s.cb(e)}))},h.onclick=function(t){var n,s,i,o=document.getElementsByClassName("series-selector-content")[0].childNodes,r=(o=e(o))[t.target.index].getElementsByClassName("series-section-expanded")[0];null!=r&&null!==(n=r.classList)&&void 0!==n&&n.contains("hidden")?(m.style.backgroundColor="#0000007d",null==r||null===(s=r.classList)||void 0===s||s.remove("hidden")):(null==r||null===(i=r.classList)||void 0===i||i.add("hidden"),m.style.backgroundColor="unset")}},o=0;o<t.length;o++)i(o);return parent}},{key:"showSeasonDetails",value:function(e){this.selectedSeason=e;for(var t=l.dom.$(".series-selector-content",this.el());null!=t&&t.firstChild;)t.removeChild(t.firstChild);var n=d.getCurrentSeries()[e].episodes;this.getSeasonDetailsContainer(n,t);var s=l.dom.$(".series-selector-cross-icon",this.el());for(s.className="series-selector-back-icon";null!=s&&s.firstChild;)s.removeChild(s.firstChild);var i=d.parseSvgString(a.BackIcon());s.appendChild(i),l.dom.$(".series-selector-title",this.el()).textContent="Season ".concat(e+1)}}]),g}();exports.default=p;
@@ -1 +0,0 @@
1
- "use strict";var e=require("./features-6c341397.js"),l=require("./icons-515b2da0.js"),t=require("./generic-513fe379.js"),n=require("./renditions-fbaf9ed4.js"),i=require("@babel/runtime/helpers/toConsumableArray"),o=require("./autoNextVideo-6c2cc63d.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("video.js"),require("./localisation-56e0a999.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./util-462eea7f.js");var r=t.getCurrentSeries(),a=[];null==r||r.map((function(e){return a.push.apply(a,i(e.episodes))}));var d=function(e,l){var n=t.getPlayer(e),i=Math.floor(n.currentTime());if(Math.floor(n.duration())!=i){n.pause(e);var r=t.getVideoIdx();o.switchToNext(r,e,a)}};function u(l,i){var o=t.getPlayer(l);o&&(o.on("loadeddata",(function(){var r,u,s;(null===(r=n.getRenditions(l))||void 0===r?void 0:r.length)>0&&e.addSettingsButtonV2(l,i),(null===(u=t.getCaptions(l))||void 0===u?void 0:u.length)>0&&e.addCaptionButton(l,i),null!=i&&null!==(s=i.series)&&void 0!==s&&s.enable&&function(e,l){var n;null==l||null===(n=l.series)||void 0===n||n.cb;var i=t.getPlayer(e);i.on("timeupdate",(function(){var e,l=Math.floor(i.currentTime()),n=i.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];n-l<=10&&t.getVideoIdx()<=(null==a?void 0:a.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var o,r=a.filter((function(e,l){return l==t.getVideoIdx()}));if((null==r?void 0:r.length)>0)if(null!==(o=document.getElementsByClassName("next-ep-preview"))&&void 0!==o&&o[0]){var u,s,v,c,m,p,g,h,f,y,b;(null===(u=document.getElementsByClassName("next-ep-preview"))||void 0===u?void 0:u[0]).style.visibility="hidden";var C=null===(s=document.getElementsByClassName("next-ep-title"))||void 0===s?void 0:s[0],x=null===(v=document.getElementsByClassName("next-ep-img"))||void 0===v?void 0:v[0],q=null===(c=document.getElementsByClassName("next-ep-content"))||void 0===c?void 0:c[0],w=null===(m=r[0])||void 0===m?void 0:m.title;(null===(p=w)||void 0===p?void 0:p.length)>60&&(w=w.substr(0,60)+"..."),C.textContent="".concat(w),x.src=(null===(g=r[0])||void 0===g||null===(h=g.gist)||void 0===h||null===(f=h.imageGist)||void 0===f?void 0:f.r16x9)||(null===(y=window)||void 0===y||null===(b=y.customData)||void 0===b?void 0:b.fallbackImage),q.onclick=function(){return d(e)}}else{var j,E,N,B,V,S,k,P=document.createElement("div");P.className="next-ep-preview",P.style.visibility="hidden",document.getElementById(e).append(P);var I=document.createElement("div");I.className="next-ep-header",I.textContent="Next up";var M=null===(j=r[0])||void 0===j?void 0:j.title,R=document.createElement("img");R.className="next-ep-img",R.src=(null===(E=r[0])||void 0===E||null===(N=E.gist)||void 0===N||null===(B=N.imageGist)||void 0===B?void 0:B.r16x9)||(null===(V=window)||void 0===V||null===(S=V.customData)||void 0===S?void 0:S.fallbackImage);var T=document.createElement("div");T.className="next-ep-title",(null===(k=M)||void 0===k?void 0:k.length)>60&&(M=M.substr(0,60)+"..."),T.textContent="".concat(M);var O=document.createElement("div");O.className="next-ep-content",O.append(R),O.append(T),O.onclick=function(){return d(e)},P.append(I),P.append(O)}}(l,i),function(e,l){var t,n=Math.floor(e/60),i=null===(t=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===t?void 0:t[0];i&&(i.style.marginRight=n>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],r=document.getElementsByClassName("vjs-time-control");l&&o.classList.value.includes("vjs-hidden")&&(r[0].style.display="block",i&&(i.style.marginRight="56px"))}(o.duration(),(null==i?void 0:i.liveVideo)||!1)})),o.one("play",(function(){var t,n,i,o;null!==(t=window)&&void 0!==t&&null!==(n=t.customData)&&void 0!==n&&n.iframeOverlayUrl&&e.addOutputtingOverlay(l,null===(i=window)||void 0===i||null===(o=i.customData)||void 0===o?void 0:o.iframeOverlayUrl)})))}exports.initialiseSkin=function(n,i){!function(){"Chrome"==t.detectBrowser()&&Promise.resolve().then((function(){return require("./chromett-f925fb6c.js")})).then((function(e){var l=document.createElement("style");l.id="chromett",l.append("".concat(e.default)),document.head.appendChild(l)}));Promise.resolve().then((function(){return require("./skin-8fa76c87.js")})).then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)}))}(),u(n,i),function(e,n){var i,o,r,a,d,u,s=t.getPlayer(e);null==s||null===(i=s.controlBar)||void 0===i||null===(o=i.getChild("FullscreenToggle"))||void 0===o||null===(r=o.el())||void 0===r||r.appendChild(t.createIconMarkup(l.MinimizeSvg(window.controlsColor))),null==s||null===(a=s.controlBar)||void 0===a||null===(d=a.getChild("FullscreenToggle"))||void 0===d||null===(u=d.el())||void 0===u||u.appendChild(t.createIconMarkup(l.MaximizeSvg(window.controlsColor)));var v=document.getElementsByClassName("vjs-time-control");n.liveVideo&&v[0]&&(v[0].style.display="none")}(n,i),function(t,n){var i,o,r,a,d,u;0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)&&e.addSkipButton(t,"defaultV2",l.SkipSvgV2());(0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)||1==(null==n?void 0:n.liveui))&&e.addRewindButton(t,"defaultV2",l.RewindSvgV2());n.liveVideo||e.addSlowMotion(t);(null==n||null===(i=n.relatedVideos)||void 0===i||null===(o=i.content)||void 0===o?void 0:o.length)>0&&e.addVideoSelector(t,null==n?void 0:n.relatedVideos);(null==n||null===(r=n.streams)||void 0===r?void 0:r.length)>1&&e.addMulticamSelector(t,null==n?void 0:n.streams);(null==n||null===(a=n.playlist)||void 0===a||null===(d=a.content)||void 0===d?void 0:d.length)>0&&e.addPlaylistSelector(t,null==n?void 0:n.playlist);null!=n&&null!==(u=n.series)&&void 0!==u&&u.enable&&e.addSeriesSelectorV2(t,n)}(n,i),function(e,l){var n=t.getPlayer(e),i=null==l?void 0:l.tvProviderLogoUrl;if(!i)return;var o=document.createElement("div");o.className="tvProviderImage";var r=document.createElement("img");r.src="".concat(i),r.alt="Provider Image",o.append(r),n.el().appendChild(o),n.on("useractive",(function(){o.classList.remove("vjs-fade")})),n.on("userinactive",(function(){n.paused()||o.classList.add("vjs-fade")})),n.on("fullscreenchange",(function(){n.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}(n,i)};
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import i from"axios";import"js-cookie";import r from"ua-parser-js";import a from"@babel/runtime/helpers/toConsumableArray";var l={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"};function u(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 d(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?u(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):u(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var s={name:"@viewlift/player",version:"1.0.102",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.2.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3","js-cookie":"^3.0.5","video.js":"^7.20.3","videojs-contrib-ads":"^6.9.0","videojs-contrib-dash":"^5.1.1","videojs-contrib-eme":"^3.11.1","videojs-ima":"^2.1.0"}},c=function(e,n){var t,o,r,a;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:_(),params:d({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":s.version},withCredentials:!0})},v=function(e,n){var t,o;return i({url:b()+l.getLinearChannelDetails,params:d(d(d(d(d({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(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===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.entitlement),method:"GET",headers:{Authorization:n}})},m=function(e,n){var t,o,r=JSON.parse(atob(n.split(".")[1])),a=(null==r?void 0:r.site)||null;return r&&r.countryCode,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:b()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:n}})},p=function(){var e=n(t.mark((function e(n,o){var r,a;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,P();case 2:if(r=e.sent,"v1"!=o){e.next=8;break}return a={siteOwner:null==n?void 0:n.siteOwner,userId:null==n?void 0:n.userId,videoId:null==n?void 0:n.videoId,watchedPercentage:null==n?void 0:n.watchedPercentage,watchedTime:null==n?void 0:n.watchedTime},e.abrupt("return",i({url:h(),method:"POST",headers:{Authorization:r,"x-api-key":n.xApiKey},params:{version:"v2"},data:JSON.stringify(a),withCredentials:!0}));case 8:if("v2"!=o){e.next=10;break}return e.abrupt("return",i({url:T(),method:"POST",headers:{Authorization:r},data:d({},n),params:d({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 10:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),f=function(e,n){var t,o,r=(null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";if("v1"==r){var a,l,u=JSON.parse(atob(n.split(".")[1])),d=(null==u?void 0:u.site)||null;return i({method:"GET",url:y(e),params:{site:d},headers:{Authorization:n,"x-api-key":null===(a=window)||void 0===a||null===(l=a.watchHistory)||void 0===l?void 0:l.xApiKey},timeout:15e3})}if("v2"==r){var s,c;JSON.parse(atob(n.split(".")[1]));var v=window.contentType;return i({method:"GET",url:w(e,v),headers:{Authorization:n,"x-api-key":null===(s=window)||void 0===s||null===(c=s.watchHistory)||void 0===c?void 0:c.xApiKey},timeout:15e3})}},g=function(e){var n,t;if("v1"==((null===(n=window)||void 0===n||null===(t=n.watchHistory)||void 0===t?void 0:t.apiVersion)||"v1"))return i({method:"GET",url:E(),params:{site:null==e?void 0:e.siteOwner,version:"v2",seriesId:e.videoId},headers:{Authorization:e.token},timeout:15e3});var o=e.videoId;return i({method:"GET",url:I(o),headers:{Authorization:e.token},timeout:15e3})},I=function(e){return b()+"".concat(null==l?void 0:l.getSeriesWatchHistoryV2,"/").concat(e)},E=function(){return b()+"".concat(null==l?void 0:l.getSeriesWatchHistoryV1)},y=function(e){return b()+"".concat(null==l?void 0:l.getVideoInfoV1,"/").concat(e)},w=function(e,n){return b()+"".concat(null==l?void 0:l.getVideoInfoV2,"/").concat(n,"/").concat(e)},h=function(){return b()+"".concat(null==l?void 0:l.saveWatchHistoryV1)},T=function(){return b()+"".concat(null==l?void 0:l.saveWatchHistoryV2)},_=function(){var e,n,t,o,i=b()+"".concat(null==l?void 0:l.getVideoDetails);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":i},b=function(){var e;return(null===(e=window)||void 0===e?void 0:e.playerEntitlementUrl)||(null==l?void 0:l.apiBaseUrl)},O=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},D=null;function V(){return{set:function(e){e&&(D=e)},get:function(){return D}}}var L,S,C,A,R,W,k=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=V().get(),o=b(),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)}}(),F=null,P=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"))||!O(n)){e.next=6;break}return F||(F=k().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&&V().set(r),i||n})).catch((function(e){return console.error("Error fetching refresh token",e),n})).finally((function(){F=null}))),e.abrupt("return",F);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=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},x=function(e){S=e},j=function(){return S},U=function(e){L=e},B=function(){return L},H=function(){return C},M=function(e){C=e},z=function(e){R=e},G=function(){return R},Y=function(e){A=new Map,e.map((function(e,n){A.set(e.id,n)}))},q=function(e){if(A){var n=A.get(e);M(n+1)}},X=(W=0,{set:function(e){e>=0&&(W=e)},get:function(){return W}}),J=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)}}},K=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Z=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"};function $(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 Q(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?$(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):$(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}window._deviceInfo=r(navigator.userAgent);var ee=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},ne=function(e){var n=te(e,"video.tags",[]),t=te(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map((function(e){return e.title})).join(","):t},te=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},oe=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},ie=function(){var e,n,t,o,i,r,a,l,u,d,s,c,v,m,p,f,g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",I=arguments.length>1?arguments[1]:void 0,E=arguments.length>2?arguments[2]:void 0,y=(null==E?void 0:E.contentType)||"video",w=null==E||null===(e=E[y])||void 0===e?void 0:e.metadata,h=Ue(I);if(!g.includes("VIEWLIFT_"))return g;var T=window.getComputedStyle(document.getElementById(I),null),_=Math.trunc(T.getPropertyValue("height").slice(0,-2)),b=Math.trunc(T.getPropertyValue("width").slice(0,-2)),O="linearchannel"===y?null==E||null===(n=E.linearchannel)||void 0===n||null===(t=n.channels)||void 0===t||null===(o=t.find((function(e){return(null==e?void 0:e.id)===(null==E?void 0:E.channelId)})))||void 0===o||null===(i=o.content)||void 0===i?void 0:i.id:te(E,"video.gist.id",""),D=Q(Q({},le(w)),{},{VIEWLIFT_WIDTH:b,VIEWLIFT_HEIGHT:_,VIEWLIFT_SIZE:ee(b,_),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===(r=window)||void 0===r?void 0:r.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:te(E,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:te(E,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:te(E,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==h||null===(a=h.options_)||void 0===a?void 0:a.autoplay)||1,VIEWLIFT_MUTE:(null==h||null===(l=h.options_)||void 0===l?void 0:l.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_KEYWORDS:ne(E),VIEWLIFT_MEDIA_ID:O,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(te(E,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:O,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+te(E,"video.gist.permalink","")),VIEWLIFT_COPPA:te(null===(u=window)||void 0===u||null===(d=u.app_data)||void 0===d||null===(s=d.site)||void 0===s?void 0:s.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:te(null===(c=window)||void 0===c||null===(v=c.app_data)||void 0===v||null===(m=v.site)||void 0===m?void 0:m.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*te(E,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:te(E,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:O,VIEWLIFT_CONTENT_TITLE:te(E,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:te(E,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:te(E,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ae(),VIEWLIFT_SEASON_NUMBER:re(),VIEWLIFT_CONTENT_TAGS:ne(E)},null===(p=window)||void 0===p||null===(f=p.customData)||void 0===f?void 0:f.macros);for(var V in D){var L=new RegExp("\\b("+V+")\\b","g");g=g.replace(L,D[V])}return g},re=function(){var e=X.get();return e>=0?e+1:1},ae=function(){var e,n,t,o=B(),i=j(),r=null==i||null===(e=i.video)||void 0===e?void 0:e.id,a=X.get(),l=null==o||null===(n=o[a])||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 l>=0?l+1:1},le=function(e){var n,t,o,i,r,a,l={},u=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){u.set(e.name,e.value)})));var d=(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,s=(null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(a=r.subscription)||void 0===a?void 0:a.TVE)||!1;return d||s?(oe()?d?l=Q(Q({},l),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||""}):s&&(l=Q(Q({},l),{},{VIEWLIFT_CSID:u.get("csid.mweb.tve")||""})):d?l=Q(Q({},l),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||""}):s&&(l=Q(Q({},l),{},{VIEWLIFT_CSID:u.get("csid.web.tve")||""})),d?l=Q(Q({},l),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||""}):s&&(l=Q(Q({},l),{},{VIEWLIFT_SFID:u.get("sfid.tve")||""})),l=oe()?Q(Q({},l),{},{VIEWLIFT_PROF:u.get("prof.mweb")||""}):Q(Q({},l),{},{VIEWLIFT_PROF:u.get("prof.web")||""})):(l=Q(Q({},l),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||""}),l=oe()?Q(Q({},l),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:u.get("prof.mweb")||""}):Q(Q({},l),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||"",VIEWLIFT_PROF:u.get("prof.web")||""})),l},ue=function(e,n){var t,o,i,r,a,l,u,d,s,c,v,m,p,f=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[f])||void 0===t?void 0:t.drmEnabled,I=null==e||null===(o=e[f])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,E=null==e||null===(r=e[f])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,y=(null==e||null===(l=e[f])||void 0===l||null===(u=l.streamingInfo)||void 0===u||null===(d=u.videoAssets)||void 0===d?void 0:d.hls)||!1;null==e||null===(s=e[f])||void 0===s||null===(c=s.liveDetails)||void 0===c||c.isDvrEnabled;var w=(null==e||null===(v=e[f])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(p=m.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return null==e?void 0:e.directPlaybackUrl;if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return se(E);if(g){var h=ce(I,n);return h.src=ie(h.src,n,e),h}if("Safari"!==Z()&&w)return de(I);if(y){var T=se(I);return T.src=ie(T.src,n,e),T}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=ie(_.src,n,e),_}return null},de=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},se=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},ce=function(e,n){var t=e.fairPlay,i=e.widevine,r=e.playReady,a=Z();if(Ue(n),"Safari"===a){var l=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)return new TextDecoder("utf-16").decode(n.slice(16))},getLicense:function(n,t,i,r){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(a,(function(e,n,t){console.log(e),e&&r(e),r(null,t)}))}}}}}(t);return ve(n),l}var u,d={src:i.url,type:"application/dash+xml"};return"caliente"==(null===(u=window)||void 0===u?void 0:u.siteName)?(ve(n),d.keySystems={"com.widevine.alpha":{url:i.licenseUrl,licenseHeaders:{"X-AxDRM-Message":i.licenseToken}},"com.microsoft.playready":{url:r.licenseUrl,licenseHeaders:{"X-AxDRM-Message":r.licenseToken}}}):(d.keySystemOptions=[],d.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:i.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":i.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),d.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:r.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),d};var ve=function(e){var n=Ue(e);if("function"==typeof n.eme)try{n.eme()}catch(e){console.log("EME ERROR :",e)}},me=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}},pe=function(e,n){var t,o,i;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(t=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===t||null===(o=t[0])||void 0===o||null===(i=o.style)||void 0===i||i.setProperty("display","flex"));for(var r=Ue(e).textTracks(),a=0;a<r.length;a++){var l=r[a];"subtitles"!==l.kind&&"captions"!==l.kind||l.id!=n||(l.mode="showing")}},fe=function(e,n){for(var t=Ue(e).textTracks(),o=0;o<t.length;o++){var i=t[o];"subtitles"!==i.kind&&"captions"!==i.kind||i.id!==n||(i.mode="hidden")}},ge=function(e){var n,t=Ue(e);return(null==t||null===(n=t.textTracks())||void 0===n?void 0:n.tracks_.filter((function(e){return"subtitles"==e.kind||"captions"===e.kind})))||[]},Ie=function(e){var n=Ue(e);n.remoteTextTracks().tracks_.map((function(e){"subtitles"==(null==e?void 0:e.kind)||null==e||e.kind,n.removeRemoteTextTrack(e)}))},Ee=function(e,n){var t=Ue(e);t.remoteTextTracks().tracks_.map((function(e){t.removeRemoteTextTrack(e)})),n.map((function(e){t.addRemoteTextTrack({src:e.url,srcLang:e.language,label:e.language})}))},ye=!1,we=function(e,n,t){var o=ie(n,e,t),i=Ue(e);n&&window.google&&(i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,n){var t,o,i,r=Ue(e);if(null!==r.el_){ye=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),ye&&null!==r.el_&&("function"==typeof r.ima?r.ima(a):setTimeout((function(){r.ima.setContentWithAdTag(null,n,!0),r.ima.requestAds()}),1e3));var l=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&l.hasAttribute("controls")&&l.removeAttribute("controls");var u="click",d=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(d=!0,u="touchend"),r.one(u,(function(){d&&r.ima.initializeAdDisplayContainer()}));var s=(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;r.one("ads-ad-started",(function(){s&&s({status:"STARTED",msg:"Advertisement Started"})})),r.one("ads-manager",(function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){s&&s({status:"ENDED",msg:"Advertisement Ended"})}))})),r.on("adserror",(function(e){s&&s({status:"ERROR",msg:"Advertisement Error"})}))}}(e,o))},he=["live","carousel","V2","defaultV2","multiplayer","minimalist"],Te=function(e){return!he.includes(e)},_e=function(e){var n=(new DOMParser).parseFromString(e,"text/html");return null==n?void 0:n.querySelector("body")},be=function(e){var n=(new DOMParser).parseFromString(e,"image/svg+xml");return null==n?void 0:n.querySelector("svg")},Oe=function(e){return be(e)},De=function(e){a(document.querySelectorAll("[video-idx]")).map((function(n){var t=n.getAttribute("video-idx");n.style.border=t==e?"2px solid white":"none"}))},Ve=function(){var e=a(document.getElementsByClassName("vjs-control vjs-button open"));null==e||e.map((function(e){var n,t;null==e||null===(n=e.childNodes)||void 0===n||null===(t=n[0])||void 0===t||t.click()}))},Le=function(e){return e?e+"?impolicy=resize&w=1920&h=1080":null},Se="",Ce=function(e,n){var t,o=function(){return function(e,n){var t=window.matchMedia("(orientation: portrait)").matches?"potrait":"landscape",o=document.getElementById(e);if(o&&Se!==t){var i=window.getComputedStyle(o,null).getPropertyValue("height");n&&(n.style.height="".concat(i)),Se=t}}(e,n)};window._orientationChangeHandler=o;window.addEventListener("resize",(function(){clearTimeout(t),t=setTimeout((function(){o()}),100)}))},Ae=function(e,n){var t,o=Ue(e),i=Ue(e).el(),r=new ResizeObserver((function(){var o;null!==(o=n.classList)&&void 0!==o&&o.contains("hidden")||(t&&clearTimeout(t),t=setTimeout((function(){Re(e,n)}),200))}));r.observe(i),o.on("dispose",(function(){r.disconnect()})),o.on("fullscreenchange",(function(){setTimeout((function(){Re(e,n)}),50)}))},Re=function(e,n){var t;if(n){var o=document.getElementById(e),i=null===(t=window.getComputedStyle(o,null))||void 0===t?void 0:t.height;n.style.height!==i&&(n.style.height="".concat(i))}};function We(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 ke=function(e){o(e).play()},Fe=function(e){o(e).pause()},Pe=function(e,n){var t=o(e),i=t.currentTime()+n;t.currentTime(i)},Ne=function(e,n){var t=o(e),i=t.currentTime(),r=i<=n?0:i-n;t.currentTime(r)},xe=function(e){return!!o.getPlayer("".concat(e))},je=function(e){return o(e).paused()},Ue=function(e){return!!o.getPlayer("".concat(e))&&o.getPlayer("".concat(e))},Be=function(){var e=n(t.mark((function e(n,o){var i,r,a,l=arguments;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=l.length>2&&void 0!==l[2]&&l[2],e.next=3,P();case 3:return r=e.sent,a=Ue(n),e.abrupt("return",new Promise((function(e,t){v(o,r).then((function(t){var r=null==t?void 0:t.data;r.contentType="linearchannel",r.channelId=null==o?void 0:o.channelId;var l=ue(r,n);l&&i?(Ye(n,l),a.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:r})}))):e({status:!0,msg:"Feed authenticated",response:r})})).catch((function(e){t({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)}}(),He=function(){var e=n(t.mark((function e(n,o,i){var r,a,l,u,d,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,P();case 2:return u=e.sent,q(o),d=0,s=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(a=window)&&void 0!==a&&null!==(l=a.watchHistory)&&void 0!==l&&l.enable&&f(o,u).then((function(e){var n,t,o,i,r,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)),d=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,s=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||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,t){c(o,u).then((function(o){var i,r,a,l,u,c,v,m,p,f,g=null==o?void 0:o.data,I=(null==g||null===(i=g.video)||void 0===i||null===(r=i.streamingInfo)||void 0===r?void 0:r.isLiveStream)||!1;x(o.data);var E=(null==g||null===(a=g.ads)||void 0===a||null===(l=a.preRoll)||void 0===l||null===(u=l.adTags)||void 0===u||null===(c=u.web)||void 0===c?void 0:c.active)&&(null==g||null===(v=g.ads)||void 0===v||null===(m=v.preRoll)||void 0===m||null===(p=m.adTags)||void 0===p||null===(f=p.web)||void 0===f?void 0:f.url);E&&we(n,E,g);var y=ue(g,n);if(y){var w,h,T,_,b,O,D,V,L,S,C,A,R,W,k=(null==g||null===(w=g.video)||void 0===w||null===(h=w.gist)||void 0===h?void 0:h.videoImageUrl)||(null==g||null===(T=g.video)||void 0===T||null===(_=T.gist)||void 0===_||null===(b=_.imageGist)||void 0===b?void 0:b.r16x9),F=Ue(n);if(F.poster(k),Ye(n,y),F.on("loadstart",(function(){I&&e({status:!0,msg:"Video Loaded",response:g})})),F.on("loadeddata",(function(){K(),e({status:!0,msg:"Video Loaded",response:g})})),F.one("play",(function(){d&&s<95&&setTimeout((function(){F.currentTime(d)}),0)})),F.one("error",(function(){var e;t({status:!1,msg:(null==F||null===(e=F.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==g||null===(O=g.video)||void 0===O||null===(D=O.contentDetails)||void 0===D||null===(V=D.closedCaptions)||void 0===V?void 0:V.length)>0||(null==g||null===(L=g.video)||void 0===L||null===(S=L.closedCaptions)||void 0===S?void 0:S.length)>0)C=((null==g||null===(A=g.video)||void 0===A||null===(R=A.contentDetails)||void 0===R?void 0:R.closedCaptions)||(null==g||null===(W=g.video)||void 0===W?void 0:W.closedCaptions)).filter((function(e){return"VTT"===e.format})),Ee(n,C);else Ie(n)}else J(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(e){qe(e,n,t,o)}))})));case 8:case"end":return e.stop()}}),e)})));return function(n,t,o){return e.apply(this,arguments)}}(),Me=function(e,n,t){var o=Ue(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)}))}))},ze=function(e){var n=Ue(e);if(Ge(),window._orientationChangeHandler&&(window.removeEventListener("resize",window._orientationChangeHandler),delete window._orientationChangeHandler),window._multiplayer_dbClickHandler&&(window.removeEventListener("dblclick",window._multiplayer_dbClickHandler),delete window._multiplayer_dbClickHandler),window._multiplayer_dbTapHandler&&(window.removeEventListener("touchend",window._multiplayer_dbTapHandler),delete window._multiplayer_dbTapHandler),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},Ge=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()},Ye=function(e,n){var t=Ue(e);t&&t.src(n)},qe=function(n,t,o,i){var r,a,l,u,d,s,c=null==n||null===(r=n.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(u=l.data)||void 0===u?void 0:u.errorMessage)||(null==n?void 0:n.message);xe(t)&&J(t,(null===(d=window)||void 0===d?void 0:d.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?We(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):We(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}))},Xe=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{Ae as $,N as A,V as B,O as C,Te as D,c as E,qe as F,m as G,v as H,f as I,Le as J,we as K,me as L,Ee as M,X as N,U as O,be as P,Oe as Q,B as R,H as S,De as T,je as U,M as V,Ie as W,_e as X,Ve as Y,Re as Z,Ce as _,j as a,Y as a0,q as a1,Ue as b,ue as c,Z as d,x as e,K as f,P as g,J as h,G as i,g as j,z as k,Ye as l,Me as m,Pe as n,Fe as o,ke as p,xe as q,Ne as r,p as s,He as t,Be as u,ze as v,pe as w,fe as x,ge as y,Xe as z};
@@ -1 +0,0 @@
1
- import{i as e,j as l,k as t,g as n,h as i,d as o,l as a,m as r,n as s,o as d}from"./features-e13a7a55.js";import{M as u,a as v,c as m,d as c}from"./icons-3e9a1686.js";import{R as p,b as f,S as g,y as h,Q as y,d as b}from"./generic-735b9e62.js";import{g as C}from"./renditions-e3fe9bf6.js";import x from"@babel/runtime/helpers/toConsumableArray";import{s as j}from"./autoNextVideo-f070f6bd.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"./util-536c46af.js";var E=p(),N=[];null==E||E.map((function(e){return N.push.apply(N,x(e.episodes))}));var w=function(e,l){var t=f(e),n=Math.floor(t.currentTime());if(Math.floor(t.duration())!=n){t.pause(e);var i=g();j(i,e,N)}};function B(n,i){var o=f(n);o&&(o.on("loadeddata",(function(){var t,a,r;(null===(t=C(n))||void 0===t?void 0:t.length)>0&&e(n,i),(null===(a=h(n))||void 0===a?void 0:a.length)>0&&l(n,i),null!=i&&null!==(r=i.series)&&void 0!==r&&r.enable&&function(e,l){var t;null==l||null===(t=l.series)||void 0===t||t.cb;var n=f(e);n.on("timeupdate",(function(){var e,l=Math.floor(n.currentTime()),t=n.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];t-l<=10&&g()<=(null==N?void 0:N.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}));var i,o=N.filter((function(e,l){return l==g()}));if((null==o?void 0:o.length)>0)if(null!==(i=document.getElementsByClassName("next-ep-preview"))&&void 0!==i&&i[0]){var a,r,s,d,u,v,m,c,p,h,y;(null===(a=document.getElementsByClassName("next-ep-preview"))||void 0===a?void 0:a[0]).style.visibility="hidden";var b=null===(r=document.getElementsByClassName("next-ep-title"))||void 0===r?void 0:r[0],C=null===(s=document.getElementsByClassName("next-ep-img"))||void 0===s?void 0:s[0],x=null===(d=document.getElementsByClassName("next-ep-content"))||void 0===d?void 0:d[0],j=null===(u=o[0])||void 0===u?void 0:u.title;(null===(v=j)||void 0===v?void 0:v.length)>60&&(j=j.substr(0,60)+"..."),b.textContent="".concat(j),C.src=(null===(m=o[0])||void 0===m||null===(c=m.gist)||void 0===c||null===(p=c.imageGist)||void 0===p?void 0:p.r16x9)||(null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.fallbackImage),x.onclick=function(){return w(e)}}else{var E,B,V,k,I,M,P,T=document.createElement("div");T.className="next-ep-preview",T.style.visibility="hidden",document.getElementById(e).append(T);var D=document.createElement("div");D.className="next-ep-header",D.textContent="Next up";var L=null===(E=o[0])||void 0===E?void 0:E.title,R=document.createElement("img");R.className="next-ep-img",R.src=(null===(B=o[0])||void 0===B||null===(V=B.gist)||void 0===V||null===(k=V.imageGist)||void 0===k?void 0:k.r16x9)||(null===(I=window)||void 0===I||null===(M=I.customData)||void 0===M?void 0:M.fallbackImage);var F=document.createElement("div");F.className="next-ep-title",(null===(P=L)||void 0===P?void 0:P.length)>60&&(L=L.substr(0,60)+"..."),F.textContent="".concat(L);var G=document.createElement("div");G.className="next-ep-content",G.append(R),G.append(F),G.onclick=function(){return w(e)},T.append(D),T.append(G)}}(n,i),function(e,l){var t,n=Math.floor(e/60),i=null===(t=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===t?void 0:t[0];i&&(i.style.marginRight=n>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],a=document.getElementsByClassName("vjs-time-control");l&&o.classList.value.includes("vjs-hidden")&&(a[0].style.display="block",i&&(i.style.marginRight="56px"))}(o.duration(),(null==i?void 0:i.liveVideo)||!1)})),o.one("play",(function(){var e,l,i,o;null!==(e=window)&&void 0!==e&&null!==(l=e.customData)&&void 0!==l&&l.iframeOverlayUrl&&t(n,null===(i=window)||void 0===i||null===(o=i.customData)||void 0===o?void 0:o.iframeOverlayUrl)})))}function V(e,l){!function(){"Chrome"==b()&&import("./chromett-a3cbb2e1.js").then((function(e){var l=document.createElement("style");l.id="chromett",l.append("".concat(e.default)),document.head.appendChild(l)}));import("./skin-808893ac.js").then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)}))}(),B(e,l),function(e,l){var t,n,i,o,a,r,s=f(e);null==s||null===(t=s.controlBar)||void 0===t||null===(n=t.getChild("FullscreenToggle"))||void 0===n||null===(i=n.el())||void 0===i||i.appendChild(y(u(window.controlsColor))),null==s||null===(o=s.controlBar)||void 0===o||null===(a=o.getChild("FullscreenToggle"))||void 0===a||null===(r=a.el())||void 0===r||r.appendChild(y(v(window.controlsColor)));var d=document.getElementsByClassName("vjs-time-control");l.liveVideo&&d[0]&&(d[0].style.display="none")}(e,l),function(e,l){var t,u,v,p,f,g;0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)&&n(e,"defaultV2",m());(0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)||1==(null==l?void 0:l.liveui))&&i(e,"defaultV2",c());l.liveVideo||o(e);(null==l||null===(t=l.relatedVideos)||void 0===t||null===(u=t.content)||void 0===u?void 0:u.length)>0&&a(e,null==l?void 0:l.relatedVideos);(null==l||null===(v=l.streams)||void 0===v?void 0:v.length)>1&&r(e,null==l?void 0:l.streams);(null==l||null===(p=l.playlist)||void 0===p||null===(f=p.content)||void 0===f?void 0:f.length)>0&&s(e,null==l?void 0:l.playlist);null!=l&&null!==(g=l.series)&&void 0!==g&&g.enable&&d(e,l)}(e,l),function(e,l){var t=f(e),n=null==l?void 0:l.tvProviderLogoUrl;if(!n)return;var i=document.createElement("div");i.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(n),o.alt="Provider Image",i.append(o),t.el().appendChild(i),t.on("useractive",(function(){i.classList.remove("vjs-fade")})),t.on("userinactive",(function(){t.paused()||i.classList.add("vjs-fade")})),t.on("fullscreenchange",(function(){t.isFullscreen_?i.style.top="3.2rem":i.style.top="1rem"}))}(e,l)}export{V as initialiseSkin};