@viewlift/player-backup 2.0.154-backup → 2.0.156-backup

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/cjs/{autoNextVideo-5d0e55b1.js → autoNextVideo-3956b0f7.js} +1 -1
  2. package/cjs/bundle.css +35 -35
  3. package/cjs/{features-458ebda5.js → features-a45cff31.js} +1 -1
  4. package/cjs/generic-900f83b1.js +1 -0
  5. package/cjs/{index-4c71d167.js → index-8a7469c9.js} +1 -1
  6. package/cjs/{index-5b474000.js → index-b1a41b03.js} +1 -1
  7. package/cjs/index.js +1 -1
  8. package/cjs/{multicamv2-9712e761.js → multicamv2-5fad5720.js} +1 -1
  9. package/cjs/{multicamv2-82f7d26b.js → multicamv2-f3666c2f.js} +1 -1
  10. package/cjs/{nextEpisodeButton-4e68b783.js → nextEpisodeButton-3edac3a2.js} +1 -1
  11. package/cjs/{playlist-a7868614.js → playlist-74e9b975.js} +1 -1
  12. package/cjs/{series-f8858e53.js → series-a652a76e.js} +1 -1
  13. package/cjs/{series-v2-ea6c107b.js → series-v2-0133f296.js} +1 -1
  14. package/cjs/{series-v2-b43b648b.js → series-v2-510d584c.js} +1 -1
  15. package/cjs/{skin-aeb91b16.js → skin-5b88b6f4.js} +1 -1
  16. package/cjs/{skin-88576c78.js → skin-5d054f75.js} +1 -1
  17. package/cjs/{skin-b5272f13.js → skin-a4a531c7.js} +1 -1
  18. package/cjs/{skin-188a3db3.js → skin-b686cea9.js} +1 -1
  19. package/cjs/{skin-f7d3a1c4.js → skin-ebf5381a.js} +1 -1
  20. package/cjs/skin-ee86d94a.js +1 -0
  21. package/cjs/{skin-18bd3977.js → skin-fa077740.js} +1 -1
  22. package/cjs/{videoSelector-f1e0c3eb.js → videoSelector-3f889644.js} +1 -1
  23. package/cjs/{videoSelector-4a371b82.js → videoSelector-854f7d04.js} +1 -1
  24. package/esm/{autoNextVideo-b216988b.js → autoNextVideo-bb58f1bd.js} +1 -1
  25. package/esm/bundle.css +35 -35
  26. package/esm/{features-fd69b042.js → features-f712643c.js} +1 -1
  27. package/esm/generic-4f8afe2b.js +1 -0
  28. package/esm/{index-5e87744f.js → index-161a811d.js} +1 -1
  29. package/esm/{index-711110d3.js → index-af58f70a.js} +1 -1
  30. package/esm/index.js +1 -1
  31. package/esm/{multicamv2-6f0431cd.js → multicamv2-869a5726.js} +1 -1
  32. package/esm/{multicamv2-bb0f9f89.js → multicamv2-96963022.js} +1 -1
  33. package/esm/{nextEpisodeButton-5e5558ad.js → nextEpisodeButton-9210285a.js} +1 -1
  34. package/esm/{playlist-79eae2ee.js → playlist-da6ce3dc.js} +1 -1
  35. package/esm/{series-e06315cf.js → series-3ae4f6ce.js} +1 -1
  36. package/esm/{series-v2-ec76f997.js → series-v2-ad7fe4a6.js} +1 -1
  37. package/esm/{series-v2-b19edf3e.js → series-v2-df020c65.js} +1 -1
  38. package/esm/{skin-37776131.js → skin-2b49fba4.js} +1 -1
  39. package/esm/{skin-e48c05ff.js → skin-3a97d995.js} +1 -1
  40. package/esm/{skin-8fcd821a.js → skin-6249480f.js} +1 -1
  41. package/esm/skin-8c788fb7.js +1 -0
  42. package/esm/{skin-a82311ef.js → skin-bf5c96ab.js} +1 -1
  43. package/esm/{skin-0d813434.js → skin-c7165ced.js} +1 -1
  44. package/esm/{skin-2ce48287.js → skin-e1d10989.js} +1 -1
  45. package/esm/{videoSelector-c032a200.js → videoSelector-087d9cec.js} +1 -1
  46. package/esm/{videoSelector-2c7b42b1.js → videoSelector-4f3e9e96.js} +1 -1
  47. package/package.json +1 -1
  48. package/cjs/generic-6079db75.js +0 -1
  49. package/cjs/skin-1a4a4e94.js +0 -1
  50. package/esm/generic-bfb2240d.js +0 -1
  51. package/esm/skin-eb52313f.js +0 -1
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import r from"axios";import{g as i}from"./player_instance-34118a5b.js";import a from"js-cookie";import{a as l,e as u,g as s,h as d,s as c,i as v,d as m}from"./currentVideoInfo-0b234e55.js";import{a as p,r as f}from"./captions-78bd2908.js";import{t as g,c as I}from"./skin-1d47c799.js";import E from"@babel/runtime/helpers/toConsumableArray";import h from"@babel/runtime/helpers/slicedToArray";function y(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function T(e){window.dataLayer=window.dataLayer||[],y("js",new Date),y("config",e)}function w(e,n){y("event",e,n)}var b={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function _(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 S(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?_(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):_(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var O={name:"@viewlift/player",version:"2.0.61",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=O.version;var L,A=function(e,n){var t,o,i,a,l,u,s,d;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):r({url:null!==(l=window)&&void 0!==l&&null!==(u=l.customData)&&void 0!==u&&u.overrideEntitlementBaseUrl?(null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d?void 0:d.overrideEntitlementBaseUrl)+"/video/status":F.get()+"".concat(null==b?void 0:b.getVideoDetails),params:S({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(i=window)||void 0===i||null===(a=i.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":O.version,"x-player-name":"videojs"},withCredentials:!0})},P=function(e,n){var t,o,i,a;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):r({url:F.get()+b.getLinearChannelDetails,params:S(S(S(S(S({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(i=window)||void 0===i||null===(a=i.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},D=function(e,n){var t,o,i=H(n),a=(null==i?void 0:i.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})}):r({url:F.get()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:n}})},R=function(){var e=n(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return o=e.sent,e.abrupt("return",r({url:F.get()+"".concat(null==b?void 0:b.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:S({},n),params:S({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),C=function(e,n){var t,o,i=window.contentType;return r({method:"GET",url:F.get()+"".concat(null==b?void 0:b.getVideoInfoV2,"/").concat(i,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},V=function(e){var n=e.videoId;return r({method:"GET",url:F.get()+"".concat(null==b?void 0:b.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},F=(L=null==b?void 0:b.apiBaseUrl,{set:function(e){e&&(L=e)},get:function(){return L}}),k=function(e,n,t,o){return r({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n},withCredentials:!0})},W=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},j=null;function N(){return{set:function(e){e&&(j=e)},get:function(){return j}}}var U=function(){var e=n(t.mark(function e(){var n,o,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=N().get(),o=F.get(),e.prev=2,e.next=5,r({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return i=e.sent,e.abrupt("return",i);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return e.apply(this,arguments)}}(),B=null,M=function(){var e=n(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!W(n)){e.next=6;break}return B||(B=U().then(function(e){var t,o,r=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,i=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return r&&sessionStorage.setItem("vlp_token",r),i&&N().set(i),r||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){B=null})),e.abrupt("return",B);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),x=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,o=null==e?void 0:e.asat;return t&&!o&&(n=!1),n},H=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))};function G(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 Y(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?G(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):G(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Q=function(){var e,n,t,o,r,i,a,u=l();return"linearchannel"===((null==u?void 0:u.contentType)||"video")?null==u||null===(e=u.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find(function(e){return(null==e?void 0:e.id)===(null==u?void 0:u.channelId)}))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==u||null===(r=u.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.id)||(null==u||null===(a=u.video)||void 0===a?void 0:a.id)||(null==u?void 0:u.id)};function z(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return"".concat(e()).concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}function q(){var e=window.sessionStorage.getItem("uid");return e||(e=z(),window.sessionStorage.setItem("uid",e),e)}function K(){return X.apply(this,arguments)}function X(){return(X=n(t.mark(function e(){var n,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:if(!(n=e.sent)){e.next=6;break}return o=JSON.parse(atob(n.split(".")[1])),e.abrupt("return",null!=o&&o.anonymousId?"guest-user":null==o?void 0:o.userId);case 6:return e.abrupt("return","guest-user");case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function J(e){return e?String(e):""}var $=function(e){return function(){try{return e.apply(void 0,arguments)}catch(e){return console.error(e),null}}};function Z(e,o){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname&&function(e,o){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=z(),u="WEBSITE",s=null,d=0,c=null,v=0,m=0,p=!1,f=[],g=i(e);if(g){var I,E,h,y,T=$(function(){for(var e=g.currentTime(),n=g.buffered(),t=0;t<n.length;t++){var o=n.start(t),r=n.end(t);if(e>=o&&e<=r)return Math.round(r-e)}return 0}),_=function(){var e=n(t.mark(function e(n){var o,i,s,d,c,v,m,p,f,g,I;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return f=e.sent,g=H(f),e.t0=Y,e.t1=Y,e.t2=null==g?void 0:g.site,e.t3=null==g?void 0:g.siteId,e.t4=u,e.t5=q(),e.t6=Q(),e.t7=n.url||document.location.href,e.t8=n.ref||document.referrer,e.t9=n.eventName,e.t10=null!==(o=n.videoPosition)&&void 0!==o?o:null,e.t11="production",e.t12=n.dp1||"",e.t13=n.dp2||"",e.t14=n.dp3||"",e.t15=n.dp4||"",e.t16=n.dp5||"",e.t17=n.isAdEvent?n.videoPosition:null,e.t18=n.isAdEvent?J(n.adPosition):"",e.next=25,K();case 25:e.t19=e.sent,e.t20=n.playerType||"videojs",e.t21=n.mediaType||"VIDEO",e.t22=l,e.t23=null!==(i=n.ttFirstFrame)&&void 0!==i?i:null,e.t24=null!==(s=n.bitrate)&&void 0!==s?s:null,e.t25=null!==(d=n.resHeight)&&void 0!==d?d:null,e.t26=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t27=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t28={aid:e.t2,cid:e.t3,pfm:e.t4,uid:e.t5,vid:e.t6,url:e.t7,ref:e.t8,pa:e.t9,vpos:e.t10,environment:e.t11,dp1:e.t12,dp2:e.t13,dp3:e.t14,dp4:e.t15,dp5:e.t16,apos:e.t17,apod:e.t18,profid:e.t19,player:e.t20,media_type:e.t21,stream_id:e.t22,embedurl:"",ttfirstframe:e.t23,bitrate:e.t24,connectionspeed:null,resolutionheight:e.t25,resolutionwidth:e.t26,bufferhealth:e.t27},e.t29=(null==n?void 0:n.duration)&&{duration:n.duration},e.t30=(0,e.t1)(e.t28,e.t29),e.t31=null==a||null===(m=a.beacon)||void 0===m?void 0:m.params,e.t32=(0,e.t0)(e.t30,e.t31),I=[e.t32],r({url:(null==a||null===(p=a.beacon)||void 0===p?void 0:p.url)||F.get()+b.getBeaconUrl,method:"post",headers:{Authorization:f},contentType:"application/x-www-form-urlencoded",dataType:"text",data:I}).catch(function(e){return console.error(e)});case 41:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),S=function(e){if(!g.paused()&&g.readyState()>2)return clearInterval(s),clearInterval(c),e;var n,t=e+.1;return+t.toFixed(2)>=5&&m<4&&p?(m++,w("BUFFERING",Y({pfm:u,uid:q(),vid:Q(),videoPosition:Math.floor(g.currentTime)},null==a||null===(n=a.beacon)||void 0===n?void 0:n.params)),_({eventName:"BUFFERING",videoPosition:Math.floor(g.currentTime),isAdEvent:!1}),0):t};I=Math.floor(g.currentTime),g.on("error",function(){var e,n=Math.floor(g.currentTime);clearInterval(s);var t=I===n?"FAILED_TO_START":"DROPPED_STREAM";w(t,Y({pfm:u,uid:q(),vid:Q(),videoPosition:n},null==a||null===(e=a.beacon)||void 0===e?void 0:e.params)),_({eventName:t,videoPosition:n,isAdEvent:!1})}),E=!1,g.on("waiting",$(function(){p&&(E=!0,clearInterval(s),s=setInterval(function(){E&&!g.paused()?v=S(v):clearInterval(s)},100))})),g.on("playing",$(function(){E=!1,clearInterval(s)})),h=function(e){var n,t,o,r=Y({videoPosition:Math.floor(g.currentTime),isAdEvent:!0,bufferHealth:T(),pfm:u,uid:q(),vid:Q(),resHeight:(null===(n=videoElement)||void 0===n?void 0:n.videoHeight)||null,resWidth:(null===(t=videoElement)||void 0===t?void 0:t.videoWidth)||null},null==a||null===(o=a.beacon)||void 0===o?void 0:o.params);w(e,Y({},r)),_(Y({eventName:e,adPosition:1},r))},g.on("adstart",function(){h("AD_REQUEST"),h("AD_IMPRESSION")}),g.on("adskip",function(){d=0}),g.on("adend",function(){d=0}),g.on("timeupdate",function(){var e,n,t,o,r=Math.floor(g.currentTime());if(r>=30&&r%30==0&&!f.includes(r)){var i,a=null===(i=g.el().getElementsByTagName("video"))||void 0===i?void 0:i[0];m=0,f.push(r),_({eventName:"PING",videoPosition:r,isAdEvent:!1,duration:30,resHeight:(null==a?void 0:a.videoHeight)||null,resWidth:(null==a?void 0:a.videoWidth)||null,bufferHealth:T(),bitrate:Math.round((null==g||null===(e=g.tech_)||void 0===e||null===(n=e.vhs)||void 0===n||null===(t=n.selectPlaylist())||void 0===t||null===(o=t.attributes)||void 0===o?void 0:o.BANDWIDTH)/1e3)})}}),y=$(function(){var e;d=0,c=setInterval(function(){d=S(d)},100),w("PLAY",Y({pfm:u,uid:q(),vid:Q(),videoPosition:Math.floor(g.currentTime)},null==a||null===(e=a.beacon)||void 0===e?void 0:e.params)),_({eventName:"PLAY",videoPosition:Math.floor(g.currentTime),isAdEvent:!1}),o&&o("started_video_playback",{"Video ID":Q(),watchTime:Math.floor(g.currentTime)})}),g.one("play",y),g.on("loadeddata",function(){g.one("timeupdate",function(){var e;clearInterval(c),clearInterval(s),v=d||0,w("FIRST_FRAME",Y({pfm:u,uid:q(),vid:Q(),videoPosition:Math.floor(g.currentTime),ttFirstFrame:d,bufferHealth:T()},null==a||null===(e=a.beacon)||void 0===e?void 0:e.params)),_({eventName:"FIRST_FRAME",videoPosition:Math.floor(g.currentTime),isAdEvent:!1,ttFirstFrame:d,bufferHealth:T()}),p=!0,d=0})})}else console.error("Videojs: Player instance not found.")}(e,o,a)}var ee=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},ne=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},te=function(e,n){var t=new Map;V({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),d(t)}).catch(function(e){return console.log(e)})},oe=function(){var e=u.get();return e>=0?e+1:1},re=function(){var e,n,t,o=s(),r=l(),i=null==r||null===(e=r.video)||void 0===e?void 0:e.id,a=u.get(),d=null==o||null===(n=o[a])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===i});return d>=0?d+1:1};function ie(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function ae(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ie(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var le=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},ue=function(e){var n=se(e,"video.tags",[]),t=se(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},se=function(e,n,t){for(var o=0,r=(n=n.split(".")).length;o<r;o++){var i;e=null===(i=e)||void 0===i?void 0:i[n[o]]}return e||t},de=function(){var n,t,o,r,l,u,s,d,c,v,m,p,f,g,I,E,h,y,T,w,b,_,S,O,L=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",A=arguments.length>1?arguments[1]:void 0,P=arguments.length>2?arguments[2]:void 0;if(null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.disableMacros)return L;var D=(null==P?void 0:P.siteName)||"",R=(null==P?void 0:P.contentType)||"video",C=(null==P||null===(o=P[R])||void 0===o?void 0:o.metadata)||(null==P||null===(r=P[R])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.metadata),V=i(A);if(!L.includes("VIEWLIFT_"))return L;var F,k=window.getComputedStyle(document.getElementById(A),null),W=Math.trunc(k.getPropertyValue("height").slice(0,-2)),j=Math.trunc(k.getPropertyValue("width").slice(0,-2)),N="linearchannel"===R?null==P||null===(u=P.linearchannel)||void 0===u||null===(s=u.channels)||void 0===s||null===(d=s.find(function(e){return(null==e?void 0:e.id)===(null==P?void 0:P.channelId)}))||void 0===d||null===(c=d.content)||void 0===c?void 0:c.id:se(P,"video.gist.id",""),U="linearchannel"===R?null==P||null===(v=P.linearchannel)||void 0===v||null===(m=v.channels)||void 0===m||null===(p=m.find(function(e){return(null==e?void 0:e.id)===(null==P?void 0:P.channelId)}))||void 0===p?void 0:p.title:se(P,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),B=null,M=null;"function"==typeof window.__gpp&&(null===(F=window)||void 0===F||F.__gpp("ping",function(e){B=null==e?void 0:e.gppString,M=null==e?void 0:e.sectionList[0]}));var x=ae(ae({},ce(C)),{},(_={VIEWLIFT_WIDTH:j,VIEWLIFT_HEIGHT:W,VIEWLIFT_SIZE:le(j,W),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(f=window)||void 0===f?void 0:f.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:se(P,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:se(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:se(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==V||null===(g=V.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==V||null===(I=V.options_)||void 0===I?void 0:I.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D||"usanetwork"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ue(P),VIEWLIFT_MEDIA_ID:N,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(se(P,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:N,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+se(P,"video.gist.permalink","")),VIEWLIFT_CONSENT:a.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:se(null===(E=window)||void 0===E||null===(h=E.app_data)||void 0===h||null===(y=h.site)||void 0===y?void 0:y.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_GDPR:"spinco"==D||"usanetwork"==D?"":se(null===(T=window)||void 0===T||null===(w=T.app_data)||void 0===w||null===(b=w.site)||void 0===b?void 0:b.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*se(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:se(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:N,VIEWLIFT_CONTENT_TITLE:U,VIEWLIFT_CONTENT_SERIES_TITLE:se(P,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:se(P,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:re(),VIEWLIFT_SEASON_NUMBER:oe(),VIEWLIFT_CONTENT_TAGS:ue(P),VIEWLIFT_GPP_SID:M||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:B||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(_,"VIEWLIFT_LAT",""),e(_,"VIEWLIFT_APP_BUNDLE",""),e(_,"VIEWLIFT_ATT_CONSENT",""),_),null===(S=window)||void 0===S||null===(O=S.customData)||void 0===O?void 0:O.macros);for(var H in x){var G=new RegExp(H,"g");L=L.replace(G,x[H])}return L},ce=function(e){var n,t,o,r,i,a,l={},u=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){u.set(e.name,e.value)}));var s=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,d=(null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(a=i.subscription)||void 0===a?void 0:a.TVE)||!1;return s||d?(ne()?s?l=ae(ae({},l),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||""}):d&&(l=ae(ae({},l),{},{VIEWLIFT_CSID:u.get("csid.mweb.tve")||""})):s?l=ae(ae({},l),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||""}):d&&(l=ae(ae({},l),{},{VIEWLIFT_CSID:u.get("csid.web.tve")||""})),s?l=ae(ae({},l),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}):d&&(l=ae(ae({},l),{},{VIEWLIFT_SFID:u.get("sfid.tve")||u.get("sfid.web.tve")||""})),l=ne()?ae(ae({},l),{},{VIEWLIFT_PROF:u.get("prof.mweb")||""}):ae(ae({},l),{},{VIEWLIFT_PROF:u.get("prof.web")||""})):(l=ae(ae({},l),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}),l=ne()?ae(ae({},l),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:u.get("prof.mweb")||""}):ae(ae({},l),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||"",VIEWLIFT_PROF:u.get("prof.web")||""})),l=ae(ae({},l),{},{VIEWLIFT_AFID:u.get("afid")})},ve=function(e,n){var t,o,r,i,a,l,u,s,d,c,v,m,p,f=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[f])||void 0===t?void 0:t.drmEnabled,I=null==e||null===(o=e[f])||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.videoAssets,E=null==e||null===(i=e[f])||void 0===i||null===(a=i.streamingInfo)||void 0===a?void 0:a.audioAssets,h=(null==e||null===(l=e[f])||void 0===l||null===(u=l.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(d=e[f])||void 0===d||null===(c=d.liveDetails)||void 0===c||c.isDvrEnabled;var y=(null==e||null===(v=e[f])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(p=m.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return pe(E);if(g){var T=fe(I,n);return T.src=de(T.src,n,e),T}if("Safari"!==ee()&&y)return me(I);if(h){var w=pe(I);return w.src=de(w.src,n,e),w}if(null!=I&&I.mpeg){var b=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(I);return b.src=de(b.src,n,e),b}return null},me=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},pe=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},fe=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,r=e.fairPlayCmaf||e.fairPlay,a=e.widevine,l=e.playReady,u=ee();if(i(n),"Safari"===u){var s=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var r={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(r,function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,r,i){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:r,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(a,function(e,n,t){console.log(e),e&&i(e),i(null,t)})}}}}}(r);return ge(n),s}var d,c={src:a.url,type:"application/dash+xml"};return"caliente"==(null===(d=window)||void 0===d?void 0:d.siteName)?(ge(n),c.keySystems={"com.widevine.alpha":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==l?void 0:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==l?void 0:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==l?void 0:l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var ge=function(e){var n=i(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==ee()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Ie=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var r=t.split(".com")[1]||"";return{src:r?"".concat(n).concat(r):t,type:o}},Ee=function(e,n){if(import("./error-2395864b.js").then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e);if(o){var r=document.createElement("div");r.className="error-container";var i=document.createElement("div");i.className="error-message",i.innerHTML="".concat(n),r.appendChild(i),o.append(r)}}},he=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var ye=!1,Te=function(e,n,t){var o=de(n,e,t),r=i(e);if(n&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,o,r,a=i(e);if(null!==a.el_){ye=!0;var l={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};a.ima.initializeAdDisplayContainer&&a.ima.initializeAdDisplayContainer(),ye&&null!==a.el_&&("function"==typeof a.ima?a.ima(l):setTimeout(function(){a.ima.setContentWithAdTag(null,n,!0),a.ima.requestAds()},1e3));var u=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&u.hasAttribute("controls")&&u.removeAttribute("controls");var s="click",d=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(d=!0,s="touchend"),a.one(s,function(){d&&a.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(r=o.ads)||void 0===r?void 0:r.adEventHandler)||null;a.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),a.one("ads-manager",function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})}),n.addEventListener(google.ima.AdEvent.Type.LOADED,function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})})}),a.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,o)}};function we(e,n){var t,o,r,a=i(e),l=null==a||null===(t=a.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,u=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(t){var o,r,i,s,d,c,v,m,p;if(_e.enabled&&"input"!=t.target.localName){var f=t.key,g=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(f)&&(t.preventDefault(),null==u||u.focus()),f){case" ":null==l||l.click();break;case"m":case"M":a.muted(!a.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":g&&!1===n.liveui||Ze(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(s=i.appcmsMain)||void 0===s||null===(d=s.adsConfig)||void 0===d?void 0:d.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(m=v.appcmsMain)&&void 0!==m&&null!==(p=m.adsConfig)&&void 0!==p&&p.vodAdClientSideTracking)return;g||$e(e,10)}}},!0)}var be,_e=(be=!0,{enable:function(){be=!0},disable:function(){be=!1},get enabled(){return be}}),Se="ssai-breakStart",Oe="ssai-adImpression",Le="ssai-firstQuartile",Ae="ssai-midpoint",Pe="ssai-thirdQuartile",De="ssai-complete",Re="ssai-breakEnd",Ce={breakStart:Se,impression:Oe,firstQuartile:Le,midpoint:Ae,thirdQuartile:Pe,complete:De,breakEnd:Re};function Ve(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=i(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,r=Ce[o];r&&t.trigger(r,n)}function Fe(e){var n=i(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var o=function(e,n){return t(n)};return n.on(e,o),function(){return n.off(e,o)}};return{adBreakStart:function(e){return t(Se,e)},adImpression:function(e){return t(Oe,e)},adFirstQuartile:function(e){return t(Le,e)},adMidpoint:function(e){return t(Ae,e)},adThirdQuartile:function(e){return t(Pe,e)},adComplete:function(e){return t(De,e)},adBreakEnd:function(e){return t(Re,e)}}}function ke(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 We(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ke(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ke(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function je(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 Ne(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)?Ne(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,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}function Ne(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var Ue,Be=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),Me=(Ue=null,{set:function(e){Ue=e},get position(){return Ue}});function xe(e,n){return He.apply(this,arguments)}function He(){return(He=n(t.mark(function e(n,o){var r,a,l,u,s,d,c,v,m,p,f,g,I,E,y,T,w;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i(n),l=ve(o,n),u=l.src,s=(null==o||null===(r=o.video)||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,d=u.replace("/dash/","/session/").replace("/master/","/session/"),d=de(d,n,o),c=Ge(d),v=h(c,2),m=v[0],p=v[1],d=new URL(d.split("?")[0]),Object.keys(p).length>0&&Object.entries(p).forEach(function(e){var n=h(e,2),t=n[0],o=n[1];d.searchParams.set(t,o)}),e.prev=9,e.next=12,fetch(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(We({adsParams:We({},m)},s&&{availSuppression:{mode:"BEHIND_LIVE_EDGE",value:"00:00:00"}}))});case 12:return f=e.sent,e.next=15,f.json();case 15:return g=e.sent,I="https://"+new URL(d).hostname,E=g.trackingUrl,y=g.manifestUrl,T=I+E,w=I+y,Be.set(T),console.log("%c TRACKING URL","background: #bdf369; color: #000",T),l.src=w,e.abrupt("return",l);case 27:return e.prev=27,e.t0=e.catch(9),e.abrupt("return",l);case 30:case"end":return e.stop()}},e,null,[[9,27]])}))).apply(this,arguments)}function Ge(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),r=je((null==o?void 0:o.searchParams)||[]);try{for(r.s();!(t=r.n()).done;){var i=h(t.value,2),a=i[0],l=i[1];n[decodeURIComponent(a)]=decodeURIComponent(l||"")}}catch(e){r.e(e)}finally{r.f()}for(var u={},s={},d=0,c=Object.entries(n);d<c.length;d++){var v=h(c[d],2),m=v[0],p=v[1];if(m.startsWith("ads."))u[m.replace(/^ads\./,"")]=p;else s[m]=p}return[u,s]}var Ye,Qe=(Ye=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),Ye=Array.isArray(e)?E(e):Ye},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",Ye),E(Ye)}});function ze(e,n){return qe.apply(this,arguments)}function qe(){return qe=n(t.mark(function e(o,r){var a,l,u,s,d,c,v,m,p,f,I,h,y,T,w,b,_,S,O,L,A,P,D;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:D=function(e,n,t,r,a,l){var u=i(o);if(!u.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(u.currentTime());var s,d=je(t);try{var c=function(){var t,i,d,c=s.value,v=c.eventType,m=c.beaconUrls,p=c.startTimeInSeconds,f=c.startTime,g=c.durationInSeconds,I=p||0,E=m,h=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(d=i.ads)||void 0===d?void 0:d.adEventHandler)||null,y="".concat(I,"_").concat(v),T=A.get("pod-".concat(a))||[];if(console.warn(e,I,"map:",v,"condition1:",e>=I,"map:",A),e>=I&&!T.includes(y)){T.push(y),A.set("pod-".concat(a),T);try{P(v,n,E,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,v,n)}if("breakEnd"==v){var w=Me.position;Me.set(null),setTimeout(function(){null!=w&&(u.currentTime(w),l())},500)}if("function"==typeof h)try{var b,_={eventType:v,startTimeInSeconds:p,startTime:f,durationInSeconds:g,ad:null==n||null===(b=n.ads)||void 0===b?void 0:b[r],adIndex:r};h({adsData:_}),Ve(o,_)}catch(e){console.error("Error when calling ads callback:",e)}}};for(d.s();!(s=d.n()).done;)c()}catch(e){d.e(e)}finally{d.f()}}},P=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},L=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},Me.set(r),p=Be.get(),(f=i(o)).one("loadeddata",function(){p&&O(p)}),I=new Map,h=new Map,y=-1,T=(null===(a=document)||void 0===a||null===(l=a.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,w=(null==f||null===(u=f.controlBar)||void 0===u?void 0:u.getChild("videoSelector"))||null,b=(null==f||null===(s=f.controlBar)||void 0===s?void 0:s.getChild("seriesV2"))||null,_=(null==f||null===(d=f.el())||void 0===d||null===(c=d.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,S=(null==f||null===(v=f.el())||void 0===v||null===(m=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===m?void 0:m[0])||null,O=function(){var e=n(t.mark(function e(n){var a,l,u,s,d,c,v,m,p,f,O,A,P,R,C,V,F,k,W,j;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return V=function(e){document.removeEventListener("pointermove",C),document.removeEventListener("pointerup",V),0===e.button&&P()},C=function(e){},R=function(){var e,n=f.currentTime(),t=null,o=je(p);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,a=r.durationInSeconds,l=(r.ads,Math.floor(i+a));n>=i&&n<=l&&(t=l,I.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){f.currentTime(t+2.2)},100))},P=function(){var e,n=f.currentTime(),t=null,o=je(p);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,a=r.durationInSeconds,l=r.ads,u=Math.floor(i+a);(Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n>u||n>i)&&!I.has(i)||n>=i&&n<=u)&&(t=i,I.set(i,!0),h.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){f.currentTime(t+.4)},100))},d=!1,e.next=7,fetch(n);case 7:return c=e.sent,e.next=10,c.json();case 10:v=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",v),m=v.avails,p=[],f=i(o),O=f.controlBar.progressControl,A=O.seekBar.el(),null===(a=document)||void 0===a||a.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),m.map(function(e,n){var t,o,r;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(d=!0),p.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(o=e.adBreakTrackingEvents)||void 0===o||null===(r=o.filter(function(e){return"breakStart"==(null==e?void 0:e.eventType)}))||void 0===r?void 0:r[0])||[]})}),!d&&r&&(f.currentTime(r),R()),null!=p&&p.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",p),window.adsQueueList=p),console.log(p,"data"),p.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=f.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",A.appendChild(i)}}),f._timeUpdateHandler&&f.off("timeupdate",f._timeUpdateHandler),f._timeUpdateHandler=g(function(){var e=f.currentTime();if(e!==y){y=e;for(var n=!1,t=function(){var t=p[o],r=t.startTimeInSeconds,i=t.durationInSeconds,a=t.ads,l=r+i;if(e>=r-1.2&&e<=l+1.2){e>=r&&e<=l&&Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n=!0),e>l&&I.set(r,!0),_e.disable(),T&&T.classList.add("vjs-hidden"),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),w&&(w.el().style.pointerEvents="none",w.el().classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),O.el().classList.add("hide-progress-bar");for(var u=e-r,s=0,d=0,c=0;c<a.length;c++){var v,m=null==a||null===(v=a[c])||void 0===v?void 0:v.durationInSeconds;if(u<s+m){d=c;break}s+=m}a[d];var f=Math.max(0,i-u),g=Math.round(f);F.style.display="block",j.textContent="".concat(d+1," of ").concat(a.length," • ").concat(L(g));var y=[];return null==a||a.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});y.push.apply(y,E(n))}),Array.isArray(a)&&0==(null==a?void 0:a.length)&&y.push(null==t?void 0:t.podSlotImpressionBeacon),D(e,t,y,d,o,R),"break"}h.delete(r)},o=0;o<p.length;o++){if("break"===t())break}n||(F.style.display="none",O.el().classList.remove("hide-progress-bar"),w&&(w.el().style.pointerEvents="auto",w.el().classList.remove("vjs-hidden")),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),_e.enable())}},1e3),f.on("timeupdate",f._timeUpdateHandler),null===(l=document)||void 0===l||l.addEventListener("keydown",function(e){_e.enabled&&"ArrowRight"==e.key&&(P(),$e(o,10),e.stopPropagation())}),O.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",C),document.addEventListener("pointerup",V))}),null===(u=document)||void 0===u||null===(s=u.querySelectorAll(".ssai-ad-container"))||void 0===s||s.forEach(function(e){return null==e?void 0:e.remove()}),(F=document.createElement("div")).className="ssai-ad-container",(k=document.createElement("div")).className="sponsored-adbox",(W=document.createElement("div")).className="sponsored-text",W.textContent="Sponsored Ad",k.append(W),(j=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",F.append(k),F.append(j),f.el().appendChild(F);case 45:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),A=new Map;case 18:case"end":return e.stop()}},e)})),qe.apply(this,arguments)}function Ke(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}var Xe=function(e){o(e).play()},Je=function(e){o(e).pause()},$e=function(e,n){var t=o(e),r=t.currentTime()+n;t.currentTime(r)},Ze=function(e,n){var t=o(e),r=t.currentTime(),i=r<=n?0:r-n;t.currentTime(i)},en=function(e){return!!o.getPlayer("".concat(e))},nn=function(e){return o(e).paused()},tn=function(){var e=n(t.mark(function e(n,o){var r,a,l,u=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>2&&void 0!==u[2]&&u[2],e.next=3,M();case 3:return a=e.sent,l=i(n),e.abrupt("return",new Promise(function(e,t){var i=(null==o?void 0:o.programs)||[];null==o||delete o.programs,P(o,a).then(function(t){var a=null==t?void 0:t.data;window.sid=z(),a.contentType="linearchannel",a.channelId=null==o?void 0:o.channelId;var u=ve(a,n);c(a),m(i),sessionStorage.setItem("program_switched",!0),u&&r?(un(n,u),l.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:a})})):e({status:!0,msg:"Feed authenticated",response:a})}).catch(function(e){t({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),on=function(){var e=n(t.mark(function e(o,r,a){var l,u,d,m,g,I,E;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return m=e.sent,(s()||null)&&v(r),g=0,I=0,E=null,null!==(l=window)&&void 0!==l&&l.watchHistory&&null!==(u=window)&&void 0!==u&&null!==(d=u.watchHistory)&&void 0!==d&&d.enable&&C(r,m).then(function(e){var n,t,o,r,i,a,l;(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(null==e?void 0:e.data)),g=(null==e||null===(i=e.data)||void 0===i?void 0:i.watchedTime)||null,(I=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null)<95)&&(E=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null)}).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))}),e.abrupt("return",new Promise(function(e,a){A(r,m).then(function(){var r=n(t.mark(function n(r){var l,u,s,d,v,m,h,y,T,w,b,_,S,O,L,A,P,D,R,C,V,F,k,W,j,N,U,B,M,x,H,G,Y,Q,z,q,K,X;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(A=null==r?void 0:r.data,P=(null==A?void 0:A.contentType)||"video",D=(null==A||null===(l=A[P])||void 0===l?void 0:l.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(u=window)||void 0===u||null===(s=u.app_data)||void 0===s||null===(d=s.appcmsMain)||void 0===d||null===(v=d.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)||!1,R=(null==A||null===(m=A.video)||void 0===m||null===(h=m.streamingInfo)||void 0===h?void 0:h.isLiveStream)||!1,c(r.data),(C=(null==A||null===(y=A.ads)||void 0===y||null===(T=y.preRoll)||void 0===T||null===(w=T.adTags)||void 0===w||null===(b=w.web)||void 0===b?void 0:b.active)&&(null==A||null===(_=A.ads)||void 0===_||null===(S=_.preRoll)||void 0===S||null===(O=S.adTags)||void 0===O||null===(L=O.web)||void 0===L?void 0:L.url))&&Te(o,C,A),V=ve(A,o),!D){n.next=12;break}return n.next=11,xe(o,A);case 11:V=n.sent;case 12:V?(G=(null==A||null===(F=A.video)||void 0===F||null===(k=F.gist)||void 0===k?void 0:k.videoImageUrl)||(null==A||null===(W=A.video)||void 0===W||null===(j=W.gist)||void 0===j||null===(N=j.imageGist)||void 0===N?void 0:N.r16x9),(Y=i(o)).poster(G),un(o,V),D&&ze(o,E),Y.on("loadstart",function(){R&&e({status:!0,msg:"Video Loaded",response:A})}),Y.on("loadeddata",function(){he(),e({status:!0,msg:"Video Loaded",response:A})}),Y.one("play",function(){g&&!D&&I<95&&setTimeout(function(){Y.currentTime(g)},0)}),Y.one("error",function(){var e;a({status:!1,msg:(null==Y||null===(e=Y.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==A||null===(U=A.video)||void 0===U||null===(B=U.contentDetails)||void 0===B||null===(M=B.closedCaptions)||void 0===M?void 0:M.length)>0||(null==A||null===(x=A.video)||void 0===x||null===(H=x.closedCaptions)||void 0===H?void 0:H.length)>0?(X=(null==A||null===(z=A.video)||void 0===z||null===(q=z.contentDetails)||void 0===q?void 0:q.closedCaptions)||(null==A||null===(K=A.video)||void 0===K?void 0:K.closedCaptions),Q=X.filter(function(e){return"VTT"===e.format}),p(o,Q)):f(o)):(Ee(o,"Incompatible Source, only hls,mp4,drm content is allowed"),a("Incompatible Source, only hls,mp4,drm content is allowed"));case 13:case"end":return n.stop()}},n)}));return function(e){return r.apply(this,arguments)}}()).catch(function(e){sn(e,o,a,r)})}));case 10:case"end":return e.stop()}},e)}));return function(n,t,o){return e.apply(this,arguments)}}(),rn=function(e,n,t){var o=i(e);return o.src(n),new Promise(function(e,n){var r=0;o.one("loadedmetadata",function(){clearTimeout(r),e({status:!0,msg:"video loaded"})}),o.one("loadstart",function(e){r=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},an=function(e){var n=i(e);if(ln(),I(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},ln=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},un=function(e,n){var t=i(e);t&&t.src(n)},sn=function(n,t,o,r){var i,a,l,u,s,d,c=null==n||null===(i=n.response)||void 0===i||null===(a=i.data)||void 0===a?void 0:a.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(u=l.data)||void 0===u?void 0:u.errorMessage)||(null==n?void 0:n.message);en(t)&&Ee(t,(null===(s=window)||void 0===s?void 0:s.customErrors)&&(null===(d=window)||void 0===d?void 0:d.customErrors[c])||"".concat(v)),o&&o(function(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ke(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ke(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}({status:!1,response:n,msg:"".concat(v)},r&&{videoId:r}))},dn=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var r=n.getElementsByClassName("vjs-fullscreen-control")[0];r&&(r.style.display="none")};export{Ze as A,en as B,on as C,tn as D,an as E,k as F,Qe as G,Fe as H,F as I,x as J,N as K,W as L,T as M,we as N,ne as O,nn as P,_e as Q,Be as R,Ve as S,ze as T,V as U,re as a,oe as b,ve as c,ee as d,he as e,dn as f,q as g,Ee as h,Z as i,Te as j,Ie as k,un as l,xe as m,H as n,A as o,C as p,sn as q,M as r,R as s,P as t,D as u,te as v,rn as w,$e as x,Xe as y,Je as z};
@@ -1 +0,0 @@
1
- import{h as e,d as n,e as o,o as l,p as t,q as r,r as i,s as a}from"./features-fd69b042.js";import{g as s}from"./player_instance-34118a5b.js";import{a as d,i as u,b as c}from"./index-5e87744f.js";import{O as v,Q as p,R as m,S as f,c as y,N as h,T as b}from"./generic-bfb2240d.js";import"videojs-contrib-quality-menu";import{i as g,r as w}from"./index-711110d3.js";import{c as j}from"./helper-d52dff3c.js";import{c as k,a as S,b as I}from"./currentVideoInfo-0b234e55.js";import E from"video.js";import T from"@babel/runtime/helpers/toConsumableArray";import C from"@babel/runtime/helpers/asyncToGenerator";import A from"@babel/runtime/regenerator";import"@babel/runtime/helpers/defineProperty";import"js-cookie";import{t as B}from"./skin-1d47c799.js";import"axios";import{c as L,d as _}from"./icons-37daa6b3.js";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-62be852a.js";import"@babel/runtime/helpers/assertThisInitialized";import"./localisation-0bf399a1.js";import"./autoNextVideo-b216988b.js";import"./util-45804492.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/slicedToArray";import"./captions-78bd2908.js";import"video.js/dist/video-js.min.css";function M(n,o){var l=s(n);l&&(l.on("loadeddata",function(){var e,t,r,i,a,c=j(o),p=k();l.qualityLevels()&&l.qualityLevels().length&&function(e){var n=s(e);n&&(null==n||n.qualityMenu,n.qualityMenu({useResolutionLabels:!0}))}(n),!(null!=o&&null!==(e=o.series)&&void 0!==e&&e.enable||null!==(t=window)&&void 0!==t&&null!==(r=t.app_data)&&void 0!==r&&null!==(i=r.appcmsMain)&&void 0!==i&&null!==(a=i.features)&&void 0!==a&&a.auto_play)||null!=o&&o.liveVideo||d(n,o),null!=o&&o.liveVideo||v()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||u(n),c&&p&&p.length?g(n):w()}),l.one("play",function(){var o,l,t,r;null!==(o=window)&&void 0!==o&&null!==(l=o.customData)&&void 0!==l&&l.iframeOverlayUrl&&e(n,null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r?void 0:r.iframeOverlayUrl)}))}function x(e,n){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=function(e,n){if(e){if("string"==typeof e)return O(e,n);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?O(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){o&&(e=o);var l=0,t=function(){};return{s:t,n:function(){return l>=e.length?{done:!0}:{done:!1,value:e[l++]}},e:function(e){throw e},f:t}}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,i=!0,a=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==o.return||o.return()}finally{if(a)throw r}}}}function O(e,n){(null==n||n>e.length)&&(n=e.length);for(var o=0,l=Array(n);o<n;o++)l[o]=e[o];return l}function D(){return D=C(A.mark(function e(n){var o,l,t,r,i,a,d,u,c,v,y,h,b,g,w,j,k,S,I,E,L,_,M,O,D,P;return A.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:P=function(e,o,l,t,r){var i=s(n);if(!i.seeking()){o.startTimeInSeconds,o.durationInSeconds,Math.floor(i.currentTime());var a,d=x(l);try{for(d.s();!(a=d.n()).done;){var u,c,v,p=a.value,m=p.eventType,y=p.beaconUrls,h=p.startTimeInSeconds,b=p.startTime,g=p.durationInSeconds,w=h||0,j=y,k=(null===(u=window)||void 0===u||null===(c=u.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.adEventHandler)||null,S="".concat(w,"_").concat(m),I=O.get("pod-".concat(r))||[];if(console.warn(e,w,"map:",m,"condition1:",e>=w,"map:",O),e>=w&&!I.includes(S)){I.push(S),O.set("pod-".concat(r),I);try{D(m,o,j,i)}catch(e){console.error("Error when calling triggerAdBeacon:",e,m,o)}if("function"==typeof k)try{var E,T={eventType:m,startTimeInSeconds:h,startTime:b,durationInSeconds:g,ad:null==o||null===(E=o.ads)||void 0===E?void 0:E[t],adIndex:t};k({adsData:T}),f(n,T)}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){d.e(e)}finally{d.f()}}},D=function(e,n,o,l){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(l.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(l.currentTime())),"AD_POD:",n),null==o||o.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},h=function(){y&&clearInterval(y)},c=m.get(),v=s(n),y=null,v.one("loadeddata",function(){y=setInterval(function(){c&&!v.paused()&&M(c)},2e3)}),v.on("sourceset",function(e){console.log(e,"sourceset")}),v.on("dispose",function(){h()}),b=new Map,g=new Map,w=-1,j=null,k=(null===(o=document)||void 0===o||null===(l=o.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,S=(null==v||null===(t=v.controlBar)||void 0===t?void 0:t.getChild("videoSelector"))||null,I=(null==v||null===(r=v.controlBar)||void 0===r?void 0:r.getChild("seriesV2"))||null,E=(null==v||null===(i=v.el())||void 0===i||null===(a=i.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===a?void 0:a[0])||null,L=(null==v||null===(d=v.el())||void 0===d||null===(u=d.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===u?void 0:u[0])||null,_=!1,M=function(){var e=C(A.mark(function e(o){var l,t,r,i,a,d,u,c,v,m;return A.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=new URL(o),j&&t.searchParams.append("nextToken",j),e.next=4,fetch(t.toString(),{method:"GET"});case 4:return r=e.sent,e.next=7,r.json();case 7:i=e.sent,a=i.avails,d=i.nextToken||null,j=d,u=[],c=s(n),v=c.controlBar.progressControl,m=v.seekBar.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),a.map(function(e,n){var o,l;u.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(o=e.adBreakTrackingEvents)||void 0===o||null===(l=o.filter(function(e){return"breakStart"==(null==e?void 0:e.eventType)}))||void 0===l?void 0:l[0])||[]})}),console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",u),null!=u&&u.length&&(window.adsQueueList=u),u.forEach(function(e){var n=e.markerPositionInSeconds,o=e.ads,l=c.duration();if(!(n>l||Array.isArray(o)&&0==(null==o?void 0:o.length))){var t=n/l*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(t,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(t,"%"),r.style.pointerEvents="none",m.appendChild(r)}}),c._timeUpdateHandler&&c.off("timeupdate",c._timeUpdateHandler),c._timeUpdateHandler=B(function(){var e=c.currentTime();if(e!==w){w=e;for(var n=function(){var n=u[o],l=n.startTimeInSeconds,t=n.durationInSeconds,r=n.ads,i=l+t;if(e>=l-1.2&&e<=i+1.2){_=!!(e>=l&&e<=i&&Array.isArray(r)&&(null==r?void 0:r.length)>0),e>i&&b.set(l,!0),p.disable(),k&&k.classList.add("vjs-hidden"),E&&(E.style.pointerEvents="none",E.classList.add("vjs-hidden")),L&&(L.style.pointerEvents="none",L.classList.add("vjs-hidden")),S&&(S.el().style.pointerEvents="none",S.el().classList.add("vjs-hidden")),I&&(I.el().style.pointerEvents="none",I.el().classList.add("vjs-hidden")),v.el().classList.add("hide-progress-bar");for(var a=e-l,s=0,d=0,c=0;c<r.length;c++){var m,f=null==r||null===(m=r[c])||void 0===m?void 0:m.durationInSeconds;if(a<s+f){d=c;break}s+=f}var y=[];return null==r||r.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});y.push.apply(y,T(n))}),Array.isArray(r)&&0==(null==r?void 0:r.length)&&y.push(null==n?void 0:n.podSlotImpressionBeacon),P(e,n,y,d,o),"break"}g.delete(l)},o=0;o<u.length;o++){if("break"===n())break}_||(v.el().classList.remove("hide-progress-bar"),S&&(S.el().style.pointerEvents="auto",S.el().classList.remove("vjs-hidden")),I&&(I.el().style.pointerEvents="auto",I.el().classList.remove("vjs-hidden")),k&&k.classList.remove("vjs-hidden"),E&&(E.style.pointerEvents="auto",E.classList.remove("vjs-hidden")),L&&(L.style.pointerEvents="auto",L.classList.remove("vjs-hidden")),p.enable())}},1e3),c.on("timeupdate",c._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),O=new Map;case 23:case"end":return e.stop()}},e)})),D.apply(this,arguments)}function P(e,d){s(e).addClass("skin_vlone"),M(e,d),function(e,s){var d,u,v,p,m,f,g,w,k,E,T,C,A,B,M,x=(null==s?void 0:s.liveVideo)||!1,O=(null==s||null===(d=s.res)||void 0===d||null===(u=d.video)||void 0===u?void 0:u.isSSAIEnabled)||!1,P=y(null==s?void 0:s.res,e)||{};P.src;var V=(null==s?void 0:s.skin_settings)||{};j(s),null!=V&&V.skipBtn&&0==(null==s?void 0:s.liveVideo)&&0==(null==s?void 0:s.liveui)&&n(e,"VL_ONE",L());(null!=V&&V.rewindBtn&&0==(null==s?void 0:s.liveVideo)&&0==(null==s?void 0:s.liveui)||1==(null==s?void 0:s.liveui))&&o(e,"VL_ONE",_());(null==s||null===(v=s.relatedVideos)||void 0===v||null===(p=v.content)||void 0===p?void 0:p.length)>0&&l(e,null==s?void 0:s.relatedVideos);null!=s&&null!==(m=s.series)&&void 0!==m&&m.enable&&t(e,s);(null==s||null===(f=s.streams)||void 0===f?void 0:f.length)>1&&r(e,null==s?void 0:s.streams);if(c(e,s),h(e,s),"MEDIA_TAILOR"==(null===(g=window)||void 0===g||null===(w=g.app_data)||void 0===w||null===(k=w.appcmsMain)||void 0===k||null===(E=k.adsConfig)||void 0===E?void 0:E.vodAdSticherProvider)&&null!==(T=window)&&void 0!==T&&null!==(C=T.app_data)&&void 0!==C&&null!==(A=C.appcmsMain)&&void 0!==A&&null!==(B=A.adsConfig)&&void 0!==B&&B.vodAdClientSideTracking&&O)if(x)!function(e){D.apply(this,arguments)}(e);else{var N,U=null;if(null!=s&&null!==(N=s.series)&&void 0!==N&&N.enable){var q,H,R,Q,F,G=null===(q=S())||void 0===q||null===(H=q.video)||void 0===H||null===(R=H.gist)||void 0===R?void 0:R.id,$=I(),z=(null==$?void 0:$.get(G))||{t:0,p:0},J=z.t,K=z.p;"function"==typeof(null===(Q=window)||void 0===Q||null===(F=Q.watchHistory)||void 0===F?void 0:F.cb)&&window.watchHistory.cb({watchedTime:J}),K<95&&(U=J)}else{var W=s.watchHistoryResumeTime;s.watchedPercentage<95&&(U=W)}b(e,U)}null!=s&&s.isDvrEnabled&&null!=s&&null!==(M=s.dvrConfig)&&void 0!==M&&M.enable&&(i(e,s),a(e,s))}(e,d),V(e,d)}var V=function(e,n){var o,l,t,r,i,a,d,u,c,v,p,m,f=s(e),y=(null==n?void 0:n.theme)||{},h=E.dom.$(".vjs-play-progress"),b=E.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");b&&(b.style.color="".concat(null===(o=window)||void 0===o||null===(l=o.app_data)||void 0===l||null===(t=l.appcmsMain)||void 0===t||null===(r=t.brand)||void 0===r||null===(i=r.cta)||void 0===i||null===(a=i.primary)||void 0===a?void 0:a.backgroundColor)),h&&(h.style.background="".concat(null===(d=window)||void 0===d||null===(u=d.app_data)||void 0===u||null===(c=u.appcmsMain)||void 0===c||null===(v=c.brand)||void 0===v||null===(p=v.cta)||void 0===p||null===(m=p.primary)||void 0===m?void 0:m.backgroundColor));var g=f.getChild("BigPlayButton")||null;(null==y?void 0:y.progressBarColor)&&h&&(h.style.background=y.progressBarColor),(null==y?void 0:y.playButtonBackgroundColor)&&g&&(g.el().style.background=y.playButtonBackgroundColor),(null==y?void 0:y.playButtonColor)&&b&&(b.style.color=y.playButtonColor),(null==y?void 0:y.playButtonType)&&("square"==(null==y?void 0:y.playButtonType)?g.el().style.borderRadius=".3em":g.el().style.borderRadius="1.3em")};export{P as initialiseSkin};