bitmovin-player 8.263.0 → 8.264.0

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 (99) hide show
  1. package/bitmovinplayer-serviceworker.js +2 -2
  2. package/bitmovinplayer-serviceworker.prod.js +2 -2
  3. package/bitmovinplayer-ui.css +1 -1
  4. package/bitmovinplayer-ui.js +2 -2
  5. package/bitmovinplayer.js +2 -2
  6. package/bitmovinplayer.prod.js +2 -2
  7. package/modules/bitmovinplayer-abr.js +2 -2
  8. package/modules/bitmovinplayer-abr.prod.js +2 -2
  9. package/modules/bitmovinplayer-advertising-bitmovin.js +2 -2
  10. package/modules/bitmovinplayer-advertising-bitmovin.prod.js +2 -2
  11. package/modules/bitmovinplayer-advertising-core.js +2 -2
  12. package/modules/bitmovinplayer-advertising-core.prod.js +2 -2
  13. package/modules/bitmovinplayer-advertising-ima.js +2 -2
  14. package/modules/bitmovinplayer-advertising-ima.prod.js +2 -2
  15. package/modules/bitmovinplayer-advertising-omsdk.js +2 -2
  16. package/modules/bitmovinplayer-advertising-omsdk.prod.js +2 -2
  17. package/modules/bitmovinplayer-analytics.js +1 -1
  18. package/modules/bitmovinplayer-analytics.prod.js +1 -1
  19. package/modules/bitmovinplayer-container-mp4.js +2 -2
  20. package/modules/bitmovinplayer-container-mp4.prod.js +2 -2
  21. package/modules/bitmovinplayer-container-ts.js +2 -2
  22. package/modules/bitmovinplayer-container-ts.prod.js +2 -2
  23. package/modules/bitmovinplayer-container-webm.js +2 -2
  24. package/modules/bitmovinplayer-container-webm.prod.js +2 -2
  25. package/modules/bitmovinplayer-core.js +2 -2
  26. package/modules/bitmovinplayer-core.prod.js +2 -2
  27. package/modules/bitmovinplayer-crypto.js +1 -1
  28. package/modules/bitmovinplayer-crypto.prod.js +1 -1
  29. package/modules/bitmovinplayer-dash.js +1 -1
  30. package/modules/bitmovinplayer-dash.prod.js +1 -1
  31. package/modules/bitmovinplayer-drm.js +2 -2
  32. package/modules/bitmovinplayer-drm.prod.js +2 -2
  33. package/modules/bitmovinplayer-engine-bitmovin.js +2 -2
  34. package/modules/bitmovinplayer-engine-bitmovin.prod.js +2 -2
  35. package/modules/bitmovinplayer-engine-native.js +2 -2
  36. package/modules/bitmovinplayer-engine-native.prod.js +2 -2
  37. package/modules/bitmovinplayer-engine-webrtc.js +2 -2
  38. package/modules/bitmovinplayer-engine-webrtc.prod.js +2 -2
  39. package/modules/bitmovinplayer-envivio.js +1 -1
  40. package/modules/bitmovinplayer-envivio.prod.js +1 -1
  41. package/modules/bitmovinplayer-hls.js +2 -2
  42. package/modules/bitmovinplayer-hls.prod.js +2 -2
  43. package/modules/bitmovinplayer-lowlatency.js +2 -2
  44. package/modules/bitmovinplayer-lowlatency.prod.js +2 -2
  45. package/modules/bitmovinplayer-mserenderer.js +2 -2
  46. package/modules/bitmovinplayer-mserenderer.prod.js +2 -2
  47. package/modules/bitmovinplayer-patch.js +1 -1
  48. package/modules/bitmovinplayer-patch.prod.js +1 -1
  49. package/modules/bitmovinplayer-playstation4.js +2 -2
  50. package/modules/bitmovinplayer-playstation4.prod.js +2 -2
  51. package/modules/bitmovinplayer-playstation5.js +2 -2
  52. package/modules/bitmovinplayer-playstation5.prod.js +2 -2
  53. package/modules/bitmovinplayer-polyfill.js +1 -1
  54. package/modules/bitmovinplayer-polyfill.prod.js +1 -1
  55. package/modules/bitmovinplayer-reactnative.js +1 -1
  56. package/modules/bitmovinplayer-reactnative.prod.js +1 -1
  57. package/modules/bitmovinplayer-remotecontrol.js +2 -2
  58. package/modules/bitmovinplayer-remotecontrol.prod.js +2 -2
  59. package/modules/bitmovinplayer-serviceworker-client.js +2 -2
  60. package/modules/bitmovinplayer-serviceworker-client.prod.js +2 -2
  61. package/modules/bitmovinplayer-serviceworker.js +2 -2
  62. package/modules/bitmovinplayer-serviceworker.prod.js +2 -2
  63. package/modules/bitmovinplayer-sgai.js +2 -2
  64. package/modules/bitmovinplayer-sgai.prod.js +2 -2
  65. package/modules/bitmovinplayer-smooth.js +2 -2
  66. package/modules/bitmovinplayer-smooth.prod.js +2 -2
  67. package/modules/bitmovinplayer-style.js +2 -2
  68. package/modules/bitmovinplayer-style.prod.js +2 -2
  69. package/modules/bitmovinplayer-subtitles-cea608.js +2 -2
  70. package/modules/bitmovinplayer-subtitles-cea608.prod.js +2 -2
  71. package/modules/bitmovinplayer-subtitles-native.js +2 -2
  72. package/modules/bitmovinplayer-subtitles-native.prod.js +2 -2
  73. package/modules/bitmovinplayer-subtitles-ttml.js +1 -1
  74. package/modules/bitmovinplayer-subtitles-ttml.prod.js +2 -2
  75. package/modules/bitmovinplayer-subtitles-vtt.js +2 -2
  76. package/modules/bitmovinplayer-subtitles-vtt.prod.js +1 -1
  77. package/modules/bitmovinplayer-subtitles.js +2 -2
  78. package/modules/bitmovinplayer-subtitles.prod.js +2 -2
  79. package/modules/bitmovinplayer-thumbnail-imp.js +2 -2
  80. package/modules/bitmovinplayer-thumbnail-imp.prod.js +2 -2
  81. package/modules/bitmovinplayer-thumbnail.js +2 -2
  82. package/modules/bitmovinplayer-thumbnail.prod.js +2 -2
  83. package/modules/bitmovinplayer-tizen.js +2 -2
  84. package/modules/bitmovinplayer-tizen.prod.js +2 -2
  85. package/modules/bitmovinplayer-ui.js +2 -2
  86. package/modules/bitmovinplayer-ui.prod.js +1 -1
  87. package/modules/bitmovinplayer-vidaa.js +2 -2
  88. package/modules/bitmovinplayer-vidaa.prod.js +2 -2
  89. package/modules/bitmovinplayer-vr.js +2 -2
  90. package/modules/bitmovinplayer-vr.prod.js +2 -2
  91. package/modules/bitmovinplayer-webos.js +2 -2
  92. package/modules/bitmovinplayer-webos.prod.js +2 -2
  93. package/modules/bitmovinplayer-wpe.js +2 -2
  94. package/modules/bitmovinplayer-wpe.prod.js +1 -1
  95. package/modules/bitmovinplayer-xml.js +1 -1
  96. package/modules/bitmovinplayer-xml.prod.js +1 -1
  97. package/package.json +1 -1
  98. package/types/advertising/API.d.ts +1 -1
  99. package/types/core/PlayerAPI.d.ts +1 -1
@@ -9,10 +9,10 @@
9
9
  * This software includes open-source components. See THIRD_PARTY_NOTICES
10
10
  * in the distribution for details.
11
11
  *
12
- * Bitmovin Player Version 8.263.0
12
+ * Bitmovin Player Version 8.264.0
13
13
  *
14
14
  ****************************************************************************/
15
15
 
16
16
  (function() {
17
- "use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.abr=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player.abr=e())}(self,(function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[744],{98154:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.AdaptationApiFactory=void 0;var r=i(23068),o=function(){function t(){}return t.create=function(t){return{setConfig:function(e){"Updating adaptation config with ".concat(JSON.stringify(e)),(0,r.isNumber)(e.qualityStabilityBalance)&&function(e){if(e<0||e>1)"Failed to set qualityStabilityBalance to ".concat(e,", valid range is 0 to 1");else{var i=t.getConfig(!0).adaptation;i&&(i.qualityStabilityBalance=e,"Updated qualityStabilityBalance to ".concat(e))}}(e.qualityStabilityBalance),e.resolution&&function(e){var i=e.maxSelectableVideoHeight,n=e.maxSelectableVideoWidth,r=e.minSelectableVideoHeight,o=e.minSelectableVideoWidth,s=t.getConfig(!0).adaptation.resolution;a(i)&&(s.maxSelectableVideoHeight=i),a(n)&&(s.maxSelectableVideoWidth=n),a(r)&&(s.minSelectableVideoHeight=r),a(o)&&(s.minSelectableVideoWidth=o),"Updated resolution boundaries to ".concat(JSON.stringify(s))}(e.resolution),(0,r.isBoolean)(e.limitToPlayerSize)&&function(e){var i=t.getConfig(!0).adaptation;i&&(i.limitToPlayerSize=e,"Updated limitToPlayerSize to ".concat(e))}(e.limitToPlayerSize)},getConfig:function(){var e=t.getConfig(!0).adaptation,i=e.qualityStabilityBalance,r=e.resolution,o=e.limitToPlayerSize;return{qualityStabilityBalance:i,resolution:n({},r),limitToPlayerSize:o}}}},t}();function a(t){return(0,r.isNumber)(t)&&t>=0}e.AdaptationApiFactory=o},89498:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.AdaptationHandler=void 0;var r=i(80813),o=i(98714),a=i(49859),s=i(91678),u=i(33436),l=i(86897),h=i(93204),p=i(79721),d=i(85434),c=i(70850),f=i(46057),v=i(47151),g=i(79505),y=i(49024),b=i(19119),m=i(43008),R=i(59113),S=i(7676),_=1/0,T=function(){function t(t,e,i){var n,r,o=this;this.context=t,this.mimeType=e,this.constraints=i,this.tL=!1,this.vL=function(t){var e;return void 0===t&&(t=null===(e=o.rL)||void 0===e?void 0:e.getState()),t?(0,a.getPreferredBitrate)((0,a.getAdaptationState)(t),o.mimeType):null},this.kL=(0,y.createAdaptationLogic)(this.context,this.mimeType,{minBitrate:this.constraints.minBitrate,maxBitrate:this.constraints.maxBitrate},null===(r=null===(n=this.context.config)||void 0===n?void 0:n.adaptation)||void 0===r?void 0:r.logic),this.oL=this.LL(this.pL),this.CL()}return Object.defineProperty(t.prototype,"rL",{get:function(){var t=this.context.sourceContext.sourceIdentifier;return this.context.serviceManager.get(r.ServiceName.SourceStoreService,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uL",{get:function(){var t=this.context.sourceContext.sourceIdentifier;return this.context.serviceManager.get(r.ServiceName.ManifestService,t)},enumerable:!1,configurable:!0}),t.prototype.wL=function(t,e,i){var n,r;return t?this.oL:e&&null!==(r=null===(n=this.kL.findRepresentationForBitrate(e,i))||void 0===n?void 0:n._internalId)&&void 0!==r?r:null},t.prototype.xL=function(t,e){var i,n=this.yL(),r=this.vL();return n||r?this.wL(n,r,e):null!==(i=this.kL.selectRepresentationID(t,e))&&void 0!==i?i:null},t.prototype.yL=function(){return!this.isAuto()&&Boolean(this.DL(this.oL,this.AL()))},t.prototype.zL=function(t){this.lL=t},t.prototype.AL=function(){var t,e,i;return null!==(i=null===(e=null===(t=this.uL)||void 0===t?void 0:t.getAdaptationSet(this.pL))||void 0===e?void 0:e.Representation)&&void 0!==i?i:[]},t.prototype.selectRepresentationID=function(t,e){void 0===t&&(t={});var i=this.EL(null!=e?e:this.AL()),n=this.xL(t,i);return n&&this.zL(n),this.lL},t.prototype.BL=function(){var t=this,e=Boolean(this.nL);this.rL&&!e&&(this.nL=(0,h.subscribe)(this.rL)(l.getBufferStateMap,(function(e){var i,n,r=null==e?void 0:e[t.mimeType];if(r){var a=r.rendererRanges;a&&a.length>0&&(null===(i=t.rL)||void 0===i||i.dispatch((0,o.clearPreferredBitrateForMimeTypeAction)(t.mimeType)),null===(n=t.nL)||void 0===n||n.call(t),t.nL=void 0)}})))},t.prototype.CL=function(){var t=this;this.rL&&(this.vL()&&this.BL(),this.mL=(0,h.subscribe)(this.rL)(this.vL,(function(){return t.BL()}),(function(t){return Boolean(t)})))},t.prototype.DL=function(t,e){var i;return e?e.find((function(e){return e._internalId.equals(t)})):null===(i=this.uL)||void 0===i?void 0:i.getRepresentationById(t)},t.prototype.EL=function(t){this.IL();var e=t.map((function(t){return{representation:t,bitrate:t._bandwidth,width:t._width,height:t._height}}));return this.FL(e).map((function(t){return t.representation}))},t.prototype.FL=function(t){var e=this,i=this.context.config.adaptation.resolution,n=i.minSelectableVideoHeight,r=i.maxSelectableVideoHeight,o=i.minSelectableVideoWidth,a=i.maxSelectableVideoWidth,s=t.filter((function(t){return!((0,m.hasBitrate)(t)&&!w(t.bitrate,e.constraints.minBitrate,e.constraints.maxBitrate))&&(!(0,m.hasResolution)(t)||w(t.width,o,a)&&w(t.height,n,r))}));if(s.length>0)return s;var u=this.GL(t);return u?[u]:t},t.prototype.GL=function(t){var e=0!==this.constraints.minBitrate,i=this.constraints.maxBitrate!==_,n=t.filter(m.hasBitrate);return e?(0,S.findMaximum)(n,(function(t){return t.bitrate})):i?(0,S.findMinimum)(n,(function(t){return t.bitrate})):d.MimeTypeHelper.isVideo(this.mimeType)?this.HL(t):void 0},t.prototype.HL=function(t){var e=this.context.config.adaptation.resolution,i=e.minSelectableVideoHeight,n=e.maxSelectableVideoHeight,r=e.minSelectableVideoWidth,o=e.maxSelectableVideoWidth,a=t.filter(m.hasResolution);return 0!==i?(0,S.findMaximum)(a,(function(t){return t.height})):n!==1/0?(0,S.findMinimum)(a,(function(t){return t.height})):0!==r?(0,S.findMaximum)(a,(function(t){return t.width})):o!==1/0?(0,S.findMinimum)(a,(function(t){return t.width})):void 0},t.prototype.IL=function(){d.MimeTypeHelper.isVideo(this.mimeType)&&(this.context.config.adaptation.limitToPlayerSize&&!this.tL?this.KL():!this.context.config.adaptation.limitToPlayerSize&&this.tL&&this.JL())},t.prototype.JL=function(){this.tL=!1,this.context.config.adaptation.onVideoAdaptation=this.sL},t.prototype.KL=function(){var t=this;this.tL=!0;var e=this.context.config.adaptation.onVideoAdaptation;this.sL=e,this.context.config.adaptation.onVideoAdaptation=e&&"function"==typeof e?function(i){var n,r,o;return i.suggested=(0,b.AdaptToPlayerResolution)(t.context.internalPlayer,i.suggested,null!==(r=null===(n=t.qL)||void 0===n?void 0:n.isFullscreen())&&void 0!==r&&r)||i.suggested,null!==(o=(0,c.safeUserCallback)((function(){return e(i)}),t.context.logger))&&void 0!==o?o:i.suggested}:function(e){var i,n;return(0,b.AdaptToPlayerResolution)(t.context.internalPlayer,e.suggested,null!==(n=null===(i=t.qL)||void 0===i?void 0:i.isFullscreen())&&void 0!==n&&n)||e.suggested}},t.prototype.LL=function(t){return t?new g.RepresentationId(t,"auto"):new g.RepresentationId(new v.AdaptationSetId(p.DEFAULT_PERIOD_ID,this.mimeType),"auto")},t.prototype.ML=function(t){var e,i={id:t._id,bitrate:t._bandwidth,width:t._width,height:t._height};null===(e=this.context.store)||void 0===e||e.dispatch((0,s.addMetricsValue)(this.mimeType,u.MetricType.DownloadedAdaptationSet,i))},t.prototype.NL=function(){var t,e,i=this;if(this.uL){var r=this.uL.getAdaptationSet(this.pL);if(r){var o=n(n({},r),{Representation:this.EL(r.Representation),_minBandwidth:Math.max(null!==(t=r._minBandwidth)&&void 0!==t?t:0,this.constraints.minBitrate),_maxBandwidth:Math.min(null!==(e=r._maxBandwidth)&&void 0!==e?e:_,this.constraints.maxBitrate)});this.kL.setAdaptationSet(o),(0,f.yieldToMain)().then((function(){return i.ML(o)}))}}},t.prototype.OL=function(t){return this.pL&&t&&this.uL?this.uL.getRepresentation(this.pL,t):null},t.prototype.PL=function(){if(this.oL){var t=this.oL.representationId;this.oL=this.LL(this.pL);var e=this.OL(t);e&&(this.oL=e._internalId)}else this.oL=this.LL(this.pL)},t.prototype.setAdaptationSetId=function(t){this.pL=t,this.PL(),this.NL()},t.prototype.setFixedRepresentation=function(t){var e;if("auto"===t)this.oL=new g.RepresentationId(this.pL,"auto");else if(this.pL){var i=null===(e=this.uL)||void 0===e?void 0:e.getRepresentation(this.pL,t);i&&(this.oL=i._internalId,this.selectRepresentationID())}},t.prototype.getFixedRepresentation=function(){return this.lL},t.prototype.getLowestRepresentationId=function(){var t;return this.isAuto()?null===(t=this.kL.getLowestRepresentation())||void 0===t?void 0:t._internalId.representationId:this.oL.representationId},t.prototype.isAuto=function(){return"auto"===this.oL.representationId},t.prototype.shouldDownloadBeCancelled=function(t,e){var i,n,r,o,a,s,u,l=null!==(n=null===(i=this.context.config.adaptation)||void 0===i?void 0:i.disableDownloadCancelling)&&void 0!==n&&n,h=null!==(a=null===(o=null===(r=this.uL)||void 0===r?void 0:r.getAdaptationSet(this.pL))||void 0===o?void 0:o.Representation)&&void 0!==a?a:[],p=1===h.length,d=h.some((function(t){return Boolean(t._bandwidth)}));if(!this.isAuto()||l||p||!d)return!1;var c=function(t){if(!(0,S.hasTotalBytes)(t))return 1/0;var e=function(t){var e,i=null!==(e=t.elapsedTime)&&void 0!==e?e:0;return t.loadedBytes>0&&i>0?8*t.loadedBytes/1024/i:0}(t);return e>0?8*t.totalBytes/1024/e:1/0}(t),f=(null!==(u=null===(s=t.responseTiming)||void 0===s?void 0:s.doneTimestamp)&&void 0!==u?u:0)>0,v=!!t.segmentDuration&&c>1.5*t.segmentDuration;return!(f||!v)&&!function(t){return!!(0,S.hasTotalBytes)(t)&&t.loadedBytes>=.9*t.totalBytes}(t)&&this.kL.shouldDownloadBeCancelled(t,e)},t.prototype.setStartupPhase=function(){this.kL.setStartupPhase()},t.prototype.addSample=function(t){this.kL.addSample(n({timestamp:Date.now()},t))},t.prototype.shutdown=function(){this.kL.shutdown()},t.prototype.dispose=function(){var t,e;this.shutdown(),this.kL.dispose(),null===(t=this.mL)||void 0===t||t.call(this),null===(e=this.nL)||void 0===e||e.call(this)},t.prototype.selectQualityBasedOnBitrateMeasurement=function(t){var e=this.FL(t),i=this.vL();if(i)return(0,R.findQualityForBitrate)(i,e);if(this.yL()){var n=this.EL(this.AL()),r=this.DL(this.lL,n);if(r)return(0,R.findQualityForBitrate)(r._bandwidth,e)}return(0,R.findQualityForBitrate)(this.kL.getCurrentBitrateMeasurement(),e)},t}();function w(t,e,i){return t>=e&&t<=i}e.AdaptationHandler=T},49024:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.createAdaptationLogic=function(t,e,i,l){var h=i.minBitrate,p=i.maxBitrate;return void 0===l&&(l=n.AdaptationLogicType.DOWNLOAD_PREDICTION),l===n.AdaptationLogicType.LOW_LATENCY?new s.LowLatencyAbr(t,e):l===n.AdaptationLogicType.WISH?new u.WishLogic(t,e):l===n.AdaptationLogicType.DOWNLOAD_PREDICTION?new a.DownloadPredictionLogic(t,e):l===n.AdaptationLogicType.BUFFER_FILL_RATE?new r.BufferFillRateLogic(t,e):new o.BufferLogic(t,e,h||0,p||1/0)};var n=i(21281),r=i(48968),o=i(39201),a=i(85696),s=i(24296),u=i(7290)},49541:function(t,e,i){e.X=void 0;var n=i(85434),r=i(89498),o=i(83429),a=function(){function t(t){this.context=t,this.el=new Map}return t.prototype.fl=function(t){if(t){if(!this.el.has(t)){var e=function(t,e){var i={minBitrate:0,maxBitrate:1/0};return n.MimeTypeHelper.isVideo(t)?(i.minBitrate=Number(e.MIN_SELECTABLE_VIDEO_BITRATE)||i.minBitrate,i.maxBitrate=Number(e.MAX_SELECTABLE_VIDEO_BITRATE)||i.maxBitrate):n.MimeTypeHelper.isAudio(t)&&(i.minBitrate=Number(e.MIN_SELECTABLE_AUDIO_BITRATE)||i.minBitrate,i.maxBitrate=Number(e.MAX_SELECTABLE_AUDIO_BITRATE)||i.maxBitrate),i}(t,this.context.settings);this.el.set(t,new r.AdaptationHandler(this.context,t,e))}return this.el.get(t)}},t.prototype.selectRepresentation=function(t,e,i){var n,r;return void 0===e&&(e={}),null!==(r=null===(n=this.fl(t))||void 0===n?void 0:n.selectRepresentationID(e,i))&&void 0!==r?r:void 0},t.prototype.isAuto=function(t){var e,i;return null===(i=null===(e=this.fl(t))||void 0===e?void 0:e.isAuto())||void 0===i||i},t.prototype.shouldDownloadBeCancelled=function(t,e,i){var n,r;return null!==(r=null===(n=this.fl(t))||void 0===n?void 0:n.shouldDownloadBeCancelled(e,i))&&void 0!==r&&r},t.prototype.selectQualityBasedOnBitrateMeasurement=function(t,e){var i=e?this.el.get(e):this.qm(),r=null;i||(r=null!=e?e:n.MimeType.VideoMp4,i=this.fl(r));var o=null==i?void 0:i.selectQualityBasedOnBitrateMeasurement(t);return r&&this.release(r),null!=o?o:t[0]},t.prototype.qm=function(){var t=void 0;return this.el.forEach((function(e,i){t&&!n.MimeTypeHelper.isVideo(i)||(t=e)})),t},t.prototype.setAdaptationSetId=function(t,e){var i;null===(i=this.fl(t))||void 0===i||i.setAdaptationSetId(e)},t.prototype.setFixedRepresentation=function(t,e){var i;null===(i=this.fl(t))||void 0===i||i.setFixedRepresentation(e)},t.prototype.getCurrentRepresentationId=function(t){var e,i;return null!==(i=null===(e=this.fl(t))||void 0===e?void 0:e.getFixedRepresentation())&&void 0!==i?i:null},t.prototype.getLowestRepresentationId=function(t){var e;return null===(e=this.fl(t))||void 0===e?void 0:e.getLowestRepresentationId()},t.prototype.setStartupPhase=function(t){var e;null===(e=this.fl(t))||void 0===e||e.setStartupPhase()},t.prototype.shutdown=function(t){var e;null===(e=this.fl(t))||void 0===e||e.shutdown()},t.prototype.addSample=function(t,e){var i;null===(i=this.fl(t))||void 0===i||i.addSample(e)},t.prototype.getUserSelectedRepresentation=function(t,e,i){return(0,o.getUserSelectedRepresentation)(this.context,t,e,i)},t.prototype.release=function(t){var e;null===(e=this.el.get(t))||void 0===e||e.dispose(),this.el.delete(t)},t.prototype.dispose=function(){this.el.forEach((function(t){return t.dispose()})),this.el.clear()},t}();e.X=a},81723:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.BaseAdaptationLogic=void 0;var r=i(46151),o=i(15971),a=i(85434),s=i(89927),u=i(88844),l=i(59113),h=i(59406),p=i(70238),d=i(7676),c=function(){function t(t,e){this.context=t,this.mimeType=e,this.lastRateMeasurement=0,this.availableRepresentations=[],this.startupPhase=!0,this.lastDownloadCancelled=!1,this.monitoringMimeType=this.getMonitoringMimeType()}return t.prototype.getMonitoringMimeType=function(){var t,e=null,i=null===(t=this.context.store)||void 0===t?void 0:t.getState();return i&&(e=Object.keys((0,r.getMetricsState)(i)).find(a.MimeTypeHelper.isVideo)),null!=e?e:this.mimeType},t.prototype.updateAvailableRepresentations=function(t){t&&(this.availableRepresentations=t.map((function(t,e){return n(n({},t),{arrayIndex:e})})))},t.prototype.getAvailableRepresentations=function(){var t,e=this;return this.lastDownloadCancelled&&(null===(t=this.lastRepresentation)||void 0===t?void 0:t._bandwidth)?this.availableRepresentations.filter((function(t){var i=t._bandwidth;return e.lastRepresentation&&i<e.lastRepresentation._bandwidth})):this.availableRepresentations},t.prototype.setAdaptationSet=function(t){var e,i,n;if(this.updateAvailableRepresentations(t.Representation),this.lastRepresentation)this.lastRepresentation=this.findRepresentationForBitrate(this.lastRepresentation._bandwidth,t.Representation);else{var r=null===(n=null===(i=null===(e=(0,o.getSourceState)(this.context))||void 0===e?void 0:e.activeTracks)||void 0===i?void 0:i[t._internalId.adaptationSetId])||void 0===n?void 0:n.selectedRepresentationId;this.lastRepresentation=r?this.availableRepresentations.find((function(t){return t._internalId.equals(r)})):void 0}},t.prototype.findRepresentationForBitrate=function(t,e){var i,n;return this.updateAvailableRepresentations(e),null!==(n=null===(i=(0,l.findQualityForBitrate)(t,this.getAvailableRepresentations().map((function(t){return{rep:t,bitrate:Number(t._bandwidth)}}))))||void 0===i?void 0:i.rep)&&void 0!==n?n:this.getLowestRepresentation()},t.prototype.checkStartupPhase=function(t){this.startupPhase&&this.bgb(t)},t.prototype.getLowestRepresentation=function(){return(0,d.getLowestRepresentation)(this.availableRepresentations)},t.prototype.bgb=function(t){var e=this,i=this.context.bufferSettings.getForwardTargetLevel();this.startupPhaseTimerID||(this.startupPhaseTimerID=window.setTimeout((function(){e.startupPhase=!1,e.startupPhaseTimerID=void 0}),(0,s.toMilliSeconds)(i))),t.value>=.5*i&&((0,u.clearTimeoutIfDefined)(this.startupPhaseTimerID),this.startupPhase=!1,this.startupPhaseTimerID=void 0)},t.prototype.getRepresentationForNormalChange=function(t,e,i){return this.startupPhase||!i?this.getRepresentationForRateMeasurement(p.SwitchingAggressiveness.Mid):this.getRepresentationToSwitchTo(e.result,t.result)},t.prototype.getCurrentBitrate=function(t){return this.lastDownloadCancelled?this.lastRateMeasurement:t.value},t.prototype.getRepresentationToSwitchTo=function(t,e){if(this.lastDownloadCancelled)return this.switchDown(p.SwitchingAggressiveness.VeryHigh);switch(t){case h.Rules.SHOULD_SWITCH_UP:return this.ifFillStateHigh(e);case h.Rules.SHOULD_STAY:return this.ifFillStateMid(e);case h.Rules.SHOULD_SWITCH_DOWN:return this.ifFillStateLow(e);default:return this.useLastRepresentation()}},t.prototype.switchUp=function(t){var e;if(void 0===t&&(t=p.SwitchingAggressiveness.Conservative),void 0!==(null===(e=this.lastRepresentation)||void 0===e?void 0:e.arrayIndex)&&this.lastRepresentation.arrayIndex>=this.availableRepresentations.length-1)return this.lastRepresentation;var i=this.getRepresentationForRateMeasurement(t);return this.lastRepresentation&&Number(i._bandwidth)<=Number(this.lastRepresentation._bandwidth)?this.lastRepresentation:i},t.prototype.switchDown=function(t){var e,i,n,r;if(void 0===t&&(t=p.SwitchingAggressiveness.VeryHigh),void 0!==(null===(e=this.lastRepresentation)||void 0===e?void 0:e.arrayIndex)&&(null===(i=this.lastRepresentation)||void 0===i?void 0:i.arrayIndex)<1&&null!==(null===(n=this.lastRepresentation)||void 0===n?void 0:n._id))return this.lastRepresentation;var o=this.getRepresentationForRateMeasurement(t);return this.lastRepresentation&&(!o||o._bandwidth>=(null===(r=this.lastRepresentation)||void 0===r?void 0:r._bandwidth))&&(o=this.getOneRepresentationLower()),o},t.prototype.stay=function(){var t;return null!==(t=this.lastRepresentation)&&void 0!==t?t:this.getLowestRepresentation()},t.prototype.ifFillStateHigh=function(t){switch(t){case h.Rules.SHOULD_SWITCH_UP:return this.switchUp(p.SwitchingAggressiveness.VeryHigh);case h.Rules.SHOULD_STAY:return this.switchUp(p.SwitchingAggressiveness.High);case h.Rules.SHOULD_SWITCH_DOWN:default:return this.stay()}},t.prototype.ifFillStateMid=function(t){switch(t){case h.Rules.SHOULD_SWITCH_UP:return this.switchUp(p.SwitchingAggressiveness.Mid);case h.Rules.SHOULD_STAY:return this.stay();case h.Rules.SHOULD_SWITCH_DOWN:return this.switchDown(p.SwitchingAggressiveness.High);default:return this.stay()}},t.prototype.ifFillStateLow=function(t){switch(t){case h.Rules.SHOULD_SWITCH_UP:return this.stay();case h.Rules.SHOULD_STAY:return this.switchDown(p.SwitchingAggressiveness.High);case h.Rules.SHOULD_SWITCH_DOWN:return this.switchDown(p.SwitchingAggressiveness.VeryHigh);default:return this.stay()}},t.prototype.useLastRepresentation=function(){var t;return(null===(t=this.lastRepresentation)||void 0===t?void 0:t._id)?this.lastRepresentation:this.getLowestRepresentation()},t.prototype.getOneRepresentationLower=function(){var t,e,i=Math.max(0,(null!==(e=null===(t=this.lastRepresentation)||void 0===t?void 0:t.arrayIndex)&&void 0!==e?e:0)-1);return this.availableRepresentations[i]},t}();e.BaseAdaptationLogic=c},48968:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.BufferFillRateLogic=void 0;var r=i(46151),o=i(33436),a=i(88844),s=i(81723),u=i(4865),l=i(20066),h=i(64463),p=i(70238),d=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.ffb=0,n.shouldDownloadBeCancelled=function(t,e){var i,r;return 0!==(null===(i=n.lastRepresentation)||void 0===i?void 0:i.arrayIndex)&&n.kfb()._id!==(null===(r=n.lastRepresentation)||void 0===r?void 0:r._id)&&(n.lastDownloadCancelled=!0,!0)},n.efb={bufferFillRate:new l.BufferFillRateRule(n.context,n.monitoringMimeType),bufferFillState:(0,h.BufferFillStateRule)(n.context,n.monitoringMimeType),rateMeasurement:new u.BlockBasedRateMeasurementRule(n.context,n.monitoringMimeType)},n}return n(e,t),e.prototype.getRepresentationForRateMeasurement=function(t){void 0===t&&(t=p.SwitchingAggressiveness.Mid);var e=this.efb.rateMeasurement.getStatus(t),i=this.context.settings.RATE_SAFETY_MARGIN_PERCENTAGE/100,n=e.value*(1-i);return this.findRepresentationForBitrate(n)},e.prototype.addSample=function(t){Object.values(this.efb).forEach((function(e){return e.addSample(t)}))},e.prototype.gfb=function(t){return this.switchDown(p.SwitchingAggressiveness.VeryHigh)},e.calcEstimatedDownloadDuration=function(t,e,i,n){var r=parseFloat((i*t/e).toFixed(2));return n&&(r*=2),1.1*r},e.prototype.hfb=function(t,i,n,r,o){var a=e.calcEstimatedDownloadDuration(n,t,i,o);return a<r||a<=n},e.prototype.ifb=function(t,e,i,n){var r,o,a,s=null==t?void 0:t.hlsDependentSegments;if(s&&null!==(null===(r=this.lastRepresentation)||void 0===r?void 0:r._id)&&(null===(o=this.lastRepresentation)||void 0===o?void 0:o.arrayIndex)!==e.arrayIndex){var u=Math.min.apply(null,this.availableRepresentations.map((function(t){return Number(t._bandwidth)}))),l=Number(e._bandwidth);if(!(isFinite(l)&&l===u||this.hfb(i,e._bandwidth,t.segmentDuration,n,s))){for(var h=!1,p=null!==(a=e.arrayIndex)&&void 0!==a?a:-1;p>=0;p--){var d=this.availableRepresentations[p];if(this.hfb(i,d._bandwidth,t.segmentDuration,n,s)){e=d,h=!0;break}}h||(e=this.useLastRepresentation())}}return e},e.prototype.jfb=function(t){var e,i=this.lastRateMeasurement>0&&2*t<=this.lastRateMeasurement;return i&&(null===(e=this.lastRepresentation)||void 0===e?void 0:e._id)?1.5*t<this.lastRepresentation._bandwidth:i},e.prototype.kfb=function(t){var e,i,n=this.context.store.getState();n&&(i=(0,r.getMetricsState)(n));var a,s=this.efb.bufferFillState.getStatus(),u=this.efb.bufferFillRate.getStatus(),l=this.efb.rateMeasurement.getStatus(1).value,h=null!=i&&this.context.bufferSettings.getForwardTargetLevel()>i.default.bufferLogicActivationThreshold,d=this.jfb(l);this.checkStartupPhase(s),a=d?this.gfb(l):this.getRepresentationForNormalChange(u,s,h);var c=(0,r.getMetricsLastEntry)(null!=i?i:{},this.mimeType,o.MetricType.StalledSeconds).value;return c>this.ffb?(this.ffb=c,this.switchDown(p.SwitchingAggressiveness.MidHigh)):(a=this.ifb(t,a,l,s.value),this.lastRateMeasurement=l,this.lastDownloadCancelled&&void 0!==a.arrayIndex&&void 0!==(null===(e=this.lastRepresentation)||void 0===e?void 0:e.arrayIndex)&&a.arrayIndex>=this.lastRepresentation.arrayIndex&&(a=this.getOneRepresentationLower(),this.lastDownloadCancelled=!1),a)},e.prototype.selectRepresentationID=function(t,e){return this.updateAvailableRepresentations(e),this.lastRepresentation=this.kfb(t),this.lastRepresentation._internalId},e.prototype.setAdaptationSet=function(e){var i;t.prototype.setAdaptationSet.call(this,e),null!==(i=this.lastRepresentation)&&void 0!==i||(this.lastRepresentation={_id:null,_bandwidth:0,arrayIndex:-1})},e.prototype.getCurrentBitrateMeasurement=function(){return this.getCurrentBitrate(this.efb.rateMeasurement.getStatus())},e.prototype.getAvailableRepresentations=function(){return this.availableRepresentations},e.prototype.setStartupPhase=function(){this.startupPhase=!0,(0,a.clearTimeoutIfDefined)(this.startupPhaseTimerID),this.startupPhaseTimerID=void 0,Object.values(this.efb).forEach((function(t){return t.setStartupPhase()}))},e.prototype.shutdown=function(){(0,a.clearTimeoutIfDefined)(this.startupPhaseTimerID),this.startupPhaseTimerID=void 0,this.lastDownloadCancelled=!1,Object.values(this.efb).forEach((function(t){return t.shutdown()}))},e.prototype.dispose=function(){this.shutdown(),Object.values(this.efb).forEach((function(t){return t.dispose()})),this.efb={},this.lastRepresentation=void 0,this.availableRepresentations=[]},e}(s.BaseAdaptationLogic);e.BufferFillRateLogic=d},39201:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.BufferLogic=void 0;var n=i(85434),r=i(96533),o=i(7676),a=function(){function t(t,e,i,r){this.context=t,this.mimeType=e,this.minSelectableBitrate=i,this.maxSelectableBitrate=r,this.pfb=[],this.lfb=n.MimeTypeHelper.getMediaType(this.mimeType),this.ofb={timestamp:Date.now(),bufferLevel:0,bufferTargetLevel:0}}return t.prototype.qfb=function(t){t&&(this.pfb=t)},t.prototype.rfb=function(){return(0,r.findLowestPossibleBandwidthFromRepresentations)(this.pfb,this.minSelectableBitrate)},t.prototype.sfb=function(){var t;return null===(t=this.findRepresentationForBitrate(this.maxSelectableBitrate))||void 0===t?void 0:t._bandwidth},t.prototype.tfb=function(){return this.context.bufferSettings.getForwardTargetLevel(this.lfb)},t.prototype.ufb=function(){var t=this.rfb(),e=this.sfb();return this.nfb=this.tfb(),function(t,e,i){var n=[];0===e&&(e=t);var r=2*Math.floor(.1*i),o=8*Math.floor(.1*i);o<=r&&(o=Math.floor(.9*i)),r<=1&&(r=1);for(var a=(e-t)/(o-r),s=t-a*r,u=0;u<r;u++)n[u]=t;for(u=r;u<o;u++)n[u]=Math.floor(a*u+s);for(u=o;u<=i;u++)n[u]=e;return n}(t,e||t,this.nfb)},t.prototype.vfb=function(){var t=this.tfb();this.nfb!==t&&(this.mfb=this.ufb())},t.prototype.findRepresentationForBitrate=function(t,e){return this.qfb(e),(0,r.getMatchingRepresentationByBandwidth)(this.pfb,t)},t.prototype.wfb=function(){var t,e=this.tfb(),i=this.ofb.bufferLevel;return(i=Math.floor(i))>e&&(i=e),t=this.mfb.hasOwnProperty(i)?this.mfb[i]:this.mfb[0],this.findRepresentationForBitrate(t)},t.prototype.selectRepresentationID=function(t,e){this.qfb(e);var i=this.wfb();return this.vfb(),i._internalId},t.prototype.setAdaptationSet=function(t){this.qfb(t.Representation),this.mfb=this.ufb()},t.prototype.shouldDownloadBeCancelled=function(){return!1},t.prototype.setStartupPhase=function(){},t.prototype.shutdown=function(){},t.prototype.addSample=function(t){this.ofb=t},t.prototype.dispose=function(){this.mfb=[]},t.prototype.getCurrentBitrateMeasurement=function(){return 0},t.prototype.getLowestRepresentation=function(){return(0,o.getLowestRepresentation)(this.pfb)},t}();e.BufferLogic=a},11958:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.CancellableAdaptationLogic=void 0;var r=i(80813),o=i(4131),a=i(21281),s=i(46151),u=i(33436),l=i(81199),h=i(81723),p=i(39185),d=i(45199),c=i(17006),f=i(70238),v=i(7676),g=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.shouldDownloadBeCancelled=function(t,e){var i,r,a=null!==(i=t.elapsedTime)&&void 0!==i?i:-1,s=null===(r=n.Ghb)||void 0===r?void 0:r.isPaused(),u=n.isStartupBitrateInEffect(),l=function(t){var e,i=null!==(e=t.elapsedTime)&&void 0!==e?e:-1;return i<0?0:i-y(t)}(t),h=n.Hhb(e),p=(0,o.hasLoadedData)(t),d=p?l>n.context.settings.MIN_EFFECTIVE_SEGMENT_DOWNLOAD_TIME:a>n.context.settings.MIN_EFFECTIVE_SEGMENT_DOWNLOAD_TIME;return!(s||u||h||!d)&&n.Uhb(t,l,p,a)},n.timeToFirstByteMeasurementRule=new d.TimeToFirstByteMeasurementRule(n.context,n.monitoringMimeType),n.rateMeasurementRule=new p.SegmentBasedRateMeasurementRule(n.context,n.monitoringMimeType),n}return n(e,t),Object.defineProperty(e.prototype,"Fhb",{get:function(){return this.context.serviceManager.get(r.ServiceName.ManifestService,this.context.sourceContext.sourceIdentifier)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Ghb",{get:function(){return this.context.serviceManager.get(r.ServiceName.PlayerStateService)},enumerable:!1,configurable:!0}),e.prototype.setAdaptationSet=function(e){t.prototype.setAdaptationSet.call(this,e),this.previousRequestProgress=void 0},e.prototype.isStartupBitrateInEffect=function(){var t,e=this.context.store.getState(),i=e?(0,s.getMetricsHistoryFromInstanceState)(e,this.mimeType,u.MetricType.DownloadInformation):[],n=Boolean(null===(t=this.context.config.adaptation)||void 0===t?void 0:t.startupBitrate),r=i.filter((function(t){return Boolean(t.value)})).length>0;return n&&!r},e.prototype.Hhb=function(t){return!!t&&this.getLowestRepresentation()._internalId.equals(t)},e.prototype.Ihb=function(){return(0,l.getPlayableBufferLevel)(this.context.internalPlayer)},e.prototype.estimateTimeToFirstByte=function(t){var e;switch(void 0===t&&(t=0),e=0!==t?this.timeToFirstByteMeasurementRule.estimateStatus(t,5,.2).value:this.timeToFirstByteMeasurementRule.getStatus(5,.2).value,function(t){var e,i;return null!==(i=null===(e=t.adaptation)||void 0===e?void 0:e.rttEstimationMethod)&&void 0!==i?i:a.RttEstimationMethod.WeightedAverage}(this.context.config)){case a.RttEstimationMethod.Median:return e.median;case a.RttEstimationMethod.WeightedAverage:default:return e.standardDeviation>e.mean?e.mean+e.standardDeviation:e.weightedAverage}},e.prototype.Jhb=function(t,e,i,n,r,o){var a,l,h,p,d,f,v,g=n*e/i+r,y=null!==(l=null===(a=this.Fhb)||void 0===a?void 0:a.isManifestFetchRequired(t))&&void 0!==l&&l,m=!this.Lhb(t),R=null!==(h=null==o?void 0:o.hlsDependentSegments)&&void 0!==h&&h,S=null!==(d=null===(p=this.Fhb)||void 0===p?void 0:p.getRepresentationById(t))&&void 0!==d?d:null,_=Boolean(this.lastRepresentation)&&null!==(null===(f=this.lastRepresentation)||void 0===f?void 0:f._id)&&(null===(v=this.lastRepresentation)||void 0===v?void 0:v.arrayIndex)!==(null==S?void 0:S.arrayIndex),T=this.context.store.getState(),w=g;if(w+=function(t,e,i){var n=t?(0,s.getMetricsState)(t):{};return b((0,s.getMetricsHistory)(n,e,u.MetricType.DecryptionTime),i)+b((0,s.getMetricsHistory)(n,e,u.MetricType.TransmuxingTime),i)}(T,this.mimeType,t),R&&_&&(w*=2),m&&(w+=r),y){var M=function(t){var e=t?(0,s.getMetricsState)(t):{};return function(t){var e=(0,s.getMetricsHistory)(t,"default",u.MetricType.DownloadInformation).slice(-3).map((function(t){return t.value.time}));return(0,c.calculateExponentialWeightedAverage)(e,.8)}(e)+function(t){var e=(0,s.getMetricsHistory)(t,"default",u.MetricType.ProcessingTime).slice(-3).map((function(t){return t.value}));return(0,c.calculateExponentialWeightedAverage)(e,.8)}(e)}(T);w+=Math.max(M,r)}return w},e.prototype.Khb=function(t,e,i,n){var r=1-this.context.settings.DOWNLOAD_DURATION_SAFETY_MARGIN,o=(n?this.context.settings.MAXIMUM_DOWNLOAD_DURATION_MULTIPLIER_SAME_QUALITY:this.context.settings.MAXIMUM_DOWNLOAD_DURATION_MULTIPLIER)-r,a=r+Math.min(e,i)*o/i;return Math.min(t*a,i)},e.prototype.isDownloadFeasible=function(t,e,i,n,r,o,a){var s,u=t.arrayIndex===(null===(s=this.lastRepresentation)||void 0===s?void 0:s.arrayIndex),l=this.Khb(i,o,a,u);return this.Jhb(t._internalId,i,e,t._bandwidth,r,{hlsDependentSegments:n})<=l},e.prototype.Lhb=function(t){var e,i,n=this.context.store.getState(),r=n?(0,s.getMetricsHistoryFromInstanceState)(n,this.mimeType,u.MetricType.CachedInitSegments):[];return 0===r.length?null!==(i=null===(e=this.Fhb)||void 0===e?void 0:e.hasSelfInitialisingSegments())&&void 0!==i&&i:r.some((function(e){var i=e.hasOwnProperty("value")&&e.value.hasOwnProperty("internalRepId")?e.value.internalRepId:null;return null!==i&&i.equals(t)}))},e.prototype.Mhb=function(t,e,i){var n=this;void 0===i&&(i=this.estimateTimeToFirstByte());var r=this.availableRepresentations.filter((function(t){var e;return n.lastRepresentation&&!t._internalId.equals(null===(e=n.lastRepresentation)||void 0===e?void 0:e._internalId)}));return Math.min.apply(Math,r.map((function(r){var o;return n.Jhb(r._internalId,null!==(o=n.lastSegmentInfo?n.lastSegmentInfo.segmentDuration:e)&&void 0!==o?o:0,t,r._bandwidth,i,n.lastSegmentInfo)})))},e.prototype.Nhb=function(t){var e,i,n,r,o,a,s=null!==(e=t.elapsedTime)&&void 0!==e?e:0,u=(null===(i=this.previousRequestProgress)||void 0===i?void 0:i.url)===t.url?(t.loadedBytes-(null!==(r=null===(n=this.previousRequestProgress)||void 0===n?void 0:n.loadedBytes)&&void 0!==r?r:0))/(s-(null!==(a=null===(o=this.previousRequestProgress)||void 0===o?void 0:o.elapsedTime)&&void 0!==a?a:0)):-1;return this.previousRequestProgress=t,u},e.prototype.Ohb=function(t,e){var i,n=e?y(t):null!==(i=t.elapsedTime)&&void 0!==i?i:0;return this.estimateTimeToFirstByte(n)},e.prototype.Phb=function(t){return void 0===t&&(t=4),this.lastRepresentation?this.lastRepresentation._bandwidth/8*t*1.2:0},e.prototype.Qhb=function(t,e){var i=(0,o.hasLoadedData)(t),n=i?this.Nhb(t):0,r=i&&(0,v.hasTotalBytes)(t)?t.totalBytes-t.loadedBytes:this.Phb(t.segmentDuration);return Math.min(r/(e/8),n>0?r/n:1/0)},e.prototype.Rhb=function(t,e,i){if((0,o.hasLoadedData)(t))return t.loadedBytes/e*8;var n=this.context.bufferSettings.getForwardTargetLevel(),r=this.rateMeasurementRule.getStatus(f.SwitchingAggressiveness.Mid,i/n);return this.getCurrentBitrate(r)},e.prototype.Shb=function(t,e,i,n,r){var o=this.Qhb(n,i);return o>e&&o>r&&e<=r+t},e.prototype.Thb=function(t,e,i,n){var r,o;if(null!==(o=null===(r=this.Ghb)||void 0===r?void 0:r.isPlay())&&void 0!==o&&o)return!1;var a=function(t){return t.getStatus(5,.2).value.mean}(this.timeToFirstByteMeasurementRule);return n>Math.max(t,3*a)&&e<=i+t},e.prototype.Uhb=function(t,e,i,n){var r,o,a,s=this.Ihb(),u=this.Rhb(t,e,s),l=this.Ohb(t,i),h=null!==(a=null!==(r=t.segmentDuration)&&void 0!==r?r:null===(o=this.lastSegmentInfo)||void 0===o?void 0:o.segmentDuration)&&void 0!==a?a:0,p=this.Mhb(u,h,l);return!!(i?this.Shb(h,s,u,t,p):this.Thb(h,s,p,n))&&((0,v.hasTotalBytes)(t)&&(t.loadedBytes/t.totalBytes*100).toFixed(1),this.lastDownloadCancelled=!0,this.lastRateMeasurement=u,!0)},e}(h.BaseAdaptationLogic);function y(t){var e,i,n,r,o=null!==(i=null===(e=t.responseTiming)||void 0===e?void 0:e.openedTimestamp)&&void 0!==i?i:-1,a=null!==(r=null===(n=t.responseTiming)||void 0===n?void 0:n.headersReceivedTimestamp)&&void 0!==r?r:-1;return o<0||a<0?0:a-o}function b(t,e){var i=t.filter((function(t){return t.value.representationId.equals(e)})).slice(-3).map((function(t){return t.value.time}));return(0,c.calculateExponentialWeightedAverage)(i,.8)}e.CancellableAdaptationLogic=g},85696:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.DownloadPredictionLogic=void 0,i(13531);var r=i(70962),o=i(46151),a=i(88844),s=i(11958),u=i(64463),l=i(43829),h=i(70238),p=i(7676),d=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.xfb=new l.DownloadRateRule(n.context,n.monitoringMimeType),n.yfb=(0,u.BufferFillStateRule)(n.context,n.monitoringMimeType),n}return n(e,t),e.prototype.getRepresentationForRateMeasurement=function(t){void 0===t&&(t=h.SwitchingAggressiveness.Mid);var e=this.context.bufferSettings.getForwardTargetLevel(),i=this.yfb.getStatus().value,n=this.rateMeasurementRule.getStatus(t,i/e),r=this.getCurrentBitrate(n),o=(0,p.adjustRateToSafetyMargin)(r,this.context.settings.RATE_SAFETY_MARGIN_PERCENTAGE);return this.findRepresentationForBitrate(o)},e.prototype.getCurrentBitrateMeasurement=function(){var t=this.getCurrentBitrate(this.rateMeasurementRule.getStatus());return(0,p.adjustRateToSafetyMargin)(t,this.context.settings.RATE_SAFETY_MARGIN_PERCENTAGE)},e.prototype.addSample=function(t){this.xfb.addSample(t),this.yfb.addSample(t),this.rateMeasurementRule.addSample(),this.timeToFirstByteMeasurementRule.addSample()},e.prototype.zfb=function(t,e,i,n,r){var o=this;if(!t.segmentDuration||this.isStartupBitrateInEffect())return e;this.lastSegmentInfo=t;var a=this.availableRepresentations.filter((function(t){return t._bandwidth<=e._bandwidth}));if(0===a.length)return this.availableRepresentations[0];var s=r.value||0,u=this.context.bufferSettings.getForwardTargetLevel(),l=(0,p.adjustRateToSafetyMargin)(i,this.context.settings.RATE_SAFETY_MARGIN_PERCENTAGE),h=a.filter((function(e){var i;return o.isDownloadFeasible(e,l,null!==(i=t.segmentDuration)&&void 0!==i?i:0,!1,n,s,u)}));return 0===h.length?a[0]:h[h.length-1]},e.prototype.Afb=function(t,e,i,n){var a,s;this.checkStartupPhase(e);var u=this.context.store.getState(),l=null!==(s=null===(a=(u?(0,o.getMetricsState)(u):{}).default)||void 0===a?void 0:a.bufferLogicActivationThreshold)&&void 0!==s?s:r.DefaultSettings.BUFFER_LOGIC_ACTIVATION_THRESHOLD,h=this.context.bufferSettings.getForwardTargetLevel()>l,p=this.getRepresentationForNormalChange(i,e,h);if(n){var d=this.estimateTimeToFirstByte();p=this.zfb(n,p,t,d,e)}return p},e.prototype.selectRepresentationID=function(t,e){var i,n,r;this.updateAvailableRepresentations(e);var o=this.rateMeasurementRule.getStatus(),a=this.getCurrentBitrate(o),s=this.yfb.getStatus(),u=this.xfb.getStatus(),l=this.Afb(a,s,u,t);return this.lastRepresentation&&(null===(n=null===(i=this.lastRepresentation)||void 0===i?void 0:i._internalId)||void 0===n||n.equals(null==l?void 0:l._internalId)),this.lastRepresentation=l,this.lastRateMeasurement=a,this.lastDownloadCancelled=!1,this.previousRequestProgress=void 0,null===(r=this.lastRepresentation)||void 0===r?void 0:r._internalId},e.prototype.setStartupPhase=function(){var t,e,i,n;this.startupPhase=!0,(0,a.clearTimeoutIfDefined)(this.startupPhaseTimerID),this.startupPhaseTimerID=void 0,null===(t=this.xfb)||void 0===t||t.setStartupPhase(),null===(e=this.yfb)||void 0===e||e.setStartupPhase(),null===(i=this.rateMeasurementRule)||void 0===i||i.setStartupPhase(),null===(n=this.timeToFirstByteMeasurementRule)||void 0===n||n.setStartupPhase()},e.prototype.shutdown=function(){var t,e,i,n;(0,a.clearTimeoutIfDefined)(this.startupPhaseTimerID),this.startupPhaseTimerID=void 0,this.lastDownloadCancelled=!1,this.previousRequestProgress=void 0,null===(t=this.xfb)||void 0===t||t.shutdown(),null===(e=this.yfb)||void 0===e||e.shutdown(),null===(i=this.rateMeasurementRule)||void 0===i||i.shutdown(),null===(n=this.timeToFirstByteMeasurementRule)||void 0===n||n.shutdown()},e.prototype.dispose=function(){var t,e,i,n;this.shutdown(),null===(t=this.xfb)||void 0===t||t.dispose(),null===(e=this.yfb)||void 0===e||e.dispose(),null===(i=this.rateMeasurementRule)||void 0===i||i.dispose(),null===(n=this.timeToFirstByteMeasurementRule)||void 0===n||n.dispose(),this.lastRepresentation=void 0,this.availableRepresentations=[]},e}(s.CancellableAdaptationLogic);e.DownloadPredictionLogic=d},76344:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AdaptationModuleDefinition=void 0;var n=i(62756),r=i(98154),o=i(7676);e.AdaptationModuleDefinition={name:n.ModuleName.ABR,module:function(){return{AdaptationService:i(49541).X,AdaptToPlayerResolution:i(19119).AdaptToPlayerResolution,AdaptationUtils:o,AdaptationApiFactory:r.AdaptationApiFactory}},dependencies:[n.ModuleName.EngineBitmovin]},e.default=e.AdaptationModuleDefinition},19119:function(t,e){function i(t){return t&&t.clientWidth&&t.clientHeight?{width:t.clientWidth*devicePixelRatio,height:t.clientHeight*devicePixelRatio}:null}Object.defineProperty(e,"__esModule",{value:!0}),e.AdaptToPlayerResolution=function(t,e,n){var r,o=function(t,e){var n=e.getVideoElement();if(!n)return null;var r=n.parentElement,o=r&&r.querySelector("#bitmovinplayer-vr-canvas");return t?{width:screen.width*devicePixelRatio,height:screen.height*devicePixelRatio}:i(n)||o&&i(o)||r&&i(r)}(n,t);if(!o)return e;var a=null!==(r=t.getAvailableVideoQualities())&&void 0!==r?r:[],s=a.find((function(t){return t.id===e}));if(!s)return e;var u=function(t,e,i){return t.filter((function(t){var n=t.bitrate<=e,r=function(t,e){var i=e.width/e.height;return t.width/t.height<i?e.width>=t.width:e.height>=t.height}(i,t);return n&&r}))}(a,s.bitrate,o);return 0===u.length?e:u[function(t){var e=t.findIndex((function(e){return e.width>t[0].width&&e.height>t[0].height}))-1;return Math.max(0,e)}(u)].id}},43008:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.hasBitrate=function(t){return null!=t.bitrate},e.hasBitrateBounds=function(t){return null!=t.minBitrate&&null!=t.maxBitrate},e.hasResolution=function(t){return null!=t.height&&null!=t.width}},59113:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.findQualityForBitrate=function(t,e){if(e&&0!==e.length)return e.reduce((function(e,i){var n=r(i),o={entry:i,bitrate:n};return e.bitrate>t||n>t?n>e.bitrate?e:o:n>e.bitrate?o:e}),{entry:e[0],bitrate:r(e[0])}).entry};var n=i(43008);function r(t){return(0,n.hasBitrate)(t)&&t.bitrate>0?t.bitrate:(0,n.hasBitrateBounds)(t)?(t.maxBitrate+t.minBitrate)/2:0}},17006:function(t,e){function i(t){return t.length>0?t.reduce((function(t,e){return t+e}),0)/t.length:0}Object.defineProperty(e,"__esModule",{value:!0}),e.calculateExponentialWeightedAverage=void 0,e.calculateMean=i,e.calculateStandardDeviation=function(t,e){if(void 0===e&&(e=i(t)),t.length<2)return 0;var n=t.reduce((function(t,i){return t+Math.pow(i-e,2)}),0),r=1/(t.length-1)*n;return Math.sqrt(r)},e.calculateMedian=function(t){var e=t.slice(0).sort((function(t,e){return t-e}));return 0===e.length?0:e.length%2==1?e[Math.floor(e.length/2)]:.5*(e[e.length/2-1]+e[e.length/2])},e.calculateExponentialWeightedAverage=function(t,i,n){return void 0===n&&(n=t.length-1),0===t.length||n<0?0:0===n||0===i?t[n]:i*t[n]+(1-i)*(0,e.calculateExponentialWeightedAverage)(t,i,n-1)}},70238:function(t,e){var i;Object.defineProperty(e,"__esModule",{value:!0}),e.SwitchingAggressiveness=void 0,function(t){t[t.Conservative=10]="Conservative",t[t.VeryLow=8]="VeryLow",t[t.Low=7]="Low",t[t.LowMid=6]="LowMid",t[t.Mid=5]="Mid",t[t.MidHigh=4]="MidHigh",t[t.High=3]="High",t[t.VeryHigh=2]="VeryHigh",t[t.Extreme=1]="Extreme"}(i||(e.SwitchingAggressiveness=i={}))},7676:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.toMbps=e.toKbps=e.findMaximum=e.findMinimum=void 0,e.getMaxStartupBitrateFromConfig=function(t){var e,i=null===(e=t.config)||void 0===e?void 0:e.adaptation;if(!i)return 0;var r=function(t){return t.maxStartupBitrate?n.Util.extractBitrateFromString("max",t.maxStartupBitrate):1/0}(i);return!isNaN(r)&&isFinite(r)?r:0},e.getStartupBitrateFromConfig=function(t){var e,i=null===(e=t.config)||void 0===e?void 0:e.adaptation,r=t.settings;if(!i||!r)return 0;var o=i.startupBitrate||0;if(!o)return 0;var a=function(t,e){var i=n.Util.extractBitrateFromString("min",t);return i*=1+e/100,i+=8}(o,r.RATE_SAFETY_MARGIN_PERCENTAGE);return!isNaN(a)&&isFinite(a)?a:0},e.findExtremum=r,e.hasTotalBytes=function(t){return void 0!==t.totalBytes},e.adjustRateToSafetyMargin=function(t,e){return t*(1-e/100)},e.getLowestRepresentation=function(t){return(0,e.findMinimum)(t,(function(t){return t._bandwidth}))};var n=i(70850);function r(t,e){return t[t.reduce((function(i,n,r){return e(t[i],t[r])?i:r}),0)]}var o=function(t){return t};e.findMinimum=function(t,e){return void 0===e&&(e=o),r(t,(function(t,i){return e(t)<e(i)}))},e.findMaximum=function(t,e){return void 0===e&&(e=o),r(t,(function(t,i){return e(t)>e(i)}))},e.toKbps=function(t){return t/Math.pow(2,10)},e.toMbps=function(t){return t/Math.pow(2,20)}},7290:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.WishLogic=void 0;var r=i(44468),o=i(70962),a=i(46151),s=i(33436),u=i(85434),l=i(88844),h=i(11958),p=i(59113),d=i(59406),c=i(70238),f=i(7676),v=i(47577),g=1e-4,y=1e-4,b=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.context=e,n.mimeType=i,n.Cfb=[],n.Dfb=[],n.Efb=0,n.Jfb(),n.Bfb=e.settings.WISH_ABR_PARAMS,n}return n(e,t),Object.defineProperty(e.prototype,"Ffb",{get:function(){var t,e=u.MimeTypeHelper.isVideo(this.mimeType)?r.MediaType.Video:r.MediaType.Audio,i=null!==(t=this.context.internalPlayer.bufferApi.getLevel(r.BufferType.ForwardDuration,e).level)&&void 0!==t?t:0;return i>this.context.bufferSettings.getTargetLevel(r.BufferType.ForwardDuration,e)+this.Efb?0:i},enumerable:!1,configurable:!0}),e.prototype.Jfb=function(){var t=this.context.settings.WISH_ABR_PARAMS.BITRATE_MODIFIER_FUNCTION_TYPE,e=this.context.settings.WISH_ABR_PARAMS.TARGET_BUFFER_FACTOR,i=this.context.settings.WISH_ABR_PARAMS.TARGET_BITRATE_FACTOR;if(!["log","linear"].includes(t)){var n=o.WishDefaultConfig.BITRATE_MODIFIER_FUNCTION_TYPE;this.context.settings.WISH_ABR_PARAMS.BITRATE_MODIFIER_FUNCTION_TYPE=n}if(e>1||e<g){var r=Math.min(Math.max(e,g),1);this.context.settings.WISH_ABR_PARAMS.TARGET_BUFFER_FACTOR=r}if(i<y){var a=Math.max(i,y);this.context.settings.WISH_ABR_PARAMS.TARGET_BITRATE_FACTOR=a}},e.prototype.getRepresentationForRateMeasurement=function(t){void 0===t&&(t=c.SwitchingAggressiveness.Mid);var e=this.context.bufferSettings.getForwardTargetLevel(),i=this.rateMeasurementRule.getStatus(t,this.Ffb/e),n=this.getCurrentBitrate(i),r=(0,f.adjustRateToSafetyMargin)(n,this.context.settings.RATE_SAFETY_MARGIN_PERCENTAGE);return this.findRepresentationForBitrate(r)},e.prototype.Kfb=function(){var t=this.context.store.getState();return(t?(0,a.getMetricsHistoryFromInstanceState)(t,this.mimeType,s.MetricType.DownloadInformation):[]).filter((function(t){return Boolean(t.value)})).length>2},e.prototype.addSample=function(t){(function(t){return null!=t.segmentDuration})(t)&&(this.rateMeasurementRule.addSample(),this.timeToFirstByteMeasurementRule.addSample(),t.segmentDuration!==this.Efb&&(this.Efb=t.segmentDuration,this.Lfb()))},e.prototype.selectRepresentationID=function(t,e){var i;this.updateAvailableRepresentations(e),this.checkStartupPhase({value:this.Ffb,result:d.Rules.SHOULD_STAY});var n=this.Nfb(),r=null===(i=n.rep)||void 0===i?void 0:i._internalId,o=n.index;return this.Dfb.push(this.Cfb[o]),this.Dfb.length>20&&(this.Dfb=this.Dfb.slice(-10)),this.lastSegmentInfo=t,this.lastRepresentation=n.rep,this.lastRateMeasurement=this.getCurrentBitrate(this.rateMeasurementRule.getStatus()),this.lastDownloadCancelled=!1,this.previousRequestProgress=void 0,r},e.prototype.getCurrentBitrateMeasurement=function(){return this.rateMeasurementRule.getStatus().value},e.prototype.setAdaptationSet=function(e){t.prototype.setAdaptationSet.call(this,e);var i=this.getAvailableRepresentations().map((function(t){return(0,f.toKbps)(t._bandwidth)}));this.Cfb=(0,v.applyQualityFunction)(i,this.Bfb.BITRATE_MODIFIER_FUNCTION_TYPE),this.Lfb()},e.prototype.findRepresentationForBitrate=function(t,e){var i,n=(0,p.findQualityForBitrate)(t,this.getAvailableRepresentations().map((function(t){return{rep:t,bitrate:t._bandwidth}})));return null!==(i=null==n?void 0:n.rep)&&void 0!==i?i:this.getLowestRepresentation()},e.prototype.setStartupPhase=function(){this.startupPhase=!0,(0,l.clearTimeoutIfDefined)(this.startupPhaseTimerID),this.startupPhaseTimerID=void 0},e.prototype.shutdown=function(){var t,e;this.lastRateMeasurement=0,this.lastDownloadCancelled=!1,this.previousRequestProgress=void 0,null===(t=this.rateMeasurementRule)||void 0===t||t.shutdown(),null===(e=this.timeToFirstByteMeasurementRule)||void 0===e||e.shutdown()},e.prototype.dispose=function(){var t,e;this.shutdown(),null===(t=this.rateMeasurementRule)||void 0===t||t.dispose(),null===(e=this.timeToFirstByteMeasurementRule)||void 0===e||e.dispose(),this.lastRepresentation=void 0,this.availableRepresentations=[],this.Cfb=[],this.Efb=0,this.Dfb=[]},e.prototype.Lfb=function(){if((0,v.canUseWishAlgorithm)(this.Cfb,this.Efb)){var t=this.getAvailableRepresentations().map((function(t){return(0,f.toKbps)(t._bandwidth)})),e=u.MimeTypeHelper.isVideo(this.mimeType)?r.MediaType.Video:r.MediaType.Audio,i=this.context.bufferSettings.getTargetLevel(r.BufferType.ForwardDuration,e);this.Gfb=(0,v.computeAlpha)(this.Bfb,t,this.Cfb,this.Efb,i),this.Hfb=(0,v.computeBeta)(this.Bfb,this.Gfb,i,this.Efb),this.Ifb=(0,v.computeGamma)(this.Gfb,this.Hfb)}},e.prototype.Mfb=function(t,e,i,n){var r=(0,v.determineBandwidthCost)(t._bandwidth,n),o=(0,v.determineBufferCost)(r,this.Efb,this.Ffb),a=(0,v.determineQualityCost)(this.Cfb,e,i);return this.Gfb*r+this.Hfb*o+this.Ifb*a},e.prototype.isStartupBitrateInEffect=function(){var t,e,i=Boolean(null===(t=this.context.config.adaptation)||void 0===t?void 0:t.startupBitrate),n=Boolean(null===(e=this.context.config.adaptation)||void 0===e?void 0:e.maxStartupBitrate);return(i||n)&&!this.Kfb()},e.prototype.Nfb=function(){var t=this;if(this.startupPhase&&(this.isStartupBitrateInEffect()||this.Bfb.USE_RATE_BASED_SELECTION_ON_SEEKING)){var e=this.getRepresentationForRateMeasurement(),i=this.getAvailableRepresentations().indexOf(e);return{rep:e,index:-1!==i?i:0}}if(this.Ffb<this.Efb||!(0,v.canUseWishAlgorithm)(this.Cfb,this.Efb))return{rep:this.getAvailableRepresentations()[0],index:0};var n=(0,v.getAverageSelectedQuality)(this.Dfb,10),r=this.rateMeasurementRule.getStatus(5,.325).value,o=this.getCurrentBitrate(this.rateMeasurementRule.getStatus()),a=Math.min(r,o),s=this.getAvailableRepresentations()[0]._bandwidth,u=Math.max(1.1*r,s),l=this.getAvailableRepresentations().filter((function(t){return t._bandwidth<=u})).map((function(e,i){return{rep:e,index:i,cost:t.Mfb(e,i,n,a)}})).sort((function(t,e){return t.cost-e.cost}));return{rep:l[0].rep,index:l[0].index}},e}(h.CancellableAdaptationLogic);e.WishLogic=b},47577:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.applyQualityFunction=function(t,e){switch(e){case"linear":var i=t[t.length-1];return t.map((function(t){return function(t,e){return t/e}(t,i)}));case"log":var n=t[0];return t.map((function(t){return function(t,e){return Math.log(t/e)}(t,n)}))}},e.computeAlpha=function(t,e,i,n,r){switch(t.BITRATE_MODIFIER_FUNCTION_TYPE){case"linear":return function(t,e,i,n){var r=t.TARGET_BITRATE_FACTOR,o=t.TARGET_BUFFER_FACTOR,a=i,s=e[0],u=e[e.length-2];return 1/(1+(o*n-a)/i+Math.exp(3-2*s-u)/r)}(t,i,n,r);case"log":return function(t,e,i,n){var r=t.TARGET_BITRATE_FACTOR,o=t.TARGET_BUFFER_FACTOR,a=i,s=e[0],u=e[e.length-1];return 1/(1+(o*n-a)/i+2*u*u/(r*s*e[e.length-2]))}(t,e,n,r)}},e.computeBeta=function(t,e,i,n){return e*((t.TARGET_BUFFER_FACTOR*i-n)/n)},e.computeGamma=function(t,e){return 1-t-e},e.determineBandwidthCost=function(t,e){return e?t/e:1},e.determineBufferCost=function(t,e,i){return i<=e?1/0:t*(e/(i-e))},e.determineQualityCost=function(t,e,i){var n=t[t.length-1],r=t[0],o=t[e];return Math.exp(n+i-2*o)/Math.exp(2*n-2*r)},e.getAverageSelectedQuality=function(t,e){if(0===t.length)return 0;var i=t.slice(-e);return i.reduce((function(t,e){return t+e}))/i.length},e.canUseWishAlgorithm=function(t,e){return!(t.length<=1||!e)}},82873:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BandwidthValueType=void 0,e.getBandwidth=function(t){if(0!==t.length){for(var e=t.length,r=e-1;r>=0;r--){var o=t[r].value,a=o.downloadRate,s=o.segmentBitrate;if(void 0===s||a<s*n)return{rateBps:a,type:i.Accurate}}return{rateBps:t[e-1].value.downloadRate,type:i.Estimated}}};var i,n=.9;!function(t){t.Accurate="accurate",t.Estimated="estimated"}(i||(e.BandwidthValueType=i={}))},24296:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.LowLatencyAbr=void 0;var n=i(80813),r=i(46151),o=i(33436),a=i(59113),s=i(28922),u=i(7676),l=i(82873),h=i(50265),p=i(52902),d=function(){function t(t,e){this.context=t,this.mimeType=e,this.Sfb=new h.RateLimitedCancelCheck}return Object.defineProperty(t.prototype,"Tfb",{get:function(){return this.context.serviceManager.get(n.ServiceName.ManifestService,this.context.sourceContext.sourceIdentifier)},enumerable:!1,configurable:!0}),t.prototype.egb=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];this.context.logger},t.prototype.fgb=function(){var t=(0,r.getMetricsHistoryFromInstanceState)(this.context.store.getState(),this.mimeType,o.MetricType.ChunkedDownloadInformation),e=this.ggb();return(0,l.getBandwidth)(t.slice(-e))},t.prototype.ggb=function(){var t,e=null===(t=this.context.config.adaptation)||void 0===t?void 0:t.qualityStabilityBalance,i=Math.ceil(20*e);return Math.max(1,i)},t.prototype.hgb=function(t){var e,i,n,r,o=null!==(n=null===(i=null===(e=this.Tfb)||void 0===e?void 0:e.getAdaptationSet(t))||void 0===i?void 0:i.Representation)&&void 0!==n?n:[],a=(0,u.getLowestRepresentation)(o);return null!==(r=null==a?void 0:a._internalId.equals(t))&&void 0!==r&&r},t.prototype.getCurrentBitrateMeasurement=function(){var t,e;return null!==(e=null===(t=this.fgb())||void 0===t?void 0:t.rateBps)&&void 0!==e?e:0},t.prototype.getLowestRepresentation=function(){var t,e,i;if(this.Rfb){var n=null!==(i=null===(e=null===(t=this.Tfb)||void 0===t?void 0:t.getAdaptationSet(this.Rfb._internalId))||void 0===e?void 0:e.Representation)&&void 0!==i?i:[];return(0,u.getLowestRepresentation)(n)}},t.prototype.selectRepresentationID=function(t,e){var i,n,a,h;if(e&&0!==e.length){var p,d=this.fgb();if(this.egb("current bandwidth",d),!d)return null===(i=(0,u.getLowestRepresentation)(e))||void 0===i?void 0:i._internalId;if(d.type===l.BandwidthValueType.Accurate&&(p=null!==(n=this.findRepresentationForBitrate(d.rateBps,e))&&void 0!==n?n:void 0,this.egb("accurate value, selecting ",null==p?void 0:p._bandwidth)),d.type===l.BandwidthValueType.Estimated){var c=null===(a=(0,r.getMetricsLastEntry)((0,r.getMetricsState)(this.context.store.getState()),this.mimeType,o.MetricType.ChunkedDownloadInformation).value)||void 0===a?void 0:a.representationBitrate;void 0!==c&&(p=(0,s.findNextHigherBitrateRepresentation)(e,c),this.egb("estimated value, currently on ".concat(c,", selecting ").concat(null==p?void 0:p._bandwidth)))}return p?p._internalId:null===(h=(0,u.getLowestRepresentation)(e))||void 0===h?void 0:h._internalId}},t.prototype.findRepresentationForBitrate=function(t,e){var i,n;if(!e||e.length<1)return null;var r=null===(i=(0,a.findQualityForBitrate)(t,e.map((function(t){return{rep:t,bitrate:t._bandwidth}}))))||void 0===i?void 0:i.rep;return null!==(n=null!=r?r:(0,u.getLowestRepresentation)(e))&&void 0!==n?n:null},t.prototype.shouldDownloadBeCancelled=function(t,e){if(this.Sfb.shouldExecuteCancelCheck(t)){if(this.hgb(e))return!1;var i=(0,p.shouldCancelDownload)(t);return i&&this.egb("Cancelling segment download, current download rate is significantly lower than segment bitrate"),i}return!1},t.prototype.addSample=function(t){},t.prototype.setAdaptationSet=function(t){this.Rfb=t},t.prototype.setStartupPhase=function(){},t.prototype.shutdown=function(){},t.prototype.dispose=function(){this.shutdown()},t}();e.LowLatencyAbr=d},50265:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.RateLimitedCancelCheck=void 0;var i=function(){function t(){this.Xhb=0}return t.prototype.shouldExecuteCancelCheck=function(t){if(void 0===t.segmentDuration||void 0===t.elapsedTime)return!1;this.Yhb(t)&&(this.Xhb=0);var e=this.Xhb+.2;if(t.elapsedTime>=t.segmentDuration*e){var i=t.elapsedTime/t.segmentDuration;return this.Xhb=.2*Math.floor(i/.2),!0}return!1},t.prototype.Yhb=function(t){return t.elapsedTime<this.Xhb*t.segmentDuration},t}();e.RateLimitedCancelCheck=i},52902:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.shouldCancelDownload=function(t){var e=t.responseTiming;if(!e)return!1;var i=e.progressTimestamp-e.headersReceivedTimestamp,r=(0,n.bytesToBits)(t.loadedBytes)/i,o=1-(0,n.bytesToBits)(t.loadedBytes)/(t.representationBitrate*t.segmentDuration);return r<t.representationBitrate*o};var n=i(33004)},4865:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.BlockBasedRateMeasurementRule=void 0;var r=i(46151),o=i(33436),a=i(70850),s=i(59406),u=1e6,l=function(t){function e(e,i){var n,r,o,s,u=t.call(this,e,i)||this;return u.dgb=e.settings,u.cgb=i,u.shb=!0,u.qhb=16e5,null!=(null===(r=null===(n=e.config)||void 0===n?void 0:n.adaptation)||void 0===r?void 0:r.maxStartupBitrate)&&(u.qhb=a.Util.extractBitrateFromString("max",e.config.adaptation.maxStartupBitrate)),null!=(null===(s=null===(o=e.config)||void 0===o?void 0:o.adaptation)||void 0===s?void 0:s.startupBitrate)&&(u.ohb=a.Util.extractBitrateFromString("min",e.config.adaptation.startupBitrate)),u.rhb={bytes:0,time:0},u.phb=[],u}return n(e,t),e.calcRateInBps=function(t,e){return 8*t/e},e.prototype.thb=function(t){var i=this.phb.pop();if((null==i?void 0:i.bytes)===u&&(this.phb.push(i),i=void 0),i||(i={bytes:0,time:0,rateInBps:0}),i.bytes+t.bytes<=u){var n=i.bytes+t.bytes,r=i.time+t.time;this.phb.push({bytes:n,time:r,rateInBps:e.calcRateInBps(n,r)})}else{var o=(u-i.bytes)/t.bytes;i.bytes+=t.bytes*o,i.time+=t.time*o,i.rateInBps=e.calcRateInBps(i.bytes,i.time),this.phb.push(i);for(var a=t.bytes*(1-o),s=t.time*(1-o);a>u;){var l=s/(a/u);this.phb.push({bytes:u,time:l,rateInBps:e.calcRateInBps(u,l)}),a-=u,s-=l}this.phb.push({bytes:a,time:s,rateInBps:e.calcRateInBps(a,s)})}},e.prototype.uhb=function(t){if(t&&!isNaN(t.bytes)){var e=this.rhb;if(e.bytes===t.bytes&&e.time===t.time)return;this.rhb=t,this.thb(t),this.phb.length>40&&this.phb.shift(),this.xhb()}},e.prototype.vhb=function(t,i){var n,r=-t;null!=i&&(r=-t-i,n=-i);var o=this.phb.slice(r,n);if(0===o.length)return 0;var a=o.reduce((function(t,e){return{bytes:t.bytes+e.bytes,time:t.time+e.time,rateInBps:t.rateInBps+e.rateInBps}}));return a.rateInBps=e.calcRateInBps(a.bytes,a.time),a.rateInBps},e.prototype.whb=function(){if(null==this.ohb)return null;var t=this.ohb;return t*=1+this.dgb.RATE_SAFETY_MARGIN_PERCENTAGE/100,t+=8,isNaN(t)?null:{bytes:h(t),time:1}},e.prototype.addSample=function(){if(this.instanceState){var t=(0,r.getMetricsState)(this.instanceState),e=(0,r.getMetricsLastEntry)(t,this.cgb,o.MetricType.DownloadInformation);if(this.shb){this.shb=!1;var i=this.whb();i&&(e={value:i})}if(!e||!e.value||!e.value.bytes){e=e||{};var n=this.yhb();n>0&&(e.value={bytes:h(n),time:1}),e&&e.value||(e=(0,r.getMetricsLastEntry)(t,"default",o.MetricType.DownloadInformation));var a=1/0;e&&e.value&&!isNaN(e.value.bytes)&&!isNaN(e.value.time)&&(a=e.value.bytes/e.value.time),a>this.qhb&&(e.value=e.value||{},e.value.bytes=h(this.qhb),e.value.time=1)}this.uhb(e.value)}},e.prototype.getStatus=function(t){0===this.phb.length&&this.addSample();var e=this.vhb(t),i=this.vhb(t,1);return{value:e,result:e>1.1*i?s.Rules.SHOULD_SWITCH_UP:e<.9*i?s.Rules.SHOULD_SWITCH_DOWN:s.Rules.SHOULD_STAY}},e.prototype.xhb=function(){if(this.instanceState){var t=(0,r.getMetricsHistoryFromInstanceState)(this.instanceState,this.cgb,o.MetricType.DownloadInformation).slice(-3).map((function(t){return Math.round(8*t.value.bytes/t.value.time)}));this.context.storedConfig.set("b",t),this.context.storedConfig.set("b_t",Date.now())}},e.prototype.yhb=function(){var t=this.context.storedConfig.get("b")||[];return Math.round(t.reduce((function(t,e){return t+e}),0)/t.length)||-1},e.prototype.shutdown=function(){},e.prototype.setStartupPhase=function(){},e.prototype.dispose=function(){},e}(s.AdaptationRule);function h(t){return t/8}e.BlockBasedRateMeasurementRule=l},20066:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.BufferFillRateRule=void 0;var r=i(89927),o=i(88844),a=i(59406),s=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.zhb=e.bufferSettings,n.Ahb=!0,n.Chb=[],n}return n(e,t),e.prototype.Dhb=function(){if(0===this.Chb.length)return NaN;var t=this.Chb[this.Chb.length-1],e=t.bufferTargetLevel;if(this.Ahb){var i=t.bufferLevel,n=this.Chb[this.Chb.length-2],r=0;n&&(r=n.bufferLevel),i>=t.bufferTargetLevel||r>i?this.Ahb=!1:e=i}return e},e.prototype.Ehb=function(t){isNaN(t)&&(t=this.zhb.getForwardTargetLevel());for(var e,i=Date.now()-(0,r.toMilliSeconds)(t),n=0,o=0,a=0;a<this.Chb.length;a++)(e=this.Chb[a]).timestamp>=i&&(n+=e.bufferLevel-o),o=e.bufferLevel;return n/=this.Dhb(),isNaN(n)?1:n},e.prototype.addSample=function(t){var e=this;this.Bhb||(this.Bhb=window.setTimeout((function(){e.Ahb=!1}),(0,r.toMilliSeconds)(this.zhb.getForwardTargetLevel()))),this.Chb.push(t),t.timestamp-this.Chb[0].timestamp>6e4&&this.Chb.shift()},e.prototype.getStatus=function(t){var e=this.Ehb(t),i=a.Rules.SHOULD_STAY;return e>.7?i=a.Rules.SHOULD_SWITCH_UP:e<-.5&&(i=a.Rules.SHOULD_SWITCH_DOWN),{value:e,result:i}},e.prototype.setStartupPhase=function(){this.Ahb=!0},e.prototype.shutdown=function(){(0,o.clearTimeoutIfDefined)(this.Bhb),this.Bhb=void 0},e.prototype.dispose=function(){this.shutdown(),this.Chb=[]},e}(a.AdaptationRule);e.BufferFillRateRule=s},64463:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.BufferFillStateRule=function(t,e){var i,s,u=!0,l={timestamp:Date.now(),bufferTargetLevel:(null===(i=n.DefaultSettings.TARGET_BUFFER_LEVEL.video)||void 0===i?void 0:i.forwardduration)||0,bufferLevel:0},h=function(){(0,o.clearTimeoutIfDefined)(s),s=void 0};return{addSample:function(e){s||(s=window.setTimeout((function(){u=!1}),(0,r.toMilliSeconds)(t.bufferSettings.getForwardTargetLevel()))),l=e},getStatus:function(){var t;return l.bufferLevel>.8*l.bufferTargetLevel?(t=a.Rules.SHOULD_SWITCH_UP,u&&(u=!1,(0,o.clearTimeoutIfDefined)(s))):t=l.bufferLevel<.4*l.bufferTargetLevel?a.Rules.SHOULD_SWITCH_DOWN:a.Rules.SHOULD_STAY,u&&(t=a.Rules.SHOULD_STAY),{value:l.bufferLevel,result:t}},setStartupPhase:function(){u=!0},shutdown:h,dispose:function(){h()}}};var n=i(70962),r=i(89927),o=i(88844),a=i(59406)},43829:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.DownloadRateRule=void 0;var r=i(89927),o=i(59406),a=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.Vhb=[],n}return n(e,t),e.prototype.Whb=function(t){void 0===t&&(t=this.context.bufferSettings.getForwardTargetLevel());var e=Date.now()-(0,r.toMilliSeconds)(t),i=this.Vhb.filter((function(t){return t.timestamp>=e}));if(0===i.length)return 1;var n=0;return i.forEach((function(t,e){var o=i[e-1],a=t.segmentDuration,s=a/8,u=Math.min(t.bufferLevel/t.bufferTargetLevel,1),l=Math.max(t.segmentDownloadDuration,s),h=u*(a/l)+a/(o?Math.max(t.timestamp-o.timestamp,s):(0,r.toMilliSeconds)(Math.max(a,l)))*(1-u);n=t.downloadCancelled?n-h:n+h})),n/i.length},e.prototype.addSample=function(t){(function(t){return null!=t.segmentDuration&&null!=t.segmentDownloadDuration})(t)&&(this.Vhb.push(t),t.timestamp-this.Vhb[0].timestamp>6e4&&this.Vhb.shift())},e.prototype.getStatus=function(t,e){var i=this.Whb(t),n=o.Rules.SHOULD_STAY;return i>1.7?n=o.Rules.SHOULD_SWITCH_UP:i<.5&&(n=o.Rules.SHOULD_SWITCH_DOWN),{value:i,result:n}},e.prototype.setStartupPhase=function(){},e.prototype.shutdown=function(){},e.prototype.dispose=function(){this.shutdown(),this.Vhb=[]},e}(o.AdaptationRule);e.DownloadRateRule=a},59406:function(t,e){var i;Object.defineProperty(e,"__esModule",{value:!0}),e.AdaptationRule=e.Rules=void 0,function(t){t.SHOULD_SWITCH_UP="SWITCH_UP",t.SHOULD_STAY="STAY",t.SHOULD_SWITCH_DOWN="SWITCH_DOWN"}(i||(e.Rules=i={}));var n=function(){function t(t,e){this.context=t,this.samples=[],this.mimeType=e,this.logger=t.logger,this.Settings=t.settings,this.maxHistorySize=this.Settings.DEFAULT_ADAPTATION_RULE_HISTORY_SIZE}return Object.defineProperty(t.prototype,"instanceState",{get:function(){var t;return null===(t=this.context.store)||void 0===t?void 0:t.getState()},enumerable:!1,configurable:!0}),t.prototype.estimateStatus=function(t,e,i){return this.getStatus(e,i)},t}();e.AdaptationRule=n},39185:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.SegmentBasedRateMeasurementRule=void 0;var r=i(46151),o=i(33436),a=i(89927),s=i(70850),u=i(17006),l=i(7676),h=i(59406),p=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.mhb=-1,n.nhb=.1,n.yib=!0,n}return n(e,t),e.getBitrateFromPerformanceAPI=function(){if(!performance||"function"!=typeof performance.getEntriesByName)return 0;var t=0,e=0;return performance.getEntriesByType("resource").filter(d).forEach((function(i){t+=8*i.transferSize,e+=(0,a.toSeconds)(i.duration-(i.responseStart-i.requestStart))})),t>0&&e>0?t/e:0},e.prototype.zib=function(t,e,i){var n;void 0===e&&(e=1),void 0===i&&(i=0);var r=-t-i;return n=0!==i?this.samples.slice(r,-i):this.samples.slice(r),(0,u.calculateExponentialWeightedAverage)(n,1-e)},e.validateDownloadInfo=function(t){if(Boolean(t)&&Boolean(t.value)){var e=Boolean(t.value.bytes),i=!isNaN(t.value.time),n=void 0!==t.value.timeToFirstByte&&!isNaN(t.value.timeToFirstByte);return e&&i&&n}return!1},e.prototype.Aib=function(t){if(!this.instanceState)return 0;var i=(0,r.getMetricsLastEntry)((0,r.getMetricsState)(this.instanceState),t,o.MetricType.DownloadInformation),n=e.validateDownloadInfo(i),a=n&&this.mhb<i.time;return a&&isFinite(i.time)&&(this.mhb=i.time),n&&a?c(i,this.context.settings.MAX_ALLOWED_BANDWIDTH_ESTIMATION):n&&!a?-1:0},e.prototype.Bib=function(){var t=[],i=this.Dib();i>0&&t.push(i);var n=this.Aib("default");n>0&&t.push(n);var r=Math.min.apply(Math,t);return r>0&&isFinite(r)?r:e.getBitrateFromPerformanceAPI()},e.prototype.addSample=function(){var t=this.Aib(this.mimeType),e=0;this.yib&&(e=function(t,e){var i=(0,l.getStartupBitrateFromConfig)(t),n=(0,l.getMaxStartupBitrateFromConfig)(t);return n=e>0?Math.min(n,e):n,i||n||0}(this.context,t),this.yib=!1),0===(e=e||t||0)&&(e=this.Bib()),e>0&&(this.samples.push(e),this.samples.length>this.maxHistorySize&&this.samples.splice(0,this.samples.length-this.maxHistorySize)),t>0&&this.Cib()},e.prototype.getStatus=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1),0===this.samples.length&&this.addSample();var i=this.zib(t,e),n=this.zib(t,e,1);return{value:i,result:i>n*(1+this.nhb)?h.Rules.SHOULD_SWITCH_UP:i<n*(1-this.nhb)?h.Rules.SHOULD_SWITCH_DOWN:h.Rules.SHOULD_STAY}},e.prototype.Cib=function(){if(this.instanceState){var t=(0,r.getMetricsHistoryFromInstanceState)(this.instanceState,this.mimeType,o.MetricType.DownloadInformation).filter(e.validateDownloadInfo).slice(-3).map((function(t){return c(t)}));this.context.storedConfig.set("b",t),this.context.storedConfig.set("b_t",Date.now())}},e.prototype.Dib=function(){var t=this,e=(this.context.storedConfig.get("b")||[]).map((function(e){return f(e,t.context.settings.MAX_ALLOWED_BANDWIDTH_ESTIMATION)}));return Math.round(e.reduce((function(t,e){return t+e}),0)/e.length)||0},e.prototype.shutdown=function(){},e.prototype.setStartupPhase=function(){},e.prototype.dispose=function(){},e}(h.AdaptationRule);function d(t){return t.transferSize>0&&!/^https?:\/\/localhost(:\d+)?(\/|$)/.test(t.name)}function c(t,e){var i;void 0===e&&(e=1/0);var n=t.value.time-(null!==(i=t.value.timeToFirstByte)&&void 0!==i?i:0);return f(8*t.value.bytes/n,e)}function f(t,e){var i=s.Util.extractBitrateFromString("max",e);return Math.min(t,i)}e.SegmentBasedRateMeasurementRule=p},45199:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),r=this&&this.__spreadArray||function(t,e,i){if(i||2===arguments.length)for(var n,r=0,o=e.length;r<o;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.TimeToFirstByteMeasurementRule=void 0;var o=i(46151),a=i(33436),s=i(17006),u=i(59406),l=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.Eib=-1,n}return n(e,t),e.prototype.Fib=function(t){if(!this.instanceState)return 0;var e=(0,o.getMetricsLastEntry)((0,o.getMetricsState)(this.instanceState),t,a.MetricType.DownloadInformation),i=Boolean(e)&&Boolean(e.value),n=i&&void 0!==e.value.timeToFirstByte&&!isNaN(e.value.timeToFirstByte),r=i&&this.Eib<e.time;return r&&isFinite(e.time)&&(this.Eib=e.time),n&&r?e.value.timeToFirstByte:n&&!r?-1:0},e.prototype.addSample=function(){var t=this.Fib(this.mimeType),e=this.Fib("default"),i=t||e||0;if(i>0)for(this.samples.push(i);this.samples.length>this.maxHistorySize;)this.samples.shift()},e.prototype.Gib=function(t){var e=-t;return t>0?this.samples.slice(e):[]},e.prototype.Hib=function(t,e){var i=(0,s.calculateMean)(t),n=(0,s.calculateExponentialWeightedAverage)(t,e),r=(0,s.calculateStandardDeviation)(t,i);return{value:{median:(0,s.calculateMedian)(t),mean:i,weightedAverage:n,standardDeviation:r},result:u.Rules.SHOULD_STAY}},e.prototype.getStatus=function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.Hib(this.Gib(t),e)},e.prototype.estimateStatus=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=1);var n=r(r([],this.Gib(e-1),!0),[t],!1);return this.Hib(n,i)},e.prototype.setStartupPhase=function(){},e.prototype.shutdown=function(){},e.prototype.dispose=function(){},e}(u.AdaptationRule);e.TimeToFirstByteMeasurementRule=l},28922:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.findNextHigherBitrateRepresentation=function(t,e){for(var i,n,r=0,o=t;r<o.length;r++){var a=o[r];a._bandwidth>e&&(void 0===i||a._bandwidth<i._bandwidth)&&(i=a),(void 0===n||a._bandwidth>n._bandwidth)&&(n=a)}return null!=i?i:n}},83429:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.getUserSelectedRepresentation=function(t,e,i,a){var s,u,l=function(t,e){return r.MimeTypeHelper.isAudio(t)?null==e?void 0:e.onAudioAdaptation:r.MimeTypeHelper.isVideo(t)?null==e?void 0:e.onVideoAdaptation:void 0}(e,t.config.adaptation);if(l){var h=t.serviceManager.maybeCall(n.ServiceName.ManifestService,(function(t){return t.getAdaptationSet(i)}),null,t.sourceContext.sourceIdentifier),p=null!==(s=null==h?void 0:h.Representation.map((function(t){return{bandwidth:t._bandwidth,id:t._id}})))&&void 0!==s?s:[],d={suggested:a.representationId,isAd:t.sourceContext.isAd,representations:p},c=null!==(u=(0,o.safeUserCallback)((function(){return l(d)}),t.logger))&&void 0!==u?u:void 0;return function(t,e,i){return t.serviceManager.maybeCall(n.ServiceName.ManifestService,(function(t){return e&&t.getRepresentation(e,i)}),void 0,t.sourceContext.sourceIdentifier)||void 0}(t,i,c)}};var n=i(80813),r=i(85434),o=i(70850)}},function(t){return function(){return t(t.s=76344)}()}])}));
17
+ "use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.abr=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player.abr=e())}(self,(function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[744],{98154:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.AdaptationApiFactory=void 0;var r=i(23068),o=function(){function t(){}return t.create=function(t){return{setConfig:function(e){"Updating adaptation config with ".concat(JSON.stringify(e)),(0,r.isNumber)(e.qualityStabilityBalance)&&function(e){if(e<0||e>1)"Failed to set qualityStabilityBalance to ".concat(e,", valid range is 0 to 1");else{var i=t.getConfig(!0).adaptation;i&&(i.qualityStabilityBalance=e,"Updated qualityStabilityBalance to ".concat(e))}}(e.qualityStabilityBalance),e.resolution&&function(e){var i=e.maxSelectableVideoHeight,n=e.maxSelectableVideoWidth,r=e.minSelectableVideoHeight,o=e.minSelectableVideoWidth,s=t.getConfig(!0).adaptation.resolution;a(i)&&(s.maxSelectableVideoHeight=i),a(n)&&(s.maxSelectableVideoWidth=n),a(r)&&(s.minSelectableVideoHeight=r),a(o)&&(s.minSelectableVideoWidth=o),"Updated resolution boundaries to ".concat(JSON.stringify(s))}(e.resolution),(0,r.isBoolean)(e.limitToPlayerSize)&&function(e){var i=t.getConfig(!0).adaptation;i&&(i.limitToPlayerSize=e,"Updated limitToPlayerSize to ".concat(e))}(e.limitToPlayerSize)},getConfig:function(){var e=t.getConfig(!0).adaptation,i=e.qualityStabilityBalance,r=e.resolution,o=e.limitToPlayerSize;return{qualityStabilityBalance:i,resolution:n({},r),limitToPlayerSize:o}}}},t}();function a(t){return(0,r.isNumber)(t)&&t>=0}e.AdaptationApiFactory=o},89498:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.AdaptationHandler=void 0;var r=i(80813),o=i(98714),a=i(49859),s=i(91678),u=i(33436),l=i(86897),h=i(93204),p=i(79721),d=i(85434),c=i(70850),f=i(46057),v=i(47151),g=i(79505),y=i(49024),m=i(19119),b=i(43008),R=i(59113),S=i(7676),_=1/0,T=function(){function t(t,e,i){var n,r,o=this;this.context=t,this.mimeType=e,this.constraints=i,this.CO=!1,this.EO=function(t){var e;return void 0===t&&(t=null===(e=o.AO)||void 0===e?void 0:e.getState()),t?(0,a.getPreferredBitrate)((0,a.getAdaptationState)(t),o.mimeType):null},this.tO=(0,y.createAdaptationLogic)(this.context,this.mimeType,{minBitrate:this.constraints.minBitrate,maxBitrate:this.constraints.maxBitrate},null===(r=null===(n=this.context.config)||void 0===n?void 0:n.adaptation)||void 0===r?void 0:r.logic),this.xO=this.eP(this.yO),this.VP()}return Object.defineProperty(t.prototype,"AO",{get:function(){var t=this.context.sourceContext.sourceIdentifier;return this.context.serviceManager.get(r.ServiceName.SourceStoreService,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DO",{get:function(){var t=this.context.sourceContext.sourceIdentifier;return this.context.serviceManager.get(r.ServiceName.ManifestService,t)},enumerable:!1,configurable:!0}),t.prototype.FO=function(t,e,i){var n,r;return t?this.xO:e&&null!==(r=null===(n=this.tO.findRepresentationForBitrate(e,i))||void 0===n?void 0:n._internalId)&&void 0!==r?r:null},t.prototype.GO=function(t,e){var i,n=this.HO(),r=this.EO();return n||r?this.FO(n,r,e):null!==(i=this.tO.selectRepresentationID(t,e))&&void 0!==i?i:null},t.prototype.HO=function(){return!this.isAuto()&&Boolean(this.WP(this.xO,this.JO()))},t.prototype.IO=function(t){this.uO=t},t.prototype.JO=function(){var t,e,i;return null!==(i=null===(e=null===(t=this.DO)||void 0===t?void 0:t.getAdaptationSet(this.yO))||void 0===e?void 0:e.Representation)&&void 0!==i?i:[]},t.prototype.selectRepresentationID=function(t,e){void 0===t&&(t={});var i=this.XP(null!=e?e:this.JO()),n=this.GO(t,i);return n&&this.IO(n),this.uO},t.prototype.UP=function(){var t=this,e=Boolean(this.wO);this.AO&&!e&&(this.wO=(0,h.subscribe)(this.AO)(l.getBufferStateMap,(function(e){var i,n,r=null==e?void 0:e[t.mimeType];if(r){var a=r.rendererRanges;a&&a.length>0&&(null===(i=t.AO)||void 0===i||i.dispatch((0,o.clearPreferredBitrateForMimeTypeAction)(t.mimeType)),null===(n=t.wO)||void 0===n||n.call(t),t.wO=void 0)}})))},t.prototype.VP=function(){var t=this;this.AO&&(this.EO()&&this.UP(),this.vO=(0,h.subscribe)(this.AO)(this.EO,(function(){return t.UP()}),(function(t){return Boolean(t)})))},t.prototype.WP=function(t,e){var i;return e?e.find((function(e){return e._internalId.equals(t)})):null===(i=this.DO)||void 0===i?void 0:i.getRepresentationById(t)},t.prototype.XP=function(t){this.bP();var e=t.map((function(t){return{representation:t,bitrate:t._bandwidth,width:t._width,height:t._height}}));return this.YP(e).map((function(t){return t.representation}))},t.prototype.YP=function(t){var e=this,i=this.context.config.adaptation.resolution,n=i.minSelectableVideoHeight,r=i.maxSelectableVideoHeight,o=i.minSelectableVideoWidth,a=i.maxSelectableVideoWidth,s=t.filter((function(t){return!((0,b.hasBitrate)(t)&&!w(t.bitrate,e.constraints.minBitrate,e.constraints.maxBitrate))&&(!(0,b.hasResolution)(t)||w(t.width,o,a)&&w(t.height,n,r))}));if(s.length>0)return s;var u=this.ZP(t);return u?[u]:t},t.prototype.ZP=function(t){var e=0!==this.constraints.minBitrate,i=this.constraints.maxBitrate!==_,n=t.filter(b.hasBitrate);return e?(0,S.findMaximum)(n,(function(t){return t.bitrate})):i?(0,S.findMinimum)(n,(function(t){return t.bitrate})):d.MimeTypeHelper.isVideo(this.mimeType)?this.aP(t):void 0},t.prototype.aP=function(t){var e=this.context.config.adaptation.resolution,i=e.minSelectableVideoHeight,n=e.maxSelectableVideoHeight,r=e.minSelectableVideoWidth,o=e.maxSelectableVideoWidth,a=t.filter(b.hasResolution);return 0!==i?(0,S.findMaximum)(a,(function(t){return t.height})):n!==1/0?(0,S.findMinimum)(a,(function(t){return t.height})):0!==r?(0,S.findMaximum)(a,(function(t){return t.width})):o!==1/0?(0,S.findMinimum)(a,(function(t){return t.width})):void 0},t.prototype.bP=function(){d.MimeTypeHelper.isVideo(this.mimeType)&&(this.context.config.adaptation.limitToPlayerSize&&!this.CO?this.dP():!this.context.config.adaptation.limitToPlayerSize&&this.CO&&this.cP())},t.prototype.cP=function(){this.CO=!1,this.context.config.adaptation.onVideoAdaptation=this.BO},t.prototype.dP=function(){var t=this;this.CO=!0;var e=this.context.config.adaptation.onVideoAdaptation;this.BO=e,this.context.config.adaptation.onVideoAdaptation=e&&"function"==typeof e?function(i){var n,r,o;return i.suggested=(0,m.AdaptToPlayerResolution)(t.context.internalPlayer,i.suggested,null!==(r=null===(n=t.zO)||void 0===n?void 0:n.isFullscreen())&&void 0!==r&&r)||i.suggested,null!==(o=(0,c.safeUserCallback)((function(){return e(i)}),t.context.logger))&&void 0!==o?o:i.suggested}:function(e){var i,n;return(0,m.AdaptToPlayerResolution)(t.context.internalPlayer,e.suggested,null!==(n=null===(i=t.zO)||void 0===i?void 0:i.isFullscreen())&&void 0!==n&&n)||e.suggested}},t.prototype.eP=function(t){return t?new g.RepresentationId(t,"auto"):new g.RepresentationId(new v.AdaptationSetId(p.DEFAULT_PERIOD_ID,this.mimeType),"auto")},t.prototype.fP=function(t){var e,i={id:t._id,bitrate:t._bandwidth,width:t._width,height:t._height};null===(e=this.context.store)||void 0===e||e.dispatch((0,s.addMetricsValue)(this.mimeType,u.MetricType.DownloadedAdaptationSet,i))},t.prototype.gP=function(){var t,e,i=this;if(this.DO){var r=this.DO.getAdaptationSet(this.yO);if(r){var o=n(n({},r),{Representation:this.XP(r.Representation),_minBandwidth:Math.max(null!==(t=r._minBandwidth)&&void 0!==t?t:0,this.constraints.minBitrate),_maxBandwidth:Math.min(null!==(e=r._maxBandwidth)&&void 0!==e?e:_,this.constraints.maxBitrate)});this.tO.setAdaptationSet(o),(0,f.yieldToMain)().then((function(){return i.fP(o)}))}}},t.prototype.hP=function(t){return this.yO&&t&&this.DO?this.DO.getRepresentation(this.yO,t):null},t.prototype.iP=function(){if(this.xO){var t=this.xO.representationId;this.xO=this.eP(this.yO);var e=this.hP(t);e&&(this.xO=e._internalId)}else this.xO=this.eP(this.yO)},t.prototype.setAdaptationSetId=function(t){this.yO=t,this.iP(),this.gP()},t.prototype.setFixedRepresentation=function(t){var e;if("auto"===t)this.xO=new g.RepresentationId(this.yO,"auto");else if(this.yO){var i=null===(e=this.DO)||void 0===e?void 0:e.getRepresentation(this.yO,t);i&&(this.xO=i._internalId,this.selectRepresentationID())}},t.prototype.getFixedRepresentation=function(){return this.uO},t.prototype.getLowestRepresentationId=function(){var t;return this.isAuto()?null===(t=this.tO.getLowestRepresentation())||void 0===t?void 0:t._internalId.representationId:this.xO.representationId},t.prototype.isAuto=function(){return"auto"===this.xO.representationId},t.prototype.shouldDownloadBeCancelled=function(t,e){var i,n,r,o,a,s,u,l=null!==(n=null===(i=this.context.config.adaptation)||void 0===i?void 0:i.disableDownloadCancelling)&&void 0!==n&&n,h=null!==(a=null===(o=null===(r=this.DO)||void 0===r?void 0:r.getAdaptationSet(this.yO))||void 0===o?void 0:o.Representation)&&void 0!==a?a:[],p=1===h.length,d=h.some((function(t){return Boolean(t._bandwidth)}));if(!this.isAuto()||l||p||!d)return!1;var c=function(t){if(!(0,S.hasTotalBytes)(t))return 1/0;var e=function(t){var e,i=null!==(e=t.elapsedTime)&&void 0!==e?e:0;return t.loadedBytes>0&&i>0?8*t.loadedBytes/1024/i:0}(t);return e>0?8*t.totalBytes/1024/e:1/0}(t),f=(null!==(u=null===(s=t.responseTiming)||void 0===s?void 0:s.doneTimestamp)&&void 0!==u?u:0)>0,v=!!t.segmentDuration&&c>1.5*t.segmentDuration;return!(f||!v)&&!function(t){return!!(0,S.hasTotalBytes)(t)&&t.loadedBytes>=.9*t.totalBytes}(t)&&this.tO.shouldDownloadBeCancelled(t,e)},t.prototype.setStartupPhase=function(){this.tO.setStartupPhase()},t.prototype.addSample=function(t){this.tO.addSample(n({timestamp:Date.now()},t))},t.prototype.shutdown=function(){this.tO.shutdown()},t.prototype.dispose=function(){var t,e;this.shutdown(),this.tO.dispose(),null===(t=this.vO)||void 0===t||t.call(this),null===(e=this.wO)||void 0===e||e.call(this)},t.prototype.selectQualityBasedOnBitrateMeasurement=function(t){var e=this.YP(t),i=this.EO();if(i)return(0,R.findQualityForBitrate)(i,e);if(this.HO()){var n=this.XP(this.JO()),r=this.WP(this.uO,n);if(r)return(0,R.findQualityForBitrate)(r._bandwidth,e)}return(0,R.findQualityForBitrate)(this.tO.getCurrentBitrateMeasurement(),e)},t}();function w(t,e,i){return t>=e&&t<=i}e.AdaptationHandler=T},49024:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.createAdaptationLogic=function(t,e,i,l){var h=i.minBitrate,p=i.maxBitrate;return void 0===l&&(l=n.AdaptationLogicType.DOWNLOAD_PREDICTION),l===n.AdaptationLogicType.LOW_LATENCY?new s.LowLatencyAbr(t,e):l===n.AdaptationLogicType.WISH?new u.WishLogic(t,e):l===n.AdaptationLogicType.DOWNLOAD_PREDICTION?new a.DownloadPredictionLogic(t,e):l===n.AdaptationLogicType.BUFFER_FILL_RATE?new r.BufferFillRateLogic(t,e):new o.BufferLogic(t,e,h||0,p||1/0)};var n=i(21281),r=i(48968),o=i(39201),a=i(85696),s=i(24296),u=i(7290)},49541:function(t,e,i){e.X=void 0;var n=i(85434),r=i(89498),o=i(83429),a=function(){function t(t){this.context=t,this.jm=new Map}return t.prototype.km=function(t){if(t){if(!this.jm.has(t)){var e=function(t,e){var i={minBitrate:0,maxBitrate:1/0};return n.MimeTypeHelper.isVideo(t)?(i.minBitrate=Number(e.MIN_SELECTABLE_VIDEO_BITRATE)||i.minBitrate,i.maxBitrate=Number(e.MAX_SELECTABLE_VIDEO_BITRATE)||i.maxBitrate):n.MimeTypeHelper.isAudio(t)&&(i.minBitrate=Number(e.MIN_SELECTABLE_AUDIO_BITRATE)||i.minBitrate,i.maxBitrate=Number(e.MAX_SELECTABLE_AUDIO_BITRATE)||i.maxBitrate),i}(t,this.context.settings);this.jm.set(t,new r.AdaptationHandler(this.context,t,e))}return this.jm.get(t)}},t.prototype.selectRepresentation=function(t,e,i){var n,r;return void 0===e&&(e={}),null!==(r=null===(n=this.km(t))||void 0===n?void 0:n.selectRepresentationID(e,i))&&void 0!==r?r:void 0},t.prototype.isAuto=function(t){var e,i;return null===(i=null===(e=this.km(t))||void 0===e?void 0:e.isAuto())||void 0===i||i},t.prototype.shouldDownloadBeCancelled=function(t,e,i){var n,r;return null!==(r=null===(n=this.km(t))||void 0===n?void 0:n.shouldDownloadBeCancelled(e,i))&&void 0!==r&&r},t.prototype.selectQualityBasedOnBitrateMeasurement=function(t,e){var i=e?this.jm.get(e):this.lm(),r=null;i||(r=null!=e?e:n.MimeType.VideoMp4,i=this.km(r));var o=null==i?void 0:i.selectQualityBasedOnBitrateMeasurement(t);return r&&this.release(r),null!=o?o:t[0]},t.prototype.lm=function(){var t=void 0;return this.jm.forEach((function(e,i){t&&!n.MimeTypeHelper.isVideo(i)||(t=e)})),t},t.prototype.setAdaptationSetId=function(t,e){var i;null===(i=this.km(t))||void 0===i||i.setAdaptationSetId(e)},t.prototype.setFixedRepresentation=function(t,e){var i;null===(i=this.km(t))||void 0===i||i.setFixedRepresentation(e)},t.prototype.getCurrentRepresentationId=function(t){var e,i;return null!==(i=null===(e=this.km(t))||void 0===e?void 0:e.getFixedRepresentation())&&void 0!==i?i:null},t.prototype.getLowestRepresentationId=function(t){var e;return null===(e=this.km(t))||void 0===e?void 0:e.getLowestRepresentationId()},t.prototype.setStartupPhase=function(t){var e;null===(e=this.km(t))||void 0===e||e.setStartupPhase()},t.prototype.shutdown=function(t){var e;null===(e=this.km(t))||void 0===e||e.shutdown()},t.prototype.addSample=function(t,e){var i;null===(i=this.km(t))||void 0===i||i.addSample(e)},t.prototype.getUserSelectedRepresentation=function(t,e,i){return(0,o.getUserSelectedRepresentation)(this.context,t,e,i)},t.prototype.release=function(t){var e;null===(e=this.jm.get(t))||void 0===e||e.dispose(),this.jm.delete(t)},t.prototype.dispose=function(){this.jm.forEach((function(t){return t.dispose()})),this.jm.clear()},t}();e.X=a},81723:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.BaseAdaptationLogic=void 0;var r=i(46151),o=i(15971),a=i(85434),s=i(89927),u=i(88844),l=i(59113),h=i(59406),p=i(70238),d=i(7676),c=function(){function t(t,e){this.context=t,this.mimeType=e,this.lastRateMeasurement=0,this.availableRepresentations=[],this.startupPhase=!0,this.lastDownloadCancelled=!1,this.monitoringMimeType=this.getMonitoringMimeType()}return t.prototype.getMonitoringMimeType=function(){var t,e=null,i=null===(t=this.context.store)||void 0===t?void 0:t.getState();return i&&(e=Object.keys((0,r.getMetricsState)(i)).find(a.MimeTypeHelper.isVideo)),null!=e?e:this.mimeType},t.prototype.updateAvailableRepresentations=function(t){t&&(this.availableRepresentations=t.map((function(t,e){return n(n({},t),{arrayIndex:e})})))},t.prototype.getAvailableRepresentations=function(){var t,e=this;return this.lastDownloadCancelled&&(null===(t=this.lastRepresentation)||void 0===t?void 0:t._bandwidth)?this.availableRepresentations.filter((function(t){var i=t._bandwidth;return e.lastRepresentation&&i<e.lastRepresentation._bandwidth})):this.availableRepresentations},t.prototype.setAdaptationSet=function(t){var e,i,n;if(this.updateAvailableRepresentations(t.Representation),this.lastRepresentation)this.lastRepresentation=this.findRepresentationForBitrate(this.lastRepresentation._bandwidth,t.Representation);else{var r=null===(n=null===(i=null===(e=(0,o.getSourceState)(this.context))||void 0===e?void 0:e.activeTracks)||void 0===i?void 0:i[t._internalId.adaptationSetId])||void 0===n?void 0:n.selectedRepresentationId;this.lastRepresentation=r?this.availableRepresentations.find((function(t){return t._internalId.equals(r)})):void 0}},t.prototype.findRepresentationForBitrate=function(t,e){var i,n;return this.updateAvailableRepresentations(e),null!==(n=null===(i=(0,l.findQualityForBitrate)(t,this.getAvailableRepresentations().map((function(t){return{rep:t,bitrate:Number(t._bandwidth)}}))))||void 0===i?void 0:i.rep)&&void 0!==n?n:this.getLowestRepresentation()},t.prototype.checkStartupPhase=function(t){this.startupPhase&&this.yhb(t)},t.prototype.getLowestRepresentation=function(){return(0,d.getLowestRepresentation)(this.availableRepresentations)},t.prototype.yhb=function(t){var e=this,i=this.context.bufferSettings.getForwardTargetLevel();this.startupPhaseTimerID||(this.startupPhaseTimerID=window.setTimeout((function(){e.startupPhase=!1,e.startupPhaseTimerID=void 0}),(0,s.toMilliSeconds)(i))),t.value>=.5*i&&((0,u.clearTimeoutIfDefined)(this.startupPhaseTimerID),this.startupPhase=!1,this.startupPhaseTimerID=void 0)},t.prototype.getRepresentationForNormalChange=function(t,e,i){return this.startupPhase||!i?this.getRepresentationForRateMeasurement(p.SwitchingAggressiveness.Mid):this.getRepresentationToSwitchTo(e.result,t.result)},t.prototype.getCurrentBitrate=function(t){return this.lastDownloadCancelled?this.lastRateMeasurement:t.value},t.prototype.getRepresentationToSwitchTo=function(t,e){if(this.lastDownloadCancelled)return this.switchDown(p.SwitchingAggressiveness.VeryHigh);switch(t){case h.Rules.SHOULD_SWITCH_UP:return this.ifFillStateHigh(e);case h.Rules.SHOULD_STAY:return this.ifFillStateMid(e);case h.Rules.SHOULD_SWITCH_DOWN:return this.ifFillStateLow(e);default:return this.useLastRepresentation()}},t.prototype.switchUp=function(t){var e;if(void 0===t&&(t=p.SwitchingAggressiveness.Conservative),void 0!==(null===(e=this.lastRepresentation)||void 0===e?void 0:e.arrayIndex)&&this.lastRepresentation.arrayIndex>=this.availableRepresentations.length-1)return this.lastRepresentation;var i=this.getRepresentationForRateMeasurement(t);return this.lastRepresentation&&Number(i._bandwidth)<=Number(this.lastRepresentation._bandwidth)?this.lastRepresentation:i},t.prototype.switchDown=function(t){var e,i,n,r;if(void 0===t&&(t=p.SwitchingAggressiveness.VeryHigh),void 0!==(null===(e=this.lastRepresentation)||void 0===e?void 0:e.arrayIndex)&&(null===(i=this.lastRepresentation)||void 0===i?void 0:i.arrayIndex)<1&&null!==(null===(n=this.lastRepresentation)||void 0===n?void 0:n._id))return this.lastRepresentation;var o=this.getRepresentationForRateMeasurement(t);return this.lastRepresentation&&(!o||o._bandwidth>=(null===(r=this.lastRepresentation)||void 0===r?void 0:r._bandwidth))&&(o=this.getOneRepresentationLower()),o},t.prototype.stay=function(){var t;return null!==(t=this.lastRepresentation)&&void 0!==t?t:this.getLowestRepresentation()},t.prototype.ifFillStateHigh=function(t){switch(t){case h.Rules.SHOULD_SWITCH_UP:return this.switchUp(p.SwitchingAggressiveness.VeryHigh);case h.Rules.SHOULD_STAY:return this.switchUp(p.SwitchingAggressiveness.High);case h.Rules.SHOULD_SWITCH_DOWN:default:return this.stay()}},t.prototype.ifFillStateMid=function(t){switch(t){case h.Rules.SHOULD_SWITCH_UP:return this.switchUp(p.SwitchingAggressiveness.Mid);case h.Rules.SHOULD_STAY:return this.stay();case h.Rules.SHOULD_SWITCH_DOWN:return this.switchDown(p.SwitchingAggressiveness.High);default:return this.stay()}},t.prototype.ifFillStateLow=function(t){switch(t){case h.Rules.SHOULD_SWITCH_UP:return this.stay();case h.Rules.SHOULD_STAY:return this.switchDown(p.SwitchingAggressiveness.High);case h.Rules.SHOULD_SWITCH_DOWN:return this.switchDown(p.SwitchingAggressiveness.VeryHigh);default:return this.stay()}},t.prototype.useLastRepresentation=function(){var t;return(null===(t=this.lastRepresentation)||void 0===t?void 0:t._id)?this.lastRepresentation:this.getLowestRepresentation()},t.prototype.getOneRepresentationLower=function(){var t,e,i=Math.max(0,(null!==(e=null===(t=this.lastRepresentation)||void 0===t?void 0:t.arrayIndex)&&void 0!==e?e:0)-1);return this.availableRepresentations[i]},t}();e.BaseAdaptationLogic=c},48968:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.BufferFillRateLogic=void 0;var r=i(46151),o=i(33436),a=i(88844),s=i(81723),u=i(4865),l=i(20066),h=i(64463),p=i(70238),d=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.ofb=0,n.shouldDownloadBeCancelled=function(t,e){var i,r;return 0!==(null===(i=n.lastRepresentation)||void 0===i?void 0:i.arrayIndex)&&n.tfb()._id!==(null===(r=n.lastRepresentation)||void 0===r?void 0:r._id)&&(n.lastDownloadCancelled=!0,!0)},n.nfb={bufferFillRate:new l.BufferFillRateRule(n.context,n.monitoringMimeType),bufferFillState:(0,h.BufferFillStateRule)(n.context,n.monitoringMimeType),rateMeasurement:new u.BlockBasedRateMeasurementRule(n.context,n.monitoringMimeType)},n}return n(e,t),e.prototype.getRepresentationForRateMeasurement=function(t){void 0===t&&(t=p.SwitchingAggressiveness.Mid);var e=this.nfb.rateMeasurement.getStatus(t),i=this.context.settings.RATE_SAFETY_MARGIN_PERCENTAGE/100,n=e.value*(1-i);return this.findRepresentationForBitrate(n)},e.prototype.addSample=function(t){Object.values(this.nfb).forEach((function(e){return e.addSample(t)}))},e.prototype.pfb=function(t){return this.switchDown(p.SwitchingAggressiveness.VeryHigh)},e.calcEstimatedDownloadDuration=function(t,e,i,n){var r=parseFloat((i*t/e).toFixed(2));return n&&(r*=2),1.1*r},e.prototype.qfb=function(t,i,n,r,o){var a=e.calcEstimatedDownloadDuration(n,t,i,o);return a<r||a<=n},e.prototype.rfb=function(t,e,i,n){var r,o,a,s=null==t?void 0:t.hlsDependentSegments;if(s&&null!==(null===(r=this.lastRepresentation)||void 0===r?void 0:r._id)&&(null===(o=this.lastRepresentation)||void 0===o?void 0:o.arrayIndex)!==e.arrayIndex){var u=Math.min.apply(null,this.availableRepresentations.map((function(t){return Number(t._bandwidth)}))),l=Number(e._bandwidth);if(!(isFinite(l)&&l===u||this.qfb(i,e._bandwidth,t.segmentDuration,n,s))){for(var h=!1,p=null!==(a=e.arrayIndex)&&void 0!==a?a:-1;p>=0;p--){var d=this.availableRepresentations[p];if(this.qfb(i,d._bandwidth,t.segmentDuration,n,s)){e=d,h=!0;break}}h||(e=this.useLastRepresentation())}}return e},e.prototype.sfb=function(t){var e,i=this.lastRateMeasurement>0&&2*t<=this.lastRateMeasurement;return i&&(null===(e=this.lastRepresentation)||void 0===e?void 0:e._id)?1.5*t<this.lastRepresentation._bandwidth:i},e.prototype.tfb=function(t){var e,i,n=this.context.store.getState();n&&(i=(0,r.getMetricsState)(n));var a,s=this.nfb.bufferFillState.getStatus(),u=this.nfb.bufferFillRate.getStatus(),l=this.nfb.rateMeasurement.getStatus(1).value,h=null!=i&&this.context.bufferSettings.getForwardTargetLevel()>i.default.bufferLogicActivationThreshold,d=this.sfb(l);this.checkStartupPhase(s),a=d?this.pfb(l):this.getRepresentationForNormalChange(u,s,h);var c=(0,r.getMetricsLastEntry)(null!=i?i:{},this.mimeType,o.MetricType.StalledSeconds).value;return c>this.ofb?(this.ofb=c,this.switchDown(p.SwitchingAggressiveness.MidHigh)):(a=this.rfb(t,a,l,s.value),this.lastRateMeasurement=l,this.lastDownloadCancelled&&void 0!==a.arrayIndex&&void 0!==(null===(e=this.lastRepresentation)||void 0===e?void 0:e.arrayIndex)&&a.arrayIndex>=this.lastRepresentation.arrayIndex&&(a=this.getOneRepresentationLower(),this.lastDownloadCancelled=!1),a)},e.prototype.selectRepresentationID=function(t,e){return this.updateAvailableRepresentations(e),this.lastRepresentation=this.tfb(t),this.lastRepresentation._internalId},e.prototype.setAdaptationSet=function(e){var i;t.prototype.setAdaptationSet.call(this,e),null!==(i=this.lastRepresentation)&&void 0!==i||(this.lastRepresentation={_id:null,_bandwidth:0,arrayIndex:-1})},e.prototype.getCurrentBitrateMeasurement=function(){return this.getCurrentBitrate(this.nfb.rateMeasurement.getStatus())},e.prototype.getAvailableRepresentations=function(){return this.availableRepresentations},e.prototype.setStartupPhase=function(){this.startupPhase=!0,(0,a.clearTimeoutIfDefined)(this.startupPhaseTimerID),this.startupPhaseTimerID=void 0,Object.values(this.nfb).forEach((function(t){return t.setStartupPhase()}))},e.prototype.shutdown=function(){(0,a.clearTimeoutIfDefined)(this.startupPhaseTimerID),this.startupPhaseTimerID=void 0,this.lastDownloadCancelled=!1,Object.values(this.nfb).forEach((function(t){return t.shutdown()}))},e.prototype.dispose=function(){this.shutdown(),Object.values(this.nfb).forEach((function(t){return t.dispose()})),this.nfb={},this.lastRepresentation=void 0,this.availableRepresentations=[]},e}(s.BaseAdaptationLogic);e.BufferFillRateLogic=d},39201:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.BufferLogic=void 0;var n=i(85434),r=i(96533),o=i(7676),a=function(){function t(t,e,i,r){this.context=t,this.mimeType=e,this.minSelectableBitrate=i,this.maxSelectableBitrate=r,this.yfb=[],this.ufb=n.MimeTypeHelper.getMediaType(this.mimeType),this.xfb={timestamp:Date.now(),bufferLevel:0,bufferTargetLevel:0}}return t.prototype.zfb=function(t){t&&(this.yfb=t)},t.prototype.Afb=function(){return(0,r.findLowestPossibleBandwidthFromRepresentations)(this.yfb,this.minSelectableBitrate)},t.prototype.Bfb=function(){var t;return null===(t=this.findRepresentationForBitrate(this.maxSelectableBitrate))||void 0===t?void 0:t._bandwidth},t.prototype.Cfb=function(){return this.context.bufferSettings.getForwardTargetLevel(this.ufb)},t.prototype.Dfb=function(){var t=this.Afb(),e=this.Bfb();return this.wfb=this.Cfb(),function(t,e,i){var n=[];0===e&&(e=t);var r=2*Math.floor(.1*i),o=8*Math.floor(.1*i);o<=r&&(o=Math.floor(.9*i)),r<=1&&(r=1);for(var a=(e-t)/(o-r),s=t-a*r,u=0;u<r;u++)n[u]=t;for(u=r;u<o;u++)n[u]=Math.floor(a*u+s);for(u=o;u<=i;u++)n[u]=e;return n}(t,e||t,this.wfb)},t.prototype.Efb=function(){var t=this.Cfb();this.wfb!==t&&(this.vfb=this.Dfb())},t.prototype.findRepresentationForBitrate=function(t,e){return this.zfb(e),(0,r.getMatchingRepresentationByBandwidth)(this.yfb,t)},t.prototype.Ffb=function(){var t,e=this.Cfb(),i=this.xfb.bufferLevel;return(i=Math.floor(i))>e&&(i=e),t=this.vfb.hasOwnProperty(i)?this.vfb[i]:this.vfb[0],this.findRepresentationForBitrate(t)},t.prototype.selectRepresentationID=function(t,e){this.zfb(e);var i=this.Ffb();return this.Efb(),i._internalId},t.prototype.setAdaptationSet=function(t){this.zfb(t.Representation),this.vfb=this.Dfb()},t.prototype.shouldDownloadBeCancelled=function(){return!1},t.prototype.setStartupPhase=function(){},t.prototype.shutdown=function(){},t.prototype.addSample=function(t){this.xfb=t},t.prototype.dispose=function(){this.vfb=[]},t.prototype.getCurrentBitrateMeasurement=function(){return 0},t.prototype.getLowestRepresentation=function(){return(0,o.getLowestRepresentation)(this.yfb)},t}();e.BufferLogic=a},11958:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.CancellableAdaptationLogic=void 0;var r=i(80813),o=i(4131),a=i(21281),s=i(46151),u=i(33436),l=i(81199),h=i(81723),p=i(39185),d=i(45199),c=i(17006),f=i(70238),v=i(7676),g=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.shouldDownloadBeCancelled=function(t,e){var i,r,a=null!==(i=t.elapsedTime)&&void 0!==i?i:-1,s=null===(r=n.Thb)||void 0===r?void 0:r.isPaused(),u=n.isStartupBitrateInEffect(),l=function(t){var e,i=null!==(e=t.elapsedTime)&&void 0!==e?e:-1;return i<0?0:i-y(t)}(t),h=n.Uhb(e),p=(0,o.hasLoadedData)(t),d=p?l>n.context.settings.MIN_EFFECTIVE_SEGMENT_DOWNLOAD_TIME:a>n.context.settings.MIN_EFFECTIVE_SEGMENT_DOWNLOAD_TIME;return!(s||u||h||!d)&&n.hhb(t,l,p,a)},n.timeToFirstByteMeasurementRule=new d.TimeToFirstByteMeasurementRule(n.context,n.monitoringMimeType),n.rateMeasurementRule=new p.SegmentBasedRateMeasurementRule(n.context,n.monitoringMimeType),n}return n(e,t),Object.defineProperty(e.prototype,"Shb",{get:function(){return this.context.serviceManager.get(r.ServiceName.ManifestService,this.context.sourceContext.sourceIdentifier)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Thb",{get:function(){return this.context.serviceManager.get(r.ServiceName.PlayerStateService)},enumerable:!1,configurable:!0}),e.prototype.setAdaptationSet=function(e){t.prototype.setAdaptationSet.call(this,e),this.previousRequestProgress=void 0},e.prototype.isStartupBitrateInEffect=function(){var t,e=this.context.store.getState(),i=e?(0,s.getMetricsHistoryFromInstanceState)(e,this.mimeType,u.MetricType.DownloadInformation):[],n=Boolean(null===(t=this.context.config.adaptation)||void 0===t?void 0:t.startupBitrate),r=i.filter((function(t){return Boolean(t.value)})).length>0;return n&&!r},e.prototype.Uhb=function(t){return!!t&&this.getLowestRepresentation()._internalId.equals(t)},e.prototype.Vhb=function(){return(0,l.getPlayableBufferLevel)(this.context.internalPlayer)},e.prototype.estimateTimeToFirstByte=function(t){var e;switch(void 0===t&&(t=0),e=0!==t?this.timeToFirstByteMeasurementRule.estimateStatus(t,5,.2).value:this.timeToFirstByteMeasurementRule.getStatus(5,.2).value,function(t){var e,i;return null!==(i=null===(e=t.adaptation)||void 0===e?void 0:e.rttEstimationMethod)&&void 0!==i?i:a.RttEstimationMethod.WeightedAverage}(this.context.config)){case a.RttEstimationMethod.Median:return e.median;case a.RttEstimationMethod.WeightedAverage:default:return e.standardDeviation>e.mean?e.mean+e.standardDeviation:e.weightedAverage}},e.prototype.Whb=function(t,e,i,n,r,o){var a,l,h,p,d,f,v,g=n*e/i+r,y=null!==(l=null===(a=this.Shb)||void 0===a?void 0:a.isManifestFetchRequired(t))&&void 0!==l&&l,b=!this.Yhb(t),R=null!==(h=null==o?void 0:o.hlsDependentSegments)&&void 0!==h&&h,S=null!==(d=null===(p=this.Shb)||void 0===p?void 0:p.getRepresentationById(t))&&void 0!==d?d:null,_=Boolean(this.lastRepresentation)&&null!==(null===(f=this.lastRepresentation)||void 0===f?void 0:f._id)&&(null===(v=this.lastRepresentation)||void 0===v?void 0:v.arrayIndex)!==(null==S?void 0:S.arrayIndex),T=this.context.store.getState(),w=g;if(w+=function(t,e,i){var n=t?(0,s.getMetricsState)(t):{};return m((0,s.getMetricsHistory)(n,e,u.MetricType.DecryptionTime),i)+m((0,s.getMetricsHistory)(n,e,u.MetricType.TransmuxingTime),i)}(T,this.mimeType,t),R&&_&&(w*=2),b&&(w+=r),y){var M=function(t){var e=t?(0,s.getMetricsState)(t):{};return function(t){var e=(0,s.getMetricsHistory)(t,"default",u.MetricType.DownloadInformation).slice(-3).map((function(t){return t.value.time}));return(0,c.calculateExponentialWeightedAverage)(e,.8)}(e)+function(t){var e=(0,s.getMetricsHistory)(t,"default",u.MetricType.ProcessingTime).slice(-3).map((function(t){return t.value}));return(0,c.calculateExponentialWeightedAverage)(e,.8)}(e)}(T);w+=Math.max(M,r)}return w},e.prototype.Xhb=function(t,e,i,n){var r=1-this.context.settings.DOWNLOAD_DURATION_SAFETY_MARGIN,o=(n?this.context.settings.MAXIMUM_DOWNLOAD_DURATION_MULTIPLIER_SAME_QUALITY:this.context.settings.MAXIMUM_DOWNLOAD_DURATION_MULTIPLIER)-r,a=r+Math.min(e,i)*o/i;return Math.min(t*a,i)},e.prototype.isDownloadFeasible=function(t,e,i,n,r,o,a){var s,u=t.arrayIndex===(null===(s=this.lastRepresentation)||void 0===s?void 0:s.arrayIndex),l=this.Xhb(i,o,a,u);return this.Whb(t._internalId,i,e,t._bandwidth,r,{hlsDependentSegments:n})<=l},e.prototype.Yhb=function(t){var e,i,n=this.context.store.getState(),r=n?(0,s.getMetricsHistoryFromInstanceState)(n,this.mimeType,u.MetricType.CachedInitSegments):[];return 0===r.length?null!==(i=null===(e=this.Shb)||void 0===e?void 0:e.hasSelfInitialisingSegments())&&void 0!==i&&i:r.some((function(e){var i=e.hasOwnProperty("value")&&e.value.hasOwnProperty("internalRepId")?e.value.internalRepId:null;return null!==i&&i.equals(t)}))},e.prototype.Zhb=function(t,e,i){var n=this;void 0===i&&(i=this.estimateTimeToFirstByte());var r=this.availableRepresentations.filter((function(t){var e;return n.lastRepresentation&&!t._internalId.equals(null===(e=n.lastRepresentation)||void 0===e?void 0:e._internalId)}));return Math.min.apply(Math,r.map((function(r){var o;return n.Whb(r._internalId,null!==(o=n.lastSegmentInfo?n.lastSegmentInfo.segmentDuration:e)&&void 0!==o?o:0,t,r._bandwidth,i,n.lastSegmentInfo)})))},e.prototype.ahb=function(t){var e,i,n,r,o,a,s=null!==(e=t.elapsedTime)&&void 0!==e?e:0,u=(null===(i=this.previousRequestProgress)||void 0===i?void 0:i.url)===t.url?(t.loadedBytes-(null!==(r=null===(n=this.previousRequestProgress)||void 0===n?void 0:n.loadedBytes)&&void 0!==r?r:0))/(s-(null!==(a=null===(o=this.previousRequestProgress)||void 0===o?void 0:o.elapsedTime)&&void 0!==a?a:0)):-1;return this.previousRequestProgress=t,u},e.prototype.bhb=function(t,e){var i,n=e?y(t):null!==(i=t.elapsedTime)&&void 0!==i?i:0;return this.estimateTimeToFirstByte(n)},e.prototype.chb=function(t){return void 0===t&&(t=4),this.lastRepresentation?this.lastRepresentation._bandwidth/8*t*1.2:0},e.prototype.dhb=function(t,e){var i=(0,o.hasLoadedData)(t),n=i?this.ahb(t):0,r=i&&(0,v.hasTotalBytes)(t)?t.totalBytes-t.loadedBytes:this.chb(t.segmentDuration);return Math.min(r/(e/8),n>0?r/n:1/0)},e.prototype.ehb=function(t,e,i){if((0,o.hasLoadedData)(t))return t.loadedBytes/e*8;var n=this.context.bufferSettings.getForwardTargetLevel(),r=this.rateMeasurementRule.getStatus(f.SwitchingAggressiveness.Mid,i/n);return this.getCurrentBitrate(r)},e.prototype.fhb=function(t,e,i,n,r){var o=this.dhb(n,i);return o>e&&o>r&&e<=r+t},e.prototype.ghb=function(t,e,i,n){var r,o;if(null!==(o=null===(r=this.Thb)||void 0===r?void 0:r.isPlay())&&void 0!==o&&o)return!1;var a=function(t){return t.getStatus(5,.2).value.mean}(this.timeToFirstByteMeasurementRule);return n>Math.max(t,3*a)&&e<=i+t},e.prototype.hhb=function(t,e,i,n){var r,o,a,s=this.Vhb(),u=this.ehb(t,e,s),l=this.bhb(t,i),h=null!==(a=null!==(r=t.segmentDuration)&&void 0!==r?r:null===(o=this.lastSegmentInfo)||void 0===o?void 0:o.segmentDuration)&&void 0!==a?a:0,p=this.Zhb(u,h,l);return!!(i?this.fhb(h,s,u,t,p):this.ghb(h,s,p,n))&&((0,v.hasTotalBytes)(t)&&(t.loadedBytes/t.totalBytes*100).toFixed(1),this.lastDownloadCancelled=!0,this.lastRateMeasurement=u,!0)},e}(h.BaseAdaptationLogic);function y(t){var e,i,n,r,o=null!==(i=null===(e=t.responseTiming)||void 0===e?void 0:e.openedTimestamp)&&void 0!==i?i:-1,a=null!==(r=null===(n=t.responseTiming)||void 0===n?void 0:n.headersReceivedTimestamp)&&void 0!==r?r:-1;return o<0||a<0?0:a-o}function m(t,e){var i=t.filter((function(t){return t.value.representationId.equals(e)})).slice(-3).map((function(t){return t.value.time}));return(0,c.calculateExponentialWeightedAverage)(i,.8)}e.CancellableAdaptationLogic=g},85696:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.DownloadPredictionLogic=void 0,i(13531);var r=i(70962),o=i(46151),a=i(88844),s=i(11958),u=i(64463),l=i(43829),h=i(70238),p=i(7676),d=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.Gfb=new l.DownloadRateRule(n.context,n.monitoringMimeType),n.Hfb=(0,u.BufferFillStateRule)(n.context,n.monitoringMimeType),n}return n(e,t),e.prototype.getRepresentationForRateMeasurement=function(t){void 0===t&&(t=h.SwitchingAggressiveness.Mid);var e=this.context.bufferSettings.getForwardTargetLevel(),i=this.Hfb.getStatus().value,n=this.rateMeasurementRule.getStatus(t,i/e),r=this.getCurrentBitrate(n),o=(0,p.adjustRateToSafetyMargin)(r,this.context.settings.RATE_SAFETY_MARGIN_PERCENTAGE);return this.findRepresentationForBitrate(o)},e.prototype.getCurrentBitrateMeasurement=function(){var t=this.getCurrentBitrate(this.rateMeasurementRule.getStatus());return(0,p.adjustRateToSafetyMargin)(t,this.context.settings.RATE_SAFETY_MARGIN_PERCENTAGE)},e.prototype.addSample=function(t){this.Gfb.addSample(t),this.Hfb.addSample(t),this.rateMeasurementRule.addSample(),this.timeToFirstByteMeasurementRule.addSample()},e.prototype.Ifb=function(t,e,i,n,r){var o=this;if(!t.segmentDuration||this.isStartupBitrateInEffect())return e;this.lastSegmentInfo=t;var a=this.availableRepresentations.filter((function(t){return t._bandwidth<=e._bandwidth}));if(0===a.length)return this.availableRepresentations[0];var s=r.value||0,u=this.context.bufferSettings.getForwardTargetLevel(),l=(0,p.adjustRateToSafetyMargin)(i,this.context.settings.RATE_SAFETY_MARGIN_PERCENTAGE),h=a.filter((function(e){var i;return o.isDownloadFeasible(e,l,null!==(i=t.segmentDuration)&&void 0!==i?i:0,!1,n,s,u)}));return 0===h.length?a[0]:h[h.length-1]},e.prototype.Jfb=function(t,e,i,n){var a,s;this.checkStartupPhase(e);var u=this.context.store.getState(),l=null!==(s=null===(a=(u?(0,o.getMetricsState)(u):{}).default)||void 0===a?void 0:a.bufferLogicActivationThreshold)&&void 0!==s?s:r.DefaultSettings.BUFFER_LOGIC_ACTIVATION_THRESHOLD,h=this.context.bufferSettings.getForwardTargetLevel()>l,p=this.getRepresentationForNormalChange(i,e,h);if(n){var d=this.estimateTimeToFirstByte();p=this.Ifb(n,p,t,d,e)}return p},e.prototype.selectRepresentationID=function(t,e){var i,n,r;this.updateAvailableRepresentations(e);var o=this.rateMeasurementRule.getStatus(),a=this.getCurrentBitrate(o),s=this.Hfb.getStatus(),u=this.Gfb.getStatus(),l=this.Jfb(a,s,u,t);return this.lastRepresentation&&(null===(n=null===(i=this.lastRepresentation)||void 0===i?void 0:i._internalId)||void 0===n||n.equals(null==l?void 0:l._internalId)),this.lastRepresentation=l,this.lastRateMeasurement=a,this.lastDownloadCancelled=!1,this.previousRequestProgress=void 0,null===(r=this.lastRepresentation)||void 0===r?void 0:r._internalId},e.prototype.setStartupPhase=function(){var t,e,i,n;this.startupPhase=!0,(0,a.clearTimeoutIfDefined)(this.startupPhaseTimerID),this.startupPhaseTimerID=void 0,null===(t=this.Gfb)||void 0===t||t.setStartupPhase(),null===(e=this.Hfb)||void 0===e||e.setStartupPhase(),null===(i=this.rateMeasurementRule)||void 0===i||i.setStartupPhase(),null===(n=this.timeToFirstByteMeasurementRule)||void 0===n||n.setStartupPhase()},e.prototype.shutdown=function(){var t,e,i,n;(0,a.clearTimeoutIfDefined)(this.startupPhaseTimerID),this.startupPhaseTimerID=void 0,this.lastDownloadCancelled=!1,this.previousRequestProgress=void 0,null===(t=this.Gfb)||void 0===t||t.shutdown(),null===(e=this.Hfb)||void 0===e||e.shutdown(),null===(i=this.rateMeasurementRule)||void 0===i||i.shutdown(),null===(n=this.timeToFirstByteMeasurementRule)||void 0===n||n.shutdown()},e.prototype.dispose=function(){var t,e,i,n;this.shutdown(),null===(t=this.Gfb)||void 0===t||t.dispose(),null===(e=this.Hfb)||void 0===e||e.dispose(),null===(i=this.rateMeasurementRule)||void 0===i||i.dispose(),null===(n=this.timeToFirstByteMeasurementRule)||void 0===n||n.dispose(),this.lastRepresentation=void 0,this.availableRepresentations=[]},e}(s.CancellableAdaptationLogic);e.DownloadPredictionLogic=d},76344:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AdaptationModuleDefinition=void 0;var n=i(62756),r=i(98154),o=i(7676);e.AdaptationModuleDefinition={name:n.ModuleName.ABR,module:function(){return{AdaptationService:i(49541).X,AdaptToPlayerResolution:i(19119).AdaptToPlayerResolution,AdaptationUtils:o,AdaptationApiFactory:r.AdaptationApiFactory}},dependencies:[n.ModuleName.EngineBitmovin]},e.default=e.AdaptationModuleDefinition},19119:function(t,e){function i(t){return t&&t.clientWidth&&t.clientHeight?{width:t.clientWidth*devicePixelRatio,height:t.clientHeight*devicePixelRatio}:null}Object.defineProperty(e,"__esModule",{value:!0}),e.AdaptToPlayerResolution=function(t,e,n){var r,o=function(t,e){var n=e.getVideoElement();if(!n)return null;var r=n.parentElement,o=r&&r.querySelector("#bitmovinplayer-vr-canvas");return t?{width:screen.width*devicePixelRatio,height:screen.height*devicePixelRatio}:i(n)||o&&i(o)||r&&i(r)}(n,t);if(!o)return e;var a=null!==(r=t.getAvailableVideoQualities())&&void 0!==r?r:[],s=a.find((function(t){return t.id===e}));if(!s)return e;var u=function(t,e,i){return t.filter((function(t){var n=t.bitrate<=e,r=function(t,e){var i=e.width/e.height;return t.width/t.height<i?e.width>=t.width:e.height>=t.height}(i,t);return n&&r}))}(a,s.bitrate,o);return 0===u.length?e:u[function(t){var e=t.findIndex((function(e){return e.width>t[0].width&&e.height>t[0].height}))-1;return Math.max(0,e)}(u)].id}},43008:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.hasBitrate=function(t){return null!=t.bitrate},e.hasBitrateBounds=function(t){return null!=t.minBitrate&&null!=t.maxBitrate},e.hasResolution=function(t){return null!=t.height&&null!=t.width}},59113:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.findQualityForBitrate=function(t,e){if(e&&0!==e.length)return e.reduce((function(e,i){var n=r(i),o={entry:i,bitrate:n};return e.bitrate>t||n>t?n>e.bitrate?e:o:n>e.bitrate?o:e}),{entry:e[0],bitrate:r(e[0])}).entry};var n=i(43008);function r(t){return(0,n.hasBitrate)(t)&&t.bitrate>0?t.bitrate:(0,n.hasBitrateBounds)(t)?(t.maxBitrate+t.minBitrate)/2:0}},17006:function(t,e){function i(t){return t.length>0?t.reduce((function(t,e){return t+e}),0)/t.length:0}Object.defineProperty(e,"__esModule",{value:!0}),e.calculateExponentialWeightedAverage=void 0,e.calculateMean=i,e.calculateStandardDeviation=function(t,e){if(void 0===e&&(e=i(t)),t.length<2)return 0;var n=t.reduce((function(t,i){return t+Math.pow(i-e,2)}),0),r=1/(t.length-1)*n;return Math.sqrt(r)},e.calculateMedian=function(t){var e=t.slice(0).sort((function(t,e){return t-e}));return 0===e.length?0:e.length%2==1?e[Math.floor(e.length/2)]:.5*(e[e.length/2-1]+e[e.length/2])},e.calculateExponentialWeightedAverage=function(t,i,n){return void 0===n&&(n=t.length-1),0===t.length||n<0?0:0===n||0===i?t[n]:i*t[n]+(1-i)*(0,e.calculateExponentialWeightedAverage)(t,i,n-1)}},70238:function(t,e){var i;Object.defineProperty(e,"__esModule",{value:!0}),e.SwitchingAggressiveness=void 0,function(t){t[t.Conservative=10]="Conservative",t[t.VeryLow=8]="VeryLow",t[t.Low=7]="Low",t[t.LowMid=6]="LowMid",t[t.Mid=5]="Mid",t[t.MidHigh=4]="MidHigh",t[t.High=3]="High",t[t.VeryHigh=2]="VeryHigh",t[t.Extreme=1]="Extreme"}(i||(e.SwitchingAggressiveness=i={}))},7676:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.toMbps=e.toKbps=e.findMaximum=e.findMinimum=void 0,e.getMaxStartupBitrateFromConfig=function(t){var e,i=null===(e=t.config)||void 0===e?void 0:e.adaptation;if(!i)return 0;var r=function(t){return t.maxStartupBitrate?n.Util.extractBitrateFromString("max",t.maxStartupBitrate):1/0}(i);return!isNaN(r)&&isFinite(r)?r:0},e.getStartupBitrateFromConfig=function(t){var e,i=null===(e=t.config)||void 0===e?void 0:e.adaptation,r=t.settings;if(!i||!r)return 0;var o=i.startupBitrate||0;if(!o)return 0;var a=function(t,e){var i=n.Util.extractBitrateFromString("min",t);return i*=1+e/100,i+=8}(o,r.RATE_SAFETY_MARGIN_PERCENTAGE);return!isNaN(a)&&isFinite(a)?a:0},e.findExtremum=r,e.hasTotalBytes=function(t){return void 0!==t.totalBytes},e.adjustRateToSafetyMargin=function(t,e){return t*(1-e/100)},e.getLowestRepresentation=function(t){return(0,e.findMinimum)(t,(function(t){return t._bandwidth}))};var n=i(70850);function r(t,e){return t[t.reduce((function(i,n,r){return e(t[i],t[r])?i:r}),0)]}var o=function(t){return t};e.findMinimum=function(t,e){return void 0===e&&(e=o),r(t,(function(t,i){return e(t)<e(i)}))},e.findMaximum=function(t,e){return void 0===e&&(e=o),r(t,(function(t,i){return e(t)>e(i)}))},e.toKbps=function(t){return t/Math.pow(2,10)},e.toMbps=function(t){return t/Math.pow(2,20)}},7290:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.WishLogic=void 0;var r=i(44468),o=i(70962),a=i(46151),s=i(33436),u=i(85434),l=i(88844),h=i(11958),p=i(59113),d=i(59406),c=i(70238),f=i(7676),v=i(47577),g=1e-4,y=1e-4,m=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.context=e,n.mimeType=i,n.Lfb=[],n.Mfb=[],n.Nfb=0,n.Sfb(),n.Kfb=e.settings.WISH_ABR_PARAMS,n}return n(e,t),Object.defineProperty(e.prototype,"Ofb",{get:function(){var t,e=u.MimeTypeHelper.isVideo(this.mimeType)?r.MediaType.Video:r.MediaType.Audio,i=null!==(t=this.context.internalPlayer.bufferApi.getLevel(r.BufferType.ForwardDuration,e).level)&&void 0!==t?t:0;return i>this.context.bufferSettings.getTargetLevel(r.BufferType.ForwardDuration,e)+this.Nfb?0:i},enumerable:!1,configurable:!0}),e.prototype.Sfb=function(){var t=this.context.settings.WISH_ABR_PARAMS.BITRATE_MODIFIER_FUNCTION_TYPE,e=this.context.settings.WISH_ABR_PARAMS.TARGET_BUFFER_FACTOR,i=this.context.settings.WISH_ABR_PARAMS.TARGET_BITRATE_FACTOR;if(!["log","linear"].includes(t)){var n=o.WishDefaultConfig.BITRATE_MODIFIER_FUNCTION_TYPE;this.context.settings.WISH_ABR_PARAMS.BITRATE_MODIFIER_FUNCTION_TYPE=n}if(e>1||e<g){var r=Math.min(Math.max(e,g),1);this.context.settings.WISH_ABR_PARAMS.TARGET_BUFFER_FACTOR=r}if(i<y){var a=Math.max(i,y);this.context.settings.WISH_ABR_PARAMS.TARGET_BITRATE_FACTOR=a}},e.prototype.getRepresentationForRateMeasurement=function(t){void 0===t&&(t=c.SwitchingAggressiveness.Mid);var e=this.context.bufferSettings.getForwardTargetLevel(),i=this.rateMeasurementRule.getStatus(t,this.Ofb/e),n=this.getCurrentBitrate(i),r=(0,f.adjustRateToSafetyMargin)(n,this.context.settings.RATE_SAFETY_MARGIN_PERCENTAGE);return this.findRepresentationForBitrate(r)},e.prototype.Tfb=function(){var t=this.context.store.getState();return(t?(0,a.getMetricsHistoryFromInstanceState)(t,this.mimeType,s.MetricType.DownloadInformation):[]).filter((function(t){return Boolean(t.value)})).length>2},e.prototype.addSample=function(t){(function(t){return null!=t.segmentDuration})(t)&&(this.rateMeasurementRule.addSample(),this.timeToFirstByteMeasurementRule.addSample(),t.segmentDuration!==this.Nfb&&(this.Nfb=t.segmentDuration,this.egb()))},e.prototype.selectRepresentationID=function(t,e){var i;this.updateAvailableRepresentations(e),this.checkStartupPhase({value:this.Ofb,result:d.Rules.SHOULD_STAY});var n=this.ggb(),r=null===(i=n.rep)||void 0===i?void 0:i._internalId,o=n.index;return this.Mfb.push(this.Lfb[o]),this.Mfb.length>20&&(this.Mfb=this.Mfb.slice(-10)),this.lastSegmentInfo=t,this.lastRepresentation=n.rep,this.lastRateMeasurement=this.getCurrentBitrate(this.rateMeasurementRule.getStatus()),this.lastDownloadCancelled=!1,this.previousRequestProgress=void 0,r},e.prototype.getCurrentBitrateMeasurement=function(){return this.rateMeasurementRule.getStatus().value},e.prototype.setAdaptationSet=function(e){t.prototype.setAdaptationSet.call(this,e);var i=this.getAvailableRepresentations().map((function(t){return(0,f.toKbps)(t._bandwidth)}));this.Lfb=(0,v.applyQualityFunction)(i,this.Kfb.BITRATE_MODIFIER_FUNCTION_TYPE),this.egb()},e.prototype.findRepresentationForBitrate=function(t,e){var i,n=(0,p.findQualityForBitrate)(t,this.getAvailableRepresentations().map((function(t){return{rep:t,bitrate:t._bandwidth}})));return null!==(i=null==n?void 0:n.rep)&&void 0!==i?i:this.getLowestRepresentation()},e.prototype.setStartupPhase=function(){this.startupPhase=!0,(0,l.clearTimeoutIfDefined)(this.startupPhaseTimerID),this.startupPhaseTimerID=void 0},e.prototype.shutdown=function(){var t,e;this.lastRateMeasurement=0,this.lastDownloadCancelled=!1,this.previousRequestProgress=void 0,null===(t=this.rateMeasurementRule)||void 0===t||t.shutdown(),null===(e=this.timeToFirstByteMeasurementRule)||void 0===e||e.shutdown()},e.prototype.dispose=function(){var t,e;this.shutdown(),null===(t=this.rateMeasurementRule)||void 0===t||t.dispose(),null===(e=this.timeToFirstByteMeasurementRule)||void 0===e||e.dispose(),this.lastRepresentation=void 0,this.availableRepresentations=[],this.Lfb=[],this.Nfb=0,this.Mfb=[]},e.prototype.egb=function(){if((0,v.canUseWishAlgorithm)(this.Lfb,this.Nfb)){var t=this.getAvailableRepresentations().map((function(t){return(0,f.toKbps)(t._bandwidth)})),e=u.MimeTypeHelper.isVideo(this.mimeType)?r.MediaType.Video:r.MediaType.Audio,i=this.context.bufferSettings.getTargetLevel(r.BufferType.ForwardDuration,e);this.Pfb=(0,v.computeAlpha)(this.Kfb,t,this.Lfb,this.Nfb,i),this.Qfb=(0,v.computeBeta)(this.Kfb,this.Pfb,i,this.Nfb),this.Rfb=(0,v.computeGamma)(this.Pfb,this.Qfb)}},e.prototype.fgb=function(t,e,i,n){var r=(0,v.determineBandwidthCost)(t._bandwidth,n),o=(0,v.determineBufferCost)(r,this.Nfb,this.Ofb),a=(0,v.determineQualityCost)(this.Lfb,e,i);return this.Pfb*r+this.Qfb*o+this.Rfb*a},e.prototype.isStartupBitrateInEffect=function(){var t,e,i=Boolean(null===(t=this.context.config.adaptation)||void 0===t?void 0:t.startupBitrate),n=Boolean(null===(e=this.context.config.adaptation)||void 0===e?void 0:e.maxStartupBitrate);return(i||n)&&!this.Tfb()},e.prototype.ggb=function(){var t=this;if(this.startupPhase&&(this.isStartupBitrateInEffect()||this.Kfb.USE_RATE_BASED_SELECTION_ON_SEEKING)){var e=this.getRepresentationForRateMeasurement(),i=this.getAvailableRepresentations().indexOf(e);return{rep:e,index:-1!==i?i:0}}if(this.Ofb<this.Nfb||!(0,v.canUseWishAlgorithm)(this.Lfb,this.Nfb))return{rep:this.getAvailableRepresentations()[0],index:0};var n=(0,v.getAverageSelectedQuality)(this.Mfb,10),r=this.rateMeasurementRule.getStatus(5,.325).value,o=this.getCurrentBitrate(this.rateMeasurementRule.getStatus()),a=Math.min(r,o),s=this.getAvailableRepresentations()[0]._bandwidth,u=Math.max(1.1*r,s),l=this.getAvailableRepresentations().filter((function(t){return t._bandwidth<=u})).map((function(e,i){return{rep:e,index:i,cost:t.fgb(e,i,n,a)}})).sort((function(t,e){return t.cost-e.cost}));return{rep:l[0].rep,index:l[0].index}},e}(h.CancellableAdaptationLogic);e.WishLogic=m},47577:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.applyQualityFunction=function(t,e){switch(e){case"linear":var i=t[t.length-1];return t.map((function(t){return function(t,e){return t/e}(t,i)}));case"log":var n=t[0];return t.map((function(t){return function(t,e){return Math.log(t/e)}(t,n)}))}},e.computeAlpha=function(t,e,i,n,r){switch(t.BITRATE_MODIFIER_FUNCTION_TYPE){case"linear":return function(t,e,i,n){var r=t.TARGET_BITRATE_FACTOR,o=t.TARGET_BUFFER_FACTOR,a=i,s=e[0],u=e[e.length-2];return 1/(1+(o*n-a)/i+Math.exp(3-2*s-u)/r)}(t,i,n,r);case"log":return function(t,e,i,n){var r=t.TARGET_BITRATE_FACTOR,o=t.TARGET_BUFFER_FACTOR,a=i,s=e[0],u=e[e.length-1];return 1/(1+(o*n-a)/i+2*u*u/(r*s*e[e.length-2]))}(t,e,n,r)}},e.computeBeta=function(t,e,i,n){return e*((t.TARGET_BUFFER_FACTOR*i-n)/n)},e.computeGamma=function(t,e){return 1-t-e},e.determineBandwidthCost=function(t,e){return e?t/e:1},e.determineBufferCost=function(t,e,i){return i<=e?1/0:t*(e/(i-e))},e.determineQualityCost=function(t,e,i){var n=t[t.length-1],r=t[0],o=t[e];return Math.exp(n+i-2*o)/Math.exp(2*n-2*r)},e.getAverageSelectedQuality=function(t,e){if(0===t.length)return 0;var i=t.slice(-e);return i.reduce((function(t,e){return t+e}))/i.length},e.canUseWishAlgorithm=function(t,e){return!(t.length<=1||!e)}},82873:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BandwidthValueType=void 0,e.getBandwidth=function(t){if(0!==t.length){for(var e=t.length,r=e-1;r>=0;r--){var o=t[r].value,a=o.downloadRate,s=o.segmentBitrate;if(void 0===s||a<s*n)return{rateBps:a,type:i.Accurate}}return{rateBps:t[e-1].value.downloadRate,type:i.Estimated}}};var i,n=.9;!function(t){t.Accurate="accurate",t.Estimated="estimated"}(i||(e.BandwidthValueType=i={}))},24296:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.LowLatencyAbr=void 0;var n=i(80813),r=i(46151),o=i(33436),a=i(59113),s=i(28922),u=i(7676),l=i(82873),h=i(50265),p=i(52902),d=function(){function t(t,e){this.context=t,this.mimeType=e,this.sgb=new h.RateLimitedCancelCheck}return Object.defineProperty(t.prototype,"tgb",{get:function(){return this.context.serviceManager.get(n.ServiceName.ManifestService,this.context.sourceContext.sourceIdentifier)},enumerable:!1,configurable:!0}),t.prototype.ugb=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];this.context.logger},t.prototype.vgb=function(){var t=(0,r.getMetricsHistoryFromInstanceState)(this.context.store.getState(),this.mimeType,o.MetricType.ChunkedDownloadInformation),e=this.wgb();return(0,l.getBandwidth)(t.slice(-e))},t.prototype.wgb=function(){var t,e=null===(t=this.context.config.adaptation)||void 0===t?void 0:t.qualityStabilityBalance,i=Math.ceil(20*e);return Math.max(1,i)},t.prototype.xgb=function(t){var e,i,n,r,o=null!==(n=null===(i=null===(e=this.tgb)||void 0===e?void 0:e.getAdaptationSet(t))||void 0===i?void 0:i.Representation)&&void 0!==n?n:[],a=(0,u.getLowestRepresentation)(o);return null!==(r=null==a?void 0:a._internalId.equals(t))&&void 0!==r&&r},t.prototype.getCurrentBitrateMeasurement=function(){var t,e;return null!==(e=null===(t=this.vgb())||void 0===t?void 0:t.rateBps)&&void 0!==e?e:0},t.prototype.getLowestRepresentation=function(){var t,e,i;if(this.rgb){var n=null!==(i=null===(e=null===(t=this.tgb)||void 0===t?void 0:t.getAdaptationSet(this.rgb._internalId))||void 0===e?void 0:e.Representation)&&void 0!==i?i:[];return(0,u.getLowestRepresentation)(n)}},t.prototype.selectRepresentationID=function(t,e){var i,n,a,h;if(e&&0!==e.length){var p,d=this.vgb();if(this.ugb("current bandwidth",d),!d)return null===(i=(0,u.getLowestRepresentation)(e))||void 0===i?void 0:i._internalId;if(d.type===l.BandwidthValueType.Accurate&&(p=null!==(n=this.findRepresentationForBitrate(d.rateBps,e))&&void 0!==n?n:void 0,this.ugb("accurate value, selecting ",null==p?void 0:p._bandwidth)),d.type===l.BandwidthValueType.Estimated){var c=null===(a=(0,r.getMetricsLastEntry)((0,r.getMetricsState)(this.context.store.getState()),this.mimeType,o.MetricType.ChunkedDownloadInformation).value)||void 0===a?void 0:a.representationBitrate;void 0!==c&&(p=(0,s.findNextHigherBitrateRepresentation)(e,c),this.ugb("estimated value, currently on ".concat(c,", selecting ").concat(null==p?void 0:p._bandwidth)))}return p?p._internalId:null===(h=(0,u.getLowestRepresentation)(e))||void 0===h?void 0:h._internalId}},t.prototype.findRepresentationForBitrate=function(t,e){var i,n;if(!e||e.length<1)return null;var r=null===(i=(0,a.findQualityForBitrate)(t,e.map((function(t){return{rep:t,bitrate:t._bandwidth}}))))||void 0===i?void 0:i.rep;return null!==(n=null!=r?r:(0,u.getLowestRepresentation)(e))&&void 0!==n?n:null},t.prototype.shouldDownloadBeCancelled=function(t,e){if(this.sgb.shouldExecuteCancelCheck(t)){if(this.xgb(e))return!1;var i=(0,p.shouldCancelDownload)(t);return i&&this.ugb("Cancelling segment download, current download rate is significantly lower than segment bitrate"),i}return!1},t.prototype.addSample=function(t){},t.prototype.setAdaptationSet=function(t){this.rgb=t},t.prototype.setStartupPhase=function(){},t.prototype.shutdown=function(){},t.prototype.dispose=function(){this.shutdown()},t}();e.LowLatencyAbr=d},50265:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.RateLimitedCancelCheck=void 0;var i=function(){function t(){this.mhb=0}return t.prototype.shouldExecuteCancelCheck=function(t){if(void 0===t.segmentDuration||void 0===t.elapsedTime)return!1;this.nhb(t)&&(this.mhb=0);var e=this.mhb+.2;if(t.elapsedTime>=t.segmentDuration*e){var i=t.elapsedTime/t.segmentDuration;return this.mhb=.2*Math.floor(i/.2),!0}return!1},t.prototype.nhb=function(t){return t.elapsedTime<this.mhb*t.segmentDuration},t}();e.RateLimitedCancelCheck=i},52902:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.shouldCancelDownload=function(t){var e=t.responseTiming;if(!e)return!1;var i=e.progressTimestamp-e.headersReceivedTimestamp,r=(0,n.bytesToBits)(t.loadedBytes)/i,o=1-(0,n.bytesToBits)(t.loadedBytes)/(t.representationBitrate*t.segmentDuration);return r<t.representationBitrate*o};var n=i(33004)},4865:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.BlockBasedRateMeasurementRule=void 0;var r=i(46151),o=i(33436),a=i(70850),s=i(59406),u=1e6,l=function(t){function e(e,i){var n,r,o,s,u=t.call(this,e,i)||this;return u.Ahb=e.settings,u.zhb=i,u.Fhb=!0,u.Dhb=16e5,null!=(null===(r=null===(n=e.config)||void 0===n?void 0:n.adaptation)||void 0===r?void 0:r.maxStartupBitrate)&&(u.Dhb=a.Util.extractBitrateFromString("max",e.config.adaptation.maxStartupBitrate)),null!=(null===(s=null===(o=e.config)||void 0===o?void 0:o.adaptation)||void 0===s?void 0:s.startupBitrate)&&(u.Bhb=a.Util.extractBitrateFromString("min",e.config.adaptation.startupBitrate)),u.Ehb={bytes:0,time:0},u.Chb=[],u}return n(e,t),e.calcRateInBps=function(t,e){return 8*t/e},e.prototype.Ghb=function(t){var i=this.Chb.pop();if((null==i?void 0:i.bytes)===u&&(this.Chb.push(i),i=void 0),i||(i={bytes:0,time:0,rateInBps:0}),i.bytes+t.bytes<=u){var n=i.bytes+t.bytes,r=i.time+t.time;this.Chb.push({bytes:n,time:r,rateInBps:e.calcRateInBps(n,r)})}else{var o=(u-i.bytes)/t.bytes;i.bytes+=t.bytes*o,i.time+=t.time*o,i.rateInBps=e.calcRateInBps(i.bytes,i.time),this.Chb.push(i);for(var a=t.bytes*(1-o),s=t.time*(1-o);a>u;){var l=s/(a/u);this.Chb.push({bytes:u,time:l,rateInBps:e.calcRateInBps(u,l)}),a-=u,s-=l}this.Chb.push({bytes:a,time:s,rateInBps:e.calcRateInBps(a,s)})}},e.prototype.Hhb=function(t){if(t&&!isNaN(t.bytes)){var e=this.Ehb;if(e.bytes===t.bytes&&e.time===t.time)return;this.Ehb=t,this.Ghb(t),this.Chb.length>40&&this.Chb.shift(),this.Khb()}},e.prototype.Ihb=function(t,i){var n,r=-t;null!=i&&(r=-t-i,n=-i);var o=this.Chb.slice(r,n);if(0===o.length)return 0;var a=o.reduce((function(t,e){return{bytes:t.bytes+e.bytes,time:t.time+e.time,rateInBps:t.rateInBps+e.rateInBps}}));return a.rateInBps=e.calcRateInBps(a.bytes,a.time),a.rateInBps},e.prototype.Jhb=function(){if(null==this.Bhb)return null;var t=this.Bhb;return t*=1+this.Ahb.RATE_SAFETY_MARGIN_PERCENTAGE/100,t+=8,isNaN(t)?null:{bytes:h(t),time:1}},e.prototype.addSample=function(){if(this.instanceState){var t=(0,r.getMetricsState)(this.instanceState),e=(0,r.getMetricsLastEntry)(t,this.zhb,o.MetricType.DownloadInformation);if(this.Fhb){this.Fhb=!1;var i=this.Jhb();i&&(e={value:i})}if(!e||!e.value||!e.value.bytes){e=e||{};var n=this.Lhb();n>0&&(e.value={bytes:h(n),time:1}),e&&e.value||(e=(0,r.getMetricsLastEntry)(t,"default",o.MetricType.DownloadInformation));var a=1/0;e&&e.value&&!isNaN(e.value.bytes)&&!isNaN(e.value.time)&&(a=e.value.bytes/e.value.time),a>this.Dhb&&(e.value=e.value||{},e.value.bytes=h(this.Dhb),e.value.time=1)}this.Hhb(e.value)}},e.prototype.getStatus=function(t){0===this.Chb.length&&this.addSample();var e=this.Ihb(t),i=this.Ihb(t,1);return{value:e,result:e>1.1*i?s.Rules.SHOULD_SWITCH_UP:e<.9*i?s.Rules.SHOULD_SWITCH_DOWN:s.Rules.SHOULD_STAY}},e.prototype.Khb=function(){if(this.instanceState){var t=(0,r.getMetricsHistoryFromInstanceState)(this.instanceState,this.zhb,o.MetricType.DownloadInformation).slice(-3).map((function(t){return Math.round(8*t.value.bytes/t.value.time)}));this.context.storedConfig.set("b",t),this.context.storedConfig.set("b_t",Date.now())}},e.prototype.Lhb=function(){var t=this.context.storedConfig.get("b")||[];return Math.round(t.reduce((function(t,e){return t+e}),0)/t.length)||-1},e.prototype.shutdown=function(){},e.prototype.setStartupPhase=function(){},e.prototype.dispose=function(){},e}(s.AdaptationRule);function h(t){return t/8}e.BlockBasedRateMeasurementRule=l},20066:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.BufferFillRateRule=void 0;var r=i(89927),o=i(88844),a=i(59406),s=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.Mhb=e.bufferSettings,n.Nhb=!0,n.Phb=[],n}return n(e,t),e.prototype.Qhb=function(){if(0===this.Phb.length)return NaN;var t=this.Phb[this.Phb.length-1],e=t.bufferTargetLevel;if(this.Nhb){var i=t.bufferLevel,n=this.Phb[this.Phb.length-2],r=0;n&&(r=n.bufferLevel),i>=t.bufferTargetLevel||r>i?this.Nhb=!1:e=i}return e},e.prototype.Rhb=function(t){isNaN(t)&&(t=this.Mhb.getForwardTargetLevel());for(var e,i=Date.now()-(0,r.toMilliSeconds)(t),n=0,o=0,a=0;a<this.Phb.length;a++)(e=this.Phb[a]).timestamp>=i&&(n+=e.bufferLevel-o),o=e.bufferLevel;return n/=this.Qhb(),isNaN(n)?1:n},e.prototype.addSample=function(t){var e=this;this.Ohb||(this.Ohb=window.setTimeout((function(){e.Nhb=!1}),(0,r.toMilliSeconds)(this.Mhb.getForwardTargetLevel()))),this.Phb.push(t),t.timestamp-this.Phb[0].timestamp>6e4&&this.Phb.shift()},e.prototype.getStatus=function(t){var e=this.Rhb(t),i=a.Rules.SHOULD_STAY;return e>.7?i=a.Rules.SHOULD_SWITCH_UP:e<-.5&&(i=a.Rules.SHOULD_SWITCH_DOWN),{value:e,result:i}},e.prototype.setStartupPhase=function(){this.Nhb=!0},e.prototype.shutdown=function(){(0,o.clearTimeoutIfDefined)(this.Ohb),this.Ohb=void 0},e.prototype.dispose=function(){this.shutdown(),this.Phb=[]},e}(a.AdaptationRule);e.BufferFillRateRule=s},64463:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.BufferFillStateRule=function(t,e){var i,s,u=!0,l={timestamp:Date.now(),bufferTargetLevel:(null===(i=n.DefaultSettings.TARGET_BUFFER_LEVEL.video)||void 0===i?void 0:i.forwardduration)||0,bufferLevel:0},h=function(){(0,o.clearTimeoutIfDefined)(s),s=void 0};return{addSample:function(e){s||(s=window.setTimeout((function(){u=!1}),(0,r.toMilliSeconds)(t.bufferSettings.getForwardTargetLevel()))),l=e},getStatus:function(){var t;return l.bufferLevel>.8*l.bufferTargetLevel?(t=a.Rules.SHOULD_SWITCH_UP,u&&(u=!1,(0,o.clearTimeoutIfDefined)(s))):t=l.bufferLevel<.4*l.bufferTargetLevel?a.Rules.SHOULD_SWITCH_DOWN:a.Rules.SHOULD_STAY,u&&(t=a.Rules.SHOULD_STAY),{value:l.bufferLevel,result:t}},setStartupPhase:function(){u=!0},shutdown:h,dispose:function(){h()}}};var n=i(70962),r=i(89927),o=i(88844),a=i(59406)},43829:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.DownloadRateRule=void 0;var r=i(89927),o=i(59406),a=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.ihb=[],n}return n(e,t),e.prototype.jhb=function(t){void 0===t&&(t=this.context.bufferSettings.getForwardTargetLevel());var e=Date.now()-(0,r.toMilliSeconds)(t),i=this.ihb.filter((function(t){return t.timestamp>=e}));if(0===i.length)return 1;var n=0;return i.forEach((function(t,e){var o=i[e-1],a=t.segmentDuration,s=a/8,u=Math.min(t.bufferLevel/t.bufferTargetLevel,1),l=Math.max(t.segmentDownloadDuration,s),h=u*(a/l)+a/(o?Math.max(t.timestamp-o.timestamp,s):(0,r.toMilliSeconds)(Math.max(a,l)))*(1-u);n=t.downloadCancelled?n-h:n+h})),n/i.length},e.prototype.addSample=function(t){(function(t){return null!=t.segmentDuration&&null!=t.segmentDownloadDuration})(t)&&(this.ihb.push(t),t.timestamp-this.ihb[0].timestamp>6e4&&this.ihb.shift())},e.prototype.getStatus=function(t,e){var i=this.jhb(t),n=o.Rules.SHOULD_STAY;return i>1.7?n=o.Rules.SHOULD_SWITCH_UP:i<.5&&(n=o.Rules.SHOULD_SWITCH_DOWN),{value:i,result:n}},e.prototype.setStartupPhase=function(){},e.prototype.shutdown=function(){},e.prototype.dispose=function(){this.shutdown(),this.ihb=[]},e}(o.AdaptationRule);e.DownloadRateRule=a},59406:function(t,e){var i;Object.defineProperty(e,"__esModule",{value:!0}),e.AdaptationRule=e.Rules=void 0,function(t){t.SHOULD_SWITCH_UP="SWITCH_UP",t.SHOULD_STAY="STAY",t.SHOULD_SWITCH_DOWN="SWITCH_DOWN"}(i||(e.Rules=i={}));var n=function(){function t(t,e){this.context=t,this.samples=[],this.mimeType=e,this.logger=t.logger,this.Settings=t.settings,this.maxHistorySize=this.Settings.DEFAULT_ADAPTATION_RULE_HISTORY_SIZE}return Object.defineProperty(t.prototype,"instanceState",{get:function(){var t;return null===(t=this.context.store)||void 0===t?void 0:t.getState()},enumerable:!1,configurable:!0}),t.prototype.estimateStatus=function(t,e,i){return this.getStatus(e,i)},t}();e.AdaptationRule=n},39185:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.SegmentBasedRateMeasurementRule=void 0;var r=i(46151),o=i(33436),a=i(89927),s=i(70850),u=i(17006),l=i(7676),h=i(59406),p=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.Dib=-1,n.Eib=.1,n.Fib=!0,n}return n(e,t),e.getBitrateFromPerformanceAPI=function(){if(!performance||"function"!=typeof performance.getEntriesByName)return 0;var t=0,e=0;return performance.getEntriesByType("resource").filter(d).forEach((function(i){t+=8*i.transferSize,e+=(0,a.toSeconds)(i.duration-(i.responseStart-i.requestStart))})),t>0&&e>0?t/e:0},e.prototype.Gib=function(t,e,i){var n;void 0===e&&(e=1),void 0===i&&(i=0);var r=-t-i;return n=0!==i?this.samples.slice(r,-i):this.samples.slice(r),(0,u.calculateExponentialWeightedAverage)(n,1-e)},e.validateDownloadInfo=function(t){if(Boolean(t)&&Boolean(t.value)){var e=Boolean(t.value.bytes),i=!isNaN(t.value.time),n=void 0!==t.value.timeToFirstByte&&!isNaN(t.value.timeToFirstByte);return e&&i&&n}return!1},e.prototype.Hib=function(t){if(!this.instanceState)return 0;var i=(0,r.getMetricsLastEntry)((0,r.getMetricsState)(this.instanceState),t,o.MetricType.DownloadInformation),n=e.validateDownloadInfo(i),a=n&&this.Dib<i.time;return a&&isFinite(i.time)&&(this.Dib=i.time),n&&a?c(i,this.context.settings.MAX_ALLOWED_BANDWIDTH_ESTIMATION):n&&!a?-1:0},e.prototype.Iib=function(){var t=[],i=this.Kib();i>0&&t.push(i);var n=this.Hib("default");n>0&&t.push(n);var r=Math.min.apply(Math,t);return r>0&&isFinite(r)?r:e.getBitrateFromPerformanceAPI()},e.prototype.addSample=function(){var t=this.Hib(this.mimeType),e=0;this.Fib&&(e=function(t,e){var i=(0,l.getStartupBitrateFromConfig)(t),n=(0,l.getMaxStartupBitrateFromConfig)(t);return n=e>0?Math.min(n,e):n,i||n||0}(this.context,t),this.Fib=!1),0===(e=e||t||0)&&(e=this.Iib()),e>0&&(this.samples.push(e),this.samples.length>this.maxHistorySize&&this.samples.splice(0,this.samples.length-this.maxHistorySize)),t>0&&this.Jib()},e.prototype.getStatus=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1),0===this.samples.length&&this.addSample();var i=this.Gib(t,e),n=this.Gib(t,e,1);return{value:i,result:i>n*(1+this.Eib)?h.Rules.SHOULD_SWITCH_UP:i<n*(1-this.Eib)?h.Rules.SHOULD_SWITCH_DOWN:h.Rules.SHOULD_STAY}},e.prototype.Jib=function(){if(this.instanceState){var t=(0,r.getMetricsHistoryFromInstanceState)(this.instanceState,this.mimeType,o.MetricType.DownloadInformation).filter(e.validateDownloadInfo).slice(-3).map((function(t){return c(t)}));this.context.storedConfig.set("b",t),this.context.storedConfig.set("b_t",Date.now())}},e.prototype.Kib=function(){var t=this,e=(this.context.storedConfig.get("b")||[]).map((function(e){return f(e,t.context.settings.MAX_ALLOWED_BANDWIDTH_ESTIMATION)}));return Math.round(e.reduce((function(t,e){return t+e}),0)/e.length)||0},e.prototype.shutdown=function(){},e.prototype.setStartupPhase=function(){},e.prototype.dispose=function(){},e}(h.AdaptationRule);function d(t){return t.transferSize>0&&!/^https?:\/\/localhost(:\d+)?(\/|$)/.test(t.name)}function c(t,e){var i;void 0===e&&(e=1/0);var n=t.value.time-(null!==(i=t.value.timeToFirstByte)&&void 0!==i?i:0);return f(8*t.value.bytes/n,e)}function f(t,e){var i=s.Util.extractBitrateFromString("max",e);return Math.min(t,i)}e.SegmentBasedRateMeasurementRule=p},45199:function(t,e,i){var n=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),r=this&&this.__spreadArray||function(t,e,i){if(i||2===arguments.length)for(var n,r=0,o=e.length;r<o;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.TimeToFirstByteMeasurementRule=void 0;var o=i(46151),a=i(33436),s=i(17006),u=i(59406),l=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.Lib=-1,n}return n(e,t),e.prototype.Mib=function(t){if(!this.instanceState)return 0;var e=(0,o.getMetricsLastEntry)((0,o.getMetricsState)(this.instanceState),t,a.MetricType.DownloadInformation),i=Boolean(e)&&Boolean(e.value),n=i&&void 0!==e.value.timeToFirstByte&&!isNaN(e.value.timeToFirstByte),r=i&&this.Lib<e.time;return r&&isFinite(e.time)&&(this.Lib=e.time),n&&r?e.value.timeToFirstByte:n&&!r?-1:0},e.prototype.addSample=function(){var t=this.Mib(this.mimeType),e=this.Mib("default"),i=t||e||0;if(i>0)for(this.samples.push(i);this.samples.length>this.maxHistorySize;)this.samples.shift()},e.prototype.Nib=function(t){var e=-t;return t>0?this.samples.slice(e):[]},e.prototype.Oib=function(t,e){var i=(0,s.calculateMean)(t),n=(0,s.calculateExponentialWeightedAverage)(t,e),r=(0,s.calculateStandardDeviation)(t,i);return{value:{median:(0,s.calculateMedian)(t),mean:i,weightedAverage:n,standardDeviation:r},result:u.Rules.SHOULD_STAY}},e.prototype.getStatus=function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.Oib(this.Nib(t),e)},e.prototype.estimateStatus=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=1);var n=r(r([],this.Nib(e-1),!0),[t],!1);return this.Oib(n,i)},e.prototype.setStartupPhase=function(){},e.prototype.shutdown=function(){},e.prototype.dispose=function(){},e}(u.AdaptationRule);e.TimeToFirstByteMeasurementRule=l},28922:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.findNextHigherBitrateRepresentation=function(t,e){for(var i,n,r=0,o=t;r<o.length;r++){var a=o[r];a._bandwidth>e&&(void 0===i||a._bandwidth<i._bandwidth)&&(i=a),(void 0===n||a._bandwidth>n._bandwidth)&&(n=a)}return null!=i?i:n}},83429:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.getUserSelectedRepresentation=function(t,e,i,a){var s,u,l=function(t,e){return r.MimeTypeHelper.isAudio(t)?null==e?void 0:e.onAudioAdaptation:r.MimeTypeHelper.isVideo(t)?null==e?void 0:e.onVideoAdaptation:void 0}(e,t.config.adaptation);if(l){var h=t.serviceManager.maybeCall(n.ServiceName.ManifestService,(function(t){return t.getAdaptationSet(i)}),null,t.sourceContext.sourceIdentifier),p=null!==(s=null==h?void 0:h.Representation.map((function(t){return{bandwidth:t._bandwidth,id:t._id}})))&&void 0!==s?s:[],d={suggested:a.representationId,isAd:t.sourceContext.isAd,representations:p},c=null!==(u=(0,o.safeUserCallback)((function(){return l(d)}),t.logger))&&void 0!==u?u:void 0;return function(t,e,i){return t.serviceManager.maybeCall(n.ServiceName.ManifestService,(function(t){return e&&t.getRepresentation(e,i)}),void 0,t.sourceContext.sourceIdentifier)||void 0}(t,i,c)}};var n=i(80813),r=i(85434),o=i(70850)}},function(t){return function(){return t(t.s=76344)}()}])}));
18
18
  })();