@viewlift/player-backup 2.0.92-smartTv-test8 → 2.0.92-smartTv-test10

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 (89) hide show
  1. package/cjs/{autoNextVideo-c350df7b.js → autoNextVideo-6842bf1e.js} +1 -1
  2. package/cjs/autoNextVideo-e09dd4b5.js +1 -0
  3. package/cjs/bundle.css +4 -4
  4. package/cjs/{features-eb94500c.js → features-164d9559.js} +1 -1
  5. package/cjs/features-194d4a4a.js +1 -0
  6. package/cjs/{generic-0c35f368.js → generic-c19ce514.js} +1 -1
  7. package/cjs/generic-def54bbe.js +1 -0
  8. package/cjs/{index-5fc16e9e.js → index-0c84da35.js} +1 -1
  9. package/cjs/{index-1838c329.js → index-1bc6e4e1.js} +1 -1
  10. package/cjs/index-66c8779a.js +1 -0
  11. package/cjs/index-c7da0bd6.js +1 -0
  12. package/cjs/index.js +1 -1
  13. package/cjs/{multicamv2-0a17293d.js → multicamv2-1ac4ccf1.js} +1 -1
  14. package/cjs/{multicamv2-063ef4b5.js → multicamv2-73c22260.js} +1 -1
  15. package/cjs/multicamv2-936f60ff.js +1 -0
  16. package/cjs/multicamv2-fee75fc1.js +1 -0
  17. package/cjs/{nextEpisodeButton-13952866.js → nextEpisodeButton-05c5a9dc.js} +1 -1
  18. package/cjs/nextEpisodeButton-86065304.js +1 -0
  19. package/cjs/{playlist-8ef107a3.js → playlist-55d7cfe6.js} +1 -1
  20. package/cjs/playlist-64dbfa4a.js +1 -0
  21. package/cjs/{series-24d7cb4e.js → series-1914b8bc.js} +1 -1
  22. package/cjs/series-5b4f0d53.js +1 -0
  23. package/cjs/{series-v2-62db0e36.js → series-v2-0ca89367.js} +1 -1
  24. package/cjs/{series-v2-cef236d8.js → series-v2-2f4f32b3.js} +1 -1
  25. package/cjs/series-v2-d07a7942.js +1 -0
  26. package/cjs/series-v2-d1d7ceff.js +1 -0
  27. package/cjs/{skin-38f1a2fc.js → skin-15d13e48.js} +1 -1
  28. package/cjs/{skin-e12a0fef.js → skin-1d18fba7.js} +1 -1
  29. package/cjs/{skin-b1633de8.js → skin-4d8917b6.js} +1 -1
  30. package/cjs/skin-53a84878.js +1 -0
  31. package/cjs/{skin-12bc785c.js → skin-634c2100.js} +1 -1
  32. package/cjs/skin-70c07a7e.js +1 -0
  33. package/cjs/skin-aba2ebf4.js +1 -0
  34. package/cjs/skin-b9d750c7.js +1 -0
  35. package/cjs/{skin-d9e4f8fc.js → skin-d29ebe60.js} +1 -1
  36. package/cjs/{skin-a1ee643b.js → skin-e203c087.js} +1 -1
  37. package/cjs/skin-f370223b.js +1 -0
  38. package/cjs/{skin-e067a109.js → skin-f4d42976.js} +1 -1
  39. package/cjs/skin-f694c50c.js +1 -0
  40. package/cjs/skin-fdb52765.js +1 -0
  41. package/cjs/{videoSelector-65192a98.js → videoSelector-7b96e887.js} +1 -1
  42. package/cjs/videoSelector-9da40745.js +1 -0
  43. package/cjs/{videoSelector-7f301deb.js → videoSelector-f7367197.js} +1 -1
  44. package/cjs/videoSelector-f80fd578.js +1 -0
  45. package/esm/{autoNextVideo-89bf12ac.js → autoNextVideo-57e39c2b.js} +1 -1
  46. package/esm/autoNextVideo-eb7653f5.js +1 -0
  47. package/esm/bundle.css +4 -4
  48. package/esm/{features-7ebeedef.js → features-0fa41453.js} +1 -1
  49. package/esm/features-bee4be78.js +1 -0
  50. package/esm/{generic-c2920429.js → generic-8c232113.js} +1 -1
  51. package/esm/generic-d036e0c3.js +1 -0
  52. package/esm/{index-28856e72.js → index-2c81a570.js} +1 -1
  53. package/esm/{index-041e7de7.js → index-397c761f.js} +1 -1
  54. package/esm/index-9204c12e.js +1 -0
  55. package/esm/index-e8a8d6bc.js +1 -0
  56. package/esm/index.js +1 -1
  57. package/esm/{multicamv2-401586c5.js → multicamv2-19227feb.js} +1 -1
  58. package/esm/multicamv2-243a2d0d.js +1 -0
  59. package/esm/{multicamv2-6c33d338.js → multicamv2-5011595d.js} +1 -1
  60. package/esm/multicamv2-82f420e3.js +1 -0
  61. package/esm/{nextEpisodeButton-2fef2e20.js → nextEpisodeButton-0e6e9a99.js} +1 -1
  62. package/esm/nextEpisodeButton-1bfc42cd.js +1 -0
  63. package/esm/{playlist-016d4588.js → playlist-08aae44b.js} +1 -1
  64. package/esm/playlist-d62f0e1d.js +1 -0
  65. package/esm/{series-45a2c046.js → series-3890c03d.js} +1 -1
  66. package/esm/series-38d43d02.js +1 -0
  67. package/esm/{series-v2-e5e65d24.js → series-v2-48a526b1.js} +1 -1
  68. package/esm/series-v2-575f3828.js +1 -0
  69. package/esm/{series-v2-832edccb.js → series-v2-5e24f55e.js} +1 -1
  70. package/esm/series-v2-ad505b62.js +1 -0
  71. package/esm/{skin-c4585908.js → skin-0d8cbec3.js} +1 -1
  72. package/esm/{skin-dbfebb49.js → skin-101250f3.js} +1 -1
  73. package/esm/{skin-67ccd73a.js → skin-1bf9ceff.js} +1 -1
  74. package/esm/{skin-c4fe4f21.js → skin-52a2c45b.js} +1 -1
  75. package/esm/{skin-aed7b0ac.js → skin-8285699e.js} +1 -1
  76. package/esm/skin-91ea9846.js +1 -0
  77. package/esm/{skin-b720eeaf.js → skin-b11f07c9.js} +1 -1
  78. package/esm/skin-d0b8a20f.js +1 -0
  79. package/esm/skin-dedcfa56.js +1 -0
  80. package/esm/{skin-af71c222.js → skin-e0d75fb2.js} +1 -1
  81. package/esm/skin-e4470dd0.js +1 -0
  82. package/esm/skin-ebe075ff.js +1 -0
  83. package/esm/skin-ecc6caf9.js +1 -0
  84. package/esm/skin-fd8ab03a.js +1 -0
  85. package/esm/{videoSelector-f235608d.js → videoSelector-135b3f39.js} +1 -1
  86. package/esm/{videoSelector-67bbbd4e.js → videoSelector-408efa97.js} +1 -1
  87. package/esm/videoSelector-7dfef6f4.js +1 -0
  88. package/esm/videoSelector-9f4b211e.js +1 -0
  89. package/package.json +1 -1
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import i from"video.js";import o from"axios";import{g as r,c as l}from"./skin-86e7e2b5.js";import{i as a,d}from"./browser-512cd55a.js";import u from"js-cookie";import{UAParser as s}from"ua-parser-js";import{a as c,r as v}from"./captions-0280b028.js";function m(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function f(e){window.dataLayer=window.dataLayer||[],m("js",new Date),m("config",e)}function p(e,n){m("event",e,n)}var w={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 I(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function g(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?I(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):I(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var E={name:"@viewlift/player-backup",version:"2.0.92-smartTv-test8",main:"dist/bundle.cjs.js",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",install:"^0.13.0","js-cookie":"^3.0.5",npm:"^11.5.2","ua-parser-js":"^2.0.3","video.js":"^7.3.26","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-contrib-quality-menu":"^1.0.3","videojs-mux":"^4.21.7"}};window.vl_player_version=E.version;var T,h=function(e,n){var t,i,r,l,a,d,u,s;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):o({url:null!==(a=window)&&void 0!==a&&null!==(d=a.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(u=window)||void 0===u||null===(s=u.customData)||void 0===s?void 0:s.overrideEntitlementBaseUrl)+"/video/status":O.get()+"".concat(null==w?void 0:w.getVideoDetails),params:g({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":E.version},withCredentials:!0})},y=function(e,n){var t,i,r,l;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):o({url:O.get()+w.getLinearChannelDetails,params:g(g(g(g(g({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===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},_=function(e,n){var t,i,r=k(n),l=(null==r?void 0:r.site)||null;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.seriesData?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.seriesData})}):o({url:O.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},b=function(){var e=n(t.mark(function e(n){var i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return i=e.sent,e.abrupt("return",o({url:O.get()+"".concat(null==w?void 0:w.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:g({},n),params:g({},(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)}}(),F=function(e,n){var t,i,r=window.contentType;return o({method:"GET",url:O.get()+"".concat(null==w?void 0:w.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(i=t.watchHistory)||void 0===i?void 0:i.xApiKey},timeout:15e3})},D=function(e){var n=e.videoId;return o({method:"GET",url:O.get()+"".concat(null==w?void 0:w.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},O=(T=null==w?void 0:w.apiBaseUrl,{set:function(e){e&&(T=e)},get:function(){return T}}),L=function(e,n,t,i){return o({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==i?void 0:i.latitude,longitude:null==i?void 0:i.longitude},method:"GET",headers:{Authorization:n},withCredentials:!0})},R=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},S=null;function P(){return{set:function(e){e&&(S=e)},get:function(){return S}}}var V,W,C,A,N,j,B=function(){var e=n(t.mark(function e(){var n,i,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=P().get(),i=O.get(),e.prev=2,e.next=5,o({method:"GET",url:"".concat(i,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return e.apply(this,arguments)}}(),x=null,U=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"))||!R(n)){e.next=6;break}return x||(x=B().then(function(e){var t,i,o=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&P().set(r),o||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){x=null})),e.abrupt("return",x);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),M=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return t&&!i&&(n=!1),n},k=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},H=function(e){W=e},G=function(){return W},z=function(e){V=e},Y=function(){return V},X=function(){return C},q=function(e){C=e},J=function(){return N},K=function(e){A=new Map,e.map(function(e,n){A.set(e.id,n)})},Q=function(e){if(A){var n=A.get(e);q(n+1)}},Z=(j=0,{set:function(e){e>=0&&(j=e)},get:function(){return j}});function $(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function ee(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?$(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):$(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var ne=0,te=function(){var e,n,t,i,o,r,l,a=G();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===t||null===(i=t.content)||void 0===i?void 0:i.id:(null==a||null===(o=a.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function ie(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function oe(){var e=window.sessionStorage.getItem("uid");return e||(e=ie(),window.sessionStorage.setItem("uid",e),e)}function re(){return le.apply(this,arguments)}function le(){return(le=n(t.mark(function e(){var n,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ae(e){return e?String(e):""}window.initialise=function(e){window.sid=ie(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",function(){var t,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,p(r?"FAILED_TO_START":"DROPPED_STREAM",ee({pfm:window.platform,uid:oe(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,n){e.one("play",tryCatch(function(){var t,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),p("PLAY",ee({pfm:window.platform,uid:oe(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",{"Video ID":te(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,n){var t,i;if(n.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(i=t.className)&&void 0!==i&&i.includes("vjs-waiting")&&ne<4)ne++,p("BUFFERING",ee({pfm:window.platform,uid:oe(),vid:te(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var n,t,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,p("FIRST_FRAME",ee({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),vid:te()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var n,t,i,o,r,l;p("AD_REQUEST",ee({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),vid:te(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),p("AD_IMPRESSION",ee({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:te()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var n=[];e.on("timeupdate",function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(ne=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(de(n,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var de=function(e,n,t){return e>=n&&e<=t};function ue(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var t=r(e);window.initialise(t,n),window.firstFrame(t,n),t.on("loadedmetadata",function(){window.endFirstFrame(t)})}}window.fireEvent=function(){var e=n(t.mark(function e(n){var i,r,l,a,d,u,s,c,v,m,f,p,I,g,E,T,h,y,_,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return T=e.sent,h=k(T),y=null==h?void 0:h.site,_=null==h?void 0:h.siteId,e.t0=ee,e.t1=ee,e.t2=ee({aid:y,cid:_,pfm:window.platform},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params),e.t3={},e.t4=oe(),e.t5=te(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=null!==(a=n.videoPosition)&&void 0!==a?a:null,e.t10=window.environment,e.t11=n.dp1||"",e.t12=n.dp2||"",e.t13=n.dp3||"",e.t14=n.dp4||"",e.t15=n.dp5||"",e.t16=!0===n.isAdEvent?n.videoPosition:null,e.t17=!0===n.isAdEvent?ae(n.adPosition):"",e.next=26,re();case 26:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t26=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==n?void 0:n.duration)&&{duration:n.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(m=window)||void 0===m||null===(f=m.customData)||void 0===f||null===(p=f.beacon)||void 0===p?void 0:p.params,e.t31=(0,e.t0)(e.t29,e.t30),b=[e.t31],o({url:(null===(I=window)||void 0===I||null===(g=I.customData)||void 0===g||null===(E=g.beacon)||void 0===E?void 0:E.url)||O.get()+w.getBeaconUrl,method:"post",headers:{Authorization:T},contentType:"application/x-www-form-urlencoded",dataType:"text",data:b}).catch(function(e){console.error(e)});case 42:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var se=function(e,n){var t=new Map;D({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),N=t}).catch(function(e){return console.log(e)})},ce=function(){var e=Z.get();return e>=0?e+1:1},ve=function(){var e,n,t,i=Y(),o=G(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,l=Z.get(),a=null==i||null===(n=i[l])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};function me(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function fe(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?me(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):me(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}window._deviceInfo=s(navigator.userAgent);var pe=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},we=function(e){var n=Ie(e,"video.tags",[]),t=Ie(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},Ie=function(e,n,t){for(var i=0,o=(n=n.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[n[i]]}return e||t},ge=function(){var e,n,t,i,o,l,a,d,s,c,v,m,f,p,w,I,g,E,T,h,y,_=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=arguments.length>1?arguments[1]:void 0,F=arguments.length>2?arguments[2]:void 0,D=(null==F?void 0:F.siteName)||"",O=(null==F?void 0:F.contentType)||"video",L=(null==F||null===(e=F[O])||void 0===e?void 0:e.metadata)||(null==F||null===(n=F[O])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.metadata),R=r(b);if(!_.includes("VIEWLIFT_"))return _;var S,P=window.getComputedStyle(document.getElementById(b),null),V=Math.trunc(P.getPropertyValue("height").slice(0,-2)),W=Math.trunc(P.getPropertyValue("width").slice(0,-2)),C="linearchannel"===O?null==F||null===(i=F.linearchannel)||void 0===i||null===(o=i.channels)||void 0===o||null===(l=o.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===l||null===(a=l.content)||void 0===a?void 0:a.id:Ie(F,"video.gist.id",""),A="linearchannel"===O?null==F||null===(d=F.linearchannel)||void 0===d||null===(s=d.channels)||void 0===s||null===(c=s.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===c?void 0:c.title:Ie(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),N=null,j=null;"function"==typeof window.__gpp&&(null===(S=window)||void 0===S||S.__gpp("ping",function(e){N=null==e?void 0:e.gppString,j=null==e?void 0:e.sectionList[0]}));var B=fe(fe({},Ee(L)),{},{VIEWLIFT_WIDTH:W,VIEWLIFT_HEIGHT:V,VIEWLIFT_SIZE:pe(W,V),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(v=window)||void 0===v?void 0:v.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Ie(F,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Ie(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Ie(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==R||null===(m=R.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==R||null===(f=R.options_)||void 0===f?void 0:f.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:we(F),VIEWLIFT_MEDIA_ID:C,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Ie(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:C,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Ie(F,"video.gist.permalink","")),VIEWLIFT_CONSENT:u.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Ie(null===(p=window)||void 0===p||null===(w=p.app_data)||void 0===w||null===(I=w.site)||void 0===I?void 0:I.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==D?"":Ie(null===(g=window)||void 0===g||null===(E=g.app_data)||void 0===E||null===(T=E.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*Ie(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Ie(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:C,VIEWLIFT_CONTENT_TITLE:A,VIEWLIFT_CONTENT_SERIES_TITLE:Ie(F,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Ie(F,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ve(),VIEWLIFT_SEASON_NUMBER:ce(),VIEWLIFT_CONTENT_TAGS:we(F),VIEWLIFT_GPP_SID:j||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:N||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.macros);for(var x in B){var U=new RegExp(x,"g");_=_.replace(U,B[x])}return _},Ee=function(e){var n,t,i,o,r,l,d;if(null!==(n=window)&&void 0!==n&&n.customData.isSmartTV)return Te(e);var u={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){s.set(e.name,e.value)}));var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.subscription)||void 0===o?void 0:o.SVOD)||!1,v=(null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(d=l.subscription)||void 0===d?void 0:d.TVE)||!1;return c||v?(a()?c?u=fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):v&&(u=fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):c?u=fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):v&&(u=fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),c?u=fe(fe({},u),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):v&&(u=fe(fe({},u),{},{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),u=a()?fe(fe({},u),{},{VIEWLIFT_PROF:s.get("prof.mweb")||""}):fe(fe({},u),{},{VIEWLIFT_PROF:s.get("prof.web")||""})):(u=fe(fe({},u),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),u=a()?fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),u=fe(fe({},u),{},{VIEWLIFT_AFID:s.get("afid")})},Te=function(e){var n,t,i,o,r,l,a={},d=new Map;return(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)})),null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.subscription)||void 0===i||i.SVOD,(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1?(a=fe(fe({},a),{},{VIEWLIFT_SFID:d.get("sfid.samsungtv.tve")||d.get("sfid.tve")}),a="lgTv"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.lgtv.tve")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.viziotv.tve")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.xfinity.tve")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.xbox.tve")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.samsungtv.tve")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})):(a=fe(fe({},a),{},{VIEWLIFT_SFID:d.get("sfid.samsungtv.dtc")||d.get("sfid.dtc")}),a="lgTv"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.lgtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.viziotv.dtc")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.xfinity.dtc")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.xbox.dtc")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.samsungtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})),a},he=function(e){var n=null;try{var t,i,o,r,l,a,d,u,s,c,v,m,f,p,w,I,g,E,T,h,y,_,b,F,D,O,L,R,S;if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV){if("samsungTv"==window.customData.device&&null!=e&&null!==(i=e.ads)&&void 0!==i&&null!==(o=i.preRoll)&&void 0!==o&&null!==(r=o.adTags)&&void 0!==r&&null!==(l=r.samsung_tv)&&void 0!==l&&l.active)n=null==e||null===(E=e.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(h=T.adTags)||void 0===h||null===(y=h.samsung_tv)||void 0===y?void 0:y.url;else if("lgTv"==window.customData.device&&null!=e&&null!==(a=e.ads)&&void 0!==a&&null!==(d=a.preRoll)&&void 0!==d&&null!==(u=d.adTags)&&void 0!==u&&null!==(s=u.lg_tv)&&void 0!==s&&s.active){var P,V,W,C;n=null==e||null===(P=e.ads)||void 0===P||null===(V=P.preRoll)||void 0===V||null===(W=V.adTags)||void 0===W||null===(C=W.lg_tv)||void 0===C?void 0:C.url}else if("vizioTv"==window.customData.device&&null!=e&&null!==(c=e.ads)&&void 0!==c&&null!==(v=c.preRoll)&&void 0!==v&&null!==(m=v.adTags)&&void 0!==m&&null!==(f=m.vizioTv)&&void 0!==f&&f.active){var A,N,j,B;n=null==e||null===(A=e.ads)||void 0===A||null===(N=A.preRoll)||void 0===N||null===(j=N.adTags)||void 0===j||null===(B=j.vizioTv)||void 0===B?void 0:B.url}else if("xbox"==window.customData.device&&null!=e&&null!==(p=e.ads)&&void 0!==p&&null!==(w=p.preRoll)&&void 0!==w&&null!==(I=w.adTags)&&void 0!==I&&null!==(g=I.xbox)&&void 0!==g&&g.active){var x,U,M,k;n=null==e||null===(x=e.ads)||void 0===x||null===(U=x.preRoll)||void 0===U||null===(M=U.adTags)||void 0===M||null===(k=M.xbox)||void 0===k?void 0:k.url}}else n=(null==e||null===(_=e.ads)||void 0===_||null===(b=_.preRoll)||void 0===b||null===(F=b.adTags)||void 0===F||null===(D=F.web)||void 0===D?void 0:D.active)&&(null==e||null===(O=e.ads)||void 0===O||null===(L=O.preRoll)||void 0===L||null===(R=L.adTags)||void 0===R||null===(S=R.web)||void 0===S?void 0:S.url)}catch(e){}return n},ye=function(e,n){var t,i,o,r,l,a,u,s,c,v,m,f,p,w=(null==e?void 0:e.contentType)||"video",I=null==e||null===(t=e[w])||void 0===t?void 0:t.drmEnabled,g=null==e||null===(i=e[w])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[w])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,T=(null==e||null===(a=e[w])||void 0===a||null===(u=a.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[w])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[w])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return be(E);if(I){var y=Fe(g,n);return y.src=ge(y.src,n,e),y}if("Safari"!==d()&&h){var _=_e(g);return _.src=ge(_.src,n,e),_}if(T){var b=be(g);return b.src=ge(b.src,n,e),b}if(null!=g&&g.mpeg){var F=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(g);return F.src=ge(F.src,n,e),F}return null},_e=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},be=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=e.fairPlayCmaf||e.fairPlay,o=e.widevine,l=e.playReady,a=d();if(r(n),"Safari"===a){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(o,function(e,n,i){console.log(e),e&&t(e),t(null,new Uint8Array(i))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,o,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};i.xhr(l,function(e,n,t){console.log(e),e&&r(e),r(null,t)})}}}}}(t);return De(n),u}var s,c={src:o.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(De(n),c.keySystems={"com.widevine.alpha":{url:o.licenseUrl,licenseHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:o.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var De=function(e){var n=r(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==d()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Oe=function(e,n){var t=e.src,i=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:i};n=n.replace(/\/$/,"");var o=t.split(".com")[1]||"";return{src:o?"".concat(n).concat(o):t,type:i}},Le=function(e,n){if(import("./error-2395864b.js").then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),o.appendChild(r),i.append(o)}}},Re=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Se=!1,Pe=function(e,n,t){var i=ge(n,e,t),o=r(e);if(n&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,n){var t,i,o,l=r(e);if(null!==l.el_){Se=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),Se&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,i)}};function Ve(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}var We=function(e){i(e).play()},Ce=function(e){i(e).pause()},Ae=function(e,n){var t=i(e),o=t.currentTime()+n;t.currentTime(o)},Ne=function(e,n){var t=i(e),o=t.currentTime(),r=o<=n?0:o-n;t.currentTime(r)},je=function(e){return!!i.getPlayer("".concat(e))},Be=function(e){return i(e).paused()},xe=function(){var e=n(t.mark(function e(n,i){var o,l,a,d=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=d.length>2&&void 0!==d[2]&&d[2],e.next=3,U();case 3:return l=e.sent,a=r(n),e.abrupt("return",new Promise(function(e,t){y(i,l).then(function(t){var r=null==t?void 0:t.data;window.sid=ie(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var l=ye(r,n);H(r),l&&o?(Ge(n,l),a.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:r})})):e({status:!0,msg:"Feed authenticated",response:r})}).catch(function(e){t({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Ue=function(){var e=n(t.mark(function e(n,i){var o,l,a,d,u,s,m=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(d=m.length>2&&void 0!==m[2]?m[2]:null){e.next=5;break}return e.next=4,U();case 4:d=e.sent;case 5:return(Y()||null)&&Q(i),u=0,s=0,null!==(o=window)&&void 0!==o&&o.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&F(i,d).then(function(e){var n,t,i,o,r,l;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),u=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,s=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null}).catch(function(e){var n,t,i,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))}),e.abrupt("return",new Promise(function(e,t){h(i,d).then(function(i){var o,l,a=null==i?void 0:i.data,d=(null==a||null===(o=a.video)||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;H(i.data);var m=he(a);m&&Pe(n,m,a);var f=ye(a,n);if(f){var p,w,I,g,E,T,h,y,_,b,F,D,O,L,R=(null==a||null===(p=a.video)||void 0===p||null===(w=p.gist)||void 0===w?void 0:w.videoImageUrl)||(null==a||null===(I=a.video)||void 0===I||null===(g=I.gist)||void 0===g||null===(E=g.imageGist)||void 0===E?void 0:E.r16x9),S=r(n);if(S.poster(R),Ge(n,f),S.on("loadstart",function(){d&&e({status:!0,msg:"Video Loaded",response:a})}),S.on("loadeddata",function(){Re(),e({status:!0,msg:"Video Loaded",response:a})}),S.one("play",function(){u&&s<95&&setTimeout(function(){S.currentTime(u)},0)}),S.one("error",function(){var e;t({status:!1,msg:(null==S||null===(e=S.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==a||null===(T=a.video)||void 0===T||null===(h=T.contentDetails)||void 0===h||null===(y=h.closedCaptions)||void 0===y?void 0:y.length)>0||(null==a||null===(_=a.video)||void 0===_||null===(b=_.closedCaptions)||void 0===b?void 0:b.length)>0)F=((null==a||null===(D=a.video)||void 0===D||null===(O=D.contentDetails)||void 0===O?void 0:O.closedCaptions)||(null==a||null===(L=a.video)||void 0===L?void 0:L.closedCaptions)).filter(function(e){return"VTT"===e.format}),c(n,F);else v(n)}else Le(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){ze(e,n,t,i)})}));case 11:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Me=function(e,n,t){var i=r(e);return i.src(n),new Promise(function(e,n){var o=0;i.one("loadedmetadata",function(){clearTimeout(o),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){o=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},ke=function(e){var n=r(e);if(He(),l(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},He=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()},Ge=function(e,n){var t=r(e);t&&t.src(n)},ze=function(n,t,i,o){var r,l,a,d,u,s,c=null==n||null===(r=n.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==n||null===(a=n.response)||void 0===a||null===(d=a.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);je(t)&&Le(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),i&&i(function(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Ve(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}({status:!1,response:n,msg:"".concat(v)},o&&{videoId:o}))},Ye=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var i=n.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=n.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")};export{_ as A,se as B,Z as C,z as D,Me as E,We as F,Ce as G,Be as H,je as I,Ue as J,xe as K,ke as L,L as M,O as N,M as O,P,R as Q,f as R,X as S,q as T,D as U,K as V,Q as W,ve as a,Y as b,ce as c,G as d,ye as e,H as f,oe as g,Re as h,Le as i,J as j,Ae as k,Ge as l,ge as m,he as n,Ye as o,ue as p,Pe as q,Ne as r,b as s,Oe as t,k as u,h as v,F as w,ze as x,U as y,y as z};
1
+ import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import i from"video.js";import o from"axios";import{g as r,c as l}from"./skin-86e7e2b5.js";import{i as a,d}from"./browser-512cd55a.js";import u from"js-cookie";import{UAParser as s}from"ua-parser-js";import{a as c,r as v}from"./captions-0280b028.js";function m(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function f(e){window.dataLayer=window.dataLayer||[],m("js",new Date),m("config",e)}function p(e,n){m("event",e,n)}var w={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 I(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function g(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?I(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):I(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var E={name:"@viewlift/player-backup",version:"2.0.92-smartTv-test9",main:"dist/bundle.cjs.js",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",install:"^0.13.0","js-cookie":"^3.0.5",npm:"^11.5.2","ua-parser-js":"^2.0.3","video.js":"^7.3.26","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-contrib-quality-menu":"^1.0.3","videojs-mux":"^4.21.7"}};window.vl_player_version=E.version;var T,h=function(e,n){var t,i,r,l,a,d,u,s;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):o({url:null!==(a=window)&&void 0!==a&&null!==(d=a.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(u=window)||void 0===u||null===(s=u.customData)||void 0===s?void 0:s.overrideEntitlementBaseUrl)+"/video/status":O.get()+"".concat(null==w?void 0:w.getVideoDetails),params:g({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":E.version},withCredentials:!0})},y=function(e,n){var t,i,r,l;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):o({url:O.get()+w.getLinearChannelDetails,params:g(g(g(g(g({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===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},_=function(e,n){var t,i,r=k(n),l=(null==r?void 0:r.site)||null;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.seriesData?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.seriesData})}):o({url:O.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},b=function(){var e=n(t.mark(function e(n){var i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return i=e.sent,e.abrupt("return",o({url:O.get()+"".concat(null==w?void 0:w.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:g({},n),params:g({},(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)}}(),F=function(e,n){var t,i,r=window.contentType;return o({method:"GET",url:O.get()+"".concat(null==w?void 0:w.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(i=t.watchHistory)||void 0===i?void 0:i.xApiKey},timeout:15e3})},D=function(e){var n=e.videoId;return o({method:"GET",url:O.get()+"".concat(null==w?void 0:w.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},O=(T=null==w?void 0:w.apiBaseUrl,{set:function(e){e&&(T=e)},get:function(){return T}}),L=function(e,n,t,i){return o({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==i?void 0:i.latitude,longitude:null==i?void 0:i.longitude},method:"GET",headers:{Authorization:n},withCredentials:!0})},R=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},S=null;function P(){return{set:function(e){e&&(S=e)},get:function(){return S}}}var V,W,C,A,N,j,B=function(){var e=n(t.mark(function e(){var n,i,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=P().get(),i=O.get(),e.prev=2,e.next=5,o({method:"GET",url:"".concat(i,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return e.apply(this,arguments)}}(),x=null,U=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"))||!R(n)){e.next=6;break}return x||(x=B().then(function(e){var t,i,o=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&P().set(r),o||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){x=null})),e.abrupt("return",x);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),M=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return t&&!i&&(n=!1),n},k=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},H=function(e){W=e},G=function(){return W},z=function(e){V=e},Y=function(){return V},X=function(){return C},q=function(e){C=e},J=function(){return N},K=function(e){A=new Map,e.map(function(e,n){A.set(e.id,n)})},Q=function(e){if(A){var n=A.get(e);q(n+1)}},Z=(j=0,{set:function(e){e>=0&&(j=e)},get:function(){return j}});function $(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function ee(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?$(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):$(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var ne=0,te=function(){var e,n,t,i,o,r,l,a=G();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===t||null===(i=t.content)||void 0===i?void 0:i.id:(null==a||null===(o=a.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function ie(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function oe(){var e=window.sessionStorage.getItem("uid");return e||(e=ie(),window.sessionStorage.setItem("uid",e),e)}function re(){return le.apply(this,arguments)}function le(){return(le=n(t.mark(function e(){var n,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ae(e){return e?String(e):""}window.initialise=function(e){window.sid=ie(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",function(){var t,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,p(r?"FAILED_TO_START":"DROPPED_STREAM",ee({pfm:window.platform,uid:oe(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,n){e.one("play",tryCatch(function(){var t,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),p("PLAY",ee({pfm:window.platform,uid:oe(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",{"Video ID":te(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,n){var t,i;if(n.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(i=t.className)&&void 0!==i&&i.includes("vjs-waiting")&&ne<4)ne++,p("BUFFERING",ee({pfm:window.platform,uid:oe(),vid:te(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var n,t,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,p("FIRST_FRAME",ee({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),vid:te()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var n,t,i,o,r,l;p("AD_REQUEST",ee({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),vid:te(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),p("AD_IMPRESSION",ee({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:te()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var n=[];e.on("timeupdate",function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(ne=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(de(n,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var de=function(e,n,t){return e>=n&&e<=t};function ue(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var t=r(e);window.initialise(t,n),window.firstFrame(t,n),t.on("loadedmetadata",function(){window.endFirstFrame(t)})}}window.fireEvent=function(){var e=n(t.mark(function e(n){var i,r,l,a,d,u,s,c,v,m,f,p,I,g,E,T,h,y,_,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return T=e.sent,h=k(T),y=null==h?void 0:h.site,_=null==h?void 0:h.siteId,e.t0=ee,e.t1=ee,e.t2=ee({aid:y,cid:_,pfm:window.platform},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params),e.t3={},e.t4=oe(),e.t5=te(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=null!==(a=n.videoPosition)&&void 0!==a?a:null,e.t10=window.environment,e.t11=n.dp1||"",e.t12=n.dp2||"",e.t13=n.dp3||"",e.t14=n.dp4||"",e.t15=n.dp5||"",e.t16=!0===n.isAdEvent?n.videoPosition:null,e.t17=!0===n.isAdEvent?ae(n.adPosition):"",e.next=26,re();case 26:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t26=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==n?void 0:n.duration)&&{duration:n.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(m=window)||void 0===m||null===(f=m.customData)||void 0===f||null===(p=f.beacon)||void 0===p?void 0:p.params,e.t31=(0,e.t0)(e.t29,e.t30),b=[e.t31],o({url:(null===(I=window)||void 0===I||null===(g=I.customData)||void 0===g||null===(E=g.beacon)||void 0===E?void 0:E.url)||O.get()+w.getBeaconUrl,method:"post",headers:{Authorization:T},contentType:"application/x-www-form-urlencoded",dataType:"text",data:b}).catch(function(e){console.error(e)});case 42:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var se=function(e,n){var t=new Map;D({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),N=t}).catch(function(e){return console.log(e)})},ce=function(){var e=Z.get();return e>=0?e+1:1},ve=function(){var e,n,t,i=Y(),o=G(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,l=Z.get(),a=null==i||null===(n=i[l])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};function me(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function fe(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?me(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):me(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}window._deviceInfo=s(navigator.userAgent);var pe=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},we=function(e){var n=Ie(e,"video.tags",[]),t=Ie(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},Ie=function(e,n,t){for(var i=0,o=(n=n.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[n[i]]}return e||t},ge=function(){var e,n,t,i,o,l,a,d,s,c,v,m,f,p,w,I,g,E,T,h,y,_=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=arguments.length>1?arguments[1]:void 0,F=arguments.length>2?arguments[2]:void 0,D=(null==F?void 0:F.siteName)||"",O=(null==F?void 0:F.contentType)||"video",L=(null==F||null===(e=F[O])||void 0===e?void 0:e.metadata)||(null==F||null===(n=F[O])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.metadata),R=r(b);if(!_.includes("VIEWLIFT_"))return _;var S,P=window.getComputedStyle(document.getElementById(b),null),V=Math.trunc(P.getPropertyValue("height").slice(0,-2)),W=Math.trunc(P.getPropertyValue("width").slice(0,-2)),C="linearchannel"===O?null==F||null===(i=F.linearchannel)||void 0===i||null===(o=i.channels)||void 0===o||null===(l=o.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===l||null===(a=l.content)||void 0===a?void 0:a.id:Ie(F,"video.gist.id",""),A="linearchannel"===O?null==F||null===(d=F.linearchannel)||void 0===d||null===(s=d.channels)||void 0===s||null===(c=s.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===c?void 0:c.title:Ie(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),N=null,j=null;"function"==typeof window.__gpp&&(null===(S=window)||void 0===S||S.__gpp("ping",function(e){N=null==e?void 0:e.gppString,j=null==e?void 0:e.sectionList[0]}));var B=fe(fe({},Ee(L)),{},{VIEWLIFT_WIDTH:W,VIEWLIFT_HEIGHT:V,VIEWLIFT_SIZE:pe(W,V),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(v=window)||void 0===v?void 0:v.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Ie(F,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Ie(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Ie(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==R||null===(m=R.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==R||null===(f=R.options_)||void 0===f?void 0:f.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:we(F),VIEWLIFT_MEDIA_ID:C,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Ie(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:C,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Ie(F,"video.gist.permalink","")),VIEWLIFT_CONSENT:u.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Ie(null===(p=window)||void 0===p||null===(w=p.app_data)||void 0===w||null===(I=w.site)||void 0===I?void 0:I.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==D?"":Ie(null===(g=window)||void 0===g||null===(E=g.app_data)||void 0===E||null===(T=E.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*Ie(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Ie(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:C,VIEWLIFT_CONTENT_TITLE:A,VIEWLIFT_CONTENT_SERIES_TITLE:Ie(F,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Ie(F,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ve(),VIEWLIFT_SEASON_NUMBER:ce(),VIEWLIFT_CONTENT_TAGS:we(F),VIEWLIFT_GPP_SID:j||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:N||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.macros);for(var x in B){var U=new RegExp(x,"g");_=_.replace(U,B[x])}return _},Ee=function(e){var n,t,i,o,r,l,d;if(null!==(n=window)&&void 0!==n&&n.customData.isSmartTV)return Te(e);var u={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){s.set(e.name,e.value)}));var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.subscription)||void 0===o?void 0:o.SVOD)||!1,v=(null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(d=l.subscription)||void 0===d?void 0:d.TVE)||!1;return c||v?(a()?c?u=fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):v&&(u=fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):c?u=fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):v&&(u=fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),c?u=fe(fe({},u),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):v&&(u=fe(fe({},u),{},{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),u=a()?fe(fe({},u),{},{VIEWLIFT_PROF:s.get("prof.mweb")||""}):fe(fe({},u),{},{VIEWLIFT_PROF:s.get("prof.web")||""})):(u=fe(fe({},u),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),u=a()?fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),u=fe(fe({},u),{},{VIEWLIFT_AFID:s.get("afid")})},Te=function(e){var n,t,i,o,r,l,a={},d=new Map;return(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)})),null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.subscription)||void 0===i||i.SVOD,(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1?(a=fe(fe({},a),{},{VIEWLIFT_SFID:d.get("sfid.samsungtv.tve")||d.get("sfid.tve")}),a="lgTv"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.lgtv.tve")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.viziotv.tve")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.xfinity.tve")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.xbox.tve")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.samsungtv.tve")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})):(a=fe(fe({},a),{},{VIEWLIFT_SFID:d.get("sfid.samsungtv.dtc")||d.get("sfid.dtc")}),a="lgTv"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.lgtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.viziotv.dtc")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.xfinity.dtc")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.xbox.dtc")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.samsungtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})),a},he=function(e){var n=null;try{var t,i,o,r,l,a,d,u,s,c,v,m,f,p,w,I,g,E,T,h,y,_,b,F,D,O,L,R,S;if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV){if("samsungTv"==window.customData.device&&null!=e&&null!==(i=e.ads)&&void 0!==i&&null!==(o=i.preRoll)&&void 0!==o&&null!==(r=o.adTags)&&void 0!==r&&null!==(l=r.samsung_tv)&&void 0!==l&&l.active)n=null==e||null===(E=e.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(h=T.adTags)||void 0===h||null===(y=h.samsung_tv)||void 0===y?void 0:y.url;else if("lgTv"==window.customData.device&&null!=e&&null!==(a=e.ads)&&void 0!==a&&null!==(d=a.preRoll)&&void 0!==d&&null!==(u=d.adTags)&&void 0!==u&&null!==(s=u.lg_tv)&&void 0!==s&&s.active){var P,V,W,C;n=null==e||null===(P=e.ads)||void 0===P||null===(V=P.preRoll)||void 0===V||null===(W=V.adTags)||void 0===W||null===(C=W.lg_tv)||void 0===C?void 0:C.url}else if("vizioTv"==window.customData.device&&null!=e&&null!==(c=e.ads)&&void 0!==c&&null!==(v=c.preRoll)&&void 0!==v&&null!==(m=v.adTags)&&void 0!==m&&null!==(f=m.vizioTv)&&void 0!==f&&f.active){var A,N,j,B;n=null==e||null===(A=e.ads)||void 0===A||null===(N=A.preRoll)||void 0===N||null===(j=N.adTags)||void 0===j||null===(B=j.vizioTv)||void 0===B?void 0:B.url}else if("xbox"==window.customData.device&&null!=e&&null!==(p=e.ads)&&void 0!==p&&null!==(w=p.preRoll)&&void 0!==w&&null!==(I=w.adTags)&&void 0!==I&&null!==(g=I.xbox)&&void 0!==g&&g.active){var x,U,M,k;n=null==e||null===(x=e.ads)||void 0===x||null===(U=x.preRoll)||void 0===U||null===(M=U.adTags)||void 0===M||null===(k=M.xbox)||void 0===k?void 0:k.url}}else n=(null==e||null===(_=e.ads)||void 0===_||null===(b=_.preRoll)||void 0===b||null===(F=b.adTags)||void 0===F||null===(D=F.web)||void 0===D?void 0:D.active)&&(null==e||null===(O=e.ads)||void 0===O||null===(L=O.preRoll)||void 0===L||null===(R=L.adTags)||void 0===R||null===(S=R.web)||void 0===S?void 0:S.url)}catch(e){}return n},ye=function(e,n){var t,i,o,r,l,a,u,s,c,v,m,f,p,w=(null==e?void 0:e.contentType)||"video",I=null==e||null===(t=e[w])||void 0===t?void 0:t.drmEnabled,g=null==e||null===(i=e[w])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[w])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,T=(null==e||null===(a=e[w])||void 0===a||null===(u=a.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[w])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[w])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return be(E);if(I){var y=Fe(g,n);return y.src=ge(y.src,n,e),y}if("Safari"!==d()&&h){var _=_e(g);return _.src=ge(_.src,n,e),_}if(T){var b=be(g);return b.src=ge(b.src,n,e),b}if(null!=g&&g.mpeg){var F=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(g);return F.src=ge(F.src,n,e),F}return null},_e=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},be=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=e.fairPlayCmaf||e.fairPlay,o=e.widevine,l=e.playReady,a=d();if(r(n),"Safari"===a){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(o,function(e,n,i){console.log(e),e&&t(e),t(null,new Uint8Array(i))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,o,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};i.xhr(l,function(e,n,t){console.log(e),e&&r(e),r(null,t)})}}}}}(t);return De(n),u}var s,c={src:o.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(De(n),c.keySystems={"com.widevine.alpha":{url:o.licenseUrl,licenseHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:o.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var De=function(e){var n=r(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==d()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Oe=function(e,n){var t=e.src,i=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:i};n=n.replace(/\/$/,"");var o=t.split(".com")[1]||"";return{src:o?"".concat(n).concat(o):t,type:i}},Le=function(e,n){if(import("./error-2395864b.js").then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),o.appendChild(r),i.append(o)}}},Re=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Se=!1,Pe=function(e,n,t){var i=ge(n,e,t),o=r(e);if(n&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,n){var t,i,o,l=r(e);if(null!==l.el_){Se=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),Se&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,i)}};function Ve(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}var We=function(e){i(e).play()},Ce=function(e){i(e).pause()},Ae=function(e,n){var t=i(e),o=t.currentTime()+n;t.currentTime(o)},Ne=function(e,n){var t=i(e),o=t.currentTime(),r=o<=n?0:o-n;t.currentTime(r)},je=function(e){return!!i.getPlayer("".concat(e))},Be=function(e){return i(e).paused()},xe=function(){var e=n(t.mark(function e(n,i){var o,l,a,d=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=d.length>2&&void 0!==d[2]&&d[2],e.next=3,U();case 3:return l=e.sent,a=r(n),e.abrupt("return",new Promise(function(e,t){y(i,l).then(function(t){var r=null==t?void 0:t.data;window.sid=ie(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var l=ye(r,n);H(r),l&&o?(Ge(n,l),a.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:r})})):e({status:!0,msg:"Feed authenticated",response:r})}).catch(function(e){t({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Ue=function(){var e=n(t.mark(function e(n,i){var o,l,a,d,u,s,m=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(d=m.length>2&&void 0!==m[2]?m[2]:null){e.next=5;break}return e.next=4,U();case 4:d=e.sent;case 5:return(Y()||null)&&Q(i),u=0,s=0,null!==(o=window)&&void 0!==o&&o.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&F(i,d).then(function(e){var n,t,i,o,r,l;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),u=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,s=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null}).catch(function(e){var n,t,i,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))}),e.abrupt("return",new Promise(function(e,t){h(i,d).then(function(i){var o,l,a=null==i?void 0:i.data,d=(null==a||null===(o=a.video)||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;H(i.data);var m=he(a);m&&Pe(n,m,a);var f=ye(a,n);if(f){var p,w,I,g,E,T,h,y,_,b,F,D,O,L,R=(null==a||null===(p=a.video)||void 0===p||null===(w=p.gist)||void 0===w?void 0:w.videoImageUrl)||(null==a||null===(I=a.video)||void 0===I||null===(g=I.gist)||void 0===g||null===(E=g.imageGist)||void 0===E?void 0:E.r16x9),S=r(n);if(S.poster(R),Ge(n,f),S.on("loadstart",function(){d&&e({status:!0,msg:"Video Loaded",response:a})}),S.on("loadeddata",function(){Re(),e({status:!0,msg:"Video Loaded",response:a})}),S.one("play",function(){u&&s<95&&setTimeout(function(){S.currentTime(u)},0)}),S.one("error",function(){var e;t({status:!1,msg:(null==S||null===(e=S.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==a||null===(T=a.video)||void 0===T||null===(h=T.contentDetails)||void 0===h||null===(y=h.closedCaptions)||void 0===y?void 0:y.length)>0||(null==a||null===(_=a.video)||void 0===_||null===(b=_.closedCaptions)||void 0===b?void 0:b.length)>0)F=((null==a||null===(D=a.video)||void 0===D||null===(O=D.contentDetails)||void 0===O?void 0:O.closedCaptions)||(null==a||null===(L=a.video)||void 0===L?void 0:L.closedCaptions)).filter(function(e){return"VTT"===e.format}),c(n,F);else v(n)}else Le(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){ze(e,n,t,i)})}));case 11:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Me=function(e,n,t){var i=r(e);return i.src(n),new Promise(function(e,n){var o=0;i.one("loadedmetadata",function(){clearTimeout(o),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){o=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},ke=function(e){var n=r(e);if(He(),l(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},He=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()},Ge=function(e,n){var t=r(e);t&&t.src(n)},ze=function(n,t,i,o){var r,l,a,d,u,s,c=null==n||null===(r=n.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==n||null===(a=n.response)||void 0===a||null===(d=a.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);je(t)&&Le(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),i&&i(function(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Ve(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}({status:!1,response:n,msg:"".concat(v)},o&&{videoId:o}))},Ye=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var i=n.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=n.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")};export{_ as A,se as B,Z as C,z as D,Me as E,We as F,Ce as G,Be as H,je as I,Ue as J,xe as K,ke as L,L as M,O as N,M as O,P,R as Q,f as R,X as S,q as T,D as U,K as V,Q as W,ve as a,Y as b,ce as c,G as d,ye as e,H as f,oe as g,Re as h,Le as i,J as j,Ae as k,Ge as l,ge as m,he as n,Ye as o,ue as p,Pe as q,Ne as r,b as s,Oe as t,k as u,h as v,F as w,ze as x,U as y,y as z};
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import i from"video.js";import o from"axios";import{g as r,c as l}from"./skin-86e7e2b5.js";import{i as a,d}from"./browser-512cd55a.js";import u from"js-cookie";import{UAParser as s}from"ua-parser-js";import{a as c,r as v}from"./captions-0280b028.js";function m(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function f(e){window.dataLayer=window.dataLayer||[],m("js",new Date),m("config",e)}function p(e,n){m("event",e,n)}var w={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 I(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function g(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?I(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):I(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var E={name:"@viewlift/player-backup",version:"2.0.92-smartTv-test10",main:"dist/bundle.cjs.js",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",install:"^0.13.0","js-cookie":"^3.0.5",npm:"^11.5.2","ua-parser-js":"^2.0.3","video.js":"^7.3.26","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-contrib-quality-menu":"^1.0.3","videojs-mux":"^4.21.7"}};window.vl_player_version=E.version;var T,h=function(e,n){var t,i,r,l,a,d,u,s;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):o({url:null!==(a=window)&&void 0!==a&&null!==(d=a.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(u=window)||void 0===u||null===(s=u.customData)||void 0===s?void 0:s.overrideEntitlementBaseUrl)+"/video/status":O.get()+"".concat(null==w?void 0:w.getVideoDetails),params:g({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":E.version},withCredentials:!0})},y=function(e,n){var t,i,r,l;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):o({url:O.get()+w.getLinearChannelDetails,params:g(g(g(g(g({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===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},_=function(e,n){var t,i,r=k(n),l=(null==r?void 0:r.site)||null;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.seriesData?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.seriesData})}):o({url:O.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},b=function(){var e=n(t.mark(function e(n){var i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return i=e.sent,e.abrupt("return",o({url:O.get()+"".concat(null==w?void 0:w.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:g({},n),params:g({},(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)}}(),F=function(e,n){var t,i,r=window.contentType;return o({method:"GET",url:O.get()+"".concat(null==w?void 0:w.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(i=t.watchHistory)||void 0===i?void 0:i.xApiKey},timeout:15e3})},D=function(e){var n=e.videoId;return o({method:"GET",url:O.get()+"".concat(null==w?void 0:w.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},O=(T=null==w?void 0:w.apiBaseUrl,{set:function(e){e&&(T=e)},get:function(){return T}}),L=function(e,n,t,i){return o({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==i?void 0:i.latitude,longitude:null==i?void 0:i.longitude},method:"GET",headers:{Authorization:n},withCredentials:!0})},R=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},S=null;function P(){return{set:function(e){e&&(S=e)},get:function(){return S}}}var V,W,C,A,N,j,B=function(){var e=n(t.mark(function e(){var n,i,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=P().get(),i=O.get(),e.prev=2,e.next=5,o({method:"GET",url:"".concat(i,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return e.apply(this,arguments)}}(),x=null,U=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"))||!R(n)){e.next=6;break}return x||(x=B().then(function(e){var t,i,o=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&P().set(r),o||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){x=null})),e.abrupt("return",x);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),M=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return t&&!i&&(n=!1),n},k=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},H=function(e){W=e},G=function(){return W},z=function(e){V=e},Y=function(){return V},X=function(){return C},q=function(e){C=e},J=function(){return N},K=function(e){A=new Map,e.map(function(e,n){A.set(e.id,n)})},Q=function(e){if(A){var n=A.get(e);q(n+1)}},Z=(j=0,{set:function(e){e>=0&&(j=e)},get:function(){return j}});function $(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function ee(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?$(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):$(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var ne=0,te=function(){var e,n,t,i,o,r,l,a=G();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===t||null===(i=t.content)||void 0===i?void 0:i.id:(null==a||null===(o=a.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function ie(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function oe(){var e=window.sessionStorage.getItem("uid");return e||(e=ie(),window.sessionStorage.setItem("uid",e),e)}function re(){return le.apply(this,arguments)}function le(){return(le=n(t.mark(function e(){var n,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ae(e){return e?String(e):""}window.initialise=function(e){window.sid=ie(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",function(){var t,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,p(r?"FAILED_TO_START":"DROPPED_STREAM",ee({pfm:window.platform,uid:oe(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,n){e.one("play",tryCatch(function(){var t,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),p("PLAY",ee({pfm:window.platform,uid:oe(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",{"Video ID":te(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,n){var t,i;if(n.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(i=t.className)&&void 0!==i&&i.includes("vjs-waiting")&&ne<4)ne++,p("BUFFERING",ee({pfm:window.platform,uid:oe(),vid:te(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var n,t,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,p("FIRST_FRAME",ee({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),vid:te()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var n,t,i,o,r,l;p("AD_REQUEST",ee({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),vid:te(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),p("AD_IMPRESSION",ee({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:te()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var n=[];e.on("timeupdate",function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(ne=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(de(n,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var de=function(e,n,t){return e>=n&&e<=t};function ue(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var t=r(e);window.initialise(t,n),window.firstFrame(t,n),t.on("loadedmetadata",function(){window.endFirstFrame(t)})}}window.fireEvent=function(){var e=n(t.mark(function e(n){var i,r,l,a,d,u,s,c,v,m,f,p,I,g,E,T,h,y,_,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return T=e.sent,h=k(T),y=null==h?void 0:h.site,_=null==h?void 0:h.siteId,e.t0=ee,e.t1=ee,e.t2=ee({aid:y,cid:_,pfm:window.platform},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params),e.t3={},e.t4=oe(),e.t5=te(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=null!==(a=n.videoPosition)&&void 0!==a?a:null,e.t10=window.environment,e.t11=n.dp1||"",e.t12=n.dp2||"",e.t13=n.dp3||"",e.t14=n.dp4||"",e.t15=n.dp5||"",e.t16=!0===n.isAdEvent?n.videoPosition:null,e.t17=!0===n.isAdEvent?ae(n.adPosition):"",e.next=26,re();case 26:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t26=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==n?void 0:n.duration)&&{duration:n.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(m=window)||void 0===m||null===(f=m.customData)||void 0===f||null===(p=f.beacon)||void 0===p?void 0:p.params,e.t31=(0,e.t0)(e.t29,e.t30),b=[e.t31],o({url:(null===(I=window)||void 0===I||null===(g=I.customData)||void 0===g||null===(E=g.beacon)||void 0===E?void 0:E.url)||O.get()+w.getBeaconUrl,method:"post",headers:{Authorization:T},contentType:"application/x-www-form-urlencoded",dataType:"text",data:b}).catch(function(e){console.error(e)});case 42:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var se=function(e,n){var t=new Map;D({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),N=t}).catch(function(e){return console.log(e)})},ce=function(){var e=Z.get();return e>=0?e+1:1},ve=function(){var e,n,t,i=Y(),o=G(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,l=Z.get(),a=null==i||null===(n=i[l])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};function me(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function fe(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?me(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):me(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}window._deviceInfo=s(navigator.userAgent);var pe=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},we=function(e){var n=Ie(e,"video.tags",[]),t=Ie(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},Ie=function(e,n,t){for(var i=0,o=(n=n.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[n[i]]}return e||t},ge=function(){var e,n,t,i,o,l,a,d,s,c,v,m,f,p,w,I,g,E,T,h,y,_=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=arguments.length>1?arguments[1]:void 0,F=arguments.length>2?arguments[2]:void 0,D=(null==F?void 0:F.siteName)||"",O=(null==F?void 0:F.contentType)||"video",L=(null==F||null===(e=F[O])||void 0===e?void 0:e.metadata)||(null==F||null===(n=F[O])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.metadata),R=r(b);if(!_.includes("VIEWLIFT_"))return _;var S,P=window.getComputedStyle(document.getElementById(b),null),V=Math.trunc(P.getPropertyValue("height").slice(0,-2)),W=Math.trunc(P.getPropertyValue("width").slice(0,-2)),C="linearchannel"===O?null==F||null===(i=F.linearchannel)||void 0===i||null===(o=i.channels)||void 0===o||null===(l=o.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===l||null===(a=l.content)||void 0===a?void 0:a.id:Ie(F,"video.gist.id",""),A="linearchannel"===O?null==F||null===(d=F.linearchannel)||void 0===d||null===(s=d.channels)||void 0===s||null===(c=s.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===c?void 0:c.title:Ie(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),N=null,j=null;"function"==typeof window.__gpp&&(null===(S=window)||void 0===S||S.__gpp("ping",function(e){N=null==e?void 0:e.gppString,j=null==e?void 0:e.sectionList[0]}));var B=fe(fe({},Ee(L)),{},{VIEWLIFT_WIDTH:W,VIEWLIFT_HEIGHT:V,VIEWLIFT_SIZE:pe(W,V),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(v=window)||void 0===v?void 0:v.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Ie(F,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Ie(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Ie(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==R||null===(m=R.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==R||null===(f=R.options_)||void 0===f?void 0:f.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:we(F),VIEWLIFT_MEDIA_ID:C,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Ie(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:C,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Ie(F,"video.gist.permalink","")),VIEWLIFT_CONSENT:u.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Ie(null===(p=window)||void 0===p||null===(w=p.app_data)||void 0===w||null===(I=w.site)||void 0===I?void 0:I.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==D?"":Ie(null===(g=window)||void 0===g||null===(E=g.app_data)||void 0===E||null===(T=E.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*Ie(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Ie(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:C,VIEWLIFT_CONTENT_TITLE:A,VIEWLIFT_CONTENT_SERIES_TITLE:Ie(F,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Ie(F,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ve(),VIEWLIFT_SEASON_NUMBER:ce(),VIEWLIFT_CONTENT_TAGS:we(F),VIEWLIFT_GPP_SID:j||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:N||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.macros);for(var x in B){var U=new RegExp(x,"g");_=_.replace(U,B[x])}return _},Ee=function(e){var n,t,i,o,r,l,d;if(null!==(n=window)&&void 0!==n&&n.customData.isSmartTV)return Te(e);var u={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){s.set(e.name,e.value)}));var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.subscription)||void 0===o?void 0:o.SVOD)||!1,v=(null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(d=l.subscription)||void 0===d?void 0:d.TVE)||!1;return c||v?(a()?c?u=fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):v&&(u=fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):c?u=fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):v&&(u=fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),c?u=fe(fe({},u),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):v&&(u=fe(fe({},u),{},{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),u=a()?fe(fe({},u),{},{VIEWLIFT_PROF:s.get("prof.mweb")||""}):fe(fe({},u),{},{VIEWLIFT_PROF:s.get("prof.web")||""})):(u=fe(fe({},u),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),u=a()?fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):fe(fe({},u),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),u=fe(fe({},u),{},{VIEWLIFT_AFID:s.get("afid")})},Te=function(e){var n,t,i,o,r,l,a={},d=new Map;return(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)})),null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.subscription)||void 0===i||i.SVOD,(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1?(a=fe(fe({},a),{},{VIEWLIFT_SFID:d.get("sfid.samsungtv.tve")||d.get("sfid.tve")}),a="lgTv"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.lgtv.tve")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.viziotv.tve")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.xfinity.tve")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.xbox.tve")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.samsungtv.tve")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})):(a=fe(fe({},a),{},{VIEWLIFT_SFID:d.get("sfid.samsungtv.dtc")||d.get("sfid.dtc")}),a="lgTv"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.lgtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.viziotv.dtc")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.xfinity.dtc")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.xbox.dtc")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.samsungtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})),a},he=function(e){var n=null;try{var t,i,o,r,l,a,d,u,s,c,v,m,f,p,w,I,g,E,T,h,y,_,b,F,D,O,L,R,S;if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV){if("samsungTv"==window.customData.device&&null!=e&&null!==(i=e.ads)&&void 0!==i&&null!==(o=i.preRoll)&&void 0!==o&&null!==(r=o.adTags)&&void 0!==r&&null!==(l=r.samsung_tv)&&void 0!==l&&l.active)n=null==e||null===(E=e.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(h=T.adTags)||void 0===h||null===(y=h.samsung_tv)||void 0===y?void 0:y.url;else if("lgTv"==window.customData.device&&null!=e&&null!==(a=e.ads)&&void 0!==a&&null!==(d=a.preRoll)&&void 0!==d&&null!==(u=d.adTags)&&void 0!==u&&null!==(s=u.lg_tv)&&void 0!==s&&s.active){var P,V,W,C;n=null==e||null===(P=e.ads)||void 0===P||null===(V=P.preRoll)||void 0===V||null===(W=V.adTags)||void 0===W||null===(C=W.lg_tv)||void 0===C?void 0:C.url}else if("vizioTv"==window.customData.device&&null!=e&&null!==(c=e.ads)&&void 0!==c&&null!==(v=c.preRoll)&&void 0!==v&&null!==(m=v.adTags)&&void 0!==m&&null!==(f=m.vizioTv)&&void 0!==f&&f.active){var A,N,j,B;n=null==e||null===(A=e.ads)||void 0===A||null===(N=A.preRoll)||void 0===N||null===(j=N.adTags)||void 0===j||null===(B=j.vizioTv)||void 0===B?void 0:B.url}else if("xbox"==window.customData.device&&null!=e&&null!==(p=e.ads)&&void 0!==p&&null!==(w=p.preRoll)&&void 0!==w&&null!==(I=w.adTags)&&void 0!==I&&null!==(g=I.xbox)&&void 0!==g&&g.active){var x,U,M,k;n=null==e||null===(x=e.ads)||void 0===x||null===(U=x.preRoll)||void 0===U||null===(M=U.adTags)||void 0===M||null===(k=M.xbox)||void 0===k?void 0:k.url}}else n=(null==e||null===(_=e.ads)||void 0===_||null===(b=_.preRoll)||void 0===b||null===(F=b.adTags)||void 0===F||null===(D=F.web)||void 0===D?void 0:D.active)&&(null==e||null===(O=e.ads)||void 0===O||null===(L=O.preRoll)||void 0===L||null===(R=L.adTags)||void 0===R||null===(S=R.web)||void 0===S?void 0:S.url)}catch(e){}return n},ye=function(e,n){var t,i,o,r,l,a,u,s,c,v,m,f,p,w=(null==e?void 0:e.contentType)||"video",I=null==e||null===(t=e[w])||void 0===t?void 0:t.drmEnabled,g=null==e||null===(i=e[w])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[w])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,T=(null==e||null===(a=e[w])||void 0===a||null===(u=a.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[w])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[w])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return be(E);if(I){var y=Fe(g,n);return y.src=ge(y.src,n,e),y}if("Safari"!==d()&&h){var _=_e(g);return _.src=ge(_.src,n,e),_}if(T){var b=be(g);return b.src=ge(b.src,n,e),b}if(null!=g&&g.mpeg){var F=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(g);return F.src=ge(F.src,n,e),F}return null},_e=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},be=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=e.fairPlayCmaf||e.fairPlay,o=e.widevine,l=e.playReady,a=d();if(r(n),"Safari"===a){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(o,function(e,n,i){console.log(e),e&&t(e),t(null,new Uint8Array(i))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,o,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};i.xhr(l,function(e,n,t){console.log(e),e&&r(e),r(null,t)})}}}}}(t);return De(n),u}var s,c={src:o.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(De(n),c.keySystems={"com.widevine.alpha":{url:o.licenseUrl,licenseHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:o.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var De=function(e){var n=r(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==d()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Oe=function(e,n){var t=e.src,i=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:i};n=n.replace(/\/$/,"");var o=t.split(".com")[1]||"";return{src:o?"".concat(n).concat(o):t,type:i}},Le=function(e,n){if(import("./error-2395864b.js").then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),o.appendChild(r),i.append(o)}}},Re=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Se=!1,Pe=function(e,n,t){var i=ge(n,e,t),o=r(e);if(n&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,n){var t,i,o,l=r(e);if(null!==l.el_){Se=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),Se&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,i)}};function Ve(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}var We=function(e){i(e).play()},Ce=function(e){i(e).pause()},Ae=function(e,n){var t=i(e),o=t.currentTime()+n;t.currentTime(o)},Ne=function(e,n){var t=i(e),o=t.currentTime(),r=o<=n?0:o-n;t.currentTime(r)},je=function(e){return!!i.getPlayer("".concat(e))},Be=function(e){return i(e).paused()},xe=function(){var e=n(t.mark(function e(n,i){var o,l,a,d=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=d.length>2&&void 0!==d[2]&&d[2],e.next=3,U();case 3:return l=e.sent,a=r(n),e.abrupt("return",new Promise(function(e,t){y(i,l).then(function(t){var r=null==t?void 0:t.data;window.sid=ie(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var l=ye(r,n);H(r),l&&o?(Ge(n,l),a.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:r})})):e({status:!0,msg:"Feed authenticated",response:r})}).catch(function(e){t({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Ue=function(){var e=n(t.mark(function e(n,i){var o,l,a,d,u,s,m=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(d=m.length>2&&void 0!==m[2]?m[2]:null){e.next=5;break}return e.next=4,U();case 4:d=e.sent;case 5:return(Y()||null)&&Q(i),u=0,s=0,null!==(o=window)&&void 0!==o&&o.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&F(i,d).then(function(e){var n,t,i,o,r,l;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),u=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,s=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null}).catch(function(e){var n,t,i,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))}),e.abrupt("return",new Promise(function(e,t){h(i,d).then(function(i){var o,l,a=null==i?void 0:i.data,d=(null==a||null===(o=a.video)||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;H(i.data);var m=he(a);m&&Pe(n,m,a);var f=ye(a,n);if(f){var p,w,I,g,E,T,h,y,_,b,F,D,O,L,R=(null==a||null===(p=a.video)||void 0===p||null===(w=p.gist)||void 0===w?void 0:w.videoImageUrl)||(null==a||null===(I=a.video)||void 0===I||null===(g=I.gist)||void 0===g||null===(E=g.imageGist)||void 0===E?void 0:E.r16x9),S=r(n);if(S.poster(R),Ge(n,f),S.on("loadstart",function(){d&&e({status:!0,msg:"Video Loaded",response:a})}),S.on("loadeddata",function(){Re(),e({status:!0,msg:"Video Loaded",response:a})}),S.one("play",function(){u&&s<95&&setTimeout(function(){S.currentTime(u)},0)}),S.one("error",function(){var e;t({status:!1,msg:(null==S||null===(e=S.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==a||null===(T=a.video)||void 0===T||null===(h=T.contentDetails)||void 0===h||null===(y=h.closedCaptions)||void 0===y?void 0:y.length)>0||(null==a||null===(_=a.video)||void 0===_||null===(b=_.closedCaptions)||void 0===b?void 0:b.length)>0)F=((null==a||null===(D=a.video)||void 0===D||null===(O=D.contentDetails)||void 0===O?void 0:O.closedCaptions)||(null==a||null===(L=a.video)||void 0===L?void 0:L.closedCaptions)).filter(function(e){return"VTT"===e.format}),c(n,F);else v(n)}else Le(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){ze(e,n,t,i)})}));case 11:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Me=function(e,n,t){var i=r(e);return i.src(n),new Promise(function(e,n){var o=0;i.one("loadedmetadata",function(){clearTimeout(o),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){o=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},ke=function(e){var n=r(e);if(He(),l(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},He=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()},Ge=function(e,n){var t=r(e);t&&t.src(n)},ze=function(n,t,i,o){var r,l,a,d,u,s,c=null==n||null===(r=n.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==n||null===(a=n.response)||void 0===a||null===(d=a.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);je(t)&&Le(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),i&&i(function(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Ve(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}({status:!1,response:n,msg:"".concat(v)},o&&{videoId:o}))},Ye=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var i=n.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=n.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")};export{_ as A,se as B,Z as C,z as D,Me as E,We as F,Ce as G,Be as H,je as I,Ue as J,xe as K,ke as L,L as M,O as N,M as O,P,R as Q,f as R,X as S,q as T,D as U,K as V,Q as W,ve as a,Y as b,ce as c,G as d,ye as e,H as f,oe as g,Re as h,Le as i,J as j,Ae as k,Ge as l,ge as m,he as n,Ye as o,ue as p,Pe as q,Ne as r,b as s,Oe as t,k as u,h as v,F as w,ze as x,U as y,y as z};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import{g as t,t as n}from"./skin-86e7e2b5.js";import{S as r,b as i,d as o}from"./generic-c2920429.js";import{s as a}from"./autoNextVideo-89bf12ac.js";import l from"@babel/runtime/helpers/typeof";import u from"video.js";import s from"@babel/runtime/helpers/asyncToGenerator";import c from"@babel/runtime/regenerator";import d from"@babel/runtime/helpers/defineProperty";import p from"@babel/runtime/helpers/slicedToArray";var m,v,f,g,h=[],b=function(n,o){var a;if(null!=o&&null!==(a=o.series)&&void 0!==a&&a.enable){var l;h=[];var u=i();null==u||u.map(function(t){var n;return(n=h).push.apply(n,e(t.episodes))}),null==o||null===(l=o.series)||void 0===l||l.cb}else{var s,c;h=(null==o||null===(s=o.relatedVideos)||void 0===s?void 0:s.content)||[],null==o||null===(c=o.relatedVideos)||void 0===c||c.cb}var d=t(n);d.on("timeupdate",function(){var e,t,n=Math.floor(d.currentTime()),i=d.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-n<=10&&r()<=(null===(t=h)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")});var p,m=h.filter(function(e,t){return t==r()});if((null==m?void 0:m.length)>0)if(null!==(p=document.getElementsByClassName("next-ep-preview"))&&void 0!==p&&p[0]){var v,f,g,b,x,w,A,E,N,k,j,C;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var T=null===(f=document.getElementsByClassName("next-ep-title"))||void 0===f?void 0:f[0],I=null===(g=document.getElementsByClassName("next-ep-img"))||void 0===g?void 0:g[0],O=null===(b=document.getElementsByClassName("next-ep-content"))||void 0===b?void 0:b[0],L=null===(x=m[0])||void 0===x?void 0:x.title;(null===(w=L)||void 0===w?void 0:w.length)>60&&(L=L.substr(0,60)+"..."),T.textContent="".concat(L),I.src=(null===(A=m[0])||void 0===A||null===(E=A.gist)||void 0===E||null===(N=E.imageGist)||void 0===N?void 0:N.r16x9)||(null==m||null===(k=m[0])||void 0===k?void 0:k.img)||(null===(j=window)||void 0===j||null===(C=j.customData)||void 0===C?void 0:C.fallbackImage),O.onclick=function(){return y(n)}}else{var B,S,M,P,R,D,$,X,_=document.createElement("div");_.className="next-ep-preview",_.style.visibility="hidden",document.getElementById(n).append(_);var F=document.createElement("div");F.className="next-ep-header",F.textContent="Next up";var U=null===(B=m[0])||void 0===B?void 0:B.title,W=document.createElement("img");W.className="next-ep-img",W.src=(null===(S=m[0])||void 0===S||null===(M=S.gist)||void 0===M||null===(P=M.imageGist)||void 0===P?void 0:P.r16x9)||(null==m||null===(R=m[0])||void 0===R?void 0:R.img)||(null===(D=window)||void 0===D||null===($=D.customData)||void 0===$?void 0:$.fallbackImage);var q=document.createElement("div");q.className="next-ep-title",(null===(X=U)||void 0===X?void 0:X.length)>60&&(U=U.substr(0,60)+"..."),q.textContent="".concat(U);var G=document.createElement("div");G.className="next-ep-content",G.append(W),G.append(q),G.onclick=function(){return y(n)},_.append(F),_.append(G)}},y=function(e,n){var i=t(e),o=Math.floor(i.currentTime());if(Math.floor(i.duration())!=o){i.pause(e);var l=r();a(l,e,h)}};function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach(function(t){d(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}m={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},v=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===l(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},f=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},g=function e(t){return"HTML"!==t.nodeName&&"static"===f(t)("position")?e(t.offsetParent):t},u.registerPlugin("thumbnails",function(e){var t,n,r,i,o,a,l,u,s,c;if(i=v({},m,e),a=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=a.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(r=document.createElement("div")).className="vjs-thumbnail-holder",o=document.createElement("img"),r.appendChild(o),o.src=i[0].src,o.className="vjs-thumbnail",v(o.style,i[0].style),o.style.left||o.style.right||(o.onload=function(){o.style.left=-o.naturalWidth/2+"px"}),u=a.duration(),a.on("durationchange",function(e){u=a.duration()}),a.on("loadedmetadata",function(e){u=a.duration()}),(l=a.controlBar.progressControl).el().appendChild(r),s=function(e){var t,n,a,s,c,d,p,m,h,b;for(n in a=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((b=g(l.el()).getBoundingClientRect()).width||b.right)+h,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=g(l.el()).getBoundingClientRect().left+h,t=Math.floor((s-l.el().offsetLeft)/l.width()*u),i)t>n&&(a=Math.max(a,n));(c=i[a]).src&&o.src!=c.src&&(o.src=c.src),c.style&&o.style!=c.style&&v(o.style,c.style),s+(m=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=f(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(o,c.width||i[0].width)/2)>p?s-=s+m-p:s<m&&(s=m),r.style.left=s+"px"},null!==(t=window)&&void 0!==t&&null!==(n=t.customData)&&void 0!==n&&n.isSmartTV){var d=function(){var e,t,n=0,u=(null===(e=l.el_.children[0].children[2])||void 0===e?void 0:e.offsetWidth)||5;u<65?u=5:u>=a.el().offsetWidth-180?u=a.el().offsetWidth-240:u-=58;var s=a.currentTime();for(t in i)s>t&&(n=Math.max(n,t));var c=i[n];c.uri&&""!=c.uri&&o.src!=c.uri?(o.src=c.uri,r.style.left=u+"px",o.style.opacity="1"):(r.style.left="-1000px",o.style.opacity="0")},p=null;l.el_.children[0].onfocus=function(){d(),p=setInterval(function(){d()},250)},l.el_.children[0].addEventListener("blur",function(){try{r.style.left="-1000px",o.style.opacity="0",p&&(clearInterval(p),p=null)}catch(e){}})}else l.on("mousemove",s),l.on("touchmove",s);function h(){document.removeEventListener("pointermove",s),document.removeEventListener("pointerup",h),c()}l.on("pointerdown",function(e){document.addEventListener("pointermove",s),document.addEventListener("pointerup",h)}),c=function(e){r.style.left="-1000px"},l.on("mouseout",c),l.on("touchcancel",c),l.on("touchend",c),a.on("userinactive",c)});var A="my-player";function E(e){var t=e.split("\n"),n=[];return t.forEach(function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach(function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))}),n.push(r)}}),n}function N(){return(N=s(c.mark(function e(t){var n,r,i,o,a,l,u,s,d,m,v,f,g,h,b,y,x,w,A,E,N,k,j,C;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return r=e.sent,e.next=11,createImageBitmap(r);case 11:for(i=e.sent,o=t.layout.split("x").map(Number),a=p(o,2),l=a[0],u=a[1],s=i.width/u,d=i.height/l,m=[],v=0;v<l;v++)for(f=0;f<u;f++)(g=document.createElement("canvas")).width=s,g.height=d,g.getContext("2d").drawImage(i,f*s,v*d,s,d,0,0,s,d),h=g.toDataURL("image/png"),m.push({uri:h,duration:t.duration}),t._tiles=m;return e.abrupt("return",m);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=p(b,2),x=y[0],w=y[1],A=[],E=0;E<x*w;E++)A.push({uri:null===(N=window)||void 0===N||null===(k=N.app_data)||void 0===k||null===(j=k.appcmsMain)||void 0===j||null===(C=j.images)||void 0===C?void 0:C.placeholderCover,duration:t.duration});return e.abrupt("return",A);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function k(e,t){return j.apply(this,arguments)}function j(){return(j=s(c.mark(function e(t,n){var r,i;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return A=n,e.prev=1,e.next=4,fetch(t);case 4:return r=e.sent,e.next=7,r.text();case 7:return i=e.sent,e.abrupt("return",E(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function C(e,n,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),o=t(A);if(i&&o){var a=i.getBoundingClientRect(),l=(e.clientX-a.left)/a.width,u=function(e,t){var n,r;if(!t||0===t.length)return null;var i=0,o=t.length-1;for(;i<=o;){var a=Math.floor((i+o)/2),l=t[a];if(l===e)return l;l<e?i=a+1:o=a-1}var u=null!==(n=t[i])&&void 0!==n?n:1/0,s=null!==(r=t[o])&&void 0!==r?r:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(l*o.duration()),r),s=n[u];s&&!s.loading&&(s.loading=!0,function(e){return N.apply(this,arguments)}(s).then(function(e){var t=e[s.tileIndex],n=document.querySelector(".vjs-thumbnail-holder img");n&&t.uri&&(n.src=t.uri),s.loading=!1,s.src=t.uri}))}}function T(e){return I.apply(this,arguments)}function I(){return(I=s(c.mark(function e(t){var r,i,o,a;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r={},t.forEach(function(e,t){for(var n=e.layout.split("x").map(Number),i=p(n,2),o=i[0]*i[1],a=e.duration,l=0;l<o;l++){var u,s=Math.round((t*o+l)*a);r[s]=w(w({},e),{},{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},d(u,"left","-60px"),d(u,"border","1px solid transparent"),d(u,"borderRadius","4px"),u)})}}),i=Object.keys(r).map(Number).sort(function(e,t){return e-t}),null==(o=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||o.addEventListener("mousemove",n(function(e){return C(e,r,i)},500)),null==(a=document.querySelector(".vjs-progress-control.vjs-control"))||a.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",n(function(e){return C(e,r,i)},500))}),e.abrupt("return",r);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var O=function(){var e=s(c.mark(function e(t,n){var r,i,o,a,l,u,s,d;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:i=e.sent,o=i.split("\n").map(function(e){return e.trim()}),a=[],l=null,u=0;case 10:if(!(u<(null==o?void 0:o.length))){e.next=27;break}if(!(s=o[u]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},d=s.split(":")[1]||"",d.split(",").forEach(function(e){var t=e.split("="),n=p(t,2),r=n[0],i=n[1];r&&i&&(l[r.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!s.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(s.includes("jpg")||s.includes("png")||s.includes("jpeg"))&&(l.uri=s.includes("http")?s:t+s,a.push(l),l=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();function L(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function B(e,t){return S.apply(this,arguments)}function S(){return(S=s(c.mark(function e(n,r){var i,a,l,u,s,d,m,v,f,g,h,b,y,x,w,E,N,k,j,C,T,I,O,B,S,R,D,$,X,_,F,U,W,q,G,V,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,oe,ae,le,ue,se,ce,de,pe,me,ve;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return A=r,i=t(r),a=n.split("/"),l=a.findIndex(function(e){return"dash"===e.toLowerCase()}),u=L(-1!==l?a.slice(0,l+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return v=e.sent,e.next=11,v.text();case 11:f=e.sent,g=new DOMParser,h=g.parseFromString(f,"application/xml"),b=(null==i?void 0:i.duration())||(null===(s=o())||void 0===s||null===(d=s.video)||void 0===d?void 0:d.runtime),y=(null==h||null===(m=h.querySelector("MPD > BaseURL"))||void 0===m?void 0:m.textContent)||u+"/",x=h.getElementsByTagName("AdaptationSet"),w=0;case 18:if(!(w<x.length)){e.next=72;break}if(("image"!==(E=x[w]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){e.next=69;break}if(k=E.getElementsByTagName("SegmentTemplate")[0],j=null===(N=k.getElementsByTagName("SegmentTimeline"))||void 0===N?void 0:N[0],!k||!j){e.next=48;break}if(I=j.getElementsByTagName("S"),O=parseInt(null===(C=I[0])||void 0===C?void 0:C.getAttribute("t")),B=parseInt(null===(T=I[0])||void 0===T?void 0:T.getAttribute("d")),S=E.getElementsByTagName("Representation")[0],R=S.getElementsByTagName("EssentialProperty")[0],D=R.getAttribute("value"),$=null==D?void 0:D.split("x"),X=p($,2),_=X[0],F=X[1],!k){e.next=46;break}if(k.getAttribute("media"),U=k.getAttribute("timescale"),W=(U?B/U:B)/(_*F),q=S.getAttribute("id"),G=Math.round(b/W),V=Math.ceil(G/(_*F)),z=k.getAttribute("media"),parseInt(k.getAttribute("startNumber")),!isNaN(parseInt(V))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],w=0;w<V;w++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:W,layout:D,uri:Y+Q.replace("$Time$",O+w*B).replace("$RepresentationID$",q)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=p(ee,2),ne=te[0],re=te[1],!k){e.next=69;break}if(k.getAttribute("media"),ie=k.getAttribute("duration"),oe=k.getAttribute("timescale"),ae=(oe?ie/oe:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(b/ae),se=Math.ceil(ue/(ne*re)),ce=k.getAttribute("media"),de=parseInt(k.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],me=M(ce),w=0;w<se;w++)ve=me?P(me,w+de):ce,pe.push({duration:ae,layout:Z,uri:y+ve.replace("$Number$",w+de).replace("$RepresentationID$",le)});return e.abrupt("return",pe);case 69:w++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}},e,null,[[5,76]])}))).apply(this,arguments)}function M(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function P(e,t){var n=e.match(/%0(\d+)d/);if(!n)return e;var r=parseInt(n[1],10),i=String(t).padStart(r,"0");return e.replace(/\$Number%0\d+d\$/,i)}function R(e){return D.apply(this,arguments)}function D(){return(D=s(c.mark(function e(n){var r,i,o,a,l,u,s,d,p,m,v,f,g,h,b,y;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),s=u.currentSource(),d=s.src,d=null!==(r=d)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(o=i.player)||void 0===o?void 0:o.getSource():d,null===(a=d)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,k(d,n);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return m=(null==p?void 0:p[0])||null,v=m.uri,f=d.substring(0,d.lastIndexOf("/"))+"/",e.next=12,O(f,v);case 12:return g=e.sent,e.next=15,T(g);case 15:h=e.sent,u.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(l=d)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,B(d,n);case 22:if(!((null==(b=e.sent)?void 0:b.length)>0)){e.next=28;break}return e.next=26,T(b);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}function $(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",o.append(a),r.el().appendChild(o),r.on("useractive",function(){o.classList.remove("vjs-fade")}),r.on("userinactive",function(){r.paused()||o.classList.add("vjs-fade")}),r.on("fullscreenchange",function(){r.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"})}}export{b as a,$ as b,R as i};
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import{g as t,t as n}from"./skin-86e7e2b5.js";import{S as r,b as i,d as o}from"./generic-d036e0c3.js";import{s as a}from"./autoNextVideo-57e39c2b.js";import l from"@babel/runtime/helpers/typeof";import u from"video.js";import s from"@babel/runtime/helpers/asyncToGenerator";import c from"@babel/runtime/regenerator";import d from"@babel/runtime/helpers/defineProperty";import p from"@babel/runtime/helpers/slicedToArray";var m,v,f,g,h=[],b=function(n,o){var a;if(null!=o&&null!==(a=o.series)&&void 0!==a&&a.enable){var l;h=[];var u=i();null==u||u.map(function(t){var n;return(n=h).push.apply(n,e(t.episodes))}),null==o||null===(l=o.series)||void 0===l||l.cb}else{var s,c;h=(null==o||null===(s=o.relatedVideos)||void 0===s?void 0:s.content)||[],null==o||null===(c=o.relatedVideos)||void 0===c||c.cb}var d=t(n);d.on("timeupdate",function(){var e,t,n=Math.floor(d.currentTime()),i=d.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-n<=10&&r()<=(null===(t=h)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")});var p,m=h.filter(function(e,t){return t==r()});if((null==m?void 0:m.length)>0)if(null!==(p=document.getElementsByClassName("next-ep-preview"))&&void 0!==p&&p[0]){var v,f,g,b,x,w,A,E,N,k,j,C;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var T=null===(f=document.getElementsByClassName("next-ep-title"))||void 0===f?void 0:f[0],I=null===(g=document.getElementsByClassName("next-ep-img"))||void 0===g?void 0:g[0],O=null===(b=document.getElementsByClassName("next-ep-content"))||void 0===b?void 0:b[0],L=null===(x=m[0])||void 0===x?void 0:x.title;(null===(w=L)||void 0===w?void 0:w.length)>60&&(L=L.substr(0,60)+"..."),T.textContent="".concat(L),I.src=(null===(A=m[0])||void 0===A||null===(E=A.gist)||void 0===E||null===(N=E.imageGist)||void 0===N?void 0:N.r16x9)||(null==m||null===(k=m[0])||void 0===k?void 0:k.img)||(null===(j=window)||void 0===j||null===(C=j.customData)||void 0===C?void 0:C.fallbackImage),O.onclick=function(){return y(n)}}else{var B,S,M,P,R,D,$,X,_=document.createElement("div");_.className="next-ep-preview",_.style.visibility="hidden",document.getElementById(n).append(_);var F=document.createElement("div");F.className="next-ep-header",F.textContent="Next up";var U=null===(B=m[0])||void 0===B?void 0:B.title,W=document.createElement("img");W.className="next-ep-img",W.src=(null===(S=m[0])||void 0===S||null===(M=S.gist)||void 0===M||null===(P=M.imageGist)||void 0===P?void 0:P.r16x9)||(null==m||null===(R=m[0])||void 0===R?void 0:R.img)||(null===(D=window)||void 0===D||null===($=D.customData)||void 0===$?void 0:$.fallbackImage);var q=document.createElement("div");q.className="next-ep-title",(null===(X=U)||void 0===X?void 0:X.length)>60&&(U=U.substr(0,60)+"..."),q.textContent="".concat(U);var G=document.createElement("div");G.className="next-ep-content",G.append(W),G.append(q),G.onclick=function(){return y(n)},_.append(F),_.append(G)}},y=function(e,n){var i=t(e),o=Math.floor(i.currentTime());if(Math.floor(i.duration())!=o){i.pause(e);var l=r();a(l,e,h)}};function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach(function(t){d(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}m={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},v=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===l(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},f=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},g=function e(t){return"HTML"!==t.nodeName&&"static"===f(t)("position")?e(t.offsetParent):t},u.registerPlugin("thumbnails",function(e){var t,n,r,i,o,a,l,u,s,c;if(i=v({},m,e),a=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=a.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(r=document.createElement("div")).className="vjs-thumbnail-holder",o=document.createElement("img"),r.appendChild(o),o.src=i[0].src,o.className="vjs-thumbnail",v(o.style,i[0].style),o.style.left||o.style.right||(o.onload=function(){o.style.left=-o.naturalWidth/2+"px"}),u=a.duration(),a.on("durationchange",function(e){u=a.duration()}),a.on("loadedmetadata",function(e){u=a.duration()}),(l=a.controlBar.progressControl).el().appendChild(r),s=function(e){var t,n,a,s,c,d,p,m,h,b;for(n in a=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((b=g(l.el()).getBoundingClientRect()).width||b.right)+h,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=g(l.el()).getBoundingClientRect().left+h,t=Math.floor((s-l.el().offsetLeft)/l.width()*u),i)t>n&&(a=Math.max(a,n));(c=i[a]).src&&o.src!=c.src&&(o.src=c.src),c.style&&o.style!=c.style&&v(o.style,c.style),s+(m=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=f(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(o,c.width||i[0].width)/2)>p?s-=s+m-p:s<m&&(s=m),r.style.left=s+"px"},null!==(t=window)&&void 0!==t&&null!==(n=t.customData)&&void 0!==n&&n.isSmartTV){var d=function(){var e,t,n=0,u=(null===(e=l.el_.children[0].children[2])||void 0===e?void 0:e.offsetWidth)||5;u<65?u=5:u>=a.el().offsetWidth-180?u=a.el().offsetWidth-240:u-=58;var s=a.currentTime();for(t in i)s>t&&(n=Math.max(n,t));var c=i[n];c.uri&&""!=c.uri&&o.src!=c.uri?(o.src=c.uri,r.style.left=u+"px",o.style.opacity="1"):(r.style.left="-1000px",o.style.opacity="0")},p=null;l.el_.children[0].onfocus=function(){d(),p=setInterval(function(){d()},250)},l.el_.children[0].addEventListener("blur",function(){try{r.style.left="-1000px",o.style.opacity="0",p&&(clearInterval(p),p=null)}catch(e){}})}else l.on("mousemove",s),l.on("touchmove",s);function h(){document.removeEventListener("pointermove",s),document.removeEventListener("pointerup",h),c()}l.on("pointerdown",function(e){document.addEventListener("pointermove",s),document.addEventListener("pointerup",h)}),c=function(e){r.style.left="-1000px"},l.on("mouseout",c),l.on("touchcancel",c),l.on("touchend",c),a.on("userinactive",c)});var A="my-player";function E(e){var t=e.split("\n"),n=[];return t.forEach(function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach(function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))}),n.push(r)}}),n}function N(){return(N=s(c.mark(function e(t){var n,r,i,o,a,l,u,s,d,m,v,f,g,h,b,y,x,w,A,E,N,k,j,C;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return r=e.sent,e.next=11,createImageBitmap(r);case 11:for(i=e.sent,o=t.layout.split("x").map(Number),a=p(o,2),l=a[0],u=a[1],s=i.width/u,d=i.height/l,m=[],v=0;v<l;v++)for(f=0;f<u;f++)(g=document.createElement("canvas")).width=s,g.height=d,g.getContext("2d").drawImage(i,f*s,v*d,s,d,0,0,s,d),h=g.toDataURL("image/png"),m.push({uri:h,duration:t.duration}),t._tiles=m;return e.abrupt("return",m);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=p(b,2),x=y[0],w=y[1],A=[],E=0;E<x*w;E++)A.push({uri:null===(N=window)||void 0===N||null===(k=N.app_data)||void 0===k||null===(j=k.appcmsMain)||void 0===j||null===(C=j.images)||void 0===C?void 0:C.placeholderCover,duration:t.duration});return e.abrupt("return",A);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function k(e,t){return j.apply(this,arguments)}function j(){return(j=s(c.mark(function e(t,n){var r,i;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return A=n,e.prev=1,e.next=4,fetch(t);case 4:return r=e.sent,e.next=7,r.text();case 7:return i=e.sent,e.abrupt("return",E(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function C(e,n,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),o=t(A);if(i&&o){var a=i.getBoundingClientRect(),l=(e.clientX-a.left)/a.width,u=function(e,t){var n,r;if(!t||0===t.length)return null;var i=0,o=t.length-1;for(;i<=o;){var a=Math.floor((i+o)/2),l=t[a];if(l===e)return l;l<e?i=a+1:o=a-1}var u=null!==(n=t[i])&&void 0!==n?n:1/0,s=null!==(r=t[o])&&void 0!==r?r:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(l*o.duration()),r),s=n[u];s&&!s.loading&&(s.loading=!0,function(e){return N.apply(this,arguments)}(s).then(function(e){var t=e[s.tileIndex],n=document.querySelector(".vjs-thumbnail-holder img");n&&t.uri&&(n.src=t.uri),s.loading=!1,s.src=t.uri}))}}function T(e){return I.apply(this,arguments)}function I(){return(I=s(c.mark(function e(t){var r,i,o,a;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r={},t.forEach(function(e,t){for(var n=e.layout.split("x").map(Number),i=p(n,2),o=i[0]*i[1],a=e.duration,l=0;l<o;l++){var u,s=Math.round((t*o+l)*a);r[s]=w(w({},e),{},{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},d(u,"left","-60px"),d(u,"border","1px solid transparent"),d(u,"borderRadius","4px"),u)})}}),i=Object.keys(r).map(Number).sort(function(e,t){return e-t}),null==(o=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||o.addEventListener("mousemove",n(function(e){return C(e,r,i)},500)),null==(a=document.querySelector(".vjs-progress-control.vjs-control"))||a.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",n(function(e){return C(e,r,i)},500))}),e.abrupt("return",r);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var O=function(){var e=s(c.mark(function e(t,n){var r,i,o,a,l,u,s,d;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:i=e.sent,o=i.split("\n").map(function(e){return e.trim()}),a=[],l=null,u=0;case 10:if(!(u<(null==o?void 0:o.length))){e.next=27;break}if(!(s=o[u]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},d=s.split(":")[1]||"",d.split(",").forEach(function(e){var t=e.split("="),n=p(t,2),r=n[0],i=n[1];r&&i&&(l[r.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!s.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(s.includes("jpg")||s.includes("png")||s.includes("jpeg"))&&(l.uri=s.includes("http")?s:t+s,a.push(l),l=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();function L(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function B(e,t){return S.apply(this,arguments)}function S(){return(S=s(c.mark(function e(n,r){var i,a,l,u,s,d,m,v,f,g,h,b,y,x,w,E,N,k,j,C,T,I,O,B,S,R,D,$,X,_,F,U,W,q,G,V,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,oe,ae,le,ue,se,ce,de,pe,me,ve;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return A=r,i=t(r),a=n.split("/"),l=a.findIndex(function(e){return"dash"===e.toLowerCase()}),u=L(-1!==l?a.slice(0,l+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return v=e.sent,e.next=11,v.text();case 11:f=e.sent,g=new DOMParser,h=g.parseFromString(f,"application/xml"),b=(null==i?void 0:i.duration())||(null===(s=o())||void 0===s||null===(d=s.video)||void 0===d?void 0:d.runtime),y=(null==h||null===(m=h.querySelector("MPD > BaseURL"))||void 0===m?void 0:m.textContent)||u+"/",x=h.getElementsByTagName("AdaptationSet"),w=0;case 18:if(!(w<x.length)){e.next=72;break}if(("image"!==(E=x[w]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){e.next=69;break}if(k=E.getElementsByTagName("SegmentTemplate")[0],j=null===(N=k.getElementsByTagName("SegmentTimeline"))||void 0===N?void 0:N[0],!k||!j){e.next=48;break}if(I=j.getElementsByTagName("S"),O=parseInt(null===(C=I[0])||void 0===C?void 0:C.getAttribute("t")),B=parseInt(null===(T=I[0])||void 0===T?void 0:T.getAttribute("d")),S=E.getElementsByTagName("Representation")[0],R=S.getElementsByTagName("EssentialProperty")[0],D=R.getAttribute("value"),$=null==D?void 0:D.split("x"),X=p($,2),_=X[0],F=X[1],!k){e.next=46;break}if(k.getAttribute("media"),U=k.getAttribute("timescale"),W=(U?B/U:B)/(_*F),q=S.getAttribute("id"),G=Math.round(b/W),V=Math.ceil(G/(_*F)),z=k.getAttribute("media"),parseInt(k.getAttribute("startNumber")),!isNaN(parseInt(V))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],w=0;w<V;w++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:W,layout:D,uri:Y+Q.replace("$Time$",O+w*B).replace("$RepresentationID$",q)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=p(ee,2),ne=te[0],re=te[1],!k){e.next=69;break}if(k.getAttribute("media"),ie=k.getAttribute("duration"),oe=k.getAttribute("timescale"),ae=(oe?ie/oe:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(b/ae),se=Math.ceil(ue/(ne*re)),ce=k.getAttribute("media"),de=parseInt(k.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],me=M(ce),w=0;w<se;w++)ve=me?P(me,w+de):ce,pe.push({duration:ae,layout:Z,uri:y+ve.replace("$Number$",w+de).replace("$RepresentationID$",le)});return e.abrupt("return",pe);case 69:w++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}},e,null,[[5,76]])}))).apply(this,arguments)}function M(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function P(e,t){var n=e.match(/%0(\d+)d/);if(!n)return e;var r=parseInt(n[1],10),i=String(t).padStart(r,"0");return e.replace(/\$Number%0\d+d\$/,i)}function R(e){return D.apply(this,arguments)}function D(){return(D=s(c.mark(function e(n){var r,i,o,a,l,u,s,d,p,m,v,f,g,h,b,y;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),s=u.currentSource(),d=s.src,d=null!==(r=d)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(o=i.player)||void 0===o?void 0:o.getSource():d,null===(a=d)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,k(d,n);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return m=(null==p?void 0:p[0])||null,v=m.uri,f=d.substring(0,d.lastIndexOf("/"))+"/",e.next=12,O(f,v);case 12:return g=e.sent,e.next=15,T(g);case 15:h=e.sent,u.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(l=d)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,B(d,n);case 22:if(!((null==(b=e.sent)?void 0:b.length)>0)){e.next=28;break}return e.next=26,T(b);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}function $(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",o.append(a),r.el().appendChild(o),r.on("useractive",function(){o.classList.remove("vjs-fade")}),r.on("userinactive",function(){r.paused()||o.classList.add("vjs-fade")}),r.on("fullscreenchange",function(){r.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"})}}export{b as a,$ as b,R as i};