From 66900fdc855a997d552107798eb7cadb5668e99a Mon Sep 17 00:00:00 2001 From: Paul Berberian Date: Thu, 10 Jun 2021 14:44:43 +0200 Subject: [PATCH] update version to v3.26.0 --- CHANGELOG.md | 9 +-------- VERSION | 2 +- dist/rx-player.js | 4 ++-- dist/rx-player.min.js | 2 +- package-lock.json | 4 ++-- package.json | 2 +- sonar-project.properties | 2 +- src/core/api/public_api.ts | 4 ++-- 8 files changed, 11 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30cc2724d7..242d597212 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,6 @@ # Changelog -## v3.25.1 (2021/06/10) - -### Bug fixes - - - fix import path for the experimental `VideoThumbnailLoader` tool - - -## v3.25.0 (2021/06/10) +## v3.26.0 (2021/06/10) ### Features diff --git a/VERSION b/VERSION index 59ac166a96..419ede3b9c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.25.1 +3.26.0 diff --git a/dist/rx-player.js b/dist/rx-player.js index e5cd5e583b..0d473eb2fe 100644 --- a/dist/rx-player.js +++ b/dist/rx-player.js @@ -56046,7 +56046,7 @@ var Player = /*#__PURE__*/function (_EventEmitter) { videoElement.preload = "auto"; _this.version = /* PLAYER_VERSION */ - "3.25.1"; + "3.26.0"; _this.log = log/* default */.Z; _this.state = "STOPPED"; _this.videoElement = videoElement; @@ -58824,7 +58824,7 @@ var Player = /*#__PURE__*/function (_EventEmitter) { Player.version = /* PLAYER_VERSION */ -"3.25.1"; +"3.26.0"; /* harmony default export */ var public_api = (Player); ;// CONCATENATED MODULE: ./src/core/api/index.ts /** diff --git a/dist/rx-player.min.js b/dist/rx-player.min.js index b3206195e6..55102f6873 100644 --- a/dist/rx-player.min.js +++ b/dist/rx-player.min.js @@ -1,2 +1,2 @@ /*! For license information please see rx-player.min.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.RxPlayer=t():e.RxPlayer=t()}(self,(function(){return function(){var e={3349:function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:function(){return r}})},5991:function(e,t,n){"use strict";function r(e,t){for(var n=0;n=0||"[object SafariRemoteNotification]"===(null===(r=window.safari)||void 0===r?void 0:r.pushNotification.toString())),f=!i.Z&&"string"==typeof navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)},5767:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(3666);function a(e){if(i.vU){for(var t=e.textTracks,n=0;n=0;o--)if("track"===a[o].nodeName)try{e.removeChild(a[o])}catch(e){r.Z.warn("Compat: Could not remove text track child from element.")}}e.src="",e.removeAttribute("src")}},6139:function(e,t,n){"use strict";n.d(t,{N:function(){return O},Y:function(){return W}});var r,i=n(3610),a=n(2817),o=n(9917),s=n(3714),u=n(8117),l=n(3666),d=n(2203),c=n(5059),f=n(5991),p=n(9589),v=function(){function e(e,t,n){this._keyType=e,this._mediaKeys=t,this._configuration=n}var t=e.prototype;return t.createMediaKeys=function(){var e=this;return new p.Z((function(t){return t(e._mediaKeys)}))},t.getConfiguration=function(){return this._configuration},(0,f.Z)(e,[{key:"keySystem",get:function(){return this._keyType}}]),e}(),h=n(1788),m=n(6716),g=n(3071),y=n(3505),_=n(1959),b=n(8719);if(!d.Z){var T=window.MSMediaKeys;void 0!==T&&void 0!==T.prototype&&"function"==typeof T.isTypeSupported&&"function"==typeof T.prototype.createSession&&(r=T)}var E,w=function(e){function t(t){var n;return(n=e.call(this)||this).expiration=NaN,n.keyStatuses=new Map,n._mk=t,n._closeSession$=new m.x,n.closed=new p.Z((function(e){n._closeSession$.subscribe(e)})),n.update=function(e){return new p.Z((function(t,r){if(void 0===n._ss)return r("MediaKeySession not set.");try{t(n._ss.update(e,""))}catch(e){r(e)}}))},n}(0,h.Z)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new p.Z((function(e){n._ss=n._mk.createSession("video/mp4",t),(0,g.T)(b.GJ(n._ss),b.GV(n._ss),b.Xe(n._ss)).pipe((0,y.R)(n._closeSession$)).subscribe((function(e){return n.trigger(e.type,e)})),e()}))},n.close=function(){var e=this;return new p.Z((function(t){null!=e._ss&&(e._ss.close(),e._ss=void 0),e._closeSession$.next(),e._closeSession$.complete(),t()}))},n.load=function(){return p.Z.resolve(!1)},n.remove=function(){return p.Z.resolve()},(0,f.Z)(t,[{key:"sessionId",get:function(){var e,t;return null!==(t=null===(e=this._ss)||void 0===e?void 0:e.sessionId)&&void 0!==t?t:""}}]),t}(_.Z),S=function(){function e(e){if(void 0===r)throw new Error("No MSMediaKeys API.");this._mediaKeys=new r(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0!==this._videoElement.msSetMediaKeys)return this._videoElement.msSetMediaKeys(this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new w(this._mediaKeys)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();if(!d.Z){var k=window.MozMediaKeys;void 0!==k&&void 0!==k.prototype&&"function"==typeof k.isTypeSupported&&"function"==typeof k.prototype.createSession&&(E=k)}var A=n(9689),x=n(3635);function I(e){return"function"==typeof e.webkitGenerateKeyRequest}var Z=function(e){function t(t,n){var r;return(r=e.call(this)||this)._closeSession$=new m.x,r._vid=t,r._key=n,r.sessionId="",r.closed=new p.Z((function(e){r._closeSession$.subscribe(e)})),r.keyStatuses=new Map,r.expiration=NaN,(0,g.T)(b.GJ(t),b.GV(t),b.Xe(t)).pipe((0,y.R)(r._closeSession$)).subscribe((function(e){return r.trigger(e.type,e)})),r.update=function(e){return new p.Z((function(t,n){try{if(r._key.indexOf("clearkey")>=0){var i=e instanceof ArrayBuffer?new Uint8Array(e):e,a=JSON.parse((0,x.uR)(i)),o=(0,A.K)(a.keys[0].k),s=(0,A.K)(a.keys[0].kid);t(r._vid.webkitAddKey(r._key,o,s,""))}else t(r._vid.webkitAddKey(r._key,e,null,""))}catch(e){n(e)}}))},r}(0,h.Z)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new p.Z((function(e){n._vid.webkitGenerateKeyRequest(n._key,t),e()}))},n.close=function(){var e=this;return new p.Z((function(t){e._closeSession$.next(),e._closeSession$.complete(),t()}))},n.load=function(){return p.Z.resolve(!1)},n.remove=function(){return p.Z.resolve()},t}(_.Z),M=function(){function e(e){this._keySystem=e}var t=e.prototype;return t._setVideo=function(e){if(!I(e))throw new Error("Video not attached to the MediaKeys");this._videoElement=e},t.createSession=function(){if(null==this._videoElement)throw new Error("Video not attached to the MediaKeys");return new Z(this._videoElement,this._keySystem)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();var R=n(6968);var C=n(158);function P(e,t){if(void 0===e.webkitSetMediaKeys)throw new Error("No webKitMediaKeys API.");return e.webkitSetMediaKeys(t)}var N=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._serverCertificate=r,i._closeSession$=new m.x,i._videoElement=t,i._keyType=n,i.closed=new p.Z((function(e){i._closeSession$.subscribe(e)})),i.keyStatuses=new Map,i.expiration=NaN,i.update=function(e){return new p.Z((function(t,n){if(void 0===i._nativeSession||void 0===i._nativeSession.update||"function"!=typeof i._nativeSession.update)return n("Unavailable WebKit key session.");try{t(i._nativeSession.update(e))}catch(e){n(e)}}))},i}(0,h.Z)(t,e);var n=t.prototype;return n.listenEvent=function(e){var t=this;(0,g.T)(b.GJ(e),b.GV(e),b.Xe(e)).pipe((0,y.R)(this._closeSession$)).subscribe((function(e){t.trigger(e.type,e)}))},n.generateRequest=function(e,t){var n=this;return new p.Z((function(e){if(void 0===n._videoElement.webkitKeys||void 0===n._videoElement.webkitKeys.createSession)throw new Error("No WebKitMediaKeys API.");var r,i;if("com.apple.fps.1_0"===(i=n._keyType)||"com.apple.fps.2_0"===i){if(void 0===n._serverCertificate)throw new Error("A server certificate is needed for creating fairplay session.");r=function(e,t){var n=e instanceof Uint8Array?e:new Uint8Array(e),r=t instanceof Uint8Array?t:new Uint8Array(t);if((0,R.dN)(n,0)+4!==n.length)throw new Error("Unsupported WebKit initData.");var i=(0,x.wV)(n),a=i.indexOf("skd://"),o=a>-1?i.substring(a+6):i,s=(0,x.TZ)(o),u=0,l=new Uint8Array(n.byteLength+4+s.byteLength+4+r.byteLength);return l.set(n),u+=n.length,l.set((0,R.O_)(s.byteLength),u),u+=4,l.set(s,u),u+=s.byteLength,l.set((0,R.O_)(r.byteLength),u),u+=4,l.set(r,u),l}(t,n._serverCertificate)}else r=t;var a=n._videoElement.webkitKeys.createSession("video/mp4",r);if(null==a)throw new Error("Impossible to get the key sessions");n.listenEvent(a),n._nativeSession=a,e()}))},n.close=function(){var e=this;return new p.Z((function(t,n){e._closeSession$.next(),e._closeSession$.complete(),void 0===e._nativeSession&&n("No session to close."),e._nativeSession.close(),t()}))},n.load=function(){return p.Z.resolve(!1)},n.remove=function(){return p.Z.resolve()},(0,f.Z)(t,[{key:"sessionId",get:function(){var e,t;return null!==(t=null===(e=this._nativeSession)||void 0===e?void 0:e.sessionId)&&void 0!==t?t:""}}]),t}(_.Z),D=function(){function e(e){if(void 0===C.t)throw new Error("No WebKitMediaKeys API.");this._keyType=e,this._mediaKeys=new C.t(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0===this._videoElement)throw new Error("Video not attached to the MediaKeys");return P(this._videoElement,this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new N(this._videoElement,this._keyType,this._serverCertificate)},t.setServerCertificate=function(e){return this._serverCertificate=e,p.Z.resolve()},e}();var O=null,L=function(e,t){return"function"==typeof e.setMediaKeys?e.setMediaKeys(t):e.webkitSetMediaKeys?e.webkitSetMediaKeys(t):e.mozSetMediaKeys?e.mozSetMediaKeys(t):e.msSetMediaKeys&&null!==t?e.msSetMediaKeys(t):void 0};if(d.Z||null!=navigator.requestMediaKeySystemAccess&&!(0,c.Z)())O=function(e,t){return(0,u.Z)(navigator.requestMediaKeySystemAccess(e,t))};else{var B,U;if(I(HTMLVideoElement.prototype)){var F={isTypeSupported:function(e){var t=document.querySelector("video");return null==t&&(t=document.createElement("video")),null!=t&&"function"==typeof t.canPlayType&&!!t.canPlayType("video/mp4",e)},createCustomMediaKeys:function(e){return new M(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof M))throw new Error("Custom setMediaKeys is supposed to be called with old webkit custom MediaKeys.");return t._setVideo(e)}}};B=F.isTypeSupported,U=F.createCustomMediaKeys,L=F.setMediaKeys}else if(void 0!==C.t){var z=function(){if(void 0===C.t)throw new Error("No WebKitMediaKeys API.");return{isTypeSupported:C.t.isTypeSupported,createCustomMediaKeys:function(e){return new D(e)},setMediaKeys:function(e,t){if(null===t)return P(e,t);if(!(t instanceof D))throw new Error("Custom setMediaKeys is supposed to be called with webkit custom MediaKeys.");return t._setVideo(e)}}}();B=z.isTypeSupported,U=z.createCustomMediaKeys,L=z.setMediaKeys}else if(l.fq&&void 0!==r){var K={isTypeSupported:function(e,t){if(void 0===r)throw new Error("No MSMediaKeys API.");return void 0!==t?r.isTypeSupported(e,t):r.isTypeSupported(e)},createCustomMediaKeys:function(e){return new S(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof S))throw new Error("Custom setMediaKeys is supposed to be called with IE11 custom MediaKeys.");return t._setVideo(e)}}};B=K.isTypeSupported,U=K.createCustomMediaKeys,L=K.setMediaKeys}else if(void 0!==E){var V={isTypeSupported:function(e,t){if(void 0===E)throw new Error("No MozMediaKeys API.");return void 0!==t?E.isTypeSupported(e,t):E.isTypeSupported(e)},createCustomMediaKeys:function(e){if(void 0===E)throw new Error("No MozMediaKeys API.");return new E(e)},setMediaKeys:function(e,t){if(void 0===e.mozSetMediaKeys||"function"!=typeof e.mozSetMediaKeys)throw new Error("Can't set video on MozMediaKeys.");return e.mozSetMediaKeys(t)}};B=V.isTypeSupported,U=V.createCustomMediaKeys,L=V.setMediaKeys}else{var G=window.MediaKeys,H=function(){if(void 0===G)throw new s.Z("MEDIA_KEYS_NOT_SUPPORTED","No `MediaKeys` implementation found in the current browser.");if(void 0===G.isTypeSupported){throw new Error("This browser seems to be unable to play encrypted contents currently. Note: Some browsers do not allow decryption in some situations, like when not using HTTPS.")}};B=function(e){return H(),G.isTypeSupported(e)},U=function(e){return H(),new G(e)}}O=function(e,t){if(!B(e))return(0,i._)((function(){return new Error("Unsupported key type")}));for(var n=0;n=t?(r.Z.warn("Compat: Invalid cue times: "+e+" - "+t),null):new i.w(e,t,n)}},5059:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3666),i=n(158);function a(){return r.G6&&void 0!==i.t}},944:function(e,t){"use strict";t.Z={DEFAULT_UNMUTED_VOLUME:.1,DEFAULT_REQUEST_TIMEOUT:3e4,DEFAULT_TEXT_TRACK_MODE:"native",DEFAULT_MANUAL_BITRATE_SWITCHING_MODE:"seamless",DEFAULT_ENABLE_FAST_SWITCHING:!0,DEFAULT_AUDIO_TRACK_SWITCHING_MODE:"seamless",DELTA_POSITION_AFTER_RELOAD:{bitrateSwitch:-.1,trackSwitch:{audio:-.7,video:-.1,other:0}},DEFAULT_CODEC_SWITCHING_BEHAVIOR:"continue",DEFAULT_AUTO_PLAY:!1,DEFAULT_SHOW_NATIVE_SUBTITLE:!0,DEFAULT_STOP_AT_END:!0,DEFAULT_WANTED_BUFFER_AHEAD:30,DEFAULT_MAX_BUFFER_AHEAD:1/0,DEFAULT_MAX_BUFFER_BEHIND:1/0,MAXIMUM_MAX_BUFFER_AHEAD:{text:18e3},MAXIMUM_MAX_BUFFER_BEHIND:{text:18e3},DEFAULT_INITIAL_BITRATES:{audio:0,video:0,other:0},DEFAULT_MIN_BITRATES:{audio:0,video:0,other:0},DEFAULT_MAX_BITRATES:{audio:1/0,video:1/0,other:1/0},INACTIVITY_DELAY:6e4,DEFAULT_THROTTLE_WHEN_HIDDEN:!1,DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN:!1,DEFAULT_LIMIT_VIDEO_WIDTH:!1,DEFAULT_LIVE_GAP:{DEFAULT:10,LOW_LATENCY:3},BUFFER_DISCONTINUITY_THRESHOLD:.2,FORCE_DISCONTINUITY_SEEK_DELAY:2e3,BITRATE_REBUFFERING_RATIO:1.5,BUFFER_GC_GAPS:{CALM:240,BEEFY:30},DEFAULT_MAX_MANIFEST_REQUEST_RETRY:4,DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR:4,DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE:1/0,INITIAL_BACKOFF_DELAY_BASE:{REGULAR:200,LOW_LATENCY:50},MAX_BACKOFF_DELAY_BASE:{REGULAR:3e3,LOW_LATENCY:1e3},SAMPLING_INTERVAL_MEDIASOURCE:1e3,SAMPLING_INTERVAL_LOW_LATENCY:250,SAMPLING_INTERVAL_NO_MEDIASOURCE:500,ABR_MINIMUM_TOTAL_BYTES:15e4,ABR_MINIMUM_CHUNK_SIZE:16e3,ABR_STARVATION_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},ABR_REGULAR_FACTOR:{DEFAULT:.8,LOW_LATENCY:.8},ABR_STARVATION_GAP:{DEFAULT:5,LOW_LATENCY:5},OUT_OF_STARVATION_GAP:{DEFAULT:7,LOW_LATENCY:7},ABR_STARVATION_DURATION_DELTA:.1,ABR_FAST_EMA:2,ABR_SLOW_EMA:10,RESUME_GAP_AFTER_SEEKING:{DEFAULT:1.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_NOT_ENOUGH_DATA:{DEFAULT:.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_BUFFERING:{DEFAULT:5,LOW_LATENCY:.5},STALL_GAP:{DEFAULT:.5,LOW_LATENCY:.2},MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT:.15,MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE:.4,MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE:.3,MINIMUM_SEGMENT_SIZE:.005,APPEND_WINDOW_SECURITIES:{START:.2,END:.1},MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL:50,TEXT_TRACK_SIZE_CHECKS_INTERVAL:250,BUFFER_PADDING:{audio:1,video:3,other:1},SEGMENT_PRIORITIES_STEPS:[2,4,8,12,18,25],MAX_HIGH_PRIORITY_LEVEL:1,MIN_CANCELABLE_PRIORITY:3,EME_DEFAULT_WIDEVINE_ROBUSTNESSES:["HW_SECURE_ALL","HW_SECURE_DECODE","HW_SECURE_CRYPTO","SW_SECURE_DECODE","SW_SECURE_CRYPTO"],EME_KEY_SYSTEMS:{clearkey:["webkit-org.w3.clearkey","org.w3.clearkey"],widevine:["com.widevine.alpha"],playready:["com.microsoft.playready","com.chromecast.playready","com.youtube.playready"],fairplay:["com.apple.fps.1_0"]},MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE:10,MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE:200,MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY:300,OUT_OF_SYNC_MANIFEST_REFRESH_DELAY:3e3,FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY:3e3,DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:3,EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS:15,EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION:1e3,EME_SESSION_CLOSING_MAX_RETRY:5,EME_SESSION_CLOSING_INITIAL_DELAY:100,EME_SESSION_CLOSING_MAX_DELAY:1e3,EME_WAITING_DELAY_LOADED_SESSION_EMPTY_KEYSTATUSES:100,FORCED_ENDED_THRESHOLD:8e-4,ADAPTATION_SWITCH_BUFFER_PADDINGS:{video:{before:2,after:2.5},audio:{before:2,after:2.5},text:{before:0,after:0},image:{before:0,after:0}},SOURCE_BUFFER_FLUSHING_INTERVAL:500,CONTENT_REPLACEMENT_PADDING:1.2,CACHE_LOAD_DURATION_THRESHOLDS:{video:50,audio:10},STREAM_EVENT_EMITTER_POLL_INTERVAL:250,DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR:.001}},7794:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(1788),i=n(1959),a=n(7829);function o(e,t){var n;if(t.length!==e.length)return!0;for(var r=0;re.length)return y.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var i=e.subarray(n,n+r),a={systemId:(0,_.Y)(i,8),data:i};S(t,a)?y.Z.warn("Compat: Duplicated PSSH found in initialization data, removing it."):t.push(a),n+=r}return n!==e.length?(y.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}]):t}(new Uint8Array(t))}}var A=n(9917),x=n(2297),I=n(8117);function Z(e,t,n){return(0,A.P)((function(){var r;y.Z.debug("Compat: Calling generateRequest on the MediaKeySession");try{r=function(e){y.Z.info("Compat: Trying to move CENC PSSH from init data at the end of it.");for(var t=!1,n=new Uint8Array,r=new Uint8Array,i=0;ie.length)throw y.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var o=e.subarray(i,i+a);if(16===e[i+12]&&119===e[i+13]&&239===e[i+14]&&236===e[i+15]&&192===e[i+16]&&178===e[i+17]&&77===e[i+18]&&2===e[i+19]&&172===e[i+20]&&227===e[i+21]&&60===e[i+22]&&30===e[i+23]&&82===e[i+24]&&226===e[i+25]&&251===e[i+26]&&75===e[i+27]){var s=(0,x.Xj)(o),u=null===s?void 0:o[s[1]];y.Z.info("Compat: CENC PSSH found with version",u),void 0===u?y.Z.warn("Compat: could not read version of CENC PSSH"):t===(1===u)?n=(0,T.zo)(n,o):1===u?(y.Z.warn("Compat: cenc version 1 encountered, removing every other cenc pssh box."),n=o,t=!0):y.Z.warn("Compat: filtering out cenc pssh box with wrong version",u)}else r=(0,T.zo)(r,o);i+=a}if(i!==e.length)throw y.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");return(0,T.zo)(r,n)}(n)}catch(e){r=n}var i=null!=t?t:"";return(0,I.Z)(e.generateRequest(i,r)).pipe((0,h.K)((function(t){if(""!==i||!(t instanceof TypeError))throw t;return y.Z.warn('Compat: error while calling `generateRequest` with an empty initialization data type. Retrying with a default "cenc" value.',t),(0,I.Z)(e.generateRequest("cenc",r))})))}))}var M=n(944),R=n(5157),C=n(7714),P=n(8418),N=n(2793),D=n(1946);var O=n(3833),L=n(8430);var B=n(4181),U=n(6625),F=n(5561);function z(e){if(""===e.sessionId)return!1;var t=e.keyStatuses,n=[];return t.forEach((function(e){n.push(e)})),n.length<=0?(y.Z.debug("EME: isSessionUsable: MediaKeySession given has an empty keyStatuses",e),!1):(0,C.Z)(n,"expired")?(y.Z.debug("EME: isSessionUsable: MediaKeySession given has an expired key",e.sessionId),!1):(0,C.Z)(n,"internal-error")?(y.Z.debug("EME: isSessionUsable: MediaKeySession given has a key with an internal-error",e.sessionId),!1):(y.Z.debug("EME: isSessionUsable: MediaKeySession is usable",e.sessionId),!0)}function K(e,t,n){return(0,A.P)((function(){var i=e.loadedSessionsStore,a=e.persistentSessionsStore;return"temporary"===n?V(i,t):null===a?(y.Z.warn("EME: Cannot create persistent MediaKeySession, PersistentSessionsStore not created."),V(i,t)):function(e,t,n){return(0,A.P)((function(){y.Z.info("EME: Creating persistent MediaKeySession");var i=e.createSession(n,"persistent-license"),a=t.getAndReuse(n);if(null===a)return(0,r.of)({type:"created-session",value:{mediaKeySession:i,sessionType:"persistent-license"}});var o=function(){return y.Z.info("EME: Removing previous persistent session."),null!==t.get(n)&&t.delete(n),e.closeSession(n).pipe((0,v.U)((function(){return{type:"created-session",value:{mediaKeySession:e.createSession(n,"persistent-license"),sessionType:"persistent-license"}}})))};return function(e,t){return(0,A.P)((function(){return y.Z.info("Compat/EME: Load persisted session",t),(0,F.Z)((function(){return(0,I.Z)(e.load(t))}),void 0)})).pipe((0,l.z)((function(t){return!t||e.keyStatuses.size>0?(0,r.of)(t):(0,B.S)((0,U.H)(100),(0,g.eX)(e)).pipe((0,f.q)(1),(0,O.h)(t))})))}(i,a.sessionId).pipe((0,l.z)((function(e){return e?e&&z(i)?(t.add(n,i),y.Z.info("EME: Succeeded to load persistent session."),(0,r.of)({type:"loaded-persistent-session",value:{mediaKeySession:i,sessionType:"persistent-license"}})):(y.Z.warn("EME: Previous persistent session not usable anymore."),o()):(y.Z.warn("EME: No data stored for the loaded session"),t.delete(n),(0,r.of)({type:"created-session",value:{mediaKeySession:i,sessionType:"persistent-license"}}))})),(0,h.K)((function(e){return y.Z.warn("EME: Unable to load persistent session: "+(e instanceof Error?e.toString():"Unknown Error")),o()})))}))}(i,a,t)}))}function V(e,t){return(0,A.P)((function(){y.Z.info("EME: Creating a new temporary session");var n=e.createSession(t,"temporary");return(0,r.of)({type:"created-session",value:{mediaKeySession:n,sessionType:"temporary"}})}))}function G(e,t,n,o){return(0,A.P)((function(){var s=null,d=t.loadedSessionsStore,c=t.persistentSessionsStore,f=d.getAndReuse(e);if(null!==f){if(z(s=f.mediaKeySession))return y.Z.info("EME: Reuse loaded session",s.sessionId),(0,r.of)({type:"loaded-open-session",value:{mediaKeySession:s,sessionType:f.sessionType,initializationData:e}});null!==c&&c.delete(e)}return(null!=s?d.closeSession(e):(0,r.of)(null)).pipe((0,l.z)((function(){return(0,i.z)(function(e,t){if(t<0||t>=e.getLength())return u.E;for(var n=[],r=e.getAll().slice(),i=r.length-t,o=0;o=a.length){var n=new R.Z("INCOMPATIBLE_KEYSYSTEMS","No key system compatible with your wanted configuration has been found in the current browser.");return(0,o._)((function(){return n}))}if(null==H.N){var r=Error("requestMediaKeySystemAccess is not implemented in your browser.");return(0,o._)((function(){return r}))}var i=a[t],s=i.keyName,u=i.keyType,l=i.keySystemOptions,d=function(e,t){var n=["temporary"],r="optional",i="optional";!0===t.persistentLicense&&(r="required",n.push("persistent-license")),!0===t.persistentStateRequired&&(r="required"),!0===t.distinctiveIdentifierRequired&&(i="required");var a=null!=t.videoRobustnesses?t.videoRobustnesses:"widevine"===e?X:[],o=null!=t.audioRobustnesses?t.audioRobustnesses:"widevine"===e?X:[];return 0===a.length&&a.push(void 0),0===o.length&&o.push(void 0),[{initDataTypes:["cenc"],videoCapabilities:(0,q.Z)(a,(function(e){return[{contentType:'video/mp4;codecs="avc1.4d401e"',robustness:e},{contentType:'video/mp4;codecs="avc1.42e01e"',robustness:e},{contentType:'video/webm;codecs="vp8"',robustness:e}]})),audioCapabilities:(0,q.Z)(o,(function(e){return[{contentType:'audio/mp4;codecs="mp4a.40.2"',robustness:e},{contentType:"audio/webm;codecs=opus",robustness:e}]})),distinctiveIdentifier:i,persistentState:r,sessionTypes:n}]}(s,l);return y.Z.debug("EME: Request keysystem access "+u+","+(t+1)+" of "+a.length,d),(0,H.N)(u,d).pipe((0,v.U)((function(e){return y.Z.info("EME: Found compatible keysystem",u,d),{type:"create-media-key-system-access",value:{options:l,mediaKeySystemAccess:e}}})),(0,h.K)((function(){return y.Z.debug("EME: Rejected access to keysystem",u,d),e(t+1)})))}(0)}))}var ee=n(2870),te=new WeakMap,ne=function(e){te.set(e,null)},re=function(e,t){var n=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer),r=(0,ee.Z)(n);te.set(e,{hash:r,serverCertificate:n})},ie=function(e){var t=te.get(e);return void 0!==t&&(null!==t||void 0)},ae=function(e,t){var n=te.get(e);if(null==n)return!1;var r=n.hash,i=n.serverCertificate,a=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer);if((0,ee.Z)(a)!==r||i.length!==a.length)return!1;for(var o=0;ooe)return t(r);var o=Math.min(Math.pow(2,i)*se,ue);return y.Z.warn("EME: attempt to close a mediaKeySession failed, scheduling retry...",o),(0,B.S)([(0,U.H)(o),(0,g.eX)(e),(0,g.GJ)(e)]).pipe((0,f.q)(1),(0,l.z)((function(){return n(a)})))})))}(0);function t(e){return y.Z.error("EME: Could not close MediaKeySession: "+(e instanceof Error?e.toString():"Unknown error")),(0,r.of)(null)}}var de=n(9689),ce=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,de.J)(this.initData)},e.decode=function(e){return(0,de.K)(e)},e}();function fe(e,t){var n,r;return null!==(r=null!==(n=pe(e,t))&&void 0!==n?n:pe(t,e))&&void 0!==r&&r}function pe(e,t){if(0===e.length)return!1;if(t.length=0?this._storage[t].payload:void 0},t.getAndReuse=function(e){var t=this._findIndex(e);if(-1!==t){var n=this._storage.splice(t,1)[0];return this._storage.push(n),n.payload}},t.store=function(e,t){var n=this._findIndex(e);n>=0&&this._storage.splice(n,1);var r=this._formatValuesForStore(e.values);this._storage.push({type:e.type,values:r,payload:t})},t.storeIfNone=function(e,t){if(this._findIndex(e)>=0)return!1;var n=this._formatValuesForStore(e.values);return this._storage.push({type:e.type,values:n,payload:t}),!0},t.remove=function(e){var t=this._findIndex(e);if(-1!==t)return this._storage.splice(t,1)[0].payload},t._findIndex=function(e){for(var t=this._formatValuesForStore(e.values),n=this._storage.length-1;n>=0;n--){var r=this._storage[n];if(r.type===e.type&&fe(r.values,t))return n}return-1},t._formatValuesForStore=function(e){return e.slice().sort((function(e,t){return e.systemId===t.systemId?0:void 0===e.systemId?1:void 0===t.systemId||e.systemId=0?function(e,t){var n=(0,Ie.q)(e)?{first:e}:"number"==typeof e?{each:e}:e,r=n.first,i=n.each,a=n.with,o=void 0===a?De:a,s=n.scheduler,u=void 0===s?null!=t?t:xe.z:s,l=n.meta,d=void 0===l?null:l;if(null==r&&null==i)throw new TypeError("No timeout provided.");return(0,Ze.e)((function(e,t){var n,a,s=null,l=0,c=function(e){a=(0,Ce.A)(t,u,(function(){n.unsubscribe(),(0,Me.Xf)(o({meta:d,lastValue:s,seen:l})).subscribe(t)}),e)};n=e.subscribe(new Pe.Q(t,(function(e){null==a||a.unsubscribe(),l++,t.next(s=e),i>0&&c(i)}),void 0,void 0,(function(){(null==a?void 0:a.closed)||null==a||a.unsubscribe(),s=null}))),c(null!=r?"number"==typeof r?r:+r-u.now():i)}))}(n):Ae.y)})),T=function(e,t){return{totalRetry:null!=t?t:2,baseDelay:200,maxDelay:3e3,shouldRetry:function(e){return e instanceof Ne||(0,D.Z)(e)||!0!==e.noRetry},onRetry:function(t){return e.next({type:"warning",value:qe(t)})}}}(d,f.retry);return(o=b,s=T,u=s.baseDelay,c=s.maxDelay,p=s.totalRetry,m=s.shouldRetry,g=s.onRetry,_=0,o.pipe((0,h.K)((function(e,t){if(!(0,D.Z)(m)&&!m(e)||_++>=p)throw e;"function"==typeof g&&g(e,_);var n=Math.min(u*Math.pow(2,_-1),c),r=(0,Be.Z)(n);return(0,U.H)(r).pipe((0,l.z)((function(){return t})))})))).pipe((0,v.U)((function(t){return{type:"key-message-handled",value:{session:e,license:t}}})),(0,h.K)((function(e){var t=qe(e);if(!(0,D.Z)(e)&&!0===e.fallbackOnLastTry)throw y.Z.warn("EME: Last `getLicense` attempt failed. Blacklisting the current session."),new We(t);throw t})),(0,L.O)({type:"session-message",value:{messageType:a,initializationData:i}}))}))),b=(0,a.T)(_,g).pipe((o=function(t){switch(t.type){case"key-message-handled":case"key-status-change-handled":return function(e,t,n){return(0,D.Z)(t)?(y.Z.info("EME: No message given, skipping session.update"),(0,r.of)({type:"no-update",value:{initializationData:n}})):(y.Z.info("EME: Updating MediaKeySession with message"),(0,I.Z)(e.update(t)).pipe((0,h.K)((function(e){var t=e instanceof Error?e.toString():"`session.update` failed";throw new R.Z("KEY_UPDATE_ERROR",t)})),(0,p.b)((function(){y.Z.info("EME: MediaKeySession update succeeded.")})),(0,O.h)({type:"session-updated",value:{session:e,license:t,initializationData:n}})))}(e,t.value.license,i);default:return(0,r.of)(t)}},(0,Oe.m)(s)?(0,l.z)(o,s,1):(0,l.z)(o,1))),T=(0,a.T)(Ye(e,t,n),b,m,d);return(0,D.Z)(e.closed)?T:T.pipe((0,Le.R)((0,I.Z)(e.closed)))}function Ye(e,t,n){return(0,A.P)((function(){if(0===e.keyStatuses.size)return u.E;var a=Ke(e,t,n),o=a.warnings,s=a.blacklistedKeyIDs,l=a.whitelistedKeyIds,d=o.length>0?r.of.apply(void 0,o):u.E,c=(0,r.of)({type:"keys-update",value:{whitelistedKeyIds:l,blacklistedKeyIDs:s}});return(0,i.z)(d,c)}))}function qe(e){if(e instanceof Ne)return new R.Z("KEY_LOAD_TIMEOUT","The license server took too much time to respond.");var t=new R.Z("KEY_LOAD_ERROR","An error occured when calling `getLicense`.");return!(0,D.Z)(e)&&(0,ge.Z)(e.message)&&(t.message=e.message),t}function Xe(e,t){return(0,A.P)((function(){return"function"!=typeof e.setServerCertificate?(y.Z.warn("EME: Could not set the server certificate. mediaKeys.setServerCertificate is not a function"),u.E):!0===ie(e)?(y.Z.info("EME: The MediaKeys already has a server certificate, skipping..."),u.E):(y.Z.info("EME: Setting server certificate on the MediaKeys"),ne(e),function(e,t){return(0,A.P)((function(){return(0,F.Z)((function(){return(0,I.Z)(e.setServerCertificate(t))}),void 0).pipe((0,h.K)((function(e){y.Z.warn("EME: mediaKeys.setServerCertificate returned an error",e);var t=e instanceof Error?e.toString():"`setServerCertificate` error";throw new R.Z("LICENSE_SERVER_CERTIFICATE_ERROR",t)})))}))}(e,t).pipe((0,p.b)((function(){re(e,t)})),(0,m.l)(),(0,h.K)((function(e){return(0,r.of)({type:"warning",value:e})}))))}))}var je=M.Z.EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS,Qe=M.Z.EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION,Je=g.Oh;var et=function(e,t,n){y.Z.debug("EME: Starting EMEManager logic.");var g=new ve,_=new ve,E=Te(e,t).pipe((0,l.z)((function(e){if("attached-media-keys"!==e.type)return(0,r.of)(e);var t=e.value,n=t.mediaKeys,a=t.options.serverCertificate;return(0,D.Z)(a)?(0,r.of)(e):(0,i.z)(Xe(n,a),(0,r.of)(e))})),(0,d.d)()),w=E.pipe((0,c.h)((function(e){return"attached-media-keys"===e.type})),(0,f.q)(1)),S=Je(e).pipe((0,p.b)((function(e){y.Z.debug("EME: Encrypted event received from media element.",e)})),(0,N.Z)((function(e){return k(e)}),null),(0,d.d)({refCount:!0})),A=n.pipe((0,p.b)((function(e){y.Z.debug("EME: Encrypted event received from Player",e)}))),x=(0,a.T)(A,S).pipe((0,l.z)((function(e){return w.pipe((0,v.U)((function(t){return[e,t]})))})),(0,l.z)((function(e){var t=e[0],n=e[1],i=n.value,d=i.mediaKeySystemAccess,c=i.stores,f=i.options,p=_.get(t);if(void 0!==p){if(void 0===t.type){y.Z.error("EME: The current session has already been blacklisted but the current content is not known. Throwing.");var E=p.sessionError;return E.fatal=!0,(0,o._)((function(){return E}))}return y.Z.warn("EME: The current session has already been blacklisted. Blacklisting content."),(0,r.of)({type:"blacklist-protection-data",value:t})}var w,S=new s.t(1);if("content"===f.singleLicensePer&&!g.isEmpty()){var k=t.keyIds;if(void 0===k)return y.Z.warn("EME: Initialization data linked to unknown key id, we'll not able to fallback from it."),(0,r.of)({type:"init-data-ignored",value:{initializationData:t}});var A=g.getAll()[0];return A.lastKeyUpdate$.pipe((0,l.z)((function(e){return k.every((function(t){for(var n=0;n0)(r=e.value.blacklistedKeyIDs).push.apply(r,a)}if(S.next(e.value),0===e.value.whitelistedKeyIds.length&&0===e.value.blacklistedKeyIDs.length||"temporary"===o||null===c.persistentSessionsStore||s)return e;var u=c.persistentSessionsStore;return function(e,t){if(!(isNaN(t)||t<0||t>=e.getLength())){var n=e.getLength(),r=n-t;y.Z.info("EME: Too many stored persistent sessions, removing some.",n,r),e.deleteOldSessions(r)}}(u,Qe-1),u.add(t,i),s=!0,e})),(0,h.K)((function(e){if(!(e instanceof We))throw e;_.store(t,e);var n=e.sessionError;if(void 0===t.type)throw y.Z.error("EME: Current session blacklisted and content not known. Throwing."),n.fatal=!0,n;return y.Z.warn("EME: Current session blacklisted. Blacklisting content."),(0,r.of)({type:"warning",value:n},{type:"blacklist-protection-data",value:t})})))})))})));return(0,a.T)(E,S.pipe((0,v.U)((function(e){return{type:"encrypted-event-received",value:e}}))),x)}},6033:function(e,t){"use strict";var n=new WeakMap;t.Z={setState:function(e,t){n.set(e,t)},getState:function(e){var t=n.get(e);return void 0===t?null:t},clearState:function(e){n.set(e,null)}}},4507:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(3071),i=n(2817),a=n(9127),o=n(6139);var s=n(8719),u=n(5157),l=n(7874),d=n(3887),c=s.Oh;function f(e,t,n){var s=(0,r.T)(c(e),n);return null==l.Z.emeManager?(0,r.T)(s.pipe((0,a.U)((function(){throw d.Z.error("Init: Encrypted event but EME feature not activated"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","EME feature not activated.")}))),(0,i.of)({type:"eme-disabled"})):0===t.length?(0,r.T)(s.pipe((0,a.U)((function(){throw d.Z.error("Init: Ciphered media and no keySystem passed"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Media is encrypted and no `keySystems` given")}))),(0,i.of)({type:"eme-disabled"})):"function"!=typeof o.N?(0,r.T)(s.pipe((0,a.U)((function(){throw d.Z.error("Init: Encrypted event but no EME API available"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Encryption APIs not found.")}))),(0,i.of)({type:"eme-disabled"})):(d.Z.debug("Init: Creating EMEManager"),l.Z.emeManager(e,t,n))}},8343:function(e,t){"use strict";var n={loaded:function(e){return{type:"loaded",value:{segmentBuffersStore:e}}},decipherabilityUpdate:function(e){return{type:"decipherabilityUpdate",value:e}},manifestReady:function(e){return{type:"manifestReady",value:{manifest:e}}},manifestUpdate:function(){return{type:"manifestUpdate",value:null}},nullRepresentation:function(e,t){return{type:"representationChange",value:{type:e,representation:null,period:t}}},reloadingMediaSource:function(){return{type:"reloading-media-source",value:void 0}},stalled:function(e){return{type:"stalled",value:e}},unstalled:function(){return{type:"unstalled",value:null}},warning:function(e){return{type:"warning",value:e}}};t.Z=n},2795:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(6362),i=n(2817),a=n(4975),o=n(4727),s=n(3833),u=n(9878),l=n(2006),d=n(8515),c=n(3994),f=n(3666);function p(){return f.op}var v=n(9917),h=n(8117),m=n(5561);var g=n(3774),y=n(8719);var _=n(3887);function b(e,t,n){var u=e.pipe((0,a.h)((function(e){var r=e.seeking,i=e.stalled,a=e.readyState,o=e.currentRange;return!r&&null===i&&(function(e,t){return!e||!f.SB||t}(n,t.hasAttribute("playsinline"))?(a>=4||3===a&&null!==o)&&(!p()||t.duration>0):a>=1&&t.duration>0)})),(0,o.q)(1),(0,s.h)("can-play"));return p()&&0===t.duration?(0,r.z)((0,i.of)("not-loaded-metadata"),u):u}function T(e){return function(e){return(0,v.P)((function(){return(0,m.Z)((function(){return(0,h.Z)(e.play())}),void 0)}))}(e).pipe((0,s.h)("autoplay"),(0,u.K)((function(e){if(e instanceof Error&&"NotAllowedError"===e.name)return _.Z.warn("Init: Media element can't play. It may be due to browser auto-play policies."),(0,i.of)("autoplay-blocked");throw e})))}function E(e){var t=e.clock$,n=e.mediaElement,r=e.startTime,a=e.mustAutoPlay,s=e.setCurrentTime,u=e.isDirectfile,f=function(e){return e.readyState>=g.cX.HAVE_METADATA?(0,i.of)(null):(0,y.K4)(e).pipe((0,o.q)(1))}(n).pipe((0,o.q)(1),(0,l.b)((function(){_.Z.info("Init: Set initial time",r);var e="function"==typeof r?r():r;s(e)})),(0,d.d)({refCount:!0})),p=f.pipe((0,c.z)((function(){return b(t,n,u).pipe((0,l.b)((function(){return _.Z.info("Init: Can begin to play content")})),(0,c.z)((function(e){return"can-play"===e?a?T(n):(n.autoplay&&_.Z.warn("Init: autoplay is enabled on HTML media element. Media will play as soon as possible."),(0,i.of)("loaded")):(0,i.of)(e)})))})),(0,d.d)({refCount:!0}));return{seek$:f,load$:p}}},8969:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(1545),i=n(2817),a=n(3071),o=n(3994),s=n(5583),u=n(533),l=n(9127),d=n(4975),c=n(4727),f=n(8902),p=n(1480),v=n(3887),h=n(5767);var m=n(3714),g=n(4437),y=n(4507),_=n(8343),b=n(2795),T=n(2447),E=n(2983);function w(e){var t=e.autoPlay,n=e.clock$,w=e.keySystems,S=e.mediaElement,k=e.speed$,A=e.setCurrentTime,x=e.startAt,I=e.url;if((0,h.Z)(S),null==I)throw new Error("No URL for a DirectFile content");var Z=function(e,t){return new p.y((function(n){return v.Z.info("Setting URL to Element",t,e),e.src=t,n.next(void 0),function(){(0,h.Z)(e)}}))}(S,I);v.Z.debug("Init: Calculating initial time");var M=function(){return function(e,t){if(null==t)return 0;if(null!=t.position)return t.position;if(null!=t.wallClockTime)return t.wallClockTime;if(null!=t.fromFirstPosition)return t.fromFirstPosition;var n=e.duration;if(null==n||!isFinite(n))return v.Z.warn("startAt.fromLastPosition set but no known duration, beginning at 0."),0;if("number"==typeof t.fromLastPosition)return Math.max(0,n+t.fromLastPosition);if(null!=t.percentage){var r=t.percentage;return r>=100?n:r<=0?0:n*(+r/100)}return 0}(S,x)};v.Z.debug("Init: Initial time calculated:",M);var R=(0,b.Z)({clock$:n,mediaElement:S,startTime:M,mustAutoPlay:t,setCurrentTime:A,isDirectfile:!0}),C=R.seek$,P=R.load$,N=Z.pipe((0,o.z)((function(){return(0,y.Z)(S,w,r.E)})),(0,g.Z)(),(0,s.B)()),D=(0,T.Z)(S),O=(0,E.Z)(S,k,n).pipe((0,u.l)()),L=n.pipe((0,l.U)((function(e){return null===e.stalled?_.Z.unstalled():_.Z.stalled(e.stalled)}))),B=N.pipe((0,d.h)((function(e){return"created-media-keys"===e.type?(e.value.attachMediaKeys$.next(),!0):"eme-disabled"===e.type||"attached-media-keys"===e.type})),(0,c.q)(1),(0,f.j)(P),(0,o.z)((function(e){if("autoplay-blocked"===e){var t=new m.Z("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");return(0,i.of)(_.Z.warning(t),_.Z.loaded(null))}if("not-loaded-metadata"===e){var n=new m.Z("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");return(0,i.of)(_.Z.warning(n))}return(0,i.of)(_.Z.loaded(null))}))),U=C.pipe((0,u.l)());return(0,a.T)(B,U,N,D,O,L)}},2447:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2401),i=n(3994),a=n(3714);function o(e){return(0,r.R)(e,"error").pipe((0,i.z)((function(){switch(null==e.error?0:e.error.code){case 1:throw new a.Z("MEDIA_ERR_ABORTED","The fetching of the associated resource was aborted by the user's request.");case 2:throw new a.Z("MEDIA_ERR_NETWORK","A network error occurred which prevented the media from being successfully fetched");case 3:throw new a.Z("MEDIA_ERR_DECODE","An error occurred while trying to decode the media resource");case 4:throw new a.Z("MEDIA_ERR_SRC_NOT_SUPPORTED","The media resource has been found to be unsuitable.");default:throw new a.Z("MEDIA_ERR_UNKNOWN","The HTMLMediaElement errored due to an unknown reason.")}})))}},2983:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(9917),i=n(2817),a=n(9127),o=n(8430),s=n(3741),u=n(4978),l=n(2006),d=n(3887);function c(e,t,n){return n.pipe((0,a.U)((function(e){return null!==e.stalled})),(0,o.O)(!1),(0,s.x)()).pipe((0,u.w)((function(n){return n?(0,r.P)((function(){return d.Z.info("Init: Pause playback to build buffer"),e.playbackRate=0,(0,i.of)(0)})):t.pipe((0,l.b)((function(t){d.Z.info("Init: Resume playback speed",t),e.playbackRate=t})))})))}},7127:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1788),i=n(9917),a=n(2817),o=n(3887),s=n(4123),u=n(4309),l=function(e){function t(){var t;return o.Z.debug("ISB: Creating ImageSegmentBuffer"),(t=e.call(this)||this).bufferType="image",t._buffered=new u.Z,t}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,i.P)((function(){var n,r;if(o.Z.debug("ISB: appending new data."),null===e.data.chunk)return(0,a.of)(void 0);var i=e.data,s=i.appendWindow,u=i.chunk,l=u.start,d=u.end,c=u.timescale,f=null!==(n=s[0])&&void 0!==n?n:0,p=null!==(r=s[1])&&void 0!==r?r:1/0,v=l/c,h=d/c,m=Math.max(f,v),g=Math.min(p,h);return t._buffered.insert(m,g),null!==e.inventoryInfos&&t._segmentInventory.insertChunk(e.inventoryInfos),(0,a.of)(void 0)}))},n.removeBuffer=function(e,t){return(0,i.P)((function(){return o.Z.info("ISB: ignored image data remove order",e,t),(0,a.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,i.P)((function(){return t._segmentInventory.completeSegment(e),(0,a.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){o.Z.debug("ISB: disposing image SegmentBuffer"),this._buffered.remove(0,1/0)},t}(s.C)},5192:function(e,t,n){"use strict";n.d(t,{Z:function(){return L}});var r=n(1788),i=n(3071),a=n(6697),o=n(6362),s=n(2817),u=n(6716),l=n(9917),d=n(8430),c=n(8550),f=n(3833),p=n(3505),v=n(8719),h=n(1480),m=n(9127),g=n(3741),y=n(3887),_=n(2203).Z?void 0:window.ResizeObserver;var b=n(944),T=n(4123),E=n(4309),w=n(7874);function S(e,t){return Math.abs(e-t)<=.2}function k(e,t){for(var n=e.length-1;n>=0;n--){if(e[n].startt)return e.slice(n,e.length)}return[]}function x(e,t,n){var r=Math.max(e.start,t),i=k(e.cues,t),a={start:e.start,end:r,cues:i},o=Math.min(n,e.end),s=A(e.cues,n);return[a,{start:o,end:e.end,cues:s}]}var I=function(){function e(){this._cuesBuffer=[]}var t=e.prototype;return t.get=function(e){for(var t=this._cuesBuffer,n=[],r=t.length-1;r>=0;r--){var i=t[r];if(e=i.start){for(var a=i.cues,o=0;o=a[o].start&&ee){var a=r[i];if(a.start>=n)return;if(a.end>=n){if(e<=a.start)a.cues=A(a.cues,n),a.start=n;else{var o=x(a,e,n),s=o[0],u=o[1];this._cuesBuffer[i]=s,r.splice(i+1,0,u)}return}a.start>=e?(r.splice(i,1),i--):(a.cues=k(a.cues,e),a.end=Math.max(e,a.start))}},t.insert=function(e,t,n){var r=this._cuesBuffer,i={start:t,end:n,cues:e};function a(e){var t=r[e];void 0===t||S(i.end,t.end)?r[e]=i:(t.start>=i.end||(t.cues=A(t.cues,i.end),t.start=i.end),r.splice(e,0,i))}for(var o=0;os.end);return void a(o)}if(ts.end);return void a(o)}if(S(s.end,n))return s.cues=k(s.cues,t),s.end=t,void r.splice(o+1,0,i);if(s.end>n){var u=x(s,t,n),l=u[0],d=u[1];return this._cuesBuffer[o]=l,r.splice(o+1,0,i),void r.splice(o+2,0,d)}for(s.cues=k(s.cues,t),s.end=t,s=r[o+1];void 0!==s&&n>s.end;)r.splice(o,1),s=r[o];return void a(o)}}r.push(i)},e}();function Z(e,t,n,r){for(var i=[t/n.columns,e/n.rows],a=r.getElementsByClassName("proportional-style"),o=0;o0}var M=v.C1,R=v.ik,C=v.d5,P=b.Z.MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,N=b.Z.TEXT_TRACK_SIZE_CHECKS_INTERVAL;function D(e,t){try{e.removeChild(t)}catch(e){y.Z.warn("HTSB: Can't remove text track: not in the element.")}}function O(e){var t=e.getAttribute("data-resolution-rows"),n=e.getAttribute("data-resolution-columns");if(null===t||null===n)return null;var r=parseInt(t,10),i=parseInt(n,10);return null===r||null===i?null:{rows:r,columns:i}}var L=function(e){function t(t,n){var r;return y.Z.debug("HTSB: Creating HTMLTextSegmentBuffer"),(r=e.call(this)||this).bufferType="text",r._buffered=new E.Z,r._videoElement=t,r._textTrackElement=n,r._clearSizeUpdates$=new u.x,r._destroy$=new u.x,r._buffer=new I,r._currentCues=[],function(e){var t=C(e),n=R(e),r=M(e),u=(0,i.T)(n,r),l=(0,a.F)(P).pipe((0,d.O)(null));return u.pipe((0,d.O)(null),(0,c.c)((0,o.z)(l.pipe((0,f.h)(!0),(0,p.R)(t)),(0,s.of)(!1))))}(r._videoElement).pipe((0,p.R)(r._destroy$)).subscribe((function(e){if(e){var t=Math.max(r._videoElement.currentTime+P/1e3/2,0),n=r._buffer.get(t);0===n.length?r._disableCurrentCues():r._displayCues(n)}else r._disableCurrentCues()})),r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,l.P)((function(){return t.pushChunkSync(e),(0,s.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,l.P)((function(){return n.removeBufferSync(e,t),(0,s.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,l.P)((function(){return t._segmentInventory.completeSegment(e),(0,s.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){y.Z.debug("HTSB: Disposing HTMLTextSegmentBuffer"),this._disableCurrentCues(),this._buffer.remove(0,1/0),this._buffered.remove(0,1/0),this._destroy$.next(),this._destroy$.complete()},n.pushChunkSync=function(e){var t,n;y.Z.debug("HTSB: Appending new html text tracks");var r=e.data,i=r.timestampOffset,a=r.appendWindow,o=r.chunk;if(null!==o){var s,u,l=o.start,d=o.end,c=o.data,f=o.type,p=o.language,v=null!==(t=a[0])&&void 0!==t?t:0,h=null!==(n=a[1])&&void 0!==n?n:1/0,m=function(e,t,n,r){y.Z.debug("HTSB: Finding parser for html text tracks:",e);var i=w.Z.htmlTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");y.Z.debug("HTSB: Parser found, parsing...");var a=i(t,n,r);return y.Z.debug("HTTB: Parsed successfully!",a),a}(f,c,i,p);if(0!==v&&h!==1/0){for(var g=0;g=0&&m[g].start>=h;)g--;for(m.splice(g,m.length),g=m.length-1;g>=0&&m[g].end>h;)m[g].end=h,g--}if(void 0!==l)s=Math.max(v,l);else{if(m.length<=0)return void y.Z.warn("HTSB: Current text tracks have no cues nor start time. Aborting");y.Z.warn("HTSB: No start time given. Guessing from cues."),s=m[0].start}if(void 0!==d)u=Math.min(h,d);else{if(m.length<=0)return void y.Z.warn("HTSB: Current text tracks have no cues nor end time. Aborting");y.Z.warn("HTSB: No end time given. Guessing from cues."),u=m[m.length-1].end}u<=s?y.Z.warn("HTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."):(null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos),this._buffer.insert(m,s,u),this._buffered.insert(s,u))}},n.removeBufferSync=function(e,t){y.Z.debug("HTSB: Removing html text track data",e,t),this._buffer.remove(e,t),this._buffered.remove(e,t)},n._disableCurrentCues=function(){if(this._clearSizeUpdates$.next(),this._currentCues.length>0){for(var e=0;e0&&function(e,t){return(0,l.P)((function(){if(void 0!==_){var n=-1,r=-1;return new h.y((function(t){var i=new _((function(e){if(0!==e.length){var i=e[0].contentRect,a=i.height,o=i.width;a===n&&o===r||(n=a,r=o,t.next({height:a,width:o}))}else y.Z.error("Compat: Resized but no observed element.")}));return i.observe(e),function(){i.disconnect()}}))}return(0,a.F)(t).pipe((0,d.O)(null),(0,m.U)((function(){var t=e.getBoundingClientRect();return{height:t.height,width:t.width}})),(0,g.x)((function(e,t){return e.height===t.height&&e.width===t.width})))}))}(this._textTrackElement,N).pipe((0,p.R)(this._clearSizeUpdates$),(0,p.R)(this._destroy$)).subscribe((function(e){for(var t=e.height,n=e.width,r=0;r0?e.textTracks[u-1]:e.addTextTrack(s)).mode=t?null!==(n=i.HIDDEN)&&void 0!==n?n:"hidden":null!==(r=i.SHOWING)&&void 0!==r?r:"showing"}else a=document.createElement("track"),e.appendChild(a),i=a.track,a.kind=s,i.mode=t?"hidden":"showing";return{track:i,trackElement:a}}(t,n),a=i.track,u=i.trackElement;return r.bufferType="text",r._buffered=new d.Z,r._videoElement=t,r._track=a,r._trackElement=u,r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,i.P)((function(){var n,r;if(s.Z.debug("NTSB: Appending new native text tracks"),null===e.data.chunk)return(0,a.of)(void 0);var i,o,u=e.data,l=u.timestampOffset,d=u.appendWindow,f=u.chunk,p=f.start,v=f.end,h=f.data,m=f.type,g=f.language,y=null!==(n=d[0])&&void 0!==n?n:0,_=null!==(r=d[1])&&void 0!==r?r:1/0,b=function(e,t,n,r){s.Z.debug("NTSB: Finding parser for native text tracks:",e);var i=c.Z.nativeTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");s.Z.debug("NTSB: Parser found, parsing...");var a=i(t,n,r);return s.Z.debug("NTSB: Parsed successfully!",a),a}(m,h,l,g);if(0!==y&&_!==1/0){for(var T=0;T=0&&b[T].startTime>=_;)T--;for(b.splice(T,b.length),T=b.length-1;T>=0&&b[T].endTime>_;)b[T].endTime=_,T--}if(void 0!==p)i=Math.max(y,p);else{if(b.length<=0)return s.Z.warn("NTSB: Current text tracks have no cues nor start time. Aborting"),(0,a.of)(void 0);s.Z.warn("NTSB: No start time given. Guessing from cues."),i=b[0].startTime}if(void 0!==v)o=Math.min(_,v);else{if(b.length<=0)return s.Z.warn("NTSB: Current text tracks have no cues nor end time. Aborting"),(0,a.of)(void 0);s.Z.warn("NTSB: No end time given. Guessing from cues."),o=b[b.length-1].endTime}if(o<=i)return s.Z.warn("NTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."),(0,a.of)(void 0);if(b.length>0){var E=b[0],w=t._track.cues;null!==w&&w.length>0&&E.startTime=0;i--){var a=r[i],o=a.startTime,l=a.endTime;o>=e&&o<=t&&l<=t&&u(n,a)}this._buffered.remove(e,t)},t}(l.C)},4123:function(e,t,n){"use strict";n.d(t,{C:function(){return m},f:function(){return h}});var r=n(944),i=n(3887),a=n(5952),o=n(5278),s=r.Z.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,u=r.Z.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE,l=r.Z.MINIMUM_SEGMENT_SIZE,d=function(){function e(){this._inventory=[]}var t=e.prototype;return t.reset=function(){this._inventory.length=0},t.synchronizeBuffered=function(e){for(var t=this._inventory,n=0,r=t[0],a=null==r?void 0:r.infos.adaptation.type,s=e.length,u=0;u0){var g=t[f+m-1];h={end:(0,o.Z)(g.bufferedEnd,g.end),precizeEnd:g.precizeEnd},i.Z.debug("SI: "+m+" segments GCed.",a),t.splice(f,m),n=f}if(void 0===r)return;if(c-(0,o.Z)(r.bufferedStart,r.start)>=l){if(p(r,d,h,a),n===t.length-1)return void v(r,c,a);r=t[++n];for(var y=(0,o.Z)(r.bufferedStart,r.start),_=(0,o.Z)(r.bufferedEnd,r.end),b=u=l&&(void 0===b||c-y>=_-b);){var T=t[n-1];void 0===T.bufferedEnd&&(T.bufferedEnd=r.precizeStart?r.start:T.end,i.Z.debug("SI: calculating buffered end of contiguous segment",a,T.bufferedEnd,T.end)),r.bufferedStart=T.bufferedEnd,void 0!==(r=t[++n])&&(y=(0,o.Z)(r.bufferedStart,r.start),_=(0,o.Z)(r.bufferedEnd,r.end))}}var E=t[n-1];void 0!==E&&v(E,c,a)}}null!=r&&(i.Z.debug("SI: last segments have been GCed",a,n,t.length),t.splice(n,t.length-n)),void 0!==a&&"DEBUG"===i.Z.getLevel()&&i.Z.debug("SI: current "+a+" inventory timeline:\n"+function(e){var t=1/60,n={},r=[],i=null,a=null;function o(e){var t=String.fromCharCode(r.length+65);return r.push({letter:t,periodId:e.period.id,representationId:e.representation.id,bitrate:e.representation.bitrate}),t}for(var s="",u=0;u=s)i.Z.warn("SI: Invalid chunked inserted: starts before it ends",u,o,s);else{for(var l=this._inventory,d={partiallyPushed:!0,estimatedStart:o,start:o,end:s,precizeStart:!1,precizeEnd:!1,bufferedStart:void 0,bufferedEnd:void 0,infos:{segment:a,period:t,adaptation:n,representation:r}},c=l.length-1;c>=0;c--){var f=l[c];if(f.start<=o){if(f.end<=o){for(i.Z.debug("SI: Pushing segment strictly after previous one.",u,o,f.end),this._inventory.splice(c+1,0,d),c+=2;cd.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,d.end,l[c].start),l[c].start=d.end,l[c].bufferedStart=void 0,void(l[c].precizeStart=l[c].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[c].start,l[c].end),l.splice(c,1)}return}if(f.start===o){if(f.end<=s){for(i.Z.debug("SI: Segment pushed replace another one",u,o,s,f.end),this._inventory.splice(c,1,d),c+=1;cd.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,d.end,l[c].start),l[c].start=d.end,l[c].bufferedStart=void 0,void(l[c].precizeStart=l[c].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[c].start,l[c].end),l.splice(c,1)}return}return i.Z.debug("SI: Segment pushed ends before another with the same start",u,o,s,f.end),l.splice(c,0,d),f.start=d.end,f.bufferedStart=void 0,void(f.precizeStart=f.precizeStart&&d.precizeEnd)}if(f.end<=d.end){for(i.Z.debug("SI: Segment pushed updates end of previous one",u,o,s,f.start,f.end),this._inventory.splice(c+1,0,d),f.end=d.start,f.bufferedEnd=void 0,f.precizeEnd=f.precizeEnd&&d.precizeStart,c+=2;cd.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,d.end,l[c].start),l[c].start=d.end,l[c].bufferedStart=void 0,void(l[c].precizeStart=l[c].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[c].start,l[c].end),l.splice(c,1)}return}i.Z.debug("SI: Segment pushed is contained in a previous one",u,o,s,f.start,f.end);var p={partiallyPushed:f.partiallyPushed,start:d.end,end:f.end,precizeStart:f.precizeStart&&f.precizeEnd&&d.precizeEnd,precizeEnd:f.precizeEnd,bufferedStart:void 0,bufferedEnd:f.end,infos:f.infos};return f.end=d.start,f.bufferedEnd=void 0,f.precizeEnd=f.precizeEnd&&d.precizeStart,l.splice(c+1,0,d),void l.splice(c+2,0,p)}}var v=this._inventory[0];if(void 0===v)return i.Z.debug("SI: first segment pushed",u,o,s),void this._inventory.push(d);if(!(v.start>=s)){if(v.end<=s){for(i.Z.debug("SI: Segment pushed starts before and completely recovers the previous first one",u,o,s,v.start,v.end),this._inventory.splice(0,1,d);l.length>1&&l[1].startd.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,d.end,l[1].start),l[1].start=d.end,l[1].bufferedStart=void 0,void(l[1].precizeStart=d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[1].start,l[1].end),l.splice(1,1)}return}return i.Z.debug("SI: Segment pushed start of the next one",u,o,s,v.start,v.end),v.start=s,v.bufferedStart=void 0,v.precizeStart=d.precizeEnd,void this._inventory.splice(0,0,d)}i.Z.debug("SI: Segment pushed comes before all previous ones",u,o,s,v.start),this._inventory.splice(0,0,d)}}},t.completeSegment=function(e){if(!e.segment.isInit){for(var t=this._inventory,n=!1,r=0;r0&&(this._inventory.splice(o+1,u),r-=u),this._inventory[o].partiallyPushed=!1,this._inventory[o].end=l,this._inventory[o].bufferedEnd=d}n||i.Z.warn("SI: Completed Segment not found",e)}},t.getInventory=function(){return this._inventory},e}();function c(e){if(void 0===e.bufferedStart||e.partiallyPushed)return!1;var t=e.start,n=e.end-t;return Math.abs(t-e.bufferedStart)<=s&&(void 0===e.bufferedEnd||e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-n)<=Math.min(u,n/3))}function f(e){if(void 0===e.bufferedEnd||e.partiallyPushed)return!1;var t=e.start,n=e.end,r=n-t;return Math.abs(n-e.bufferedEnd)<=s&&null!=e.bufferedStart&&e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-r)<=Math.min(u,r/3)}function p(e,t,n,r){void 0!==e.bufferedStart?(e.bufferedStartt&&(n.precizeEnd||e.start-n.end<=s)?(i.Z.debug("SI: buffered start is end of previous segment",r,t,e.start,n.end),e.bufferedStart=n.end,c(e)&&(e.start=n.end,e.precizeStart=!0)):e.start-t<=s?(i.Z.debug("SI: found true buffered start",r,t,e.start),e.bufferedStart=t,c(e)&&(e.start=t,e.precizeStart=!0)):tt&&(i.Z.debug("SI: Segment partially GCed at the end",n,e.bufferedEnd,t),e.bufferedEnd=t),!e.precizeEnd&&t-e.end<=s&&f(e)&&(e.precizeEnd=!0,e.end=t)):e.precizeEnd?(i.Z.debug("SI: buffered end is precize end",n,e.end),e.bufferedEnd=e.end):t-e.end<=s?(i.Z.debug("SI: found true buffered end",n,t,e.end),e.bufferedEnd=t,f(e)&&(e.end=t,e.precizeEnd=!0)):t>e.end?(i.Z.debug("SI: range end too far from expected end",n,t,e.end),e.bufferedEnd=e.end):(i.Z.debug("SI: Segment appears immediately garbage collected at the end",n,e.bufferedEnd,t),e.bufferedEnd=t)}var h,m=function(){function e(){this._segmentInventory=new d}var t=e.prototype;return t.synchronizeInventory=function(){this._segmentInventory.synchronizeBuffered(this.getBufferedRanges())},t.getInventory=function(){return this._segmentInventory.getInventory()},t.getPendingOperations=function(){return[]},e}();!function(e){e[e.Push=0]="Push",e[e.Remove=1]="Remove",e[e.EndOfSegment=2]="EndOfSegment"}(h||(h={}))},4309:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2829),i=function(){function e(){this._ranges=[],this.length=0}var t=e.prototype;return t.insert=function(e,t){(0,r.kR)(this._ranges,{start:e,end:t}),this.length=this._ranges.length},t.remove=function(e,t){var n=[];e>0&&n.push({start:0,end:e}),t<1/0&&n.push({start:t,end:1/0}),this._ranges=(0,r.tn)(this._ranges,n),this.length=this._ranges.length},t.start=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].start},t.end=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].end},e}()},3801:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3349),i=n(1788),a=function(e){function t(n){var i;return i=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(i),t.prototype),i.name="AssertionError",i.message=n,i}return(0,i.Z)(t,e),t}((0,n(3786).Z)(Error))},7839:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3349),i=n(1788),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="CustomLoaderError",s.message=n,s.canRetry=i,s.isOfflineError=a,s.xhr=o,s}return(0,i.Z)(t,e),t}((0,n(3786).Z)(Error))},5157:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(3349),i=n(1788),a=n(3786),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="EncryptedMediaError",a.type=o.ZB.ENCRYPTED_MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},5992:function(e,t,n){"use strict";n.d(t,{ZB:function(){return r},br:function(){return i},SM:function(){return a}});var r={NETWORK_ERROR:"NETWORK_ERROR",MEDIA_ERROR:"MEDIA_ERROR",ENCRYPTED_MEDIA_ERROR:"ENCRYPTED_MEDIA_ERROR",OTHER_ERROR:"OTHER_ERROR"},i={TIMEOUT:"TIMEOUT",ERROR_EVENT:"ERROR_EVENT",ERROR_HTTP_CODE:"ERROR_HTTP_CODE",PARSE_ERROR:"PARSE_ERROR"},a={PIPELINE_LOAD_ERROR:"PIPELINE_LOAD_ERROR",PIPELINE_PARSE_ERROR:"PIPELINE_PARSE_ERROR",INTEGRITY_ERROR:"INTEGRITY_ERROR",MANIFEST_PARSE_ERROR:"MANIFEST_PARSE_ERROR",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"MANIFEST_INCOMPATIBLE_CODECS_ERROR",MANIFEST_UPDATE_ERROR:"MANIFEST_UPDATE_ERROR",MANIFEST_UNSUPPORTED_ADAPTATION_TYPE:"MANIFEST_UNSUPPORTED_ADAPTATION_TYPE",MEDIA_STARTING_TIME_NOT_FOUND:"MEDIA_STARTING_TIME_NOT_FOUND",MEDIA_TIME_BEFORE_MANIFEST:"MEDIA_TIME_BEFORE_MANIFEST",MEDIA_TIME_AFTER_MANIFEST:"MEDIA_TIME_AFTER_MANIFEST",MEDIA_TIME_NOT_FOUND:"MEDIA_TIME_NOT_FOUND",NO_PLAYABLE_REPRESENTATION:"NO_PLAYABLE_REPRESENTATION",MEDIA_IS_ENCRYPTED_ERROR:"MEDIA_IS_ENCRYPTED_ERROR",CREATE_MEDIA_KEYS_ERROR:"CREATE_MEDIA_KEYS_ERROR",KEY_ERROR:"KEY_ERROR",KEY_STATUS_CHANGE_ERROR:"KEY_STATUS_CHANGE_ERROR",KEY_UPDATE_ERROR:"KEY_UPDATE_ERROR",KEY_LOAD_ERROR:"KEY_LOAD_ERROR",KEY_LOAD_TIMEOUT:"KEY_LOAD_TIMEOUT",KEY_GENERATE_REQUEST_ERROR:"KEY_GENERATE_REQUEST_ERROR",INCOMPATIBLE_KEYSYSTEMS:"INCOMPATIBLE_KEYSYSTEMS",INVALID_ENCRYPTED_EVENT:"INVALID_ENCRYPTED_EVENT",INVALID_KEY_SYSTEM:"INVALID_KEY_SYSTEM",LICENSE_SERVER_CERTIFICATE_ERROR:"LICENSE_SERVER_CERTIFICATE_ERROR",MULTIPLE_SESSIONS_SAME_INIT_DATA:"MULTIPLE_SESSIONS_SAME_INIT_DATA",BUFFER_APPEND_ERROR:"BUFFER_APPEND_ERROR",BUFFER_FULL_ERROR:"BUFFER_FULL_ERROR",BUFFER_TYPE_UNKNOWN:"BUFFER_TYPE_UNKNOWN",MEDIA_ERR_BLOCKED_AUTOPLAY:"MEDIA_ERR_BLOCKED_AUTOPLAY",MEDIA_ERR_PLAY_NOT_ALLOWED:"MEDIA_ERR_PLAY_NOT_ALLOWED",MEDIA_ERR_NOT_LOADED_METADATA:"MEDIA_ERR_NOT_LOADED_METADATA",MEDIA_ERR_ABORTED:"MEDIA_ERR_ABORTED",MEDIA_ERR_NETWORK:"MEDIA_ERR_NETWORK",MEDIA_ERR_DECODE:"MEDIA_ERR_DECODE",MEDIA_ERR_SRC_NOT_SUPPORTED:"MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ERR_UNKNOWN:"MEDIA_ERR_UNKNOWN",MEDIA_SOURCE_NOT_SUPPORTED:"MEDIA_SOURCE_NOT_SUPPORTED",MEDIA_KEYS_NOT_SUPPORTED:"MEDIA_KEYS_NOT_SUPPORTED",DISCONTINUITY_ENCOUNTERED:"DISCONTINUITY_ENCOUNTERED",NONE:"NONE"}},7367:function(e,t,n){"use strict";function r(e,t,n){return e+" ("+t+") "+n}n.d(t,{Z:function(){return r}})},9822:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5157),i=n(5992),a=n(3714),o=n(9362),s=n(5389);function u(e){return(e instanceof r.Z||e instanceof a.Z||e instanceof s.Z||e instanceof o.Z)&&Object.keys(i.ZB).indexOf(e.type)>=0}},3714:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(3349),i=n(1788),a=n(3786),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="MediaError",a.type=o.ZB.MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9362:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(3349),i=n(1788),a=n(3786),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="NetworkError",a.type=o.ZB.NETWORK_ERROR,a.xhr=void 0===i.xhr?null:i.xhr,a.url=i.url,a.status=i.status,a.errorType=i.type,a.code=n,a.message=(0,s.Z)(a.name,a.code,i.message),a.fatal=!1,a}return(0,i.Z)(t,e),t.prototype.isHttpError=function(e){return this.errorType===o.br.ERROR_HTTP_CODE&&this.status===e},t}((0,a.Z)(Error))},5389:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(3349),i=n(1788),a=n(3786),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="OtherError",a.type=o.ZB.OTHER_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9105:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3349),i=n(1788),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="RequestError",s.url=n,s.xhr=o,s.status=i,s.type=a,s.message=a,s}return(0,i.Z)(t,e),t}((0,n(3786).Z)(Error))},7273:function(e,t){"use strict";t.Z={dashParsers:{wasm:null,js:null},directfile:null,emeManager:null,htmlTextTracksBuffer:null,htmlTextTracksParsers:{},imageBuffer:null,imageParser:null,nativeTextTracksBuffer:null,nativeTextTracksParsers:{},transports:{}}},7874:function(e,t,n){"use strict";var r=n(7273);t.Z=r.Z},3887:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(8894),i=new(function(){function e(){this.error=r.Z,this.warn=r.Z,this.info=r.Z,this.debug=r.Z,this._levels={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4},this._currentLevel="NONE"}var t=e.prototype;return t.setLevel=function(e){var t,n=this._levels[e];"number"==typeof n?(t=n,this._currentLevel=e):(t=0,this._currentLevel="NONE"),this.error=t>=this._levels.ERROR?console.error.bind(console):r.Z,this.warn=t>=this._levels.WARNING?console.warn.bind(console):r.Z,this.info=t>=this._levels.INFO?console.info.bind(console):r.Z,this.debug=t>=this._levels.DEBUG?console.log.bind(console):r.Z},t.getLevel=function(){return this._currentLevel},e}())},8999:function(e,t,n){"use strict";n.d(t,{r:function(){return p},Z:function(){return v}});var r=n(3714),i=n(3887),a=n(3274),o=n(7714),s=n(1946),u=n(7829);var l="undefined"!=typeof window&&"function"==typeof window.Set&&"function"==typeof Array.from?function(e){return Array.from(new Set(e))}:function(e){return e.filter((function(e,t,n){return n.indexOf(e)===t}))},d=n(3774);var c=n(4791),f=function(){function e(e,t){var n;this.id=e.id,this.bitrate=e.bitrate,this.codec=e.codecs,void 0!==e.height&&(this.height=e.height),void 0!==e.width&&(this.width=e.width),void 0!==e.mimeType&&(this.mimeType=e.mimeType),void 0!==e.contentProtections&&(this.contentProtections=e.contentProtections),void 0!==e.frameRate&&(this.frameRate=e.frameRate),void 0!==e.hdrInfo&&(this.hdrInfo=e.hdrInfo),this.index=e.index,this.isSupported="audio"!==t.type&&"video"!==t.type||(n=this.getMimeTypeString(),null!=d.JJ&&("function"!=typeof d.JJ.isTypeSupported||d.JJ.isTypeSupported(n)))}var t=e.prototype;return t.getMimeTypeString=function(){var e,t;return(null!==(e=this.mimeType)&&void 0!==e?e:"")+';codecs="'+(null!==(t=this.codec)&&void 0!==t?t:"")+'"'},t.getEncryptionData=function(e){for(var t,n=this.getAllEncryptionData(),r=[],i=0;i0&&(this.trickModeTracks=l.map((function(t){return new e(t)})));for(var h=t.representations,m=[],g=!1,y=0;y0&&!g){i.Z.warn("Incompatible codecs for adaptation",t);var b=new r.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");this.parsingErrors.push(b)}}var t=e.prototype;return t.getAvailableBitrates=function(){for(var e=[],t=0;t0}));if(o.every((function(e){return!e.isSupported}))&&a.length>0&&("video"===i||"audio"===i))throw new f.Z("MANIFEST_PARSE_ERROR","No supported "+i+" adaptations");return o.length>0&&(r[i]=o),r}),{}),!Array.isArray(this.adaptations.video)&&!Array.isArray(this.adaptations.audio))throw new f.Z("MANIFEST_PARSE_ERROR","No supported audio and video tracks.");this.duration=e.duration,this.start=e.start,null!=this.duration&&null!=this.start&&(this.end=this.start+this.duration),this.streamEvents=void 0===e.streamEvents?[]:e.streamEvents}var t=e.prototype;return t.getAdaptations=function(){var e=this.adaptations;return(0,p.Z)(e).reduce((function(e,t){return null!=t?e.concat(t):e}),[])},t.getAdaptationsForType=function(e){var t=this.adaptations[e];return null==t?[]:t},t.getAdaptation=function(e){return(0,o.Z)(this.getAdaptations(),(function(t){var n=t.id;return e===n}))},t.getSupportedAdaptations=function(e){if(void 0===e)return this.getAdaptations().filter((function(e){return e.isSupported}));var t=this.adaptations[e];return void 0===t?[]:t.filter((function(e){return e.isSupported}))},e}(),h=n(3887),m=function(){function e(e){this._mediaURLs=e.media}var t=e.prototype;return t.getInitSegment=function(){return null},t.getSegments=function(){return[{id:"0",isInit:!1,number:0,mediaURLs:[this._mediaURLs],time:0,end:Number.MAX_VALUE,duration:Number.MAX_VALUE,timescale:1}]},t.getFirstPosition=function(){},t.getLastPosition=function(){},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(){h.Z.warn("Tried to replace a static RepresentationIndex")},t._update=function(){h.Z.warn("Tried to update a static RepresentationIndex")},e}();!function(e){e[e.Full=0]="Full",e[e.Partial=1]="Partial"}(r||(r={}));var g=n(5138);function y(e,t,n){e.start=t.start,e.end=t.end,e.duration=t.duration,e.streamEvents=t.streamEvents;for(var i=e.getAdaptations(),a=t.getAdaptations(),s=function(e){var t=i[e],s=(0,o.Z)(a,(function(e){return e.id===t.id}));if(void 0===s)h.Z.warn('Manifest: Adaptation "'+i[e].id+'" not found when merging.');else for(var u=i[e].representations,l=s.representations,d=function(e){var t=u[e],i=(0,o.Z)(l,(function(e){return e.id===t.id}));void 0===i?h.Z.warn('Manifest: Representation "'+u[e].id+'" not found when merging.'):n===r.Full?t.index._replace(i.index):t.index._update(i.index)},c=0;c0&&r._addSupplementaryImageAdaptations(u),o.length>0&&r._addSupplementaryTextAdaptations(o),r}(0,i.Z)(t,e);var n=t.prototype;return n.getPeriod=function(e){return(0,o.Z)(this.periods,(function(t){return e===t.id}))},n.getPeriodForTime=function(e){return(0,o.Z)(this.periods,(function(t){return e>=t.start&&(void 0===t.end||t.end>e)}))},n.getNextPeriod=function(e){return(0,o.Z)(this.periods,(function(t){return t.start>e}))},n.getPeriodAfter=function(e){var t=e.end;if(void 0===t)return null;var n=(0,o.Z)(this.periods,(function(e){return void 0===e.end||t0&&this.trigger("decipherabilityUpdate",r)},n.addUndecipherableProtectionData=function(e){var t=T(this,(function(t){var n,r;if(!1===t.decipherable)return!1;for(var i=null!==(r=null===(n=t.contentProtections)||void 0===n?void 0:n.initData)&&void 0!==r?r:[],o=function(t){if((void 0===e.type||i[t].type===e.type)&&e.values.every((function(e){return i[t].values.some((function(t){return(void 0===e.systemId||t.systemId===e.systemId)&&(0,a.Z)(t.data,e.data)}))})))return{v:!1}},s=0;s0&&this.trigger("decipherabilityUpdate",t)},n.getAdaptations=function(){(0,l.Z)("manifest.getAdaptations() is deprecated. Please use manifest.period[].getAdaptations() instead");var e=this.periods[0];if(void 0===e)return[];var t=e.adaptations,n=[];for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];n.push.apply(n,i)}return n},n.getAdaptationsForType=function(e){(0,l.Z)("manifest.getAdaptationsForType(type) is deprecated. Please use manifest.period[].getAdaptationsForType(type) instead");var t=this.periods[0];if(void 0===t)return[];var n=t.adaptations[e];return void 0===n?[]:n},n.getAdaptation=function(e){return(0,l.Z)("manifest.getAdaptation(id) is deprecated. Please use manifest.period[].getAdaptation(id) instead"),(0,o.Z)(this.getAdaptations(),(function(t){var n=t.id;return e===n}))},n._addSupplementaryImageAdaptations=function(e){var t=this,n=(Array.isArray(e)?e:[e]).map((function(e){var n,r=e.mimeType,i=e.url,a="gen-image-ada-"+_(),o="gen-image-rep-"+_(),s=new d.Z({id:a,type:"image",representations:[{bitrate:0,id:o,mimeType:r,index:new m({media:i})}]},{isManuallyAdded:!0});return(n=t.parsingErrors).push.apply(n,s.parsingErrors),s}));if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.image=null!=r.image?r.image.concat(n):n}},n._addSupplementaryTextAdaptations=function(e){var t=this,n=(Array.isArray(e)?e:[e]).reduce((function(e,n){var r=n.mimeType,i=n.codecs,a=n.url,o=n.language,s=n.languages,u=n.closedCaption,l=null!=o?[o]:null!=s?s:[];return e.concat(l.map((function(e){var n,o="gen-text-ada-"+_(),s="gen-text-rep-"+_(),l=new d.Z({id:o,type:"text",language:e,closedCaption:u,representations:[{bitrate:0,id:s,mimeType:r,codecs:i,index:new m({media:a})}]},{isManuallyAdded:!0});return(n=t.parsingErrors).push.apply(n,l.parsingErrors),l})))}),[]);if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.text=null!=r.text?r.text.concat(n):n}},n._performUpdate=function(e,t){if(this.availabilityStartTime=e.availabilityStartTime,this.expired=e.expired,this.isDynamic=e.isDynamic,this.isLive=e.isLive,this.isLastPeriodKnown=e.isLastPeriodKnown,this.lifetime=e.lifetime,this.parsingErrors=e.parsingErrors,this.suggestedPresentationDelay=e.suggestedPresentationDelay,this.transport=e.transport,this.publishTime=e.publishTime,t===r.Full)this._timeBounds=e._timeBounds,this.uris=e.uris,function(e,t){for(var n=0,i=0;ie.length)h.Z.error("Manifest: error when updating Periods");else{n0&&e.push.apply(e,d)}}(this.periods,e.periods);else{this._timeBounds.maximumTimeData=e._timeBounds.maximumTimeData,this.updateUrl=e.uris[0],function(e,t){if(0!==e.length){if(0!==t.length){var n=e[e.length-1];if(n.starta&&(e.splice(a,u-a),u=a),y(e[u],s,r.Full),a++}a0;){var i=this.periods[0];if(void 0===i.end||i.end>n)break;this.periods.shift()}}this.adaptations=void 0===this.periods[0]?{}:this.periods[0].adaptations,this.trigger("manifestUpdate",null)},t}(s.Z)},2689:function(e,t,n){"use strict";n.d(t,{s:function(){return r}});var r=Math.pow(2,32)-1},2297:function(e,t,n){"use strict";n.d(t,{iz:function(){return o},t_:function(){return a},Qy:function(){return s},Xj:function(){return l},nR:function(){return u}});var r=n(3887),i=n(6968);function a(e,t){var n=s(e,t);return null!==n?e.subarray(n[1],n[2]):null}function o(e,t){var n=s(e,t);return null!==n?e.subarray(n[0],n[2]):null}function s(e,t){for(var n,r,a=e.length,o=0,s=0;o+8<=a;){if(r=o,s=(0,i.pX)(e,r),r+=4,n=(0,i.pX)(e,r),r+=4,0===s)s=a-o;else if(1===s){if(r+8>a)return null;s=(0,i.pV)(e,r),r+=8}if(s<0)throw new Error("ISOBMFF: Size out of range");if(n===t)return 1970628964===t&&(r+=16),[o,r,o+s];o+=s}return null}function u(e,t,n,r,a){for(var o,s=e.length,u=0;us)return;o=(0,i.pV)(e,l),l+=8}if(1970628964===d&&l+16<=s&&(0,i.pX)(e,l)===t&&(0,i.pX)(e,l+4)===n&&(0,i.pX)(e,l+8)===r&&(0,i.pX)(e,l+12)===a)return l+=16,e.subarray(l,u+o)}}function l(e){var t=e.length;if(t<8)return r.Z.warn("ISOBMFF: box inferior to 8 bytes, cannot find offsets"),null;var n=0,a=(0,i.pX)(e,n);n+=4;var o=(0,i.pX)(e,n);if(n+=4,0===a)a=t;else if(1===a){if(n+8>t)return r.Z.warn("ISOBMFF: box too short, cannot find offsets"),null;a=(0,i.pV)(e,n),n+=8}if(a<0)throw new Error("ISOBMFF: Size out of range");return 1970628964===o&&(n+=16),[0,n,a]}},6807:function(e,t,n){"use strict";n.d(t,{XA:function(){return i},Le:function(){return a},fs:function(){return o},E3:function(){return s}});var r=n(2297);function i(e){var t=(0,r.t_)(e,1836019558);return null===t?null:(0,r.t_)(t,1953653094)}function a(e){return(0,r.t_)(e,1835295092)}function o(e){var t=(0,r.t_)(e,1836019574);if(null===t)return null;var n=(0,r.t_)(t,1953653099);return null===n?null:(0,r.t_)(n,1835297121)}function s(e,t){return void 0===t&&(t=0),(0,r.t_)(e.subarray(t),1701671783)}},6490:function(e,t,n){"use strict";n.d(t,{Z:function(){return s},Y:function(){return u}});var r=n(3887);var i="function"==typeof Uint8Array.prototype.slice?function(e,t,n){return e.slice(t,n)}:function(e,t,n){return new Uint8Array(Array.prototype.slice.call(e,t,n))},a=n(3635),o=n(2297);function s(e){var t=0,n=(0,o.t_)(e,1836019574);if(null===n)return[];for(var a=[];t1)r.Z.warn("ISOBMFF: un-handled PSSH version");else{var n=t+4;if(!(n+16>e.length)){var o=i(e,n,n+16);return(0,a.ci)(o)}}}},4644:function(e,t,n){"use strict";n.d(t,{LD:function(){return f},Qx:function(){return d},MM:function(){return c},Wf:function(){return l},J6:function(){return p},s9:function(){return v}});var r=n(3887),i=n(6968),a=n(3635),o=n(2689),s=n(2297),u=n(6807);function l(e,t){var n=(0,s.Qy)(e,1936286840);if(null===n)return null;var r=t,a=n[2]-n[0],o=n[1],u=e[o];o+=8;var l,d=(0,i.pX)(e,o);if(o+=4,0===u)l=(0,i.pX)(e,o),o+=4,r+=(0,i.pX)(e,o)+a,o+=4;else{if(1!==u)return null;l=(0,i.pV)(e,o),o+=8,r+=(0,i.pV)(e,o)+a,o+=8}var c=[];o+=2;var f=(0,i.zK)(e,o);for(o+=2;--f>=0;){var p=(0,i.pX)(e,o);o+=4;var v=2147483647&p;if(1===(2147483648&p)>>>31)throw new Error("sidx with reference_type `1` not yet implemented");var h=(0,i.pX)(e,o);o+=4,o+=4,c.push({time:l,duration:h,timescale:d,range:[r,r+v-1]}),l+=h,r+=v}return c}function d(e){var t=(0,u.XA)(e);if(null!==t){var n=(0,s.t_)(t,1952867444);if(null!==n){var r=n[0];return 1===r?(0,i.pV)(n,4):0===r?(0,i.pX)(n,4):void 0}}}function c(e){var t=(0,u.XA)(e);if(null!==t){var n=(0,s.t_)(t,1953658222);if(null!==n){var r=0,a=n[r];if(r+=1,!(a>1)){var o=(0,i.QI)(n,r);r+=3;var l=(256&o)>0,d=0;if(l||void 0!==(d=function(e){var t=(0,s.t_)(e,1952868452);if(null!==t){var n=1,r=(0,i.QI)(t,n);if(n+=3,(8&r)>0)return n+=4,(1&r)>0&&(n+=8),(2&r)>0&&(n+=4),(0,i.pX)(t,n)}}(t))){var c=(1&o)>0,f=(4&o)>0,p=(512&o)>0,v=(1024&o)>0,h=(2048&o)>0,m=(0,i.pX)(n,r);r+=4,c&&(r+=4),f&&(r+=4);for(var g=m,y=0;g-- >0;)l?(y+=(0,i.pX)(n,r),r+=4):y+=d,p&&(r+=4),v&&(r+=4),h&&(r+=4);return y}}}}}function f(e){var t=(0,u.fs)(e);if(null!==t){var n=(0,s.t_)(t,1835296868);if(null!==n){var r=0,a=n[r];return r+=4,1===a?(0,i.pX)(n,r+16):0===a?(0,i.pX)(n,r+8):void 0}}}function p(e){var t=e.length;if(t<4)throw new Error("Cannot update box length: box too short");var n=(0,i.pX)(e,0);if(0===n){if(t>o.s){var r=new Uint8Array(t+8);return r.set((0,i.kh)(1),0),r.set(e.subarray(4,8),4),r.set((0,i.el)(t+8),8),r.set(e.subarray(8,t),16),r}return e.set((0,i.kh)(t),0),e}if(1===n){if(t<16)throw new Error("Cannot update box length: box too short");return e.set((0,i.el)(t),8),e}if(t<=o.s)return e.set((0,i.kh)(t),0),e;var a=new Uint8Array(t+8);return a.set((0,i.kh)(1),0),a.set(e.subarray(4,8),4),a.set((0,i.el)(t+8),8),a.set(e.subarray(8,t),16),a}function v(e){for(var t=[],n=0;n0)throw new Error("Unhandled version: "+s);var c=(0,r.dN)(e,t);t+=4;var f=(0,r.dN)(e,t);t+=4;var p=(0,i.uR)(e.subarray(t,t+4));t+=4;var v=(0,r.qb)(e,t);t+=2;var h=(0,r.qb)(e,t),m=[e[t+=2],e[t+1]].join(":"),g=1===e[t+=2];t=64;var y=[];if(0===c)throw new Error("bif: no images to parse");for(var _=0,b=null;t0,this._isEMSGWhitelisted=c}var t=e.prototype;return t.getInitSegment=function(){return(0,a.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){return(0,o.Z)(this._index,e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstPosition=function(){var e=this._index;return 0===e.timeline.length?null:(0,i.zG)(e.timeline[0].start,e)},t.getLastPosition=function(){var e=this._index.timeline;if(0===e.length)return null;var t=e[e.length-1],n=(0,i.jH)(t,null,this._scaledPeriodEnd);return(0,i.zG)(n,this._index)},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.initializeIndex=function(e){for(var t=0;t0&&null!=c[0].duration?c[0].duration:0,_=0;_0?Math.floor(u/s):0),A=E+k*T;A=d)return m;null!=h&&(h+=S+1)}return m}},4784:function(e,t,n){"use strict";n.d(t,{k6:function(){return o},QB:function(){return u}});var r=n(6923),i=n(9829);function a(e){return function(t,n,i){var a,o,s,u=(0,r.Z)(i)?parseInt(i,10):1;return a=String(e),o=u,(s=a.toString()).length>=o?s:(new Array(o+1).join("0")+s).slice(-o)}}function o(e,t,n,r){return 0===e.length?void 0!==t?[s(t,n,r)]:null:e.map((function(e){return s((0,i.Z)(e,t),n,r)}))}function s(e,t,n){return-1===e.indexOf("$")?e:e.replace(/\$\$/g,"$").replace(/\$RepresentationID\$/g,String(t)).replace(/\$Bandwidth(|\%0(\d+)d)\$/g,a(void 0===n?0:n))}function u(e,t){return function(n){return-1===n.indexOf("$")?n:n.replace(/\$\$/g,"$").replace(/\$Number(|\%0(\d+)d)\$/g,(function(e,n,r){if(void 0===t)throw new Error("Segment number not defined in a $Number$ scheme");return a(t)(e,n,r)})).replace(/\$Time(|\%0(\d+)d)\$/g,(function(t,n,r){if(void 0===e)throw new Error("Segment time not defined in a $Time$ scheme");return a(e)(t,n,r)}))}}},148:function(e,t,n){"use strict";n.d(t,{Z:function(){return Be}});var r=n(8418),i=n(1946),a=n(944),o=n(3887),s=n(3274),u=n(9829);function l(e){return 0===e.length?0:e.reduce((function(e,t){var n;return Math.min(null!==(n=t.attributes.availabilityTimeOffset)&&void 0!==n?n:0,e)}),1/0)}function d(e){var t=Date.parse(e)-performance.now();if(!isNaN(t))return t;o.Z.warn("DASH Parser: Invalid clock received: ",e)}function c(e){for(var t=e.representations,n=null,r=0;r=0;t--){var n=e[t].adaptations,r=void 0===n.audio?void 0:n.audio[0],i=void 0===n.video?void 0:n.video[0];if(void 0!==r||void 0!==i){var a=null,s=null;if(void 0!==r){var u=c(r);if(void 0===u)return;a=u}if(void 0!==i){var l=c(i);if(void 0===l)return;s=l}if(void 0!==r&&null===a||void 0!==i&&null===s)return void o.Z.info("Parser utils: found Period with no segment. ","Going to previous one to calculate last position");if(null!==s)return null!==a?Math.min(a,s):s;if(null!==a)return a}}}function p(e){for(var t=e.representations,n=null,r=0;r=n}function U(e,t,n,r){var i=e.start,a=e.duration,s=e.repeatCount;return null==i&&(null==t?i=r:null!=t.duration&&(i=t.start+t.duration*(t.repeatCount+1))),null!=a&&!isNaN(a)||null==n||null==n.start||isNaN(n.start)||null==i||isNaN(i)||(a=n.start-i),null==i||isNaN(i)||null==a||isNaN(a)||null!=s&&isNaN(s)?(o.Z.warn('DASH: A "S" Element could not have been parsed.'),null):{start:i,duration:a,repeatCount:void 0===s?0:s}}function F(e){for(var t={},n=0;n0){var s=i-a.start;if(s%a.duration==0&&s/a.duration<=a.repeatCount)return{repeatNumberInPrevSegments:s/a.duration,prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInNewElements:0}}if(++o>=e.length)return null;if((a=e[o]).start===i)return{prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(a.start>i)return null}else for(var u=0,l=t[0],d=i;;){var c=l.getAttribute("d"),f=null===c?null:parseInt(c,10);if(null===f||Number.isNaN(f))return null;var p=l.getAttribute("r"),v=null===p?null:parseInt(p,10);if(null!==v){if(Number.isNaN(v)||v<0)return null;if(v>0){var h=n-d;if(h%f==0&&h/f<=v)return{repeatNumberInPrevSegments:0,repeatNumberInNewElements:h/f,prevSegmentsIdx:0,newElementsIdx:u}}d+=f*(v+1)}else d+=f;if(++u>=t.length)return null;var m=(l=t[u]).getAttribute("t"),g=null===m?null:parseInt(m,10);if(null!==g){if(Number.isNaN(g))return null;d=g}if(d===n)return{newElementsIdx:u,prevSegmentsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(d>i)return null}}(t,e);if(null===i)return o.Z.warn('DASH: Cannot perform "based" update. Common segment not found.'),z(e,n);var a=i.prevSegmentsIdx,s=i.newElementsIdx,u=i.repeatNumberInPrevSegments,l=i.repeatNumberInNewElements,d=t.length-a+s-1;if(d>=e.length)return o.Z.info('DASH: Cannot perform "based" update. New timeline too short'),z(e,n);var c=t.slice(a);if(u>0){var f=c[0];f.start+=f.duration*u,c[0].repeatCount-=u}if(l>0&&0!==s)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form.'),z(e,n);var p=c[c.length-1],v=F(e[d]),h=(null!==(r=v.repeatCount)&&void 0!==r?r:0)-l;if(v.duration!==p.duration||p.repeatCount>h)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form at the beginning.'),z(e,n);void 0!==v.repeatCount&&v.repeatCount>p.repeatCount&&(p.repeatCount=v.repeatCount);for(var m=[],g=[],y=d+1;yu?u-y:r,T=y+s,E=y+this._index.presentationTimeOffset,w=null===o?null:o.map((0,M.QB)(E,_)),S={id:String(_),number:_,time:T/a,end:(T+b)/a,duration:b/a,timescale:1,isInit:!1,scaledDuration:b/a,mediaURLs:w,timestampOffset:-n.indexTimeOffset/a,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};h.push(S),g++}return h},t.getFirstPosition=function(){var e=this._getFirstSegmentStart();return null==e?e:e/this._index.timescale+this._periodStart},t.getLastPosition=function(){var e=this._getLastSegmentStart();return null==e?e:(e+this._index.duration)/this._index.timescale+this._periodStart},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;var t=this.getSegments(e.time,.1);return 0!==t.length&&(t[0].time===e.time&&t[0].end===e.end&&t[0].number===e.number)},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){if(!this._isDynamic)return!0;if(void 0===this._scaledPeriodEnd)return!1;var e=this._index.timescale,t=this._getLastSegmentStart();return null!=t&&B(e,t+this._index.duration,this._scaledPeriodEnd)},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index,this._aggressiveMode=e._aggressiveMode,this._isDynamic=e._isDynamic,this._periodStart=e._periodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._manifestBoundsCalculator=e._manifestBoundsCalculator},t._update=function(e){this._replace(e)},t._getFirstSegmentStart=function(){if(!this._isDynamic)return 0;if(0===this._scaledPeriodEnd||void 0===this._scaledPeriodEnd){var e=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0!==e&&ethis._periodStart?(i-this._periodStart)*r:0;return Math.floor(a/n)*n}},t._getLastSegmentStart=function(){var e,t=this._index,n=t.duration,r=t.timescale;if(this._isDynamic){var i=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0===i)return;var a=this._aggressiveMode?n/r:0;if(null!=this._scaledPeriodEnd&&this._scaledPeriodEnd<(i+a-this._periodStart)*this._index.timescale)return this._scaledPeriodEndH*r||0===d?c:(d-1)*n},e}();function $(e,t){var n=[];if(0===t.length)return e;if(0===e.length){for(var r=0;r0){var b=t.parentSegmentTemplates.slice(),T=e.children.segmentTemplate;void 0!==T&&b.push(T);var E=A.Z.apply(void 0,[{}].concat(b));g.availabilityTimeOffset=t.availabilityTimeOffset+l(e.children.baseURLs)+(null!==(r=E.availabilityTimeOffset)&&void 0!==r?r:0),i=G.isTimelineIndexArgument(E)?new G(E,g):new W(E,g)}else{var w=t.adaptation.children;if(void 0!==w.segmentBase){var S=w.segmentBase;i=new x.Z(S,g)}else if(void 0!==w.segmentList){var k=w.segmentList;i=new R(k,g)}else i=new W({duration:Number.MAX_VALUE,timescale:1,startNumber:0,media:""},g)}return i}(d,(0,A.Z)({},n,{unsafelyBaseOnPreviousRepresentation:f,adaptation:t,inbandEventStreams:p})),h=void 0;null==d.attributes.bitrate?(o.Z.warn("DASH: No usable bitrate found in the Representation."),h=0):h=d.attributes.bitrate;var m={bitrate:h,index:v,id:c},g=void 0;if(null!=d.attributes.codecs?g=d.attributes.codecs:null!=t.attributes.codecs&&(g=t.attributes.codecs),null!=g&&(g="mp4a.40.02"===g?"mp4a.40.2":g,m.codecs=g),null!=d.attributes.frameRate?m.frameRate=d.attributes.frameRate:null!=t.attributes.frameRate&&(m.frameRate=t.attributes.frameRate),null!=d.attributes.height?m.height=d.attributes.height:null!=t.attributes.height&&(m.height=t.attributes.height),null!=d.attributes.mimeType?m.mimeType=d.attributes.mimeType:null!=t.attributes.mimeType&&(m.mimeType=t.attributes.mimeType),null!=d.attributes.width?m.width=d.attributes.width:null!=t.attributes.width&&(m.width=t.attributes.width),null!=t.children.contentProtections){var y=t.children.contentProtections.reduce((function(e,t){var n;if(void 0!==t.attributes.schemeIdUri&&"urn:uuid:"===t.attributes.schemeIdUri.substring(0,9)&&(n=t.attributes.schemeIdUri.substring(9).replace(/-/g,"").toLowerCase()),void 0!==t.attributes.keyId&&t.attributes.keyId.length>0&&e.keyIds.push({keyId:t.attributes.keyId,systemId:n}),void 0!==n){for(var r=t.children.cencPssh,i=[],a=0;a0){var u,l=(0,s.Z)(e.initData,(function(e){return"cenc"===e.type}));if(void 0===l)e.initData.push({type:"cenc",values:i});else(u=l.values).push.apply(u,i)}}return e}),{keyIds:[],initData:[]});(Object.keys(y.initData).length>0||y.keyIds.length>0)&&(m.contentProtections=y)}m.hdrInfo=Y({adaptationProfiles:t.attributes.profiles,manifestProfiles:n.manifestProfiles,codecs:g}),a.push(m)},d=0;d0&&void 0!==v.video&&!L){var B,U=d.video[v.video];N.unsafelyBaseOnPreviousAdaptation=null!==(i=null===(r=t.unsafelyBaseOnPreviousPeriod)||void 0===r?void 0:r.getAdaptation(U.id))&&void 0!==i?i:null;var F=q(S,m,N);(B=U.representations).push.apply(B,F),R=U.id}else{var z=g.accessibilities,K=void 0;void 0!==_&&_.some((function(e){return"dub"===e.value}))&&(K=!0);var V=void 0;"text"!==Z?V=!1:void 0!==z&&(V=z.some(j));var G=void 0;"audio"!==Z?G=!1:void 0!==z&&(G=z.some(X));var H=void 0;"video"!==Z?H=!1:void 0!==z&&(H=z.some(Q));for(var W=J(m,{isAudioDescription:G,isClosedCaption:V,isSignInterpreted:H,isTrickModeTrack:L,type:Z});(0,b.Z)(p,W);)W+="-dup";R=W,p.push(W),N.unsafelyBaseOnPreviousAdaptation=null!==(u=null===(a=t.unsafelyBaseOnPreviousPeriod)||void 0===a?void 0:a.getAdaptation(W))&&void 0!==u?u:null;var Y={id:W,representations:q(S,m,N),type:Z,isTrickModeTrack:L};null!=m.attributes.language&&(Y.language=m.attributes.language),null!=V&&(Y.closedCaption=V),null!=G&&(Y.audioDescription=G),!0===K&&(Y.isDub=!0),!0===H&&(Y.isSignInterpreted=!0);var te=d[Z];if(void 0!==O)c.push({adaptation:Y,trickModeAttachedAdaptationIds:O});else if(void 0===te)d[Z]=[Y],E&&(v[Z]=0);else{for(var ne=null,re=function(e){var t=C[e],n=f[t];if(null!=n&&n.newID!==R&&(0,b.Z)(n.adaptationSetSwitchingIDs,M)){var r,i=(0,s.Z)(te,(function(e){return e.id===t}));null!=i&&i.audioDescription===Y.audioDescription&&i.closedCaption===Y.closedCaption&&i.language===Y.language&&(o.Z.info('DASH Parser: merging "switchable" AdaptationSets',M,t),(r=i.representations).push.apply(r,Y.representations),ne=i)}},ie=0;ieae)&&(te.splice(se,1),te.splice(oe,0,ne),v[Z]=oe)}}else null===ne&&te.push(Y)}}null!=M&&null==f[M]&&(f[M]={newID:R,adaptationSetSwitchingIDs:C})}}return w(d,c),d}(p.children.adaptations,R),P=function(e,t){for(var n,r=[],i=0;i=0;p--)f(p);if(t.isDynamic&&!c.lastPositionIsKnown()){var v=re(t,0);if(void 0!==v){var m=v[0],E=v[1];c.setLastPosition(m,E)}}return function(e){if(0===e.length)return[];for(var t=[e[0]],n=1;nr.start;)o.Z.warn("DASH: Updating overlapping Periods.",i,r),i.duration=r.start-i.start,i.end=r.start,i.duration<=0&&(t.pop(),i=t[t.length-1]);t.push(r)}return t}(i)}function re(e,t){if(null!=e.clockOffset){var n=e.clockOffset/1e3-e.availabilityStartTime,r=performance.now()/1e3,i=r+n;if(i>=t)return[i,r]}else{var a=Date.now()/1e3;if(a>=t)return o.Z.warn("DASH Parser: no clock synchronization mechanism found. Using the system clock instead."),[a-e.availabilityStartTime,performance.now()/1e3]}}var ie=a.Z.DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0;var ae=function e(t,n,r,i,a){void 0===a&&(a=new WeakMap);var c=t.children,p=t.attributes;if(null==n.externalClockOffset){var h="dynamic"===p.type,m=(0,s.Z)(c.utcTimings,(function(e){return"urn:mpeg:dash:utc:direct:2014"===e.schemeIdUri&&null!=e.value})),g=null!=m&&null!=m.value?d(m.value):void 0,y=null==g||isNaN(g)?void 0:g;if(null!=y&&!0!==i)n.externalClockOffset=y;else if(h&&!0!==i){var _=function(e){var t=e.children.utcTimings.filter((function(e){return"urn:mpeg:dash:utc:http-iso:2014"===e.schemeIdUri&&void 0!==e.value}));return t.length>0?t[0].value:void 0}(t);if(null!=_&&_.length>0)return{type:"needs-clock",value:{url:_,continue:function(i){return n.externalClockOffset=d(i),e(t,n,r,!0)}}}}}for(var b=[],T=0;T=0&&(d=0===m.minimumUpdatePeriod?ie:m.minimumUpdatePeriod);var I=function(e){if(0===e.length)throw new Error("DASH Parser: no period available for a dynamic content");return[v(e),f(e)]}(k),Z=I[0],M=I[1],R=performance.now();if(g){var C;if(c=Z,x=null!=b?b:null,void 0!==M)C=M;else{var P=null!=_?_:0,N=t.externalClockOffset;if(void 0===N)o.Z.warn("DASH Parser: use system clock to define maximum position"),C=Date.now()/1e3-P;else C=(performance.now()+N)/1e3-P}p={isLinear:!0,value:C,time:R},null!==x&&void 0!==c&&C-c>x&&(x=C-c)}else{c=void 0!==Z?Z:void 0!==(null===(i=k[0])||void 0===i?void 0:i.start)?k[0].start:0;var D=null!=A?A:1/0;if(void 0!==k[k.length-1]){var O=k[k.length-1],L=null!==(a=O.end)&&void 0!==a?a:void 0!==O.duration?O.start+O.duration:void 0;void 0!==L&&L=0;s--){var u,l=b[s].index,d=o[s],f=d.parsed,p=d.warnings,v=d.receivedTime,h=d.sendingTime,m=d.url;p.length>0&&r.push.apply(r,p);for(var g=0;g0){var s=_e(a,"cenc:pssh"),u=s[0],l=s[1];null!==l&&(o.Z.warn(l.message),t.push(l)),null!==u&&n.push(u)}}}return[{cencPssh:n},t]}(e.childNodes),n=t[0],r=t[1];return[{children:n,attributes:function(e){for(var t={},n=0;n0&&(n=n.concat(d));break;case"SegmentList":var c=Ze(i),f=c[0],p=c[1];n=n.concat(p),t.segmentList=f;break;case"SegmentTemplate":var v=Re(i),h=v[0],m=v[1];n=n.concat(m),t.segmentTemplate=h}}return[t,n]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Te(t,n),i=0;i0&&(r=r.concat(u));break;case"ContentComponent":t.contentComponent=Se(a);break;case"EssentialProperty":null==t.essentialProperties?t.essentialProperties=[be(a)]:t.essentialProperties.push(be(a));break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(be(a));break;case"Representation":var l=Ce(a),d=l[0],c=l[1];t.representations.push(d),c.length>0&&(r=r.concat(c));break;case"Role":null==t.roles?t.roles=[be(a)]:t.roles.push(be(a));break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[be(a)]:t.supplementalProperties.push(be(a));break;case"SegmentBase":var f=xe(a),p=f[0],v=f[1];t.segmentBase=p,v.length>0&&(r=r.concat(v));break;case"SegmentList":var h=Ze(a),m=h[0],g=h[1];t.segmentList=m,g.length>0&&(r=r.concat(g));break;case"SegmentTemplate":var y=Re(a),_=y[0],b=y[1];t.segmentTemplate=_,b.length>0&&(r=r.concat(b));break;case"ContentProtection":var T=ke(a),E=T[0],w=T[1];w.length>0&&(r=r.concat(w)),void 0!==E&&n.push(E)}}return n.length>0&&(t.contentProtections=n),[t,r]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Te(t,n),i=0;i0&&(n=n.concat(d))}}return[t,n]}function De(e){for(var t={eventStreamData:e},n=[],r=Te(t,n),i=0;i0&&(i=i.concat(_))}}return[{baseURLs:n,adaptations:r,eventStreams:a,segmentTemplate:t},i]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Te(t,n),i=0;i"+o+"",c=(new DOMParser).parseFromString(d,"text/xml");if(null==c||0===c.children.length)throw new Error("DASH parser: Invalid external ressources");for(var f=c.children[0].children,p=[],v=[],h=0;h0;){var n=e[0];if(n.start>=t)return;if(n.repeatCount<=0)e.shift();else{var r=e[1];if(null!=r&&r.start<=t)e.shift();else{if(n.duration<=0)return;for(var i=n.start+n.duration,a=1;in.repeatCount)){var o=n.repeatCount-a;return n.start=i,void(n.repeatCount=o)}e.shift()}}}}n.d(t,{Z:function(){return r}})},3911:function(e,t,n){"use strict";function r(e,t,n){var r,i=e.repeatCount;return i>=0?i:(r=null!=t?t.start:null!=n?n:Number.MAX_VALUE,Math.ceil((r-e.start)/e.duration)-1)}function i(e,t,n){var i=e.start,a=e.duration;return a<=0?i:i+(r(e,t,n)+1)*a}function a(e,t){var n;return e*t.timescale+(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0)}function o(e,t){var n;return(e-(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0))/t.timescale}function s(e,t,n){return[e*n,(e+t)*n]}function u(e,t,n){var r=e.timeline,s=a(t,e);if(s<0)return null;var u=function(e,t){for(var n=0,r=e.length;n>>1;e[i].start<=t?n=i+1:r=i}return n-1}(r,s);if(u<0||u>=r.length-1)return null;var l=r[u];if(l.duration<=0)return null;var d=r[u+1];if(void 0===d)return null;var c=d.start;return s>=i(l,d,n)&&se.time)return!1;if(o===e.time)return a.duration/n===e.duration&&(null==a.range?null==e.range:null!=e.range&&a.range[0]===e.range[0]&&a.range[1]===e.range[1]);if(a.repeatCount>=0&&null!=a.duration){var s=(o-a.start)/a.duration-1;return s%1==0&&s<=a.repeatCount}}return!1}n.d(t,{Z:function(){return r}})},5505:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(3714),i=n(3887),a=n(3911);function o(e,t){var n=e.length;if(0!==e.length){if(0!==t.length){var o=t[0].start,s=e[n-1];if((0,a.jH)(s,t[0])=0;u--){var l=e[u].start;if(l===o)return void e.splice.apply(e,[u,n-u].concat(t));if(lo)return i.Z.warn("RepresentationIndex: Manifest update removed previous segments"),void e.splice.apply(e,[u,n-u].concat(t));if(void 0===d.repeatCount||d.repeatCount<=0)return d.repeatCount<0&&(d.repeatCount=Math.floor((o-d.start)/d.duration)-1),void e.splice.apply(e,[u+1,n-(u+1)].concat(t));if(d.start+d.duration*(d.repeatCount+1)<=o)return void e.splice.apply(e,[u+1,n-(u+1)].concat(t));var c=(o-d.start)/d.duration-1;if(c%1==0&&d.duration===t[0].duration){var f=t[0].repeatCount<0?-1:t[0].repeatCount+c+1;return e.splice.apply(e,[u,n-u].concat(t)),e[u].start=d.start,void(e[u].repeatCount=f)}return i.Z.warn("RepresentationIndex: Manifest update removed previous segments"),e[u].repeatCount=Math.floor(c),void e.splice.apply(e,[u+1,n-(u+1)].concat(t))}}var p=e[e.length-1],v=t[t.length-1];if(void 0!==p.repeatCount&&p.repeatCount<0)return p.start>v.start?void i.Z.warn("RepresentationIndex: The new index is older than the previous one"):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),void e.splice.apply(e,[0,n].concat(t)));p.start+p.duration*(p.repeatCount+1)>=v.start+v.duration*(v.repeatCount+1)?i.Z.warn("RepresentationIndex: The new index is older than the previous one"):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)))}}else e.splice.apply(e,[0,n].concat(t))}},5734:function(e,t,n){"use strict";var r=n(6923),i=/&#([0-9]+);/g,a=/
/gi,o=/]*>([\s\S]*?)<\/style[^>]*>/i,s=/\s*

]+))?>(.*)/i,u=/]+?start="?([0-9]*)"?[^0-9]/i;function l(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var d,c,f=/]/gi,p=/]|<\/body>/gi,v=[],h=o.exec(e),m=Array.isArray(h)?h[1]:"";p.exec(e);var g,y=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);null!==r;){var i=r[1],a=l(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(m),_=function(e){var t=/p\s*{([^}]*)}/gi.exec(e);return null===t?"":t[1]}(m);if((0,r.Z)(n)&&void 0===(g=y[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;d=f.exec(e),c=p.exec(e),null!==d||null!==c;){if(null===d||null===c||d.index>=c.index)throw new Error("parse error");var b=e.slice(d.index,c.index),T=u.exec(b);if(!Array.isArray(T))throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");w(b.split("\n"),E/1e3)}return v;function w(e,n){for(var o=e.length;--o>=0;){var u=s.exec(e[o]);if(Array.isArray(u)){var l=u[1],d=u[2];if(g===l)if(" "===d)v[v.length-1].end=n;else{var c=document.createElement("DIV");c.className="rxp-texttrack-region";var f=document.createElement("DIV");f.className="rxp-texttrack-div",f.style.position="absolute",f.style.bottom="0",f.style.width="100%",f.style.color="#fff",f.style.textShadow="-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000";var p=document.createElement("div");p.className="rxp-texttrack-p",(0,r.Z)(_)&&(p.style.cssText=_);for(var h=d.split(a),m=0;m/gi,s=/]*>([\s\S]*?)<\/style[^>]*>/i,u=/\s*

]+))?>(.*)/i,l=/]+?start="?([0-9]*)"?[^0-9]/i;function d(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var c,f,p=/]/gi,v=/]|<\/body>/gi,h=[],m=s.exec(e),g=null!==m?m[1]:"";v.exec(e);var y,_=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);Array.isArray(r);){var i=r[1],a=d(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(g);if((0,i.Z)(n)&&void 0===(y=_[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;c=p.exec(e),f=v.exec(e),null!==c||null!==f;){if(null===c||null===f||c.index>=f.index)throw new Error("parse error");var b=e.slice(c.index,f.index),T=l.exec(b);if(null===T)throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");w(b.split("\n"),E/1e3)}return function(e){for(var t=[],n=0;n=0;)if(null!==(r=u.exec(e[s]))){var l=r,d=l[1],c=l[2];y===d&&(" "===c?h[h.length-1].end=n:h.push({text:(i=c,i.replace(o,"\n").replace(a,(function(e,t){return String.fromCharCode(t)}))),start:n+t}))}}}},2061:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e,t){for(var n=t+1;(0,r.Z)(e[n]);)n++;return n}function a(e){for(var t=[],n=0;n0&&(1===o.length?o[0].indexOf("--\x3e")>=0&&t.push(o):(o[1].indexOf("--\x3e")>=0||o[0].indexOf("--\x3e")>=0)&&t.push(o)),n=a}return t}},8675:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2061),i=n(788);function a(e,t){for(var n=e.split(/\r\n|\n|\r/),a=(0,r.Z)(n),s=[],u=0;u0){var u=document.createTextNode(o[s]);r.appendChild(u)}}else if("B"===a.nodeName){var l=e(a);l.style.fontWeight="bold",r.appendChild(l)}else if("I"===a.nodeName){var d=e(a);d.style.fontStyle="italic",r.appendChild(d)}else if("U"===a.nodeName){var c=e(a);c.style.textDecoration="underline",r.appendChild(c)}else if("FONT"===a.nodeName&&null!=a.color){var f=e(a);f.style.color=a.color,r.appendChild(f)}else{var p=e(a);r.appendChild(p)}}return r}(t)}},8057:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7253),i=n(2061),a=n(788);function o(e,t){for(var n,o,s,u,l,d=e.split(/\r\n|\n|\r/),c=(0,i.Z)(d),f=[],p=0;p0){var y=p.getAttribute("xml:space"),_=(0,l.Z)(y)?"default"===y:o,b=(0,d.Z)({},i,(0,f.U)(g,[p],n,t));u.push.apply(u,e(p,b,[p].concat(a),_))}}return u}(e,(0,d.Z)({},r),[],i)}(e,n,r,i,s),E=0;E|\u2265/g,">").replace(/\u200E/g,"‎").replace(/\u200F/g,"‏").replace(/\u00A0/g," ")}else if("br"===s.nodeName)i+="\n";else if("span"===s.nodeName&&s.nodeType===Node.ELEMENT_NODE&&s.childNodes.length>0){var d=s.getAttribute("xml:space");i+=n(s,(0,o.Z)(d)?"default"===d:t)}}return i}return n(e,t)}(t,f),g=(0,i.Z)(v+n,h+n,m);return null===g?null:((0,a.Z)(g)&&function(e,t){var n=t.extent;if((0,o.Z)(n)){var r=u._0.exec(n);null!=r&&(e.size=Number(r[1]))}switch(t.writingMode){case"tb":case"tblr":e.vertical="lr";break;case"tbrl":e.vertical="rl"}var i=t.origin;if((0,o.Z)(i))u._0.exec(i);var a=t.align;if((0,o.Z)(a)){e.align=a,"center"===a&&("center"!==e.align&&(e.align="middle"),e.position="auto");var s=d[a];e.positionAlign=void 0===s?"":s;var c=l[a];e.lineAlign=void 0===c?"":c}}(g,r),g)}var f=function(e,t){for(var n=(0,r.Z)(e,t),i=[],a=0;a=2)for(var r=1;r0&&n.appendChild(document.createElement("br")),o[s].length>0){var u=document.createTextNode(o[s]);n.appendChild(u)}}else{var c=e.nodeName.toLowerCase().split("."),f=[];if(c.forEach((function(e){(0,i.Z)(t[e])&&f.push(t[e])})),0!==f.length){var p=document.createAttribute("style");f.forEach((function(e){p.value+=e}));var v=(0,l.Z)(r,a)?a:"span";(n=document.createElement(v)).setAttributeNode(p)}else{var h=(0,l.Z)(r,a)?a:"span";n=document.createElement(h)}for(var m=0;m/,"").replace(/<([u,i,b,c])(\..*?)?(?: .*?)?>(.*?)<\/\1>/g,"<$1$2>$3"),r=(new DOMParser).parseFromString(n,"text/html").body.childNodes,i=[],a=0;a=2){var a=parseInt(i[1],10);isNaN(a)||(t.position=a,void 0!==i[2]&&(t.positionAlign=i[2]))}}(0,u.Z)(e.size)&&(t.size=e.size),"string"==typeof e.align&&(0,s.Z)(["start","center","end","left"],e.align)&&(t.align=e.align)}var d=n(7253);var c=function(e,t){var n=e.split(/\r\n|\n|\r/);if(!/^WEBVTT($| |\t)/.test(n[0]))throw new Error("Can't parse WebVTT: Invalid file.");for(var s,u,c,f,p=(0,o.yE)(n),v=(0,i.Z)(n,p),h=[],m=0;m/;if(o.test(e[0]))n=e[0],r=e.slice(1,e.length);else{if(!o.test(e[1]))return null;a=e[0],n=e[1],r=e.slice(2,e.length)}var s=function(e){var t=/^([\d:.]+)[ |\t]+-->[ |\t]+([\d:.]+)[ |\t]*(.*)$/.exec(e);if(null===t)return null;var n=i(t[1]),r=i(t[2]);return null==n||null==r?null:{start:n,end:r,settings:t[3].split(/ |\t/).reduce((function(e,t){var n=t.split(":");return 2===n.length&&(e[n[0]]=n[1]),e}),{})}}(n);return null===s?null:{start:s.start+t,end:s.end+t,settings:s.settings,payload:r,header:a}}},360:function(e,t,n){"use strict";n.d(t,{yE:function(){return i},tq:function(){return o},JF:function(){return a},$4:function(){return s}});var r=n(6923);function i(e){for(var t=0;t=0)return!0;var r=e[t+1];return void 0!==r&&r.indexOf("--\x3e")>=0}function s(e,t){for(var n=t+1;(0,r.Z)(e[n]);)n++;return n}},1732:function(e,t,n){"use strict";n.d(t,{Z:function(){return ve}});var r=n(7874),i=n(8791),a=n(2817),o=n(4597),s=n(5278);function u(e){var t=e.segment,n=e.url;return t.isInit||null===n?(0,a.of)({type:"data-created",value:{responseData:null}}):(0,o.ZP)({url:n,responseType:"arraybuffer",sendProgressEvents:!0})}function l(e){var t=e.response,n=e.content,i=n.segment,o=n.period,u=t.data,l=t.isChunked;if(n.segment.isInit)return(0,a.of)({type:"parsed-init-segment",value:{initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}});if(l)throw new Error("Image data should not be downloaded in chunks");var d=(0,s.Z)(i.timestampOffset,0);if(null===u||null===r.Z.imageParser)return(0,a.of)({type:"parsed-segment",value:{chunkData:null,chunkInfos:{duration:i.duration,time:i.time},chunkOffset:d,appendWindow:[o.start,o.end],protectionDataUpdate:!1}});var c=r.Z.imageParser(new Uint8Array(u)),f=c.thumbs;return(0,a.of)({type:"parsed-segment",value:{chunkData:{data:f,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkInfos:{time:0,duration:Number.MAX_VALUE,timescale:c.timescale},chunkOffset:d,appendWindow:[o.start,o.end],protectionDataUpdate:!1}})}var d=n(1973),c=n(6362),f=n(2334),p=n(3994),v=n(4975),h=n(9127),m=n(3887),g=n(1989),y=n(8026),_=n(3635),b=n(7445);function T(e){var t=e.aggressiveMode,n=e.referenceDateTime,i=void 0!==e.serverSyncInfos?e.serverSyncInfos.serverTimestamp-e.serverSyncInfos.clientTime:void 0;return function(s){var u,l=s.response,T=s.scheduleRequest,E=s.url,w=s.externalClockOffset,S=null!==(u=l.url)&&void 0!==u?u:E,k=l.responseData,A=null!=i?i:w,x={aggressiveMode:!0===t,unsafelyBaseOnPreviousManifest:s.unsafeMode?s.previousManifest:null,url:S,referenceDateTime:n,externalClockOffset:A},I=r.Z.dashParsers;if(null===I.wasm||"uninitialized"===I.wasm.status||"failure"===I.wasm.status)return m.Z.debug("DASH: WASM MPD Parser not initialized. Running JS one."),R();var Z=function(e){if(e instanceof ArrayBuffer)return e;if("string"==typeof e)return(0,_.tG)(e).buffer;if(e instanceof Document)return(0,_.tG)(e.documentElement.innerHTML).buffer;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(k);if(!function(e){var t=new DataView(e);if(61371===t.getUint16(0)&&191===t.getUint8(2))return!0;if(65279===t.getUint16(0)||65534===t.getUint16(0))return!1;return!0}(Z))return m.Z.info("DASH: MPD doesn't seem to be UTF-8-encoded. Running JS parser instead of the WASM one."),R();if("initialized"===I.wasm.status)return m.Z.debug("DASH: Running WASM MPD Parser."),C(I.wasm.runWasmParser(Z,x));m.Z.debug("DASH: Awaiting WASM initialization before parsing the MPD.");var M=I.wasm.waitForInitialization().catch((function(){}));return(0,d.Dp)(M).pipe((0,p.z)((function(){return null===I.wasm||"initialized"!==I.wasm.status?(m.Z.warn("DASH: WASM MPD parser initialization failed. Running JS parser instead"),R()):(m.Z.debug("DASH: Running WASM MPD Parser."),C(I.wasm.runWasmParser(Z,x)))})));function R(){if(null===I.js)throw new Error("No MPD parser is imported");var e=function(e){if(e instanceof ArrayBuffer)return(new DOMParser).parseFromString((0,_.uR)(new Uint8Array(e)),"text/xml");if("string"==typeof e)return(new DOMParser).parseFromString(e,"text/xml");if(e instanceof Document)return e;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(k);return C(I.js(e,x))}function C(t){if("done"===t.type){var n=t.value,r=n.warnings,i=n.parsed,s=r.map((function(e){return{type:"warning",value:e}})),u=new g.ZP(i,e);return(0,c.z)(a.of.apply(void 0,s),(0,b.Z)(u,S))}var l=t.value,d=l.urls.map((function(e){return T((function(){return(0,o.ZP)({url:e,responseType:"string"===l.format?"text":"arraybuffer"}).pipe((0,v.h)((function(e){return"data-loaded"===e.type})),(0,h.U)((function(e){return e.value})))}))}));return(0,f.a)(d).pipe((0,p.z)((function(e){if("string"===l.format){var t=e.map((function(e){if("string"!=typeof e.responseData)throw new Error("External DASH resources should have been a string");return(0,y.Z)(e,{responseData:e.responseData})}));return C(l.continue(t))}var n=e.map((function(e){if(!(e.responseData instanceof ArrayBuffer))throw new Error("External DASH resources should have been ArrayBuffers");return(0,y.Z)(e,{responseData:e.responseData})}));return C(l.continue(n))})))}}}var E=n(1480),w=n(7839);function S(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function k(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){S(a,r,i,o,s,"next",e)}function s(e){S(a,r,i,o,s,"throw",e)}o(void 0)}))}}var A=n(7757),x=n.n(A),I=n(944),Z=n(9105),M=n(5992),R=n(1946),C=I.Z.DEFAULT_REQUEST_TIMEOUT,P="function"==typeof Headers?Headers:null,N="function"==typeof AbortController?AbortController:null;function D(){return"function"==typeof window.fetch&&!(0,R.Z)(N)&&!(0,R.Z)(P)}var O=function(e){var t;if(!(0,R.Z)(e.headers))if((0,R.Z)(P))t=e.headers;else{t=new P;for(var n=Object.keys(e.headers),r=0;r=300)return m.Z.warn("Fetch: Request HTTP Error",e),void n.error(new Z.Z(e.url,e.status,M.br.ERROR_HTTP_CODE));if(!(0,R.Z)(e.body)){var t=e.headers.get("Content-Length"),r=(0,R.Z)(t)||isNaN(+t)?void 0:+t,i=e.body.getReader(),s=0;return u()}function u(){return l.apply(this,arguments)}function l(){return(l=k(x().mark((function t(){var l,d,c,f,p;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.read();case 2:if((l=t.sent).done||(0,R.Z)(l.value)){t.next=11;break}return s+=l.value.byteLength,d=performance.now(),c={type:"data-chunk",value:{url:e.url,currentTime:d,duration:d-o,sendingTime:o,chunkSize:l.value.byteLength,chunk:l.value.buffer,size:s,totalSize:r}},n.next(c),t.abrupt("return",u());case 11:l.done&&(f=performance.now(),p=f-o,a=!0,n.next({type:"data-complete",value:{duration:p,receivedTime:f,sendingTime:o,size:s,status:e.status,url:e.url}}),n.complete());case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}n.error(new Z.Z(e.url,e.status,M.br.PARSE_ERROR))})).catch((function(t){if(r)m.Z.debug("Fetch: Request aborted.");else{if(i)return m.Z.warn("Fetch: Request timeouted."),void n.error(new Z.Z(e.url,0,M.br.TIMEOUT));m.Z.warn("Fetch: Request Error",t instanceof Error?t.toString():""),n.error(new Z.Z(e.url,0,M.br.ERROR_EVENT))}})),function(){r=!0,u()}}))},L=n(8806),B=n(281);function U(e,t){return"audio"===e||"video"===e?"video/mp4"===t.mimeType||"audio/mp4"===t.mimeType?"mp4":"video/webm"===t.mimeType||"audio/webm"===t.mimeType?"webm":void 0:"text"===e&&"application/mp4"===t.mimeType?"mp4":void 0}var F=n(2006),z=n(4460);function K(e){return function(t){return e(t).pipe((0,F.b)((function(e){"data-loaded"!==e.type&&"data-chunk"!==e.type||null===e.value.responseData||"string"==typeof e.value.responseData||"mp4"!==U(t.adaptation.type,t.representation)||(0,z.Z)(new Uint8Array(e.value.responseData),t.segment.isInit)})))}}var V=n(6968);function G(e,t){var n=t.segment;if(void 0===n.range)return(0,o.ZP)({url:e,responseType:"arraybuffer",sendProgressEvents:!0});if(void 0===n.indexRange)return(0,o.ZP)({url:e,headers:{Range:(0,B.Z)(n.range)},responseType:"arraybuffer",sendProgressEvents:!0});if(n.range[1]+1===n.indexRange[0])return(0,o.ZP)({url:e,headers:{Range:(0,B.Z)([n.range[0],n.indexRange[1]])},responseType:"arraybuffer",sendProgressEvents:!0});var r=(0,o.ZP)({url:e,headers:{Range:(0,B.Z)(n.range)},responseType:"arraybuffer",sendProgressEvents:!1}),i=(0,o.ZP)({url:e,headers:{Range:(0,B.Z)(n.indexRange)},responseType:"arraybuffer",sendProgressEvents:!1});return(0,f.a)([r,i]).pipe((0,h.U)((function(t){var n=t[0],r=t[1],i=(0,V.zo)(new Uint8Array(n.value.responseData),new Uint8Array(r.value.responseData)),a=Math.min(n.value.sendingTime,r.value.sendingTime),o=Math.max(n.value.receivedTime,r.value.receivedTime);return{type:"data-loaded",value:{url:e,responseData:i,size:n.value.size+r.value.size,duration:o-a,sendingTime:a,receivedTime:o}}})))}var H=n(3074),W=n(8766);function $(e,t){var n=t.segment,r=void 0!==n.range?{Range:(0,B.Z)(n.range)}:void 0;return O({url:e,headers:r}).pipe((0,H.R)((function(e,t){if("data-complete"===t.type)return null!==e.partialChunk&&m.Z.warn("DASH Pipelines: remaining chunk does not belong to any segment"),{event:t,completeChunks:[],partialChunk:null};var n=new Uint8Array(t.value.chunk),r=function(e){for(var t=0,n=[];te.length)return[n,r];var o=(0,W.Z)(r,1835295092);if(o<0)return[n,r];var s=t+o+(0,V.pX)(e,o+t);if(s>e.length)return[n,r];var u=Math.max(a,s),l=e.subarray(t,u);n.push(l),t=u}return[n,null]}(null!==e.partialChunk?(0,V.zo)(e.partialChunk,n):n);return{event:t,completeChunks:r[0],partialChunk:r[1]}}),{event:null,completeChunks:[],partialChunk:null}),(0,p.z)((function(e){for(var t=[],n=0;n0)for(var p=0;p=Math.pow(2,8-n))return n}function re(e,t){var n=ne(e,t);if(null==n)return m.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return m.Z.warn("webm: impossible length"),null;for(var r=0,i=0;ie.length)return m.Z.warn("webm: impossible length"),null;for(var r=(e[t]&(1<<8-n)-1)*Math.pow(2,8*(n-1)),i=1;i=i)return!0}return!1}(r,t)}}}function le(e){var t=e.__priv_patchLastSegmentInSidx;return function(e){var n=e.content,r=e.response,i=e.initTimescale,o=n.period,u=n.adaptation,l=n.representation,d=n.segment,c=n.manifest,f=r.data,p=r.isChunked,v=[o.start,o.end];if(null===f)return d.isInit?(0,a.of)({type:"parsed-init-segment",value:{initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}}):(0,a.of)({type:"parsed-segment",value:{chunkData:null,chunkInfos:null,chunkOffset:0,appendWindow:v,protectionDataUpdate:!1}});var h=f instanceof Uint8Array?f:new Uint8Array(f),m=U(u.type,l),g="mp4"===m||void 0===m,y=!1;if(g){var _=(0,q.Z)(h);_.length>0&&(y=l._addProtectionData("cenc",_))}if(!d.isInit){var b=g?se(h,p,d,i):null,T=(0,s.Z)(d.timestampOffset,0);if(g){var E=(0,X.s9)(h);if(void 0!==E){var w=ue(E.filter((function(e){return void 0!==d.privateInfos&&void 0!==d.privateInfos.isEMSGWhitelisted&&d.privateInfos.isEMSGWhitelisted(e)})),c.publishTime);if(void 0!==w){var S=w.needsManifestRefresh,k=w.inbandEvents;return(0,a.of)({type:"parsed-segment",value:{chunkData:h,chunkInfos:b,chunkOffset:T,appendWindow:v,inbandEvents:k,needsManifestRefresh:S,protectionDataUpdate:y}})}}}return(0,a.of)({type:"parsed-segment",value:{chunkData:h,chunkInfos:b,chunkOffset:T,appendWindow:v,protectionDataUpdate:y}})}var A=d.indexRange,x=null;if("webm"===m)x=function(e,t){var n=J(j,[],e,[t,e.length]);if(null==n)return null;var r=n[0],i=n[1],a=ee(e,r);if(null==a)return null;var o=te(e,r);if(null==o)return null;var s=J(475249515,[],e,[r,i]);if(null==s)return null;for(var u=[],l=s[0];l0)){var I=x[x.length-1];Array.isArray(I.range)&&(I.range[1]=1/0)}l.index instanceof oe.Z&&null!==x&&x.length>0&&l.index.initializeIndex(x);var Z=g?(0,X.LD)(h):"webm"===m?ee(h,0):void 0,M=(0,R.Z)(Z)?void 0:Z;return(0,a.of)({type:"parsed-init-segment",value:{initializationData:h,protectionDataUpdate:y,initTimescale:M}})}}var de=n(6807);function ce(e,t,n,r){var i,a,o=e.segment,s=e.adaptation,u=e.representation;if(o.isInit)return null;null===n?r?(i=o.time,a=o.end):m.Z.warn("Transport: Unavailable time data for current text track."):(i=n.time,void 0!==n.duration?a=i+n.duration:r||(a=i+o.duration));var l=function(e){var t=e.codec;if(void 0===t)throw new Error("Cannot parse subtitles: unknown format");switch(t.toLowerCase()){case"stpp":case"stpp.ttml.im1t":return"ttml";case"wvtt":return"vtt"}throw new Error('The codec used for the subtitles "'+t+'" is not managed yet.')}(u);return{data:function(e){var t=(0,de.Le)(e);return null===t?"":(0,_.uR)(t)}(t),type:l,language:s.language,start:i,end:a}}function fe(e,t,n){var r,i,a=e.segment,o=e.adaptation,s=e.representation;return a.isInit?null:(n?m.Z.warn("Transport: Unavailable time data for current text track."):(r=a.time,i=a.time+a.duration),{data:t,type:function(e){var t=e.mimeType,n=void 0===t?"":t;switch(e.mimeType){case"application/ttml+xml":return"ttml";case"application/x-sami":case"application/smil":return"sami";case"text/vtt":return"vtt"}var r=e.codec;if("srt"===(void 0===r?"":r).toLowerCase())return"srt";throw new Error("could not find a text-track parser for the type "+n)}(s),language:o.language,start:r,end:i})}function pe(e){var t=e.__priv_patchLastSegmentInSidx;return function(e){var n=e.response,r=e.content,i=e.initTimescale,o=r.period,u=r.adaptation,l=r.representation,d=r.segment,c=d.timestampOffset,f=void 0===c?0:c,p=n.data,v=n.isChunked;if(null===p)return d.isInit?(0,a.of)({type:"parsed-init-segment",value:{initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}}):(0,a.of)({type:"parsed-segment",value:{chunkData:null,chunkInfos:null,chunkOffset:f,appendWindow:[o.start,o.end],protectionDataUpdate:!1}});var h=U(u.type,l);if("webm"===h)throw new Error("Text tracks with a WEBM container are not yet handled.");return"mp4"===h?function(e,t){var n=e.response,r=e.content,i=e.initTimescale,o=r.period,u=r.representation,l=r.segment,d=l.isInit,c=l.indexRange,f=n.data,p=n.isChunked,v="string"==typeof f?(0,_.tG)(f):f instanceof Uint8Array?f:new Uint8Array(f);if(d){var h=(0,X.Wf)(v,Array.isArray(c)?c[0]:0);if(!0===t&&null!==h&&h.length>0){var m=h[h.length-1];Array.isArray(m.range)&&(m.range[1]=1/0)}var g=(0,X.LD)(v);return u.index instanceof oe.Z&&null!==h&&h.length>0&&u.index.initializeIndex(h),(0,a.of)({type:"parsed-init-segment",value:{initializationData:null,protectionDataUpdate:!1,initTimescale:g}})}var y=se(v,p,l,i),b=ce(r,v,y,p),T=(0,s.Z)(l.timestampOffset,0);return(0,a.of)({type:"parsed-segment",value:{chunkData:b,chunkInfos:y,chunkOffset:T,appendWindow:[o.start,o.end],protectionDataUpdate:!1}})}({response:{data:p,isChunked:v},content:r,initTimescale:i},t):function(e){var t=e.response,n=e.content,r=n.period,i=n.segment,o=i.timestampOffset,s=void 0===o?0:o;if(i.isInit)return(0,a.of)({type:"parsed-init-segment",value:{initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}});var u,l=t.data,d=t.isChunked;if("string"!=typeof l){var c=l instanceof Uint8Array?l:new Uint8Array(l);u=(0,_.uR)(c)}else u=l;var f=fe(n,u,d);return(0,a.of)({type:"parsed-segment",value:{chunkData:f,chunkInfos:null,chunkOffset:s,appendWindow:[r.start,r.end],protectionDataUpdate:!1}})}({response:{data:p,isChunked:v},content:r})}}var ve=function(e){var t=(0,i.Z)({customManifestLoader:e.manifestLoader},null===r.Z.dashParsers.wasm||"initialized"!==r.Z.dashParsers.wasm.status&&"initializing"!==r.Z.dashParsers.wasm.status?"arraybuffer":"text"),n=T(e),s=function(e){var t=e.lowLatencyMode,n=e.segmentLoader;return!0!==e.checkMediaSegmentIntegrity?r:K(r);function r(e){var r=e.url;if(null==r)return(0,a.of)({type:"data-created",value:{responseData:null}});if(t||void 0===n)return Y(r,e,t);var i={adaptation:e.adaptation,manifest:e.manifest,period:e.period,representation:e.representation,segment:e.segment,transport:"dash",url:r};return new E.y((function(a){var o=!1,s=!1,u=n(i,{reject:function(e){var t,n,r;if(void 0===e&&(e={}),!s){o=!0;var i=e,u=null!==(t=null==i?void 0:i.message)&&void 0!==t?t:"Unknown error when fetching a DASH segment through a custom segmentLoader.",l=new w.Z(u,null!==(n=null==i?void 0:i.canRetry)&&void 0!==n&&n,null!==(r=null==i?void 0:i.isOfflineError)&&void 0!==r&&r,null==i?void 0:i.xhr);a.error(l)}},resolve:function(e){s||(o=!0,a.next({type:"data-loaded",value:{responseData:e.data,size:e.size,duration:e.duration}}),a.complete())},progress:function(e){s||a.next({type:"progress",value:{duration:e.duration,size:e.size,totalSize:e.totalSize}})},fallback:function(){s=!0,Y(r,e,t).subscribe(a)}});return function(){o||s||"function"!=typeof u||u()}}))}}(e),d=le(e);return{manifest:{loader:t,parser:n},audio:{loader:s,parser:d},video:{loader:s,parser:d},text:{loader:function(e){var t=e.lowLatencyMode;return!0!==e.checkMediaSegmentIntegrity?n:K(n);function n(e){var n=e.segment.range,r=e.url;if(null===r)return(0,a.of)({type:"data-created",value:{responseData:null}});if(e.segment.isInit)return G(r,e);var i=U(e.adaptation.type,e.representation),s="mp4"===i||void 0===i;if(t&&s){if(D())return $(r,e);(0,L.Z)("DASH: Your browser does not have the fetch API. You will have a higher chance of rebuffering when playing close to the live edge")}var u=s?"arraybuffer":"text";return(0,o.ZP)({url:r,responseType:u,headers:Array.isArray(n)?{Range:(0,B.Z)(n)}:null,sendProgressEvents:!0})}}(e),parser:pe(e)},image:{loader:u,parser:l}}}},2339:function(e,t,n){"use strict";n.d(t,{Z:function(){return _e}});var r=n(2817),i=n(9127),a=n(2006),o=n(7874),s=n(3887),u=n(1989),l=n(6807),d=n(8999),c=n(7714),f=n(811),p=n(6968),v=n(6923),h=n(8026),m=n(9829),g=n(3635),y=n(5278),_=n(2689),b={};function T(e){if(null!=b[e])return b[e];var t=(0,g.tG)(e);return b[e]=t,t}function E(e,t){var n=t.length+8;return n<=_.s?(0,p.zo)((0,p.kh)(n),T(e),t):(0,p.zo)((0,p.kh)(1),T(e),(0,p.el)(n+8),t)}function w(e,t){return E(e,p.zo.apply(void 0,t))}function S(e){var t=[];e.periods.forEach((function(n){var r=n.id;if((0,c.Z)(t,r)){s.Z.warn("Two periods with the same ID found. Updating.");var i=r+"-dup";n.id=i,S(e),t.push(i)}else t.push(r);var a=n.adaptations,o=[];Object.keys(a).forEach((function(t){var n=a[t];void 0!==n&&n.forEach((function(t){var n=t.id;if((0,c.Z)(o,n)){s.Z.warn("Two adaptations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,S(e),o.push(r)}else o.push(n);var i=[];t.representations.forEach((function(t){var n=t.id;if((0,c.Z)(i,n)){s.Z.warn("Two representations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,S(e),i.push(r)}else i.push(n)}))}))}))}))}var k=n(9689);function A(e){return[{systemId:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",privateData:(0,p.zo)([8,1,18,16],e)}]}function x(e,t){if(void 0===t&&(t=A),null===e.firstElementChild||"ProtectionHeader"!==e.firstElementChild.nodeName)throw new Error("Protection should have ProtectionHeader child");var n=e.firstElementChild,r=(0,k.K)(null===n.textContent?"":n.textContent),i=function(e){var t=(0,p.qb)(e,8),n=(0,g.wV)(e.subarray(10,t+10)),r=(new DOMParser).parseFromString(n,"application/xml").querySelector("KID");if(null===r)throw new Error("Cannot parse PlayReady private data: invalid XML");var i=null===r.textContent?"":r.textContent,a=(0,g.wO)((0,k.K)(i));return(0,g.ci)(a).toLowerCase()}(r),a=(0,g.nr)(i),o=n.getAttribute("SystemID");return{keyId:a,keySystems:[{systemId:(null!==o?o:"").toLowerCase().replace(/\{|\}/g,""),privateData:r}].concat(t(a))}}var I=n(9362),Z=n(8232),M=n(3911),R=n(1091),C=n(5505);function P(e,t,n){var r=e.timeline,i=e.timescale,a=r[r.length-1],o=t.timescale===i?{time:t.time,duration:t.duration}:{time:t.time/t.timescale*i,duration:t.duration/t.timescale*i};return!(n.time===o.time)&&(o.time>=(0,M.jH)(a,null)&&(a.duration===o.duration?a.repeatCount++:e.timeline.push({duration:o.duration,start:o.time,repeatCount:0}),!0))}function N(e,t){return e.replace(/\{start time\}/g,String(t))}function D(e,t,n){var r=t-e;return r>0?Math.floor(r/n):0}function O(e,t){var n=e.repeatCount;if(null!=e.duration&&n<0){var r=void 0!==t?t.start:1/0;n=Math.ceil((r-e.start)/e.duration)-1}return n}var L=function(){function e(e,t){var n=t.aggressiveMode,r=t.isLive,i=t.segmentPrivateInfos,a=t.timeShiftBufferDepth,o=null==t.manifestReceivedTime?performance.now():t.manifestReceivedTime;if(this._index=e,this._indexValidityTime=o,this._timeShiftBufferDepth=a,this._initSegmentInfos={bitsPerSample:i.bitsPerSample,channels:i.channels,codecPrivateData:i.codecPrivateData,packetSize:i.packetSize,samplingRate:i.samplingRate,timescale:e.timescale,protection:i.protection},this._isAggressiveMode=n,this._isLive=r,0!==e.timeline.length){var s=e.timeline[e.timeline.length-1],u=(0,M.jH)(s,null);if(this._initialScaledLastPosition=u,r){var l=o/1e3*e.timescale;this._scaledLiveGap=l-u}}}var t=e.prototype;return t.getInitSegment=function(){return{id:"init",isInit:!0,privateInfos:{smoothInitSegment:this._initSegmentInfos},mediaURLs:null,time:0,end:0,duration:0,timescale:1}},t.getSegments=function(e,t){this._refreshTimeline();for(var n,r=function(e,t,n){var r=void 0===e.timescale||0===e.timescale?1:e.timescale;return{up:t*r,to:(t+n)*r}}(this._index,e,t),i=r.up,a=r.to,o=this._index,s=o.timeline,u=o.timescale,l=o.media,d=this._isAggressiveMode,c=[],f=s.length,p=null==this._scaledLiveGap?void 0:performance.now()/1e3*u-this._scaledLiveGap,v=0;v=a)return c;null!=n&&(n+=y+1)}return c},t.shouldRefresh=function(e,t){if(this._refreshTimeline(),!this._isLive)return!1;var n=this._index,r=n.timeline,i=n.timescale,a=r[r.length-1];if(void 0===a)return!1;var o=a.repeatCount,s=a.start+(o+1)*a.duration;return!(t*i=s||e*i>a.start+o*a.duration)},t.getFirstPosition=function(){this._refreshTimeline();var e=this._index;return 0===e.timeline.length?null:e.timeline[0].start/e.timescale},t.getLastPosition=function(){this._refreshTimeline();var e=this._index;if(null==this._scaledLiveGap){var t=e.timeline[e.timeline.length-1];return(0,M.jH)(t,null)/e.timescale}for(var n=e.timeline.length-1;n>=0;n--)for(var r=e.timeline[n],i=performance.now()/1e3*e.timescale,a=r.start,o=r.duration,s=r.repeatCount;s>=0;s--){var u=a+o*(s+1);if((this._isAggressiveMode?u-o:u)<=i-this._scaledLiveGap)return u/e.timescale}},t.checkDiscontinuity=function(e){return this._refreshTimeline(),(0,M._j)(this._index,e,void 0)},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline();var t=this._index,n=t.timeline,r=t.timescale;return(0,R.Z)(e,n,r,0)},t.canBeOutOfSyncError=function(e){return!!this._isLive&&(e instanceof I.Z&&(e.isHttpError(404)||e.isHttpError(412)))},t._replace=function(e){var t=this._index.timeline,n=e._index.timeline,r=this._index.timescale,i=e._index.timescale;if(this._index=e._index,this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap,0!==t.length&&0!==n.length&&r===i){var a=t[t.length-1],o=n[n.length-1],u=(0,M.jH)(o,null);if(!((0,M.jH)(a,null)<=u))for(var l=0;lu){if(d.duration!==o.duration)return;var f=u-d.start;if(0===f)return s.Z.warn("Smooth Parser: a discontinuity detected in the previous manifest has been resolved."),void(this._index.timeline=this._index.timeline.concat(t.slice(l)));if(f<0||f%d.duration!=0)return;var p=f/d.duration-1,v=d.repeatCount-p;if(v<0)return;o.repeatCount+=v;var h=t.slice(l+1);return void(this._index.timeline=this._index.timeline.concat(h))}}}},t._update=function(e){(0,C.Z)(this._index.timeline,e._index.timeline),this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap},t.isFinished=function(){return!this._isLive},t.isInitialized=function(){return!0},t.addNewSegments=function(e,t){this._refreshTimeline();for(var n=0;n>3:2)?"mp4a.40.2":"mp4a.40."+n}(u,l);return{audiotag:void 0!==i?parseInt(i,10):i,bitrate:p,bitsPerSample:void 0!==a?parseInt(a,10):a,channels:void 0!==o?parseInt(o,10):o,codecPrivateData:u,codecs:h,customAttributes:n,mimeType:void 0!==l?F[l]:l,packetSize:void 0!==d?parseInt(d,10):d,samplingRate:void 0!==c?parseInt(c,10):c};case"video":var m=r("CodecPrivateData"),g=r("FourCC"),_=r("MaxWidth"),b=r("MaxHeight"),T=r("Bitrate"),E=void 0===T||isNaN(parseInt(T,10))?0:parseInt(T,10);if(void 0!==g&&void 0===F[g]||void 0===m)return s.Z.warn("Smooth parser: Unsupported video codec. Ignoring quality level."),null;var w=function(e){var t=/00000001\d7([0-9a-fA-F]{6})/.exec(e);return null!==t&&(0,v.Z)(t[1])?"avc1."+t[1]:"avc1.4D401E"}(m);return{bitrate:E,customAttributes:n,mimeType:void 0!==g?F[g]:g,codecPrivateData:m,codecs:w,width:void 0!==_?parseInt(_,10):void 0,height:void 0!==b?parseInt(b,10):void 0};case"text":var S=r("CodecPrivateData"),k=r("FourCC"),A=r("Bitrate");return{bitrate:void 0===A||isNaN(parseInt(A,10))?0:parseInt(A,10),customAttributes:n,mimeType:void 0!==k?F[k]:k,codecPrivateData:(0,y.Z)(S,"")};default:return s.Z.error("Smooth Parser: Unrecognized StreamIndex type: "+t),null}}function o(t){var r=t.root,i=t.timescale,o=t.rootURL,u=t.protections,l=t.timeShiftBufferDepth,y=t.manifestReceivedTime,_=t.isLive,b=r.getAttribute("Timescale"),T=null===b||isNaN(+b)?i:+b,w=r.getAttribute("Type");if(null===w)throw new Error("StreamIndex without type.");(0,c.Z)(d.r,w)||s.Z.warn("Smooth Parser: Unrecognized adaptation type:",w);var S=w,k=r.getAttribute("Subtype"),A=r.getAttribute("Language"),x=r.getAttribute("Url"),I=null===x?"":x;var Z,M=B(r,(function(e,t,r){switch(t){case"QualityLevel":var i=a(r,S);if(null===i)return e;("video"!==S||i.bitrate>n)&&e.qualityLevels.push(i);break;case"c":e.cNodes.push(r)}return e}),{qualityLevels:[],cNodes:[]}),R=M.qualityLevels,C=M.cNodes,P={timeline:(Z=C,Z.reduce((function(e,t,n){var r=t.getAttribute("d"),i=t.getAttribute("t"),a=t.getAttribute("r"),o=null!==a?+a-1:0,s=null!==i?+i:void 0,u=null!==r?+r:void 0;if(0===n)s=void 0===s||isNaN(s)?0:s;else{var l=e[n-1];if(null==s||isNaN(s)){if(null==l.duration||isNaN(l.duration))throw new Error("Smooth: Invalid CNodes. Missing timestamp.");s=l.start+l.duration*(l.repeatCount+1)}}if(null==u||isNaN(u)){var d=Z[n+1];if(void 0===d)return e;var c=d.getAttribute("t"),f=(0,v.Z)(c)?+c:null;if(null===f)throw new Error("Can't build index timeline from Smooth Manifest.");u=f-s}return e.push({duration:u,start:s,repeatCount:o}),e}),[])),timescale:T};(0,f.Z)(0!==R.length,"Adaptation should have at least one playable representation.");var N=S+((0,v.Z)(A)?"_"+A:""),D=R.map((function(t){var n,r,i,a,s=(0,m.Z)(o,I),d={timeline:P.timeline,timescale:P.timescale,media:(n=s,r=t.bitrate,i=t.customAttributes,n.replace(/\{bitrate\}/g,String(r)).replace(/{CustomAttributes}/g,i.length>0?i[0]:""))},c=(0,v.Z)(t.mimeType)?t.mimeType:U[S],f=t.codecs,b=N+"_"+(null!=S?S+"-":"")+(null!=c?c+"-":"")+(null!=f?f+"-":"")+String(t.bitrate),T=[];u.length>0&&(a=u[0],u.forEach((function(e){var t=e.keyId;e.keySystems.forEach((function(e){T.push({keyId:t,systemId:e.systemId})}))})));var w={bitsPerSample:t.bitsPerSample,channels:t.channels,codecPrivateData:t.codecPrivateData,packetSize:t.packetSize,samplingRate:t.samplingRate,protection:null!=a?{keyId:a.keyId}:void 0},k=null!=e.aggressiveMode&&e.aggressiveMode,A=new L(d,{aggressiveMode:k,isLive:_,manifestReceivedTime:y,segmentPrivateInfos:w,timeShiftBufferDepth:l}),x=(0,h.Z)({},t,{index:A,mimeType:c,codecs:f,id:b});if(T.length>0||void 0!==a){var Z=void 0===a?[]:a.keySystems.map((function(e){var t=e.systemId,n=e.privateData,r=t.replace(/-/g,"");return{systemId:r,data:function(e,t){if(32!==e.length)throw new Error("HSS: wrong system id length");var n=0;return E("pssh",(0,p.zo)([n,0,0,0],(0,g.nr)(e),(0,p.kh)(t.length),t))}(r,n)}}));if(Z.length>0){var M=[{type:"cenc",values:Z}];x.contentProtections={keyIds:T,initData:M}}else x.contentProtections={keyIds:T,initData:[]}}return x}));if("ADVT"===k)return null;var O={id:N,type:S,representations:D,language:null==A?void 0:A};return"text"===S&&"DESC"===k&&(O.closedCaption=!0),O}return function(n,r,a){var s=(0,m.f)(null==r?"":r),u=n.documentElement;if(null==u||"SmoothStreamingMedia"!==u.nodeName)throw new Error("document root should be SmoothStreamingMedia");var l=u.getAttribute("MajorVersion"),d=u.getAttribute("MinorVersion");if(null===l||null===d||!/^[2]-[0-2]$/.test(l+"-"+d))throw new Error("Version should be 2.0, 2.1 or 2.2");var c,f,p=u.getAttribute("Timescale"),h=(0,v.Z)(p)?isNaN(+p)?1e7:+p:1e7,g=B(u,(function(t,n,r){switch(n){case"Protection":t.protections.push(x(r,e.keySystems));break;case"StreamIndex":t.adaptationNodes.push(r)}return t}),{adaptationNodes:[],protections:[]}),y=g.protections,_=g.adaptationNodes,b="boolean"==typeof(c=u.getAttribute("IsLive"))?c:"string"==typeof c&&"TRUE"===c.toUpperCase();if(b){var T=u.getAttribute("DVRWindowLength");null==T||isNaN(+T)||0==+T||(f=+T/h)}var E,w,k,A,I,Z,M=_.reduce((function(e,t){var n=o({root:t,rootURL:s,timescale:h,protections:y,isLive:b,timeShiftBufferDepth:f,manifestReceivedTime:a});if(null===n)return e;var r=n.type,i=e[r];return void 0===i?e[r]=[n]:i.push(n),e}),{}),R=null,C=void 0!==M.video?M.video[0]:void 0,P=void 0!==M.audio?M.audio[0]:void 0;if(void 0!==C||void 0!==P){var N=[],D=[];if(void 0!==C){var O=C.representations[0];if(void 0!==O){var L=O.index.getFirstPosition(),U=O.index.getLastPosition();null!=L&&N.push(L),null!=U&&D.push(U)}}if(void 0!==P){var F=P.representations[0];if(void 0!==F){var z=F.index.getFirstPosition(),K=F.index.getLastPosition();null!=z&&N.push(z),null!=K&&D.push(K)}}N.length>0&&(I=Math.max.apply(Math,N)),D.length>0&&(Z=Math.min.apply(Math,D))}var V=u.getAttribute("Duration"),G=null!=V&&0!=+V?+V/h:void 0;b?(E=e.suggestedPresentationDelay,w=t,k=null!=I?I:w,A={isLinear:!0,value:null!=Z?Z:Date.now()/1e3-w,time:performance.now()},R=null!=f?f:null):(k=null!=I?I:0,A={isLinear:!1,value:void 0!==Z?Z:void 0!==G?k+G:1/0,time:performance.now()});var H=b?0:k,W=b?void 0:A.value,$={availabilityStartTime:void 0===w?0:w,clockOffset:i,isLive:b,isDynamic:b,isLastPeriodKnown:!0,timeBounds:{absoluteMinimumTime:k,timeshiftDepth:R,maximumTimeData:A},periods:[{adaptations:M,duration:void 0!==W?W-H:G,end:W,id:"gen-smooth-period-0",start:H}],suggestedPresentationDelay:E,transportType:"smooth",uris:null==r?[]:[r]};return S($),$}},K=n(4597),V=n(8806),G=n(4460),H=n(8791),W=n(7445),$=n(4644),Y=n(2297);function q(e,t,n,r,i){var a,o,u,d=[];if(i){var c=(0,l.XA)(e);null!==c?(u=function(e){var t=(0,Y.nR)(e,3565190898,3392751253,2387879627,2655430559);if(void 0===t)return[];for(var n=[],r=t[0],i=t[4],a=0;a0)return e;var n=new Uint8Array(e.length+4);return n.set(e.subarray(0,t+8),0),n[t+3]=1|n[t+3],n.set([0,0,0,0],t+8),n.set(e.subarray(t+8,e.length),t+12),(0,$.J6)(n)}(l,s[1]-s[0]),f=te(u,d,c,i,(0,Y.nR)(a,2721664850,1520127764,2722393154,2086964724)),v=w("moof",[i,f]),h=(0,Y.Qy)(v,1836019558),m=(0,Y.Qy)(f,1953653094),g=(0,Y.Qy)(c,1953658222);if(null===h||null===m||null===g)throw new Error("Smooth: Invalid moof, trun or traf generation");var y=h[1]-h[0]+i.length+(m[1]-m[0])+u.length+d.length+(g[1]-g[0])+8,_=n[2]-n[0],b=v.length-_,T=(0,Y.Qy)(e,1835295092);if(null===T)throw new Error("Smooth: Invalid ISOBMFF given");if(!X.YM&&(0===b||b<=-8)){var S=T[1];return v.set((0,p.kh)(S),y),e.set(v,n[0]),b<=-8&&e.set(E("free",new Uint8Array(-b-8)),v.length),e}var k=T[1]+b;v.set((0,p.kh)(k),y);var A=new Uint8Array(e.length+b),x=e.subarray(0,n[0]),I=e.subarray(n[2],e.length);return A.set(x,0),A.set(v,x.length),A.set(I,x.length+v.length),A}var re=n(1480),ie=n(7839),ae=n(281);function oe(e,t,n,r,i,a){var o,s,u,l=w("stbl",[n,E("stts",new Uint8Array(8)),E("stsc",new Uint8Array(8)),E("stsz",new Uint8Array(12)),E("stco",new Uint8Array(8))]),d=w("dinf",[function(e){return E("dref",(0,p.zo)(7,[1],e))}(E("url ",new Uint8Array([0,0,0,1])))]),c=w("minf",[r,d,l]),f=function(e){var t,n;switch(e){case"video":t="vide",n="VideoHandler";break;case"audio":t="soun",n="SoundHandler";break;default:t="hint",n=""}return E("hdlr",(0,p.zo)(8,(0,g.tG)(t),12,(0,g.tG)(n),1))}(t),v=w("mdia",[function(e){return E("mdhd",(0,p.zo)(12,(0,p.kh)(e),8))}(e),f,c]),h=w("trak",[function(e,t,n){return E("tkhd",(0,p.zo)((0,p.kh)(7),8,(0,p.kh)(n),20,[1,0,0,0],[0,1,0,0],12,[0,1,0,0],12,[64,0,0,0],(0,p.XT)(e),2,(0,p.XT)(t),2))}(i,a,1),v]),m=w("mvex",[(o=1,E("trex",(0,p.zo)(4,(0,p.kh)(o),[0,0,0,1],12)))]),y=function(e,t,n){return w("moov",[e,t,n])}(function(e,t){return E("mvhd",(0,p.zo)(12,(0,p.kh)(e),4,[0,1],2,[1,0],10,[0,1],14,[0,1],14,[64,0,0,0],26,(0,p.XT)(t+1)))}(e,1),m,h),_=(s="isom",u=["isom","iso2","iso6","avc1","dash"],E("ftyp",p.zo.apply(void 0,[(0,g.tG)(s),[0,0,0,1]].concat(u.map(g.tG)))));return(0,p.zo)(_,y)}function se(e,t,n,r,i,a,o,s){var u=o.split("00000001"),l=u[1],d=u[2];if(void 0===l||void 0===d)throw new Error("Smooth: unsupported codec private data.");var c,f,v=function(e,t,n){var r=2===n?1:4===n?3:0,i=e[1],a=e[2],o=e[3];return E("avcC",(0,p.zo)([1,i,a,o,252|r,225],(0,p.XT)(e.length),e,[1],(0,p.XT)(t.length),t))}((0,g.nr)(l),(0,g.nr)(d),a);if(void 0===s){c=J([function(e,t,n,r,i,a,o){return E("avc1",(0,p.zo)(6,(0,p.XT)(1),16,(0,p.XT)(e),(0,p.XT)(t),(0,p.XT)(n),2,(0,p.XT)(r),6,[0,1,i.length],(0,g.tG)(i),31-i.length,(0,p.XT)(a),[255,255],o))}(t,n,r,i,"AVC Coding",24,v)])}else{var h=w("schi",[ee(1,8,s)]),m=j("cenc",65536);c=J([function(e,t,n,r,i,a,o,s){return E("encv",(0,p.zo)(6,(0,p.XT)(1),16,(0,p.XT)(e),(0,p.XT)(t),(0,p.XT)(n),2,(0,p.XT)(r),6,[0,1,i.length],(0,g.tG)(i),31-i.length,(0,p.XT)(a),[255,255],o,s))}(t,n,r,i,"AVC Coding",24,v,w("sinf",[Q("avc1"),m,h]))])}return oe(e,"video",c,((f=new Uint8Array(12))[3]=1,E("vmhd",f)),t,n)}var ue=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];function le(e,t,n,r,i,a,o){var s,u,l,d=function(e,t){return E("esds",(0,p.zo)(4,[3,25],(0,p.XT)(e),[0,4,17,64,21],11,[5,2],(0,g.nr)(t),[6,1,2]))}(1,0===a.length?(s=i,u=t,l=((l=((l=(63&2)<<4)|31&ue.indexOf(s))<<4)|31&u)<<3,(0,g.ci)((0,p.XT)(l))):a);return oe(e,"audio",function(){if(void 0===o)return J([function(e,t,n,r,i,a){return E("mp4a",(0,p.zo)(6,(0,p.XT)(e),8,(0,p.XT)(t),(0,p.XT)(n),2,(0,p.XT)(r),(0,p.XT)(i),2,a))}(1,t,n,r,i,d)]);var e=w("schi",[ee(1,8,o)]),a=j("cenc",65536),s=w("sinf",[Q("mp4a"),a,e]);return J([function(e,t,n,r,i,a,o){return E("enca",(0,p.zo)(6,(0,p.XT)(e),8,(0,p.XT)(t),(0,p.XT)(n),2,(0,p.XT)(r),(0,p.XT)(i),2,a,o))}(1,t,n,r,i,d,s)])}(),E("smhd",new Uint8Array(8)),0,0)}function de(e){var t,n=e.url,r=e.segment.range;return Array.isArray(r)&&(t={Range:(0,ae.Z)(r)}),(0,K.ZP)({url:n,responseType:"arraybuffer",headers:t,sendProgressEvents:!0})}var ce=function(e){return function(t){var n=t.segment,i=t.representation,a=t.adaptation,o=t.period,s=t.manifest,u=t.url;if(n.isInit){if(void 0===n.privateInfos||void 0===n.privateInfos.smoothInitSegment)throw new Error("Smooth: Invalid segment format");var l,d=n.privateInfos.smoothInitSegment,c=d.codecPrivateData,f=d.timescale,p=d.protection,v=void 0===p?{keyId:void 0,keySystems:void 0}:p;if(void 0===c)throw new Error("Smooth: no codec private data.");switch(a.type){case"video":var h=i.width,m=void 0===h?0:h,g=i.height;l=se(f,m,void 0===g?0:g,72,72,4,c,v.keyId);break;case"audio":var y=d.channels,_=void 0===y?0:y,b=d.bitsPerSample,T=void 0===b?0:b,E=d.packetSize,w=void 0===E?0:E,S=d.samplingRate;l=le(f,_,T,w,void 0===S?0:S,c,v.keyId);break;default:0,l=new Uint8Array(0)}return(0,r.of)({type:"data-created",value:{responseData:l}})}if(null===u)return(0,r.of)({type:"data-created",value:{responseData:null}});var k={adaptation:a,manifest:s,period:o,representation:i,segment:n,transport:"smooth",url:u};return"function"!=typeof e?de(k):new re.y((function(t){var n=!1,r=!1,i=e(k,{reject:function(e){var i,a,o;if(void 0===e&&(e={}),!r){n=!0;var s=e,u=null!==(i=null==s?void 0:s.message)&&void 0!==i?i:"Unknown error when fetching a Smooth segment through a custom segmentLoader.",l=new ie.Z(u,null!==(a=null==s?void 0:s.canRetry)&&void 0!==a&&a,null!==(o=null==s?void 0:s.isOfflineError)&&void 0!==o&&o,null==s?void 0:s.xhr);t.error(l)}},resolve:function(e){r||(n=!0,t.next({type:"data-loaded",value:{responseData:e.data,size:e.size,duration:e.duration}}),t.complete())},fallback:function(){r=!0,de(k).subscribe(t)},progress:function(e){r||t.next({type:"progress",value:{duration:e.duration,size:e.size,totalSize:e.totalSize}})}});return function(){n||r||"function"!=typeof i||i()}}))}},fe=/(\.isml?)(\?token=\S+)?$/,pe=/\?token=(\S+)/;function ve(e,t){return(0,v.Z)(t)?e.replace(pe,"?token="+t):e.replace(pe,"")}function he(e){return fe.test(e)?((0,V.Z)("Giving a isml URL to loadVideo is deprecated. Please give the Manifest URL directly"),e.replace(fe,"$1/manifest$2")):e}var me=/\.wsx?(\?token=\S+)?/;function ge(e,t,n){var r;s.Z.debug("Smooth Parser: update segments information.");for(var i=e.representations,a=0;a=0}var _e=function(e){var t=z(e),n=ce(e.segmentLoader),d={customManifestLoader:e.manifestLoader},c={loader:function(t){return t.segment.isInit||!0!==e.checkMediaSegmentIntegrity?n(t):n(t).pipe((0,a.b)((function(e){"data-loaded"!==e.type&&"data-chunk"!==e.type||null===e.value.responseData||(0,G.Z)(new Uint8Array(e.value.responseData),t.segment.isInit)})))},parser:function(e){var t,n,i=e.content,a=e.response,o=e.initTimescale,s=i.segment,u=i.adaptation,l=i.manifest,d=a.data,c=a.isChunked;if(null===d)return s.isInit?(0,r.of)({type:"parsed-init-segment",value:{initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}}):(0,r.of)({type:"parsed-segment",value:{chunkData:null,chunkInfos:null,chunkOffset:0,appendWindow:[void 0,void 0],protectionDataUpdate:!1}});var f=d instanceof Uint8Array?d:new Uint8Array(d);if(s.isInit){var p=null===(n=null===(t=s.privateInfos)||void 0===t?void 0:t.smoothInitSegment)||void 0===n?void 0:n.timescale;return(0,r.of)({type:"parsed-init-segment",value:{initializationData:d,initTimescale:p,protectionDataUpdate:!1}})}var v=void 0!==o?q(f,c,o,s,l.isLive):null;if(null===v||null===v.chunkInfos||void 0===v.scaledSegmentTime)throw new Error("Smooth Segment without time information");var h=v.nextSegments,m=v.chunkInfos,g=ne(f,v.scaledSegmentTime);return h.length>0&&ge(u,h,s),(0,r.of)({type:"parsed-segment",value:{chunkData:g,chunkInfos:m,chunkOffset:0,appendWindow:[void 0,void 0],protectionDataUpdate:!1}})}};return{manifest:{resolver:function(e){var t,n=e.url;if(void 0===n)return(0,r.of)({url:void 0});me.test(n)?((0,V.Z)("Giving WSX URL to loadVideo is deprecated. You should only give Manifest URLs."),t=(0,K.ZP)({url:ve(n,""),responseType:"document"}).pipe((0,i.U)((function(e){var t=e.value,n=t.responseData.getElementsByTagName("media")[0].getAttribute("src");if(null===n||0===n.length)throw new Error("Invalid ISML");return n})))):t=(0,r.of)(n);var a=function(e){var t=pe.exec(e);if(null!==t){var n=t[1];if(void 0!==n)return n}return""}(n);return t.pipe((0,i.U)((function(e){return{url:ve(he(e),a)}})))},loader:(0,H.Z)(d,"text"),parser:function(n){var r=n.response,i=n.url,a=void 0===r.url?i:r.url,o="string"==typeof r.responseData?(new DOMParser).parseFromString(r.responseData,"text/xml"):r.responseData,s=r.receivedTime,l=t(o,a,s),d=new u.ZP(l,{representationFilter:e.representationFilter,supplementaryImageTracks:e.supplementaryImageTracks,supplementaryTextTracks:e.supplementaryTextTracks});return(0,W.Z)(d,a)}},audio:c,video:c,text:{loader:function(t){var n=t.segment,i=t.representation,o=t.url;if(n.isInit||null===o)return(0,r.of)({type:"data-created",value:{responseData:null}});var s=ye(i);return s&&!0===e.checkMediaSegmentIntegrity?(0,K.ZP)({url:o,responseType:"arraybuffer",sendProgressEvents:!0}).pipe((0,a.b)((function(e){"data-loaded"===e.type&&(0,G.Z)(new Uint8Array(e.value.responseData),n.isInit)}))):(0,K.ZP)({url:o,responseType:s?"arraybuffer":"text",sendProgressEvents:!0})},parser:function(e){var t,n,i=e.content,a=e.response,o=e.initTimescale,u=i.manifest,d=i.adaptation,c=i.representation,f=i.segment,p=d.language,v=ye(c),h=c.mimeType,m=void 0===h?"":h,y=c.codec,_=void 0===y?"":y,b=a.data,T=a.isChunked;if(f.isInit)return(0,r.of)({type:"parsed-init-segment",value:{initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}});if(null===b)return(0,r.of)({type:"parsed-segment",value:{chunkData:null,chunkInfos:null,chunkOffset:0,appendWindow:[void 0,void 0],protectionDataUpdate:!1}});var E,w,S,k,A=null;if(v){var x;x="string"==typeof b?(0,g.tG)(b):b instanceof Uint8Array?b:new Uint8Array(b);var I=void 0!==o?q(x,T,o,f,u.isLive):null;n=null==I?void 0:I.nextSegments,null===(A=null!==(t=null==I?void 0:I.chunkInfos)&&void 0!==t?t:null)?T?s.Z.warn("Smooth: Unavailable time data for current text track."):(E=f.time,w=f.end):(E=A.time,w=void 0!==A.duration?A.time+A.duration:f.end);var Z=_.toLowerCase();if("application/ttml+xml+mp4"===m||"stpp"===Z||"stpp.ttml.im1t"===Z)k="ttml";else{if("wvtt"!==Z)throw new Error("could not find a text-track parser for the type "+m);k="vtt"}var M=(0,l.Le)(x);S=null===M?"":(0,g.uR)(M)}else{var R;if(E=f.time,w=f.end,"string"!=typeof b){var C=b instanceof Uint8Array?b:new Uint8Array(b);R=(0,g.uR)(C)}else R=b;switch(m){case"application/x-sami":case"application/smil":k="sami";break;case"application/ttml+xml":k="ttml";break;case"text/vtt":k="vtt"}if(void 0===k){if("srt"!==_.toLowerCase())throw new Error("could not find a text-track parser for the type "+m);k="srt"}S=R}null!==A&&Array.isArray(n)&&n.length>0&&ge(d,n,f);var P=null!=E?E:0;return(0,r.of)({type:"parsed-segment",value:{chunkData:{type:k,data:S,start:E,end:w,language:p},chunkInfos:A,chunkOffset:P,appendWindow:[void 0,void 0],protectionDataUpdate:!1}})}},image:{loader:function(e){var t=e.segment,n=e.url;return t.isInit||null===n?(0,r.of)({type:"data-created",value:{responseData:null}}):(0,K.ZP)({url:n,responseType:"arraybuffer",sendProgressEvents:!0})},parser:function(e){var t=e.response,n=e.content,i=t.data,a=t.isChunked;if(n.segment.isInit)return(0,r.of)({type:"parsed-init-segment",value:{initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}});if(a)throw new Error("Image data should not be downloaded in chunks");if(null===i||null===o.Z.imageParser)return(0,r.of)({type:"parsed-segment",value:{chunkData:null,chunkInfos:null,chunkOffset:0,appendWindow:[void 0,void 0],protectionDataUpdate:!1}});var s=o.Z.imageParser(new Uint8Array(i)),u=s.thumbs;return(0,r.of)({type:"parsed-segment",value:{chunkData:{data:u,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkInfos:{time:0,duration:Number.MAX_VALUE,timescale:s.timescale},chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}})}}}}},281:function(e,t,n){"use strict";function r(e){var t=e[0],n=e[1];return n===1/0?"bytes="+t+"-":"bytes="+t+"-"+n}n.d(t,{Z:function(){return r}})},4460:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5389),i=n(8766);function a(e,t){if(t){if((0,i.Z)(e,1718909296)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `ftyp` box");if((0,i.Z)(e,1836019574)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `moov` box")}else{if((0,i.Z)(e,1836019558)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `moof` box");if((0,i.Z)(e,1835295092)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `mdat` box")}}},8766:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(6968);function i(e,t){for(var n=e.length,i=0;i+8<=n;){var a=(0,r.pX)(e,i);if(0===a)a=n-i;else if(1===a){if(i+16>n)return-1;a=(0,r.pV)(e,i+8)}if(isNaN(a)||a<=0)return-1;if((0,r.pX)(e,i+4)===t)return i+a<=n?i:-1;i+=a}return-1}},8791:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(1946),i=n(4597),a=n(1480),o=n(7839);function s(e,t){var n=e.customManifestLoader,s=function(e){return function(t){var n=t.url;if(void 0===n)throw new Error("Cannot perform HTTP(s) request. URL not known");return(0,i.ZP)({url:n,responseType:e})}}(t);return(0,r.Z)(n)?s:function(e,t){return function(n){return new a.y((function(r){var i=n.url,a=Date.now()-performance.now(),s=!1,u=!1,l=e(i,{reject:function(e){var t,n,i;if(!u){s=!0;var a=e,l=null!==(t=null==a?void 0:a.message)&&void 0!==t?t:"Unknown error when fetching the Manifest through a custom manifestLoader.",d=new o.Z(l,null!==(n=null==a?void 0:a.canRetry)&&void 0!==n&&n,null!==(i=null==a?void 0:a.isOfflineError)&&void 0!==i&&i,null==a?void 0:a.xhr);r.error(d)}},resolve:function(e){if(!u){s=!0;var t=void 0!==e.receivingTime?e.receivingTime-a:void 0,n=void 0!==e.sendingTime?e.sendingTime-a:void 0;r.next({type:"data-loaded",value:{responseData:e.data,size:e.size,duration:e.duration,url:e.url,receivedTime:t,sendingTime:n}}),r.complete()}},fallback:function(){u=!0,t(n).subscribe(r)}});return function(){s||u||"function"!=typeof l||l()}}))}}(n,s)}},7445:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2817),i=n(6362);function a(e,t){var n=r.of.apply(void 0,e.parsingErrors.map((function(e){return{type:"warning",value:e}})));return(0,i.z)(n,(0,r.of)({type:"parsed",value:{manifest:e,url:t}}))}},4791:function(e,t,n){"use strict";function r(e,t){if(e.length!==t.length)return!1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return!1;return!0}n.d(t,{Z:function(){return r}})},3274:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.find)return e.find(t,n);for(var r=e.length>>>0,i=0;i>>0,i=0;i>>0;if(0===r)return!1;for(var i,a,o=0|n,s=o>=0?Math.min(o,r-1):Math.max(r+o,0);s=a.length)throw new Error("Unable to parse base64 string.");var t=a[e];if(255===t)throw new Error("Unable to parse base64 string.");return t}function s(e){var t,n="",r=e.length;for(t=2;t>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2|e[t]>>6],n+=i[63&e[t]];return t===r+1&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4],n+="=="),t===r&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2],n+="="),n}function u(e){var t=e.length%4,n=e;0!==t&&(r.Z.warn("base64ToBytes: base64 given miss padding"),n+=3===t?"=":2===t?"==":"===");var i=n.indexOf("=");if(-1!==i&&i>16,l[c+1]=a>>8&255,l[c+2]=255&a;return l.subarray(0,l.length-s)}},6968:function(e,t,n){"use strict";function r(){for(var e,t=arguments.length,n=-1,r=0;++n0&&(i.set(e,a),a+=e.length);return i}function i(e,t){return(e[t+0]<<8)+(e[t+1]<<0)}function a(e,t){return 65536*e[t+0]+256*e[t+1]+e[t+2]}function o(e,t){return 16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3]}function s(e,t){return 4294967296*(16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3])+16777216*e[t+4]+65536*e[t+5]+256*e[t+6]+e[t+7]}function u(e){return new Uint8Array([e>>>8&255,255&e])}function l(e){return new Uint8Array([e>>>24&255,e>>>16&255,e>>>8&255,255&e])}function d(e){var t=e%4294967296,n=(e-t)/4294967296;return new Uint8Array([n>>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t])}function c(e,t){return(e[t+0]<<0)+(e[t+1]<<8)}function f(e,t){return e[t+0]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]}function p(e){return new Uint8Array([255&e,e>>>8&255,e>>>16&255,e>>>24&255])}function v(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer)}n.d(t,{zo:function(){return r},zK:function(){return i},QI:function(){return a},pX:function(){return o},pV:function(){return s},qb:function(){return c},dN:function(){return f},XT:function(){return u},kh:function(){return l},el:function(){return d},O_:function(){return p},_f:function(){return v}})},8117:function(e,t,n){"use strict";var r=n(1480),i=n(1973),a=n(2817),o=n(1946);t.Z=function(e){return e instanceof r.y?e:(0,o.Z)(e)||"function"!=typeof e.subscribe&&"function"!=typeof e.then?(0,a.of)(e):(0,i.Dp)(e)}},4437:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r,i=n(5987),a=n(8337),o=1,s={};function u(e){return e in s&&(delete s[e],!0)}var l=function(e){var t=o++;return s[t]=!0,r||(r=Promise.resolve()),r.then((function(){return u(t)&&e()})),t},d=function(e){u(e)},c={setImmediate:function(){for(var e=[],t=0;t0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=c.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(c.clearImmediate(n),t._scheduled=void 0)},t}(a.o),p=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.ZT)(t,e),t.prototype.flush=function(e){this._active=!0,this._scheduled=void 0;var t,n=this.actions,r=-1;e=e||n.shift();var i=n.length;do{if(t=e.execute(e.state,e.delay))break}while(++r=Number.MAX_SAFE_INTEGER&&(e+="0",t=0),e+String(t)}}n.d(t,{Z:function(){return r}})},6923:function(e,t,n){"use strict";function r(e){return"string"==typeof e&&e.length>0}n.d(t,{Z:function(){return r}})},1946:function(e,t,n){"use strict";function r(e){return null==e}n.d(t,{Z:function(){return r}})},7829:function(e,t,n){"use strict";var r=n(5553);t.ZP=r.ZP},5553:function(e,t,n){"use strict";n.d(t,{ZP:function(){return d},iH:function(){return l},Y1:function(){return u}});var r=n(6923),i=n(1946),a={aa:"aar",ab:"abk",ae:"ave",af:"afr",ak:"aka",am:"amh",an:"arg",ar:"ara",as:"asm",av:"ava",ay:"aym",az:"aze",ba:"bak",be:"bel",bg:"bul",bi:"bis",bm:"bam",bn:"ben",bo:"bod",br:"bre",bs:"bos",ca:"cat",ce:"che",ch:"cha",co:"cos",cr:"cre",cs:"ces",cu:"chu",cv:"chv",cy:"cym",da:"dan",de:"deu",dv:"div",dz:"dzo",ee:"ewe",el:"ell",en:"eng",eo:"epo",es:"spa",et:"est",eu:"eus",fa:"fas",ff:"ful",fi:"fin",fj:"fij",fo:"fao",fr:"fra",fy:"fry",ga:"gle",gd:"gla",gl:"glg",gn:"grn",gu:"guj",gv:"glv",ha:"hau",he:"heb",hi:"hin",ho:"hmo",hr:"hrv",ht:"hat",hu:"hun",hy:"hye",hz:"her",ia:"ina",id:"ind",ie:"ile",ig:"ibo",ii:"iii",ik:"ipk",io:"ido",is:"isl",it:"ita",iu:"iku",ja:"jpn",jv:"jav",ka:"kat",kg:"kon",ki:"kik",kj:"kua",kk:"kaz",kl:"kal",km:"khm",kn:"kan",ko:"kor",kr:"kau",ks:"kas",ku:"kur",kv:"kom",kw:"cor",ky:"kir",la:"lat",lb:"ltz",lg:"lug",li:"lim",ln:"lin",lo:"lao",lt:"lit",lu:"lub",lv:"lav",mg:"mlg",mh:"mah",mi:"mri",mk:"mkd",ml:"mal",mn:"mon",mr:"mar",ms:"msa",mt:"mlt",my:"mya",na:"nau",nb:"nob",nd:"nde",ne:"nep",ng:"ndo",nl:"nld",nn:"nno",no:"nor",nr:"nbl",nv:"nav",ny:"nya",oc:"oci",oj:"oji",om:"orm",or:"ori",os:"oss",pa:"pan",pi:"pli",pl:"pol",ps:"pus",pt:"por",qu:"que",rm:"roh",rn:"run",ro:"ron",ru:"rus",rw:"kin",sa:"san",sc:"srd",sd:"snd",se:"sme",sg:"sag",si:"sin",sk:"slk",sl:"slv",sm:"smo",sn:"sna",so:"som",sq:"sqi",sr:"srp",ss:"ssw",st:"sot",su:"sun",sv:"swe",sw:"swa",ta:"tam",te:"tel",tg:"tgk",th:"tha",ti:"tir",tk:"tuk",tl:"tgl",tn:"tsn",to:"ton",tr:"tur",ts:"tso",tt:"tat",tw:"twi",ty:"tah",ug:"uig",uk:"ukr",ur:"urd",uz:"uzb",ve:"ven",vi:"vie",vo:"vol",wa:"wln",wo:"wol",xh:"xho",yi:"yid",yo:"yor",za:"zha",zh:"zho",zu:"zul"},o={alb:"sqi",arm:"hye",baq:"eus",bur:"mya",chi:"zho",cze:"ces",dut:"nld",fre:"fra",geo:"kat",ger:"deu",gre:"ell",ice:"isl",mac:"mkd",mao:"mri",may:"msa",per:"fas",slo:"slk",rum:"ron",tib:"bod",wel:"cym"};function s(e){if((0,i.Z)(e)||""===e)return"";var t=function(e){var t;switch(e.length){case 2:t=a[e];break;case 3:t=o[e]}return t}((""+e).toLowerCase().split("-")[0]);return(0,r.Z)(t)?t:e}function u(e){if(!(0,i.Z)(e)){var t,n=!1;return"string"==typeof e?t=e:(t=e.language,!0===e.closedCaption&&(n=!0)),{language:t,closedCaption:n,normalized:s(t)}}return e}function l(e){if((0,i.Z)(e))return e;if("string"==typeof e)return{language:e,audioDescription:!1,normalized:s(e)};var t={language:e.language,audioDescription:!0===e.audioDescription,normalized:s(s(e.language))};return!0===e.isDub&&(t.isDub=!0),t}var d=s},8894:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},8026:function(e,t){"use strict";t.Z="function"==typeof Object.assign?Object.assign:function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=0;n<(arguments.length<=1?0:arguments.length-1);n++){var r=n+1<1||arguments.length<=n+1?void 0:arguments[n+1];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}},1679:function(e,t,n){"use strict";t.Z="function"==typeof Object.values?Object.values:function(e){return Object.keys(e).map((function(t){return e[t]}))}},9589:function(e,t,n){"use strict";var r=n(8555),i=n.n(r);t.Z="function"==typeof Promise?Promise:i()},2829:function(e,t,n){"use strict";n.d(t,{JN:function(){return d},uH:function(){return b},F_:function(){return p},L7:function(){return m},XS:function(){return f},DD:function(){return h},rx:function(){return c},at:function(){return v},kR:function(){return g},Ti:function(){return s},A1:function(){return o},tn:function(){return _}});function r(e,t){return Math.abs(e-t)<.016666666666666666}function i(e,t){return{start:Math.min(e.start,t.start),end:Math.max(e.end,t.end)}}function a(e,t){return e.end<=t.start}function o(e,t){for(var n=0;n=0;n--){var r=e.start(n);if(t>=r){var i=e.end(n);if(t=o?r.push({start:a,end:o}):n={start:a,end:o}}return{outerRanges:r,innerRange:n}}function v(e,t){var n=c(e,t);return null!==n?n.end-n.start:0}function h(e,t){var n=c(e,t);return null!==n?t-n.start:0}function m(e,t){var n=c(e,t);return null!==n?n.end-t:1/0}function g(e,t){if(t.start===t.end)return e;for(var n=t,r=0;r0)for(var o=0;o0)for(var s=0;sl&&n.push({start:l,end:a[d].start}),l=a[d].end;l=0&&(d.timeout=l),d.responseType=u,"document"===d.responseType&&d.overrideMimeType("text/xml"),!(0,s.Z)(i)){var c=i;for(var f in c)c.hasOwnProperty(f)&&d.setRequestHeader(f,c[f])}var p=performance.now();return d.onerror=function(){n.error(new a.Z(r,d.status,"ERROR_EVENT",d))},d.ontimeout=function(){n.error(new a.Z(r,d.status,"TIMEOUT",d))},!0===e.sendProgressEvents&&(d.onprogress=function(e){var t=performance.now();n.next({type:"progress",value:{url:r,duration:t-p,sendingTime:p,currentTime:t,size:e.loaded,totalSize:e.total}})}),d.onload=function(e){if(4===d.readyState)if(d.status>=200&&d.status<300){var t,i=performance.now(),u=d.response instanceof ArrayBuffer?d.response.byteLength:e.total,l=d.status,c=d.responseType,f=(0,o.Z)(d.responseURL)?d.responseURL:r;if(t="json"===c?"object"==typeof d.response?d.response:function(e){try{return JSON.parse(e)}catch(e){return null}}(d.responseText):d.response,(0,s.Z)(t))return void n.error(new a.Z(r,d.status,"PARSE_ERROR",d));n.next({type:"data-loaded",value:{status:l,url:f,responseType:c,sendingTime:p,receivedTime:i,duration:i-p,size:u,responseData:t}}),n.complete()}else n.error(new a.Z(r,d.status,"ERROR_HTTP_CODE",d))},d.send(),function(){(0,s.Z)(d)||4===d.readyState||d.abort()}}))}},9829:function(e,t,n){"use strict";n.d(t,{Z:function(){return o},f:function(){return s}});var r=/^(?:[a-z]+:)?\/\//i,i=/\/\.{1,2}\//;function a(e){if(!i.test(e))return e;for(var t=[],n=e.split("/"),r=0,a=n.length;r=0&&t===n+1)return e}var i=e.indexOf("?");return i>=0&&i>8&255}return n}function u(e){if(a)try{return new TextDecoder("utf-16le").decode(e)}catch(e){r.Z.warn("Utils: could not use TextDecoder to parse UTF-16LE, fallbacking to another implementation",e)}for(var t="",n=0;n=t?n:new Array(t-n.length+1).join("0")+n}function c(e){if(a)try{return(new TextDecoder).decode(e)}catch(e){r.Z.warn("Utils: could not use TextDecoder to parse UTF-8, fallbacking to another implementation",e)}var t=e;239===t[0]&&187===t[1]&&191===t[2]&&(t=t.subarray(3));var n,i=function(e){for(var t="",n=0;n=256?"%u"+d(u,4):"%"+d(u,2)}}return decodeURIComponent(n)}function f(e){for(var t=e.length,n=new Uint8Array(t/2),r=0,i=0;r>>4).toString(16),n+=(15&e[r]).toString(16),t.length>0&&r=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(u&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:Z(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},1480:function(e,t,n){"use strict";n.d(t,{y:function(){return d}});var r=n(6267),i=n(5720),a=n(6766),o=n(278);function s(e){return 0===e.length?o.y:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var u=n(3912),l=n(8474),d=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var a,o=(a=e)&&a instanceof r.Lv||function(e){return e&&(0,l.m)(e.next)&&(0,l.m)(e.error)&&(0,l.m)(e.complete)}(a)&&(0,i.Nn)(a)?e:new r.Hp(e,t,n);if(u.v.useDeprecatedSynchronousErrorHandling)this._deprecatedSyncErrorSubscribe(o);else{var s=this.operator,d=this.source;o.add(s?s.call(o,d):d?this._subscribe(o):this._trySubscribe(o))}return o},e.prototype._deprecatedSyncErrorSubscribe=function(e){var t=e;t._syncErrorHack_isSubscribing=!0;var n=this.operator;if(n)e.add(n.call(e,this.source));else try{e.add(this._subscribe(e))}catch(e){t.__syncError=e}for(var r=t;r;){if("__syncError"in r)try{throw r.__syncError}finally{e.unsubscribe()}r=r.destination}t._syncErrorHack_isSubscribing=!1},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=c(t))((function(t,r){var i;i=n.subscribe((function(t){try{e(t)}catch(e){r(e),null==i||i.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[a.L]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=t.hasError,r=t.isStopped,i=t.observers;return n||r?a.Lc:(i.push(e),new a.w0((function(){return(0,s.P)(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new i.y;return e.source=this,e},t.create=function(e,t){return new l(e,t)},t}(i.y),l=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return(0,r.ZT)(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:a.Lc},t}(u)},6267:function(e,t,n){"use strict";n.d(t,{Hp:function(){return p},Lv:function(){return f}});var r=n(5987),i=n(8474),a=n(5720),o=n(3912),s=n(5),u=n(2967),l=d("C",void 0,void 0);function d(e,t,n){return{kind:e,value:t,error:n}}var c=n(8380),f=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,(0,a.Nn)(t)&&t.add(n)):n.destination=g,n}return(0,r.ZT)(t,e),t.create=function(e,t,n){return new p(e,t,n)},t.prototype.next=function(e){this.isStopped?m(function(e){return d("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?m(d("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?m(l,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(a.w0),p=function(e){function t(t,n,r){var a,s=e.call(this)||this;if((0,i.m)(t))a=t;else if(t){var l;a=t.next,n=t.error,r=t.complete,s&&o.v.useDeprecatedNextContext?(l=Object.create(t)).unsubscribe=function(){return s.unsubscribe()}:l=t,a=null==a?void 0:a.bind(l),n=null==n?void 0:n.bind(l),r=null==r?void 0:r.bind(l)}return s.destination={next:a?v(a,s):u.Z,error:v(null!=n?n:h,s),complete:r?v(r,s):u.Z},s}return(0,r.ZT)(t,e),t}(f);function v(e,t){return function(){for(var n=[],i=0;i=2,!0))}},5583:function(e,t,n){"use strict";n.d(t,{B:function(){return l}});var r=n(5987),i=n(1973),a=n(4727),o=n(6716),s=n(6267),u=n(6798);function l(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new o.x}:t,r=e.resetOnError,a=void 0===r||r,l=e.resetOnComplete,c=void 0===l||l,f=e.resetOnRefCountZero,p=void 0===f||f;return function(e){var t=null,r=null,o=null,l=0,f=!1,v=!1,h=function(){null==r||r.unsubscribe(),r=null},m=function(){h(),t=o=null,f=v=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return(0,u.e)((function(e,u){l++,v||f||h();var y=o=null!=o?o:n();u.add((function(){0!==--l||v||f||(r=d(g,p))})),y.subscribe(u),t||(t=new s.Hp({next:function(e){return y.next(e)},error:function(e){v=!0,h(),r=d(m,a,e),y.error(e)},complete:function(){f=!0,h(),r=d(m,c),y.complete()}}),(0,i.Dp)(e).subscribe(t))}))(e)}}function d(e,t){for(var n=[],i=2;i0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function l(e,t){for(var n=0,r=t.length,i=e.length;n1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof d?Promise.resolve(n.value.v).then(u,l):c(a[0][2],n)}catch(e){c(a[0][3],e)}var n}function u(e){s("next",e)}function l(e){s("throw",e)}function c(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function f(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=s(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}Object.create}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";n.d(r,{default:function(){return wi}});var e=n(5991),t=n(1788),i=n(6716),a=n(3),o=n(5987),s=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return(0,o.ZT)(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(i.x),u=n(2817),l=n(1480),d=n(9917),c={connector:function(){return new i.x},resetOnDisconnect:!0};function f(e,t){void 0===t&&(t=c);var n=null,r=t.connector,i=t.resetOnDisconnect,a=void 0===i||i,o=r(),s=new l.y((function(e){return o.subscribe(e)}));return s.connect=function(){return n&&!n.closed||(n=(0,d.P)((function(){return e})).subscribe(o),a&&n.add((function(){return o=r()}))),n},s}var p=n(2334),v=n(6362),h=n(3071),m=n(1545),g=n(3505),y=n(9127),_=n(3741),b=n(3994),T=n(8515),E=n(4975),w=n(5583),S=n(8430),k=n(4727),A=n(3833),x=n(6798),I=n(2566);var Z=n(8550),M=n(8902),R=n(8719);function C(){if(P()){var e=document;"function"==typeof e.exitFullscreen?e.exitFullscreen():"function"==typeof e.msExitFullscreen?e.msExitFullscreen():"function"==typeof e.mozCancelFullScreen?e.mozCancelFullScreen():"function"==typeof e.webkitExitFullscreen&&e.webkitExitFullscreen()}}function P(){var e=document;return null!=e.fullscreenElement||null!=e.mozFullScreenElement||null!=e.webkitFullscreenElement||null!=e.msFullscreenElement}var N=n(3666),D=n(3887);function O(){var e,t;if(!N.vU)return!0;var n=function(){if(!N.vU)return D.Z.warn("Compat: Can't access Firefox version on no firefox browser."),null;var e=navigator.userAgent,t=/Firefox\/([0-9]+)\./.exec(e);if(null===t)return-1;var n=parseInt(t[1],10);return isNaN(n)?-1:n}();return null===n||n<67||void 0!==(null===(t=null===(e=HTMLVideoElement)||void 0===e?void 0:e.prototype)||void 0===t?void 0:t.requirePictureInPicture)}var L=n(944),B=n(3714),U=n(9822),F=n(5389);function z(e,t){var n=t.defaultCode,r=t.defaultReason;if((0,U.Z)(e))return e;var i=e instanceof Error?e.toString():r;return new F.Z(n,i)}var K=n(5992),V=n(7874),G=n(1989),H=n(4791),W=n(1959),$=n(1946),Y=n(8894),q=n(8026),X=n(9589),j=n(2829),Q=n(8806),J=n(6139),ee=n(6033);function te(e){return(0,d.P)((function(){var t=ee.Z.getState(e);if(null===t)return(0,u.of)(null);D.Z.info("EME: Disposing of the current MediaKeys");var n=t.loadedSessionsStore;return ee.Z.clearState(e),n.closeAllSessions().pipe((0,M.j)((0,J.Y)(e,null)))}))}function ne(e){var t=ee.Z.getState(e);return null==t?null:t.keySystemOptions.type}var re=n(533);function ie(e){return(0,d.P)((function(){if(D.Z.info("EME: Clearing-up EME session."),N.fq)return D.Z.info("EME: disposing current MediaKeys."),te(e).pipe((0,re.l)());var t=ee.Z.getState(e);return null!==t&&!0===t.keySystemOptions.closeSessionsOnStop?(D.Z.info("EME: closing all current sessions."),t.loadedSessionsStore.closeAllSessions().pipe((0,re.l)())):(D.Z.info("EME: Nothing to clear. Returning right away. No state =",null===t),m.E)}))}var ae=n(9878);function oe(e){return(0,x.e)((function(t,n){try{t.subscribe(n)}finally{n.add(e)}}))}var se=n(5561),ue=n(2793),le=n(9105),de=n(9362);function ce(e){return e instanceof le.Z?new de.Z("PIPELINE_LOAD_ERROR",e):z(e,{defaultCode:"PIPELINE_LOAD_ERROR",defaultReason:"Unknown error when fetching the Manifest"})}var fe=n(6625);var pe,ve=n(7839),he=n(2572);function me(e){return e instanceof le.Z?e.type===K.br.ERROR_EVENT&&!1===navigator.onLine:e instanceof ve.Z&&e.isOfflineError}function ge(e,t,n){var r=n.baseDelay,i=n.maxDelay,a=n.maxRetryRegular,o=n.maxRetryOffline,s=0,u=pe.None,l=e.slice();return 0===l.length?(D.Z.warn("Fetchers: no URL given to `tryURLsWithBackoff`."),m.E):function e(n,d){return t(n).pipe((0,y.U)((function(e){return{type:"response",value:e}})),(0,ae.K)((function(t){if(!function(e){return e instanceof le.Z?e.type===K.br.ERROR_HTTP_CODE?e.status>=500||404===e.status||415===e.status||412===e.status:e.type===K.br.TIMEOUT||e.type===K.br.ERROR_EVENT:e instanceof ve.Z?"boolean"==typeof e.canRetry?e.canRetry:void 0!==e.xhr&&(e.xhr.status>=500||404===e.xhr.status||415===e.xhr.status||412===e.xhr.status):(0,U.Z)(e)&&"INTEGRITY_ERROR"===e.code}(t)){if(l.length<=1)throw t;l.splice(d,1);var n=d>=l.length-1?0:d;return e(l[n],n).pipe((0,S.O)({type:"retry",value:t}))}var c=function(e){return me(e)?pe.Offline:pe.Regular}(t),f=c===pe.Offline?o:a;if(c!==u&&(s=0,u=c),df)throw t;var v=Math.min(r*Math.pow(2,s-1),i),h=(0,he.Z)(v),m=l[0];return(0,fe.H)(h).pipe((0,b.z)((function(){return e(m,0)})),(0,S.O)({type:"retry",value:t}))})))}(l[0],0)}function ye(e,t){return ge([null],(function(){return e}),t)}!function(e){e[e.None=0]="None",e[e.Regular=1]="Regular",e[e.Offline=2]="Offline"}(pe||(pe={}));var _e=L.Z.DEFAULT_MAX_MANIFEST_REQUEST_RETRY,be=L.Z.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,Te=L.Z.INITIAL_BACKOFF_DELAY_BASE,Ee=L.Z.MAX_BACKOFF_DELAY_BASE;var we=function(){function e(e,t,n){var r,i,a,o;this._manifestUrl=e,this._pipelines=t.manifest,this._backoffOptions=(i=(r=n).maxRetryRegular,a=r.maxRetryOffline,{baseDelay:(o=r.lowLatencyMode)?Te.LOW_LATENCY:Te.REGULAR,maxDelay:o?Ee.LOW_LATENCY:Ee.REGULAR,maxRetryRegular:void 0!==i?i:_e,maxRetryOffline:void 0!==a?a:be})}var t=e.prototype;return t.fetch=function(e){var t,n=this,r=null!=e?e:this._manifestUrl,i=null!==(t=this._pipelines.resolver)&&void 0!==t?t:u.of,a=this._pipelines.loader;return(0,se.Z)(i,{url:r}).pipe((0,ae.K)((function(e){throw ce(e)})),(0,b.z)((function(e){return ye((0,se.Z)(a,e),n._backoffOptions).pipe((0,ae.K)((function(e){throw ce(e)})),(0,y.U)((function(e){return"retry"===e.type?{type:"warning",value:ce(e.value)}:{type:"response",parse:function(t){return n._parseLoadedManifest(e.value.value,t)}}})))})))},t.parse=function(e,t){return this._parseLoadedManifest({responseData:e,size:void 0,duration:void 0},t)},t._parseLoadedManifest=function(e,t){var n,r,a=e.sendingTime,o=e.receivedTime,s=performance.now(),u=new i.x,l=(n=this._backoffOptions,r=u,function(e){return ye((0,se.Z)(e,void 0),n).pipe((0,ue.Z)((function(e){return"retry"===e.type?(r.next(ce(e.value)),null):e.value}),null),(0,ae.K)((function(e){throw ce(e)})))});return(0,h.T)(u.pipe((0,y.U)((function(e){return{type:"warning",value:e}}))),this._pipelines.parser({response:e,url:this._manifestUrl,externalClockOffset:t.externalClockOffset,previousManifest:t.previousManifest,scheduleRequest:l,unsafeMode:t.unsafeMode}).pipe((0,ae.K)((function(e){throw z(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"})})),(0,y.U)((function(e){if("warning"===e.type)return{type:"warning",value:z(e.value,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"})};var t=performance.now()-s;return D.Z.info("MF: Manifest parsed in "+t+"ms"),{type:"parsed",manifest:e.value.manifest,sendingTime:a,receivedTime:o,parsingTime:t}})),oe((function(){u.complete()}))))},e}(),Se=L.Z.DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR,ke=L.Z.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,Ae=L.Z.INITIAL_BACKOFF_DELAY_BASE,xe=L.Z.MAX_BACKOFF_DELAY_BASE;var Ie=n(5138),Ze=function(){function e(e){var t=e.prioritySteps;if(this._minPendingPriority=null,this._waitingQueue=[],this._pendingTasks=[],this._prioritySteps=t,this._prioritySteps.high>=this._prioritySteps.low)throw new Error("FP Error: the max high level priority should be given a lowerpriority number than the min low priority.")}var t=e.prototype;return t.create=function(e,t){var n=this,r=new l.y((function(i){var a,o=!0;return a={observable:r,priority:t,trigger:function(t){null!==a.subscription&&(a.subscription.unsubscribe(),a.subscription=null,o&&i.next({type:"interrupted"})),t&&(n._minPendingPriority=null===n._minPendingPriority?a.priority:Math.min(n._minPendingPriority,a.priority),n._pendingTasks.push(a),a.subscription=e.subscribe({next:function(e){return i.next({type:"data",value:e})},error:function(e){i.error(e),a.subscription=null,a.finished=!0,n._onTaskEnd(a)},complete:function(){i.next({type:"ended"}),o&&i.complete(),a.subscription=null,a.finished=!0,n._onTaskEnd(a)}}))},subscription:null,finished:!1},n._canBeStartedNow(a)?(a.trigger(!0),n._isRunningHighPriorityTasks()&&n._interruptCancellableTasks()):n._waitingQueue.push(a),function(){if(o=!1,null!==a.subscription&&(a.subscription.unsubscribe(),a.subscription=null),!a.finished){var e=(0,Ie.Z)(n._waitingQueue,(function(e){return e.observable===r}));if(e>=0)n._waitingQueue.splice(e,1);else{var t=(0,Ie.Z)(n._pendingTasks,(function(e){return e.observable===r}));if(t<0)return void D.Z.warn("FP: unsubscribing non-existent task");var i=n._pendingTasks.splice(t,1)[0];0===n._pendingTasks.length?(n._minPendingPriority=null,n._loopThroughWaitingQueue()):n._minPendingPriority===i.priority&&(n._minPendingPriority=Math.min.apply(Math,n._pendingTasks.map((function(e){return e.priority}))),n._loopThroughWaitingQueue())}}}}));return r},t.updatePriority=function(e,t){var n=(0,Ie.Z)(this._waitingQueue,(function(t){return t.observable===e}));if(n>=0){var r=this._waitingQueue[n];if(r.priority===t)return;if(r.priority=t,!this._canBeStartedNow(r))return;return this._startWaitingQueueTask(n),void(this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks())}var i=(0,Ie.Z)(this._pendingTasks,(function(t){return t.observable===e}));if(i<0)D.Z.warn("FP: request to update the priority of a non-existent task");else{var a=this._pendingTasks[i];if(a.priority!==t){var o=a.priority;if(a.priority=t,null===this._minPendingPriority||tt.priority?t.priority:e}),null);if(!(null===e||null!==this._minPendingPriority&&this._minPendingPriority=this._prioritySteps.low)return this._interruptPendingTask(t),this._interruptCancellableTasks()}},t._startWaitingQueueTask=function(e){this._waitingQueue.splice(e,1)[0].trigger(!0)},t._interruptPendingTask=function(e){var t=(0,Ie.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0?D.Z.warn("FP: Interrupting a non-existent pending task. Aborting..."):(this._pendingTasks.splice(t,1),this._waitingQueue.push(e),0===this._pendingTasks.length?this._minPendingPriority=null:this._minPendingPriority===e.priority&&(this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority})))),e.trigger(!1))},t._onTaskEnd=function(e){var t=(0,Ie.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0||(this._pendingTasks.splice(t,1),this._pendingTasks.length>0?this._minPendingPriority===e.priority&&(this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority})))):(this._minPendingPriority=null,this._loopThroughWaitingQueue()))},t._canBeStartedNow=function(e){return null===this._minPendingPriority||e.priority<=this._minPendingPriority},t._isRunningHighPriorityTasks=function(){return null!==this._minPendingPriority&&this._minPendingPriority<=this._prioritySteps.high},e}(),Me=n(2006),Re=n(7714),Ce=n(8418),Pe=n(908),Ne=function(){function e(){this._cache=new WeakMap}var t=e.prototype;return t.add=function(e,t){var n=e.representation;e.segment.isInit&&this._cache.set(n,t)},t.get=function(e){var t=e.representation;if(e.segment.isInit){var n=this._cache.get(t);if(void 0!==n)return n}return null},e}(),De=n(8117);function Oe(e,t,n){return function(r){return function(r){function i(){var i;return ge(null!==(i=r.segment.mediaURLs)&&void 0!==i?i:[null],(function(t){var n=(0,q.Z)({url:t},r);return(0,v.z)((0,u.of)({type:"request",value:n}),(0,se.Z)(e,n))}),n).pipe((0,ae.K)((function(e){throw ce(e)})),(0,y.U)((function(e){if("retry"===e.type)return{type:"warning",value:ce(e.value)};if("request"===e.value.type)return e.value;var n=e.value;return"data-loaded"===n.type&&null!=t&&t.add(r,n.value),e.value})))}var a=null!=t?t.get(r):null;return null!=a?(0,De.Z)(a).pipe((0,y.U)((function(e){return{type:"cache",value:e}})),(0,ae.K)(i)):i()}(r).pipe((0,b.z)((function(e){var t;switch(t="data-chunk-complete"!==e.type&&"data-loaded"!==e.type||void 0===e.value.size||void 0===e.value.duration?m.E:(0,u.of)({type:"metrics",value:{size:e.value.size,duration:e.value.duration,content:r}}),e.type){case"warning":case"request":case"progress":return(0,u.of)(e);case"cache":case"data-created":case"data-loaded":return(0,v.z)((0,u.of)({type:"data",value:e.value}),t);case"data-chunk":return(0,u.of)({type:"chunk",value:e.value});case"data-chunk-complete":return(0,v.z)((0,u.of)({type:"chunk-complete",value:null}),t);default:(0,Ce.Z)(e)}})))}}var Le=(0,Pe.Z)();var Be=L.Z.MIN_CANCELABLE_PRIORITY,Ue=L.Z.MAX_HIGH_PRIORITY_LEVEL,Fe=function(){function e(e,t){this._transport=e,this._prioritizer=new Ze({prioritySteps:{high:Ue,low:Be}}),this._backoffOptions=t}return e.prototype.createSegmentFetcher=function(e,t){var n,r,i,a=function(e,t){var n=t.maxRetryRegular,r=t.maxRetryOffline,i=t.lowLatencyMode;return{maxRetryRegular:"image"===e?0:null!=n?n:Se,maxRetryOffline:null!=r?r:ke,baseDelay:i?Ae.LOW_LATENCY:Ae.REGULAR,maxDelay:i?xe.LOW_LATENCY:xe.REGULAR}}(e,this._backoffOptions),o=function(e,t,n,r){var i=(0,Re.Z)(["audio","video"],e)?new Ne:void 0,a=Oe(t[e].loader,i,r),o=t[e].parser;return function(e){var t=Le(),r=!1;return a(e).pipe((0,Me.b)((function(e){switch(e.type){case"metrics":n.next(e);break;case"request":var i=e.value.segment;if(void 0===i)return;r=!0,n.next({type:"requestBegin",value:{duration:i.duration,time:i.time,requestTimestamp:performance.now(),id:t}});break;case"progress":var a=e.value;null!=a.totalSize&&a.size1){var l=n[u],d=function(){for(var e=u+1;el)return e}();if(null!=d&&r>=n[d])return t[d]}if((null==s||s<1.15)&&r=0;c--)if(t[c]t&&t-e.time>-1.2}));if(n<0)return[];for(var r=e[n],i=r.time,a=[r],o=n+1;o0?l.progress[l.progress.length-1]:void 0,p=pt(l);if(void 0!==f&&void 0!==p){var v=vt(f,p);if((c-f.timestamp)/1e3<=v)if(v-s/a>2e3)return p}var h=(c-l.requestTimestamp)/1e3;if(null!=n&&!(h<=(1.5*d+2)/a)){var m=d/h,g=n.bitrate*Math.min(.7,m);return void 0===r||g=s.outOfStarvationGap&&(D.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1):this._inStarvationMode&&(D.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1),this._inStarvationMode&&null!=(o=ht(r,e,n,i))&&(D.Z.info("ABR: starvation mode emergency estimate:",o),t.reset(),a=null==n?o:Math.min(o,n.bitrate)),null==a&&(a=null!=(o=t.getEstimate())?o*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):null!=i?i*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):this._initialBitrate),e.speed>1&&(a/=e.speed),{bandwidthEstimate:o,bitrateChosen:a}},t.isUrgent=function(e,t,n,r){return null===t||e!==t.bitrate&&(e>t.bitrate?!this._inStarvationMode:function(e,t){var n=isFinite(e.bufferGap)?e.bufferGap:0,r=e.position+n,i=(0,st.Z)(t,(function(e){return e.duration>0&&e.time+e.duration>r}));if(void 0===i)return!0;var a=performance.now(),o=i.progress.length>0?i.progress[i.progress.length-1]:void 0,s=pt(i);if(void 0===o||void 0===s)return!0;var u=vt(o,s);return(a-o.timestamp)/1e3>1.2*u||u-n/e.speed>-1.5}(r,n))},e}(),gt=n(1679),yt=function(){function e(){this._currentRequests={}}var t=e.prototype;return t.add=function(e){var t=e.id,n=e.time,r=e.duration,i=e.requestTimestamp;this._currentRequests[t]={time:n,duration:r,requestTimestamp:i,progress:[]}},t.addProgress=function(e){var t=this._currentRequests[e.id];null!=t?t.progress.push(e):D.Z.warn("ABR: progress for a request not added")},t.remove=function(e){null==this._currentRequests[e]&&D.Z.warn("ABR: can't remove unknown request"),delete this._currentRequests[e]},t.getRequests=function(){return(0,gt.Z)(this._currentRequests).filter((function(e){return null!=e})).sort((function(e,t){return e.time-t.time}))},e}(),_t=function(){function e(){this._currentRepresentationData=null,this._lastRepresentationWithGoodScore=null}var t=e.prototype;return t.addSample=function(e,t,n){var r,i=n/t,a=this._getEWMA(e);null!=a?(r=a,a.addSample(t,i)):((r=new $e(5)).addSample(t,i),this._currentRepresentationData={representation:e,ewma:r}),r.getEstimate()>1&&this._lastRepresentationWithGoodScore!==e&&(D.Z.debug("ABR: New last stable representation",e),this._lastRepresentationWithGoodScore=e)},t.getEstimate=function(e){var t=this._getEWMA(e);if(null!=t)return t.getEstimate()},t.getLastStableRepresentation=function(){return this._lastRepresentationWithGoodScore},t._getEWMA=function(e){return null!=this._currentRepresentationData&&this._currentRepresentationData.representation.id===e.id?this._currentRepresentationData.ewma:null},e}();function bt(e,t,n,r){var i=t<=n?n:t>=r?r:t,a=(0,Ie.Z)(e,(function(e){return e.bitrate>i}));return-1===a?e[e.length-1]:0===a?e[0]:e[a-1]}function Tt(e,t){var n=e;return null!=t.bitrate&&(n=function(e,t){if(0===e.length)return[];e.sort((function(e,t){return e.bitrate-t.bitrate}));var n=e[0].bitrate,r=Math.max(t,n),i=(0,Ie.Z)(e,(function(e){return e.bitrate>r}));return-1===i?e:e.slice(0,i)}(n,t.bitrate)),null!=t.width&&(n=function(e,t){var n=e.slice().sort((function(e,t){return(0,We.Z)(e.width,0)-(0,We.Z)(t.width,0)})),r=(0,st.Z)(n,(function(e){return"number"==typeof e.width&&e.width>=t}));if(void 0===r)return e;var i="number"==typeof r.width?r.width:0;return e.filter((function(e){return"number"!=typeof e.width||e.width<=i}))}(n,t.width)),n}function Et(e){var t=e.bandwidthEstimator,n=e.clock$,r=e.filters$,i=e.initialBitrate,a=e.lowLatencyMode,o=e.manualBitrate$,s=e.minAutoBitrate$,l=e.maxAutoBitrate$,c=e.representations,f=e.streamEvents$,v=new _t,m=new mt(null==i?0:i,a),g=new yt,_=ot();var b=f.pipe((0,E.h)((function(e){return"metrics"===e.type})),(0,Me.b)((function(e){return function(e){var n=e.duration,r=e.size,i=e.content;if(!_(i,n)){t.addSample(n,r);var a=n/1e3,o=i.segment.duration,s=i.representation;v.addSample(s,a,o)}}(e.value)})),(0,re.l)()),T=f.pipe((0,Me.b)((function(e){switch(e.type){case"requestBegin":g.add(e.value);break;case"requestEnd":g.remove(e.value.id);break;case"progress":g.addProgress(e.value)}})),(0,re.l)()),w=f.pipe((0,E.h)((function(e){return"representationChange"===e.type})),(0,y.U)((function(e){return e.value.representation})),(0,S.O)(null)),k=(0,d.P)((function(){if(0===c.length)throw new Error("ABRManager: no representation choice given");return 1===c.length?(0,u.of)({bitrate:void 0,representation:c[0],manual:!1,urgent:!0,knownStableBitrate:void 0}):o.pipe((0,Ge.w)((function(e){if(e>=0){var i=bt(c,e,0,1/0);return(0,u.of)({representation:i,bitrate:void 0,knownStableBitrate:void 0,manual:!0,urgent:!0})}var a,o=!0,d=it(f.pipe((0,E.h)((function(e){return"added-segment"===e.type})),nt(n),(0,y.U)((function(e){var t=e[0].value,n=e[1],r=n.speed,i=n.position,a=t.buffered,o=(0,j.L7)(a,i),s=t.content.representation,u=v.getEstimate(s);return{bufferGap:o,currentBitrate:s.bitrate,currentScore:u,speed:r}}))),c.map((function(e){return e.bitrate}))).pipe((0,S.O)(void 0));return(0,p.a)([n,s,l,r,d]).pipe(nt(w),(0,y.U)((function(e){var n=e[0],r=n[0],i=n[1],s=n[2],u=n[3],l=n[4],d=e[1],f=Tt(c,u),p=g.getRequests(),h=m.getBandwidthEstimate(r,t,d,p,a),y=h.bandwidthEstimate,_=h.bitrateChosen;a=y;var b=v.getLastStableRepresentation(),T=null==b?void 0:b.bitrate/(r.speed>0?r.speed:1),E=r.bufferGap;!o&&E<=5?o=!0:o&&isFinite(E)&&E>10&&(o=!1);var w=bt(f,_,i,s);if(o)return D.Z.debug("ABR: Choosing representation with bandwidth estimation.",w),{bitrate:y,representation:w,urgent:m.isUrgent(w.bitrate,d,p,r),manual:!1,knownStableBitrate:T};if(null==l||w.bitrate>=l)return D.Z.debug("ABR: Choosing representation with bandwidth estimation.",w),{bitrate:y,representation:w,urgent:m.isUrgent(w.bitrate,d,p,r),manual:!1,knownStableBitrate:T};var S=bt(f,l,i,s);return l<=s&&D.Z.debug("ABR: Choosing representation with buffer based bitrate ceiling.",S),{bitrate:y,representation:S,urgent:m.isUrgent(l,d,p,r),manual:!1,knownStableBitrate:T}})))})))}));return(0,h.T)(b,T,k)}var wt=function(){function e(e){this._manualBitrates=e.manualBitrates,this._minAutoBitrates=e.minAutoBitrates,this._maxAutoBitrates=e.maxAutoBitrates,this._initialBitrates=e.initialBitrates,this._throttlers=e.throttlers,this._bandwidthEstimators={},this._lowLatencyMode=e.lowLatencyMode}var t=e.prototype;return t.get$=function(e,t,n,r){var i,a,o,s,l=this._getBandwidthEstimator(e),d=(0,We.Z)(this._manualBitrates[e],(0,u.of)(-1)),c=(0,We.Z)(this._minAutoBitrates[e],(0,u.of)(0)),f=(0,We.Z)(this._maxAutoBitrates[e],(0,u.of)(1/0)),v=(0,We.Z)(this._initialBitrates[e],0);return Et({bandwidthEstimator:l,streamEvents$:r,clock$:n,filters$:(i=this._throttlers.limitWidth[e],a=this._throttlers.throttleBitrate[e],o=this._throttlers.throttle[e],s=[],null!=i&&s.push(i.pipe((0,y.U)((function(e){return{width:e}})))),null!=o&&s.push(o.pipe((0,y.U)((function(e){return{bitrate:e}})))),null!=a&&s.push(a.pipe((0,y.U)((function(e){return{bitrate:e}})))),s.length>0?(0,p.a)(s).pipe((0,y.U)((function(e){return q.Z.apply(void 0,[{}].concat(e))}))):(0,u.of)({})),initialBitrate:v,manualBitrate$:d,minAutoBitrate$:c,maxAutoBitrate$:f,representations:t,lowLatencyMode:this._lowLatencyMode})},t._getBandwidthEstimator=function(e){var t=this._bandwidthEstimators[e];if(null==t){D.Z.debug("ABR: Creating new BandwidthEstimator for ",e);var n=new Qe;return this._bandwidthEstimators[e]=n,n}return t},e}(),St=n(4507),kt=n(5767),At=n(3774),xt=n(6923),It=R.ym;function Zt(e,t,n){if(null!==t&&"closed"!==t.readyState){for(var r=t.readyState,i=t.sourceBuffers,a=i.length-1;a>=0;a--){var o=i[a];try{"open"===r&&(D.Z.info("Init: Removing SourceBuffer from mediaSource",o),o.abort()),t.removeSourceBuffer(o)}catch(e){D.Z.warn("Init: Error while disposing SourceBuffer",e)}}i.length>0&&D.Z.warn("Init: Not all SourceBuffers could have been removed.")}if((0,kt.Z)(e),null!==n)try{D.Z.debug("Init: Revoking previous URL"),URL.revokeObjectURL(n)}catch(e){D.Z.warn("Init: Error while revoking the media source URL",e)}}function Mt(e){return function(e){return new l.y((function(t){if(null==At.JJ)throw new B.Z("MEDIA_SOURCE_NOT_SUPPORTED","No MediaSource Object was found in the current browser.");var n=(0,xt.Z)(e.src)?e.src:null;Zt(e,null,n),D.Z.info("Init: Creating MediaSource");var r=new At.JJ,i=URL.createObjectURL(r);return D.Z.info("Init: Attaching MediaSource URL to the media element",i),e.src=i,t.next(r),function(){Zt(e,r,i)}}))}(e).pipe((0,b.z)((function(e){return It(e).pipe((0,k.q)(1),(0,A.h)(e))})))}var Rt=n(8343),Ct=L.Z.DEFAULT_LIVE_GAP;var Pt=n(3610),Nt=n(6697),Dt=n(2401);var Ot=n(6968),Lt=n(2870),Bt=n(4123),Ut=L.Z.SOURCE_BUFFER_FLUSHING_INTERVAL,Ft=function(e){function n(t,n,r){var a;a=e.call(this)||this;var o=r.addSourceBuffer(n);return a._destroy$=new i.x,a.bufferType=t,a._mediaSource=r,a._sourceBuffer=o,a._queue=[],a._pendingTask=null,a._lastInitSegment=null,a.codec=n,(0,Nt.F)(Ut).pipe((0,Me.b)((function(){return a._flush()})),(0,g.R)(a._destroy$)).subscribe(),(0,Dt.R)(a._sourceBuffer,"error").pipe((0,Me.b)((function(e){return a._onPendingTaskError(e)})),(0,g.R)(a._destroy$)).subscribe(),(0,Dt.R)(a._sourceBuffer,"updateend").pipe((0,Me.b)((function(){return a._flush()})),(0,g.R)(a._destroy$)).subscribe(),a}(0,t.Z)(n,e);var r=n.prototype;return r.pushChunk=function(e){return D.Z.debug("AVSB: receiving order to push data to the SourceBuffer",this.bufferType,e),this._addToQueue({type:Bt.f.Push,value:e})},r.removeBuffer=function(e,t){return D.Z.debug("AVSB: receiving order to remove data from the SourceBuffer",this.bufferType,e,t),this._addToQueue({type:Bt.f.Remove,value:{start:e,end:t}})},r.endOfSegment=function(e){return D.Z.debug("AVSB: receiving order for validating end of segment",this.bufferType,e.segment),this._addToQueue({type:Bt.f.EndOfSegment,value:e})},r.getBufferedRanges=function(){return this._sourceBuffer.buffered},r.getPendingOperations=function(){var e=function(e){switch(e.type){case Bt.f.Push:case Bt.f.Remove:case Bt.f.EndOfSegment:return{type:e.type,value:e.value}}},t=this._queue.map(e);return null===this._pendingTask?t:[e(this._pendingTask)].concat(t)},r.dispose=function(){for(this._destroy$.next(),this._destroy$.complete(),null!==this._pendingTask&&(this._pendingTask.subject.complete(),this._pendingTask=null);this._queue.length>0;){var e=this._queue.shift();void 0!==e&&e.subject.complete()}if("open"===this._mediaSource.readyState)try{this._sourceBuffer.abort()}catch(e){D.Z.warn("AVSB: Failed to abort a "+this.bufferType+" SourceBuffer:",e)}},r._onPendingTaskError=function(e){if(this._lastInitSegment=null,null!==this._pendingTask){var t=e instanceof Error?e:new Error("An unknown error occured when doing operations on the SourceBuffer");this._pendingTask.subject.error(t)}},r._addToQueue=function(e){var t=this;return new l.y((function(n){var r=0===t._queue.length&&null===t._pendingTask,a=new i.x,o=(0,q.Z)({subject:a},e);t._queue.push(o);var s=a.subscribe(n);return r&&t._flush(),function(){s.unsubscribe();var e=t._queue.indexOf(o);e>=0&&t._queue.splice(e,1)}}))},r._flush=function(){if(!this._sourceBuffer.updating){if(null!==this._pendingTask){var e=this._pendingTask;if(e.type!==Bt.f.Push||0===e.data.length){switch(e.type){case Bt.f.Push:null!==e.inventoryData&&this._segmentInventory.insertChunk(e.inventoryData);break;case Bt.f.EndOfSegment:this._segmentInventory.completeSegment(e.value);break;case Bt.f.Remove:this.synchronizeInventory();break;default:(0,Ce.Z)(e)}var t=e.subject;return this._pendingTask=null,t.next(),t.complete(),void this._flush()}}else{var n=this._queue.shift();if(void 0===n)return;if(n.type!==Bt.f.Push)this._pendingTask=n;else{var r,i=n.value;try{r=this._preparePushOperation(i.data)}catch(e){this._pendingTask=(0,q.Z)({data:[],inventoryData:i.inventoryInfos},n);var a=e instanceof Error?e:new Error("An unknown error occured when preparing a push operation");return this._lastInitSegment=null,void n.subject.error(a)}this._pendingTask=(0,q.Z)({data:r,inventoryData:i.inventoryInfos},n)}}try{switch(this._pendingTask.type){case Bt.f.EndOfSegment:return D.Z.debug("AVSB: Acknowledging complete segment",this._pendingTask.value),void this._flush();case Bt.f.Push:var o=this._pendingTask.data.shift();if(void 0===o)return void this._flush();this._sourceBuffer.appendBuffer(o);break;case Bt.f.Remove:var s=this._pendingTask.value,u=s.start,l=s.end;D.Z.debug("AVSB: removing data from SourceBuffer",this.bufferType,u,l),this._sourceBuffer.remove(u,l);break;default:(0,Ce.Z)(this._pendingTask)}}catch(e){this._onPendingTaskError(e)}}},r._preparePushOperation=function(e){var t=[],n=e.codec,r=e.timestampOffset,i=e.appendWindow,a=!1;if(n!==this.codec&&(D.Z.debug("AVSB: updating codec",n),(a=function(e,t){if("function"==typeof e.changeType){try{e.changeType(t)}catch(e){return D.Z.warn("Could not call 'changeType' on the given SourceBuffer:",e),!1}return!0}return!1}(this._sourceBuffer,n))?this.codec=n:D.Z.debug("AVSB: could not update codec",n,this.codec)),this._sourceBuffer.timestampOffset!==r){var o=r;D.Z.debug("AVSB: updating timestampOffset",this.bufferType,this._sourceBuffer.timestampOffset,o),this._sourceBuffer.timestampOffset=o}if(void 0===i[0]?this._sourceBuffer.appendWindowStart>0&&(this._sourceBuffer.appendWindowStart=0):i[0]!==this._sourceBuffer.appendWindowStart&&(i[0]>=this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[0]+1),this._sourceBuffer.appendWindowStart=i[0]),void 0===i[1]?this._sourceBuffer.appendWindowEnd!==1/0&&(this._sourceBuffer.appendWindowEnd=1/0):i[1]!==this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[1]),null!==e.initSegment&&(a||!this._isLastInitSegment(e.initSegment))){var s=e.initSegment;t.push(s);var u=(0,Ot._f)(s);this._lastInitSegment={data:u,hash:(0,Lt.Z)(u)}}return null!==e.chunk&&t.push(e.chunk),t},r._isLastInitSegment=function(e){if(null===this._lastInitSegment)return!1;if(this._lastInitSegment.data===e)return!0;var t=this._lastInitSegment.data;if(t.byteLength===e.byteLength){var n=(0,Ot._f)(e);if((0,Lt.Z)(n)===this._lastInitSegment.hash&&(0,H.Z)(t,n))return!0}return!1},n}(Bt.C),zt=["audio","video","text","image"];function Kt(e){return"audio"===e||"video"===e}var Vt=function(){function e(e,t){this._mediaElement=e,this._mediaSource=t,this._initializedSegmentBuffers={},this._onNativeBufferAddedOrDisabled=[]}e.isNative=function(e){return Kt(e)};var t=e.prototype;return t.getBufferTypes=function(){var e=this.getNativeBufferTypes();return null==V.Z.nativeTextTracksBuffer&&null==V.Z.htmlTextTracksBuffer||e.push("text"),null!=V.Z.imageBuffer&&e.push("image"),e},t.getNativeBufferTypes=function(){return"AUDIO"===this._mediaElement.nodeName?["audio"]:["video","audio"]},t.getStatus=function(e){var t=this._initializedSegmentBuffers[e];return void 0===t?{type:"uninitialized"}:null===t?{type:"disabled"}:{type:"initialized",value:t}},t.waitForUsableBuffers=function(){var e=this;return this._areNativeBuffersUsable()?(0,u.of)(void 0):new l.y((function(t){e._onNativeBufferAddedOrDisabled.push((function(){e._areNativeBuffersUsable()&&(t.next(void 0),t.complete())}))}))},t.disableSegmentBuffer=function(t){var n=this._initializedSegmentBuffers[t];if(null!==n){if(void 0!==n)throw new Error("Cannot disable an active SegmentBuffer.");this._initializedSegmentBuffers[t]=null,e.isNative(t)&&this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()}))}else D.Z.warn("SBS: The "+t+" SegmentBuffer was already disabled.")},t.createSegmentBuffer=function(e,t,n){void 0===n&&(n={});var r,i=this._initializedSegmentBuffers[e];if(Kt(e)){if(null!=i)return i instanceof Ft&&i.codec!==t?D.Z.warn("SB: Reusing native SegmentBuffer with codec",i.codec,"for codec",t):D.Z.info("SB: Reusing native SegmentBuffer with codec",t),i;D.Z.info("SB: Adding native SegmentBuffer with codec",t);var a=new Ft(e,t,this._mediaSource);return this._initializedSegmentBuffers[e]=a,this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()})),a}if(null!=i)return D.Z.info("SB: Reusing a previous custom SegmentBuffer for the type",e),i;if("text"===e){if(D.Z.info("SB: Creating a new text SegmentBuffer"),"html"===n.textTrackMode){if(null==V.Z.htmlTextTracksBuffer)throw new Error("HTML Text track feature not activated");r=new V.Z.htmlTextTracksBuffer(this._mediaElement,n.textTrackElement)}else{if(null==V.Z.nativeTextTracksBuffer)throw new Error("Native Text track feature not activated");r=new V.Z.nativeTextTracksBuffer(this._mediaElement,!0===n.hideNativeSubtitle)}return this._initializedSegmentBuffers.text=r,r}if("image"===e){if(null==V.Z.imageBuffer)throw new Error("Image buffer feature not activated");return D.Z.info("SB: Creating a new image SegmentBuffer"),r=new V.Z.imageBuffer,this._initializedSegmentBuffers.image=r,r}throw D.Z.error("SB: Unknown buffer type:",e),new B.Z("BUFFER_TYPE_UNKNOWN","The player wants to create a SegmentBuffer of an unknown type.")},t.disposeSegmentBuffer=function(e){var t=this._initializedSegmentBuffers[e];null!=t?(D.Z.info("SB: Aborting SegmentBuffer",e),t.dispose(),delete this._initializedSegmentBuffers[e]):D.Z.warn("SB: Trying to dispose a SegmentBuffer that does not exist")},t.disposeAll=function(){var e=this;zt.forEach((function(t){"initialized"===e.getStatus(t).type&&e.disposeSegmentBuffer(t)}))},t._areNativeBuffersUsable=function(){var e=this,t=this.getNativeBufferTypes();return!t.some((function(t){return void 0===e._initializedSegmentBuffers[t]}))&&!t.every((function(t){return null===e._initializedSegmentBuffers[t]}))},e}(),Gt=function(){function e(e){this._array=[],this._sortingFn=e}var t=e.prototype;return t.add=function(){for(var e=arguments.length,t=new Array(e),n=0;n=this._array.length)throw new Error("Invalid index.");return this._array[e]},t.findFirst=function(e){return(0,st.Z)(this._array,e)},t.has=function(e){return(0,Re.Z)(this._array,e)},t.removeElement=function(e){var t=this._array.indexOf(e);if(t>=0)return this._array.splice(t,1),t},t.head=function(){return this._array[0]},t.last=function(){return this._array[this._array.length-1]},t.shift=function(){return this._array.shift()},t.pop=function(){return this._array.pop()},e}(),Ht=function(){function e(e){this._weakMap=new WeakMap,this._fn=e}var t=e.prototype;return t.get=function(e){var t=this._weakMap.get(e);if(void 0===t){var n=this._fn(e);return this._weakMap.set(e,n),n}return t},t.destroy=function(e){this._weakMap.delete(e)},e}(),Wt=n(9834);function $t(e){var t=e.segmentBuffer,n=e.clock$,r=e.maxBufferBehind$,i=e.maxBufferAhead$;return(0,p.a)([n,r,i]).pipe((0,b.z)((function(e){var n=e[0],r=e[1],i=e[2];return function(e,t,n,r){if(!isFinite(n)&&!isFinite(r))return m.E;var i=[],a=(0,j.F_)(e.getBufferedRanges(),t),o=a.innerRange,s=a.outerRanges,u=function(){if(isFinite(r)){for(var e=0;en.start&&i.push({start:t+r,end:n.end})}null!=o&&t+r=r.end?i.push(r):t>=r.end&&t-n>r.start&&t-no.start&&i.push({start:o.start,end:t-n})}}(),u(),(0,Ke.Dp)(i.map((function(t){return D.Z.debug("GC: cleaning range from SegmentBuffer",t),e.removeBuffer(t.start,t.end)}))).pipe((0,Wt.u)(),(0,re.l)())}(t,n,r,i)})))}var Yt={activePeriodChanged:function(e){return{type:"activePeriodChanged",value:{period:e}}},adaptationChange:function(e,t,n){return{type:"adaptationChange",value:{type:e,adaptation:t,period:n}}},addedSegment:function(e,t,n,r){return{type:"added-segment",value:{content:e,segment:t,segmentData:r,buffered:n}}},bitrateEstimationChange:function(e,t){return{type:"bitrateEstimationChange",value:{type:e,bitrate:t}}},streamComplete:function(e){return{type:"complete-stream",value:{type:e}}},endOfStream:function(){return{type:"end-of-stream",value:void 0}},needsManifestRefresh:function(){return{type:"needs-manifest-refresh",value:void 0}},manifestMightBeOufOfSync:function(){return{type:"manifest-might-be-out-of-sync",value:void 0}},needsMediaSourceReload:function(e,t,n){return{type:"needs-media-source-reload",value:{position:t,autoPlay:n,period:e}}},needsBufferFlush:function(){return{type:"needs-buffer-flush",value:void 0}},needsDecipherabilityFlush:function(e,t,n){return{type:"needs-decipherability-flush",value:{position:e,autoPlay:t,duration:n}}},periodStreamReady:function(e,t,n){return{type:"periodStreamReady",value:{type:e,period:t,adaptation$:n}}},periodStreamCleared:function(e,t){return{type:"periodStreamCleared",value:{type:e,period:t}}},encryptionDataEncountered:function(e){return{type:"encryption-data-encountered",value:e}},representationChange:function(e,t,n){return{type:"representationChange",value:{type:e,period:t,representation:n}}},streamTerminating:function(){return{type:"stream-terminating",value:void 0}},resumeStream:function(){return{type:"resume-stream",value:void 0}},warning:function(e){return{type:"warning",value:e}}},qt=n(7473),Xt=n.n(qt);function jt(e,t,n,r,i){var a=e.period,o=e.adaptation,s=e.representation,u=function(e,t){for(var n=0;n=t.end)return null;if(r.bufferedEnd>t.start)return n}return null}(i,t);if(null===u){if(null===n){if(r&&void 0!==a.end&&t.end>=a.end)return{start:void 0,end:null};var l=s.index.checkDiscontinuity(t.start);if(null!==l)return{start:void 0,end:l}}return null}var d=i[u];if(void 0!==d.bufferedStart&&d.bufferedStart>t.start&&(null===n||d.infos.segment.end<=n))return D.Z.debug("RS: current discontinuity encountered",o.type,d.bufferedStart),{start:void 0,end:d.bufferedStart};var c=function(e,t,n){if(n<=0)return D.Z.error("RS: Asked to check a discontinuity before the first chunk."),null;for(var r=n;r=t.end)return null;if(i.bufferedStart-a.bufferedEnd>0)return r}return null}(i,t,u+1);if(null!==c&&(null===n||i[c].infos.segment.end<=n)){var f=i[c-1].bufferedEnd,p=i[c].bufferedStart;return D.Z.debug("RS: future discontinuity encountered",o.type,f,p),{start:f,end:p}}if(null===n){if(r&&void 0!==a.end){if(t.end=0;n--){var r=e[n];if(void 0===r.bufferedStart)return null;if(r.bufferedStart=a.end)return null;for(var m=i.length-1;m>=0;m--){var g=i[m];if(void 0===g.bufferedStart)break;if(g.bufferedStart=n.length-1?null:n[t+1];return!function(e,t,n){if(void 0===e.bufferedStart)return D.Z.warn("Stream: Start of a segment unknown. Assuming it is garbage collected by default.",e),!0;if(null!==t&&void 0!==t.bufferedEnd&&e.bufferedStart-t.bufferedEnd<.1)return!1;if(ntn)return D.Z.info("Stream: The start of the wanted segment has been garbage collected",e),!0;return!1}(e,r,i.start)&&!function(e,t,n){if(void 0===e.bufferedEnd)return D.Z.warn("Stream: End of a segment unknown. Assuming it is garbage collected by default.",e),!0;if(null!==t&&void 0!==t.bufferedStart&&t.bufferedStart-e.bufferedEnd<.1)return!1;if(n>e.bufferedEnd&&e.end-e.bufferedEnd>tn)return D.Z.info("Stream: The end of the wanted segment has been garbage collected",e),!0;return!1}(e,a,i.end)}));return s.filter((function(e){var i=(0,q.Z)({segment:e},t);if(a.length>0&&a.some((function(e){return(0,Qt.Z)(i,e)})))return!1;var o=e.duration,s=e.time,l=e.end;if(e.isInit)return!0;if(o0&&a.some((function(e){if(e.period.id!==t.period.id||e.adaptation.id!==t.adaptation.id)return!1;var a=e.segment;return!(a.time-rn>s)&&(!(a.end+rn-rn&&f.end-l>-rn)return!1}}for(var p=0;ps)return v.start>s+rn||on(u,p).ende[n].start;)n++;return e[--n]}function sn(e,t,n,r){return e.period.id===t.period.id&&(!(e.segment.timei}return rr}(e.representation,t.representation,r)))}var un=L.Z.SEGMENT_PRIORITIES_STEPS;function ln(e,t){for(var n=e-(t.position+t.wantedTimeOffset),r=0;r=0;o--){var s=t[o],u=s.infos.representation;if(!s.partiallyPushed&&!1!==u.decipherable&&u.isSupported){var l=s.infos.segment,d=l.time/l.timescale;((null==l.duration?s.end:d+l.duration/l.timescale)>r&&dr&&s.start0)u=!1;else if(void 0===g)u=f.end>=o.end&&s.index.isFinished();else if(null===g)u=s.index.isFinished();else{var y=void 0!==o.end?Math.min(o.end,g):g;u=f.end>=y&&s.index.isFinished()}if(s.index.isInitialized()&&(s.index.areSegmentsChronologicallyGenerated()||u)){var _=null;v.length>0&&(_=Math.min.apply(Math,v.map((function(e){return e.segment.time})))),m.length>0&&(_=null!==_?Math.min(_,m[0].segment.time):m[0].segment.time),l=jt(e,f,_,u,h)}else l=null;return{imminentDiscontinuity:l,hasFinishedLoading:u,neededSegments:m,shouldRefreshManifest:p}}var fn=L.Z.BUFFER_GC_GAPS.CALM,pn=L.Z.BUFFER_GC_GAPS.BEEFY;function vn(e,t,n){for(var r=(0,j.F_)(t,e),i=r.innerRange,a=r.outerRanges,o=[],s=0;su.start)&&o.push(u)}return null!=i&&(D.Z.debug("Stream: GC removing part of inner range",o),e-n>i.start&&o.push({start:i.start,end:e-n}),e+n0&&null!==C&&null===P){var f=c[0].priority;c.unshift({segment:C,priority:f})}}else null===C?D.Z.warn("Stream: Uninitialized index without an initialization segment"):null!==P?D.Z.warn("Stream: Uninitialized index with an already loaded initialization segment"):c.unshift({segment:C,priority:ln(_.start,n)});var p=c[0];if(null!==i){if(N=[],i.urgent)return D.Z.debug("Stream: urgent termination request, terminate.",R),O.next(),O.complete(),(0,u.of)(Yt.streamTerminating());if(null===B||void 0===p||B.segment.id!==p.segment.id)return D.Z.debug("Stream: cancel request and terminate.",null===B,R),O.next(),O.complete(),(0,u.of)(Yt.streamTerminating());if(B.priority!==p.priority){var h=B.request$;B.priority=p.priority,l.updatePriority(h,p.priority)}D.Z.debug("Stream: terminate after request.",R)}else if(void 0===p)null!==B&&D.Z.debug("Stream: interrupt segment request.",R),N=[],O.next();else if(null===B)D.Z.debug("Stream: start downloading queue.",R),N=c,O.next();else if(B.segment.id!==p.segment.id)D.Z.debug("Stream: restart download queue.",R),N=c,O.next();else if(B.priority!==p.priority){D.Z.debug("Stream: update request priority.",R);var m=B.request$;B.priority=p.priority,l.updatePriority(m,p.priority)}else D.Z.debug("Stream: update downloading queue",R),N=c.slice().splice(1,c.length);var g=(0,u.of)({type:"stream-status",value:{period:_,position:n.position,bufferType:R,imminentDiscontinuity:d.imminentDiscontinuity,hasFinishedLoading:d.hasFinishedLoading,neededSegments:d.neededSegments}});return d.shouldRefreshManifest?(0,v.z)((0,u.of)(Yt.needsManifestRefresh()),g):g})),(t=function(e){return"stream-terminating"!==e.type},void 0===(n=!0)&&(n=!1),(0,x.e)((function(e,r){var i=0;e.subscribe(new I.Q(r,(function(e){var a=t(e,i++);(a||n)&&r.next(e),!a&&r.complete()})))})))),F=!1,z=m.E;if(void 0!==Z){var K=E.getEncryptionData(Z);K.length>0&&(z=u.of.apply(void 0,K.map((function(e){return Yt.encryptionDataEncountered(e)}))),F=!0)}var V=O.pipe((0,Ge.w)((function(){return N.length>0?(e=(0,d.P)((function(){var t=N.shift();if(void 0===t)return Xt()((function(){L.next()})),m.E;var n=t.segment,r=t.priority,i={manifest:g,period:_,adaptation:T,representation:E,segment:n},a=l.createRequest(i,r);return B={segment:n,priority:r,request$:a},a.pipe((0,b.z)((function(t){switch(t.type){case"warning":return(0,u.of)({type:"retry",value:{segment:n,error:t.value}});case"chunk-complete":return B=null,(0,u.of)({type:"end-of-segment",value:{segment:n}});case"interrupted":return D.Z.info("Stream: segment request interrupted temporarly.",n),m.E;case"chunk":var r=null==P?void 0:P.initTimescale;return t.parse(r).pipe((0,y.U)((function(e){return(0,q.Z)({segment:n},e)})));case"ended":return e;default:(0,Ce.Z)(t)}})))}))).pipe(oe((function(){B=null}))):m.E;var e})),(0,b.z)((function(e){var t;switch(e.type){case"retry":return(0,v.z)((0,u.of)({type:"warning",value:e.value.error}),(0,d.P)((function(){var t=e.value.segment,n=E.index;if(!1===n.isSegmentStillAvailable(t))L.next();else if(n.canBeOutOfSyncError(e.value.error,t))return(0,u.of)(Yt.manifestMightBeOufOfSync());return m.E})));case"parsed-init-segment":P=e.value;var n=E.getAllEncryptionData(),i=!F&&n.length>0?u.of.apply(void 0,n.map((function(e){return Yt.encryptionDataEncountered(e)}))):m.E,a=function(e){var t=e.clock$,n=e.content,r=e.segment,i=e.segmentData,a=e.segmentBuffer;return(0,d.P)((function(){if(null===i)return m.E;var e=n.representation.getMimeTypeString();return hn(t,a,{data:{initSegment:i,chunk:null,timestampOffset:0,appendWindow:[void 0,void 0],codec:e},inventoryInfos:null}).pipe((0,y.U)((function(){var e=a.getBufferedRanges();return Yt.addedSegment(n,r,e,i)})))}))}({clock$:r,content:o,segment:e.segment,segmentData:e.value.initializationData,segmentBuffer:s});return(0,h.T)(i,a);case"parsed-segment":var l=null!==(t=null==P?void 0:P.initializationData)&&void 0!==t?t:null,c=e.value,f=c.inbandEvents,p=c.needsManifestRefresh,g=e.value.protectionDataUpdate&&!F?u.of.apply(void 0,E.getAllEncryptionData().map((function(e){return Yt.encryptionDataEncountered(e)}))):m.E,_=!0===p?(0,u.of)(Yt.needsManifestRefresh()):m.E,b=void 0!==f&&f.length>0?(0,u.of)({type:"inband-events",value:f}):m.E;return(0,v.z)(g,_,b,function(e){var t=e.clock$,n=e.content,r=e.initSegmentData,i=e.parsedSegment,a=e.segment,o=e.segmentBuffer;return(0,d.P)((function(){var e,s;if(null===i.chunkData)return m.E;var u=i.chunkData,l=i.chunkInfos,d=i.chunkOffset,c=i.appendWindow,f=n.representation.getMimeTypeString(),p=[void 0!==c[0]?Math.max(0,c[0]-mn.START):void 0,void 0!==c[1]?c[1]+mn.END:void 0],v={initSegment:r,chunk:u,timestampOffset:d,appendWindow:p,codec:f},h=null!==(e=null==l?void 0:l.time)&&void 0!==e?e:a.time,g=h+(null!==(s=null==l?void 0:l.duration)&&void 0!==s?s:a.duration);void 0!==p[0]&&(h=Math.max(h,p[0])),void 0!==p[1]&&(g=Math.min(g,p[1]));var _=(0,q.Z)({segment:a,start:h,end:g},n);return hn(t,o,{data:v,inventoryInfos:_}).pipe((0,y.U)((function(){var e=o.getBufferedRanges();return Yt.addedSegment(n,a,e,u)})))}))}({clock$:r,content:o,initSegmentData:l,parsedSegment:e.value,segment:e.segment,segmentBuffer:s}));case"end-of-segment":var T=e.value.segment;return s.endOfSegment((0,q.Z)({segment:T},o)).pipe((0,re.l)());default:(0,Ce.Z)(e)}})));return(0,v.z)(z,(0,h.T)(U,V).pipe((0,w.B)()))};function yn(e,t,n){return t.pipe((0,k.q)(1),(0,b.z)((function(r){var i;if(e.start<=r.position&&(void 0===e.end||e.end>r.position)){var a=r.getCurrentTime()+n,o=Math.min(Math.max(e.start,a),null!==(i=e.end)&&void 0!==i?i:1/0);return(0,u.of)(Yt.needsMediaSourceReload(e,o,!r.isPaused))}return t.pipe((0,y.U)((function(t){return Yt.needsMediaSourceReload(e,t.getCurrentTime(),!t.isPaused)})))})))}var _n=L.Z.DELTA_POSITION_AFTER_RELOAD;var bn=function(e){var t=e.abrManager,n=e.clock$,r=e.content,a=e.options,o=e.segmentBuffer,l=e.segmentFetcherCreator,c=e.wantedBufferAhead$,f="direct"===a.manualBitrateSwitchingMode,p=r.manifest,g=r.period,T=r.adaptation,S={},A=function(e,t,n){var r=e.manifest,a=e.adaptation,o=new i.x,s=new i.x,l=(0,h.T)(o,s);return{estimator$:(0,h.T)((0,W.R)(r,"decipherabilityUpdate"),(0,u.of)(null)).pipe((0,y.U)((function(){var e=a.getPlayableRepresentations();if(e.length<=0)throw new B.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+a.type+" Adaptation can be played");return e})),(0,_.x)((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n=i.end&&(D.Z.debug('Stream: full "empty" AdaptationStream',n),a=!0),(0,u.of)({type:"stream-status",value:{period:i,bufferType:n,position:t.position,imminentDiscontinuity:null,hasFinishedLoading:a,neededSegments:[],shouldRefreshManifest:!1}})})))}var En=n(9252);var wn=function(e,t){var n=e.split(";"),r=n[0],i=n.slice(1),a=t.split(";"),o=a[0],s=a.slice(1);if(r!==o)return!1;var u=(0,st.Z)(i,(function(e){return(0,En.Z)(e,"codecs=")})),l=(0,st.Z)(s,(function(e){return(0,En.Z)(e,"codecs=")}));if(void 0===u||void 0===l)return!1;var d=u.substring(7),c=l.substring(7);return d.split(".")[0]===c.split(".")[0]},Sn=L.Z.ADAPTATION_SWITCH_BUFFER_PADDINGS;function kn(e,t,n,r,i){if(void 0!==e.codec&&"reload"===i.onCodecSwitch&&!function(e,t){return e.getPlayableRepresentations().some((function(e){return wn(e.getMimeTypeString(),t)}))}(n,e.codec))return{type:"needs-reload",value:void 0};var a=e.getBufferedRanges();if(0===a.length)return{type:"continue",value:void 0};var o=(0,j.JN)(a),s=t.start,u=null==t.end?1/0:t.end,l=(0,j.tn)(o,[{start:s,end:u}]);if(0===l.length)return{type:"continue",value:void 0};e.synchronizeInventory();var d=e.getInventory();if(!d.some((function(e){return e.infos.period.id===t.id&&e.infos.adaptation.id!==n.id})))return{type:"continue",value:void 0};var c=function(e,t,n){return e.reduce((function(e,r){if(r.infos.period.id!==t.id||r.infos.adaptation.id!==n.id)return e;var i=r.bufferedStart,a=r.bufferedEnd;return void 0===i||void 0===a||e.push({start:i,end:a}),e}),[])}(d,t,n),f=(0,j.uH)(l,c);if(0===f.length)return{type:"continue",value:void 0};var p=r.currentTime;if("video"===n.type&&(0,j.Ti)({start:s,end:u},p)&&(r.readyState>1||!n.getPlayableRepresentations().some((function(t){var n;return wn(t.getMimeTypeString(),null!==(n=e.codec)&&void 0!==n?n:"")})))&&!(0,j.A1)(c,p))return{type:"needs-reload",value:void 0};var v="audio"===n.type&&"direct"===i.audioTrackSwitchingMode,h=[],m=function(e,t){for(var n=0;n=t.start)return n>0?e[n-1]:null;return e.length>0?e[e.length-1]:null}(d,t);null!==m&&(void 0===m.bufferedEnd||t.start-m.bufferedEnd<1)&&h.push({start:0,end:t.start+1});var g=n.type,y=Sn[g].before;null==y&&(y=0);var _=Sn[g].after;if(null==_&&(_=0),v||h.push({start:p-y,end:p+_}),void 0!==t.end){var b=function(e,t){for(var n=0;nt.start)return e[n];return null}(d,t);null!==b&&(void 0===b.bufferedStart||b.bufferedStart-t.end<1)&&h.push({start:t.end-1,end:Number.MAX_VALUE})}var T=(0,j.uH)(f,h);return 0===T.length?{type:"continue",value:void 0}:v?{type:"flush-buffer",value:T}:{type:"clean-buffer",value:T}}var An=L.Z.DELTA_POSITION_AFTER_RELOAD;var xn=function(e){var t=e.abrManager,n=e.bufferType,r=e.clock$,i=e.content,o=e.garbageCollectors,s=e.segmentFetcherCreator,l=e.segmentBuffersStore,d=e.options,c=e.wantedBufferAhead$,f=i.period,p=new a.t(1);return p.pipe((0,Ge.w)((function(e,a){var p=0===a?0:"audio"===n?An.trackSwitch.audio:"video"===n?An.trackSwitch.video:An.trackSwitch.other;if(null===e){D.Z.info("Stream: Set no "+n+" Adaptation",f);var g,_=l.getStatus(n);if("initialized"===_.type){if(D.Z.info("Stream: Clearing previous "+n+" SegmentBuffer"),Vt.isNative(n))return yn(f,r,p);g=_.value.removeBuffer(f.start,null==f.end?1/0:f.end)}else"uninitialized"===_.type&&l.disableSegmentBuffer(n),g=(0,u.of)(null);return(0,v.z)(g.pipe((0,A.h)(Yt.adaptationChange(n,null,f))),Tn(r,c,n,{period:f}))}if(Vt.isNative(n)&&"disabled"===l.getStatus(n).type)return yn(f,r,p);D.Z.info("Stream: Updating "+n+" adaptation",e,f);var T=r.pipe((0,k.q)(1),(0,b.z)((function(a){var g=function(e,t,n,r){var i=e.getStatus(t);if("initialized"===i.type)return D.Z.info("Stream: Reusing a previous SegmentBuffer for the type",t),i.value;var a=function(e){var t=e.representations;if(null==t[0])return"";return t[0].getMimeTypeString()}(n),o="text"===t?r.textTrackOptions:void 0;return e.createSegmentBuffer(t,a,o)}(l,n,e,d),_={currentTime:a.getCurrentTime(),readyState:a.readyState},T=kn(g,f,e,_,d);if("needs-reload"===T.type)return yn(f,r,p);var E="flush-buffer"===T.type?(0,u.of)(Yt.needsBufferFlush()):m.E,w="clean-buffer"===T.type||"flush-buffer"===T.type?v.z.apply(void 0,T.value.map((function(e){var t=e.start,n=e.end;return g.removeBuffer(t,n)}))).pipe((0,re.l)()):m.E,S=o.get(g),k=function(e,a){var o=i.manifest,p=r.pipe((0,y.U)((function(e){var t=a.getBufferedRanges();return(0,q.Z)({},e,{bufferGap:(0,j.L7)(t,e.position)})})));return bn({abrManager:t,clock$:p,content:{manifest:o,period:f,adaptation:e},options:d,segmentBuffer:a,segmentFetcherCreator:s,wantedBufferAhead$:c}).pipe((0,ae.K)((function(e){if(!Vt.isNative(n)){D.Z.error("Stream: "+n+" Stream crashed. Aborting it.",e),l.disposeSegmentBuffer(n);var t=z(e,{defaultCode:"NONE",defaultReason:"Unknown `AdaptationStream` error"});return(0,v.z)((0,u.of)(Yt.warning(t)),Tn(r,c,n,{period:f}))}throw D.Z.error("Stream: "+n+" Stream crashed. Stopping playback.",e),e})))}(e,g);return l.waitForUsableBuffers().pipe((0,b.z)((function(){return(0,v.z)(w,E,(0,h.T)(k,S))})))})));return(0,v.z)((0,u.of)(Yt.adaptationChange(n,e,f)),T)})),(0,S.O)(Yt.periodStreamReady(n,f,p)))},In=n(3074);function Zn(){for(var e=arguments.length,t=new Array(e),n=0;nc.getMaximumPosition()){var i=new B.Z("MEDIA_TIME_AFTER_MANIFEST","The current position is after the latest time announced in the Manifest.");return Yt.warning(i)}return null}),null)),M=r.getBufferTypes().map((function(e){return function(e,n){var a=new Gt((function(e,t){return e.start-t.start})),o=new i.x,s=!1;function l(t){return N(e,t,o).pipe((0,ue.Z)((function(e){switch(e.type){case"needs-media-source-reload":var t=a.head();if(void 0===t||t.id!==e.value.period.id)return null;break;case"periodStreamReady":s=!0,a.add(e.value.period);break;case"periodStreamCleared":a.removeElement(e.value.period)}return e}),null),(0,w.B)())}function f(e){var t=a.head(),n=a.last();return null==t||null==n||(t.start>e||(null==n.end?1/0:n.end)=s.end}))),m=d.pipe(Ve((function(t){return N(e,t,f)}))),y=l.pipe((0,k.q)(1),(0,Me.b)((function(){d.complete(),f.next(),f.complete()})),(0,w.B)()),_=(0,h.T)(p,y),T=xn({abrManager:n,bufferType:e,clock$:t,content:{manifest:c,period:s},garbageCollectors:I,segmentFetcherCreator:a,segmentBuffersStore:r,options:o,wantedBufferAhead$:x}).pipe((0,b.z)((function(t){if("stream-status"===t.type)if(t.value.hasFinishedLoading){var n=c.getPeriodAfter(s);if(null===n)return(0,v.z)((0,u.of)(t),(0,u.of)(Yt.streamComplete(e)));d.next(n)}else f.next();return(0,u.of)(t)})),(0,w.B)()),S=(0,v.z)(T.pipe((0,g.R)(_)),(0,u.of)(Yt.periodStreamCleared(e,s)).pipe((0,Me.b)((function(){D.Z.info("SO: Destroying Stream for",e,s)}))));return(0,h.T)(S,m,y.pipe((0,re.l)()))}};function Pn(e,t,n){return function(e){return(0,h.T)((0,R.ym)(e).pipe((0,A.h)(!0)),(0,R.ep)(e).pipe((0,A.h)(!1)),(0,R.UG)(e).pipe((0,A.h)(!1))).pipe((0,S.O)("open"===e.readyState),(0,_.x)())}(e).pipe((0,Ge.w)((function(t){return t?function(e){if(0===e.length)return(0,u.of)(void 0);for(var t=[],n=0;n=i||i===n?null:isNaN(e.duration)||!isFinite(e.duration)||i-e.duration>.01?(D.Z.info("Init: Updating duration",i),e.duration=i,i):null})),(0,ae.K)((function(e){return D.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e),(0,u.of)(null)})))}var Nn=n(4181);var Dn=R.gg,On=R.ym,Ln=R._E;function Bn(e){return(0,d.P)((function(){if(D.Z.debug("Init: Trying to call endOfStream"),"open"!==e.readyState)return D.Z.debug("Init: MediaSource not open, cancel endOfStream"),(0,u.of)(null);var t=e.sourceBuffers,n=function(e){for(var t=[],n=0;n0&&void 0!==e[0].period.end&&e[0].period.end+10r.start)return Hn(t)&&e.splice(a,0,t),e;Hn(t)&&e.push(t);return e}(e,t[0],t[1])}),[])),o=null,s=null;return e.pipe(nt(a),(0,y.U)((function(e){var r=e[0],a=e[1],u=r.buffered,l=r.currentRange,d=r.position,c=r.event,f=r.stalled;if(null===f)return{type:"unstalled",value:null};if(r.seeking)o=r.position;else if(null!==o){var p=performance.now();if(null===s&&(s=p),Fn&&r.positionn)return r;var o=void 0;if(void 0===a.end||a.end>n){var s=e[i],u=s.discontinuity,l=s.position,d=u.start,c=u.end;if(n>=(null!=d?d:l)-Vn)if(null===c){var f=t.getPeriodAfter(a);null!==f?o=f.start+Vn:D.Z.warn("Init: discontinuity at Period's end but no next Period")}else no?r:o)}}return r}(a,n,v);if(null!==h){var m=h+.001;if(!(m<=t.currentTime))return D.Z.warn("SA: skippable discontinuity found in the stream",d,m),i(m),Yt.warning(Wn(v,m));D.Z.info("Init: position to seek already reached, no seeking",t.currentTime,m)}}if(function(e,t,n,r){return N.vU&&r&&"timeupdate"===n&&null!=t&&t.end-e>10}(d,l,c,null!==f))return D.Z.warn("Init: After freeze seek",d,l),i(d),Yt.warning(Wn(d,d));var g=null!=v?v:d,y=(0,j.XS)(u,g);if(y=0;b--){var T=n.periods[b];if(void 0!==T.end&&T.end<=g){if(n.periods[b+1].start>g&&n.periods[b+1].start>t.currentTime){var E=n.periods[b+1];return i(E.start),Yt.warning(Wn(g,E.start))}break}}return{type:"stalled",value:f}})))}function Hn(e){return null!==e.discontinuity}function Wn(e,t){return new B.Z("DISCONTINUITY_ENCOUNTERED","A discontinuity has been encountered at position "+String(e)+", seeked at position "+String(t))}var $n=function(e,t){return e.id===t.id&&e.start===t.start&&e.end===t.end};var Yn=function(e,t){for(var n=[],r=t.periods,i=0;i0})),(0,_.x)(),(0,Ge.w)((function(e){return e?(0,p.a)([(0,Nt.F)(qn).pipe((0,S.O)(null)),n]).pipe((0,y.U)((function(e){e[0];return{isSeeking:e[1].seeking,currentTime:t.currentTime}})),(0,x.e)((function(e,t){var n,r=!1;e.subscribe(new I.Q(t,(function(e){var i=n;n=e,r&&t.next([i,e]),r=!0})))})),(0,b.z)((function(e){var t=e[0],n=e[1];return function(e,t,n){for(var i=t.currentTime,a=n.isSeeking,o=n.currentTime,s=[],l=[],d=0;do||void 0!==p&&o>=p)&&(Xn(c)&&l.push(c.publicEvent),r.delete(c)):f<=o&&void 0!==p&&o=(null!=p?p:f)&&(a?s.push({type:"stream-event-skip",value:c.publicEvent}):(s.push({type:"stream-event",value:c.publicEvent}),Xn(c)&&l.push(c.publicEvent)))}return(0,v.z)(s.length>0?u.of.apply(void 0,s):m.E,l.length>0?u.of.apply(void 0,l).pipe((0,Me.b)((function(e){"function"==typeof e.onExit&&e.onExit()})),(0,re.l)()):m.E)}(i,t,n)}))):m.E})))},Qn=n(2983);function Jn(e){var t=e.mediaElement,n=e.manifest,r=e.clock$,a=e.speed$,o=e.bufferOptions,s=e.abrManager,l=e.segmentFetcherCreator,c=e.setCurrentTime;return function(e,f,v){var _,T=function(e,t){return(0,d.P)((function(){var n;return Pn(t,e,void 0).pipe((0,b.z)((function(r){return null!==r&&(n=r),(0,W.R)(e,"manifestUpdate").pipe((0,Ge.w)((function(){return Pn(t,e,n)})),(0,Me.b)((function(e){null!==e&&(n=e)})))})),(0,re.l)())}))}(n,e),w=null!==(_=n.getPeriodForTime(f))&&void 0!==_?_:n.getNextPeriod(f);if(void 0===w){var k=new B.Z("MEDIA_STARTING_TIME_NOT_FOUND","Wanted starting time not found in the Manifest.");return(0,Pt._)((function(){return k}))}var A=new Vt(t,e),x=(0,Un.Z)({clock$:r,mediaElement:t,startTime:f,mustAutoPlay:v,setCurrentTime:c,isDirectfile:!1}),I=x.seek$,Z=x.load$,M=Z.pipe((0,E.h)((function(e){return"not-loaded-metadata"!==e}))),R=M.pipe((0,b.z)((function(){return jn(n,t,r)}))),C=function(e,t){var n=t.autoPlay,r=t.initialPlay$,i=t.initialSeek$,a=t.manifest,o=t.speed$,s=t.startTime,u=!1,l=!1,d=r.pipe((0,Me.b)((function(){u=!0})),(0,re.l)()),c=i.pipe((0,Me.b)((function(){l=!0})),(0,re.l)()),f=(0,p.a)([e,o]).pipe((0,y.U)((function(e){var t=e[0],r=e[1],i=a.isLive;return{position:t.position,getCurrentTime:t.getCurrentTime,duration:t.duration,isPaused:u?t.paused:!n,liveGap:i?a.getMaximumPosition()-t.position:1/0,readyState:t.readyState,speed:r,stalled:t.stalled,wantedTimeOffset:l?0:s-t.position}})));return(0,h.T)(d,c,f)}(r,{autoPlay:v,initialPlay$:M,initialSeek$:I,manifest:n,speed$:a,startTime:f}),P=new i.x,N=new i.x,O=Cn({manifest:n,initialPeriod:w},C,s,A,l,o).pipe((0,b.z)((function(t){switch(t.type){case"end-of-stream":return D.Z.debug("Init: end-of-stream order received."),function(e){return On(e).pipe((0,S.O)(null),(0,Ge.w)((function(){return Bn(e)})))}(e).pipe((0,re.l)(),(0,g.R)(P));case"resume-stream":return D.Z.debug("Init: resume-stream order received."),P.next(null),m.E;case"stream-status":var n=t.value,r=n.period,i=n.bufferType,a=n.imminentDiscontinuity,o=n.position;return N.next({period:r,bufferType:i,discontinuity:a,position:o}),m.E;default:return(0,u.of)(t)}}))),L=(0,Qn.Z)(t,a,r).pipe((0,re.l)()),U=Gn(r,t,n,N,c),F=Z.pipe((0,b.z)((function(e){if("autoplay-blocked"===e){var t=new B.Z("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");return(0,u.of)(Rt.Z.warning(t),Rt.Z.loaded(A))}if("not-loaded-metadata"===e){var n=new B.Z("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");return(0,u.of)(Rt.Z.warning(n))}return D.Z.debug("Init: The current content is loaded."),(0,u.of)(Rt.Z.loaded(A))})));return(0,h.T)(T,F,L,U,O,R).pipe(oe((function(){A.disposeAll()})))}}var er=L.Z.FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY,tr=L.Z.MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE,nr=L.Z.MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE;function rr(e){var t,n,r=e.initialManifest,i=e.manifestFetcher,a=e.minimumManifestUpdateInterval,o=e.scheduleRefresh$,s=(t=function(e,t){return i.fetch(e).pipe((0,b.z)((function(e){return"warning"===e.type?(0,u.of)(e):e.parse(t)})),(0,w.B)())},n=!1,function(){for(var e=arguments.length,r=new Array(e),i=0;i0?f=nr,l=void 0===t?0:performance.now()-t,d=Math.max(a-l,0),g=o.pipe((0,b.z)((function(e){var n=e.completeRefresh,r=e.delay,i=e.canUseUnsafeMode&&s;return ir(null!=r?r:0,a,t).pipe((0,A.h)({completeRefresh:n,unsafeMode:i}))}))),y=null===c.expired?m.E:(0,fe.H)(d).pipe((0,M.j)((0,Ke.Dp)(c.expired)),(0,A.h)({completeRefresh:!0,unsafeMode:s})),_=function(){if(void 0===c.lifetime||c.lifetime<0)return m.E;var e,t=1e3*c.lifetime-l;void 0===i?e=t:c.lifetime<3&&i>=100?(e=Math.min(Math.max(3e3-l,Math.max(t,0)+i),6*t),D.Z.info("MUS: Manifest update rythm is too frequent. Postponing next request.",t,e)):i>=1e3*c.lifetime/10?(e=Math.min(Math.max(t,0)+i,6*t),D.Z.info("MUS: Manifest took too long to parse. Postponing next request",e,e)):e=t;return(0,fe.H)(Math.max(e,d)).pipe((0,A.h)({completeRefresh:!1,unsafeMode:s}))}();return(0,h.T)(_,g,y).pipe((0,k.q)(1),(0,b.z)((function(e){return v({completeRefresh:e.completeRefresh,unsafeMode:e.unsafeMode})})),(0,b.z)((function(e){return"warning"===e.type?(0,u.of)(e):p(e)})))}function v(e){var t=e.completeRefresh,n=e.unsafeMode,r=c.updateUrl,i=t||void 0===r,o=i?c.getUrl():r,l=c.clockOffset;return n?(f+=1,D.Z.info('Init: Refreshing the Manifest in "unsafeMode" for the '+String(f)+" consecutive time.")):f>0&&(D.Z.info('Init: Not parsing the Manifest in "unsafeMode" anymore after '+String(f)+" consecutive times."),f=0),s(o,{externalClockOffset:l,previousManifest:c,unsafeMode:n}).pipe((0,b.z)((function(e){if("warning"===e.type)return(0,u.of)(e);var t=e.manifest,n=e.sendingTime,r=e.receivedTime,o=e.parsingTime,s=performance.now();if(i)c.replace(t);else try{c.update(t)}catch(e){var l=e instanceof Error?e.message:"unknown error";return D.Z.warn("MUS: Attempt to update Manifest failed: "+l,"Re-downloading the Manifest fully"),ir(er,a,n).pipe((0,b.z)((function(){return v({completeRefresh:!0,unsafeMode:!1})})))}return(0,u.of)({type:"parsed",manifest:c,sendingTime:n,receivedTime:r,parsingTime:o,updatingTime:performance.now()-s})})))}}function ir(e,t,n){return(0,d.P)((function(){var r=void 0===n?0:performance.now()-n,i=Math.max(t-r,0);return(0,fe.H)(Math.max(e-r,i))}))}var ar=n(2447),or=L.Z.OUT_OF_SYNC_MANIFEST_REFRESH_DELAY;var sr=function(e){var t,n,r,a=e.adaptiveOptions,o=e.autoPlay,s=e.bufferOptions,l=e.clock$,d=e.keySystems,c=e.lowLatencyMode,f=e.manifest$,v=e.manifestFetcher,_=e.mediaElement,I=e.minimumManifestUpdateInterval,Z=e.segmentFetcherCreator,M=e.setCurrentTime,R=e.speed$,C=e.startAt,P=e.textTrackOptions,N=new wt(a),O=Mt(_).pipe((0,T.d)({refCount:!0})),L=new i.x,B=(0,St.Z)(_,d,L).pipe((0,He.Z)(),(0,w.B)()),U=(0,ar.Z)(_),F=B.pipe((t=function(e,t){switch(t.type){case"eme-disabled":case"attached-media-keys":return(0,u.of)({isEmeReady:!0,drmSystemId:e.drmSystemId});case"created-media-keys":var n=t.value.initializationDataSystemId;return O.pipe((0,b.z)((function(){return t.value.attachMediaKeys$.next(),!0===t.value.options.disableMediaKeysAttachmentLock?(0,u.of)({isEmeReady:!0,drmSystemId:n}):m.E})),(0,S.O)({isEmeReady:!1,drmSystemId:n}));default:return m.E}},n={isEmeReady:!1,drmSystemId:void 0},void 0===r&&(r=1/0),(0,x.e)((function(e,i){var a=n;return(0,ze.p)(e,i,(function(e,n){return t(a,e,n)}),r,(function(e){a=e}),!1,void 0,(function(){return a=null}))}))),(0,E.h)((function(e){return e.isEmeReady})),(0,k.q)(1),Ve((function(e){var t=e.drmSystemId;return O.pipe((0,y.U)((function(e){return{mediaSource:e,drmSystemId:t}})))}))),z=(0,p.a)([f,F]).pipe((0,b.z)((function(e){var t=e[0],n=e[1];if("warning"===t.type)return(0,u.of)(t);var r=t.manifest,a=n.mediaSource,d=n.drmSystemId;D.Z.debug("Init: Calculating initial time");var f=function(e,t,n){if(D.Z.debug("Init: calculating initial time"),null!=n){var r=e.getMinimumPosition(),i=e.getMaximumPosition();if(null!=n.position)return D.Z.debug("Init: using startAt.minimumPosition"),Math.max(Math.min(n.position,i),r);if(null!=n.wallClockTime){D.Z.debug("Init: using startAt.wallClockTime");var a=null==e.availabilityStartTime?0:e.availabilityStartTime,o=n.wallClockTime-a;return Math.max(Math.min(o,i),r)}if(null!=n.fromFirstPosition){D.Z.debug("Init: using startAt.fromFirstPosition");var s=n.fromFirstPosition;return s<=0?r:Math.min(i,r+s)}if(null!=n.fromLastPosition){D.Z.debug("Init: using startAt.fromLastPosition");var u=n.fromLastPosition;return u>=0?i:Math.max(r,i+u)}if(null!=n.percentage){D.Z.debug("Init: using startAt.percentage");var l=n.percentage;return l>100?i:l<0?r:r+ +l/100*(i-r)}}var d=e.getMinimumPosition();if(e.isLive){var c,f=e.suggestedPresentationDelay,p=e.clockOffset,v=e.getMaximumPosition();if(null==p)D.Z.info("Init: no clock offset found for a live content, starting close to maximum available position"),c=v;else{D.Z.info("Init: clock offset found for a live content, checking if we can start close to it");var h=null==e.availabilityStartTime?0:e.availabilityStartTime,m=(performance.now()+p)/1e3-h;c=Math.min(v,m)}var g=void 0!==f?f:t?Ct.LOW_LATENCY:Ct.DEFAULT;return D.Z.debug("Init: "+c+" defined as the live time, applying a live gap of "+g),Math.max(c-g,d)}return D.Z.info("Init: starting at the minimum available position:",d),d}(r,c,C);D.Z.debug("Init: Initial time calculated:",f);var p=Jn({abrManager:N,bufferOptions:(0,q.Z)({textTrackOptions:P,drmSystemId:d},s),clock$:l,manifest:r,mediaElement:_,segmentFetcherCreator:Z,speed$:R,setCurrentTime:M}),m=function e(t,n,r){var a=new i.x,o=p(t,n,r).pipe((0,ue.Z)((function(e){switch(e.type){case"needs-manifest-refresh":return T.next({completeRefresh:!1,canUseUnsafeMode:!0}),null;case"manifest-might-be-out-of-sync":return T.next({completeRefresh:!0,canUseUnsafeMode:!1,delay:or}),null;case"needs-media-source-reload":return a.next(e.value),null;case"needs-decipherability-flush":var t=ne(_);if(null===(r=t)||r.indexOf("widevine")<0)return a.next(e.value),null;var n=e.value.position;return n+.001=1&&"loadedmetadata"!==u&&null===m&&!(_||h),T=null,E=s?vr.LOW_LATENCY:vr.DEFAULT;if(o){if(b)d<=E?(r=!0,T=l+d):d===1/0?(r=!0,T=l):1===v&&(r=!0);else if(null!==m){var w=mr(m,s);!0!==r&&null!==m&&v>1&&(_||h||d<1/0&&d>w)?i=!0:(d===1/0||d<=w)&&(T=d===1/0?l:l+d)}}else b&&(!p&&"timeupdate"===u&&"timeupdate"===g&&l===y||"seeking"===u&&d===1/0)?r=!0:null!==m&&("seeking"!==u&&l!==y||"canplay"===u||d<1/0&&(d>mr(m,s)||_||h))&&(i=!0);return!0===i?null:!0===r||null!==m?(a="seeking"===u||null!==m&&"seeking"===m.reason?"seeking":t.seeking&&("internal-seeking"===u||null!==m&&"internal-seek"===m.reason)?"internal-seek":t.seeking?"seeking":1===v?"not-ready":"buffering",null!==m&&m.reason===a?{reason:m.reason,timestamp:m.timestamp,position:T}:{reason:a,timestamp:performance.now(),position:T}):null}var _r=function(e,t){var n=0;return{clock$:(0,d.P)((function(){var r=(0,q.Z)(gr(e,"init"),{stalled:null,getCurrentTime:function(){return e.currentTime}});var i=hr.map((function(t){return(0,Dt.R)(e,t).pipe((0,A.h)(t))})),a=t.lowLatencyMode?lr:t.withMediaSource?ur:dr,o=(0,Nt.F)(a).pipe((0,A.h)("timeupdate"));return h.T.apply(void 0,[o].concat(i)).pipe((0,y.U)((function(i){return r=function(i){var a=i;"seeking"===a&&n>0&&(a="internal-seeking",n-=1);var o=gr(e,a),s=yr(r,o,t),u=(0,q.Z)({},{stalled:s,getCurrentTime:function(){return e.currentTime}},o);return D.Z.debug("API: current media element state",u),u}(i),"DEBUG"===D.Z.getLevel()&&D.Z.debug("API: current playback timeline:\n"+function(e,t){for(var n="",r="",i=0;it){var d=n.length-Math.floor(l.length/2);r=" ".repeat(d)+"^"+t}if(i=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Cr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;)this._periods.pop()},t.update=function(){this._resetChosenAudioTracks(),this._resetChosenTextTracks(),this._resetChosenVideoTracks()},t.setInitialAudioTrack=function(e){var t=oi(this._periods,e),n=null!=t?t.audio:null;if(null==n||null==t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("audio"),i=this._audioChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,Re.Z)(r,i))n.adaptation$.next(i);else{var a=ti(r,jr(this._preferredAudioTracks));this._audioChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialTextTrack=function(e){var t=oi(this._periods,e),n=null!=t?t.text:null;if(null==n||null==t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("text"),i=this._textChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,Re.Z)(r,i))n.adaptation$.next(i);else{var a=ri(r,Qr(this._preferredTextTracks));this._textChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialVideoTrack=function(e){var t=oi(this._periods,e),n=null!=t?t.video:null;if(null==n||null==t)throw new Error("TrackChoiceManager: Given Period not found.");var r,i=e.getSupportedAdaptations("video"),a=this._videoChoiceMemory.get(e);if(null===a)r=null;else if(void 0!==a&&(0,Re.Z)(i,a.baseAdaptation))r=a.baseAdaptation;else{r=ai(i,this._preferredVideoTracks)}if(null===r)return this._videoChoiceMemory.set(e,null),void n.adaptation$.next(null);var o=li(r,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:r,adaptation:o}),n.adaptation$.next(o)},t.setAudioTrackByID=function(e,t){var n=oi(this._periods,e),r=null!=n?n.audio:null;if(null==r)throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,st.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Audio Track not found.");this._audioChoiceMemory.get(e)!==i&&(this._audioChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setTextTrackByID=function(e,t){var n=oi(this._periods,e),r=null!=n?n.text:null;if(null==r)throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,st.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Text Track not found.");this._textChoiceMemory.get(e)!==i&&(this._textChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setVideoTrackByID=function(e,t){var n=oi(this._periods,e),r=null!=n?n.video:null;if(null==r)throw new Error("LanguageManager: Given Period not found.");var i=(0,st.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Video Track not found.");var a=li(i,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:i,adaptation:a}),r.adaptation$.next(a)},t.disableTextTrack=function(e){var t=oi(this._periods,e),n=null!=t?t.text:null;if(null==n)throw new Error("TrackChoiceManager: Given Period not found.");null!==this._textChoiceMemory.get(e)&&(this._textChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrack=function(e){var t=oi(this._periods,e),n=null==t?void 0:t.video;if(void 0===n)throw new Error("TrackManager: Given Period not found.");null!==this._videoChoiceMemory.get(e)&&(this._videoChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!1,this._resetChosenVideoTracks()},t.enableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!0,this._resetChosenVideoTracks()},t.isTrickModeEnabled=function(){return this.trickModeTrackEnabled},t.getChosenAudioTrack=function(e){var t=oi(this._periods,e);if(null==(null!=t?t.audio:null))return null;var n=this._audioChoiceMemory.get(e);if(null==n)return null;var r={language:(0,We.Z)(n.language,""),normalized:(0,We.Z)(n.normalizedLanguage,""),audioDescription:!0===n.isAudioDescription,id:n.id,representations:n.representations.map(ui)};return!0===n.isDub&&(r.dub=!0),r},t.getChosenTextTrack=function(e){var t=oi(this._periods,e);if(null==(null!=t?t.text:null))return null;var n=this._textChoiceMemory.get(e);return null==n?null:{language:(0,We.Z)(n.language,""),normalized:(0,We.Z)(n.normalizedLanguage,""),closedCaption:!0===n.isClosedCaption,id:n.id}},t.getChosenVideoTrack=function(e){var t=oi(this._periods,e);if(null==(null!=t?t.video:null))return null;var n=this._videoChoiceMemory.get(e);if(void 0===n)return null;if(null===n)return null;var r=n.adaptation,i=void 0!==r.trickModeTracks?r.trickModeTracks.map((function(e){var t=e.representations.map(si),n={id:e.id,representations:t,isTrickModeTrack:!0};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),n})):void 0,a={id:r.id,representations:r.representations.map(si)};return!0===r.isSignInterpreted&&(a.signInterpreted=!0),!0===r.isTrickModeTrack&&(a.isTrickModeTrack=!0),void 0!==i&&(a.trickModeTracks=i),a},t.getAvailableAudioTracks=function(e){var t=oi(this._periods,e),n=null!=t?t.audio:null;if(null==n)return[];var r=this._audioChoiceMemory.get(e),i=null!=r?r.id:null;return n.adaptations.map((function(e){var t={language:(0,We.Z)(e.language,""),normalized:(0,We.Z)(e.normalizedLanguage,""),audioDescription:!0===e.isAudioDescription,id:e.id,active:null!=i&&i===e.id,representations:e.representations.map(ui)};return!0===e.isDub&&(t.dub=!0),t}))},t.getAvailableTextTracks=function(e){var t=oi(this._periods,e),n=null!=t?t.text:null;if(null==n)return[];var r=this._textChoiceMemory.get(e),i=null!=r?r.id:null;return n.adaptations.map((function(e){return{language:(0,We.Z)(e.language,""),normalized:(0,We.Z)(e.normalizedLanguage,""),closedCaption:!0===e.isClosedCaption,id:e.id,active:null!=i&&i===e.id}}))},t.getAvailableVideoTracks=function(e){var t,n=oi(this._periods,e),r=null!=n?n.video:null;if(null==r)return[];var i=this._videoChoiceMemory.get(e),a=void 0===i?void 0:null!==(t=null==i?void 0:i.adaptation.id)&&void 0!==t?t:void 0;return r.adaptations.map((function(e){var t=void 0!==e.trickModeTracks?e.trickModeTracks.map((function(e){var t=null!==a&&a===e.id,n=e.representations.map(si),r={id:e.id,representations:n,isTrickModeTrack:!0,active:t};return!0===e.isSignInterpreted&&(r.signInterpreted=!0),r})):void 0,n={id:e.id,active:null!==a&&a===e.id,representations:e.representations.map(si)};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),void 0!==t&&(n.trickModeTracks=t),n}))},t._applyAudioPreferences=function(){this._audioChoiceMemory=new WeakMap,this._resetChosenAudioTracks()},t._applyTextPreferences=function(){this._textChoiceMemory=new WeakMap,this._resetChosenTextTracks()},t._applyVideoPreferences=function(){this._videoChoiceMemory=new WeakMap,this._resetChosenVideoTracks()},t._resetChosenAudioTracks=function(){var e=this,t=jr(this._preferredAudioTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if(null!=i.audio){var a=i.period,o=i.audio,s=a.getSupportedAdaptations("audio"),u=e._audioChoiceMemory.get(a);if(null===u||void 0!==u&&(0,Re.Z)(s,u))n(r+1);else{var l=ti(s,t);e._audioChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}else n(r+1)}}(0)},t._resetChosenTextTracks=function(){var e=this,t=Qr(this._preferredTextTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if(null!=i.text){var a=i.period,o=i.text,s=a.getSupportedAdaptations("text"),u=e._textChoiceMemory.get(a);if(null===u||void 0!==u&&(0,Re.Z)(s,u))n(r+1);else{var l=ri(s,t);e._textChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}else n(r+1)}}(0)},t._resetChosenVideoTracks=function(){var e=this,t=this._preferredVideoTracks;!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if(null!=i.video){var a=i.period,o=i.video,s=a.getSupportedAdaptations("video"),u=e._videoChoiceMemory.get(a);if(null!==u){if(void 0!==u&&(0,Re.Z)(s,u.baseAdaptation)){var l=li(u.baseAdaptation,e.trickModeTrackEnabled);return l.id===u.adaptation.id?void n(r+1):(e._videoChoiceMemory.set(a,{baseAdaptation:u.baseAdaptation,adaptation:l}),o.adaptation$.next(l),n(0))}var d=ai(s,t);if(null===d)return e._videoChoiceMemory.set(a,null),o.adaptation$.next(null),n(0);var c=li(d,e.trickModeTrackEnabled);return e._videoChoiceMemory.set(a,{baseAdaptation:d,adaptation:c}),o.adaptation$.next(c),n(0)}n(r+1)}else n(r+1)}}(0)},e}();function ei(e){return function(t){var n;if(void 0!==e.normalized&&(null!==(n=t.normalizedLanguage)&&void 0!==n?n:"")!==e.normalized)return!1;if(void 0!==e.audioDescription)if(e.audioDescription){if(!0!==t.isAudioDescription)return!1}else if(!0===t.isAudioDescription)return!1;if(void 0===e.codec)return!0;var r=e.codec.test,i=function(e){return void 0!==e.codec&&r.test(e.codec)};return e.codec.all?t.representations.every(i):t.representations.some(i)}}function ti(e,t){if(0===e.length)return null;for(var n=0;nh)throw new Error('Invalid maxVideoBitrate parameter. Its value, "'+h+'", is inferior to the set minVideoBitrate, "'+p+'"')}if((0,$.Z)(e.maxAudioBitrate))v=zr.audio;else{if(v=Number(e.maxAudioBitrate),isNaN(v))throw new Error("Invalid maxAudioBitrate parameter. Should be a number.");if(f>v)throw new Error('Invalid maxAudioBitrate parameter. Its value, "'+v+'", is inferior to the set minAudioBitrate, "'+f+'"')}return{maxBufferAhead:t,maxBufferBehind:n,limitVideoWidth:m,videoElement:l,wantedBufferAhead:r,throttleWhenHidden:i,throttleVideoBitrateWhenHidden:a,preferredAudioTracks:o,preferredTextTracks:s,preferredVideoTracks:u,initialAudioBitrate:c,initialVideoBitrate:d,minAudioBitrate:f,minVideoBitrate:p,maxAudioBitrate:v,maxVideoBitrate:h,stopAtEnd:(0,$.Z)(e.stopAtEnd)?Hr:!!e.stopAtEnd}}(e),o=r.initialAudioBitrate,u=r.initialVideoBitrate,l=r.limitVideoWidth,d=r.minAudioBitrate,c=r.minVideoBitrate,f=r.maxAudioBitrate,p=r.maxBufferAhead,v=r.maxBufferBehind,h=r.maxVideoBitrate,m=r.preferredAudioTracks,b=r.preferredTextTracks,T=r.preferredVideoTracks,E=r.throttleWhenHidden,w=r.throttleVideoBitrateWhenHidden,S=r.videoElement,k=r.wantedBufferAhead,A=r.stopAtEnd;return S.preload="auto",t.version="3.25.1",t.log=D.Z,t.state="STOPPED",t.videoElement=S,t._priv_destroy$=new i.x,t._priv_pictureInPictureEvent$=new a.t(1),mi(S).pipe((0,g.R)(t._priv_destroy$)).subscribe(t._priv_pictureInPictureEvent$),vi(S).pipe((0,g.R)(t._priv_destroy$)).subscribe((function(){return t.trigger("fullscreenChange",t.isFullscreen())})),yi(S.textTracks).pipe((0,g.R)(t._priv_destroy$),(0,y.U)((function(e){for(var t=e.target,n=[],r=0;r0?e.textTracks[0]:null},o.getPlayerState=function(){return this.state},o.isLive=function(){if(null===this._priv_contentInfos)return!1;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;return!t&&null!==n&&n.isLive},o.areTrickModeTracksEnabled=function(){return this._priv_preferTrickModeTracks},o.getUrl=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest,r=e.url;return t?r:null!==n?n.getUrl():void 0}},o.getVideoDuration=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration},o.getVideoBufferGap=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,j.L7)(e.buffered,e.currentTime)},o.getVideoLoadedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,j.at)(e.buffered,e.currentTime)},o.getVideoPlayedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,j.DD)(e.buffered,e.currentTime)},o.getWallClockTime=function(){if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)return this.videoElement.currentTime;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;return t?this.videoElement.currentTime:null!==n?this.videoElement.currentTime+(void 0!==n.availabilityStartTime?n.availabilityStartTime:0):0},o.getPosition=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.currentTime},o.getPlaybackRate=function(){return this._priv_speed$.getValue()},o.setPlaybackRate=function(e,t){this._priv_speed$.next(e);var n=null==t?void 0:t.preferTrickModeTracks;"boolean"==typeof n&&(this._priv_preferTrickModeTracks=n,null!==this._priv_trackChoiceManager&&(n&&!this._priv_trackChoiceManager.isTrickModeEnabled()?this._priv_trackChoiceManager.enableVideoTrickModeTracks():!n&&this._priv_trackChoiceManager.isTrickModeEnabled()&&this._priv_trackChoiceManager.disableVideoTrickModeTracks()))},o.getAvailableVideoBitrates=function(){if(null===this._priv_contentInfos)return[];var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;if(null===t||null===n)return[];var r=n[t.id];return void 0===r||(0,$.Z)(r.video)?[]:r.video.getAvailableBitrates()},o.getAvailableAudioBitrates=function(){if(null===this._priv_contentInfos)return[];var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;if(null===t||null===n)return[];var r=n[t.id];return void 0===r||(0,$.Z)(r.audio)?[]:r.audio.getAvailableBitrates()},o.getManualAudioBitrate=function(){return this._priv_bitrateInfos.manualBitrates.audio.getValue()},o.getManualVideoBitrate=function(){return this._priv_bitrateInfos.manualBitrates.video.getValue()},o.getVideoBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,$.Z)(e.video))return e.video.bitrate},o.getAudioBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,$.Z)(e.audio))return e.audio.bitrate},o.getMinVideoBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.video.getValue()},o.getMinAudioBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.audio.getValue()},o.getMaxVideoBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.video.getValue()},o.getMaxAudioBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.audio.getValue()},o.play=function(){var e=this;if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement.play();return(0,$.Z)(t)||"function"!=typeof t.catch?X.Z.resolve():t.catch((function(t){if("NotAllowedError"===t.name){var n=new B.Z("MEDIA_ERR_PLAY_NOT_ALLOWED",t.toString());e.trigger("warning",n)}throw t}))},o.pause=function(){if(null===this.videoElement)throw new Error("Disposed player");this.videoElement.pause()},o.seekTo=function(e){if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)throw new Error("player: no content loaded");var t,n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if(!r&&null===i)throw new Error("player: the content did not load yet");if("number"==typeof e)t=e;else if("object"==typeof e){var a=e,o=this.videoElement.currentTime;if((0,$.Z)(a.relative))if((0,$.Z)(a.position)){if((0,$.Z)(a.wallClockTime))throw new Error('invalid time object. You must set one of the following properties: "relative", "position" or "wallClockTime"');t=r||null===i?a.wallClockTime:a.wallClockTime-(void 0!==i.availabilityStartTime?i.availabilityStartTime:0)}else t=a.position;else t=o+a.relative}if(void 0===t)throw new Error("invalid time given");var s=t;if(null!==i&&!i.isLive){var u=i.getMaximumPosition();s=void 0!==u?Math.min(t,u-.001):t}return this.videoElement.currentTime=s,t},o.isFullscreen=function(){return(0,Q.Z)("isFullscreen is deprecated. Fullscreen management should now be managed by the application"),P()},o.setFullscreen=function(e){if(void 0===e&&(e=!0),(0,Q.Z)("setFullscreen is deprecated. Fullscreen management should now be managed by the application"),null===this.videoElement)throw new Error("Disposed player");e?function(e){if(!P()){var t=e;"function"==typeof t.requestFullscreen?t.requestFullscreen():"function"==typeof t.msRequestFullscreen?t.msRequestFullscreen():"function"==typeof t.mozRequestFullScreen?t.mozRequestFullScreen():"function"==typeof t.webkitRequestFullscreen&&t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}}(this.videoElement):C()},o.exitFullscreen=function(){(0,Q.Z)("exitFullscreen is deprecated. Fullscreen management should now be managed by the application"),C()},o.getVolume=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.volume},o.setVolume=function(e){if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement;e!==t.volume&&(t.volume=e,this.trigger("volumeChange",e))},o.isMute=function(){return 0===this.getVolume()},o.mute=function(){this._priv_mutedMemory=this.getVolume(),this.setVolume(0)},o.unMute=function(){0===this.getVolume()&&this.setVolume(0===this._priv_mutedMemory?di:this._priv_mutedMemory)},o.setVideoBitrate=function(e){this._priv_bitrateInfos.manualBitrates.video.next(e)},o.setAudioBitrate=function(e){this._priv_bitrateInfos.manualBitrates.audio.next(e)},o.setMinVideoBitrate=function(e){var t=this._priv_bitrateInfos.maxAutoBitrates.video.getValue();if(e>t)throw new Error('Invalid minimum video bitrate given. Its value, "'+e+'" is superior the current maximum video birate, "'+t+'".');this._priv_bitrateInfos.minAutoBitrates.video.next(e)},o.setMinAudioBitrate=function(e){var t=this._priv_bitrateInfos.maxAutoBitrates.audio.getValue();if(e>t)throw new Error('Invalid minimum audio bitrate given. Its value, "'+e+'" is superior the current maximum audio birate, "'+t+'".');this._priv_bitrateInfos.minAutoBitrates.audio.next(e)},o.setMaxVideoBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.video.getValue();if(e0?r.next(i[0]):r.next(null)}},o._priv_onPeriodStreamCleared=function(e){var t=e.type,n=e.period;switch(t){case"audio":case"text":case"video":null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.removePeriod(t,n)}if(null!==this._priv_contentInfos){var r=this._priv_contentInfos,i=r.activeAdaptations,a=r.activeRepresentations;if(!(0,$.Z)(i)&&!(0,$.Z)(i[n.id])){var o=i[n.id];delete o[t],0===Object.keys(o).length&&delete i[n.id]}if(!(0,$.Z)(a)&&!(0,$.Z)(a[n.id])){var s=a[n.id];delete s[t],0===Object.keys(s).length&&delete a[n.id]}}},o._priv_onReloadingMediaSource=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.segmentBuffersStore=null),null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.resetPeriods()},o._priv_onAdaptationChange=function(e){var t=e.type,n=e.adaptation,r=e.period;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeAdaptations&&(this._priv_contentInfos.activeAdaptations={});var i,a=this._priv_contentInfos,o=a.activeAdaptations,s=a.currentPeriod,u=o[r.id];if((0,$.Z)(u))o[r.id]=((i={})[t]=n,i);else u[t]=n;if(null!==this._priv_trackChoiceManager&&null!==s&&!(0,$.Z)(r)&&r.id===s.id)switch(t){case"audio":var l=this._priv_trackChoiceManager.getChosenAudioTrack(s);this.trigger("audioTrackChange",l);var d=this.getAvailableAudioBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",d);break;case"text":var c=this._priv_trackChoiceManager.getChosenTextTrack(s);this.trigger("textTrackChange",c);break;case"video":var f=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("videoTrackChange",f);var p=this.getAvailableVideoBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",p)}}else D.Z.error("API: The adaptations changed but no content is loaded")},o._priv_onRepresentationChange=function(e){var t,n=e.type,r=e.period,i=e.representation;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeRepresentations&&(this._priv_contentInfos.activeRepresentations={});var a,o=this._priv_contentInfos,s=o.activeRepresentations,u=o.currentPeriod,l=s[r.id];if((0,$.Z)(l))s[r.id]=((a={})[n]=i,a);else l[n]=i;var d=null!==(t=null==i?void 0:i.bitrate)&&void 0!==t?t:-1;(0,$.Z)(r)||null===u||u.id!==r.id||("video"===n?this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",d):"audio"===n&&this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",d))}else D.Z.error("API: The representations changed but no content is loaded")},o._priv_onBitrateEstimationChange=function(e){var t=e.type,n=e.bitrate;void 0!==n&&(this._priv_bitrateInfos.lastBitrates[t]=n),this.trigger("bitrateEstimationChange",{type:t,bitrate:n})},o._priv_onPlayPauseNext=function(e){if(null===this.videoElement)throw new Error("Disposed player");this._priv_playing$.next(e)},o._priv_onNativeTextTracksNext=function(e){this.trigger("nativeTextTracksChange",e)},o._priv_setPlayerState=function(e){this.state!==e&&(this.state=e,D.Z.info("API: playerStateChange event",e),this.trigger("playerStateChange",e))},o._priv_triggerPositionUpdate=function(e){var t;if(null!==this._priv_contentInfos){if(this.state!==Zr){var n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if((r||null!==i)&&!(0,$.Z)(e)){this._priv_lastContentPlaybackInfos.lastPlaybackPosition=e.position;var a=null!==i?i.getMaximumPosition():void 0,o={position:e.position,duration:e.duration,playbackRate:e.playbackRate,maximumBufferTime:a,bufferGap:isFinite(e.bufferGap)?e.bufferGap:0};if(null!==i&&void 0!==a&&i.isLive&&e.position>0){var s=null!==(t=i.availabilityStartTime)&&void 0!==t?t:0;o.wallClockTime=e.position+s,o.liveGap=a-e.position}this.trigger("positionUpdate",o)}}}else D.Z.warn("API: Cannot perform time update: no content loaded.")},o._priv_triggerAvailableBitratesChangeEvent=function(e,t){var n=this._priv_contentEventsMemory[e];(void 0===n||(0,H.Z)(t,n))&&(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},o._priv_triggerCurrentBitrateChangeEvent=function(e,t){t!==this._priv_contentEventsMemory[e]&&(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},o._priv_getCurrentRepresentations=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeRepresentations;return null===t||null===n||(0,$.Z)(n[t.id])?null:n[t.id]},(0,e.Z)(r,null,[{key:"ErrorTypes",get:function(){return K.ZB}},{key:"ErrorCodes",get:function(){return K.SM}},{key:"LogLevel",get:function(){return D.Z.getLevel()},set:function(e){D.Z.setLevel(e)}}]),r}(W.Z);bi.version="3.25.1";var Ti=bi,Ei=n(7273);!function(){Ei.Z.emeManager=n(8281).ZP,Ei.Z.imageBuffer=n(7127).Z,Ei.Z.imageParser=n(3203).Z,Ei.Z.transports.smooth=n(2339).Z,Ei.Z.transports.dash=n(1732).Z,Ei.Z.dashParsers.js=n(148).Z,Ei.Z.nativeTextTracksBuffer=n(9059).Z,Ei.Z.nativeTextTracksParsers.vtt=n(9405).Z,Ei.Z.nativeTextTracksParsers.ttml=n(1570).Z,Ei.Z.nativeTextTracksParsers.sami=n(1812).Z,Ei.Z.nativeTextTracksParsers.srt=n(8057).Z,Ei.Z.htmlTextTracksBuffer=n(5192).Z,Ei.Z.htmlTextTracksParsers.sami=n(5734).Z,Ei.Z.htmlTextTracksParsers.ttml=n(7439).Z,Ei.Z.htmlTextTracksParsers.srt=n(8675).Z,Ei.Z.htmlTextTracksParsers.vtt=n(4099).Z;var e=n(8969).Z,t=n(7794).Z;Ei.Z.directfile={initDirectFile:e,mediaElementTrackChoiceManager:t}}();var wi=Ti}(),r=r.default}()})); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.RxPlayer=t():e.RxPlayer=t()}(self,(function(){return function(){var e={3349:function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:function(){return r}})},5991:function(e,t,n){"use strict";function r(e,t){for(var n=0;n=0||"[object SafariRemoteNotification]"===(null===(r=window.safari)||void 0===r?void 0:r.pushNotification.toString())),f=!i.Z&&"string"==typeof navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)},5767:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(3666);function a(e){if(i.vU){for(var t=e.textTracks,n=0;n=0;o--)if("track"===a[o].nodeName)try{e.removeChild(a[o])}catch(e){r.Z.warn("Compat: Could not remove text track child from element.")}}e.src="",e.removeAttribute("src")}},6139:function(e,t,n){"use strict";n.d(t,{N:function(){return O},Y:function(){return W}});var r,i=n(3610),a=n(2817),o=n(9917),s=n(3714),u=n(8117),l=n(3666),d=n(2203),c=n(5059),f=n(5991),p=n(9589),v=function(){function e(e,t,n){this._keyType=e,this._mediaKeys=t,this._configuration=n}var t=e.prototype;return t.createMediaKeys=function(){var e=this;return new p.Z((function(t){return t(e._mediaKeys)}))},t.getConfiguration=function(){return this._configuration},(0,f.Z)(e,[{key:"keySystem",get:function(){return this._keyType}}]),e}(),h=n(1788),m=n(6716),g=n(3071),y=n(3505),_=n(1959),b=n(8719);if(!d.Z){var T=window.MSMediaKeys;void 0!==T&&void 0!==T.prototype&&"function"==typeof T.isTypeSupported&&"function"==typeof T.prototype.createSession&&(r=T)}var E,w=function(e){function t(t){var n;return(n=e.call(this)||this).expiration=NaN,n.keyStatuses=new Map,n._mk=t,n._closeSession$=new m.x,n.closed=new p.Z((function(e){n._closeSession$.subscribe(e)})),n.update=function(e){return new p.Z((function(t,r){if(void 0===n._ss)return r("MediaKeySession not set.");try{t(n._ss.update(e,""))}catch(e){r(e)}}))},n}(0,h.Z)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new p.Z((function(e){n._ss=n._mk.createSession("video/mp4",t),(0,g.T)(b.GJ(n._ss),b.GV(n._ss),b.Xe(n._ss)).pipe((0,y.R)(n._closeSession$)).subscribe((function(e){return n.trigger(e.type,e)})),e()}))},n.close=function(){var e=this;return new p.Z((function(t){null!=e._ss&&(e._ss.close(),e._ss=void 0),e._closeSession$.next(),e._closeSession$.complete(),t()}))},n.load=function(){return p.Z.resolve(!1)},n.remove=function(){return p.Z.resolve()},(0,f.Z)(t,[{key:"sessionId",get:function(){var e,t;return null!==(t=null===(e=this._ss)||void 0===e?void 0:e.sessionId)&&void 0!==t?t:""}}]),t}(_.Z),S=function(){function e(e){if(void 0===r)throw new Error("No MSMediaKeys API.");this._mediaKeys=new r(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0!==this._videoElement.msSetMediaKeys)return this._videoElement.msSetMediaKeys(this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new w(this._mediaKeys)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();if(!d.Z){var k=window.MozMediaKeys;void 0!==k&&void 0!==k.prototype&&"function"==typeof k.isTypeSupported&&"function"==typeof k.prototype.createSession&&(E=k)}var A=n(9689),x=n(3635);function I(e){return"function"==typeof e.webkitGenerateKeyRequest}var Z=function(e){function t(t,n){var r;return(r=e.call(this)||this)._closeSession$=new m.x,r._vid=t,r._key=n,r.sessionId="",r.closed=new p.Z((function(e){r._closeSession$.subscribe(e)})),r.keyStatuses=new Map,r.expiration=NaN,(0,g.T)(b.GJ(t),b.GV(t),b.Xe(t)).pipe((0,y.R)(r._closeSession$)).subscribe((function(e){return r.trigger(e.type,e)})),r.update=function(e){return new p.Z((function(t,n){try{if(r._key.indexOf("clearkey")>=0){var i=e instanceof ArrayBuffer?new Uint8Array(e):e,a=JSON.parse((0,x.uR)(i)),o=(0,A.K)(a.keys[0].k),s=(0,A.K)(a.keys[0].kid);t(r._vid.webkitAddKey(r._key,o,s,""))}else t(r._vid.webkitAddKey(r._key,e,null,""))}catch(e){n(e)}}))},r}(0,h.Z)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new p.Z((function(e){n._vid.webkitGenerateKeyRequest(n._key,t),e()}))},n.close=function(){var e=this;return new p.Z((function(t){e._closeSession$.next(),e._closeSession$.complete(),t()}))},n.load=function(){return p.Z.resolve(!1)},n.remove=function(){return p.Z.resolve()},t}(_.Z),M=function(){function e(e){this._keySystem=e}var t=e.prototype;return t._setVideo=function(e){if(!I(e))throw new Error("Video not attached to the MediaKeys");this._videoElement=e},t.createSession=function(){if(null==this._videoElement)throw new Error("Video not attached to the MediaKeys");return new Z(this._videoElement,this._keySystem)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();var R=n(6968);var C=n(158);function P(e,t){if(void 0===e.webkitSetMediaKeys)throw new Error("No webKitMediaKeys API.");return e.webkitSetMediaKeys(t)}var N=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._serverCertificate=r,i._closeSession$=new m.x,i._videoElement=t,i._keyType=n,i.closed=new p.Z((function(e){i._closeSession$.subscribe(e)})),i.keyStatuses=new Map,i.expiration=NaN,i.update=function(e){return new p.Z((function(t,n){if(void 0===i._nativeSession||void 0===i._nativeSession.update||"function"!=typeof i._nativeSession.update)return n("Unavailable WebKit key session.");try{t(i._nativeSession.update(e))}catch(e){n(e)}}))},i}(0,h.Z)(t,e);var n=t.prototype;return n.listenEvent=function(e){var t=this;(0,g.T)(b.GJ(e),b.GV(e),b.Xe(e)).pipe((0,y.R)(this._closeSession$)).subscribe((function(e){t.trigger(e.type,e)}))},n.generateRequest=function(e,t){var n=this;return new p.Z((function(e){if(void 0===n._videoElement.webkitKeys||void 0===n._videoElement.webkitKeys.createSession)throw new Error("No WebKitMediaKeys API.");var r,i;if("com.apple.fps.1_0"===(i=n._keyType)||"com.apple.fps.2_0"===i){if(void 0===n._serverCertificate)throw new Error("A server certificate is needed for creating fairplay session.");r=function(e,t){var n=e instanceof Uint8Array?e:new Uint8Array(e),r=t instanceof Uint8Array?t:new Uint8Array(t);if((0,R.dN)(n,0)+4!==n.length)throw new Error("Unsupported WebKit initData.");var i=(0,x.wV)(n),a=i.indexOf("skd://"),o=a>-1?i.substring(a+6):i,s=(0,x.TZ)(o),u=0,l=new Uint8Array(n.byteLength+4+s.byteLength+4+r.byteLength);return l.set(n),u+=n.length,l.set((0,R.O_)(s.byteLength),u),u+=4,l.set(s,u),u+=s.byteLength,l.set((0,R.O_)(r.byteLength),u),u+=4,l.set(r,u),l}(t,n._serverCertificate)}else r=t;var a=n._videoElement.webkitKeys.createSession("video/mp4",r);if(null==a)throw new Error("Impossible to get the key sessions");n.listenEvent(a),n._nativeSession=a,e()}))},n.close=function(){var e=this;return new p.Z((function(t,n){e._closeSession$.next(),e._closeSession$.complete(),void 0===e._nativeSession&&n("No session to close."),e._nativeSession.close(),t()}))},n.load=function(){return p.Z.resolve(!1)},n.remove=function(){return p.Z.resolve()},(0,f.Z)(t,[{key:"sessionId",get:function(){var e,t;return null!==(t=null===(e=this._nativeSession)||void 0===e?void 0:e.sessionId)&&void 0!==t?t:""}}]),t}(_.Z),D=function(){function e(e){if(void 0===C.t)throw new Error("No WebKitMediaKeys API.");this._keyType=e,this._mediaKeys=new C.t(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0===this._videoElement)throw new Error("Video not attached to the MediaKeys");return P(this._videoElement,this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new N(this._videoElement,this._keyType,this._serverCertificate)},t.setServerCertificate=function(e){return this._serverCertificate=e,p.Z.resolve()},e}();var O=null,L=function(e,t){return"function"==typeof e.setMediaKeys?e.setMediaKeys(t):e.webkitSetMediaKeys?e.webkitSetMediaKeys(t):e.mozSetMediaKeys?e.mozSetMediaKeys(t):e.msSetMediaKeys&&null!==t?e.msSetMediaKeys(t):void 0};if(d.Z||null!=navigator.requestMediaKeySystemAccess&&!(0,c.Z)())O=function(e,t){return(0,u.Z)(navigator.requestMediaKeySystemAccess(e,t))};else{var B,U;if(I(HTMLVideoElement.prototype)){var F={isTypeSupported:function(e){var t=document.querySelector("video");return null==t&&(t=document.createElement("video")),null!=t&&"function"==typeof t.canPlayType&&!!t.canPlayType("video/mp4",e)},createCustomMediaKeys:function(e){return new M(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof M))throw new Error("Custom setMediaKeys is supposed to be called with old webkit custom MediaKeys.");return t._setVideo(e)}}};B=F.isTypeSupported,U=F.createCustomMediaKeys,L=F.setMediaKeys}else if(void 0!==C.t){var z=function(){if(void 0===C.t)throw new Error("No WebKitMediaKeys API.");return{isTypeSupported:C.t.isTypeSupported,createCustomMediaKeys:function(e){return new D(e)},setMediaKeys:function(e,t){if(null===t)return P(e,t);if(!(t instanceof D))throw new Error("Custom setMediaKeys is supposed to be called with webkit custom MediaKeys.");return t._setVideo(e)}}}();B=z.isTypeSupported,U=z.createCustomMediaKeys,L=z.setMediaKeys}else if(l.fq&&void 0!==r){var K={isTypeSupported:function(e,t){if(void 0===r)throw new Error("No MSMediaKeys API.");return void 0!==t?r.isTypeSupported(e,t):r.isTypeSupported(e)},createCustomMediaKeys:function(e){return new S(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof S))throw new Error("Custom setMediaKeys is supposed to be called with IE11 custom MediaKeys.");return t._setVideo(e)}}};B=K.isTypeSupported,U=K.createCustomMediaKeys,L=K.setMediaKeys}else if(void 0!==E){var V={isTypeSupported:function(e,t){if(void 0===E)throw new Error("No MozMediaKeys API.");return void 0!==t?E.isTypeSupported(e,t):E.isTypeSupported(e)},createCustomMediaKeys:function(e){if(void 0===E)throw new Error("No MozMediaKeys API.");return new E(e)},setMediaKeys:function(e,t){if(void 0===e.mozSetMediaKeys||"function"!=typeof e.mozSetMediaKeys)throw new Error("Can't set video on MozMediaKeys.");return e.mozSetMediaKeys(t)}};B=V.isTypeSupported,U=V.createCustomMediaKeys,L=V.setMediaKeys}else{var G=window.MediaKeys,H=function(){if(void 0===G)throw new s.Z("MEDIA_KEYS_NOT_SUPPORTED","No `MediaKeys` implementation found in the current browser.");if(void 0===G.isTypeSupported){throw new Error("This browser seems to be unable to play encrypted contents currently. Note: Some browsers do not allow decryption in some situations, like when not using HTTPS.")}};B=function(e){return H(),G.isTypeSupported(e)},U=function(e){return H(),new G(e)}}O=function(e,t){if(!B(e))return(0,i._)((function(){return new Error("Unsupported key type")}));for(var n=0;n=t?(r.Z.warn("Compat: Invalid cue times: "+e+" - "+t),null):new i.w(e,t,n)}},5059:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3666),i=n(158);function a(){return r.G6&&void 0!==i.t}},944:function(e,t){"use strict";t.Z={DEFAULT_UNMUTED_VOLUME:.1,DEFAULT_REQUEST_TIMEOUT:3e4,DEFAULT_TEXT_TRACK_MODE:"native",DEFAULT_MANUAL_BITRATE_SWITCHING_MODE:"seamless",DEFAULT_ENABLE_FAST_SWITCHING:!0,DEFAULT_AUDIO_TRACK_SWITCHING_MODE:"seamless",DELTA_POSITION_AFTER_RELOAD:{bitrateSwitch:-.1,trackSwitch:{audio:-.7,video:-.1,other:0}},DEFAULT_CODEC_SWITCHING_BEHAVIOR:"continue",DEFAULT_AUTO_PLAY:!1,DEFAULT_SHOW_NATIVE_SUBTITLE:!0,DEFAULT_STOP_AT_END:!0,DEFAULT_WANTED_BUFFER_AHEAD:30,DEFAULT_MAX_BUFFER_AHEAD:1/0,DEFAULT_MAX_BUFFER_BEHIND:1/0,MAXIMUM_MAX_BUFFER_AHEAD:{text:18e3},MAXIMUM_MAX_BUFFER_BEHIND:{text:18e3},DEFAULT_INITIAL_BITRATES:{audio:0,video:0,other:0},DEFAULT_MIN_BITRATES:{audio:0,video:0,other:0},DEFAULT_MAX_BITRATES:{audio:1/0,video:1/0,other:1/0},INACTIVITY_DELAY:6e4,DEFAULT_THROTTLE_WHEN_HIDDEN:!1,DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN:!1,DEFAULT_LIMIT_VIDEO_WIDTH:!1,DEFAULT_LIVE_GAP:{DEFAULT:10,LOW_LATENCY:3},BUFFER_DISCONTINUITY_THRESHOLD:.2,FORCE_DISCONTINUITY_SEEK_DELAY:2e3,BITRATE_REBUFFERING_RATIO:1.5,BUFFER_GC_GAPS:{CALM:240,BEEFY:30},DEFAULT_MAX_MANIFEST_REQUEST_RETRY:4,DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR:4,DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE:1/0,INITIAL_BACKOFF_DELAY_BASE:{REGULAR:200,LOW_LATENCY:50},MAX_BACKOFF_DELAY_BASE:{REGULAR:3e3,LOW_LATENCY:1e3},SAMPLING_INTERVAL_MEDIASOURCE:1e3,SAMPLING_INTERVAL_LOW_LATENCY:250,SAMPLING_INTERVAL_NO_MEDIASOURCE:500,ABR_MINIMUM_TOTAL_BYTES:15e4,ABR_MINIMUM_CHUNK_SIZE:16e3,ABR_STARVATION_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},ABR_REGULAR_FACTOR:{DEFAULT:.8,LOW_LATENCY:.8},ABR_STARVATION_GAP:{DEFAULT:5,LOW_LATENCY:5},OUT_OF_STARVATION_GAP:{DEFAULT:7,LOW_LATENCY:7},ABR_STARVATION_DURATION_DELTA:.1,ABR_FAST_EMA:2,ABR_SLOW_EMA:10,RESUME_GAP_AFTER_SEEKING:{DEFAULT:1.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_NOT_ENOUGH_DATA:{DEFAULT:.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_BUFFERING:{DEFAULT:5,LOW_LATENCY:.5},STALL_GAP:{DEFAULT:.5,LOW_LATENCY:.2},MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT:.15,MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE:.4,MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE:.3,MINIMUM_SEGMENT_SIZE:.005,APPEND_WINDOW_SECURITIES:{START:.2,END:.1},MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL:50,TEXT_TRACK_SIZE_CHECKS_INTERVAL:250,BUFFER_PADDING:{audio:1,video:3,other:1},SEGMENT_PRIORITIES_STEPS:[2,4,8,12,18,25],MAX_HIGH_PRIORITY_LEVEL:1,MIN_CANCELABLE_PRIORITY:3,EME_DEFAULT_WIDEVINE_ROBUSTNESSES:["HW_SECURE_ALL","HW_SECURE_DECODE","HW_SECURE_CRYPTO","SW_SECURE_DECODE","SW_SECURE_CRYPTO"],EME_KEY_SYSTEMS:{clearkey:["webkit-org.w3.clearkey","org.w3.clearkey"],widevine:["com.widevine.alpha"],playready:["com.microsoft.playready","com.chromecast.playready","com.youtube.playready"],fairplay:["com.apple.fps.1_0"]},MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE:10,MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE:200,MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY:300,OUT_OF_SYNC_MANIFEST_REFRESH_DELAY:3e3,FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY:3e3,DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:3,EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS:15,EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION:1e3,EME_SESSION_CLOSING_MAX_RETRY:5,EME_SESSION_CLOSING_INITIAL_DELAY:100,EME_SESSION_CLOSING_MAX_DELAY:1e3,EME_WAITING_DELAY_LOADED_SESSION_EMPTY_KEYSTATUSES:100,FORCED_ENDED_THRESHOLD:8e-4,ADAPTATION_SWITCH_BUFFER_PADDINGS:{video:{before:2,after:2.5},audio:{before:2,after:2.5},text:{before:0,after:0},image:{before:0,after:0}},SOURCE_BUFFER_FLUSHING_INTERVAL:500,CONTENT_REPLACEMENT_PADDING:1.2,CACHE_LOAD_DURATION_THRESHOLDS:{video:50,audio:10},STREAM_EVENT_EMITTER_POLL_INTERVAL:250,DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR:.001}},7794:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(1788),i=n(1959),a=n(7829);function o(e,t){var n;if(t.length!==e.length)return!0;for(var r=0;re.length)return y.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var i=e.subarray(n,n+r),a={systemId:(0,_.Y)(i,8),data:i};S(t,a)?y.Z.warn("Compat: Duplicated PSSH found in initialization data, removing it."):t.push(a),n+=r}return n!==e.length?(y.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}]):t}(new Uint8Array(t))}}var A=n(9917),x=n(2297),I=n(8117);function Z(e,t,n){return(0,A.P)((function(){var r;y.Z.debug("Compat: Calling generateRequest on the MediaKeySession");try{r=function(e){y.Z.info("Compat: Trying to move CENC PSSH from init data at the end of it.");for(var t=!1,n=new Uint8Array,r=new Uint8Array,i=0;ie.length)throw y.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var o=e.subarray(i,i+a);if(16===e[i+12]&&119===e[i+13]&&239===e[i+14]&&236===e[i+15]&&192===e[i+16]&&178===e[i+17]&&77===e[i+18]&&2===e[i+19]&&172===e[i+20]&&227===e[i+21]&&60===e[i+22]&&30===e[i+23]&&82===e[i+24]&&226===e[i+25]&&251===e[i+26]&&75===e[i+27]){var s=(0,x.Xj)(o),u=null===s?void 0:o[s[1]];y.Z.info("Compat: CENC PSSH found with version",u),void 0===u?y.Z.warn("Compat: could not read version of CENC PSSH"):t===(1===u)?n=(0,T.zo)(n,o):1===u?(y.Z.warn("Compat: cenc version 1 encountered, removing every other cenc pssh box."),n=o,t=!0):y.Z.warn("Compat: filtering out cenc pssh box with wrong version",u)}else r=(0,T.zo)(r,o);i+=a}if(i!==e.length)throw y.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");return(0,T.zo)(r,n)}(n)}catch(e){r=n}var i=null!=t?t:"";return(0,I.Z)(e.generateRequest(i,r)).pipe((0,h.K)((function(t){if(""!==i||!(t instanceof TypeError))throw t;return y.Z.warn('Compat: error while calling `generateRequest` with an empty initialization data type. Retrying with a default "cenc" value.',t),(0,I.Z)(e.generateRequest("cenc",r))})))}))}var M=n(944),R=n(5157),C=n(7714),P=n(8418),N=n(2793),D=n(1946);var O=n(3833),L=n(8430);var B=n(4181),U=n(6625),F=n(5561);function z(e){if(""===e.sessionId)return!1;var t=e.keyStatuses,n=[];return t.forEach((function(e){n.push(e)})),n.length<=0?(y.Z.debug("EME: isSessionUsable: MediaKeySession given has an empty keyStatuses",e),!1):(0,C.Z)(n,"expired")?(y.Z.debug("EME: isSessionUsable: MediaKeySession given has an expired key",e.sessionId),!1):(0,C.Z)(n,"internal-error")?(y.Z.debug("EME: isSessionUsable: MediaKeySession given has a key with an internal-error",e.sessionId),!1):(y.Z.debug("EME: isSessionUsable: MediaKeySession is usable",e.sessionId),!0)}function K(e,t,n){return(0,A.P)((function(){var i=e.loadedSessionsStore,a=e.persistentSessionsStore;return"temporary"===n?V(i,t):null===a?(y.Z.warn("EME: Cannot create persistent MediaKeySession, PersistentSessionsStore not created."),V(i,t)):function(e,t,n){return(0,A.P)((function(){y.Z.info("EME: Creating persistent MediaKeySession");var i=e.createSession(n,"persistent-license"),a=t.getAndReuse(n);if(null===a)return(0,r.of)({type:"created-session",value:{mediaKeySession:i,sessionType:"persistent-license"}});var o=function(){return y.Z.info("EME: Removing previous persistent session."),null!==t.get(n)&&t.delete(n),e.closeSession(n).pipe((0,v.U)((function(){return{type:"created-session",value:{mediaKeySession:e.createSession(n,"persistent-license"),sessionType:"persistent-license"}}})))};return function(e,t){return(0,A.P)((function(){return y.Z.info("Compat/EME: Load persisted session",t),(0,F.Z)((function(){return(0,I.Z)(e.load(t))}),void 0)})).pipe((0,l.z)((function(t){return!t||e.keyStatuses.size>0?(0,r.of)(t):(0,B.S)((0,U.H)(100),(0,g.eX)(e)).pipe((0,f.q)(1),(0,O.h)(t))})))}(i,a.sessionId).pipe((0,l.z)((function(e){return e?e&&z(i)?(t.add(n,i),y.Z.info("EME: Succeeded to load persistent session."),(0,r.of)({type:"loaded-persistent-session",value:{mediaKeySession:i,sessionType:"persistent-license"}})):(y.Z.warn("EME: Previous persistent session not usable anymore."),o()):(y.Z.warn("EME: No data stored for the loaded session"),t.delete(n),(0,r.of)({type:"created-session",value:{mediaKeySession:i,sessionType:"persistent-license"}}))})),(0,h.K)((function(e){return y.Z.warn("EME: Unable to load persistent session: "+(e instanceof Error?e.toString():"Unknown Error")),o()})))}))}(i,a,t)}))}function V(e,t){return(0,A.P)((function(){y.Z.info("EME: Creating a new temporary session");var n=e.createSession(t,"temporary");return(0,r.of)({type:"created-session",value:{mediaKeySession:n,sessionType:"temporary"}})}))}function G(e,t,n,o){return(0,A.P)((function(){var s=null,d=t.loadedSessionsStore,c=t.persistentSessionsStore,f=d.getAndReuse(e);if(null!==f){if(z(s=f.mediaKeySession))return y.Z.info("EME: Reuse loaded session",s.sessionId),(0,r.of)({type:"loaded-open-session",value:{mediaKeySession:s,sessionType:f.sessionType,initializationData:e}});null!==c&&c.delete(e)}return(null!=s?d.closeSession(e):(0,r.of)(null)).pipe((0,l.z)((function(){return(0,i.z)(function(e,t){if(t<0||t>=e.getLength())return u.E;for(var n=[],r=e.getAll().slice(),i=r.length-t,o=0;o=a.length){var n=new R.Z("INCOMPATIBLE_KEYSYSTEMS","No key system compatible with your wanted configuration has been found in the current browser.");return(0,o._)((function(){return n}))}if(null==H.N){var r=Error("requestMediaKeySystemAccess is not implemented in your browser.");return(0,o._)((function(){return r}))}var i=a[t],s=i.keyName,u=i.keyType,l=i.keySystemOptions,d=function(e,t){var n=["temporary"],r="optional",i="optional";!0===t.persistentLicense&&(r="required",n.push("persistent-license")),!0===t.persistentStateRequired&&(r="required"),!0===t.distinctiveIdentifierRequired&&(i="required");var a=null!=t.videoRobustnesses?t.videoRobustnesses:"widevine"===e?X:[],o=null!=t.audioRobustnesses?t.audioRobustnesses:"widevine"===e?X:[];return 0===a.length&&a.push(void 0),0===o.length&&o.push(void 0),[{initDataTypes:["cenc"],videoCapabilities:(0,q.Z)(a,(function(e){return[{contentType:'video/mp4;codecs="avc1.4d401e"',robustness:e},{contentType:'video/mp4;codecs="avc1.42e01e"',robustness:e},{contentType:'video/webm;codecs="vp8"',robustness:e}]})),audioCapabilities:(0,q.Z)(o,(function(e){return[{contentType:'audio/mp4;codecs="mp4a.40.2"',robustness:e},{contentType:"audio/webm;codecs=opus",robustness:e}]})),distinctiveIdentifier:i,persistentState:r,sessionTypes:n}]}(s,l);return y.Z.debug("EME: Request keysystem access "+u+","+(t+1)+" of "+a.length,d),(0,H.N)(u,d).pipe((0,v.U)((function(e){return y.Z.info("EME: Found compatible keysystem",u,d),{type:"create-media-key-system-access",value:{options:l,mediaKeySystemAccess:e}}})),(0,h.K)((function(){return y.Z.debug("EME: Rejected access to keysystem",u,d),e(t+1)})))}(0)}))}var ee=n(2870),te=new WeakMap,ne=function(e){te.set(e,null)},re=function(e,t){var n=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer),r=(0,ee.Z)(n);te.set(e,{hash:r,serverCertificate:n})},ie=function(e){var t=te.get(e);return void 0!==t&&(null!==t||void 0)},ae=function(e,t){var n=te.get(e);if(null==n)return!1;var r=n.hash,i=n.serverCertificate,a=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer);if((0,ee.Z)(a)!==r||i.length!==a.length)return!1;for(var o=0;ooe)return t(r);var o=Math.min(Math.pow(2,i)*se,ue);return y.Z.warn("EME: attempt to close a mediaKeySession failed, scheduling retry...",o),(0,B.S)([(0,U.H)(o),(0,g.eX)(e),(0,g.GJ)(e)]).pipe((0,f.q)(1),(0,l.z)((function(){return n(a)})))})))}(0);function t(e){return y.Z.error("EME: Could not close MediaKeySession: "+(e instanceof Error?e.toString():"Unknown error")),(0,r.of)(null)}}var de=n(9689),ce=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,de.J)(this.initData)},e.decode=function(e){return(0,de.K)(e)},e}();function fe(e,t){var n,r;return null!==(r=null!==(n=pe(e,t))&&void 0!==n?n:pe(t,e))&&void 0!==r&&r}function pe(e,t){if(0===e.length)return!1;if(t.length=0?this._storage[t].payload:void 0},t.getAndReuse=function(e){var t=this._findIndex(e);if(-1!==t){var n=this._storage.splice(t,1)[0];return this._storage.push(n),n.payload}},t.store=function(e,t){var n=this._findIndex(e);n>=0&&this._storage.splice(n,1);var r=this._formatValuesForStore(e.values);this._storage.push({type:e.type,values:r,payload:t})},t.storeIfNone=function(e,t){if(this._findIndex(e)>=0)return!1;var n=this._formatValuesForStore(e.values);return this._storage.push({type:e.type,values:n,payload:t}),!0},t.remove=function(e){var t=this._findIndex(e);if(-1!==t)return this._storage.splice(t,1)[0].payload},t._findIndex=function(e){for(var t=this._formatValuesForStore(e.values),n=this._storage.length-1;n>=0;n--){var r=this._storage[n];if(r.type===e.type&&fe(r.values,t))return n}return-1},t._formatValuesForStore=function(e){return e.slice().sort((function(e,t){return e.systemId===t.systemId?0:void 0===e.systemId?1:void 0===t.systemId||e.systemId=0?function(e,t){var n=(0,Ie.q)(e)?{first:e}:"number"==typeof e?{each:e}:e,r=n.first,i=n.each,a=n.with,o=void 0===a?De:a,s=n.scheduler,u=void 0===s?null!=t?t:xe.z:s,l=n.meta,d=void 0===l?null:l;if(null==r&&null==i)throw new TypeError("No timeout provided.");return(0,Ze.e)((function(e,t){var n,a,s=null,l=0,c=function(e){a=(0,Ce.A)(t,u,(function(){n.unsubscribe(),(0,Me.Xf)(o({meta:d,lastValue:s,seen:l})).subscribe(t)}),e)};n=e.subscribe(new Pe.Q(t,(function(e){null==a||a.unsubscribe(),l++,t.next(s=e),i>0&&c(i)}),void 0,void 0,(function(){(null==a?void 0:a.closed)||null==a||a.unsubscribe(),s=null}))),c(null!=r?"number"==typeof r?r:+r-u.now():i)}))}(n):Ae.y)})),T=function(e,t){return{totalRetry:null!=t?t:2,baseDelay:200,maxDelay:3e3,shouldRetry:function(e){return e instanceof Ne||(0,D.Z)(e)||!0!==e.noRetry},onRetry:function(t){return e.next({type:"warning",value:qe(t)})}}}(d,f.retry);return(o=b,s=T,u=s.baseDelay,c=s.maxDelay,p=s.totalRetry,m=s.shouldRetry,g=s.onRetry,_=0,o.pipe((0,h.K)((function(e,t){if(!(0,D.Z)(m)&&!m(e)||_++>=p)throw e;"function"==typeof g&&g(e,_);var n=Math.min(u*Math.pow(2,_-1),c),r=(0,Be.Z)(n);return(0,U.H)(r).pipe((0,l.z)((function(){return t})))})))).pipe((0,v.U)((function(t){return{type:"key-message-handled",value:{session:e,license:t}}})),(0,h.K)((function(e){var t=qe(e);if(!(0,D.Z)(e)&&!0===e.fallbackOnLastTry)throw y.Z.warn("EME: Last `getLicense` attempt failed. Blacklisting the current session."),new We(t);throw t})),(0,L.O)({type:"session-message",value:{messageType:a,initializationData:i}}))}))),b=(0,a.T)(_,g).pipe((o=function(t){switch(t.type){case"key-message-handled":case"key-status-change-handled":return function(e,t,n){return(0,D.Z)(t)?(y.Z.info("EME: No message given, skipping session.update"),(0,r.of)({type:"no-update",value:{initializationData:n}})):(y.Z.info("EME: Updating MediaKeySession with message"),(0,I.Z)(e.update(t)).pipe((0,h.K)((function(e){var t=e instanceof Error?e.toString():"`session.update` failed";throw new R.Z("KEY_UPDATE_ERROR",t)})),(0,p.b)((function(){y.Z.info("EME: MediaKeySession update succeeded.")})),(0,O.h)({type:"session-updated",value:{session:e,license:t,initializationData:n}})))}(e,t.value.license,i);default:return(0,r.of)(t)}},(0,Oe.m)(s)?(0,l.z)(o,s,1):(0,l.z)(o,1))),T=(0,a.T)(Ye(e,t,n),b,m,d);return(0,D.Z)(e.closed)?T:T.pipe((0,Le.R)((0,I.Z)(e.closed)))}function Ye(e,t,n){return(0,A.P)((function(){if(0===e.keyStatuses.size)return u.E;var a=Ke(e,t,n),o=a.warnings,s=a.blacklistedKeyIDs,l=a.whitelistedKeyIds,d=o.length>0?r.of.apply(void 0,o):u.E,c=(0,r.of)({type:"keys-update",value:{whitelistedKeyIds:l,blacklistedKeyIDs:s}});return(0,i.z)(d,c)}))}function qe(e){if(e instanceof Ne)return new R.Z("KEY_LOAD_TIMEOUT","The license server took too much time to respond.");var t=new R.Z("KEY_LOAD_ERROR","An error occured when calling `getLicense`.");return!(0,D.Z)(e)&&(0,ge.Z)(e.message)&&(t.message=e.message),t}function Xe(e,t){return(0,A.P)((function(){return"function"!=typeof e.setServerCertificate?(y.Z.warn("EME: Could not set the server certificate. mediaKeys.setServerCertificate is not a function"),u.E):!0===ie(e)?(y.Z.info("EME: The MediaKeys already has a server certificate, skipping..."),u.E):(y.Z.info("EME: Setting server certificate on the MediaKeys"),ne(e),function(e,t){return(0,A.P)((function(){return(0,F.Z)((function(){return(0,I.Z)(e.setServerCertificate(t))}),void 0).pipe((0,h.K)((function(e){y.Z.warn("EME: mediaKeys.setServerCertificate returned an error",e);var t=e instanceof Error?e.toString():"`setServerCertificate` error";throw new R.Z("LICENSE_SERVER_CERTIFICATE_ERROR",t)})))}))}(e,t).pipe((0,p.b)((function(){re(e,t)})),(0,m.l)(),(0,h.K)((function(e){return(0,r.of)({type:"warning",value:e})}))))}))}var je=M.Z.EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS,Qe=M.Z.EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION,Je=g.Oh;var et=function(e,t,n){y.Z.debug("EME: Starting EMEManager logic.");var g=new ve,_=new ve,E=Te(e,t).pipe((0,l.z)((function(e){if("attached-media-keys"!==e.type)return(0,r.of)(e);var t=e.value,n=t.mediaKeys,a=t.options.serverCertificate;return(0,D.Z)(a)?(0,r.of)(e):(0,i.z)(Xe(n,a),(0,r.of)(e))})),(0,d.d)()),w=E.pipe((0,c.h)((function(e){return"attached-media-keys"===e.type})),(0,f.q)(1)),S=Je(e).pipe((0,p.b)((function(e){y.Z.debug("EME: Encrypted event received from media element.",e)})),(0,N.Z)((function(e){return k(e)}),null),(0,d.d)({refCount:!0})),A=n.pipe((0,p.b)((function(e){y.Z.debug("EME: Encrypted event received from Player",e)}))),x=(0,a.T)(A,S).pipe((0,l.z)((function(e){return w.pipe((0,v.U)((function(t){return[e,t]})))})),(0,l.z)((function(e){var t=e[0],n=e[1],i=n.value,d=i.mediaKeySystemAccess,c=i.stores,f=i.options,p=_.get(t);if(void 0!==p){if(void 0===t.type){y.Z.error("EME: The current session has already been blacklisted but the current content is not known. Throwing.");var E=p.sessionError;return E.fatal=!0,(0,o._)((function(){return E}))}return y.Z.warn("EME: The current session has already been blacklisted. Blacklisting content."),(0,r.of)({type:"blacklist-protection-data",value:t})}var w,S=new s.t(1);if("content"===f.singleLicensePer&&!g.isEmpty()){var k=t.keyIds;if(void 0===k)return y.Z.warn("EME: Initialization data linked to unknown key id, we'll not able to fallback from it."),(0,r.of)({type:"init-data-ignored",value:{initializationData:t}});var A=g.getAll()[0];return A.lastKeyUpdate$.pipe((0,l.z)((function(e){return k.every((function(t){for(var n=0;n0)(r=e.value.blacklistedKeyIDs).push.apply(r,a)}if(S.next(e.value),0===e.value.whitelistedKeyIds.length&&0===e.value.blacklistedKeyIDs.length||"temporary"===o||null===c.persistentSessionsStore||s)return e;var u=c.persistentSessionsStore;return function(e,t){if(!(isNaN(t)||t<0||t>=e.getLength())){var n=e.getLength(),r=n-t;y.Z.info("EME: Too many stored persistent sessions, removing some.",n,r),e.deleteOldSessions(r)}}(u,Qe-1),u.add(t,i),s=!0,e})),(0,h.K)((function(e){if(!(e instanceof We))throw e;_.store(t,e);var n=e.sessionError;if(void 0===t.type)throw y.Z.error("EME: Current session blacklisted and content not known. Throwing."),n.fatal=!0,n;return y.Z.warn("EME: Current session blacklisted. Blacklisting content."),(0,r.of)({type:"warning",value:n},{type:"blacklist-protection-data",value:t})})))})))})));return(0,a.T)(E,S.pipe((0,v.U)((function(e){return{type:"encrypted-event-received",value:e}}))),x)}},6033:function(e,t){"use strict";var n=new WeakMap;t.Z={setState:function(e,t){n.set(e,t)},getState:function(e){var t=n.get(e);return void 0===t?null:t},clearState:function(e){n.set(e,null)}}},4507:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(3071),i=n(2817),a=n(9127),o=n(6139);var s=n(8719),u=n(5157),l=n(7874),d=n(3887),c=s.Oh;function f(e,t,n){var s=(0,r.T)(c(e),n);return null==l.Z.emeManager?(0,r.T)(s.pipe((0,a.U)((function(){throw d.Z.error("Init: Encrypted event but EME feature not activated"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","EME feature not activated.")}))),(0,i.of)({type:"eme-disabled"})):0===t.length?(0,r.T)(s.pipe((0,a.U)((function(){throw d.Z.error("Init: Ciphered media and no keySystem passed"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Media is encrypted and no `keySystems` given")}))),(0,i.of)({type:"eme-disabled"})):"function"!=typeof o.N?(0,r.T)(s.pipe((0,a.U)((function(){throw d.Z.error("Init: Encrypted event but no EME API available"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Encryption APIs not found.")}))),(0,i.of)({type:"eme-disabled"})):(d.Z.debug("Init: Creating EMEManager"),l.Z.emeManager(e,t,n))}},8343:function(e,t){"use strict";var n={loaded:function(e){return{type:"loaded",value:{segmentBuffersStore:e}}},decipherabilityUpdate:function(e){return{type:"decipherabilityUpdate",value:e}},manifestReady:function(e){return{type:"manifestReady",value:{manifest:e}}},manifestUpdate:function(){return{type:"manifestUpdate",value:null}},nullRepresentation:function(e,t){return{type:"representationChange",value:{type:e,representation:null,period:t}}},reloadingMediaSource:function(){return{type:"reloading-media-source",value:void 0}},stalled:function(e){return{type:"stalled",value:e}},unstalled:function(){return{type:"unstalled",value:null}},warning:function(e){return{type:"warning",value:e}}};t.Z=n},2795:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(6362),i=n(2817),a=n(4975),o=n(4727),s=n(3833),u=n(9878),l=n(2006),d=n(8515),c=n(3994),f=n(3666);function p(){return f.op}var v=n(9917),h=n(8117),m=n(5561);var g=n(3774),y=n(8719);var _=n(3887);function b(e,t,n){var u=e.pipe((0,a.h)((function(e){var r=e.seeking,i=e.stalled,a=e.readyState,o=e.currentRange;return!r&&null===i&&(function(e,t){return!e||!f.SB||t}(n,t.hasAttribute("playsinline"))?(a>=4||3===a&&null!==o)&&(!p()||t.duration>0):a>=1&&t.duration>0)})),(0,o.q)(1),(0,s.h)("can-play"));return p()&&0===t.duration?(0,r.z)((0,i.of)("not-loaded-metadata"),u):u}function T(e){return function(e){return(0,v.P)((function(){return(0,m.Z)((function(){return(0,h.Z)(e.play())}),void 0)}))}(e).pipe((0,s.h)("autoplay"),(0,u.K)((function(e){if(e instanceof Error&&"NotAllowedError"===e.name)return _.Z.warn("Init: Media element can't play. It may be due to browser auto-play policies."),(0,i.of)("autoplay-blocked");throw e})))}function E(e){var t=e.clock$,n=e.mediaElement,r=e.startTime,a=e.mustAutoPlay,s=e.setCurrentTime,u=e.isDirectfile,f=function(e){return e.readyState>=g.cX.HAVE_METADATA?(0,i.of)(null):(0,y.K4)(e).pipe((0,o.q)(1))}(n).pipe((0,o.q)(1),(0,l.b)((function(){_.Z.info("Init: Set initial time",r);var e="function"==typeof r?r():r;s(e)})),(0,d.d)({refCount:!0})),p=f.pipe((0,c.z)((function(){return b(t,n,u).pipe((0,l.b)((function(){return _.Z.info("Init: Can begin to play content")})),(0,c.z)((function(e){return"can-play"===e?a?T(n):(n.autoplay&&_.Z.warn("Init: autoplay is enabled on HTML media element. Media will play as soon as possible."),(0,i.of)("loaded")):(0,i.of)(e)})))})),(0,d.d)({refCount:!0}));return{seek$:f,load$:p}}},8969:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(1545),i=n(2817),a=n(3071),o=n(3994),s=n(5583),u=n(533),l=n(9127),d=n(4975),c=n(4727),f=n(8902),p=n(1480),v=n(3887),h=n(5767);var m=n(3714),g=n(4437),y=n(4507),_=n(8343),b=n(2795),T=n(2447),E=n(2983);function w(e){var t=e.autoPlay,n=e.clock$,w=e.keySystems,S=e.mediaElement,k=e.speed$,A=e.setCurrentTime,x=e.startAt,I=e.url;if((0,h.Z)(S),null==I)throw new Error("No URL for a DirectFile content");var Z=function(e,t){return new p.y((function(n){return v.Z.info("Setting URL to Element",t,e),e.src=t,n.next(void 0),function(){(0,h.Z)(e)}}))}(S,I);v.Z.debug("Init: Calculating initial time");var M=function(){return function(e,t){if(null==t)return 0;if(null!=t.position)return t.position;if(null!=t.wallClockTime)return t.wallClockTime;if(null!=t.fromFirstPosition)return t.fromFirstPosition;var n=e.duration;if(null==n||!isFinite(n))return v.Z.warn("startAt.fromLastPosition set but no known duration, beginning at 0."),0;if("number"==typeof t.fromLastPosition)return Math.max(0,n+t.fromLastPosition);if(null!=t.percentage){var r=t.percentage;return r>=100?n:r<=0?0:n*(+r/100)}return 0}(S,x)};v.Z.debug("Init: Initial time calculated:",M);var R=(0,b.Z)({clock$:n,mediaElement:S,startTime:M,mustAutoPlay:t,setCurrentTime:A,isDirectfile:!0}),C=R.seek$,P=R.load$,N=Z.pipe((0,o.z)((function(){return(0,y.Z)(S,w,r.E)})),(0,g.Z)(),(0,s.B)()),D=(0,T.Z)(S),O=(0,E.Z)(S,k,n).pipe((0,u.l)()),L=n.pipe((0,l.U)((function(e){return null===e.stalled?_.Z.unstalled():_.Z.stalled(e.stalled)}))),B=N.pipe((0,d.h)((function(e){return"created-media-keys"===e.type?(e.value.attachMediaKeys$.next(),!0):"eme-disabled"===e.type||"attached-media-keys"===e.type})),(0,c.q)(1),(0,f.j)(P),(0,o.z)((function(e){if("autoplay-blocked"===e){var t=new m.Z("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");return(0,i.of)(_.Z.warning(t),_.Z.loaded(null))}if("not-loaded-metadata"===e){var n=new m.Z("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");return(0,i.of)(_.Z.warning(n))}return(0,i.of)(_.Z.loaded(null))}))),U=C.pipe((0,u.l)());return(0,a.T)(B,U,N,D,O,L)}},2447:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2401),i=n(3994),a=n(3714);function o(e){return(0,r.R)(e,"error").pipe((0,i.z)((function(){switch(null==e.error?0:e.error.code){case 1:throw new a.Z("MEDIA_ERR_ABORTED","The fetching of the associated resource was aborted by the user's request.");case 2:throw new a.Z("MEDIA_ERR_NETWORK","A network error occurred which prevented the media from being successfully fetched");case 3:throw new a.Z("MEDIA_ERR_DECODE","An error occurred while trying to decode the media resource");case 4:throw new a.Z("MEDIA_ERR_SRC_NOT_SUPPORTED","The media resource has been found to be unsuitable.");default:throw new a.Z("MEDIA_ERR_UNKNOWN","The HTMLMediaElement errored due to an unknown reason.")}})))}},2983:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(9917),i=n(2817),a=n(9127),o=n(8430),s=n(3741),u=n(4978),l=n(2006),d=n(3887);function c(e,t,n){return n.pipe((0,a.U)((function(e){return null!==e.stalled})),(0,o.O)(!1),(0,s.x)()).pipe((0,u.w)((function(n){return n?(0,r.P)((function(){return d.Z.info("Init: Pause playback to build buffer"),e.playbackRate=0,(0,i.of)(0)})):t.pipe((0,l.b)((function(t){d.Z.info("Init: Resume playback speed",t),e.playbackRate=t})))})))}},7127:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1788),i=n(9917),a=n(2817),o=n(3887),s=n(4123),u=n(4309),l=function(e){function t(){var t;return o.Z.debug("ISB: Creating ImageSegmentBuffer"),(t=e.call(this)||this).bufferType="image",t._buffered=new u.Z,t}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,i.P)((function(){var n,r;if(o.Z.debug("ISB: appending new data."),null===e.data.chunk)return(0,a.of)(void 0);var i=e.data,s=i.appendWindow,u=i.chunk,l=u.start,d=u.end,c=u.timescale,f=null!==(n=s[0])&&void 0!==n?n:0,p=null!==(r=s[1])&&void 0!==r?r:1/0,v=l/c,h=d/c,m=Math.max(f,v),g=Math.min(p,h);return t._buffered.insert(m,g),null!==e.inventoryInfos&&t._segmentInventory.insertChunk(e.inventoryInfos),(0,a.of)(void 0)}))},n.removeBuffer=function(e,t){return(0,i.P)((function(){return o.Z.info("ISB: ignored image data remove order",e,t),(0,a.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,i.P)((function(){return t._segmentInventory.completeSegment(e),(0,a.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){o.Z.debug("ISB: disposing image SegmentBuffer"),this._buffered.remove(0,1/0)},t}(s.C)},5192:function(e,t,n){"use strict";n.d(t,{Z:function(){return L}});var r=n(1788),i=n(3071),a=n(6697),o=n(6362),s=n(2817),u=n(6716),l=n(9917),d=n(8430),c=n(8550),f=n(3833),p=n(3505),v=n(8719),h=n(1480),m=n(9127),g=n(3741),y=n(3887),_=n(2203).Z?void 0:window.ResizeObserver;var b=n(944),T=n(4123),E=n(4309),w=n(7874);function S(e,t){return Math.abs(e-t)<=.2}function k(e,t){for(var n=e.length-1;n>=0;n--){if(e[n].startt)return e.slice(n,e.length)}return[]}function x(e,t,n){var r=Math.max(e.start,t),i=k(e.cues,t),a={start:e.start,end:r,cues:i},o=Math.min(n,e.end),s=A(e.cues,n);return[a,{start:o,end:e.end,cues:s}]}var I=function(){function e(){this._cuesBuffer=[]}var t=e.prototype;return t.get=function(e){for(var t=this._cuesBuffer,n=[],r=t.length-1;r>=0;r--){var i=t[r];if(e=i.start){for(var a=i.cues,o=0;o=a[o].start&&ee){var a=r[i];if(a.start>=n)return;if(a.end>=n){if(e<=a.start)a.cues=A(a.cues,n),a.start=n;else{var o=x(a,e,n),s=o[0],u=o[1];this._cuesBuffer[i]=s,r.splice(i+1,0,u)}return}a.start>=e?(r.splice(i,1),i--):(a.cues=k(a.cues,e),a.end=Math.max(e,a.start))}},t.insert=function(e,t,n){var r=this._cuesBuffer,i={start:t,end:n,cues:e};function a(e){var t=r[e];void 0===t||S(i.end,t.end)?r[e]=i:(t.start>=i.end||(t.cues=A(t.cues,i.end),t.start=i.end),r.splice(e,0,i))}for(var o=0;os.end);return void a(o)}if(ts.end);return void a(o)}if(S(s.end,n))return s.cues=k(s.cues,t),s.end=t,void r.splice(o+1,0,i);if(s.end>n){var u=x(s,t,n),l=u[0],d=u[1];return this._cuesBuffer[o]=l,r.splice(o+1,0,i),void r.splice(o+2,0,d)}for(s.cues=k(s.cues,t),s.end=t,s=r[o+1];void 0!==s&&n>s.end;)r.splice(o,1),s=r[o];return void a(o)}}r.push(i)},e}();function Z(e,t,n,r){for(var i=[t/n.columns,e/n.rows],a=r.getElementsByClassName("proportional-style"),o=0;o0}var M=v.C1,R=v.ik,C=v.d5,P=b.Z.MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,N=b.Z.TEXT_TRACK_SIZE_CHECKS_INTERVAL;function D(e,t){try{e.removeChild(t)}catch(e){y.Z.warn("HTSB: Can't remove text track: not in the element.")}}function O(e){var t=e.getAttribute("data-resolution-rows"),n=e.getAttribute("data-resolution-columns");if(null===t||null===n)return null;var r=parseInt(t,10),i=parseInt(n,10);return null===r||null===i?null:{rows:r,columns:i}}var L=function(e){function t(t,n){var r;return y.Z.debug("HTSB: Creating HTMLTextSegmentBuffer"),(r=e.call(this)||this).bufferType="text",r._buffered=new E.Z,r._videoElement=t,r._textTrackElement=n,r._clearSizeUpdates$=new u.x,r._destroy$=new u.x,r._buffer=new I,r._currentCues=[],function(e){var t=C(e),n=R(e),r=M(e),u=(0,i.T)(n,r),l=(0,a.F)(P).pipe((0,d.O)(null));return u.pipe((0,d.O)(null),(0,c.c)((0,o.z)(l.pipe((0,f.h)(!0),(0,p.R)(t)),(0,s.of)(!1))))}(r._videoElement).pipe((0,p.R)(r._destroy$)).subscribe((function(e){if(e){var t=Math.max(r._videoElement.currentTime+P/1e3/2,0),n=r._buffer.get(t);0===n.length?r._disableCurrentCues():r._displayCues(n)}else r._disableCurrentCues()})),r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,l.P)((function(){return t.pushChunkSync(e),(0,s.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,l.P)((function(){return n.removeBufferSync(e,t),(0,s.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,l.P)((function(){return t._segmentInventory.completeSegment(e),(0,s.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){y.Z.debug("HTSB: Disposing HTMLTextSegmentBuffer"),this._disableCurrentCues(),this._buffer.remove(0,1/0),this._buffered.remove(0,1/0),this._destroy$.next(),this._destroy$.complete()},n.pushChunkSync=function(e){var t,n;y.Z.debug("HTSB: Appending new html text tracks");var r=e.data,i=r.timestampOffset,a=r.appendWindow,o=r.chunk;if(null!==o){var s,u,l=o.start,d=o.end,c=o.data,f=o.type,p=o.language,v=null!==(t=a[0])&&void 0!==t?t:0,h=null!==(n=a[1])&&void 0!==n?n:1/0,m=function(e,t,n,r){y.Z.debug("HTSB: Finding parser for html text tracks:",e);var i=w.Z.htmlTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");y.Z.debug("HTSB: Parser found, parsing...");var a=i(t,n,r);return y.Z.debug("HTTB: Parsed successfully!",a),a}(f,c,i,p);if(0!==v&&h!==1/0){for(var g=0;g=0&&m[g].start>=h;)g--;for(m.splice(g,m.length),g=m.length-1;g>=0&&m[g].end>h;)m[g].end=h,g--}if(void 0!==l)s=Math.max(v,l);else{if(m.length<=0)return void y.Z.warn("HTSB: Current text tracks have no cues nor start time. Aborting");y.Z.warn("HTSB: No start time given. Guessing from cues."),s=m[0].start}if(void 0!==d)u=Math.min(h,d);else{if(m.length<=0)return void y.Z.warn("HTSB: Current text tracks have no cues nor end time. Aborting");y.Z.warn("HTSB: No end time given. Guessing from cues."),u=m[m.length-1].end}u<=s?y.Z.warn("HTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."):(null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos),this._buffer.insert(m,s,u),this._buffered.insert(s,u))}},n.removeBufferSync=function(e,t){y.Z.debug("HTSB: Removing html text track data",e,t),this._buffer.remove(e,t),this._buffered.remove(e,t)},n._disableCurrentCues=function(){if(this._clearSizeUpdates$.next(),this._currentCues.length>0){for(var e=0;e0&&function(e,t){return(0,l.P)((function(){if(void 0!==_){var n=-1,r=-1;return new h.y((function(t){var i=new _((function(e){if(0!==e.length){var i=e[0].contentRect,a=i.height,o=i.width;a===n&&o===r||(n=a,r=o,t.next({height:a,width:o}))}else y.Z.error("Compat: Resized but no observed element.")}));return i.observe(e),function(){i.disconnect()}}))}return(0,a.F)(t).pipe((0,d.O)(null),(0,m.U)((function(){var t=e.getBoundingClientRect();return{height:t.height,width:t.width}})),(0,g.x)((function(e,t){return e.height===t.height&&e.width===t.width})))}))}(this._textTrackElement,N).pipe((0,p.R)(this._clearSizeUpdates$),(0,p.R)(this._destroy$)).subscribe((function(e){for(var t=e.height,n=e.width,r=0;r0?e.textTracks[u-1]:e.addTextTrack(s)).mode=t?null!==(n=i.HIDDEN)&&void 0!==n?n:"hidden":null!==(r=i.SHOWING)&&void 0!==r?r:"showing"}else a=document.createElement("track"),e.appendChild(a),i=a.track,a.kind=s,i.mode=t?"hidden":"showing";return{track:i,trackElement:a}}(t,n),a=i.track,u=i.trackElement;return r.bufferType="text",r._buffered=new d.Z,r._videoElement=t,r._track=a,r._trackElement=u,r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,i.P)((function(){var n,r;if(s.Z.debug("NTSB: Appending new native text tracks"),null===e.data.chunk)return(0,a.of)(void 0);var i,o,u=e.data,l=u.timestampOffset,d=u.appendWindow,f=u.chunk,p=f.start,v=f.end,h=f.data,m=f.type,g=f.language,y=null!==(n=d[0])&&void 0!==n?n:0,_=null!==(r=d[1])&&void 0!==r?r:1/0,b=function(e,t,n,r){s.Z.debug("NTSB: Finding parser for native text tracks:",e);var i=c.Z.nativeTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");s.Z.debug("NTSB: Parser found, parsing...");var a=i(t,n,r);return s.Z.debug("NTSB: Parsed successfully!",a),a}(m,h,l,g);if(0!==y&&_!==1/0){for(var T=0;T=0&&b[T].startTime>=_;)T--;for(b.splice(T,b.length),T=b.length-1;T>=0&&b[T].endTime>_;)b[T].endTime=_,T--}if(void 0!==p)i=Math.max(y,p);else{if(b.length<=0)return s.Z.warn("NTSB: Current text tracks have no cues nor start time. Aborting"),(0,a.of)(void 0);s.Z.warn("NTSB: No start time given. Guessing from cues."),i=b[0].startTime}if(void 0!==v)o=Math.min(_,v);else{if(b.length<=0)return s.Z.warn("NTSB: Current text tracks have no cues nor end time. Aborting"),(0,a.of)(void 0);s.Z.warn("NTSB: No end time given. Guessing from cues."),o=b[b.length-1].endTime}if(o<=i)return s.Z.warn("NTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."),(0,a.of)(void 0);if(b.length>0){var E=b[0],w=t._track.cues;null!==w&&w.length>0&&E.startTime=0;i--){var a=r[i],o=a.startTime,l=a.endTime;o>=e&&o<=t&&l<=t&&u(n,a)}this._buffered.remove(e,t)},t}(l.C)},4123:function(e,t,n){"use strict";n.d(t,{C:function(){return m},f:function(){return h}});var r=n(944),i=n(3887),a=n(5952),o=n(5278),s=r.Z.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,u=r.Z.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE,l=r.Z.MINIMUM_SEGMENT_SIZE,d=function(){function e(){this._inventory=[]}var t=e.prototype;return t.reset=function(){this._inventory.length=0},t.synchronizeBuffered=function(e){for(var t=this._inventory,n=0,r=t[0],a=null==r?void 0:r.infos.adaptation.type,s=e.length,u=0;u0){var g=t[f+m-1];h={end:(0,o.Z)(g.bufferedEnd,g.end),precizeEnd:g.precizeEnd},i.Z.debug("SI: "+m+" segments GCed.",a),t.splice(f,m),n=f}if(void 0===r)return;if(c-(0,o.Z)(r.bufferedStart,r.start)>=l){if(p(r,d,h,a),n===t.length-1)return void v(r,c,a);r=t[++n];for(var y=(0,o.Z)(r.bufferedStart,r.start),_=(0,o.Z)(r.bufferedEnd,r.end),b=u=l&&(void 0===b||c-y>=_-b);){var T=t[n-1];void 0===T.bufferedEnd&&(T.bufferedEnd=r.precizeStart?r.start:T.end,i.Z.debug("SI: calculating buffered end of contiguous segment",a,T.bufferedEnd,T.end)),r.bufferedStart=T.bufferedEnd,void 0!==(r=t[++n])&&(y=(0,o.Z)(r.bufferedStart,r.start),_=(0,o.Z)(r.bufferedEnd,r.end))}}var E=t[n-1];void 0!==E&&v(E,c,a)}}null!=r&&(i.Z.debug("SI: last segments have been GCed",a,n,t.length),t.splice(n,t.length-n)),void 0!==a&&"DEBUG"===i.Z.getLevel()&&i.Z.debug("SI: current "+a+" inventory timeline:\n"+function(e){var t=1/60,n={},r=[],i=null,a=null;function o(e){var t=String.fromCharCode(r.length+65);return r.push({letter:t,periodId:e.period.id,representationId:e.representation.id,bitrate:e.representation.bitrate}),t}for(var s="",u=0;u=s)i.Z.warn("SI: Invalid chunked inserted: starts before it ends",u,o,s);else{for(var l=this._inventory,d={partiallyPushed:!0,estimatedStart:o,start:o,end:s,precizeStart:!1,precizeEnd:!1,bufferedStart:void 0,bufferedEnd:void 0,infos:{segment:a,period:t,adaptation:n,representation:r}},c=l.length-1;c>=0;c--){var f=l[c];if(f.start<=o){if(f.end<=o){for(i.Z.debug("SI: Pushing segment strictly after previous one.",u,o,f.end),this._inventory.splice(c+1,0,d),c+=2;cd.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,d.end,l[c].start),l[c].start=d.end,l[c].bufferedStart=void 0,void(l[c].precizeStart=l[c].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[c].start,l[c].end),l.splice(c,1)}return}if(f.start===o){if(f.end<=s){for(i.Z.debug("SI: Segment pushed replace another one",u,o,s,f.end),this._inventory.splice(c,1,d),c+=1;cd.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,d.end,l[c].start),l[c].start=d.end,l[c].bufferedStart=void 0,void(l[c].precizeStart=l[c].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[c].start,l[c].end),l.splice(c,1)}return}return i.Z.debug("SI: Segment pushed ends before another with the same start",u,o,s,f.end),l.splice(c,0,d),f.start=d.end,f.bufferedStart=void 0,void(f.precizeStart=f.precizeStart&&d.precizeEnd)}if(f.end<=d.end){for(i.Z.debug("SI: Segment pushed updates end of previous one",u,o,s,f.start,f.end),this._inventory.splice(c+1,0,d),f.end=d.start,f.bufferedEnd=void 0,f.precizeEnd=f.precizeEnd&&d.precizeStart,c+=2;cd.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,d.end,l[c].start),l[c].start=d.end,l[c].bufferedStart=void 0,void(l[c].precizeStart=l[c].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[c].start,l[c].end),l.splice(c,1)}return}i.Z.debug("SI: Segment pushed is contained in a previous one",u,o,s,f.start,f.end);var p={partiallyPushed:f.partiallyPushed,start:d.end,end:f.end,precizeStart:f.precizeStart&&f.precizeEnd&&d.precizeEnd,precizeEnd:f.precizeEnd,bufferedStart:void 0,bufferedEnd:f.end,infos:f.infos};return f.end=d.start,f.bufferedEnd=void 0,f.precizeEnd=f.precizeEnd&&d.precizeStart,l.splice(c+1,0,d),void l.splice(c+2,0,p)}}var v=this._inventory[0];if(void 0===v)return i.Z.debug("SI: first segment pushed",u,o,s),void this._inventory.push(d);if(!(v.start>=s)){if(v.end<=s){for(i.Z.debug("SI: Segment pushed starts before and completely recovers the previous first one",u,o,s,v.start,v.end),this._inventory.splice(0,1,d);l.length>1&&l[1].startd.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,d.end,l[1].start),l[1].start=d.end,l[1].bufferedStart=void 0,void(l[1].precizeStart=d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[1].start,l[1].end),l.splice(1,1)}return}return i.Z.debug("SI: Segment pushed start of the next one",u,o,s,v.start,v.end),v.start=s,v.bufferedStart=void 0,v.precizeStart=d.precizeEnd,void this._inventory.splice(0,0,d)}i.Z.debug("SI: Segment pushed comes before all previous ones",u,o,s,v.start),this._inventory.splice(0,0,d)}}},t.completeSegment=function(e){if(!e.segment.isInit){for(var t=this._inventory,n=!1,r=0;r0&&(this._inventory.splice(o+1,u),r-=u),this._inventory[o].partiallyPushed=!1,this._inventory[o].end=l,this._inventory[o].bufferedEnd=d}n||i.Z.warn("SI: Completed Segment not found",e)}},t.getInventory=function(){return this._inventory},e}();function c(e){if(void 0===e.bufferedStart||e.partiallyPushed)return!1;var t=e.start,n=e.end-t;return Math.abs(t-e.bufferedStart)<=s&&(void 0===e.bufferedEnd||e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-n)<=Math.min(u,n/3))}function f(e){if(void 0===e.bufferedEnd||e.partiallyPushed)return!1;var t=e.start,n=e.end,r=n-t;return Math.abs(n-e.bufferedEnd)<=s&&null!=e.bufferedStart&&e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-r)<=Math.min(u,r/3)}function p(e,t,n,r){void 0!==e.bufferedStart?(e.bufferedStartt&&(n.precizeEnd||e.start-n.end<=s)?(i.Z.debug("SI: buffered start is end of previous segment",r,t,e.start,n.end),e.bufferedStart=n.end,c(e)&&(e.start=n.end,e.precizeStart=!0)):e.start-t<=s?(i.Z.debug("SI: found true buffered start",r,t,e.start),e.bufferedStart=t,c(e)&&(e.start=t,e.precizeStart=!0)):tt&&(i.Z.debug("SI: Segment partially GCed at the end",n,e.bufferedEnd,t),e.bufferedEnd=t),!e.precizeEnd&&t-e.end<=s&&f(e)&&(e.precizeEnd=!0,e.end=t)):e.precizeEnd?(i.Z.debug("SI: buffered end is precize end",n,e.end),e.bufferedEnd=e.end):t-e.end<=s?(i.Z.debug("SI: found true buffered end",n,t,e.end),e.bufferedEnd=t,f(e)&&(e.end=t,e.precizeEnd=!0)):t>e.end?(i.Z.debug("SI: range end too far from expected end",n,t,e.end),e.bufferedEnd=e.end):(i.Z.debug("SI: Segment appears immediately garbage collected at the end",n,e.bufferedEnd,t),e.bufferedEnd=t)}var h,m=function(){function e(){this._segmentInventory=new d}var t=e.prototype;return t.synchronizeInventory=function(){this._segmentInventory.synchronizeBuffered(this.getBufferedRanges())},t.getInventory=function(){return this._segmentInventory.getInventory()},t.getPendingOperations=function(){return[]},e}();!function(e){e[e.Push=0]="Push",e[e.Remove=1]="Remove",e[e.EndOfSegment=2]="EndOfSegment"}(h||(h={}))},4309:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2829),i=function(){function e(){this._ranges=[],this.length=0}var t=e.prototype;return t.insert=function(e,t){(0,r.kR)(this._ranges,{start:e,end:t}),this.length=this._ranges.length},t.remove=function(e,t){var n=[];e>0&&n.push({start:0,end:e}),t<1/0&&n.push({start:t,end:1/0}),this._ranges=(0,r.tn)(this._ranges,n),this.length=this._ranges.length},t.start=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].start},t.end=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].end},e}()},3801:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3349),i=n(1788),a=function(e){function t(n){var i;return i=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(i),t.prototype),i.name="AssertionError",i.message=n,i}return(0,i.Z)(t,e),t}((0,n(3786).Z)(Error))},7839:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3349),i=n(1788),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="CustomLoaderError",s.message=n,s.canRetry=i,s.isOfflineError=a,s.xhr=o,s}return(0,i.Z)(t,e),t}((0,n(3786).Z)(Error))},5157:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(3349),i=n(1788),a=n(3786),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="EncryptedMediaError",a.type=o.ZB.ENCRYPTED_MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},5992:function(e,t,n){"use strict";n.d(t,{ZB:function(){return r},br:function(){return i},SM:function(){return a}});var r={NETWORK_ERROR:"NETWORK_ERROR",MEDIA_ERROR:"MEDIA_ERROR",ENCRYPTED_MEDIA_ERROR:"ENCRYPTED_MEDIA_ERROR",OTHER_ERROR:"OTHER_ERROR"},i={TIMEOUT:"TIMEOUT",ERROR_EVENT:"ERROR_EVENT",ERROR_HTTP_CODE:"ERROR_HTTP_CODE",PARSE_ERROR:"PARSE_ERROR"},a={PIPELINE_LOAD_ERROR:"PIPELINE_LOAD_ERROR",PIPELINE_PARSE_ERROR:"PIPELINE_PARSE_ERROR",INTEGRITY_ERROR:"INTEGRITY_ERROR",MANIFEST_PARSE_ERROR:"MANIFEST_PARSE_ERROR",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"MANIFEST_INCOMPATIBLE_CODECS_ERROR",MANIFEST_UPDATE_ERROR:"MANIFEST_UPDATE_ERROR",MANIFEST_UNSUPPORTED_ADAPTATION_TYPE:"MANIFEST_UNSUPPORTED_ADAPTATION_TYPE",MEDIA_STARTING_TIME_NOT_FOUND:"MEDIA_STARTING_TIME_NOT_FOUND",MEDIA_TIME_BEFORE_MANIFEST:"MEDIA_TIME_BEFORE_MANIFEST",MEDIA_TIME_AFTER_MANIFEST:"MEDIA_TIME_AFTER_MANIFEST",MEDIA_TIME_NOT_FOUND:"MEDIA_TIME_NOT_FOUND",NO_PLAYABLE_REPRESENTATION:"NO_PLAYABLE_REPRESENTATION",MEDIA_IS_ENCRYPTED_ERROR:"MEDIA_IS_ENCRYPTED_ERROR",CREATE_MEDIA_KEYS_ERROR:"CREATE_MEDIA_KEYS_ERROR",KEY_ERROR:"KEY_ERROR",KEY_STATUS_CHANGE_ERROR:"KEY_STATUS_CHANGE_ERROR",KEY_UPDATE_ERROR:"KEY_UPDATE_ERROR",KEY_LOAD_ERROR:"KEY_LOAD_ERROR",KEY_LOAD_TIMEOUT:"KEY_LOAD_TIMEOUT",KEY_GENERATE_REQUEST_ERROR:"KEY_GENERATE_REQUEST_ERROR",INCOMPATIBLE_KEYSYSTEMS:"INCOMPATIBLE_KEYSYSTEMS",INVALID_ENCRYPTED_EVENT:"INVALID_ENCRYPTED_EVENT",INVALID_KEY_SYSTEM:"INVALID_KEY_SYSTEM",LICENSE_SERVER_CERTIFICATE_ERROR:"LICENSE_SERVER_CERTIFICATE_ERROR",MULTIPLE_SESSIONS_SAME_INIT_DATA:"MULTIPLE_SESSIONS_SAME_INIT_DATA",BUFFER_APPEND_ERROR:"BUFFER_APPEND_ERROR",BUFFER_FULL_ERROR:"BUFFER_FULL_ERROR",BUFFER_TYPE_UNKNOWN:"BUFFER_TYPE_UNKNOWN",MEDIA_ERR_BLOCKED_AUTOPLAY:"MEDIA_ERR_BLOCKED_AUTOPLAY",MEDIA_ERR_PLAY_NOT_ALLOWED:"MEDIA_ERR_PLAY_NOT_ALLOWED",MEDIA_ERR_NOT_LOADED_METADATA:"MEDIA_ERR_NOT_LOADED_METADATA",MEDIA_ERR_ABORTED:"MEDIA_ERR_ABORTED",MEDIA_ERR_NETWORK:"MEDIA_ERR_NETWORK",MEDIA_ERR_DECODE:"MEDIA_ERR_DECODE",MEDIA_ERR_SRC_NOT_SUPPORTED:"MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ERR_UNKNOWN:"MEDIA_ERR_UNKNOWN",MEDIA_SOURCE_NOT_SUPPORTED:"MEDIA_SOURCE_NOT_SUPPORTED",MEDIA_KEYS_NOT_SUPPORTED:"MEDIA_KEYS_NOT_SUPPORTED",DISCONTINUITY_ENCOUNTERED:"DISCONTINUITY_ENCOUNTERED",NONE:"NONE"}},7367:function(e,t,n){"use strict";function r(e,t,n){return e+" ("+t+") "+n}n.d(t,{Z:function(){return r}})},9822:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5157),i=n(5992),a=n(3714),o=n(9362),s=n(5389);function u(e){return(e instanceof r.Z||e instanceof a.Z||e instanceof s.Z||e instanceof o.Z)&&Object.keys(i.ZB).indexOf(e.type)>=0}},3714:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(3349),i=n(1788),a=n(3786),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="MediaError",a.type=o.ZB.MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9362:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(3349),i=n(1788),a=n(3786),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="NetworkError",a.type=o.ZB.NETWORK_ERROR,a.xhr=void 0===i.xhr?null:i.xhr,a.url=i.url,a.status=i.status,a.errorType=i.type,a.code=n,a.message=(0,s.Z)(a.name,a.code,i.message),a.fatal=!1,a}return(0,i.Z)(t,e),t.prototype.isHttpError=function(e){return this.errorType===o.br.ERROR_HTTP_CODE&&this.status===e},t}((0,a.Z)(Error))},5389:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(3349),i=n(1788),a=n(3786),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="OtherError",a.type=o.ZB.OTHER_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9105:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3349),i=n(1788),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="RequestError",s.url=n,s.xhr=o,s.status=i,s.type=a,s.message=a,s}return(0,i.Z)(t,e),t}((0,n(3786).Z)(Error))},7273:function(e,t){"use strict";t.Z={dashParsers:{wasm:null,js:null},directfile:null,emeManager:null,htmlTextTracksBuffer:null,htmlTextTracksParsers:{},imageBuffer:null,imageParser:null,nativeTextTracksBuffer:null,nativeTextTracksParsers:{},transports:{}}},7874:function(e,t,n){"use strict";var r=n(7273);t.Z=r.Z},3887:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(8894),i=new(function(){function e(){this.error=r.Z,this.warn=r.Z,this.info=r.Z,this.debug=r.Z,this._levels={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4},this._currentLevel="NONE"}var t=e.prototype;return t.setLevel=function(e){var t,n=this._levels[e];"number"==typeof n?(t=n,this._currentLevel=e):(t=0,this._currentLevel="NONE"),this.error=t>=this._levels.ERROR?console.error.bind(console):r.Z,this.warn=t>=this._levels.WARNING?console.warn.bind(console):r.Z,this.info=t>=this._levels.INFO?console.info.bind(console):r.Z,this.debug=t>=this._levels.DEBUG?console.log.bind(console):r.Z},t.getLevel=function(){return this._currentLevel},e}())},8999:function(e,t,n){"use strict";n.d(t,{r:function(){return p},Z:function(){return v}});var r=n(3714),i=n(3887),a=n(3274),o=n(7714),s=n(1946),u=n(7829);var l="undefined"!=typeof window&&"function"==typeof window.Set&&"function"==typeof Array.from?function(e){return Array.from(new Set(e))}:function(e){return e.filter((function(e,t,n){return n.indexOf(e)===t}))},d=n(3774);var c=n(4791),f=function(){function e(e,t){var n;this.id=e.id,this.bitrate=e.bitrate,this.codec=e.codecs,void 0!==e.height&&(this.height=e.height),void 0!==e.width&&(this.width=e.width),void 0!==e.mimeType&&(this.mimeType=e.mimeType),void 0!==e.contentProtections&&(this.contentProtections=e.contentProtections),void 0!==e.frameRate&&(this.frameRate=e.frameRate),void 0!==e.hdrInfo&&(this.hdrInfo=e.hdrInfo),this.index=e.index,this.isSupported="audio"!==t.type&&"video"!==t.type||(n=this.getMimeTypeString(),null!=d.JJ&&("function"!=typeof d.JJ.isTypeSupported||d.JJ.isTypeSupported(n)))}var t=e.prototype;return t.getMimeTypeString=function(){var e,t;return(null!==(e=this.mimeType)&&void 0!==e?e:"")+';codecs="'+(null!==(t=this.codec)&&void 0!==t?t:"")+'"'},t.getEncryptionData=function(e){for(var t,n=this.getAllEncryptionData(),r=[],i=0;i0&&(this.trickModeTracks=l.map((function(t){return new e(t)})));for(var h=t.representations,m=[],g=!1,y=0;y0&&!g){i.Z.warn("Incompatible codecs for adaptation",t);var b=new r.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");this.parsingErrors.push(b)}}var t=e.prototype;return t.getAvailableBitrates=function(){for(var e=[],t=0;t0}));if(o.every((function(e){return!e.isSupported}))&&a.length>0&&("video"===i||"audio"===i))throw new f.Z("MANIFEST_PARSE_ERROR","No supported "+i+" adaptations");return o.length>0&&(r[i]=o),r}),{}),!Array.isArray(this.adaptations.video)&&!Array.isArray(this.adaptations.audio))throw new f.Z("MANIFEST_PARSE_ERROR","No supported audio and video tracks.");this.duration=e.duration,this.start=e.start,null!=this.duration&&null!=this.start&&(this.end=this.start+this.duration),this.streamEvents=void 0===e.streamEvents?[]:e.streamEvents}var t=e.prototype;return t.getAdaptations=function(){var e=this.adaptations;return(0,p.Z)(e).reduce((function(e,t){return null!=t?e.concat(t):e}),[])},t.getAdaptationsForType=function(e){var t=this.adaptations[e];return null==t?[]:t},t.getAdaptation=function(e){return(0,o.Z)(this.getAdaptations(),(function(t){var n=t.id;return e===n}))},t.getSupportedAdaptations=function(e){if(void 0===e)return this.getAdaptations().filter((function(e){return e.isSupported}));var t=this.adaptations[e];return void 0===t?[]:t.filter((function(e){return e.isSupported}))},e}(),h=n(3887),m=function(){function e(e){this._mediaURLs=e.media}var t=e.prototype;return t.getInitSegment=function(){return null},t.getSegments=function(){return[{id:"0",isInit:!1,number:0,mediaURLs:[this._mediaURLs],time:0,end:Number.MAX_VALUE,duration:Number.MAX_VALUE,timescale:1}]},t.getFirstPosition=function(){},t.getLastPosition=function(){},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(){h.Z.warn("Tried to replace a static RepresentationIndex")},t._update=function(){h.Z.warn("Tried to update a static RepresentationIndex")},e}();!function(e){e[e.Full=0]="Full",e[e.Partial=1]="Partial"}(r||(r={}));var g=n(5138);function y(e,t,n){e.start=t.start,e.end=t.end,e.duration=t.duration,e.streamEvents=t.streamEvents;for(var i=e.getAdaptations(),a=t.getAdaptations(),s=function(e){var t=i[e],s=(0,o.Z)(a,(function(e){return e.id===t.id}));if(void 0===s)h.Z.warn('Manifest: Adaptation "'+i[e].id+'" not found when merging.');else for(var u=i[e].representations,l=s.representations,d=function(e){var t=u[e],i=(0,o.Z)(l,(function(e){return e.id===t.id}));void 0===i?h.Z.warn('Manifest: Representation "'+u[e].id+'" not found when merging.'):n===r.Full?t.index._replace(i.index):t.index._update(i.index)},c=0;c0&&r._addSupplementaryImageAdaptations(u),o.length>0&&r._addSupplementaryTextAdaptations(o),r}(0,i.Z)(t,e);var n=t.prototype;return n.getPeriod=function(e){return(0,o.Z)(this.periods,(function(t){return e===t.id}))},n.getPeriodForTime=function(e){return(0,o.Z)(this.periods,(function(t){return e>=t.start&&(void 0===t.end||t.end>e)}))},n.getNextPeriod=function(e){return(0,o.Z)(this.periods,(function(t){return t.start>e}))},n.getPeriodAfter=function(e){var t=e.end;if(void 0===t)return null;var n=(0,o.Z)(this.periods,(function(e){return void 0===e.end||t0&&this.trigger("decipherabilityUpdate",r)},n.addUndecipherableProtectionData=function(e){var t=T(this,(function(t){var n,r;if(!1===t.decipherable)return!1;for(var i=null!==(r=null===(n=t.contentProtections)||void 0===n?void 0:n.initData)&&void 0!==r?r:[],o=function(t){if((void 0===e.type||i[t].type===e.type)&&e.values.every((function(e){return i[t].values.some((function(t){return(void 0===e.systemId||t.systemId===e.systemId)&&(0,a.Z)(t.data,e.data)}))})))return{v:!1}},s=0;s0&&this.trigger("decipherabilityUpdate",t)},n.getAdaptations=function(){(0,l.Z)("manifest.getAdaptations() is deprecated. Please use manifest.period[].getAdaptations() instead");var e=this.periods[0];if(void 0===e)return[];var t=e.adaptations,n=[];for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];n.push.apply(n,i)}return n},n.getAdaptationsForType=function(e){(0,l.Z)("manifest.getAdaptationsForType(type) is deprecated. Please use manifest.period[].getAdaptationsForType(type) instead");var t=this.periods[0];if(void 0===t)return[];var n=t.adaptations[e];return void 0===n?[]:n},n.getAdaptation=function(e){return(0,l.Z)("manifest.getAdaptation(id) is deprecated. Please use manifest.period[].getAdaptation(id) instead"),(0,o.Z)(this.getAdaptations(),(function(t){var n=t.id;return e===n}))},n._addSupplementaryImageAdaptations=function(e){var t=this,n=(Array.isArray(e)?e:[e]).map((function(e){var n,r=e.mimeType,i=e.url,a="gen-image-ada-"+_(),o="gen-image-rep-"+_(),s=new d.Z({id:a,type:"image",representations:[{bitrate:0,id:o,mimeType:r,index:new m({media:i})}]},{isManuallyAdded:!0});return(n=t.parsingErrors).push.apply(n,s.parsingErrors),s}));if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.image=null!=r.image?r.image.concat(n):n}},n._addSupplementaryTextAdaptations=function(e){var t=this,n=(Array.isArray(e)?e:[e]).reduce((function(e,n){var r=n.mimeType,i=n.codecs,a=n.url,o=n.language,s=n.languages,u=n.closedCaption,l=null!=o?[o]:null!=s?s:[];return e.concat(l.map((function(e){var n,o="gen-text-ada-"+_(),s="gen-text-rep-"+_(),l=new d.Z({id:o,type:"text",language:e,closedCaption:u,representations:[{bitrate:0,id:s,mimeType:r,codecs:i,index:new m({media:a})}]},{isManuallyAdded:!0});return(n=t.parsingErrors).push.apply(n,l.parsingErrors),l})))}),[]);if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.text=null!=r.text?r.text.concat(n):n}},n._performUpdate=function(e,t){if(this.availabilityStartTime=e.availabilityStartTime,this.expired=e.expired,this.isDynamic=e.isDynamic,this.isLive=e.isLive,this.isLastPeriodKnown=e.isLastPeriodKnown,this.lifetime=e.lifetime,this.parsingErrors=e.parsingErrors,this.suggestedPresentationDelay=e.suggestedPresentationDelay,this.transport=e.transport,this.publishTime=e.publishTime,t===r.Full)this._timeBounds=e._timeBounds,this.uris=e.uris,function(e,t){for(var n=0,i=0;ie.length)h.Z.error("Manifest: error when updating Periods");else{n0&&e.push.apply(e,d)}}(this.periods,e.periods);else{this._timeBounds.maximumTimeData=e._timeBounds.maximumTimeData,this.updateUrl=e.uris[0],function(e,t){if(0!==e.length){if(0!==t.length){var n=e[e.length-1];if(n.starta&&(e.splice(a,u-a),u=a),y(e[u],s,r.Full),a++}a0;){var i=this.periods[0];if(void 0===i.end||i.end>n)break;this.periods.shift()}}this.adaptations=void 0===this.periods[0]?{}:this.periods[0].adaptations,this.trigger("manifestUpdate",null)},t}(s.Z)},2689:function(e,t,n){"use strict";n.d(t,{s:function(){return r}});var r=Math.pow(2,32)-1},2297:function(e,t,n){"use strict";n.d(t,{iz:function(){return o},t_:function(){return a},Qy:function(){return s},Xj:function(){return l},nR:function(){return u}});var r=n(3887),i=n(6968);function a(e,t){var n=s(e,t);return null!==n?e.subarray(n[1],n[2]):null}function o(e,t){var n=s(e,t);return null!==n?e.subarray(n[0],n[2]):null}function s(e,t){for(var n,r,a=e.length,o=0,s=0;o+8<=a;){if(r=o,s=(0,i.pX)(e,r),r+=4,n=(0,i.pX)(e,r),r+=4,0===s)s=a-o;else if(1===s){if(r+8>a)return null;s=(0,i.pV)(e,r),r+=8}if(s<0)throw new Error("ISOBMFF: Size out of range");if(n===t)return 1970628964===t&&(r+=16),[o,r,o+s];o+=s}return null}function u(e,t,n,r,a){for(var o,s=e.length,u=0;us)return;o=(0,i.pV)(e,l),l+=8}if(1970628964===d&&l+16<=s&&(0,i.pX)(e,l)===t&&(0,i.pX)(e,l+4)===n&&(0,i.pX)(e,l+8)===r&&(0,i.pX)(e,l+12)===a)return l+=16,e.subarray(l,u+o)}}function l(e){var t=e.length;if(t<8)return r.Z.warn("ISOBMFF: box inferior to 8 bytes, cannot find offsets"),null;var n=0,a=(0,i.pX)(e,n);n+=4;var o=(0,i.pX)(e,n);if(n+=4,0===a)a=t;else if(1===a){if(n+8>t)return r.Z.warn("ISOBMFF: box too short, cannot find offsets"),null;a=(0,i.pV)(e,n),n+=8}if(a<0)throw new Error("ISOBMFF: Size out of range");return 1970628964===o&&(n+=16),[0,n,a]}},6807:function(e,t,n){"use strict";n.d(t,{XA:function(){return i},Le:function(){return a},fs:function(){return o},E3:function(){return s}});var r=n(2297);function i(e){var t=(0,r.t_)(e,1836019558);return null===t?null:(0,r.t_)(t,1953653094)}function a(e){return(0,r.t_)(e,1835295092)}function o(e){var t=(0,r.t_)(e,1836019574);if(null===t)return null;var n=(0,r.t_)(t,1953653099);return null===n?null:(0,r.t_)(n,1835297121)}function s(e,t){return void 0===t&&(t=0),(0,r.t_)(e.subarray(t),1701671783)}},6490:function(e,t,n){"use strict";n.d(t,{Z:function(){return s},Y:function(){return u}});var r=n(3887);var i="function"==typeof Uint8Array.prototype.slice?function(e,t,n){return e.slice(t,n)}:function(e,t,n){return new Uint8Array(Array.prototype.slice.call(e,t,n))},a=n(3635),o=n(2297);function s(e){var t=0,n=(0,o.t_)(e,1836019574);if(null===n)return[];for(var a=[];t1)r.Z.warn("ISOBMFF: un-handled PSSH version");else{var n=t+4;if(!(n+16>e.length)){var o=i(e,n,n+16);return(0,a.ci)(o)}}}},4644:function(e,t,n){"use strict";n.d(t,{LD:function(){return f},Qx:function(){return d},MM:function(){return c},Wf:function(){return l},J6:function(){return p},s9:function(){return v}});var r=n(3887),i=n(6968),a=n(3635),o=n(2689),s=n(2297),u=n(6807);function l(e,t){var n=(0,s.Qy)(e,1936286840);if(null===n)return null;var r=t,a=n[2]-n[0],o=n[1],u=e[o];o+=8;var l,d=(0,i.pX)(e,o);if(o+=4,0===u)l=(0,i.pX)(e,o),o+=4,r+=(0,i.pX)(e,o)+a,o+=4;else{if(1!==u)return null;l=(0,i.pV)(e,o),o+=8,r+=(0,i.pV)(e,o)+a,o+=8}var c=[];o+=2;var f=(0,i.zK)(e,o);for(o+=2;--f>=0;){var p=(0,i.pX)(e,o);o+=4;var v=2147483647&p;if(1===(2147483648&p)>>>31)throw new Error("sidx with reference_type `1` not yet implemented");var h=(0,i.pX)(e,o);o+=4,o+=4,c.push({time:l,duration:h,timescale:d,range:[r,r+v-1]}),l+=h,r+=v}return c}function d(e){var t=(0,u.XA)(e);if(null!==t){var n=(0,s.t_)(t,1952867444);if(null!==n){var r=n[0];return 1===r?(0,i.pV)(n,4):0===r?(0,i.pX)(n,4):void 0}}}function c(e){var t=(0,u.XA)(e);if(null!==t){var n=(0,s.t_)(t,1953658222);if(null!==n){var r=0,a=n[r];if(r+=1,!(a>1)){var o=(0,i.QI)(n,r);r+=3;var l=(256&o)>0,d=0;if(l||void 0!==(d=function(e){var t=(0,s.t_)(e,1952868452);if(null!==t){var n=1,r=(0,i.QI)(t,n);if(n+=3,(8&r)>0)return n+=4,(1&r)>0&&(n+=8),(2&r)>0&&(n+=4),(0,i.pX)(t,n)}}(t))){var c=(1&o)>0,f=(4&o)>0,p=(512&o)>0,v=(1024&o)>0,h=(2048&o)>0,m=(0,i.pX)(n,r);r+=4,c&&(r+=4),f&&(r+=4);for(var g=m,y=0;g-- >0;)l?(y+=(0,i.pX)(n,r),r+=4):y+=d,p&&(r+=4),v&&(r+=4),h&&(r+=4);return y}}}}}function f(e){var t=(0,u.fs)(e);if(null!==t){var n=(0,s.t_)(t,1835296868);if(null!==n){var r=0,a=n[r];return r+=4,1===a?(0,i.pX)(n,r+16):0===a?(0,i.pX)(n,r+8):void 0}}}function p(e){var t=e.length;if(t<4)throw new Error("Cannot update box length: box too short");var n=(0,i.pX)(e,0);if(0===n){if(t>o.s){var r=new Uint8Array(t+8);return r.set((0,i.kh)(1),0),r.set(e.subarray(4,8),4),r.set((0,i.el)(t+8),8),r.set(e.subarray(8,t),16),r}return e.set((0,i.kh)(t),0),e}if(1===n){if(t<16)throw new Error("Cannot update box length: box too short");return e.set((0,i.el)(t),8),e}if(t<=o.s)return e.set((0,i.kh)(t),0),e;var a=new Uint8Array(t+8);return a.set((0,i.kh)(1),0),a.set(e.subarray(4,8),4),a.set((0,i.el)(t+8),8),a.set(e.subarray(8,t),16),a}function v(e){for(var t=[],n=0;n0)throw new Error("Unhandled version: "+s);var c=(0,r.dN)(e,t);t+=4;var f=(0,r.dN)(e,t);t+=4;var p=(0,i.uR)(e.subarray(t,t+4));t+=4;var v=(0,r.qb)(e,t);t+=2;var h=(0,r.qb)(e,t),m=[e[t+=2],e[t+1]].join(":"),g=1===e[t+=2];t=64;var y=[];if(0===c)throw new Error("bif: no images to parse");for(var _=0,b=null;t0,this._isEMSGWhitelisted=c}var t=e.prototype;return t.getInitSegment=function(){return(0,a.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){return(0,o.Z)(this._index,e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstPosition=function(){var e=this._index;return 0===e.timeline.length?null:(0,i.zG)(e.timeline[0].start,e)},t.getLastPosition=function(){var e=this._index.timeline;if(0===e.length)return null;var t=e[e.length-1],n=(0,i.jH)(t,null,this._scaledPeriodEnd);return(0,i.zG)(n,this._index)},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.initializeIndex=function(e){for(var t=0;t0&&null!=c[0].duration?c[0].duration:0,_=0;_0?Math.floor(u/s):0),A=E+k*T;A=d)return m;null!=h&&(h+=S+1)}return m}},4784:function(e,t,n){"use strict";n.d(t,{k6:function(){return o},QB:function(){return u}});var r=n(6923),i=n(9829);function a(e){return function(t,n,i){var a,o,s,u=(0,r.Z)(i)?parseInt(i,10):1;return a=String(e),o=u,(s=a.toString()).length>=o?s:(new Array(o+1).join("0")+s).slice(-o)}}function o(e,t,n,r){return 0===e.length?void 0!==t?[s(t,n,r)]:null:e.map((function(e){return s((0,i.Z)(e,t),n,r)}))}function s(e,t,n){return-1===e.indexOf("$")?e:e.replace(/\$\$/g,"$").replace(/\$RepresentationID\$/g,String(t)).replace(/\$Bandwidth(|\%0(\d+)d)\$/g,a(void 0===n?0:n))}function u(e,t){return function(n){return-1===n.indexOf("$")?n:n.replace(/\$\$/g,"$").replace(/\$Number(|\%0(\d+)d)\$/g,(function(e,n,r){if(void 0===t)throw new Error("Segment number not defined in a $Number$ scheme");return a(t)(e,n,r)})).replace(/\$Time(|\%0(\d+)d)\$/g,(function(t,n,r){if(void 0===e)throw new Error("Segment time not defined in a $Time$ scheme");return a(e)(t,n,r)}))}}},148:function(e,t,n){"use strict";n.d(t,{Z:function(){return Be}});var r=n(8418),i=n(1946),a=n(944),o=n(3887),s=n(3274),u=n(9829);function l(e){return 0===e.length?0:e.reduce((function(e,t){var n;return Math.min(null!==(n=t.attributes.availabilityTimeOffset)&&void 0!==n?n:0,e)}),1/0)}function d(e){var t=Date.parse(e)-performance.now();if(!isNaN(t))return t;o.Z.warn("DASH Parser: Invalid clock received: ",e)}function c(e){for(var t=e.representations,n=null,r=0;r=0;t--){var n=e[t].adaptations,r=void 0===n.audio?void 0:n.audio[0],i=void 0===n.video?void 0:n.video[0];if(void 0!==r||void 0!==i){var a=null,s=null;if(void 0!==r){var u=c(r);if(void 0===u)return;a=u}if(void 0!==i){var l=c(i);if(void 0===l)return;s=l}if(void 0!==r&&null===a||void 0!==i&&null===s)return void o.Z.info("Parser utils: found Period with no segment. ","Going to previous one to calculate last position");if(null!==s)return null!==a?Math.min(a,s):s;if(null!==a)return a}}}function p(e){for(var t=e.representations,n=null,r=0;r=n}function U(e,t,n,r){var i=e.start,a=e.duration,s=e.repeatCount;return null==i&&(null==t?i=r:null!=t.duration&&(i=t.start+t.duration*(t.repeatCount+1))),null!=a&&!isNaN(a)||null==n||null==n.start||isNaN(n.start)||null==i||isNaN(i)||(a=n.start-i),null==i||isNaN(i)||null==a||isNaN(a)||null!=s&&isNaN(s)?(o.Z.warn('DASH: A "S" Element could not have been parsed.'),null):{start:i,duration:a,repeatCount:void 0===s?0:s}}function F(e){for(var t={},n=0;n0){var s=i-a.start;if(s%a.duration==0&&s/a.duration<=a.repeatCount)return{repeatNumberInPrevSegments:s/a.duration,prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInNewElements:0}}if(++o>=e.length)return null;if((a=e[o]).start===i)return{prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(a.start>i)return null}else for(var u=0,l=t[0],d=i;;){var c=l.getAttribute("d"),f=null===c?null:parseInt(c,10);if(null===f||Number.isNaN(f))return null;var p=l.getAttribute("r"),v=null===p?null:parseInt(p,10);if(null!==v){if(Number.isNaN(v)||v<0)return null;if(v>0){var h=n-d;if(h%f==0&&h/f<=v)return{repeatNumberInPrevSegments:0,repeatNumberInNewElements:h/f,prevSegmentsIdx:0,newElementsIdx:u}}d+=f*(v+1)}else d+=f;if(++u>=t.length)return null;var m=(l=t[u]).getAttribute("t"),g=null===m?null:parseInt(m,10);if(null!==g){if(Number.isNaN(g))return null;d=g}if(d===n)return{newElementsIdx:u,prevSegmentsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(d>i)return null}}(t,e);if(null===i)return o.Z.warn('DASH: Cannot perform "based" update. Common segment not found.'),z(e,n);var a=i.prevSegmentsIdx,s=i.newElementsIdx,u=i.repeatNumberInPrevSegments,l=i.repeatNumberInNewElements,d=t.length-a+s-1;if(d>=e.length)return o.Z.info('DASH: Cannot perform "based" update. New timeline too short'),z(e,n);var c=t.slice(a);if(u>0){var f=c[0];f.start+=f.duration*u,c[0].repeatCount-=u}if(l>0&&0!==s)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form.'),z(e,n);var p=c[c.length-1],v=F(e[d]),h=(null!==(r=v.repeatCount)&&void 0!==r?r:0)-l;if(v.duration!==p.duration||p.repeatCount>h)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form at the beginning.'),z(e,n);void 0!==v.repeatCount&&v.repeatCount>p.repeatCount&&(p.repeatCount=v.repeatCount);for(var m=[],g=[],y=d+1;yu?u-y:r,T=y+s,E=y+this._index.presentationTimeOffset,w=null===o?null:o.map((0,M.QB)(E,_)),S={id:String(_),number:_,time:T/a,end:(T+b)/a,duration:b/a,timescale:1,isInit:!1,scaledDuration:b/a,mediaURLs:w,timestampOffset:-n.indexTimeOffset/a,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};h.push(S),g++}return h},t.getFirstPosition=function(){var e=this._getFirstSegmentStart();return null==e?e:e/this._index.timescale+this._periodStart},t.getLastPosition=function(){var e=this._getLastSegmentStart();return null==e?e:(e+this._index.duration)/this._index.timescale+this._periodStart},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;var t=this.getSegments(e.time,.1);return 0!==t.length&&(t[0].time===e.time&&t[0].end===e.end&&t[0].number===e.number)},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){if(!this._isDynamic)return!0;if(void 0===this._scaledPeriodEnd)return!1;var e=this._index.timescale,t=this._getLastSegmentStart();return null!=t&&B(e,t+this._index.duration,this._scaledPeriodEnd)},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index,this._aggressiveMode=e._aggressiveMode,this._isDynamic=e._isDynamic,this._periodStart=e._periodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._manifestBoundsCalculator=e._manifestBoundsCalculator},t._update=function(e){this._replace(e)},t._getFirstSegmentStart=function(){if(!this._isDynamic)return 0;if(0===this._scaledPeriodEnd||void 0===this._scaledPeriodEnd){var e=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0!==e&&ethis._periodStart?(i-this._periodStart)*r:0;return Math.floor(a/n)*n}},t._getLastSegmentStart=function(){var e,t=this._index,n=t.duration,r=t.timescale;if(this._isDynamic){var i=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0===i)return;var a=this._aggressiveMode?n/r:0;if(null!=this._scaledPeriodEnd&&this._scaledPeriodEnd<(i+a-this._periodStart)*this._index.timescale)return this._scaledPeriodEndH*r||0===d?c:(d-1)*n},e}();function $(e,t){var n=[];if(0===t.length)return e;if(0===e.length){for(var r=0;r0){var b=t.parentSegmentTemplates.slice(),T=e.children.segmentTemplate;void 0!==T&&b.push(T);var E=A.Z.apply(void 0,[{}].concat(b));g.availabilityTimeOffset=t.availabilityTimeOffset+l(e.children.baseURLs)+(null!==(r=E.availabilityTimeOffset)&&void 0!==r?r:0),i=G.isTimelineIndexArgument(E)?new G(E,g):new W(E,g)}else{var w=t.adaptation.children;if(void 0!==w.segmentBase){var S=w.segmentBase;i=new x.Z(S,g)}else if(void 0!==w.segmentList){var k=w.segmentList;i=new R(k,g)}else i=new W({duration:Number.MAX_VALUE,timescale:1,startNumber:0,media:""},g)}return i}(d,(0,A.Z)({},n,{unsafelyBaseOnPreviousRepresentation:f,adaptation:t,inbandEventStreams:p})),h=void 0;null==d.attributes.bitrate?(o.Z.warn("DASH: No usable bitrate found in the Representation."),h=0):h=d.attributes.bitrate;var m={bitrate:h,index:v,id:c},g=void 0;if(null!=d.attributes.codecs?g=d.attributes.codecs:null!=t.attributes.codecs&&(g=t.attributes.codecs),null!=g&&(g="mp4a.40.02"===g?"mp4a.40.2":g,m.codecs=g),null!=d.attributes.frameRate?m.frameRate=d.attributes.frameRate:null!=t.attributes.frameRate&&(m.frameRate=t.attributes.frameRate),null!=d.attributes.height?m.height=d.attributes.height:null!=t.attributes.height&&(m.height=t.attributes.height),null!=d.attributes.mimeType?m.mimeType=d.attributes.mimeType:null!=t.attributes.mimeType&&(m.mimeType=t.attributes.mimeType),null!=d.attributes.width?m.width=d.attributes.width:null!=t.attributes.width&&(m.width=t.attributes.width),null!=t.children.contentProtections){var y=t.children.contentProtections.reduce((function(e,t){var n;if(void 0!==t.attributes.schemeIdUri&&"urn:uuid:"===t.attributes.schemeIdUri.substring(0,9)&&(n=t.attributes.schemeIdUri.substring(9).replace(/-/g,"").toLowerCase()),void 0!==t.attributes.keyId&&t.attributes.keyId.length>0&&e.keyIds.push({keyId:t.attributes.keyId,systemId:n}),void 0!==n){for(var r=t.children.cencPssh,i=[],a=0;a0){var u,l=(0,s.Z)(e.initData,(function(e){return"cenc"===e.type}));if(void 0===l)e.initData.push({type:"cenc",values:i});else(u=l.values).push.apply(u,i)}}return e}),{keyIds:[],initData:[]});(Object.keys(y.initData).length>0||y.keyIds.length>0)&&(m.contentProtections=y)}m.hdrInfo=Y({adaptationProfiles:t.attributes.profiles,manifestProfiles:n.manifestProfiles,codecs:g}),a.push(m)},d=0;d0&&void 0!==v.video&&!L){var B,U=d.video[v.video];N.unsafelyBaseOnPreviousAdaptation=null!==(i=null===(r=t.unsafelyBaseOnPreviousPeriod)||void 0===r?void 0:r.getAdaptation(U.id))&&void 0!==i?i:null;var F=q(S,m,N);(B=U.representations).push.apply(B,F),R=U.id}else{var z=g.accessibilities,K=void 0;void 0!==_&&_.some((function(e){return"dub"===e.value}))&&(K=!0);var V=void 0;"text"!==Z?V=!1:void 0!==z&&(V=z.some(j));var G=void 0;"audio"!==Z?G=!1:void 0!==z&&(G=z.some(X));var H=void 0;"video"!==Z?H=!1:void 0!==z&&(H=z.some(Q));for(var W=J(m,{isAudioDescription:G,isClosedCaption:V,isSignInterpreted:H,isTrickModeTrack:L,type:Z});(0,b.Z)(p,W);)W+="-dup";R=W,p.push(W),N.unsafelyBaseOnPreviousAdaptation=null!==(u=null===(a=t.unsafelyBaseOnPreviousPeriod)||void 0===a?void 0:a.getAdaptation(W))&&void 0!==u?u:null;var Y={id:W,representations:q(S,m,N),type:Z,isTrickModeTrack:L};null!=m.attributes.language&&(Y.language=m.attributes.language),null!=V&&(Y.closedCaption=V),null!=G&&(Y.audioDescription=G),!0===K&&(Y.isDub=!0),!0===H&&(Y.isSignInterpreted=!0);var te=d[Z];if(void 0!==O)c.push({adaptation:Y,trickModeAttachedAdaptationIds:O});else if(void 0===te)d[Z]=[Y],E&&(v[Z]=0);else{for(var ne=null,re=function(e){var t=C[e],n=f[t];if(null!=n&&n.newID!==R&&(0,b.Z)(n.adaptationSetSwitchingIDs,M)){var r,i=(0,s.Z)(te,(function(e){return e.id===t}));null!=i&&i.audioDescription===Y.audioDescription&&i.closedCaption===Y.closedCaption&&i.language===Y.language&&(o.Z.info('DASH Parser: merging "switchable" AdaptationSets',M,t),(r=i.representations).push.apply(r,Y.representations),ne=i)}},ie=0;ieae)&&(te.splice(se,1),te.splice(oe,0,ne),v[Z]=oe)}}else null===ne&&te.push(Y)}}null!=M&&null==f[M]&&(f[M]={newID:R,adaptationSetSwitchingIDs:C})}}return w(d,c),d}(p.children.adaptations,R),P=function(e,t){for(var n,r=[],i=0;i=0;p--)f(p);if(t.isDynamic&&!c.lastPositionIsKnown()){var v=re(t,0);if(void 0!==v){var m=v[0],E=v[1];c.setLastPosition(m,E)}}return function(e){if(0===e.length)return[];for(var t=[e[0]],n=1;nr.start;)o.Z.warn("DASH: Updating overlapping Periods.",i,r),i.duration=r.start-i.start,i.end=r.start,i.duration<=0&&(t.pop(),i=t[t.length-1]);t.push(r)}return t}(i)}function re(e,t){if(null!=e.clockOffset){var n=e.clockOffset/1e3-e.availabilityStartTime,r=performance.now()/1e3,i=r+n;if(i>=t)return[i,r]}else{var a=Date.now()/1e3;if(a>=t)return o.Z.warn("DASH Parser: no clock synchronization mechanism found. Using the system clock instead."),[a-e.availabilityStartTime,performance.now()/1e3]}}var ie=a.Z.DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0;var ae=function e(t,n,r,i,a){void 0===a&&(a=new WeakMap);var c=t.children,p=t.attributes;if(null==n.externalClockOffset){var h="dynamic"===p.type,m=(0,s.Z)(c.utcTimings,(function(e){return"urn:mpeg:dash:utc:direct:2014"===e.schemeIdUri&&null!=e.value})),g=null!=m&&null!=m.value?d(m.value):void 0,y=null==g||isNaN(g)?void 0:g;if(null!=y&&!0!==i)n.externalClockOffset=y;else if(h&&!0!==i){var _=function(e){var t=e.children.utcTimings.filter((function(e){return"urn:mpeg:dash:utc:http-iso:2014"===e.schemeIdUri&&void 0!==e.value}));return t.length>0?t[0].value:void 0}(t);if(null!=_&&_.length>0)return{type:"needs-clock",value:{url:_,continue:function(i){return n.externalClockOffset=d(i),e(t,n,r,!0)}}}}}for(var b=[],T=0;T=0&&(d=0===m.minimumUpdatePeriod?ie:m.minimumUpdatePeriod);var I=function(e){if(0===e.length)throw new Error("DASH Parser: no period available for a dynamic content");return[v(e),f(e)]}(k),Z=I[0],M=I[1],R=performance.now();if(g){var C;if(c=Z,x=null!=b?b:null,void 0!==M)C=M;else{var P=null!=_?_:0,N=t.externalClockOffset;if(void 0===N)o.Z.warn("DASH Parser: use system clock to define maximum position"),C=Date.now()/1e3-P;else C=(performance.now()+N)/1e3-P}p={isLinear:!0,value:C,time:R},null!==x&&void 0!==c&&C-c>x&&(x=C-c)}else{c=void 0!==Z?Z:void 0!==(null===(i=k[0])||void 0===i?void 0:i.start)?k[0].start:0;var D=null!=A?A:1/0;if(void 0!==k[k.length-1]){var O=k[k.length-1],L=null!==(a=O.end)&&void 0!==a?a:void 0!==O.duration?O.start+O.duration:void 0;void 0!==L&&L=0;s--){var u,l=b[s].index,d=o[s],f=d.parsed,p=d.warnings,v=d.receivedTime,h=d.sendingTime,m=d.url;p.length>0&&r.push.apply(r,p);for(var g=0;g0){var s=_e(a,"cenc:pssh"),u=s[0],l=s[1];null!==l&&(o.Z.warn(l.message),t.push(l)),null!==u&&n.push(u)}}}return[{cencPssh:n},t]}(e.childNodes),n=t[0],r=t[1];return[{children:n,attributes:function(e){for(var t={},n=0;n0&&(n=n.concat(d));break;case"SegmentList":var c=Ze(i),f=c[0],p=c[1];n=n.concat(p),t.segmentList=f;break;case"SegmentTemplate":var v=Re(i),h=v[0],m=v[1];n=n.concat(m),t.segmentTemplate=h}}return[t,n]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Te(t,n),i=0;i0&&(r=r.concat(u));break;case"ContentComponent":t.contentComponent=Se(a);break;case"EssentialProperty":null==t.essentialProperties?t.essentialProperties=[be(a)]:t.essentialProperties.push(be(a));break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(be(a));break;case"Representation":var l=Ce(a),d=l[0],c=l[1];t.representations.push(d),c.length>0&&(r=r.concat(c));break;case"Role":null==t.roles?t.roles=[be(a)]:t.roles.push(be(a));break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[be(a)]:t.supplementalProperties.push(be(a));break;case"SegmentBase":var f=xe(a),p=f[0],v=f[1];t.segmentBase=p,v.length>0&&(r=r.concat(v));break;case"SegmentList":var h=Ze(a),m=h[0],g=h[1];t.segmentList=m,g.length>0&&(r=r.concat(g));break;case"SegmentTemplate":var y=Re(a),_=y[0],b=y[1];t.segmentTemplate=_,b.length>0&&(r=r.concat(b));break;case"ContentProtection":var T=ke(a),E=T[0],w=T[1];w.length>0&&(r=r.concat(w)),void 0!==E&&n.push(E)}}return n.length>0&&(t.contentProtections=n),[t,r]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Te(t,n),i=0;i0&&(n=n.concat(d))}}return[t,n]}function De(e){for(var t={eventStreamData:e},n=[],r=Te(t,n),i=0;i0&&(i=i.concat(_))}}return[{baseURLs:n,adaptations:r,eventStreams:a,segmentTemplate:t},i]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Te(t,n),i=0;i"+o+"",c=(new DOMParser).parseFromString(d,"text/xml");if(null==c||0===c.children.length)throw new Error("DASH parser: Invalid external ressources");for(var f=c.children[0].children,p=[],v=[],h=0;h0;){var n=e[0];if(n.start>=t)return;if(n.repeatCount<=0)e.shift();else{var r=e[1];if(null!=r&&r.start<=t)e.shift();else{if(n.duration<=0)return;for(var i=n.start+n.duration,a=1;in.repeatCount)){var o=n.repeatCount-a;return n.start=i,void(n.repeatCount=o)}e.shift()}}}}n.d(t,{Z:function(){return r}})},3911:function(e,t,n){"use strict";function r(e,t,n){var r,i=e.repeatCount;return i>=0?i:(r=null!=t?t.start:null!=n?n:Number.MAX_VALUE,Math.ceil((r-e.start)/e.duration)-1)}function i(e,t,n){var i=e.start,a=e.duration;return a<=0?i:i+(r(e,t,n)+1)*a}function a(e,t){var n;return e*t.timescale+(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0)}function o(e,t){var n;return(e-(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0))/t.timescale}function s(e,t,n){return[e*n,(e+t)*n]}function u(e,t,n){var r=e.timeline,s=a(t,e);if(s<0)return null;var u=function(e,t){for(var n=0,r=e.length;n>>1;e[i].start<=t?n=i+1:r=i}return n-1}(r,s);if(u<0||u>=r.length-1)return null;var l=r[u];if(l.duration<=0)return null;var d=r[u+1];if(void 0===d)return null;var c=d.start;return s>=i(l,d,n)&&se.time)return!1;if(o===e.time)return a.duration/n===e.duration&&(null==a.range?null==e.range:null!=e.range&&a.range[0]===e.range[0]&&a.range[1]===e.range[1]);if(a.repeatCount>=0&&null!=a.duration){var s=(o-a.start)/a.duration-1;return s%1==0&&s<=a.repeatCount}}return!1}n.d(t,{Z:function(){return r}})},5505:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(3714),i=n(3887),a=n(3911);function o(e,t){var n=e.length;if(0!==e.length){if(0!==t.length){var o=t[0].start,s=e[n-1];if((0,a.jH)(s,t[0])=0;u--){var l=e[u].start;if(l===o)return void e.splice.apply(e,[u,n-u].concat(t));if(lo)return i.Z.warn("RepresentationIndex: Manifest update removed previous segments"),void e.splice.apply(e,[u,n-u].concat(t));if(void 0===d.repeatCount||d.repeatCount<=0)return d.repeatCount<0&&(d.repeatCount=Math.floor((o-d.start)/d.duration)-1),void e.splice.apply(e,[u+1,n-(u+1)].concat(t));if(d.start+d.duration*(d.repeatCount+1)<=o)return void e.splice.apply(e,[u+1,n-(u+1)].concat(t));var c=(o-d.start)/d.duration-1;if(c%1==0&&d.duration===t[0].duration){var f=t[0].repeatCount<0?-1:t[0].repeatCount+c+1;return e.splice.apply(e,[u,n-u].concat(t)),e[u].start=d.start,void(e[u].repeatCount=f)}return i.Z.warn("RepresentationIndex: Manifest update removed previous segments"),e[u].repeatCount=Math.floor(c),void e.splice.apply(e,[u+1,n-(u+1)].concat(t))}}var p=e[e.length-1],v=t[t.length-1];if(void 0!==p.repeatCount&&p.repeatCount<0)return p.start>v.start?void i.Z.warn("RepresentationIndex: The new index is older than the previous one"):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),void e.splice.apply(e,[0,n].concat(t)));p.start+p.duration*(p.repeatCount+1)>=v.start+v.duration*(v.repeatCount+1)?i.Z.warn("RepresentationIndex: The new index is older than the previous one"):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)))}}else e.splice.apply(e,[0,n].concat(t))}},5734:function(e,t,n){"use strict";var r=n(6923),i=/&#([0-9]+);/g,a=/
/gi,o=/]*>([\s\S]*?)<\/style[^>]*>/i,s=/\s*

]+))?>(.*)/i,u=/]+?start="?([0-9]*)"?[^0-9]/i;function l(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var d,c,f=/]/gi,p=/]|<\/body>/gi,v=[],h=o.exec(e),m=Array.isArray(h)?h[1]:"";p.exec(e);var g,y=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);null!==r;){var i=r[1],a=l(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(m),_=function(e){var t=/p\s*{([^}]*)}/gi.exec(e);return null===t?"":t[1]}(m);if((0,r.Z)(n)&&void 0===(g=y[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;d=f.exec(e),c=p.exec(e),null!==d||null!==c;){if(null===d||null===c||d.index>=c.index)throw new Error("parse error");var b=e.slice(d.index,c.index),T=u.exec(b);if(!Array.isArray(T))throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");w(b.split("\n"),E/1e3)}return v;function w(e,n){for(var o=e.length;--o>=0;){var u=s.exec(e[o]);if(Array.isArray(u)){var l=u[1],d=u[2];if(g===l)if(" "===d)v[v.length-1].end=n;else{var c=document.createElement("DIV");c.className="rxp-texttrack-region";var f=document.createElement("DIV");f.className="rxp-texttrack-div",f.style.position="absolute",f.style.bottom="0",f.style.width="100%",f.style.color="#fff",f.style.textShadow="-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000";var p=document.createElement("div");p.className="rxp-texttrack-p",(0,r.Z)(_)&&(p.style.cssText=_);for(var h=d.split(a),m=0;m/gi,s=/]*>([\s\S]*?)<\/style[^>]*>/i,u=/\s*

]+))?>(.*)/i,l=/]+?start="?([0-9]*)"?[^0-9]/i;function d(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var c,f,p=/]/gi,v=/]|<\/body>/gi,h=[],m=s.exec(e),g=null!==m?m[1]:"";v.exec(e);var y,_=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);Array.isArray(r);){var i=r[1],a=d(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(g);if((0,i.Z)(n)&&void 0===(y=_[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;c=p.exec(e),f=v.exec(e),null!==c||null!==f;){if(null===c||null===f||c.index>=f.index)throw new Error("parse error");var b=e.slice(c.index,f.index),T=l.exec(b);if(null===T)throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");w(b.split("\n"),E/1e3)}return function(e){for(var t=[],n=0;n=0;)if(null!==(r=u.exec(e[s]))){var l=r,d=l[1],c=l[2];y===d&&(" "===c?h[h.length-1].end=n:h.push({text:(i=c,i.replace(o,"\n").replace(a,(function(e,t){return String.fromCharCode(t)}))),start:n+t}))}}}},2061:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e,t){for(var n=t+1;(0,r.Z)(e[n]);)n++;return n}function a(e){for(var t=[],n=0;n0&&(1===o.length?o[0].indexOf("--\x3e")>=0&&t.push(o):(o[1].indexOf("--\x3e")>=0||o[0].indexOf("--\x3e")>=0)&&t.push(o)),n=a}return t}},8675:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2061),i=n(788);function a(e,t){for(var n=e.split(/\r\n|\n|\r/),a=(0,r.Z)(n),s=[],u=0;u0){var u=document.createTextNode(o[s]);r.appendChild(u)}}else if("B"===a.nodeName){var l=e(a);l.style.fontWeight="bold",r.appendChild(l)}else if("I"===a.nodeName){var d=e(a);d.style.fontStyle="italic",r.appendChild(d)}else if("U"===a.nodeName){var c=e(a);c.style.textDecoration="underline",r.appendChild(c)}else if("FONT"===a.nodeName&&null!=a.color){var f=e(a);f.style.color=a.color,r.appendChild(f)}else{var p=e(a);r.appendChild(p)}}return r}(t)}},8057:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7253),i=n(2061),a=n(788);function o(e,t){for(var n,o,s,u,l,d=e.split(/\r\n|\n|\r/),c=(0,i.Z)(d),f=[],p=0;p0){var y=p.getAttribute("xml:space"),_=(0,l.Z)(y)?"default"===y:o,b=(0,d.Z)({},i,(0,f.U)(g,[p],n,t));u.push.apply(u,e(p,b,[p].concat(a),_))}}return u}(e,(0,d.Z)({},r),[],i)}(e,n,r,i,s),E=0;E|\u2265/g,">").replace(/\u200E/g,"‎").replace(/\u200F/g,"‏").replace(/\u00A0/g," ")}else if("br"===s.nodeName)i+="\n";else if("span"===s.nodeName&&s.nodeType===Node.ELEMENT_NODE&&s.childNodes.length>0){var d=s.getAttribute("xml:space");i+=n(s,(0,o.Z)(d)?"default"===d:t)}}return i}return n(e,t)}(t,f),g=(0,i.Z)(v+n,h+n,m);return null===g?null:((0,a.Z)(g)&&function(e,t){var n=t.extent;if((0,o.Z)(n)){var r=u._0.exec(n);null!=r&&(e.size=Number(r[1]))}switch(t.writingMode){case"tb":case"tblr":e.vertical="lr";break;case"tbrl":e.vertical="rl"}var i=t.origin;if((0,o.Z)(i))u._0.exec(i);var a=t.align;if((0,o.Z)(a)){e.align=a,"center"===a&&("center"!==e.align&&(e.align="middle"),e.position="auto");var s=d[a];e.positionAlign=void 0===s?"":s;var c=l[a];e.lineAlign=void 0===c?"":c}}(g,r),g)}var f=function(e,t){for(var n=(0,r.Z)(e,t),i=[],a=0;a=2)for(var r=1;r0&&n.appendChild(document.createElement("br")),o[s].length>0){var u=document.createTextNode(o[s]);n.appendChild(u)}}else{var c=e.nodeName.toLowerCase().split("."),f=[];if(c.forEach((function(e){(0,i.Z)(t[e])&&f.push(t[e])})),0!==f.length){var p=document.createAttribute("style");f.forEach((function(e){p.value+=e}));var v=(0,l.Z)(r,a)?a:"span";(n=document.createElement(v)).setAttributeNode(p)}else{var h=(0,l.Z)(r,a)?a:"span";n=document.createElement(h)}for(var m=0;m/,"").replace(/<([u,i,b,c])(\..*?)?(?: .*?)?>(.*?)<\/\1>/g,"<$1$2>$3"),r=(new DOMParser).parseFromString(n,"text/html").body.childNodes,i=[],a=0;a=2){var a=parseInt(i[1],10);isNaN(a)||(t.position=a,void 0!==i[2]&&(t.positionAlign=i[2]))}}(0,u.Z)(e.size)&&(t.size=e.size),"string"==typeof e.align&&(0,s.Z)(["start","center","end","left"],e.align)&&(t.align=e.align)}var d=n(7253);var c=function(e,t){var n=e.split(/\r\n|\n|\r/);if(!/^WEBVTT($| |\t)/.test(n[0]))throw new Error("Can't parse WebVTT: Invalid file.");for(var s,u,c,f,p=(0,o.yE)(n),v=(0,i.Z)(n,p),h=[],m=0;m/;if(o.test(e[0]))n=e[0],r=e.slice(1,e.length);else{if(!o.test(e[1]))return null;a=e[0],n=e[1],r=e.slice(2,e.length)}var s=function(e){var t=/^([\d:.]+)[ |\t]+-->[ |\t]+([\d:.]+)[ |\t]*(.*)$/.exec(e);if(null===t)return null;var n=i(t[1]),r=i(t[2]);return null==n||null==r?null:{start:n,end:r,settings:t[3].split(/ |\t/).reduce((function(e,t){var n=t.split(":");return 2===n.length&&(e[n[0]]=n[1]),e}),{})}}(n);return null===s?null:{start:s.start+t,end:s.end+t,settings:s.settings,payload:r,header:a}}},360:function(e,t,n){"use strict";n.d(t,{yE:function(){return i},tq:function(){return o},JF:function(){return a},$4:function(){return s}});var r=n(6923);function i(e){for(var t=0;t=0)return!0;var r=e[t+1];return void 0!==r&&r.indexOf("--\x3e")>=0}function s(e,t){for(var n=t+1;(0,r.Z)(e[n]);)n++;return n}},1732:function(e,t,n){"use strict";n.d(t,{Z:function(){return ve}});var r=n(7874),i=n(8791),a=n(2817),o=n(4597),s=n(5278);function u(e){var t=e.segment,n=e.url;return t.isInit||null===n?(0,a.of)({type:"data-created",value:{responseData:null}}):(0,o.ZP)({url:n,responseType:"arraybuffer",sendProgressEvents:!0})}function l(e){var t=e.response,n=e.content,i=n.segment,o=n.period,u=t.data,l=t.isChunked;if(n.segment.isInit)return(0,a.of)({type:"parsed-init-segment",value:{initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}});if(l)throw new Error("Image data should not be downloaded in chunks");var d=(0,s.Z)(i.timestampOffset,0);if(null===u||null===r.Z.imageParser)return(0,a.of)({type:"parsed-segment",value:{chunkData:null,chunkInfos:{duration:i.duration,time:i.time},chunkOffset:d,appendWindow:[o.start,o.end],protectionDataUpdate:!1}});var c=r.Z.imageParser(new Uint8Array(u)),f=c.thumbs;return(0,a.of)({type:"parsed-segment",value:{chunkData:{data:f,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkInfos:{time:0,duration:Number.MAX_VALUE,timescale:c.timescale},chunkOffset:d,appendWindow:[o.start,o.end],protectionDataUpdate:!1}})}var d=n(1973),c=n(6362),f=n(2334),p=n(3994),v=n(4975),h=n(9127),m=n(3887),g=n(1989),y=n(8026),_=n(3635),b=n(7445);function T(e){var t=e.aggressiveMode,n=e.referenceDateTime,i=void 0!==e.serverSyncInfos?e.serverSyncInfos.serverTimestamp-e.serverSyncInfos.clientTime:void 0;return function(s){var u,l=s.response,T=s.scheduleRequest,E=s.url,w=s.externalClockOffset,S=null!==(u=l.url)&&void 0!==u?u:E,k=l.responseData,A=null!=i?i:w,x={aggressiveMode:!0===t,unsafelyBaseOnPreviousManifest:s.unsafeMode?s.previousManifest:null,url:S,referenceDateTime:n,externalClockOffset:A},I=r.Z.dashParsers;if(null===I.wasm||"uninitialized"===I.wasm.status||"failure"===I.wasm.status)return m.Z.debug("DASH: WASM MPD Parser not initialized. Running JS one."),R();var Z=function(e){if(e instanceof ArrayBuffer)return e;if("string"==typeof e)return(0,_.tG)(e).buffer;if(e instanceof Document)return(0,_.tG)(e.documentElement.innerHTML).buffer;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(k);if(!function(e){var t=new DataView(e);if(61371===t.getUint16(0)&&191===t.getUint8(2))return!0;if(65279===t.getUint16(0)||65534===t.getUint16(0))return!1;return!0}(Z))return m.Z.info("DASH: MPD doesn't seem to be UTF-8-encoded. Running JS parser instead of the WASM one."),R();if("initialized"===I.wasm.status)return m.Z.debug("DASH: Running WASM MPD Parser."),C(I.wasm.runWasmParser(Z,x));m.Z.debug("DASH: Awaiting WASM initialization before parsing the MPD.");var M=I.wasm.waitForInitialization().catch((function(){}));return(0,d.Dp)(M).pipe((0,p.z)((function(){return null===I.wasm||"initialized"!==I.wasm.status?(m.Z.warn("DASH: WASM MPD parser initialization failed. Running JS parser instead"),R()):(m.Z.debug("DASH: Running WASM MPD Parser."),C(I.wasm.runWasmParser(Z,x)))})));function R(){if(null===I.js)throw new Error("No MPD parser is imported");var e=function(e){if(e instanceof ArrayBuffer)return(new DOMParser).parseFromString((0,_.uR)(new Uint8Array(e)),"text/xml");if("string"==typeof e)return(new DOMParser).parseFromString(e,"text/xml");if(e instanceof Document)return e;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(k);return C(I.js(e,x))}function C(t){if("done"===t.type){var n=t.value,r=n.warnings,i=n.parsed,s=r.map((function(e){return{type:"warning",value:e}})),u=new g.ZP(i,e);return(0,c.z)(a.of.apply(void 0,s),(0,b.Z)(u,S))}var l=t.value,d=l.urls.map((function(e){return T((function(){return(0,o.ZP)({url:e,responseType:"string"===l.format?"text":"arraybuffer"}).pipe((0,v.h)((function(e){return"data-loaded"===e.type})),(0,h.U)((function(e){return e.value})))}))}));return(0,f.a)(d).pipe((0,p.z)((function(e){if("string"===l.format){var t=e.map((function(e){if("string"!=typeof e.responseData)throw new Error("External DASH resources should have been a string");return(0,y.Z)(e,{responseData:e.responseData})}));return C(l.continue(t))}var n=e.map((function(e){if(!(e.responseData instanceof ArrayBuffer))throw new Error("External DASH resources should have been ArrayBuffers");return(0,y.Z)(e,{responseData:e.responseData})}));return C(l.continue(n))})))}}}var E=n(1480),w=n(7839);function S(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function k(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){S(a,r,i,o,s,"next",e)}function s(e){S(a,r,i,o,s,"throw",e)}o(void 0)}))}}var A=n(7757),x=n.n(A),I=n(944),Z=n(9105),M=n(5992),R=n(1946),C=I.Z.DEFAULT_REQUEST_TIMEOUT,P="function"==typeof Headers?Headers:null,N="function"==typeof AbortController?AbortController:null;function D(){return"function"==typeof window.fetch&&!(0,R.Z)(N)&&!(0,R.Z)(P)}var O=function(e){var t;if(!(0,R.Z)(e.headers))if((0,R.Z)(P))t=e.headers;else{t=new P;for(var n=Object.keys(e.headers),r=0;r=300)return m.Z.warn("Fetch: Request HTTP Error",e),void n.error(new Z.Z(e.url,e.status,M.br.ERROR_HTTP_CODE));if(!(0,R.Z)(e.body)){var t=e.headers.get("Content-Length"),r=(0,R.Z)(t)||isNaN(+t)?void 0:+t,i=e.body.getReader(),s=0;return u()}function u(){return l.apply(this,arguments)}function l(){return(l=k(x().mark((function t(){var l,d,c,f,p;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.read();case 2:if((l=t.sent).done||(0,R.Z)(l.value)){t.next=11;break}return s+=l.value.byteLength,d=performance.now(),c={type:"data-chunk",value:{url:e.url,currentTime:d,duration:d-o,sendingTime:o,chunkSize:l.value.byteLength,chunk:l.value.buffer,size:s,totalSize:r}},n.next(c),t.abrupt("return",u());case 11:l.done&&(f=performance.now(),p=f-o,a=!0,n.next({type:"data-complete",value:{duration:p,receivedTime:f,sendingTime:o,size:s,status:e.status,url:e.url}}),n.complete());case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}n.error(new Z.Z(e.url,e.status,M.br.PARSE_ERROR))})).catch((function(t){if(r)m.Z.debug("Fetch: Request aborted.");else{if(i)return m.Z.warn("Fetch: Request timeouted."),void n.error(new Z.Z(e.url,0,M.br.TIMEOUT));m.Z.warn("Fetch: Request Error",t instanceof Error?t.toString():""),n.error(new Z.Z(e.url,0,M.br.ERROR_EVENT))}})),function(){r=!0,u()}}))},L=n(8806),B=n(281);function U(e,t){return"audio"===e||"video"===e?"video/mp4"===t.mimeType||"audio/mp4"===t.mimeType?"mp4":"video/webm"===t.mimeType||"audio/webm"===t.mimeType?"webm":void 0:"text"===e&&"application/mp4"===t.mimeType?"mp4":void 0}var F=n(2006),z=n(4460);function K(e){return function(t){return e(t).pipe((0,F.b)((function(e){"data-loaded"!==e.type&&"data-chunk"!==e.type||null===e.value.responseData||"string"==typeof e.value.responseData||"mp4"!==U(t.adaptation.type,t.representation)||(0,z.Z)(new Uint8Array(e.value.responseData),t.segment.isInit)})))}}var V=n(6968);function G(e,t){var n=t.segment;if(void 0===n.range)return(0,o.ZP)({url:e,responseType:"arraybuffer",sendProgressEvents:!0});if(void 0===n.indexRange)return(0,o.ZP)({url:e,headers:{Range:(0,B.Z)(n.range)},responseType:"arraybuffer",sendProgressEvents:!0});if(n.range[1]+1===n.indexRange[0])return(0,o.ZP)({url:e,headers:{Range:(0,B.Z)([n.range[0],n.indexRange[1]])},responseType:"arraybuffer",sendProgressEvents:!0});var r=(0,o.ZP)({url:e,headers:{Range:(0,B.Z)(n.range)},responseType:"arraybuffer",sendProgressEvents:!1}),i=(0,o.ZP)({url:e,headers:{Range:(0,B.Z)(n.indexRange)},responseType:"arraybuffer",sendProgressEvents:!1});return(0,f.a)([r,i]).pipe((0,h.U)((function(t){var n=t[0],r=t[1],i=(0,V.zo)(new Uint8Array(n.value.responseData),new Uint8Array(r.value.responseData)),a=Math.min(n.value.sendingTime,r.value.sendingTime),o=Math.max(n.value.receivedTime,r.value.receivedTime);return{type:"data-loaded",value:{url:e,responseData:i,size:n.value.size+r.value.size,duration:o-a,sendingTime:a,receivedTime:o}}})))}var H=n(3074),W=n(8766);function $(e,t){var n=t.segment,r=void 0!==n.range?{Range:(0,B.Z)(n.range)}:void 0;return O({url:e,headers:r}).pipe((0,H.R)((function(e,t){if("data-complete"===t.type)return null!==e.partialChunk&&m.Z.warn("DASH Pipelines: remaining chunk does not belong to any segment"),{event:t,completeChunks:[],partialChunk:null};var n=new Uint8Array(t.value.chunk),r=function(e){for(var t=0,n=[];te.length)return[n,r];var o=(0,W.Z)(r,1835295092);if(o<0)return[n,r];var s=t+o+(0,V.pX)(e,o+t);if(s>e.length)return[n,r];var u=Math.max(a,s),l=e.subarray(t,u);n.push(l),t=u}return[n,null]}(null!==e.partialChunk?(0,V.zo)(e.partialChunk,n):n);return{event:t,completeChunks:r[0],partialChunk:r[1]}}),{event:null,completeChunks:[],partialChunk:null}),(0,p.z)((function(e){for(var t=[],n=0;n0)for(var p=0;p=Math.pow(2,8-n))return n}function re(e,t){var n=ne(e,t);if(null==n)return m.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return m.Z.warn("webm: impossible length"),null;for(var r=0,i=0;ie.length)return m.Z.warn("webm: impossible length"),null;for(var r=(e[t]&(1<<8-n)-1)*Math.pow(2,8*(n-1)),i=1;i=i)return!0}return!1}(r,t)}}}function le(e){var t=e.__priv_patchLastSegmentInSidx;return function(e){var n=e.content,r=e.response,i=e.initTimescale,o=n.period,u=n.adaptation,l=n.representation,d=n.segment,c=n.manifest,f=r.data,p=r.isChunked,v=[o.start,o.end];if(null===f)return d.isInit?(0,a.of)({type:"parsed-init-segment",value:{initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}}):(0,a.of)({type:"parsed-segment",value:{chunkData:null,chunkInfos:null,chunkOffset:0,appendWindow:v,protectionDataUpdate:!1}});var h=f instanceof Uint8Array?f:new Uint8Array(f),m=U(u.type,l),g="mp4"===m||void 0===m,y=!1;if(g){var _=(0,q.Z)(h);_.length>0&&(y=l._addProtectionData("cenc",_))}if(!d.isInit){var b=g?se(h,p,d,i):null,T=(0,s.Z)(d.timestampOffset,0);if(g){var E=(0,X.s9)(h);if(void 0!==E){var w=ue(E.filter((function(e){return void 0!==d.privateInfos&&void 0!==d.privateInfos.isEMSGWhitelisted&&d.privateInfos.isEMSGWhitelisted(e)})),c.publishTime);if(void 0!==w){var S=w.needsManifestRefresh,k=w.inbandEvents;return(0,a.of)({type:"parsed-segment",value:{chunkData:h,chunkInfos:b,chunkOffset:T,appendWindow:v,inbandEvents:k,needsManifestRefresh:S,protectionDataUpdate:y}})}}}return(0,a.of)({type:"parsed-segment",value:{chunkData:h,chunkInfos:b,chunkOffset:T,appendWindow:v,protectionDataUpdate:y}})}var A=d.indexRange,x=null;if("webm"===m)x=function(e,t){var n=J(j,[],e,[t,e.length]);if(null==n)return null;var r=n[0],i=n[1],a=ee(e,r);if(null==a)return null;var o=te(e,r);if(null==o)return null;var s=J(475249515,[],e,[r,i]);if(null==s)return null;for(var u=[],l=s[0];l0)){var I=x[x.length-1];Array.isArray(I.range)&&(I.range[1]=1/0)}l.index instanceof oe.Z&&null!==x&&x.length>0&&l.index.initializeIndex(x);var Z=g?(0,X.LD)(h):"webm"===m?ee(h,0):void 0,M=(0,R.Z)(Z)?void 0:Z;return(0,a.of)({type:"parsed-init-segment",value:{initializationData:h,protectionDataUpdate:y,initTimescale:M}})}}var de=n(6807);function ce(e,t,n,r){var i,a,o=e.segment,s=e.adaptation,u=e.representation;if(o.isInit)return null;null===n?r?(i=o.time,a=o.end):m.Z.warn("Transport: Unavailable time data for current text track."):(i=n.time,void 0!==n.duration?a=i+n.duration:r||(a=i+o.duration));var l=function(e){var t=e.codec;if(void 0===t)throw new Error("Cannot parse subtitles: unknown format");switch(t.toLowerCase()){case"stpp":case"stpp.ttml.im1t":return"ttml";case"wvtt":return"vtt"}throw new Error('The codec used for the subtitles "'+t+'" is not managed yet.')}(u);return{data:function(e){var t=(0,de.Le)(e);return null===t?"":(0,_.uR)(t)}(t),type:l,language:s.language,start:i,end:a}}function fe(e,t,n){var r,i,a=e.segment,o=e.adaptation,s=e.representation;return a.isInit?null:(n?m.Z.warn("Transport: Unavailable time data for current text track."):(r=a.time,i=a.time+a.duration),{data:t,type:function(e){var t=e.mimeType,n=void 0===t?"":t;switch(e.mimeType){case"application/ttml+xml":return"ttml";case"application/x-sami":case"application/smil":return"sami";case"text/vtt":return"vtt"}var r=e.codec;if("srt"===(void 0===r?"":r).toLowerCase())return"srt";throw new Error("could not find a text-track parser for the type "+n)}(s),language:o.language,start:r,end:i})}function pe(e){var t=e.__priv_patchLastSegmentInSidx;return function(e){var n=e.response,r=e.content,i=e.initTimescale,o=r.period,u=r.adaptation,l=r.representation,d=r.segment,c=d.timestampOffset,f=void 0===c?0:c,p=n.data,v=n.isChunked;if(null===p)return d.isInit?(0,a.of)({type:"parsed-init-segment",value:{initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}}):(0,a.of)({type:"parsed-segment",value:{chunkData:null,chunkInfos:null,chunkOffset:f,appendWindow:[o.start,o.end],protectionDataUpdate:!1}});var h=U(u.type,l);if("webm"===h)throw new Error("Text tracks with a WEBM container are not yet handled.");return"mp4"===h?function(e,t){var n=e.response,r=e.content,i=e.initTimescale,o=r.period,u=r.representation,l=r.segment,d=l.isInit,c=l.indexRange,f=n.data,p=n.isChunked,v="string"==typeof f?(0,_.tG)(f):f instanceof Uint8Array?f:new Uint8Array(f);if(d){var h=(0,X.Wf)(v,Array.isArray(c)?c[0]:0);if(!0===t&&null!==h&&h.length>0){var m=h[h.length-1];Array.isArray(m.range)&&(m.range[1]=1/0)}var g=(0,X.LD)(v);return u.index instanceof oe.Z&&null!==h&&h.length>0&&u.index.initializeIndex(h),(0,a.of)({type:"parsed-init-segment",value:{initializationData:null,protectionDataUpdate:!1,initTimescale:g}})}var y=se(v,p,l,i),b=ce(r,v,y,p),T=(0,s.Z)(l.timestampOffset,0);return(0,a.of)({type:"parsed-segment",value:{chunkData:b,chunkInfos:y,chunkOffset:T,appendWindow:[o.start,o.end],protectionDataUpdate:!1}})}({response:{data:p,isChunked:v},content:r,initTimescale:i},t):function(e){var t=e.response,n=e.content,r=n.period,i=n.segment,o=i.timestampOffset,s=void 0===o?0:o;if(i.isInit)return(0,a.of)({type:"parsed-init-segment",value:{initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}});var u,l=t.data,d=t.isChunked;if("string"!=typeof l){var c=l instanceof Uint8Array?l:new Uint8Array(l);u=(0,_.uR)(c)}else u=l;var f=fe(n,u,d);return(0,a.of)({type:"parsed-segment",value:{chunkData:f,chunkInfos:null,chunkOffset:s,appendWindow:[r.start,r.end],protectionDataUpdate:!1}})}({response:{data:p,isChunked:v},content:r})}}var ve=function(e){var t=(0,i.Z)({customManifestLoader:e.manifestLoader},null===r.Z.dashParsers.wasm||"initialized"!==r.Z.dashParsers.wasm.status&&"initializing"!==r.Z.dashParsers.wasm.status?"arraybuffer":"text"),n=T(e),s=function(e){var t=e.lowLatencyMode,n=e.segmentLoader;return!0!==e.checkMediaSegmentIntegrity?r:K(r);function r(e){var r=e.url;if(null==r)return(0,a.of)({type:"data-created",value:{responseData:null}});if(t||void 0===n)return Y(r,e,t);var i={adaptation:e.adaptation,manifest:e.manifest,period:e.period,representation:e.representation,segment:e.segment,transport:"dash",url:r};return new E.y((function(a){var o=!1,s=!1,u=n(i,{reject:function(e){var t,n,r;if(void 0===e&&(e={}),!s){o=!0;var i=e,u=null!==(t=null==i?void 0:i.message)&&void 0!==t?t:"Unknown error when fetching a DASH segment through a custom segmentLoader.",l=new w.Z(u,null!==(n=null==i?void 0:i.canRetry)&&void 0!==n&&n,null!==(r=null==i?void 0:i.isOfflineError)&&void 0!==r&&r,null==i?void 0:i.xhr);a.error(l)}},resolve:function(e){s||(o=!0,a.next({type:"data-loaded",value:{responseData:e.data,size:e.size,duration:e.duration}}),a.complete())},progress:function(e){s||a.next({type:"progress",value:{duration:e.duration,size:e.size,totalSize:e.totalSize}})},fallback:function(){s=!0,Y(r,e,t).subscribe(a)}});return function(){o||s||"function"!=typeof u||u()}}))}}(e),d=le(e);return{manifest:{loader:t,parser:n},audio:{loader:s,parser:d},video:{loader:s,parser:d},text:{loader:function(e){var t=e.lowLatencyMode;return!0!==e.checkMediaSegmentIntegrity?n:K(n);function n(e){var n=e.segment.range,r=e.url;if(null===r)return(0,a.of)({type:"data-created",value:{responseData:null}});if(e.segment.isInit)return G(r,e);var i=U(e.adaptation.type,e.representation),s="mp4"===i||void 0===i;if(t&&s){if(D())return $(r,e);(0,L.Z)("DASH: Your browser does not have the fetch API. You will have a higher chance of rebuffering when playing close to the live edge")}var u=s?"arraybuffer":"text";return(0,o.ZP)({url:r,responseType:u,headers:Array.isArray(n)?{Range:(0,B.Z)(n)}:null,sendProgressEvents:!0})}}(e),parser:pe(e)},image:{loader:u,parser:l}}}},2339:function(e,t,n){"use strict";n.d(t,{Z:function(){return _e}});var r=n(2817),i=n(9127),a=n(2006),o=n(7874),s=n(3887),u=n(1989),l=n(6807),d=n(8999),c=n(7714),f=n(811),p=n(6968),v=n(6923),h=n(8026),m=n(9829),g=n(3635),y=n(5278),_=n(2689),b={};function T(e){if(null!=b[e])return b[e];var t=(0,g.tG)(e);return b[e]=t,t}function E(e,t){var n=t.length+8;return n<=_.s?(0,p.zo)((0,p.kh)(n),T(e),t):(0,p.zo)((0,p.kh)(1),T(e),(0,p.el)(n+8),t)}function w(e,t){return E(e,p.zo.apply(void 0,t))}function S(e){var t=[];e.periods.forEach((function(n){var r=n.id;if((0,c.Z)(t,r)){s.Z.warn("Two periods with the same ID found. Updating.");var i=r+"-dup";n.id=i,S(e),t.push(i)}else t.push(r);var a=n.adaptations,o=[];Object.keys(a).forEach((function(t){var n=a[t];void 0!==n&&n.forEach((function(t){var n=t.id;if((0,c.Z)(o,n)){s.Z.warn("Two adaptations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,S(e),o.push(r)}else o.push(n);var i=[];t.representations.forEach((function(t){var n=t.id;if((0,c.Z)(i,n)){s.Z.warn("Two representations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,S(e),i.push(r)}else i.push(n)}))}))}))}))}var k=n(9689);function A(e){return[{systemId:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",privateData:(0,p.zo)([8,1,18,16],e)}]}function x(e,t){if(void 0===t&&(t=A),null===e.firstElementChild||"ProtectionHeader"!==e.firstElementChild.nodeName)throw new Error("Protection should have ProtectionHeader child");var n=e.firstElementChild,r=(0,k.K)(null===n.textContent?"":n.textContent),i=function(e){var t=(0,p.qb)(e,8),n=(0,g.wV)(e.subarray(10,t+10)),r=(new DOMParser).parseFromString(n,"application/xml").querySelector("KID");if(null===r)throw new Error("Cannot parse PlayReady private data: invalid XML");var i=null===r.textContent?"":r.textContent,a=(0,g.wO)((0,k.K)(i));return(0,g.ci)(a).toLowerCase()}(r),a=(0,g.nr)(i),o=n.getAttribute("SystemID");return{keyId:a,keySystems:[{systemId:(null!==o?o:"").toLowerCase().replace(/\{|\}/g,""),privateData:r}].concat(t(a))}}var I=n(9362),Z=n(8232),M=n(3911),R=n(1091),C=n(5505);function P(e,t,n){var r=e.timeline,i=e.timescale,a=r[r.length-1],o=t.timescale===i?{time:t.time,duration:t.duration}:{time:t.time/t.timescale*i,duration:t.duration/t.timescale*i};return!(n.time===o.time)&&(o.time>=(0,M.jH)(a,null)&&(a.duration===o.duration?a.repeatCount++:e.timeline.push({duration:o.duration,start:o.time,repeatCount:0}),!0))}function N(e,t){return e.replace(/\{start time\}/g,String(t))}function D(e,t,n){var r=t-e;return r>0?Math.floor(r/n):0}function O(e,t){var n=e.repeatCount;if(null!=e.duration&&n<0){var r=void 0!==t?t.start:1/0;n=Math.ceil((r-e.start)/e.duration)-1}return n}var L=function(){function e(e,t){var n=t.aggressiveMode,r=t.isLive,i=t.segmentPrivateInfos,a=t.timeShiftBufferDepth,o=null==t.manifestReceivedTime?performance.now():t.manifestReceivedTime;if(this._index=e,this._indexValidityTime=o,this._timeShiftBufferDepth=a,this._initSegmentInfos={bitsPerSample:i.bitsPerSample,channels:i.channels,codecPrivateData:i.codecPrivateData,packetSize:i.packetSize,samplingRate:i.samplingRate,timescale:e.timescale,protection:i.protection},this._isAggressiveMode=n,this._isLive=r,0!==e.timeline.length){var s=e.timeline[e.timeline.length-1],u=(0,M.jH)(s,null);if(this._initialScaledLastPosition=u,r){var l=o/1e3*e.timescale;this._scaledLiveGap=l-u}}}var t=e.prototype;return t.getInitSegment=function(){return{id:"init",isInit:!0,privateInfos:{smoothInitSegment:this._initSegmentInfos},mediaURLs:null,time:0,end:0,duration:0,timescale:1}},t.getSegments=function(e,t){this._refreshTimeline();for(var n,r=function(e,t,n){var r=void 0===e.timescale||0===e.timescale?1:e.timescale;return{up:t*r,to:(t+n)*r}}(this._index,e,t),i=r.up,a=r.to,o=this._index,s=o.timeline,u=o.timescale,l=o.media,d=this._isAggressiveMode,c=[],f=s.length,p=null==this._scaledLiveGap?void 0:performance.now()/1e3*u-this._scaledLiveGap,v=0;v=a)return c;null!=n&&(n+=y+1)}return c},t.shouldRefresh=function(e,t){if(this._refreshTimeline(),!this._isLive)return!1;var n=this._index,r=n.timeline,i=n.timescale,a=r[r.length-1];if(void 0===a)return!1;var o=a.repeatCount,s=a.start+(o+1)*a.duration;return!(t*i=s||e*i>a.start+o*a.duration)},t.getFirstPosition=function(){this._refreshTimeline();var e=this._index;return 0===e.timeline.length?null:e.timeline[0].start/e.timescale},t.getLastPosition=function(){this._refreshTimeline();var e=this._index;if(null==this._scaledLiveGap){var t=e.timeline[e.timeline.length-1];return(0,M.jH)(t,null)/e.timescale}for(var n=e.timeline.length-1;n>=0;n--)for(var r=e.timeline[n],i=performance.now()/1e3*e.timescale,a=r.start,o=r.duration,s=r.repeatCount;s>=0;s--){var u=a+o*(s+1);if((this._isAggressiveMode?u-o:u)<=i-this._scaledLiveGap)return u/e.timescale}},t.checkDiscontinuity=function(e){return this._refreshTimeline(),(0,M._j)(this._index,e,void 0)},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline();var t=this._index,n=t.timeline,r=t.timescale;return(0,R.Z)(e,n,r,0)},t.canBeOutOfSyncError=function(e){return!!this._isLive&&(e instanceof I.Z&&(e.isHttpError(404)||e.isHttpError(412)))},t._replace=function(e){var t=this._index.timeline,n=e._index.timeline,r=this._index.timescale,i=e._index.timescale;if(this._index=e._index,this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap,0!==t.length&&0!==n.length&&r===i){var a=t[t.length-1],o=n[n.length-1],u=(0,M.jH)(o,null);if(!((0,M.jH)(a,null)<=u))for(var l=0;lu){if(d.duration!==o.duration)return;var f=u-d.start;if(0===f)return s.Z.warn("Smooth Parser: a discontinuity detected in the previous manifest has been resolved."),void(this._index.timeline=this._index.timeline.concat(t.slice(l)));if(f<0||f%d.duration!=0)return;var p=f/d.duration-1,v=d.repeatCount-p;if(v<0)return;o.repeatCount+=v;var h=t.slice(l+1);return void(this._index.timeline=this._index.timeline.concat(h))}}}},t._update=function(e){(0,C.Z)(this._index.timeline,e._index.timeline),this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap},t.isFinished=function(){return!this._isLive},t.isInitialized=function(){return!0},t.addNewSegments=function(e,t){this._refreshTimeline();for(var n=0;n>3:2)?"mp4a.40.2":"mp4a.40."+n}(u,l);return{audiotag:void 0!==i?parseInt(i,10):i,bitrate:p,bitsPerSample:void 0!==a?parseInt(a,10):a,channels:void 0!==o?parseInt(o,10):o,codecPrivateData:u,codecs:h,customAttributes:n,mimeType:void 0!==l?F[l]:l,packetSize:void 0!==d?parseInt(d,10):d,samplingRate:void 0!==c?parseInt(c,10):c};case"video":var m=r("CodecPrivateData"),g=r("FourCC"),_=r("MaxWidth"),b=r("MaxHeight"),T=r("Bitrate"),E=void 0===T||isNaN(parseInt(T,10))?0:parseInt(T,10);if(void 0!==g&&void 0===F[g]||void 0===m)return s.Z.warn("Smooth parser: Unsupported video codec. Ignoring quality level."),null;var w=function(e){var t=/00000001\d7([0-9a-fA-F]{6})/.exec(e);return null!==t&&(0,v.Z)(t[1])?"avc1."+t[1]:"avc1.4D401E"}(m);return{bitrate:E,customAttributes:n,mimeType:void 0!==g?F[g]:g,codecPrivateData:m,codecs:w,width:void 0!==_?parseInt(_,10):void 0,height:void 0!==b?parseInt(b,10):void 0};case"text":var S=r("CodecPrivateData"),k=r("FourCC"),A=r("Bitrate");return{bitrate:void 0===A||isNaN(parseInt(A,10))?0:parseInt(A,10),customAttributes:n,mimeType:void 0!==k?F[k]:k,codecPrivateData:(0,y.Z)(S,"")};default:return s.Z.error("Smooth Parser: Unrecognized StreamIndex type: "+t),null}}function o(t){var r=t.root,i=t.timescale,o=t.rootURL,u=t.protections,l=t.timeShiftBufferDepth,y=t.manifestReceivedTime,_=t.isLive,b=r.getAttribute("Timescale"),T=null===b||isNaN(+b)?i:+b,w=r.getAttribute("Type");if(null===w)throw new Error("StreamIndex without type.");(0,c.Z)(d.r,w)||s.Z.warn("Smooth Parser: Unrecognized adaptation type:",w);var S=w,k=r.getAttribute("Subtype"),A=r.getAttribute("Language"),x=r.getAttribute("Url"),I=null===x?"":x;var Z,M=B(r,(function(e,t,r){switch(t){case"QualityLevel":var i=a(r,S);if(null===i)return e;("video"!==S||i.bitrate>n)&&e.qualityLevels.push(i);break;case"c":e.cNodes.push(r)}return e}),{qualityLevels:[],cNodes:[]}),R=M.qualityLevels,C=M.cNodes,P={timeline:(Z=C,Z.reduce((function(e,t,n){var r=t.getAttribute("d"),i=t.getAttribute("t"),a=t.getAttribute("r"),o=null!==a?+a-1:0,s=null!==i?+i:void 0,u=null!==r?+r:void 0;if(0===n)s=void 0===s||isNaN(s)?0:s;else{var l=e[n-1];if(null==s||isNaN(s)){if(null==l.duration||isNaN(l.duration))throw new Error("Smooth: Invalid CNodes. Missing timestamp.");s=l.start+l.duration*(l.repeatCount+1)}}if(null==u||isNaN(u)){var d=Z[n+1];if(void 0===d)return e;var c=d.getAttribute("t"),f=(0,v.Z)(c)?+c:null;if(null===f)throw new Error("Can't build index timeline from Smooth Manifest.");u=f-s}return e.push({duration:u,start:s,repeatCount:o}),e}),[])),timescale:T};(0,f.Z)(0!==R.length,"Adaptation should have at least one playable representation.");var N=S+((0,v.Z)(A)?"_"+A:""),D=R.map((function(t){var n,r,i,a,s=(0,m.Z)(o,I),d={timeline:P.timeline,timescale:P.timescale,media:(n=s,r=t.bitrate,i=t.customAttributes,n.replace(/\{bitrate\}/g,String(r)).replace(/{CustomAttributes}/g,i.length>0?i[0]:""))},c=(0,v.Z)(t.mimeType)?t.mimeType:U[S],f=t.codecs,b=N+"_"+(null!=S?S+"-":"")+(null!=c?c+"-":"")+(null!=f?f+"-":"")+String(t.bitrate),T=[];u.length>0&&(a=u[0],u.forEach((function(e){var t=e.keyId;e.keySystems.forEach((function(e){T.push({keyId:t,systemId:e.systemId})}))})));var w={bitsPerSample:t.bitsPerSample,channels:t.channels,codecPrivateData:t.codecPrivateData,packetSize:t.packetSize,samplingRate:t.samplingRate,protection:null!=a?{keyId:a.keyId}:void 0},k=null!=e.aggressiveMode&&e.aggressiveMode,A=new L(d,{aggressiveMode:k,isLive:_,manifestReceivedTime:y,segmentPrivateInfos:w,timeShiftBufferDepth:l}),x=(0,h.Z)({},t,{index:A,mimeType:c,codecs:f,id:b});if(T.length>0||void 0!==a){var Z=void 0===a?[]:a.keySystems.map((function(e){var t=e.systemId,n=e.privateData,r=t.replace(/-/g,"");return{systemId:r,data:function(e,t){if(32!==e.length)throw new Error("HSS: wrong system id length");var n=0;return E("pssh",(0,p.zo)([n,0,0,0],(0,g.nr)(e),(0,p.kh)(t.length),t))}(r,n)}}));if(Z.length>0){var M=[{type:"cenc",values:Z}];x.contentProtections={keyIds:T,initData:M}}else x.contentProtections={keyIds:T,initData:[]}}return x}));if("ADVT"===k)return null;var O={id:N,type:S,representations:D,language:null==A?void 0:A};return"text"===S&&"DESC"===k&&(O.closedCaption=!0),O}return function(n,r,a){var s=(0,m.f)(null==r?"":r),u=n.documentElement;if(null==u||"SmoothStreamingMedia"!==u.nodeName)throw new Error("document root should be SmoothStreamingMedia");var l=u.getAttribute("MajorVersion"),d=u.getAttribute("MinorVersion");if(null===l||null===d||!/^[2]-[0-2]$/.test(l+"-"+d))throw new Error("Version should be 2.0, 2.1 or 2.2");var c,f,p=u.getAttribute("Timescale"),h=(0,v.Z)(p)?isNaN(+p)?1e7:+p:1e7,g=B(u,(function(t,n,r){switch(n){case"Protection":t.protections.push(x(r,e.keySystems));break;case"StreamIndex":t.adaptationNodes.push(r)}return t}),{adaptationNodes:[],protections:[]}),y=g.protections,_=g.adaptationNodes,b="boolean"==typeof(c=u.getAttribute("IsLive"))?c:"string"==typeof c&&"TRUE"===c.toUpperCase();if(b){var T=u.getAttribute("DVRWindowLength");null==T||isNaN(+T)||0==+T||(f=+T/h)}var E,w,k,A,I,Z,M=_.reduce((function(e,t){var n=o({root:t,rootURL:s,timescale:h,protections:y,isLive:b,timeShiftBufferDepth:f,manifestReceivedTime:a});if(null===n)return e;var r=n.type,i=e[r];return void 0===i?e[r]=[n]:i.push(n),e}),{}),R=null,C=void 0!==M.video?M.video[0]:void 0,P=void 0!==M.audio?M.audio[0]:void 0;if(void 0!==C||void 0!==P){var N=[],D=[];if(void 0!==C){var O=C.representations[0];if(void 0!==O){var L=O.index.getFirstPosition(),U=O.index.getLastPosition();null!=L&&N.push(L),null!=U&&D.push(U)}}if(void 0!==P){var F=P.representations[0];if(void 0!==F){var z=F.index.getFirstPosition(),K=F.index.getLastPosition();null!=z&&N.push(z),null!=K&&D.push(K)}}N.length>0&&(I=Math.max.apply(Math,N)),D.length>0&&(Z=Math.min.apply(Math,D))}var V=u.getAttribute("Duration"),G=null!=V&&0!=+V?+V/h:void 0;b?(E=e.suggestedPresentationDelay,w=t,k=null!=I?I:w,A={isLinear:!0,value:null!=Z?Z:Date.now()/1e3-w,time:performance.now()},R=null!=f?f:null):(k=null!=I?I:0,A={isLinear:!1,value:void 0!==Z?Z:void 0!==G?k+G:1/0,time:performance.now()});var H=b?0:k,W=b?void 0:A.value,$={availabilityStartTime:void 0===w?0:w,clockOffset:i,isLive:b,isDynamic:b,isLastPeriodKnown:!0,timeBounds:{absoluteMinimumTime:k,timeshiftDepth:R,maximumTimeData:A},periods:[{adaptations:M,duration:void 0!==W?W-H:G,end:W,id:"gen-smooth-period-0",start:H}],suggestedPresentationDelay:E,transportType:"smooth",uris:null==r?[]:[r]};return S($),$}},K=n(4597),V=n(8806),G=n(4460),H=n(8791),W=n(7445),$=n(4644),Y=n(2297);function q(e,t,n,r,i){var a,o,u,d=[];if(i){var c=(0,l.XA)(e);null!==c?(u=function(e){var t=(0,Y.nR)(e,3565190898,3392751253,2387879627,2655430559);if(void 0===t)return[];for(var n=[],r=t[0],i=t[4],a=0;a0)return e;var n=new Uint8Array(e.length+4);return n.set(e.subarray(0,t+8),0),n[t+3]=1|n[t+3],n.set([0,0,0,0],t+8),n.set(e.subarray(t+8,e.length),t+12),(0,$.J6)(n)}(l,s[1]-s[0]),f=te(u,d,c,i,(0,Y.nR)(a,2721664850,1520127764,2722393154,2086964724)),v=w("moof",[i,f]),h=(0,Y.Qy)(v,1836019558),m=(0,Y.Qy)(f,1953653094),g=(0,Y.Qy)(c,1953658222);if(null===h||null===m||null===g)throw new Error("Smooth: Invalid moof, trun or traf generation");var y=h[1]-h[0]+i.length+(m[1]-m[0])+u.length+d.length+(g[1]-g[0])+8,_=n[2]-n[0],b=v.length-_,T=(0,Y.Qy)(e,1835295092);if(null===T)throw new Error("Smooth: Invalid ISOBMFF given");if(!X.YM&&(0===b||b<=-8)){var S=T[1];return v.set((0,p.kh)(S),y),e.set(v,n[0]),b<=-8&&e.set(E("free",new Uint8Array(-b-8)),v.length),e}var k=T[1]+b;v.set((0,p.kh)(k),y);var A=new Uint8Array(e.length+b),x=e.subarray(0,n[0]),I=e.subarray(n[2],e.length);return A.set(x,0),A.set(v,x.length),A.set(I,x.length+v.length),A}var re=n(1480),ie=n(7839),ae=n(281);function oe(e,t,n,r,i,a){var o,s,u,l=w("stbl",[n,E("stts",new Uint8Array(8)),E("stsc",new Uint8Array(8)),E("stsz",new Uint8Array(12)),E("stco",new Uint8Array(8))]),d=w("dinf",[function(e){return E("dref",(0,p.zo)(7,[1],e))}(E("url ",new Uint8Array([0,0,0,1])))]),c=w("minf",[r,d,l]),f=function(e){var t,n;switch(e){case"video":t="vide",n="VideoHandler";break;case"audio":t="soun",n="SoundHandler";break;default:t="hint",n=""}return E("hdlr",(0,p.zo)(8,(0,g.tG)(t),12,(0,g.tG)(n),1))}(t),v=w("mdia",[function(e){return E("mdhd",(0,p.zo)(12,(0,p.kh)(e),8))}(e),f,c]),h=w("trak",[function(e,t,n){return E("tkhd",(0,p.zo)((0,p.kh)(7),8,(0,p.kh)(n),20,[1,0,0,0],[0,1,0,0],12,[0,1,0,0],12,[64,0,0,0],(0,p.XT)(e),2,(0,p.XT)(t),2))}(i,a,1),v]),m=w("mvex",[(o=1,E("trex",(0,p.zo)(4,(0,p.kh)(o),[0,0,0,1],12)))]),y=function(e,t,n){return w("moov",[e,t,n])}(function(e,t){return E("mvhd",(0,p.zo)(12,(0,p.kh)(e),4,[0,1],2,[1,0],10,[0,1],14,[0,1],14,[64,0,0,0],26,(0,p.XT)(t+1)))}(e,1),m,h),_=(s="isom",u=["isom","iso2","iso6","avc1","dash"],E("ftyp",p.zo.apply(void 0,[(0,g.tG)(s),[0,0,0,1]].concat(u.map(g.tG)))));return(0,p.zo)(_,y)}function se(e,t,n,r,i,a,o,s){var u=o.split("00000001"),l=u[1],d=u[2];if(void 0===l||void 0===d)throw new Error("Smooth: unsupported codec private data.");var c,f,v=function(e,t,n){var r=2===n?1:4===n?3:0,i=e[1],a=e[2],o=e[3];return E("avcC",(0,p.zo)([1,i,a,o,252|r,225],(0,p.XT)(e.length),e,[1],(0,p.XT)(t.length),t))}((0,g.nr)(l),(0,g.nr)(d),a);if(void 0===s){c=J([function(e,t,n,r,i,a,o){return E("avc1",(0,p.zo)(6,(0,p.XT)(1),16,(0,p.XT)(e),(0,p.XT)(t),(0,p.XT)(n),2,(0,p.XT)(r),6,[0,1,i.length],(0,g.tG)(i),31-i.length,(0,p.XT)(a),[255,255],o))}(t,n,r,i,"AVC Coding",24,v)])}else{var h=w("schi",[ee(1,8,s)]),m=j("cenc",65536);c=J([function(e,t,n,r,i,a,o,s){return E("encv",(0,p.zo)(6,(0,p.XT)(1),16,(0,p.XT)(e),(0,p.XT)(t),(0,p.XT)(n),2,(0,p.XT)(r),6,[0,1,i.length],(0,g.tG)(i),31-i.length,(0,p.XT)(a),[255,255],o,s))}(t,n,r,i,"AVC Coding",24,v,w("sinf",[Q("avc1"),m,h]))])}return oe(e,"video",c,((f=new Uint8Array(12))[3]=1,E("vmhd",f)),t,n)}var ue=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];function le(e,t,n,r,i,a,o){var s,u,l,d=function(e,t){return E("esds",(0,p.zo)(4,[3,25],(0,p.XT)(e),[0,4,17,64,21],11,[5,2],(0,g.nr)(t),[6,1,2]))}(1,0===a.length?(s=i,u=t,l=((l=((l=(63&2)<<4)|31&ue.indexOf(s))<<4)|31&u)<<3,(0,g.ci)((0,p.XT)(l))):a);return oe(e,"audio",function(){if(void 0===o)return J([function(e,t,n,r,i,a){return E("mp4a",(0,p.zo)(6,(0,p.XT)(e),8,(0,p.XT)(t),(0,p.XT)(n),2,(0,p.XT)(r),(0,p.XT)(i),2,a))}(1,t,n,r,i,d)]);var e=w("schi",[ee(1,8,o)]),a=j("cenc",65536),s=w("sinf",[Q("mp4a"),a,e]);return J([function(e,t,n,r,i,a,o){return E("enca",(0,p.zo)(6,(0,p.XT)(e),8,(0,p.XT)(t),(0,p.XT)(n),2,(0,p.XT)(r),(0,p.XT)(i),2,a,o))}(1,t,n,r,i,d,s)])}(),E("smhd",new Uint8Array(8)),0,0)}function de(e){var t,n=e.url,r=e.segment.range;return Array.isArray(r)&&(t={Range:(0,ae.Z)(r)}),(0,K.ZP)({url:n,responseType:"arraybuffer",headers:t,sendProgressEvents:!0})}var ce=function(e){return function(t){var n=t.segment,i=t.representation,a=t.adaptation,o=t.period,s=t.manifest,u=t.url;if(n.isInit){if(void 0===n.privateInfos||void 0===n.privateInfos.smoothInitSegment)throw new Error("Smooth: Invalid segment format");var l,d=n.privateInfos.smoothInitSegment,c=d.codecPrivateData,f=d.timescale,p=d.protection,v=void 0===p?{keyId:void 0,keySystems:void 0}:p;if(void 0===c)throw new Error("Smooth: no codec private data.");switch(a.type){case"video":var h=i.width,m=void 0===h?0:h,g=i.height;l=se(f,m,void 0===g?0:g,72,72,4,c,v.keyId);break;case"audio":var y=d.channels,_=void 0===y?0:y,b=d.bitsPerSample,T=void 0===b?0:b,E=d.packetSize,w=void 0===E?0:E,S=d.samplingRate;l=le(f,_,T,w,void 0===S?0:S,c,v.keyId);break;default:0,l=new Uint8Array(0)}return(0,r.of)({type:"data-created",value:{responseData:l}})}if(null===u)return(0,r.of)({type:"data-created",value:{responseData:null}});var k={adaptation:a,manifest:s,period:o,representation:i,segment:n,transport:"smooth",url:u};return"function"!=typeof e?de(k):new re.y((function(t){var n=!1,r=!1,i=e(k,{reject:function(e){var i,a,o;if(void 0===e&&(e={}),!r){n=!0;var s=e,u=null!==(i=null==s?void 0:s.message)&&void 0!==i?i:"Unknown error when fetching a Smooth segment through a custom segmentLoader.",l=new ie.Z(u,null!==(a=null==s?void 0:s.canRetry)&&void 0!==a&&a,null!==(o=null==s?void 0:s.isOfflineError)&&void 0!==o&&o,null==s?void 0:s.xhr);t.error(l)}},resolve:function(e){r||(n=!0,t.next({type:"data-loaded",value:{responseData:e.data,size:e.size,duration:e.duration}}),t.complete())},fallback:function(){r=!0,de(k).subscribe(t)},progress:function(e){r||t.next({type:"progress",value:{duration:e.duration,size:e.size,totalSize:e.totalSize}})}});return function(){n||r||"function"!=typeof i||i()}}))}},fe=/(\.isml?)(\?token=\S+)?$/,pe=/\?token=(\S+)/;function ve(e,t){return(0,v.Z)(t)?e.replace(pe,"?token="+t):e.replace(pe,"")}function he(e){return fe.test(e)?((0,V.Z)("Giving a isml URL to loadVideo is deprecated. Please give the Manifest URL directly"),e.replace(fe,"$1/manifest$2")):e}var me=/\.wsx?(\?token=\S+)?/;function ge(e,t,n){var r;s.Z.debug("Smooth Parser: update segments information.");for(var i=e.representations,a=0;a=0}var _e=function(e){var t=z(e),n=ce(e.segmentLoader),d={customManifestLoader:e.manifestLoader},c={loader:function(t){return t.segment.isInit||!0!==e.checkMediaSegmentIntegrity?n(t):n(t).pipe((0,a.b)((function(e){"data-loaded"!==e.type&&"data-chunk"!==e.type||null===e.value.responseData||(0,G.Z)(new Uint8Array(e.value.responseData),t.segment.isInit)})))},parser:function(e){var t,n,i=e.content,a=e.response,o=e.initTimescale,s=i.segment,u=i.adaptation,l=i.manifest,d=a.data,c=a.isChunked;if(null===d)return s.isInit?(0,r.of)({type:"parsed-init-segment",value:{initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}}):(0,r.of)({type:"parsed-segment",value:{chunkData:null,chunkInfos:null,chunkOffset:0,appendWindow:[void 0,void 0],protectionDataUpdate:!1}});var f=d instanceof Uint8Array?d:new Uint8Array(d);if(s.isInit){var p=null===(n=null===(t=s.privateInfos)||void 0===t?void 0:t.smoothInitSegment)||void 0===n?void 0:n.timescale;return(0,r.of)({type:"parsed-init-segment",value:{initializationData:d,initTimescale:p,protectionDataUpdate:!1}})}var v=void 0!==o?q(f,c,o,s,l.isLive):null;if(null===v||null===v.chunkInfos||void 0===v.scaledSegmentTime)throw new Error("Smooth Segment without time information");var h=v.nextSegments,m=v.chunkInfos,g=ne(f,v.scaledSegmentTime);return h.length>0&&ge(u,h,s),(0,r.of)({type:"parsed-segment",value:{chunkData:g,chunkInfos:m,chunkOffset:0,appendWindow:[void 0,void 0],protectionDataUpdate:!1}})}};return{manifest:{resolver:function(e){var t,n=e.url;if(void 0===n)return(0,r.of)({url:void 0});me.test(n)?((0,V.Z)("Giving WSX URL to loadVideo is deprecated. You should only give Manifest URLs."),t=(0,K.ZP)({url:ve(n,""),responseType:"document"}).pipe((0,i.U)((function(e){var t=e.value,n=t.responseData.getElementsByTagName("media")[0].getAttribute("src");if(null===n||0===n.length)throw new Error("Invalid ISML");return n})))):t=(0,r.of)(n);var a=function(e){var t=pe.exec(e);if(null!==t){var n=t[1];if(void 0!==n)return n}return""}(n);return t.pipe((0,i.U)((function(e){return{url:ve(he(e),a)}})))},loader:(0,H.Z)(d,"text"),parser:function(n){var r=n.response,i=n.url,a=void 0===r.url?i:r.url,o="string"==typeof r.responseData?(new DOMParser).parseFromString(r.responseData,"text/xml"):r.responseData,s=r.receivedTime,l=t(o,a,s),d=new u.ZP(l,{representationFilter:e.representationFilter,supplementaryImageTracks:e.supplementaryImageTracks,supplementaryTextTracks:e.supplementaryTextTracks});return(0,W.Z)(d,a)}},audio:c,video:c,text:{loader:function(t){var n=t.segment,i=t.representation,o=t.url;if(n.isInit||null===o)return(0,r.of)({type:"data-created",value:{responseData:null}});var s=ye(i);return s&&!0===e.checkMediaSegmentIntegrity?(0,K.ZP)({url:o,responseType:"arraybuffer",sendProgressEvents:!0}).pipe((0,a.b)((function(e){"data-loaded"===e.type&&(0,G.Z)(new Uint8Array(e.value.responseData),n.isInit)}))):(0,K.ZP)({url:o,responseType:s?"arraybuffer":"text",sendProgressEvents:!0})},parser:function(e){var t,n,i=e.content,a=e.response,o=e.initTimescale,u=i.manifest,d=i.adaptation,c=i.representation,f=i.segment,p=d.language,v=ye(c),h=c.mimeType,m=void 0===h?"":h,y=c.codec,_=void 0===y?"":y,b=a.data,T=a.isChunked;if(f.isInit)return(0,r.of)({type:"parsed-init-segment",value:{initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}});if(null===b)return(0,r.of)({type:"parsed-segment",value:{chunkData:null,chunkInfos:null,chunkOffset:0,appendWindow:[void 0,void 0],protectionDataUpdate:!1}});var E,w,S,k,A=null;if(v){var x;x="string"==typeof b?(0,g.tG)(b):b instanceof Uint8Array?b:new Uint8Array(b);var I=void 0!==o?q(x,T,o,f,u.isLive):null;n=null==I?void 0:I.nextSegments,null===(A=null!==(t=null==I?void 0:I.chunkInfos)&&void 0!==t?t:null)?T?s.Z.warn("Smooth: Unavailable time data for current text track."):(E=f.time,w=f.end):(E=A.time,w=void 0!==A.duration?A.time+A.duration:f.end);var Z=_.toLowerCase();if("application/ttml+xml+mp4"===m||"stpp"===Z||"stpp.ttml.im1t"===Z)k="ttml";else{if("wvtt"!==Z)throw new Error("could not find a text-track parser for the type "+m);k="vtt"}var M=(0,l.Le)(x);S=null===M?"":(0,g.uR)(M)}else{var R;if(E=f.time,w=f.end,"string"!=typeof b){var C=b instanceof Uint8Array?b:new Uint8Array(b);R=(0,g.uR)(C)}else R=b;switch(m){case"application/x-sami":case"application/smil":k="sami";break;case"application/ttml+xml":k="ttml";break;case"text/vtt":k="vtt"}if(void 0===k){if("srt"!==_.toLowerCase())throw new Error("could not find a text-track parser for the type "+m);k="srt"}S=R}null!==A&&Array.isArray(n)&&n.length>0&&ge(d,n,f);var P=null!=E?E:0;return(0,r.of)({type:"parsed-segment",value:{chunkData:{type:k,data:S,start:E,end:w,language:p},chunkInfos:A,chunkOffset:P,appendWindow:[void 0,void 0],protectionDataUpdate:!1}})}},image:{loader:function(e){var t=e.segment,n=e.url;return t.isInit||null===n?(0,r.of)({type:"data-created",value:{responseData:null}}):(0,K.ZP)({url:n,responseType:"arraybuffer",sendProgressEvents:!0})},parser:function(e){var t=e.response,n=e.content,i=t.data,a=t.isChunked;if(n.segment.isInit)return(0,r.of)({type:"parsed-init-segment",value:{initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}});if(a)throw new Error("Image data should not be downloaded in chunks");if(null===i||null===o.Z.imageParser)return(0,r.of)({type:"parsed-segment",value:{chunkData:null,chunkInfos:null,chunkOffset:0,appendWindow:[void 0,void 0],protectionDataUpdate:!1}});var s=o.Z.imageParser(new Uint8Array(i)),u=s.thumbs;return(0,r.of)({type:"parsed-segment",value:{chunkData:{data:u,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkInfos:{time:0,duration:Number.MAX_VALUE,timescale:s.timescale},chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}})}}}}},281:function(e,t,n){"use strict";function r(e){var t=e[0],n=e[1];return n===1/0?"bytes="+t+"-":"bytes="+t+"-"+n}n.d(t,{Z:function(){return r}})},4460:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5389),i=n(8766);function a(e,t){if(t){if((0,i.Z)(e,1718909296)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `ftyp` box");if((0,i.Z)(e,1836019574)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `moov` box")}else{if((0,i.Z)(e,1836019558)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `moof` box");if((0,i.Z)(e,1835295092)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `mdat` box")}}},8766:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(6968);function i(e,t){for(var n=e.length,i=0;i+8<=n;){var a=(0,r.pX)(e,i);if(0===a)a=n-i;else if(1===a){if(i+16>n)return-1;a=(0,r.pV)(e,i+8)}if(isNaN(a)||a<=0)return-1;if((0,r.pX)(e,i+4)===t)return i+a<=n?i:-1;i+=a}return-1}},8791:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(1946),i=n(4597),a=n(1480),o=n(7839);function s(e,t){var n=e.customManifestLoader,s=function(e){return function(t){var n=t.url;if(void 0===n)throw new Error("Cannot perform HTTP(s) request. URL not known");return(0,i.ZP)({url:n,responseType:e})}}(t);return(0,r.Z)(n)?s:function(e,t){return function(n){return new a.y((function(r){var i=n.url,a=Date.now()-performance.now(),s=!1,u=!1,l=e(i,{reject:function(e){var t,n,i;if(!u){s=!0;var a=e,l=null!==(t=null==a?void 0:a.message)&&void 0!==t?t:"Unknown error when fetching the Manifest through a custom manifestLoader.",d=new o.Z(l,null!==(n=null==a?void 0:a.canRetry)&&void 0!==n&&n,null!==(i=null==a?void 0:a.isOfflineError)&&void 0!==i&&i,null==a?void 0:a.xhr);r.error(d)}},resolve:function(e){if(!u){s=!0;var t=void 0!==e.receivingTime?e.receivingTime-a:void 0,n=void 0!==e.sendingTime?e.sendingTime-a:void 0;r.next({type:"data-loaded",value:{responseData:e.data,size:e.size,duration:e.duration,url:e.url,receivedTime:t,sendingTime:n}}),r.complete()}},fallback:function(){u=!0,t(n).subscribe(r)}});return function(){s||u||"function"!=typeof l||l()}}))}}(n,s)}},7445:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2817),i=n(6362);function a(e,t){var n=r.of.apply(void 0,e.parsingErrors.map((function(e){return{type:"warning",value:e}})));return(0,i.z)(n,(0,r.of)({type:"parsed",value:{manifest:e,url:t}}))}},4791:function(e,t,n){"use strict";function r(e,t){if(e.length!==t.length)return!1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return!1;return!0}n.d(t,{Z:function(){return r}})},3274:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.find)return e.find(t,n);for(var r=e.length>>>0,i=0;i>>0,i=0;i>>0;if(0===r)return!1;for(var i,a,o=0|n,s=o>=0?Math.min(o,r-1):Math.max(r+o,0);s=a.length)throw new Error("Unable to parse base64 string.");var t=a[e];if(255===t)throw new Error("Unable to parse base64 string.");return t}function s(e){var t,n="",r=e.length;for(t=2;t>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2|e[t]>>6],n+=i[63&e[t]];return t===r+1&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4],n+="=="),t===r&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2],n+="="),n}function u(e){var t=e.length%4,n=e;0!==t&&(r.Z.warn("base64ToBytes: base64 given miss padding"),n+=3===t?"=":2===t?"==":"===");var i=n.indexOf("=");if(-1!==i&&i>16,l[c+1]=a>>8&255,l[c+2]=255&a;return l.subarray(0,l.length-s)}},6968:function(e,t,n){"use strict";function r(){for(var e,t=arguments.length,n=-1,r=0;++n0&&(i.set(e,a),a+=e.length);return i}function i(e,t){return(e[t+0]<<8)+(e[t+1]<<0)}function a(e,t){return 65536*e[t+0]+256*e[t+1]+e[t+2]}function o(e,t){return 16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3]}function s(e,t){return 4294967296*(16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3])+16777216*e[t+4]+65536*e[t+5]+256*e[t+6]+e[t+7]}function u(e){return new Uint8Array([e>>>8&255,255&e])}function l(e){return new Uint8Array([e>>>24&255,e>>>16&255,e>>>8&255,255&e])}function d(e){var t=e%4294967296,n=(e-t)/4294967296;return new Uint8Array([n>>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t])}function c(e,t){return(e[t+0]<<0)+(e[t+1]<<8)}function f(e,t){return e[t+0]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]}function p(e){return new Uint8Array([255&e,e>>>8&255,e>>>16&255,e>>>24&255])}function v(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer)}n.d(t,{zo:function(){return r},zK:function(){return i},QI:function(){return a},pX:function(){return o},pV:function(){return s},qb:function(){return c},dN:function(){return f},XT:function(){return u},kh:function(){return l},el:function(){return d},O_:function(){return p},_f:function(){return v}})},8117:function(e,t,n){"use strict";var r=n(1480),i=n(1973),a=n(2817),o=n(1946);t.Z=function(e){return e instanceof r.y?e:(0,o.Z)(e)||"function"!=typeof e.subscribe&&"function"!=typeof e.then?(0,a.of)(e):(0,i.Dp)(e)}},4437:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r,i=n(5987),a=n(8337),o=1,s={};function u(e){return e in s&&(delete s[e],!0)}var l=function(e){var t=o++;return s[t]=!0,r||(r=Promise.resolve()),r.then((function(){return u(t)&&e()})),t},d=function(e){u(e)},c={setImmediate:function(){for(var e=[],t=0;t0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=c.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(c.clearImmediate(n),t._scheduled=void 0)},t}(a.o),p=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.ZT)(t,e),t.prototype.flush=function(e){this._active=!0,this._scheduled=void 0;var t,n=this.actions,r=-1;e=e||n.shift();var i=n.length;do{if(t=e.execute(e.state,e.delay))break}while(++r=Number.MAX_SAFE_INTEGER&&(e+="0",t=0),e+String(t)}}n.d(t,{Z:function(){return r}})},6923:function(e,t,n){"use strict";function r(e){return"string"==typeof e&&e.length>0}n.d(t,{Z:function(){return r}})},1946:function(e,t,n){"use strict";function r(e){return null==e}n.d(t,{Z:function(){return r}})},7829:function(e,t,n){"use strict";var r=n(5553);t.ZP=r.ZP},5553:function(e,t,n){"use strict";n.d(t,{ZP:function(){return d},iH:function(){return l},Y1:function(){return u}});var r=n(6923),i=n(1946),a={aa:"aar",ab:"abk",ae:"ave",af:"afr",ak:"aka",am:"amh",an:"arg",ar:"ara",as:"asm",av:"ava",ay:"aym",az:"aze",ba:"bak",be:"bel",bg:"bul",bi:"bis",bm:"bam",bn:"ben",bo:"bod",br:"bre",bs:"bos",ca:"cat",ce:"che",ch:"cha",co:"cos",cr:"cre",cs:"ces",cu:"chu",cv:"chv",cy:"cym",da:"dan",de:"deu",dv:"div",dz:"dzo",ee:"ewe",el:"ell",en:"eng",eo:"epo",es:"spa",et:"est",eu:"eus",fa:"fas",ff:"ful",fi:"fin",fj:"fij",fo:"fao",fr:"fra",fy:"fry",ga:"gle",gd:"gla",gl:"glg",gn:"grn",gu:"guj",gv:"glv",ha:"hau",he:"heb",hi:"hin",ho:"hmo",hr:"hrv",ht:"hat",hu:"hun",hy:"hye",hz:"her",ia:"ina",id:"ind",ie:"ile",ig:"ibo",ii:"iii",ik:"ipk",io:"ido",is:"isl",it:"ita",iu:"iku",ja:"jpn",jv:"jav",ka:"kat",kg:"kon",ki:"kik",kj:"kua",kk:"kaz",kl:"kal",km:"khm",kn:"kan",ko:"kor",kr:"kau",ks:"kas",ku:"kur",kv:"kom",kw:"cor",ky:"kir",la:"lat",lb:"ltz",lg:"lug",li:"lim",ln:"lin",lo:"lao",lt:"lit",lu:"lub",lv:"lav",mg:"mlg",mh:"mah",mi:"mri",mk:"mkd",ml:"mal",mn:"mon",mr:"mar",ms:"msa",mt:"mlt",my:"mya",na:"nau",nb:"nob",nd:"nde",ne:"nep",ng:"ndo",nl:"nld",nn:"nno",no:"nor",nr:"nbl",nv:"nav",ny:"nya",oc:"oci",oj:"oji",om:"orm",or:"ori",os:"oss",pa:"pan",pi:"pli",pl:"pol",ps:"pus",pt:"por",qu:"que",rm:"roh",rn:"run",ro:"ron",ru:"rus",rw:"kin",sa:"san",sc:"srd",sd:"snd",se:"sme",sg:"sag",si:"sin",sk:"slk",sl:"slv",sm:"smo",sn:"sna",so:"som",sq:"sqi",sr:"srp",ss:"ssw",st:"sot",su:"sun",sv:"swe",sw:"swa",ta:"tam",te:"tel",tg:"tgk",th:"tha",ti:"tir",tk:"tuk",tl:"tgl",tn:"tsn",to:"ton",tr:"tur",ts:"tso",tt:"tat",tw:"twi",ty:"tah",ug:"uig",uk:"ukr",ur:"urd",uz:"uzb",ve:"ven",vi:"vie",vo:"vol",wa:"wln",wo:"wol",xh:"xho",yi:"yid",yo:"yor",za:"zha",zh:"zho",zu:"zul"},o={alb:"sqi",arm:"hye",baq:"eus",bur:"mya",chi:"zho",cze:"ces",dut:"nld",fre:"fra",geo:"kat",ger:"deu",gre:"ell",ice:"isl",mac:"mkd",mao:"mri",may:"msa",per:"fas",slo:"slk",rum:"ron",tib:"bod",wel:"cym"};function s(e){if((0,i.Z)(e)||""===e)return"";var t=function(e){var t;switch(e.length){case 2:t=a[e];break;case 3:t=o[e]}return t}((""+e).toLowerCase().split("-")[0]);return(0,r.Z)(t)?t:e}function u(e){if(!(0,i.Z)(e)){var t,n=!1;return"string"==typeof e?t=e:(t=e.language,!0===e.closedCaption&&(n=!0)),{language:t,closedCaption:n,normalized:s(t)}}return e}function l(e){if((0,i.Z)(e))return e;if("string"==typeof e)return{language:e,audioDescription:!1,normalized:s(e)};var t={language:e.language,audioDescription:!0===e.audioDescription,normalized:s(s(e.language))};return!0===e.isDub&&(t.isDub=!0),t}var d=s},8894:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},8026:function(e,t){"use strict";t.Z="function"==typeof Object.assign?Object.assign:function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=0;n<(arguments.length<=1?0:arguments.length-1);n++){var r=n+1<1||arguments.length<=n+1?void 0:arguments[n+1];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}},1679:function(e,t,n){"use strict";t.Z="function"==typeof Object.values?Object.values:function(e){return Object.keys(e).map((function(t){return e[t]}))}},9589:function(e,t,n){"use strict";var r=n(8555),i=n.n(r);t.Z="function"==typeof Promise?Promise:i()},2829:function(e,t,n){"use strict";n.d(t,{JN:function(){return d},uH:function(){return b},F_:function(){return p},L7:function(){return m},XS:function(){return f},DD:function(){return h},rx:function(){return c},at:function(){return v},kR:function(){return g},Ti:function(){return s},A1:function(){return o},tn:function(){return _}});function r(e,t){return Math.abs(e-t)<.016666666666666666}function i(e,t){return{start:Math.min(e.start,t.start),end:Math.max(e.end,t.end)}}function a(e,t){return e.end<=t.start}function o(e,t){for(var n=0;n=0;n--){var r=e.start(n);if(t>=r){var i=e.end(n);if(t=o?r.push({start:a,end:o}):n={start:a,end:o}}return{outerRanges:r,innerRange:n}}function v(e,t){var n=c(e,t);return null!==n?n.end-n.start:0}function h(e,t){var n=c(e,t);return null!==n?t-n.start:0}function m(e,t){var n=c(e,t);return null!==n?n.end-t:1/0}function g(e,t){if(t.start===t.end)return e;for(var n=t,r=0;r0)for(var o=0;o0)for(var s=0;sl&&n.push({start:l,end:a[d].start}),l=a[d].end;l=0&&(d.timeout=l),d.responseType=u,"document"===d.responseType&&d.overrideMimeType("text/xml"),!(0,s.Z)(i)){var c=i;for(var f in c)c.hasOwnProperty(f)&&d.setRequestHeader(f,c[f])}var p=performance.now();return d.onerror=function(){n.error(new a.Z(r,d.status,"ERROR_EVENT",d))},d.ontimeout=function(){n.error(new a.Z(r,d.status,"TIMEOUT",d))},!0===e.sendProgressEvents&&(d.onprogress=function(e){var t=performance.now();n.next({type:"progress",value:{url:r,duration:t-p,sendingTime:p,currentTime:t,size:e.loaded,totalSize:e.total}})}),d.onload=function(e){if(4===d.readyState)if(d.status>=200&&d.status<300){var t,i=performance.now(),u=d.response instanceof ArrayBuffer?d.response.byteLength:e.total,l=d.status,c=d.responseType,f=(0,o.Z)(d.responseURL)?d.responseURL:r;if(t="json"===c?"object"==typeof d.response?d.response:function(e){try{return JSON.parse(e)}catch(e){return null}}(d.responseText):d.response,(0,s.Z)(t))return void n.error(new a.Z(r,d.status,"PARSE_ERROR",d));n.next({type:"data-loaded",value:{status:l,url:f,responseType:c,sendingTime:p,receivedTime:i,duration:i-p,size:u,responseData:t}}),n.complete()}else n.error(new a.Z(r,d.status,"ERROR_HTTP_CODE",d))},d.send(),function(){(0,s.Z)(d)||4===d.readyState||d.abort()}}))}},9829:function(e,t,n){"use strict";n.d(t,{Z:function(){return o},f:function(){return s}});var r=/^(?:[a-z]+:)?\/\//i,i=/\/\.{1,2}\//;function a(e){if(!i.test(e))return e;for(var t=[],n=e.split("/"),r=0,a=n.length;r=0&&t===n+1)return e}var i=e.indexOf("?");return i>=0&&i>8&255}return n}function u(e){if(a)try{return new TextDecoder("utf-16le").decode(e)}catch(e){r.Z.warn("Utils: could not use TextDecoder to parse UTF-16LE, fallbacking to another implementation",e)}for(var t="",n=0;n=t?n:new Array(t-n.length+1).join("0")+n}function c(e){if(a)try{return(new TextDecoder).decode(e)}catch(e){r.Z.warn("Utils: could not use TextDecoder to parse UTF-8, fallbacking to another implementation",e)}var t=e;239===t[0]&&187===t[1]&&191===t[2]&&(t=t.subarray(3));var n,i=function(e){for(var t="",n=0;n=256?"%u"+d(u,4):"%"+d(u,2)}}return decodeURIComponent(n)}function f(e){for(var t=e.length,n=new Uint8Array(t/2),r=0,i=0;r>>4).toString(16),n+=(15&e[r]).toString(16),t.length>0&&r=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(u&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:Z(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},1480:function(e,t,n){"use strict";n.d(t,{y:function(){return d}});var r=n(6267),i=n(5720),a=n(6766),o=n(278);function s(e){return 0===e.length?o.y:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var u=n(3912),l=n(8474),d=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var a,o=(a=e)&&a instanceof r.Lv||function(e){return e&&(0,l.m)(e.next)&&(0,l.m)(e.error)&&(0,l.m)(e.complete)}(a)&&(0,i.Nn)(a)?e:new r.Hp(e,t,n);if(u.v.useDeprecatedSynchronousErrorHandling)this._deprecatedSyncErrorSubscribe(o);else{var s=this.operator,d=this.source;o.add(s?s.call(o,d):d?this._subscribe(o):this._trySubscribe(o))}return o},e.prototype._deprecatedSyncErrorSubscribe=function(e){var t=e;t._syncErrorHack_isSubscribing=!0;var n=this.operator;if(n)e.add(n.call(e,this.source));else try{e.add(this._subscribe(e))}catch(e){t.__syncError=e}for(var r=t;r;){if("__syncError"in r)try{throw r.__syncError}finally{e.unsubscribe()}r=r.destination}t._syncErrorHack_isSubscribing=!1},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=c(t))((function(t,r){var i;i=n.subscribe((function(t){try{e(t)}catch(e){r(e),null==i||i.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[a.L]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=t.hasError,r=t.isStopped,i=t.observers;return n||r?a.Lc:(i.push(e),new a.w0((function(){return(0,s.P)(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new i.y;return e.source=this,e},t.create=function(e,t){return new l(e,t)},t}(i.y),l=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return(0,r.ZT)(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:a.Lc},t}(u)},6267:function(e,t,n){"use strict";n.d(t,{Hp:function(){return p},Lv:function(){return f}});var r=n(5987),i=n(8474),a=n(5720),o=n(3912),s=n(5),u=n(2967),l=d("C",void 0,void 0);function d(e,t,n){return{kind:e,value:t,error:n}}var c=n(8380),f=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,(0,a.Nn)(t)&&t.add(n)):n.destination=g,n}return(0,r.ZT)(t,e),t.create=function(e,t,n){return new p(e,t,n)},t.prototype.next=function(e){this.isStopped?m(function(e){return d("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?m(d("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?m(l,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(a.w0),p=function(e){function t(t,n,r){var a,s=e.call(this)||this;if((0,i.m)(t))a=t;else if(t){var l;a=t.next,n=t.error,r=t.complete,s&&o.v.useDeprecatedNextContext?(l=Object.create(t)).unsubscribe=function(){return s.unsubscribe()}:l=t,a=null==a?void 0:a.bind(l),n=null==n?void 0:n.bind(l),r=null==r?void 0:r.bind(l)}return s.destination={next:a?v(a,s):u.Z,error:v(null!=n?n:h,s),complete:r?v(r,s):u.Z},s}return(0,r.ZT)(t,e),t}(f);function v(e,t){return function(){for(var n=[],i=0;i=2,!0))}},5583:function(e,t,n){"use strict";n.d(t,{B:function(){return l}});var r=n(5987),i=n(1973),a=n(4727),o=n(6716),s=n(6267),u=n(6798);function l(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new o.x}:t,r=e.resetOnError,a=void 0===r||r,l=e.resetOnComplete,c=void 0===l||l,f=e.resetOnRefCountZero,p=void 0===f||f;return function(e){var t=null,r=null,o=null,l=0,f=!1,v=!1,h=function(){null==r||r.unsubscribe(),r=null},m=function(){h(),t=o=null,f=v=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return(0,u.e)((function(e,u){l++,v||f||h();var y=o=null!=o?o:n();u.add((function(){0!==--l||v||f||(r=d(g,p))})),y.subscribe(u),t||(t=new s.Hp({next:function(e){return y.next(e)},error:function(e){v=!0,h(),r=d(m,a,e),y.error(e)},complete:function(){f=!0,h(),r=d(m,c),y.complete()}}),(0,i.Dp)(e).subscribe(t))}))(e)}}function d(e,t){for(var n=[],i=2;i0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function l(e,t){for(var n=0,r=t.length,i=e.length;n1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof d?Promise.resolve(n.value.v).then(u,l):c(a[0][2],n)}catch(e){c(a[0][3],e)}var n}function u(e){s("next",e)}function l(e){s("throw",e)}function c(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function f(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=s(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}Object.create}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";n.d(r,{default:function(){return wi}});var e=n(5991),t=n(1788),i=n(6716),a=n(3),o=n(5987),s=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return(0,o.ZT)(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(i.x),u=n(2817),l=n(1480),d=n(9917),c={connector:function(){return new i.x},resetOnDisconnect:!0};function f(e,t){void 0===t&&(t=c);var n=null,r=t.connector,i=t.resetOnDisconnect,a=void 0===i||i,o=r(),s=new l.y((function(e){return o.subscribe(e)}));return s.connect=function(){return n&&!n.closed||(n=(0,d.P)((function(){return e})).subscribe(o),a&&n.add((function(){return o=r()}))),n},s}var p=n(2334),v=n(6362),h=n(3071),m=n(1545),g=n(3505),y=n(9127),_=n(3741),b=n(3994),T=n(8515),E=n(4975),w=n(5583),S=n(8430),k=n(4727),A=n(3833),x=n(6798),I=n(2566);var Z=n(8550),M=n(8902),R=n(8719);function C(){if(P()){var e=document;"function"==typeof e.exitFullscreen?e.exitFullscreen():"function"==typeof e.msExitFullscreen?e.msExitFullscreen():"function"==typeof e.mozCancelFullScreen?e.mozCancelFullScreen():"function"==typeof e.webkitExitFullscreen&&e.webkitExitFullscreen()}}function P(){var e=document;return null!=e.fullscreenElement||null!=e.mozFullScreenElement||null!=e.webkitFullscreenElement||null!=e.msFullscreenElement}var N=n(3666),D=n(3887);function O(){var e,t;if(!N.vU)return!0;var n=function(){if(!N.vU)return D.Z.warn("Compat: Can't access Firefox version on no firefox browser."),null;var e=navigator.userAgent,t=/Firefox\/([0-9]+)\./.exec(e);if(null===t)return-1;var n=parseInt(t[1],10);return isNaN(n)?-1:n}();return null===n||n<67||void 0!==(null===(t=null===(e=HTMLVideoElement)||void 0===e?void 0:e.prototype)||void 0===t?void 0:t.requirePictureInPicture)}var L=n(944),B=n(3714),U=n(9822),F=n(5389);function z(e,t){var n=t.defaultCode,r=t.defaultReason;if((0,U.Z)(e))return e;var i=e instanceof Error?e.toString():r;return new F.Z(n,i)}var K=n(5992),V=n(7874),G=n(1989),H=n(4791),W=n(1959),$=n(1946),Y=n(8894),q=n(8026),X=n(9589),j=n(2829),Q=n(8806),J=n(6139),ee=n(6033);function te(e){return(0,d.P)((function(){var t=ee.Z.getState(e);if(null===t)return(0,u.of)(null);D.Z.info("EME: Disposing of the current MediaKeys");var n=t.loadedSessionsStore;return ee.Z.clearState(e),n.closeAllSessions().pipe((0,M.j)((0,J.Y)(e,null)))}))}function ne(e){var t=ee.Z.getState(e);return null==t?null:t.keySystemOptions.type}var re=n(533);function ie(e){return(0,d.P)((function(){if(D.Z.info("EME: Clearing-up EME session."),N.fq)return D.Z.info("EME: disposing current MediaKeys."),te(e).pipe((0,re.l)());var t=ee.Z.getState(e);return null!==t&&!0===t.keySystemOptions.closeSessionsOnStop?(D.Z.info("EME: closing all current sessions."),t.loadedSessionsStore.closeAllSessions().pipe((0,re.l)())):(D.Z.info("EME: Nothing to clear. Returning right away. No state =",null===t),m.E)}))}var ae=n(9878);function oe(e){return(0,x.e)((function(t,n){try{t.subscribe(n)}finally{n.add(e)}}))}var se=n(5561),ue=n(2793),le=n(9105),de=n(9362);function ce(e){return e instanceof le.Z?new de.Z("PIPELINE_LOAD_ERROR",e):z(e,{defaultCode:"PIPELINE_LOAD_ERROR",defaultReason:"Unknown error when fetching the Manifest"})}var fe=n(6625);var pe,ve=n(7839),he=n(2572);function me(e){return e instanceof le.Z?e.type===K.br.ERROR_EVENT&&!1===navigator.onLine:e instanceof ve.Z&&e.isOfflineError}function ge(e,t,n){var r=n.baseDelay,i=n.maxDelay,a=n.maxRetryRegular,o=n.maxRetryOffline,s=0,u=pe.None,l=e.slice();return 0===l.length?(D.Z.warn("Fetchers: no URL given to `tryURLsWithBackoff`."),m.E):function e(n,d){return t(n).pipe((0,y.U)((function(e){return{type:"response",value:e}})),(0,ae.K)((function(t){if(!function(e){return e instanceof le.Z?e.type===K.br.ERROR_HTTP_CODE?e.status>=500||404===e.status||415===e.status||412===e.status:e.type===K.br.TIMEOUT||e.type===K.br.ERROR_EVENT:e instanceof ve.Z?"boolean"==typeof e.canRetry?e.canRetry:void 0!==e.xhr&&(e.xhr.status>=500||404===e.xhr.status||415===e.xhr.status||412===e.xhr.status):(0,U.Z)(e)&&"INTEGRITY_ERROR"===e.code}(t)){if(l.length<=1)throw t;l.splice(d,1);var n=d>=l.length-1?0:d;return e(l[n],n).pipe((0,S.O)({type:"retry",value:t}))}var c=function(e){return me(e)?pe.Offline:pe.Regular}(t),f=c===pe.Offline?o:a;if(c!==u&&(s=0,u=c),df)throw t;var v=Math.min(r*Math.pow(2,s-1),i),h=(0,he.Z)(v),m=l[0];return(0,fe.H)(h).pipe((0,b.z)((function(){return e(m,0)})),(0,S.O)({type:"retry",value:t}))})))}(l[0],0)}function ye(e,t){return ge([null],(function(){return e}),t)}!function(e){e[e.None=0]="None",e[e.Regular=1]="Regular",e[e.Offline=2]="Offline"}(pe||(pe={}));var _e=L.Z.DEFAULT_MAX_MANIFEST_REQUEST_RETRY,be=L.Z.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,Te=L.Z.INITIAL_BACKOFF_DELAY_BASE,Ee=L.Z.MAX_BACKOFF_DELAY_BASE;var we=function(){function e(e,t,n){var r,i,a,o;this._manifestUrl=e,this._pipelines=t.manifest,this._backoffOptions=(i=(r=n).maxRetryRegular,a=r.maxRetryOffline,{baseDelay:(o=r.lowLatencyMode)?Te.LOW_LATENCY:Te.REGULAR,maxDelay:o?Ee.LOW_LATENCY:Ee.REGULAR,maxRetryRegular:void 0!==i?i:_e,maxRetryOffline:void 0!==a?a:be})}var t=e.prototype;return t.fetch=function(e){var t,n=this,r=null!=e?e:this._manifestUrl,i=null!==(t=this._pipelines.resolver)&&void 0!==t?t:u.of,a=this._pipelines.loader;return(0,se.Z)(i,{url:r}).pipe((0,ae.K)((function(e){throw ce(e)})),(0,b.z)((function(e){return ye((0,se.Z)(a,e),n._backoffOptions).pipe((0,ae.K)((function(e){throw ce(e)})),(0,y.U)((function(e){return"retry"===e.type?{type:"warning",value:ce(e.value)}:{type:"response",parse:function(t){return n._parseLoadedManifest(e.value.value,t)}}})))})))},t.parse=function(e,t){return this._parseLoadedManifest({responseData:e,size:void 0,duration:void 0},t)},t._parseLoadedManifest=function(e,t){var n,r,a=e.sendingTime,o=e.receivedTime,s=performance.now(),u=new i.x,l=(n=this._backoffOptions,r=u,function(e){return ye((0,se.Z)(e,void 0),n).pipe((0,ue.Z)((function(e){return"retry"===e.type?(r.next(ce(e.value)),null):e.value}),null),(0,ae.K)((function(e){throw ce(e)})))});return(0,h.T)(u.pipe((0,y.U)((function(e){return{type:"warning",value:e}}))),this._pipelines.parser({response:e,url:this._manifestUrl,externalClockOffset:t.externalClockOffset,previousManifest:t.previousManifest,scheduleRequest:l,unsafeMode:t.unsafeMode}).pipe((0,ae.K)((function(e){throw z(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"})})),(0,y.U)((function(e){if("warning"===e.type)return{type:"warning",value:z(e.value,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"})};var t=performance.now()-s;return D.Z.info("MF: Manifest parsed in "+t+"ms"),{type:"parsed",manifest:e.value.manifest,sendingTime:a,receivedTime:o,parsingTime:t}})),oe((function(){u.complete()}))))},e}(),Se=L.Z.DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR,ke=L.Z.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,Ae=L.Z.INITIAL_BACKOFF_DELAY_BASE,xe=L.Z.MAX_BACKOFF_DELAY_BASE;var Ie=n(5138),Ze=function(){function e(e){var t=e.prioritySteps;if(this._minPendingPriority=null,this._waitingQueue=[],this._pendingTasks=[],this._prioritySteps=t,this._prioritySteps.high>=this._prioritySteps.low)throw new Error("FP Error: the max high level priority should be given a lowerpriority number than the min low priority.")}var t=e.prototype;return t.create=function(e,t){var n=this,r=new l.y((function(i){var a,o=!0;return a={observable:r,priority:t,trigger:function(t){null!==a.subscription&&(a.subscription.unsubscribe(),a.subscription=null,o&&i.next({type:"interrupted"})),t&&(n._minPendingPriority=null===n._minPendingPriority?a.priority:Math.min(n._minPendingPriority,a.priority),n._pendingTasks.push(a),a.subscription=e.subscribe({next:function(e){return i.next({type:"data",value:e})},error:function(e){i.error(e),a.subscription=null,a.finished=!0,n._onTaskEnd(a)},complete:function(){i.next({type:"ended"}),o&&i.complete(),a.subscription=null,a.finished=!0,n._onTaskEnd(a)}}))},subscription:null,finished:!1},n._canBeStartedNow(a)?(a.trigger(!0),n._isRunningHighPriorityTasks()&&n._interruptCancellableTasks()):n._waitingQueue.push(a),function(){if(o=!1,null!==a.subscription&&(a.subscription.unsubscribe(),a.subscription=null),!a.finished){var e=(0,Ie.Z)(n._waitingQueue,(function(e){return e.observable===r}));if(e>=0)n._waitingQueue.splice(e,1);else{var t=(0,Ie.Z)(n._pendingTasks,(function(e){return e.observable===r}));if(t<0)return void D.Z.warn("FP: unsubscribing non-existent task");var i=n._pendingTasks.splice(t,1)[0];0===n._pendingTasks.length?(n._minPendingPriority=null,n._loopThroughWaitingQueue()):n._minPendingPriority===i.priority&&(n._minPendingPriority=Math.min.apply(Math,n._pendingTasks.map((function(e){return e.priority}))),n._loopThroughWaitingQueue())}}}}));return r},t.updatePriority=function(e,t){var n=(0,Ie.Z)(this._waitingQueue,(function(t){return t.observable===e}));if(n>=0){var r=this._waitingQueue[n];if(r.priority===t)return;if(r.priority=t,!this._canBeStartedNow(r))return;return this._startWaitingQueueTask(n),void(this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks())}var i=(0,Ie.Z)(this._pendingTasks,(function(t){return t.observable===e}));if(i<0)D.Z.warn("FP: request to update the priority of a non-existent task");else{var a=this._pendingTasks[i];if(a.priority!==t){var o=a.priority;if(a.priority=t,null===this._minPendingPriority||tt.priority?t.priority:e}),null);if(!(null===e||null!==this._minPendingPriority&&this._minPendingPriority=this._prioritySteps.low)return this._interruptPendingTask(t),this._interruptCancellableTasks()}},t._startWaitingQueueTask=function(e){this._waitingQueue.splice(e,1)[0].trigger(!0)},t._interruptPendingTask=function(e){var t=(0,Ie.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0?D.Z.warn("FP: Interrupting a non-existent pending task. Aborting..."):(this._pendingTasks.splice(t,1),this._waitingQueue.push(e),0===this._pendingTasks.length?this._minPendingPriority=null:this._minPendingPriority===e.priority&&(this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority})))),e.trigger(!1))},t._onTaskEnd=function(e){var t=(0,Ie.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0||(this._pendingTasks.splice(t,1),this._pendingTasks.length>0?this._minPendingPriority===e.priority&&(this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority})))):(this._minPendingPriority=null,this._loopThroughWaitingQueue()))},t._canBeStartedNow=function(e){return null===this._minPendingPriority||e.priority<=this._minPendingPriority},t._isRunningHighPriorityTasks=function(){return null!==this._minPendingPriority&&this._minPendingPriority<=this._prioritySteps.high},e}(),Me=n(2006),Re=n(7714),Ce=n(8418),Pe=n(908),Ne=function(){function e(){this._cache=new WeakMap}var t=e.prototype;return t.add=function(e,t){var n=e.representation;e.segment.isInit&&this._cache.set(n,t)},t.get=function(e){var t=e.representation;if(e.segment.isInit){var n=this._cache.get(t);if(void 0!==n)return n}return null},e}(),De=n(8117);function Oe(e,t,n){return function(r){return function(r){function i(){var i;return ge(null!==(i=r.segment.mediaURLs)&&void 0!==i?i:[null],(function(t){var n=(0,q.Z)({url:t},r);return(0,v.z)((0,u.of)({type:"request",value:n}),(0,se.Z)(e,n))}),n).pipe((0,ae.K)((function(e){throw ce(e)})),(0,y.U)((function(e){if("retry"===e.type)return{type:"warning",value:ce(e.value)};if("request"===e.value.type)return e.value;var n=e.value;return"data-loaded"===n.type&&null!=t&&t.add(r,n.value),e.value})))}var a=null!=t?t.get(r):null;return null!=a?(0,De.Z)(a).pipe((0,y.U)((function(e){return{type:"cache",value:e}})),(0,ae.K)(i)):i()}(r).pipe((0,b.z)((function(e){var t;switch(t="data-chunk-complete"!==e.type&&"data-loaded"!==e.type||void 0===e.value.size||void 0===e.value.duration?m.E:(0,u.of)({type:"metrics",value:{size:e.value.size,duration:e.value.duration,content:r}}),e.type){case"warning":case"request":case"progress":return(0,u.of)(e);case"cache":case"data-created":case"data-loaded":return(0,v.z)((0,u.of)({type:"data",value:e.value}),t);case"data-chunk":return(0,u.of)({type:"chunk",value:e.value});case"data-chunk-complete":return(0,v.z)((0,u.of)({type:"chunk-complete",value:null}),t);default:(0,Ce.Z)(e)}})))}}var Le=(0,Pe.Z)();var Be=L.Z.MIN_CANCELABLE_PRIORITY,Ue=L.Z.MAX_HIGH_PRIORITY_LEVEL,Fe=function(){function e(e,t){this._transport=e,this._prioritizer=new Ze({prioritySteps:{high:Ue,low:Be}}),this._backoffOptions=t}return e.prototype.createSegmentFetcher=function(e,t){var n,r,i,a=function(e,t){var n=t.maxRetryRegular,r=t.maxRetryOffline,i=t.lowLatencyMode;return{maxRetryRegular:"image"===e?0:null!=n?n:Se,maxRetryOffline:null!=r?r:ke,baseDelay:i?Ae.LOW_LATENCY:Ae.REGULAR,maxDelay:i?xe.LOW_LATENCY:xe.REGULAR}}(e,this._backoffOptions),o=function(e,t,n,r){var i=(0,Re.Z)(["audio","video"],e)?new Ne:void 0,a=Oe(t[e].loader,i,r),o=t[e].parser;return function(e){var t=Le(),r=!1;return a(e).pipe((0,Me.b)((function(e){switch(e.type){case"metrics":n.next(e);break;case"request":var i=e.value.segment;if(void 0===i)return;r=!0,n.next({type:"requestBegin",value:{duration:i.duration,time:i.time,requestTimestamp:performance.now(),id:t}});break;case"progress":var a=e.value;null!=a.totalSize&&a.size1){var l=n[u],d=function(){for(var e=u+1;el)return e}();if(null!=d&&r>=n[d])return t[d]}if((null==s||s<1.15)&&r=0;c--)if(t[c]t&&t-e.time>-1.2}));if(n<0)return[];for(var r=e[n],i=r.time,a=[r],o=n+1;o0?l.progress[l.progress.length-1]:void 0,p=pt(l);if(void 0!==f&&void 0!==p){var v=vt(f,p);if((c-f.timestamp)/1e3<=v)if(v-s/a>2e3)return p}var h=(c-l.requestTimestamp)/1e3;if(null!=n&&!(h<=(1.5*d+2)/a)){var m=d/h,g=n.bitrate*Math.min(.7,m);return void 0===r||g=s.outOfStarvationGap&&(D.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1):this._inStarvationMode&&(D.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1),this._inStarvationMode&&null!=(o=ht(r,e,n,i))&&(D.Z.info("ABR: starvation mode emergency estimate:",o),t.reset(),a=null==n?o:Math.min(o,n.bitrate)),null==a&&(a=null!=(o=t.getEstimate())?o*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):null!=i?i*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):this._initialBitrate),e.speed>1&&(a/=e.speed),{bandwidthEstimate:o,bitrateChosen:a}},t.isUrgent=function(e,t,n,r){return null===t||e!==t.bitrate&&(e>t.bitrate?!this._inStarvationMode:function(e,t){var n=isFinite(e.bufferGap)?e.bufferGap:0,r=e.position+n,i=(0,st.Z)(t,(function(e){return e.duration>0&&e.time+e.duration>r}));if(void 0===i)return!0;var a=performance.now(),o=i.progress.length>0?i.progress[i.progress.length-1]:void 0,s=pt(i);if(void 0===o||void 0===s)return!0;var u=vt(o,s);return(a-o.timestamp)/1e3>1.2*u||u-n/e.speed>-1.5}(r,n))},e}(),gt=n(1679),yt=function(){function e(){this._currentRequests={}}var t=e.prototype;return t.add=function(e){var t=e.id,n=e.time,r=e.duration,i=e.requestTimestamp;this._currentRequests[t]={time:n,duration:r,requestTimestamp:i,progress:[]}},t.addProgress=function(e){var t=this._currentRequests[e.id];null!=t?t.progress.push(e):D.Z.warn("ABR: progress for a request not added")},t.remove=function(e){null==this._currentRequests[e]&&D.Z.warn("ABR: can't remove unknown request"),delete this._currentRequests[e]},t.getRequests=function(){return(0,gt.Z)(this._currentRequests).filter((function(e){return null!=e})).sort((function(e,t){return e.time-t.time}))},e}(),_t=function(){function e(){this._currentRepresentationData=null,this._lastRepresentationWithGoodScore=null}var t=e.prototype;return t.addSample=function(e,t,n){var r,i=n/t,a=this._getEWMA(e);null!=a?(r=a,a.addSample(t,i)):((r=new $e(5)).addSample(t,i),this._currentRepresentationData={representation:e,ewma:r}),r.getEstimate()>1&&this._lastRepresentationWithGoodScore!==e&&(D.Z.debug("ABR: New last stable representation",e),this._lastRepresentationWithGoodScore=e)},t.getEstimate=function(e){var t=this._getEWMA(e);if(null!=t)return t.getEstimate()},t.getLastStableRepresentation=function(){return this._lastRepresentationWithGoodScore},t._getEWMA=function(e){return null!=this._currentRepresentationData&&this._currentRepresentationData.representation.id===e.id?this._currentRepresentationData.ewma:null},e}();function bt(e,t,n,r){var i=t<=n?n:t>=r?r:t,a=(0,Ie.Z)(e,(function(e){return e.bitrate>i}));return-1===a?e[e.length-1]:0===a?e[0]:e[a-1]}function Tt(e,t){var n=e;return null!=t.bitrate&&(n=function(e,t){if(0===e.length)return[];e.sort((function(e,t){return e.bitrate-t.bitrate}));var n=e[0].bitrate,r=Math.max(t,n),i=(0,Ie.Z)(e,(function(e){return e.bitrate>r}));return-1===i?e:e.slice(0,i)}(n,t.bitrate)),null!=t.width&&(n=function(e,t){var n=e.slice().sort((function(e,t){return(0,We.Z)(e.width,0)-(0,We.Z)(t.width,0)})),r=(0,st.Z)(n,(function(e){return"number"==typeof e.width&&e.width>=t}));if(void 0===r)return e;var i="number"==typeof r.width?r.width:0;return e.filter((function(e){return"number"!=typeof e.width||e.width<=i}))}(n,t.width)),n}function Et(e){var t=e.bandwidthEstimator,n=e.clock$,r=e.filters$,i=e.initialBitrate,a=e.lowLatencyMode,o=e.manualBitrate$,s=e.minAutoBitrate$,l=e.maxAutoBitrate$,c=e.representations,f=e.streamEvents$,v=new _t,m=new mt(null==i?0:i,a),g=new yt,_=ot();var b=f.pipe((0,E.h)((function(e){return"metrics"===e.type})),(0,Me.b)((function(e){return function(e){var n=e.duration,r=e.size,i=e.content;if(!_(i,n)){t.addSample(n,r);var a=n/1e3,o=i.segment.duration,s=i.representation;v.addSample(s,a,o)}}(e.value)})),(0,re.l)()),T=f.pipe((0,Me.b)((function(e){switch(e.type){case"requestBegin":g.add(e.value);break;case"requestEnd":g.remove(e.value.id);break;case"progress":g.addProgress(e.value)}})),(0,re.l)()),w=f.pipe((0,E.h)((function(e){return"representationChange"===e.type})),(0,y.U)((function(e){return e.value.representation})),(0,S.O)(null)),k=(0,d.P)((function(){if(0===c.length)throw new Error("ABRManager: no representation choice given");return 1===c.length?(0,u.of)({bitrate:void 0,representation:c[0],manual:!1,urgent:!0,knownStableBitrate:void 0}):o.pipe((0,Ge.w)((function(e){if(e>=0){var i=bt(c,e,0,1/0);return(0,u.of)({representation:i,bitrate:void 0,knownStableBitrate:void 0,manual:!0,urgent:!0})}var a,o=!0,d=it(f.pipe((0,E.h)((function(e){return"added-segment"===e.type})),nt(n),(0,y.U)((function(e){var t=e[0].value,n=e[1],r=n.speed,i=n.position,a=t.buffered,o=(0,j.L7)(a,i),s=t.content.representation,u=v.getEstimate(s);return{bufferGap:o,currentBitrate:s.bitrate,currentScore:u,speed:r}}))),c.map((function(e){return e.bitrate}))).pipe((0,S.O)(void 0));return(0,p.a)([n,s,l,r,d]).pipe(nt(w),(0,y.U)((function(e){var n=e[0],r=n[0],i=n[1],s=n[2],u=n[3],l=n[4],d=e[1],f=Tt(c,u),p=g.getRequests(),h=m.getBandwidthEstimate(r,t,d,p,a),y=h.bandwidthEstimate,_=h.bitrateChosen;a=y;var b=v.getLastStableRepresentation(),T=null==b?void 0:b.bitrate/(r.speed>0?r.speed:1),E=r.bufferGap;!o&&E<=5?o=!0:o&&isFinite(E)&&E>10&&(o=!1);var w=bt(f,_,i,s);if(o)return D.Z.debug("ABR: Choosing representation with bandwidth estimation.",w),{bitrate:y,representation:w,urgent:m.isUrgent(w.bitrate,d,p,r),manual:!1,knownStableBitrate:T};if(null==l||w.bitrate>=l)return D.Z.debug("ABR: Choosing representation with bandwidth estimation.",w),{bitrate:y,representation:w,urgent:m.isUrgent(w.bitrate,d,p,r),manual:!1,knownStableBitrate:T};var S=bt(f,l,i,s);return l<=s&&D.Z.debug("ABR: Choosing representation with buffer based bitrate ceiling.",S),{bitrate:y,representation:S,urgent:m.isUrgent(l,d,p,r),manual:!1,knownStableBitrate:T}})))})))}));return(0,h.T)(b,T,k)}var wt=function(){function e(e){this._manualBitrates=e.manualBitrates,this._minAutoBitrates=e.minAutoBitrates,this._maxAutoBitrates=e.maxAutoBitrates,this._initialBitrates=e.initialBitrates,this._throttlers=e.throttlers,this._bandwidthEstimators={},this._lowLatencyMode=e.lowLatencyMode}var t=e.prototype;return t.get$=function(e,t,n,r){var i,a,o,s,l=this._getBandwidthEstimator(e),d=(0,We.Z)(this._manualBitrates[e],(0,u.of)(-1)),c=(0,We.Z)(this._minAutoBitrates[e],(0,u.of)(0)),f=(0,We.Z)(this._maxAutoBitrates[e],(0,u.of)(1/0)),v=(0,We.Z)(this._initialBitrates[e],0);return Et({bandwidthEstimator:l,streamEvents$:r,clock$:n,filters$:(i=this._throttlers.limitWidth[e],a=this._throttlers.throttleBitrate[e],o=this._throttlers.throttle[e],s=[],null!=i&&s.push(i.pipe((0,y.U)((function(e){return{width:e}})))),null!=o&&s.push(o.pipe((0,y.U)((function(e){return{bitrate:e}})))),null!=a&&s.push(a.pipe((0,y.U)((function(e){return{bitrate:e}})))),s.length>0?(0,p.a)(s).pipe((0,y.U)((function(e){return q.Z.apply(void 0,[{}].concat(e))}))):(0,u.of)({})),initialBitrate:v,manualBitrate$:d,minAutoBitrate$:c,maxAutoBitrate$:f,representations:t,lowLatencyMode:this._lowLatencyMode})},t._getBandwidthEstimator=function(e){var t=this._bandwidthEstimators[e];if(null==t){D.Z.debug("ABR: Creating new BandwidthEstimator for ",e);var n=new Qe;return this._bandwidthEstimators[e]=n,n}return t},e}(),St=n(4507),kt=n(5767),At=n(3774),xt=n(6923),It=R.ym;function Zt(e,t,n){if(null!==t&&"closed"!==t.readyState){for(var r=t.readyState,i=t.sourceBuffers,a=i.length-1;a>=0;a--){var o=i[a];try{"open"===r&&(D.Z.info("Init: Removing SourceBuffer from mediaSource",o),o.abort()),t.removeSourceBuffer(o)}catch(e){D.Z.warn("Init: Error while disposing SourceBuffer",e)}}i.length>0&&D.Z.warn("Init: Not all SourceBuffers could have been removed.")}if((0,kt.Z)(e),null!==n)try{D.Z.debug("Init: Revoking previous URL"),URL.revokeObjectURL(n)}catch(e){D.Z.warn("Init: Error while revoking the media source URL",e)}}function Mt(e){return function(e){return new l.y((function(t){if(null==At.JJ)throw new B.Z("MEDIA_SOURCE_NOT_SUPPORTED","No MediaSource Object was found in the current browser.");var n=(0,xt.Z)(e.src)?e.src:null;Zt(e,null,n),D.Z.info("Init: Creating MediaSource");var r=new At.JJ,i=URL.createObjectURL(r);return D.Z.info("Init: Attaching MediaSource URL to the media element",i),e.src=i,t.next(r),function(){Zt(e,r,i)}}))}(e).pipe((0,b.z)((function(e){return It(e).pipe((0,k.q)(1),(0,A.h)(e))})))}var Rt=n(8343),Ct=L.Z.DEFAULT_LIVE_GAP;var Pt=n(3610),Nt=n(6697),Dt=n(2401);var Ot=n(6968),Lt=n(2870),Bt=n(4123),Ut=L.Z.SOURCE_BUFFER_FLUSHING_INTERVAL,Ft=function(e){function n(t,n,r){var a;a=e.call(this)||this;var o=r.addSourceBuffer(n);return a._destroy$=new i.x,a.bufferType=t,a._mediaSource=r,a._sourceBuffer=o,a._queue=[],a._pendingTask=null,a._lastInitSegment=null,a.codec=n,(0,Nt.F)(Ut).pipe((0,Me.b)((function(){return a._flush()})),(0,g.R)(a._destroy$)).subscribe(),(0,Dt.R)(a._sourceBuffer,"error").pipe((0,Me.b)((function(e){return a._onPendingTaskError(e)})),(0,g.R)(a._destroy$)).subscribe(),(0,Dt.R)(a._sourceBuffer,"updateend").pipe((0,Me.b)((function(){return a._flush()})),(0,g.R)(a._destroy$)).subscribe(),a}(0,t.Z)(n,e);var r=n.prototype;return r.pushChunk=function(e){return D.Z.debug("AVSB: receiving order to push data to the SourceBuffer",this.bufferType,e),this._addToQueue({type:Bt.f.Push,value:e})},r.removeBuffer=function(e,t){return D.Z.debug("AVSB: receiving order to remove data from the SourceBuffer",this.bufferType,e,t),this._addToQueue({type:Bt.f.Remove,value:{start:e,end:t}})},r.endOfSegment=function(e){return D.Z.debug("AVSB: receiving order for validating end of segment",this.bufferType,e.segment),this._addToQueue({type:Bt.f.EndOfSegment,value:e})},r.getBufferedRanges=function(){return this._sourceBuffer.buffered},r.getPendingOperations=function(){var e=function(e){switch(e.type){case Bt.f.Push:case Bt.f.Remove:case Bt.f.EndOfSegment:return{type:e.type,value:e.value}}},t=this._queue.map(e);return null===this._pendingTask?t:[e(this._pendingTask)].concat(t)},r.dispose=function(){for(this._destroy$.next(),this._destroy$.complete(),null!==this._pendingTask&&(this._pendingTask.subject.complete(),this._pendingTask=null);this._queue.length>0;){var e=this._queue.shift();void 0!==e&&e.subject.complete()}if("open"===this._mediaSource.readyState)try{this._sourceBuffer.abort()}catch(e){D.Z.warn("AVSB: Failed to abort a "+this.bufferType+" SourceBuffer:",e)}},r._onPendingTaskError=function(e){if(this._lastInitSegment=null,null!==this._pendingTask){var t=e instanceof Error?e:new Error("An unknown error occured when doing operations on the SourceBuffer");this._pendingTask.subject.error(t)}},r._addToQueue=function(e){var t=this;return new l.y((function(n){var r=0===t._queue.length&&null===t._pendingTask,a=new i.x,o=(0,q.Z)({subject:a},e);t._queue.push(o);var s=a.subscribe(n);return r&&t._flush(),function(){s.unsubscribe();var e=t._queue.indexOf(o);e>=0&&t._queue.splice(e,1)}}))},r._flush=function(){if(!this._sourceBuffer.updating){if(null!==this._pendingTask){var e=this._pendingTask;if(e.type!==Bt.f.Push||0===e.data.length){switch(e.type){case Bt.f.Push:null!==e.inventoryData&&this._segmentInventory.insertChunk(e.inventoryData);break;case Bt.f.EndOfSegment:this._segmentInventory.completeSegment(e.value);break;case Bt.f.Remove:this.synchronizeInventory();break;default:(0,Ce.Z)(e)}var t=e.subject;return this._pendingTask=null,t.next(),t.complete(),void this._flush()}}else{var n=this._queue.shift();if(void 0===n)return;if(n.type!==Bt.f.Push)this._pendingTask=n;else{var r,i=n.value;try{r=this._preparePushOperation(i.data)}catch(e){this._pendingTask=(0,q.Z)({data:[],inventoryData:i.inventoryInfos},n);var a=e instanceof Error?e:new Error("An unknown error occured when preparing a push operation");return this._lastInitSegment=null,void n.subject.error(a)}this._pendingTask=(0,q.Z)({data:r,inventoryData:i.inventoryInfos},n)}}try{switch(this._pendingTask.type){case Bt.f.EndOfSegment:return D.Z.debug("AVSB: Acknowledging complete segment",this._pendingTask.value),void this._flush();case Bt.f.Push:var o=this._pendingTask.data.shift();if(void 0===o)return void this._flush();this._sourceBuffer.appendBuffer(o);break;case Bt.f.Remove:var s=this._pendingTask.value,u=s.start,l=s.end;D.Z.debug("AVSB: removing data from SourceBuffer",this.bufferType,u,l),this._sourceBuffer.remove(u,l);break;default:(0,Ce.Z)(this._pendingTask)}}catch(e){this._onPendingTaskError(e)}}},r._preparePushOperation=function(e){var t=[],n=e.codec,r=e.timestampOffset,i=e.appendWindow,a=!1;if(n!==this.codec&&(D.Z.debug("AVSB: updating codec",n),(a=function(e,t){if("function"==typeof e.changeType){try{e.changeType(t)}catch(e){return D.Z.warn("Could not call 'changeType' on the given SourceBuffer:",e),!1}return!0}return!1}(this._sourceBuffer,n))?this.codec=n:D.Z.debug("AVSB: could not update codec",n,this.codec)),this._sourceBuffer.timestampOffset!==r){var o=r;D.Z.debug("AVSB: updating timestampOffset",this.bufferType,this._sourceBuffer.timestampOffset,o),this._sourceBuffer.timestampOffset=o}if(void 0===i[0]?this._sourceBuffer.appendWindowStart>0&&(this._sourceBuffer.appendWindowStart=0):i[0]!==this._sourceBuffer.appendWindowStart&&(i[0]>=this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[0]+1),this._sourceBuffer.appendWindowStart=i[0]),void 0===i[1]?this._sourceBuffer.appendWindowEnd!==1/0&&(this._sourceBuffer.appendWindowEnd=1/0):i[1]!==this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[1]),null!==e.initSegment&&(a||!this._isLastInitSegment(e.initSegment))){var s=e.initSegment;t.push(s);var u=(0,Ot._f)(s);this._lastInitSegment={data:u,hash:(0,Lt.Z)(u)}}return null!==e.chunk&&t.push(e.chunk),t},r._isLastInitSegment=function(e){if(null===this._lastInitSegment)return!1;if(this._lastInitSegment.data===e)return!0;var t=this._lastInitSegment.data;if(t.byteLength===e.byteLength){var n=(0,Ot._f)(e);if((0,Lt.Z)(n)===this._lastInitSegment.hash&&(0,H.Z)(t,n))return!0}return!1},n}(Bt.C),zt=["audio","video","text","image"];function Kt(e){return"audio"===e||"video"===e}var Vt=function(){function e(e,t){this._mediaElement=e,this._mediaSource=t,this._initializedSegmentBuffers={},this._onNativeBufferAddedOrDisabled=[]}e.isNative=function(e){return Kt(e)};var t=e.prototype;return t.getBufferTypes=function(){var e=this.getNativeBufferTypes();return null==V.Z.nativeTextTracksBuffer&&null==V.Z.htmlTextTracksBuffer||e.push("text"),null!=V.Z.imageBuffer&&e.push("image"),e},t.getNativeBufferTypes=function(){return"AUDIO"===this._mediaElement.nodeName?["audio"]:["video","audio"]},t.getStatus=function(e){var t=this._initializedSegmentBuffers[e];return void 0===t?{type:"uninitialized"}:null===t?{type:"disabled"}:{type:"initialized",value:t}},t.waitForUsableBuffers=function(){var e=this;return this._areNativeBuffersUsable()?(0,u.of)(void 0):new l.y((function(t){e._onNativeBufferAddedOrDisabled.push((function(){e._areNativeBuffersUsable()&&(t.next(void 0),t.complete())}))}))},t.disableSegmentBuffer=function(t){var n=this._initializedSegmentBuffers[t];if(null!==n){if(void 0!==n)throw new Error("Cannot disable an active SegmentBuffer.");this._initializedSegmentBuffers[t]=null,e.isNative(t)&&this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()}))}else D.Z.warn("SBS: The "+t+" SegmentBuffer was already disabled.")},t.createSegmentBuffer=function(e,t,n){void 0===n&&(n={});var r,i=this._initializedSegmentBuffers[e];if(Kt(e)){if(null!=i)return i instanceof Ft&&i.codec!==t?D.Z.warn("SB: Reusing native SegmentBuffer with codec",i.codec,"for codec",t):D.Z.info("SB: Reusing native SegmentBuffer with codec",t),i;D.Z.info("SB: Adding native SegmentBuffer with codec",t);var a=new Ft(e,t,this._mediaSource);return this._initializedSegmentBuffers[e]=a,this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()})),a}if(null!=i)return D.Z.info("SB: Reusing a previous custom SegmentBuffer for the type",e),i;if("text"===e){if(D.Z.info("SB: Creating a new text SegmentBuffer"),"html"===n.textTrackMode){if(null==V.Z.htmlTextTracksBuffer)throw new Error("HTML Text track feature not activated");r=new V.Z.htmlTextTracksBuffer(this._mediaElement,n.textTrackElement)}else{if(null==V.Z.nativeTextTracksBuffer)throw new Error("Native Text track feature not activated");r=new V.Z.nativeTextTracksBuffer(this._mediaElement,!0===n.hideNativeSubtitle)}return this._initializedSegmentBuffers.text=r,r}if("image"===e){if(null==V.Z.imageBuffer)throw new Error("Image buffer feature not activated");return D.Z.info("SB: Creating a new image SegmentBuffer"),r=new V.Z.imageBuffer,this._initializedSegmentBuffers.image=r,r}throw D.Z.error("SB: Unknown buffer type:",e),new B.Z("BUFFER_TYPE_UNKNOWN","The player wants to create a SegmentBuffer of an unknown type.")},t.disposeSegmentBuffer=function(e){var t=this._initializedSegmentBuffers[e];null!=t?(D.Z.info("SB: Aborting SegmentBuffer",e),t.dispose(),delete this._initializedSegmentBuffers[e]):D.Z.warn("SB: Trying to dispose a SegmentBuffer that does not exist")},t.disposeAll=function(){var e=this;zt.forEach((function(t){"initialized"===e.getStatus(t).type&&e.disposeSegmentBuffer(t)}))},t._areNativeBuffersUsable=function(){var e=this,t=this.getNativeBufferTypes();return!t.some((function(t){return void 0===e._initializedSegmentBuffers[t]}))&&!t.every((function(t){return null===e._initializedSegmentBuffers[t]}))},e}(),Gt=function(){function e(e){this._array=[],this._sortingFn=e}var t=e.prototype;return t.add=function(){for(var e=arguments.length,t=new Array(e),n=0;n=this._array.length)throw new Error("Invalid index.");return this._array[e]},t.findFirst=function(e){return(0,st.Z)(this._array,e)},t.has=function(e){return(0,Re.Z)(this._array,e)},t.removeElement=function(e){var t=this._array.indexOf(e);if(t>=0)return this._array.splice(t,1),t},t.head=function(){return this._array[0]},t.last=function(){return this._array[this._array.length-1]},t.shift=function(){return this._array.shift()},t.pop=function(){return this._array.pop()},e}(),Ht=function(){function e(e){this._weakMap=new WeakMap,this._fn=e}var t=e.prototype;return t.get=function(e){var t=this._weakMap.get(e);if(void 0===t){var n=this._fn(e);return this._weakMap.set(e,n),n}return t},t.destroy=function(e){this._weakMap.delete(e)},e}(),Wt=n(9834);function $t(e){var t=e.segmentBuffer,n=e.clock$,r=e.maxBufferBehind$,i=e.maxBufferAhead$;return(0,p.a)([n,r,i]).pipe((0,b.z)((function(e){var n=e[0],r=e[1],i=e[2];return function(e,t,n,r){if(!isFinite(n)&&!isFinite(r))return m.E;var i=[],a=(0,j.F_)(e.getBufferedRanges(),t),o=a.innerRange,s=a.outerRanges,u=function(){if(isFinite(r)){for(var e=0;en.start&&i.push({start:t+r,end:n.end})}null!=o&&t+r=r.end?i.push(r):t>=r.end&&t-n>r.start&&t-no.start&&i.push({start:o.start,end:t-n})}}(),u(),(0,Ke.Dp)(i.map((function(t){return D.Z.debug("GC: cleaning range from SegmentBuffer",t),e.removeBuffer(t.start,t.end)}))).pipe((0,Wt.u)(),(0,re.l)())}(t,n,r,i)})))}var Yt={activePeriodChanged:function(e){return{type:"activePeriodChanged",value:{period:e}}},adaptationChange:function(e,t,n){return{type:"adaptationChange",value:{type:e,adaptation:t,period:n}}},addedSegment:function(e,t,n,r){return{type:"added-segment",value:{content:e,segment:t,segmentData:r,buffered:n}}},bitrateEstimationChange:function(e,t){return{type:"bitrateEstimationChange",value:{type:e,bitrate:t}}},streamComplete:function(e){return{type:"complete-stream",value:{type:e}}},endOfStream:function(){return{type:"end-of-stream",value:void 0}},needsManifestRefresh:function(){return{type:"needs-manifest-refresh",value:void 0}},manifestMightBeOufOfSync:function(){return{type:"manifest-might-be-out-of-sync",value:void 0}},needsMediaSourceReload:function(e,t,n){return{type:"needs-media-source-reload",value:{position:t,autoPlay:n,period:e}}},needsBufferFlush:function(){return{type:"needs-buffer-flush",value:void 0}},needsDecipherabilityFlush:function(e,t,n){return{type:"needs-decipherability-flush",value:{position:e,autoPlay:t,duration:n}}},periodStreamReady:function(e,t,n){return{type:"periodStreamReady",value:{type:e,period:t,adaptation$:n}}},periodStreamCleared:function(e,t){return{type:"periodStreamCleared",value:{type:e,period:t}}},encryptionDataEncountered:function(e){return{type:"encryption-data-encountered",value:e}},representationChange:function(e,t,n){return{type:"representationChange",value:{type:e,period:t,representation:n}}},streamTerminating:function(){return{type:"stream-terminating",value:void 0}},resumeStream:function(){return{type:"resume-stream",value:void 0}},warning:function(e){return{type:"warning",value:e}}},qt=n(7473),Xt=n.n(qt);function jt(e,t,n,r,i){var a=e.period,o=e.adaptation,s=e.representation,u=function(e,t){for(var n=0;n=t.end)return null;if(r.bufferedEnd>t.start)return n}return null}(i,t);if(null===u){if(null===n){if(r&&void 0!==a.end&&t.end>=a.end)return{start:void 0,end:null};var l=s.index.checkDiscontinuity(t.start);if(null!==l)return{start:void 0,end:l}}return null}var d=i[u];if(void 0!==d.bufferedStart&&d.bufferedStart>t.start&&(null===n||d.infos.segment.end<=n))return D.Z.debug("RS: current discontinuity encountered",o.type,d.bufferedStart),{start:void 0,end:d.bufferedStart};var c=function(e,t,n){if(n<=0)return D.Z.error("RS: Asked to check a discontinuity before the first chunk."),null;for(var r=n;r=t.end)return null;if(i.bufferedStart-a.bufferedEnd>0)return r}return null}(i,t,u+1);if(null!==c&&(null===n||i[c].infos.segment.end<=n)){var f=i[c-1].bufferedEnd,p=i[c].bufferedStart;return D.Z.debug("RS: future discontinuity encountered",o.type,f,p),{start:f,end:p}}if(null===n){if(r&&void 0!==a.end){if(t.end=0;n--){var r=e[n];if(void 0===r.bufferedStart)return null;if(r.bufferedStart=a.end)return null;for(var m=i.length-1;m>=0;m--){var g=i[m];if(void 0===g.bufferedStart)break;if(g.bufferedStart=n.length-1?null:n[t+1];return!function(e,t,n){if(void 0===e.bufferedStart)return D.Z.warn("Stream: Start of a segment unknown. Assuming it is garbage collected by default.",e),!0;if(null!==t&&void 0!==t.bufferedEnd&&e.bufferedStart-t.bufferedEnd<.1)return!1;if(ntn)return D.Z.info("Stream: The start of the wanted segment has been garbage collected",e),!0;return!1}(e,r,i.start)&&!function(e,t,n){if(void 0===e.bufferedEnd)return D.Z.warn("Stream: End of a segment unknown. Assuming it is garbage collected by default.",e),!0;if(null!==t&&void 0!==t.bufferedStart&&t.bufferedStart-e.bufferedEnd<.1)return!1;if(n>e.bufferedEnd&&e.end-e.bufferedEnd>tn)return D.Z.info("Stream: The end of the wanted segment has been garbage collected",e),!0;return!1}(e,a,i.end)}));return s.filter((function(e){var i=(0,q.Z)({segment:e},t);if(a.length>0&&a.some((function(e){return(0,Qt.Z)(i,e)})))return!1;var o=e.duration,s=e.time,l=e.end;if(e.isInit)return!0;if(o0&&a.some((function(e){if(e.period.id!==t.period.id||e.adaptation.id!==t.adaptation.id)return!1;var a=e.segment;return!(a.time-rn>s)&&(!(a.end+rn-rn&&f.end-l>-rn)return!1}}for(var p=0;ps)return v.start>s+rn||on(u,p).ende[n].start;)n++;return e[--n]}function sn(e,t,n,r){return e.period.id===t.period.id&&(!(e.segment.timei}return rr}(e.representation,t.representation,r)))}var un=L.Z.SEGMENT_PRIORITIES_STEPS;function ln(e,t){for(var n=e-(t.position+t.wantedTimeOffset),r=0;r=0;o--){var s=t[o],u=s.infos.representation;if(!s.partiallyPushed&&!1!==u.decipherable&&u.isSupported){var l=s.infos.segment,d=l.time/l.timescale;((null==l.duration?s.end:d+l.duration/l.timescale)>r&&dr&&s.start0)u=!1;else if(void 0===g)u=f.end>=o.end&&s.index.isFinished();else if(null===g)u=s.index.isFinished();else{var y=void 0!==o.end?Math.min(o.end,g):g;u=f.end>=y&&s.index.isFinished()}if(s.index.isInitialized()&&(s.index.areSegmentsChronologicallyGenerated()||u)){var _=null;v.length>0&&(_=Math.min.apply(Math,v.map((function(e){return e.segment.time})))),m.length>0&&(_=null!==_?Math.min(_,m[0].segment.time):m[0].segment.time),l=jt(e,f,_,u,h)}else l=null;return{imminentDiscontinuity:l,hasFinishedLoading:u,neededSegments:m,shouldRefreshManifest:p}}var fn=L.Z.BUFFER_GC_GAPS.CALM,pn=L.Z.BUFFER_GC_GAPS.BEEFY;function vn(e,t,n){for(var r=(0,j.F_)(t,e),i=r.innerRange,a=r.outerRanges,o=[],s=0;su.start)&&o.push(u)}return null!=i&&(D.Z.debug("Stream: GC removing part of inner range",o),e-n>i.start&&o.push({start:i.start,end:e-n}),e+n0&&null!==C&&null===P){var f=c[0].priority;c.unshift({segment:C,priority:f})}}else null===C?D.Z.warn("Stream: Uninitialized index without an initialization segment"):null!==P?D.Z.warn("Stream: Uninitialized index with an already loaded initialization segment"):c.unshift({segment:C,priority:ln(_.start,n)});var p=c[0];if(null!==i){if(N=[],i.urgent)return D.Z.debug("Stream: urgent termination request, terminate.",R),O.next(),O.complete(),(0,u.of)(Yt.streamTerminating());if(null===B||void 0===p||B.segment.id!==p.segment.id)return D.Z.debug("Stream: cancel request and terminate.",null===B,R),O.next(),O.complete(),(0,u.of)(Yt.streamTerminating());if(B.priority!==p.priority){var h=B.request$;B.priority=p.priority,l.updatePriority(h,p.priority)}D.Z.debug("Stream: terminate after request.",R)}else if(void 0===p)null!==B&&D.Z.debug("Stream: interrupt segment request.",R),N=[],O.next();else if(null===B)D.Z.debug("Stream: start downloading queue.",R),N=c,O.next();else if(B.segment.id!==p.segment.id)D.Z.debug("Stream: restart download queue.",R),N=c,O.next();else if(B.priority!==p.priority){D.Z.debug("Stream: update request priority.",R);var m=B.request$;B.priority=p.priority,l.updatePriority(m,p.priority)}else D.Z.debug("Stream: update downloading queue",R),N=c.slice().splice(1,c.length);var g=(0,u.of)({type:"stream-status",value:{period:_,position:n.position,bufferType:R,imminentDiscontinuity:d.imminentDiscontinuity,hasFinishedLoading:d.hasFinishedLoading,neededSegments:d.neededSegments}});return d.shouldRefreshManifest?(0,v.z)((0,u.of)(Yt.needsManifestRefresh()),g):g})),(t=function(e){return"stream-terminating"!==e.type},void 0===(n=!0)&&(n=!1),(0,x.e)((function(e,r){var i=0;e.subscribe(new I.Q(r,(function(e){var a=t(e,i++);(a||n)&&r.next(e),!a&&r.complete()})))})))),F=!1,z=m.E;if(void 0!==Z){var K=E.getEncryptionData(Z);K.length>0&&(z=u.of.apply(void 0,K.map((function(e){return Yt.encryptionDataEncountered(e)}))),F=!0)}var V=O.pipe((0,Ge.w)((function(){return N.length>0?(e=(0,d.P)((function(){var t=N.shift();if(void 0===t)return Xt()((function(){L.next()})),m.E;var n=t.segment,r=t.priority,i={manifest:g,period:_,adaptation:T,representation:E,segment:n},a=l.createRequest(i,r);return B={segment:n,priority:r,request$:a},a.pipe((0,b.z)((function(t){switch(t.type){case"warning":return(0,u.of)({type:"retry",value:{segment:n,error:t.value}});case"chunk-complete":return B=null,(0,u.of)({type:"end-of-segment",value:{segment:n}});case"interrupted":return D.Z.info("Stream: segment request interrupted temporarly.",n),m.E;case"chunk":var r=null==P?void 0:P.initTimescale;return t.parse(r).pipe((0,y.U)((function(e){return(0,q.Z)({segment:n},e)})));case"ended":return e;default:(0,Ce.Z)(t)}})))}))).pipe(oe((function(){B=null}))):m.E;var e})),(0,b.z)((function(e){var t;switch(e.type){case"retry":return(0,v.z)((0,u.of)({type:"warning",value:e.value.error}),(0,d.P)((function(){var t=e.value.segment,n=E.index;if(!1===n.isSegmentStillAvailable(t))L.next();else if(n.canBeOutOfSyncError(e.value.error,t))return(0,u.of)(Yt.manifestMightBeOufOfSync());return m.E})));case"parsed-init-segment":P=e.value;var n=E.getAllEncryptionData(),i=!F&&n.length>0?u.of.apply(void 0,n.map((function(e){return Yt.encryptionDataEncountered(e)}))):m.E,a=function(e){var t=e.clock$,n=e.content,r=e.segment,i=e.segmentData,a=e.segmentBuffer;return(0,d.P)((function(){if(null===i)return m.E;var e=n.representation.getMimeTypeString();return hn(t,a,{data:{initSegment:i,chunk:null,timestampOffset:0,appendWindow:[void 0,void 0],codec:e},inventoryInfos:null}).pipe((0,y.U)((function(){var e=a.getBufferedRanges();return Yt.addedSegment(n,r,e,i)})))}))}({clock$:r,content:o,segment:e.segment,segmentData:e.value.initializationData,segmentBuffer:s});return(0,h.T)(i,a);case"parsed-segment":var l=null!==(t=null==P?void 0:P.initializationData)&&void 0!==t?t:null,c=e.value,f=c.inbandEvents,p=c.needsManifestRefresh,g=e.value.protectionDataUpdate&&!F?u.of.apply(void 0,E.getAllEncryptionData().map((function(e){return Yt.encryptionDataEncountered(e)}))):m.E,_=!0===p?(0,u.of)(Yt.needsManifestRefresh()):m.E,b=void 0!==f&&f.length>0?(0,u.of)({type:"inband-events",value:f}):m.E;return(0,v.z)(g,_,b,function(e){var t=e.clock$,n=e.content,r=e.initSegmentData,i=e.parsedSegment,a=e.segment,o=e.segmentBuffer;return(0,d.P)((function(){var e,s;if(null===i.chunkData)return m.E;var u=i.chunkData,l=i.chunkInfos,d=i.chunkOffset,c=i.appendWindow,f=n.representation.getMimeTypeString(),p=[void 0!==c[0]?Math.max(0,c[0]-mn.START):void 0,void 0!==c[1]?c[1]+mn.END:void 0],v={initSegment:r,chunk:u,timestampOffset:d,appendWindow:p,codec:f},h=null!==(e=null==l?void 0:l.time)&&void 0!==e?e:a.time,g=h+(null!==(s=null==l?void 0:l.duration)&&void 0!==s?s:a.duration);void 0!==p[0]&&(h=Math.max(h,p[0])),void 0!==p[1]&&(g=Math.min(g,p[1]));var _=(0,q.Z)({segment:a,start:h,end:g},n);return hn(t,o,{data:v,inventoryInfos:_}).pipe((0,y.U)((function(){var e=o.getBufferedRanges();return Yt.addedSegment(n,a,e,u)})))}))}({clock$:r,content:o,initSegmentData:l,parsedSegment:e.value,segment:e.segment,segmentBuffer:s}));case"end-of-segment":var T=e.value.segment;return s.endOfSegment((0,q.Z)({segment:T},o)).pipe((0,re.l)());default:(0,Ce.Z)(e)}})));return(0,v.z)(z,(0,h.T)(U,V).pipe((0,w.B)()))};function yn(e,t,n){return t.pipe((0,k.q)(1),(0,b.z)((function(r){var i;if(e.start<=r.position&&(void 0===e.end||e.end>r.position)){var a=r.getCurrentTime()+n,o=Math.min(Math.max(e.start,a),null!==(i=e.end)&&void 0!==i?i:1/0);return(0,u.of)(Yt.needsMediaSourceReload(e,o,!r.isPaused))}return t.pipe((0,y.U)((function(t){return Yt.needsMediaSourceReload(e,t.getCurrentTime(),!t.isPaused)})))})))}var _n=L.Z.DELTA_POSITION_AFTER_RELOAD;var bn=function(e){var t=e.abrManager,n=e.clock$,r=e.content,a=e.options,o=e.segmentBuffer,l=e.segmentFetcherCreator,c=e.wantedBufferAhead$,f="direct"===a.manualBitrateSwitchingMode,p=r.manifest,g=r.period,T=r.adaptation,S={},A=function(e,t,n){var r=e.manifest,a=e.adaptation,o=new i.x,s=new i.x,l=(0,h.T)(o,s);return{estimator$:(0,h.T)((0,W.R)(r,"decipherabilityUpdate"),(0,u.of)(null)).pipe((0,y.U)((function(){var e=a.getPlayableRepresentations();if(e.length<=0)throw new B.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+a.type+" Adaptation can be played");return e})),(0,_.x)((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n=i.end&&(D.Z.debug('Stream: full "empty" AdaptationStream',n),a=!0),(0,u.of)({type:"stream-status",value:{period:i,bufferType:n,position:t.position,imminentDiscontinuity:null,hasFinishedLoading:a,neededSegments:[],shouldRefreshManifest:!1}})})))}var En=n(9252);var wn=function(e,t){var n=e.split(";"),r=n[0],i=n.slice(1),a=t.split(";"),o=a[0],s=a.slice(1);if(r!==o)return!1;var u=(0,st.Z)(i,(function(e){return(0,En.Z)(e,"codecs=")})),l=(0,st.Z)(s,(function(e){return(0,En.Z)(e,"codecs=")}));if(void 0===u||void 0===l)return!1;var d=u.substring(7),c=l.substring(7);return d.split(".")[0]===c.split(".")[0]},Sn=L.Z.ADAPTATION_SWITCH_BUFFER_PADDINGS;function kn(e,t,n,r,i){if(void 0!==e.codec&&"reload"===i.onCodecSwitch&&!function(e,t){return e.getPlayableRepresentations().some((function(e){return wn(e.getMimeTypeString(),t)}))}(n,e.codec))return{type:"needs-reload",value:void 0};var a=e.getBufferedRanges();if(0===a.length)return{type:"continue",value:void 0};var o=(0,j.JN)(a),s=t.start,u=null==t.end?1/0:t.end,l=(0,j.tn)(o,[{start:s,end:u}]);if(0===l.length)return{type:"continue",value:void 0};e.synchronizeInventory();var d=e.getInventory();if(!d.some((function(e){return e.infos.period.id===t.id&&e.infos.adaptation.id!==n.id})))return{type:"continue",value:void 0};var c=function(e,t,n){return e.reduce((function(e,r){if(r.infos.period.id!==t.id||r.infos.adaptation.id!==n.id)return e;var i=r.bufferedStart,a=r.bufferedEnd;return void 0===i||void 0===a||e.push({start:i,end:a}),e}),[])}(d,t,n),f=(0,j.uH)(l,c);if(0===f.length)return{type:"continue",value:void 0};var p=r.currentTime;if("video"===n.type&&(0,j.Ti)({start:s,end:u},p)&&(r.readyState>1||!n.getPlayableRepresentations().some((function(t){var n;return wn(t.getMimeTypeString(),null!==(n=e.codec)&&void 0!==n?n:"")})))&&!(0,j.A1)(c,p))return{type:"needs-reload",value:void 0};var v="audio"===n.type&&"direct"===i.audioTrackSwitchingMode,h=[],m=function(e,t){for(var n=0;n=t.start)return n>0?e[n-1]:null;return e.length>0?e[e.length-1]:null}(d,t);null!==m&&(void 0===m.bufferedEnd||t.start-m.bufferedEnd<1)&&h.push({start:0,end:t.start+1});var g=n.type,y=Sn[g].before;null==y&&(y=0);var _=Sn[g].after;if(null==_&&(_=0),v||h.push({start:p-y,end:p+_}),void 0!==t.end){var b=function(e,t){for(var n=0;nt.start)return e[n];return null}(d,t);null!==b&&(void 0===b.bufferedStart||b.bufferedStart-t.end<1)&&h.push({start:t.end-1,end:Number.MAX_VALUE})}var T=(0,j.uH)(f,h);return 0===T.length?{type:"continue",value:void 0}:v?{type:"flush-buffer",value:T}:{type:"clean-buffer",value:T}}var An=L.Z.DELTA_POSITION_AFTER_RELOAD;var xn=function(e){var t=e.abrManager,n=e.bufferType,r=e.clock$,i=e.content,o=e.garbageCollectors,s=e.segmentFetcherCreator,l=e.segmentBuffersStore,d=e.options,c=e.wantedBufferAhead$,f=i.period,p=new a.t(1);return p.pipe((0,Ge.w)((function(e,a){var p=0===a?0:"audio"===n?An.trackSwitch.audio:"video"===n?An.trackSwitch.video:An.trackSwitch.other;if(null===e){D.Z.info("Stream: Set no "+n+" Adaptation",f);var g,_=l.getStatus(n);if("initialized"===_.type){if(D.Z.info("Stream: Clearing previous "+n+" SegmentBuffer"),Vt.isNative(n))return yn(f,r,p);g=_.value.removeBuffer(f.start,null==f.end?1/0:f.end)}else"uninitialized"===_.type&&l.disableSegmentBuffer(n),g=(0,u.of)(null);return(0,v.z)(g.pipe((0,A.h)(Yt.adaptationChange(n,null,f))),Tn(r,c,n,{period:f}))}if(Vt.isNative(n)&&"disabled"===l.getStatus(n).type)return yn(f,r,p);D.Z.info("Stream: Updating "+n+" adaptation",e,f);var T=r.pipe((0,k.q)(1),(0,b.z)((function(a){var g=function(e,t,n,r){var i=e.getStatus(t);if("initialized"===i.type)return D.Z.info("Stream: Reusing a previous SegmentBuffer for the type",t),i.value;var a=function(e){var t=e.representations;if(null==t[0])return"";return t[0].getMimeTypeString()}(n),o="text"===t?r.textTrackOptions:void 0;return e.createSegmentBuffer(t,a,o)}(l,n,e,d),_={currentTime:a.getCurrentTime(),readyState:a.readyState},T=kn(g,f,e,_,d);if("needs-reload"===T.type)return yn(f,r,p);var E="flush-buffer"===T.type?(0,u.of)(Yt.needsBufferFlush()):m.E,w="clean-buffer"===T.type||"flush-buffer"===T.type?v.z.apply(void 0,T.value.map((function(e){var t=e.start,n=e.end;return g.removeBuffer(t,n)}))).pipe((0,re.l)()):m.E,S=o.get(g),k=function(e,a){var o=i.manifest,p=r.pipe((0,y.U)((function(e){var t=a.getBufferedRanges();return(0,q.Z)({},e,{bufferGap:(0,j.L7)(t,e.position)})})));return bn({abrManager:t,clock$:p,content:{manifest:o,period:f,adaptation:e},options:d,segmentBuffer:a,segmentFetcherCreator:s,wantedBufferAhead$:c}).pipe((0,ae.K)((function(e){if(!Vt.isNative(n)){D.Z.error("Stream: "+n+" Stream crashed. Aborting it.",e),l.disposeSegmentBuffer(n);var t=z(e,{defaultCode:"NONE",defaultReason:"Unknown `AdaptationStream` error"});return(0,v.z)((0,u.of)(Yt.warning(t)),Tn(r,c,n,{period:f}))}throw D.Z.error("Stream: "+n+" Stream crashed. Stopping playback.",e),e})))}(e,g);return l.waitForUsableBuffers().pipe((0,b.z)((function(){return(0,v.z)(w,E,(0,h.T)(k,S))})))})));return(0,v.z)((0,u.of)(Yt.adaptationChange(n,e,f)),T)})),(0,S.O)(Yt.periodStreamReady(n,f,p)))},In=n(3074);function Zn(){for(var e=arguments.length,t=new Array(e),n=0;nc.getMaximumPosition()){var i=new B.Z("MEDIA_TIME_AFTER_MANIFEST","The current position is after the latest time announced in the Manifest.");return Yt.warning(i)}return null}),null)),M=r.getBufferTypes().map((function(e){return function(e,n){var a=new Gt((function(e,t){return e.start-t.start})),o=new i.x,s=!1;function l(t){return N(e,t,o).pipe((0,ue.Z)((function(e){switch(e.type){case"needs-media-source-reload":var t=a.head();if(void 0===t||t.id!==e.value.period.id)return null;break;case"periodStreamReady":s=!0,a.add(e.value.period);break;case"periodStreamCleared":a.removeElement(e.value.period)}return e}),null),(0,w.B)())}function f(e){var t=a.head(),n=a.last();return null==t||null==n||(t.start>e||(null==n.end?1/0:n.end)=s.end}))),m=d.pipe(Ve((function(t){return N(e,t,f)}))),y=l.pipe((0,k.q)(1),(0,Me.b)((function(){d.complete(),f.next(),f.complete()})),(0,w.B)()),_=(0,h.T)(p,y),T=xn({abrManager:n,bufferType:e,clock$:t,content:{manifest:c,period:s},garbageCollectors:I,segmentFetcherCreator:a,segmentBuffersStore:r,options:o,wantedBufferAhead$:x}).pipe((0,b.z)((function(t){if("stream-status"===t.type)if(t.value.hasFinishedLoading){var n=c.getPeriodAfter(s);if(null===n)return(0,v.z)((0,u.of)(t),(0,u.of)(Yt.streamComplete(e)));d.next(n)}else f.next();return(0,u.of)(t)})),(0,w.B)()),S=(0,v.z)(T.pipe((0,g.R)(_)),(0,u.of)(Yt.periodStreamCleared(e,s)).pipe((0,Me.b)((function(){D.Z.info("SO: Destroying Stream for",e,s)}))));return(0,h.T)(S,m,y.pipe((0,re.l)()))}};function Pn(e,t,n){return function(e){return(0,h.T)((0,R.ym)(e).pipe((0,A.h)(!0)),(0,R.ep)(e).pipe((0,A.h)(!1)),(0,R.UG)(e).pipe((0,A.h)(!1))).pipe((0,S.O)("open"===e.readyState),(0,_.x)())}(e).pipe((0,Ge.w)((function(t){return t?function(e){if(0===e.length)return(0,u.of)(void 0);for(var t=[],n=0;n=i||i===n?null:isNaN(e.duration)||!isFinite(e.duration)||i-e.duration>.01?(D.Z.info("Init: Updating duration",i),e.duration=i,i):null})),(0,ae.K)((function(e){return D.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e),(0,u.of)(null)})))}var Nn=n(4181);var Dn=R.gg,On=R.ym,Ln=R._E;function Bn(e){return(0,d.P)((function(){if(D.Z.debug("Init: Trying to call endOfStream"),"open"!==e.readyState)return D.Z.debug("Init: MediaSource not open, cancel endOfStream"),(0,u.of)(null);var t=e.sourceBuffers,n=function(e){for(var t=[],n=0;n0&&void 0!==e[0].period.end&&e[0].period.end+10r.start)return Hn(t)&&e.splice(a,0,t),e;Hn(t)&&e.push(t);return e}(e,t[0],t[1])}),[])),o=null,s=null;return e.pipe(nt(a),(0,y.U)((function(e){var r=e[0],a=e[1],u=r.buffered,l=r.currentRange,d=r.position,c=r.event,f=r.stalled;if(null===f)return{type:"unstalled",value:null};if(r.seeking)o=r.position;else if(null!==o){var p=performance.now();if(null===s&&(s=p),Fn&&r.positionn)return r;var o=void 0;if(void 0===a.end||a.end>n){var s=e[i],u=s.discontinuity,l=s.position,d=u.start,c=u.end;if(n>=(null!=d?d:l)-Vn)if(null===c){var f=t.getPeriodAfter(a);null!==f?o=f.start+Vn:D.Z.warn("Init: discontinuity at Period's end but no next Period")}else no?r:o)}}return r}(a,n,v);if(null!==h){var m=h+.001;if(!(m<=t.currentTime))return D.Z.warn("SA: skippable discontinuity found in the stream",d,m),i(m),Yt.warning(Wn(v,m));D.Z.info("Init: position to seek already reached, no seeking",t.currentTime,m)}}if(function(e,t,n,r){return N.vU&&r&&"timeupdate"===n&&null!=t&&t.end-e>10}(d,l,c,null!==f))return D.Z.warn("Init: After freeze seek",d,l),i(d),Yt.warning(Wn(d,d));var g=null!=v?v:d,y=(0,j.XS)(u,g);if(y=0;b--){var T=n.periods[b];if(void 0!==T.end&&T.end<=g){if(n.periods[b+1].start>g&&n.periods[b+1].start>t.currentTime){var E=n.periods[b+1];return i(E.start),Yt.warning(Wn(g,E.start))}break}}return{type:"stalled",value:f}})))}function Hn(e){return null!==e.discontinuity}function Wn(e,t){return new B.Z("DISCONTINUITY_ENCOUNTERED","A discontinuity has been encountered at position "+String(e)+", seeked at position "+String(t))}var $n=function(e,t){return e.id===t.id&&e.start===t.start&&e.end===t.end};var Yn=function(e,t){for(var n=[],r=t.periods,i=0;i0})),(0,_.x)(),(0,Ge.w)((function(e){return e?(0,p.a)([(0,Nt.F)(qn).pipe((0,S.O)(null)),n]).pipe((0,y.U)((function(e){e[0];return{isSeeking:e[1].seeking,currentTime:t.currentTime}})),(0,x.e)((function(e,t){var n,r=!1;e.subscribe(new I.Q(t,(function(e){var i=n;n=e,r&&t.next([i,e]),r=!0})))})),(0,b.z)((function(e){var t=e[0],n=e[1];return function(e,t,n){for(var i=t.currentTime,a=n.isSeeking,o=n.currentTime,s=[],l=[],d=0;do||void 0!==p&&o>=p)&&(Xn(c)&&l.push(c.publicEvent),r.delete(c)):f<=o&&void 0!==p&&o=(null!=p?p:f)&&(a?s.push({type:"stream-event-skip",value:c.publicEvent}):(s.push({type:"stream-event",value:c.publicEvent}),Xn(c)&&l.push(c.publicEvent)))}return(0,v.z)(s.length>0?u.of.apply(void 0,s):m.E,l.length>0?u.of.apply(void 0,l).pipe((0,Me.b)((function(e){"function"==typeof e.onExit&&e.onExit()})),(0,re.l)()):m.E)}(i,t,n)}))):m.E})))},Qn=n(2983);function Jn(e){var t=e.mediaElement,n=e.manifest,r=e.clock$,a=e.speed$,o=e.bufferOptions,s=e.abrManager,l=e.segmentFetcherCreator,c=e.setCurrentTime;return function(e,f,v){var _,T=function(e,t){return(0,d.P)((function(){var n;return Pn(t,e,void 0).pipe((0,b.z)((function(r){return null!==r&&(n=r),(0,W.R)(e,"manifestUpdate").pipe((0,Ge.w)((function(){return Pn(t,e,n)})),(0,Me.b)((function(e){null!==e&&(n=e)})))})),(0,re.l)())}))}(n,e),w=null!==(_=n.getPeriodForTime(f))&&void 0!==_?_:n.getNextPeriod(f);if(void 0===w){var k=new B.Z("MEDIA_STARTING_TIME_NOT_FOUND","Wanted starting time not found in the Manifest.");return(0,Pt._)((function(){return k}))}var A=new Vt(t,e),x=(0,Un.Z)({clock$:r,mediaElement:t,startTime:f,mustAutoPlay:v,setCurrentTime:c,isDirectfile:!1}),I=x.seek$,Z=x.load$,M=Z.pipe((0,E.h)((function(e){return"not-loaded-metadata"!==e}))),R=M.pipe((0,b.z)((function(){return jn(n,t,r)}))),C=function(e,t){var n=t.autoPlay,r=t.initialPlay$,i=t.initialSeek$,a=t.manifest,o=t.speed$,s=t.startTime,u=!1,l=!1,d=r.pipe((0,Me.b)((function(){u=!0})),(0,re.l)()),c=i.pipe((0,Me.b)((function(){l=!0})),(0,re.l)()),f=(0,p.a)([e,o]).pipe((0,y.U)((function(e){var t=e[0],r=e[1],i=a.isLive;return{position:t.position,getCurrentTime:t.getCurrentTime,duration:t.duration,isPaused:u?t.paused:!n,liveGap:i?a.getMaximumPosition()-t.position:1/0,readyState:t.readyState,speed:r,stalled:t.stalled,wantedTimeOffset:l?0:s-t.position}})));return(0,h.T)(d,c,f)}(r,{autoPlay:v,initialPlay$:M,initialSeek$:I,manifest:n,speed$:a,startTime:f}),P=new i.x,N=new i.x,O=Cn({manifest:n,initialPeriod:w},C,s,A,l,o).pipe((0,b.z)((function(t){switch(t.type){case"end-of-stream":return D.Z.debug("Init: end-of-stream order received."),function(e){return On(e).pipe((0,S.O)(null),(0,Ge.w)((function(){return Bn(e)})))}(e).pipe((0,re.l)(),(0,g.R)(P));case"resume-stream":return D.Z.debug("Init: resume-stream order received."),P.next(null),m.E;case"stream-status":var n=t.value,r=n.period,i=n.bufferType,a=n.imminentDiscontinuity,o=n.position;return N.next({period:r,bufferType:i,discontinuity:a,position:o}),m.E;default:return(0,u.of)(t)}}))),L=(0,Qn.Z)(t,a,r).pipe((0,re.l)()),U=Gn(r,t,n,N,c),F=Z.pipe((0,b.z)((function(e){if("autoplay-blocked"===e){var t=new B.Z("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");return(0,u.of)(Rt.Z.warning(t),Rt.Z.loaded(A))}if("not-loaded-metadata"===e){var n=new B.Z("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");return(0,u.of)(Rt.Z.warning(n))}return D.Z.debug("Init: The current content is loaded."),(0,u.of)(Rt.Z.loaded(A))})));return(0,h.T)(T,F,L,U,O,R).pipe(oe((function(){A.disposeAll()})))}}var er=L.Z.FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY,tr=L.Z.MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE,nr=L.Z.MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE;function rr(e){var t,n,r=e.initialManifest,i=e.manifestFetcher,a=e.minimumManifestUpdateInterval,o=e.scheduleRefresh$,s=(t=function(e,t){return i.fetch(e).pipe((0,b.z)((function(e){return"warning"===e.type?(0,u.of)(e):e.parse(t)})),(0,w.B)())},n=!1,function(){for(var e=arguments.length,r=new Array(e),i=0;i0?f=nr,l=void 0===t?0:performance.now()-t,d=Math.max(a-l,0),g=o.pipe((0,b.z)((function(e){var n=e.completeRefresh,r=e.delay,i=e.canUseUnsafeMode&&s;return ir(null!=r?r:0,a,t).pipe((0,A.h)({completeRefresh:n,unsafeMode:i}))}))),y=null===c.expired?m.E:(0,fe.H)(d).pipe((0,M.j)((0,Ke.Dp)(c.expired)),(0,A.h)({completeRefresh:!0,unsafeMode:s})),_=function(){if(void 0===c.lifetime||c.lifetime<0)return m.E;var e,t=1e3*c.lifetime-l;void 0===i?e=t:c.lifetime<3&&i>=100?(e=Math.min(Math.max(3e3-l,Math.max(t,0)+i),6*t),D.Z.info("MUS: Manifest update rythm is too frequent. Postponing next request.",t,e)):i>=1e3*c.lifetime/10?(e=Math.min(Math.max(t,0)+i,6*t),D.Z.info("MUS: Manifest took too long to parse. Postponing next request",e,e)):e=t;return(0,fe.H)(Math.max(e,d)).pipe((0,A.h)({completeRefresh:!1,unsafeMode:s}))}();return(0,h.T)(_,g,y).pipe((0,k.q)(1),(0,b.z)((function(e){return v({completeRefresh:e.completeRefresh,unsafeMode:e.unsafeMode})})),(0,b.z)((function(e){return"warning"===e.type?(0,u.of)(e):p(e)})))}function v(e){var t=e.completeRefresh,n=e.unsafeMode,r=c.updateUrl,i=t||void 0===r,o=i?c.getUrl():r,l=c.clockOffset;return n?(f+=1,D.Z.info('Init: Refreshing the Manifest in "unsafeMode" for the '+String(f)+" consecutive time.")):f>0&&(D.Z.info('Init: Not parsing the Manifest in "unsafeMode" anymore after '+String(f)+" consecutive times."),f=0),s(o,{externalClockOffset:l,previousManifest:c,unsafeMode:n}).pipe((0,b.z)((function(e){if("warning"===e.type)return(0,u.of)(e);var t=e.manifest,n=e.sendingTime,r=e.receivedTime,o=e.parsingTime,s=performance.now();if(i)c.replace(t);else try{c.update(t)}catch(e){var l=e instanceof Error?e.message:"unknown error";return D.Z.warn("MUS: Attempt to update Manifest failed: "+l,"Re-downloading the Manifest fully"),ir(er,a,n).pipe((0,b.z)((function(){return v({completeRefresh:!0,unsafeMode:!1})})))}return(0,u.of)({type:"parsed",manifest:c,sendingTime:n,receivedTime:r,parsingTime:o,updatingTime:performance.now()-s})})))}}function ir(e,t,n){return(0,d.P)((function(){var r=void 0===n?0:performance.now()-n,i=Math.max(t-r,0);return(0,fe.H)(Math.max(e-r,i))}))}var ar=n(2447),or=L.Z.OUT_OF_SYNC_MANIFEST_REFRESH_DELAY;var sr=function(e){var t,n,r,a=e.adaptiveOptions,o=e.autoPlay,s=e.bufferOptions,l=e.clock$,d=e.keySystems,c=e.lowLatencyMode,f=e.manifest$,v=e.manifestFetcher,_=e.mediaElement,I=e.minimumManifestUpdateInterval,Z=e.segmentFetcherCreator,M=e.setCurrentTime,R=e.speed$,C=e.startAt,P=e.textTrackOptions,N=new wt(a),O=Mt(_).pipe((0,T.d)({refCount:!0})),L=new i.x,B=(0,St.Z)(_,d,L).pipe((0,He.Z)(),(0,w.B)()),U=(0,ar.Z)(_),F=B.pipe((t=function(e,t){switch(t.type){case"eme-disabled":case"attached-media-keys":return(0,u.of)({isEmeReady:!0,drmSystemId:e.drmSystemId});case"created-media-keys":var n=t.value.initializationDataSystemId;return O.pipe((0,b.z)((function(){return t.value.attachMediaKeys$.next(),!0===t.value.options.disableMediaKeysAttachmentLock?(0,u.of)({isEmeReady:!0,drmSystemId:n}):m.E})),(0,S.O)({isEmeReady:!1,drmSystemId:n}));default:return m.E}},n={isEmeReady:!1,drmSystemId:void 0},void 0===r&&(r=1/0),(0,x.e)((function(e,i){var a=n;return(0,ze.p)(e,i,(function(e,n){return t(a,e,n)}),r,(function(e){a=e}),!1,void 0,(function(){return a=null}))}))),(0,E.h)((function(e){return e.isEmeReady})),(0,k.q)(1),Ve((function(e){var t=e.drmSystemId;return O.pipe((0,y.U)((function(e){return{mediaSource:e,drmSystemId:t}})))}))),z=(0,p.a)([f,F]).pipe((0,b.z)((function(e){var t=e[0],n=e[1];if("warning"===t.type)return(0,u.of)(t);var r=t.manifest,a=n.mediaSource,d=n.drmSystemId;D.Z.debug("Init: Calculating initial time");var f=function(e,t,n){if(D.Z.debug("Init: calculating initial time"),null!=n){var r=e.getMinimumPosition(),i=e.getMaximumPosition();if(null!=n.position)return D.Z.debug("Init: using startAt.minimumPosition"),Math.max(Math.min(n.position,i),r);if(null!=n.wallClockTime){D.Z.debug("Init: using startAt.wallClockTime");var a=null==e.availabilityStartTime?0:e.availabilityStartTime,o=n.wallClockTime-a;return Math.max(Math.min(o,i),r)}if(null!=n.fromFirstPosition){D.Z.debug("Init: using startAt.fromFirstPosition");var s=n.fromFirstPosition;return s<=0?r:Math.min(i,r+s)}if(null!=n.fromLastPosition){D.Z.debug("Init: using startAt.fromLastPosition");var u=n.fromLastPosition;return u>=0?i:Math.max(r,i+u)}if(null!=n.percentage){D.Z.debug("Init: using startAt.percentage");var l=n.percentage;return l>100?i:l<0?r:r+ +l/100*(i-r)}}var d=e.getMinimumPosition();if(e.isLive){var c,f=e.suggestedPresentationDelay,p=e.clockOffset,v=e.getMaximumPosition();if(null==p)D.Z.info("Init: no clock offset found for a live content, starting close to maximum available position"),c=v;else{D.Z.info("Init: clock offset found for a live content, checking if we can start close to it");var h=null==e.availabilityStartTime?0:e.availabilityStartTime,m=(performance.now()+p)/1e3-h;c=Math.min(v,m)}var g=void 0!==f?f:t?Ct.LOW_LATENCY:Ct.DEFAULT;return D.Z.debug("Init: "+c+" defined as the live time, applying a live gap of "+g),Math.max(c-g,d)}return D.Z.info("Init: starting at the minimum available position:",d),d}(r,c,C);D.Z.debug("Init: Initial time calculated:",f);var p=Jn({abrManager:N,bufferOptions:(0,q.Z)({textTrackOptions:P,drmSystemId:d},s),clock$:l,manifest:r,mediaElement:_,segmentFetcherCreator:Z,speed$:R,setCurrentTime:M}),m=function e(t,n,r){var a=new i.x,o=p(t,n,r).pipe((0,ue.Z)((function(e){switch(e.type){case"needs-manifest-refresh":return T.next({completeRefresh:!1,canUseUnsafeMode:!0}),null;case"manifest-might-be-out-of-sync":return T.next({completeRefresh:!0,canUseUnsafeMode:!1,delay:or}),null;case"needs-media-source-reload":return a.next(e.value),null;case"needs-decipherability-flush":var t=ne(_);if(null===(r=t)||r.indexOf("widevine")<0)return a.next(e.value),null;var n=e.value.position;return n+.001=1&&"loadedmetadata"!==u&&null===m&&!(_||h),T=null,E=s?vr.LOW_LATENCY:vr.DEFAULT;if(o){if(b)d<=E?(r=!0,T=l+d):d===1/0?(r=!0,T=l):1===v&&(r=!0);else if(null!==m){var w=mr(m,s);!0!==r&&null!==m&&v>1&&(_||h||d<1/0&&d>w)?i=!0:(d===1/0||d<=w)&&(T=d===1/0?l:l+d)}}else b&&(!p&&"timeupdate"===u&&"timeupdate"===g&&l===y||"seeking"===u&&d===1/0)?r=!0:null!==m&&("seeking"!==u&&l!==y||"canplay"===u||d<1/0&&(d>mr(m,s)||_||h))&&(i=!0);return!0===i?null:!0===r||null!==m?(a="seeking"===u||null!==m&&"seeking"===m.reason?"seeking":t.seeking&&("internal-seeking"===u||null!==m&&"internal-seek"===m.reason)?"internal-seek":t.seeking?"seeking":1===v?"not-ready":"buffering",null!==m&&m.reason===a?{reason:m.reason,timestamp:m.timestamp,position:T}:{reason:a,timestamp:performance.now(),position:T}):null}var _r=function(e,t){var n=0;return{clock$:(0,d.P)((function(){var r=(0,q.Z)(gr(e,"init"),{stalled:null,getCurrentTime:function(){return e.currentTime}});var i=hr.map((function(t){return(0,Dt.R)(e,t).pipe((0,A.h)(t))})),a=t.lowLatencyMode?lr:t.withMediaSource?ur:dr,o=(0,Nt.F)(a).pipe((0,A.h)("timeupdate"));return h.T.apply(void 0,[o].concat(i)).pipe((0,y.U)((function(i){return r=function(i){var a=i;"seeking"===a&&n>0&&(a="internal-seeking",n-=1);var o=gr(e,a),s=yr(r,o,t),u=(0,q.Z)({},{stalled:s,getCurrentTime:function(){return e.currentTime}},o);return D.Z.debug("API: current media element state",u),u}(i),"DEBUG"===D.Z.getLevel()&&D.Z.debug("API: current playback timeline:\n"+function(e,t){for(var n="",r="",i=0;it){var d=n.length-Math.floor(l.length/2);r=" ".repeat(d)+"^"+t}if(i=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Cr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;)this._periods.pop()},t.update=function(){this._resetChosenAudioTracks(),this._resetChosenTextTracks(),this._resetChosenVideoTracks()},t.setInitialAudioTrack=function(e){var t=oi(this._periods,e),n=null!=t?t.audio:null;if(null==n||null==t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("audio"),i=this._audioChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,Re.Z)(r,i))n.adaptation$.next(i);else{var a=ti(r,jr(this._preferredAudioTracks));this._audioChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialTextTrack=function(e){var t=oi(this._periods,e),n=null!=t?t.text:null;if(null==n||null==t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("text"),i=this._textChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,Re.Z)(r,i))n.adaptation$.next(i);else{var a=ri(r,Qr(this._preferredTextTracks));this._textChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialVideoTrack=function(e){var t=oi(this._periods,e),n=null!=t?t.video:null;if(null==n||null==t)throw new Error("TrackChoiceManager: Given Period not found.");var r,i=e.getSupportedAdaptations("video"),a=this._videoChoiceMemory.get(e);if(null===a)r=null;else if(void 0!==a&&(0,Re.Z)(i,a.baseAdaptation))r=a.baseAdaptation;else{r=ai(i,this._preferredVideoTracks)}if(null===r)return this._videoChoiceMemory.set(e,null),void n.adaptation$.next(null);var o=li(r,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:r,adaptation:o}),n.adaptation$.next(o)},t.setAudioTrackByID=function(e,t){var n=oi(this._periods,e),r=null!=n?n.audio:null;if(null==r)throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,st.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Audio Track not found.");this._audioChoiceMemory.get(e)!==i&&(this._audioChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setTextTrackByID=function(e,t){var n=oi(this._periods,e),r=null!=n?n.text:null;if(null==r)throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,st.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Text Track not found.");this._textChoiceMemory.get(e)!==i&&(this._textChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setVideoTrackByID=function(e,t){var n=oi(this._periods,e),r=null!=n?n.video:null;if(null==r)throw new Error("LanguageManager: Given Period not found.");var i=(0,st.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Video Track not found.");var a=li(i,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:i,adaptation:a}),r.adaptation$.next(a)},t.disableTextTrack=function(e){var t=oi(this._periods,e),n=null!=t?t.text:null;if(null==n)throw new Error("TrackChoiceManager: Given Period not found.");null!==this._textChoiceMemory.get(e)&&(this._textChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrack=function(e){var t=oi(this._periods,e),n=null==t?void 0:t.video;if(void 0===n)throw new Error("TrackManager: Given Period not found.");null!==this._videoChoiceMemory.get(e)&&(this._videoChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!1,this._resetChosenVideoTracks()},t.enableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!0,this._resetChosenVideoTracks()},t.isTrickModeEnabled=function(){return this.trickModeTrackEnabled},t.getChosenAudioTrack=function(e){var t=oi(this._periods,e);if(null==(null!=t?t.audio:null))return null;var n=this._audioChoiceMemory.get(e);if(null==n)return null;var r={language:(0,We.Z)(n.language,""),normalized:(0,We.Z)(n.normalizedLanguage,""),audioDescription:!0===n.isAudioDescription,id:n.id,representations:n.representations.map(ui)};return!0===n.isDub&&(r.dub=!0),r},t.getChosenTextTrack=function(e){var t=oi(this._periods,e);if(null==(null!=t?t.text:null))return null;var n=this._textChoiceMemory.get(e);return null==n?null:{language:(0,We.Z)(n.language,""),normalized:(0,We.Z)(n.normalizedLanguage,""),closedCaption:!0===n.isClosedCaption,id:n.id}},t.getChosenVideoTrack=function(e){var t=oi(this._periods,e);if(null==(null!=t?t.video:null))return null;var n=this._videoChoiceMemory.get(e);if(void 0===n)return null;if(null===n)return null;var r=n.adaptation,i=void 0!==r.trickModeTracks?r.trickModeTracks.map((function(e){var t=e.representations.map(si),n={id:e.id,representations:t,isTrickModeTrack:!0};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),n})):void 0,a={id:r.id,representations:r.representations.map(si)};return!0===r.isSignInterpreted&&(a.signInterpreted=!0),!0===r.isTrickModeTrack&&(a.isTrickModeTrack=!0),void 0!==i&&(a.trickModeTracks=i),a},t.getAvailableAudioTracks=function(e){var t=oi(this._periods,e),n=null!=t?t.audio:null;if(null==n)return[];var r=this._audioChoiceMemory.get(e),i=null!=r?r.id:null;return n.adaptations.map((function(e){var t={language:(0,We.Z)(e.language,""),normalized:(0,We.Z)(e.normalizedLanguage,""),audioDescription:!0===e.isAudioDescription,id:e.id,active:null!=i&&i===e.id,representations:e.representations.map(ui)};return!0===e.isDub&&(t.dub=!0),t}))},t.getAvailableTextTracks=function(e){var t=oi(this._periods,e),n=null!=t?t.text:null;if(null==n)return[];var r=this._textChoiceMemory.get(e),i=null!=r?r.id:null;return n.adaptations.map((function(e){return{language:(0,We.Z)(e.language,""),normalized:(0,We.Z)(e.normalizedLanguage,""),closedCaption:!0===e.isClosedCaption,id:e.id,active:null!=i&&i===e.id}}))},t.getAvailableVideoTracks=function(e){var t,n=oi(this._periods,e),r=null!=n?n.video:null;if(null==r)return[];var i=this._videoChoiceMemory.get(e),a=void 0===i?void 0:null!==(t=null==i?void 0:i.adaptation.id)&&void 0!==t?t:void 0;return r.adaptations.map((function(e){var t=void 0!==e.trickModeTracks?e.trickModeTracks.map((function(e){var t=null!==a&&a===e.id,n=e.representations.map(si),r={id:e.id,representations:n,isTrickModeTrack:!0,active:t};return!0===e.isSignInterpreted&&(r.signInterpreted=!0),r})):void 0,n={id:e.id,active:null!==a&&a===e.id,representations:e.representations.map(si)};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),void 0!==t&&(n.trickModeTracks=t),n}))},t._applyAudioPreferences=function(){this._audioChoiceMemory=new WeakMap,this._resetChosenAudioTracks()},t._applyTextPreferences=function(){this._textChoiceMemory=new WeakMap,this._resetChosenTextTracks()},t._applyVideoPreferences=function(){this._videoChoiceMemory=new WeakMap,this._resetChosenVideoTracks()},t._resetChosenAudioTracks=function(){var e=this,t=jr(this._preferredAudioTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if(null!=i.audio){var a=i.period,o=i.audio,s=a.getSupportedAdaptations("audio"),u=e._audioChoiceMemory.get(a);if(null===u||void 0!==u&&(0,Re.Z)(s,u))n(r+1);else{var l=ti(s,t);e._audioChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}else n(r+1)}}(0)},t._resetChosenTextTracks=function(){var e=this,t=Qr(this._preferredTextTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if(null!=i.text){var a=i.period,o=i.text,s=a.getSupportedAdaptations("text"),u=e._textChoiceMemory.get(a);if(null===u||void 0!==u&&(0,Re.Z)(s,u))n(r+1);else{var l=ri(s,t);e._textChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}else n(r+1)}}(0)},t._resetChosenVideoTracks=function(){var e=this,t=this._preferredVideoTracks;!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if(null!=i.video){var a=i.period,o=i.video,s=a.getSupportedAdaptations("video"),u=e._videoChoiceMemory.get(a);if(null!==u){if(void 0!==u&&(0,Re.Z)(s,u.baseAdaptation)){var l=li(u.baseAdaptation,e.trickModeTrackEnabled);return l.id===u.adaptation.id?void n(r+1):(e._videoChoiceMemory.set(a,{baseAdaptation:u.baseAdaptation,adaptation:l}),o.adaptation$.next(l),n(0))}var d=ai(s,t);if(null===d)return e._videoChoiceMemory.set(a,null),o.adaptation$.next(null),n(0);var c=li(d,e.trickModeTrackEnabled);return e._videoChoiceMemory.set(a,{baseAdaptation:d,adaptation:c}),o.adaptation$.next(c),n(0)}n(r+1)}else n(r+1)}}(0)},e}();function ei(e){return function(t){var n;if(void 0!==e.normalized&&(null!==(n=t.normalizedLanguage)&&void 0!==n?n:"")!==e.normalized)return!1;if(void 0!==e.audioDescription)if(e.audioDescription){if(!0!==t.isAudioDescription)return!1}else if(!0===t.isAudioDescription)return!1;if(void 0===e.codec)return!0;var r=e.codec.test,i=function(e){return void 0!==e.codec&&r.test(e.codec)};return e.codec.all?t.representations.every(i):t.representations.some(i)}}function ti(e,t){if(0===e.length)return null;for(var n=0;nh)throw new Error('Invalid maxVideoBitrate parameter. Its value, "'+h+'", is inferior to the set minVideoBitrate, "'+p+'"')}if((0,$.Z)(e.maxAudioBitrate))v=zr.audio;else{if(v=Number(e.maxAudioBitrate),isNaN(v))throw new Error("Invalid maxAudioBitrate parameter. Should be a number.");if(f>v)throw new Error('Invalid maxAudioBitrate parameter. Its value, "'+v+'", is inferior to the set minAudioBitrate, "'+f+'"')}return{maxBufferAhead:t,maxBufferBehind:n,limitVideoWidth:m,videoElement:l,wantedBufferAhead:r,throttleWhenHidden:i,throttleVideoBitrateWhenHidden:a,preferredAudioTracks:o,preferredTextTracks:s,preferredVideoTracks:u,initialAudioBitrate:c,initialVideoBitrate:d,minAudioBitrate:f,minVideoBitrate:p,maxAudioBitrate:v,maxVideoBitrate:h,stopAtEnd:(0,$.Z)(e.stopAtEnd)?Hr:!!e.stopAtEnd}}(e),o=r.initialAudioBitrate,u=r.initialVideoBitrate,l=r.limitVideoWidth,d=r.minAudioBitrate,c=r.minVideoBitrate,f=r.maxAudioBitrate,p=r.maxBufferAhead,v=r.maxBufferBehind,h=r.maxVideoBitrate,m=r.preferredAudioTracks,b=r.preferredTextTracks,T=r.preferredVideoTracks,E=r.throttleWhenHidden,w=r.throttleVideoBitrateWhenHidden,S=r.videoElement,k=r.wantedBufferAhead,A=r.stopAtEnd;return S.preload="auto",t.version="3.26.0",t.log=D.Z,t.state="STOPPED",t.videoElement=S,t._priv_destroy$=new i.x,t._priv_pictureInPictureEvent$=new a.t(1),mi(S).pipe((0,g.R)(t._priv_destroy$)).subscribe(t._priv_pictureInPictureEvent$),vi(S).pipe((0,g.R)(t._priv_destroy$)).subscribe((function(){return t.trigger("fullscreenChange",t.isFullscreen())})),yi(S.textTracks).pipe((0,g.R)(t._priv_destroy$),(0,y.U)((function(e){for(var t=e.target,n=[],r=0;r0?e.textTracks[0]:null},o.getPlayerState=function(){return this.state},o.isLive=function(){if(null===this._priv_contentInfos)return!1;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;return!t&&null!==n&&n.isLive},o.areTrickModeTracksEnabled=function(){return this._priv_preferTrickModeTracks},o.getUrl=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest,r=e.url;return t?r:null!==n?n.getUrl():void 0}},o.getVideoDuration=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration},o.getVideoBufferGap=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,j.L7)(e.buffered,e.currentTime)},o.getVideoLoadedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,j.at)(e.buffered,e.currentTime)},o.getVideoPlayedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,j.DD)(e.buffered,e.currentTime)},o.getWallClockTime=function(){if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)return this.videoElement.currentTime;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;return t?this.videoElement.currentTime:null!==n?this.videoElement.currentTime+(void 0!==n.availabilityStartTime?n.availabilityStartTime:0):0},o.getPosition=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.currentTime},o.getPlaybackRate=function(){return this._priv_speed$.getValue()},o.setPlaybackRate=function(e,t){this._priv_speed$.next(e);var n=null==t?void 0:t.preferTrickModeTracks;"boolean"==typeof n&&(this._priv_preferTrickModeTracks=n,null!==this._priv_trackChoiceManager&&(n&&!this._priv_trackChoiceManager.isTrickModeEnabled()?this._priv_trackChoiceManager.enableVideoTrickModeTracks():!n&&this._priv_trackChoiceManager.isTrickModeEnabled()&&this._priv_trackChoiceManager.disableVideoTrickModeTracks()))},o.getAvailableVideoBitrates=function(){if(null===this._priv_contentInfos)return[];var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;if(null===t||null===n)return[];var r=n[t.id];return void 0===r||(0,$.Z)(r.video)?[]:r.video.getAvailableBitrates()},o.getAvailableAudioBitrates=function(){if(null===this._priv_contentInfos)return[];var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;if(null===t||null===n)return[];var r=n[t.id];return void 0===r||(0,$.Z)(r.audio)?[]:r.audio.getAvailableBitrates()},o.getManualAudioBitrate=function(){return this._priv_bitrateInfos.manualBitrates.audio.getValue()},o.getManualVideoBitrate=function(){return this._priv_bitrateInfos.manualBitrates.video.getValue()},o.getVideoBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,$.Z)(e.video))return e.video.bitrate},o.getAudioBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,$.Z)(e.audio))return e.audio.bitrate},o.getMinVideoBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.video.getValue()},o.getMinAudioBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.audio.getValue()},o.getMaxVideoBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.video.getValue()},o.getMaxAudioBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.audio.getValue()},o.play=function(){var e=this;if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement.play();return(0,$.Z)(t)||"function"!=typeof t.catch?X.Z.resolve():t.catch((function(t){if("NotAllowedError"===t.name){var n=new B.Z("MEDIA_ERR_PLAY_NOT_ALLOWED",t.toString());e.trigger("warning",n)}throw t}))},o.pause=function(){if(null===this.videoElement)throw new Error("Disposed player");this.videoElement.pause()},o.seekTo=function(e){if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)throw new Error("player: no content loaded");var t,n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if(!r&&null===i)throw new Error("player: the content did not load yet");if("number"==typeof e)t=e;else if("object"==typeof e){var a=e,o=this.videoElement.currentTime;if((0,$.Z)(a.relative))if((0,$.Z)(a.position)){if((0,$.Z)(a.wallClockTime))throw new Error('invalid time object. You must set one of the following properties: "relative", "position" or "wallClockTime"');t=r||null===i?a.wallClockTime:a.wallClockTime-(void 0!==i.availabilityStartTime?i.availabilityStartTime:0)}else t=a.position;else t=o+a.relative}if(void 0===t)throw new Error("invalid time given");var s=t;if(null!==i&&!i.isLive){var u=i.getMaximumPosition();s=void 0!==u?Math.min(t,u-.001):t}return this.videoElement.currentTime=s,t},o.isFullscreen=function(){return(0,Q.Z)("isFullscreen is deprecated. Fullscreen management should now be managed by the application"),P()},o.setFullscreen=function(e){if(void 0===e&&(e=!0),(0,Q.Z)("setFullscreen is deprecated. Fullscreen management should now be managed by the application"),null===this.videoElement)throw new Error("Disposed player");e?function(e){if(!P()){var t=e;"function"==typeof t.requestFullscreen?t.requestFullscreen():"function"==typeof t.msRequestFullscreen?t.msRequestFullscreen():"function"==typeof t.mozRequestFullScreen?t.mozRequestFullScreen():"function"==typeof t.webkitRequestFullscreen&&t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}}(this.videoElement):C()},o.exitFullscreen=function(){(0,Q.Z)("exitFullscreen is deprecated. Fullscreen management should now be managed by the application"),C()},o.getVolume=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.volume},o.setVolume=function(e){if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement;e!==t.volume&&(t.volume=e,this.trigger("volumeChange",e))},o.isMute=function(){return 0===this.getVolume()},o.mute=function(){this._priv_mutedMemory=this.getVolume(),this.setVolume(0)},o.unMute=function(){0===this.getVolume()&&this.setVolume(0===this._priv_mutedMemory?di:this._priv_mutedMemory)},o.setVideoBitrate=function(e){this._priv_bitrateInfos.manualBitrates.video.next(e)},o.setAudioBitrate=function(e){this._priv_bitrateInfos.manualBitrates.audio.next(e)},o.setMinVideoBitrate=function(e){var t=this._priv_bitrateInfos.maxAutoBitrates.video.getValue();if(e>t)throw new Error('Invalid minimum video bitrate given. Its value, "'+e+'" is superior the current maximum video birate, "'+t+'".');this._priv_bitrateInfos.minAutoBitrates.video.next(e)},o.setMinAudioBitrate=function(e){var t=this._priv_bitrateInfos.maxAutoBitrates.audio.getValue();if(e>t)throw new Error('Invalid minimum audio bitrate given. Its value, "'+e+'" is superior the current maximum audio birate, "'+t+'".');this._priv_bitrateInfos.minAutoBitrates.audio.next(e)},o.setMaxVideoBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.video.getValue();if(e0?r.next(i[0]):r.next(null)}},o._priv_onPeriodStreamCleared=function(e){var t=e.type,n=e.period;switch(t){case"audio":case"text":case"video":null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.removePeriod(t,n)}if(null!==this._priv_contentInfos){var r=this._priv_contentInfos,i=r.activeAdaptations,a=r.activeRepresentations;if(!(0,$.Z)(i)&&!(0,$.Z)(i[n.id])){var o=i[n.id];delete o[t],0===Object.keys(o).length&&delete i[n.id]}if(!(0,$.Z)(a)&&!(0,$.Z)(a[n.id])){var s=a[n.id];delete s[t],0===Object.keys(s).length&&delete a[n.id]}}},o._priv_onReloadingMediaSource=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.segmentBuffersStore=null),null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.resetPeriods()},o._priv_onAdaptationChange=function(e){var t=e.type,n=e.adaptation,r=e.period;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeAdaptations&&(this._priv_contentInfos.activeAdaptations={});var i,a=this._priv_contentInfos,o=a.activeAdaptations,s=a.currentPeriod,u=o[r.id];if((0,$.Z)(u))o[r.id]=((i={})[t]=n,i);else u[t]=n;if(null!==this._priv_trackChoiceManager&&null!==s&&!(0,$.Z)(r)&&r.id===s.id)switch(t){case"audio":var l=this._priv_trackChoiceManager.getChosenAudioTrack(s);this.trigger("audioTrackChange",l);var d=this.getAvailableAudioBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",d);break;case"text":var c=this._priv_trackChoiceManager.getChosenTextTrack(s);this.trigger("textTrackChange",c);break;case"video":var f=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("videoTrackChange",f);var p=this.getAvailableVideoBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",p)}}else D.Z.error("API: The adaptations changed but no content is loaded")},o._priv_onRepresentationChange=function(e){var t,n=e.type,r=e.period,i=e.representation;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeRepresentations&&(this._priv_contentInfos.activeRepresentations={});var a,o=this._priv_contentInfos,s=o.activeRepresentations,u=o.currentPeriod,l=s[r.id];if((0,$.Z)(l))s[r.id]=((a={})[n]=i,a);else l[n]=i;var d=null!==(t=null==i?void 0:i.bitrate)&&void 0!==t?t:-1;(0,$.Z)(r)||null===u||u.id!==r.id||("video"===n?this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",d):"audio"===n&&this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",d))}else D.Z.error("API: The representations changed but no content is loaded")},o._priv_onBitrateEstimationChange=function(e){var t=e.type,n=e.bitrate;void 0!==n&&(this._priv_bitrateInfos.lastBitrates[t]=n),this.trigger("bitrateEstimationChange",{type:t,bitrate:n})},o._priv_onPlayPauseNext=function(e){if(null===this.videoElement)throw new Error("Disposed player");this._priv_playing$.next(e)},o._priv_onNativeTextTracksNext=function(e){this.trigger("nativeTextTracksChange",e)},o._priv_setPlayerState=function(e){this.state!==e&&(this.state=e,D.Z.info("API: playerStateChange event",e),this.trigger("playerStateChange",e))},o._priv_triggerPositionUpdate=function(e){var t;if(null!==this._priv_contentInfos){if(this.state!==Zr){var n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if((r||null!==i)&&!(0,$.Z)(e)){this._priv_lastContentPlaybackInfos.lastPlaybackPosition=e.position;var a=null!==i?i.getMaximumPosition():void 0,o={position:e.position,duration:e.duration,playbackRate:e.playbackRate,maximumBufferTime:a,bufferGap:isFinite(e.bufferGap)?e.bufferGap:0};if(null!==i&&void 0!==a&&i.isLive&&e.position>0){var s=null!==(t=i.availabilityStartTime)&&void 0!==t?t:0;o.wallClockTime=e.position+s,o.liveGap=a-e.position}this.trigger("positionUpdate",o)}}}else D.Z.warn("API: Cannot perform time update: no content loaded.")},o._priv_triggerAvailableBitratesChangeEvent=function(e,t){var n=this._priv_contentEventsMemory[e];(void 0===n||(0,H.Z)(t,n))&&(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},o._priv_triggerCurrentBitrateChangeEvent=function(e,t){t!==this._priv_contentEventsMemory[e]&&(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},o._priv_getCurrentRepresentations=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeRepresentations;return null===t||null===n||(0,$.Z)(n[t.id])?null:n[t.id]},(0,e.Z)(r,null,[{key:"ErrorTypes",get:function(){return K.ZB}},{key:"ErrorCodes",get:function(){return K.SM}},{key:"LogLevel",get:function(){return D.Z.getLevel()},set:function(e){D.Z.setLevel(e)}}]),r}(W.Z);bi.version="3.26.0";var Ti=bi,Ei=n(7273);!function(){Ei.Z.emeManager=n(8281).ZP,Ei.Z.imageBuffer=n(7127).Z,Ei.Z.imageParser=n(3203).Z,Ei.Z.transports.smooth=n(2339).Z,Ei.Z.transports.dash=n(1732).Z,Ei.Z.dashParsers.js=n(148).Z,Ei.Z.nativeTextTracksBuffer=n(9059).Z,Ei.Z.nativeTextTracksParsers.vtt=n(9405).Z,Ei.Z.nativeTextTracksParsers.ttml=n(1570).Z,Ei.Z.nativeTextTracksParsers.sami=n(1812).Z,Ei.Z.nativeTextTracksParsers.srt=n(8057).Z,Ei.Z.htmlTextTracksBuffer=n(5192).Z,Ei.Z.htmlTextTracksParsers.sami=n(5734).Z,Ei.Z.htmlTextTracksParsers.ttml=n(7439).Z,Ei.Z.htmlTextTracksParsers.srt=n(8675).Z,Ei.Z.htmlTextTracksParsers.vtt=n(4099).Z;var e=n(8969).Z,t=n(7794).Z;Ei.Z.directfile={initDirectFile:e,mediaElementTrackChoiceManager:t}}();var wi=Ti}(),r=r.default}()})); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 3b701c8008..b85a473b89 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "rx-player", - "version": "3.25.1", + "version": "3.26.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "3.25.1", + "version": "3.26.0", "license": "Apache-2.0", "dependencies": { "next-tick": "1.1.0", diff --git a/package.json b/package.json index eddf273534..b34357586b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "rx-player", "author": "Canal+", - "version": "3.25.1", + "version": "3.26.0", "description": "Canal+ HTML5 Video Player", "main": "./dist/rx-player.js", "keywords": [ diff --git a/sonar-project.properties b/sonar-project.properties index 12186bb199..f21effdaee 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,6 +1,6 @@ sonar.projectKey=rx-player sonar.projectName=rx-player -sonar.projectVersion=3.25.1 +sonar.projectVersion=3.26.0 sonar.sources=./src,./demo,./tests sonar.exclusions=demo/full/bundle.js,demo/standalone/lib.js,demo/bundle.js sonar.host.url=https://sonarcloud.io diff --git a/src/core/api/public_api.ts b/src/core/api/public_api.ts index 0702c91db0..d13ee45e0a 100644 --- a/src/core/api/public_api.ts +++ b/src/core/api/public_api.ts @@ -497,7 +497,7 @@ class Player extends EventEmitter { // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624 videoElement.preload = "auto"; - this.version = /* PLAYER_VERSION */"3.25.1"; + this.version = /* PLAYER_VERSION */"3.26.0"; this.log = log; this.state = "STOPPED"; this.videoElement = videoElement; @@ -2977,7 +2977,7 @@ class Player extends EventEmitter { return activeRepresentations[currentPeriod.id]; } } -Player.version = /* PLAYER_VERSION */"3.25.1"; +Player.version = /* PLAYER_VERSION */"3.26.0"; export default Player; export { IStreamEventData };