@viewlift/player-backup 2.0.196-backup → 2.0.197-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.
package/cjs/bundle.css CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
 
4
4
 
5
+
5
6
  .video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
6
7
  height: 0.7em;
7
8
  position: absolute;
@@ -223,7 +224,6 @@
223
224
 
224
225
 
225
226
 
226
-
227
227
  /* CSS for videojs-dvr-seekbar */
228
228
 
229
229
  .video-js.vjs-dvr-seekbar {
@@ -398,6 +398,7 @@
398
398
 
399
399
 
400
400
 
401
+
401
402
  .video-js .multicamera-parent.default{
402
403
  height: 345px;
403
404
  position: absolute;
@@ -479,7 +480,6 @@
479
480
 
480
481
 
481
482
 
482
-
483
483
  /* nextep */
484
484
  .next-ep-preview{
485
485
  position: absolute;
@@ -0,0 +1 @@
1
+ "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator");require("axios");var o=require("./generic-dc7b4a94.js"),r=require("./player_instance-fcf6a8fb.js"),i=require("video.js"),l=require("./util-7a0f40d6.js"),a=require("./captions-dbc83a75.js"),u=require("./resolution-f9dcc1b4.js"),s=require("./skin-516012d7.js"),d=require("./localisation-56e0a999.js"),c=require("./currentVideoInfo-31d70bec.js"),v=require("@babel/runtime/helpers/typeof"),p=require("./icons-2609dbe4.js"),f=require("./helper-a50a8ffc.js"),g=require("@babel/runtime/helpers/toConsumableArray"),m=function(e){return new Promise((function(n,t){if(y(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}}))},y=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},h=function(e,n,t){var o=r.getPlayer(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},b=function(e){var n=r.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},w=function(){var e=n(t.mark((function e(n){var l,a,u,s,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=r.getPlayer(null==n?void 0:n.playerId),null!=n&&null!==(l=n.series)&&void 0!==l&&l.enable||!(null!=n&&n.chromecastReceiverId||null!=n&&n.airplay)){e.next=10;break}return e.prev=2,e.next=5,m("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.log("Error",e.t0);case 10:if(null!=n&&null!==(a=n.series)&&void 0!==a&&a.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=13,import("@silvermine/videojs-chromecast");case 13:e.sent.default(i),(d=i.getTech("chromecast"))&&!d.prototype.seeking&&(d.prototype.seeking=function(){}),null!==(s=window)&&void 0!==s&&s.cast?null==u||u.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==u||u.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==o.detectBrowser()?null==u||u.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(n){return e.apply(this,arguments)}}(),k=function(e,n){var t=r.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,r,l,a,u=this.el(),s=i.dom.getPointerPosition(u,n).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*s,v.seek()}}))};var S=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),m("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))]);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("@viewlift/comscore/index.js").then((function(e){o.comscoreInstanceManager.set(e)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),O=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then((function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),P=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(i),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./index-3f0e537b.js")}));case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),j=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./videojs-dash5.es-3854764f.js")}));case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),C=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){m("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(i)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(i)}))},loadAdsLibrary:S,loadEMELibrary:O,loadMuxPlugin:P,loadDvrSeekbar:T,loadContribDash:j,loadComscorePlugin:I});function E(e){return D.apply(this,arguments)}function D(){return(D=n(t.mark((function e(n){var r,i,l;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(null==n?void 0:n.airplay)||!1,e.next=3,S();case 3:r&&"Safari"==o.detectBrowser()?Promise.resolve().then((function(){return C})).then((function(e){e.importAirplay()})):(l=(null===(i=document)||void 0===i?void 0:i.getElementById(null==n?void 0:n.playerId))||null)&&l.setAttribute("x-webkit-airplay","deny");case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function x(e){return R.apply(this,arguments)}function R(){return(R=n(t.mark((function e(n){var o,i,l,a,u,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=r.getPlayer(n.playerId),e.next=3,I();case 3:s.comscore({publisherId:null==n||null===(o=n.comscore)||void 0===o?void 0:o.publishedId,endpoint:null==n||null===(i=n.comscore)||void 0===i?void 0:i.endpoint,implementationId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.implementationId,projectId:null==n||null===(a=n.comscore)||void 0===a?void 0:a.projectId,debug:(null==n||null===(u=n.comscore)||void 0===u?void 0:u.debug)||!1});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function L(e,n){return A.apply(this,arguments)}function A(){return(A=n(t.mark((function e(n,r){var i,l,a,u,s,d,c,v,p,f,g,m;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v=(null==r?void 0:r.contentType)||"video",p=null==r||null===(i=r[v])||void 0===i?void 0:i.drmEnabled,null==r||null===(l=r[v])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==r||null===(u=r[v])||void 0===u||null===(s=u.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.dash)||null,g=(null==n||null===(c=n.comscore)||void 0===c?void 0:c.enable)||!1,e.prev=6,e.next=9,Promise.allSettled([p?"Safari"==o.detectBrowser()?O():"caliente"!=(null===(m=window)||void 0===m?void 0:m.siteName)?j():O():"Safari"!=o.detectBrowser()&&f?j():null,g?x(n):null,w(n)]);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:case"end":return e.stop()}}),e,null,[[6,11]])})))).apply(this,arguments)}function N(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 V(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?N(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):N(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var _=new Set,B=null,M=function(e,n,t){var r,i,l,a,u,s,d,v={},p=(null==e?void 0:e.contentType)||"video";v["c3.cm.id"]=(null===(r=e[p])||void 0===r?void 0:r.id)||"Null",v["c3.cm.contentType"]=J(e),v[null==t||null===(i=t.Constants)||void 0===i?void 0:i.IS_LIVE]=!(null==e||!e.linearchannel),v[null==t||null===(l=t.Constants)||void 0===l?void 0:l.STREAM_URL]=n.currentSrc(),v[null==t||null===(a=t.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===o.getUserId()?"NULL":o.getUserId(),v["c3.cm.categoryType"]=F(e),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(u=e[p])||void 0===u?void 0:u.drmEnabled)||"None",v.DAIStream=null!==(s=e[p])&&void 0!==s&&null!==(d=s.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",v[t.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=W(e),v["c3.cm.genreList"]=U(e),v["c3.cm.genre"]=H(e),v["c3.cm.channel"]=q(e);var f=X(c.getCurrentSeries(),e);return v=V(V({},v),f)},H=function(e){var n,t,o,r=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[r])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},U=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map((function(e){return null==e?void 0:e.title})).join(", ")||"Null"},q=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},F=function(e){return(null==e?void 0:e.contentType)||"null"},W=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return r?"YES":"NO"},G=function(e,n){var t,o,r=(n||{}).epg;if(r&&null!=r&&r.enable&&null!=r&&r.programTitle)return r.programTitle;var i=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[i])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},J=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var K,z,X=function(e,n){var t,r,i,l,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var s=o.getSeasonNumber(),d=o.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(r=t.series)||void 0===r?void 0:r.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(i=e[s-1])||void 0===i||null===(l=i.episodes)||void 0===l||null===(a=l[d-1])||void 0===a?void 0:a.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},Y=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},Q=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},$=function(){var e=n(t.mark((function e(n,o){var i,l,a,u,s,d,v,p,f,g;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},l=i.trackConvivaPlayerEvent,a=i.paymentHandler,u=i.tveProvider,s=i.enable,d=i.appName,v=(o||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(p=r.getPlayer(n),"function"==typeof(f=l)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,f("getConvivaObject");case 10:if(g=e.sent){e.next=13;break}return e.abrupt("return");case 13:p.ready((function(){var e=p.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=Y(t.keySystem);f("contentInfo",{DRMEnabled:o})}else f("contentInfo",{DRMEnabled:"None"})})),n||f("contentInfo",{DRMEnabled:"None"})})),p.on("loadstart",(function(){var e,n;B&&B!==p.currentSrc()&&f("playbackEnded"),f("setPlayer",p),_.clear(),B=p.currentSrc();var t=Q(p.currentType()),r=c.getCurrentVideo(),i=M(r,p,g);i[null==g||null===(e=g.Constants)||void 0===e?void 0:e.PLAYER_NAME]=d||"WEB",i[null==g||null===(n=g.Constants)||void 0===n?void 0:n.ASSET_NAME]=G(r,o),i.authToken=v||"NULL",i.streamType=t,i.D2CType=a||"NONE",i.subscriberType=u||(a?"D2C":"FREE"),i["c3.cm.affiliate"]=u||"NULL",Z.setData(i),f("contentInfo",i)})),p.on("loadedmetadata",(function(){var e,n=p.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),f("contentInfo",{screenResolution:e})})),p.on("play",(function(){_.has(p.currentSrc())||(_.add(p.currentSrc()),f("playbackStarted",null))})),p.on("ended",(function(){_.has(p.currentSrc())&&_.delete(p.currentSrc()),f("playbackEnded")})),p.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&f("initAdSensor",{player:p,adsLoader:null==e?void 0:e.adsLoader})})),p.on("dispose",(function(){null==_||_.clear(),f("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Z=(K={},{setData:function(e){K=V(V({},K),e)},getData:function(){return K}}),ee=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-b08b92d0.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-9be02be9.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-36ecc705.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-32ffda5a.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-07e3b037.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t?Promise.resolve().then((function(){return require("./skin-b8dd131f.js")})).then((function(t){t.initialiseSkin(e,n)})):"news"==t&&Promise.resolve().then((function(){return require("./skin-85e9a926.js")})).then((function(t){t.initialiseSkin(e,n)}))};function ne(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 te(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ne(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var oe=[],re=0,ie=null;function le(){console.log("Cleaning up watch history data"),z=null,oe=[],re=0,ie=null}function ae(e,n,t){var r,i,l,a,u,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(r=n.watchHistory)||void 0===r||r.apiVersion;var d=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,c=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(l=n.watchHistory)||void 0===l||l.xapiKey;var p=(null==n||null===(a=n.video)||void 0===a?void 0:a.originalObjectId)||null,f=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,g=Math.floor(e.currentTime()),m=s?100:Math.floor(c/v*100),y={};f?se(y={completed:s,watchedTime:g,watchedPercentage:m},d,n.siteOwner):(y=te(te({videoId:z,watchedTime:g,watchedPercentage:m,doneWatching:s,profileId:d},ie&&{seriesId:ie}),p&&{originalObjectId:p}),o.saveWatchHistory(y).then((function(e){})).catch((function(e){}))),re=c+t}function ue(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function se(n,t,o){var r=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),i=ue(r),l=(new Date).getTime(),a=c.getCurrentVideo(),u=(null==a?void 0:a.video)||{},s=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(n,t){return te(te({},n),{},e({},t,u[t]))}),{}),d=i.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===z}));d<0?i.push(te(te({content:s},n),{},{addedDate:l,updateDate:l})):i[d]=te(te(te({},i[d]),n),{},{updateDate:l}),localStorage.setItem("".concat(r),JSON.stringify(i))}function de(e,n,t){var o=ue(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),r=[];return o&&Array.isArray(o)&&(r=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),r}var ce=!1,ve=function(e,n){var t,r,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(r=t.streamingInfo)||void 0===r?void 0:r.secondaryVideoAssets)||null)&&!ce){var l=pe(e,"videoAssets","secondaryVideoAssets"),a=o.getSource(l,n);return a&&o.loadVideo(n,a),ce=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function pe(e,n,t){if(Array.isArray(e))return e.map((function(e){return pe(e,n,t)}));if(null!==e&&"object"===v(e)){var o={};return Object.keys(e).forEach((function(r){r===n&&void 0!==e[t]?o[r]=e[t]:r===t&&void 0!==e[n]?o[r]=e[n]:o[r]=pe(e[r],n,t)})),o}return e}function fe(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return ge(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ge(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function ge(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function me(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 ye(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?me(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):me(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var he=function(e,n,t,i){var l,u,s,d,p,f=i.res,g=i.sres,m=r.getPlayer(e),y=(null==f?void 0:f.contentType)||"video",b=(null==f||null===(l=f[y])||void 0===l?void 0:l.drmEnabled)||!1,w=(null==f||null===(u=f[y])||void 0===u||null===(s=u.streamingInfo)||void 0===s?void 0:s.isLiveStream)||!1,k=(null==f||null===(d=f[y])||void 0===d||null===(p=d.liveDetails)||void 0===p?void 0:p.isDvrEnabled)||!1;c.setCurrentVideo(f),c.videoReplayTracker.set(f),m&&(m.on("loadstart",(function(){w?t.resolve({status:!0,msg:"Video Loaded",response:f}):t.resolve(ye({status:!0,msg:"Player Initialised"},g?{seriesResponse:g,response:f}:{response:f}))})),m.on("loadeddata",(function(){var t,i,l,u=a.getCaptions(e);if(null==u||u.map((function(n){return a.disableCaptions(e,n.id)})),k&&"Safari"===o.detectBrowser())try{var s;null==m||null===(s=m.liveTracker)||void 0===s||s.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&h(e,sessionStorage.getItem("volume")||"100");var d=c.getCurrentVideo();if(o.initialiseComscoreStreamingTracking(n,f),o.clearError(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.saveOffline)){var v,p,g=ye(ye({},n),f);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(ie=null==n||null===(i=n.series)||void 0===i?void 0:i.id),oe=[],re=0,z=t;var a=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,u=r.getPlayer(e);u&&(u.on("dispose",le),u.on("timeupdate",(function(){if(!u.seeking()){var e=Math.floor(u.currentTime());oe.includes(re)||(e!=re||e<a?e>re&&(re=e+a):(oe.push(e),ae(u,n,a)))}})),u.one("ended",(function(){ae(u,n,a,!0)})))}(e,g,null==d||null===(v=d.video)||void 0===v||null===(p=v.gist)||void 0===p?void 0:p.id)}if(null!=n&&null!==(l=n.analytics)&&void 0!==l&&l.muxKey&&null!=m&&m.mux){var y,b,w,S,I,O,P=(null===(y=c.getCurrentVideo())||void 0===y?void 0:y.video)||(null==f?void 0:f.video),T=null==P?void 0:P.gist,j={env_key:null==n||null===(b=n.analytics)||void 0===b?void 0:b.muxKey,player_name:"vl-web-player",player_version:null===(w=window)||void 0===w?void 0:w.vl_player_version,video_id:null==T?void 0:T.id,video_title:null==T?void 0:T.title,video_series:null==P||null===(S=P.series)||void 0===S?void 0:S.title,video_stream_type:null!=P&&null!==(I=P.streamingInfo)&&void 0!==I&&I.isLiveStream?"live":"video",viewer_user_id:null==n||null===(O=n.analytics)||void 0===O?void 0:O.userId};m.mux({debug:!1,data:j})}})),m.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];m.trigger("subtitlechanged",n)})),m.on("subtitlechanged",(function(e,n){var t,o,r,i,l,a,u,s,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(i=r.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(d=s.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var g,m=f.getMediaSession(),y=m.media.tracks.filter((function(e){return"TEXT"==e.type}));g=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),m.editTracksInfo(g)}})),m.tech_.on("retryplaylist",(function(){w&&ve(f,e)})),m.on("error",(function(){var n,r;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&w)?ve(f,e):(o.handleError(e,(null==m||null===(n=m.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==m||null===(r=m.error())||void 0===r?void 0:r.message)||"Some error occured",response:f}))})),m.one("play",(function(){var e,t,o,r,i;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(o=t.appcmsMain)||void 0===o||null===(r=o.adsConfig)||void 0===r||!r.vodAdClientSideTracking){if(null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable){var l,a,u,s=null===(l=c.getCurrentVideo())||void 0===l||null===(a=l.video)||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.id,d=c.getSeriesWatchMap(),v=(null==d?void 0:d.get(s))||{t:0,p:0},p=v.t,f=v.p;p&&f<95&&setTimeout((function(){m.currentTime(p)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){m.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}})),m.on("volumechange",(function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),m.on("chromecastDisconnected",(function(){if(w){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}})),m.one("loadeddata",(function(){var e,n=(null==m||null===(e=m.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort((function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0})),"object"==v(m.dash)){var t,r,i,l=null==m||null===(t=m.dash)||void 0===t||null===(r=t.mediaPlayer)||void 0===r?void 0:r.getTracksFor("audio"),a=null==l?void 0:l.find((function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")})),u=fe(n);try{for(u.s();!(i=u.n()).done;){var s=i.value;if(a&&(null==s?void 0:s.id)=="dash-audio-".concat(a.index)){s.enabled=!0;break}}}catch(e){u.e(e)}finally{u.f()}}else{var d,c=fe(n);try{for(c.s();!(d=c.n()).done;){var p,f,g,y=d.value;if(("Chrome"==o.detectBrowser()||"Edge"==o.detectBrowser()&&(null!==(p=navigator)&&void 0!==p&&null!==(f=p.userAgent)&&void 0!==f&&f.includes("Macintosh")||!b))&&null!=y&&null!==(g=y.label)&&void 0!==g&&g.includes("5.1"))m.audioTracks().removeTrack(y);else{if("main"==y.kind){y.enabled=!0;break}y.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}})))};function be(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function we(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach((function(e){e.remove()}))}function ke(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(c.getCurrentEpgPrograms()||[]).filter((function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n})).map((function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}}))}function Se(e,n){var t=r.getPlayer(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,l=n.videoId;n.epg;var a=i.playLive,u=i.playFromBegining,s=i.programs;c.setCurrentEpgPrograms(s),t.on("loadeddata",(function(){f.checkDvrStartOverEnabled(n)?u?f.playFromBeginningHandler(t,n):a?f.playLiveOrResumeHandler(t,l):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,r=n.videoId,i=n.epg,l=o.buttonConfig,a=void 0===l?{}:l,u=a.watchLive;a.resume;var s=a.startFromBegining,d=r;if(i&&null!=i&&i.enable){var c=JSON.parse(sessionStorage.getItem("epgConfig"));d="".concat(null==c?void 0:c.programId,"-").concat(null==c?void 0:c.channelId)}var v=!!f.getWatchedTime(d),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var g=f.getCurrentProgramThumbnail(n);g&&(p.style.backgroundImage="url(".concat(g,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.innerHTML=Oe(o,v),p.style.display="flex",e.el().appendChild(p),f.pauseAndHideControl(e),Ie("watch-live-resume-btn",u,(function(){f.showControl(e,p),f.playLiveOrResumeHandler(e,d)})),Ie("watch-begining-btn",s,(function(){f.showControl(e,p),f.playFromBeginningHandler(e,n)}))}(t,n),f.handleLiveStartOverBtn({player:t,showWatchLive:!0,showStartOver:!0})):f.removeDvrStartOver(t)})),t.one("loadedmetadata",(function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),r=!1,i=e.seekable(),l=i.start(0),a=i.end(i.length-1)-l,u=JSON.parse(sessionStorage.getItem("epgConfig")),s=t,d=!0;if(u&&null!=u&&u.enable){var c;d=(null==n||null===(c=n.epg)||void 0===c?void 0:c.programId)===(null==u?void 0:u.programId),s=null==u?void 0:u.programId}e.on("seeking",(function(){r=!0})),e.on("seeked",(function(){r=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!d||sessionStorage.getItem("program_switched"))return;s="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}f.saveWatchedTime(s,o),f.getProgramStartTime(e,n),f.handleLiveStartOverBtn({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})})),e.on("timeupdate",(function(){if(!r){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!d||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");s="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(f.saveWatchedTime(s,t),o=t,function(e,n){ke(n).forEach((function(t){var o=t.id,r=t.title,i=t.time,l=document.getElementById(o);if(l){var a=Math.min(i/n*100,99.5);l.style.left="".concat(a,"%")}else{var u=e.controlBar.progressControl.seekBar.el(),s=be(o,r,Math.min(i/n*100,99.5));u.appendChild(s)}}))}(e,a))}}))}(t,n)}))}else console.warn("Player instance is required to initialize start over.")}function Ie(e,n,t){var o,r,i=document.getElementById(e);i&&(r=n,(o=i)&&(o.style.color="".concat((null==r?void 0:r.textColor)||"#000"),o.style.backgroundColor="".concat((null==r?void 0:r.backGroundColor)||"#DCF95B")),i.addEventListener("click",t))}function Oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,r=t.resume,i=t.startFromBegining,l=n?(null==r?void 0:r.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(p.watchLiveIcon2()," ").concat(l,"</button>"),u='<button id="watch-begining-btn">'.concat(p.startLiveIcon()," ").concat((null==i?void 0:i.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(u,"</div>")}function Pe(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 Te(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Pe(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var je=function(l,u,d,c){var v,p,f,g,m,y,h,b,w,S,I,O,P,T,j,C,E,D,x,R,A,N,V,_,B,M,H,U,q,F,W,G,J,K,z,X,Y,Q,ne,te,oe=u.res,re=void 0===oe?null:oe,ie=u.sres,le=void 0===ie?null:ie,ae=null!=d&&d.chromecastReceiverId?["chromecast","html5"]:["html5"],ue=(null===(v=re)||void 0===v?void 0:v.contentType)||"video",se=s.impolicy16x9(null===(p=re)||void 0===p||null===(f=p[ue])||void 0===f||null===(g=f.gist)||void 0===g?void 0:g.videoImageUrl)||s.impolicy16x9(null===(m=re)||void 0===m||null===(y=m[ue])||void 0===y||null===(h=y.gist)||void 0===h||null===(b=h.imageGist)||void 0===b?void 0:b.r16x9),de=(null===(w=re)||void 0===w||null===(S=w[ue])||void 0===S||null===(I=S.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,ce=(null===(O=re)||void 0===O||null===(P=O[ue])||void 0===P||null===(T=P.streamingInfo)||void 0===T?void 0:T.isLiveStream)||!1,ve=(null===(j=re)||void 0===j||null===(C=j.ads)||void 0===C||null===(E=C.preRoll)||void 0===E||null===(D=E.adTags)||void 0===D||null===(x=D.web)||void 0===x?void 0:x.active)&&(null===(R=re)||void 0===R||null===(A=R.ads)||void 0===A||null===(N=A.preRoll)||void 0===N||null===(V=N.adTags)||void 0===V||null===(_=V.web)||void 0===_?void 0:_.url),pe=(null===(B=re=Te(Te({},re),{},{audioAssetSource:null==d?void 0:d.audioAssetSource}))||void 0===B||null===(M=B[ue])||void 0===M?void 0:M.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(H=window)||void 0===H||null===(U=H.app_data)||void 0===U||null===(q=U.appcmsMain)||void 0===q||null===(F=q.adsConfig)||void 0===F?void 0:F.vodAdSticherProvider)||!1,fe=(null==d?void 0:d.latency)||6,ge=(null==d?void 0:d.skin_settings)||{};null==d||d.dvrConfig;var me=(ne={enableSmoothSeeking:!0,controls:0!=(null==d?void 0:d.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==d?void 0:d.muted)||!1,autoplay:(null==d?void 0:d.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==ge?void 0:ge.pictureInPictureToggle)||!1},playbackRates:null!=ge&&ge.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==d.skin,liveui:de},e(ne,"autoplay",null==d?void 0:d.autoplay),e(ne,"normalizeAutoplay",(null==d?void 0:d.autoplay)&&!ve),e(ne,"loop",(null==d?void 0:d.loop)||!1),e(ne,"audioPosterMode",null==d?void 0:d.audioPosterMode),e(ne,"html5",Te(Te({dash:Te(Te(Te({},!i.browser.IS_SAFARI&&{useTTML:!0}),(null==d?void 0:d.debugConfig)&&(null==d||null===(W=d.debugConfig)||void 0===W?void 0:W.enable)&&{debug:!0,logLevel:null!=d&&null!==(G=d.debugConfig)&&void 0!==G&&G.logLevel?null==d||null===(J=d.debugConfig)||void 0===J?void 0:J.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:fe},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Te(Te({liveRangeSafeTimeDelta:fe,useDevicePixelRatio:!0,experimentalLLHLS:(null==d?void 0:d.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==d||null===(K=d.customData)||void 0===K?void 0:K.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===(z=null==d?void 0:d.enableLowInitialPlaylist)||void 0===z||z}),debug:(null==d?void 0:d.debugConfig)&&(null==d||null===(X=d.debugConfig)||void 0===X?void 0:X.enable)||!1,nativeTextTracks:"Safari"==o.detectBrowser()},0==(null==d||null===(Y=d.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==d||null===(Q=d.customData)||void 0===Q?void 0:Q.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(ne,"poster",se),e(ne,"techOrder",ae),e(ne,"chromecast",{requestCustomDataFn:function(e){var n,t,o=r.getPlayer(l),i=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind})),a=function(e,n,t){var o,r,i,l,a,u,s,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var g,m,y,h,b,w,k,S;f.isDrmEnabled=!0;var I=(null==n||null===(g=n.keySystems)||void 0===g?void 0:g["com.widevine.alpha"])||null,O=(null==I?void 0:I.url)||(null==n||null===(m=n.keySystemOptions)||void 0===m||null===(y=m[0])||void 0===y||null===(h=y.options)||void 0===h?void 0:h.serverURL);f.licenseUrl=O;var P=(null==I?void 0:I.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);f.licenseToken=P}var T=(null==e||null===(o=e[p])||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType)||"VIDEO";f.contentType=T;var j=null==e||null===(i=e[p])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;f.duration=j;var C=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;f.mediaTitle=C;var E=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=E,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(re,e,i);return Te(Te({},a),{},{convivaMetaData:Te({customerKey:(null==d||null===(n=d.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==d||null===(t=d.convivaConfig)||void 0===t?void 0:t.debug)||!1},Z.getData())})},modifyLoadRequestFn:function(e){var n,t,o,i,a,u=r.getPlayer(l),s=(null==u?void 0:u.currentSource())||{};!(null===(n=re)||void 0===n||null===(t=n[ue])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(i=o.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(a=s.src)&&void 0!==a&&a.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),ne);if(!i.getPlayers()[l]){null!=d&&d.debugConfig&&null!=d&&null!==(te=d.debugConfig)&&void 0!==te&&te.enable&&i.log.level("debug");var ye=i(l,me,function(){var e=n(t.mark((function e(){var n,r,u,s,v,p,f,g,m,y,h,b,w,S,I,O,P,T,j,C,E;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(ye),console.log(i.VERSION),console.log(i.getPlugins()),e.next=5,L(d,re);case 5:if(w=null===(n=re)||void 0===n||null===(r=n[ue])||void 0===r||null===(u=r.liveDetails)||void 0===u?void 0:u.startOverTime,ce&&c.resolve(Te({status:!0,msg:"Player Initialised"},le?{seriesResponse:le,response:re}:{response:re})),de&&null!=d&&null!==(s=d.dvrConfig)&&void 0!==s&&s.enable&&Se(l,Te(Te({},d),{},{isDvrEnabled:de})),o.inititateBeacon(l,null==d?void 0:d.analyticsCb,null==d?void 0:d.customData),$(l,d),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),de&&k(l,w),!ve||null!=d&&null!==(v=d.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(l,ve,re),S=o.getSource(re,l),console.log(S),null!=d&&d.nearestClusterUrl&&(S=o.getUpdatedClusterSource(S,d.nearestClusterUrl)),!pe){e.next=21;break}return e.next=20,o.getSGAIEnabledSource(l,re);case 20:S=e.sent;case 21:S?o.loadVideo(l,S):(c.reject({status:!1,msg:"Incompatible / Missing Source",response:re}),o.handleError(l,"Incompatible / Missing Source")),((null===(p=re)||void 0===p||null===(f=p[ue])||void 0===f||null===(g=f.contentDetails)||void 0===g||null===(m=g.closedCaptions)||void 0===m?void 0:m.length)>0||(null===(y=re)||void 0===y||null===(h=y[ue])||void 0===h||null===(b=h.closedCaptions)||void 0===b?void 0:b.length)>0)&&(E=(null===(O=re)||void 0===O||null===(P=O[ue])||void 0===P||null===(T=P.contentDetails)||void 0===T?void 0:T.closedCaptions)||(null===(j=re)||void 0===j||null===(C=j[ue])||void 0===C?void 0:C.closedCaptions),I=E.filter((function(e){return"VTT"===e.format||"WEBVTT"===e.format})),a.addCaptions(l,I)),null!=d&&d.disableControls?o.disableControls(l):ee(l,Te(Te(Te({},d),me),{},{liveVideo:ce,isDvrEnabled:de,res:re,sres:le})),he(l,Te(Te(Te({},d),me),{},{liveVideo:ce}),c,{res:re,sres:le});case 25:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())}};function Ce(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Ee(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ce(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var De,xe=function(e,n){var t=n.resolve,o=n.reject,r=null==e?void 0:e.playerId,i=Re(e);je(r,{res:i},e,{resolve:t,reject:o})},Re=function(e){var n,t,r,i,l,a,u,s,d=null==e?void 0:e.streamingInfo,c=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,v=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,p=(null==e||null===(r=e.streamingInfo)||void 0===r||null===(i=r.ads)||void 0===i?void 0:i.url)||null,f=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,m=(null==e||null===(a=e.streamingInfo)||void 0===a?void 0:a.subtitles)||[],y=(null==e||null===(u=e.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.drmProvider)||null,h=null==e?void 0:e.token,b=o.getDecodedToken(h);null==b||b.site;var w=null==b?void 0:b.siteId;return Ee(Ee({id:"".concat(w,"_external")},!v&&{directPlaybackUrl:null==c?void 0:c.url}),{},{video:{drmEnabled:v,streamingInfo:{videoAssets:Ee(Ee({},y&&{drmProvider:y}),{},{widevine:null==c?void 0:c.widevine,fairPlay:null==c?void 0:c.fairPlay,playReady:null==c?void 0:c.playReady})},liveDetails:{isDvrEnabled:null==d?void 0:d.isDvrEnabled},gist:Ee({},f&&{videoImageUrl:f}),contentDetails:Ee({},(null==m?void 0:m.length)>0&&{closedCaptions:g(m)})},ads:{preRoll:{adTags:{web:Ee(Ee({},p&&{active:!0}),p&&{url:p})}}}})};function Le(e,n){return Ae.apply(this,arguments)}function Ae(){return(Ae=n(t.mark((function e(n,r){var i,l,a,u,s,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.resolve,l=r.reject,a=null==n?void 0:n.videoId,u=null==n?void 0:n.playerId,s=!(null==n||!n.anonymousId),e.next=6,o.getToken();case 6:d=e.sent,o.getVideoDetails(a,d).then((function(e){var t,r,v,p;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(r=t.video)||void 0===r||null===(v=r.gist)||void 0===v?void 0:v.contentType,c.setCurrentVideo(null==e?void 0:e.data);var f,g=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(p=n.watchHistory)&&void 0!==p&&p.enable&&!s)if((null===(f=n.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var m,y,h,b=de((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",a,null==n?void 0:n.siteOwner);if(b&&b.length)n.watchHistoryResumeTime=(null===(y=b[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(h=b[0])||void 0===h?void 0:h.watchedPercentage)||null;g.contentType="video",je(u,{res:g},n,{resolve:i,reject:l})}else o.getVideoInfo(a,d).then((function(e){var t,o,r,i,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(r=window)||void 0===r||null===(i=r.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,g.contentType="video"})).catch((function(e){var n,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))})).finally((function(){je(u,{res:g},n,{resolve:i,reject:l})}));else je(u,{res:g},n,{resolve:i,reject:l})})).catch((function(e){o.initiateErrorHandling(e,u,l,a)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ne(e,n){return Ve.apply(this,arguments)}function Ve(){return(Ve=n(t.mark((function e(n,r){var i,l,a,u,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.resolve,l=r.reject,e.next=3,o.getToken();case 3:a=e.sent,u=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,o.getLinearChannelDetails(s,a).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,je(u,{res:t},n,{resolve:i,reject:l})})).catch((function(e){o.initiateErrorHandling(e,u,l,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _e(e,n){return Be.apply(this,arguments)}function Be(){return(Be=n(t.mark((function e(n,r){var i,l,a,u,s,d,v;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=r.resolve,a=r.reject,e.next=3,o.getToken();case 3:u=e.sent,s=null==n?void 0:n.playerId,d=sessionStorage.getItem("season-idx")||0,c.seasonIdxManager.set(parseInt(d)),v=null==n||null===(i=n.series)||void 0===i?void 0:i.id,o.getSeriesDetails(v,u).then((function(e){var t,r,i,d=e.data,p=e.data.seasons;c.setCurrentSeries(p);var f=videoId||(null==p||null===(t=p[0])||void 0===t||null===(r=t.episodes)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.id);o.createSeriesWatchMap(v,u),o.getVideoDetails(f,u).then((function(e){var t,o,r;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType,c.setCurrentVideo(e.data),je(s,{res:null==e?void 0:e.data,sres:d},n,{resolve:l,reject:a})})).catch((function(e){o.initiateErrorHandling(e,s,a,videoId)}))})).catch((function(e){o.initiateErrorHandling(e,s,a)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Me(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 He(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Me(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}exports.VLPlayerCore=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var r=n(t.mark((function n(r,i){var l,a,u,c,v,p,f,g,y,h,b,w,k,S,I,O,P,T,j,C,D,x,R,L,A;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(k=(null==e?void 0:e.videoSourceUrl)||!1,S=null==e?void 0:e.asat,I=(null==e||null===(l=e.epg)||void 0===l?void 0:l.enable)||!1,O=null==e?void 0:e.videoId,P=(null==e||null===(a=e.series)||void 0===a?void 0:a.enable)||!1,T=(null==e?void 0:e.streamingInfo)||!1,window.videoId=O,j=null==e?void 0:e.token,!o.token_authentication_enabled(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",j),o.refreshTokenManager().set(null==e?void 0:e.refreshToken),j&&!o.isTokenExpired(j)){n.next=16;break}return i({status:!1,msg:"".concat(j?"Token is expired !":"Missing Authorization Token"),response:{token:j}}),n.abrupt("return");case 16:De=JSON.parse(atob(j.split(".")[1]));case 17:return window.siteName=null===(u=De)||void 0===u?void 0:u.site,window.siteId=null===(c=De)||void 0===c?void 0:c.siteId,e.isAnonymousUser=!(null===(v=De)||void 0===v||!v.anonymousId),e.siteOwner=(null===(p=De)||void 0===p?void 0:p.site)||null,e.userId=(null===(f=De)||void 0===f?void 0:f.userId)||null,window.sessionStorage.setItem("uid",null===(g=De)||void 0===g?void 0:g.userId),window.watchHistory=e.watchHistory||null,C=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(y=e.series)&&void 0!==y&&y.enable?null:null==e?void 0:e.chromecastReceiverId,D=(null==e||null===(h=e.analytics)||void 0===h?void 0:h.gaId)||null,(x=null==e?void 0:e.errors)&&(window.customErrors=x),window.customData=null==e?void 0:e.customData,d.setLocalisation(null==e||null===(b=e.customData)||void 0===b?void 0:b.localisation),o.baseUrlManager.set(e.apiBaseUrl),null!=e&&e.skin&&!s.isNotAValidSkin(e.skin)||(e.skin="VL_ONE"),n.next=35,E(e);case 35:D&&m("https://www.googletagmanager.com/gtag/js?id=".concat(D)).then((function(){return o.runGtag(D)})).catch((function(e){})),(R=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(C)))&&R.addEventListener("contextmenu",(function(e){return e.preventDefault()})),k?(A={directPlaybackUrl:k,id:L="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},S?o.getVideoDetails(L,j).then((function(n){var t=(null==n?void 0:n.data)||{};je(C,{res:He(He({},t),A)},e,{resolve:r,reject:i})})).catch((function(e){o.initiateErrorHandling(e,C,i,L)})):je(C,{res:A},e,{resolve:r,reject:i})):T?xe(e,{resolve:r,reject:i}):P?_e(e,{resolve:r,reject:i}):I?Ne(e,{resolve:r,reject:i}):Le(e,{resolve:r,reject:i});case 39:case"end":return n.stop()}}),n)})));return function(e,n){return r.apply(this,arguments)}}())},getRenditions:u.getRenditions,skip:o.skip,getPlayer:r.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,authenticateLC:o.authenticateLC,dispose:o.dispose,enableCaptions:a.enableCaptions,disableCaptions:a.disableCaptions,getCaptions:a.getCaptions,playSelectedResolution:u.playSelectedResolution,getSource:o.getSource,setVolume:h,getVolume:b,disableControls:o.disableControls,setPlaybackSpeed:l.setPlaybackSpeed,getEntitlementData:o.getEntitlementData,adsQueuePointManager:o.adsQueuePointManager,getSsaiEvents:o.getSsaiEvents,playerEvents:l.playerEvents,onReplay:l.onReplay,isBehindLive:o.isBehindLive}},exports.initiateMarker=function(e){var n=r.getPlayer(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),l=t.end(t.length-1)-i;we(),ke(l).forEach((function(e){var n=e.id,t=e.title,r=e.time,i=be(n,t,Math.min(r/l*100,99.5));o.appendChild(i)}))}},exports.removeMarkers=we;
package/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";require("video.js/dist/video-js.min.css"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./generic-dc7b4a94.js"),require("./player_instance-fcf6a8fb.js"),require("video.js");var e=require("./index-096edf73.js");require("./util-7a0f40d6.js"),require("./captions-dbc83a75.js"),require("./resolution-f9dcc1b4.js"),require("./skin-516012d7.js"),require("./localisation-56e0a999.js"),require("js-cookie"),require("./currentVideoInfo-31d70bec.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js"),require("@babel/runtime/helpers/typeof"),require("./icons-2609dbe4.js"),require("./helper-a50a8ffc.js"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),module.exports=e.VLPlayerCore;
1
+ "use strict";require("video.js/dist/video-js.min.css"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./generic-dc7b4a94.js"),require("./player_instance-fcf6a8fb.js"),require("video.js");var e=require("./index-6c94ecac.js");require("./util-7a0f40d6.js"),require("./captions-dbc83a75.js"),require("./resolution-f9dcc1b4.js"),require("./skin-516012d7.js"),require("./localisation-56e0a999.js"),require("js-cookie"),require("./currentVideoInfo-31d70bec.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js"),require("@babel/runtime/helpers/typeof"),require("./icons-2609dbe4.js"),require("./helper-a50a8ffc.js"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),module.exports=e.VLPlayerCore;
@@ -1 +1 @@
1
- "use strict";var e=require("./features-4d58ca45.js"),l=require("./player_instance-fcf6a8fb.js"),i=require("./index-b9ba3a36.js"),r=require("./generic-dc7b4a94.js");require("videojs-contrib-quality-menu");var n=require("./index-096edf73.js"),o=require("./helper-a50a8ffc.js"),t=require("./currentVideoInfo-31d70bec.js"),u=require("video.js"),a=require("./icons-2609dbe4.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("./resolution-f9dcc1b4.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/assertThisInitialized"),require("./skin-516012d7.js"),require("./localisation-56e0a999.js"),require("./autoNextVideo-1960dcfe.js"),require("./util-7a0f40d6.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("@babel/runtime/helpers/slicedToArray"),require("axios"),require("js-cookie"),require("./captions-dbc83a75.js"),require("@viewlift/comscore/index.js"),require("video.js/dist/video-js.min.css");function d(u,a){var d=l.getPlayer(u);d&&(d.on("loadeddata",(function(){var e,s,v,c,p,m=o.checkDvrStartOverEnabled(a),b=t.getCurrentEpgPrograms();d.qualityLevels()&&d.qualityLevels().length&&function(e){var i=l.getPlayer(e);i&&(null==i||i.qualityMenu,i.qualityMenu({useResolutionLabels:!0}))}(u),!(null!=a&&null!==(e=a.series)&&void 0!==e&&e.enable||null!==(s=window)&&void 0!==s&&null!==(v=s.app_data)&&void 0!==v&&null!==(c=v.appcmsMain)&&void 0!==c&&null!==(p=c.features)&&void 0!==p&&p.auto_play)||null!=a&&a.liveVideo||i.addNextEpPreview(u,a),null!=a&&a.liveVideo||r.isMobile()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||i.initiateTrickplay(u),m&&b&&b.length?n.initiateMarker(u):n.removeMarkers()})),d.one("play",(function(){var l,i,r,n;null!==(l=window)&&void 0!==l&&null!==(i=l.customData)&&void 0!==i&&i.iframeOverlayUrl&&e.addOutputtingOverlay(u,null===(r=window)||void 0===r||null===(n=r.customData)||void 0===n?void 0:n.iframeOverlayUrl)})))}var s=function(e,i){var r,n,o,t,a,d,s,v,c,p,m,b,g=l.getPlayer(e),h=(null==i?void 0:i.theme)||{},y=u.dom.$(".vjs-play-progress"),f=u.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");f&&(f.style.color="".concat(null===(r=window)||void 0===r||null===(n=r.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(t=o.brand)||void 0===t||null===(a=t.cta)||void 0===a||null===(d=a.primary)||void 0===d?void 0:d.backgroundColor)),y&&(y.style.background="".concat(null===(s=window)||void 0===s||null===(v=s.app_data)||void 0===v||null===(c=v.appcmsMain)||void 0===c||null===(p=c.brand)||void 0===p||null===(m=p.cta)||void 0===m||null===(b=m.primary)||void 0===b?void 0:b.backgroundColor));var q=g.getChild("BigPlayButton")||null;(null==h?void 0:h.progressBarColor)&&y&&(y.style.background=h.progressBarColor),(null==h?void 0:h.playButtonBackgroundColor)&&q&&(q.el().style.background=h.playButtonBackgroundColor),(null==h?void 0:h.playButtonColor)&&f&&(f.style.color=h.playButtonColor),(null==h?void 0:h.playButtonType)&&("square"==(null==h?void 0:h.playButtonType)?q.el().style.borderRadius=".3em":q.el().style.borderRadius="1.3em")};exports.initialiseSkin=function(n,u){l.getPlayer(n).addClass("skin_vlone"),d(n,u),function(l,n){var u,d,s,v,c,p,m,b,g,h,y,f,q,j,w,k,C=(null==n?void 0:n.liveVideo)||!1,B=(null==n||null===(u=n.res)||void 0===u?void 0:u.contentType)||"video",M=(null==n||null===(d=n.res)||void 0===d||null===(s=d[B])||void 0===s?void 0:s.isSSAIEnabled)||!1,S=r.getSource(null==n?void 0:n.res,l)||{};S.src;var T=(null==n?void 0:n.skin_settings)||{};o.checkDvrStartOverEnabled(n),null!=T&&T.skipBtn&&0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)&&e.addSkipButton(l,"VL_ONE",a.SkipSvgV2());(null!=T&&T.rewindBtn&&0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)||1==(null==n?void 0:n.liveui))&&e.addRewindButton(l,"VL_ONE",a.RewindSvgV2());(null==n||null===(v=n.relatedVideos)||void 0===v||null===(c=v.content)||void 0===c?void 0:c.length)>0&&e.addVideoSelector(l,null==n?void 0:n.relatedVideos);null!=n&&null!==(p=n.series)&&void 0!==p&&p.enable&&e.addSeriesSelectorV2(l,n);(null==n||null===(m=n.streams)||void 0===m?void 0:m.length)>1&&e.addMulticamSelector(l,null==n?void 0:n.streams);if(i.addTVProviderImage(l,n),r.initialiseKeyboardEvents(l,n),"MEDIA_TAILOR"==(null===(b=window)||void 0===b||null===(g=b.app_data)||void 0===g||null===(h=g.appcmsMain)||void 0===h||null===(y=h.adsConfig)||void 0===y?void 0:y.vodAdSticherProvider)&&null!==(f=window)&&void 0!==f&&null!==(q=f.app_data)&&void 0!==q&&null!==(j=q.appcmsMain)&&void 0!==j&&null!==(w=j.adsConfig)&&void 0!==w&&w.vodAdClientSideTracking&&M)if(C)r.setupAdvertisementMarkersForLinear(l);else{var V,L=null;if(null!=n&&null!==(V=n.series)&&void 0!==V&&V.enable){var E,P,_,A,x,O=null===(E=t.getCurrentVideo())||void 0===E||null===(P=E.video)||void 0===P||null===(_=P.gist)||void 0===_?void 0:_.id,R=t.getSeriesWatchMap(),D=(null==R?void 0:R.get(O))||{t:0,p:0},I=D.t,N=D.p;"function"==typeof(null===(A=window)||void 0===A||null===(x=A.watchHistory)||void 0===x?void 0:x.cb)&&window.watchHistory.cb({watchedTime:I}),N<95&&(L=I)}else{var F=n.watchHistoryResumeTime;n.watchedPercentage<95&&(L=F)}r.setupAdvertisementMarkers(l,L)}null!=n&&n.isDvrEnabled&&null!=n&&null!==(k=n.dvrConfig)&&void 0!==k&&k.enable&&(e.addStartFromBeginningButton(l,n),e.addWatchLiveButton(l,n))}(n,u),s(n,u),function(e){var i,r,n,o=l.getPlayer(e),t=null;if(!o)return;var u=o.controlBar.getChild("VolumePanel"),a=null===(i=u.getChild("MuteToggle"))||void 0===i?void 0:i.el(),d=null==u||null===(r=u.el())||void 0===r?void 0:r.querySelector(".vjs-volume-bar"),s=null==u||null===(n=u.el())||void 0===n?void 0:n.querySelector(".vjs-volume-level");if(!u||!d||!s)return;function v(e){e.preventDefault(),t&&(clearTimeout(t),t=null),p(m(e.touches[0]))}function c(e){e.preventDefault(),p(m(e.changedTouches[0])),t=setTimeout((function(){u.el().classList.remove("vjs-hover")}),2e3)}function p(e){var l=Math.min(Math.max(e,0),100);s.style.height=l+"%",d.setAttribute("aria-valuenow",l),d.setAttribute("aria-valuetext",l+"%"),o.volume(l/100)}function m(e){var l=d.getBoundingClientRect(),i=e.clientY-l.top,r=l.height;return 100-Math.min(Math.max(i/r*100,0),100)}a.addEventListener("touchend",(function(){null!=u&&u.el()&&(u.el().classList.toggle("vjs-hover"),o.muted(!1),t&&(clearTimeout(t),t=null),t=setTimeout((function(){u.el().classList.remove("vjs-hover")}),2e3))})),d.addEventListener("touchmove",v,{passive:!1}),d.addEventListener("touchstart",v,{passive:!1}),d.addEventListener("touchend",c,{passive:!1})}(n)};
1
+ "use strict";var e=require("./features-4d58ca45.js"),l=require("./player_instance-fcf6a8fb.js"),i=require("./index-b9ba3a36.js"),r=require("./generic-dc7b4a94.js");require("videojs-contrib-quality-menu");var n=require("./index-6c94ecac.js"),o=require("./helper-a50a8ffc.js"),t=require("./currentVideoInfo-31d70bec.js"),u=require("video.js"),a=require("./icons-2609dbe4.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("./resolution-f9dcc1b4.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/assertThisInitialized"),require("./skin-516012d7.js"),require("./localisation-56e0a999.js"),require("./autoNextVideo-1960dcfe.js"),require("./util-7a0f40d6.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("@babel/runtime/helpers/slicedToArray"),require("axios"),require("js-cookie"),require("./captions-dbc83a75.js"),require("@viewlift/comscore/index.js"),require("video.js/dist/video-js.min.css");function d(u,a){var d=l.getPlayer(u);d&&(d.on("loadeddata",(function(){var e,s,v,c,p,m=o.checkDvrStartOverEnabled(a),b=t.getCurrentEpgPrograms();d.qualityLevels()&&d.qualityLevels().length&&function(e){var i=l.getPlayer(e);i&&(null==i||i.qualityMenu,i.qualityMenu({useResolutionLabels:!0}))}(u),!(null!=a&&null!==(e=a.series)&&void 0!==e&&e.enable||null!==(s=window)&&void 0!==s&&null!==(v=s.app_data)&&void 0!==v&&null!==(c=v.appcmsMain)&&void 0!==c&&null!==(p=c.features)&&void 0!==p&&p.auto_play)||null!=a&&a.liveVideo||i.addNextEpPreview(u,a),null!=a&&a.liveVideo||r.isMobile()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||i.initiateTrickplay(u),m&&b&&b.length?n.initiateMarker(u):n.removeMarkers()})),d.one("play",(function(){var l,i,r,n;null!==(l=window)&&void 0!==l&&null!==(i=l.customData)&&void 0!==i&&i.iframeOverlayUrl&&e.addOutputtingOverlay(u,null===(r=window)||void 0===r||null===(n=r.customData)||void 0===n?void 0:n.iframeOverlayUrl)})))}var s=function(e,i){var r,n,o,t,a,d,s,v,c,p,m,b,g=l.getPlayer(e),h=(null==i?void 0:i.theme)||{},y=u.dom.$(".vjs-play-progress"),f=u.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");f&&(f.style.color="".concat(null===(r=window)||void 0===r||null===(n=r.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(t=o.brand)||void 0===t||null===(a=t.cta)||void 0===a||null===(d=a.primary)||void 0===d?void 0:d.backgroundColor)),y&&(y.style.background="".concat(null===(s=window)||void 0===s||null===(v=s.app_data)||void 0===v||null===(c=v.appcmsMain)||void 0===c||null===(p=c.brand)||void 0===p||null===(m=p.cta)||void 0===m||null===(b=m.primary)||void 0===b?void 0:b.backgroundColor));var q=g.getChild("BigPlayButton")||null;(null==h?void 0:h.progressBarColor)&&y&&(y.style.background=h.progressBarColor),(null==h?void 0:h.playButtonBackgroundColor)&&q&&(q.el().style.background=h.playButtonBackgroundColor),(null==h?void 0:h.playButtonColor)&&f&&(f.style.color=h.playButtonColor),(null==h?void 0:h.playButtonType)&&("square"==(null==h?void 0:h.playButtonType)?q.el().style.borderRadius=".3em":q.el().style.borderRadius="1.3em")};exports.initialiseSkin=function(n,u){l.getPlayer(n).addClass("skin_vlone"),d(n,u),function(l,n){var u,d,s,v,c,p,m,b,g,h,y,f,q,j,w,k,C=(null==n?void 0:n.liveVideo)||!1,B=(null==n||null===(u=n.res)||void 0===u?void 0:u.contentType)||"video",M=(null==n||null===(d=n.res)||void 0===d||null===(s=d[B])||void 0===s?void 0:s.isSSAIEnabled)||!1,S=r.getSource(null==n?void 0:n.res,l)||{};S.src;var T=(null==n?void 0:n.skin_settings)||{};o.checkDvrStartOverEnabled(n),null!=T&&T.skipBtn&&0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)&&e.addSkipButton(l,"VL_ONE",a.SkipSvgV2());(null!=T&&T.rewindBtn&&0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)||1==(null==n?void 0:n.liveui))&&e.addRewindButton(l,"VL_ONE",a.RewindSvgV2());(null==n||null===(v=n.relatedVideos)||void 0===v||null===(c=v.content)||void 0===c?void 0:c.length)>0&&e.addVideoSelector(l,null==n?void 0:n.relatedVideos);null!=n&&null!==(p=n.series)&&void 0!==p&&p.enable&&e.addSeriesSelectorV2(l,n);(null==n||null===(m=n.streams)||void 0===m?void 0:m.length)>1&&e.addMulticamSelector(l,null==n?void 0:n.streams);if(i.addTVProviderImage(l,n),r.initialiseKeyboardEvents(l,n),"MEDIA_TAILOR"==(null===(b=window)||void 0===b||null===(g=b.app_data)||void 0===g||null===(h=g.appcmsMain)||void 0===h||null===(y=h.adsConfig)||void 0===y?void 0:y.vodAdSticherProvider)&&null!==(f=window)&&void 0!==f&&null!==(q=f.app_data)&&void 0!==q&&null!==(j=q.appcmsMain)&&void 0!==j&&null!==(w=j.adsConfig)&&void 0!==w&&w.vodAdClientSideTracking&&M)if(C)r.setupAdvertisementMarkersForLinear(l);else{var V,L=null;if(null!=n&&null!==(V=n.series)&&void 0!==V&&V.enable){var E,P,_,A,x,O=null===(E=t.getCurrentVideo())||void 0===E||null===(P=E.video)||void 0===P||null===(_=P.gist)||void 0===_?void 0:_.id,R=t.getSeriesWatchMap(),D=(null==R?void 0:R.get(O))||{t:0,p:0},I=D.t,N=D.p;"function"==typeof(null===(A=window)||void 0===A||null===(x=A.watchHistory)||void 0===x?void 0:x.cb)&&window.watchHistory.cb({watchedTime:I}),N<95&&(L=I)}else{var F=n.watchHistoryResumeTime;n.watchedPercentage<95&&(L=F)}r.setupAdvertisementMarkers(l,L)}null!=n&&n.isDvrEnabled&&null!=n&&null!==(k=n.dvrConfig)&&void 0!==k&&k.enable&&(e.addStartFromBeginningButton(l,n),e.addWatchLiveButton(l,n))}(n,u),s(n,u),function(e){var i,r,n,o=l.getPlayer(e),t=null;if(!o)return;var u=o.controlBar.getChild("VolumePanel"),a=null===(i=u.getChild("MuteToggle"))||void 0===i?void 0:i.el(),d=null==u||null===(r=u.el())||void 0===r?void 0:r.querySelector(".vjs-volume-bar"),s=null==u||null===(n=u.el())||void 0===n?void 0:n.querySelector(".vjs-volume-level");if(!u||!d||!s)return;function v(e){e.preventDefault(),t&&(clearTimeout(t),t=null),p(m(e.touches[0]))}function c(e){e.preventDefault(),p(m(e.changedTouches[0])),t=setTimeout((function(){u.el().classList.remove("vjs-hover")}),2e3)}function p(e){var l=Math.min(Math.max(e,0),100);s.style.height=l+"%",d.setAttribute("aria-valuenow",l),d.setAttribute("aria-valuetext",l+"%"),o.volume(l/100)}function m(e){var l=d.getBoundingClientRect(),i=e.clientY-l.top,r=l.height;return 100-Math.min(Math.max(i/r*100,0),100)}a.addEventListener("touchend",(function(){null!=u&&u.el()&&(u.el().classList.toggle("vjs-hover"),o.muted(!1),t&&(clearTimeout(t),t=null),t=setTimeout((function(){u.el().classList.remove("vjs-hover")}),2e3))})),d.addEventListener("touchmove",v,{passive:!1}),d.addEventListener("touchstart",v,{passive:!1}),d.addEventListener("touchend",c,{passive:!1})}(n)};
package/esm/bundle.css CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
 
4
4
 
5
+
5
6
  .video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
6
7
  height: 0.7em;
7
8
  position: absolute;
@@ -223,7 +224,6 @@
223
224
 
224
225
 
225
226
 
226
-
227
227
  /* CSS for videojs-dvr-seekbar */
228
228
 
229
229
  .video-js.vjs-dvr-seekbar {
@@ -398,6 +398,7 @@
398
398
 
399
399
 
400
400
 
401
+
401
402
  .video-js .multicamera-parent.default{
402
403
  height: 345px;
403
404
  position: absolute;
@@ -479,7 +480,6 @@
479
480
 
480
481
 
481
482
 
482
-
483
483
  /* nextep */
484
484
  .next-ep-preview{
485
485
  position: absolute;
@@ -0,0 +1 @@
1
+ import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import"axios";import{d as o,c as i,g as r,a as l,b as a,s,e as u,l as c,i as d,f as v,h as p,j as f,k as m,m as g,n as y,o as b,p as h,q as w,r as k,t as I,u as O,v as S,w as j,x as T,y as P,z as D,A as E,B as C,C as x,D as R,E as A,F as L,G as N,H as _,I as M,J as V,K as B,L as U,M as H,N as F,O as q,P as J}from"./generic-227dd92b.js";import{g as K}from"./player_instance-34118a5b.js";import W from"video.js";import{o as z,g as G,a as X,s as Y,b as Q,p as $,c as Z}from"./util-aeb59632.js";import{g as ee,d as ne,a as te,e as oe}from"./captions-f507e8ee.js";import{g as ie,p as re}from"./resolution-1c59b0f3.js";import{i as le,a as ae}from"./skin-d5091b86.js";import{s as se}from"./localisation-0bf399a1.js";import{g as ue,a as ce,s as de,v as ve,b as pe,c as fe,d as me,e as ge,f as ye}from"./currentVideoInfo-a8a254c2.js";import be from"@babel/runtime/helpers/typeof";import{s as he,w as we}from"./icons-37daa6b3.js";import{c as ke,p as Ie,a as Oe,h as Se,r as je,g as Te,b as Pe,d as De,s as Ee,e as Ce,f as xe}from"./helper-349e076f.js";import Re from"@babel/runtime/helpers/toConsumableArray";var Ae=function(e){return new Promise((function(n,t){if(Le(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}}))},Le=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Ne=function(e,n,t){var o=K(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},_e=function(e){var n=K(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Me=function(){var e=n(t.mark((function e(n){var i,r,l,a,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=K(null==n?void 0:n.playerId),null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable||!(null!=n&&n.chromecastReceiverId||null!=n&&n.airplay)){e.next=10;break}return e.prev=2,e.next=5,Ae("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.log("Error",e.t0);case 10:if(null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=13,import("@silvermine/videojs-chromecast");case 13:e.sent.default(W),(s=W.getTech("chromecast"))&&!s.prototype.seeking&&(s.prototype.seeking=function(){}),null!==(a=window)&&void 0!==a&&a.cast?null==l||l.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==o()?null==l||l.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(n){return e.apply(this,arguments)}}(),Ve=function(e,n){var t=K(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,r,l,a=this.el(),s=W.dom.getPointerPosition(a,n).x;W.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,d.seek()}}))};var Be=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),Ae("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))]);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ue=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("@viewlift/comscore/index.js").then((function(e){i.set(e)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),He=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then((function(e){W.getPlugin("eme")||W.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Fe=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(W),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),qe=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-8e3eab6d.js");case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),Je=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-08c7635e.js");case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),Ke=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){Ae("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(W)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(W)}))},loadAdsLibrary:Be,loadEMELibrary:He,loadMuxPlugin:Fe,loadDvrSeekbar:qe,loadContribDash:Je,loadComscorePlugin:Ue});function We(e){return ze.apply(this,arguments)}function ze(){return(ze=n(t.mark((function e(n){var i,r,l;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=(null==n?void 0:n.airplay)||!1,e.next=3,Be();case 3:i&&"Safari"==o()?Promise.resolve().then((function(){return Ke})).then((function(e){e.importAirplay()})):(l=(null===(r=document)||void 0===r?void 0:r.getElementById(null==n?void 0:n.playerId))||null)&&l.setAttribute("x-webkit-airplay","deny");case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(e){return Xe.apply(this,arguments)}function Xe(){return(Xe=n(t.mark((function e(n){var o,i,r,l,a,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=K(n.playerId),e.next=3,Ue();case 3:s.comscore({publisherId:null==n||null===(o=n.comscore)||void 0===o?void 0:o.publishedId,endpoint:null==n||null===(i=n.comscore)||void 0===i?void 0:i.endpoint,implementationId:null==n||null===(r=n.comscore)||void 0===r?void 0:r.implementationId,projectId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.projectId,debug:(null==n||null===(a=n.comscore)||void 0===a?void 0:a.debug)||!1});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ye(e,n){return Qe.apply(this,arguments)}function Qe(){return(Qe=n(t.mark((function e(n,i){var r,l,a,s,u,c,d,v,p,f,m,g;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v=(null==i?void 0:i.contentType)||"video",p=null==i||null===(r=i[v])||void 0===r?void 0:r.drmEnabled,null==i||null===(l=i[v])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==i||null===(s=i[v])||void 0===s||null===(u=s.streamingInfo)||void 0===u||null===(c=u.videoAssets)||void 0===c?void 0:c.dash)||null,m=(null==n||null===(d=n.comscore)||void 0===d?void 0:d.enable)||!1,e.prev=6,e.next=9,Promise.allSettled([p?"Safari"==o()?He():"caliente"!=(null===(g=window)||void 0===g?void 0:g.siteName)?Je():He():"Safari"!=o()&&f?Je():null,m?Ge(n):null,Me(n)]);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:case"end":return e.stop()}}),e,null,[[6,11]])})))).apply(this,arguments)}function $e(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 Ze(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?$e(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):$e(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var en=new Set,nn=null,tn=function(e,n,t){var o,i,l,a,s,u,c,d={},v=(null==e?void 0:e.contentType)||"video";d["c3.cm.id"]=(null===(o=e[v])||void 0===o?void 0:o.id)||"Null",d["c3.cm.contentType"]=cn(e),d[null==t||null===(i=t.Constants)||void 0===i?void 0:i.IS_LIVE]=!(null==e||!e.linearchannel),d[null==t||null===(l=t.Constants)||void 0===l?void 0:l.STREAM_URL]=n.currentSrc(),d[null==t||null===(a=t.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===r()?"NULL":r(),d["c3.cm.categoryType"]=an(e),d["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),d.DRMEnabled=(null===(s=e[v])||void 0===s?void 0:s.drmEnabled)||"None",d.DAIStream=null!==(u=e[v])&&void 0!==u&&null!==(c=u.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",d[t.Constants.DEFAULT_RESOURCE]="AKAMAI",d["c3.cm.brand"]="NULL",d.CDVREnabled=sn(e),d["c3.cm.genreList"]=rn(e),d["c3.cm.genre"]=on(e),d["c3.cm.channel"]=ln(e);var p=pn(ue(),e);return d=Ze(Ze({},d),p)},on=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},rn=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map((function(e){return null==e?void 0:e.title})).join(", ")||"Null"},ln=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},an=function(e){return(null==e?void 0:e.contentType)||"null"},sn=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},un=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[r])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},cn=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var dn,vn,pn=function(e,n){var t,o,i,r,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var c=a(),d=l();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(o=t.series)||void 0===o?void 0:o.title)||"Null",u["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(i=e[c-1])||void 0===i||null===(r=i.episodes)||void 0===r||null===(s=r[d-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},fn=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},mn=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},gn=function(){var e=n(t.mark((function e(n,o){var i,r,l,a,s,u,c,d,v,p;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},r=i.trackConvivaPlayerEvent,l=i.paymentHandler,a=i.tveProvider,s=i.enable,u=i.appName,c=(o||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(d=K(n),"function"==typeof(v=r)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,v("getConvivaObject");case 10:if(p=e.sent){e.next=13;break}return e.abrupt("return");case 13:d.ready((function(){var e=d.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=fn(t.keySystem);v("contentInfo",{DRMEnabled:o})}else v("contentInfo",{DRMEnabled:"None"})})),n||v("contentInfo",{DRMEnabled:"None"})})),d.on("loadstart",(function(){var e,n;nn&&nn!==d.currentSrc()&&v("playbackEnded"),v("setPlayer",d),en.clear(),nn=d.currentSrc();var t=mn(d.currentType()),i=ce(),r=tn(i,d,p);r[null==p||null===(e=p.Constants)||void 0===e?void 0:e.PLAYER_NAME]=u||"WEB",r[null==p||null===(n=p.Constants)||void 0===n?void 0:n.ASSET_NAME]=un(i,o),r.authToken=c||"NULL",r.streamType=t,r.D2CType=l||"NONE",r.subscriberType=a||(l?"D2C":"FREE"),r["c3.cm.affiliate"]=a||"NULL",yn.setData(r),v("contentInfo",r)})),d.on("loadedmetadata",(function(){var e,n=d.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),v("contentInfo",{screenResolution:e})})),d.on("play",(function(){en.has(d.currentSrc())||(en.add(d.currentSrc()),v("playbackStarted",null))})),d.on("ended",(function(){en.has(d.currentSrc())&&en.delete(d.currentSrc()),v("playbackEnded")})),d.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&v("initAdSensor",{player:d,adsLoader:null==e?void 0:e.adsLoader})})),d.on("dispose",(function(){null==en||en.clear(),v("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),yn=(dn={},{setData:function(e){dn=Ze(Ze({},dn),e)},getData:function(){return dn}}),bn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-71d399f6.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-c303da65.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-0913004f.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-020b5e86.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-f877008d.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t?import("./skin-ace1d4fa.js").then((function(t){t.initialiseSkin(e,n)})):"news"==t&&import("./skin-1c262d06.js").then((function(t){t.initialiseSkin(e,n)}))};function hn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function wn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?hn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):hn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var kn=[],In=0,On=null;function Sn(){console.log("Cleaning up watch history data"),vn=null,kn=[],In=0,On=null}function jn(e,n,t){var o,i,r,l,a,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(o=n.watchHistory)||void 0===o||o.apiVersion;var c=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,d=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(r=n.watchHistory)||void 0===r||r.xapiKey;var p=(null==n||null===(l=n.video)||void 0===l?void 0:l.originalObjectId)||null,f=(null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.saveOffline)||!1,m=Math.floor(e.currentTime()),g=u?100:Math.floor(d/v*100),y={};f?Pn(y={completed:u,watchedTime:m,watchedPercentage:g},c,n.siteOwner):(y=wn(wn({videoId:vn,watchedTime:m,watchedPercentage:g,doneWatching:u,profileId:c},On&&{seriesId:On}),p&&{originalObjectId:p}),s(y).then((function(e){})).catch((function(e){}))),In=d+t}function Tn(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Pn(n,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=Tn(i),l=(new Date).getTime(),a=ce(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(n,t){return wn(wn({},n),{},e({},t,s[t]))}),{}),c=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===vn}));c<0?r.push(wn(wn({content:u},n),{},{addedDate:l,updateDate:l})):r[c]=wn(wn(wn({},r[c]),n),{},{updateDate:l}),localStorage.setItem("".concat(i),JSON.stringify(r))}function Dn(e,n,t){var o=Tn(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var En=!1,Cn=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!En){var r=xn(e,"videoAssets","secondaryVideoAssets"),l=u(r,n);return l&&c(n,l),En=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function xn(e,n,t){if(Array.isArray(e))return e.map((function(e){return xn(e,n,t)}));if(null!==e&&"object"===be(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=xn(e[i],n,t)})),o}return e}function Rn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return An(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?An(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function An(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function Ln(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Nn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ln(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ln(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var _n=function(e,n,t,i){var r,l,a,s,u,c=i.res,f=i.sres,m=K(e),g=(null==c?void 0:c.contentType)||"video",y=(null==c||null===(r=c[g])||void 0===r?void 0:r.drmEnabled)||!1,b=(null==c||null===(l=c[g])||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,h=(null==c||null===(s=c[g])||void 0===s||null===(u=s.liveDetails)||void 0===u?void 0:u.isDvrEnabled)||!1;de(c),ve.set(c),m&&(m.on("loadstart",(function(){b?t.resolve({status:!0,msg:"Video Loaded",response:c}):t.resolve(Nn({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:c}:{response:c}))})),m.on("loadeddata",(function(){var t,i,r,l=ee(e);if(null==l||l.map((function(n){return ne(e,n.id)})),h&&"Safari"===o())try{var a;null==m||null===(a=m.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&Ne(e,sessionStorage.getItem("volume")||"100");var s=ce();if(d(n,c),v(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.saveOffline)){var u,p,f=Nn(Nn({},n),c);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(On=null==n||null===(i=n.series)||void 0===i?void 0:i.id),kn=[],In=0,vn=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=K(e);a&&(a.on("dispose",Sn),a.on("timeupdate",(function(){if(!a.seeking()){var e=Math.floor(a.currentTime());kn.includes(In)||(e!=In||e<l?e>In&&(In=e+l):(kn.push(e),jn(a,n,l)))}})),a.one("ended",(function(){jn(a,n,l,!0)})))}(e,f,null==s||null===(u=s.video)||void 0===u||null===(p=u.gist)||void 0===p?void 0:p.id)}if(null!=n&&null!==(r=n.analytics)&&void 0!==r&&r.muxKey&&null!=m&&m.mux){var g,y,b,w,k,I,O=(null===(g=ce())||void 0===g?void 0:g.video)||(null==c?void 0:c.video),S=null==O?void 0:O.gist,j={env_key:null==n||null===(y=n.analytics)||void 0===y?void 0:y.muxKey,player_name:"vl-web-player",player_version:null===(b=window)||void 0===b?void 0:b.vl_player_version,video_id:null==S?void 0:S.id,video_title:null==S?void 0:S.title,video_series:null==O||null===(w=O.series)||void 0===w?void 0:w.title,video_stream_type:null!=O&&null!==(k=O.streamingInfo)&&void 0!==k&&k.isLiveStream?"live":"video",viewer_user_id:null==n||null===(I=n.analytics)||void 0===I?void 0:I.userId};m.mux({debug:!1,data:j})}})),m.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];m.trigger("subtitlechanged",n)})),m.on("subtitlechanged",(function(e,n){var t,o,i,r,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}})),m.tech_.on("retryplaylist",(function(){b&&Cn(c,e)})),m.on("error",(function(){var n,o;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&b)?Cn(c,e):(p(e,(null==m||null===(n=m.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==m||null===(o=m.error())||void 0===o?void 0:o.message)||"Some error occured",response:c}))})),m.one("play",(function(){var e,t,o,i,r;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(o=t.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable){var l,a,s,u=null===(l=ce())||void 0===l||null===(a=l.video)||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.id,c=pe(),d=(null==c?void 0:c.get(u))||{t:0,p:0},v=d.t,p=d.p;v&&p<95&&setTimeout((function(){m.currentTime(v)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){m.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}})),m.on("volumechange",(function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),m.on("chromecastDisconnected",(function(){if(b){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}})),m.one("loadeddata",(function(){var e,n=(null==m||null===(e=m.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort((function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0})),"object"==be(m.dash)){var t,i,r,l=null==m||null===(t=m.dash)||void 0===t||null===(i=t.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),a=null==l?void 0:l.find((function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")})),s=Rn(n);try{for(s.s();!(r=s.n()).done;){var u=r.value;if(a&&(null==u?void 0:u.id)=="dash-audio-".concat(a.index)){u.enabled=!0;break}}}catch(e){s.e(e)}finally{s.f()}}else{var c,d=Rn(n);try{for(d.s();!(c=d.n()).done;){var v,p,f,g=c.value;if(("Chrome"==o()||"Edge"==o()&&(null!==(v=navigator)&&void 0!==v&&null!==(p=v.userAgent)&&void 0!==p&&p.includes("Macintosh")||!y))&&null!=g&&null!==(f=g.label)&&void 0!==f&&f.includes("5.1"))m.audioTracks().removeTrack(g);else{if("main"==g.kind){g.enabled=!0;break}g.enabled=!1}}}catch(e){d.e(e)}finally{d.f()}}})))};function Mn(e){var n=K(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),r=t.end(t.length-1)-i;Bn(),Un(r).forEach((function(e){var n=e.id,t=e.title,i=e.time,l=Vn(n,t,Math.min(i/r*100,99.5));o.appendChild(l)}))}}function Vn(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function Bn(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach((function(e){e.remove()}))}function Un(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(fe()||[]).filter((function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n})).map((function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}}))}function Hn(e,n){var t=K(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,r=n.videoId;n.epg;var l=i.playLive,a=i.playFromBegining,s=i.programs;me(s),t.on("loadeddata",(function(){ke(n)?a?Ie(t,n):l?Oe(t,r):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,i=n.videoId,r=n.epg,l=o.buttonConfig,a=void 0===l?{}:l,s=a.watchLive;a.resume;var u=a.startFromBegining,c=i;if(r&&null!=r&&r.enable){var d=JSON.parse(sessionStorage.getItem("epgConfig"));c="".concat(null==d?void 0:d.programId,"-").concat(null==d?void 0:d.channelId)}var v=!!Te(c),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var f=Pe(n);f&&(p.style.backgroundImage="url(".concat(f,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.innerHTML=qn(o,v),p.style.display="flex",e.el().appendChild(p),De(e),Fn("watch-live-resume-btn",s,(function(){xe(e,p),Oe(e,c)})),Fn("watch-begining-btn",u,(function(){xe(e,p),Ie(e,n)}))}(t,n),Se({player:t,showWatchLive:!0,showStartOver:!0})):je(t)})),t.one("loadedmetadata",(function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),i=!1,r=e.seekable(),l=r.start(0),a=r.end(r.length-1)-l,s=JSON.parse(sessionStorage.getItem("epgConfig")),u=t,c=!0;if(s&&null!=s&&s.enable){var d;c=(null==n||null===(d=n.epg)||void 0===d?void 0:d.programId)===(null==s?void 0:s.programId),u=null==s?void 0:s.programId}e.on("seeking",(function(){i=!0})),e.on("seeked",(function(){i=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!c||sessionStorage.getItem("program_switched"))return;u="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}Ee(u,o),Ce(e,n),Se({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})})),e.on("timeupdate",(function(){if(!i){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!c||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");u="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(Ee(u,t),o=t,function(e,n){Un(n).forEach((function(t){var o=t.id,i=t.title,r=t.time,l=document.getElementById(o);if(l){var a=Math.min(r/n*100,99.5);l.style.left="".concat(a,"%")}else{var s=e.controlBar.progressControl.seekBar.el(),u=Vn(o,i,Math.min(r/n*100,99.5));s.appendChild(u)}}))}(e,a))}}))}(t,n)}))}else console.warn("Player instance is required to initialize start over.")}function Fn(e,n,t){var o,i,r=document.getElementById(e);r&&(i=n,(o=r)&&(o.style.color="".concat((null==i?void 0:i.textColor)||"#000"),o.style.backgroundColor="".concat((null==i?void 0:i.backGroundColor)||"#DCF95B")),r.addEventListener("click",t))}function qn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,i=t.resume,r=t.startFromBegining,l=n?(null==i?void 0:i.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(we()," ").concat(l,"</button>"),s='<button id="watch-begining-btn">'.concat(he()," ").concat((null==r?void 0:r.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(s,"</div>")}function Jn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Kn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Jn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Jn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Wn=function(i,r,l,a){var s,d,v,h,w,k,I,O,S,j,T,P,D,E,C,x,R,A,L,N,_,M,V,B,U,H,F,q,J,z,G,X,Y,Q,$,Z,ee,ne,oe,ie,re=r.res,ae=void 0===re?null:re,se=r.sres,ue=void 0===se?null:se,ce=null!=l&&l.chromecastReceiverId?["chromecast","html5"]:["html5"],de=(null===(s=ae)||void 0===s?void 0:s.contentType)||"video",ve=le(null===(d=ae)||void 0===d||null===(v=d[de])||void 0===v||null===(h=v.gist)||void 0===h?void 0:h.videoImageUrl)||le(null===(w=ae)||void 0===w||null===(k=w[de])||void 0===k||null===(I=k.gist)||void 0===I||null===(O=I.imageGist)||void 0===O?void 0:O.r16x9),pe=(null===(S=ae)||void 0===S||null===(j=S[de])||void 0===j||null===(T=j.liveDetails)||void 0===T?void 0:T.isDvrEnabled)||!1,fe=(null===(P=ae)||void 0===P||null===(D=P[de])||void 0===D||null===(E=D.streamingInfo)||void 0===E?void 0:E.isLiveStream)||!1,me=(null===(C=ae)||void 0===C||null===(x=C.ads)||void 0===x||null===(R=x.preRoll)||void 0===R||null===(A=R.adTags)||void 0===A||null===(L=A.web)||void 0===L?void 0:L.active)&&(null===(N=ae)||void 0===N||null===(_=N.ads)||void 0===_||null===(M=_.preRoll)||void 0===M||null===(V=M.adTags)||void 0===V||null===(B=V.web)||void 0===B?void 0:B.url),ge=(null===(U=ae=Kn(Kn({},ae),{},{audioAssetSource:null==l?void 0:l.audioAssetSource}))||void 0===U||null===(H=U[de])||void 0===H?void 0:H.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(F=window)||void 0===F||null===(q=F.app_data)||void 0===q||null===(J=q.appcmsMain)||void 0===J||null===(z=J.adsConfig)||void 0===z?void 0:z.vodAdSticherProvider)||!1,ye=(null==l?void 0:l.latency)||6,be=(null==l?void 0:l.skin_settings)||{};null==l||l.dvrConfig;var he=(oe={enableSmoothSeeking:!0,controls:0!=(null==l?void 0:l.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==l?void 0:l.muted)||!1,autoplay:(null==l?void 0:l.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==be?void 0:be.pictureInPictureToggle)||!1},playbackRates:null!=be&&be.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==l.skin,liveui:pe},e(oe,"autoplay",null==l?void 0:l.autoplay),e(oe,"normalizeAutoplay",(null==l?void 0:l.autoplay)&&!me),e(oe,"loop",(null==l?void 0:l.loop)||!1),e(oe,"audioPosterMode",null==l?void 0:l.audioPosterMode),e(oe,"html5",Kn(Kn({dash:Kn(Kn(Kn({},!W.browser.IS_SAFARI&&{useTTML:!0}),(null==l?void 0:l.debugConfig)&&(null==l||null===(G=l.debugConfig)||void 0===G?void 0:G.enable)&&{debug:!0,logLevel:null!=l&&null!==(X=l.debugConfig)&&void 0!==X&&X.logLevel?null==l||null===(Y=l.debugConfig)||void 0===Y?void 0:Y.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:ye},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Kn(Kn({liveRangeSafeTimeDelta:ye,useDevicePixelRatio:!0,experimentalLLHLS:(null==l?void 0:l.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==l||null===(Q=l.customData)||void 0===Q?void 0:Q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===($=null==l?void 0:l.enableLowInitialPlaylist)||void 0===$||$}),debug:(null==l?void 0:l.debugConfig)&&(null==l||null===(Z=l.debugConfig)||void 0===Z?void 0:Z.enable)||!1,nativeTextTracks:"Safari"==o()},0==(null==l||null===(ee=l.customData)||void 0===ee?void 0:ee.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==l||null===(ne=l.customData)||void 0===ne?void 0:ne.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(oe,"poster",ve),e(oe,"techOrder",ce),e(oe,"chromecast",{requestCustomDataFn:function(e){var n,t,o=K(i),r=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind})),a=function(e,n,t){var o,i,r,l,a,s,u,c,d,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,g,y,b,h,w,k,I;f.isDrmEnabled=!0;var O=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,S=(null==O?void 0:O.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(y=g[0])||void 0===y||null===(b=y.options)||void 0===b?void 0:b.serverURL);f.licenseUrl=S;var j=(null==O?void 0:O.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(h=n.keySystemOptions)||void 0===h||null===(w=h[0])||void 0===w||null===(k=w.options)||void 0===k||null===(I=k.httpRequestHeaders)||void 0===I?void 0:I["X-AxDRM-Message"]);f.licenseToken=j}var T=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=T;var P=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=P;var D=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=D;var E=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=E,f.subTitles=t,f.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(ae,e,r);return Kn(Kn({},a),{},{convivaMetaData:Kn({customerKey:(null==l||null===(n=l.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==l||null===(t=l.convivaConfig)||void 0===t?void 0:t.debug)||!1},yn.getData())})},modifyLoadRequestFn:function(e){var n,t,o,r,l,a=K(i),s=(null==a?void 0:a.currentSource())||{};!(null===(n=ae)||void 0===n||null===(t=n[de])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(r=o.videoAssets)||void 0===r?void 0:r.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(l=s.src)&&void 0!==l&&l.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),oe);if(!W.getPlayers()[i]){null!=l&&l.debugConfig&&null!=l&&null!==(ie=l.debugConfig)&&void 0!==ie&&ie.enable&&W.log.level("debug");var we=W(i,he,function(){var e=n(t.mark((function e(){var n,o,r,s,d,v,h,w,k,I,O,S,j,T,P,D,E,C,x,R,A;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(we),console.log(W.VERSION),console.log(W.getPlugins()),e.next=5,Ye(l,ae);case 5:if(j=null===(n=ae)||void 0===n||null===(o=n[de])||void 0===o||null===(r=o.liveDetails)||void 0===r?void 0:r.startOverTime,fe&&a.resolve(Kn({status:!0,msg:"Player Initialised"},ue?{seriesResponse:ue,response:ae}:{response:ae})),pe&&null!=l&&null!==(s=l.dvrConfig)&&void 0!==s&&s.enable&&Hn(i,Kn(Kn({},l),{},{isDvrEnabled:pe})),m(i,null==l?void 0:l.analyticsCb,null==l?void 0:l.customData),gn(i,l),/Android/i.test(navigator.userAgent)&&(W.options.vhs.overrideNative=!0),pe&&Ve(i,j),!me||null!=l&&null!==(d=l.customData)&&void 0!==d&&d.disableAds||g(i,me,ae),T=u(ae,i),console.log(T),null!=l&&l.nearestClusterUrl&&(T=y(T,l.nearestClusterUrl)),!ge){e.next=21;break}return e.next=20,b(i,ae);case 20:T=e.sent;case 21:T?c(i,T):(a.reject({status:!1,msg:"Incompatible / Missing Source",response:ae}),p(i,"Incompatible / Missing Source")),((null===(v=ae)||void 0===v||null===(h=v[de])||void 0===h||null===(w=h.contentDetails)||void 0===w||null===(k=w.closedCaptions)||void 0===k?void 0:k.length)>0||(null===(I=ae)||void 0===I||null===(O=I[de])||void 0===O||null===(S=O.closedCaptions)||void 0===S?void 0:S.length)>0)&&(A=(null===(D=ae)||void 0===D||null===(E=D[de])||void 0===E||null===(C=E.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null===(x=ae)||void 0===x||null===(R=x[de])||void 0===R?void 0:R.closedCaptions),P=A.filter((function(e){return"VTT"===e.format||"WEBVTT"===e.format})),te(i,P)),null!=l&&l.disableControls?f(i):bn(i,Kn(Kn(Kn({},l),he),{},{liveVideo:fe,isDvrEnabled:pe,res:ae,sres:ue})),_n(i,Kn(Kn(Kn({},l),he),{},{liveVideo:fe}),a,{res:ae,sres:ue});case 25:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())}};function zn(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 Gn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?zn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):zn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Xn,Yn=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,r=Qn(e);Wn(i,{res:r},e,{resolve:t,reject:o})},Qn=function(e){var n,t,o,i,r,l,a,s,u=null==e?void 0:e.streamingInfo,c=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,d=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,v=(null==e||null===(o=e.streamingInfo)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.url)||null,p=(null==e||null===(r=e.streamingInfo)||void 0===r?void 0:r.posterUrl)||null,f=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.subtitles)||[],m=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(s=a.videoAssets)||void 0===s?void 0:s.drmProvider)||null,g=null==e?void 0:e.token,y=h(g);null==y||y.site;var b=null==y?void 0:y.siteId;return Gn(Gn({id:"".concat(b,"_external")},!d&&{directPlaybackUrl:null==c?void 0:c.url}),{},{video:{drmEnabled:d,streamingInfo:{videoAssets:Gn(Gn({},m&&{drmProvider:m}),{},{widevine:null==c?void 0:c.widevine,fairPlay:null==c?void 0:c.fairPlay,playReady:null==c?void 0:c.playReady})},liveDetails:{isDvrEnabled:null==u?void 0:u.isDvrEnabled},gist:Gn({},p&&{videoImageUrl:p}),contentDetails:Gn({},(null==f?void 0:f.length)>0&&{closedCaptions:Re(f)})},ads:{preRoll:{adTags:{web:Gn(Gn({},v&&{active:!0}),v&&{url:v})}}}})};function $n(e,n){return Zn.apply(this,arguments)}function Zn(){return(Zn=n(t.mark((function e(n,o){var i,r,l,a,s,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.resolve,r=o.reject,l=null==n?void 0:n.videoId,a=null==n?void 0:n.playerId,s=!(null==n||!n.anonymousId),e.next=6,O();case 6:u=e.sent,w(l,u).then((function(e){var t,o,c,d;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(c=o.gist)||void 0===c?void 0:c.contentType,de(null==e?void 0:e.data);var v,p=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(d=n.watchHistory)&&void 0!==d&&d.enable&&!s)if((null===(v=n.watchHistory)||void 0===v?void 0:v.saveOffline)||!1){var f,m,g,y=Dn((null===(f=n.watchHistory)||void 0===f?void 0:f.profileId)||"",l,null==n?void 0:n.siteOwner);if(y&&y.length)n.watchHistoryResumeTime=(null===(m=y[0])||void 0===m?void 0:m.watchedTime)||null,n.watchedPercentage=(null===(g=y[0])||void 0===g?void 0:g.watchedPercentage)||null;p.contentType="video",Wn(a,{res:p},n,{resolve:i,reject:r})}else k(l,u).then((function(e){var t,o,i,r,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,p.contentType="video"})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})).finally((function(){Wn(a,{res:p},n,{resolve:i,reject:r})}));else Wn(a,{res:p},n,{resolve:i,reject:r})})).catch((function(e){I(e,a,r,l)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function et(e,n){return nt.apply(this,arguments)}function nt(){return(nt=n(t.mark((function e(n,o){var i,r,l,a,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.resolve,r=o.reject,e.next=3,O();case 3:l=e.sent,a=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,S(s,l).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,Wn(a,{res:t},n,{resolve:i,reject:r})})).catch((function(e){I(e,a,r,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tt(e,n){return ot.apply(this,arguments)}function ot(){return(ot=n(t.mark((function e(n,o){var i,r,l,a,s,u,c;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.resolve,l=o.reject,e.next=3,O();case 3:a=e.sent,s=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,ge.set(parseInt(u)),c=null==n||null===(i=n.series)||void 0===i?void 0:i.id,j(c,a).then((function(e){var t,o,i,u=e.data,d=e.data.seasons;ye(d);var v=videoId||(null==d||null===(t=d[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.id);T(c,a),w(v,a).then((function(e){var t,o,i;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,de(e.data),Wn(s,{res:null==e?void 0:e.data,sres:u},n,{resolve:r,reject:l})})).catch((function(e){I(e,s,l,videoId)}))})).catch((function(e){I(e,s,l)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function it(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 rt(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?it(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):it(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function lt(){return{loadVideoInstantly:P,onTimeUpdate:z,getVideoDuration:G,onVideoEnded:X,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var o=n(t.mark((function n(o,i){var r,l,a,s,u,c,d,v,p,f,m,g,y,b,h,k,O,S,j,T,P,D,E,C,x;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!R(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(y=(null==e?void 0:e.videoSourceUrl)||!1,b=null==e?void 0:e.asat,h=(null==e||null===(r=e.epg)||void 0===r?void 0:r.enable)||!1,k=null==e?void 0:e.videoId,O=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,S=(null==e?void 0:e.streamingInfo)||!1,window.videoId=k,j=null==e?void 0:e.token,!H(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",j),F().set(null==e?void 0:e.refreshToken),j&&!q(j)){n.next=16;break}return i({status:!1,msg:"".concat(j?"Token is expired !":"Missing Authorization Token"),response:{token:j}}),n.abrupt("return");case 16:Xn=JSON.parse(atob(j.split(".")[1]));case 17:return window.siteName=null===(a=Xn)||void 0===a?void 0:a.site,window.siteId=null===(s=Xn)||void 0===s?void 0:s.siteId,e.isAnonymousUser=!(null===(u=Xn)||void 0===u||!u.anonymousId),e.siteOwner=(null===(c=Xn)||void 0===c?void 0:c.site)||null,e.userId=(null===(d=Xn)||void 0===d?void 0:d.userId)||null,window.sessionStorage.setItem("uid",null===(v=Xn)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,T=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(p=e.series)&&void 0!==p&&p.enable?null:null==e?void 0:e.chromecastReceiverId,P=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,(D=null==e?void 0:e.errors)&&(window.customErrors=D),window.customData=null==e?void 0:e.customData,se(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),U.set(e.apiBaseUrl),null!=e&&e.skin&&!ae(e.skin)||(e.skin="VL_ONE"),n.next=35,We(e);case 35:P&&Ae("https://www.googletagmanager.com/gtag/js?id=".concat(P)).then((function(){return J(P)})).catch((function(e){})),(E=null===(g=document)||void 0===g?void 0:g.getElementById("".concat(T)))&&E.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y?(x={directPlaybackUrl:y,id:C="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},b?w(C,j).then((function(n){var t=(null==n?void 0:n.data)||{};Wn(T,{res:rt(rt({},t),x)},e,{resolve:o,reject:i})})).catch((function(e){I(e,T,i,C)})):Wn(T,{res:x},e,{resolve:o,reject:i})):S?Yn(e,{resolve:o,reject:i}):O?tt(e,{resolve:o,reject:i}):h?et(e,{resolve:o,reject:i}):$n(e,{resolve:o,reject:i});case 39:case"end":return n.stop()}}),n)})));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:ie,skip:D,getPlayer:K,play:E,pause:C,detectBrowser:o,rewind:x,loadVideo:c,seekToTimeStamp:Y,isPlayerInitialised:R,load:A,authenticateLC:L,dispose:N,enableCaptions:oe,disableCaptions:ne,getCaptions:ee,playSelectedResolution:re,getSource:u,setVolume:Ne,getVolume:_e,disableControls:f,setPlaybackSpeed:Q,getEntitlementData:_,adsQueuePointManager:M,getSsaiEvents:V,playerEvents:$,onReplay:Z,isBehindLive:B}}export{lt as V,Mn as i,Bn as r};
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./generic-227dd92b.js";import"./player_instance-34118a5b.js";import"video.js";export{V as default}from"./index-e23388db.js";import"./util-aeb59632.js";import"./captions-f507e8ee.js";import"./resolution-1c59b0f3.js";import"./skin-d5091b86.js";import"./localisation-0bf399a1.js";import"js-cookie";import"./currentVideoInfo-a8a254c2.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@viewlift/comscore/index.js";import"@babel/runtime/helpers/typeof";import"./icons-37daa6b3.js";import"./helper-349e076f.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";
1
+ import"video.js/dist/video-js.min.css";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./generic-227dd92b.js";import"./player_instance-34118a5b.js";import"video.js";export{V as default}from"./index-e35f4fab.js";import"./util-aeb59632.js";import"./captions-f507e8ee.js";import"./resolution-1c59b0f3.js";import"./skin-d5091b86.js";import"./localisation-0bf399a1.js";import"js-cookie";import"./currentVideoInfo-a8a254c2.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@viewlift/comscore/index.js";import"@babel/runtime/helpers/typeof";import"./icons-37daa6b3.js";import"./helper-349e076f.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";
@@ -1 +1 @@
1
- import{h as l,d as e,e as o,o as i,p as n,q as t,r as a,s as r}from"./features-0fea54ae.js";import{g as u}from"./player_instance-34118a5b.js";import{a as s,i as d,b as v}from"./index-750c848d.js";import{S as p,e as c,R as m,U as b,V as h}from"./generic-227dd92b.js";import"videojs-contrib-quality-menu";import{i as f,r as y}from"./index-e23388db.js";import{c as g}from"./helper-349e076f.js";import{c as j,a as w,b as C}from"./currentVideoInfo-a8a254c2.js";import B from"video.js";import{c as T,d as k}from"./icons-37daa6b3.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"./resolution-1c59b0f3.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/assertThisInitialized";import"./skin-d5091b86.js";import"./localisation-0bf399a1.js";import"./autoNextVideo-5cb3369b.js";import"./util-aeb59632.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/slicedToArray";import"axios";import"js-cookie";import"./captions-f507e8ee.js";import"@viewlift/comscore/index.js";import"video.js/dist/video-js.min.css";function L(e,o){var i=u(e);i&&(i.on("loadeddata",(function(){var l,n,t,a,r,v=g(o),c=j();i.qualityLevels()&&i.qualityLevels().length&&function(l){var e=u(l);e&&(null==e||e.qualityMenu,e.qualityMenu({useResolutionLabels:!0}))}(e),!(null!=o&&null!==(l=o.series)&&void 0!==l&&l.enable||null!==(n=window)&&void 0!==n&&null!==(t=n.app_data)&&void 0!==t&&null!==(a=t.appcmsMain)&&void 0!==a&&null!==(r=a.features)&&void 0!==r&&r.auto_play)||null!=o&&o.liveVideo||s(e,o),null!=o&&o.liveVideo||p()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||d(e),v&&c&&c.length?f(e):y()})),i.one("play",(function(){var o,i,n,t;null!==(o=window)&&void 0!==o&&null!==(i=o.customData)&&void 0!==i&&i.iframeOverlayUrl&&l(e,null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t?void 0:t.iframeOverlayUrl)})))}function M(l,s){u(l).addClass("skin_vlone"),L(l,s),function(l,u){var s,d,p,f,y,j,B,L,M,V,_,q,x,A,E,R,I=(null==u?void 0:u.liveVideo)||!1,S=(null==u||null===(s=u.res)||void 0===s?void 0:s.contentType)||"video",D=(null==u||null===(d=u.res)||void 0===d||null===(p=d[S])||void 0===p?void 0:p.isSSAIEnabled)||!1,O=c(null==u?void 0:u.res,l)||{};O.src;var P=(null==u?void 0:u.skin_settings)||{};g(u),null!=P&&P.skipBtn&&0==(null==u?void 0:u.liveVideo)&&0==(null==u?void 0:u.liveui)&&e(l,"VL_ONE",T());(null!=P&&P.rewindBtn&&0==(null==u?void 0:u.liveVideo)&&0==(null==u?void 0:u.liveui)||1==(null==u?void 0:u.liveui))&&o(l,"VL_ONE",k());(null==u||null===(f=u.relatedVideos)||void 0===f||null===(y=f.content)||void 0===y?void 0:y.length)>0&&i(l,null==u?void 0:u.relatedVideos);null!=u&&null!==(j=u.series)&&void 0!==j&&j.enable&&n(l,u);(null==u||null===(B=u.streams)||void 0===B?void 0:B.length)>1&&t(l,null==u?void 0:u.streams);if(v(l,u),m(l,u),"MEDIA_TAILOR"==(null===(L=window)||void 0===L||null===(M=L.app_data)||void 0===M||null===(V=M.appcmsMain)||void 0===V||null===(_=V.adsConfig)||void 0===_?void 0:_.vodAdSticherProvider)&&null!==(q=window)&&void 0!==q&&null!==(x=q.app_data)&&void 0!==x&&null!==(A=x.appcmsMain)&&void 0!==A&&null!==(E=A.adsConfig)&&void 0!==E&&E.vodAdClientSideTracking&&D)if(I)b(l);else{var H,N=null;if(null!=u&&null!==(H=u.series)&&void 0!==H&&H.enable){var U,G,$,z,F,Y=null===(U=w())||void 0===U||null===(G=U.video)||void 0===G||null===($=G.gist)||void 0===$?void 0:$.id,J=C(),K=(null==J?void 0:J.get(Y))||{t:0,p:0},Q=K.t,W=K.p;"function"==typeof(null===(z=window)||void 0===z||null===(F=z.watchHistory)||void 0===F?void 0:F.cb)&&window.watchHistory.cb({watchedTime:Q}),W<95&&(N=Q)}else{var X=u.watchHistoryResumeTime;u.watchedPercentage<95&&(N=X)}h(l,N)}null!=u&&u.isDvrEnabled&&null!=u&&null!==(R=u.dvrConfig)&&void 0!==R&&R.enable&&(a(l,u),r(l,u))}(l,s),V(l,s),function(l){var e,o,i,n=u(l),t=null;if(!n)return;var a=n.controlBar.getChild("VolumePanel"),r=null===(e=a.getChild("MuteToggle"))||void 0===e?void 0:e.el(),s=null==a||null===(o=a.el())||void 0===o?void 0:o.querySelector(".vjs-volume-bar"),d=null==a||null===(i=a.el())||void 0===i?void 0:i.querySelector(".vjs-volume-level");if(!a||!s||!d)return;function v(l){l.preventDefault(),t&&(clearTimeout(t),t=null),c(m(l.touches[0]))}function p(l){l.preventDefault(),c(m(l.changedTouches[0])),t=setTimeout((function(){a.el().classList.remove("vjs-hover")}),2e3)}function c(l){var e=Math.min(Math.max(l,0),100);d.style.height=e+"%",s.setAttribute("aria-valuenow",e),s.setAttribute("aria-valuetext",e+"%"),n.volume(e/100)}function m(l){var e=s.getBoundingClientRect(),o=l.clientY-e.top,i=e.height;return 100-Math.min(Math.max(o/i*100,0),100)}r.addEventListener("touchend",(function(){null!=a&&a.el()&&(a.el().classList.toggle("vjs-hover"),n.muted(!1),t&&(clearTimeout(t),t=null),t=setTimeout((function(){a.el().classList.remove("vjs-hover")}),2e3))})),s.addEventListener("touchmove",v,{passive:!1}),s.addEventListener("touchstart",v,{passive:!1}),s.addEventListener("touchend",p,{passive:!1})}(l)}var V=function(l,e){var o,i,n,t,a,r,s,d,v,p,c,m,b=u(l),h=(null==e?void 0:e.theme)||{},f=B.dom.$(".vjs-play-progress"),y=B.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");y&&(y.style.color="".concat(null===(o=window)||void 0===o||null===(i=o.app_data)||void 0===i||null===(n=i.appcmsMain)||void 0===n||null===(t=n.brand)||void 0===t||null===(a=t.cta)||void 0===a||null===(r=a.primary)||void 0===r?void 0:r.backgroundColor)),f&&(f.style.background="".concat(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(v=d.appcmsMain)||void 0===v||null===(p=v.brand)||void 0===p||null===(c=p.cta)||void 0===c||null===(m=c.primary)||void 0===m?void 0:m.backgroundColor));var g=b.getChild("BigPlayButton")||null;(null==h?void 0:h.progressBarColor)&&f&&(f.style.background=h.progressBarColor),(null==h?void 0:h.playButtonBackgroundColor)&&g&&(g.el().style.background=h.playButtonBackgroundColor),(null==h?void 0:h.playButtonColor)&&y&&(y.style.color=h.playButtonColor),(null==h?void 0:h.playButtonType)&&("square"==(null==h?void 0:h.playButtonType)?g.el().style.borderRadius=".3em":g.el().style.borderRadius="1.3em")};export{M as initialiseSkin};
1
+ import{h as l,d as e,e as o,o as i,p as n,q as t,r as a,s as r}from"./features-0fea54ae.js";import{g as u}from"./player_instance-34118a5b.js";import{a as s,i as d,b as v}from"./index-750c848d.js";import{S as p,e as c,R as m,U as b,V as h}from"./generic-227dd92b.js";import"videojs-contrib-quality-menu";import{i as f,r as y}from"./index-e35f4fab.js";import{c as g}from"./helper-349e076f.js";import{c as j,a as w,b as C}from"./currentVideoInfo-a8a254c2.js";import B from"video.js";import{c as T,d as k}from"./icons-37daa6b3.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"./resolution-1c59b0f3.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/assertThisInitialized";import"./skin-d5091b86.js";import"./localisation-0bf399a1.js";import"./autoNextVideo-5cb3369b.js";import"./util-aeb59632.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/slicedToArray";import"axios";import"js-cookie";import"./captions-f507e8ee.js";import"@viewlift/comscore/index.js";import"video.js/dist/video-js.min.css";function L(e,o){var i=u(e);i&&(i.on("loadeddata",(function(){var l,n,t,a,r,v=g(o),c=j();i.qualityLevels()&&i.qualityLevels().length&&function(l){var e=u(l);e&&(null==e||e.qualityMenu,e.qualityMenu({useResolutionLabels:!0}))}(e),!(null!=o&&null!==(l=o.series)&&void 0!==l&&l.enable||null!==(n=window)&&void 0!==n&&null!==(t=n.app_data)&&void 0!==t&&null!==(a=t.appcmsMain)&&void 0!==a&&null!==(r=a.features)&&void 0!==r&&r.auto_play)||null!=o&&o.liveVideo||s(e,o),null!=o&&o.liveVideo||p()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||d(e),v&&c&&c.length?f(e):y()})),i.one("play",(function(){var o,i,n,t;null!==(o=window)&&void 0!==o&&null!==(i=o.customData)&&void 0!==i&&i.iframeOverlayUrl&&l(e,null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t?void 0:t.iframeOverlayUrl)})))}function M(l,s){u(l).addClass("skin_vlone"),L(l,s),function(l,u){var s,d,p,f,y,j,B,L,M,V,_,q,x,A,E,R,I=(null==u?void 0:u.liveVideo)||!1,S=(null==u||null===(s=u.res)||void 0===s?void 0:s.contentType)||"video",D=(null==u||null===(d=u.res)||void 0===d||null===(p=d[S])||void 0===p?void 0:p.isSSAIEnabled)||!1,O=c(null==u?void 0:u.res,l)||{};O.src;var P=(null==u?void 0:u.skin_settings)||{};g(u),null!=P&&P.skipBtn&&0==(null==u?void 0:u.liveVideo)&&0==(null==u?void 0:u.liveui)&&e(l,"VL_ONE",T());(null!=P&&P.rewindBtn&&0==(null==u?void 0:u.liveVideo)&&0==(null==u?void 0:u.liveui)||1==(null==u?void 0:u.liveui))&&o(l,"VL_ONE",k());(null==u||null===(f=u.relatedVideos)||void 0===f||null===(y=f.content)||void 0===y?void 0:y.length)>0&&i(l,null==u?void 0:u.relatedVideos);null!=u&&null!==(j=u.series)&&void 0!==j&&j.enable&&n(l,u);(null==u||null===(B=u.streams)||void 0===B?void 0:B.length)>1&&t(l,null==u?void 0:u.streams);if(v(l,u),m(l,u),"MEDIA_TAILOR"==(null===(L=window)||void 0===L||null===(M=L.app_data)||void 0===M||null===(V=M.appcmsMain)||void 0===V||null===(_=V.adsConfig)||void 0===_?void 0:_.vodAdSticherProvider)&&null!==(q=window)&&void 0!==q&&null!==(x=q.app_data)&&void 0!==x&&null!==(A=x.appcmsMain)&&void 0!==A&&null!==(E=A.adsConfig)&&void 0!==E&&E.vodAdClientSideTracking&&D)if(I)b(l);else{var H,N=null;if(null!=u&&null!==(H=u.series)&&void 0!==H&&H.enable){var U,G,$,z,F,Y=null===(U=w())||void 0===U||null===(G=U.video)||void 0===G||null===($=G.gist)||void 0===$?void 0:$.id,J=C(),K=(null==J?void 0:J.get(Y))||{t:0,p:0},Q=K.t,W=K.p;"function"==typeof(null===(z=window)||void 0===z||null===(F=z.watchHistory)||void 0===F?void 0:F.cb)&&window.watchHistory.cb({watchedTime:Q}),W<95&&(N=Q)}else{var X=u.watchHistoryResumeTime;u.watchedPercentage<95&&(N=X)}h(l,N)}null!=u&&u.isDvrEnabled&&null!=u&&null!==(R=u.dvrConfig)&&void 0!==R&&R.enable&&(a(l,u),r(l,u))}(l,s),V(l,s),function(l){var e,o,i,n=u(l),t=null;if(!n)return;var a=n.controlBar.getChild("VolumePanel"),r=null===(e=a.getChild("MuteToggle"))||void 0===e?void 0:e.el(),s=null==a||null===(o=a.el())||void 0===o?void 0:o.querySelector(".vjs-volume-bar"),d=null==a||null===(i=a.el())||void 0===i?void 0:i.querySelector(".vjs-volume-level");if(!a||!s||!d)return;function v(l){l.preventDefault(),t&&(clearTimeout(t),t=null),c(m(l.touches[0]))}function p(l){l.preventDefault(),c(m(l.changedTouches[0])),t=setTimeout((function(){a.el().classList.remove("vjs-hover")}),2e3)}function c(l){var e=Math.min(Math.max(l,0),100);d.style.height=e+"%",s.setAttribute("aria-valuenow",e),s.setAttribute("aria-valuetext",e+"%"),n.volume(e/100)}function m(l){var e=s.getBoundingClientRect(),o=l.clientY-e.top,i=e.height;return 100-Math.min(Math.max(o/i*100,0),100)}r.addEventListener("touchend",(function(){null!=a&&a.el()&&(a.el().classList.toggle("vjs-hover"),n.muted(!1),t&&(clearTimeout(t),t=null),t=setTimeout((function(){a.el().classList.remove("vjs-hover")}),2e3))})),s.addEventListener("touchmove",v,{passive:!1}),s.addEventListener("touchstart",v,{passive:!1}),s.addEventListener("touchend",p,{passive:!1})}(l)}var V=function(l,e){var o,i,n,t,a,r,s,d,v,p,c,m,b=u(l),h=(null==e?void 0:e.theme)||{},f=B.dom.$(".vjs-play-progress"),y=B.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");y&&(y.style.color="".concat(null===(o=window)||void 0===o||null===(i=o.app_data)||void 0===i||null===(n=i.appcmsMain)||void 0===n||null===(t=n.brand)||void 0===t||null===(a=t.cta)||void 0===a||null===(r=a.primary)||void 0===r?void 0:r.backgroundColor)),f&&(f.style.background="".concat(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(v=d.appcmsMain)||void 0===v||null===(p=v.brand)||void 0===p||null===(c=p.cta)||void 0===c||null===(m=c.primary)||void 0===m?void 0:m.backgroundColor));var g=b.getChild("BigPlayButton")||null;(null==h?void 0:h.progressBarColor)&&f&&(f.style.background=h.progressBarColor),(null==h?void 0:h.playButtonBackgroundColor)&&g&&(g.el().style.background=h.playButtonBackgroundColor),(null==h?void 0:h.playButtonColor)&&y&&(y.style.color=h.playButtonColor),(null==h?void 0:h.playButtonType)&&("square"==(null==h?void 0:h.playButtonType)?g.el().style.borderRadius=".3em":g.el().style.borderRadius="1.3em")};export{M as initialiseSkin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "2.0.196-backup",
3
+ "version": "2.0.197-backup",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "types": "dist/@viewlift/player/esm/index.d.ts",
6
6
  "amdName": "_playerCore",
@@ -1 +0,0 @@
1
- "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator");require("axios");var o=require("./generic-dc7b4a94.js"),r=require("./player_instance-fcf6a8fb.js"),i=require("video.js"),l=require("./util-7a0f40d6.js"),a=require("./captions-dbc83a75.js"),u=require("./resolution-f9dcc1b4.js"),s=require("./skin-516012d7.js"),d=require("./localisation-56e0a999.js"),c=require("./currentVideoInfo-31d70bec.js"),v=require("@babel/runtime/helpers/typeof"),p=require("./icons-2609dbe4.js"),f=require("./helper-a50a8ffc.js"),g=require("@babel/runtime/helpers/toConsumableArray"),m=function(e){return new Promise((function(n,t){if(y(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}}))},y=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},h=function(e,n,t){var o=r.getPlayer(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},b=function(e){var n=r.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},w=function(){var e=n(t.mark((function e(n){var l,a,u,s,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=r.getPlayer(null==n?void 0:n.playerId),null!=n&&null!==(l=n.series)&&void 0!==l&&l.enable||!(null!=n&&n.chromecastReceiverId||null!=n&&n.airplay)){e.next=10;break}return e.prev=2,e.next=5,m("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.log("Error",e.t0);case 10:if(null!=n&&null!==(a=n.series)&&void 0!==a&&a.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=13,import("@silvermine/videojs-chromecast");case 13:e.sent.default(i),(d=i.getTech("chromecast"))&&!d.prototype.seeking&&(d.prototype.seeking=function(){}),null!==(s=window)&&void 0!==s&&s.cast?null==u||u.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==u||u.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==o.detectBrowser()?null==u||u.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(n){return e.apply(this,arguments)}}(),k=function(e,n){var t=r.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,r,l,a,u=this.el(),s=i.dom.getPointerPosition(u,n).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*s,v.seek()}}))};var S=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),m("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))]);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("@viewlift/comscore/index.js").then((function(e){o.comscoreInstanceManager.set(e)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),O=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then((function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),P=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(i),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./index-3f0e537b.js")}));case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),j=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./videojs-dash5.es-3854764f.js")}));case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),C=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){m("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(i)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(i)}))},loadAdsLibrary:S,loadEMELibrary:O,loadMuxPlugin:P,loadDvrSeekbar:T,loadContribDash:j,loadComscorePlugin:I});function E(e){return D.apply(this,arguments)}function D(){return(D=n(t.mark((function e(n){var r;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(null==n?void 0:n.airplay)||!1,e.next=3,S();case 3:r&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return C})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function x(e){return R.apply(this,arguments)}function R(){return(R=n(t.mark((function e(n){var o,i,l,a,u,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=r.getPlayer(n.playerId),e.next=3,I();case 3:s.comscore({publisherId:null==n||null===(o=n.comscore)||void 0===o?void 0:o.publishedId,endpoint:null==n||null===(i=n.comscore)||void 0===i?void 0:i.endpoint,implementationId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.implementationId,projectId:null==n||null===(a=n.comscore)||void 0===a?void 0:a.projectId,debug:(null==n||null===(u=n.comscore)||void 0===u?void 0:u.debug)||!1});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function L(e,n){return A.apply(this,arguments)}function A(){return(A=n(t.mark((function e(n,r){var i,l,a,u,s,d,c,v,p,f,g,m;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v=(null==r?void 0:r.contentType)||"video",p=null==r||null===(i=r[v])||void 0===i?void 0:i.drmEnabled,null==r||null===(l=r[v])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==r||null===(u=r[v])||void 0===u||null===(s=u.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.dash)||null,g=(null==n||null===(c=n.comscore)||void 0===c?void 0:c.enable)||!1,e.prev=6,e.next=9,Promise.allSettled([p?"Safari"==o.detectBrowser()?O():"caliente"!=(null===(m=window)||void 0===m?void 0:m.siteName)?j():O():"Safari"!=o.detectBrowser()&&f?j():null,g?x(n):null,w(n)]);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:case"end":return e.stop()}}),e,null,[[6,11]])})))).apply(this,arguments)}function N(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 V(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?N(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):N(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var _=new Set,B=null,M=function(e,n,t){var r,i,l,a,u,s,d,v={},p=(null==e?void 0:e.contentType)||"video";v["c3.cm.id"]=(null===(r=e[p])||void 0===r?void 0:r.id)||"Null",v["c3.cm.contentType"]=J(e),v[null==t||null===(i=t.Constants)||void 0===i?void 0:i.IS_LIVE]=!(null==e||!e.linearchannel),v[null==t||null===(l=t.Constants)||void 0===l?void 0:l.STREAM_URL]=n.currentSrc(),v[null==t||null===(a=t.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===o.getUserId()?"NULL":o.getUserId(),v["c3.cm.categoryType"]=F(e),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(u=e[p])||void 0===u?void 0:u.drmEnabled)||"None",v.DAIStream=null!==(s=e[p])&&void 0!==s&&null!==(d=s.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",v[t.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=W(e),v["c3.cm.genreList"]=U(e),v["c3.cm.genre"]=H(e),v["c3.cm.channel"]=q(e);var f=X(c.getCurrentSeries(),e);return v=V(V({},v),f)},H=function(e){var n,t,o,r=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[r])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},U=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map((function(e){return null==e?void 0:e.title})).join(", ")||"Null"},q=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},F=function(e){return(null==e?void 0:e.contentType)||"null"},W=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return r?"YES":"NO"},G=function(e,n){var t,o,r=(n||{}).epg;if(r&&null!=r&&r.enable&&null!=r&&r.programTitle)return r.programTitle;var i=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[i])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},J=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var K,z,X=function(e,n){var t,r,i,l,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var s=o.getSeasonNumber(),d=o.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(r=t.series)||void 0===r?void 0:r.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(i=e[s-1])||void 0===i||null===(l=i.episodes)||void 0===l||null===(a=l[d-1])||void 0===a?void 0:a.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},Y=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},Q=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},$=function(){var e=n(t.mark((function e(n,o){var i,l,a,u,s,d,v,p,f,g;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},l=i.trackConvivaPlayerEvent,a=i.paymentHandler,u=i.tveProvider,s=i.enable,d=i.appName,v=(o||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(p=r.getPlayer(n),"function"==typeof(f=l)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,f("getConvivaObject");case 10:if(g=e.sent){e.next=13;break}return e.abrupt("return");case 13:p.ready((function(){var e=p.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=Y(t.keySystem);f("contentInfo",{DRMEnabled:o})}else f("contentInfo",{DRMEnabled:"None"})})),n||f("contentInfo",{DRMEnabled:"None"})})),p.on("loadstart",(function(){var e,n;B&&B!==p.currentSrc()&&f("playbackEnded"),f("setPlayer",p),_.clear(),B=p.currentSrc();var t=Q(p.currentType()),r=c.getCurrentVideo(),i=M(r,p,g);i[null==g||null===(e=g.Constants)||void 0===e?void 0:e.PLAYER_NAME]=d||"WEB",i[null==g||null===(n=g.Constants)||void 0===n?void 0:n.ASSET_NAME]=G(r,o),i.authToken=v||"NULL",i.streamType=t,i.D2CType=a||"NONE",i.subscriberType=u||(a?"D2C":"FREE"),i["c3.cm.affiliate"]=u||"NULL",Z.setData(i),f("contentInfo",i)})),p.on("loadedmetadata",(function(){var e,n=p.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),f("contentInfo",{screenResolution:e})})),p.on("play",(function(){_.has(p.currentSrc())||(_.add(p.currentSrc()),f("playbackStarted",null))})),p.on("ended",(function(){_.has(p.currentSrc())&&_.delete(p.currentSrc()),f("playbackEnded")})),p.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&f("initAdSensor",{player:p,adsLoader:null==e?void 0:e.adsLoader})})),p.on("dispose",(function(){null==_||_.clear(),f("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Z=(K={},{setData:function(e){K=V(V({},K),e)},getData:function(){return K}}),ee=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-b08b92d0.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-9be02be9.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-36ecc705.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-32ffda5a.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-07e3b037.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t?Promise.resolve().then((function(){return require("./skin-1cbd1f59.js")})).then((function(t){t.initialiseSkin(e,n)})):"news"==t&&Promise.resolve().then((function(){return require("./skin-85e9a926.js")})).then((function(t){t.initialiseSkin(e,n)}))};function ne(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 te(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ne(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var oe=[],re=0,ie=null;function le(){console.log("Cleaning up watch history data"),z=null,oe=[],re=0,ie=null}function ae(e,n,t){var r,i,l,a,u,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(r=n.watchHistory)||void 0===r||r.apiVersion;var d=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,c=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(l=n.watchHistory)||void 0===l||l.xapiKey;var p=(null==n||null===(a=n.video)||void 0===a?void 0:a.originalObjectId)||null,f=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,g=Math.floor(e.currentTime()),m=s?100:Math.floor(c/v*100),y={};f?se(y={completed:s,watchedTime:g,watchedPercentage:m},d,n.siteOwner):(y=te(te({videoId:z,watchedTime:g,watchedPercentage:m,doneWatching:s,profileId:d},ie&&{seriesId:ie}),p&&{originalObjectId:p}),o.saveWatchHistory(y).then((function(e){})).catch((function(e){}))),re=c+t}function ue(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function se(n,t,o){var r=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),i=ue(r),l=(new Date).getTime(),a=c.getCurrentVideo(),u=(null==a?void 0:a.video)||{},s=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(n,t){return te(te({},n),{},e({},t,u[t]))}),{}),d=i.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===z}));d<0?i.push(te(te({content:s},n),{},{addedDate:l,updateDate:l})):i[d]=te(te(te({},i[d]),n),{},{updateDate:l}),localStorage.setItem("".concat(r),JSON.stringify(i))}function de(e,n,t){var o=ue(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),r=[];return o&&Array.isArray(o)&&(r=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),r}var ce=!1,ve=function(e,n){var t,r,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(r=t.streamingInfo)||void 0===r?void 0:r.secondaryVideoAssets)||null)&&!ce){var l=pe(e,"videoAssets","secondaryVideoAssets"),a=o.getSource(l,n);return a&&o.loadVideo(n,a),ce=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function pe(e,n,t){if(Array.isArray(e))return e.map((function(e){return pe(e,n,t)}));if(null!==e&&"object"===v(e)){var o={};return Object.keys(e).forEach((function(r){r===n&&void 0!==e[t]?o[r]=e[t]:r===t&&void 0!==e[n]?o[r]=e[n]:o[r]=pe(e[r],n,t)})),o}return e}function fe(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return ge(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ge(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function ge(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function me(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 ye(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?me(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):me(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var he=function(e,n,t,i){var l,u,s,d,p,f=i.res,g=i.sres,m=r.getPlayer(e),y=(null==f?void 0:f.contentType)||"video",b=(null==f||null===(l=f[y])||void 0===l?void 0:l.drmEnabled)||!1,w=(null==f||null===(u=f[y])||void 0===u||null===(s=u.streamingInfo)||void 0===s?void 0:s.isLiveStream)||!1,k=(null==f||null===(d=f[y])||void 0===d||null===(p=d.liveDetails)||void 0===p?void 0:p.isDvrEnabled)||!1;c.setCurrentVideo(f),c.videoReplayTracker.set(f),m&&(m.on("loadstart",(function(){w?t.resolve({status:!0,msg:"Video Loaded",response:f}):t.resolve(ye({status:!0,msg:"Player Initialised"},g?{seriesResponse:g,response:f}:{response:f}))})),m.on("loadeddata",(function(){var t,i,l,u=a.getCaptions(e);if(null==u||u.map((function(n){return a.disableCaptions(e,n.id)})),k&&"Safari"===o.detectBrowser())try{var s;null==m||null===(s=m.liveTracker)||void 0===s||s.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&h(e,sessionStorage.getItem("volume")||"100");var d=c.getCurrentVideo();if(o.initialiseComscoreStreamingTracking(n,f),o.clearError(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.saveOffline)){var v,p,g=ye(ye({},n),f);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(ie=null==n||null===(i=n.series)||void 0===i?void 0:i.id),oe=[],re=0,z=t;var a=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,u=r.getPlayer(e);u&&(u.on("dispose",le),u.on("timeupdate",(function(){if(!u.seeking()){var e=Math.floor(u.currentTime());oe.includes(re)||(e!=re||e<a?e>re&&(re=e+a):(oe.push(e),ae(u,n,a)))}})),u.one("ended",(function(){ae(u,n,a,!0)})))}(e,g,null==d||null===(v=d.video)||void 0===v||null===(p=v.gist)||void 0===p?void 0:p.id)}if(null!=n&&null!==(l=n.analytics)&&void 0!==l&&l.muxKey&&null!=m&&m.mux){var y,b,w,S,I,O,P=(null===(y=c.getCurrentVideo())||void 0===y?void 0:y.video)||(null==f?void 0:f.video),T=null==P?void 0:P.gist,j={env_key:null==n||null===(b=n.analytics)||void 0===b?void 0:b.muxKey,player_name:"vl-web-player",player_version:null===(w=window)||void 0===w?void 0:w.vl_player_version,video_id:null==T?void 0:T.id,video_title:null==T?void 0:T.title,video_series:null==P||null===(S=P.series)||void 0===S?void 0:S.title,video_stream_type:null!=P&&null!==(I=P.streamingInfo)&&void 0!==I&&I.isLiveStream?"live":"video",viewer_user_id:null==n||null===(O=n.analytics)||void 0===O?void 0:O.userId};m.mux({debug:!1,data:j})}})),m.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];m.trigger("subtitlechanged",n)})),m.on("subtitlechanged",(function(e,n){var t,o,r,i,l,a,u,s,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(i=r.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(d=s.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var g,m=f.getMediaSession(),y=m.media.tracks.filter((function(e){return"TEXT"==e.type}));g=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),m.editTracksInfo(g)}})),m.tech_.on("retryplaylist",(function(){w&&ve(f,e)})),m.on("error",(function(){var n,r;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&w)?ve(f,e):(o.handleError(e,(null==m||null===(n=m.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==m||null===(r=m.error())||void 0===r?void 0:r.message)||"Some error occured",response:f}))})),m.one("play",(function(){var e,t,o,r,i;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(o=t.appcmsMain)||void 0===o||null===(r=o.adsConfig)||void 0===r||!r.vodAdClientSideTracking){if(null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable){var l,a,u,s=null===(l=c.getCurrentVideo())||void 0===l||null===(a=l.video)||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.id,d=c.getSeriesWatchMap(),v=(null==d?void 0:d.get(s))||{t:0,p:0},p=v.t,f=v.p;p&&f<95&&setTimeout((function(){m.currentTime(p)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){m.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}})),m.on("volumechange",(function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),m.on("chromecastDisconnected",(function(){if(w){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}})),m.one("loadeddata",(function(){var e,n=(null==m||null===(e=m.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort((function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0})),"object"==v(m.dash)){var t,r,i,l=null==m||null===(t=m.dash)||void 0===t||null===(r=t.mediaPlayer)||void 0===r?void 0:r.getTracksFor("audio"),a=null==l?void 0:l.find((function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")})),u=fe(n);try{for(u.s();!(i=u.n()).done;){var s=i.value;if(a&&(null==s?void 0:s.id)=="dash-audio-".concat(a.index)){s.enabled=!0;break}}}catch(e){u.e(e)}finally{u.f()}}else{var d,c=fe(n);try{for(c.s();!(d=c.n()).done;){var p,f,g,y=d.value;if(("Chrome"==o.detectBrowser()||"Edge"==o.detectBrowser()&&(null!==(p=navigator)&&void 0!==p&&null!==(f=p.userAgent)&&void 0!==f&&f.includes("Macintosh")||!b))&&null!=y&&null!==(g=y.label)&&void 0!==g&&g.includes("5.1"))m.audioTracks().removeTrack(y);else{if("main"==y.kind){y.enabled=!0;break}y.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}})))};function be(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function we(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach((function(e){e.remove()}))}function ke(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(c.getCurrentEpgPrograms()||[]).filter((function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n})).map((function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}}))}function Se(e,n){var t=r.getPlayer(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,l=n.videoId;n.epg;var a=i.playLive,u=i.playFromBegining,s=i.programs;c.setCurrentEpgPrograms(s),t.on("loadeddata",(function(){f.checkDvrStartOverEnabled(n)?u?f.playFromBeginningHandler(t,n):a?f.playLiveOrResumeHandler(t,l):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,r=n.videoId,i=n.epg,l=o.buttonConfig,a=void 0===l?{}:l,u=a.watchLive;a.resume;var s=a.startFromBegining,d=r;if(i&&null!=i&&i.enable){var c=JSON.parse(sessionStorage.getItem("epgConfig"));d="".concat(null==c?void 0:c.programId,"-").concat(null==c?void 0:c.channelId)}var v=!!f.getWatchedTime(d),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var g=f.getCurrentProgramThumbnail(n);g&&(p.style.backgroundImage="url(".concat(g,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.innerHTML=Oe(o,v),p.style.display="flex",e.el().appendChild(p),f.pauseAndHideControl(e),Ie("watch-live-resume-btn",u,(function(){f.showControl(e,p),f.playLiveOrResumeHandler(e,d)})),Ie("watch-begining-btn",s,(function(){f.showControl(e,p),f.playFromBeginningHandler(e,n)}))}(t,n),f.handleLiveStartOverBtn({player:t,showWatchLive:!0,showStartOver:!0})):f.removeDvrStartOver(t)})),t.one("loadedmetadata",(function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),r=!1,i=e.seekable(),l=i.start(0),a=i.end(i.length-1)-l,u=JSON.parse(sessionStorage.getItem("epgConfig")),s=t,d=!0;if(u&&null!=u&&u.enable){var c;d=(null==n||null===(c=n.epg)||void 0===c?void 0:c.programId)===(null==u?void 0:u.programId),s=null==u?void 0:u.programId}e.on("seeking",(function(){r=!0})),e.on("seeked",(function(){r=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!d||sessionStorage.getItem("program_switched"))return;s="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}f.saveWatchedTime(s,o),f.getProgramStartTime(e,n),f.handleLiveStartOverBtn({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})})),e.on("timeupdate",(function(){if(!r){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!d||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");s="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(f.saveWatchedTime(s,t),o=t,function(e,n){ke(n).forEach((function(t){var o=t.id,r=t.title,i=t.time,l=document.getElementById(o);if(l){var a=Math.min(i/n*100,99.5);l.style.left="".concat(a,"%")}else{var u=e.controlBar.progressControl.seekBar.el(),s=be(o,r,Math.min(i/n*100,99.5));u.appendChild(s)}}))}(e,a))}}))}(t,n)}))}else console.warn("Player instance is required to initialize start over.")}function Ie(e,n,t){var o,r,i=document.getElementById(e);i&&(r=n,(o=i)&&(o.style.color="".concat((null==r?void 0:r.textColor)||"#000"),o.style.backgroundColor="".concat((null==r?void 0:r.backGroundColor)||"#DCF95B")),i.addEventListener("click",t))}function Oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,r=t.resume,i=t.startFromBegining,l=n?(null==r?void 0:r.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(p.watchLiveIcon2()," ").concat(l,"</button>"),u='<button id="watch-begining-btn">'.concat(p.startLiveIcon()," ").concat((null==i?void 0:i.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(u,"</div>")}function Pe(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 Te(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Pe(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var je=function(l,u,d,c){var v,p,f,g,m,y,h,b,w,S,I,O,P,T,j,C,E,D,x,R,A,N,V,_,B,M,H,U,q,F,W,G,J,K,z,X,Y,Q,ne,te,oe=u.res,re=void 0===oe?null:oe,ie=u.sres,le=void 0===ie?null:ie,ae=null!=d&&d.chromecastReceiverId?["chromecast","html5"]:["html5"],ue=(null===(v=re)||void 0===v?void 0:v.contentType)||"video",se=s.impolicy16x9(null===(p=re)||void 0===p||null===(f=p[ue])||void 0===f||null===(g=f.gist)||void 0===g?void 0:g.videoImageUrl)||s.impolicy16x9(null===(m=re)||void 0===m||null===(y=m[ue])||void 0===y||null===(h=y.gist)||void 0===h||null===(b=h.imageGist)||void 0===b?void 0:b.r16x9),de=(null===(w=re)||void 0===w||null===(S=w[ue])||void 0===S||null===(I=S.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,ce=(null===(O=re)||void 0===O||null===(P=O[ue])||void 0===P||null===(T=P.streamingInfo)||void 0===T?void 0:T.isLiveStream)||!1,ve=(null===(j=re)||void 0===j||null===(C=j.ads)||void 0===C||null===(E=C.preRoll)||void 0===E||null===(D=E.adTags)||void 0===D||null===(x=D.web)||void 0===x?void 0:x.active)&&(null===(R=re)||void 0===R||null===(A=R.ads)||void 0===A||null===(N=A.preRoll)||void 0===N||null===(V=N.adTags)||void 0===V||null===(_=V.web)||void 0===_?void 0:_.url),pe=(null===(B=re=Te(Te({},re),{},{audioAssetSource:null==d?void 0:d.audioAssetSource}))||void 0===B||null===(M=B[ue])||void 0===M?void 0:M.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(H=window)||void 0===H||null===(U=H.app_data)||void 0===U||null===(q=U.appcmsMain)||void 0===q||null===(F=q.adsConfig)||void 0===F?void 0:F.vodAdSticherProvider)||!1,fe=(null==d?void 0:d.latency)||6,ge=(null==d?void 0:d.skin_settings)||{};null==d||d.dvrConfig;var me=(ne={enableSmoothSeeking:!0,controls:0!=(null==d?void 0:d.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==d?void 0:d.muted)||!1,autoplay:(null==d?void 0:d.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==ge?void 0:ge.pictureInPictureToggle)||!1},playbackRates:null!=ge&&ge.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==d.skin,liveui:de},e(ne,"autoplay",null==d?void 0:d.autoplay),e(ne,"normalizeAutoplay",(null==d?void 0:d.autoplay)&&!ve),e(ne,"loop",(null==d?void 0:d.loop)||!1),e(ne,"audioPosterMode",null==d?void 0:d.audioPosterMode),e(ne,"html5",Te(Te({dash:Te(Te(Te({},!i.browser.IS_SAFARI&&{useTTML:!0}),(null==d?void 0:d.debugConfig)&&(null==d||null===(W=d.debugConfig)||void 0===W?void 0:W.enable)&&{debug:!0,logLevel:null!=d&&null!==(G=d.debugConfig)&&void 0!==G&&G.logLevel?null==d||null===(J=d.debugConfig)||void 0===J?void 0:J.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:fe},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Te(Te({liveRangeSafeTimeDelta:fe,useDevicePixelRatio:!0,experimentalLLHLS:(null==d?void 0:d.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==d||null===(K=d.customData)||void 0===K?void 0:K.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===(z=null==d?void 0:d.enableLowInitialPlaylist)||void 0===z||z}),debug:(null==d?void 0:d.debugConfig)&&(null==d||null===(X=d.debugConfig)||void 0===X?void 0:X.enable)||!1,nativeTextTracks:"Safari"==o.detectBrowser()},0==(null==d||null===(Y=d.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==d||null===(Q=d.customData)||void 0===Q?void 0:Q.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(ne,"poster",se),e(ne,"techOrder",ae),e(ne,"chromecast",{requestCustomDataFn:function(e){var n,t,o=r.getPlayer(l),i=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind})),a=function(e,n,t){var o,r,i,l,a,u,s,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var g,m,y,h,b,w,k,S;f.isDrmEnabled=!0;var I=(null==n||null===(g=n.keySystems)||void 0===g?void 0:g["com.widevine.alpha"])||null,O=(null==I?void 0:I.url)||(null==n||null===(m=n.keySystemOptions)||void 0===m||null===(y=m[0])||void 0===y||null===(h=y.options)||void 0===h?void 0:h.serverURL);f.licenseUrl=O;var P=(null==I?void 0:I.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);f.licenseToken=P}var T=(null==e||null===(o=e[p])||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType)||"VIDEO";f.contentType=T;var j=null==e||null===(i=e[p])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;f.duration=j;var C=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;f.mediaTitle=C;var E=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=E,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(re,e,i);return Te(Te({},a),{},{convivaMetaData:Te({customerKey:(null==d||null===(n=d.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==d||null===(t=d.convivaConfig)||void 0===t?void 0:t.debug)||!1},Z.getData())})},modifyLoadRequestFn:function(e){var n,t,o,i,a,u=r.getPlayer(l),s=(null==u?void 0:u.currentSource())||{};!(null===(n=re)||void 0===n||null===(t=n[ue])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(i=o.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(a=s.src)&&void 0!==a&&a.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),ne);if(!i.getPlayers()[l]){null!=d&&d.debugConfig&&null!=d&&null!==(te=d.debugConfig)&&void 0!==te&&te.enable&&i.log.level("debug");var ye=i(l,me,function(){var e=n(t.mark((function e(){var n,r,u,s,v,p,f,g,m,y,h,b,w,S,I,O,P,T,j,C,E;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(ye),console.log(i.VERSION),console.log(i.getPlugins()),e.next=5,L(d,re);case 5:if(w=null===(n=re)||void 0===n||null===(r=n[ue])||void 0===r||null===(u=r.liveDetails)||void 0===u?void 0:u.startOverTime,ce&&c.resolve(Te({status:!0,msg:"Player Initialised"},le?{seriesResponse:le,response:re}:{response:re})),de&&null!=d&&null!==(s=d.dvrConfig)&&void 0!==s&&s.enable&&Se(l,Te(Te({},d),{},{isDvrEnabled:de})),o.inititateBeacon(l,null==d?void 0:d.analyticsCb,null==d?void 0:d.customData),$(l,d),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),de&&k(l,w),!ve||null!=d&&null!==(v=d.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(l,ve,re),S=o.getSource(re,l),console.log(S),null!=d&&d.nearestClusterUrl&&(S=o.getUpdatedClusterSource(S,d.nearestClusterUrl)),!pe){e.next=21;break}return e.next=20,o.getSGAIEnabledSource(l,re);case 20:S=e.sent;case 21:S?o.loadVideo(l,S):(c.reject({status:!1,msg:"Incompatible / Missing Source",response:re}),o.handleError(l,"Incompatible / Missing Source")),((null===(p=re)||void 0===p||null===(f=p[ue])||void 0===f||null===(g=f.contentDetails)||void 0===g||null===(m=g.closedCaptions)||void 0===m?void 0:m.length)>0||(null===(y=re)||void 0===y||null===(h=y[ue])||void 0===h||null===(b=h.closedCaptions)||void 0===b?void 0:b.length)>0)&&(E=(null===(O=re)||void 0===O||null===(P=O[ue])||void 0===P||null===(T=P.contentDetails)||void 0===T?void 0:T.closedCaptions)||(null===(j=re)||void 0===j||null===(C=j[ue])||void 0===C?void 0:C.closedCaptions),I=E.filter((function(e){return"VTT"===e.format||"WEBVTT"===e.format})),a.addCaptions(l,I)),null!=d&&d.disableControls?o.disableControls(l):ee(l,Te(Te(Te({},d),me),{},{liveVideo:ce,isDvrEnabled:de,res:re,sres:le})),he(l,Te(Te(Te({},d),me),{},{liveVideo:ce}),c,{res:re,sres:le});case 25:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())}};function Ce(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Ee(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ce(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var De,xe=function(e,n){var t=n.resolve,o=n.reject,r=null==e?void 0:e.playerId,i=Re(e);je(r,{res:i},e,{resolve:t,reject:o})},Re=function(e){var n,t,r,i,l,a,u,s,d=null==e?void 0:e.streamingInfo,c=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,v=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,p=(null==e||null===(r=e.streamingInfo)||void 0===r||null===(i=r.ads)||void 0===i?void 0:i.url)||null,f=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,m=(null==e||null===(a=e.streamingInfo)||void 0===a?void 0:a.subtitles)||[],y=(null==e||null===(u=e.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.drmProvider)||null,h=null==e?void 0:e.token,b=o.getDecodedToken(h);null==b||b.site;var w=null==b?void 0:b.siteId;return Ee(Ee({id:"".concat(w,"_external")},!v&&{directPlaybackUrl:null==c?void 0:c.url}),{},{video:{drmEnabled:v,streamingInfo:{videoAssets:Ee(Ee({},y&&{drmProvider:y}),{},{widevine:null==c?void 0:c.widevine,fairPlay:null==c?void 0:c.fairPlay,playReady:null==c?void 0:c.playReady})},liveDetails:{isDvrEnabled:null==d?void 0:d.isDvrEnabled},gist:Ee({},f&&{videoImageUrl:f}),contentDetails:Ee({},(null==m?void 0:m.length)>0&&{closedCaptions:g(m)})},ads:{preRoll:{adTags:{web:Ee(Ee({},p&&{active:!0}),p&&{url:p})}}}})};function Le(e,n){return Ae.apply(this,arguments)}function Ae(){return(Ae=n(t.mark((function e(n,r){var i,l,a,u,s,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.resolve,l=r.reject,a=null==n?void 0:n.videoId,u=null==n?void 0:n.playerId,s=!(null==n||!n.anonymousId),e.next=6,o.getToken();case 6:d=e.sent,o.getVideoDetails(a,d).then((function(e){var t,r,v,p;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(r=t.video)||void 0===r||null===(v=r.gist)||void 0===v?void 0:v.contentType,c.setCurrentVideo(null==e?void 0:e.data);var f,g=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(p=n.watchHistory)&&void 0!==p&&p.enable&&!s)if((null===(f=n.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var m,y,h,b=de((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",a,null==n?void 0:n.siteOwner);if(b&&b.length)n.watchHistoryResumeTime=(null===(y=b[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(h=b[0])||void 0===h?void 0:h.watchedPercentage)||null;g.contentType="video",je(u,{res:g},n,{resolve:i,reject:l})}else o.getVideoInfo(a,d).then((function(e){var t,o,r,i,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(r=window)||void 0===r||null===(i=r.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,g.contentType="video"})).catch((function(e){var n,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))})).finally((function(){je(u,{res:g},n,{resolve:i,reject:l})}));else je(u,{res:g},n,{resolve:i,reject:l})})).catch((function(e){o.initiateErrorHandling(e,u,l,a)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ne(e,n){return Ve.apply(this,arguments)}function Ve(){return(Ve=n(t.mark((function e(n,r){var i,l,a,u,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.resolve,l=r.reject,e.next=3,o.getToken();case 3:a=e.sent,u=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,o.getLinearChannelDetails(s,a).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,je(u,{res:t},n,{resolve:i,reject:l})})).catch((function(e){o.initiateErrorHandling(e,u,l,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _e(e,n){return Be.apply(this,arguments)}function Be(){return(Be=n(t.mark((function e(n,r){var i,l,a,u,s,d,v;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=r.resolve,a=r.reject,e.next=3,o.getToken();case 3:u=e.sent,s=null==n?void 0:n.playerId,d=sessionStorage.getItem("season-idx")||0,c.seasonIdxManager.set(parseInt(d)),v=null==n||null===(i=n.series)||void 0===i?void 0:i.id,o.getSeriesDetails(v,u).then((function(e){var t,r,i,d=e.data,p=e.data.seasons;c.setCurrentSeries(p);var f=videoId||(null==p||null===(t=p[0])||void 0===t||null===(r=t.episodes)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.id);o.createSeriesWatchMap(v,u),o.getVideoDetails(f,u).then((function(e){var t,o,r;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType,c.setCurrentVideo(e.data),je(s,{res:null==e?void 0:e.data,sres:d},n,{resolve:l,reject:a})})).catch((function(e){o.initiateErrorHandling(e,s,a,videoId)}))})).catch((function(e){o.initiateErrorHandling(e,s,a)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Me(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 He(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Me(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}exports.VLPlayerCore=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var r=n(t.mark((function n(r,i){var l,a,u,c,v,p,f,g,y,h,b,w,k,S,I,O,P,T,j,C,D,x,R,L,A;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(k=(null==e?void 0:e.videoSourceUrl)||!1,S=null==e?void 0:e.asat,I=(null==e||null===(l=e.epg)||void 0===l?void 0:l.enable)||!1,O=null==e?void 0:e.videoId,P=(null==e||null===(a=e.series)||void 0===a?void 0:a.enable)||!1,T=(null==e?void 0:e.streamingInfo)||!1,window.videoId=O,j=null==e?void 0:e.token,!o.token_authentication_enabled(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",j),o.refreshTokenManager().set(null==e?void 0:e.refreshToken),j&&!o.isTokenExpired(j)){n.next=16;break}return i({status:!1,msg:"".concat(j?"Token is expired !":"Missing Authorization Token"),response:{token:j}}),n.abrupt("return");case 16:De=JSON.parse(atob(j.split(".")[1]));case 17:return window.siteName=null===(u=De)||void 0===u?void 0:u.site,window.siteId=null===(c=De)||void 0===c?void 0:c.siteId,e.isAnonymousUser=!(null===(v=De)||void 0===v||!v.anonymousId),e.siteOwner=(null===(p=De)||void 0===p?void 0:p.site)||null,e.userId=(null===(f=De)||void 0===f?void 0:f.userId)||null,window.sessionStorage.setItem("uid",null===(g=De)||void 0===g?void 0:g.userId),window.watchHistory=e.watchHistory||null,C=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(y=e.series)&&void 0!==y&&y.enable?null:null==e?void 0:e.chromecastReceiverId,D=(null==e||null===(h=e.analytics)||void 0===h?void 0:h.gaId)||null,(x=null==e?void 0:e.errors)&&(window.customErrors=x),window.customData=null==e?void 0:e.customData,d.setLocalisation(null==e||null===(b=e.customData)||void 0===b?void 0:b.localisation),o.baseUrlManager.set(e.apiBaseUrl),null!=e&&e.skin&&!s.isNotAValidSkin(e.skin)||(e.skin="VL_ONE"),n.next=35,E(e);case 35:D&&m("https://www.googletagmanager.com/gtag/js?id=".concat(D)).then((function(){return o.runGtag(D)})).catch((function(e){})),(R=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(C)))&&R.addEventListener("contextmenu",(function(e){return e.preventDefault()})),k?(A={directPlaybackUrl:k,id:L="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},S?o.getVideoDetails(L,j).then((function(n){var t=(null==n?void 0:n.data)||{};je(C,{res:He(He({},t),A)},e,{resolve:r,reject:i})})).catch((function(e){o.initiateErrorHandling(e,C,i,L)})):je(C,{res:A},e,{resolve:r,reject:i})):T?xe(e,{resolve:r,reject:i}):P?_e(e,{resolve:r,reject:i}):I?Ne(e,{resolve:r,reject:i}):Le(e,{resolve:r,reject:i});case 39:case"end":return n.stop()}}),n)})));return function(e,n){return r.apply(this,arguments)}}())},getRenditions:u.getRenditions,skip:o.skip,getPlayer:r.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,authenticateLC:o.authenticateLC,dispose:o.dispose,enableCaptions:a.enableCaptions,disableCaptions:a.disableCaptions,getCaptions:a.getCaptions,playSelectedResolution:u.playSelectedResolution,getSource:o.getSource,setVolume:h,getVolume:b,disableControls:o.disableControls,setPlaybackSpeed:l.setPlaybackSpeed,getEntitlementData:o.getEntitlementData,adsQueuePointManager:o.adsQueuePointManager,getSsaiEvents:o.getSsaiEvents,playerEvents:l.playerEvents,onReplay:l.onReplay,isBehindLive:o.isBehindLive}},exports.initiateMarker=function(e){var n=r.getPlayer(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),l=t.end(t.length-1)-i;we(),ke(l).forEach((function(e){var n=e.id,t=e.title,r=e.time,i=be(n,t,Math.min(r/l*100,99.5));o.appendChild(i)}))}},exports.removeMarkers=we;
@@ -1 +0,0 @@
1
- import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import"axios";import{d as o,c as i,g as r,a as l,b as a,s,e as u,l as c,i as d,f as v,h as p,j as f,k as m,m as g,n as y,o as b,p as h,q as w,r as k,t as I,u as O,v as S,w as j,x as T,y as P,z as D,A as E,B as C,C as x,D as R,E as A,F as L,G as N,H as _,I as M,J as V,K as B,L as U,M as H,N as F,O as q,P as J}from"./generic-227dd92b.js";import{g as K}from"./player_instance-34118a5b.js";import W from"video.js";import{o as z,g as G,a as X,s as Y,b as Q,p as $,c as Z}from"./util-aeb59632.js";import{g as ee,d as ne,a as te,e as oe}from"./captions-f507e8ee.js";import{g as ie,p as re}from"./resolution-1c59b0f3.js";import{i as le,a as ae}from"./skin-d5091b86.js";import{s as se}from"./localisation-0bf399a1.js";import{g as ue,a as ce,s as de,v as ve,b as pe,c as fe,d as me,e as ge,f as ye}from"./currentVideoInfo-a8a254c2.js";import be from"@babel/runtime/helpers/typeof";import{s as he,w as we}from"./icons-37daa6b3.js";import{c as ke,p as Ie,a as Oe,h as Se,r as je,g as Te,b as Pe,d as De,s as Ee,e as Ce,f as xe}from"./helper-349e076f.js";import Re from"@babel/runtime/helpers/toConsumableArray";var Ae=function(e){return new Promise((function(n,t){if(Le(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}}))},Le=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Ne=function(e,n,t){var o=K(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},_e=function(e){var n=K(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Me=function(){var e=n(t.mark((function e(n){var i,r,l,a,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=K(null==n?void 0:n.playerId),null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable||!(null!=n&&n.chromecastReceiverId||null!=n&&n.airplay)){e.next=10;break}return e.prev=2,e.next=5,Ae("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.log("Error",e.t0);case 10:if(null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=13,import("@silvermine/videojs-chromecast");case 13:e.sent.default(W),(s=W.getTech("chromecast"))&&!s.prototype.seeking&&(s.prototype.seeking=function(){}),null!==(a=window)&&void 0!==a&&a.cast?null==l||l.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==o()?null==l||l.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(n){return e.apply(this,arguments)}}(),Ve=function(e,n){var t=K(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,r,l,a=this.el(),s=W.dom.getPointerPosition(a,n).x;W.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,d.seek()}}))};var Be=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),Ae("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))]);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ue=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("@viewlift/comscore/index.js").then((function(e){i.set(e)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),He=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then((function(e){W.getPlugin("eme")||W.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Fe=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(W),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),qe=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-8e3eab6d.js");case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),Je=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-08c7635e.js");case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),Ke=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){Ae("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(W)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(W)}))},loadAdsLibrary:Be,loadEMELibrary:He,loadMuxPlugin:Fe,loadDvrSeekbar:qe,loadContribDash:Je,loadComscorePlugin:Ue});function We(e){return ze.apply(this,arguments)}function ze(){return(ze=n(t.mark((function e(n){var i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=(null==n?void 0:n.airplay)||!1,e.next=3,Be();case 3:i&&"Safari"==o()&&Promise.resolve().then((function(){return Ke})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(e){return Xe.apply(this,arguments)}function Xe(){return(Xe=n(t.mark((function e(n){var o,i,r,l,a,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=K(n.playerId),e.next=3,Ue();case 3:s.comscore({publisherId:null==n||null===(o=n.comscore)||void 0===o?void 0:o.publishedId,endpoint:null==n||null===(i=n.comscore)||void 0===i?void 0:i.endpoint,implementationId:null==n||null===(r=n.comscore)||void 0===r?void 0:r.implementationId,projectId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.projectId,debug:(null==n||null===(a=n.comscore)||void 0===a?void 0:a.debug)||!1});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ye(e,n){return Qe.apply(this,arguments)}function Qe(){return(Qe=n(t.mark((function e(n,i){var r,l,a,s,u,c,d,v,p,f,m,g;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v=(null==i?void 0:i.contentType)||"video",p=null==i||null===(r=i[v])||void 0===r?void 0:r.drmEnabled,null==i||null===(l=i[v])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==i||null===(s=i[v])||void 0===s||null===(u=s.streamingInfo)||void 0===u||null===(c=u.videoAssets)||void 0===c?void 0:c.dash)||null,m=(null==n||null===(d=n.comscore)||void 0===d?void 0:d.enable)||!1,e.prev=6,e.next=9,Promise.allSettled([p?"Safari"==o()?He():"caliente"!=(null===(g=window)||void 0===g?void 0:g.siteName)?Je():He():"Safari"!=o()&&f?Je():null,m?Ge(n):null,Me(n)]);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:case"end":return e.stop()}}),e,null,[[6,11]])})))).apply(this,arguments)}function $e(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 Ze(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?$e(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):$e(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var en=new Set,nn=null,tn=function(e,n,t){var o,i,l,a,s,u,c,d={},v=(null==e?void 0:e.contentType)||"video";d["c3.cm.id"]=(null===(o=e[v])||void 0===o?void 0:o.id)||"Null",d["c3.cm.contentType"]=cn(e),d[null==t||null===(i=t.Constants)||void 0===i?void 0:i.IS_LIVE]=!(null==e||!e.linearchannel),d[null==t||null===(l=t.Constants)||void 0===l?void 0:l.STREAM_URL]=n.currentSrc(),d[null==t||null===(a=t.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===r()?"NULL":r(),d["c3.cm.categoryType"]=an(e),d["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),d.DRMEnabled=(null===(s=e[v])||void 0===s?void 0:s.drmEnabled)||"None",d.DAIStream=null!==(u=e[v])&&void 0!==u&&null!==(c=u.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",d[t.Constants.DEFAULT_RESOURCE]="AKAMAI",d["c3.cm.brand"]="NULL",d.CDVREnabled=sn(e),d["c3.cm.genreList"]=rn(e),d["c3.cm.genre"]=on(e),d["c3.cm.channel"]=ln(e);var p=pn(ue(),e);return d=Ze(Ze({},d),p)},on=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},rn=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map((function(e){return null==e?void 0:e.title})).join(", ")||"Null"},ln=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},an=function(e){return(null==e?void 0:e.contentType)||"null"},sn=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},un=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[r])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},cn=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var dn,vn,pn=function(e,n){var t,o,i,r,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var c=a(),d=l();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(o=t.series)||void 0===o?void 0:o.title)||"Null",u["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(i=e[c-1])||void 0===i||null===(r=i.episodes)||void 0===r||null===(s=r[d-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},fn=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},mn=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},gn=function(){var e=n(t.mark((function e(n,o){var i,r,l,a,s,u,c,d,v,p;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},r=i.trackConvivaPlayerEvent,l=i.paymentHandler,a=i.tveProvider,s=i.enable,u=i.appName,c=(o||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(d=K(n),"function"==typeof(v=r)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,v("getConvivaObject");case 10:if(p=e.sent){e.next=13;break}return e.abrupt("return");case 13:d.ready((function(){var e=d.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=fn(t.keySystem);v("contentInfo",{DRMEnabled:o})}else v("contentInfo",{DRMEnabled:"None"})})),n||v("contentInfo",{DRMEnabled:"None"})})),d.on("loadstart",(function(){var e,n;nn&&nn!==d.currentSrc()&&v("playbackEnded"),v("setPlayer",d),en.clear(),nn=d.currentSrc();var t=mn(d.currentType()),i=ce(),r=tn(i,d,p);r[null==p||null===(e=p.Constants)||void 0===e?void 0:e.PLAYER_NAME]=u||"WEB",r[null==p||null===(n=p.Constants)||void 0===n?void 0:n.ASSET_NAME]=un(i,o),r.authToken=c||"NULL",r.streamType=t,r.D2CType=l||"NONE",r.subscriberType=a||(l?"D2C":"FREE"),r["c3.cm.affiliate"]=a||"NULL",yn.setData(r),v("contentInfo",r)})),d.on("loadedmetadata",(function(){var e,n=d.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),v("contentInfo",{screenResolution:e})})),d.on("play",(function(){en.has(d.currentSrc())||(en.add(d.currentSrc()),v("playbackStarted",null))})),d.on("ended",(function(){en.has(d.currentSrc())&&en.delete(d.currentSrc()),v("playbackEnded")})),d.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&v("initAdSensor",{player:d,adsLoader:null==e?void 0:e.adsLoader})})),d.on("dispose",(function(){null==en||en.clear(),v("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),yn=(dn={},{setData:function(e){dn=Ze(Ze({},dn),e)},getData:function(){return dn}}),bn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-71d399f6.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-c303da65.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-0913004f.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-020b5e86.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-f877008d.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t?import("./skin-97922cb9.js").then((function(t){t.initialiseSkin(e,n)})):"news"==t&&import("./skin-1c262d06.js").then((function(t){t.initialiseSkin(e,n)}))};function hn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function wn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?hn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):hn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var kn=[],In=0,On=null;function Sn(){console.log("Cleaning up watch history data"),vn=null,kn=[],In=0,On=null}function jn(e,n,t){var o,i,r,l,a,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(o=n.watchHistory)||void 0===o||o.apiVersion;var c=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,d=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(r=n.watchHistory)||void 0===r||r.xapiKey;var p=(null==n||null===(l=n.video)||void 0===l?void 0:l.originalObjectId)||null,f=(null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.saveOffline)||!1,m=Math.floor(e.currentTime()),g=u?100:Math.floor(d/v*100),y={};f?Pn(y={completed:u,watchedTime:m,watchedPercentage:g},c,n.siteOwner):(y=wn(wn({videoId:vn,watchedTime:m,watchedPercentage:g,doneWatching:u,profileId:c},On&&{seriesId:On}),p&&{originalObjectId:p}),s(y).then((function(e){})).catch((function(e){}))),In=d+t}function Tn(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Pn(n,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=Tn(i),l=(new Date).getTime(),a=ce(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(n,t){return wn(wn({},n),{},e({},t,s[t]))}),{}),c=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===vn}));c<0?r.push(wn(wn({content:u},n),{},{addedDate:l,updateDate:l})):r[c]=wn(wn(wn({},r[c]),n),{},{updateDate:l}),localStorage.setItem("".concat(i),JSON.stringify(r))}function Dn(e,n,t){var o=Tn(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var En=!1,Cn=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!En){var r=xn(e,"videoAssets","secondaryVideoAssets"),l=u(r,n);return l&&c(n,l),En=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function xn(e,n,t){if(Array.isArray(e))return e.map((function(e){return xn(e,n,t)}));if(null!==e&&"object"===be(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=xn(e[i],n,t)})),o}return e}function Rn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return An(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?An(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function An(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function Ln(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Nn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ln(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ln(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var _n=function(e,n,t,i){var r,l,a,s,u,c=i.res,f=i.sres,m=K(e),g=(null==c?void 0:c.contentType)||"video",y=(null==c||null===(r=c[g])||void 0===r?void 0:r.drmEnabled)||!1,b=(null==c||null===(l=c[g])||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,h=(null==c||null===(s=c[g])||void 0===s||null===(u=s.liveDetails)||void 0===u?void 0:u.isDvrEnabled)||!1;de(c),ve.set(c),m&&(m.on("loadstart",(function(){b?t.resolve({status:!0,msg:"Video Loaded",response:c}):t.resolve(Nn({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:c}:{response:c}))})),m.on("loadeddata",(function(){var t,i,r,l=ee(e);if(null==l||l.map((function(n){return ne(e,n.id)})),h&&"Safari"===o())try{var a;null==m||null===(a=m.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&Ne(e,sessionStorage.getItem("volume")||"100");var s=ce();if(d(n,c),v(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.saveOffline)){var u,p,f=Nn(Nn({},n),c);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(On=null==n||null===(i=n.series)||void 0===i?void 0:i.id),kn=[],In=0,vn=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=K(e);a&&(a.on("dispose",Sn),a.on("timeupdate",(function(){if(!a.seeking()){var e=Math.floor(a.currentTime());kn.includes(In)||(e!=In||e<l?e>In&&(In=e+l):(kn.push(e),jn(a,n,l)))}})),a.one("ended",(function(){jn(a,n,l,!0)})))}(e,f,null==s||null===(u=s.video)||void 0===u||null===(p=u.gist)||void 0===p?void 0:p.id)}if(null!=n&&null!==(r=n.analytics)&&void 0!==r&&r.muxKey&&null!=m&&m.mux){var g,y,b,w,k,I,O=(null===(g=ce())||void 0===g?void 0:g.video)||(null==c?void 0:c.video),S=null==O?void 0:O.gist,j={env_key:null==n||null===(y=n.analytics)||void 0===y?void 0:y.muxKey,player_name:"vl-web-player",player_version:null===(b=window)||void 0===b?void 0:b.vl_player_version,video_id:null==S?void 0:S.id,video_title:null==S?void 0:S.title,video_series:null==O||null===(w=O.series)||void 0===w?void 0:w.title,video_stream_type:null!=O&&null!==(k=O.streamingInfo)&&void 0!==k&&k.isLiveStream?"live":"video",viewer_user_id:null==n||null===(I=n.analytics)||void 0===I?void 0:I.userId};m.mux({debug:!1,data:j})}})),m.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];m.trigger("subtitlechanged",n)})),m.on("subtitlechanged",(function(e,n){var t,o,i,r,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}})),m.tech_.on("retryplaylist",(function(){b&&Cn(c,e)})),m.on("error",(function(){var n,o;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&b)?Cn(c,e):(p(e,(null==m||null===(n=m.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==m||null===(o=m.error())||void 0===o?void 0:o.message)||"Some error occured",response:c}))})),m.one("play",(function(){var e,t,o,i,r;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(o=t.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable){var l,a,s,u=null===(l=ce())||void 0===l||null===(a=l.video)||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.id,c=pe(),d=(null==c?void 0:c.get(u))||{t:0,p:0},v=d.t,p=d.p;v&&p<95&&setTimeout((function(){m.currentTime(v)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){m.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}})),m.on("volumechange",(function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),m.on("chromecastDisconnected",(function(){if(b){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}})),m.one("loadeddata",(function(){var e,n=(null==m||null===(e=m.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort((function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0})),"object"==be(m.dash)){var t,i,r,l=null==m||null===(t=m.dash)||void 0===t||null===(i=t.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),a=null==l?void 0:l.find((function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")})),s=Rn(n);try{for(s.s();!(r=s.n()).done;){var u=r.value;if(a&&(null==u?void 0:u.id)=="dash-audio-".concat(a.index)){u.enabled=!0;break}}}catch(e){s.e(e)}finally{s.f()}}else{var c,d=Rn(n);try{for(d.s();!(c=d.n()).done;){var v,p,f,g=c.value;if(("Chrome"==o()||"Edge"==o()&&(null!==(v=navigator)&&void 0!==v&&null!==(p=v.userAgent)&&void 0!==p&&p.includes("Macintosh")||!y))&&null!=g&&null!==(f=g.label)&&void 0!==f&&f.includes("5.1"))m.audioTracks().removeTrack(g);else{if("main"==g.kind){g.enabled=!0;break}g.enabled=!1}}}catch(e){d.e(e)}finally{d.f()}}})))};function Mn(e){var n=K(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),r=t.end(t.length-1)-i;Bn(),Un(r).forEach((function(e){var n=e.id,t=e.title,i=e.time,l=Vn(n,t,Math.min(i/r*100,99.5));o.appendChild(l)}))}}function Vn(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function Bn(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach((function(e){e.remove()}))}function Un(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(fe()||[]).filter((function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n})).map((function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}}))}function Hn(e,n){var t=K(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,r=n.videoId;n.epg;var l=i.playLive,a=i.playFromBegining,s=i.programs;me(s),t.on("loadeddata",(function(){ke(n)?a?Ie(t,n):l?Oe(t,r):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,i=n.videoId,r=n.epg,l=o.buttonConfig,a=void 0===l?{}:l,s=a.watchLive;a.resume;var u=a.startFromBegining,c=i;if(r&&null!=r&&r.enable){var d=JSON.parse(sessionStorage.getItem("epgConfig"));c="".concat(null==d?void 0:d.programId,"-").concat(null==d?void 0:d.channelId)}var v=!!Te(c),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var f=Pe(n);f&&(p.style.backgroundImage="url(".concat(f,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.innerHTML=qn(o,v),p.style.display="flex",e.el().appendChild(p),De(e),Fn("watch-live-resume-btn",s,(function(){xe(e,p),Oe(e,c)})),Fn("watch-begining-btn",u,(function(){xe(e,p),Ie(e,n)}))}(t,n),Se({player:t,showWatchLive:!0,showStartOver:!0})):je(t)})),t.one("loadedmetadata",(function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),i=!1,r=e.seekable(),l=r.start(0),a=r.end(r.length-1)-l,s=JSON.parse(sessionStorage.getItem("epgConfig")),u=t,c=!0;if(s&&null!=s&&s.enable){var d;c=(null==n||null===(d=n.epg)||void 0===d?void 0:d.programId)===(null==s?void 0:s.programId),u=null==s?void 0:s.programId}e.on("seeking",(function(){i=!0})),e.on("seeked",(function(){i=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!c||sessionStorage.getItem("program_switched"))return;u="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}Ee(u,o),Ce(e,n),Se({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})})),e.on("timeupdate",(function(){if(!i){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!c||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");u="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(Ee(u,t),o=t,function(e,n){Un(n).forEach((function(t){var o=t.id,i=t.title,r=t.time,l=document.getElementById(o);if(l){var a=Math.min(r/n*100,99.5);l.style.left="".concat(a,"%")}else{var s=e.controlBar.progressControl.seekBar.el(),u=Vn(o,i,Math.min(r/n*100,99.5));s.appendChild(u)}}))}(e,a))}}))}(t,n)}))}else console.warn("Player instance is required to initialize start over.")}function Fn(e,n,t){var o,i,r=document.getElementById(e);r&&(i=n,(o=r)&&(o.style.color="".concat((null==i?void 0:i.textColor)||"#000"),o.style.backgroundColor="".concat((null==i?void 0:i.backGroundColor)||"#DCF95B")),r.addEventListener("click",t))}function qn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,i=t.resume,r=t.startFromBegining,l=n?(null==i?void 0:i.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(we()," ").concat(l,"</button>"),s='<button id="watch-begining-btn">'.concat(he()," ").concat((null==r?void 0:r.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(s,"</div>")}function Jn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Kn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Jn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Jn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Wn=function(i,r,l,a){var s,d,v,h,w,k,I,O,S,j,T,P,D,E,C,x,R,A,L,N,_,M,V,B,U,H,F,q,J,z,G,X,Y,Q,$,Z,ee,ne,oe,ie,re=r.res,ae=void 0===re?null:re,se=r.sres,ue=void 0===se?null:se,ce=null!=l&&l.chromecastReceiverId?["chromecast","html5"]:["html5"],de=(null===(s=ae)||void 0===s?void 0:s.contentType)||"video",ve=le(null===(d=ae)||void 0===d||null===(v=d[de])||void 0===v||null===(h=v.gist)||void 0===h?void 0:h.videoImageUrl)||le(null===(w=ae)||void 0===w||null===(k=w[de])||void 0===k||null===(I=k.gist)||void 0===I||null===(O=I.imageGist)||void 0===O?void 0:O.r16x9),pe=(null===(S=ae)||void 0===S||null===(j=S[de])||void 0===j||null===(T=j.liveDetails)||void 0===T?void 0:T.isDvrEnabled)||!1,fe=(null===(P=ae)||void 0===P||null===(D=P[de])||void 0===D||null===(E=D.streamingInfo)||void 0===E?void 0:E.isLiveStream)||!1,me=(null===(C=ae)||void 0===C||null===(x=C.ads)||void 0===x||null===(R=x.preRoll)||void 0===R||null===(A=R.adTags)||void 0===A||null===(L=A.web)||void 0===L?void 0:L.active)&&(null===(N=ae)||void 0===N||null===(_=N.ads)||void 0===_||null===(M=_.preRoll)||void 0===M||null===(V=M.adTags)||void 0===V||null===(B=V.web)||void 0===B?void 0:B.url),ge=(null===(U=ae=Kn(Kn({},ae),{},{audioAssetSource:null==l?void 0:l.audioAssetSource}))||void 0===U||null===(H=U[de])||void 0===H?void 0:H.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(F=window)||void 0===F||null===(q=F.app_data)||void 0===q||null===(J=q.appcmsMain)||void 0===J||null===(z=J.adsConfig)||void 0===z?void 0:z.vodAdSticherProvider)||!1,ye=(null==l?void 0:l.latency)||6,be=(null==l?void 0:l.skin_settings)||{};null==l||l.dvrConfig;var he=(oe={enableSmoothSeeking:!0,controls:0!=(null==l?void 0:l.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==l?void 0:l.muted)||!1,autoplay:(null==l?void 0:l.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==be?void 0:be.pictureInPictureToggle)||!1},playbackRates:null!=be&&be.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==l.skin,liveui:pe},e(oe,"autoplay",null==l?void 0:l.autoplay),e(oe,"normalizeAutoplay",(null==l?void 0:l.autoplay)&&!me),e(oe,"loop",(null==l?void 0:l.loop)||!1),e(oe,"audioPosterMode",null==l?void 0:l.audioPosterMode),e(oe,"html5",Kn(Kn({dash:Kn(Kn(Kn({},!W.browser.IS_SAFARI&&{useTTML:!0}),(null==l?void 0:l.debugConfig)&&(null==l||null===(G=l.debugConfig)||void 0===G?void 0:G.enable)&&{debug:!0,logLevel:null!=l&&null!==(X=l.debugConfig)&&void 0!==X&&X.logLevel?null==l||null===(Y=l.debugConfig)||void 0===Y?void 0:Y.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:ye},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Kn(Kn({liveRangeSafeTimeDelta:ye,useDevicePixelRatio:!0,experimentalLLHLS:(null==l?void 0:l.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==l||null===(Q=l.customData)||void 0===Q?void 0:Q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===($=null==l?void 0:l.enableLowInitialPlaylist)||void 0===$||$}),debug:(null==l?void 0:l.debugConfig)&&(null==l||null===(Z=l.debugConfig)||void 0===Z?void 0:Z.enable)||!1,nativeTextTracks:"Safari"==o()},0==(null==l||null===(ee=l.customData)||void 0===ee?void 0:ee.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==l||null===(ne=l.customData)||void 0===ne?void 0:ne.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(oe,"poster",ve),e(oe,"techOrder",ce),e(oe,"chromecast",{requestCustomDataFn:function(e){var n,t,o=K(i),r=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind})),a=function(e,n,t){var o,i,r,l,a,s,u,c,d,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,g,y,b,h,w,k,I;f.isDrmEnabled=!0;var O=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,S=(null==O?void 0:O.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(y=g[0])||void 0===y||null===(b=y.options)||void 0===b?void 0:b.serverURL);f.licenseUrl=S;var j=(null==O?void 0:O.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(h=n.keySystemOptions)||void 0===h||null===(w=h[0])||void 0===w||null===(k=w.options)||void 0===k||null===(I=k.httpRequestHeaders)||void 0===I?void 0:I["X-AxDRM-Message"]);f.licenseToken=j}var T=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=T;var P=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=P;var D=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=D;var E=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=E,f.subTitles=t,f.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(ae,e,r);return Kn(Kn({},a),{},{convivaMetaData:Kn({customerKey:(null==l||null===(n=l.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==l||null===(t=l.convivaConfig)||void 0===t?void 0:t.debug)||!1},yn.getData())})},modifyLoadRequestFn:function(e){var n,t,o,r,l,a=K(i),s=(null==a?void 0:a.currentSource())||{};!(null===(n=ae)||void 0===n||null===(t=n[de])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(r=o.videoAssets)||void 0===r?void 0:r.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(l=s.src)&&void 0!==l&&l.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),oe);if(!W.getPlayers()[i]){null!=l&&l.debugConfig&&null!=l&&null!==(ie=l.debugConfig)&&void 0!==ie&&ie.enable&&W.log.level("debug");var we=W(i,he,function(){var e=n(t.mark((function e(){var n,o,r,s,d,v,h,w,k,I,O,S,j,T,P,D,E,C,x,R,A;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(we),console.log(W.VERSION),console.log(W.getPlugins()),e.next=5,Ye(l,ae);case 5:if(j=null===(n=ae)||void 0===n||null===(o=n[de])||void 0===o||null===(r=o.liveDetails)||void 0===r?void 0:r.startOverTime,fe&&a.resolve(Kn({status:!0,msg:"Player Initialised"},ue?{seriesResponse:ue,response:ae}:{response:ae})),pe&&null!=l&&null!==(s=l.dvrConfig)&&void 0!==s&&s.enable&&Hn(i,Kn(Kn({},l),{},{isDvrEnabled:pe})),m(i,null==l?void 0:l.analyticsCb,null==l?void 0:l.customData),gn(i,l),/Android/i.test(navigator.userAgent)&&(W.options.vhs.overrideNative=!0),pe&&Ve(i,j),!me||null!=l&&null!==(d=l.customData)&&void 0!==d&&d.disableAds||g(i,me,ae),T=u(ae,i),console.log(T),null!=l&&l.nearestClusterUrl&&(T=y(T,l.nearestClusterUrl)),!ge){e.next=21;break}return e.next=20,b(i,ae);case 20:T=e.sent;case 21:T?c(i,T):(a.reject({status:!1,msg:"Incompatible / Missing Source",response:ae}),p(i,"Incompatible / Missing Source")),((null===(v=ae)||void 0===v||null===(h=v[de])||void 0===h||null===(w=h.contentDetails)||void 0===w||null===(k=w.closedCaptions)||void 0===k?void 0:k.length)>0||(null===(I=ae)||void 0===I||null===(O=I[de])||void 0===O||null===(S=O.closedCaptions)||void 0===S?void 0:S.length)>0)&&(A=(null===(D=ae)||void 0===D||null===(E=D[de])||void 0===E||null===(C=E.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null===(x=ae)||void 0===x||null===(R=x[de])||void 0===R?void 0:R.closedCaptions),P=A.filter((function(e){return"VTT"===e.format||"WEBVTT"===e.format})),te(i,P)),null!=l&&l.disableControls?f(i):bn(i,Kn(Kn(Kn({},l),he),{},{liveVideo:fe,isDvrEnabled:pe,res:ae,sres:ue})),_n(i,Kn(Kn(Kn({},l),he),{},{liveVideo:fe}),a,{res:ae,sres:ue});case 25:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())}};function zn(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 Gn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?zn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):zn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Xn,Yn=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,r=Qn(e);Wn(i,{res:r},e,{resolve:t,reject:o})},Qn=function(e){var n,t,o,i,r,l,a,s,u=null==e?void 0:e.streamingInfo,c=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,d=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,v=(null==e||null===(o=e.streamingInfo)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.url)||null,p=(null==e||null===(r=e.streamingInfo)||void 0===r?void 0:r.posterUrl)||null,f=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.subtitles)||[],m=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(s=a.videoAssets)||void 0===s?void 0:s.drmProvider)||null,g=null==e?void 0:e.token,y=h(g);null==y||y.site;var b=null==y?void 0:y.siteId;return Gn(Gn({id:"".concat(b,"_external")},!d&&{directPlaybackUrl:null==c?void 0:c.url}),{},{video:{drmEnabled:d,streamingInfo:{videoAssets:Gn(Gn({},m&&{drmProvider:m}),{},{widevine:null==c?void 0:c.widevine,fairPlay:null==c?void 0:c.fairPlay,playReady:null==c?void 0:c.playReady})},liveDetails:{isDvrEnabled:null==u?void 0:u.isDvrEnabled},gist:Gn({},p&&{videoImageUrl:p}),contentDetails:Gn({},(null==f?void 0:f.length)>0&&{closedCaptions:Re(f)})},ads:{preRoll:{adTags:{web:Gn(Gn({},v&&{active:!0}),v&&{url:v})}}}})};function $n(e,n){return Zn.apply(this,arguments)}function Zn(){return(Zn=n(t.mark((function e(n,o){var i,r,l,a,s,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.resolve,r=o.reject,l=null==n?void 0:n.videoId,a=null==n?void 0:n.playerId,s=!(null==n||!n.anonymousId),e.next=6,O();case 6:u=e.sent,w(l,u).then((function(e){var t,o,c,d;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(c=o.gist)||void 0===c?void 0:c.contentType,de(null==e?void 0:e.data);var v,p=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(d=n.watchHistory)&&void 0!==d&&d.enable&&!s)if((null===(v=n.watchHistory)||void 0===v?void 0:v.saveOffline)||!1){var f,m,g,y=Dn((null===(f=n.watchHistory)||void 0===f?void 0:f.profileId)||"",l,null==n?void 0:n.siteOwner);if(y&&y.length)n.watchHistoryResumeTime=(null===(m=y[0])||void 0===m?void 0:m.watchedTime)||null,n.watchedPercentage=(null===(g=y[0])||void 0===g?void 0:g.watchedPercentage)||null;p.contentType="video",Wn(a,{res:p},n,{resolve:i,reject:r})}else k(l,u).then((function(e){var t,o,i,r,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,p.contentType="video"})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})).finally((function(){Wn(a,{res:p},n,{resolve:i,reject:r})}));else Wn(a,{res:p},n,{resolve:i,reject:r})})).catch((function(e){I(e,a,r,l)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function et(e,n){return nt.apply(this,arguments)}function nt(){return(nt=n(t.mark((function e(n,o){var i,r,l,a,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.resolve,r=o.reject,e.next=3,O();case 3:l=e.sent,a=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,S(s,l).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,Wn(a,{res:t},n,{resolve:i,reject:r})})).catch((function(e){I(e,a,r,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tt(e,n){return ot.apply(this,arguments)}function ot(){return(ot=n(t.mark((function e(n,o){var i,r,l,a,s,u,c;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.resolve,l=o.reject,e.next=3,O();case 3:a=e.sent,s=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,ge.set(parseInt(u)),c=null==n||null===(i=n.series)||void 0===i?void 0:i.id,j(c,a).then((function(e){var t,o,i,u=e.data,d=e.data.seasons;ye(d);var v=videoId||(null==d||null===(t=d[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.id);T(c,a),w(v,a).then((function(e){var t,o,i;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,de(e.data),Wn(s,{res:null==e?void 0:e.data,sres:u},n,{resolve:r,reject:l})})).catch((function(e){I(e,s,l,videoId)}))})).catch((function(e){I(e,s,l)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function it(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 rt(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?it(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):it(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function lt(){return{loadVideoInstantly:P,onTimeUpdate:z,getVideoDuration:G,onVideoEnded:X,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var o=n(t.mark((function n(o,i){var r,l,a,s,u,c,d,v,p,f,m,g,y,b,h,k,O,S,j,T,P,D,E,C,x;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!R(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(y=(null==e?void 0:e.videoSourceUrl)||!1,b=null==e?void 0:e.asat,h=(null==e||null===(r=e.epg)||void 0===r?void 0:r.enable)||!1,k=null==e?void 0:e.videoId,O=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,S=(null==e?void 0:e.streamingInfo)||!1,window.videoId=k,j=null==e?void 0:e.token,!H(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",j),F().set(null==e?void 0:e.refreshToken),j&&!q(j)){n.next=16;break}return i({status:!1,msg:"".concat(j?"Token is expired !":"Missing Authorization Token"),response:{token:j}}),n.abrupt("return");case 16:Xn=JSON.parse(atob(j.split(".")[1]));case 17:return window.siteName=null===(a=Xn)||void 0===a?void 0:a.site,window.siteId=null===(s=Xn)||void 0===s?void 0:s.siteId,e.isAnonymousUser=!(null===(u=Xn)||void 0===u||!u.anonymousId),e.siteOwner=(null===(c=Xn)||void 0===c?void 0:c.site)||null,e.userId=(null===(d=Xn)||void 0===d?void 0:d.userId)||null,window.sessionStorage.setItem("uid",null===(v=Xn)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,T=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(p=e.series)&&void 0!==p&&p.enable?null:null==e?void 0:e.chromecastReceiverId,P=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,(D=null==e?void 0:e.errors)&&(window.customErrors=D),window.customData=null==e?void 0:e.customData,se(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),U.set(e.apiBaseUrl),null!=e&&e.skin&&!ae(e.skin)||(e.skin="VL_ONE"),n.next=35,We(e);case 35:P&&Ae("https://www.googletagmanager.com/gtag/js?id=".concat(P)).then((function(){return J(P)})).catch((function(e){})),(E=null===(g=document)||void 0===g?void 0:g.getElementById("".concat(T)))&&E.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y?(x={directPlaybackUrl:y,id:C="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},b?w(C,j).then((function(n){var t=(null==n?void 0:n.data)||{};Wn(T,{res:rt(rt({},t),x)},e,{resolve:o,reject:i})})).catch((function(e){I(e,T,i,C)})):Wn(T,{res:x},e,{resolve:o,reject:i})):S?Yn(e,{resolve:o,reject:i}):O?tt(e,{resolve:o,reject:i}):h?et(e,{resolve:o,reject:i}):$n(e,{resolve:o,reject:i});case 39:case"end":return n.stop()}}),n)})));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:ie,skip:D,getPlayer:K,play:E,pause:C,detectBrowser:o,rewind:x,loadVideo:c,seekToTimeStamp:Y,isPlayerInitialised:R,load:A,authenticateLC:L,dispose:N,enableCaptions:oe,disableCaptions:ne,getCaptions:ee,playSelectedResolution:re,getSource:u,setVolume:Ne,getVolume:_e,disableControls:f,setPlaybackSpeed:Q,getEntitlementData:_,adsQueuePointManager:M,getSsaiEvents:V,playerEvents:$,onReplay:Z,isBehindLive:B}}export{lt as V,Mn as i,Bn as r};