rx-player 3.27.0-dev.2022032800 → 3.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +3 -2
  2. package/VERSION +1 -1
  3. package/dist/_esm5.processed/compat/get_start_date.d.ts +30 -0
  4. package/dist/_esm5.processed/compat/get_start_date.js +44 -0
  5. package/dist/_esm5.processed/compat/index.d.ts +2 -1
  6. package/dist/_esm5.processed/compat/index.js +2 -1
  7. package/dist/_esm5.processed/config.d.ts +1 -2
  8. package/dist/_esm5.processed/core/api/public_api.js +25 -25
  9. package/dist/_esm5.processed/core/segment_buffers/garbage_collector.js +4 -1
  10. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +2 -1
  11. package/dist/_esm5.processed/core/stream/period/period_stream.js +9 -3
  12. package/dist/_esm5.processed/core/stream/representation/force_garbage_collection.js +3 -2
  13. package/dist/_esm5.processed/core/stream/representation/get_buffer_status.d.ts +2 -2
  14. package/dist/_esm5.processed/core/stream/representation/get_buffer_status.js +9 -3
  15. package/dist/_esm5.processed/core/stream/representation/get_needed_segments.d.ts +11 -1
  16. package/dist/_esm5.processed/core/stream/representation/get_needed_segments.js +27 -45
  17. package/dist/_esm5.processed/core/stream/representation/representation_stream.js +6 -4
  18. package/dist/_esm5.processed/default_config.d.ts +2 -8
  19. package/dist/_esm5.processed/default_config.js +2 -8
  20. package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.js +39 -38
  21. package/dist/_esm5.processed/utils/reference.js +0 -2
  22. package/dist/_esm5.processed/utils/task_canceller.d.ts +8 -1
  23. package/dist/_esm5.processed/utils/task_canceller.js +9 -1
  24. package/dist/rx-player.js +198 -145
  25. package/dist/rx-player.min.js +1 -1
  26. package/package.json +1 -1
  27. package/sonar-project.properties +1 -1
  28. package/src/compat/get_start_date.ts +48 -0
  29. package/src/compat/index.ts +2 -0
  30. package/src/core/api/public_api.ts +23 -27
  31. package/src/core/segment_buffers/garbage_collector.ts +4 -0
  32. package/src/core/stream/orchestrator/stream_orchestrator.ts +2 -1
  33. package/src/core/stream/period/period_stream.ts +9 -4
  34. package/src/core/stream/representation/force_garbage_collection.ts +4 -1
  35. package/src/core/stream/representation/get_buffer_status.ts +21 -13
  36. package/src/core/stream/representation/get_needed_segments.ts +40 -55
  37. package/src/core/stream/representation/representation_stream.ts +6 -4
  38. package/src/default_config.ts +20 -27
  39. package/src/transports/dash/add_segment_integrity_checks_to_loader.ts +41 -44
  40. package/src/utils/reference.ts +0 -2
  41. package/src/utils/task_canceller.ts +16 -1
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see rx-player.min.js.LICENSE.txt */
2
- !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={7757:function(e,t,n){e.exports=n(5666)},3774:function(e,t,n){"use strict";n.d(t,{J:function(){return a},c:function(){return o}});var r=n(1946),i=n(2203).Z?void 0:window,a=void 0===i?void 0:(0,r.Z)(i.MediaSource)?(0,r.Z)(i.MozMediaSource)?(0,r.Z)(i.WebKitMediaSource)?i.MSMediaSource:i.WebKitMediaSource:i.MozMediaSource:i.MediaSource,o={HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4}},3666:function(e,t,n){"use strict";n.d(t,{SB:function(){return p},YM:function(){return s},fq:function(){return o},kD:function(){return u},op:function(){return c},vS:function(){return f},vU:function(){return l},yS:function(){return d}});var r,i,a=n(2203),o=!a.Z&&void 0!==window.MSInputMethodContext&&void 0!==document.documentMode,s=!a.Z&&("Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&/(Trident|Edge)\//.test(navigator.userAgent)),u=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("edg/"),l=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),c=!a.Z&&/SamsungBrowser/.test(navigator.userAgent),d=!a.Z&&/Tizen/.test(navigator.userAgent),f=!a.Z&&(Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>=0||"[object SafariRemoteNotification]"===(null===(i=null===(r=window.safari)||void 0===r?void 0:r.pushNotification)||void 0===i?void 0:i.toString())),p=!a.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(1946);function a(e){var t=e.textTracks;if(!(0,i.Z)(t)){for(var n=0;n<t.length;n++)t[n].mode="disabled";if(e.hasChildNodes())for(var a=e.childNodes,o=a.length-1;o>=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 P},Y:function(){return D}});var r,i=n(3714),a=n(811),o=n(3666),s=n(2203),u=n(5059),l=n(3144),c=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 Promise((function(t){return t(e._mediaKeys)}))},t.getConfiguration=function(){return this._configuration},(0,l.Z)(e,[{key:"keySystem",get:function(){return this._keyType}}]),e}(),d=n(4578),f=n(6716),p=n(3071),v=n(3505),h=n(1959),m=n(4804);if(!s.Z){var g=window.MSMediaKeys;void 0!==g&&void 0!==g.prototype&&"function"==typeof g.isTypeSupported&&"function"==typeof g.prototype.createSession&&(r=g)}var y,_=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 f.x,n.closed=new Promise((function(e){n._closeSession$.subscribe(e)})),n.update=function(e){return new Promise((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,d.Z)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new Promise((function(e){var r=t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer);n._ss=n._mk.createSession("video/mp4",r),(0,p.T)(m.GJ(n._ss),m.GV(n._ss),m.Xe(n._ss)).pipe((0,v.R)(n._closeSession$)).subscribe((function(e){return n.trigger(e.type,e)})),e()}))},n.close=function(){var e=this;return new Promise((function(t){null!=e._ss&&(e._ss.close(),e._ss=void 0),e._closeSession$.next(),e._closeSession$.complete(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},(0,l.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}(h.Z),b=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 _(this._mediaKeys)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();if(!s.Z){var T=window.MozMediaKeys;void 0!==T&&void 0!==T.prototype&&"function"==typeof T.isTypeSupported&&"function"==typeof T.prototype.createSession&&(y=T)}var E=n(9689),S=n(8894),w=n(3635);function k(e){return"function"==typeof e.webkitGenerateKeyRequest}var A=function(e){function t(t,n){var r;(r=e.call(this)||this)._vid=t,r._key=n,r.sessionId="",r._closeSession=S.Z,r.keyStatuses=new Map,r.expiration=NaN;var i=function(e){r.trigger(e.type,e)};return r.closed=new Promise((function(e){r._closeSession=function(){["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(e){t.removeEventListener(e,i),t.removeEventListener("webkit"+e,i)})),e()}})),["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(e){t.addEventListener(e,i),t.addEventListener("webkit"+e,i)})),r}(0,d.Z)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new Promise((function(n,r){try{if(t._key.indexOf("clearkey")>=0){var i=e instanceof ArrayBuffer?new Uint8Array(e):e,a=JSON.parse((0,w.uR)(i)),o=(0,E.K)(a.keys[0].k),s=(0,E.K)(a.keys[0].kid);n(t._vid.webkitAddKey(t._key,o,s,""))}else n(t._vid.webkitAddKey(t._key,e,null,""))}catch(e){r(e)}}))},n.generateRequest=function(e,t){var n=this;return new Promise((function(e){n._vid.webkitGenerateKeyRequest(n._key,t),e()}))},n.close=function(){var e=this;return new Promise((function(t){e._closeSession(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},t}(h.Z),x=function(){function e(e){this._keySystem=e}var t=e.prototype;return t._setVideo=function(e){if(!k(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 A(this._videoElement,this._keySystem)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();var I=n(6968);var Z=n(158);function R(e,t){var n=e;if(void 0===n.webkitSetMediaKeys)throw new Error("No webKitMediaKeys API.");return n.webkitSetMediaKeys(t)}var M=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._serverCertificate=r,i._videoElement=t,i._keyType=n,i._unbindSession=S.Z,i._closeSession=S.Z,i.closed=new Promise((function(e){i._closeSession=e})),i.keyStatuses=new Map,i.expiration=NaN,i}(0,d.Z)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new Promise((function(n,r){if(void 0===t._nativeSession||void 0===t._nativeSession.update||"function"!=typeof t._nativeSession.update)return r("Unavailable WebKit key session.");try{var i;i=e instanceof ArrayBuffer?new Uint8Array(e):e instanceof Uint8Array?e:new Uint8Array(e.buffer),n(t._nativeSession.update(i))}catch(e){r(e)}}))},n.generateRequest=function(e,t){var n=this;return new Promise((function(e){var r,i,a,o=n._videoElement;if(void 0===(null===(r=o.webkitKeys)||void 0===r?void 0:r.createSession))throw new Error("No WebKitMediaKeys API.");if("com.apple.fps.1_0"===(a=n._keyType)||"com.apple.fps.2_0"===a){if(void 0===n._serverCertificate)throw new Error("A server certificate is needed for creating fairplay session.");i=function(e,t){var n=e instanceof Uint8Array?e:new Uint8Array(e),r=t instanceof Uint8Array?t:new Uint8Array(t);if((0,I.dN)(n,0)+4!==n.length)throw new Error("Unsupported WebKit initData.");var i=(0,w.wV)(n),a=i.indexOf("skd://"),o=a>-1?i.substring(a+6):i,s=(0,w.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,I.O_)(s.byteLength),u),u+=4,l.set(s,u),u+=s.byteLength,l.set((0,I.O_)(r.byteLength),u),u+=4,l.set(r,u),l}(t,n._serverCertificate)}else i=t;var s=o.webkitKeys.createSession("video/mp4",i);if(null==s)throw new Error("Impossible to get the key sessions");n._listenEvent(s),n._nativeSession=s,e()}))},n.close=function(){var e=this;return new Promise((function(t,n){e._unbindSession(),e._closeSession(),void 0!==e._nativeSession?(e._nativeSession.close(),t()):n("No session to close.")}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},n._listenEvent=function(e){var t=this;this._unbindSession();var n=function(e){t.trigger(e.type,e)};["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(t){e.addEventListener(t,n),e.addEventListener("webkit"+t,n)})),this._unbindSession=function(){["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(t){e.removeEventListener(t,n),e.removeEventListener("webkit"+t,n)}))}},(0,l.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}(h.Z),C=function(){function e(e){if(void 0===Z.t)throw new Error("No WebKitMediaKeys API.");this._keyType=e,this._mediaKeys=new Z.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 R(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 M(this._videoElement,this._keyType,this._serverCertificate)},t.setServerCertificate=function(e){return this._serverCertificate=e,Promise.resolve()},e}();var P=null,D=function(e,t){var n=e;return"function"==typeof n.setMediaKeys?n.setMediaKeys(t):"function"==typeof n.webkitSetMediaKeys?n.webkitSetMediaKeys(t):"function"==typeof n.mozSetMediaKeys?n.mozSetMediaKeys(t):"function"==typeof n.msSetMediaKeys&&null!==t?n.msSetMediaKeys(t):void 0};if(s.Z||null!=navigator.requestMediaKeySystemAccess&&!(0,u.Z)())P=function(){var e;return(e=navigator).requestMediaKeySystemAccess.apply(e,arguments)};else{var N,O;if(k(HTMLVideoElement.prototype)){var L={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 x(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof x))throw new Error("Custom setMediaKeys is supposed to be called with old webkit custom MediaKeys.");return t._setVideo(e)}}};N=L.isTypeSupported,O=L.createCustomMediaKeys,D=L.setMediaKeys}else if(void 0!==Z.t){var B=function(){if(void 0===Z.t)throw new Error("No WebKitMediaKeys API.");return{isTypeSupported:Z.t.isTypeSupported,createCustomMediaKeys:function(e){return new C(e)},setMediaKeys:function(e,t){if(null===t)return R(e,t);if(!(t instanceof C))throw new Error("Custom setMediaKeys is supposed to be called with webkit custom MediaKeys.");return t._setVideo(e)}}}();N=B.isTypeSupported,O=B.createCustomMediaKeys,D=B.setMediaKeys}else if(o.fq&&void 0!==r){var U={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 b(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof b))throw new Error("Custom setMediaKeys is supposed to be called with IE11 custom MediaKeys.");return t._setVideo(e)}}};N=U.isTypeSupported,O=U.createCustomMediaKeys,D=U.setMediaKeys}else if(void 0!==y){var F={isTypeSupported:function(e,t){if(void 0===y)throw new Error("No MozMediaKeys API.");return void 0!==t?y.isTypeSupported(e,t):y.isTypeSupported(e)},createCustomMediaKeys:function(e){if(void 0===y)throw new Error("No MozMediaKeys API.");return new y(e)},setMediaKeys:function(e,t){var n=e;if(void 0===n.mozSetMediaKeys||"function"!=typeof n.mozSetMediaKeys)throw new Error("Can't set video on MozMediaKeys.");return n.mozSetMediaKeys(t)}};N=F.isTypeSupported,O=F.createCustomMediaKeys,D=F.setMediaKeys}else{var z=window.MediaKeys,V=function(){if(void 0===z)throw new i.Z("MEDIA_KEYS_NOT_SUPPORTED","No `MediaKeys` implementation found in the current browser.");if(void 0===z.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.")}};N=function(e){return V(),(0,a.Z)("function"==typeof z.isTypeSupported),z.isTypeSupported(e)},O=function(e){return V(),new z(e)}}P=function(e,t){if(!N(e))return Promise.reject(new Error("Unsupported key type"));for(var n=0;n<t.length;n++){var r=t[n],i=r.videoCapabilities,a=r.audioCapabilities,o=r.initDataTypes,s=r.distinctiveIdentifier,u=!0;if(u=(u=u&&(null==o||o.some((function(e){return"cenc"===e}))))&&"required"!==s){var l={initDataTypes:["cenc"],distinctiveIdentifier:"not-allowed",persistentState:"required",sessionTypes:["temporary","persistent-license"]};void 0!==i&&(l.videoCapabilities=i),void 0!==a&&(l.audioCapabilities=a);var d=O(e);return Promise.resolve(new c(e,d,l))}}return Promise.reject(new Error("Unsupported configuration"))}}},158:function(e,t,n){"use strict";var r;if(n.d(t,{t:function(){return r}}),!n(2203).Z){var i=window.WebKitMediaKeys;void 0!==i&&"function"==typeof i.isTypeSupported&&"function"==typeof i.prototype.createSession&&"function"==typeof HTMLMediaElement.prototype.webkitSetMediaKeys&&(r=i)}},4804:function(e,t,n){"use strict";n.d(t,{Nh:function(){return B},_K:function(){return z},Oh:function(){return te},C1:function(){return W},Q1:function(){return j},GV:function(){return re},Xe:function(){return ie},GJ:function(){return ne},eX:function(){return ae},K4:function(){return K},yj:function(){return F},Qt:function(){return q},gg:function(){return ee},ik:function(){return H},d5:function(){return G},UG:function(){return X},ep:function(){return Q},ym:function(){return $},UA:function(){return Y},_E:function(){return J},$x:function(){return V}});var r=n(1480),i=n(2967),a=new r.y(i.Z);var o=n(7991),s=n(6362),u=n(4727),l=n(533),c=n(9127);var d=n(7877);function f(e,t){return t?function(n){return(0,s.z)(t.pipe((0,u.q)(1),(0,l.l)()),n.pipe(f(e)))}:(0,d.z)((function(t,n){return e(t,n).pipe((0,u.q)(1),function(e){return(0,c.U)((function(){return e}))}(t))}))}var p=n(6625);function v(e,t){void 0===t&&(t=o.z);var n=(0,p.H)(e,t);return f((function(){return n}))}var h=n(6798),m=n(2566),g=n(7878),y={leading:!0,trailing:!1};function _(e,t,n){void 0===t&&(t=o.z),void 0===n&&(n=y);var r,i,a,s,u,l=(0,p.H)(e,t);return r=function(){return l},s=(a=void 0===(i=n)?y:i).leading,u=a.trailing,(0,h.e)((function(e,t){var n=!1,i=null,a=null,o=!1,l=function(){null==a||a.unsubscribe(),a=null,u&&(f(),o&&t.complete())},c=function(){a=null,o&&t.complete()},d=function(e){return a=(0,g.Xf)(r(e)).subscribe(new m.Q(t,l,c))},f=function(){if(n){n=!1;var e=i;i=null,t.next(e),!o&&d(e)}};e.subscribe(new m.Q(t,(function(e){n=!0,i=e,(!a||a.closed)&&(s?f():d(e))}),(function(){o=!0,(!(u&&n&&a)||a.closed)&&t.complete()})))}))}var b=n(2401),T=n(3071),E=n(9917),S=n(6108),w=n(3741),k=n(4978),A=n(2817),x=n(2334),I=n(6697),Z=n(6872),R=n(6923),M=n(2203),C=n(5059),P=["","webkit","moz","ms"],D=M.Z||null==window.devicePixelRatio||0===window.devicePixelRatio?1:window.devicePixelRatio;function N(e,t){return t.filter((function(t){return function(e,t){var n=document.createElement(e.tagName),r="on"+t;return r in n||(n.setAttribute(r,"return;"),"function"==typeof n[r])}(e,t)}))[0]}function O(e,t){var n,r=function(e,t){return e.reduce((function(e,n){return e.concat((null==t?P:t).map((function(e){return e+n})))}),[])}(e,t);return function(e){return e instanceof HTMLElement?(void 0===n&&(n=N(e,r)),(0,R.Z)(n)?(0,b.R)(e,n):a):T.T.apply(void 0,r.map((function(t){return(0,b.R)(e,t)})))}}function L(){var e,t=document;null!=t.hidden?e="":null!=t.mozHidden?e="moz":null!=t.msHidden?e="ms":null!=t.webkitHidden&&(e="webkit");var n=(0,R.Z)(e)?e+"Hidden":"hidden",r=(0,R.Z)(e)?e+"visibilitychange":"visibilitychange";return(0,E.P)((function(){var e=document[n];return(0,b.R)(document,r).pipe((0,c.U)((function(){return!document[n]})),(0,S.O)(!e),(0,w.x)())}))}function B(){var e=Z.Z.getCurrent().INACTIVITY_DELAY;return L().pipe((0,k.w)((function(t){return t?(0,A.of)(t):(0,A.of)(t).pipe(v(e))})))}function U(e,t){var n=t.width,r=t.height/(e.clientHeight/e.clientWidth);return Math.min(n,r)}function F(e){return(0,E.P)((function(){var t=e;if(!0===t.webkitSupportsPresentationMode&&"function"==typeof t.webkitSetPresentationMode){var n="picture-in-picture"===t.webkitPresentationMode;return(0,b.R)(t,"webkitpresentationmodechanged").pipe((0,c.U)((function(){return{isEnabled:"picture-in-picture"===t.webkitPresentationMode,pipWindow:null}})),(0,S.O)({isEnabled:n,pipWindow:null}))}var r={isEnabled:document.pictureInPictureElement===t,pipWindow:null};return(0,T.T)((0,b.R)(t,"enterpictureinpicture").pipe((0,c.U)((function(e){var t;return{isEnabled:!0,pipWindow:null!==(t=e.pictureInPictureWindow)&&void 0!==t?t:null}}))),(0,b.R)(t,"leavepictureinpicture").pipe((0,c.U)((function(){return{isEnabled:!1,pipWindow:null}})))).pipe((0,S.O)(r))}))}function z(e){var t=Z.Z.getCurrent().INACTIVITY_DELAY;return(0,x.a)([L(),e]).pipe((0,k.w)((function(e){var n=e[0];return e[1].isEnabled||n?(0,A.of)(!0):(0,A.of)(!1).pipe(v(t))})),(0,w.x)())}function V(e,t){return(0,x.a)([t,(0,I.F)(2e4).pipe((0,S.O)(null)),(0,b.R)(window,"resize").pipe(_(500),(0,S.O)(null))]).pipe((0,k.w)((function(t){var n=t[0];if(n.isEnabled){if(null!=n.pipWindow){var r=n.pipWindow,i=U(e,r);return(0,b.R)(r,"resize").pipe((0,S.O)(i*D),(0,c.U)((function(){return U(e,r)*D})))}return(0,A.of)(1/0)}return(0,A.of)(e.clientWidth*D)})),(0,w.x)())}var K=O(["loadedmetadata"]),G=O(["seeking"]),H=O(["seeked"]),W=O(["ended"]),j=(O(["timeupdate"]),O(["fullscreenchange","FullscreenChange"],P.concat("MS"))),q=function(e){return(0,T.T)(O(["play"])(e),O(["pause"])(e))},Y=function(e){return(0,T.T)(O(["addtrack"])(e),O(["removetrack"])(e))},$=O(["sourceopen","webkitsourceopen"]),X=O(["sourceclose","webkitsourceclose"]),Q=O(["sourceended","webkitsourceended"]),J=O(["update"]),ee=O(["onremovesourcebuffer"]),te=O((0,C.Z)()?["needkey"]:["encrypted","needkey"]),ne=O(["keymessage","message"]),re=O(["keyadded","ready"]),ie=O(["keyerror","error"]),ae=O(["keystatuseschange"])},2203:function(e,t){"use strict";var n="undefined"==typeof window;t.Z=n},1988:function(e,t,n){"use strict";function r(e){return"function"==typeof window.VTTCue&&e instanceof window.VTTCue}n.d(t,{Z:function(){return r}})},7253:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946);function a(e,t,n){if(e>=t)return r.Z.warn("Compat: Invalid cue times: "+e+" - "+t),null;if((0,i.Z)(window.VTTCue)){if((0,i.Z)(window.TextTrackCue))throw new Error("VTT cues not supported in your target");return new TextTrackCue(e,t,n)}return new VTTCue(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.vS||r.SB)&&void 0!==i.t}},1669:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3666);function i(){return r.op}},6872:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r={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,DEFAULT_MAX_VIDEO_BUFFER_SIZE: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.5},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},REBUFFERING_GAP:{DEFAULT:.5,LOW_LATENCY:.2},MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING:2,UNFREEZING_SEEK_DELAY:6e3,FREEZING_STALLED_DELAY:600,UNFREEZING_DELTA_POSITION:.001,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_WAITING_DELAY_LOADED_SESSION_EMPTY_KEYSTATUSES:100,FORCED_ENDED_THRESHOLD:8e-4,ADAPTATION_SWITCH_BUFFER_PADDINGS:{video:{before:5,after: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,BUFFERED_HISTORY_RETENTION_TIME:6e4,BUFFERED_HISTORY_MAXIMUM_ENTRIES:200,MIN_BUFFER_LENGTH:5,MIN_BUFFER_DISTANCE_BEFORE_CLEAN_UP:10,UPTO_CURRENT_POSITION_CLEANUP:5},i=n(8026);function a(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function o(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(0===n.length)return e;var s=n.shift();if(a(e)&&a(s))for(var u in s)if(a(s[u])){var l;if(void 0===e[u])(0,i.Z)(e,((l={})[u]={},l));var c=e[u];o(c,s[u])}else{var d;(0,i.Z)(e,((d={})[u]=s[u],d))}return o.apply(void 0,[e].concat(n))}var s=new(function(){function e(){this._config=r}var t=e.prototype;return t.update=function(e){var t=o(this._config,e);this._config=t},t.getCurrent=function(){return this._config},e}())},7794:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(4578),i=n(811),a=n(1959),o=n(7829);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){var n;if(t.length!==e.length)return!0;for(var r=0;r<t.length;r++)if(t[r].nativeTrack!==(null===(n=e[r])||void 0===n?void 0:n.nativeTrack))return!0;return!1}function c(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],s=""===a.language?"nolang":a.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_audio_"+s+"_"+u.toString();r[s]=u+1;var c={language:a.language,id:l,normalized:(0,o.ZP)(a.language),audioDescription:!1,representations:[]};n.push({track:c,nativeTrack:a})}return n}function d(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],s=""===a.language?"nolang":a.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_text_"+s+"_"+u.toString();r[s]=u+1;var c={language:a.language,id:l,normalized:(0,o.ZP)(a.language),closedCaption:"captions"===a.kind};n.push({track:c,nativeTrack:a})}return n}function f(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],o=""===a.language?"nolang":a.language,s=null!==(t=r[o])&&void 0!==t?t:1,u="gen_video_"+o+"_"+s.toString();r[o]=s+1,n.push({track:{id:u,representations:[]},nativeTrack:a})}return n}var p=function(e){function t(t){var n,r,i,a;return(n=e.call(this)||this)._preferredAudioTracks=[],n._preferredTextTracks=[],n._preferredVideoTracks=[],n._nativeAudioTracks=t.audioTracks,n._nativeVideoTracks=t.videoTracks,n._nativeTextTracks=t.textTracks,n._audioTracks=void 0!==n._nativeAudioTracks?c(n._nativeAudioTracks):[],n._videoTracks=void 0!==n._nativeVideoTracks?f(n._nativeVideoTracks):[],n._textTracks=void 0!==n._nativeTextTracks?d(n._nativeTextTracks):[],n._lastEmittedNativeAudioTrack=null===(r=n._getPrivateChosenAudioTrack())||void 0===r?void 0:r.nativeTrack,n._lastEmittedNativeVideoTrack=null===(i=n._getPrivateChosenVideoTrack())||void 0===i?void 0:i.nativeTrack,n._lastEmittedNativeTextTrack=null===(a=n._getPrivateChosenTextTrack())||void 0===a?void 0:a.nativeTrack,n._handleNativeTracksCallbacks(),n}(0,r.Z)(t,e);var n=t.prototype;return n.setPreferredAudioTracks=function(e,t){this._preferredAudioTracks=e,t&&this._applyAudioPreferences()},n.setPreferredTextTracks=function(e,t){this._preferredTextTracks=e,t&&this._applyTextPreferences()},n.setPreferredVideoTracks=function(e,t){this._preferredVideoTracks=e,t&&this._applyVideoPreferences()},n.setAudioTrackById=function(e){for(var t=0;t<this._audioTracks.length;t++){var n=this._audioTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return this._enableAudioTrackFromIndex(t),void(this._audioTrackLockedOn=i)}throw new Error("Audio track not found.")},n.disableTextTrack=function(){v(this._textTracks),this._textTrackLockedOn=null},n.setTextTrackById=function(e){for(var t=!1,n=0;n<this._textTracks.length;n++){var r=this._textTracks[n],i=r.track,a=r.nativeTrack;i.id===e?(a.mode="showing",t=!0,this._textTrackLockedOn=a):"showing"!==a.mode&&"hidden"!==a.mode||(a.mode="disabled")}if(!t)throw new Error("Text track not found.")},n.disableVideoTrack=function(){m(this._videoTracks),this._videoTrackLockedOn=null},n.setVideoTrackById=function(e){for(var t=0;t<this._videoTracks.length;t++){var n=this._videoTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return i.selected=!0,void(this._videoTrackLockedOn=i)}throw new Error("Video track not found.")},n.getChosenAudioTrack=function(){var e=this._getPrivateChosenAudioTrack();return null!=e?e.track:e},n.getChosenTextTrack=function(){var e=this._getPrivateChosenTextTrack();return null!=e?e.track:e},n.getChosenVideoTrack=function(){var e=this._getPrivateChosenVideoTrack();return null!=e?e.track:e},n.getAvailableAudioTracks=function(){return this._audioTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,audioDescription:t.audioDescription,active:n.enabled,representations:t.representations}}))},n.getAvailableTextTracks=function(){return this._textTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,closedCaption:t.closedCaption,active:"showing"===n.mode}}))},n.getAvailableVideoTracks=function(){return this._videoTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,representations:t.representations,active:n.selected}}))},n.dispose=function(){void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onchange=null,this._nativeVideoTracks.onaddtrack=null,this._nativeVideoTracks.onremovetrack=null),void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onchange=null,this._nativeAudioTracks.onaddtrack=null,this._nativeAudioTracks.onremovetrack=null),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onchange=null,this._nativeTextTracks.onaddtrack=null,this._nativeTextTracks.onremovetrack=null),this.removeEventListener()},n._getPrivateChosenAudioTrack=function(){if(void 0!==this._nativeAudioTracks){for(var e=0;e<this._audioTracks.length;e++){var t=this._audioTracks[e];if(t.nativeTrack.enabled)return t}return null}},n._getPrivateChosenVideoTrack=function(){if(void 0!==this._nativeVideoTracks){for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e];if(t.nativeTrack.selected)return t}return null}},n._getPrivateChosenTextTrack=function(){if(void 0!==this._nativeTextTracks){for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e];if("showing"===t.nativeTrack.mode)return t}return null}},n._setOptimalAudioTrack=function(){if(void 0!==this._audioTrackLockedOn)for(var e=0;e<this._audioTracks.length;e++){if(this._audioTracks[e].nativeTrack===this._audioTrackLockedOn)return void this._enableAudioTrackFromIndex(e)}this._applyAudioPreferences()},n._applyAudioPreferences=function(){this._audioTrackLockedOn=void 0;for(var e=this._preferredAudioTracks,t=0;t<e.length;t++){var n=e[t];if(null!==n&&void 0!==n.language)for(var r=(0,o.ZP)(n.language),i=0;i<this._audioTracks.length;i++){var a=this._audioTracks[i];if(a.track.normalized===r&&a.track.audioDescription===n.audioDescription)return void this._enableAudioTrackFromIndex(i)}}},n._setOptimalTextTrack=function(){if(null!==this._textTrackLockedOn){if(void 0!==this._textTrackLockedOn)for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e].nativeTrack;if(t===this._textTrackLockedOn)return h(this._textTracks,t),void("showing"!==t.mode&&(t.mode="showing"))}this._applyTextPreferences()}else v(this._textTracks)},n._applyTextPreferences=function(){this._textTrackLockedOn=void 0;for(var e=this._preferredTextTracks,t=0;t<e.length;t++){var n=e[t];if(null===n)return void v(this._textTracks);for(var r=(0,o.ZP)(n.language),i=0;i<this._textTracks.length;i++){var a=this._textTracks[i];if(a.track.normalized===r&&a.track.closedCaption===n.closedCaption)return h(this._textTracks,a.nativeTrack),void("showing"!==a.nativeTrack.mode&&(a.nativeTrack.mode="showing"))}}v(this._textTracks)},n._setOptimalVideoTrack=function(){if(null!==this._videoTrackLockedOn){if(void 0!==this._videoTrackLockedOn)for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e].nativeTrack;if(t===this._videoTrackLockedOn)return void(t.selected=!0)}this._applyVideoPreferences()}else m(this._videoTracks)},n._applyVideoPreferences=function(){this._videoTrackLockedOn=void 0,this._preferredVideoTracks.some((function(e){return null===e}))&&m(this._videoTracks)},n._handleNativeTracksCallbacks=function(){var e=this;void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeAudioTracks){var r=c(e._nativeAudioTracks);if(l(e._audioTracks,r)){e._audioTracks=r,e._setOptimalAudioTrack(),e.trigger("availableAudioTracksChange",e.getAvailableAudioTracks());var i=e._getPrivateChosenAudioTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeAudioTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeAudioTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeAudioTracks){var r=c(e._nativeAudioTracks);if(l(e._audioTracks,r)){e._audioTracks=r,e.trigger("availableAudioTracksChange",e.getAvailableAudioTracks());var i=e._getPrivateChosenAudioTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeAudioTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeAudioTracks.onchange=function(){if(void 0!==e._audioTracks)for(var t=0;t<e._audioTracks.length;t++){var n=e._audioTracks[t],r=n.track,i=n.nativeTrack;if(i.enabled)return void(i!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",r),e._lastEmittedNativeAudioTrack=i))}null!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null),e._lastEmittedNativeAudioTrack=null)}),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeTextTracks){var r=d(e._nativeTextTracks);if(l(e._textTracks,r)){e._textTracks=r,e._setOptimalTextTrack(),e.trigger("availableTextTracksChange",e.getAvailableTextTracks());var i=e._getPrivateChosenTextTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeTextTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeTextTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeTextTracks){var r=d(e._nativeTextTracks);if(l(e._textTracks,r)){e._textTracks=r,e._setOptimalTextTrack(),e.trigger("availableTextTracksChange",e.getAvailableTextTracks());var i=e._getPrivateChosenTextTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeTextTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeTextTracks.onchange=function(){if(void 0!==e._textTracks)for(var t=0;t<e._textTracks.length;t++){var n=e._textTracks[t],r=n.track,i=n.nativeTrack;if("showing"===i.mode)return void(i!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",r),e._lastEmittedNativeTextTrack=i))}null!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null),e._lastEmittedNativeTextTrack=null)}),void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeVideoTracks){var r=f(e._nativeVideoTracks);if(l(e._videoTracks,r)){e._videoTracks=r,e._setOptimalVideoTrack(),e.trigger("availableVideoTracksChange",e.getAvailableVideoTracks());var i=e._getPrivateChosenVideoTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeVideoTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeVideoTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeVideoTracks){var r=f(e._nativeVideoTracks);if(l(e._videoTracks,r)){e._videoTracks=r,e._setOptimalVideoTrack(),e.trigger("availableVideoTracksChange",e.getAvailableVideoTracks());var i=e._getPrivateChosenVideoTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeVideoTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeVideoTracks.onchange=function(){if(void 0!==e._videoTracks)for(var t=0;t<e._videoTracks.length;t++){var n=e._videoTracks[t],r=n.track,i=n.nativeTrack;if(i.selected)return void(i!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",r),e._lastEmittedNativeVideoTrack=i))}null!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null),e._lastEmittedNativeVideoTrack=null)})},n._enableAudioTrackFromIndex=function(e){(0,i.Z)(e<this._audioTracks.length);for(var t,n=s(this._audioTracks);!(t=n()).done;){t.value.nativeTrack.enabled=!1}this._audioTracks[e].nativeTrack.enabled=!0},t}(a.Z);function v(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.mode="disabled"}}function h(e,t){for(var n=0;n<e.length;n++){var r=e[n].nativeTrack;r===t||"showing"!==r.mode&&"hidden"!==r.mode||(r.mode="disabled")}}function m(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.selected=!1}}},7665:function(e,t,n){"use strict";n.d(t,{u:function(){return St},Z:function(){return kt}});var r=n(5861),i=n(4578),a=n(7757),o=n.n(a),s=n(3887),u=n(6490),l=n(4791),c=n(6968),d=n(3635),f=(0,c.pX)((0,d.tG)("pssh"),0);function p(e,t){for(var n=0;n<e.length;n++){var r=e[n];if((void 0===t.systemId||void 0===r.systemId||t.systemId===r.systemId)&&(0,l.Z)(t.data,r.data))return!0}return!1}function v(e){var t=e.initData,n=e.initDataType;return null==t?(s.Z.warn("Compat: No init data found on media encrypted event."),null):{type:n,values:function(e){for(var t=[],n=0;n<e.length;){if(e.length<n+8||(0,c.pX)(e,n+4)!==f)return s.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var r=(0,c.pX)(new Uint8Array(e),n);if(n+r>e.length)return s.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var i=e.subarray(n,n+r),a={systemId:(0,u.Y)(i,8),data:i};p(t,a)?s.Z.warn("Compat: Duplicated PSSH found in initialization data, removing it."):t.push(a),n+=r}return n!==e.length?(s.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}]):t}(new Uint8Array(t))}}var h=n(4804),m=n(6872),g=n(5157),y=n(5389),_=n(3274),b=n(7714),T=n(1959),E=n(1946),S=n(288),w=n(6139),k=n(770);function A(e){k.Z.setState(e,null),(0,w.Y)(e,null)}function x(){return(x=(0,r.Z)(o().mark((function e(t,n,r){var i,a,u,l,c,d;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.keySystemOptions,a=n.loadedSessionsStore,u=n.mediaKeySystemAccess,l=n.mediaKeys,c=k.Z.getState(t),d=null!==c&&c.loadedSessionsStore!==a?c.loadedSessionsStore.closeAllSessions():Promise.resolve(),e.next=5,d;case 5:if(!r.isCancelled){e.next=7;break}throw r.cancellationError;case 7:if(k.Z.setState(t,{keySystemOptions:i,mediaKeySystemAccess:u,mediaKeys:l,loadedSessionsStore:a}),t.mediaKeys!==l){e.next=10;break}return e.abrupt("return");case 10:s.Z.info("DRM: Attaching MediaKeys to the media element"),(0,w.Y)(t,l),s.Z.info("DRM: MediaKeys attached with success");case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function I(e){if(""===e.sessionId)return!1;var t=e.keyStatuses,n=[];return t.forEach((function(e){n.push(e)})),n.length<=0?(s.Z.debug("DRM: isSessionUsable: MediaKeySession given has an empty keyStatuses",e.sessionId),!1):(0,b.Z)(n,"expired")?(s.Z.debug("DRM: isSessionUsable: MediaKeySession given has an expired key",e.sessionId),!1):(0,b.Z)(n,"internal-error")?(s.Z.debug("DRM: isSessionUsable: MediaKeySession given has a key with an internal-error",e.sessionId),!1):(s.Z.debug("DRM: isSessionUsable: MediaKeySession is usable",e.sessionId),!0)}function Z(e,t,n,r){var i=e.loadedSessionsStore,a=e.persistentSessionsStore;return"temporary"===n?R(i,t):null===a?(s.Z.warn("DRM: Cannot create persistent MediaKeySession, PersistentSessionsStore not created."),R(i,t)):function(e,t,n,r){return M.apply(this,arguments)}(i,a,t,r)}function R(e,t){s.Z.info("DRM: Creating a new temporary session");var n=e.createSession(t,"temporary");return Promise.resolve({type:"created-session",value:n})}function M(){return(M=(0,r.Z)(o().mark((function e(t,n,i,a){var u,l,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f=function(){return(f=(0,r.Z)(o().mark((function e(){var r,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===a.cancellationError){e.next=2;break}throw a.cancellationError;case 2:return s.Z.info("DRM: Removing previous persistent session."),null!==(r=n.get(i))&&n.delete(r.sessionId),e.next=7,t.closeSession(u.mediaKeySession);case 7:if(null===a.cancellationError){e.next=9;break}throw a.cancellationError;case 9:return l=t.createSession(i,"persistent-license"),e.abrupt("return",{type:"created-session",value:l});case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)},d=function(){return f.apply(this,arguments)},null===a.cancellationError){e.next=4;break}throw a.cancellationError;case 4:if(s.Z.info("DRM: Creating persistent MediaKeySession"),u=t.createSession(i,"persistent-license"),null!==(l=n.getAndReuse(i))){e.next=9;break}return e.abrupt("return",{type:"created-session",value:u});case 9:return e.prev=9,e.next=12,t.loadPersistentSession(u.mediaKeySession,l.sessionId);case 12:if(c=e.sent){e.next=17;break}return s.Z.warn("DRM: No data stored for the loaded session"),n.delete(l.sessionId),e.abrupt("return",{type:"created-session",value:u});case 17:if(!c||!I(u.mediaKeySession)){e.next=21;break}return n.add(i,i.keyIds,u.mediaKeySession),s.Z.info("DRM: Succeeded to load persistent session."),e.abrupt("return",{type:"loaded-persistent-session",value:u});case 21:return s.Z.warn("DRM: Previous persistent session not usable anymore."),e.abrupt("return",d());case 25:return e.prev=25,e.t0=e.catch(9),s.Z.warn("DRM: Unable to load persistent session: "+(e.t0 instanceof Error?e.t0.toString():"Unknown Error")),e.abrupt("return",d());case 29:case"end":return e.stop()}}),e,null,[[9,25]])})))).apply(this,arguments)}function C(e,t){return P.apply(this,arguments)}function P(){return(P=(0,r.Z)(o().mark((function e(t,n){var r,i,a,s,u;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n<0||n>=t.getLength())){e.next=2;break}return e.abrupt("return");case 2:for(r=[],i=t.getAll().slice(),a=i.length-n,s=0;s<a;s++)u=i[s],r.push(t.closeSession(u.mediaKeySession));return e.next=8,Promise.all(r);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D(e,t,n,r,i){return N.apply(this,arguments)}function N(){return(N=(0,r.Z)(o().mark((function e(t,n,r,i,a){var u,l,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=null,l=n.loadedSessionsStore,c=n.persistentSessionsStore,null===(d=l.reuse(t))){e.next=11;break}if(!I(u=d.mediaKeySession)){e.next=10;break}return s.Z.info("DRM: Reuse loaded session",u.sessionId),e.abrupt("return",{type:"loaded-open-session",value:{mediaKeySession:u,sessionType:d.sessionType,keySessionRecord:d.keySessionRecord}});case 10:null!==c&&""!==d.mediaKeySession.sessionId&&c.delete(d.mediaKeySession.sessionId);case 11:if(null===u){e.next=16;break}return e.next=14,l.closeSession(u);case 14:if(null===a.cancellationError){e.next=16;break}throw a.cancellationError;case 16:return e.next=18,C(l,i);case 18:if(null===a.cancellationError){e.next=20;break}throw a.cancellationError;case 20:return e.next=22,Z(n,t,r,a);case 22:return f=e.sent,e.abrupt("return",{type:f.type,value:{mediaKeySession:f.value.mediaKeySession,sessionType:f.value.sessionType,keySessionRecord:f.value.keySessionRecord}});case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var O=n(3666);var L=n(9592);function B(e,t,n){var r=t.getConfiguration();if(O.fq||null==r)return null;var i=e.filter((function(e){return e.type===n.type&&((!0!==e.persistentLicense&&!0!==e.persistentStateRequired||"required"===r.persistentState)&&(!0!==e.distinctiveIdentifierRequired||"required"===r.distinctiveIdentifier))}))[0];return null!=i?{keySystemOptions:i,keySystemAccess:t}:null}function U(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=m.Z.getCurrent().EME_DEFAULT_WIDEVINE_ROBUSTNESSES,o=null!=t.videoRobustnesses?t.videoRobustnesses:"widevine"===e?a:[],s=null!=t.audioRobustnesses?t.audioRobustnesses:"widevine"===e?a:[];return 0===o.length&&o.push(void 0),0===s.length&&s.push(void 0),[{initDataTypes:["cenc"],videoCapabilities:(0,L.Z)(s,(function(e){return['video/mp4;codecs="avc1.4d401e"','video/mp4;codecs="avc1.42e01e"','video/webm;codecs="vp8"'].map((function(t){return void 0!==e?{contentType:t,robustness:e}:{contentType:t}}))})),audioCapabilities:(0,L.Z)(s,(function(e){return['audio/mp4;codecs="mp4a.40.2"',"audio/webm;codecs=opus"].map((function(t){return void 0!==e?{contentType:t,robustness:e}:{contentType:t}}))})),distinctiveIdentifier:i,persistentState:r,sessionTypes:n}]}function F(e,t,n){s.Z.info("DRM: Searching for compatible MediaKeySystemAccess");var i=k.Z.getState(e);if(null!=i){var a=B(t,i.mediaKeySystemAccess,i.keySystemOptions);if(null!==a)return s.Z.info("DRM: Found cached compatible keySystem"),Promise.resolve({type:"reuse-media-key-system-access",value:{mediaKeySystemAccess:a.keySystemAccess,options:a.keySystemOptions}})}var u=t.reduce((function(e,t){var n,r=m.Z.getCurrent().EME_KEY_SYSTEMS[t.type];null!=r?n=r.map((function(e){return{keyName:t.type,keyType:e,keySystemOptions:t}})):n=[{keyName:function(e){for(var t=m.Z.getCurrent().EME_KEY_SYSTEMS,n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];if((0,b.Z)(t[i],e))return i}}(t.type),keyType:t.type,keySystemOptions:t}];return e.concat(n)}),[]);return l(0);function l(e){return c.apply(this,arguments)}function c(){return(c=(0,r.Z)(o().mark((function e(t){var r,i,a,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t>=u.length)){e.next=2;break}throw new g.Z("INCOMPATIBLE_KEYSYSTEMS","No key system compatible with your wanted configuration has been found in the current browser.");case 2:if(null!=w.N){e.next=4;break}throw new Error("requestMediaKeySystemAccess is not implemented in your browser.");case 4:return r=u[t],i=r.keyName,a=r.keyType,c=r.keySystemOptions,d=U(i,c),s.Z.debug("DRM: Request keysystem access "+a+","+(t+1)+" of "+u.length,d),e.prev=7,e.next=10,(0,w.N)(a,d);case 10:return f=e.sent,s.Z.info("DRM: Found compatible keysystem",a,d),e.abrupt("return",{type:"create-media-key-system-access",value:{options:c,mediaKeySystemAccess:f}});case 15:if(e.prev=15,e.t0=e.catch(7),s.Z.debug("DRM: Rejected access to keysystem",a,d),null===n.cancellationError){e.next=20;break}throw n.cancellationError;case 20:return e.abrupt("return",l(t+1));case 21:case"end":return e.stop()}}),e,null,[[7,15]])})))).apply(this,arguments)}}var z=n(2297);function V(e,t,n){var r;s.Z.debug("Compat: Calling generateRequest on the MediaKeySession");try{r=function(e){s.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;i<e.length;){if(e.length<i+8||(0,c.pX)(e,i+4)!==f)throw s.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var a=(0,c.pX)(new Uint8Array(e),i);if(i+a>e.length)throw s.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 u=(0,z.Xj)(o),l=null===u?void 0:o[u[1]];s.Z.info("Compat: CENC PSSH found with version",l),void 0===l?s.Z.warn("Compat: could not read version of CENC PSSH"):t===(1===l)?n=(0,c.zo)(n,o):1===l?(s.Z.warn("Compat: cenc version 1 encountered, removing every other cenc pssh box."),n=o,t=!0):s.Z.warn("Compat: filtering out cenc pssh box with wrong version",l)}else r=(0,c.zo)(r,o);i+=a}if(i!==e.length)throw s.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");return(0,c.zo)(r,n)}(n)}catch(e){r=n}var i=null!=t?t:"";return e.generateRequest(i,r).catch((function(t){if(""!==i||!(t instanceof TypeError))throw t;return s.Z.warn('Compat: error while calling `generateRequest` with an empty initialization data type. Retrying with a default "cenc" value.',t),e.generateRequest("cenc",r)}))}function K(e,t){return G.apply(this,arguments)}function G(){return(G=(0,r.Z)(o().mark((function e(t,n){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.Z.info("Compat/DRM: Load persisted session",n),e.next=3,t.load(n);case 3:if((r=e.sent)&&!(t.keyStatuses.size>0)){e.next=6;break}return e.abrupt("return",r);case 6:return e.abrupt("return",new Promise((function(e){t.addEventListener("keystatuseschange",i);var n=setTimeout(i,100);function i(){clearTimeout(n),t.removeEventListener("keystatuseschange",i),e(r)}})));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var H=n(7864);function W(e){var t=new S.ZP;return Promise.race([e.close().then((function(){t.cancel()})),e.closed.then((function(){t.cancel()})),function(){return n.apply(this,arguments)}()]);function n(){return(n=(0,r.Z)(o().mark((function e(){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,H.Z)(1e3,t.signal);case 3:return e.next=5,i();case 5:e.next=13;break;case 7:if(e.prev=7,e.t0=e.catch(0),!(e.t0 instanceof S.FU)){e.next=11;break}return e.abrupt("return");case 11:n=e.t0 instanceof Error?e.t0.message:"Unknown error made it impossible to close the session",s.Z.error("DRM: "+n);case 13:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function i(){return a.apply(this,arguments)}function a(){return(a=(0,r.Z)(o().mark((function n(){return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,e.update(new Uint8Array(1));case 3:n.next=13;break;case 5:if(n.prev=5,n.t0=n.catch(0),!t.isUsed){n.next=9;break}return n.abrupt("return");case 9:if(!(n.t0 instanceof Error&&"The session is already closed."===n.t0.message)){n.next=11;break}return n.abrupt("return");case 11:return n.next=13,(0,H.Z)(1e3,t.signal);case 13:if(!t.isUsed){n.next=15;break}return n.abrupt("return");case 15:throw new Error("Compat: Couldn't know if session is closed");case 16:case"end":return n.stop()}}),n,null,[[0,5]])})))).apply(this,arguments)}}function j(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Y(e,t){return e===t||(0,l.Z)(e,t)}function $(e,t){return t.some((function(t){return Y(t,e)}))}function X(e,t){for(var n,r=function(){var e=n.value;if(!t.some((function(t){return Y(t,e)})))return{v:!1}},i=j(e);!(n=i()).done;){var a=r();if("object"==typeof a)return a.v}return!0}function Q(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return J(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 J(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ee=function(){function e(e){this._initializationData=e,this._keyIds=null}var t=e.prototype;return t.associateKeyIds=function(e){null===this._keyIds&&(this._keyIds=[]);for(var t=0,n=Array.from(e);t<n.length;t++){var r=n[t];this.isAssociatedWithKeyId(r)||this._keyIds.push(r)}},t.isAssociatedWithKeyId=function(e){if(null===this._keyIds)return!1;for(var t,n=Q(this._keyIds);!(t=n()).done;){if(Y(t.value,e))return!0}return!1},t.getAssociatedKeyIds=function(){return null===this._keyIds?[]:this._keyIds},t.isCompatibleWith=function(e){var t=e.keyIds;if(void 0!==t){if(null!==this._keyIds&&X(t,this._keyIds))return!0;if(void 0!==this._initializationData.keyIds)return X(t,this._initializationData.keyIds)}return this._checkInitializationDataCompatibility(e)},t._checkInitializationDataCompatibility=function(e){return void 0!==e.keyIds&&void 0!==this._initializationData.keyIds?X(e.keyIds,this._initializationData.keyIds):this._initializationData.type===e.type&&this._initializationData.values.isCompatibleWith(e.values)},e}();function te(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ne(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var re=function(){function e(e){this._mediaKeys=e,this._storage=[]}var t=e.prototype;return t.createSession=function(e,t){var n=this,r=new ee(e),i=this._mediaKeys.createSession(t),a={mediaKeySession:i,sessionType:t,keySessionRecord:r,isGeneratingRequest:!1,isLoadingPersistentSession:!1,closingStatus:{type:"none"}};return(0,E.Z)(i.closed)||i.closed.then((function(){var e=n.getIndex(r);e>=0&&n._storage[e].mediaKeySession===i&&n._storage.splice(e,1)})).catch((function(e){s.Z.warn("DRM-LSS: MediaKeySession.closed rejected: "+e)})),s.Z.debug("DRM-LSS: Add MediaKeySession",a.sessionType),this._storage.push(Object.assign({},a)),a},t.reuse=function(e){for(var t=this._storage.length-1;t>=0;t--){var n=this._storage[t];if(n.keySessionRecord.isCompatibleWith(e))return this._storage.splice(t,1),this._storage.push(n),Object.assign({},n)}return null},t.getEntryForSession=function(e){for(var t=this._storage.length-1;t>=0;t--){var n=this._storage[t];if(n.mediaKeySession===e)return Object.assign({},n)}return null},t.generateLicenseRequest=function(){var e=(0,r.Z)(o().mark((function e(t,n,r){var i,a,u,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=te(this._storage);case 1:if((u=a()).done){e.next=8;break}if((l=u.value).mediaKeySession!==t){e.next=6;break}return i=l,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==i){e.next=11;break}return s.Z.error("DRM-LSS: generateRequest error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",V(t,n,r));case 11:if(i.isGeneratingRequest=!0,"none"===i.closingStatus.type){e.next=14;break}throw new Error("The `MediaKeySession` is being closed.");case 14:return e.prev=14,e.next=17,V(t,n,r);case 17:e.next=26;break;case 19:if(e.prev=19,e.t0=e.catch(14),void 0!==i){e.next=23;break}throw e.t0;case 23:throw i.isGeneratingRequest=!1,"awaiting"===i.closingStatus.type&&i.closingStatus.start(),e.t0;case 26:if(void 0!==i){e.next=28;break}return e.abrupt("return",void 0);case 28:i.isGeneratingRequest=!1,"awaiting"===i.closingStatus.type&&i.closingStatus.start();case 30:case"end":return e.stop()}}),e,this,[[14,19]])})));return function(t,n,r){return e.apply(this,arguments)}}(),t.loadPersistentSession=function(){var e=(0,r.Z)(o().mark((function e(t,n){var r,i,a,u,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=te(this._storage);case 1:if((a=i()).done){e.next=8;break}if((u=a.value).mediaKeySession!==t){e.next=6;break}return r=u,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==r){e.next=11;break}return s.Z.error("DRM-LSS: loadPersistentSession error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",K(t,n));case 11:if(r.isLoadingPersistentSession=!0,"none"===r.closingStatus.type){e.next=14;break}throw new Error("The `MediaKeySession` is being closed.");case 14:return e.prev=14,e.next=17,K(t,n);case 17:l=e.sent,e.next=27;break;case 20:if(e.prev=20,e.t0=e.catch(14),void 0!==r){e.next=24;break}throw e.t0;case 24:throw r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.t0;case 27:if(void 0!==r){e.next=29;break}return e.abrupt("return",l);case 29:return r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.abrupt("return",l);case 32:case"end":return e.stop()}}),e,this,[[14,20]])})));return function(t,n){return e.apply(this,arguments)}}(),t.closeSession=function(){var e=(0,r.Z)(o().mark((function e(t){var n,r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=te(this._storage);case 1:if((i=r()).done){e.next=8;break}if((a=i.value).mediaKeySession!==t){e.next=6;break}return n=a,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==n){e.next=11;break}return s.Z.warn("DRM-LSS: No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",Promise.resolve(!1));case 11:return e.abrupt("return",this._closeEntry(n));case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.getLength=function(){return this._storage.length},t.getAll=function(){return this._storage},t.closeAllSessions=function(){var e=(0,r.Z)(o().mark((function e(){var t,n,r=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._storage,s.Z.debug("DRM-LSS: Closing all current MediaKeySessions",t.length),this._storage=[],n=t.map((function(e){return r._closeEntry(e)})),e.next=6,Promise.all(n);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.getIndex=function(e){for(var t=0;t<this._storage.length;t++){if(this._storage[t].keySessionRecord===e)return t}return-1},t._closeEntry=function(){var e=(0,r.Z)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.mediaKeySession,e.abrupt("return",new Promise((function(e,r){function i(){void 0!==t&&(t.closingStatus={type:"pending"}),ie(n).then((function(){void 0!==t&&(t.closingStatus={type:"done"}),e(!0)})).catch((function(e){void 0!==t&&(t.closingStatus={type:"failed"}),r(e)}))}void 0!==t&&(t.isLoadingPersistentSession||t.isGeneratingRequest)?t.closingStatus={type:"awaiting",start:i}:i()})));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e}();function ie(e){return ae.apply(this,arguments)}function ae(){return(ae=(0,r.Z)(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.Z.debug("DRM: Trying to close a MediaKeySession",t.sessionId),e.prev=1,e.next=4,W(t);case 4:return s.Z.debug("DRM: Succeeded to close MediaKeySession"),e.abrupt("return");case 8:return e.prev=8,e.t0=e.catch(1),s.Z.error("DRM: Could not close MediaKeySession: "+(e.t0 instanceof Error?e.t0.toString():"Unknown error")),e.abrupt("return");case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}var oe=n(811),se=n(9689),ue=n(2870),le=n(6923),ce=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,se.J)(this.initData)},e.decode=function(e){return(0,se.K)(e)},e}();function de(e,t){var n,r;return null!==(r=null!==(n=fe(e,t))&&void 0!==n?n:fe(t,e))&&void 0!==r&&r}function fe(e,t){if(0===e.length)return!1;if(t.length<e.length)return null;for(var n=e[0],r=0,i=0;i<t.length;i++){var a=t[i];if(a.systemId===n.systemId){if(a.hash!==n.hash)return!1;var o=n.data instanceof Uint8Array?n.data:"string"==typeof n.data?ce.decode(n.data):n.data.initData,s=a.data instanceof Uint8Array?a.data:"string"==typeof a.data?ce.decode(a.data):a.data.initData;if(!(0,l.Z)(o,s))return!1;if(t.length-i<e.length)return null;for(r=1;r<e.length;r++){var u=e[r];for(i+=1;i<t.length;i++){var c=t[i];if(u.systemId===c.systemId){if(u.hash!==c.hash)return!1;var d=u.data instanceof Uint8Array?u.data:"string"==typeof u.data?ce.decode(u.data):u.data.initData,f=c.data instanceof Uint8Array?c.data:"string"==typeof c.data?ce.decode(c.data):c.data.initData;if(!(0,l.Z)(d,f))return!1;break}}if(r===t.length)return null}return!0}}return null}function pe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ve(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ve(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var he=function(){function e(e){!function(e){(0,oe.u)(e,{save:"function",load:"function"},"licenseStorage")}(e),this._entries=[],this._storage=e;try{var t=this._storage.load();Array.isArray(t)||(t=[]),this._entries=t}catch(e){s.Z.warn("DRM-PSS: Could not get entries from license storage",e),this.dispose()}}var t=e.prototype;return t.getLength=function(){return this._entries.length},t.getAll=function(){return this._entries},t.get=function(e){var t=this._getIndex(e);return-1===t?null:this._entries[t]},t.getAndReuse=function(e){var t=this._getIndex(e);if(-1===t)return null;var n=this._entries.splice(t,1)[0];return this._entries.push(n),n},t.add=function(e,t,n){if(!(0,E.Z)(n)&&(0,le.Z)(n.sessionId)){var r=n.sessionId,i=this.get(e);if(null===i||i.sessionId!==r){null!==i&&this.delete(i.sessionId),s.Z.info("DRM-PSS: Add new session",r);var a=e.values.getFormattedValues().map((function(e){var t=e.systemId,n=e.data;return{systemId:t,hash:e.hash,data:new ce(n)}}));void 0===t?this._entries.push({version:3,sessionId:r,values:a,initDataType:e.type}):this._entries.push({version:4,sessionId:r,keyIds:t.map((function(e){return new ce(e)})),values:a,initDataType:e.type}),this._save()}}else s.Z.warn("DRM-PSS: Invalid Persisten Session given.")},t.delete=function(e){for(var t=-1,n=0;n<this._entries.length;n++){if(this._entries[n].sessionId===e){t=n;break}}if(-1!==t){var r=this._entries[t];s.Z.warn("DRM-PSS: Delete session from store",r.sessionId),this._entries.splice(t,1),this._save()}else s.Z.warn("DRM-PSS: initData to delete not found.")},t.deleteOldSessions=function(e){s.Z.info("DRM-PSS: Deleting last "+e+" sessions."),e<=0||(e<=this._entries.length?this._entries.splice(0,e):(s.Z.warn("DRM-PSS: Asked to remove more information that it contains",e,this._entries.length),this._entries=[]),this._save())},t.dispose=function(){this._entries=[],this._save()},t._getIndex=function(e){var t=this,n=null;function r(){if(null===n){var t=e.values.constructRequestData();n={initData:t,initDataHash:(0,ue.Z)(t)}}return n}for(var i=function(n){var i=t._entries[n];if(i.initDataType===e.type)switch(i.version){case 4:if(void 0!==e.keyIds){if(e.keyIds.every((function(e){for(var t,n=(0,se.J)(e),r=pe(i.keyIds);!(t=r()).done;){var a=t.value;if("string"==typeof a){if(n===a)return!0}else if(Y(a.initData,e))return!0}return!1})))return{v:n}}else if(de(e.values.getFormattedValues(),i.values))return{v:n};break;case 3:if(de(e.values.getFormattedValues(),i.values))return{v:n};break;case 2:var a=r(),o=a.initData,u=a.initDataHash;if(i.initDataHash===u)try{var c="string"==typeof i.initData?ce.decode(i.initData):i.initData.initData;if((0,l.Z)(c,o))return{v:n}}catch(e){s.Z.warn("DRM-PSS: Could not decode initialization data.",e)}break;case 1:var d=r(),f=d.initData,p=d.initDataHash;if(i.initDataHash===p){if(void 0===i.initData.length)return{v:n};if((0,l.Z)(i.initData,f))return{v:n}}break;default:var v=r().initDataHash;if(i.initData===v)return{v:n}}},a=0;a<this._entries.length;a++){var o=i(a);if("object"==typeof o)return o.v}return-1},t._save=function(){try{this._storage.save(this._entries)}catch(e){s.Z.warn("DRM-PSS: Could not save licenses in localStorage")}},e}();var me=new WeakMap,ge=function(e){me.set(e,null)},ye=function(e,t){var n=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer),r=(0,ue.Z)(n);me.set(e,{hash:r,serverCertificate:n})},_e=function(e){var t=me.get(e);return void 0!==t&&(null!==t||void 0)},be=function(e,t){var n=me.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,ue.Z)(a)!==r||i.length!==a.length)return!1;for(var o=0;o<i.length;o++)if(i[o]!==a[o])return!1;return!0};function Te(e){if(!0!==e.persistentLicense)return null;var t=e.licenseStorage;if(null==t)throw new g.Z("INVALID_KEY_SYSTEM","No license storage found for persistent license.");return s.Z.debug("DRM: Set the given license storage"),new he(t)}function Ee(e,t,n){return Se.apply(this,arguments)}function Se(){return(Se=(0,r.Z)(o().mark((function e(t,n,r){var i,a,u,l,c,d,f,p,v,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F(t,n,r);case 2:if(i=e.sent,null===r.cancellationError){e.next=5;break}throw r.cancellationError;case 5:if(a=i.value,u=a.options,l=a.mediaKeySystemAccess,c=k.Z.getState(t),d=Te(u),null===c||"reuse-media-key-system-access"!==i.type){e.next=12;break}if(f=c.mediaKeys,p=c.loadedSessionsStore,!1!==_e(f)&&((0,E.Z)(u.serverCertificate)||!be(f,u.serverCertificate))){e.next=12;break}return e.abrupt("return",{mediaKeys:f,mediaKeySystemAccess:l,stores:{loadedSessionsStore:p,persistentSessionsStore:d},options:u});case 12:return e.next=14,we(l);case 14:return v=e.sent,s.Z.info("DRM: MediaKeys created with success"),h=new re(v),e.abrupt("return",{mediaKeys:v,mediaKeySystemAccess:l,stores:{loadedSessionsStore:h,persistentSessionsStore:d},options:u});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function we(e){return ke.apply(this,arguments)}function ke(){return(ke=(0,r.Z)(o().mark((function e(t){var n,r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.Z.info("DRM: Calling createMediaKeys on the MediaKeySystemAccess"),e.prev=1,e.next=4,t.createMediaKeys();case 4:return n=e.sent,e.abrupt("return",n);case 8:throw e.prev=8,e.t0=e.catch(1),r=e.t0 instanceof Error?e.t0.message:"Unknown error when creating MediaKeys.",new g.Z("CREATE_MEDIA_KEYS_ERROR",r);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}function Ae(){return(Ae=(0,r.Z)(o().mark((function e(t,n,r){var i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ee(t,n,r);case 2:return i=e.sent,a=i.mediaKeys,null!==t.mediaKeys&&void 0!==t.mediaKeys&&a!==t.mediaKeys&&(s.Z.debug("DRM: Disabling old MediaKeys"),A(t)),e.abrupt("return",i);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var xe=n(7326),Ie=n(2146),Ze=n(6716),Re=n(9127),Me=n(7877),Ce=n(9917),Pe=n(7991),De=n(1454),Ne=n(6798),Oe=n(7878),Le=n(1819),Be=n(2566),Ue=n(7845),Fe=(0,Le.d)((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function ze(e){throw new Fe(e)}var Ve=n(278),Ke=n(9878),Ge=n(3071),He=n(8474);var We=n(1545),je=n(2817),qe=n(3505),Ye=n(6362),$e=n(2006),Xe=n(533),Qe=n(8117),Je=n(6625),et=n(2572);var tt=n(5561);var nt="expired",rt="internal-error",it="output-restricted";function at(e,t,n){var r=[],i=[],a=[],o=t.fallbackOn,s=void 0===o?{}:o,u=t.throwOnLicenseExpiration;return e.keyStatuses.forEach((function(e,t){var o="string"==typeof e?[e,t]:[t,e],l=o[0],c=function(e,t){return-1!==e.indexOf("playready")&&(O.YM||O.kD)?(0,d.wO)(t):t}(n,new Uint8Array(o[1]));switch(l){case nt:var f=new g.Z("KEY_STATUS_CHANGE_ERROR","A decryption key expired ("+(0,d.ci)(c)+")");if(!1!==u)throw f;r.push({type:"warning",value:f}),a.push(c);break;case rt:var p=new g.Z("KEY_STATUS_CHANGE_ERROR",'A "'+l+'" status has been encountered ('+(0,d.ci)(c)+")");if(!0!==s.keyInternalError)throw p;r.push({type:"warning",value:p}),i.push(c);break;case it:var v=new g.Z("KEY_STATUS_CHANGE_ERROR",'A "'+l+'" status has been encountered ('+(0,d.ci)(c)+")");if(!0!==s.keyOutputRestricted)throw v;r.push({type:"warning",value:v}),i.push(c);break;default:a.push(c)}})),{warnings:r,blacklistedKeyIDs:i,whitelistedKeyIds:a}}var ot=h.Xe,st=h.GJ,ut=h.eX,lt=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,xe.Z)(r),t.prototype),r.sessionError=n,r}return(0,i.Z)(t,e),t}((0,Ie.Z)(Error));function ct(e,t,n){s.Z.info("DRM: Binding session events",e.sessionId);var r,i,a=new Ze.x,o=t.getLicenseConfig,u=void 0===o?{}:o,l=ot(e).pipe((0,Re.U)((function(e){throw new g.Z("KEY_ERROR",e.type)}))),c=ut(e).pipe((0,Me.z)((function(r){return function(e,t,n,r){s.Z.info("DRM: keystatuseschange event received",e.sessionId);var i=(0,Ce.P)((function(){return(0,tt.Z)((function(){return"function"!=typeof t.onKeyStatusesChange?We.E:(0,Qe.Z)(t.onKeyStatusesChange(r,e))}),void 0)})).pipe((0,Re.U)((function(t){return{type:"key-status-change-handled",value:{session:e,license:t}}})),(0,Ke.K)((function(e){var t=new g.Z("KEY_STATUS_CHANGE_ERROR","Unknown `onKeyStatusesChange` error");throw!(0,E.Z)(e)&&(0,le.Z)(e.message)&&(t.message=e.message),t})));return(0,Ge.T)(dt(e,t,n),i)}(e,t,n,r)}))),d=st(e).pipe((0,Me.z)((function(n){var r=new Uint8Array(n.message),i=(0,le.Z)(n.messageType)?n.messageType:"license-request";s.Z.info("DRM: Received message event, type "+i,e.sessionId,n);var o,l,c,d,f,p,v,h,m=(0,Ce.P)((function(){var e=t.getLicense(r,i),n=(0,E.Z)(u.timeout)?1e4:u.timeout;return(0,Qe.Z)(e).pipe(n>=0?function(e,t){var n=(0,De.q)(e)?{first:e}:"number"==typeof e?{each:e}:e,r=n.first,i=n.each,a=n.with,o=void 0===a?ze:a,s=n.scheduler,u=void 0===s?null!=t?t:Pe.z:s,l=n.meta,c=void 0===l?null:l;if(null==r&&null==i)throw new TypeError("No timeout provided.");return(0,Ne.e)((function(e,t){var n,a,s=null,l=0,d=function(e){a=(0,Ue.f)(t,u,(function(){try{n.unsubscribe(),(0,Oe.Xf)(o({meta:c,lastValue:s,seen:l})).subscribe(t)}catch(e){t.error(e)}}),e)};n=e.subscribe(new Be.Q(t,(function(e){null==a||a.unsubscribe(),l++,t.next(s=e),i>0&&d(i)}),void 0,void 0,(function(){(null==a?void 0:a.closed)||null==a||a.unsubscribe(),s=null}))),d(null!=r?"number"==typeof r?r:+r-u.now():i)}))}(n):Ve.y)})),g=function(e,t){return{totalRetry:null!=t?t:2,baseDelay:200,maxDelay:3e3,shouldRetry:function(e){return e instanceof Fe||(0,E.Z)(e)||!0!==e.noRetry},onRetry:function(t){return e.next({type:"warning",value:ft(t)})}}}(a,u.retry);return(o=m,l=g,c=l.baseDelay,d=l.maxDelay,f=l.totalRetry,p=l.shouldRetry,v=l.onRetry,h=0,o.pipe((0,Ke.K)((function(e,t){if(!(0,E.Z)(p)&&!p(e)||h++>=f)throw e;"function"==typeof v&&v(e,h);var n=Math.min(c*Math.pow(2,h-1),d),r=(0,et.Z)(n);return(0,Je.H)(r).pipe((0,Me.z)((function(){return t})))})))).pipe((0,Re.U)((function(t){return{type:"key-message-handled",value:{session:e,license:t}}})),(0,Ke.K)((function(e){var t=ft(e);if(!(0,E.Z)(e)&&!0===e.fallbackOnLastTry)throw s.Z.warn("DRM: Last `getLicense` attempt failed. Blacklisting the current session."),new lt(t);throw t})))}))),f=(0,Ge.T)(d,c).pipe((r=function(t){switch(t.type){case"key-message-handled":case"key-status-change-handled":return(0,E.Z)(t.value.license)?(s.Z.info("DRM: No message given, skipping session.update"),We.E):function(e,t){return s.Z.info("DRM: Updating MediaKeySession with message"),(0,Qe.Z)(e.update(t)).pipe((0,Ke.K)((function(e){var t=e instanceof Error?e.toString():"`session.update` failed";throw new g.Z("KEY_UPDATE_ERROR",t)})),(0,$e.b)((function(){s.Z.info("DRM: MediaKeySession update succeeded.")})),(0,Xe.l)())}(e,t.value.license);default:return(0,je.of)(t)}},(0,He.m)(i)?(0,Me.z)(r,i,1):(0,Me.z)(r,1))),p=(0,Ge.T)(dt(e,t,n),f,l,a);return(0,E.Z)(e.closed)?p:p.pipe((0,qe.R)((0,Qe.Z)(e.closed)))}function dt(e,t,n){return(0,Ce.P)((function(){if(0===e.keyStatuses.size)return We.E;var r=at(e,t,n),i=r.warnings,a=r.blacklistedKeyIDs,o=r.whitelistedKeyIds,s=i.length>0?je.of.apply(void 0,i):We.E,u=(0,je.of)({type:"keys-update",value:{whitelistedKeyIds:o,blacklistedKeyIDs:a}});return(0,Ye.z)(s,u)}))}function ft(e){if(e instanceof Fe)return new g.Z("KEY_LOAD_TIMEOUT","The license server took too much time to respond.");var t=new g.Z("KEY_LOAD_ERROR","An error occured when calling `getLicense`.");return!(0,E.Z)(e)&&(0,le.Z)(e.message)&&(t.message=e.message),t}var pt=n(9822);function vt(e,t){return ht.apply(this,arguments)}function ht(){return(ht=(0,r.Z)(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.setServerCertificate(n);case 3:return r=e.sent,e.abrupt("return",r);case 7:throw e.prev=7,e.t0=e.catch(0),s.Z.warn("DRM: mediaKeys.setServerCertificate returned an error",e.t0),i=e.t0 instanceof Error?e.t0.toString():"`setServerCertificate` error",new g.Z("LICENSE_SERVER_CERTIFICATE_ERROR",i);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function mt(e,t){return gt.apply(this,arguments)}function gt(){return(gt=(0,r.Z)(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!0!==_e(t)){e.next=3;break}return s.Z.info("DRM: The MediaKeys already has a server certificate, skipping..."),e.abrupt("return",{type:"already-has-one"});case 3:if("function"==typeof t.setServerCertificate){e.next=6;break}return s.Z.warn("DRM: Could not set the server certificate. mediaKeys.setServerCertificate is not a function"),e.abrupt("return",{type:"method-not-implemented"});case 6:return s.Z.info("DRM: Setting server certificate on the MediaKeys"),ge(t),e.prev=8,e.next=11,vt(t,n);case 11:return r=e.sent,ye(t,n),e.abrupt("return",{type:"success",value:r});case 16:return e.prev=16,e.t0=e.catch(8),i=(0,pt.Z)(e.t0)?e.t0:new g.Z("LICENSE_SERVER_CERTIFICATE_ERROR","Unknown error when setting the server certificate."),e.abrupt("return",{type:"error",value:i});case 20:case"end":return e.stop()}}),e,null,[[8,16]])})))).apply(this,arguments)}function yt(e,t){if(!(isNaN(t)||t<0||t>=e.getLength())){var n=e.getLength(),r=n-t;s.Z.info("DRM: Too many stored persistent sessions, removing some.",n,r),e.deleteOldSessions(r)}}var _t=n(9252);var bt=function(){function e(e){this._innerValues=e,this._lazyFormattedValues=null}var t=e.prototype;return t.constructRequestData=function(){return c.zo.apply(void 0,this._innerValues.map((function(e){return e.data})))},t.isCompatibleWith=function(t){var n=t instanceof e?t.getFormattedValues():t;return de(this.getFormattedValues(),n)},t.getFormattedValues=function(){return null===this._lazyFormattedValues&&(this._lazyFormattedValues=this._innerValues.slice().sort((function(e,t){return e.systemId===t.systemId?0:void 0===e.systemId?1:void 0===t.systemId||e.systemId<t.systemId?-1:1})).map((function(e){var t=e.systemId,n=e.data;return{systemId:t,data:n,hash:(0,ue.Z)(n)}}))),this._lazyFormattedValues},e}();function Tt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Et(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Et(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 Et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var St,wt=h.Oh,kt=function(e){function t(t,n){var r;r=e.call(this)||this,s.Z.debug("DRM: Starting ContentDecryptor logic.");var i=new S.ZP;r._currentSessions=[],r._canceller=i,r._wasAttachCalled=!1,r._initDataQueue=[],r._stateData={state:St.Initializing,isMediaKeysAttached:!1,isInitDataQueueLocked:!0,data:null},r.error=null;var a=wt(t).subscribe((function(e){s.Z.debug("DRM: Encrypted event received from media element.");var t=v(e);null!==t&&r.onInitializationData(t)}));return i.signal.register((function(){a.unsubscribe()})),function(e,t,n){return Ae.apply(this,arguments)}(t,n,i.signal).then((function(e){var n,i,a=e.options,o=e.mediaKeySystemAccess;((0,E.Z)(a.licenseStorage)||!0===a.licenseStorage.disableRetroCompatibility)&&(i=o.keySystem,n=(0,_t.Z)(i,"com.microsoft.playready")||"com.chromecast.playready"===i||"com.youtube.playready"===i?"9a04f07998404286ab92e65be0885f95":"com.widevine.alpha"===i?"edef8ba979d64acea3c827dcd51d21ed":(0,_t.Z)(i,"com.apple.fps")?"94ce86fb07ff4f43adb893d2fa968ca2":(0,_t.Z)(i,"com.nagra.")?"adb41c242dbf4a6d958b4457c0d27b95":void 0),r.systemId=n,r._stateData.state===St.Initializing&&(r._stateData={state:St.WaitingForAttachment,isInitDataQueueLocked:!0,isMediaKeysAttached:!1,data:{mediaKeysInfo:e,mediaElement:t}},r.trigger("stateChange",r._stateData.state))})).catch((function(e){r._onFatalError(e)})),r}(0,i.Z)(t,e);var n=t.prototype;return n.getState=function(){return this._stateData.state},n.attach=function(){var e=this;if(this._stateData.state!==St.WaitingForAttachment)throw new Error("`attach` should only be called when in the WaitingForAttachment state");if(this._wasAttachCalled)s.Z.warn("DRM: ContentDecryptor's `attach` method called more than once.");else{this._wasAttachCalled=!0;var t=this._stateData.data,n=t.mediaElement,i=t.mediaKeysInfo,a=i.options,u=i.mediaKeys,l=i.mediaKeySystemAccess,c={loadedSessionsStore:i.stores.loadedSessionsStore,mediaKeySystemAccess:l,mediaKeys:u,keySystemOptions:a};!0===a.disableMediaKeysAttachmentLock&&(this._stateData={state:St.ReadyForContent,isInitDataQueueLocked:!0,isMediaKeysAttached:!1,data:null},this.trigger("stateChange",this._stateData.state),this._isStopped())||(s.Z.debug("DRM: Attaching current MediaKeys"),function(e,t,n){return x.apply(this,arguments)}(n,c,this._canceller.signal).then((0,r.Z)(o().mark((function t(){var n,r,s;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=a.serverCertificate,(0,E.Z)(n)){t.next=6;break}return t.next=4,mt(u,n);case 4:"error"===(r=t.sent).type&&e.trigger("warning",r.value);case 6:if(!e._isStopped()){t.next=8;break}return t.abrupt("return");case 8:s=e._stateData.state,e._stateData={state:St.ReadyForContent,isMediaKeysAttached:!0,isInitDataQueueLocked:!1,data:{mediaKeysData:i}},s!==St.ReadyForContent&&e.trigger("stateChange",St.ReadyForContent),e._isStopped()||e._processCurrentInitDataQueue();case 12:case"end":return t.stop()}}),t)})))).catch((function(t){e._onFatalError(t)})))}},n.dispose=function(){this.removeEventListener(),this._stateData={state:St.Disposed,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("stateChange",this._stateData.state)},n.onInitializationData=function(e){var t=this;if(!1===this._stateData.isInitDataQueueLocked){var n=this._stateData.data.mediaKeysData,r=Object.assign(Object.assign({},e),{values:new bt(e.values)});this._processInitializationData(r,n).catch((function(e){t._onFatalError(e)}))}else{if(this._isStopped())throw new Error("ContentDecryptor either disposed or stopped.");this._initDataQueue.push(e)}},n._processInitializationData=function(){var e=(0,r.Z)(o().mark((function e(t,n){var r,i,a,u,l,c,f,p,v,h,y,b,T,E,S,w,k,A,x,I,Z,R,M,C,P,N,O,L,B,U,F,z,V,K,G=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.mediaKeySystemAccess,i=n.stores,a=n.options,!this._tryToUseAlreadyCreatedSession(t,n)&&!this._isStopped()){e.next=3;break}return e.abrupt("return");case 3:if("content"!==a.singleLicensePer){e.next=15;break}if(void 0===(u=(0,_.Z)(this._currentSessions,(function(e){return"created-session"===e.source})))){e.next=13;break}if(void 0!==(l=t.keyIds)){e.next=10;break}return void 0===t.content?s.Z.warn("DRM: Unable to fallback from a non-decipherable quality."):It(t.content.manifest,t),e.abrupt("return");case 10:return u.record.associateKeyIds(l),void 0!==t.content&&("DEBUG"===s.Z.getLevel()&&(c=l.reduce((function(e,t){return e+", "+(0,d.ci)(t)}),""),s.Z.debug("DRM: Blacklisting new key ids",c)),xt(t.content.manifest,[],l)),e.abrupt("return");case 13:e.next=37;break;case 15:if("periods"!==a.singleLicensePer||void 0===t.content){e.next=37;break}f=t.content.period,p=this._currentSessions.filter((function(e){return"created-session"===e.source})),Mt(v=new Set,f),h=Tt(p);case 21:if((y=h()).done){e.next=37;break}b=y.value,T=Array.from(v),E=0,S=T;case 25:if(!(E<S.length)){e.next=35;break}if(w=S[E],!b.record.isAssociatedWithKeyId(w)){e.next=32;break}for(b.record.associateKeyIds(v.values()),k=Tt(T);!(A=k()).done;)$(x=A.value,b.keyStatuses.whitelisted)||$(x,b.keyStatuses.blacklisted)||b.keyStatuses.blacklisted.push(x);return xt(t.content.manifest,b.keyStatuses.whitelisted,b.keyStatuses.blacklisted),e.abrupt("return");case 32:E++,e.next=25;break;case 35:e.next=21;break;case 37:return this._lockInitDataQueue(),!0!==a.persistentLicense?I="temporary":At(r)?I="persistent-license":(s.Z.warn('DRM: Cannot create "persistent-license" session: not supported'),I="temporary"),Z=m.Z.getCurrent(),R=Z.EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS,M=Z.EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION,C="number"==typeof a.maxSessionCacheSize?a.maxSessionCacheSize:R,e.next=43,D(t,i,I,C,this._canceller.signal);case 43:if(P=e.sent,!this._isStopped()){e.next=46;break}return e.abrupt("return");case 46:if(N={record:P.value.keySessionRecord,source:P.type,keyStatuses:{whitelisted:[],blacklisted:[]},blacklistedSessionError:null},this._currentSessions.push(N),O=P.value,L=O.mediaKeySession,B=O.sessionType,U=!1,F=ct(L,a,r.keySystem).subscribe({next:function(e){switch(e.type){case"warning":return void G.trigger("warning",e.value)}var n;if(n="created-session"===N.source?Zt(t,a.singleLicensePer,e.value.whitelistedKeyIds,e.value.blacklistedKeyIDs):{whitelisted:e.value.whitelistedKeyIds,blacklisted:e.value.blacklistedKeyIDs},N.record.associateKeyIds(n.whitelisted),N.record.associateKeyIds(n.blacklisted),N.keyStatuses={whitelisted:n.whitelisted,blacklisted:n.blacklisted},0!==N.record.getAssociatedKeyIds().length&&"persistent-license"===B&&null!==i.persistentSessionsStore&&!U){var r=i.persistentSessionsStore;yt(r,M-1),r.add(t,N.record.getAssociatedKeyIds(),L),U=!0}void 0!==t.content&&xt(t.content.manifest,n.whitelisted,n.blacklisted),G._unlockInitDataQueue()},error:function(e){if(e instanceof lt){if(N.blacklistedSessionError=e,void 0!==t.content){var n=t.content.manifest;s.Z.info("DRM: blacklisting Representations based on protection data."),It(n,t)}G._unlockInitDataQueue()}else G._onFatalError(e)}}),this._canceller.signal.register((function(){F.unsubscribe()})),void 0!==a.singleLicensePer&&"init-data"!==a.singleLicensePer||this._unlockInitDataQueue(),"created-session"!==P.type){e.next=68;break}return z=t.values.constructRequestData(),e.prev=55,e.next=58,i.loadedSessionsStore.generateLicenseRequest(L,t.type,z);case 58:e.next=68;break;case 60:if(e.prev=60,e.t0=e.catch(55),null!==(V=i.loadedSessionsStore.getEntryForSession(L))&&"none"===V.closingStatus.type){e.next=67;break}return(K=this._currentSessions.indexOf(N))>=0&&this._currentSessions.splice(K,1),e.abrupt("return",Promise.resolve());case 67:throw new g.Z("KEY_GENERATE_REQUEST_ERROR",e.t0 instanceof Error?e.t0.toString():"Unknown error");case 68:return e.abrupt("return",Promise.resolve());case 69:case"end":return e.stop()}}),e,this,[[55,60]])})));return function(t,n){return e.apply(this,arguments)}}(),n._tryToUseAlreadyCreatedSession=function(e,t){var n=t.stores,r=t.options,i=(0,_.Z)(this._currentSessions,(function(t){return t.record.isCompatibleWith(e)}));if(void 0===i)return!1;var a=i.blacklistedSessionError;if(!(0,E.Z)(a))return void 0===e.type||void 0===e.content?(s.Z.error("DRM: This initialization data has already been blacklisted but the current content is not known."),!0):(s.Z.info("DRM: This initialization data has already been blacklisted. Blacklisting the related content."),It(e.content.manifest,e),!0);if(void 0!==e.keyIds){var o;if(void 0===r.singleLicensePer||"init-data"===r.singleLicensePer){var u=i.keyStatuses.blacklisted;o=function(e,t){for(var n,r=function(){var e=n.value;if(t.some((function(t){return Y(t,e)})))return{v:!0}},i=j(e);!(n=i()).done;){var a=r();if("object"==typeof a)return a.v}return!1}(e.keyIds,u)}else{var l=i.keyStatuses.whitelisted;o=!X(e.keyIds,l)}if(o)return void 0===e.content?(s.Z.error("DRM: Cannot forbid key id, the content is unknown."),!0):(s.Z.info("DRM: Current initialization data is linked to blacklisted keys. Marking Representations as not decipherable"),xt(e.content.manifest,[],e.keyIds),!0)}if(null!==n.loadedSessionsStore.reuse(e))return s.Z.debug("DRM: Init data already processed. Skipping it."),!0;var c=this._currentSessions.indexOf(i);return-1===c?s.Z.error("DRM: Unable to remove processed init data: not found."):(s.Z.debug("DRM: A session from a processed init data is not available anymore. Re-processing it."),this._currentSessions.splice(c,1)),!1},n._onFatalError=function(e){if(!this._canceller.isUsed){var t=e instanceof Error?e:new y.Z("NONE","Unknown encryption error");this.error=t,this._initDataQueue.length=0,this._stateData={state:St.Error,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("error",t),this._stateData.state===St.Error&&this.trigger("stateChange",this._stateData.state)}},n._isStopped=function(){return this._stateData.state===St.Disposed||this._stateData.state===St.Error},n._processCurrentInitDataQueue=function(){for(;!1===this._stateData.isInitDataQueueLocked;){var e=this._initDataQueue.shift();if(void 0===e)return;this.onInitializationData(e)}},n._lockInitDataQueue=function(){!1===this._stateData.isInitDataQueueLocked&&(this._stateData.isInitDataQueueLocked=!0)},n._unlockInitDataQueue=function(){!0===this._stateData.isMediaKeysAttached?(this._stateData.isInitDataQueueLocked=!1,this._processCurrentInitDataQueue()):s.Z.error("DRM: Trying to unlock in the wrong state")},t}(T.Z);function At(e){var t=e.getConfiguration().sessionTypes;return void 0!==t&&(0,b.Z)(t,"persistent-license")}function xt(e,t,n){e.updateRepresentationsDeciperability((function(e){if(void 0===e.contentProtections)return e.decipherable;for(var r=e.contentProtections.keyIds,i=0;i<r.length;i++){for(var a=r[i],o=0;o<n.length;o++)if(Y(n[o],a.keyId))return!1;for(var s=0;s<t.length;s++)if(Y(t[s],a.keyId))return!0}return e.decipherable}))}function It(e,t){e.updateRepresentationsDeciperability((function(e){var n,r;if(!1===e.decipherable)return!1;for(var i=null!==(r=null===(n=e.contentProtections)||void 0===n?void 0:n.initData)&&void 0!==r?r:[],a=function(e){if((void 0===t.type||i[e].type===t.type)&&t.values.getFormattedValues().every((function(t){return i[e].values.some((function(e){return(void 0===t.systemId||e.systemId===t.systemId)&&(0,l.Z)(e.data,t.data)}))})))return{v:!1}},o=0;o<i.length;o++){var s=a(o);if("object"==typeof s)return s.v}return e.decipherable}))}function Zt(e,t,n,r){var i,a=[].concat(n,r);if(void 0!==t&&"init-data"!==t){var o=e.keyIds,s=e.content;if(void 0!==o){var u=o.filter((function(e){return!a.some((function(t){return Y(t,e)}))}));u.length>0&&a.push.apply(a,u)}if(void 0!==s)if("content"===t){for(var l,c=new Set,d=Tt(s.manifest.periods);!(l=d()).done;){Mt(c,l.value)}Rt(c,a)}else if("periods"===t)for(var f,p=Tt(s.manifest.periods);!(f=p()).done;){var v=f.value,h=new Set;if(Mt(h,v),(null===(i=e.content)||void 0===i?void 0:i.period.id)===v.id)Rt(h,a);else for(var m=Array.from(h),g=function(){var e=_[y];if(a.some((function(t){return Y(t,e)})))return Rt(h,a),"break"},y=0,_=m;y<_.length;y++){if("break"===g())break}}}return{whitelisted:n,blacklisted:a.slice(n.length)}}function Rt(e,t){for(var n=Array.from(e.values()),r=function(){var e=a[i];t.some((function(t){return Y(t,e)}))||t.push(e)},i=0,a=n;i<a.length;i++)r()}function Mt(e,t){for(var n,r=Tt(t.getAdaptations());!(n=r()).done;)for(var i,a=Tt(n.value.representations);!(i=a()).done;){var o=i.value;if(void 0!==o.contentProtections&&o.contentProtections.keyIds.length>=-1)for(var s,u=Tt(o.contentProtections.keyIds);!(s=u()).done;){var l=s.value;e.add(l.keyId)}}}!function(e){e[e.Initializing=0]="Initializing",e[e.WaitingForAttachment=1]="WaitingForAttachment",e[e.ReadyForContent=2]="ReadyForContent",e[e.Error=3]="Error",e[e.Disposed=4]="Disposed"}(St||(St={}))},1266:function(e,t,n){"use strict";var r=n(7665);t.ZP=r.Z},770: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)}}},5039:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(4727),i=n(3666);var a=n(1669),o=n(2793),s=n(8343);function u(e,t,n,u){return e.pipe((0,o.Z)((function(e){return null!==e.rebuffering||null!==e.freezing||0===e.readyState?null:function(e,t){return!e||!i.SB||t}(u,t.hasAttribute("playsinline"))?e.readyState>=3&&null!==e.currentRange&&(!(0,a.Z)()||t.duration>0)?s.Z.loaded(n):null:t.duration>0?s.Z.loaded(n):null}),null),(0,r.q)(1))}},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},7920:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var r=n(4975),i=n(4727),a=n(9127),o=n(9878),s=n(2817),u=n(2006),l=n(8515),c=n(7877),d=n(6108),f=n(6362),p=n(9917),v=n(8117),h=n(5561);var m=n(3774),g=n(4804);var y=n(1669),_=n(3714),b=n(3887),T=n(5095),E=n(8343);function S(e){return e.pipe((0,r.h)((function(e){var t=e.seeking,n=e.rebuffering,r=e.readyState;return!t&&null===n&&r>=1})),(0,i.q)(1),(0,a.U)((function(){})))}function w(e){return function(e){return(0,p.P)((function(){return(0,h.Z)((function(){return(0,v.Z)(e.play())}),void 0)}))}(e).pipe((0,a.U)((function(){return"autoplay"})),(0,o.K)((function(e){if(e instanceof Error&&"NotAllowedError"===e.name)return b.Z.warn("Init: Media element can't play. It may be due to browser auto-play policies."),(0,s.of)("autoplay-blocked");throw e})))}function k(e){var t=e.mediaElement,n=e.playbackObserver,r=e.startTime,a=e.mustAutoPlay,o=(0,T.$)(!1),p=(0,T.$)(!1);return{seekAndPlay$:function(e){return e.readyState>=m.c.HAVE_METADATA?(0,s.of)(null):(0,g.K4)(e).pipe((0,i.q)(1))}(t).pipe((0,i.q)(1),(0,u.b)((function(){b.Z.info("Init: Set initial time",r);var e="function"==typeof r?r():r;n.setCurrentTime(e),o.setValue(!0),o.finish()})),(0,l.d)({refCount:!0})).pipe((0,c.z)((function(){if(!(0,y.Z)()||t.duration>0)return S(n.observe(!0));var e=new _.Z("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");return S(n.observe(!0)).pipe((0,d.O)(E.Z.warning(e)))})),(0,c.z)((function(e){return void 0!==e?(0,s.of)(e):(b.Z.info("Init: Can begin to play content"),a?w(t).pipe((0,c.z)((function(e){if(p.setValue(!0),p.finish(),"autoplay"===e)return(0,s.of)({type:"autoplay"});var t=new _.Z("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");return(0,f.z)((0,s.of)(E.Z.warning(t)),(0,s.of)({type:"autoplay-blocked"}))}))):(t.autoplay&&b.Z.warn("Init: autoplay is enabled on HTML media element. Media will play as soon as possible."),p.setValue(!0),p.finish(),(0,s.of)({type:"skipped"})))})),(0,l.d)({refCount:!0})),initialPlayPerformed:p,initialSeekPerformed:o}}},8969:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(1545),i=n(5583),a=n(533),o=n(4975),s=n(4727),u=n(7877),l=n(4978),c=n(2817),d=n(3071),f=n(1480),p=n(3887),v=n(5767);var h=n(8333),m=n(5039),g=n(7920),y=n(9607),_=n(467),b=n(2447),T=n(2983);function E(e){var t=e.autoPlay,n=e.keySystems,E=e.mediaElement,S=e.playbackObserver,w=e.speed,k=e.startAt,A=e.url;if((0,v.Z)(E),null==A)throw new Error("No URL for a DirectFile content");var x=function(e,t){return new f.y((function(n){return p.Z.info("Setting URL to HTMLMediaElement",t),e.src=t,n.next(void 0),function(){(0,v.Z)(e)}}))}(E,A);p.Z.debug("Init: Calculating initial time");var I=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 p.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}(E,k)};p.Z.debug("Init: Initial time calculated:",I);var Z=(0,g.Z)({mediaElement:E,playbackObserver:S,startTime:I,mustAutoPlay:t}).seekAndPlay$,R=(0,y.Z)(E,n,r.E,x).pipe((0,h.Z)(),(0,i.B)()),M=(0,b.Z)(E),C=S.observe(!0),P=(0,T.Z)(E,w,C).pipe((0,a.l)()),D=(0,_.Z)(S,null,r.E,r.E),N=R.pipe((0,o.h)((function(e){return"decryption-ready"===e.type||"decryption-disabled"===e.type})),(0,s.q)(1),(0,u.z)((function(){return Z})),(0,l.w)((function(e){return"warning"===e.type?(0,c.of)(e):(0,m.Z)(C,E,null,!0)})));return(0,d.T)(N,R.pipe((0,a.l)()),M,P,D)}},9607:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(3071),i=n(9127),a=n(1480),o=n(6139);var s=n(4804),u=n(5157),l=n(7874),c=n(3887),d=n(7665),f=s.Oh;function p(e,t,n,s){var p=(0,r.T)(f(e),n);if(null==l.Z.ContentDecryptor)return(0,r.T)(p.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but EME feature not activated"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","EME feature not activated.")}))),s.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));if(0===t.length)return(0,r.T)(p.pipe((0,i.U)((function(){throw c.Z.error("Init: Ciphered media and no keySystem passed"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Media is encrypted and no `keySystems` given")}))),s.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));if("function"!=typeof o.N)return(0,r.T)(p.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but no EME API available"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Encryption APIs not found.")}))),s.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));c.Z.debug("Init: Creating ContentDecryptor");var v=l.Z.ContentDecryptor;return new a.y((function(r){var i,a=new v(e,t);a.addEventListener("stateChange",(function(e){e===d.u.WaitingForAttachment&&(a.removeEventListener("stateChange"),i=s.subscribe((function(e){a.addEventListener("stateChange",(function(t){t===d.u.ReadyForContent&&(r.next({type:"decryption-ready",value:{drmSystemId:a.systemId,mediaSource:e}}),a.removeEventListener("stateChange"))})),a.attach()})))})),a.addEventListener("error",(function(e){r.error(e)})),a.addEventListener("warning",(function(e){r.next({type:"warning",value:e})}));var o=n.subscribe((function(e){a.onInitializationData(e)}));return function(){o.unsubscribe(),null==i||i.unsubscribe(),a.dispose()}}))}},467:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(3428),i=n(3074),a=n(2006),o=n(533),s=n(9127),u=n(3071),l=n(3666).yS,c=n(6872),d=n(3714),f=n(3887),p=n(2829),v=n(8567),h=1/60;function m(e,t,n,d){var m,_=d.pipe((0,r.M)(e.observe(!0)),(0,i.R)((function(e,t){return function(e,t,n){for(;e.length>0&&void 0!==e[0].period.end&&e[0].period.end+10<n.position;)e.shift();var r=t.period,i=t.bufferType;if("audio"!==i&&"video"!==i)return e;for(var a=0;a<e.length;a++)if(e[a].period.id===r.id){if(e[a].bufferType===i)return g(t)?e[a]=t:e.splice(a,1),e}else if(e[a].period.start>r.start)return g(t)&&e.splice(a,0,t),e;g(t)&&e.push(t);return e}(e,t[0],t[1])}),[])),b=null,T=null,E=n.pipe((0,r.M)(e.observe(!0)),(0,a.b)((function(t){var n,r=t[0],i=t[1];if(i.rebuffering&&!i.paused&&("audio"===r.bufferType||"video"===r.bufferType)){var a=i.position,o=null!==(n=i.rebuffering.position)&&void 0!==n?n:a,s=r.period.start;a<s&&Math.abs(o-s)<1&&(f.Z.warn("Init: rebuffering because of a future locked stream.\nTrying to unlock by seeking to the next Period"),e.setCurrentTime(s+.001))}})),(0,o.l)()),S=e.observe(!0).pipe((0,r.M)(_),(0,s.U)((function(n){var r=n[0],i=n[1],a=r.buffered,o=r.position,s=r.readyState,u=r.rebuffering,d=r.freezing,g=c.Z.getCurrent(),_=g.BUFFER_DISCONTINUITY_THRESHOLD,E=g.FORCE_DISCONTINUITY_SEEK_DELAY,S=g.FREEZING_STALLED_DELAY,w=g.UNFREEZING_SEEK_DELAY,k=g.UNFREEZING_DELTA_POSITION;if(null!==d){var A=performance.now();if(A-(null===m?d.timestamp:m.attemptTimestamp)>w&&(f.Z.warn("Init: trying to seek to un-freeze player"),e.setCurrentTime(e.getCurrentTime()+k),m={attemptTimestamp:A}),A-d.timestamp>S)return{type:"stalled",value:"freezing"}}else m=null;if(null===u)return 1===s?{type:"stalled",value:r.seeking?r.internalSeeking?"internal-seek":"seeking":"not-ready"}:{type:"unstalled",value:null};var x="seeking"===u.reason&&r.internalSeeking?"internal-seek":u.reason;if(r.seeking)b=r.position;else if(null!==b){var I=performance.now();if(null===T&&(T=I),l&&r.position<b&&I-T<E)return{type:"stalled",value:x};b=null}if(T=null,null===t)return{type:"stalled",value:x};var Z=u.position;if(null!==Z){var R=function(e,t,n){if(0===e.length)return null;for(var r=null,i=0;i<e.length;i++){var a=e[i].period;if(a.start>n)return r;var o=void 0;if(void 0===a.end||a.end>n){var s=e[i],u=s.discontinuity,l=s.position,c=u.start,d=u.end;if(n>=(null!=c?c:l)-h)if(null===d){var p=t.getPeriodAfter(a);null!==p?o=p.start+h:f.Z.warn("Init: discontinuity at Period's end but no next Period")}else n<d+h&&(o=d+h);void 0!==o&&(f.Z.info("Init: discontinuity found",n,o),r=null!==r&&r>o?r:o)}}return r}(i,t,Z);if(null!==R){var M=R+.001;if(!(M<=e.getCurrentTime()))return f.Z.warn("SA: skippable discontinuity found in the stream",o,M),e.setCurrentTime(M),v.Z.warning(y(Z,M));f.Z.info("Init: position to seek already reached, no seeking",e.getCurrentTime(),M)}}var C=null!=Z?Z:o,P=(0,p.XS)(a,C);if(P<_){var D=C+P+h;if(e.getCurrentTime()<D)return f.Z.warn("Init: discontinuity encountered inferior to the threshold",C,D,_),e.setCurrentTime(D),v.Z.warning(y(C,D))}for(var N=t.periods.length-2;N>=0;N--){var O=t.periods[N];if(void 0!==O.end&&O.end<=C){if(t.periods[N+1].start>C&&t.periods[N+1].start>e.getCurrentTime()){var L=t.periods[N+1];return e.setCurrentTime(L.start),v.Z.warning(y(C,L.start))}break}}return{type:"stalled",value:x}})));return(0,u.T)(E,S)}function g(e){return null!==e.discontinuity}function y(e,t){return new d.Z("DISCONTINUITY_ENCOUNTERED","A discontinuity has been encountered at position "+String(e)+", seeked at position "+String(t))}},2447:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2401),i=n(7877),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 d}});var r=n(9127),i=n(6108),a=n(3741),o=n(4978),s=n(9917),u=n(2817),l=n(2006),c=n(3887);function d(e,t,n){return n.pipe((0,r.U)((function(e){return null!==e.rebuffering})),(0,i.O)(!1),(0,a.x)()).pipe((0,o.w)((function(n){return n?(0,s.P)((function(){return c.Z.info("Init: Pause playback to build buffer"),e.playbackRate=0,(0,u.of)(0)})):t.asObservable().pipe((0,l.b)((function(t){c.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(4578),i=n(9917),a=n(2817),o=n(3887),s=n(9612),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,c=u.end,d=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/d,h=c/d,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,t._buffered),(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 D}});var r=n(4578),i=n(3071),a=n(6697),o=n(6108),s=n(4978),u=n(6362),l=n(9127),c=n(3505),d=n(2817),f=n(6716),p=n(9917),v=n(4804),h=n(1480),m=n(3741),g=n(3887),y=n(2203).Z?void 0:window.ResizeObserver;var _=n(6872),b=n(9612),T=n(4309),E=n(7874);function S(e,t){return Math.abs(e-t)<=.2}function w(e,t){for(var n=e.length-1;n>=0;n--){if(e[n].start<t)return e.slice(0,n+1)}return[]}function k(e,t){for(var n=0;n<e.length;n++){if(e[n].end>t)return e.slice(n,e.length)}return[]}function A(e,t,n){var r=Math.max(e.start,t),i=w(e.cues,t),a={start:e.start,end:r,cues:i},o=Math.min(n,e.end),s=k(e.cues,n);return[a,{start:o,end:e.end,cues:s}]}var x=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.end&&e>=i.start){for(var a=i.cues,o=0;o<a.length;o++)e>=a[o].start&&e<a[o].end&&n.push(a[o].element);return n}}return[]},t.remove=function(e,t){for(var n=Math.max(e,t),r=this._cuesBuffer,i=0;i<r.length;i++)if(r[i].end>e){var a=r[i];if(a.start>=n)return;if(a.end>=n){if(e<=a.start)a.cues=k(a.cues,n),a.start=n;else{var o=A(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=w(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=k(t.cues,i.end),t.start=i.end),r.splice(e,0,i))}for(var o=0;o<r.length;o++){var s=r[o];if(t<s.end){if(S(t,s.start)){if(S(n,s.end))return void(r[o]=i);if(n<s.end)return s.cues=k(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(t<s.start){if(n<s.start)return void r.splice(o,0,i);if(S(n,s.start))return s.start=n,void r.splice(o,0,i);if(S(n,s.end))return void r.splice(o,1,i);if(n<s.end)return s.cues=k(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(S(s.end,n))return s.cues=w(s.cues,t),s.end=t,void r.splice(o+1,0,i);if(s.end>n){var u=A(s,t,n),l=u[0],c=u[1];return this._cuesBuffer[o]=l,r.splice(o+1,0,i),void r.splice(o+2,0,c)}s.cues=w(s.cues,t),s.end=t;var d=o+1;for(s=r[d];void 0!==s&&n>s.end;)r.splice(d,1),s=r[d];return void a(d)}}r.push(i)},e}();function I(e,t,n,r){for(var i=[t/n.columns,e/n.rows],a=r.getElementsByClassName("proportional-style"),o=0;o<a.length;o++){var s=a[o];if(s instanceof HTMLElement){var u=s.getAttribute("data-proportional-font-size");null===u||isNaN(+u)||(s.style.fontSize=String(+u*i[1])+"px");var l=s.getAttribute("data-proportional-width");null===l||isNaN(+l)||(s.style.width=String(+l*i[0])+"px");var c=s.getAttribute("data-proportional-height");null===c||isNaN(+c)||(s.style.height=String(+c*i[1])+"px");var d=s.getAttribute("data-proportional-line-height");null===d||isNaN(+d)||(s.style.lineHeight=String(+d*i[1])+"px");var f=s.getAttribute("data-proportional-left");null===f||isNaN(+f)||(s.style.left=String(+f*i[0])+"px");var p=s.getAttribute("data-proportional-top");null===p||isNaN(+p)||(s.style.top=String(+p*i[1])+"px");var v=s.getAttribute("data-proportional-padding-top");null===v||isNaN(+v)||(s.style.paddingTop=String(+v*i[1])+"px");var h=s.getAttribute("data-proportional-padding-bottom");null===h||isNaN(+h)||(s.style.paddingBottom=String(+h*i[1])+"px");var m=s.getAttribute("data-proportional-padding-left");null===m||isNaN(+m)||(s.style.paddingLeft=String(+m*i[0])+"px");var g=s.getAttribute("data-proportional-padding-right");null===g||isNaN(+g)||(s.style.paddingRight=String(+g*i[0])+"px")}}return a.length>0}var Z=v.C1,R=v.ik,M=v.d5;function C(e,t){try{e.removeChild(t)}catch(e){g.Z.warn("HTSB: Can't remove text track: not in the element.")}}function P(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 D=function(e){function t(t,n){var r;return g.Z.debug("HTSB: Creating HTMLTextSegmentBuffer"),(r=e.call(this)||this).bufferType="text",r._buffered=new T.Z,r._videoElement=t,r._textTrackElement=n,r._clearSizeUpdates$=new f.x,r._destroy$=new f.x,r._buffer=new x,r._currentCues=[],function(e){var t=M(e),n=R(e),r=Z(e),f=_.Z.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,p=(0,i.T)(n,r),v=(0,a.F)(f).pipe((0,o.O)(null));return p.pipe((0,o.O)(null),(0,s.w)((function(){return(0,u.z)(v.pipe((0,l.U)((function(){return!0})),(0,c.R)(t)),(0,d.of)(!1))})))}(r._videoElement).pipe((0,c.R)(r._destroy$)).subscribe((function(e){if(e){var t=_.Z.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,n=Math.max(r._videoElement.currentTime+t/1e3/2,0),i=r._buffer.get(n);0===i.length?r._disableCurrentCues():r._displayCues(i)}else r._disableCurrentCues()})),r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,p.P)((function(){return t.pushChunkSync(e),(0,d.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,p.P)((function(){return n.removeBufferSync(e,t),(0,d.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,p.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,d.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){g.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;g.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,c=o.end,d=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){g.Z.debug("HTSB: Finding parser for html text tracks:",e);var i=E.Z.htmlTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");g.Z.debug("HTSB: Parser found, parsing...");var a=i(t,n,r);return g.Z.debug("HTTB: Parsed successfully!",a),a}(f,d,i,p);if(0!==v&&h!==1/0){for(var y=0;y<m.length&&m[y].end<=v;)y++;for(m.splice(0,y),y=0;y<m.length&&m[y].start<v;)m[y].start=v,y++;for(y=m.length-1;y>=0&&m[y].start>=h;)y--;for(m.splice(y,m.length),y=m.length-1;y>=0&&m[y].end>h;)m[y].end=h,y--}if(void 0!==l)s=Math.max(v,l);else{if(m.length<=0)return void g.Z.warn("HTSB: Current text tracks have no cues nor start time. Aborting");g.Z.warn("HTSB: No start time given. Guessing from cues."),s=m[0].start}if(void 0!==c)u=Math.min(h,c);else{if(m.length<=0)return void g.Z.warn("HTSB: Current text tracks have no cues nor end time. Aborting");g.Z.warn("HTSB: No end time given. Guessing from cues."),u=m[m.length-1].end}u<=s?g.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){g.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;e<this._currentCues.length;e++)C(this._textTrackElement,this._currentCues[e].element);this._currentCues=[]}},n._displayCues=function(e){if(!(this._currentCues.length===e.length&&this._currentCues.every((function(t,n){return t.element===e[n]})))){this._clearSizeUpdates$.next();for(var t=0;t<this._currentCues.length;t++)C(this._textTrackElement,this._currentCues[t].element);this._currentCues=[];for(var n=0;n<e.length;n++){var r=e[n],i=P(r);this._currentCues.push({element:r,resolution:i}),this._textTrackElement.appendChild(r)}var s=this._currentCues.filter((function(e){return null!==e.resolution}));if(s.length>0){var u=_.Z.getCurrent().TEXT_TRACK_SIZE_CHECKS_INTERVAL;(function(e,t){return(0,p.P)((function(){if(void 0!==y){var n=-1,r=-1;return new h.y((function(t){var i=new y((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 g.Z.error("Compat: Resized but no observed element.")}));return i.observe(e),function(){i.disconnect()}}))}return(0,a.F)(t).pipe((0,o.O)(null),(0,l.U)((function(){var t=e.getBoundingClientRect();return{height:t.height,width:t.width}})),(0,m.x)((function(e,t){return e.height===t.height&&e.width===t.width})))}))})(this._textTrackElement,u).pipe((0,c.R)(this._clearSizeUpdates$),(0,c.R)(this._destroy$)).subscribe((function(e){for(var t=e.height,n=e.width,r=0;r<s.length;r++){var i=s[r];I(t,n,i.resolution,i.element)}}))}}},t}(b.C)},9059:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(4578),i=n(9917),a=n(2817),o=n(3666);var s=n(3887);function u(e,t){if(o.vU&&function(e,t){var n=e.activeCues;if(null===n)return!1;for(var r=0;r<n.length;r++)if(n[r]===t)return!0;return!1}(e,t)){var n=e.mode;e.mode="hidden";try{e.removeCue(t)}catch(e){s.Z.warn("Compat: Could not remove cue from text track.")}e.mode=n}else try{e.removeCue(t)}catch(e){s.Z.warn("Compat: Could not remove cue from text track.")}}var l=n(9612),c=n(4309),d=n(7874);var f=function(e){function t(t,n){var r;s.Z.debug("NTSB: Creating NativeTextSegmentBuffer"),r=e.call(this)||this;var i=function(e,t){var n,r,i,a,s="subtitles";if(o.YM){var u=e.textTracks.length;(i=u>0?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 c.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,c=u.appendWindow,f=u.chunk,p=f.start,v=f.end,h=f.data,m=f.type,g=f.language,y=null!==(n=c[0])&&void 0!==n?n:0,_=null!==(r=c[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=d.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<b.length&&b[T].endTime<=y;)T++;for(b.splice(0,T),T=0;T<b.length&&b[T].startTime<y;)b[T].startTime=y,T++;for(T=b.length-1;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],S=t._track.cues;null!==S&&S.length>0&&E.startTime<S[S.length-1].startTime&&t._removeData(E.startTime,1/0);for(var w=0;w<b.length;w++)t._track.addCue(b[w])}return t._buffered.insert(i,o),null!==e.inventoryInfos&&t._segmentInventory.insertChunk(e.inventoryInfos),(0,a.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,i.P)((function(){return n._removeData(e,t),(0,a.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,i.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,a.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){s.Z.debug("NTSB: Aborting NativeTextSegmentBuffer"),this._removeData(0,1/0);var e=this._trackElement,t=this._videoElement;if(void 0!==e&&t.hasChildNodes())try{t.removeChild(e)}catch(e){s.Z.warn("NTSB: Can't remove track element from the video")}this._track.mode="disabled",void 0!==this._trackElement&&(this._trackElement.innerHTML="")},n._removeData=function(e,t){s.Z.debug("NTSB: Removing native text track data",e,t);var n=this._track,r=n.cues;if(null!==r)for(var i=r.length-1;i>=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)},9612:function(e,t,n){"use strict";n.d(t,{C:function(){return y},f:function(){return m}});var r=n(6872),i=n(3887),a=n(520),o=n(5278);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var l=function(){function e(e,t){this._history=[],this._lifetime=e,this._maxHistoryLength=t}var t=e.prototype;return t.addBufferedSegment=function(e,t,n){var r=performance.now();this._history.push({date:r,bufferedStart:t,bufferedEnd:n,context:e}),this._cleanHistory(r)},t.getHistoryFor=function(e){return this._history.filter((function(t){return(0,a.z)(t.context,e)}))},t._cleanHistory=function(e){for(var t,n=e-this._lifetime,r=0,i=s(this._history);!(t=i()).done;){if(!(t.value.date<n))break;r++}if(r>0&&(this._history=this._history.splice(r)),this._history.length>this._maxHistoryLength){var a=this._history.length-this._maxHistoryLength;this._history=this._history.splice(a)}},e}();function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e){if(void 0===e.bufferedStart||e.partiallyPushed)return!1;var t=e.start,n=e.end-t,i=r.Z.getCurrent(),a=i.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,o=i.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE;return Math.abs(t-e.bufferedStart)<=a&&(void 0===e.bufferedEnd||e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-n)<=Math.min(o,n/3))}function p(e){if(void 0===e.bufferedEnd||e.partiallyPushed)return!1;var t=e.start,n=e.end,i=n-t,a=r.Z.getCurrent(),o=a.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,s=a.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE;return Math.abs(n-e.bufferedEnd)<=o&&null!=e.bufferedStart&&e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-i)<=Math.min(s,i/3)}function v(e,t,n,a){var o=r.Z.getCurrent().MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE;void 0!==e.bufferedStart?(e.bufferedStart<t&&(i.Z.debug("SI: Segment partially GCed at the start",a,e.bufferedStart,t),e.bufferedStart=t),!e.precizeStart&&f(e)&&(e.start=e.bufferedStart,e.precizeStart=!0)):e.precizeStart?(i.Z.debug("SI: buffered start is precize start",a,e.start),e.bufferedStart=e.start):null!==n&&n.end>t&&(n.precizeEnd||e.start-n.end<=o)?(i.Z.debug("SI: buffered start is end of previous segment",a,t,e.start,n.end),e.bufferedStart=n.end,f(e)&&(e.start=n.end,e.precizeStart=!0)):e.start-t<=o?(i.Z.debug("SI: found true buffered start",a,t,e.start),e.bufferedStart=t,f(e)&&(e.start=t,e.precizeStart=!0)):t<e.start?i.Z.debug("SI: range start too far from expected start",a,t,e.start):(i.Z.debug("SI: Segment appears immediately garbage collected at the start",a,e.bufferedStart,t),e.bufferedStart=t)}function h(e,t,n){var a=r.Z.getCurrent().MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE;void 0!==e.bufferedEnd?(e.bufferedEnd>t&&(i.Z.debug("SI: Segment partially GCed at the end",n,e.bufferedEnd,t),e.bufferedEnd=t),!e.precizeEnd&&t-e.end<=a&&p(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<=a?(i.Z.debug("SI: found true buffered end",n,t,e.end),e.bufferedEnd=t,p(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 m,g=function(){function e(){var e=r.Z.getCurrent(),t=e.BUFFERED_HISTORY_RETENTION_TIME,n=e.BUFFERED_HISTORY_MAXIMUM_ENTRIES;this._inventory=[],this._bufferedHistory=new l(t,n)}var t=e.prototype;return t.reset=function(){this._inventory.length=0},t.synchronizeBuffered=function(e){for(var t=this._inventory,n=0,a=t[0],s=r.Z.getCurrent().MINIMUM_SEGMENT_SIZE,u=null==a?void 0:a.infos.adaptation.type,l=e.length,c=0;c<l;c++){if(void 0===a)return;var d=e.start(c),f=e.end(c);if(f-d<s)i.Z.warn("SI: skipped TimeRange when synchronizing because it was too small",u,d,f);else{for(var p=n;void 0!==a&&(0,o.Z)(a.bufferedEnd,a.end)-d<s;)a=t[++n];var m=null,g=n-p;if(g>0){var y=t[p+g-1];m={end:(0,o.Z)(y.bufferedEnd,y.end),precizeEnd:y.precizeEnd},i.Z.debug("SI: "+g+" segments GCed.",u),t.splice(p,g),n=p}if(void 0===a)return;if(f-(0,o.Z)(a.bufferedStart,a.start)>=s){if(v(a,d,m,u),n===t.length-1)return void h(a,f,u);a=t[++n];for(var _=(0,o.Z)(a.bufferedStart,a.start),b=(0,o.Z)(a.bufferedEnd,a.end),T=c<l-1?e.start(c+1):void 0;void 0!==a&&f-_>=s&&(void 0===T||f-_>=b-T);){var E=t[n-1];void 0===E.bufferedEnd&&(E.bufferedEnd=a.precizeStart?a.start:E.end,i.Z.debug("SI: calculating buffered end of contiguous segment",u,E.bufferedEnd,E.end)),a.bufferedStart=E.bufferedEnd,void 0!==(a=t[++n])&&(_=(0,o.Z)(a.bufferedStart,a.start),b=(0,o.Z)(a.bufferedEnd,a.end))}}var S=t[n-1];void 0!==S&&h(S,f,u)}}null!=a&&(i.Z.debug("SI: last segments have been GCed",u,n,t.length),t.splice(n,t.length-n)),void 0!==u&&"DEBUG"===i.Z.getLevel()&&i.Z.debug("SI: current "+u+" 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<e.length;u++){var l=e[u];if(void 0!==l.bufferedStart&&void 0!==l.bufferedEnd){var c,d=l.infos.period.id,f=l.infos.representation.id,p=n[d],v=void 0;if(void 0===p)v=o(l.infos),n[d]=((c={})[f]=v,c);else void 0===p[f]?(v=o(l.infos),p[f]=v):v=p[f];null===i?s+=l.bufferedStart.toFixed(2)+"|"+v+"|":a===v?i.bufferedEnd+t<l.bufferedStart&&(s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+v+"|"):s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+v+"|",i=l,a=v}}null!==i&&(s+=String(i.end.toFixed(2)));return r.forEach((function(e){var t;s+="\n["+e.letter+"] P: "+e.periodId+" || R: "+e.representationId+"("+(null!==(t=e.bitrate)&&void 0!==t?t:"unknown bitrate")+")"})),s}(this._inventory))},t.insertChunk=function(e){var t=e.period,n=e.adaptation,r=e.representation,a=e.segment,o=e.chunkSize,s=e.start,u=e.end;if(!a.isInit){var l=n.type;if(s>=u)i.Z.warn("SI: Invalid chunked inserted: starts before it ends",l,s,u);else{for(var c=this._inventory,d={partiallyPushed:!0,chunkSize:o,splitted:!1,start:s,end:u,precizeStart:!1,precizeEnd:!1,bufferedStart:void 0,bufferedEnd:void 0,infos:{segment:a,period:t,adaptation:n,representation:r}},f=c.length-1;f>=0;f--){var p=c[f];if(p.start<=s){if(p.end<=s){for(i.Z.debug("SI: Pushing segment strictly after previous one.",l,s,p.end),this._inventory.splice(f+1,0,d),f+=2;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}if(p.start===s){if(p.end<=u){for(i.Z.debug("SI: Segment pushed replace another one",l,s,u,p.end),this._inventory.splice(f,1,d),f+=1;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}return i.Z.debug("SI: Segment pushed ends before another with the same start",l,s,u,p.end),c.splice(f,0,d),p.start=d.end,p.bufferedStart=void 0,void(p.precizeStart=p.precizeStart&&d.precizeEnd)}if(p.end<=d.end){for(i.Z.debug("SI: Segment pushed updates end of previous one",l,s,u,p.start,p.end),this._inventory.splice(f+1,0,d),p.end=d.start,p.bufferedEnd=void 0,p.precizeEnd=p.precizeEnd&&d.precizeStart,f+=2;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}i.Z.warn("SI: Segment pushed is contained in a previous one",l,s,u,p.start,p.end);var v={partiallyPushed:p.partiallyPushed,chunkSize:p.chunkSize,splitted:!0,start:d.end,end:p.end,precizeStart:p.precizeStart&&p.precizeEnd&&d.precizeEnd,precizeEnd:p.precizeEnd,bufferedStart:void 0,bufferedEnd:p.end,infos:p.infos};return p.end=d.start,p.splitted=!0,p.bufferedEnd=void 0,p.precizeEnd=p.precizeEnd&&d.precizeStart,c.splice(f+1,0,d),void c.splice(f+2,0,v)}}var h=this._inventory[0];if(void 0===h)return i.Z.debug("SI: first segment pushed",l,s,u),void this._inventory.push(d);if(!(h.start>=u)){if(h.end<=u){for(i.Z.debug("SI: Segment pushed starts before and completely recovers the previous first one",l,s,u,h.start,h.end),this._inventory.splice(0,1,d);c.length>1&&c[1].start<d.end;){if(c[1].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[1].start),c[1].start=d.end,c[1].bufferedStart=void 0,void(c[1].precizeStart=d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[1].start,c[1].end),c.splice(1,1)}return}return i.Z.debug("SI: Segment pushed start of the next one",l,s,u,h.start,h.end),h.start=u,h.bufferedStart=void 0,h.precizeStart=d.precizeEnd,void this._inventory.splice(0,0,d)}i.Z.debug("SI: Segment pushed comes before all previous ones",l,s,u,h.start),this._inventory.splice(0,0,d)}}},t.completeSegment=function(e,t){if(!e.segment.isInit){for(var n=this._inventory,r=[],o=0;o<n.length;o++)if((0,a.z)(n[o].infos,e)){var s=!1;r.length>0&&(s=!0,1===r.length&&(i.Z.warn("SI: Completed Segment is splitted.",e),r[0].splitted=!0));var u=o,l=n[o].chunkSize;for(o+=1;o<n.length&&(0,a.z)(n[o].infos,e);){var d=n[o].chunkSize;void 0!==l&&void 0!==d&&(l+=d),o++}var f=o-1,p=f-u,v=n[f].end,h=n[f].bufferedEnd;p>0&&(this._inventory.splice(u+1,p),o-=p),this._inventory[u].partiallyPushed=!1,this._inventory[u].chunkSize=l,this._inventory[u].end=v,this._inventory[u].bufferedEnd=h,this._inventory[u].splitted=s,r.push(this._inventory[u])}if(0===r.length)i.Z.warn("SI: Completed Segment not found",e);else{this.synchronizeBuffered(t);for(var m,g=c(r);!(m=g()).done;){var y=m.value;void 0!==y.bufferedStart&&void 0!==y.bufferedEnd?this._bufferedHistory.addBufferedSegment(y.infos,y.bufferedStart,y.bufferedEnd):i.Z.debug("SI: buffered range not known after sync. Skipping history.",y)}}}},t.getInventory=function(){return this._inventory},t.getHistoryFor=function(e){return this._bufferedHistory.getHistoryFor(e)},e}(),y=function(){function e(){this._segmentInventory=new g}var t=e.prototype;return t.synchronizeInventory=function(){this._segmentInventory.synchronizeBuffered(this.getBufferedRanges())},t.getInventory=function(){return this._segmentInventory.getInventory()},t.getPendingOperations=function(){return[]},t.getSegmentHistory=function(e){return this._segmentInventory.getHistoryFor(e)},e}();!function(e){e[e.Push=0]="Push",e[e.Remove=1]="Remove",e[e.EndOfSegment=2]="EndOfSegment"}(m||(m={}))},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}()},8567:function(e,t,n){"use strict";var r=n(8026),i={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){return{type:"needs-media-source-reload",value:{position:e,autoPlay:t}}},lockedStream:function(e,t){return{type:"locked-stream",value:{bufferType:e,period:t}}},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,t){return{type:"encryption-data-encountered",value:(0,r.Z)({content:t},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}},waitingMediaSourceReload:function(e,t,n,r){return{type:"waiting-media-source-reload",value:{bufferType:e,period:t,position:n,autoPlay:r}}}};t.Z=i},7839:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7326),i=n(4578),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(2146).Z)(Error))},5157:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),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,{SM:function(){return a},ZB:function(){return r},br:function(){return i}});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}})},8750:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(9822),i=n(5389);function a(e,t){var n=t.defaultCode,a=t.defaultReason;if((0,r.Z)(e))return e;var o=e instanceof Error?e.toString():a;return new i.Z(n,o)}},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(7326),i=n(4578),a=n(2146),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(7326),i=n(4578),a=n(2146),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(7326),i=n(4578),a=n(2146),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(7326),i=n(4578),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,void 0!==o&&(s.xhr=o),s.status=i,s.type=a,s.message=a,s}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error))},7273:function(e,t){"use strict";t.Z={dashParsers:{wasm:null,js:null},directfile:null,ContentDecryptor: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 d},Z:function(){return f}});var r=n(3274),i=n(1946),a=n(7829);var o="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}))},s=n(3774);var u=n(3887),l=n(4791),c=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!=s.J&&("function"!=typeof s.J.isTypeSupported||s.J.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;i<n.length;i++)for(var a=!1,o=n[i],s=0;s<o.values.length;s++)if(o.values[s].systemId.toLowerCase()===e.toLowerCase())if(a)r[r.length-1].values.push(o.values[s]);else{var u=null===(t=this.contentProtections)||void 0===t?void 0:t.keyIds.map((function(e){return e.keyId}));r.push({type:o.type,keyIds:u,values:[o.values[s]]}),a=!0}return r},t.getAllEncryptionData=function(){var e;if(void 0===this.contentProtections||0===this.contentProtections.initData.length)return[];var t=null===(e=this.contentProtections)||void 0===e?void 0:e.keyIds.map((function(e){return e.keyId}));return this.contentProtections.initData.map((function(e){return{type:e.type,keyIds:t,values:e.values}}))},t._addProtectionData=function(e,t){var n=!1;if(void 0===this.contentProtections)return this.contentProtections={keyIds:[],initData:[{type:e,values:t}]},!0;for(var r=this.contentProtections.initData,i=0;i<r.length;i++)if(r[i].type===e){for(var a=r[i].values,o=0;o<t.length;o++){var s=t[o],c=void 0;for(c=0;c<a.length;c++)if(s.systemId===a[c].systemId){if((0,l.Z)(s.data,a[c].data))break;u.Z.warn("Manifest: different init data for the same system ID")}c===a.length&&(a.push(s),n=!0)}return n}return this.contentProtections.initData.push({type:e,values:t}),!0},e}(),d=["audio","video","text","image"],f=function(){function e(t,n){void 0===n&&(n={});var r=t.trickModeTracks,o=n,s=o.representationFilter,u=o.isManuallyAdded;this.id=t.id,this.type=t.type,void 0!==t.isTrickModeTrack&&(this.isTrickModeTrack=t.isTrickModeTrack),void 0!==t.language&&(this.language=t.language,this.normalizedLanguage=(0,a.ZP)(t.language)),void 0!==t.closedCaption&&(this.isClosedCaption=t.closedCaption),void 0!==t.audioDescription&&(this.isAudioDescription=t.audioDescription),void 0!==t.isDub&&(this.isDub=t.isDub),void 0!==t.isSignInterpreted&&(this.isSignInterpreted=t.isSignInterpreted),void 0!==r&&r.length>0&&(this.trickModeTracks=r.map((function(t){return new e(t)})));for(var l=t.representations,d=[],f=!1,p=0;p<l.length;p++){var v=new c(l[p],{type:this.type});((0,i.Z)(s)||s(v,{bufferType:this.type,language:this.language,normalizedLanguage:this.normalizedLanguage,isClosedCaption:this.isClosedCaption,isDub:this.isDub,isAudioDescription:this.isAudioDescription,isSignInterpreted:this.isSignInterpreted}))&&(d.push(v),!f&&v.isSupported&&(f=!0))}d.sort((function(e,t){return e.bitrate-t.bitrate})),this.representations=d,this.isSupported=f,this.manuallyAdded=!0===u}var t=e.prototype;return t.getAvailableBitrates=function(){for(var e=[],t=0;t<this.representations.length;t++){var n=this.representations[t];!1!==n.decipherable&&e.push(n.bitrate)}return o(e)},t.getPlayableRepresentations=function(){return this.representations.filter((function(e){return e.isSupported&&!1!==e.decipherable}))},t.getRepresentation=function(e){return(0,r.Z)(this.representations,(function(t){var n=t.id;return e===n}))},e}()},1989:function(e,t,n){"use strict";n.d(t,{ZP:function(){return T}});var r,i=n(4578),a=n(3714),o=n(3274),s=n(1959),u=n(908),l=n(8806),c=n(8999),d=n(1679),f=function(){function e(e,t){var n=this;if(this.contentWarnings=[],this.id=e.id,this.adaptations=Object.keys(e.adaptations).reduce((function(r,i){var o=e.adaptations[i];if(null==o)return r;var s=o.map((function(e){var r=new c.Z(e,{representationFilter:t});if(r.representations.length>0&&!r.isSupported){var i=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");n.contentWarnings.push(i)}return r})).filter((function(e){return e.representations.length>0}));if(s.every((function(e){return!e.isSupported}))&&o.length>0&&("video"===i||"audio"===i))throw new a.Z("MANIFEST_PARSE_ERROR","No supported "+i+" adaptations");return s.length>0&&(r[i]=s),r}),{}),!Array.isArray(this.adaptations.video)&&!Array.isArray(this.adaptations.audio))throw new a.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,d.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}(),p=n(3887),v=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,complete:!0,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(){p.Z.warn("Tried to replace a static RepresentationIndex")},t._update=function(){p.Z.warn("Tried to update a static RepresentationIndex")},e}();!function(e){e[e.Full=0]="Full",e[e.Partial=1]="Partial"}(r||(r={}));var h=n(5138);function m(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)p.Z.warn('Manifest: Adaptation "'+i[e].id+'" not found when merging.');else for(var u=i[e].representations,l=s.representations,c=function(e){var t=u[e],i=(0,o.Z)(l,(function(e){return e.id===t.id}));void 0===i?p.Z.warn('Manifest: Representation "'+u[e].id+'" not found when merging.'):n===r.Full?t.index._replace(i.index):t.index._update(i.index)},d=0;d<u.length;d++)c(d)},u=0;u<i.length;u++)s(u)}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _=(0,u.Z)(),b=(0,u.Z)();var T=function(e){function t(t,n){var r,i;r=e.call(this)||this;var a=n.supplementaryTextTracks,o=void 0===a?[]:a,s=n.supplementaryImageTracks,u=void 0===s?[]:s,l=n.representationFilter,c=n.manifestUpdateUrl;return r.contentWarnings=[],r.id=b(),r.expired=null!==(i=t.expired)&&void 0!==i?i:null,r.transport=t.transportType,r.clockOffset=t.clockOffset,r.periods=t.periods.map((function(e){var t,n=new f(e,l);return(t=r.contentWarnings).push.apply(t,n.contentWarnings),n})).sort((function(e,t){return e.start-t.start})),r.adaptations=void 0===r.periods[0]?{}:r.periods[0].adaptations,r._timeBounds=t.timeBounds,r.isDynamic=t.isDynamic,r.isLive=t.isLive,r.isLastPeriodKnown=t.isLastPeriodKnown,r.uris=void 0===t.uris?[]:t.uris,r.updateUrl=c,r.lifetime=t.lifetime,r.suggestedPresentationDelay=t.suggestedPresentationDelay,r.availabilityStartTime=t.availabilityStartTime,r.publishTime=t.publishTime,u.length>0&&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||t<e.end}));return void 0===n?null:n},n.getUrl=function(){return this.uris[0]},n.replace=function(e){this._performUpdate(e,r.Full)},n.update=function(e){this._performUpdate(e,r.Partial)},n.getMinimumPosition=function(){var e,t,n=this._timeBounds;if(null===n.timeshiftDepth)return null!==(e=n.absoluteMinimumTime)&&void 0!==e?e:0;var r,i=n.maximumTimeData;if(n.maximumTimeData.isLinear){var a=performance.now()-i.time;r=i.value+a/1e3}else r=i.value;var o=r-n.timeshiftDepth;return Math.max(null!==(t=n.absoluteMinimumTime)&&void 0!==t?t:0,o)},n.getMaximumPosition=function(){var e=this._timeBounds.maximumTimeData;if(!e.isLinear)return e.value;var t=performance.now()-e.time;return e.value+t/1e3},n.updateRepresentationsDeciperability=function(e){var t=function(e,t){for(var n,r=[],i=g(e.periods);!(n=i()).done;)for(var a,o=n.value,s=g(o.getAdaptations());!(a=s()).done;)for(var u,l=a.value,c=g(l.representations);!(u=c()).done;){var d=u.value,f=t(d);f!==d.decipherable&&(r.push({manifest:e,period:o,adaptation:l,representation:d}),d.decipherable=f)}return r}(this,e);t.length>0&&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=e.mimeType,r=e.url,i="gen-image-ada-"+_(),o="gen-image-rep-"+_(),s=new c.Z({id:i,type:"image",representations:[{bitrate:0,id:o,mimeType:n,index:new v({media:r})}]},{isManuallyAdded:!0});if(s.representations.length>0&&!s.isSupported){var u=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(u)}return 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,o=n.url,s=n.language,u=n.languages,l=n.closedCaption,d=null!=s?[s]:null!=u?u:[];return e.concat(d.map((function(e){var n="gen-text-ada-"+_(),s="gen-text-rep-"+_(),u=new c.Z({id:n,type:"text",language:e,closedCaption:l,representations:[{bitrate:0,id:s,mimeType:r,codecs:i,index:new v({media:o})}]},{isManuallyAdded:!0});if(u.representations.length>0&&!u.isSupported){var d=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(d)}return u})))}),[]);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.contentWarnings=e.contentWarnings,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;i<t.length;i++){for(var a=t[i],o=n,s=e[o];null!=s&&s.id!==a.id;)s=e[++o];if(null!=s){m(s,a,r.Full);var u=t.slice(n,i),l=o-n;e.splice.apply(e,[n,l].concat(u)),n=i+1}}if(n>e.length)p.Z.error("Manifest: error when updating Periods");else{n<e.length&&e.splice(n,e.length-n);var c=t.slice(n,t.length);c.length>0&&e.push.apply(e,c)}}(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.start<t[0].start){if(n.end!==t[0].start)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");e.push.apply(e,t)}else{var i=(0,h.Z)(e,(function(e){return e.id===t[0].id}));if(i<0)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: incoherent data");m(e[i],t[0],r.Partial);for(var o=i+1,s=1;s<t.length;s++){for(var u=t[s],l=-1,c=o;c<e.length;c++)if(u.id===e[c].id){l=c;break}if(l<0)return void e.splice.apply(e,[o,e.length-o].concat(t.slice(s,t.length)));l>o&&(e.splice(o,l-o),l=o),m(e[l],u,r.Full),o++}o<e.length&&e.splice(o,e.length-o)}}}else e.splice.apply(e,[0,0].concat(t))}(this.periods,e.periods);for(var n=this.getMinimumPosition();this.periods.length>0;){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)},520:function(e,t,n){"use strict";n.d(t,{K:function(){return a},z:function(){return i}});var r=n(1946);function i(e,t){return e.segment.id===t.segment.id&&e.representation.id===t.representation.id&&e.adaptation.id===t.adaptation.id&&e.period.id===t.period.id}function a(e){if((0,r.Z)(e))return"";var t=e.period,n=e.adaptation,i=e.representation,a=e.segment;return n.type+" P: "+t.id+" A: "+n.id+" R: "+i.id+" S: "+(a.isInit?"init":a.complete?a.time+"-"+a.duration:""+a.time)}},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,{Qy:function(){return l},Xj:function(){return d},iz:function(){return u},lp:function(){return s},nR:function(){return c},t_:function(){return o}});var r=n(3887),i=n(811),a=n(6968);function o(e,t){var n=l(e,t);return null!==n?e.subarray(n[1],n[2]):null}function s(e,t){for(var n=[],r=e;;){var a=l(r,t);if(null===a)return n;(0,i.Z)(0!==a[2]&&0!==r.length),n.push(r.subarray(a[1],a[2])),r=r.subarray(a[2])}}function u(e,t){var n=l(e,t);return null!==n?e.subarray(n[0],n[2]):null}function l(e,t){for(var n,r,i=e.length,o=0,s=0;o+8<=i;){if(r=o,s=(0,a.pX)(e,r),r+=4,n=(0,a.pX)(e,r),r+=4,0===s)s=i-o;else if(1===s){if(r+8>i)return null;s=(0,a.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 c(e,t,n,r,i){for(var o,s=e.length,u=0;u<s;u+=o){var l=u;o=(0,a.pX)(e,l),l+=4;var c=(0,a.pX)(e,l);if(l+=4,0===o)o=s-u;else if(1===o){if(l+8>s)return;o=(0,a.pV)(e,l),l+=8}if(1970628964===c&&l+16<=s&&(0,a.pX)(e,l)===t&&(0,a.pX)(e,l+4)===n&&(0,a.pX)(e,l+8)===r&&(0,a.pX)(e,l+12)===i)return l+=16,e.subarray(l,u+o)}}function d(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,i=(0,a.pX)(e,n);n+=4;var o=(0,a.pX)(e,n);if(n+=4,0===i)i=t;else if(1===i){if(n+8>t)return r.Z.warn("ISOBMFF: box too short, cannot find offsets"),null;i=(0,a.pV)(e,n),n+=8}if(i<0)throw new Error("ISOBMFF: Size out of range");return 1970628964===o&&(n+=16),[0,n,i]}},6807:function(e,t,n){"use strict";n.d(t,{E3:function(){return u},Le:function(){return o},XA:function(){return i},fs:function(){return s},uq:function(){return a}});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.lp)(e,1836019558).reduce((function(e,t){var n=(0,r.t_)(t,1953653094);return null!==n&&e.push(n),e}),[])}function o(e){return(0,r.t_)(e,1835295092)}function s(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 u(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=[];t<n.length;){var s=void 0;try{s=(0,o.Qy)(n,1886614376)}catch(e){return r.Z.warn("ISOBMFF:",e),a}if(null==s)return a;var l=i(n,s[0],s[2]),c=u(l,s[1]-s[0]);void 0!==c&&a.push({systemId:c,data:l}),n[s[0]+4]=102,n[s[0]+5]=114,n[s[0]+6]=101,n[s[0]+7]=101,t=s[2]}return a}function u(e,t){if(e[t]>1)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,{J6:function(){return m},LD:function(){return h},MM:function(){return v},Qx:function(){return f},Wf:function(){return d},s9:function(){return g}});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="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(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,c=(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 d=[];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,d.push({time:l,duration:h,timescale:c,range:[r,r+v-1]}),l+=h,r+=v}return d}function f(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 p(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)}}function v(e){var t=(0,u.uq)(e);if(0!==t.length){for(var n,r=0,a=l(t);!(n=a()).done;){var o=n.value,c=(0,s.t_)(o,1953658222);if(null===c)return;var d=0,f=c[d];if(d+=1,f>1)return;var v=(0,i.QI)(c,d);d+=3;var h=(256&v)>0,m=0;if(!h&&void 0===(m=p(o)))return;var g=(1&v)>0,y=(4&v)>0,_=(512&v)>0,b=(1024&v)>0,T=(2048&v)>0,E=(0,i.pX)(c,d);d+=4,g&&(d+=4),y&&(d+=4);for(var S=E,w=0;S-- >0;)h?(w+=(0,i.pX)(c,d),d+=4):w+=m,_&&(d+=4),b&&(d+=4),T&&(d+=4);r+=w}return r}}function h(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 m(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 g(e){for(var t=[],n=0;n<e.length;){var o=(0,u.E3)(e,n);if(null===o)break;var s=o.length;n+=s;var l=o[0];if(0!==l)r.Z.warn("ISOBMFF: EMSG version "+l.toString()+" not supported.");else{var c=4,d=(0,a.DM)(o,c),f=d.end,p=d.string;c=f;var v=(0,a.DM)(o,c),h=v.end,m=v.string;c=h;var g=(0,i.pX)(o,c);c+=4;var y=(0,i.pX)(o,c);c+=4;var _=(0,i.pX)(o,c);c+=4;var b=(0,i.pX)(o,c);c+=4;var T={schemeIdUri:p,value:m,timescale:g,presentationTimeDelta:y,eventDuration:_,id:b,messageData:o.subarray(c,s)};t.push(T)}}if(0!==t.length)return t}},3203:function(e,t,n){"use strict";var r=n(6968),i=n(3635);t.Z=function(e){var t=0,n=e.length,a=(0,i.uR)(e.subarray(t+1,t+8));if(t+=8,137!==e[0]||"BIF\r\n\n"!==a)throw new Error("Invalid BIF file");var o=e[t],s=e[t+=1],u=e[t+=1],l=e[t+=1];t+=1;var c=[o,s,u,l].join(".");if(s>0)throw new Error("Unhandled version: "+s);var d=(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===d)throw new Error("bif: no images to parse");for(var _=0,b=null;t<n;){var T=(0,r.dN)(e,t);t+=4;var E=(0,r.dN)(e,t);if(t+=4,null!==b){var S=b.timestamp*f,w=f,k=e.slice(b.offset,E);y.push({index:_,duration:w,ts:S,data:k}),_++}if(4294967295===T)break;b={timestamp:T,offset:E}}return{fileFormat:"BIF",version:c,imageCount:d,timescale:1e3,format:p,width:v,height:h,aspectRatio:m,isVod:g,thumbs:y}}},7403:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(3887),i=n(3911),a=n(1915),o=n(6394),s=n(4784);function u(e,t){if(t.timescale!==e.timescale){var n=e.timescale;e.timeline.push({start:t.time/t.timescale*n,duration:t.duration/t.timescale*n,repeatCount:void 0===t.count?0:t.count,range:t.range})}else e.timeline.push({start:t.time,duration:t.duration,repeatCount:void 0===t.count?0:t.count,range:t.range});return!0}var l=function(){function e(e,t){var n,r,a=t.periodStart,o=t.periodEnd,u=t.representationBaseURLs,l=t.representationId,c=t.representationBitrate,d=t.isEMSGWhitelisted,f=null!==(n=e.timescale)&&void 0!==n?n:1,p=(null!=e.presentationTimeOffset?e.presentationTimeOffset:0)-a*f,v=u.map((function(e){return e.url})),h=(0,s.k6)(v,void 0!==e.initialization?e.initialization.media:void 0,l,c),m=void 0!==e.initialization?e.initialization.range:void 0!==e.indexRange?[0,e.indexRange[0]-1]:void 0;this._index={indexRange:e.indexRange,indexTimeOffset:p,initialization:{mediaURLs:h,range:m},mediaURLs:(0,s.k6)(v,e.media,l,c),startNumber:e.startNumber,timeline:null!==(r=e.timeline)&&void 0!==r?r:[],timescale:f},this._scaledPeriodEnd=null==o?void 0:(0,i.gT)(o,this._index),this._isInitialized=this._index.timeline.length>0,this._isEMSGWhitelisted=d}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;t<e.length;t++)u(this._index,e[t]);this._isInitialized=!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return this._isInitialized},t._replace=function(e){this._index=e._index,this._isInitialized=e._isInitialized,this._scaledPeriodEnd=e._scaledPeriodEnd,this._isEMSGWhitelisted=e._isEMSGWhitelisted},t._update=function(){r.Z.error("Base RepresentationIndex: Cannot update a SegmentList")},e}()},1915:function(e,t,n){"use strict";function r(e,t){var n,r,i=e.initialization;return void 0!==t&&(r={isEMSGWhitelisted:t}),{id:"init",isInit:!0,time:0,end:0,duration:0,timescale:1,range:null!=i?i.range:void 0,indexRange:e.indexRange,mediaURLs:null!==(n=null==i?void 0:i.mediaURLs)&&void 0!==n?n:null,complete:!0,privateInfos:r,timestampOffset:-e.indexTimeOffset/e.timescale}}n.d(t,{Z:function(){return r}})},6394:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3911),i=n(4784);function a(e,t,n,a,o){for(var s,u,l=(0,r.gT)(t,e),c=(0,r.gT)(t+n,e),d=e.timeline,f=e.timescale,p=e.mediaURLs,v=e.startNumber,h=null!=v?v:1,m=[],g=d.length,y=d.length>0&&null!=d[0].duration?d[0].duration:0,_=0;_<g;_++){var b=d[_],T=b.duration,E=b.start,S=b.range;y=Math.max(y,T);for(var w=(0,r.KF)(b,d[_+1],o),k=!1!==e.availabilityTimeComplete||_!==g-1&&0!==w,A=(s=T,u=void 0,(u=l-E)>0?Math.floor(u/s):0),x=E+A*T;x<c&&A<=w;){var I=h+A,Z=null===p?null:p.map((0,i.QB)(x,I)),R=x-e.indexTimeOffset,M={id:String(x),time:R/f,end:(R+T)/f,duration:T/f,isInit:!1,range:S,timescale:1,mediaURLs:Z,number:I,timestampOffset:-e.indexTimeOffset/f,complete:k,privateInfos:{isEMSGWhitelisted:a}};m.push(M),x=E+ ++A*T}if(x>=c)return m;h+=w+1}return m}},4784:function(e,t,n){"use strict";n.d(t,{QB:function(){return u},k6:function(){return o}});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)}))}}},3501:function(e,t,n){"use strict";n.d(t,{Z:function(){return He}});var r=n(7904),i=n(1946),a=n(6872),o=n(3887),s=n(3274),u=n(9829);function l(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<t.length;r++){var i=t[r].index.getLastPosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.min(n,i))}return null===n?null:n}function d(e){for(var t=e.length-1;t>=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 f(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getFirstPosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.max(n,i))}return null===n?null:n}function p(e){for(var t=0;t<=e.length-1;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=f(r);if(void 0===u)return;a=u}if(void 0!==i){var l=f(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 next one to calculate first position");if(null!==s)return null!==a?Math.max(a,s):s;if(null!==a)return a}}}var v=n(9592),h=n(908),m=n(1679),g=n(3635);var y=function(){function e(e){this._isDynamic=e.isDynamic,this._timeShiftBufferDepth=e.isDynamic&&void 0!==e.timeShiftBufferDepth?e.timeShiftBufferDepth:null}var t=e.prototype;return t.setLastPosition=function(e,t){this._lastPosition=e,this._positionTime=t},t.lastPositionIsKnown=function(){return this._isDynamic?null!=this._positionTime&&null!=this._lastPosition:null!=this._lastPosition},t.estimateMinimumBound=function(){if(!this._isDynamic||null===this._timeShiftBufferDepth)return 0;var e=this.estimateMaximumBound();return void 0!==e?e-this._timeShiftBufferDepth:void 0},t.estimateMaximumBound=function(){return this._isDynamic&&null!=this._positionTime&&null!=this._lastPosition?Math.max(this._lastPosition-this._positionTime+performance.now()/1e3,0):this._lastPosition},e}(),_=n(8999),b=n(5138),T=n(7714),E=n(6923);function S(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var k=function(e,t){for(var n,r=S(t);!(n=r()).done;)for(var i,a=n.value,o=a.adaptation,s=S(a.trickModeAttachedAdaptationIds);!(i=s()).done;)for(var u,l=i.value,c=S(_.r);!(u=c()).done;){var d=e[u.value];if(void 0!==d)for(var f,p=S(d);!(f=p()).done;){var v=f.value;v.id===l&&(void 0===v.trickModeTracks&&(v.trickModeTracks=[]),v.trickModeTracks.push(o))}}},A=["subtitle","caption"];function x(e,t,n,r){function i(e,t){var n=e.split("/")[0];return(0,T.Z)(_.r,n)?n:"application/bif"===e?"image":"application/ttml+xml"===e||"application/mp4"===e&&null!=t&&null!=(0,s.Z)(t,(function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri&&(0,T.Z)(A,e.value)}))?"text":void 0}function a(e){switch(e.substring(0,3)){case"avc":case"hev":case"hvc":case"vp8":case"vp9":case"av1":return"video";case"vtt":return"text";case"bif":return"image"}switch(e.substring(0,4)){case"mp4a":return"audio";case"wvtt":case"stpp":return"text"}}if(null!==t){var o=i(t,r);if(void 0!==o)return o}if(null!==n){var u=a(n);if(void 0!==u)return u}for(var l=0;l<e.length;l++){var c=e[l].attributes,d=c.mimeType,f=c.codecs;if(void 0!==d){var p=i(d,r);if(void 0!==p)return p}if(void 0!==f){var v=a(f);if(void 0!==v)return v}}}var I=n(8026);var Z=n(7403),R=n(3911),M=n(1915),C=n(4784),P=function(){function e(e,t){var n;if(void 0===e.duration)throw new Error("Invalid SegmentList: no duration");var r=t.periodStart,i=t.representationBaseURLs,a=t.representationId,o=t.representationBitrate,s=t.isEMSGWhitelisted;this._isEMSGWhitelisted=s,this._periodStart=r;var u=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,l=null!==(n=e.timescale)&&void 0!==n?n:1,c=u-r*l,d=i.map((function(e){return e.url})),f=e.list.map((function(e){return{mediaURLs:(0,C.k6)(d,e.media,a,o),mediaRange:e.mediaRange}}));this._index={list:f,timescale:l,duration:e.duration,indexTimeOffset:c,indexRange:e.indexRange,initialization:null==e.initialization?void 0:{mediaURLs:(0,C.k6)(d,e.initialization.media,a,o),range:e.initialization.range}}}var t=e.prototype;return t.getInitSegment=function(){var e=(0,M.Z)(this._index);return void 0===e.privateInfos&&(e.privateInfos={}),e.privateInfos.isEMSGWhitelisted=this._isEMSGWhitelisted,e},t.getSegments=function(e,t){for(var n=this._index,r=n.duration,i=n.list,a=n.timescale,o=r/a,s=e-this._periodStart,u=(0,R.PZ)(s,t,a),l=u[0],c=u[1],d=Math.min(i.length-1,Math.floor(c/r)),f=[],p=Math.floor(l/r);p<=d;){var v=i[p].mediaRange,h=i[p].mediaURLs,m=p*o+this._periodStart,g={id:String(p),time:m,isInit:!1,range:v,duration:o,timescale:1,end:m+o,mediaURLs:h,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};f.push(g),p++}return f},t.shouldRefresh=function(e,t){return!1},t.getFirstPosition=function(){return this._periodStart},t.getLastPosition=function(){var e=this._index,t=e.duration;return e.list.length*t/e.timescale+this._periodStart},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index},t._update=function(){o.Z.error("List RepresentationIndex: Cannot update a SegmentList")},e}(),D=n(9362),N=n(8232),O=n(1091),L=n(5505),B=n(6394);function U(e,t,n){return t+a.Z.getCurrent().DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR*e>=n}function F(e,t,n,r){var a=e.start,s=e.duration,u=e.repeatCount;return void 0===a&&(null===t?a=r:(0,i.Z)(t.duration)||(a=t.start+t.duration*(t.repeatCount+1))),void 0!==s&&!isNaN(s)||null===n||void 0===n.start||isNaN(n.start)||void 0===a||isNaN(a)||(s=n.start-a),void 0===a||isNaN(a)||void 0===s||isNaN(s)||void 0!==u&&isNaN(u)?(o.Z.warn('DASH: A "S" Element could not have been parsed.'),null):{start:a,duration:s,repeatCount:void 0===u?0:u}}function z(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"t":var i=parseInt(r.value,10);isNaN(i)?o.Z.warn('DASH: invalid t ("'+r.value+'")'):t.start=i;break;case"d":var a=parseInt(r.value,10);isNaN(a)?o.Z.warn('DASH: invalid d ("'+r.value+'")'):t.duration=a;break;case"r":var s=parseInt(r.value,10);isNaN(s)?o.Z.warn('DASH: invalid r ("'+r.value+'")'):t.repeatCount=s}}return t}function V(e,t){for(var n=[],r=0;r<e.length;r++)n.push(z(e[r]));for(var i=[],a=0;a<n.length;a++){var o=F(n[a],void 0===i[i.length-1]?null:i[i.length-1],void 0===n[a+1]?null:n[a+1],t);null!==o&&i.push(o)}return i}function K(e,t,n){var r,i=function(e,t){if(0===e.length||0===t.length)return null;var n=e[0].start,r=t[0].getAttribute("t"),i=null===r?null:parseInt(r,10);if(null===i||Number.isNaN(i))return null;if(n===i)return{prevSegmentsIdx:0,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(n<i)for(var a=e[0],o=0;;){if(a.repeatCount>0){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],c=i;;){var d=l.getAttribute("d"),f=null===d?null:parseInt(d,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-c;if(h%f==0&&h/f<=v)return{repeatNumberInPrevSegments:0,repeatNumberInNewElements:h/f,prevSegmentsIdx:0,newElementsIdx:u}}c+=f*(v+1)}else c+=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;c=g}if(c===n)return{newElementsIdx:u,prevSegmentsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(c>i)return null}}(t,e);if(null===i)return o.Z.warn('DASH: Cannot perform "based" update. Common segment not found.'),V(e,n);var a=i.prevSegmentsIdx,s=i.newElementsIdx,u=i.repeatNumberInPrevSegments,l=i.repeatNumberInNewElements,c=t.length-a+s-1;if(c>=e.length)return o.Z.info('DASH: Cannot perform "based" update. New timeline too short'),V(e,n);var d=t.slice(a);if(u>0){var f=d[0];f.start+=f.duration*u,d[0].repeatCount-=u}if(l>0&&0!==s)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form.'),V(e,n);var p=d[d.length-1],v=z(e[c]),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.'),V(e,n);void 0!==v.repeatCount&&v.repeatCount>p.repeatCount&&(p.repeatCount=v.repeatCount);for(var m=[],g=[],y=c+1;y<e.length;y++)g.push(z(e[y]));for(var _=0;_<g.length;_++){var b=F(g[_],void 0===m[m.length-1]?p:m[m.length-1],void 0===g[_+1]?null:g[_+1],n);null!==b&&m.push(b)}return d.concat(m)}var G=function(){function e(t,n){var r,i,a;if(!e.isTimelineIndexArgument(t))throw new Error("The given index is not compatible with a TimelineRepresentationIndex.");var o=n.availabilityTimeComplete,s=n.manifestBoundsCalculator,u=n.isDynamic,l=n.isLastPeriod,c=n.representationBaseURLs,d=n.representationId,f=n.representationBitrate,p=n.periodStart,v=n.periodEnd,h=n.isEMSGWhitelisted,m=null!==(r=t.timescale)&&void 0!==r?r:1,g=(null!=t.presentationTimeOffset?t.presentationTimeOffset:0)-p*m;this._manifestBoundsCalculator=s,this._isEMSGWhitelisted=h,this._isLastPeriod=l,this._lastUpdate=null==n.receivedTime?performance.now():n.receivedTime,this._unsafelyBaseOnPreviousIndex=null,null!==n.unsafelyBaseOnPreviousRepresentation&&n.unsafelyBaseOnPreviousRepresentation.index instanceof e&&(n.unsafelyBaseOnPreviousRepresentation.index._unsafelyBaseOnPreviousIndex=null,this._unsafelyBaseOnPreviousIndex=n.unsafelyBaseOnPreviousRepresentation.index),this._isDynamic=u,this._parseTimeline=null!==(i=t.timelineParser)&&void 0!==i?i:null;var y=c.map((function(e){return e.url}));this._index={availabilityTimeComplete:o,indexRange:t.indexRange,indexTimeOffset:g,initialization:null==t.initialization?void 0:{mediaURLs:(0,C.k6)(y,t.initialization.media,d,f),range:t.initialization.range},mediaURLs:(0,C.k6)(y,t.media,d,f),startNumber:t.startNumber,timeline:null!==(a=t.timeline)&&void 0!==a?a:null,timescale:m},this._scaledPeriodStart=(0,R.gT)(p,this._index),this._scaledPeriodEnd=null==v?void 0:(0,R.gT)(v,this._index)}var t=e.prototype;return t.getInitSegment=function(){return(0,M.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var n=this._index,r=n.mediaURLs,i=n.startNumber,a=n.timeline,o=n.timescale,s=n.indexTimeOffset;return(0,B.Z)({mediaURLs:r,startNumber:i,timeline:a,timescale:o,indexTimeOffset:s},e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstPosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;return 0===e.length?null:(0,R.zG)(e[0].start,this._index)},t.getLastPosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=e.getIndexEnd(this._index.timeline,this._scaledPeriodStart);return null===t?null:(0,R.zG)(t,this._index)},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=this._index,n=t.timeline,r=t.timescale,i=t.indexTimeOffset;return(0,O.Z)(e,n,r,i)},t.checkDiscontinuity=function(e){this._refreshTimeline();var t=this._index.timeline;return null===t&&(t=this._getTimeline(),this._index.timeline=t),(0,R._j)({timeline:t,timescale:this._index.timescale,indexTimeOffset:this._index.indexTimeOffset},e,this._scaledPeriodEnd)},t.canBeOutOfSyncError=function(e){return!!this._isDynamic&&(e instanceof D.Z&&e.isHttpError(404))},t.areSegmentsChronologicallyGenerated=function(){return!0},t._replace=function(e){this._parseTimeline=e._parseTimeline,this._index=e._index,this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._manifestBoundsCalculator=e._manifestBoundsCalculator,this._isLastPeriod=e._isLastPeriod},t._update=function(e){null===this._index.timeline&&(this._index.timeline=this._getTimeline()),null===e._index.timeline&&(e._index.timeline=e._getTimeline()),(0,L.Z)(this._index.timeline,e._index.timeline)&&(this._index.startNumber=e._index.startNumber),this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._isLastPeriod=e._isLastPeriod},t.isFinished=function(){if(!this._isDynamic||!this._isLastPeriod)return!0;null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;if(void 0===this._scaledPeriodEnd||0===e.length)return!1;var t=e[e.length-1],n=(0,R.jH)(t,null,this._scaledPeriodEnd);return U(this._index.timescale,n,this._scaledPeriodEnd)},t.isInitialized=function(){return!0},e.isTimelineIndexArgument=function(e){return"function"==typeof e.timelineParser||Array.isArray(e.timeline)},t._refreshTimeline=function(){null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._manifestBoundsCalculator.estimateMinimumBound();if(null!=e){var t=(0,R.gT)(e,this._index),n=(0,N.Z)(this._index.timeline,t);void 0!==this._index.startNumber&&(this._index.startNumber+=n)}},e.getIndexEnd=function(e,t){return e.length<=0?null:(0,R.jH)(e[e.length-1],null,t)},t._getTimeline=function(){if(null===this._parseTimeline)return null!==this._index.timeline?this._index.timeline:(o.Z.error("DASH: Timeline already lazily parsed."),[]);var e=this._parseTimeline();this._parseTimeline=null;var t,n=a.Z.getCurrent().MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY;return null===this._unsafelyBaseOnPreviousIndex||e.length<n?V(e,this._scaledPeriodStart):(null===this._unsafelyBaseOnPreviousIndex._index.timeline?(t=this._unsafelyBaseOnPreviousIndex._getTimeline(),this._unsafelyBaseOnPreviousIndex._index.timeline=t):t=this._unsafelyBaseOnPreviousIndex._index.timeline,this._unsafelyBaseOnPreviousIndex=null,K(e,t,this._scaledPeriodStart))},e}(),H=function(){function e(e,t){var n,r=t.aggressiveMode,i=t.availabilityTimeOffset,a=t.manifestBoundsCalculator,o=t.isDynamic,s=t.periodEnd,u=t.periodStart,l=t.representationBaseURLs,c=t.representationId,d=t.representationBitrate,f=t.isEMSGWhitelisted,p=null!==(n=e.timescale)&&void 0!==n?n:1,v=0===l.length?0:l.reduce((function(e,t){return Math.min(e,t.availabilityTimeOffset)}),1/0);this._availabilityTimeOffset=i+v,this._manifestBoundsCalculator=a,this._aggressiveMode=r;var h=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,m=h-u*p;if(void 0===e.duration)throw new Error("Invalid SegmentTemplate: no duration");var g=l.map((function(e){return e.url}));this._index={duration:e.duration,timescale:p,indexRange:e.indexRange,indexTimeOffset:m,initialization:null==e.initialization?void 0:{mediaURLs:(0,C.k6)(g,e.initialization.media,c,d),range:e.initialization.range},mediaURLs:(0,C.k6)(g,e.media,c,d),presentationTimeOffset:h,startNumber:e.startNumber},this._isDynamic=o,this._periodStart=u,this._scaledPeriodEnd=null==s?void 0:(s-u)*p,this._isEMSGWhitelisted=f}var t=e.prototype;return t.getInitSegment=function(){return(0,M.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){var n=this._index,r=n.duration,i=n.startNumber,a=n.timescale,o=n.mediaURLs,s=this._periodStart*a,u=this._scaledPeriodEnd,l=e*a-s,c=(e+t)*a-s,d=this._getFirstSegmentStart(),f=this._getLastSegmentStart();if(null==d||null==f)return[];var p=Math.max(d,l),v=Math.min(f,c);if(v+r<=p)return[];for(var h=[],m=null!=i?i:1,g=Math.floor(p/r),y=g*r;y<=v;y+=r){var _=g+m,b=null!=u&&y+r>u?u-y:r,T=y+s,E=y+this._index.presentationTimeOffset,S=null===o?null:o.map((0,C.QB)(E,_)),w={id:String(_),number:_,time:T/a,end:(T+b)/a,duration:b/a,timescale:1,isInit:!1,scaledDuration:b/a,mediaURLs:S,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};h.push(w),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&&U(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&&e<this._periodStart)return null}var t=this._index,n=t.duration,r=t.timescale,i=this._manifestBoundsCalculator.estimateMinimumBound();if(void 0!==i){var a=i>this._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 o=this._aggressiveMode?n/r:0;if(null!=this._scaledPeriodEnd&&this._scaledPeriodEnd<(i+o-this._periodStart)*this._index.timescale)return this._scaledPeriodEnd<n?null:(Math.floor(this._scaledPeriodEnd/n)-1)*n;var s=(i-this._periodStart)*r;if(s<0)return null;var u=((void 0!==this._availabilityTimeOffset?this._availabilityTimeOffset:0)+o)*r,l=Math.floor((s+u)/n);return l<=0?null:(l-1)*n}var c=null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:0,d=Math.ceil(c/n)-1,f=d*n;return c-f>a.Z.getCurrent().MINIMUM_SEGMENT_SIZE*r||0===d?f:(d-1)*n},e}();function W(e,t){if(0===t.length)return e;var n=t.map((function(e){var t,n;return{url:e.value,availabilityTimeOffset:null!==(t=e.attributes.availabilityTimeOffset)&&void 0!==t?t:0,availabilityTimeComplete:null===(n=e.attributes.availabilityTimeComplete)||void 0===n||n}}));if(0===e.length)return n;for(var r=[],i=0;i<e.length;i++)for(var a=e[i],o=0;o<n.length;o++){var s=n[o],l=(0,u.Z)(a.url,s.url),c=a.availabilityTimeOffset+s.availabilityTimeOffset;r.push({url:l,availabilityTimeOffset:c,availabilityTimeComplete:s.availabilityTimeComplete})}return r}function j(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Y(e){var t=e.adaptationProfiles,n=e.manifestProfiles,r=e.codecs;if(void 0!==r)return-1===((null!=t?t:"")+(null!=n?n:"")).indexOf("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")||"hvc1.2.4.L153.B0"!==r&&"hev1.2.4.L153.B0"!==r?/^vp(08|09|10)/.exec(r)?function(e){var t,n,r,i=e.split("."),a=i[0],o=(i[1],i[2],i[3]),s=(i[4],i[5]),u=i[6],l=i[7];if(("vp08"===a||"vp09"===a||"vp10"===a)&&((void 0!==o&&"10"===o||"12"===o)&&(t=parseInt(o,10)),void 0!==u&&("16"===u?n="pq":"18"===u&&(n="hlg")),void 0!==s&&void 0!==l&&"09"===s&&"09"===l&&(r="rec2020"),void 0!==t&&void 0!==n))return{colorDepth:t,eotf:n,colorSpace:r}}(r):void 0:{colorDepth:10,eotf:"pq",colorSpace:"rec2020"}}function $(e,t,n){for(var r,i,a,u,l,c=[],d=function(){for(var e=l.value,d=null!=e.attributes.id?e.attributes.id:String(e.attributes.bitrate)+(null!=e.attributes.height?"-"+e.attributes.height:"")+(null!=e.attributes.width?"-"+e.attributes.width:"")+(null!=e.attributes.mimeType?"-"+e.attributes.mimeType:"")+(null!=e.attributes.codecs?"-"+e.attributes.codecs:"");c.some((function(e){return e.id===d}));)d+="-dup";var f=null!==(i=null===(r=n.unsafelyBaseOnPreviousAdaptation)||void 0===r?void 0:r.getRepresentation(d))&&void 0!==i?i:null,p=function(e,t){var n=[];if(void 0!==e.children.inbandEventStreams&&n.push.apply(n,e.children.inbandEventStreams),void 0!==t.children.inbandEventStreams&&n.push.apply(n,t.children.inbandEventStreams),0!==n.length)return n}(e,t),v=null!==(a=e.attributes.availabilityTimeComplete)&&void 0!==a?a:n.availabilityTimeComplete,h=(null!==(u=e.attributes.availabilityTimeOffset)&&void 0!==u?u:0)+n.availabilityTimeOffset,m=function(e,t){var n,r,i,a=W(t.baseURLs,e.children.baseURLs),o=t.aggressiveMode,s=t.availabilityTimeOffset,u=t.manifestBoundsCalculator,l=t.isDynamic,c=t.end,d=t.start,f=t.receivedTime,p=t.timeShiftBufferDepth,v=t.unsafelyBaseOnPreviousRepresentation,h=t.inbandEventStreams,m={aggressiveMode:o,availabilityTimeComplete:!0,availabilityTimeOffset:s,unsafelyBaseOnPreviousRepresentation:v,isEMSGWhitelisted:function(e){return void 0!==h&&h.some((function(t){return t.schemeIdUri===e.schemeIdUri}))},isLastPeriod:t.isLastPeriod,manifestBoundsCalculator:u,isDynamic:l,periodEnd:c,periodStart:d,receivedTime:f,representationBaseURLs:a,representationBitrate:e.attributes.bitrate,representationId:e.attributes.id,timeShiftBufferDepth:p};if(void 0!==e.children.segmentBase){var g=e.children.segmentBase;i=new Z.Z(g,m)}else if(void 0!==e.children.segmentList){var y=e.children.segmentList;i=new P(y,m)}else if(void 0!==e.children.segmentTemplate||t.parentSegmentTemplates.length>0){var _=t.parentSegmentTemplates.slice(),b=e.children.segmentTemplate;void 0!==b&&_.push(b);var T=I.Z.apply(void 0,[{}].concat(_));m.availabilityTimeComplete=null!==(n=T.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,m.availabilityTimeOffset=(null!==(r=T.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,i=G.isTimelineIndexArgument(T)?new G(T,m):new H(T,m)}else{var E=t.adaptation.children;if(void 0!==E.segmentBase){var S=E.segmentBase;i=new Z.Z(S,m)}else if(void 0!==E.segmentList){var w=E.segmentList;i=new P(w,m)}else i=new H({duration:Number.MAX_VALUE,timescale:1,startNumber:0,media:""},m)}return i}(e,(0,I.Z)({},n,{availabilityTimeOffset:h,availabilityTimeComplete:v,unsafelyBaseOnPreviousRepresentation:f,adaptation:t,inbandEventStreams:p})),g=void 0;null==e.attributes.bitrate?(o.Z.warn("DASH: No usable bitrate found in the Representation."),g=0):g=e.attributes.bitrate;var y={bitrate:g,index:m,id:d},_=void 0;null!=e.attributes.codecs?_=e.attributes.codecs:null!=t.attributes.codecs&&(_=t.attributes.codecs),null!=_&&(_="mp4a.40.02"===_?"mp4a.40.2":_,y.codecs=_),null!=e.attributes.frameRate?y.frameRate=e.attributes.frameRate:null!=t.attributes.frameRate&&(y.frameRate=t.attributes.frameRate),null!=e.attributes.height?y.height=e.attributes.height:null!=t.attributes.height&&(y.height=t.attributes.height),null!=e.attributes.mimeType?y.mimeType=e.attributes.mimeType:null!=t.attributes.mimeType&&(y.mimeType=t.attributes.mimeType),null!=e.attributes.width?y.width=e.attributes.width:null!=t.attributes.width&&(y.width=t.attributes.width);var b=void 0!==t.children.contentProtections?t.children.contentProtections:[];if(void 0!==e.children.contentProtections&&b.push.apply(b,e.children.contentProtections),b.length>0){var T=b.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,i=[],a=j(t.children.cencPssh);!(r=a()).done;){var o=r.value;i.push({systemId:n,data:o})}if(i.length>0){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(T.initData).length>0||T.keyIds.length>0)&&(y.contentProtections=T)}y.hdrInfo=Y({adaptationProfiles:t.attributes.profiles,manifestProfiles:n.manifestProfiles,codecs:_}),c.push(y)},f=j(e);!(l=f()).done;)d();return c}function X(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function J(e){if(void 0===e)return!1;var t="urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"1"===e.value,n="urn:mpeg:dash:role:2011"===e.schemeIdUri&&"description"===e.value;return t||n}function ee(e){return void 0!==e&&("urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"2"===e.value)}function te(e){return void 0!==e&&("urn:mpeg:dash:role:2011"===e.schemeIdUri&&"sign"===e.value)}function ne(e,t){if((0,E.Z)(e.attributes.id))return e.attributes.id;var n=t.isClosedCaption,r=t.isAudioDescription,i=t.isSignInterpreted,a=t.isTrickModeTrack,o=t.type;return(0,E.Z)(e.attributes.language)&&(o+="-"+e.attributes.language),!0===n&&(o+="-cc"),!0===r&&(o+="-ad"),!0===i&&(o+="-si"),a&&(o+="-trickMode"),(0,E.Z)(e.attributes.contentType)&&(o+="-"+e.attributes.contentType),(0,E.Z)(e.attributes.codecs)&&(o+="-"+e.attributes.codecs),(0,E.Z)(e.attributes.mimeType)&&(o+="-"+e.attributes.mimeType),(0,E.Z)(e.attributes.frameRate)&&(o+="-"+e.attributes.frameRate),o}function re(e){if(null!=e.children.supplementalProperties)for(var t,n=X(e.children.supplementalProperties);!(t=n()).done;){var r=t.value;if("urn:mpeg:dash:adaptation-set-switching:2016"===r.schemeIdUri&&null!=r.value)return r.value.split(",").map((function(e){return e.trim()})).filter((function(e){return e}))}return[]}function ie(e,t){var n=t[1].priority-e[1].priority;return 0!==n?n:e[1].isMainAdaptation!==t[1].isMainAdaptation?e[1].isMainAdaptation?-1:1:e[1].indexInMpd-t[1].indexInMpd}function ae(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return oe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var se=(0,h.Z)();function ue(e,t){var n,r,i,a,u,l,c=[],d=function(e,t){var n=[];return e.forEach((function(r,i){var a,o;if(null!=r.attributes.start)a=r.attributes.start;else if(0===i)a=t.isDynamic&&null!=t.availabilityStartTime?t.availabilityStartTime:0;else{var s=n[n.length-1];if(null==s||null==s.periodEnd)throw new Error("Missing start time when parsing periods.");a=s.periodEnd}var u=e[i+1];null!=r.attributes.duration?o=r.attributes.duration:i===e.length-1?o=t.duration:null!=u.attributes.start&&(o=u.attributes.start-a);var l=null!=o?a+o:void 0;n.push({periodStart:a,periodDuration:o,periodEnd:l})})),n}(e,t);if(d.length!==e.length)throw new Error("MPD parsing error: the time information are incoherent.");var f=t.isDynamic,p=t.timeShiftBufferDepth,h=new y({isDynamic:f,timeShiftBufferDepth:p});f||null==t.duration||h.setLastPosition(t.duration);for(var S=function(y){var S=y===e.length-1,w=e[y],A=t.xlinkInfos.get(w),I=W(t.baseURLs,w.children.baseURLs),Z=d[y],R=Z.periodStart,M=Z.periodDuration,C=Z.periodEnd,P=void 0;for(null==w.attributes.id?(o.Z.warn("DASH: No usable id found in the Period. Generating one."),P="gen-dash-period-"+se()):P=w.attributes.id;c.some((function(e){return e.id===P}));)P+="-dup";var D=void 0!==A?A.receivedTime:t.receivedTime,N=null!==(r=null===(n=t.unsafelyBaseOnPreviousManifest)||void 0===n?void 0:n.getPeriod(P))&&void 0!==r?r:null,O=null===(i=w.attributes.availabilityTimeComplete)||void 0===i||i,L=null!==(a=w.attributes.availabilityTimeOffset)&&void 0!==a?a:0,B=t.aggressiveMode,U=t.manifestProfiles,F=w.children.segmentTemplate,z={aggressiveMode:B,availabilityTimeComplete:O,availabilityTimeOffset:L,baseURLs:I,manifestBoundsCalculator:h,end:C,isDynamic:f,isLastPeriod:S,manifestProfiles:U,receivedTime:D,segmentTemplate:F,start:R,timeShiftBufferDepth:p,unsafelyBaseOnPreviousPeriod:N},V=function(e,t){for(var n,r,i,a,u,l,c,d,f={video:[],audio:[],text:[],image:[]},p=[],v={},h=[],m=-1,g=0;g<e.length;g++){var y=e[g],S=y.children,w=S.essentialProperties,A=S.roles,I=Array.isArray(A)&&A.some((function(e){return"main"===e.value}))&&A.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri})),Z=y.children.representations,R=null!==(n=y.attributes.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,M=(null!==(r=y.attributes.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,C=y.attributes.mimeType,P=y.attributes.codecs,D=x(Z,(0,E.Z)(C)?C:null,(0,E.Z)(P)?P:null,null!=S.roles?S.roles:null);if(void 0!==D){var N=null!==(i=y.attributes.selectionPriority)&&void 0!==i?i:1,O=y.attributes.id,L=void 0,B=re(y),U=[];void 0!==t.segmentTemplate&&U.push(t.segmentTemplate),void 0!==y.children.segmentTemplate&&U.push(y.children.segmentTemplate);var F={aggressiveMode:t.aggressiveMode,availabilityTimeComplete:R,availabilityTimeOffset:M,baseURLs:W(t.baseURLs,S.baseURLs),manifestBoundsCalculator:t.manifestBoundsCalculator,end:t.end,isDynamic:t.isDynamic,isLastPeriod:t.isLastPeriod,manifestProfiles:t.manifestProfiles,parentSegmentTemplates:U,receivedTime:t.receivedTime,start:t.start,timeShiftBufferDepth:t.timeShiftBufferDepth,unsafelyBaseOnPreviousAdaptation:null},z=Array.isArray(w)?(0,s.Z)(w,(function(e){return"http://dashif.org/guidelines/trickmode"===e.schemeIdUri})):void 0,V=null===(a=null==z?void 0:z.value)||void 0===a?void 0:a.split(" "),K=void 0!==V;if("video"===D&&I&&m>=0&&f.video.length>m&&!K){var G,H=f.video[m][0];F.unsafelyBaseOnPreviousAdaptation=null!==(l=null===(u=t.unsafelyBaseOnPreviousPeriod)||void 0===u?void 0:u.getAdaptation(H.id))&&void 0!==l?l:null;var j=$(Z,y,F);(G=H.representations).push.apply(G,j),L=H.id}else{var q=S.accessibilities,Y=void 0;void 0!==A&&A.some((function(e){return"dub"===e.value}))&&(Y=!0);var Q=void 0;"text"!==D?Q=!1:void 0!==q&&(Q=q.some(ee));var ae=void 0;"audio"!==D?ae=!1:void 0!==q&&(ae=q.some(J));var oe=void 0;"video"!==D?oe=!1:void 0!==q&&(oe=q.some(te));for(var se=ne(y,{isAudioDescription:ae,isClosedCaption:Q,isSignInterpreted:oe,isTrickModeTrack:K,type:D});(0,T.Z)(h,se);)se+="-dup";L=se,h.push(se),F.unsafelyBaseOnPreviousAdaptation=null!==(d=null===(c=t.unsafelyBaseOnPreviousPeriod)||void 0===c?void 0:c.getAdaptation(se))&&void 0!==d?d:null;var ue={id:se,representations:$(Z,y,F),type:D,isTrickModeTrack:K};if(null!=y.attributes.language&&(ue.language=y.attributes.language),null!=Q&&(ue.closedCaption=Q),null!=ae&&(ue.audioDescription=ae),!0===Y&&(ue.isDub=!0),!0===oe&&(ue.isSignInterpreted=!0),void 0!==V)p.push({adaptation:ue,trickModeAttachedAdaptationIds:V});else{for(var le,ce=-1,de=function(){var e=le.value,t=v[e];if(void 0!==t&&t.newID!==L&&(0,T.Z)(t.adaptationSetSwitchingIDs,O)){ce=(0,b.Z)(f[D],(function(t){return t[0].id===e}));var n,r=f[D][ce];void 0!==r&&r[0].audioDescription===ue.audioDescription&&r[0].closedCaption===ue.closedCaption&&r[0].language===ue.language&&(o.Z.info('DASH Parser: merging "switchable" AdaptationSets',O,e),(n=r[0].representations).push.apply(n,ue.representations),"video"===D&&I&&!r[1].isMainAdaptation&&(m=Math.max(m,ce)),r[1]={priority:Math.max(N,r[1].priority),isMainAdaptation:I||r[1].isMainAdaptation,indexInMpd:Math.min(g,r[1].indexInMpd)})}},fe=X(B);!(le=fe()).done;)de();ce<0&&(f[D].push([ue,{priority:N,isMainAdaptation:I,indexInMpd:g}]),"video"===D&&I&&(m=f.video.length-1))}}null!=O&&null==v[O]&&(v[O]={newID:L,adaptationSetSwitchingIDs:B})}}var pe=_.r.reduce((function(e,t){var n=f[t];return n.length>0&&(n.sort(ie),e[t]=n.map((function(e){return e[0]}))),e}),{});return f.video.sort(ie),k(pe,p),pe}(w.children.adaptations,z),K=(null!==(u=t.xmlNamespaces)&&void 0!==u?u:[]).concat(null!==(l=w.attributes.namespaces)&&void 0!==l?l:[]),G=function(e,t,n){for(var r,i,a,o=[],s=ae(e);!(a=s()).done;)for(var u,l=a.value,c=l.attributes,d=c.schemeIdUri,f=void 0===d?"":d,p=c.timescale,v=void 0===p?1:p,h=n.concat(null!==(r=l.attributes.namespaces)&&void 0!==r?r:[]),m=ae(l.children.events);!(u=m()).done;){var y=u.value;if(void 0!==y.eventStreamData){var _=(null!==(i=y.presentationTime)&&void 0!==i?i:0)/v+t,b=void 0===y.duration?void 0:_+y.duration/v,T=void 0;if(y.eventStreamData instanceof Element)T=y.eventStreamData;else{var E=h.reduce((function(e,t){return e+"xmlns:"+t.key+'="'+t.value+'" '}),"<toremove ");E+=">";var S=(0,g.uR)(new Uint8Array(y.eventStreamData));T=(new DOMParser).parseFromString(E+S+"</toremove>","application/xml").documentElement.childNodes[0]}o.push({start:_,end:b,id:y.id,data:{type:"dash-event-stream",value:{schemeIdUri:f,timescale:v,element:T}}})}}return o}(w.children.eventStreams,R,K),H={id:P,start:R,end:C,duration:M,adaptations:V,streamEvents:G};if(c.unshift(H),!h.lastPositionIsKnown()){var j=function(e){for(var t,n=null,r=!0,i=(0,m.Z)(e).filter((function(e){return null!=e})),a=ae((0,v.Z)(i,(function(e){return e})));!(t=a()).done;)for(var o,s=ae(t.value.representations);!(o=s()).done;){var u=o.value.index.getLastPosition();null!==u&&(r=!1,"number"==typeof u&&(n=null==n?u:Math.max(n,u)))}if(null!=n)return n;if(r)return null;return}(V);if(f)if("number"==typeof j){var q=performance.now()/1e3;h.setLastPosition(j,q)}else{var Y=le(t,R);if(void 0!==Y){var Q=Y[0],oe=Y[1];h.setLastPosition(Q,oe)}}else"number"==typeof j&&h.setLastPosition(j)}},w=e.length-1;w>=0;w--)S(w);if(t.isDynamic&&!h.lastPositionIsKnown()){var A=le(t,0);if(void 0!==A){var I=A[0],Z=A[1];h.setLastPosition(I,Z)}}return function(e){if(0===e.length)return[];for(var t=[e[0]],n=1;n<e.length;n++){for(var r=e[n],i=t[t.length-1];void 0===i.duration||i.start+i.duration>r.start;)o.Z.warn("DASH: Updating overlapping Periods.",null==i?void 0:i.start,r.start),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}(c)}function le(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]}}function ce(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return de(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return de(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 de(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var fe=function e(t,n,r,i,c){void 0===c&&(c=new WeakMap);var f=t.children,v=t.attributes;if(null==n.externalClockOffset){var h="dynamic"===v.type,m=(0,s.Z)(f.utcTimings,(function(e){return"urn:mpeg:dash:utc:direct:2014"===e.schemeIdUri&&null!=e.value})),g=null!=m&&null!=m.value?l(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||"urn:mpeg:dash:utc:http-xsdate: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 i.success?(n.externalClockOffset=l(i.data),e(t,n,r,!0)):(r.push(i.error),o.Z.warn("DASH Parser: Error on fetching the clock ressource",i.error),e(t,n,r,!0))}}}}}for(var b=[],T=0;T<f.periods.length;T++){var E=f.periods[T].attributes,S=E.xlinkHref,w=E.xlinkActuate;null!=S&&"onLoad"===w&&b.push({index:T,ressource:S})}return 0===b.length?function(e,t,n,r){var i,s,l,c,f,v,h=e.children,m=e.attributes,g="dynamic"===m.type,y=W(void 0!==t.url?[{url:(0,u.f)(t.url),availabilityTimeOffset:0,availabilityTimeComplete:!0}]:[],h.baseURLs),_=function(e,t){return"dynamic"!==e.type?0:null==e.availabilityStartTime?null==t?0:t:e.availabilityStartTime}(m,t.referenceDateTime),b=m.timeShiftBufferDepth,T=t.externalClockOffset,E=t.unsafelyBaseOnPreviousManifest,S={aggressiveMode:t.aggressiveMode,availabilityStartTime:_,baseURLs:y,clockOffset:T,duration:m.duration,isDynamic:g,manifestProfiles:e.attributes.profiles,receivedTime:t.manifestReceivedTime,timeShiftBufferDepth:b,unsafelyBaseOnPreviousManifest:E,xlinkInfos:r,xmlNamespaces:e.attributes.namespaces},w=ue(h.periods,S),k=m.duration,A=null;void 0!==m.minimumUpdatePeriod&&m.minimumUpdatePeriod>=0&&(c=0===m.minimumUpdatePeriod?a.Z.getCurrent().DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:m.minimumUpdatePeriod);var x=function(e){if(0===e.length)throw new Error("DASH Parser: no period available for a dynamic content");return[p(e),d(e)]}(w),I=x[0],Z=x[1],R=performance.now();if(g){var M;if(f=I,A=null!=b?b:null,void 0!==Z)M=Z;else{var C=null!=_?_:0,P=t.externalClockOffset;if(void 0===P)o.Z.warn("DASH Parser: use system clock to define maximum position"),M=Date.now()/1e3-C;else M=(performance.now()+P)/1e3-C}v={isLinear:!0,value:M,time:R},null!==A&&void 0!==f&&M-f>A&&(A=M-f)}else{f=void 0!==I?I:void 0!==(null===(i=w[0])||void 0===i?void 0:i.start)?w[0].start:0;var D=null!=k?k:1/0;if(void 0!==w[w.length-1]){var N=w[w.length-1],O=null!==(s=N.end)&&void 0!==s?s:void 0!==N.duration?N.start+N.duration:void 0;void 0!==O&&O<D&&(D=O)}void 0!==Z&&Z<D&&(D=Z),v={isLinear:!1,value:D,time:R}}var L=!g||void 0===e.attributes.minimumUpdatePeriod&&(void 0!==(null===(l=w[w.length-1])||void 0===l?void 0:l.end)||void 0!==e.attributes.duration);return{type:"done",value:{parsed:{availabilityStartTime:_,clockOffset:t.externalClockOffset,isDynamic:g,isLive:g,isLastPeriodKnown:L,periods:w,publishTime:m.publishTime,suggestedPresentationDelay:m.suggestedPresentationDelay,transportType:"dash",timeBounds:{absoluteMinimumTime:f,timeshiftDepth:A,maximumTimeData:v},lifetime:c,uris:null==t.url?h.locations:[t.url].concat(h.locations)},warnings:n}}}(t,n,r,c):{type:"needs-xlinks",value:{xlinksUrls:b.map((function(e){return e.ressource})),continue:function(a){if(a.length!==b.length)throw new Error("DASH parser: wrong number of loaded ressources.");for(var o=a.length-1;o>=0;o--){var s,u=b[o].index,l=a[o],d=l.parsed,p=l.warnings,v=l.receivedTime,h=l.sendingTime,m=l.url;p.length>0&&r.push.apply(r,p);for(var g,y=ce(d);!(g=y()).done;){var _=g.value;c.set(_,{receivedTime:v,sendingTime:h,url:m})}(s=f.periods).splice.apply(s,[u,1].concat(d))}return e(t,n,r,i,c)}}}},pe=n(7326),ve=n(4578),he=n(2146),me=n(9689),ge=/^P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,ye=/([0-9]+)-([0-9]+)/;function _e(e,t){return"true"===e?[!0,null]:"false"===e?[!1,null]:[!1,new Ze("`"+t+'` property is not a boolean value but "'+e+'"')]}function be(e,t){var n=parseInt(e,10);return isNaN(n)?[null,new Ze("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function Te(e,t){if("INF"===e)return[1/0,null];var n=parseFloat(e);return isNaN(n)?[null,new Ze("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function Ee(e,t){if("true"===e)return[!0,null];if("false"===e)return[!1,null];var n=parseInt(e,10);return isNaN(n)?[null,new Ze("`"+t+'` property is not a boolean nor an integer but "'+e+'"')]:[n,null]}function Se(e,t){var n=Date.parse(e);return isNaN(n)?[null,new Ze("`"+t+'` is in an invalid date format: "'+e+'"')]:[new Date(Date.parse(e)).getTime()/1e3,null]}function we(e,t){if(!(0,E.Z)(e))return[0,new Ze("`"+t+"` property is empty")];var n=ge.exec(e);return null===n?[null,new Ze("`"+t+'` property has an unrecognized format "'+e+'"')]:[365*parseFloat((0,E.Z)(n[2])?n[2]:"0")*24*60*60+30*parseFloat((0,E.Z)(n[4])?n[4]:"0")*24*60*60+24*parseFloat((0,E.Z)(n[6])?n[6]:"0")*60*60+60*parseFloat((0,E.Z)(n[8])?n[8]:"0")*60+60*parseFloat((0,E.Z)(n[10])?n[10]:"0")+parseFloat((0,E.Z)(n[12])?n[12]:"0"),null]}function ke(e,t){var n=ye.exec(e);return null===n?[null,new Ze("`"+t+'` property has an unrecognized format "'+e+'"')]:[[+n[1],+n[2]],null]}function Ae(e,t){try{return[(0,me.K)(e),null]}catch(n){return[null,new Ze("`"+t+'` is not a valid base64 string: "'+e+'"')]}}function xe(e){for(var t,n,r=0;r<e.attributes.length;r++){var i=e.attributes[r];switch(i.name){case"schemeIdUri":t=i.value;break;case"value":n=i.value}}return{schemeIdUri:t,value:n}}function Ie(e,t){return function(n,r){var i=r.asKey,a=(0,r.parser)(n,r.dashName),s=a[0],u=a[1];null!==u&&(o.Z.warn(u.message),t.push(u)),null!==s&&(e[i]=s)}}var Ze=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,pe.Z)(r),t.prototype),r.name="MPDError",r.message=n,r}return(0,ve.Z)(t,e),t}((0,he.Z)(Error));function Re(e){var t={},n=e.textContent,r=[],i=Ie(t,r);if(null===n||0===n.length)return[void 0,r];for(var a=0;a<e.attributes.length;a++){var o=e.attributes[a];switch(o.name){case"availabilityTimeOffset":i(o.value,{asKey:"availabilityTimeOffset",parser:Te,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":i(o.value,{asKey:"availabilityTimeComplete",parser:_e,dashName:"availabilityTimeComplete"})}}return[{value:n,attributes:t},r]}function Me(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"id":t.id=r.value;break;case"lang":t.language=r.value;break;case"contentType":t.contentType=r.value;break;case"par":t.par=r.value}}return t}function Ce(e){var t=function(e){for(var t=[],n=[],r=0;r<e.length;r++)if(e[r].nodeType===Node.ELEMENT_NODE){var i=e[r];if("cenc:pssh"===i.nodeName){var a=i.textContent;if(null!==a&&a.length>0){var s=Ae(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;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"schemeIdUri":t.schemeIdUri=r.value;break;case"value":t.value=r.value;break;case"cenc:default_KID":t.keyId=(0,g.nr)(r.value.replace(/-/g,""))}}return t}(e)},r]}function Pe(e){for(var t={},n=[],r=Ie(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"range":r(a.value,{asKey:"range",parser:ke,dashName:"range"});break;case"sourceURL":t.media=a.value}}return[t,n]}function De(e){for(var t={},n=[],r=Ie(t,n),i=e.childNodes,a=0;a<i.length;a++)if(i[a].nodeType===Node.ELEMENT_NODE){var o=i[a];if("Initialization"===o.nodeName){var s=Pe(o),u=s[0],l=s[1];t.initialization=u,n=n.concat(l)}}for(var c=0;c<e.attributes.length;c++){var d=e.attributes[c];switch(d.name){case"timescale":r(d.value,{asKey:"timescale",parser:be,dashName:"timescale"});break;case"presentationTimeOffset":r(d.value,{asKey:"presentationTimeOffset",parser:Te,dashName:"presentationTimeOffset"});break;case"indexRange":r(d.value,{asKey:"indexRange",parser:ke,dashName:"indexRange"});break;case"indexRangeExact":r(d.value,{asKey:"indexRangeExact",parser:_e,dashName:"indexRangeExact"});break;case"availabilityTimeOffset":r(d.value,{asKey:"availabilityTimeOffset",parser:Te,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(d.value,{asKey:"availabilityTimeComplete",parser:_e,dashName:"availabilityTimeComplete"});break;case"duration":r(d.value,{asKey:"duration",parser:be,dashName:"duration"});break;case"startNumber":r(d.value,{asKey:"startNumber",parser:be,dashName:"startNumber"})}}return[t,n]}function Ne(e){for(var t={},n=[],r=Ie(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"media":t.media=a.value;break;case"indexRange":r(a.value,{asKey:"indexRange",parser:ke,dashName:"indexRange"});break;case"index":t.index=a.value;break;case"mediaRange":r(a.value,{asKey:"mediaRange",parser:ke,dashName:"mediaRange"})}}return[t,n]}function Oe(e){for(var t=De(e),n=t[0],r=t[1],i=[],a=e.childNodes,o=0;o<a.length;o++)if(a[o].nodeType===Node.ELEMENT_NODE){var s=a[o];if("SegmentURL"===s.nodeName){var u=Ne(s),l=u[0],c=u[1];i.push(l),r=r.concat(c)}}return[(0,I.Z)(n,{list:i}),r]}function Le(e){var t=null;return function(){if(null===t){var n=e.getElementsByTagName("S");return t=n,n}return t}}function Be(e){for(var t,n=De(e),r=n[0],i=n[1],a=0;a<e.childNodes.length;a++)if(e.childNodes[a].nodeType===Node.ELEMENT_NODE){var o=e.childNodes[a];"SegmentTimeline"===o.nodeName&&(t=Le(o))}for(var s=(0,I.Z)({},r,{duration:r.duration,timelineParser:t}),u=Ie(s,i),l=0;l<e.attributes.length;l++){var c=e.attributes[l];switch(c.nodeName){case"initialization":null==s.initialization&&(s.initialization={media:c.value});break;case"index":s.index=c.value;break;case"availabilityTimeOffset":u(c.value,{asKey:"availabilityTimeOffset",parser:Te,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":u(c.value,{asKey:"availabilityTimeComplete",parser:_e,dashName:"availabilityTimeComplete"});break;case"media":s.media=c.value;break;case"bitstreamSwitching":u(c.value,{asKey:"bitstreamSwitching",parser:_e,dashName:"bitstreamSwitching"})}}return[s,i]}function Ue(e){var t=function(e){for(var t={baseURLs:[]},n=[],r=[],i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE){var a=e[i];switch(a.nodeName){case"BaseURL":var o=Re(a),s=o[0],u=o[1];void 0!==s&&t.baseURLs.push(s),r=r.concat(u);break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(xe(a));break;case"SegmentBase":var l=De(a),c=l[0],d=l[1];t.segmentBase=c,d.length>0&&(r=r.concat(d));break;case"SegmentList":var f=Oe(a),p=f[0],v=f[1];r=r.concat(v),t.segmentList=p;break;case"SegmentTemplate":var h=Be(a),m=h[0],g=h[1];r=r.concat(g),t.segmentTemplate=m;break;case"ContentProtection":var y=Ce(a),_=y[0],b=y[1];b.length>0&&(r=r.concat(b)),void 0!==_&&n.push(_)}}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=Ie(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"bandwidth":r(a.value,{asKey:"bitrate",parser:be,dashName:"bandwidth"});break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:_e,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:be,dashName:"height"});break;case"id":t.id=a.value;break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:Te,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:Te,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"qualityRanking":r(a.value,{asKey:"qualityRanking",parser:be,dashName:"qualityRanking"});break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:be,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:Te,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:_e,dashName:"availabilityTimeComplete"})}}return void 0===t.bitrate&&n.push(new Ze("No bitrate found on a Representation")),[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Fe(e){var t=function(e){for(var t={baseURLs:[],representations:[]},n=[],r=[],i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE){var a=e[i];switch(a.nodeName){case"Accessibility":void 0===t.accessibilities?t.accessibilities=[xe(a)]:t.accessibilities.push(xe(a));break;case"BaseURL":var o=Re(a),s=o[0],u=o[1];void 0!==s&&t.baseURLs.push(s),u.length>0&&(r=r.concat(u));break;case"ContentComponent":t.contentComponent=Me(a);break;case"EssentialProperty":null==t.essentialProperties?t.essentialProperties=[xe(a)]:t.essentialProperties.push(xe(a));break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(xe(a));break;case"Representation":var l=Ue(a),c=l[0],d=l[1];t.representations.push(c),d.length>0&&(r=r.concat(d));break;case"Role":null==t.roles?t.roles=[xe(a)]:t.roles.push(xe(a));break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[xe(a)]:t.supplementalProperties.push(xe(a));break;case"SegmentBase":var f=De(a),p=f[0],v=f[1];t.segmentBase=p,v.length>0&&(r=r.concat(v));break;case"SegmentList":var h=Oe(a),m=h[0],g=h[1];t.segmentList=m,g.length>0&&(r=r.concat(g));break;case"SegmentTemplate":var y=Be(a),_=y[0],b=y[1];t.segmentTemplate=_,b.length>0&&(r=r.concat(b));break;case"ContentProtection":var T=Ce(a),E=T[0],S=T[1];S.length>0&&(r=r.concat(S)),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=Ie(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"group":r(a.value,{asKey:"group",parser:be,dashName:"group"});break;case"lang":t.language=a.value;break;case"contentType":t.contentType=a.value;break;case"par":t.par=a.value;break;case"minBandwidth":r(a.value,{asKey:"minBitrate",parser:be,dashName:"minBandwidth"});break;case"maxBandwidth":r(a.value,{asKey:"maxBitrate",parser:be,dashName:"maxBandwidth"});break;case"minWidth":r(a.value,{asKey:"minWidth",parser:be,dashName:"minWidth"});break;case"maxWidth":r(a.value,{asKey:"maxWidth",parser:be,dashName:"maxWidth"});break;case"minHeight":r(a.value,{asKey:"minHeight",parser:be,dashName:"minHeight"});break;case"maxHeight":r(a.value,{asKey:"maxHeight",parser:be,dashName:"maxHeight"});break;case"minFrameRate":t.minFrameRate=a.value;break;case"maxFrameRate":t.maxFrameRate=a.value;break;case"selectionPriority":r(a.value,{asKey:"selectionPriority",parser:be,dashName:"selectionPriority"});break;case"segmentAlignment":r(a.value,{asKey:"segmentAlignment",parser:Ee,dashName:"segmentAlignment"});break;case"subsegmentAlignment":r(a.value,{asKey:"subsegmentAlignment",parser:Ee,dashName:"subsegmentAlignment"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:_e,dashName:"bitstreamSwitching"});break;case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:_e,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:be,dashName:"height"});break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:Te,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:Te,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:be,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:Te,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:_e,dashName:"availabilityTimeComplete"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function ze(e){for(var t={children:{events:[]},attributes:{}},n=[],r=Ie(t.attributes,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"schemeIdUri":t.attributes.schemeIdUri=a.value;break;case"timescale":r(a.value,{asKey:"timescale",parser:be,dashName:"timescale"});break;case"value":t.attributes.value=a.value}}for(var o=0;o<e.childNodes.length;o++)if(e.childNodes[o].nodeType===Node.ELEMENT_NODE){var s=e.childNodes[o];switch(s.nodeName){case"Event":var u=Ve(s),l=u[0],c=u[1];t.children.events.push(l),c.length>0&&(n=n.concat(c))}}return[t,n]}function Ve(e){for(var t={eventStreamData:e},n=[],r=Ie(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"presentationTime":r(a.value,{asKey:"presentationTime",parser:be,dashName:"presentationTime"});break;case"duration":r(a.value,{asKey:"duration",parser:be,dashName:"duration"});break;case"id":t.id=a.value}}return[t,n]}function Ke(e){var t=function(e){for(var t,n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=Re(s),l=u[0],c=u[1];void 0!==l&&n.push(l),i=i.concat(c);break;case"AdaptationSet":var d=Fe(s),f=d[0],p=d[1];r.push(f),i=i.concat(p);break;case"EventStream":var v=ze(s),h=v[0],m=v[1];a.push(h),i=i.concat(m);break;case"SegmentTemplate":var g=Be(s),y=g[0],_=g[1];t=y,_.length>0&&(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=Ie(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"start":r(a.value,{asKey:"start",parser:we,dashName:"start"});break;case"duration":r(a.value,{asKey:"duration",parser:we,dashName:"duration"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:_e,dashName:"bitstreamSwitching"});break;case"xlink:href":t.xlinkHref=a.value;break;case"xlink:actuate":t.xlinkActuate=a.value}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Ge(e){var t=function(e){for(var t=[],n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=Re(s),l=u[0],c=u[1];void 0!==l&&t.push(l),a=a.concat(c);break;case"Location":n.push(null===s.textContent?"":s.textContent);break;case"Period":var d=Ke(s),f=d[0],p=d[1];r.push(f),a=a.concat(p);break;case"UTCTiming":var v=xe(s);i.push(v)}}return[{baseURLs:t,locations:n,periods:r,utcTimings:i},a]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Ie(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"profiles":t.profiles=a.value;break;case"type":t.type=a.value;break;case"availabilityStartTime":r(a.value,{asKey:"availabilityStartTime",parser:Se,dashName:"availabilityStartTime"});break;case"availabilityEndTime":r(a.value,{asKey:"availabilityEndTime",parser:Se,dashName:"availabilityEndTime"});break;case"publishTime":r(a.value,{asKey:"publishTime",parser:Se,dashName:"publishTime"});break;case"mediaPresentationDuration":r(a.value,{asKey:"duration",parser:we,dashName:"mediaPresentationDuration"});break;case"minimumUpdatePeriod":r(a.value,{asKey:"minimumUpdatePeriod",parser:we,dashName:"minimumUpdatePeriod"});break;case"minBufferTime":r(a.value,{asKey:"minBufferTime",parser:we,dashName:"minBufferTime"});break;case"timeShiftBufferDepth":r(a.value,{asKey:"timeShiftBufferDepth",parser:we,dashName:"timeShiftBufferDepth"});break;case"suggestedPresentationDelay":r(a.value,{asKey:"suggestedPresentationDelay",parser:we,dashName:"suggestedPresentationDelay"});break;case"maxSegmentDuration":r(a.value,{asKey:"maxSegmentDuration",parser:we,dashName:"maxSegmentDuration"});break;case"maxSubsegmentDuration":r(a.value,{asKey:"maxSubsegmentDuration",parser:we,dashName:"maxSubsegmentDuration"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}var He=function(e,t){var n=e.documentElement;if((0,i.Z)(n)||"MPD"!==n.nodeName)throw new Error("DASH Parser: document root should be MPD");var a=Ge(n),o=a[0],s=a[1];return function e(t){if("done"===t.type)return t;if("needs-clock"===t.type)return{type:"needs-resources",value:{urls:[t.value.url],format:"string",continue:function(n){if(1!==n.length)throw new Error("DASH parser: wrong number of loaded ressources.");var r=t.value.continue(n[0].responseData);return e(r)}}};if("needs-xlinks"===t.type)return{type:"needs-resources",value:{urls:t.value.xlinksUrls,format:"string",continue:function(n){for(var r=[],i=0;i<n.length;i++){var a=n[i],o=a.responseData,s=a.receivedTime,u=a.sendingTime,l=a.url;if(!o.success)throw o.error;var c="<root>"+o.data+"</root>",d=(new DOMParser).parseFromString(c,"text/xml");if(null==d||0===d.children.length)throw new Error("DASH parser: Invalid external ressources");for(var f=d.children[0].children,p=[],v=[],h=0;h<f.length;h++)if(f[h].nodeType===Node.ELEMENT_NODE){var m=Ke(f[h]),g=m[0],y=m[1];v.push.apply(v,y),p.push(g)}r.push({url:l,receivedTime:s,sendingTime:u,parsed:p,warnings:v})}var _=t.value.continue(r);return e(_)}}};(0,r.Z)(t)}(fe(o,t,s))}},8232:function(e,t,n){"use strict";function r(e,t){for(var n=0;e.length>0;){var r=e[0];if(r.start>=t)return n;if(-1===r.repeatCount)return n;if(0===r.repeatCount)e.shift(),n+=1;else{var i=e[1];if(void 0!==i&&i.start<=t)e.shift(),n+=1;else{if(r.duration<=0)return n;for(var a=r.start+r.duration,o=1;a<t&&o<=r.repeatCount;)a+=r.duration,o++;if(!(o>r.repeatCount)){var s=r.repeatCount-o;return r.start=a,r.repeatCount=s,n+=o}e.shift(),n=r.repeatCount+1}}}return n}n.d(t,{Z:function(){return r}})},3911:function(e,t,n){"use strict";n.d(t,{KF:function(){return i},PZ:function(){return u},_j:function(){return l},gT:function(){return o},jH:function(){return a},zG:function(){return s}});var r=n(1946);function i(e,t,n){var i,a=e.repeatCount;return a>=0?a:(i=(0,r.Z)(t)?void 0!==n?n:Number.MAX_VALUE:t.start,Math.ceil((i-e.start)/e.duration)-1)}function a(e,t,n){var r=e.start,a=e.duration;return a<=0?r:r+(i(e,t,n)+1)*a}function o(e,t){var n;return e*t.timescale+(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0)}function s(e,t){var n;return(e-(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0))/t.timescale}function u(e,t,n){return[e*n,(e+t)*n]}function l(e,t,n){var r=e.timeline,i=o(t,e);if(i<0)return null;var u=function(e,t){for(var n=0,r=e.length;n<r;){var i=n+r>>>1;e[i].start<=t?n=i+1:r=i}return n-1}(r,i);if(u<0||u>=r.length-1)return null;var l=r[u];if(l.duration<=0)return null;var c=r[u+1];if(void 0===c)return null;var d=c.start;return i>=a(l,c,n)&&i<d?s(d,e):null}},1091:function(e,t,n){"use strict";function r(e,t,n,r){for(var i=0;i<t.length;i++){var a=t[i],o=(a.start-r)/n;if(o>e.time)return!1;if(o===e.time)return void 0===a.range?void 0===e.range:null!=e.range&&a.range[0]===e.range[0]&&a.range[1]===e.range[1];if(a.repeatCount>=0&&void 0!==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){if(0===e.length)return e.push.apply(e,t),!0;if(0===t.length)return!1;var n=e.length,o=t[0].start,s=e[n-1];if((0,a.jH)(s,t[0])<o)throw new r.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");for(var u=n-1;u>=0;u--){var l=e[u].start;if(l===o){var c=n-u;return e.splice.apply(e,[u,c].concat(t)),!1}if(l<o){var d=e[u];if(d.start+d.duration>o)return i.Z.warn("RepresentationIndex: Manifest update removed all previous segments"),e.splice.apply(e,[0,n].concat(t)),!0;if(void 0===d.repeatCount||d.repeatCount<=0)return d.repeatCount<0&&(d.repeatCount=Math.floor((o-d.start)/d.duration)-1),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;if(d.start+d.duration*(d.repeatCount+1)<=o)return e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;var f=(o-d.start)/d.duration-1;if(f%1==0&&d.duration===t[0].duration){var p=t[0].repeatCount<0?-1:t[0].repeatCount+f+1;return e.splice.apply(e,[u,n-u].concat(t)),e[u].start=d.start,e[u].repeatCount=p,!1}return i.Z.warn("RepresentationIndex: Manifest update removed previous segments"),e[u].repeatCount=Math.floor(f),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1}}var v=e[e.length-1],h=t[t.length-1];return void 0!==v.repeatCount&&v.repeatCount<0?v.start>h.start?(i.Z.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0):v.start+v.duration*(v.repeatCount+1)>=h.start+h.duration*(h.repeatCount+1)?(i.Z.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0)}},5734:function(e,t,n){"use strict";var r=n(6923),i=/&#([0-9]+);/g,a=/<br>/gi,o=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,s=/\s*<p (?:class=([^>]+))?>(.*)/i,u=/<sync[^>]+?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 c,d,f=/<sync[ >]/gi,p=/<sync[ >]|<\/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(;c=f.exec(e),d=p.exec(e),null!==c||null!==d;){if(null===c||null===d||c.index>=d.index)throw new Error("parse error");var b=e.slice(c.index,d.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)");S(b.split("\n"),E/1e3)}return v;function S(e,n){for(var o=e.length;--o>=0;){var u=s.exec(e[o]);if(Array.isArray(u)){var l=u[1],c=u[2];if(g===l)if("&nbsp;"===c)v[v.length-1].end=n;else{var d=document.createElement("DIV");d.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=c.split(a),m=0;m<h.length;m++){0!==m&&p.appendChild(document.createElement("BR"));var y=document.createElement("SPAN");y.className="rxp-texttrack-span",y.textContent=h[m].replace(i,(function(e,t){return String.fromCharCode(Number(t))})),p.appendChild(y)}f.appendChild(p),d.appendChild(f),v.push({element:d,start:n+t,end:-1})}}}}}},1812:function(e,t,n){"use strict";var r=n(7253),i=n(6923),a=/&#([0-9]+);/g,o=/<br>/gi,s=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,u=/\s*<p (?:class=([^>]+))?>(.*)/i,l=/<sync[^>]+?start="?([0-9]*)"?[^0-9]/i;function c(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,f,p=/<sync[ >]/gi,v=/<sync[ >]|<\/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=c(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(;d=p.exec(e),f=v.exec(e),null!==d||null!==f;){if(null===d||null===f||d.index>=f.index)throw new Error("parse error");var b=e.slice(d.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)");S(b.split("\n"),E/1e3)}return function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n],o=a.start,s=a.end,u=a.text;if((0,i.Z)(u)&&null!=s){var l=(0,r.Z)(o,s,u);null!=l&&t.push(l)}}return t}(h);function S(e,n){for(var r,i,s=e.length;--s>=0;)if(null!==(r=u.exec(e[s]))){var l=r,c=l[1],d=l[2];y===c&&("&nbsp;"===d?h[h.length-1].end=n:h.push({text:(i=d,i.replace(o,"\n").replace(a,(function(e,t){return String.fromCharCode(Number(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;n<e.length;n++)if((0,r.Z)(e[n])){var a=i(e,n),o=e.slice(n,a);o.length>0&&(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;u<a.length;u++){var l=(0,i.Z)(a[u],t);if(null!=l){var c=o(l);null!=c&&s.push(c)}}return s}function o(e){var t=e.start,n=e.end,r=e.payload,i=document.createElement("div");i.className="rxp-texttrack-p",i.style.fontSize="28px",i.style.position="absolute",i.style.bottom="5%",i.style.width="100%",i.style.textAlign="center",i.style.color="#fff",i.style.textShadow="-1px -1px 2px #000,1px -1px 2px #000,-1px 1px 2px #000,1px 1px 2px #000";for(var a=0;a<r.length;a++){0!==a&&i.appendChild(document.createElement("br"));var o=s(r[a]);i.appendChild(o)}return{start:t,end:n,element:i}}function s(e){var t=document.createElement("div");t.innerHTML=e;return function e(t){var n=t.childNodes,r=document.createElement("span");r.className="rxp-texttrack-span";for(var i=0;i<n.length;i++){var a=n[i];if("#text"===a.nodeName){for(var o=a.wholeText.split("\n"),s=0;s<o.length;s++)if(0!==s&&r.appendChild(document.createElement("br")),o[s].length>0){var l=document.createTextNode(o[s]);r.appendChild(l)}}else if("B"===a.nodeName){var c=e(a);c.style.fontWeight="bold",r.appendChild(c)}else if("I"===a.nodeName){var d=e(a);d.style.fontStyle="italic",r.appendChild(d)}else if("U"===a.nodeName){var f=e(a);f.style.textDecoration="underline",r.appendChild(f)}else if(u(a)&&"string"==typeof a.color){var p=e(a);p.style.color=a.color,r.appendChild(p)}else{var v=e(a);r.appendChild(v)}}return r}(t)}function u(e){return"FONT"===e.nodeName&&"color"in e}},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,c=e.split(/\r\n|\n|\r/),d=(0,i.Z)(c),f=[],p=0;p<d.length;p++){var v=(0,a.Z)(d[p],t);if(null!==v){var h=(o=void 0,s=void 0,u=void 0,l=void 0,o=(n=v).start,s=n.end,u=n.payload,l=u.join("\n"),(0,r.Z)(o,s,l));null!==h&&f.push(h)}}return f}},788:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":");if((0,r.Z)(t[2])){var n=parseInt(t[0],10),i=parseInt(t[1],10),a=parseFloat(t[2].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){if(0===e.length)return null;var n,a,o=[];if((0,r.Z)(e[1])&&-1!==e[1].indexOf("--\x3e")){var s=e[1].split("--\x3e").map((function(e){return e.trim()}));n=s[0],a=s[1],o=e.slice(2,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a)){var u=e[0].split("--\x3e").map((function(e){return e.trim()}));n=u[0],a=u[1],o=e.slice(1,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a))return null;var l=i(n),c=i(a);return void 0===l||void 0===c?null:{start:l+t,end:c+t,payload:o}}},4123:function(e,t,n){"use strict";function r(e,t){if(!(e.parentNode instanceof Element))return[];return function e(n){var r=[];n.tagName.toLowerCase()===t.toLowerCase()&&r.push(n);var i=n.parentNode;return i instanceof Element&&r.push.apply(r,e(i)),r}(e.parentNode)}n.d(t,{Z:function(){return r}})},3791:function(e,t,n){"use strict";n.d(t,{U:function(){return s},b:function(){return u}});var r=n(3274),i=n(7714),a=n(6923),o=n(9252);function s(e,t,n,o){for(var s={},u=e.slice(),l=0;l<=t.length-1;l++){var c=t[l];if(void 0!==c){var d=function(){var e=void 0,t=void 0;if(c.nodeType===Node.ELEMENT_NODE)for(var l=c,d=0;d<=l.attributes.length-1;d++){var f=l.attributes[d],p=f.name;if("style"===p)e=f.value;else if("region"===p)t=f.value;else{var v=p.substring(4);if((0,i.Z)(u,v)&&(s[v]=f.value,u.splice(d,1),0===u.length))return{v:s}}}if((0,a.Z)(e)){var h=(0,r.Z)(n,(function(t){return t.id===e}));if(void 0!==h)for(var m=0;m<=u.length-1;m++){var g=u[m];if(!(0,a.Z)(s[g])&&(0,a.Z)(h.style[g])){if(s[g]=h.style[g],u.splice(m,1),0===u.length)return{v:s};m--}}}if((0,a.Z)(t)){var y=(0,r.Z)(o,(function(e){return e.id===t}));if(void 0!==y)for(var _=0;_<=u.length-1;_++){var b=u[_];if(!(0,a.Z)(s[b])&&(0,a.Z)(y.style[b])){if(s[b]=y.style[b],u.splice(_,1),0===u.length)return{v:s};_--}}}}();if("object"==typeof d)return d.v}}return s}function u(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};for(var t=e,n={},r=0;r<=t.attributes.length-1;r++){var i=t.attributes[r];if((0,o.Z)(i.name,"tts"))n[i.name.substring(4)]=i.value}return n}},6177:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(6923),i=n(5336);function a(e,t){var n=e.exec(t);if(null===n||""===n[0])return null;var r=Number(n[1]);isNaN(r)&&(r=0);var i=Number(n[2]);isNaN(i)&&(i=0);var a=Number(n[3]);isNaN(a)&&(a=0);var o=Number(n[4]);return isNaN(o)&&(o=0),o/1e3+a+60*i+3600*r}var o=function(e,t){return i.gu.test(e)?function(e,t){var n=i.gu.exec(t),r=Number(n[1]),a=Number(n[2]),o=Number(n[3]),s=Number(n[4]),u=Number(n[5]);isNaN(u)&&(u=0);return s+=u/e.subFrameRate,(o+=s/e.frameRate)+60*a+3600*r}(t,e):i.KO.test(e)?a(i.KO,e):i.wf.test(e)?a(i.wf,e):i.jb.test(e)?function(e,t){var n=i.jb.exec(t);return Number(n[1])/e.frameRate}(t,e):i.Du.test(e)?function(e,t){var n=i.Du.exec(t);return Number(n[1])/e.tickRate}(t,e):i.te.test(e)?a(i.te,e):void 0};function s(e,t){var n=e.getAttribute("begin"),i=e.getAttribute("dur"),a=e.getAttribute("end"),s=(0,r.Z)(n)?o(n,t):null,u=(0,r.Z)(i)?o(i,t):null,l=(0,r.Z)(a)?o(a,t):null;if(null==s||null==l&&null==u)throw new Error("Invalid text cue");return{start:s,end:null==l?s+u:l}}},7439:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(5403);function i(e){return void 0===e.extent&&void 0===e.origin&&void 0===e.displayAlign&&void 0===e.display&&void 0===e.textAlign&&void 0===e.fontSize}function a(e){e.extent="70% 20%",e.fontSize="1c",e.origin="15% 80%",e.displayAlign="before",e.textAlign="center"}var o,s=n(6177);function u(e,t){(void 0===o&&(o=void 0!==e.classList&&"function"==typeof e.classList.add),o)?e.classList.add(t):(" "+e.className+" ").indexOf(" "+t+" ")<0&&(e.className+=" "+t)}var l=n(6923),c=n(8026),d=n(4123),f=n(3791),p=n(3887),v=n(5336);function h(e,t){return"-1px -1px "+t+" "+e+",1px -1px "+t+" "+e+",-1px 1px "+t+" "+e+",1px 1px "+t+" "+e}function m(e){var t;return null!=(t=v.Dq.exec(e))?"rgba("+String(parseInt(t[1],16))+","+String(parseInt(t[2],16))+","+String(parseInt(t[3],16))+","+String(parseInt(t[4],16)/255)+")":null!=(t=v.YU.exec(e))?"rgba("+String(parseInt(t[1]+t[1],16))+","+String(parseInt(t[2]+t[2],16))+","+String(parseInt(t[3]+t[3],16))+","+String(parseInt(t[4]+t[4],16)/255)+")":null!=(t=v.GK.exec(e))?"rgb("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+")":null!=(t=v.ev.exec(e))?"rgba("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+","+String(+t[4]/255)+")":e}var g=["color","direction","display","fontFamily","fontSize","fontStyle","fontWeight","textDecoration","textOutline","unicodeBidi","visibility","wrapOption"];function y(e,t,n){var r=t.color;(0,l.Z)(r)&&(e.style.color=m(r));var i=t.backgroundColor;(0,l.Z)(i)&&(e.style.backgroundColor=m(i));var a=t.textOutline;if((0,l.Z)(a)){var o=a.trim().replace(/\s+/g," ").split(" "),s=o.length;if(3===s){var c=m(o[0]),d=o[1];e.style.textShadow=h(c,d)}else if((0,l.Z)(r)&&1===s){var f=o[0];e.style.textShadow=h(r,f)}else if(2===s){var g=/^[#A-Z]/i.test(o[0]);if(g!==/^[0-9]/.test(o[0]))if(g){var y=m(o[0]),_=o[1];e.style.textShadow=h(y,_)}else if((0,l.Z)(r)){var b=o[0];e.style.textShadow=h(r,b)}}}var T=t.textDecoration;if((0,l.Z)(T))switch(T){case"noUnderline":case"noLineThrough":case"noOverline":e.style.textDecoration="none";break;case"lineThrough":e.style.textDecoration="line-through";break;default:e.style.textDecoration=T}var E=t.fontFamily;if((0,l.Z)(E))switch(E){case"proportionalSansSerif":e.style.fontFamily="Arial, Helvetica, Liberation Sans, sans-serif";break;case"monospaceSansSerif":case"sansSerif":e.style.fontFamily="sans-serif";break;case"monospaceSerif":case"default":e.style.fontFamily="Courier New, Liberation Mono, monospace";break;case"proportionalSerif":e.style.fontFamily="serif";break;default:e.style.fontFamily=E}var S=t.fontStyle;(0,l.Z)(S)&&(e.style.fontStyle=S);var w=t.fontWeight;(0,l.Z)(w)&&(e.style.fontWeight=w);var k=t.fontSize;(0,l.Z)(k)?function(e,t){var n=t.trim().split(" ");if(0!==n.length){var r=v.eT.exec(n[0]);if(null!==r)if("px"===r[2]||"em"===r[2])e.style.fontSize=r[1]+r[2];else if("c"===r[2])e.style.position="relative",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size",r[1]);else if("%"===r[2]){var i=Number(r[1]);isNaN(i)?p.Z.warn('TTML Parser: could not parse fontSize value "'+r[1]+'" into a number'):(e.style.position="relative",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size",String(i/100)))}else p.Z.warn("TTML Parser: unhandled fontSize unit:",r[2])}}(e,k):(u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1"));var A=t.direction;(0,l.Z)(A)&&(e.style.direction=A);var x=t.unicodeBidi;if((0,l.Z)(x))switch(x){case"bidiOverride":e.style.unicodeBidi="bidi-override";break;case"embed":e.style.unicodeBidi="embed";break;default:e.style.unicodeBidi="normal"}var I=t.visibility;(0,l.Z)(I)&&(e.style.visibility=I),"none"===t.display&&(e.style.display="none");var Z=t.wrapOption;e.style.whiteSpace="noWrap"===Z?n?"nowrap":"pre":n?"normal":"pre-wrap"}function _(e,t){e.style.color="white",e.style.position="absolute";var n=t.extent;(0,l.Z)(n)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=v.eT.exec(r[0]),a=v.eT.exec(r[1]);null!==i&&null!==a&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.width=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-width",i[1])):p.Z.warn("TTML Parser: unhandled extent unit:",i[2]),"px"===a[2]||"%"===a[2]||"em"===a[2]?e.style.height=a[1]+a[2]:"c"===a[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-height",a[1])):p.Z.warn("TTML Parser: unhandled extent unit:",a[2]))}}}(e,n);var r=t.writingMode;(0,l.Z)(r);var i=t.overflow;e.style.overflow=(0,l.Z)(i)?i:"hidden";var a=t.padding;(0,l.Z)(a)&&function(e,t){var n=t.trim().split(" ");if(!(n.length<1)){var r=v.eT.exec(n[0]);if(null!==r){if("px"===r[2]||"%"===r[2]||"em"===r[2]){var i=r[1]+r[2];1===n.length?e.style.padding=i:2===n.length?(e.style.paddingTop=i,e.style.paddingBottom=i):e.style.paddingTop=i}else"c"===r[2]?(u(e,"proportional-style"),1===n.length?(e.setAttribute("data-proportional-padding-top",r[1]),e.setAttribute("data-proportional-padding-bottom",r[1]),e.setAttribute("data-proportional-padding-left",r[1]),e.setAttribute("data-proportional-padding-right",r[1])):2===n.length?(e.setAttribute("data-proportional-padding-top",r[1]),e.setAttribute("data-proportional-padding-bottom",r[1])):e.setAttribute("data-proportional-padding-top",r[1])):p.Z.warn("TTML Parser: unhandled padding unit:",r[2]);if(1!==n.length){var a=v.eT.exec(n[1]);if(null!==a){if("px"===a[2]||"%"===a[2]||"em"===a[2]){var o=a[1]+a[2];n.length<4?(e.style.paddingLeft=o,e.style.paddingRight=o):e.style.paddingRight=o}else"c"===a[2]?(u(e,"proportional-style"),n.length<4?(e.setAttribute("data-proportional-padding-left",a[1]),e.setAttribute("data-proportional-padding-right",a[1])):e.setAttribute("data-proportional-padding-right",a[1])):p.Z.warn("TTML Parser: unhandled padding unit:",a[2]);if(2!==n.length){var s=v.eT.exec(n[2]);if(null!==s){if("px"===s[2]||"%"===s[2]||"em"===s[2]){var l=s[1]+s[2];e.style.paddingBottom=l}else"c"===s[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-bottom",s[1])):p.Z.warn("TTML Parser: unhandled padding unit:",s[2]);if(3!==n.length){var c=v.eT.exec(n[3]);if(null!==c)if("px"===c[2]||"%"===c[2]||"em"===c[2]){var d=c[1]+c[2];e.style.paddingLeft=d}else"c"===c[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-left",c[1])):p.Z.warn("TTML Parser: unhandled padding unit:",c[2])}}}}}}}}(e,a);var o=t.origin;(0,l.Z)(o)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=v.eT.exec(r[0]),a=v.eT.exec(r[1]);null!==i&&null!==a&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.left=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-left",i[1])):p.Z.warn("TTML Parser: unhandled origin unit:",i[2]),"px"===a[2]||"%"===a[2]||"em"===a[2]?e.style.top=a[1]+a[2]:"c"===a[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-top",a[1])):p.Z.warn("TTML Parser: unhandled origin unit:",a[2]))}}}(e,o);var s=t.displayAlign;if((0,l.Z)(s))switch(e.style.display="flex",e.style.flexDirection="column",s){case"before":e.style.justifyContent="flex-start";break;case"center":e.style.justifyContent="center";break;case"after":e.style.justifyContent="flex-end"}var c=t.opacity;(0,l.Z)(c)&&(e.style.opacity=c);var d=t.visibility;(0,l.Z)(d)&&(e.style.visibility=d),"none"===t.display&&(e.style.display="none")}function b(e,t){e.style.margin="0px";var n=t.backgroundColor;(0,l.Z)(n)&&(e.style.backgroundColor=m(n));var r=t.lineHeight;(0,l.Z)(r)&&function(e,t){var n=t.trim();if("auto"!==n){var r=v.eT.exec(n[0]);null!==r&&("px"===r[2]||"%"===r[2]||"em"===r[2]?e.style.lineHeight=r[1]+r[2]:"c"===r[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-line-height",r[1])):p.Z.warn("TTML Parser: unhandled lineHeight unit:",r[2]))}}(e,r);var i=t.textAlign;if((0,l.Z)(i))switch(i){case"center":e.style.textAlign="center";break;case"left":case"start":e.style.textAlign="left";break;case"right":case"end":e.style.textAlign="right"}}function T(e,t,n){var r=document.createElement("span"),i=null===e.textContent?"":e.textContent;if(n){var a=i.trim();i=a=a.replace(/\s+/g," ")}return r.innerHTML=i,r.className="rxp-texttrack-span",y(r,t,n),r}function E(e,t,n,r,i,a){var o=a.cellResolution,s=a.shouldTrimWhiteSpace,u=(0,d.Z)(e,"div"),p=document.createElement("DIV");if(p.className="rxp-texttrack-region",p.setAttribute("data-resolution-columns",String(o.columns)),p.setAttribute("data-resolution-rows",String(o.rows)),_(p,i),null!==t){var v=(0,f.U)(["backgroundColor"],[].concat(u,[t]),r,n).bodyBackgroundColor;(0,l.Z)(v)&&(p.style.backgroundColor=m(v))}var h=document.createElement("p");h.className="rxp-texttrack-p",b(h,i);for(var y=function(e,t,n,r,i){return function e(r,i,a,o){for(var s=r.childNodes,u=[],d=0;d<s.length;d++){var p=s[d];if("#text"===p.nodeName){var v=(0,f.U)(["backgroundColor"],a,n,t).backgroundColor;(0,l.Z)(v)?i.backgroundColor=v:delete i.backgroundColor;var h=T(p,i,o);u.push(h)}else if("br"===p.nodeName){var m=document.createElement("BR");u.push(m)}else if("span"===p.nodeName&&p.nodeType===Node.ELEMENT_NODE&&p.childNodes.length>0){var y=p.getAttribute("xml:space"),_=(0,l.Z)(y)?"default"===y:o,b=(0,c.Z)({},i,(0,f.U)(g,[p],n,t));u.push.apply(u,e(p,b,[p].concat(a),_))}}return u}(e,(0,c.Z)({},r),[],i)}(e,n,r,i,s),E=0;E<y.length;E++)h.appendChild(y[E]);return p.appendChild(h),p}function S(e){var t=e.paragraph,n=e.ttParams,r=e.body,i=e.regionStyles,a=e.idStyles,o=e.paragraphStyle,u=e.timeOffset,l=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var c=n.cellResolution,d=(0,s.Z)(t,n);return{start:d.start+u,end:d.end+u,element:E(t,r,i,a,o,{cellResolution:c,shouldTrimWhiteSpace:l})}}var w=function(e,t){for(var n=(0,r.Z)(e,t),o=[],s=0;s<n.length;s++){var u=n[s].paragraphStyle;i(u)&&a(u);var l=S(n[s]);null!==l&&o.push(l)}return o}},1570:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(5403),i=n(7253),a=n(1988),o=n(6923),s=n(6177),u=n(5336),l={left:"start",center:"center",right:"end",start:"start",end:"end"},c={left:"line-left",center:"center",right:"line-right"};function d(e){var t=e.paragraph,n=e.timeOffset,r=e.paragraphStyle,d=e.ttParams,f=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var p=(0,s.Z)(t,d),v=p.start,h=p.end,m=function(e,t){function n(e,t){for(var r=e.childNodes,i="",a=0;a<r.length;a++){var s=r[a];if("#text"===s.nodeName){var u=s.textContent;if(null===u&&(u=""),t){var l=u.trim();u=l=l.replace(/\s+/g," ")}i+=u.replace(/&|\u0026/g,"&amp;").replace(/<|\u003C/g,"&lt;").replace(/>|\u2265/g,"&gt;").replace(/\u200E/g,"&lrm;").replace(/\u200F/g,"&rlm;").replace(/\u00A0/g,"&nbsp;")}else if("br"===s.nodeName)i+="\n";else if("span"===s.nodeName&&s.nodeType===Node.ELEMENT_NODE&&s.childNodes.length>0){var c=s.getAttribute("xml:space");i+=n(s,(0,o.Z)(c)?"default"===c: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=c[a];e.positionAlign=void 0===s?"":s;var d=l[a];e.lineAlign=void 0===d?"":d}}(g,r),g)}var f=function(e,t){for(var n=(0,r.Z)(e,t),i=[],a=0;a<n.length;a++){var o=d(n[a]);null!==o&&i.push(o)}return i}},5403:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(3274),i=n(6923),a=n(8026),o=n(3887),s=/(\d+) (\d+)/;var u=n(4123),l=n(3791);var c=n(5138),d=n(7714);var f=["align","backgroundColor","color","direction","display","displayAlign","extent","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","opacity","origin","overflow","padding","textAlign","textDecoration","textOutline","unicodeBidi","visibility","wrapOption","writingMode"];function p(e,t){var n=[],p=(new DOMParser).parseFromString(e,"text/xml");if(null!=p){var v=p.getElementsByTagName("tt")[0];if(void 0===v)throw new Error("invalid XML");for(var h=function(e){var t=e.getElementsByTagName("body");return t.length>0?t[0]:null}(v),m=function(e){return e.getElementsByTagName("style")}(v),g=function(e){return e.getElementsByTagName("region")}(v),y=function(e){return e.getElementsByTagName("p")}(v),_=function(e){var t=e.getAttribute("ttp:frameRate"),n=e.getAttribute("ttp:subFramRate"),r=e.getAttribute("ttp:tickRate"),a=e.getAttribute("ttp:frameRateMultiplier"),u=e.getAttribute("xml:space"),l=e.getAttribute("ttp:cellResolution"),c={columns:32,rows:15};if(null!==l){var d=s.exec(l);if(null===d||d.length<3)o.Z.warn("TTML Parser: Invalid cellResolution");else{var f=parseInt(d[1],10),p=parseInt(d[2],10);isNaN(f)||isNaN(p)?o.Z.warn("TTML Parser: Invalid cellResolution"):c={columns:f,rows:p}}}if((0,i.Z)(u)&&"default"!==u&&"preserve"!==u)throw new Error("Invalid spacing style");var v=Number(t);(isNaN(v)||v<=0)&&(v=30);var h=Number(n);(isNaN(h)||h<=0)&&(h=1);var m=Number(r);(isNaN(m)||m<=0)&&(m=void 0);var g=v,y=null!=h?h:1,_=null!==u?u:"default",b=void 0!==m?m:v*h;if(null!==a){var T=/^(\d+) (\d+)$/g.exec(a);null!==T&&(g=v*(Number(T[1])/Number(T[2])))}return{cellResolution:c,tickRate:b,frameRate:g,subFrameRate:y,spaceStyle:_}}(v),b=[],T=0;T<=m.length-1;T++){var E=m[T];if(E instanceof Element){var S=E.getAttribute("xml:id");if(null!==S){var w=E.getAttribute("style"),k=null===w?[]:w.split(" ");b.push({id:S,style:(0,l.b)(E),extendsStyles:k})}}}!function(e){var t=[];function n(r,i){t.push(i);for(var s=function(i){var s=r.extendsStyles[i],u=(0,c.Z)(e,(function(e){return e.id===s}));if(u<0)o.Z.warn("TTML Parser: unknown style inheritance: "+s);else{var l=e[u];(0,d.Z)(t,u)?o.Z.warn("TTML Parser: infinite style inheritance loop avoided"):n(l,u),r.style=(0,a.Z)({},l.style,r.style)}},u=0;u<r.extendsStyles.length;u++)s(u);r.extendsStyles.length=0}for(var r=0;r<e.length;r++)n(e[r],r),t.length=0}(b);for(var A=[],x=0;x<=g.length-1;x++){var I=g[x];if(I instanceof Element){var Z=I.getAttribute("xml:id");null!==Z&&function(){var e=(0,l.b)(I),t=I.getAttribute("style");if((0,i.Z)(t)){var n=(0,r.Z)(b,(function(e){return e.id===t}));void 0!==n&&(e=(0,a.Z)({},n.style,e))}A.push({id:Z,style:e,extendsStyles:[]})}()}}for(var R=(0,l.U)(f,null!==h?[h]:[],b,A),M="default"===(null!==h?h.getAttribute("xml:space"):void 0)||"default"===_.spaceStyle,C=0;C<y.length;C++){var P=y[C];if(P instanceof Element){var D=(0,u.Z)(P,"div"),N=(0,a.Z)({},R,(0,l.U)(f,[P].concat(D),b,A)),O=P.getAttribute("xml:space"),L=(0,i.Z)(O)?"default"===O:M,B={paragraph:P,timeOffset:t,idStyles:b,regionStyles:A,body:h,paragraphStyle:N,ttParams:_,shouldTrimWhiteSpace:L};null!==B&&n.push(B)}}}return n}},5336:function(e,t,n){"use strict";n.d(t,{Dq:function(){return d},Du:function(){return s},GK:function(){return p},KO:function(){return i},YU:function(){return f},_0:function(){return l},eT:function(){return c},ev:function(){return v},gu:function(){return r},jb:function(){return o},te:function(){return u},wf:function(){return a}});var r=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,i=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,a=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,o=/^(\d*\.?\d*)f$/,s=/^(\d*\.?\d*)t$/,u=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/,l=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,c=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/,d=/^#([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})$/,f=/^#([0-9A-f])([0-9A-f])([0-9A-f])([0-9A-f])$/,p=/^rgb\( *(\d+) *, *(\d+) *, *(\d+) *\)/,v=/^rgba\( *(\d+) *, *(\d+) *, *(\d+) *, *(\d+) *\)/},1138:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923),i=n(360);function a(e,t){for(var n=[],a=t;a<e.length;a++)if((0,i.tq)(e,a)){var o=(0,i.$4)(e,a);n.push(e.slice(a,o)),a=o}else if((0,r.Z)(e[a]))for(;(0,r.Z)(e[a]);)a++;return n}},4099:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var r=n(1138),i=n(6923),a=n(360);var o=n(9525),s={white:"#ffffff",lime:"#00ff00",cyan:"#00ffff",red:"#ff0000",yellow:"#ffff00",magenta:"#ff00ff",blue:"#0000ff",black:"#000000"};function u(e){var t=Object.keys(s).reduce((function(e,t){return e[t]="color: "+s[t]+";",e["bg_"+t]="background-color: "+s[t]+";",e}),{}),n="";return e.forEach((function(e){if(e.length>=2)for(var r=1;r<e.length;r++){var a=e[r];if(Array.isArray(/::cue {/.exec(a)))for(a=e[++r];(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)n+=a,a=e[++r];else!function(){for(var n=[],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);(0,i.Z)(a)&&Array.isArray(o);)n.push(o[1]),a=e[++r],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);for(var s="";(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)s+=a,a=e[++r];n.forEach((function(e){void 0===t[e]?t[e]=s:t[e]+=s}))}()}})),{classes:t,global:n}}var l=n(7714);function c(e,t){var n,r=["u","i","b"],a=e.nodeName.toLowerCase().split(".")[0];if((0,l.Z)(["u","i","b","c","#text"],a))if("#text"===a){var o=e.wholeText.split("\n");n=document.createElement("span");for(var s=0;s<o.length;s++)if(s>0&&n.appendChild(document.createElement("br")),o[s].length>0){var u=document.createTextNode(o[s]);n.appendChild(u)}}else{var d=e.nodeName.toLowerCase().split("."),f=[];if(d.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<e.childNodes.length;m++){var g=c(e.childNodes[m],t);n.appendChild(g)}}else{n=document.createElement("span");for(var y=0;y<e.childNodes.length;y++){var _=c(e.childNodes[y],t);n.appendChild(_)}}return n}var d=n(1679);var f,p,v,h=function(e){if(!(void 0!==e&&0!==(0,d.Z)(e).length))return"text-align:center";var t=m(e),n=_(e);return"position: absolute;margin: 0;transform: translate("+t.offset+"%,"+n.offset+"%);width: "+S(e.size)+"%;left: "+t.position+"%;top: "+(null!==n.position?n.position+"%":"auto")+";text-align: "+E(e.align)+";"};!function(e){e.LINE_LEFT="line-left",e.CENTER="center",e.LINE_RIGHT="line-right"}(f||(f={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(p||(p={})),function(e){e.START="start",e.CENTER="center",e.END="end"}(v||(v={}));var m=function(e){return{position:g(e),offset:y(e)}},g=function(e){var t,n=k(e.position);if(null!==n)return n;var r=E(e.align);return((t={})[p.LEFT]=0,t[p.CENTER]=50,t[p.RIGHT]=100,t)[r]},y=function(e){var t,n,r,i,a=((t={})[f.LINE_LEFT]=0,t[f.CENTER]=-50,t[f.LINE_RIGHT]=-100,t),o=void 0!==e.position?(r=e.position,i=/,(line-left|line-right|center)/.exec(r),!Array.isArray(i)||i.length<2?null:i[1]):null;return null!==o?a[o]:((n={})[p.LEFT]=0,n[p.CENTER]=-50,n[p.RIGHT]=-100,n)[void 0!==e.align?E(e.align):p.CENTER]},_=function(e){return{position:b(e.line),offset:T(e.line)}},b=function(e){return k(e)},T=function(e){var t,n=((t={})[v.START]=0,t[v.CENTER]=-50,t[v.END]=-100,t);if(void 0===e)return n[v.START];var r,i=(r=/,(start|center|end)/.exec(e),!Array.isArray(r)||r.length<2?null:r[1]);return null!==i?n[i]:n[v.START]},E=function(e){switch(e){case"left":case"start":return"left";case"right":case"end":return"right";default:return"center"}},S=function(e){return w(e,100)},w=function(e,t){var n=k(e);return null!==n?n:t},k=function(e){if(void 0===e)return null;var t=/^([\d.]+)%/.exec(e);return!Array.isArray(t)||t.length<2?null:parseInt(t[1],10)};function A(e,t){var n=e.start,r=e.end,a=e.settings,o=e.header,s=e.payload,u=document.createElement("div"),l=document.createAttribute("style");l.value="width:100%;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;",u.setAttributeNode(l);var d=document.createElement("p"),f=function(e){var t=document.createAttribute("style");return t.value=h(e),t}(a);d.setAttributeNode(f);var p=document.createElement("span"),v=document.createAttribute("style");v.value="background-color:rgba(0,0,0,0.8);color:white;",p.setAttributeNode(v);var m=t.global,g=t.classes,y=[m,(0,i.Z)(o)?g[o]:void 0].filter((function(e){return void 0!==e})).join("");return v.value+=y,p.setAttributeNode(v),function(e,t){for(var n=e.replace(/<[0-9]{2}:[0-9]{2}.[0-9]{3}>/,"").replace(/<([u,i,b,c])(\..*?)?(?: .*?)?>(.*?)<\/\1>/g,"<$1$2>$3</$1$2>"),r=(new DOMParser).parseFromString(n,"text/html").body.childNodes,i=[],a=0;a<r.length;a++)i.push(c(r[a],t));return i}(s.join("\n"),g).forEach((function(e){p.appendChild(e)})),u.appendChild(d),d.appendChild(p),{start:n,end:r,element:u}}var x=function(e,t){var n=e.split(/\r\n|\n|\r/g),s=[];if(null===/^WEBVTT( |\t|\n|\r|$)/.exec(n[0]))throw new Error("Can't parse WebVTT: Invalid File.");for(var l=(0,a.yE)(n),c=function(e,t){for(var n=[],r=t;r<e.length;r++)if((0,a.JF)(e,r)){var o=r;for(r++;(0,i.Z)(e[r]);)r++;var s=e.slice(o,r);n.push(s)}else if((0,i.Z)(e[r]))for(;(0,i.Z)(e[r]);)r++;return n}(n,l),d=(0,r.Z)(n,l),f=u(c),p=0;p<d.length;p++){var v=(0,o.Z)(d[p],t);if(null!=v){var h=A(v,f);s.push(h)}}return s}},9405:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(1988),i=n(1138),a=n(9525),o=n(360),s=n(7714),u=n(6923);function l(e,t){if(!(0,u.Z)(e.vertical)||"rl"!==e.vertical&&"lr"!==e.vertical||(t.vertical=e.vertical),(0,u.Z)(e.line)){var n=/^(\d+(\.\d+)?)%(,([a-z]+))?/.exec(e.line);if(Array.isArray(n))t.line=Number(n[1]),t.snapToLines=!1,(0,s.Z)(["start","center","end"],n[4])&&(t.lineAlign=n[4]);else{var r=/^(-?\d+)(,([a-z]+))?/.exec(e.line);Array.isArray(r)&&(t.line=Number(r[1]),t.snapToLines=!0,(0,s.Z)(["start","center","end"],r[3])&&(t.lineAlign=r[3]))}}if((0,u.Z)(e.position)){var i=/^([\d\.]+)%(?:,(line-left|line-right|center))?$/.exec(e.position);if(Array.isArray(i)&&i.length>=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 c=n(7253);var d=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,d,f,p=(0,o.yE)(n),v=(0,i.Z)(n,p),h=[],m=0;m<v.length;m++){var g=(0,a.Z)(v[m],t);if(null!=g){var y=(u=void 0,d=void 0,f=void 0,u=(s=g).start,d=s.end,f=s.payload.join("\n"),(0,c.Z)(u,d,f));null!=y&&((0,r.Z)(y)&&l(g.settings,y),h.push(y))}}return h}},9525:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":").reverse();if((0,r.Z)(t[2])||(0,r.Z)(t[1])){var n=(0,r.Z)(t[2])?parseInt(t[2],10):0,i=parseInt(t[1],10),a=parseFloat(t[0].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){var n,r,a,o=/-->/;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,{$4:function(){return s},JF:function(){return a},tq:function(){return o},yE:function(){return i}});var r=n(6923);function i(e){for(var t=0;t<e.length;){if(""===e[t])return t+1;t++}return t}function a(e,t){return"string"==typeof e[t]&&/^STYLE( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}function o(e,t){var n=e[t];if(void 0===n||""===n||a(e,t)||function(e,t){return"string"==typeof e[t]&&/^REGION( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}(e,t)||function(e,t){return"string"==typeof e[t]&&/^NOTE( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}(e,t))return!1;if(n.indexOf("--\x3e")>=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}},5877:function(e,t,n){"use strict";n.d(t,{Z:function(){return re}});var r=n(7874),i=n(8791),a=n(5861),o=n(7757),s=n.n(o),u=n(4597),l=n(5278);function c(e,t,n,r){return d.apply(this,arguments)}function d(){return(d=(0,a.Z)(s().mark((function e(t,n,r,i){var a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.segment.isInit&&null!==t){e.next=3;break}return e.abrupt("return",{resultType:"segment-created",resultData:null});case 3:return e.next=5,(0,u.ZP)({url:t,responseType:"arraybuffer",onProgress:i.onProgress,cancelSignal:r});case 5:return a=e.sent,e.abrupt("return",{resultType:"segment-loaded",resultData:a});case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(e,t){var n=t.segment,i=t.period,a=e.data,o=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(o)throw new Error("Image data should not be downloaded in chunks");var s=(0,l.Z)(n.timestampOffset,0);return null===a||null===r.Z.imageParser?{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:{duration:n.duration,time:n.time},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}:{segmentType:"media",chunkData:{data:r.Z.imageParser(new Uint8Array(a)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkSize:void 0,chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}}var p=n(8750),v=n(3887),h=n(1989),m=n(8026),g=n(3635);function y(e){var t=e.aggressiveMode,n=e.referenceDateTime,i=void 0!==e.serverSyncInfos?e.serverSyncInfos.serverTimestamp-e.serverSyncInfos.clientTime:void 0;return function(a,o,s,l,c){var d,f=a.responseData,y=o.externalClockOffset,_=null!==(d=a.url)&&void 0!==d?d:o.originalUrl,b=null!=i?i:y,T={aggressiveMode:!0===t,unsafelyBaseOnPreviousManifest:o.unsafeMode?o.previousManifest:null,url:_,referenceDateTime:n,externalClockOffset:b},E=r.Z.dashParsers;if(null===E.wasm||"uninitialized"===E.wasm.status||"failure"===E.wasm.status)return v.Z.debug("DASH: WASM MPD Parser not initialized. Running JS one."),w();var S=function(e){if(e instanceof ArrayBuffer)return e;if("string"==typeof e)return(0,g.tG)(e).buffer;if(e instanceof Document)return(0,g.tG)(e.documentElement.innerHTML).buffer;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(f);return 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}(S)?"initialized"===E.wasm.status?(v.Z.debug("DASH: Running WASM MPD Parser."),k(E.wasm.runWasmParser(S,T))):(v.Z.debug("DASH: Awaiting WASM initialization before parsing the MPD."),E.wasm.waitForInitialization().catch((function(){})).then((function(){return null===E.wasm||"initialized"!==E.wasm.status?(v.Z.warn("DASH: WASM MPD parser initialization failed. Running JS parser instead"),w()):(v.Z.debug("DASH: Running WASM MPD Parser."),k(E.wasm.runWasmParser(S,T)))}))):(v.Z.info("DASH: MPD doesn't seem to be UTF-8-encoded. Running JS parser instead of the WASM one."),w());function w(){if(null===E.js)throw new Error("No MPD parser is imported");var e=function(e){if(e instanceof ArrayBuffer)return(new DOMParser).parseFromString((0,g.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")}(f);return k(E.js(e,T))}function k(t){if("done"===t.type)return t.value.warnings.length>0&&s(t.value.warnings),l.isCancelled?Promise.reject(l.cancellationError):{manifest:new h.ZP(t.value.parsed,e),url:_};var n=t.value,r=n.urls.map((function(e){return c((function(){return"string"===n.format?(0,u.ZP)({url:e,responseType:"text",cancelSignal:l}):(0,u.ZP)({url:e,responseType:"arraybuffer",cancelSignal:l})})).then((function(e){if("string"===n.format){if("string"!=typeof e.responseData)throw new Error("External DASH resources should have been a string");return(0,m.Z)(e,{responseData:{success:!0,data:e.responseData}})}if(!(e.responseData instanceof ArrayBuffer))throw new Error("External DASH resources should have been ArrayBuffers");return(0,m.Z)(e,{responseData:{success:!0,data:e.responseData}})}),(function(e){var t=(0,p.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"An unknown error occured when parsing ressources."});return(0,m.Z)({},{size:void 0,requestDuration:void 0,responseData:{success:!1,error:t}})}))}));return Promise.all(r).then((function(e){return n.format,k(n.continue(e))}))}}}var _=n(7839),b=n(6872),T=n(9105),E=n(5992),S=n(1946),w="function"==typeof Headers?Headers:null,k="function"==typeof AbortController?AbortController:null;function A(){return"function"==typeof window.fetch&&!(0,S.Z)(k)&&!(0,S.Z)(w)}var x=n(8806),I=n(281);function Z(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 R=n(288),M=n(4460);function C(e){return function(t,n,r,i){return new Promise((function(a,o){var s=new R.ZP,u=r.register((function(e){s.cancel(),o(e)}));function l(e){if((e instanceof Array||e instanceof Uint8Array)&&"mp4"===Z(n.adaptation.type,n.representation))try{(0,M.Z)(new Uint8Array(e),n.segment.isInit)}catch(e){u(),s.cancel(),o(e)}}e(t,n,s.signal,Object.assign(Object.assign({},i),{onNewChunk:function(e){l(e),s.isUsed||i.onNewChunk(e)}})).then((function(e){s.isUsed||(u(),"segment-loaded"===e.resultType&&l(e.resultData.responseData),a(e))}),(function(e){R.ZP.isCancellationError(e)||(u(),o(e))}))}))}}var P=n(6968);function D(e,t,n,r){if(void 0===t.range)return(0,u.ZP)({url:e,responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(void 0===t.indexRange)return(0,u.ZP)({url:e,headers:{Range:(0,I.Z)(t.range)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(t.range[1]+1===t.indexRange[0])return(0,u.ZP)({url:e,headers:{Range:(0,I.Z)([t.range[0],t.indexRange[1]])},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));var i=(0,u.ZP)({url:e,headers:{Range:(0,I.Z)(t.range)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}),a=(0,u.ZP)({url:e,headers:{Range:(0,I.Z)(t.indexRange)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress});return Promise.all([i,a]).then((function(t){var n=t[0],r=t[1],i=(0,P.zo)(new Uint8Array(n.responseData),new Uint8Array(r.responseData)),a=Math.min(n.sendingTime,r.sendingTime),o=Math.max(n.receivedTime,r.receivedTime);return{resultType:"segment-loaded",resultData:{url:e,responseData:i,size:n.size+r.size,requestDuration:o-a,sendingTime:a,receivedTime:o}}}))}var N=n(8766);function O(e,t,n,r){var i=t.segment,o=void 0!==i.range?{Range:(0,I.Z)(i.range)}:void 0,u=null;return function(e){var t;if(!(0,S.Z)(e.headers))if((0,S.Z)(w))t=e.headers;else{t=new w;for(var n=Object.keys(e.headers),r=0;r<n.length;r++){var i=n[r];t.append(i,e.headers[i])}}v.Z.debug("Fetch: Called with URL",e.url);var o=null,u=!1,l=performance.now(),c=(0,S.Z)(k)?null:new k;function d(){(0,S.Z)(c)?v.Z.warn("Fetch: AbortController API not available."):c.abort()}var f=(0,S.Z)(e.timeout)?b.Z.getCurrent().DEFAULT_REQUEST_TIMEOUT:e.timeout,p=window.setTimeout((function(){u=!0,d()}),f),h=e.cancelSignal.register((function(e){o=e,d()})),m={method:"GET"};return void 0!==t&&(m.headers=t),m.signal=(0,S.Z)(c)?null:c.signal,fetch(e.url,m).then((function(t){if((0,S.Z)(p)||clearTimeout(p),t.status>=300)throw v.Z.warn("Fetch: Request HTTP Error",t),new T.Z(t.url,t.status,E.br.ERROR_HTTP_CODE);if((0,S.Z)(t.body))throw new T.Z(t.url,t.status,E.br.PARSE_ERROR);var n=t.headers.get("Content-Length"),r=(0,S.Z)(n)||isNaN(+n)?void 0:+n,i=t.body.getReader(),o=0;return u();function u(){return c.apply(this,arguments)}function c(){return(c=(0,a.Z)(s().mark((function n(){var a,c,d,f,p;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i.read();case 2:if((a=n.sent).done||(0,S.Z)(a.value)){n.next=11;break}return o+=a.value.byteLength,c=performance.now(),d={url:t.url,currentTime:c,duration:c-l,sendingTime:l,chunkSize:a.value.byteLength,chunk:a.value.buffer,size:o,totalSize:r},e.onData(d),n.abrupt("return",u());case 11:if(!a.done){n.next=16;break}return h(),f=performance.now(),p=f-l,n.abrupt("return",{requestDuration:p,receivedTime:f,sendingTime:l,size:o,status:t.status,url:t.url});case 16:return n.abrupt("return",u());case 17:case"end":return n.stop()}}),n)})))).apply(this,arguments)}})).catch((function(t){if(null!==o)throw o;if(h(),u)throw v.Z.warn("Fetch: Request timeouted."),new T.Z(e.url,0,E.br.TIMEOUT);if(t instanceof T.Z)throw t;throw v.Z.warn("Fetch: Request Error",t instanceof Error?t.toString():""),new T.Z(e.url,0,E.br.ERROR_EVENT)}))}({url:e,headers:o,onData:function(e){var t=new Uint8Array(e.chunk),i=function(e){for(var t=0,n=[];t<e.length;){var r=e.subarray(t,1/0),i=(0,N.Z)(r,1836019558);if(i<0)return[n,r];var a=t+i+(0,P.pX)(e,i+t);if(a>e.length)return[n,r];var o=(0,N.Z)(r,1835295092);if(o<0)return[n,r];var s=t+o+(0,P.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!==u?(0,P.zo)(u,t):t),a=i[0];u=i[1];for(var o=0;o<a.length;o++)if(n.onNewChunk(a[o]),r.isCancelled)return;n.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize}),r.isCancelled},cancelSignal:r}).then((function(e){return{resultType:"chunk-complete",resultData:e}}))}function L(e,t,n,r,i){if(t.segment.isInit)return D(e,t.segment,i,r);var a=Z(t.adaptation.type,t.representation);if(n&&("mp4"===a||void 0===a)){if(A())return O(e,t,r,i);(0,x.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 o=t.segment;return(0,u.ZP)({url:e,responseType:"arraybuffer",headers:void 0!==o.range?{Range:(0,I.Z)(o.range)}:void 0,cancelSignal:i,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}var B=n(6490),U=n(4644),F=408125543,z=357149030;function V(e,t,n,r){for(var i=r[0],a=r[1],o=i;o<a;){var s=W(n,o);if(null==s)return null;var u=s.value,l=o+s.length,c=j(n,l);if(null==c)return null;var d=l+c.length,f=d+c.value;if(u===e)return[d,f];if(t.length>0)for(var p=0;p<t.length;p++){if(u===t[p])return V(e,t.slice(p+1,t.length),n,[d,f])}o=f}return null}function K(e,t){var n=V(2807729,[F,z],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 1e9/q(e,n[0],r)}function G(e,t){var n=V(17545,[F,z],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 4===r?function(e,t){return new DataView(e.buffer).getFloat32(t)}(e,n[0]):8===r?function(e,t){return new DataView(e.buffer).getFloat64(t)}(e,n[0]):null}function H(e,t){for(var n=1;n<=8;n++)if(e[t]>=Math.pow(2,8-n))return n}function W(e,t){var n=H(e,t);if(null==n)return v.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return v.Z.warn("webm: impossible length"),null;for(var r=0,i=0;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return{length:n,value:r}}function j(e,t){var n=H(e,t);if(null==n)return v.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return v.Z.warn("webm: impossible length"),null;for(var r=(e[t]&(1<<8-n)-1)*Math.pow(2,8*(n-1)),i=1;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return{length:n,value:r}}function q(e,t,n){for(var r=0,i=0;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return r}var Y=n(7403);function $(e,t,n,r){var i=(0,U.Qx)(e);if(void 0===i||void 0===r)return null;var a,o=void 0!==n.timestampOffset?i+n.timestampOffset*r:i,s=(0,U.MM)(e);if(t||!n.complete)return void 0===s&&v.Z.warn("DASH: Chunked segments should indicate a duration through their trun boxes"),{time:o/r,duration:void 0!==s?s/r:void 0};var u=n.duration*r,l=Math.min(.9*r,u/4);return void 0!==s&&Math.abs(s-u)<=l&&(a=s),{time:o/r,duration:void 0!==a?a/r:a}}function X(e,t){if(0!==e.length){var n=e.reduce((function(e,t){return"urn:mpeg:dash:event:2012"===t.schemeIdUri&&"1"===t.value?(void 0===e.manifestRefreshEventsFromEMSGs&&(e.manifestRefreshEventsFromEMSGs=[]),e.manifestRefreshEventsFromEMSGs.push(t)):(void 0===e.EMSGs&&(e.EMSGs=[]),e.EMSGs.push(t)),e}),{manifestRefreshEventsFromEMSGs:void 0,EMSGs:void 0}),r=n.manifestRefreshEventsFromEMSGs,i=n.EMSGs;return{inbandEvents:null==i?void 0:i.map((function(e){return{type:"emsg",value:e}})),needsManifestRefresh:void 0!==t&&void 0!==r&&function(e,t){if(e.length<=0)return!1;for(var n=e.length,r=0;r<n;r++){var i=t,a=e[r].messageData,o=(0,g.uR)(a),s=Date.parse(o);if(void 0===i||void 0===s||isNaN(s)||s>=i)return!0}return!1}(r,t)}}}function Q(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i=n.period,a=n.adaptation,o=n.representation,s=n.segment,u=n.manifest,c=e.data,d=e.isChunked,f=[i.start,i.end];if(null===c)return s.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:f};var p=c instanceof Uint8Array?c:new Uint8Array(c),v=Z(a.type,o),h="mp4"===v||void 0===v,m=!1;if(h){var g=(0,B.Z)(p);g.length>0&&(m=o._addProtectionData("cenc",g))}if(!s.isInit){var y=h?$(p,d,s,r):null,_=(0,l.Z)(s.timestampOffset,0);if(h){var b=(0,U.s9)(p);if(void 0!==b){var T=X(b.filter((function(e){return void 0!==s.privateInfos&&void 0!==s.privateInfos.isEMSGWhitelisted&&s.privateInfos.isEMSGWhitelisted(e)})),u.publishTime);if(void 0!==T){var E=T.needsManifestRefresh,w=T.inbandEvents;return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:y,chunkOffset:_,appendWindow:f,inbandEvents:w,protectionDataUpdate:m,needsManifestRefresh:E}}}}return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:y,chunkOffset:_,protectionDataUpdate:m,appendWindow:f}}var k=s.indexRange,A=null;if("webm"===v)A=function(e,t){var n=V(F,[],e,[t,e.length]);if(null==n)return null;var r=n[0],i=n[1],a=K(e,r);if(null==a)return null;var o=G(e,r);if(null==o)return null;var s=V(475249515,[],e,[r,i]);if(null==s)return null;for(var u=[],l=s[0];l<s[1];){var c=V(187,[],e,[l,s[1]]);if(null==c)break;var d=V(179,[],e,[c[0],c[1]]);if(null==d)return null;var f=q(e,d[0],d[1]-d[0]),p=V(241,[183],e,[c[0],c[1]]);if(null==p)return null;var v=q(e,p[0],p[1]-p[0])+r;u.push({time:f,rangeStart:v}),l=c[1]}for(var h=[],m=0;m<u.length;m++){var g=u[m];m===u.length-1?h.push({time:g.time,timescale:a,duration:0===m?o:o-g.time,range:[g.rangeStart,1/0]}):h.push({time:g.time,timescale:a,duration:u[m+1].time-g.time,range:[g.rangeStart,u[m+1].rangeStart-1]})}return h}(p,0);else if(h&&(A=(0,U.Wf)(p,Array.isArray(k)?k[0]:0),!0===t&&null!==A&&A.length>0)){var x=A[A.length-1];Array.isArray(x.range)&&(x.range[1]=1/0)}o.index instanceof Y.Z&&null!==A&&A.length>0&&o.index.initializeIndex(A);var I=h?(0,U.LD)(p):"webm"===v?K(p,0):void 0,R=(0,S.Z)(I)?void 0:I;return{segmentType:"init",initializationData:p,initializationDataSize:p.length,protectionDataUpdate:m,initTimescale:R}}}var J=n(6807);function ee(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):v.Z.warn("Transport: Unavailable time data for current text track."):(i=n.time,void 0!==n.duration?a=i+n.duration:!r&&o.complete&&(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,J.Le)(e);return null===t?"":(0,g.uR)(t)}(t),type:l,language:s.language,start:i,end:a}}function te(e,t,n){var r,i,a=e.segment,o=e.adaptation,s=e.representation;return a.isInit?null:(n?v.Z.warn("Transport: Unavailable time data for current text track."):(r=a.time,a.complete&&(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 ne(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a=n.period,o=n.adaptation,s=n.representation,u=n.segment,c=e.data,d=e.isChunked;if(null===c)return u.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:null,chunkOffset:null!==(i=u.timestampOffset)&&void 0!==i?i:0,protectionDataUpdate:!1,appendWindow:[a.start,a.end]};var f=Z(o.type,s);if("webm"===f)throw new Error("Text tracks with a WEBM container are not yet handled.");return"mp4"===f?function(e,t,n,r,i){var a=n.period,o=n.representation,s=n.segment,u=s.isInit,c=s.indexRange,d="string"==typeof e?(0,g.tG)(e):e instanceof Uint8Array?e:new Uint8Array(e);if(u){var f=(0,U.Wf)(d,Array.isArray(c)?c[0]:0);if(!0===i&&null!==f&&f.length>0){var p=f[f.length-1];Array.isArray(p.range)&&(p.range[1]=1/0)}var v=(0,U.LD)(d);return o.index instanceof Y.Z&&null!==f&&f.length>0&&o.index.initializeIndex(f),{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:v}}var h=$(d,t,s,r),m=ee(n,d,h,t),y=(0,l.Z)(s.timestampOffset,0);return{segmentType:"media",chunkData:m,chunkSize:d.length,chunkInfos:h,chunkOffset:y,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(c,d,n,r,t):function(e,t,n){var r,i,a=n.period,o=n.segment,s=o.timestampOffset,u=void 0===s?0:s;if(o.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if("string"!=typeof e){var l=e instanceof Uint8Array?e:new Uint8Array(e);r=(0,g.uR)(l),i=l.length}else r=e;return{segmentType:"media",chunkData:te(n,r,t),chunkSize:i,chunkInfos:null,chunkOffset:u,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(c,d,n)}}var re=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=y(e),a=function(e){var t=e.lowLatencyMode,n=e.segmentLoader;return!0!==e.checkMediaSegmentIntegrity?r:C(r);function r(e,r,i,a){if(null==e)return Promise.resolve({resultType:"segment-created",resultData:null});if(t||void 0===n)return L(e,r,t,a,i);var o={adaptation:r.adaptation,manifest:r.manifest,period:r.period,representation:r.representation,segment:r.segment,transport:"dash",url:e};return new Promise((function(s,u){var l=!1,c=n(o,{reject:function(e){var t,n,r;if(!l&&!i.isCancelled){l=!0,i.deregister(d);var a=e,o=null!==(t=null==a?void 0:a.message)&&void 0!==t?t:"Unknown error when fetching a DASH segment through a custom segmentLoader.",s=new _.Z(o,null!==(n=null==a?void 0:a.canRetry)&&void 0!==n&&n,null!==(r=null==a?void 0:a.isOfflineError)&&void 0!==r&&r,null==a?void 0:a.xhr);u(s)}},resolve:function(e){l||i.isCancelled||(l=!0,i.deregister(d),s({resultType:"segment-loaded",resultData:{responseData:e.data,size:e.size,requestDuration:e.duration}}))},progress:function(e){l||i.isCancelled||a.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})},fallback:function(){l||i.isCancelled||(l=!0,i.deregister(d),L(e,r,t,a,i).then(s,u))}});function d(e){l||(l=!0,"function"==typeof c&&c(),u(e))}i.register(d)}))}}(e),o=Q(e);return{manifest:{loadManifest:t,parseManifest:n},audio:{loadSegment:a,parseSegment:o},video:{loadSegment:a,parseSegment:o},text:{loadSegment:function(e){var t=e.lowLatencyMode;return!0!==e.checkMediaSegmentIntegrity?n:C(n);function n(e,n,r,i){var a=n.adaptation,o=n.representation,s=n.segment,l=s.range;if(null===e)return Promise.resolve({resultType:"segment-created",resultData:null});if(s.isInit)return D(e,s,r,i);var c=Z(a.type,o),d="mp4"===c||void 0===c;if(t&&d){if(A())return O(e,n,i,r);(0,x.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")}return d?(0,u.ZP)({url:e,responseType:"arraybuffer",headers:Array.isArray(l)?{Range:(0,I.Z)(l)}:null,onProgress:i.onProgress,cancelSignal:r}).then((function(e){return{resultType:"segment-loaded",resultData:e}})):(0,u.ZP)({url:e,responseType:"text",headers:Array.isArray(l)?{Range:(0,I.Z)(l)}:null,onProgress:i.onProgress,cancelSignal:r}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}}(e),parseSegment:ne(e)},image:{loadSegment:c,parseSegment:f}}}},2339:function(e,t,n){"use strict";n.d(t,{Z:function(){return me}});var r=n(5861),i=n(7757),a=n.n(i),o=n(7874),s=n(3887),u=n(1989),l=n(6807),c=n(8999),d=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 S(e,t){return E(e,p.zo.apply(void 0,t))}function w(e){var t=[];e.periods.forEach((function(n){var r=n.id;if((0,d.Z)(t,r)){s.Z.warn("Two periods with the same ID found. Updating.");var i=r+"-dup";n.id=i,w(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,d.Z)(o,n)){s.Z.warn("Two adaptations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,w(e),o.push(r)}else o.push(n);var i=[];t.representations.forEach((function(t){var n=t.id;if((0,d.Z)(i,n)){s.Z.warn("Two representations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,w(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),R=n(3911),M=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,R.jH)(a,null)&&(a.duration===o.duration?a.repeatCount++:e.timeline.push({duration:o.duration,start:o.time,repeatCount:0}),!0))}function D(e,t){return e.replace(/\{start time\}/g,String(t))}function N(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,R.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,complete:!0}},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,c=this._isAggressiveMode,d=[],f=s.length,p=null==this._scaledLiveGap?void 0:performance.now()/1e3*u-this._scaledLiveGap,v=0;v<f;v++){for(var h=s[v],m=h.duration,g=h.start,y=O(h,s[v+1]),_=N(g,i,m),b=g+_*m,T=c?0:m;b<a&&_<=y&&(null==p||b+T<=p);){var E=b,S=null!=n?n+_:void 0,w={id:String(b),isInit:!1,time:E/u,end:(E+m)/u,duration:m/u,timescale:1,number:S,mediaURLs:[D(l,E)],complete:!0,privateInfos:{smoothMediaSegment:{time:E,duration:m}}};d.push(w),b=g+ ++_*m}if(b>=a)return d;null!=n&&(n+=y+1)}return d},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>=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,R.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,R._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,M.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,R.jH)(o,null);if(!((0,R.jH)(a,null)<=u))for(var l=0;l<t.length;l++){var c=t[l],d=(0,R.jH)(c,null);if(d===u)return void(this._index.timeline=this._index.timeline.concat(t.slice(l+1)));if(d>u){if(c.duration!==o.duration)return;var f=u-c.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%c.duration!=0)return;var p=f/c.duration-1,v=c.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<e.length;n++)P(this._index,e[n],t)},t._refreshTimeline=function(){if(null!=this._initialScaledLastPosition){var e=this._index,t=this._timeShiftBufferDepth,n=(performance.now()-this._indexValidityTime)/1e3+this._initialScaledLastPosition/e.timescale;if(null!=t){var r=(n-t)*e.timescale;(0,Z.Z)(e.timeline,r)}}},e}();function B(e,t,n){for(var r=e.firstElementChild,i=n;null!==r;)i=t(i,r.nodeName,r),r=r.nextElementSibling;return i}var U={audio:"audio/mp4",video:"video/mp4",text:"application/ttml+xml"},F={AACL:"audio/mp4",AVC1:"video/mp4",H264:"video/mp4",TTML:"application/ttml+xml+mp4",DFXP:"application/ttml+xml+mp4"};var z=function(e){void 0===e&&(e={});var t=void 0===e.referenceDateTime?Date.UTC(1970,0,1,0,0,0,0)/1e3:e.referenceDateTime,n=void 0===e.minRepresentationBitrate?0:e.minRepresentationBitrate,r=e.serverSyncInfos,i=void 0!==r?r.serverTimestamp-r.clientTime:void 0;function a(e,t){var n=B(e,(function(e,t,n){return"CustomAttributes"===t&&e.push.apply(e,B(n,(function(e,t,n){if("Attribute"===t){var r=n.getAttribute("Name"),i=n.getAttribute("Value");null!==r&&null!==i&&e.push(r+"="+i)}return e}),[])),e}),[]);function r(t){var n=e.getAttribute(t);return null==n?void 0:n}switch(t){case"audio":var i=r("AudioTag"),a=r("BitsPerSample"),o=r("Channels"),u=r("CodecPrivateData"),l=r("FourCC"),c=r("PacketSize"),d=r("SamplingRate"),f=r("Bitrate"),p=void 0===f||isNaN(parseInt(f,10))?0:parseInt(f,10);if(void 0!==l&&void 0===F[l]||void 0===u)return s.Z.warn("Smooth parser: Unsupported audio codec. Ignoring quality level."),null;var h=function(e,t){var n;return 0==(n="AACH"===t?5:(0,v.Z)(e)?(248&parseInt(e.substring(0,2),16))>>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!==c?parseInt(c,10):c,samplingRate:void 0!==d?parseInt(d,10):d};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 S=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:S,width:void 0!==_?parseInt(_,10):void 0,height:void 0!==b?parseInt(b,10):void 0};case"text":var w=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)(w,"")};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,S=r.getAttribute("Type");if(null===S)throw new Error("StreamIndex without type.");(0,d.Z)(c.r,S)||s.Z.warn("Smooth Parser: Unrecognized adaptation type:",S);var w=S,k=r.getAttribute("Subtype"),A=r.getAttribute("Language"),x=r.getAttribute("Url"),I=null===x?"":x;var Z,R=B(r,(function(e,t,r){switch(t){case"QualityLevel":var i=a(r,w);if(null===i)return e;("video"!==w||i.bitrate>n)&&e.qualityLevels.push(i);break;case"c":e.cNodes.push(r)}return e}),{qualityLevels:[],cNodes:[]}),M=R.qualityLevels,C=R.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 c=Z[n+1];if(void 0===c)return e;var d=c.getAttribute("t"),f=(0,v.Z)(d)?+d: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!==M.length,"Adaptation should have at least one playable representation.");var D=w+((0,v.Z)(A)?"_"+A:""),N=M.map((function(t){var n,r,i,a,s=(0,m.Z)(o,I),c={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]:""))},d=(0,v.Z)(t.mimeType)?t.mimeType:U[w],f=t.codecs,b=D+"_"+(null!=w?w+"-":"")+(null!=d?d+"-":"")+(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 S={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(c,{aggressiveMode:k,isLive:_,manifestReceivedTime:y,segmentPrivateInfos:S,timeShiftBufferDepth:l}),x=(0,h.Z)({},t,{index:A,mimeType:d,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 R=[{type:"cenc",values:Z}];x.contentProtections={keyIds:T,initData:R}}else x.contentProtections={keyIds:T,initData:[]}}return x}));if("ADVT"===k)return null;var O={id:D,type:w,representations:N,language:null==A?void 0:A};return"text"===w&&"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"),c=u.getAttribute("MinorVersion");if(null===l||null===c||!/^[2]-[0-2]$/.test(l+"-"+c))throw new Error("Version should be 2.0, 2.1 or 2.2");var d,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(d=u.getAttribute("IsLive"))?d:"string"==typeof d&&"TRUE"===d.toUpperCase();if(b){var T=u.getAttribute("DVRWindowLength");null==T||isNaN(+T)||0==+T||(f=+T/h)}var E,S,k,A,I,Z,R=_.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}),{}),M=null,C=void 0!==R.video?R.video[0]:void 0,P=void 0!==R.audio?R.audio[0]:void 0;if(void 0!==C||void 0!==P){var D=[],N=[];if(void 0!==C){var O=C.representations[0];if(void 0!==O){var L=O.index.getFirstPosition(),U=O.index.getLastPosition();null!=L&&D.push(L),null!=U&&N.push(U)}}if(void 0!==P){var F=P.representations[0];if(void 0!==F){var z=F.index.getFirstPosition(),V=F.index.getLastPosition();null!=z&&D.push(z),null!=V&&N.push(V)}}D.length>0&&(I=Math.max.apply(Math,D)),N.length>0&&(Z=Math.min.apply(Math,N))}var K=u.getAttribute("Duration"),G=null!=K&&0!=+K?+K/h:void 0;b?(E=e.suggestedPresentationDelay,S=t,k=null!=I?I:S,A={isLinear:!0,value:null!=Z?Z:Date.now()/1e3-S,time:performance.now()},M=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,j={availabilityStartTime:void 0===S?0:S,clockOffset:i,isLive:b,isDynamic:b,isLastPeriodKnown:!0,timeBounds:{absoluteMinimumTime:k,timeshiftDepth:M,maximumTimeData:A},periods:[{adaptations:R,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 w(j),j}},V=n(4597),K=n(8806),G=n(4460),H=n(8791),W=n(4644),j=n(2297);function q(e,t,n,r,i){var a,o,u,c=[];if(i){var d=(0,l.XA)(e);null!==d?(u=function(e){var t=(0,j.nR)(e,3565190898,3392751253,2387879627,2655430559);if(void 0===t)return[];for(var n=[],r=t[0],i=t[4],a=0;a<i;a++){var o=void 0,s=void 0;1===r?(s=(0,p.pV)(t,16*a+5),o=(0,p.pV)(t,16*a+5+8)):(s=(0,p.pX)(t,8*a+5),o=(0,p.pX)(t,8*a+5+4)),n.push({time:s,duration:o})}return n}(d),o=function(e){var t=(0,j.nR)(e,1830656773,1121273062,2162299933,2952222642);if(void 0!==t)return{duration:(0,p.pV)(t,12),time:(0,p.pV)(t,4)}}(d)):s.Z.warn("smooth: could not find traf atom")}if(void 0!==u)for(var f=0;f<u.length;f++)c.push({time:u[f].time,duration:u[f].duration,timescale:n});if(void 0!==o)return{nextSegments:c,chunkInfos:{time:o.time/n,duration:o.duration/n},scaledSegmentTime:o.time};if(t||!r.complete)return{nextSegments:c,chunkInfos:null,scaledSegmentTime:void 0};var v=r.duration*n,h=Math.min(.9*n,v/4),m=(0,W.MM)(e),g=void 0!==(null===(a=r.privateInfos)||void 0===a?void 0:a.smoothMediaSegment)?r.privateInfos.smoothMediaSegment.time:Math.round(r.time*n);return{nextSegments:c,chunkInfos:void 0!==m&&Math.abs(m-v)<=h?{time:r.time,duration:m/n}:{time:r.time,duration:r.duration},scaledSegmentTime:g}}var Y=n(3666);function $(e,t){return E("schm",(0,p.zo)(4,(0,g.tG)(e),(0,p.kh)(t)))}function X(e){return E("frma",(0,g.tG)(e))}function Q(e){var t=[7,[e.length]];return E("stsd",p.zo.apply(void 0,t.concat(e)))}function J(e,t,n){return E("tenc",(0,p.zo)(6,[e,t],n))}function ee(e,t,n,r,i){var a=[e,t,n];return void 0!==i&&a.push(E("senc",i),function(e){if(0===e.length)return E("saiz",new Uint8Array(0));var t=(0,p.pX)(e,0),n=(0,p.pX)(e,4),r=new Uint8Array(n+9);r.set((0,p.kh)(n),5);for(var i,a,o=9,s=8;s<e.length;)s+=8,2==(2&t)?(a=2,s+=6*(i=(0,p.zK)(e,s))+2):(i=0,a=0),r[o]=6*i+8+a,o++;return E("saiz",r)}(i),function(e,t,n,r){return E("saio",(0,p.zo)(4,[0,0,0,1],(0,p.kh)(e.length+t.length+n.length+r.length+8+8+8+8)))}(r,e,t,n)),S("traf",a)}function te(e,t){var n=(0,j.Qy)(e,1836019558);if(null===n)throw new Error("Smooth: Invalid ISOBMFF given");var r=e.subarray(n[1],n[2]),i=(0,j.iz)(r,1835427940),a=(0,j.t_)(r,1953653094);if(null===a||null===i)throw new Error("Smooth: Invalid ISOBMFF given");var o=(0,j.Qy)(a,1952868452),s=(0,j.Qy)(a,1953658222);if(null===o||null===s)throw new Error("Smooth: Invalid ISOBMFF given");var u=a.subarray(o[0],o[2]),l=a.subarray(s[0],s[2]);u.set([0,0,0,1],o[1]-o[0]+4);var c=function(e){return E("tfdt",(0,p.zo)([1,0,0,0],(0,p.el)(e)))}(t),d=function(e,t){if((1&e[t+3])>0)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,W.J6)(n)}(l,s[1]-s[0]),f=ee(u,c,d,i,(0,j.nR)(a,2721664850,1520127764,2722393154,2086964724)),v=S("moof",[i,f]),h=(0,j.Qy)(v,1836019558),m=(0,j.Qy)(f,1953653094),g=(0,j.Qy)(d,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+c.length+(g[1]-g[0])+8,_=n[2]-n[0],b=v.length-_,T=(0,j.Qy)(e,1835295092);if(null===T)throw new Error("Smooth: Invalid ISOBMFF given");if(!Y.YM&&(0===b||b<=-8)){var w=T[1];return v.set((0,p.kh)(w),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 ne=n(7839),re=n(281);function ie(e,t,n,r,i,a){var o,s,u,l=S("stbl",[n,E("stts",new Uint8Array(8)),E("stsc",new Uint8Array(8)),E("stsz",new Uint8Array(12)),E("stco",new Uint8Array(8))]),c=S("dinf",[function(e){return E("dref",(0,p.zo)(7,[1],e))}(E("url ",new Uint8Array([0,0,0,1])))]),d=S("minf",[r,c,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=S("mdia",[function(e){return E("mdhd",(0,p.zo)(12,(0,p.kh)(e),8))}(e),f,d]),h=S("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=S("mvex",[(o=1,E("trex",(0,p.zo)(4,(0,p.kh)(o),[0,0,0,1],12)))]),y=function(e,t,n){return S("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 ae(e,t,n,r,i,a,o,s){var u=o.split("00000001"),l=u[1],c=u[2];if(void 0===l||void 0===c)throw new Error("Smooth: unsupported codec private data.");var d,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)(c),a);if(void 0===s){d=Q([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=S("schi",[J(1,8,s)]),m=$("cenc",65536);d=Q([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,S("sinf",[X("avc1"),m,h]))])}return ie(e,"video",d,((f=new Uint8Array(12))[3]=1,E("vmhd",f)),t,n)}var oe=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];function se(e,t,n,r,i,a,o){var s,u,l,c=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&oe.indexOf(s))<<4)|31&u)<<3,(0,g.ci)((0,p.XT)(l))):a);return ie(e,"audio",function(){if(void 0===o)return Q([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,c)]);var e=S("schi",[J(1,8,o)]),a=$("cenc",65536),s=S("sinf",[X("mp4a"),a,e]);return Q([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,c,s)])}(),E("smhd",new Uint8Array(8)),0,0)}var ue=/(\.isml?)(\?token=\S+)?$/,le=/\?token=(\S+)/;function ce(e,t){return(0,v.Z)(t)?e.replace(le,"?token="+t):e.replace(le,"")}function de(e){return"string"==typeof e.mimeType&&e.mimeType.indexOf("mp4")>=0}function fe(e,t,n,r,i){var a,o=t.segment.range;return Array.isArray(o)&&(a={Range:(0,re.Z)(o)}),(0,V.ZP)({url:e,responseType:"arraybuffer",headers:a,cancelSignal:r,onProgress:n.onProgress}).then((function(e){if(!de(t.representation)||!0!==i)return{resultType:"segment-loaded",resultData:e};var n=new Uint8Array(e.responseData);return(0,G.Z)(n,t.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},e),{responseData:n})}}))}var pe=function(e){var t=e.checkMediaSegmentIntegrity,n=e.customSegmentLoader;return function(e,r,i,a){var o=r.segment,s=r.manifest,u=r.period,l=r.adaptation,c=r.representation;if(o.isInit){if(void 0===o.privateInfos||void 0===o.privateInfos.smoothInitSegment)throw new Error("Smooth: Invalid segment format");var d,f=o.privateInfos.smoothInitSegment,p=f.codecPrivateData,v=f.timescale,h=f.protection,m=void 0===h?{keyId:void 0,keySystems:void 0}:h;if(void 0===p)throw new Error("Smooth: no codec private data.");switch(l.type){case"video":var g=c.width,y=void 0===g?0:g,_=c.height;d=ae(v,y,void 0===_?0:_,72,72,4,p,m.keyId);break;case"audio":var b=f.channels,T=void 0===b?0:b,E=f.bitsPerSample,S=void 0===E?0:E,w=f.packetSize,k=void 0===w?0:w,A=f.samplingRate;d=se(v,T,S,k,void 0===A?0:A,p,m.keyId);break;default:0,d=new Uint8Array(0)}return Promise.resolve({resultType:"segment-created",resultData:d})}if(null===e)return Promise.resolve({resultType:"segment-created",resultData:null});var x={adaptation:l,manifest:s,period:u,representation:c,segment:o,transport:"smooth",url:e};return"function"!=typeof n?fe(e,r,a,i,t):new Promise((function(o,s){var u=!1,l=n(x,{reject:function(e){var t,n,r;if(!u&&!i.isCancelled){u=!0,i.deregister(c);var a=e,o=null!==(t=null==a?void 0:a.message)&&void 0!==t?t:"Unknown error when fetching a Smooth segment through a custom segmentLoader.",l=new ne.Z(o,null!==(n=null==a?void 0:a.canRetry)&&void 0!==n&&n,null!==(r=null==a?void 0:a.isOfflineError)&&void 0!==r&&r,null==a?void 0:a.xhr);s(l)}},resolve:function(e){if(!u&&!i.isCancelled){u=!0,i.deregister(c),de(r.representation)&&!0===t||o({resultType:"segment-loaded",resultData:{responseData:e.data,size:e.size,requestDuration:e.duration}});var n=e.data instanceof Uint8Array?e.data:new Uint8Array(e.data);(0,G.Z)(n,r.segment.isInit),o({resultType:"segment-loaded",resultData:{responseData:n,size:e.size,requestDuration:e.duration}})}},fallback:function(){u||i.isCancelled||(u=!0,i.deregister(c),fe(e,r,a,i,t).then(o,s))},progress:function(e){u||i.isCancelled||a.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})}});function c(e){u||((u=!0)||"function"!=typeof l||l(),s(e))}i.register(c)}))}},ve=/\.wsx?(\?token=\S+)?/;function he(e,t,n){var r;s.Z.debug("Smooth Parser: update segments information.");for(var i=e.representations,a=0;a<i.length;a++){var o=i[a];o.index instanceof L&&void 0!==(null===(r=null==n?void 0:n.privateInfos)||void 0===r?void 0:r.smoothMediaSegment)?o.index.addNewSegments(t,n.privateInfos.smoothMediaSegment):s.Z.warn("Smooth Parser: should only encounter SmoothRepresentationIndex")}}var me=function(e){var t=z(e),n=pe(e),i={customManifestLoader:e.manifestLoader},c={loadSegment:function(e,t,r,i){return n(e,t,r,i)},parseSegment:function(e,t,n){var r,i,a=t.segment,o=t.adaptation,s=t.manifest,u=e.data,l=e.isChunked;if(null===u)return a.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var c=u instanceof Uint8Array?u:new Uint8Array(u);if(a.isInit){var d=null===(i=null===(r=a.privateInfos)||void 0===r?void 0:r.smoothInitSegment)||void 0===i?void 0:i.timescale;return{segmentType:"init",initializationData:u,initializationDataSize:u.byteLength,initTimescale:d,protectionDataUpdate:!1}}var f=void 0!==n?q(c,l,n,a,s.isLive):null;if(null===f||null===f.chunkInfos||void 0===f.scaledSegmentTime)throw new Error("Smooth Segment without time information");var p=f.nextSegments,v=f.chunkInfos,h=te(c,f.scaledSegmentTime);return p.length>0&&he(o,p,a),{segmentType:"media",chunkData:h,chunkInfos:v,chunkOffset:0,chunkSize:h.length,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}};return{manifest:{resolveManifestUrl:function(e,t){if(void 0===e)return Promise.resolve(void 0);var n;ve.test(e)?((0,K.Z)("Giving WSX URL to loadVideo is deprecated. You should only give Manifest URLs."),n=(0,V.ZP)({url:ce(e,""),responseType:"document",cancelSignal:t}).then((function(e){var t=e.responseData.getElementsByTagName("media")[0].getAttribute("src");if(null===t||0===t.length)throw new Error("Invalid ISML");return t}))):n=Promise.resolve(e);var r=function(e){var t=le.exec(e);if(null!==t){var n=t[1];if(void 0!==n)return n}return""}(e);return n.then((function(e){return ce(function(e){return ue.test(e)?((0,K.Z)("Giving a isml URL to loadVideo is deprecated. Please give the Manifest URL directly"),e.replace(ue,"$1/manifest$2")):e}(e),r)}))},loadManifest:(0,H.Z)(i,"text"),parseManifest:function(n,r){var i,a=null!==(i=n.url)&&void 0!==i?i:r.originalUrl,o=n.receivedTime,s=n.responseData,l="string"==typeof s?(new DOMParser).parseFromString(s,"text/xml"):s,c=t(l,a,o);return{manifest:new u.ZP(c,{representationFilter:e.representationFilter,supplementaryImageTracks:e.supplementaryImageTracks,supplementaryTextTracks:e.supplementaryTextTracks}),url:a}}},audio:c,video:c,text:{loadSegment:function(t,n,r,i){var a=n.segment,o=n.representation;return a.isInit||null===t?Promise.resolve({resultType:"segment-created",resultData:null}):de(o)?(0,V.ZP)({url:t,responseType:"arraybuffer",cancelSignal:r,onProgress:i.onProgress}).then((function(t){if(!0!==e.checkMediaSegmentIntegrity)return{resultType:"segment-loaded",resultData:t};var r=new Uint8Array(t.responseData);return(0,G.Z)(r,n.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},t),{responseData:r})}})):(0,V.ZP)({url:t,responseType:"text",cancelSignal:r,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))},parseSegment:function(e,t,n){var r,i,a,o=t.manifest,u=t.adaptation,c=t.representation,d=t.segment,f=u.language,p=de(c),v=c.mimeType,h=void 0===v?"":v,m=c.codec,y=void 0===m?"":m,_=e.data,b=e.isChunked;if(d.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(null===_)return{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var T,E,S,w,k=null;if(p){var A;i=(A="string"==typeof _?(0,g.tG)(_):_ instanceof Uint8Array?_:new Uint8Array(_)).length;var x=void 0!==n?q(A,b,n,d,o.isLive):null;a=null==x?void 0:x.nextSegments,null===(k=null!==(r=null==x?void 0:x.chunkInfos)&&void 0!==r?r:null)?b?s.Z.warn("Smooth: Unavailable time data for current text track."):(T=d.time,E=d.end):(T=k.time,E=void 0!==k.duration?k.time+k.duration:d.end);var I=y.toLowerCase();if("application/ttml+xml+mp4"===h||"stpp"===I||"stpp.ttml.im1t"===I)w="ttml";else{if("wvtt"!==I)throw new Error("could not find a text-track parser for the type "+h);w="vtt"}var Z=(0,l.Le)(A);S=null===Z?"":(0,g.uR)(Z)}else{var R;if(T=d.time,E=d.end,"string"!=typeof _){var M=_ instanceof Uint8Array?_:new Uint8Array(_);i=M.length,R=(0,g.uR)(M)}else R=_;switch(h){case"application/x-sami":case"application/smil":w="sami";break;case"application/ttml+xml":w="ttml";break;case"text/vtt":w="vtt"}if(void 0===w){if("srt"!==y.toLowerCase())throw new Error("could not find a text-track parser for the type "+h);w="srt"}S=R}return null!==k&&Array.isArray(a)&&a.length>0&&he(u,a,d),{segmentType:"media",chunkData:{type:w,data:S,start:T,end:E,language:f},chunkSize:i,chunkInfos:k,chunkOffset:null!=T?T:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}},image:{loadSegment:function(e,t,n,i){return(0,r.Z)(a().mark((function r(){var o;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!t.segment.isInit&&null!==e){r.next=2;break}return r.abrupt("return",{resultType:"segment-created",resultData:null});case 2:return r.next=4,(0,V.ZP)({url:e,responseType:"arraybuffer",onProgress:i.onProgress,cancelSignal:n});case 4:return o=r.sent,r.abrupt("return",{resultType:"segment-loaded",resultData:o});case 6:case"end":return r.stop()}}),r)})))()},parseSegment:function(e,t,n){var r=e.data,i=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(i)throw new Error("Image data should not be downloaded in chunks");return null===r||null===o.Z.imageParser?{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}:{segmentType:"media",chunkData:{data:o.Z.imageParser(new Uint8Array(r)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkSize:void 0,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 o}});var r=n(7904),i=n(4597),a=n(7839);function o(e,t){var n=e.customManifestLoader,o=function(e){return function(t,n){if(void 0===t)throw new Error("Cannot perform HTTP(s) request. URL not known");switch(e){case"arraybuffer":return(0,i.ZP)({url:t,responseType:"arraybuffer",cancelSignal:n});case"text":return(0,i.ZP)({url:t,responseType:"text",cancelSignal:n});case"document":return(0,i.ZP)({url:t,responseType:"document",cancelSignal:n});default:(0,r.Z)(e)}}}(t);return"function"!=typeof n?o:function(e,t){return function(n,r){return new Promise((function(i,o){var s=Date.now()-performance.now(),u=!1,l=e(n,{reject:function(e){var t,n,i;if(!u&&!r.isCancelled){u=!0,r.deregister(c);var s=e,l=null!==(t=null==s?void 0:s.message)&&void 0!==t?t:"Unknown error when fetching the Manifest through a custom manifestLoader.",d=new a.Z(l,null!==(n=null==s?void 0:s.canRetry)&&void 0!==n&&n,null!==(i=null==s?void 0:s.isOfflineError)&&void 0!==i&&i,null==s?void 0:s.xhr);o(d)}},resolve:function(e){if(!u&&!r.isCancelled){u=!0,r.deregister(c);var t=void 0!==e.receivingTime?e.receivingTime-s:void 0,n=void 0!==e.sendingTime?e.sendingTime-s:void 0;i({responseData:e.data,size:e.size,requestDuration:e.duration,url:e.url,receivedTime:t,sendingTime:n})}},fallback:function(){u||r.isCancelled||(u=!0,r.deregister(c),t(n,r).then(i,o))}});function c(e){u||(u=!0,"function"==typeof l&&l(),o(e))}r.register(c)}))}}(n,o)}},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<r;i++){var a=e[i];if(t.call(n,a,i,e))return a}}n.d(t,{Z:function(){return r}})},5138:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.findIndex)return e.findIndex(t,n);for(var r=e.length>>>0,i=0;i<r;i++)if(t.call(n,e[i],i,e))return i;return-1}n.d(t,{Z:function(){return r}})},7714:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.includes)return e.includes(t,n);var r=e.length>>>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<r;){if((i=e[s])===(a=t)||"number"==typeof i&&"number"==typeof a&&isNaN(i)&&isNaN(a))return!0;s++}return!1}n.d(t,{Z:function(){return r}})},811:function(e,t,n){"use strict";n.d(t,{Z:function(){return i},u:function(){return a}});var r=n(1946);function i(e,t){0}function a(e,t,n){for(var a in void 0===n&&(n="object"),i((0,r.Z)(e)),t)t.hasOwnProperty(a)&&i((e[a],t[a]),t[a])}},7904:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7326),i=n(4578),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(2146).Z)(Error));function o(e){throw new a("Unreachable path taken")}},9689:function(e,t,n){"use strict";n.d(t,{J:function(){return s},K:function(){return u}});var r=n(3887),i=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],a=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];function o(e){if(e>=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<r;t+=3)n+=i[e[t-2]>>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<n.length-2)throw new Error("Unable to parse base64 string.");for(var a,s=n.endsWith("==")?2:n.endsWith("=")?1:0,u=n.length,l=new Uint8Array(u/4*3),c=0,d=0;c<u;c+=4,d+=3)a=o(n.charCodeAt(c))<<18|o(n.charCodeAt(c+1))<<12|o(n.charCodeAt(c+2))<<6|o(n.charCodeAt(c+3)),l[d]=a>>16,l[d+1]=a>>8&255,l[d+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;++n<t;)r+="number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?e:e.length;var i=new Uint8Array(r),a=0;for(n=-1;++n<t;)"number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?a+=e:e.length>0&&(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 c(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 d(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,{O_:function(){return p},QI:function(){return a},XT:function(){return u},_f:function(){return v},dN:function(){return f},el:function(){return c},kh:function(){return l},pV:function(){return s},pX:function(){return o},qb:function(){return d},zK:function(){return i},zo:function(){return r}})},7864:function(e,t,n){"use strict";function r(e,t){return new Promise((function(n,r){var i=setTimeout((function(){a(),n()}),e),a=t.register((function(e){clearTimeout(i),r(e)}))}))}n.d(t,{Z:function(){return r}})},8117:function(e,t,n){"use strict";var r=n(1480),i=n(3102),a=n(2817),o=n(1946);t.Z=function(e){return e instanceof r.y?e:e instanceof Promise||!(0,o.Z)(e)&&"function"==typeof e.then?(0,i.D)(e):(0,a.of)(e)}},8333: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},c=function(e){u(e)},d={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=d.delegate;return((null==n?void 0:n.setImmediate)||l).apply(void 0,(0,i.ev)([],(0,i.CR)(e)))},clearImmediate:function(e){var t=d.delegate;return((null==t?void 0:t.clearImmediate)||c)(e)},delegate:void 0},f=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return(0,i.ZT)(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=d.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&&(d.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<i&&(e=n.shift()));if(this._active=!1,t){for(;++r<i&&(e=n.shift());)e.unsubscribe();throw t}},t}(n(9682).v))(f),v=n(8720);function h(){return function(e){return e.pipe((0,v.R)(p))}}},1959:function(e,t,n){"use strict";n.d(t,{R:function(){return s},Z:function(){return o}});var r=n(1480),i=n(3887),a=n(1946),o=function(){function e(){this._listeners={}}var t=e.prototype;return t.addEventListener=function(e,t){var n=this._listeners[e];Array.isArray(n)?n.push(t):this._listeners[e]=[t]},t.removeEventListener=function(e,t){if((0,a.Z)(e))this._listeners={};else{var n=this._listeners[e];if(Array.isArray(n))if((0,a.Z)(t))delete this._listeners[e];else{var r=n.indexOf(t);-1!==r&&n.splice(r,1),0===n.length&&delete this._listeners[e]}}},t.trigger=function(e,t){var n=this._listeners[e];Array.isArray(n)&&n.slice().forEach((function(e){try{e(t)}catch(e){i.Z.error(e,e instanceof Error?e.stack:null)}}))},e}();function s(e,t){return new r.y((function(n){function r(e){n.next(e)}return e.addEventListener(t,r),function(){e.removeEventListener(t,r)}}))}},2793:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(9917),i=n(9127),a=n(4975);function o(e,t){return function(n){return(0,r.P)((function(){return n.pipe((0,i.U)(e),(0,a.h)((function(e){return e!==t})))}))}}},9592:function(e,t,n){"use strict";function r(e,t){return"function"==typeof Array.prototype.flatMap?e.flatMap(t):e.reduce((function(e,n){var r=t(n);return Array.isArray(r)?(e.push.apply(e,r),e):(e.push(r),e)}),[])}n.d(t,{Z:function(){return r}})},2572:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});function r(e){return e*(.3*(2*Math.random()-1)+1)}},2870:function(e,t,n){"use strict";function r(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e[n],t&=t;return t}n.d(t,{Z:function(){return r}})},908:function(e,t,n){"use strict";function r(){var e="",t=-1;return function(){return++t>=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 c},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 c=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]}))}},2829:function(e,t,n){"use strict";n.d(t,{A1:function(){return o},DD:function(){return h},F_:function(){return p},JN:function(){return c},L7:function(){return m},Ti:function(){return s},XS:function(){return f},at:function(){return v},kR:function(){return g},rx:function(){return d},tn:function(){return _},uH:function(){return b}});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<e.length;n++)if(s(e[n],t))return!0;return!1}function s(e,t){var n=e.start,r=e.end;return n<=t&&t<r}function u(e,t){return s(e,t.start)||e.start<t.end&&t.end<e.end||s(t,e.start)}function l(e,t){return r(t.start,e.end)||r(t.end,e.start)}function c(e){for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}function d(e,t){for(var n=e.length-1;n>=0;n--){var r=e.start(n);if(t>=r){var i=e.end(n);if(t<i)return{start:r,end:i}}}return null}function f(e,t){for(var n=e.length,r=0;r<n;r++){var i=e.start(r);if(t<i)return i-t}return 1/0}function p(e,t){for(var n=null,r=[],i=0;i<e.length;i++){var a=e.start(i),o=e.end(i);t<a||t>=o?r.push({start:a,end:o}):n={start:a,end:o}}return{outerRanges:r,innerRange:n}}function v(e,t){var n=d(e,t);return null!==n?n.end-n.start:0}function h(e,t){var n=d(e,t);return null!==n?t-n.start:0}function m(e,t){var n=d(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;r<e.length;r++){var o=e[r],s=u(n,o),c=l(n,o);if(s||c)n=i(n,o),e.splice(r--,1);else if(0===r){if(a(n,e[0]))break}else if(a(e[r-1],n)&&a(n,o))break}return e.splice(r,0,n),function(e){for(var t=1;t<e.length;t++){var n=e[t-1],r=e[t];if(l(n,r)){var a=i(n,r);e.splice(--t,2,a)}}return e}(function(e){for(var t=0;t<e.length;t++){var n=e[t];n.start===n.end&&e.splice(t--,1)}return e}(e))}function y(e,t){for(var n=[],r=0;r<t.length;r++)u(e,t[r])&&n.push(t[r]);return n}function _(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=y(i,t);if(a.length>0)for(var o=0;o<a.length;o++){var s=a[o];n.push({start:Math.max(i.start,s.start),end:Math.min(i.end,s.end)})}}return n}function b(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=[],o=y(i,t);if(o.length>0)for(var s=0;s<o.length;s++){var u=o[s];a.push({start:Math.max(i.start,u.start),end:Math.min(i.end,u.end)})}if(0===a.length)n.push(i);else{for(var l=i.start,c=0;c<a.length;c++)a[c].start>l&&n.push({start:l,end:a[c].start}),l=a[c].end;l<i.end&&n.push({start:l,end:i.end})}}return n}},5095:function(e,t,n){"use strict";n.d(t,{$:function(){return s}});var r=n(1480),i=n(3887);function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){var t=e,n=[],o=!1;return{getValue:function(){return t},setValue:function(e){if(o)i.Z.error("Finished shared references cannot be updated");else if(t=e,0!==n.length)for(var r,s=a(n.slice());!(r=s()).done;){var u=r.value;try{u.hasBeenCleared||u.trigger(e)}catch(e){}}},setValueIfChanged:function(e){e!==t&&this.setValue(e)},asObservable:function(e){return new r.y((function(r){if(!0!==e&&r.next(t),!o){var i={trigger:r.next.bind(r),complete:r.complete.bind(r),hasBeenCleared:!1};return n.push(i),function(){i.hasBeenCleared=!0;var e=n.indexOf(i);e>=0&&n.splice(e,1)}}r.complete()}))},onUpdate:function(e,r){if(!0===(null==r?void 0:r.emitCurrentValue)&&e(t),!o){var i={trigger:e,complete:a,hasBeenCleared:!1};n.push(i),void 0!==(null==r?void 0:r.clearSignal)&&r.clearSignal.register(a)}function a(){i.hasBeenCleared=!0;var e=n.indexOf(i);e>=0&&n.splice(e,1)}},finish:function(){o=!0;for(var e,t=a(n.slice());!(e=t()).done;){var r=e.value;try{r.hasBeenCleared||r.complete()}catch(e){}}}}}t.Z=s},4597:function(e,t,n){"use strict";n.d(t,{ZP:function(){return s}});var r=n(6872),i=n(9105),a=n(6923),o=n(1946);var s=function(e){var t=r.Z.getCurrent().DEFAULT_REQUEST_TIMEOUT,n={url:e.url,headers:e.headers,responseType:(0,o.Z)(e.responseType)?"json":e.responseType,timeout:(0,o.Z)(e.timeout)?t:e.timeout};return new Promise((function(t,r){var s=e.onProgress,u=e.cancelSignal,l=n.url,c=n.headers,d=n.responseType,f=n.timeout,p=new XMLHttpRequest;if(p.open("GET",l,!0),f>=0&&(p.timeout=f),p.responseType=d,"document"===p.responseType&&p.overrideMimeType("text/xml"),!(0,o.Z)(c)){var v=c;for(var h in v)v.hasOwnProperty(h)&&p.setRequestHeader(h,v[h])}var m=performance.now(),g=null;void 0!==u&&(g=u.register((function(e){(0,o.Z)(p)||4===p.readyState||p.abort(),r(e)})),u.isCancelled)||(p.onerror=function(){null!==g&&g(),r(new i.Z(l,p.status,"ERROR_EVENT",p))},p.ontimeout=function(){null!==g&&g(),r(new i.Z(l,p.status,"TIMEOUT",p))},void 0!==s&&(p.onprogress=function(e){var t=performance.now();s({url:l,duration:t-m,sendingTime:m,currentTime:t,size:e.loaded,totalSize:e.total})}),p.onload=function(e){if(4===p.readyState)if(null!==g&&g(),p.status>=200&&p.status<300){var n,s=performance.now(),u=p.response instanceof ArrayBuffer?p.response.byteLength:e.total,c=p.status,d=p.responseType,f=(0,a.Z)(p.responseURL)?p.responseURL:l;if(n="json"===d?"object"==typeof p.response?p.response:function(e){try{return JSON.parse(e)}catch(e){return null}}(p.responseText):p.response,(0,o.Z)(n))return void r(new i.Z(l,p.status,"PARSE_ERROR",p));t({status:c,url:f,responseType:d,sendingTime:m,receivedTime:s,requestDuration:s-m,size:u,responseData:n})}else r(new i.Z(l,p.status,"ERROR_HTTP_CODE",p))},p.send())}))}},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<a;r++)if(".."===n[r])t.pop();else{if("."===n[r])continue;t.push(n[r])}return t.join("/")}function o(){var e=arguments.length;if(0===e)return"";for(var t="",n=0;n<e;n++){var i=n<0||arguments.length<=n?void 0:arguments[n];"string"==typeof i&&""!==i&&(r.test(i)?t=i:("/"===i[0]&&(i=i.substring(1)),"/"===t[t.length-1]&&(t=t.substring(0,t.length-1)),t=t+"/"+i))}return a(t)}function s(e){var t=e.lastIndexOf("/");if(t<0)return e;if(r.test(e)){var n=e.indexOf("/");if(n>=0&&t===n+1)return e}var i=e.indexOf("?");return i>=0&&i<t?s(e.substring(0,i)):e.substring(0,t+1)}},5561:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3610);function i(e,t){try{return e(t)}catch(e){return(0,r._)((function(){return e}))}}},9252:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof String.prototype.startsWith)return e.startsWith(t,n);var r="number"==typeof n?Math.max(n,0):0;return e.substring(r,r+t.length)===t}n.d(t,{Z:function(){return r}})},3635:function(e,t,n){"use strict";n.d(t,{DM:function(){return h},TZ:function(){return s},ci:function(){return p},nr:function(){return f},tG:function(){return l},uR:function(){return d},wO:function(){return v},wV:function(){return u}});var r=n(3887),i=n(811),a="object"==typeof window&&"function"==typeof window.TextDecoder,o="object"==typeof window&&"function"==typeof window.TextEncoder;function s(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint8Array(t),r=0;r<n.length;r+=2){var i=e.charCodeAt(r/2);n[r]=255&i,n[r+1]=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<e.length;n+=2)t+=String.fromCharCode((e[n+1]<<8)+e[n]);return t}function l(e){if(o)try{return(new TextEncoder).encode(e)}catch(e){r.Z.warn("Utils: could not use TextEncoder to encode string into UTF-8, fallbacking to another implementation",e)}var t,n=encodeURIComponent(e);if("function"==typeof unescape)t=unescape(n);else{var i=/[0-9a-fA-F]/,a=n.length;t="";for(var s=0;s<n.length;s++){var u=!1;if("%"===n[s])if(s<=a-6&&"u"===n[s+1]&&i.test(n[s+2])&&i.test(n[s+3])&&i.test(n[s+4])&&i.test(n[s+5])){var l=parseInt(n.substring(s+1,s+6),16);t+=String.fromCharCode(l),u=!0,s+=5}else if(s<=a-3&&i.test(n[s+1])&&i.test(n[s+2])){var c=parseInt(n.substring(s+1,s+3),16);t+=String.fromCharCode(c),u=!0,s+=2}u||(t+=n[s])}}for(var d=new Uint8Array(t.length),f=0;f<t.length;f++)d[f]=255&t.charCodeAt(f);return d}function c(e,t){var n=e.toString(16);return n.length>=t?n:new Array(t-n.length+1).join("0")+n}function d(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<e.length;n+=16e3){var r=e.subarray(n,n+16e3);t+=String.fromCharCode.apply(null,r)}return t}(t);if("function"==typeof escape)n=escape(i);else{var o=/[A-Za-z0-9*_\+-\.\/]/;n="";for(var s=0;s<i.length;s++)if(o.test(i[s]))n+=i[s];else{var u=i.charCodeAt(s);n+=u>=256?"%u"+c(u,4):"%"+c(u,2)}}return decodeURIComponent(n)}function f(e){for(var t=e.length,n=new Uint8Array(t/2),r=0,i=0;r<t;r+=2,i++)n[i]=255&parseInt(e.substring(r,r+2),16);return n}function p(e,t){void 0===t&&(t="");for(var n="",r=0;r<e.byteLength;r++)n+=(e[r]>>>4).toString(16),n+=(15&e[r]).toString(16),t.length>0&&r<e.byteLength-1&&(n+=t);return n}function v(e){(0,i.Z)(16===e.length,"GUID length should be 16");var t=e[0],n=e[1],r=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=new Uint8Array(16);return c[0]=a,c[1]=r,c[2]=n,c[3]=t,c[4]=s,c[5]=o,c[6]=l,c[7]=u,c.set(e.subarray(8,16),8),c}function h(e,t){for(var n=t;n<e.length;){if(0===e[n])break;n+=1}return{end:n+1,string:d(e.subarray(t,n))}}},5278:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1946);function i(){for(var e=0,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(var a=n.length;e<a;){var o=n[e];if(!(0,r.Z)(o))return o;e++}}},288:function(e,t,n){"use strict";n.d(t,{FU:function(){return c},ZP:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(811),s=n(8894),u=function(){function e(){var e,t=(e=s.Z,[function(t){e(t)},function(t){e=t}]),n=t[0],r=t[1];this.isUsed=!1,this._trigger=n,this.signal=new l(r)}return e.prototype.cancel=function(e){if(!this.isUsed){this.isUsed=!0;var t=null!=e?e:new c;this._trigger(t)}},e.isCancellationError=function(e){return e instanceof c},e}(),l=function(){function e(e){var t=this;this.isCancelled=!1,this.cancellationError=null,this._listeners=[],e((function(e){for(t.cancellationError=e,t.isCancelled=!0;t._listeners.length>0;){(0,t._listeners.splice(t._listeners.length-1,1)[0])(e)}}))}var t=e.prototype;return t.register=function(e){var t=this;return this.isCancelled&&((0,o.Z)(null!==this.cancellationError),e(this.cancellationError)),this._listeners.push(e),function(){return t.deregister(e)}},t.deregister=function(e){if(!this.isCancelled)for(var t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)},e}(),c=function(e){function t(){var n;return n=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(n),t.prototype),n.name="CancellationError",n.message="This task was cancelled.",n}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},8806:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7714),i=[];function a(e){(0,r.Z)(i,e)||(console.warn(e),i.push(e))}},7473:function(e){"use strict";var t=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},n=function(e){var n,r,i=document.createTextNode(""),a=0;return new e((function(){var e;if(n)r&&(n=r.concat(n));else{if(!r)return;n=r}if(r=n,n=null,"function"==typeof r)return e=r,r=null,void e();for(i.data=a=++a%2;r;)e=r.shift(),r.length||(r=null),e()})).observe(i,{characterData:!0}),function(e){t(e),n?"function"==typeof n?n=[n,e]:n.push(e):(n=e,i.data=a=++a%2)}};e.exports=function(){if("object"==typeof process&&process&&"function"==typeof process.nextTick)return process.nextTick;if("function"==typeof queueMicrotask)return function(e){queueMicrotask(t(e))};if("object"==typeof document&&document){if("function"==typeof MutationObserver)return n(MutationObserver);if("function"==typeof WebKitMutationObserver)return n(WebKitMutationObserver)}return"function"==typeof setImmediate?function(e){setImmediate(t(e))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(e){setTimeout(t(e),0)}:null}()},5666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),o=new I(r||[]);return a._invoke=function(e,t,n){var r=d;return function(i,a){if(r===p)throw new Error("Generator is already running");if(r===v){if("throw"===i)throw a;return R()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=k(o,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=c(e,t,n);if("normal"===u.type){if(r=n.done?v:f,u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=v,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",p="executing",v="completed",h={};function m(){}function g(){}function y(){}var _={};u(_,a,(function(){return this}));var b=Object.getPrototypeOf,T=b&&b(b(Z([])));T&&T!==n&&r.call(T,a)&&(_=T);var E=y.prototype=m.prototype=Object.create(_);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function n(i,a,o,s){var u=c(e[i],e,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(d).then((function(e){l.value=e,o(l)}),(function(e){return n("throw",e,o,s)}))}s(u.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function k(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,k(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var i=c(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,h;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function Z(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:R}}function R(){return{value:t,done:!0}}return g.prototype=y,u(E,"constructor",y),u(y,"constructor",g),g.displayName=u(y,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,u(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},S(w.prototype),u(w.prototype,o,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new w(l(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},S(E),u(E,s,"Generator"),u(E,a,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=Z,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=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<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=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){"object"==typeof globalThis?globalThis.regeneratorRuntime=t: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),c=n(8846),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=this,s=(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);return(0,c.x)((function(){var e=o,t=e.operator,n=e.source;s.add(t?t.call(s,n):n?o._subscribe(s):o._trySubscribe(s))})),s},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=f(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;t<arguments.length;t++)e[t]=arguments[t];return s(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function f(e){var t;return null!==(t=null!=e?e:u.v.Promise)&&void 0!==t?t:Promise}},3:function(e,t,n){"use strict";n.d(t,{t:function(){return o}});var r=n(5987),i=n(6716),a=n(4318),o=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=a.l);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return(0,r.ZT)(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,u=1;u<r.length&&r[u]<=o;u+=2)s=u;s&&r.splice(0,s+1)}},t}(i.x)},6716:function(e,t,n){"use strict";n.d(t,{x:function(){return l}});var r=n(5987),i=n(1480),a=n(5720),o=(0,n(1819).d)((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),s=n(3699),u=n(8846),l=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,r.ZT)(t,e),t.prototype.lift=function(e){var t=new c(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new o},t.prototype.next=function(e){var t=this;(0,u.x)((function(){var n,i;if(t._throwIfClosed(),!t.isStopped){var a=t.observers.slice();try{for(var o=(0,r.XA)(a),s=o.next();!s.done;s=o.next()){s.value.next(e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;(0,u.x)((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;(0,u.x)((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},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 c(e,t)},t}(i.y),c=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}(l)},6267:function(e,t,n){"use strict";n.d(t,{Hp:function(){return v},Lv:function(){return p}});var r=n(5987),i=n(8474),a=n(5720),o=n(3912),s=n(5),u=n(2967),l=c("C",void 0,void 0);function c(e,t,n){return{kind:e,value:t,error:n}}var d=n(8380),f=n(8846),p=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=y,n}return(0,r.ZT)(t,e),t.create=function(e,t,n){return new v(e,t,n)},t.prototype.next=function(e){this.isStopped?g(function(e){return c("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?g(c("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?g(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),v=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?h(a,s):u.Z,error:h(null!=n?n:m,s),complete:r?h(r,s):u.Z},s}return(0,r.ZT)(t,e),t}(p);function h(e,t){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{e.apply(void 0,(0,r.ev)([],(0,r.CR)(t)))}catch(e){o.v.useDeprecatedSynchronousErrorHandling?(0,f.O)(e):(0,s.h)(e)}}}function m(e){throw e}function g(e,t){var n=o.v.onStoppedNotification;n&&d.z.setTimeout((function(){return n(e,t)}))}var y={closed:!0,next:u.Z,error:m,complete:u.Z}},5720:function(e,t,n){"use strict";n.d(t,{Lc:function(){return u},w0:function(){return s},Nn:function(){return l}});var r=n(5987),i=n(8474),a=(0,n(1819).d)((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}})),o=n(3699),s=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._teardowns=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,o,s;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var l=(0,r.XA)(u),d=l.next();!d.done;d=l.next()){d.value.remove(this)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}else u.remove(this);var f=this.initialTeardown;if((0,i.m)(f))try{f()}catch(e){s=e instanceof a?e.errors:[e]}var p=this._teardowns;if(p){this._teardowns=null;try{for(var v=(0,r.XA)(p),h=v.next();!h.done;h=v.next()){var m=h.value;try{c(m)}catch(e){s=null!=s?s:[],e instanceof a?s=(0,r.ev)((0,r.ev)([],(0,r.CR)(s)),(0,r.CR)(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}if(s)throw new a(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)c(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&(0,o.P)(t,e)},e.prototype.remove=function(t){var n=this._teardowns;n&&(0,o.P)(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),u=s.EMPTY;function l(e){return e instanceof s||e&&"closed"in e&&(0,i.m)(e.remove)&&(0,i.m)(e.add)&&(0,i.m)(e.unsubscribe)}function c(e){(0,i.m)(e)?e():e.unsubscribe()}},3912:function(e,t,n){"use strict";n.d(t,{v:function(){return r}});var r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},2334:function(e,t,n){"use strict";n.d(t,{a:function(){return m}});var r=n(1480),i=Array.isArray,a=Object.getPrototypeOf,o=Object.prototype,s=Object.keys;function u(e){if(1===e.length){var t=e[0];if(i(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&a(r)===o){var n=s(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var l=n(3102),c=n(278),d=n(3211),f=n(2457);function p(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}var v=n(2566),h=n(7845);function m(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,f.yG)(e),i=(0,f.jO)(e),a=u(e),o=a.args,s=a.keys;if(0===o.length)return(0,l.D)([],n);var v=new r.y(g(o,n,s?function(e){return p(s,e)}:c.y));return i?v.pipe((0,d.Z)(i)):v}function g(e,t,n){return void 0===n&&(n=c.y),function(r){y(t,(function(){for(var i=e.length,a=new Array(i),o=i,s=i,u=function(i){y(t,(function(){var u=(0,l.D)(e[i],t),c=!1;u.subscribe(new v.Q(r,(function(e){a[i]=e,c||(c=!0,s--),s||r.next(n(a.slice()))}),(function(){--o||r.complete()})))}),r)},c=0;c<i;c++)u(c)}),r)}}function y(e,t,n){e?(0,h.f)(n,e,t):t()}},6362:function(e,t,n){"use strict";n.d(t,{z:function(){return o}});var r=n(9834),i=n(2457),a=n(3102);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,r.u)()((0,a.D)(e,(0,i.yG)(e)))}},9917:function(e,t,n){"use strict";n.d(t,{P:function(){return a}});var r=n(1480),i=n(7878);function a(e){return new r.y((function(t){(0,i.Xf)(e()).subscribe(t)}))}},1545:function(e,t,n){"use strict";n.d(t,{E:function(){return r}});var r=new(n(1480).y)((function(e){return e.complete()}))},3102:function(e,t,n){"use strict";n.d(t,{D:function(){return T}});var r=n(7878),i=n(7845),a=n(6798),o=n(2566);function s(e,t){return void 0===t&&(t=0),(0,a.e)((function(n,r){n.subscribe(new o.Q(r,(function(n){return(0,i.f)(r,e,(function(){return r.next(n)}),t)}),(function(){return(0,i.f)(r,e,(function(){return r.complete()}),t)}),(function(n){return(0,i.f)(r,e,(function(){return r.error(n)}),t)})))}))}var u=n(8720);var l=n(1480);var c=n(9768),d=n(8474);function f(e,t){if(!e)throw new Error("Iterable cannot be null");return new l.y((function(n){(0,i.f)(n,t,(function(){var r=e[Symbol.asyncIterator]();(0,i.f)(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}var p=n(1764),v=n(3841),h=n(5685),m=n(1837),g=n(8430),y=n(8729),_=n(8671);function b(e,t){if(null!=e){if((0,p.c)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,h.z)(e))return function(e,t){return new l.y((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if((0,v.t)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,g.D)(e))return f(e,t);if((0,m.T)(e))return function(e,t){return new l.y((function(n){var r;return(0,i.f)(n,t,(function(){r=e[c.h](),(0,i.f)(n,t,(function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){return void n.error(e)}i?n.complete():n.next(t)}),0,!0)})),function(){return(0,d.m)(null==r?void 0:r.return)&&r.return()}}))}(e,t);if((0,_.L)(e))return function(e,t){return f((0,_.Q)(e),t)}(e,t)}throw(0,y.z)(e)}function T(e,t){return t?b(e,t):(0,r.Xf)(e)}},2401:function(e,t,n){"use strict";n.d(t,{R:function(){return p}});var r=n(5987),i=n(7878),a=n(1480),o=n(7877),s=n(5685),u=n(8474),l=n(3211),c=["addListener","removeListener"],d=["addEventListener","removeEventListener"],f=["on","off"];function p(e,t,n,h){if((0,u.m)(n)&&(h=n,n=void 0),h)return p(e,t,n).pipe((0,l.Z)(h));var m=(0,r.CR)(function(e){return(0,u.m)(e.addEventListener)&&(0,u.m)(e.removeEventListener)}(e)?d.map((function(r){return function(i){return e[r](t,i,n)}})):function(e){return(0,u.m)(e.addListener)&&(0,u.m)(e.removeListener)}(e)?c.map(v(e,t)):function(e){return(0,u.m)(e.on)&&(0,u.m)(e.off)}(e)?f.map(v(e,t)):[],2),g=m[0],y=m[1];if(!g&&(0,s.z)(e))return(0,o.z)((function(e){return p(e,t,n)}))((0,i.Xf)(e));if(!g)throw new TypeError("Invalid event target");return new a.y((function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return g(t),function(){return y(t)}}))}function v(e,t){return function(n){return function(r){return e[n](t,r)}}}},7878:function(e,t,n){"use strict";n.d(t,{Xf:function(){return h}});var r=n(5987),i=n(5685),a=n(3841),o=n(1480),s=n(1764),u=n(8430),l=n(8729),c=n(1837),d=n(8671),f=n(8474),p=n(5),v=n(6766);function h(e){if(e instanceof o.y)return e;if(null!=e){if((0,s.c)(e))return y=e,new o.y((function(e){var t=y[v.L]();if((0,f.m)(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if((0,i.z)(e))return g=e,new o.y((function(e){for(var t=0;t<g.length&&!e.closed;t++)e.next(g[t]);e.complete()}));if((0,a.t)(e))return h=e,new o.y((function(e){h.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,p.h)}));if((0,u.D)(e))return m(e);if((0,c.T)(e))return n=e,new o.y((function(e){var t,i;try{for(var a=(0,r.XA)(n),o=a.next();!o.done;o=a.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}e.complete()}));if((0,d.L)(e))return t=e,m((0,d.Q)(t))}var t,n,h,g,y;throw(0,l.z)(e)}function m(e){return new o.y((function(t){(function(e,t){var n,i,a,o;return(0,r.mG)(this,void 0,void 0,(function(){var s,u;return(0,r.Jh)(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=(0,r.KL)(e),l.label=1;case 1:return[4,n.next()];case 2:if((i=l.sent()).done)return[3,4];if(s=i.value,t.next(s),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=l.sent(),a={error:u},[3,11];case 6:return l.trys.push([6,,9,10]),i&&!i.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}},6697:function(e,t,n){"use strict";n.d(t,{F:function(){return a}});var r=n(7991),i=n(6625);function a(e,t){return void 0===e&&(e=0),void 0===t&&(t=r.z),e<0&&(e=0),(0,i.H)(e,e,t)}},3071:function(e,t,n){"use strict";n.d(t,{T:function(){return u}});var r=n(4367),i=n(7878),a=n(1545),o=n(2457),s=n(3102);function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,o.yG)(e),u=(0,o._6)(e,1/0),l=e;return l.length?1===l.length?(0,i.Xf)(l[0]):(0,r.J)(u)((0,s.D)(l,n)):a.E}},2817:function(e,t,n){"use strict";n.d(t,{of:function(){return a}});var r=n(2457),i=n(3102);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,r.yG)(e);return(0,i.D)(e,n)}},3610:function(e,t,n){"use strict";n.d(t,{_:function(){return a}});var r=n(1480),i=n(8474);function a(e,t){var n=(0,i.m)(e)?e:function(){return e},a=function(e){return e.error(n())};return new r.y(t?function(e){return t.schedule(a,0,e)}:a)}},6625:function(e,t,n){"use strict";n.d(t,{H:function(){return s}});var r=n(1480),i=n(7991),a=n(4865),o=n(1454);function s(e,t,n){void 0===e&&(e=0),void 0===n&&(n=i.P);var s=-1;return null!=t&&((0,a.K)(t)?n=t:s=t),new r.y((function(t){var r=(0,o.q)(e)?+e-n.now():e;r<0&&(r=0);var i=0;return n.schedule((function(){t.closed||(t.next(i++),0<=s?this.schedule(void 0,s):t.complete())}),r)}))}},2566:function(e,t,n){"use strict";n.d(t,{Q:function(){return i}});var r=n(5987),i=function(e){function t(t,n,r,i,a){var o=e.call(this,t)||this;return o.onFinalize=a,o._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,o._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,o._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,o}return(0,r.ZT)(t,e),t.prototype.unsubscribe=function(){var t,n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))},t}(n(6267).Lv)},9878:function(e,t,n){"use strict";n.d(t,{K:function(){return o}});var r=n(7878),i=n(2566),a=n(6798);function o(e){return(0,a.e)((function(t,n){var a,s=null,u=!1;s=t.subscribe(new i.Q(n,void 0,void 0,(function(i){a=(0,r.Xf)(e(i,o(e)(t))),s?(s.unsubscribe(),s=null,a.subscribe(n)):u=!0}))),u&&(s.unsubscribe(),s=null,a.subscribe(n))}))}},9834:function(e,t,n){"use strict";n.d(t,{u:function(){return i}});var r=n(4367);function i(){return(0,r.J)(1)}},3741:function(e,t,n){"use strict";n.d(t,{x:function(){return o}});var r=n(278),i=n(6798),a=n(2566);function o(e,t){return void 0===t&&(t=r.y),e=null!=e?e:s,(0,i.e)((function(n,r){var i,o=!0;n.subscribe(new a.Q(r,(function(n){var a=t(n);!o&&e(i,a)||(o=!1,i=a,r.next(n))})))}))}function s(e,t){return e===t}},4975:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe(new i.Q(r,(function(n){return e.call(t,n,a++)&&r.next(n)})))}))}},533:function(e,t,n){"use strict";n.d(t,{l:function(){return o}});var r=n(6798),i=n(2566),a=n(2967);function o(){return(0,r.e)((function(e,t){e.subscribe(new i.Q(t,a.Z))}))}},9127:function(e,t,n){"use strict";n.d(t,{U:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe(new i.Q(r,(function(n){r.next(e.call(t,n,a++))})))}))}},4367:function(e,t,n){"use strict";n.d(t,{J:function(){return a}});var r=n(7877),i=n(278);function a(e){return void 0===e&&(e=1/0),(0,r.z)(i.y,e)}},7877:function(e,t,n){"use strict";n.d(t,{z:function(){return l}});var r=n(9127),i=n(7878),a=n(6798),o=n(7845),s=n(2566);var u=n(8474);function l(e,t,n){return void 0===n&&(n=1/0),(0,u.m)(t)?l((function(n,a){return(0,r.U)((function(e,r){return t(n,e,a,r)}))((0,i.Xf)(e(n,a)))}),n):("number"==typeof t&&(n=t),(0,a.e)((function(t,r){return function(e,t,n,r,a,u,l,c){var d=[],f=0,p=0,v=!1,h=function(){!v||d.length||f||t.complete()},m=function(e){return f<r?g(e):d.push(e)},g=function(e){u&&t.next(e),f++;var c=!1;(0,i.Xf)(n(e,p++)).subscribe(new s.Q(t,(function(e){null==a||a(e),u?m(e):t.next(e)}),(function(){c=!0}),void 0,(function(){if(c)try{f--;for(var e=function(){var e=d.shift();l?(0,o.f)(t,l,(function(){return g(e)})):g(e)};d.length&&f<r;)e();h()}catch(e){t.error(e)}})))};return e.subscribe(new s.Q(t,m,(function(){v=!0,h()}))),function(){null==c||c()}}(t,r,e,n)})))}},3074:function(e,t,n){"use strict";n.d(t,{R:function(){return o}});var r=n(6798),i=n(2566);function a(e,t,n,r,a){return function(o,s){var u=n,l=t,c=0;o.subscribe(new i.Q(s,(function(t){var n=c++;l=u?e(l,t,n):(u=!0,t),r&&s.next(l)}),a&&function(){u&&s.next(l),s.complete()}))}}function o(e,t){return(0,r.e)(a(e,t,arguments.length>=2,!0))}},5583:function(e,t,n){"use strict";n.d(t,{B:function(){return l}});var r=n(5987),i=n(3102),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,d=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=c(g,p))})),y.subscribe(u),t||(t=new s.Hp({next:function(e){return y.next(e)},error:function(e){v=!0,h(),r=c(m,a,e),y.error(e)},complete:function(){f=!0,h(),r=c(m,d),y.complete()}}),(0,i.D)(e).subscribe(t))}))(e)}}function c(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return!0===t?(e(),null):!1===t?null:t.apply(void 0,(0,r.ev)([],(0,r.CR)(n))).pipe((0,a.q)(1)).subscribe((function(){return e()}))}},8515:function(e,t,n){"use strict";n.d(t,{d:function(){return a}});var r=n(3),i=n(5583);function a(e,t,n){var a,o,s,u=!1;return e&&"object"==typeof e?(s=null!==(a=e.bufferSize)&&void 0!==a?a:1/0,t=null!==(o=e.windowTime)&&void 0!==o?o:1/0,u=!!e.refCount,n=e.scheduler):s=null!=e?e:1/0,(0,i.B)({connector:function(){return new r.t(s,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:u})}},6108:function(e,t,n){"use strict";n.d(t,{O:function(){return o}});var r=n(6362),i=n(2457),a=n(6798);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,i.yG)(e);return(0,a.e)((function(t,i){(n?(0,r.z)(e,t,n):(0,r.z)(e,t)).subscribe(i)}))}},8720:function(e,t,n){"use strict";n.d(t,{R:function(){return i}});var r=n(6798);function i(e,t){return void 0===t&&(t=0),(0,r.e)((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}},4978:function(e,t,n){"use strict";n.d(t,{w:function(){return o}});var r=n(7878),i=n(6798),a=n(2566);function o(e,t){return(0,i.e)((function(n,i){var o=null,s=0,u=!1,l=function(){return u&&!o&&i.complete()};n.subscribe(new a.Q(i,(function(n){null==o||o.unsubscribe();var u=0,c=s++;(0,r.Xf)(e(n,c)).subscribe(o=new a.Q(i,(function(e){return i.next(t?t(n,e,c,u++):e)}),(function(){o=null,l()})))}),(function(){u=!0,l()})))}))}},4727:function(e,t,n){"use strict";n.d(t,{q:function(){return o}});var r=n(1545),i=n(6798),a=n(2566);function o(e){return e<=0?function(){return r.E}:(0,i.e)((function(t,n){var r=0;t.subscribe(new a.Q(n,(function(t){++r<=e&&(n.next(t),e<=r&&n.complete())})))}))}},3505:function(e,t,n){"use strict";n.d(t,{R:function(){return s}});var r=n(6798),i=n(2566),a=n(7878),o=n(2967);function s(e){return(0,r.e)((function(t,n){(0,a.Xf)(e).subscribe(new i.Q(n,(function(){return n.complete()}),o.Z)),!n.closed&&t.subscribe(n)}))}},2006:function(e,t,n){"use strict";n.d(t,{b:function(){return s}});var r=n(8474),i=n(6798),a=n(2566),o=n(278);function s(e,t,n){var s=(0,r.m)(e)||t||n?{next:e,error:t,complete:n}:e;return s?(0,i.e)((function(e,t){var n;null===(n=s.subscribe)||void 0===n||n.call(s);var r=!0;e.subscribe(new a.Q(t,(function(e){var n;null===(n=s.next)||void 0===n||n.call(s,e),t.next(e)}),(function(){var e;r=!1,null===(e=s.complete)||void 0===e||e.call(s),t.complete()}),(function(e){var n;r=!1,null===(n=s.error)||void 0===n||n.call(s,e),t.error(e)}),(function(){var e,t;r&&(null===(e=s.unsubscribe)||void 0===e||e.call(s)),null===(t=s.finalize)||void 0===t||t.call(s)})))})):o.y}},3428:function(e,t,n){"use strict";n.d(t,{M:function(){return c}});var r=n(5987),i=n(6798),a=n(2566),o=n(7878),s=n(278),u=n(2967),l=n(2457);function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,l.jO)(e);return(0,i.e)((function(t,i){for(var l=e.length,c=new Array(l),d=e.map((function(){return!1})),f=!1,p=function(t){(0,o.Xf)(e[t]).subscribe(new a.Q(i,(function(e){c[t]=e,f||d[t]||(d[t]=!0,(f=d.every(s.y))&&(d=null))}),u.Z))},v=0;v<l;v++)p(v);t.subscribe(new a.Q(i,(function(e){if(f){var t=(0,r.ev)([e],(0,r.CR)(c));i.next(n?n.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):t)}})))}))}},8337:function(e,t,n){"use strict";n.d(t,{o:function(){return s}});var r=n(5987),i=function(e){function t(t,n){return e.call(this)||this}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(5720).w0),a={setInterval:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.delegate;return((null==n?void 0:n.setInterval)||setInterval).apply(void 0,(0,r.ev)([],(0,r.CR)(e)))},clearInterval:function(e){var t=a.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},o=n(3699),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),a.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;a.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,o.P)(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(i)},9682:function(e,t,n){"use strict";n.d(t,{v:function(){return o}});var r=n(5987),i=n(4318),a=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=i.l.now,e}(),o=function(e){function t(t,n){void 0===n&&(n=a.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return(0,r.ZT)(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(a)},7991:function(e,t,n){"use strict";n.d(t,{P:function(){return a},z:function(){return i}});var r=n(8337),i=new(n(9682).v)(r.o),a=i},4318:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r={now:function(){return(r.delegate||Date).now()},delegate:void 0}},8380:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});var r=n(5987),i={setTimeout:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=i.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,(0,r.ev)([],(0,r.CR)(e)))},clearTimeout:function(e){var t=i.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},9768:function(e,t,n){"use strict";n.d(t,{h:function(){return r}});var r="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},6766:function(e,t,n){"use strict";n.d(t,{L:function(){return r}});var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},2457:function(e,t,n){"use strict";n.d(t,{_6:function(){return u},jO:function(){return o},yG:function(){return s}});var r=n(8474),i=n(4865);function a(e){return e[e.length-1]}function o(e){return(0,r.m)(a(e))?e.pop():void 0}function s(e){return(0,i.K)(a(e))?e.pop():void 0}function u(e,t){return"number"==typeof a(e)?e.pop():t}},3699:function(e,t,n){"use strict";function r(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}n.d(t,{P:function(){return r}})},1819:function(e,t,n){"use strict";function r(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}n.d(t,{d:function(){return r}})},8846:function(e,t,n){"use strict";n.d(t,{O:function(){return o},x:function(){return a}});var r=n(3912),i=null;function a(e){if(r.v.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var n=i,a=n.errorThrown,o=n.error;if(i=null,a)throw o}}else e()}function o(e){r.v.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},7845:function(e,t,n){"use strict";function r(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var a=t.schedule((function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(a),!i)return a}n.d(t,{f:function(){return r}})},278:function(e,t,n){"use strict";function r(e){return e}n.d(t,{y:function(){return r}})},5685:function(e,t,n){"use strict";n.d(t,{z:function(){return r}});var r=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},8430:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});var r=n(8474);function i(e){return Symbol.asyncIterator&&(0,r.m)(null==e?void 0:e[Symbol.asyncIterator])}},1454:function(e,t,n){"use strict";function r(e){return e instanceof Date&&!isNaN(e)}n.d(t,{q:function(){return r}})},8474:function(e,t,n){"use strict";function r(e){return"function"==typeof e}n.d(t,{m:function(){return r}})},1764:function(e,t,n){"use strict";n.d(t,{c:function(){return a}});var r=n(6766),i=n(8474);function a(e){return(0,i.m)(e[r.L])}},1837:function(e,t,n){"use strict";n.d(t,{T:function(){return a}});var r=n(9768),i=n(8474);function a(e){return(0,i.m)(null==e?void 0:e[r.h])}},3841:function(e,t,n){"use strict";n.d(t,{t:function(){return i}});var r=n(8474);function i(e){return(0,r.m)(null==e?void 0:e.then)}},8671:function(e,t,n){"use strict";n.d(t,{L:function(){return o},Q:function(){return a}});var r=n(5987),i=n(8474);function a(e){return(0,r.FC)(this,arguments,(function(){var t,n,i;return(0,r.Jh)(this,(function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,(0,r.qq)(t.read())];case 3:return n=a.sent(),i=n.value,n.done?[4,(0,r.qq)(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,(0,r.qq)(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function o(e){return(0,i.m)(null==e?void 0:e.getReader)}},4865:function(e,t,n){"use strict";n.d(t,{K:function(){return i}});var r=n(8474);function i(e){return e&&(0,r.m)(e.schedule)}},6798:function(e,t,n){"use strict";n.d(t,{e:function(){return i}});var r=n(8474);function i(e){return function(t){if(function(e){return(0,r.m)(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},3211:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(5987),i=n(9127),a=Array.isArray;function o(e){return(0,i.U)((function(t){return function(e,t){return a(t)?e.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):e(t)}(e,t)}))}},2967:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},5:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(3912),i=n(8380);function a(e){i.z.setTimeout((function(){var t=r.v.onUnhandledError;if(!t)throw e;t(e)}))}},8729:function(e,t,n){"use strict";function r(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}n.d(t,{z:function(){return r}})},5987:function(e,t,n){"use strict";n.d(t,{CR:function(){return u},FC:function(){return d},Jh:function(){return o},KL:function(){return f},XA:function(){return s},ZT:function(){return i},ev:function(){return l},mG:function(){return a},qq:function(){return c}});var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function a(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))}function o(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=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;n<r;n++,i++)e[i]=t[n];return e}function c(e){return this instanceof c?(this.v=e,this):new c(e)}function d(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof c?Promise.resolve(n.value.v).then(u,l):d(a[0][2],n)}catch(e){d(a[0][3],e)}var n}function u(e){s("next",e)}function l(e){s("throw",e)}function d(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},7326: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}})},5861:function(e,t,n){"use strict";function r(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 i(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,u,"next",e)}function u(e){r(o,i,a,s,u,"throw",e)}s(void 0)}))}}n.d(t,{Z:function(){return i}})},3144:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(t,{Z:function(){return i}})},4578:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9611);function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,r.Z)(e,t)}},9611:function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,{Z:function(){return r}})},2146:function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,{Z:function(){return s}});var i=n(9611);function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function o(e,t,n){return(o=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&(0,i.Z)(a,n.prototype),a}).apply(null,arguments)}function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return o(e,arguments,r(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),(0,i.Z)(a,e)})(e)}}},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.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";n.d(r,{default:function(){return ur}});var e=n(3144),t=n(4578),i=n(6716),a=n(3),o=n(3505),s=n(9127),u=n(3741),l=n(2817),c=n(7877),d=n(8515),f=n(1480),p=n(9917),v={connector:function(){return new i.x},resetOnDisconnect:!0};function h(e,t){void 0===t&&(t=v);var n=null,r=t.connector,i=t.resetOnDisconnect,a=void 0===i||i,o=r(),s=new f.y((function(e){return o.subscribe(e)}));return s.connect=function(){return n&&!n.closed||(n=(0,p.P)((function(){return e})).subscribe(o),a&&n.add((function(){return o=r()}))),n},s}var m=n(4975),g=n(5583),y=n(2334),_=n(6108),b=n(6362),T=n(4978),E=n(3071),S=n(1545),w=n(6798),k=n(2566);var A=n(4727),x=n(4804);function I(){if(Z()){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 Z(){var e=document;return null!=e.fullscreenElement||null!=e.mozFullScreenElement||null!=e.webkitFullscreenElement||null!=e.msFullscreenElement}var R=n(3666),M=n(3887);function C(){if(!R.vU)return!0;var e=function(){if(!R.vU)return M.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}();if(null===e||e<67)return!0;var t=null===HTMLVideoElement||void 0===HTMLVideoElement?void 0:HTMLVideoElement.prototype;return void 0!==(null==t?void 0:t.requirePictureInPicture)}var P=n(6872),D=n(3714),N=n(8750),O=n(5992),L=n(7874),B=n(1989),U=n(4791),F=n(1959),z=n(1946),V=n(8026),K=n(2829),G=n(5095),H=n(8806),W=n(5861),j=n(7757),q=n.n(j),Y=n(6139),$=n(770);function X(e){return Q.apply(this,arguments)}function Q(){return(Q=(0,W.Z)(q().mark((function e(t){var n,r;return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(n=$.Z.getState(t))){e.next=3;break}return e.abrupt("return");case 3:return M.Z.info("DRM: Disposing of the current MediaKeys"),r=n.loadedSessionsStore,$.Z.clearState(t),e.next=8,r.closeAllSessions();case 8:(0,Y.Y)(t,null);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function J(e){var t=$.Z.getState(e);return null==t?null:t.keySystemOptions.type}function ee(e){if(M.Z.info("DRM: Clearing-up DRM session."),R.fq)return M.Z.info("DRM: disposing current MediaKeys."),X(e);var t=$.Z.getState(e);return null!==t&&!0===t.keySystemOptions.closeSessionsOnStop?(M.Z.info("DRM: closing all current sessions."),t.loadedSessionsStore.closeAllSessions()):(M.Z.info("DRM: Nothing to clear. Returning right away. No state =",null===t),Promise.resolve())}var te=n(811),ne=n(288),re=n(9105),ie=n(9362);function ae(e){return e instanceof re.Z?new ie.Z("PIPELINE_LOAD_ERROR",e):(0,N.Z)(e,{defaultCode:"PIPELINE_LOAD_ERROR",defaultReason:"Unknown error when fetching the Manifest"})}var oe=n(7839),se=n(9822),ue=n(7864),le=n(2572);function ce(e){return e instanceof re.Z?e.type===O.br.ERROR_HTTP_CODE?e.status>=500||404===e.status||415===e.status||412===e.status:e.type===O.br.TIMEOUT||e.type===O.br.ERROR_EVENT:e instanceof oe.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,se.Z)(e)&&"INTEGRITY_ERROR"===e.code}function de(e){return e instanceof re.Z?e.type===O.br.ERROR_EVENT&&!1===navigator.onLine:e instanceof oe.Z&&e.isOfflineError}function fe(e){return de(e)?2:1}function pe(e,t,n,r){if(r.isCancelled)return Promise.reject(r.cancellationError);var i=n.baseDelay,a=n.maxDelay,o=n.maxRetryRegular,s=n.maxRetryOffline,u=n.onRetry,l=0,c=0,d=e.slice();return 0===d.length?(M.Z.warn("Fetchers: no URL given to `tryURLsWithBackoff`."),Promise.reject(new Error("No URL to request"))):f(d[0],0);function f(e,t){return p.apply(this,arguments)}function p(){return(p=(0,W.Z)(q().mark((function e(n,p){var v,h,m,g,y,_,b,T;return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t(n,r);case 3:return v=e.sent,e.abrupt("return",v);case 7:if(e.prev=7,e.t0=e.catch(0),!ne.ZP.isCancellationError(e.t0)){e.next=11;break}throw e.t0;case 11:if(ce(e.t0)){e.next=20;break}if(!(d.length<=1)){e.next=14;break}throw e.t0;case 14:if(d.splice(p,1),h=p>=d.length-1?0:p,u(e.t0),!r.isCancelled){e.next=19;break}throw r.cancellationError;case 19:return e.abrupt("return",f(d[h],h));case 20:if(m=fe(e.t0),g=2===m?s:o,m!==c&&(l=0,c=m),!(p<d.length-1)){e.next=29;break}if(y=p+1,u(e.t0),!r.isCancelled){e.next=28;break}throw r.cancellationError;case 28:return e.abrupt("return",f(d[y],y));case 29:if(!(++l>g)){e.next=32;break}throw e.t0;case 32:if(_=Math.min(i*Math.pow(2,l-1),a),b=(0,le.Z)(_),T=d[0],u(e.t0),!r.isCancelled){e.next=38;break}throw r.cancellationError;case 38:return e.next=40,(0,ue.Z)(b,r);case 40:return e.abrupt("return",f(T,0));case 41:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}}function ve(e,t,n){return pe([null],e,t,n)}function he(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return me(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ge=function(){function e(e,t,n){this._manifestUrl=e,this._pipelines=t.manifest,this._settings=n}var t=e.prototype;return t.fetch=function(e){var t=this;return new f.y((function(n){var r,i,a=t._pipelines,o=null!=e?e:t._manifestUrl,s=!1,u=new ne.ZP,l=t._getBackoffSetting((function(e){n.next({type:"warning",value:ae(e)})}));return(void 0===a.resolveManifestUrl?c(o):(r=o,i=a.resolveManifestUrl,(0,te.Z)(void 0!==i),ve((function(){return i(r,u.signal)}),l,u.signal)).then(c)).then((function(e){s=!0,n.next({type:"response",parse:function(n){return t._parseLoadedManifest(e,n)}}),n.complete()})).catch((function(e){u.isUsed||(s=!0,n.error(ae(e)))})),function(){s||u.cancel()};function c(e){var t=a.loadManifest;return ve((function(){return t(e,u.signal)}),l,u.signal)}}))},t.parse=function(e,t){return this._parseLoadedManifest({responseData:e,size:void 0,requestDuration:void 0},t)},t._parseLoadedManifest=function(e,t){var n=this;return new f.y((function(r){var i=performance.now(),a=new ne.ZP,o=e.sendingTime,s=e.receivedTime,u=n._getBackoffSetting((function(e){r.next({type:"warning",value:ae(e)})})),l={externalClockOffset:t.externalClockOffset,unsafeMode:t.unsafeMode,previousManifest:t.previousManifest,originalUrl:n._manifestUrl};try{var c=n._pipelines.parseManifest(e,l,f,a.signal,(function(e){return d.apply(this,arguments)}));c instanceof Promise?c.then((function(e){return p(e.manifest)})).catch((function(e){a.isUsed||v(e,!0)})):p(c.manifest)}catch(e){if(a.isUsed)return;v(e,!0)}return function(){a.cancel()};function d(){return(d=(0,W.Z)(q().mark((function e(t){var n;return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ve(t,u,a.signal);case 3:return n=e.sent,e.abrupt("return",n);case 7:throw e.prev=7,e.t0=e.catch(0),ae(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function f(e){for(var t,n=he(e);!(t=n()).done;){var r=t.value;if(a.isUsed)return;v(r,!1)}}function p(e){f(e.contentWarnings);var t=performance.now()-i;M.Z.info("MF: Manifest parsed in "+t+"ms"),r.next({type:"parsed",manifest:e,sendingTime:o,receivedTime:s,parsingTime:t}),r.complete()}function v(e,t){var n=(0,N.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});t?r.error(n):r.next({type:"warning",value:n})}}))},t._getBackoffSetting=function(e){var t=P.Z.getCurrent(),n=t.DEFAULT_MAX_MANIFEST_REQUEST_RETRY,r=t.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,i=t.INITIAL_BACKOFF_DELAY_BASE,a=t.MAX_BACKOFF_DELAY_BASE,o=this._settings,s=o.lowLatencyMode,u=o.maxRetryRegular,l=o.maxRetryOffline;return{onRetry:e,baseDelay:s?i.LOW_LATENCY:i.REGULAR,maxDelay:s?a.LOW_LATENCY:a.REGULAR,maxRetryRegular:null!=u?u:n,maxRetryOffline:null!=l?l:r}},e}();var ye=n(5138),_e=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 f.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,ye.Z)(n._waitingQueue,(function(e){return e.observable===r}));if(e>=0)n._waitingQueue.splice(e,1);else{var t=(0,ye.Z)(n._pendingTasks,(function(e){return e.observable===r}));if(t<0)return void M.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,ye.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,ye.Z)(this._pendingTasks,(function(t){return t.observable===e}));if(i<0)M.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||t<this._minPendingPriority)this._minPendingPriority=t;else{if(this._minPendingPriority!==o)return;1===this._pendingTasks.length?this._minPendingPriority=t:this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority}))),this._loopThroughWaitingQueue()}this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks()}}},t._loopThroughWaitingQueue=function(){var e=this._waitingQueue.reduce((function(e,t){return null===e||e>t.priority?t.priority:e}),null);if(!(null===e||null!==this._minPendingPriority&&this._minPendingPriority<e))for(var t=0;t<this._waitingQueue.length;t++){var n=null===this._minPendingPriority?e:Math.min(this._minPendingPriority,e);this._waitingQueue[t].priority<=n&&(this._startWaitingQueueTask(t),t--)}},t._interruptCancellableTasks=function(){for(var e=0;e<this._pendingTasks.length;e++){var t=this._pendingTasks[e];if(t.priority>=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,ye.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0?M.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,ye.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}(),be=n(520),Te=n(7714),Ee=n(908),Se=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}(),we=(0,Ee.Z)();var ke=function(){function e(e,t){var n=P.Z.getCurrent(),r=n.MIN_CANCELABLE_PRIORITY,i=n.MAX_HIGH_PRIORITY_LEVEL;this._transport=e,this._prioritizer=new _e({prioritySteps:{high:i,low:r}}),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,a=P.Z.getCurrent(),o=a.DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR,s=a.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,u=a.INITIAL_BACKOFF_DELAY_BASE,l=a.MAX_BACKOFF_DELAY_BASE;return{maxRetryRegular:"image"===e?0:null!=n?n:o,maxRetryOffline:null!=r?r:s,baseDelay:i?u.LOW_LATENCY:u.REGULAR,maxDelay:i?l.LOW_LATENCY:l.REGULAR}}(e,this._backoffOptions),o=function(e,t,n,r){var i=(0,Te.Z)(["audio","video"],e)?new Se:void 0,a=t.loadSegment,o=t.parseSegment;return function(e){var t=e.segment,s=(0,be.K)(e);return new f.y((function(u){var l,c,d,f=we(),p=new ne.ZP,v=[],h=0,m=!1,g={onProgress:function(e){var t;void 0!==e.totalSize&&e.size<e.totalSize&&(null===(t=n.onProgress)||void 0===t||t.call(n,{duration:e.duration,size:e.size,totalSize:e.totalSize,timestamp:performance.now(),id:f}))},onNewChunk:function(e){u.next({type:"chunk",parse:_(e,!0)})}},y=void 0!==i?i.get(e):null;return null!==y?(M.Z.debug("SF: Found wanted segment in cache",s),u.next({type:"chunk",parse:_(y,!1)}),u.next({type:"chunk-complete"}),void u.complete()):(M.Z.debug("SF: Beginning request",s),null===(l=n.onRequestBegin)||void 0===l||l.call(n,{requestTimestamp:performance.now(),id:f,content:e}),pe(null!==(c=t.mediaURLs)&&void 0!==c?c:[null],(function(t,n){return a(t,e,n,g)}),(0,V.Z)({onRetry:function(e){u.next({type:"retry",value:ae(e)})}},r),p.signal).then((function(t){var r;if(M.Z.debug("SF: Segment request ended with success",s),"segment-loaded"===t.resultType){var a=t.resultData.responseData;void 0!==i&&i.add(e,t.resultData.responseData),u.next({type:"chunk",parse:_(a,!1)})}else"segment-created"===t.resultType&&u.next({type:"chunk",parse:_(t.resultData,!1)});M.Z.debug("SF: Segment request ended with success",s),u.next({type:"chunk-complete"}),"segment-created"!==t.resultType?(d=t.resultData,b()):d=null,p.isUsed||null===(r=n.onRequestEnd)||void 0===r||r.call(n,{id:f}),u.complete()})).catch((function(e){M.Z.debug("SF: Segment request failed",s),d=null,u.error(ae(e))})),function(){var e;void 0===d&&(M.Z.debug("SF: Segment request cancelled",s),d=null,p.cancel(),null===(e=n.onRequestEnd)||void 0===e||e.call(n,{id:f}))});function _(t,n){v.push(!1);var r=v.length-1;return function(i){var a={data:t,isChunked:n};try{var s=o(a,e,i);return v[r]||(h=void 0!==h&&"media"===s.segmentType&&null!==s.chunkInfos&&void 0!==s.chunkInfos.duration?h+s.chunkInfos.duration:void 0,v[r]=!0,b()),s}catch(e){throw(0,N.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown parsing error"})}}}function b(){var t;m||!(0,z.Z)(d)&&void 0!==d.size&&void 0!==d.requestDuration&&v.length>0&&v.every((function(e){return e}))&&(m=!0,null===(t=n.onMetrics)||void 0===t||t.call(n,{size:d.size,requestDuration:d.requestDuration,content:e,segmentDuration:h}))}}))}}(e,this._transport[e],t,a);return n=this._prioritizer,r=o,i=new WeakMap,{createRequest:function(e,t){void 0===t&&(t=0);var a=n.create(r(e),t),o=a.pipe((0,s.U)((function(e){return"data"===e.type?e.value:e})));return i.set(o,a),o},updatePriority:function(e,t){var r=i.get(e);void 0!==r?n.updatePriority(r,t):M.Z.warn("Fetchers: Cannot update the priority of a request: task not found.")}}},e}();function Ae(e){return(0,w.e)((function(t,n){try{t.subscribe(n)}finally{n.add(e)}}))}var xe=n(533);var Ie=n(8333),Ze=n(2793),Re=n(5278),Me=function(){function e(e){this._alpha=Math.exp(Math.log(.5)/e),this._lastEstimate=0,this._totalWeight=0}var t=e.prototype;return t.addSample=function(e,t){var n=Math.pow(this._alpha,e),r=t*(1-n)+n*this._lastEstimate;isNaN(r)||(this._lastEstimate=r,this._totalWeight+=e)},t.getEstimate=function(){var e=1-Math.pow(this._alpha,this._totalWeight);return this._lastEstimate/e},e}(),Ce=function(){function e(){var e=P.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new Me(t),this._slowEWMA=new Me(n),this._bytesSampled=0}var t=e.prototype;return t.addSample=function(e,t){if(!(t<P.Z.getCurrent().ABR_MINIMUM_CHUNK_SIZE)){var n=8e3*t/e,r=e/1e3;this._bytesSampled+=t,this._fastEWMA.addSample(r,n),this._slowEWMA.addSample(r,n)}},t.getEstimate=function(){var e=P.Z.getCurrent().ABR_MINIMUM_TOTAL_BYTES;if(!(this._bytesSampled<e))return Math.min(this._fastEWMA.getEstimate(),this._slowEWMA.getEstimate())},t.reset=function(){var e=P.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new Me(t),this._slowEWMA=new Me(n),this._bytesSampled=0},e}(),Pe=n(2006),De=n(3428);function Ne(e){var t=e.map((function(t){return Math.log(t/e[0])})),n=t.map((function(e){return e-t[0]+1})),r=(n[n.length-1]-1)/(2*e.length+10),i=1/r;return e.map((function(e,t){return a(t)}));function a(t){if(0===t)return 0;var o=Math.min(Math.max(1,t),e.length-1);return e[o]===e[o-1]?a(t-1):i*(r+(e[o]*n[o-1]-e[o-1]*n[o])/(e[o]-e[o-1]))+4}}var Oe=function(){function e(e){this._levelsMap=Ne(e),this._bitrates=e,M.Z.debug("ABR: Steps for buffer based chooser.",this._levelsMap.map((function(t,n){return{bufferLevel:t,bitrate:e[n]}})))}return e.prototype.getEstimate=function(e){var t=this._levelsMap,n=this._bitrates,r=e.bufferGap,i=e.currentBitrate,a=e.currentScore,o=e.speed;if(null==i)return n[0];var s,u=(0,ye.Z)(n,(function(e){return e===i}));if(u<0||n.length!==t.length)return M.Z.error("ABR: Current Bitrate not found in the calculated levels"),n[0];if(null!=a&&(s=0===o?a:a/o),null!=s&&s>1){var l=t[u],c=function(){for(var e=u+1;e<t.length;e++)if(t[e]>l)return e}();if(null!=c)if(r>=t[c])return n[c]}if((null==s||s<1.15)&&r<t[u]){for(var d=u-1;d>=0;d--)if(n[d]<i)return n[d];return i}return i},e}(),Le=n(3274);function Be(e){if(!(e.progress.length<5)){for(var t=new Me(2),n=e.progress,r=1;r<n.length;r++){var i=n[r].size-n[r-1].size,a=n[r].timestamp-n[r-1].timestamp,o=8*i/(a/1e3);t.addSample(a/1e3,o)}return t.getEstimate()}}function Ue(e,t){var n=8*(e.totalSize-e.size);return Math.max(n/t,0)}var Fe=function(){function e(e,t){var n=P.Z.getCurrent(),r=n.ABR_STARVATION_GAP,i=n.OUT_OF_STARVATION_GAP,a=n.ABR_STARVATION_FACTOR,o=n.ABR_REGULAR_FACTOR;this._initialBitrate=e,this._inStarvationMode=!1,this._lowLatencyMode=t,this._config=t?{starvationGap:r.LOW_LATENCY,outOfStarvationGap:i.LOW_LATENCY,starvationBitrateFactor:a.LOW_LATENCY,regularBitrateFactor:o.LOW_LATENCY}:{starvationGap:r.DEFAULT,outOfStarvationGap:i.DEFAULT,starvationBitrateFactor:a.DEFAULT,regularBitrateFactor:o.DEFAULT}}var t=e.prototype;return t.getBandwidthEstimate=function(e,t,n,r,i){var a,o,s=this._config,u=e.bufferGap,l=e.position,c=e.duration,d=isFinite(u)?u:0,f=P.Z.getCurrent().ABR_STARVATION_DURATION_DELTA;return isNaN(c)||d+l<c-f?!this._inStarvationMode&&d<=s.starvationGap?(M.Z.info("ABR: enter starvation mode."),this._inStarvationMode=!0):this._inStarvationMode&&d>=s.outOfStarvationGap&&(M.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1):this._inStarvationMode&&(M.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1),this._inStarvationMode&&null!=(o=function(e,t,n,r,i){if(!r){var a=t.bufferGap,o=t.speed,s=t.position,u=isFinite(a)?a:0,l=function(e,t){for(var n=-1,r=0;r<e.length;r++){var i=e[r].content.segment;if(!(i.duration<=0)){var a=i.time+i.duration;if(!i.complete&&r===e.length-1&&t-i.time>-1.2){n=r;break}if(a>t&&t-i.time>-1.2){n=r;break}}}if(n<0)return[];for(var o=e[n],s=o.content.segment.time,u=[o],l=n+1;l<e.length&&e[l].content.segment.time===s;l++)u.push(e[l]);return u}(e,s+u);if(1===l.length){var c=l[0],d=performance.now(),f=c.progress.length>0?c.progress[c.progress.length-1]:void 0,p=Be(c);if(void 0!==f&&void 0!==p){var v=Ue(f,p);if((d-f.timestamp)/1e3<=v&&v-u/o>2e3)return p}if(c.content.segment.complete){var h=c.content.segment.duration,m=(d-c.requestTimestamp)/1e3;if(null!=n&&!(m<=(1.5*h+2)/o)){var g=h/m,y=n.bitrate*Math.min(.7,g);return void 0===i||y<i?y:void 0}}}}}(r,e,n,this._lowLatencyMode,i))&&(M.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,n){if(n)return!0;var r=isFinite(e.bufferGap)?e.bufferGap:0,i=e.position+r,a=(0,Le.Z)(t,(function(e){var t=e.content;return t.segment.duration>0&&t.segment.time+t.segment.duration>i}));if(void 0===a)return!0;var o=performance.now(),s=a.progress.length>0?a.progress[a.progress.length-1]:void 0,u=Be(a);if(void 0===s||void 0===u)return!0;var l=Ue(s,u);return(o-s.timestamp)/1e3>1.2*l||l-r/e.speed>-1.5}(r,n,this._lowLatencyMode))},e}();function ze(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ve(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ve(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 Ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ke=function(){function e(e,t){this._scoreCalculator=e,this._lastAbrEstimate=t,this._consecutiveWrongGuesses=0,this._blockGuessesUntil=0,this._lastMaintanableBitrate=null}var t=e.prototype;return t.getGuess=function(e,t,n,r,i){var a=t.bufferGap,o=t.speed,s=this._lastAbrEstimate.representation;if(null===s)return null;if(r>s.bitrate)return 2===this._lastAbrEstimate.algorithmType&&(null!==this._lastAbrEstimate.representation&&(this._lastMaintanableBitrate=this._lastAbrEstimate.representation.bitrate),this._consecutiveWrongGuesses=0),null;var u=this._scoreCalculator.getEstimate(n);if(2!==this._lastAbrEstimate.algorithmType){if(void 0===u)return null;if(this._canGuessHigher(a,o,u)){var l=Ge(e,n);if(null!==l)return l}return null}if(this._isLastGuessValidated(s,r,u)&&(M.Z.debug("ABR: Guessed Representation validated",s.bitrate),this._lastMaintanableBitrate=s.bitrate,this._consecutiveWrongGuesses=0),n.id!==s.id)return s;if(this._shouldStopGuess(n,u,a,i))return this._consecutiveWrongGuesses++,this._blockGuessesUntil=performance.now()+Math.min(15e3*this._consecutiveWrongGuesses,12e4),function(e,t){var n=(0,ye.Z)(e,(function(e){return e.id===t.id}));if(n<0)return M.Z.error("ABR: Current Representation not found."),null;for(;--n>=0;)if(e[n].bitrate<t.bitrate)return e[n];return null}(e,n);if(void 0===u)return n;if(this._canGuessHigher(a,o,u)){var c=Ge(e,n);if(null!==c)return c}return n},t._canGuessHigher=function(e,t,n){var r=n[0],i=n[1];return isFinite(e)&&e>=2.5&&performance.now()>this._blockGuessesUntil&&1===i&&r/t>1.01},t._shouldStopGuess=function(e,t,n,r){if(void 0!==t&&t[0]<1.01)return!0;if((void 0===t||t[0]<1.2)&&n<.6)return!0;for(var i,a=r.filter((function(t){return t.content.representation.id===e.id})),o=performance.now(),s=ze(a);!(i=s()).done;){var u=i.value,l=o-u.requestTimestamp;if(u.content.segment.isInit){if(l>1e3)return!0}else{if(l>1e3*u.content.segment.duration+200)return!0;var c=Be(u);if(void 0!==c&&c<.8*e.bitrate)return!0}}return!1},t._isLastGuessValidated=function(e,t,n){return void 0!==n&&1===n[1]&&n[0]>1.5||t>=e.bitrate&&(null===this._lastMaintanableBitrate||this._lastMaintanableBitrate<e.bitrate)},e}();function Ge(e,t){var n=e.length,r=(0,ye.Z)(e,(function(e){return e.id===t.id}));if(r<0)return M.Z.error("ABR: Current Representation not found."),null;for(;++r<n;)if(e[r].bitrate>t.bitrate)return e[r];return null}var He=function(){function e(){this.bandwidth=void 0,this.representation=null,this.algorithmType=3}return e.prototype.update=function(e,t,n){this.representation=e,this.bandwidth=t,this.algorithmType=n},e}(),We=n(1679),je=function(){function e(){this._currentRequests={}}var t=e.prototype;return t.add=function(e){var t=e.id,n=e.requestTimestamp,r=e.content;this._currentRequests[t]={requestTimestamp:n,progress:[],content:r}},t.addProgress=function(e){var t=this._currentRequests[e.id];null!=t?t.progress.push(e):M.Z.warn("ABR: progress for a request not added")},t.remove=function(e){null==this._currentRequests[e]&&M.Z.warn("ABR: can't remove unknown request"),delete this._currentRequests[e]},t.getRequests=function(){return(0,We.Z)(this._currentRequests).filter((function(e){return null!=e})).sort((function(e,t){return e.content.segment.time-t.content.segment.time}))},e}(),qe=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._currentRepresentationData;null!==a&&a.representation.id===e.id?(r=a.ewma,a.ewma.addSample(t,i),a.loadedDuration+=n,a.loadedSegments++):((r=new Me(5)).addSample(t,i),this._currentRepresentationData={representation:e,ewma:r,loadedDuration:n,loadedSegments:0}),r.getEstimate()>1&&this._lastRepresentationWithGoodScore!==e&&(M.Z.debug("ABR: New last stable representation",e.bitrate),this._lastRepresentationWithGoodScore=e)},t.getEstimate=function(e){if(null!==this._currentRepresentationData&&this._currentRepresentationData.representation.id===e.id){var t=this._currentRepresentationData,n=t.ewma,r=t.loadedSegments,i=t.loadedDuration;return[n.getEstimate(),r>=5&&i>=10?1:0]}},t.getLastStableRepresentation=function(){return this._lastRepresentationWithGoodScore},e}();function Ye(e,t,n,r){var i=t<=n?n:t>=r?r:t,a=(0,ye.Z)(e,(function(e){return e.bitrate>i}));return-1===a?e[e.length-1]:0===a?e[0]:e[a-1]}function $e(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,ye.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,Re.Z)(e.width,0)-(0,Re.Z)(t.width,0)})),r=(0,Le.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 Xe(e){var t=e.bandwidthEstimator,n=e.observation$,r=e.filters$,i=e.initialBitrate,a=e.lowLatencyMode,o=e.manualBitrate$,u=e.minAutoBitrate$,c=e.maxAutoBitrate$,d=e.representations,f=e.streamEvents$,v=new qe,h=new Fe(null==i?0:i,a),g=new je;var b=f.pipe((0,m.h)((function(e){return"metrics"===e.type})),(0,Pe.b)((function(e){return function(e){var n=e.requestDuration,r=e.segmentDuration,i=e.size,a=e.content;if(t.addSample(n,i),!a.segment.isInit){var o=a.segment,s=a.representation;if(void 0===r&&!o.complete)return;var u=null!=r?r:o.duration;v.addSample(s,n/1e3,u)}}(e.value)})),(0,xe.l)()),S=f.pipe((0,Pe.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,xe.l)()),w=f.pipe((0,m.h)((function(e){return"representationChange"===e.type})),(0,s.U)((function(e){return e.value.representation})),(0,_.O)(null)),k=(0,p.P)((function(){if(0===d.length)throw new Error("ABRManager: no representation choice given");return 1===d.length?(0,l.of)({bitrate:void 0,representation:d[0],manual:!1,urgent:!0,knownStableBitrate:void 0}):o.pipe((0,T.w)((function(e){if(e>=0){var i=Ye(d,e,0,1/0);return(0,l.of)({representation:i,bitrate:void 0,knownStableBitrate:void 0,manual:!0,urgent:!0})}var o=new He,p=!1,b=new Ke(v,o),T=f.pipe((0,m.h)((function(e){return"added-segment"===e.type})),(0,De.M)(n),(0,s.U)((function(e){var t=e[0].value,n=e[1],r=n.speed,i=n.position,a=t.buffered,o=(0,K.L7)(a,i),s=t.content.representation,u=v.getEstimate(s),l=null==u?void 0:u[0];return{bufferGap:o,currentBitrate:s.bitrate,currentScore:l,speed:r}}))),E=d.map((function(e){return e.bitrate})),S=new Oe(E),k=T.pipe((0,s.U)((function(e){return S.getEstimate(e)})),(0,_.O)(void 0));return(0,y.a)([n,u,c,r,k]).pipe((0,De.M)(w),(0,s.U)((function(e){var n=e[0],r=n[0],i=n[1],s=n[2],u=n[3],l=n[4],c=e[1],f=r.bufferGap,m=r.liveGap,y=$e(d,u),_=g.getRequests(),T=h.getBandwidthEstimate(r,t,c,_,o.bandwidth),E=T.bandwidthEstimate,S=T.bitrateChosen,w=v.getLastStableRepresentation(),k=null===w?void 0:w.bitrate/(r.speed>0?r.speed:1);p&&f<=5?p=!1:!p&&isFinite(f)&&f>10&&(p=!0);var A=Ye(y,S,i,s),x=A.bitrate,I=null;p&&void 0!==l&&l>x&&(x=(I=Ye(y,l,i,s)).bitrate);var Z=null;return a&&null!==c&&void 0!==m&&m<40&&(Z=b.getGuess(d,r,c,x,_)),null!==Z&&Z.bitrate>x?(M.Z.debug("ABR: Choosing representation with guess-based estimation.",Z.bitrate,Z.id),o.update(Z,E,2),{bitrate:E,representation:Z,urgent:null===c||Z.bitrate<c.bitrate,manual:!1,knownStableBitrate:k}):null!==I?(M.Z.debug("ABR: Choosing representation with buffer-based estimation.",I.bitrate,I.id),o.update(I,E,0),{bitrate:E,representation:I,urgent:h.isUrgent(I.bitrate,c,_,r),manual:!1,knownStableBitrate:k}):(M.Z.debug("ABR: Choosing representation with bandwidth estimation.",A.bitrate,A.id),o.update(A,E,1),{bitrate:E,representation:A,urgent:h.isUrgent(A.bitrate,c,_,r),manual:!1,knownStableBitrate:k})})))})))}));return(0,E.T)(b,S,k)}var Qe=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,u=this._getBandwidthEstimator(e),c=(0,Re.Z)(null===(i=this._manualBitrates[e])||void 0===i?void 0:i.asObservable(),(0,l.of)(-1)),d=(0,Re.Z)(null===(a=this._minAutoBitrates[e])||void 0===a?void 0:a.asObservable(),(0,l.of)(0)),f=(0,Re.Z)(null===(o=this._maxAutoBitrates[e])||void 0===o?void 0:o.asObservable(),(0,l.of)(1/0)),p=(0,Re.Z)(this._initialBitrates[e],0);return Xe({bandwidthEstimator:u,streamEvents$:r,observation$:n,filters$:function(e,t,n){var r=[];null!=e&&r.push(e.pipe((0,s.U)((function(e){return{width:e}}))));null!=n&&r.push(n.pipe((0,s.U)((function(e){return{bitrate:e}}))));null!=t&&r.push(t.pipe((0,s.U)((function(e){return{bitrate:e}}))));return r.length>0?(0,y.a)(r).pipe((0,s.U)((function(e){return V.Z.apply(void 0,[{}].concat(e))}))):(0,l.of)({})}(this._throttlers.limitWidth[e],this._throttlers.throttleBitrate[e],this._throttlers.throttle[e]),initialBitrate:p,manualBitrate$:c,minAutoBitrate$:d,maxAutoBitrate$:f,representations:t,lowLatencyMode:this._lowLatencyMode})},t._getBandwidthEstimator=function(e){var t=this._bandwidthEstimators[e];if(null==t){M.Z.debug("ABR: Creating new BandwidthEstimator for ",e);var n=new Ce;return this._bandwidthEstimators[e]=n,n}return t},e}(),Je=n(5767),et=n(3774),tt=n(6923),nt=x.ym;function rt(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&&(M.Z.info("Init: Removing SourceBuffer from mediaSource"),o.abort()),t.removeSourceBuffer(o)}catch(e){M.Z.warn("Init: Error while disposing SourceBuffer",e)}}i.length>0&&M.Z.warn("Init: Not all SourceBuffers could have been removed.")}if((0,Je.Z)(e),null!==n)try{M.Z.debug("Init: Revoking previous URL"),URL.revokeObjectURL(n)}catch(e){M.Z.warn("Init: Error while revoking the media source URL",e)}}function it(e){return function(e){return new f.y((function(t){if(null==et.J)throw new D.Z("MEDIA_SOURCE_NOT_SUPPORTED","No MediaSource Object was found in the current browser.");var n=(0,tt.Z)(e.src)?e.src:null;rt(e,null,n),M.Z.info("Init: Creating MediaSource");var r=new et.J,i=URL.createObjectURL(r);return M.Z.info("Init: Attaching MediaSource URL to the media element",i),e.src=i,t.next(r),function(){rt(e,r,i)}}))}(e).pipe((0,c.z)((function(e){return nt(e).pipe((0,A.q)(1),(0,s.U)((function(){return e})))})))}var at=n(8343);var ot=n(9607),st=n(3610),ut=n(6697),lt=n(2401);var ct=n(7904),dt=n(6968),ft=n(2870),pt=n(9612);var vt=function(e){function n(t,n,r){var a;a=e.call(this)||this;var s=r.addSourceBuffer(n);a._destroy$=new i.x,a.bufferType=t,a._mediaSource=r,a._sourceBuffer=s,a._queue=[],a._pendingTask=null,a._lastInitSegment=null,a.codec=n;var u=P.Z.getCurrent().SOURCE_BUFFER_FLUSHING_INTERVAL;return(0,ut.F)(u).pipe((0,Pe.b)((function(){return a._flush()})),(0,o.R)(a._destroy$)).subscribe(),(0,lt.R)(a._sourceBuffer,"error").pipe((0,Pe.b)((function(e){return a._onPendingTaskError(e)})),(0,o.R)(a._destroy$)).subscribe(),(0,lt.R)(a._sourceBuffer,"updateend").pipe((0,Pe.b)((function(){return a._flush()})),(0,o.R)(a._destroy$)).subscribe(),a}(0,t.Z)(n,e);var r=n.prototype;return r.pushChunk=function(e){return M.Z.debug("AVSB: receiving order to push data to the SourceBuffer",this.bufferType,(0,be.K)(e.inventoryInfos)),this._addToQueue({type:pt.f.Push,value:e})},r.removeBuffer=function(e,t){return M.Z.debug("AVSB: receiving order to remove data from the SourceBuffer",this.bufferType,e,t),this._addToQueue({type:pt.f.Remove,value:{start:e,end:t}})},r.endOfSegment=function(e){return M.Z.debug("AVSB: receiving order for validating end of segment",this.bufferType,(0,be.K)(e)),this._addToQueue({type:pt.f.EndOfSegment,value:e})},r.getBufferedRanges=function(){return this._sourceBuffer.buffered},r.getPendingOperations=function(){var e=function(e){switch(e.type){case pt.f.Push:case pt.f.Remove:case pt.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){M.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 f.y((function(n){var r=0===t._queue.length&&null===t._pendingTask,a=new i.x,o=(0,V.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!==pt.f.Push||0===e.data.length){switch(e.type){case pt.f.Push:null!==e.inventoryData&&this._segmentInventory.insertChunk(e.inventoryData);break;case pt.f.EndOfSegment:this._segmentInventory.completeSegment(e.value,this.getBufferedRanges());break;case pt.f.Remove:this.synchronizeInventory();break;default:(0,ct.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!==pt.f.Push)this._pendingTask=n;else{var r,i=n.value;try{r=this._preparePushOperation(i.data)}catch(e){this._pendingTask=(0,V.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,V.Z)({data:r,inventoryData:i.inventoryInfos},n)}}try{switch(this._pendingTask.type){case pt.f.EndOfSegment:return M.Z.debug("AVSB: Acknowledging complete segment",(0,be.K)(this._pendingTask.value)),void this._flush();case pt.f.Push:var o=this._pendingTask.data.shift();if(void 0===o)return void this._flush();M.Z.debug("AVSB: pushing segment",this.bufferType,(0,be.K)(this._pendingTask.inventoryData)),this._sourceBuffer.appendBuffer(o);break;case pt.f.Remove:var s=this._pendingTask.value,u=s.start,l=s.end;M.Z.debug("AVSB: removing data from SourceBuffer",this.bufferType,u,l),this._sourceBuffer.remove(u,l);break;default:(0,ct.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&&(M.Z.debug("AVSB: updating codec",n),(a=function(e,t){if("function"==typeof e.changeType){try{e.changeType(t)}catch(e){return M.Z.warn("Could not call 'changeType' on the given SourceBuffer:",e),!1}return!0}return!1}(this._sourceBuffer,n))?this.codec=n:M.Z.debug("AVSB: could not update codec",n,this.codec)),this._sourceBuffer.timestampOffset!==r){var o=r;M.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,dt._f)(s);this._lastInitSegment={data:u,hash:(0,ft.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,dt._f)(e);if((0,ft.Z)(n)===this._lastInitSegment.hash&&(0,U.Z)(t,n))return!0}return!1},n}(pt.C),ht=["audio","video","text","image"];function mt(e){return"audio"===e||"video"===e}var gt=function(){function e(e,t){this._mediaElement=e,this._mediaSource=t,this._initializedSegmentBuffers={},this._onNativeBufferAddedOrDisabled=[]}e.isNative=function(e){return mt(e)};var t=e.prototype;return t.getBufferTypes=function(){var e=this.getNativeBufferTypes();return null==L.Z.nativeTextTracksBuffer&&null==L.Z.htmlTextTracksBuffer||e.push("text"),null!=L.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,l.of)(void 0):new f.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 M.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(mt(e)){if(null!=i)return i instanceof vt&&i.codec!==t?M.Z.warn("SB: Reusing native SegmentBuffer with codec",i.codec,"for codec",t):M.Z.info("SB: Reusing native SegmentBuffer with codec",t),i;M.Z.info("SB: Adding native SegmentBuffer with codec",t);var a=new vt(e,t,this._mediaSource);return this._initializedSegmentBuffers[e]=a,this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()})),a}if(null!=i)return M.Z.info("SB: Reusing a previous custom SegmentBuffer for the type",e),i;if("text"===e){if(M.Z.info("SB: Creating a new text SegmentBuffer"),"html"===n.textTrackMode){if(null==L.Z.htmlTextTracksBuffer)throw new Error("HTML Text track feature not activated");r=new L.Z.htmlTextTracksBuffer(this._mediaElement,n.textTrackElement)}else{if(null==L.Z.nativeTextTracksBuffer)throw new Error("Native Text track feature not activated");r=new L.Z.nativeTextTracksBuffer(this._mediaElement,!0===n.hideNativeSubtitle)}return this._initializedSegmentBuffers.text=r,r}if("image"===e){if(null==L.Z.imageBuffer)throw new Error("Image buffer feature not activated");return M.Z.info("SB: Creating a new image SegmentBuffer"),r=new L.Z.imageBuffer,this._initializedSegmentBuffers.image=r,r}throw M.Z.error("SB: Unknown buffer type:",e),new D.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?(M.Z.info("SB: Aborting SegmentBuffer",e),t.dispose(),delete this._initializedSegmentBuffers[e]):M.Z.warn("SB: Trying to dispose a SegmentBuffer that does not exist")},t.disposeAll=function(){var e=this;ht.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}(),yt=n(7878);function _t(e,t){return t?function(n){return n.pipe(_t((function(n,r){return(0,yt.Xf)(e(n,r)).pipe((0,s.U)((function(e,i){return t(n,e,r,i)})))})))}:(0,w.e)((function(t,n){var r=0,i=null,a=!1;t.subscribe(new k.Q(n,(function(t){i||(i=new k.Q(n,void 0,(function(){i=null,a&&n.complete()})),(0,yt.Xf)(e(t,r++)).subscribe(i))}),(function(){a=!0,!i&&n.complete()})))}))}var bt=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<e;n++)t[n]=arguments[n];t.sort(this._sortingFn);for(var r=0,i=0;i<t.length;i++){for(var a=t[i],o=!1;!o&&r<this._array.length;)this._sortingFn(a,this._array[r])<0?(this._array.splice(r,0,a),o=!0):r++;o||this._array.push(a)}},t.length=function(){return this._array.length},t.get=function(e){if(e<0||e>=this._array.length)throw new Error("Invalid index.");return this._array[e]},t.findFirst=function(e){return(0,Le.Z)(this._array,e)},t.has=function(e){return(0,Te.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}(),Tt=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}(),Et=n(3102),St=n(9834);function wt(e){var t=e.segmentBuffer,n=e.currentTime$,r=e.maxBufferBehind$,i=e.maxBufferAhead$;return(0,y.a)([n,r,i]).pipe((0,c.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 S.E;var i=[],a=(0,K.F_)(e.getBufferedRanges(),t),o=a.innerRange,s=a.outerRanges,u=function(){if(isFinite(r)){for(var e=0;e<s.length;e++){var n=s[e];t+r<=n.start?i.push(n):t<=n.start&&t+r<n.end&&t+r>n.start&&i.push({start:t+r,end:n.end})}null!=o&&t+r<o.end&&i.push({start:t+r,end:o.end})}};return function(){if(isFinite(n)){for(var e=0;e<s.length;e++){var r=s[e];t-n>=r.end?i.push(r):t>=r.end&&t-n>r.start&&t-n<r.end&&i.push({start:r.start,end:t-n})}null!=o&&t-n>o.start&&i.push({start:o.start,end:t-n})}}(),u(),(0,Et.D)(i.map((function(t){return M.Z.debug("GC: cleaning range from SegmentBuffer",t),e.removeBuffer(t.start,t.end)}))).pipe((0,St.u)(),(0,xe.l)())}(t,n,r,i)})))}var kt=n(8567),At=n(9878);function xt(e,t,n,r){return n.observe(!0).pipe((0,s.U)((function(i){var a,o=n.getCurrentTime()+r,s=Math.min(Math.max(e.start,o),null!==(a=e.end)&&void 0!==a?a:1/0);return kt.Z.waitingMediaSourceReload(t,e,s,!i.isPaused)})))}var It=n(7473),Zt=n.n(It);var Rt=function(){function e(e,t,n,r){this._content=e,this._currentObs$=null,this._downloadQueue=t,this._initSegmentRequest=null,this._mediaSegmentRequest=null,this._segmentFetcher=n,this._initSegmentMetadata$=new a.t(1),this._mediaSegmentsAwaitingInitMetadata=new Set,r||this._initSegmentMetadata$.next(void 0)}var t=e.prototype;return t.getRequestedInitSegment=function(){return null===this._initSegmentRequest?null:this._initSegmentRequest.segment},t.getRequestedMediaSegment=function(){return null===this._mediaSegmentRequest?null:this._mediaSegmentRequest.segment},t.start=function(){var e=this;if(null!==this._currentObs$)return this._currentObs$;var t=(0,p.P)((function(){var t=e._downloadQueue.asObservable().pipe((0,m.h)((function(t){for(var n=t.segmentQueue,r=0;r<n.length;r++){var i=n[r].segment;if(!e._mediaSegmentsAwaitingInitMetadata.has(i.id))break}var a=e._mediaSegmentRequest;if(r>=n.length)return null!==a;if(null===a)return!0;var o=n[r];return a.segment.id!==o.segment.id||(a.priority!==o.priority&&e._segmentFetcher.updatePriority(a.request$,o.priority),!1)})),(0,T.w)((function(t){return t.segmentQueue.length>0?e._requestMediaSegments():S.E}))),n=e._downloadQueue.asObservable().pipe((0,m.h)((function(t){var n=e._initSegmentRequest;return null!==t.initSegment&&null!==n?(t.initSegment.priority!==n.priority&&e._segmentFetcher.updatePriority(n.request$,t.initSegment.priority),!1):null===t.initSegment||null===n})),(0,T.w)((function(t){return null===t.initSegment?S.E:e._requestInitSegment(t.initSegment)})));return(0,E.T)(n,t)})).pipe((0,g.B)());return this._currentObs$=t,t},t._requestMediaSegments=function(){var e=this,t=this._downloadQueue.getValue().segmentQueue[0],n=function t(n){if(void 0===n)return(0,l.of)({type:"end-of-queue",value:null});var r=n.segment,i=n.priority,a=(0,V.Z)({segment:r},e._content),o=e._segmentFetcher.createRequest(a,i);return e._mediaSegmentRequest={segment:r,priority:i,request$:o},o.pipe((0,c.z)((function(n){switch(n.type){case"retry":return(0,l.of)({type:"retry",value:{segment:r,error:n.value}});case"interrupted":return M.Z.info("Stream: segment request interrupted temporarly.",r),S.E;case"ended":e._mediaSegmentRequest=null;var i=e._downloadQueue.getValue().segmentQueue;return 0===i.length?(0,l.of)({type:"end-of-queue",value:null}):(i[0].segment.id===r.id&&i.shift(),t(i[0]));case"chunk":case"chunk-complete":return e._mediaSegmentsAwaitingInitMetadata.add(r.id),e._initSegmentMetadata$.pipe((0,A.q)(1),(0,s.U)((function(e){if("chunk-complete"===n.type)return{type:"end-of-segment",value:{segment:r}};var t=n.parse(e);return(0,te.Z)("media"===t.segmentType,"Should have loaded a media segment."),(0,V.Z)({},t,{type:"parsed-media",segment:r})})),Ae((function(){e._mediaSegmentsAwaitingInitMetadata.delete(r.id)})));default:(0,ct.Z)(n)}})))};return(0,p.P)((function(){return n(t)})).pipe(Ae((function(){e._mediaSegmentRequest=null})))},t._requestInitSegment=function(e){var t=this;if(null===e)return this._initSegmentRequest=null,S.E;var n=e.segment,r=e.priority,i=(0,V.Z)({segment:n},this._content),a=this._segmentFetcher.createRequest(i,r);return this._initSegmentRequest={segment:n,priority:r,request$:a},a.pipe((0,c.z)((function(e){switch(e.type){case"retry":return(0,l.of)({type:"retry",value:{segment:n,error:e.value}});case"interrupted":return M.Z.info("Stream: init segment request interrupted temporarly.",n),S.E;case"chunk":var r=e.parse(void 0);return(0,te.Z)("init"===r.segmentType,"Should have loaded an init segment."),(0,b.z)((0,l.of)((0,V.Z)({},r,{type:"parsed-init",segment:n})),(0,p.P)((function(){return"init"===r.segmentType&&t._initSegmentMetadata$.next(r.initTimescale),S.E})));case"chunk-complete":return(0,l.of)({type:"end-of-segment",value:{segment:n}});case"ended":return S.E;default:(0,ct.Z)(e)}}))).pipe(Ae((function(){t._initSegmentRequest=null})))},e}();function Mt(e,t,n,r,i){var a=e.period,o=e.adaptation,s=e.representation,u=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(void 0===r.bufferedStart||void 0===r.bufferedEnd||r.bufferedStart>=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 c=i[u];if(void 0!==c.bufferedStart&&c.bufferedStart>t.start&&(null===n||c.infos.segment.end<=n))return M.Z.debug("RS: current discontinuity encountered",o.type,c.bufferedStart),{start:void 0,end:c.bufferedStart};var d=function(e,t,n){if(n<=0)return M.Z.error("RS: Asked to check a discontinuity before the first chunk."),null;for(var r=n;r<e.length;r++){var i=e[r],a=e[r-1];if(void 0===i.bufferedStart||void 0===a.bufferedEnd||i.bufferedStart>=t.end)return null;if(i.bufferedStart-a.bufferedEnd>0)return r}return null}(i,t,u+1);if(null!==d&&(null===n||i[d].infos.segment.end<=n)){var f=i[d-1].bufferedEnd,p=i[d].bufferedStart;return M.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<a.end)return null;var v=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(void 0===r.bufferedStart)return null;if(r.bufferedStart<t)return n}return null}(i,a.end);if(null!==v){var h=i[v];if(void 0!==h.bufferedEnd&&h.bufferedEnd<a.end)return M.Z.debug("RS: discontinuity encountered at the end of the current period",o.type,h.bufferedEnd,a.end),{start:h.bufferedEnd,end:null}}}if(void 0!==a.end&&t.end>=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<t.end){if(void 0!==g.bufferedEnd&&g.bufferedEnd<t.end){var y=s.index.checkDiscontinuity(t.end);if(null!==y)return{start:g.bufferedEnd,end:y}}return null}}}return null}function Ct(e){var t=e.bufferedSegments,n=e.content,r=e.currentPlaybackTime,i=e.fastSwitchThreshold,a=e.getBufferedHistory,o=e.neededRange,s=e.segmentsBeingPushed,u=e.maxBufferSize,l=n.representation,c=function(e,t,n){var r=n;return r-=t.reduce((function(e,t){return e+t.representation.bitrate/8e3*t.segment.duration}),0),e.reduce((function(e,t){return void 0!==t.chunkSize?e-t.chunkSize/8e3:e}),r)}(t,s,u),d=function(e,t){var n=e.reduce((function(e,t){return e+(t.end-t.start)}),0),r=t.reduce((function(e,t){return e+t.segment.duration}),0);return n+r}(t,s),f=l.index.getSegments(o.start,o.end-o.start),p=t.filter((function(e){return!Dt(e.infos,n,r,i)})).filter((function(e,t,n){var r=0===t?null:n[t-1],i=t>=n.length-1?null:n[t+1],s=null;if(function(e,t,n){var r=P.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedStart)return M.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(n<e.bufferedStart&&e.bufferedStart-e.start>r)return M.Z.info("Stream: The start of the wanted segment has been garbage collected",e),!0;return!1}(e,r,o.start)){if(function(e,t){if(e.length<2)return!0;var n=e[e.length-1].bufferedStart;if(void 0!==t&&t-n>.05)return!0;var r=e[e.length-2].bufferedStart;return Math.abs(r-n)>.01}(s=a(e.infos),e.bufferedStart))return!1;M.Z.debug("Stream: skipping segment gc-ed at the start",e)}if(function(e,t,n){var r=P.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedEnd)return M.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>r)return M.Z.info("Stream: The end of the wanted segment has been garbage collected",e),!0;return!1}(e,i,o.end)){if(function(e,t){if(e.length<2)return!0;var n=e[e.length-1].bufferedEnd;if(void 0!==t&&n-t>.05)return!0;var r=e[e.length-2].bufferedEnd;return Math.abs(r-n)>.01}(s=null!=s?s:a(e.infos),e.bufferedEnd))return!1;M.Z.debug("Stream: skipping segment gc-ed at the end",e)}return!0})),v=P.Z.getCurrent(),h=v.MINIMUM_SEGMENT_SIZE,m=v.MIN_BUFFER_LENGTH,g=v.MIN_BUFFER_DISTANCE_BEFORE_CLEAN_UP,y=!1,_=Math.min(1/60,h),b=!1;return{neededSegments:f.filter((function(e){var t=(0,V.Z)({segment:e},n);if(s.length>0&&s.some((function(e){return(0,be.z)(t,e)})))return!1;var a=e.duration,u=e.time,l=e.end;if(e.isInit)return!0;if(y&&u<o.start+g&&(b=!0),y&&d>m)return!1;if(e.complete&&a<h)return!1;if(s.length>0&&s.some((function(e){if(e.period.id!==n.period.id||e.adaptation.id!==n.adaptation.id)return!1;var a=e.segment;return!(a.time-_>u)&&(!(a.end+_<l)&&!Dt(e,t,r,i))})))return!1;for(var f=0;f<p.length;f++){var v=p[f];if(v.infos.period.id===n.period.id){var T=v.infos.segment;if(u-T.time>-_&&T.end-l>-_)return!1}}for(var E=0;E<p.length;E++){var S=p[E];if(S.end>u)return S.start>u+_||Pt(p,E).end<l-_}var w=a*n.representation.bitrate/8e3;return c-w<0&&d>m?(y=!0,!1):(c-=w,d+=a,!0)})),isBufferFull:b}}function Pt(e,t){for(var n=t+1,r=P.Z.getCurrent().MINIMUM_SEGMENT_SIZE,i=Math.min(1/60,r);n<e.length-1&&e[n-1].end+i>e[n].start;)n++;return e[--n]}function Dt(e,t,n,r){var i=P.Z.getCurrent().CONTENT_REPLACEMENT_PADDING;return e.period.id===t.period.id&&(!(e.segment.time<n+i)&&(e.adaptation.id!==t.adaptation.id||function(e,t,n){var r=e.bitrate,i=P.Z.getCurrent().BITRATE_REBUFFERING_RATIO;if(void 0===n){var a=r*i;return t.bitrate>a}return r<n&&t.bitrate>r}(e.representation,t.representation,r)))}function Nt(e,t){for(var n=e-t,r=P.Z.getCurrent().SEGMENT_PRIORITIES_STEPS,i=0;i<r.length;i++)if(n<r[i])return i;return r.length}function Ot(e,t,n,r,i,a,o){var s,u=e.period,l=e.representation;o.synchronizeInventory();var c,d,f=t+i,p={start:Math.max(t,u.start),end:Math.min(f,null!==(s=u.end)&&void 0!==s?s:1/0)},v=l.index.shouldRefresh(t,f),h=o.getPendingOperations().filter((function(e){return e.type===pt.f.EndOfSegment})).map((function(e){return e.value})),m=function(e,t){for(var n=P.Z.getCurrent().MINIMUM_SEGMENT_SIZE,r=Math.max(1/60,n),i=e.start+r,a=e.end-r,o=[],s=t.length-1;s>=0;s--){var u=t[s],l=u.infos.representation;if(!u.partiallyPushed&&!1!==l.decipherable&&l.isSupported){var c=u.infos.segment,d=c.time/c.timescale;((c.complete?d+c.duration/c.timescale:u.end)>i&&d<a||u.end>i&&u.start<a)&&o.unshift(u)}}return o}({start:Math.max(p.start-.5,0),end:p.end+.5},o.getInventory()),g=Ct({content:e,bufferedSegments:m,currentPlaybackTime:n.getCurrentTime(),fastSwitchThreshold:r,getBufferedHistory:o.getSegmentHistory.bind(o),neededRange:p,segmentsBeingPushed:h,maxBufferSize:a}),y=g.neededSegments,_=g.isBufferFull,b=y.map((function(e){return{priority:Nt(e.time,t),segment:e}})),T=l.index.getLastPosition();if(!l.index.isInitialized()||void 0===u.end||b.length>0)c=!1;else if(void 0===T)c=p.end>=u.end&&l.index.isFinished();else if(null===T)c=l.index.isFinished();else{var E=void 0!==u.end?Math.min(u.end,T):T;c=p.end>=E&&l.index.isFinished()}if(l.index.isInitialized()&&(l.index.areSegmentsChronologicallyGenerated()||c)){var S=null;h.length>0&&(S=Math.min.apply(Math,h.map((function(e){return e.segment.time})))),b.length>0&&(S=null!==S?Math.min(S,b[0].segment.time):b[0].segment.time),d=Mt(e,p,S,c,m)}else d=null;return{imminentDiscontinuity:d,hasFinishedLoading:c,neededSegments:b,isBufferFull:_,shouldRefreshManifest:v}}function Lt(e,t,n){for(var r=(0,K.F_)(t,e),i=r.innerRange,a=r.outerRanges,o=[],s=0;s<a.length;s++){var u=a[s];(e-n>u.end||e+n<u.start)&&o.push(u)}return null!==i&&(M.Z.debug("Stream: GC removing part of inner range",o),e-n>i.start&&o.push({start:i.start,end:e-n}),e+n<i.end&&o.push({start:e+n,end:i.end})),o}function Bt(e,t,n){var r=t.pushChunk(n);return r.pipe((0,At.K)((function(n){if(!(n instanceof Error)||"QuotaExceededError"!==n.name){var i=n instanceof Error?n.toString():"An unknown error happened when pushing content";throw new D.Z("BUFFER_APPEND_ERROR",i)}return e.observe(!0).pipe((0,A.q)(1),(0,c.z)((function(e){var n,i,a=e.position+e.wantedTimeOffset;return(0,b.z)((n=a,i=t,(0,p.P)((function(){var e=P.Z.getCurrent().BUFFER_GC_GAPS.CALM,t=P.Z.getCurrent().BUFFER_GC_GAPS.BEEFY;M.Z.warn("Stream: Running garbage collector");var r=i.getBufferedRanges(),a=Lt(n,r,e);return 0===a.length&&(a=Lt(n,r,t)),M.Z.debug("Stream: GC cleaning",a),(0,Et.D)(a.map((function(e){var t=e.start,n=e.end;return i.removeBuffer(t,n)}))).pipe((0,St.u)())}))).pipe((0,xe.l)()),r).pipe((0,At.K)((function(e){var t=e instanceof Error?e.toString():"Could not clean the buffer";throw new D.Z("BUFFER_FULL_ERROR",t)})))})))})))}var Ut=function(e){var t=e.content,n=e.options,r=e.playbackObserver,a=e.segmentBuffer,o=e.segmentFetcher,u=e.terminate$,d=t.period,f=t.adaptation,v=t.representation,h=n.bufferGoal$,m=n.maxBufferSize$,T=n.drmSystemId,x=n.fastSwitchThreshold$,I=f.type,Z={segment:v.index.getInitSegment(),segmentData:null,isLoaded:!1},R=new i.x,C=(0,G.$)({initSegment:null,segmentQueue:[]}),D=null!==Z.segment,N=new Rt(t,C,o,D);D||(Z.segmentData=null,Z.isLoaded=!0);var O=!1,L=S.E;if(void 0!==T){var B=v.getEncryptionData(T);B.length>0&&(L=l.of.apply(void 0,B.map((function(e){return kt.Z.encryptionDataEncountered(e,t)}))),O=!0)}var U,F,z=N.start().pipe((0,c.z)((function(e){switch(e.type){case"retry":return(0,b.z)((0,l.of)({type:"warning",value:e.value.error}),(0,p.P)((function(){var t=e.value.segment,n=v.index;if(!1===n.isSegmentStillAvailable(t))R.next();else if(n.canBeOutOfSyncError(e.value.error,t))return(0,l.of)(kt.Z.manifestMightBeOufOfSync());return S.E})));case"parsed-init":case"parsed-media":return function(e){if("init"===e.segmentType){Zt()((function(){R.next()})),Z.segmentData=e.initializationData,Z.isLoaded=!0;var n=v.getAllEncryptionData(),i=!O&&n.length>0?l.of.apply(void 0,n.map((function(e){return kt.Z.encryptionDataEncountered(e,t)}))):S.E,o=function(e){var t=e.playbackObserver,n=e.content,r=e.segment,i=e.segmentData,a=e.segmentBuffer;return(0,p.P)((function(){if(null===i)return S.E;var e=n.representation.getMimeTypeString();return Bt(t,a,{data:{initSegment:i,chunk:null,timestampOffset:0,appendWindow:[void 0,void 0],codec:e},inventoryInfos:null}).pipe((0,s.U)((function(){var e=a.getBufferedRanges();return kt.Z.addedSegment(n,r,e,i)})))}))}({playbackObserver:r,content:t,segment:e.segment,segmentData:e.initializationData,segmentBuffer:a});return(0,E.T)(i,o)}var u=e.inbandEvents,c=e.needsManifestRefresh,d=e.protectionDataUpdate&&!O?l.of.apply(void 0,v.getAllEncryptionData().map((function(e){return kt.Z.encryptionDataEncountered(e,t)}))):S.E,f=!0===c?(0,l.of)(kt.Z.needsManifestRefresh()):S.E,h=void 0!==u&&u.length>0?(0,l.of)({type:"inband-events",value:u}):S.E,m=Z.segmentData,g=function(e){var t=e.playbackObserver,n=e.content,r=e.initSegmentData,i=e.parsedSegment,a=e.segment,o=e.segmentBuffer;return(0,p.P)((function(){var e,u;if(null===i.chunkData)return S.E;var l=i.chunkData,c=i.chunkInfos,d=i.chunkOffset,f=i.chunkSize,p=i.appendWindow,v=n.representation.getMimeTypeString(),h=P.Z.getCurrent().APPEND_WINDOW_SECURITIES,m=[void 0!==p[0]?Math.max(0,p[0]-h.START):void 0,void 0!==p[1]?p[1]+h.END:void 0],g={initSegment:r,chunk:l,timestampOffset:d,appendWindow:m,codec:v},y=null!==(e=null==c?void 0:c.time)&&void 0!==e?e:a.time,_=y+(null!==(u=null==c?void 0:c.duration)&&void 0!==u?u:a.duration);void 0!==m[0]&&(y=Math.max(y,m[0])),void 0!==m[1]&&(_=Math.min(_,m[1]));var b=(0,V.Z)({segment:a,chunkSize:f,start:y,end:_},n);return Bt(t,o,{data:g,inventoryInfos:b}).pipe((0,s.U)((function(){var e=o.getBufferedRanges();return kt.Z.addedSegment(n,a,e,l)})))}))}({playbackObserver:r,content:t,initSegmentData:m,parsedSegment:e,segment:e.segment,segmentBuffer:a});return(0,b.z)(d,f,h,g)}(e);case"end-of-segment":var n=e.value.segment;return a.endOfSegment((0,V.Z)({segment:n},t)).pipe((0,xe.l)());case"end-of-queue":return R.next(),S.E;default:(0,ct.Z)(e)}}))),K=(0,y.a)([r.observe(!0),h,m,u.pipe((0,A.q)(1),(0,_.O)(null)),R.pipe((0,_.O)(void 0))]).pipe((0,De.M)(x),(0,c.z)((function(e){var n=e[0],i=n[0],o=n[1],s=n[2],u=n[3],c=e[1],f=i.position+i.wantedTimeOffset,p=Ot(t,f,r,c,o,s,a),h=p.neededSegments,m=null;if(v.index.isInitialized()){if(h.length>0&&!Z.isLoaded&&null!==Z.segment){var g=h[0].priority;m={segment:Z.segment,priority:g}}}else if(null===Z.segment)M.Z.warn("Stream: Uninitialized index without an initialization segment");else if(Z.isLoaded)M.Z.warn("Stream: Uninitialized index with an already loaded initialization segment");else{var y=i.position+i.wantedTimeOffset;m={segment:Z.segment,priority:Nt(d.start,y)}}if(null===u)C.setValue({initSegment:m,segmentQueue:h});else{if(u.urgent)return M.Z.debug("Stream: Urgent switch, terminate now.",I),C.setValue({initSegment:null,segmentQueue:[]}),C.finish(),(0,l.of)(kt.Z.streamTerminating());var _=h[0],T=N.getRequestedInitSegment(),E=N.getRequestedMediaSegment(),w=null===E||void 0===_||E.id!==_.segment.id?[]:[_],k=null===T?null:m;if(C.setValue({initSegment:k,segmentQueue:w}),0===w.length&&null===k)return M.Z.debug("Stream: No request left, terminate",I),C.finish(),(0,l.of)(kt.Z.streamTerminating())}var A=(0,l.of)({type:"stream-status",value:{period:d,position:i.position,bufferType:I,imminentDiscontinuity:p.imminentDiscontinuity,hasFinishedLoading:p.hasFinishedLoading,neededSegments:p.neededSegments}}),x=S.E,R=P.Z.getCurrent().UPTO_CURRENT_POSITION_CLEANUP;if(p.isBufferFull){var D=Math.max(0,f-R);x=a.removeBuffer(0,D).pipe((0,xe.l)())}return p.shouldRefreshManifest?(0,b.z)((0,l.of)(kt.Z.needsManifestRefresh()),A,x):(0,b.z)(A,x)})),(U=function(e){return"stream-terminating"!==e.type},void 0===(F=!0)&&(F=!1),(0,w.e)((function(e,t){var n=0;e.subscribe(new k.Q(t,(function(e){var r=U(e,n++);(r||F)&&t.next(e),!r&&t.complete()})))}))));return(0,E.T)(K,z,L).pipe((0,g.B)())};var Ft=function(e){var t=e.abrManager,n=e.playbackObserver,r=e.content,a=e.options,o=e.segmentBuffer,d=e.segmentFetcherCreator,f=e.wantedBufferAhead,v=e.maxVideoBufferSize,h="direct"===a.manualBitrateSwitchingMode,y=r.manifest,_=r.period,w=r.adaptation,k={},x=function(e,t,n){var r=e.manifest,a=e.adaptation,o=new i.x;return{estimator$:(0,E.T)((0,F.R)(r,"decipherabilityUpdate"),(0,l.of)(null)).pipe((0,s.U)((function(){var e=a.getPlayableRepresentations();if(e.length<=0)throw new D.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+a.type+" Adaptation can be played");return e})),(0,u.x)((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<t.length;n++)if(e[n].id!==t[n].id)return!1;return!0})),(0,T.w)((function(e){return t.get$(a.type,e,n,o)}))),abrFeedbacks$:o}}(r,t,n.observe(!0)),I=x.estimator$,Z=x.abrFeedbacks$,R=d.createSegmentFetcher(w.type,{onRequestBegin:function(e){Z.next({type:"requestBegin",value:e})},onRequestEnd:function(e){Z.next({type:"requestEnd",value:e})},onProgress:function(e){Z.next({type:"progress",value:e})},onMetrics:function(e){Z.next({type:"metrics",value:e})}}),C=(0,G.$)(null),O=I.pipe((0,Pe.b)((function(e){C.setValue(e)})),(0,Ie.Z)(),(0,g.B)()),L=O.pipe((0,m.h)((function(e){return null!=e.bitrate})),(0,u.x)((function(e,t){return e.bitrate===t.bitrate})),(0,s.U)((function(e){var t=e.bitrate;return M.Z.debug("Stream: new "+w.type+" bitrate estimate",t),kt.Z.bitrateEstimationChange(w.type,t)}))),B=O.pipe(_t((function(e,t){return U(e,0===t)})));return(0,E.T)(B,L);function U(e,t){var r=e.representation;if(h&&e.manual&&!t){var i=P.Z.getCurrent().DELTA_POSITION_AFTER_RELOAD;return xt(_,w.type,n,i.bitrateSwitch)}var o=C.asObservable().pipe((0,m.h)((function(t){return null===t||t.representation.id!==r.id||t.manual&&!e.manual})),(0,A.q)(1),(0,s.U)((function(e){return null===e?(M.Z.info("Stream: urgent Representation termination",w.type),{urgent:!0}):e.urgent?(M.Z.info("Stream: urgent Representation switch",w.type),{urgent:!0}):(M.Z.info("Stream: slow Representation switch",w.type),{urgent:!1})}))),d=a.enableFastSwitching?C.asObservable().pipe((0,s.U)((function(e){return null===e?void 0:e.knownStableBitrate})),(0,u.x)()):(0,l.of)(0),f=(0,l.of)(kt.Z.representationChange(w.type,_,r));return(0,b.z)(f,z(r,o,d)).pipe((0,Pe.b)((function(e){if("representationChange"===e.type||"added-segment"===e.type)return Z.next(e)})),(0,c.z)((function(e){if("stream-terminating"===e.type){var t=C.getValue();return null===t?S.E:U(t,!1)}return(0,l.of)(e)})))}function z(e,t,r){return(0,p.P)((function(){var i=k[e.id],u=null!=i?i:1;k[e.id]=u;var c=f.asObservable().pipe((0,s.U)((function(e){return e*u}))),d="video"===w.type?v.asObservable():(0,l.of)(1/0);return M.Z.info("Stream: changing representation",w.type,e.id,e.bitrate),Ut({playbackObserver:n,content:{representation:e,adaptation:w,period:_,manifest:y},segmentBuffer:o,segmentFetcher:R,terminate$:t,options:{bufferGoal$:c,maxBufferSize$:d,drmSystemId:a.drmSystemId,fastSwitchThreshold$:r}}).pipe((0,At.K)((function(n){var i=(0,N.Z)(n,{defaultCode:"NONE",defaultReason:"Unknown `RepresentationStream` error"});if("BUFFER_FULL_ERROR"===i.code){var a=f.getValue(),o=u;if(o<=.25||a*o<=2)throw i;return k[e.id]=o-.25,z(e,t,r)}throw i})))}))}};function zt(e,t,n,r){var i=r.period,a=!1,o=t.asObservable(),s=e.observe(!0);return(0,y.a)([s,o]).pipe((0,c.z)((function(e){var t=e[0],r=e[1],o=t.position;return void 0!==i.end&&o+r>=i.end&&(M.Z.debug('Stream: full "empty" AdaptationStream',n),a=!0),(0,l.of)({type:"stream-status",value:{period:i,bufferType:n,position:t.position,imminentDiscontinuity:null,hasFinishedLoading:a,neededSegments:[],shouldRefreshManifest:!1}})})))}var Vt=n(9252);var Kt=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,Le.Z)(i,(function(e){return(0,Vt.Z)(e,"codecs=")})),l=(0,Le.Z)(s,(function(e){return(0,Vt.Z)(e,"codecs=")}));if(void 0===u||void 0===l)return!1;var c=u.substring(7),d=l.substring(7);return c.split(".")[0]===d.split(".")[0]};function Gt(e,t,n,r,i){if(void 0!==e.codec&&"reload"===i.onCodecSwitch&&!function(e,t){return e.getPlayableRepresentations().some((function(e){return Kt(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,K.JN)(a),s=t.start,u=null==t.end?1/0:t.end,l=(0,K.tn)(o,[{start:s,end:u}]);if(0===l.length)return{type:"continue",value:void 0};e.synchronizeInventory();var c=e.getInventory();if(!c.some((function(e){return e.infos.period.id===t.id&&e.infos.adaptation.id!==n.id})))return{type:"continue",value:void 0};var d=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}),[])}(c,t,n),f=(0,K.uH)(l,d);if(0===f.length)return{type:"continue",value:void 0};var p=r.currentTime,v=i.audioTrackSwitchingMode;if(("video"===n.type||"audio"===n.type&&"reload"===v)&&(0,K.Ti)({start:s,end:u},p)&&(r.readyState>1||!n.getPlayableRepresentations().some((function(t){var n;return Kt(t.getMimeTypeString(),null!==(n=e.codec)&&void 0!==n?n:"")})))&&!(0,K.A1)(d,p))return{type:"needs-reload",value:void 0};var h="audio"===n.type&&"direct"===v,m=[],g=function(e,t){for(var n=0;n<e.length;n++)if(e[n].infos.period.start>=t.start)return n>0?e[n-1]:null;return e.length>0?e[e.length-1]:null}(c,t);null!==g&&(void 0===g.bufferedEnd||t.start-g.bufferedEnd<1)&&m.push({start:0,end:t.start+1});var y=n.type,_=P.Z.getCurrent().ADAPTATION_SWITCH_BUFFER_PADDINGS,b=_[y].before;null==b&&(b=0);var T=_[y].after;if(null==T&&(T=0),h||m.push({start:p-b,end:p+T}),void 0!==t.end){var E=function(e,t){for(var n=0;n<e.length;n++)if(e[n].infos.period.start>t.start)return e[n];return null}(c,t);null!==E&&(void 0===E.bufferedStart||E.bufferedStart-t.end<1)&&m.push({start:t.end-1,end:Number.MAX_VALUE})}var S=(0,K.uH)(f,m);return 0===S.length?{type:"continue",value:void 0}:h?{type:"flush-buffer",value:S}:{type:"clean-buffer",value:S}}var Ht=function(e){var t=e.abrManager,n=e.bufferType,r=e.content,i=e.garbageCollectors,o=e.playbackObserver,u=e.segmentFetcherCreator,d=e.segmentBuffersStore,f=e.options,v=e.wantedBufferAhead,h=e.maxVideoBufferSize,m=r.period,g=new a.t(1);return g.pipe((0,T.w)((function(e,a){var g=P.Z.getCurrent().DELTA_POSITION_AFTER_RELOAD,y=0===a?0:"audio"===n?g.trackSwitch.audio:"video"===n?g.trackSwitch.video:g.trackSwitch.other;if(null===e){M.Z.info("Stream: Set no "+n+" Adaptation. P:",m.start);var _,T=d.getStatus(n);if("initialized"===T.type){if(M.Z.info("Stream: Clearing previous "+n+" SegmentBuffer"),gt.isNative(n))return xt(m,n,o,0);_=T.value.removeBuffer(m.start,null==m.end?1/0:m.end)}else"uninitialized"===T.type&&d.disableSegmentBuffer(n),_=(0,l.of)(null);return(0,b.z)(_.pipe((0,s.U)((function(){return kt.Z.adaptationChange(n,null,m)}))),zt(o,v,n,{period:m}))}if(gt.isNative(n)&&"disabled"===d.getStatus(n).type)return xt(m,n,o,y);M.Z.info("Stream: Updating "+n+" adaptation","A: "+e.id,"P: "+m.start);var w=(0,p.P)((function(){var a=o.getReadyState(),p=function(e,t,n,r){var i=e.getStatus(t);if("initialized"===i.type)return M.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)}(d,n,e,f),g={currentTime:o.getCurrentTime(),readyState:a},_=Gt(p,m,e,g,f);if("needs-reload"===_.type)return xt(m,n,o,y);var T="flush-buffer"===_.type?(0,l.of)(kt.Z.needsBufferFlush()):S.E,w="clean-buffer"===_.type||"flush-buffer"===_.type?b.z.apply(void 0,_.value.map((function(e){var t=e.start,n=e.end;return p.removeBuffer(t,n)}))).pipe((0,xe.l)()):S.E,k=i.get(p),A=function(e,i){var a=r.manifest,c=function(e,t){return e.deriveReadOnlyObserver((function(e){return e.pipe((0,s.U)(n))}),n);function n(e){var n=t.getBufferedRanges();return(0,V.Z)({},e,{bufferGap:(0,K.L7)(n,e.position)})}}(o,i);return Ft({abrManager:t,content:{manifest:a,period:m,adaptation:e},options:f,playbackObserver:c,segmentBuffer:i,segmentFetcherCreator:u,wantedBufferAhead:v,maxVideoBufferSize:h}).pipe((0,At.K)((function(e){if(!gt.isNative(n)){M.Z.error("Stream: "+n+" Stream crashed. Aborting it.",e),d.disposeSegmentBuffer(n);var t=(0,N.Z)(e,{defaultCode:"NONE",defaultReason:"Unknown `AdaptationStream` error"});return(0,b.z)((0,l.of)(kt.Z.warning(t)),zt(o,v,n,{period:m}))}throw M.Z.error("Stream: "+n+" Stream crashed. Stopping playback.",e),e})))}(e,p);return d.waitForUsableBuffers().pipe((0,c.z)((function(){return(0,b.z)(w,T,(0,E.T)(A,k))})))}));return(0,b.z)((0,l.of)(kt.Z.adaptationChange(n,e,m)),w)})),(0,_.O)(kt.Z.periodStreamReady(n,m,g)))},Wt=n(3074);function jt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map((function(e){return e.pipe((0,m.h)((function(e){return"complete-stream"===e.type||"stream-status"===e.type&&!e.value.hasFinishedLoading})),(0,s.U)((function(e){return"complete-stream"===e.type})),(0,_.O)(!1),(0,u.x)())}));return(0,y.a)(r).pipe((0,s.U)((function(e){return e.every((function(e){return e}))})),(0,u.x)())}var qt=function(e,t,n,r,a,d){var f,v,h=e.manifest,T=e.initialPeriod,w=d.maxBufferAhead,k=d.maxBufferBehind,x=d.wantedBufferAhead,I=d.maxVideoBufferSize,Z=P.Z.getCurrent(),R=Z.MAXIMUM_MAX_BUFFER_AHEAD,C=Z.MAXIMUM_MAX_BUFFER_BEHIND,N=new Tt((function(e){var n=e.bufferType,r=null!=C[n]?C[n]:1/0,i=null!=R[n]?R[n]:1/0;return wt({segmentBuffer:e,currentTime$:t.observe(!0).pipe((0,s.U)((function(e){return e.position+e.wantedTimeOffset}))),maxBufferBehind$:k.asObservable().pipe((0,s.U)((function(e){return Math.min(e,r)}))),maxBufferAhead$:w.asObservable().pipe((0,s.U)((function(e){return Math.min(e,i)})))})})),O=t.observe(!0).pipe((0,Ze.Z)((function(e){var t=e.position,n=e.wantedTimeOffset+t;if(n<h.getMinimumPosition()){var r=new D.Z("MEDIA_TIME_BEFORE_MANIFEST","The current position is behind the earliest time announced in the Manifest.");return kt.Z.warning(r)}if(n>h.getMaximumPosition()){var i=new D.Z("MEDIA_TIME_AFTER_MANIFEST","The current position is after the latest time announced in the Manifest.");return kt.Z.warning(i)}return null}),null)),L=r.getBufferTypes().map((function(e){return function(e,n){var a=new bt((function(e,t){return e.start-t.start})),o=new i.x,u=!1;function d(t){return V(e,t,o).pipe((0,s.U)((function(e){switch(e.type){case"waiting-media-source-reload":var t=a.head();if(void 0===t||t.id!==e.value.period.id)return kt.Z.lockedStream(e.value.bufferType,e.value.period);var n=e.value,r=n.position,i=n.autoPlay;return kt.Z.needsMediaSourceReload(r,i);case"periodStreamReady":u=!0,a.add(e.value.period);break;case"periodStreamCleared":a.removeElement(e.value.period)}return e})),(0,g.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)<e)}var v=t.observe(!0).pipe((0,Ze.Z)((function(t){var n,r=t.position,i=t.wantedTimeOffset,a=i+r;if(!u||!f(a))return null;var s=null!==(n=h.getPeriodForTime(a))&&void 0!==n?n:h.getNextPeriod(a);return void 0===s?null:(M.Z.info("SO: Current position out of the bounds of the active periods,re-creating Streams.",e,r+i),u=!1,o.next(),s)}),null),(0,c.z)((function(e){if(null==e)throw new D.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return d(e)}))),m=(0,F.R)(h,"decipherabilityUpdate").pipe((0,c.z)((function(n){var i=r.getStatus(e),a=n.filter((function(t){return t.adaptation.type===e}));if(0===a.length||"initialized"!==i.type)return S.E;var s=a.filter((function(e){return!1===e.representation.decipherable})),f=i.value,v=function(e,t){if(0===t.length)return[];e.synchronizeInventory();for(var n=[],r=e.getInventory(),i=function(i){var a=r[i];if(t.some((function(e){return a.infos.period.id===e.period.id&&a.infos.adaptation.id===e.adaptation.id&&a.infos.representation.id===e.representation.id}))){var o=a.bufferedStart,s=a.bufferedEnd;if(void 0===o||void 0===s){M.Z.warn("SO: No buffered start or end found from a segment.");var u=e.getBufferedRanges(),l=u.length;return 0===l?{v:[]}:{v:[{start:u.start(0),end:u.end(l-1)}]}}var c=n[n.length-1];void 0!==c&&c.end===o?c.end=s:n.push({start:o,end:s})}},a=0;a<r.length;a++){var o=i(a);if("object"==typeof o)return o.v}return n}(f,s);return 0===v.length?S.E:(u=!1,o.next(),b.z.apply(void 0,v.map((function(e){var t=e.start,n=e.end;return f.removeBuffer(t,n).pipe((0,xe.l)())})).concat([t.observe(!0).pipe((0,A.q)(1),(0,c.z)((function(e){return(0,b.z)((0,l.of)(kt.Z.needsDecipherabilityFlush(e.position,!e.isPaused,e.duration)),(0,p.P)((function(){var t=e.position+e.wantedTimeOffset,n=h.getPeriodForTime(t);if(null==n)throw new D.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return d(n)})))})))])))})));return(0,E.T)(v,m,d(n))}(e,T).pipe((0,Ie.Z)(),(0,g.B)())})),B=(f=L,v=f.length,E.T.apply(void 0,f).pipe((0,m.h)((function(e){var t=e.type;return"periodStreamCleared"===t||"adaptationChange"===t||"representationChange"===t})),(0,Wt.R)((function(e,t){switch(t.type){case"periodStreamCleared":var n=t.value,r=n.period,i=n.type,a=e[r.id];void 0!==a&&a.buffers.has(i)&&(a.buffers.delete(i),0===a.buffers.size&&delete e[r.id]);break;case"adaptationChange":if(null!==t.value.adaptation)return e;case"representationChange":var o=t.value,s=o.period,u=o.type,l=e[s.id];if(void 0===l){var c=new Set;c.add(u),e[s.id]={period:s,buffers:c}}else l.buffers.has(u)||l.buffers.add(u)}return e}),{}),(0,s.U)((function(e){for(var t=Object.keys(e),n=[],r=0;r<t.length;r++){var i=e[t[r]];void 0!==i&&i.buffers.size===v&&n.push(i.period)}return n.reduce((function(e,t){return null===e||t.start<e.start?t:e}),null)})),(0,u.x)((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e.id===t.id})))).pipe((0,m.h)((function(e){return null!==e})),(0,s.U)((function(e){return M.Z.info("Stream: New active period",e.start),kt.Z.activePeriodChanged(e)}))),U=(0,F.R)(h,"manifestUpdate").pipe((0,s.U)((function(){return h.isLastPeriodKnown})),(0,_.O)(h.isLastPeriodKnown),(0,u.x)()),z=(0,y.a)([jt.apply(void 0,L),U]).pipe((0,s.U)((function(e){var t=e[0],n=e[1];return t&&n})),(0,u.x)(),(0,s.U)((function(e){return e?kt.Z.endOfStream():kt.Z.resumeStream()})));return E.T.apply(void 0,L.concat([B,z,O]));function V(e,s,u){M.Z.info("SO: Creating new Stream for",e,s.start);var f=new i.x,p=new i.x,v=t.observe(!0).pipe((0,m.h)((function(e){var t=e.position,n=e.wantedTimeOffset;return null!=s.end&&t+n>=s.end}))),y=f.pipe(_t((function(t){return V(e,t,p)}))),_=u.pipe((0,A.q)(1),(0,Pe.b)((function(){f.complete(),p.next(),p.complete()})),(0,g.B)()),T=(0,E.T)(v,_),S=Ht({abrManager:n,bufferType:e,content:{manifest:h,period:s},garbageCollectors:N,segmentFetcherCreator:a,segmentBuffersStore:r,options:d,playbackObserver:t,wantedBufferAhead:x,maxVideoBufferSize:I}).pipe((0,c.z)((function(t){if("stream-status"===t.type)if(t.value.hasFinishedLoading){var n=h.getPeriodAfter(s);if(null===n)return(0,b.z)((0,l.of)(t),(0,l.of)(kt.Z.streamComplete(e)));f.next(n)}else p.next();return(0,l.of)(t)})),(0,g.B)()),w=(0,b.z)(S.pipe((0,o.R)(T)),(0,l.of)(kt.Z.periodStreamCleared(e,s)).pipe((0,Pe.b)((function(){M.Z.info("SO: Destroying Stream for",e,s.start)}))));return(0,E.T)(w,y,_.pipe((0,xe.l)()))}};function Yt(e,t,n){return function(e){return(0,E.T)((0,x.ym)(e).pipe((0,s.U)((function(){return!0}))),(0,x.ep)(e).pipe((0,s.U)((function(){return!1}))),(0,x.UG)(e).pipe((0,s.U)((function(){return!1})))).pipe((0,_.O)("open"===e.readyState),(0,u.x)())}(e).pipe((0,T.w)((function(t){return t?function(e){if(0===e.length)return(0,l.of)(void 0);for(var t=[],n=function(n){var r=e[n];t.push((0,E.T)((0,lt.R)(r,"updatestart").pipe((0,s.U)((function(){return!0}))),(0,lt.R)(r,"update").pipe((0,s.U)((function(){return!1}))),(0,ut.F)(500).pipe((0,s.U)((function(){return r.updating})))).pipe((0,_.O)(r.updating),(0,u.x)()))},r=0;r<e.length;r++)n(r);return(0,y.a)(t).pipe((0,m.h)((function(e){return e.every((function(e){return!e}))})),(0,s.U)((function(){})))}(e.sourceBuffers):S.E})),(0,A.q)(1),(0,s.U)((function(){var r=t.getMaximumPosition(),i=t.isLive?Math.max(Math.pow(2,32),r+31536e3):r;return e.duration>=i||i===n?null:isNaN(e.duration)||!isFinite(e.duration)||i-e.duration>.01?(M.Z.info("Init: Updating duration",i),e.duration=i,i):null})),(0,At.K)((function(e){return M.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e),(0,l.of)(null)})))}var $t=n(5039),Xt=Array.isArray;function Qt(e){return 1===e.length&&Xt(e[0])?e[0]:e}function Jt(e){return function(t){for(var n=[],r=function(r){n.push((0,yt.Xf)(e[r]).subscribe(new k.Q(t,(function(e){if(n){for(var i=0;i<n.length;i++)i!==r&&n[i].unsubscribe();n=null}t.next(e)}))))},i=0;n&&!t.closed&&i<e.length;i++)r(i)}}var en=n(5987);var tn=x.gg,nn=x.ym,rn=x._E;function an(e){return(0,p.P)((function(){if(M.Z.debug("Init: Trying to call endOfStream"),"open"!==e.readyState)return M.Z.debug("Init: MediaSource not open, cancel endOfStream"),(0,l.of)(null);var t=e.sourceBuffers,n=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.updating&&t.push(r)}return t}(t);if(0===n.length)return M.Z.info("Init: Triggering end of stream"),e.endOfStream(),(0,l.of)(null);M.Z.debug("Init: Waiting SourceBuffers to be updated before calling endOfStream.");var r,i=n.map((function(e){return rn(e).pipe((0,A.q)(1))}));return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=Qt(e)).length?(0,yt.Xf)(e[0]):new f.y(Jt(e))}(E.T.apply(void 0,i).pipe((r=1,r<=0?function(){return S.E}:(0,w.e)((function(e,t){var n=[];e.subscribe(new k.Q(t,(function(e){n.push(e),r<n.length&&n.shift()}),(function(){var e,r;try{for(var i=(0,en.XA)(n),a=i.next();!a.done;a=i.next()){var o=a.value;t.next(o)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}t.complete()}),void 0,(function(){n=null})))})))),tn(t).pipe((0,A.q)(1))).pipe((0,c.z)((function(){return an(e)})))}))}var on=n(7920),sn=n(467);var un=function(e,t){return e.id===t.id&&e.start===t.start&&e.end===t.end};var ln=function(e,t){for(var n=[],r=t.periods,i=0;i<r.length;i++){r[i].streamEvents.forEach((function(t){for(var r=t.start,i=t.end,a=t.id,o=t.data,s=0;s<e.length;s++){var u=e[s];if(un(u,{id:a,start:r,end:i}))return void n.push(u)}if(void 0===i){var l={start:r,id:a,data:o,publicEvent:{start:r,data:o}};n.push(l)}else{var c={start:r,end:i,id:a,data:o,publicEvent:{start:r,end:i,data:o}};n.push(c)}}))}return n};function cn(e){return void 0!==e.end}var dn=function(e,t,n){var r=new WeakMap,i=[];return(0,F.R)(e,"manifestUpdate").pipe((0,_.O)(null),(0,Wt.R)((function(t){return ln(t,e)}),[])).pipe((0,Pe.b)((function(e){return i=e})),(0,s.U)((function(e){return e.length>0})),(0,u.x)(),(0,T.w)((function(e){if(!e)return S.E;var a=P.Z.getCurrent().STREAM_EVENT_EMITTER_POLL_INTERVAL;return(0,y.a)([(0,ut.F)(a).pipe((0,_.O)(null)),n]).pipe((0,s.U)((function(e){e[0];return{isSeeking:e[1].seeking,currentTime:t.currentTime}})),(0,w.e)((function(e,t){var n,r=!1;e.subscribe(new k.Q(t,(function(e){var i=n;n=e,r&&t.next([i,e]),r=!0})))})),(0,c.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=[],u=[],c=0;c<e.length;c++){var d=e[c],f=d.start,p=cn(d)?d.end:void 0;r.has(d)?(f>o||void 0!==p&&o>=p)&&(cn(d)&&u.push(d.publicEvent),r.delete(d)):f<=o&&void 0!==p&&o<p?(s.push({type:"stream-event",value:d.publicEvent}),r.set(d,!0)):i<f&&o>=(null!=p?p:f)&&(a?s.push({type:"stream-event-skip",value:d.publicEvent}):(s.push({type:"stream-event",value:d.publicEvent}),cn(d)&&u.push(d.publicEvent)))}return(0,b.z)(s.length>0?l.of.apply(void 0,s):S.E,u.length>0?l.of.apply(void 0,u).pipe((0,Pe.b)((function(e){"function"==typeof e.onExit&&e.onExit()})),(0,xe.l)()):S.E)}(i,t,n)})))})))},fn=n(2983);function pn(e){var t=e.mediaElement,n=e.manifest,r=e.speed,a=e.bufferOptions,u=e.abrManager,d=e.playbackObserver,f=e.segmentFetcherCreator;return function(e,v,h){var g,b=function(e,t){return(0,p.P)((function(){var n;return Yt(t,e).pipe((0,c.z)((function(r){return null!==r&&(n=r),(0,F.R)(e,"manifestUpdate").pipe((0,T.w)((function(){return Yt(t,e,n)})),(0,Pe.b)((function(e){null!==e&&(n=e)})))})),(0,xe.l)())}))}(n,e),w=null!==(g=n.getPeriodForTime(v))&&void 0!==g?g:n.getNextPeriod(v);if(void 0===w){var k=new D.Z("MEDIA_STARTING_TIME_NOT_FOUND","Wanted starting time not found in the Manifest.");return(0,st._)((function(){return k}))}var A=new gt(t,e),x=(0,on.Z)({mediaElement:t,playbackObserver:d,startTime:v,mustAutoPlay:h}),I=x.seekAndPlay$,Z=x.initialPlayPerformed,R=x.initialSeekPerformed,C=d.observe(!0),P=Z.asObservable().pipe((0,m.h)((function(e){return e})),(0,c.z)((function(){return dn(n,t,C)}))),N=function(e,t,n){var r=n.autoPlay,i=n.initialPlayPerformed,a=n.initialSeekPerformed,o=n.speed,u=n.startTime;return t.deriveReadOnlyObserver((function(t){return(0,y.a)([t,o.asObservable()]).pipe((0,s.U)((function(t){var n=t[0],o=t[1];return{liveGap:e.isLive?e.getMaximumPosition()-n.position:void 0,position:n.position,duration:n.duration,isPaused:i.getValue()?n.paused:!r,readyState:n.readyState,speed:o,wantedTimeOffset:a.getValue()?0:u-n.position}})))}))}(n,d,{autoPlay:h,initialPlayPerformed:Z,initialSeekPerformed:R,speed:r,startTime:v}),O=new i.x,L=new i.x,B=new i.x,U=qt({manifest:n,initialPeriod:w},N,u,A,f,a).pipe((0,c.z)((function(t){switch(t.type){case"end-of-stream":return M.Z.debug("Init: end-of-stream order received."),function(e){return nn(e).pipe((0,_.O)(null),(0,T.w)((function(){return an(e)})))}(e).pipe((0,xe.l)(),(0,o.R)(O));case"resume-stream":return M.Z.debug("Init: resume-stream order received."),O.next(null),S.E;case"stream-status":var n=t.value,r=n.period,i=n.bufferType,a=n.imminentDiscontinuity,s=n.position;return L.next({period:r,bufferType:i,discontinuity:a,position:s}),S.E;case"locked-stream":return B.next(t.value),S.E;default:return(0,l.of)(t)}}))),z=(0,fn.Z)(t,r,C).pipe((0,xe.l)()),V=(0,sn.Z)(d,n,B,L),K=I.pipe((0,T.w)((function(e){return"warning"===e.type?(0,l.of)(e):(0,$t.Z)(C,t,A,!1)})));return(0,E.T)(b,K,z,V,U,P).pipe(Ae((function(){A.disposeAll()})))}}var vn=n(6625);function hn(e){var t,n,r=e.initialManifest,i=e.manifestFetcher,a=e.minimumManifestUpdateInterval,o=e.scheduleRefresh$,u=(t=function(e,t){return i.fetch(e).pipe((0,c.z)((function(e){return"warning"===e.type?(0,l.of)(e):e.parse(t)})),(0,g.B)())},n=!1,function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return new f.y((function(e){if(!n){n=!0;var i=t.apply(void 0,r).subscribe({next:function(t){e.next(t)},error:function(t){n=!1,e.error(t)},complete:function(){n=!1,e.complete()}});return function(){i.unsubscribe(),n=!1}}e.complete()}))}),d=r.manifest,v=0;return(0,p.P)((function(){return h(r)}));function h(e){var t=e.sendingTime,n=e.parsingTime,r=e.updatingTime,i=void 0!==n?n+(null!=r?r:0):void 0,u=P.Z.getCurrent(),f=u.MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE,p=u.MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE,g=v>0?v<f:void 0!==i&&i>=p,y=void 0===t?0:performance.now()-t,_=Math.max(a-y,0),b=o.pipe((0,c.z)((function(e){var n=e.completeRefresh,r=e.delay,i=e.canUseUnsafeMode&&g;return mn(null!=r?r:0,a,t).pipe((0,s.U)((function(){return{completeRefresh:n,unsafeMode:i}})))}))),T=null===d.expired?S.E:(0,vn.H)(_).pipe((0,c.z)((function(){return null===d.expired?S.E:(0,Et.D)(d.expired)})),(0,s.U)((function(){return{completeRefresh:!0,unsafeMode:g}}))),w=function(){if(void 0===d.lifetime||d.lifetime<0)return S.E;var e,t=1e3*d.lifetime-y;void 0===i?e=t:d.lifetime<3&&i>=100?(e=Math.min(Math.max(3e3-y,Math.max(t,0)+i),6*t),M.Z.info("MUS: Manifest update rythm is too frequent. Postponing next request.",t,e)):i>=1e3*d.lifetime/10?(e=Math.min(Math.max(t,0)+i,6*t),M.Z.info("MUS: Manifest took too long to parse. Postponing next request",e,e)):e=t;return(0,vn.H)(Math.max(e,_)).pipe((0,s.U)((function(){return{completeRefresh:!1,unsafeMode:g}})))}();return(0,E.T)(w,b,T).pipe((0,A.q)(1),(0,c.z)((function(e){return m({completeRefresh:e.completeRefresh,unsafeMode:e.unsafeMode})})),(0,c.z)((function(e){return"warning"===e.type?(0,l.of)(e):h(e)})))}function m(e){var t=e.completeRefresh,n=e.unsafeMode,r=d.updateUrl,i=t||void 0===r,o=i?d.getUrl():r,s=d.clockOffset;return n?(v+=1,M.Z.info('Init: Refreshing the Manifest in "unsafeMode" for the '+String(v)+" consecutive time.")):v>0&&(M.Z.info('Init: Not parsing the Manifest in "unsafeMode" anymore after '+String(v)+" consecutive times."),v=0),u(o,{externalClockOffset:s,previousManifest:d,unsafeMode:n}).pipe((0,c.z)((function(e){if("warning"===e.type)return(0,l.of)(e);var t=e.manifest,n=e.sendingTime,r=e.receivedTime,o=e.parsingTime,s=performance.now();if(i)d.replace(t);else try{d.update(t)}catch(e){var u=e instanceof Error?e.message:"unknown error";return M.Z.warn("MUS: Attempt to update Manifest failed: "+u,"Re-downloading the Manifest fully"),mn(P.Z.getCurrent().FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY,a,n).pipe((0,c.z)((function(){return m({completeRefresh:!0,unsafeMode:!1})})))}return(0,l.of)({type:"parsed",manifest:d,sendingTime:n,receivedTime:r,parsingTime:o,updatingTime:performance.now()-s})})))}}function mn(e,t,n){return(0,p.P)((function(){var r=void 0===n?0:performance.now()-n,i=Math.max(t-r,0);return(0,vn.H)(Math.max(e-r,i))}))}var gn=n(2447);var yn=function(e){var t=e.adaptiveOptions,n=e.autoPlay,r=e.bufferOptions,a=e.keySystems,u=e.lowLatencyMode,f=e.manifest$,p=e.manifestFetcher,v=e.mediaElement,h=e.minimumManifestUpdateInterval,b=e.playbackObserver,S=e.segmentFetcherCreator,w=e.speed,k=e.startAt,x=e.textTrackOptions,I=new Qe(t),Z=it(v).pipe((0,d.d)({refCount:!0})),R=new i.x,C=(0,ot.Z)(v,a,R,Z).pipe((0,Ie.Z)(),(0,g.B)()),D=(0,gn.Z)(v),N=C.pipe((0,m.h)((function(e){return"decryption-ready"===e.type||"decryption-disabled"===e.type})),(0,s.U)((function(e){return e.value})),(0,A.q)(1)),O=(0,y.a)([f,N]).pipe((0,c.z)((function(e){var t=e[0],a=e[1],d=a.drmSystemId,f=a.mediaSource;if("warning"===t.type)return(0,l.of)(t);var m=t.manifest;M.Z.debug("Init: Calculating initial time");var g=function(e,t,n){if(null!=n){var r=e.getMinimumPosition(),i=e.getMaximumPosition();if(null!=n.position)return M.Z.debug("Init: using startAt.minimumPosition"),Math.max(Math.min(n.position,i),r);if(null!=n.wallClockTime){M.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){M.Z.debug("Init: using startAt.fromFirstPosition");var s=n.fromFirstPosition;return s<=0?r:Math.min(i,r+s)}if(null!=n.fromLastPosition){M.Z.debug("Init: using startAt.fromLastPosition");var u=n.fromLastPosition;return u>=0?i:Math.max(r,i+u)}if(null!=n.percentage){M.Z.debug("Init: using startAt.percentage");var l=n.percentage;return l>100?i:l<0?r:r+ +l/100*(i-r)}}var c=e.getMinimumPosition();if(e.isLive){var d,f=e.suggestedPresentationDelay,p=e.clockOffset,v=e.getMaximumPosition(),h=P.Z.getCurrent().DEFAULT_LIVE_GAP;if(null==p)M.Z.info("Init: no clock offset found for a live content, starting close to maximum available position"),d=v;else{M.Z.info("Init: clock offset found for a live content, checking if we can start close to it");var m=null==e.availabilityStartTime?0:e.availabilityStartTime,g=(performance.now()+p)/1e3-m;d=Math.min(v,g)}var y=void 0!==f?f:t?h.LOW_LATENCY:h.DEFAULT;return M.Z.debug("Init: "+d+" defined as the live time, applying a live gap of "+y),Math.max(d-y,c)}return M.Z.info("Init: starting at the minimum available position:",c),c}(m,u,k);M.Z.debug("Init: Initial time calculated:",g);var y=pn({abrManager:I,bufferOptions:(0,V.Z)({textTrackOptions:x,drmSystemId:d},r),manifest:m,mediaElement:v,playbackObserver:b,segmentFetcherCreator:S,speed:w}),A=function e(t,n,r){var a=new i.x,s=y(t,n,r).pipe((0,Ze.Z)((function(e){switch(e.type){case"needs-manifest-refresh":return Z.next({completeRefresh:!1,canUseUnsafeMode:!0}),null;case"manifest-might-be-out-of-sync":var t=P.Z.getCurrent().OUT_OF_SYNC_MANIFEST_REFRESH_DELAY;return Z.next({completeRefresh:!0,canUseUnsafeMode:!1,delay:t}),null;case"needs-media-source-reload":return a.next(e.value),null;case"needs-decipherability-flush":var n=J(v);if(null===(i=n)||i.indexOf("widevine")<0)return a.next(e.value),null;var r=e.value.position;return r+.001<e.value.duration?b.setCurrentTime(v.currentTime+.001):b.setCurrentTime(r),null;case"encryption-data-encountered":return R.next(e.value),null;case"needs-buffer-flush":return b.setCurrentTime(v.currentTime+.001),null}var i;return e}),null)).pipe((0,o.R)(a)),u=a.pipe((0,T.w)((function(t){return it(v).pipe((0,c.z)((function(n){return e(n,t.position,t.autoPlay)})),(0,_.O)(at.Z.reloadingMediaSource()))})));return(0,E.T)(u,s)}(f,g,n),Z=new i.x,C=hn({initialManifest:t,manifestFetcher:p,minimumManifestUpdateInterval:h,scheduleRefresh$:Z}),D=(0,E.T)((0,F.R)(m,"manifestUpdate").pipe((0,s.U)((function(){return at.Z.manifestUpdate()}))),(0,F.R)(m,"decipherabilityUpdate").pipe((0,s.U)(at.Z.decipherabilityUpdate)));return(0,E.T)(D,C,A).pipe((0,_.O)(at.Z.manifestReady(m)),Ae((function(){Z.complete()})))})));return(0,E.T)(O,D,C.pipe((0,xe.l)()))};var _n="STOPPED",bn="LOADED",Tn="LOADING",En="PLAYING",Sn="PAUSED",wn="ENDED",kn="BUFFERING",An="SEEKING",xn="RELOADING";var In=n(5553);function Zn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Rn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rn(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 Rn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Mn=["canplay","play","seeking","seeked","loadedmetadata","ratechange"],Cn=function(){function e(e,t){this._internalSeekingEventsIncomingCounter=0,this._mediaElement=e,this._withMediaSource=t.withMediaSource,this._lowLatencyMode=t.lowLatencyMode,this._lastObservation=null,this._observation$=null}var t=e.prototype;return t.getCurrentTime=function(){return this._mediaElement.currentTime},t.setCurrentTime=function(e){this._internalSeekingEventsIncomingCounter+=1,this._mediaElement.currentTime=e},t.getReadyState=function(){return this._mediaElement.readyState},t.observe=function(e){var t=this;return(0,p.P)((function(){return null===t._observation$||null===t._lastObservation?(t._lastObservation=t._generateInitialObservation(),t._observation$=t._createInnerObservable().pipe((0,g.B)()),t.observe(e)):e?t._observation$.pipe((0,_.O)(t._lastObservation)):t._observation$}))},t.deriveReadOnlyObserver=function(e){return Nn(this,e)},t._createInnerObservable=function(){var e=this;return(0,p.P)((function(){var t=P.Z.getCurrent(),n=t.SAMPLING_INTERVAL_MEDIASOURCE,r=t.SAMPLING_INTERVAL_LOW_LATENCY,i=t.SAMPLING_INTERVAL_NO_MEDIASOURCE,a=function(t){var n,r=t;"seeking"===r&&e._internalSeekingEventsIncomingCounter>0&&(r="internal-seeking",e._internalSeekingEventsIncomingCounter-=1);var i=null!==(n=e._lastObservation)&&void 0!==n?n:e._generateInitialObservation(),a=Dn(e._mediaElement,r),o=a.seeking&&("internal-seeking"===r||i.internalSeeking&&"seeking"!==r),s=function(e,t,n){var r,i,a=n.withMediaSource,o=n.lowLatencyMode,s=P.Z.getCurrent().REBUFFERING_GAP,u=t.event,l=t.position,c=t.bufferGap,d=t.currentRange,f=t.duration,p=t.paused,v=t.readyState,h=t.ended,m=e.rebuffering,g=e.event,y=e.position,_=function(e,t,n){var r=P.Z.getCurrent().REBUFFERING_GAP,i=n?"LOW_LATENCY":"DEFAULT";return null!==e&&t-e.end<=r[i]}(d,f,o),b=v>=1&&"loadedmetadata"!==u&&null===m&&!(_||h),T=null,E=o?s.LOW_LATENCY:s.DEFAULT;if(a){if(b)c<=E?(r=!0,T=l+c):c===1/0&&(r=!0,T=l);else if(null!==m){var S=Pn(m,o);!0!==r&&null!==m&&v>1&&(_||h||c<1/0&&c>S)?i=!0:(c===1/0||c<=S)&&(T=c===1/0?l:l+c)}}else b&&(!p&&"timeupdate"===u&&"timeupdate"===g&&l===y||"seeking"===u&&c===1/0)?r=!0:null!==m&&("seeking"!==u&&l!==y||"canplay"===u||c<1/0&&(c>Pn(m,o)||_||h))&&(i=!0);if(!0===i)return null;var w;if(!0===r||null!==m)return w="seeking"===u||null!==m&&"seeking"===m.reason||t.seeking?"seeking":1===v?"not-ready":"buffering",null!==m&&m.reason===w?{reason:m.reason,timestamp:m.timestamp,position:T}:{reason:w,timestamp:performance.now(),position:T};return null}(i,a,{lowLatencyMode:e._lowLatencyMode,withMediaSource:e._withMediaSource}),u=function(e,t){var n=P.Z.getCurrent().MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING;if(e.freezing)return t.ended||t.paused||0===t.readyState||0===t.playbackRate||e.position!==t.position?null:e.freezing;return"timeupdate"===t.event&&t.bufferGap>n&&!t.ended&&!t.paused&&t.readyState>=1&&0!==t.playbackRate&&t.position===e.position?{timestamp:performance.now()}:null}(i,a),l=(0,V.Z)({},{rebuffering:s,freezing:u,internalSeeking:o},a);return M.Z.debug("API: current media element state",l),l},o=Mn.map((function(t){return(0,lt.R)(e._mediaElement,t).pipe((0,s.U)((function(){return t})))})),u=e._lowLatencyMode?r:e._withMediaSource?n:i,l=(0,ut.F)(u).pipe((0,s.U)((function(){return"timeupdate"})));return E.T.apply(void 0,[l].concat(o)).pipe((0,s.U)((function(t){var n=a(t);return"DEBUG"===M.Z.getLevel()&&M.Z.debug("API: current playback timeline:\n"+function(e,t){for(var n="",r="",i=0;i<e.length;i++){var a=e.start(i),o=e.end(i),s=a.toFixed(2),u=o.toFixed(2),l=s+"|=="+(o-a).toFixed(2)+"==|"+u;if(n+=l,0===r.length&&o>t){var c=n.length-Math.floor(l.length/2);r=" ".repeat(c)+"^"+t}if(i<e.length-1){var d=e.start(i+1),f=" ~"+(d-o).toFixed(2)+"~ ";if(n+=f,0===r.length&&t<d){var p=n.length-Math.floor(f.length/2);r=" ".repeat(p)+"^"+t}}}0===r.length&&(r=" ".repeat(n.length)+"^"+t);return n+"\n"+r}(n.buffered,n.position),"\n"+t),e._lastObservation=n,n})))}))},t._generateInitialObservation=function(){return(0,V.Z)(Dn(this._mediaElement,"init"),{rebuffering:null,freezing:null,internalSeeking:!1})},e}();function Pn(e,t){if(null===e)return 0;var n=t?"LOW_LATENCY":"DEFAULT",r=P.Z.getCurrent(),i=r.RESUME_GAP_AFTER_SEEKING,a=r.RESUME_GAP_AFTER_NOT_ENOUGH_DATA,o=r.RESUME_GAP_AFTER_BUFFERING;switch(e.reason){case"seeking":return i[n];case"not-ready":return a[n];case"buffering":return o[n]}}function Dn(e,t){var n=e.buffered,r=e.currentTime,i=e.duration,a=e.ended,o=e.paused,s=e.playbackRate,u=e.readyState,l=e.seeking,c=(0,K.rx)(n,r);return{bufferGap:null!==c?c.end-r:1/0,buffered:n,currentRange:c,position:r,duration:i,ended:a,paused:o,playbackRate:s,readyState:u,seeking:l,event:t}}function Nn(e,t){var n=(0,p.P)((function(){return t(e.observe(!0))})).pipe((0,d.d)({bufferSize:1,refCount:!0}));return{getCurrentTime:function(){return e.getCurrentTime()},getReadyState:function(){return e.getReadyState()},observe:function(e){return e?n:n.pipe((t=1,(0,m.h)((function(e,n){return t<=n}))));var t},deriveReadOnlyObserver:function(e){return Nn(this,e)}}}var On=n(7829);function Ln(e){return e.map((function(e){return null===e?e:{normalized:void 0===e.language?void 0:(0,On.ZP)(e.language),audioDescription:e.audioDescription,codec:e.codec}}))}function Bn(e){return e.map((function(e){return null===e?e:{normalized:(0,On.ZP)(e.language),closedCaption:e.closedCaption}}))}var Un=function(){function e(e){this._periods=new bt((function(e,t){return e.period.start-t.period.start})),this._audioChoiceMemory=new WeakMap,this._textChoiceMemory=new WeakMap,this._videoChoiceMemory=new WeakMap,this._preferredAudioTracks=[],this._preferredTextTracks=[],this._preferredVideoTracks=[],this.trickModeTrackEnabled=e.preferTrickModeTracks}var t=e.prototype;return t.setPreferredAudioTracks=function(e,t){this._preferredAudioTracks=e,t&&this._applyAudioPreferences()},t.setPreferredTextTracks=function(e,t){this._preferredTextTracks=e,t&&this._applyTextPreferences()},t.setPreferredVideoTracks=function(e,t){this._preferredVideoTracks=e,t&&this._applyVideoPreferences()},t.addPeriod=function(e,t,n){var r=Wn(this._periods,t),i=t.getSupportedAdaptations(e);if(void 0!==r){if(void 0!==r[e])return void M.Z.warn("TrackChoiceManager: "+e+" already added for period",t.start);r[e]={adaptations:i,adaptation$:n}}else{var a;this._periods.add(((a={period:t})[e]={adaptations:i,adaptation$:n},a))}},t.removePeriod=function(e,t){var n=function(e,t){for(var n=0;n<e.length();n++){if(e.get(n).period.id===t.id)return n}}(this._periods,t);if(void 0!==n){var r=this._periods.get(n);void 0!==r[e]?(delete r[e],void 0===r.audio&&void 0===r.text&&void 0===r.video&&this._periods.removeElement(r)):M.Z.warn("TrackChoiceManager: "+e+" already removed for period",t.start)}else M.Z.warn("TrackChoiceManager: "+e+" not found for period",t.start)},t.resetPeriods=function(){for(;this._periods.length()>0;)this._periods.pop()},t.update=function(){this._resetChosenAudioTracks(),this._resetChosenTextTracks(),this._resetChosenVideoTracks()},t.setInitialAudioTrack=function(e){var t=Wn(this._periods,e),n=void 0!==t?t.audio:null;if((0,z.Z)(n)||void 0===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,Te.Z)(r,i))n.adaptation$.next(i);else{var a=zn(r,Ln(this._preferredAudioTracks));this._audioChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialTextTrack=function(e){var t=Wn(this._periods,e),n=void 0!==t?t.text:null;if((0,z.Z)(n)||void 0===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,Te.Z)(r,i))n.adaptation$.next(i);else{var a=Kn(r,Bn(this._preferredTextTracks));this._textChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialVideoTrack=function(e){var t=Wn(this._periods,e),n=void 0!==t?t.video:null;if((0,z.Z)(n)||void 0===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,Te.Z)(i,a.baseAdaptation))r=a.baseAdaptation;else{r=Hn(i,this._preferredVideoTracks)}if(null===r)return this._videoChoiceMemory.set(e,null),void n.adaptation$.next(null);var o=Yn(r,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:r,adaptation:o}),n.adaptation$.next(o)},t.setAudioTrackByID=function(e,t){var n=Wn(this._periods,e),r=void 0!==n?n.audio:null;if((0,z.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,Le.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=Wn(this._periods,e),r=void 0!==n?n.text:null;if((0,z.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,Le.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=Wn(this._periods,e),r=void 0!==n?n.video:null;if((0,z.Z)(r))throw new Error("LanguageManager: Given Period not found.");var i=(0,Le.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Video Track not found.");var a=Yn(i,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:i,adaptation:a}),r.adaptation$.next(a)},t.disableTextTrack=function(e){var t=Wn(this._periods,e),n=void 0!==t?t.text:null;if((0,z.Z)(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=Wn(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=Wn(this._periods,e),n=void 0!==t?t.audio:null;if((0,z.Z)(n))return null;var r=this._audioChoiceMemory.get(e);if((0,z.Z)(r))return null;var i={language:(0,Re.Z)(r.language,""),normalized:(0,Re.Z)(r.normalizedLanguage,""),audioDescription:!0===r.isAudioDescription,id:r.id,representations:r.representations.map(qn)};return!0===r.isDub&&(i.dub=!0),i},t.getChosenTextTrack=function(e){var t=Wn(this._periods,e),n=void 0!==t?t.text:null;if((0,z.Z)(n))return null;var r=this._textChoiceMemory.get(e);return(0,z.Z)(r)?null:{language:(0,Re.Z)(r.language,""),normalized:(0,Re.Z)(r.normalizedLanguage,""),closedCaption:!0===r.isClosedCaption,id:r.id}},t.getChosenVideoTrack=function(e){var t=Wn(this._periods,e),n=void 0!==t?t.video:null;if((0,z.Z)(n))return null;var r=this._videoChoiceMemory.get(e);if((0,z.Z)(r))return null;var i=r.adaptation,a=void 0!==i.trickModeTracks?i.trickModeTracks.map((function(e){var t=e.representations.map(jn),n={id:e.id,representations:t,isTrickModeTrack:!0};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),n})):void 0,o={id:i.id,representations:i.representations.map(jn)};return!0===i.isSignInterpreted&&(o.signInterpreted=!0),!0===i.isTrickModeTrack&&(o.isTrickModeTrack=!0),void 0!==a&&(o.trickModeTracks=a),o},t.getAvailableAudioTracks=function(e){var t=Wn(this._periods,e),n=void 0!==t?t.audio:null;if((0,z.Z)(n))return[];var r=this._audioChoiceMemory.get(e),i=(0,z.Z)(r)?null:r.id;return n.adaptations.map((function(e){var t={language:(0,Re.Z)(e.language,""),normalized:(0,Re.Z)(e.normalizedLanguage,""),audioDescription:!0===e.isAudioDescription,id:e.id,active:null!==i&&i===e.id,representations:e.representations.map(qn)};return!0===e.isDub&&(t.dub=!0),t}))},t.getAvailableTextTracks=function(e){var t=Wn(this._periods,e),n=void 0!==t?t.text:null;if((0,z.Z)(n))return[];var r=this._textChoiceMemory.get(e),i=(0,z.Z)(r)?null:r.id;return n.adaptations.map((function(e){return{language:(0,Re.Z)(e.language,""),normalized:(0,Re.Z)(e.normalizedLanguage,""),closedCaption:!0===e.isClosedCaption,id:e.id,active:null!==i&&i===e.id}}))},t.getAvailableVideoTracks=function(e){var t,n=Wn(this._periods,e),r=void 0!==n?n.video:null;if((0,z.Z)(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(jn),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(jn)};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=Ln(this._preferredAudioTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,z.Z)(i.audio))n(r+1);else{var a=i.period,o=i.audio,s=a.getSupportedAdaptations("audio"),u=e._audioChoiceMemory.get(a);if(null===u||void 0!==u&&(0,Te.Z)(s,u))n(r+1);else{var l=zn(s,t);e._audioChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenTextTracks=function(){var e=this,t=Bn(this._preferredTextTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,z.Z)(i.text))n(r+1);else{var a=i.period,o=i.text,s=a.getSupportedAdaptations("text"),u=e._textChoiceMemory.get(a);if(null===u||void 0!==u&&(0,Te.Z)(s,u))n(r+1);else{var l=Kn(s,t);e._textChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(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((0,z.Z)(i.video))n(r+1);else{var a=i.period,o=i.video,s=a.getSupportedAdaptations("video"),u=e._videoChoiceMemory.get(a);if(null!==u){if(void 0!==u&&(0,Te.Z)(s,u.baseAdaptation)){var l=Yn(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 c=Hn(s,t);if(null===c)return e._videoChoiceMemory.set(a,null),o.adaptation$.next(null),n(0);var d=Yn(c,e.trickModeTrackEnabled);return e._videoChoiceMemory.set(a,{baseAdaptation:c,adaptation:d}),o.adaptation$.next(d),n(0)}n(r+1)}}}(0)},e}();function Fn(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 zn(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=Fn(r),a=(0,Le.Z)(e,i);if(void 0!==a)return a}return e[0]}function Vn(e){return function(t){return(0,Re.Z)(t.normalizedLanguage,"")===e.normalized&&(e.closedCaption?!0===t.isClosedCaption:!0!==t.isClosedCaption)}}function Kn(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=Vn(r),a=(0,Le.Z)(e,i);if(void 0!==a)return a}return null}function Gn(e){return function(t){if(void 0!==e.signInterpreted&&e.signInterpreted!==t.isSignInterpreted)return!1;if(void 0===e.codec)return!0;var n=e.codec.test,r=function(e){return void 0!==e.codec&&n.test(e.codec)};return e.codec.all?t.representations.every(r):t.representations.some(r)}}function Hn(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=Gn(r),a=(0,Le.Z)(e,i);if(void 0!==a)return a}return e[0]}function Wn(e,t){for(var n=0;n<e.length();n++){var r=e.get(n);if(r.period.id===t.id)return r}}function jn(e){return{id:e.id,bitrate:e.bitrate,frameRate:e.frameRate,width:e.width,height:e.height,codec:e.codec,hdrInfo:e.hdrInfo}}function qn(e){return{id:e.id,bitrate:e.bitrate,codec:e.codec}}function Yn(e,t){var n;return t&&void 0!==(null===(n=e.trickModeTracks)||void 0===n?void 0:n[0])?e.trickModeTracks[0]:e}var $n=x.Nh,Xn=x._K,Qn=x.C1,Jn=x.Q1,er=x.Qt,tr=x.yj,nr=x.d5,rr=x.UA,ir=x.$x,ar=function(n){function r(e){var t;void 0===e&&(e={}),t=n.call(this)||this;var r=function(e){var t,n,r,i,a,o,s,u,l,c,d,f,p,v,h,m,g=P.Z.getCurrent(),y=g.DEFAULT_INITIAL_BITRATES,_=g.DEFAULT_LIMIT_VIDEO_WIDTH,b=g.DEFAULT_MIN_BITRATES,T=g.DEFAULT_MAX_BITRATES,E=g.DEFAULT_MAX_BUFFER_AHEAD,S=g.DEFAULT_MAX_BUFFER_BEHIND,w=g.DEFAULT_MAX_VIDEO_BUFFER_SIZE,k=g.DEFAULT_STOP_AT_END,A=g.DEFAULT_THROTTLE_WHEN_HIDDEN,x=g.DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN,I=g.DEFAULT_WANTED_BUFFER_AHEAD;if((0,z.Z)(e.maxBufferAhead))t=E;else if(t=Number(e.maxBufferAhead),isNaN(t))throw new Error("Invalid maxBufferAhead parameter. Should be a number.");if((0,z.Z)(e.maxBufferBehind))n=S;else if(n=Number(e.maxBufferBehind),isNaN(n))throw new Error("Invalid maxBufferBehind parameter. Should be a number.");if((0,z.Z)(e.wantedBufferAhead))r=I;else if(r=Number(e.wantedBufferAhead),isNaN(r))throw new Error("Invalid wantedBufferAhead parameter. Should be a number.");if((0,z.Z)(e.maxVideoBufferSize))i=w;else if(i=Number(e.maxVideoBufferSize),isNaN(i))throw new Error("Invalid maxVideoBufferSize parameter. Should be a number.");var Z=(0,z.Z)(e.limitVideoWidth)?_:!!e.limitVideoWidth;if((0,z.Z)(e.throttleWhenHidden)?a=A:((0,H.Z)("`throttleWhenHidden` API is deprecated. Consider using `throttleVideoBitrateWhenHidden` instead."),a=!!e.throttleWhenHidden),o=!a&&((0,z.Z)(e.throttleVideoBitrateWhenHidden)?x:!!e.throttleVideoBitrateWhenHidden),void 0!==e.preferredTextTracks?Array.isArray(e.preferredTextTracks)?u=e.preferredTextTracks:((0,H.Z)("Invalid `preferredTextTracks` option, it should be an Array"),u=[]):u=[],void 0!==e.preferredAudioTracks?Array.isArray(e.preferredAudioTracks)?s=e.preferredAudioTracks:((0,H.Z)("Invalid `preferredAudioTracks` option, it should be an Array"),s=[]):s=[],void 0!==e.preferredVideoTracks?Array.isArray(e.preferredVideoTracks)?l=e.preferredVideoTracks:((0,H.Z)("Invalid `preferredVideoTracks` option, it should be an Array"),l=[]):l=[],(0,z.Z)(e.videoElement))c=document.createElement("video");else{if(!(e.videoElement instanceof HTMLMediaElement))throw new Error("Invalid videoElement parameter. Should be a HTMLMediaElement.");c=e.videoElement}if((0,z.Z)(e.initialVideoBitrate))d=y.video;else if(d=Number(e.initialVideoBitrate),isNaN(d))throw new Error("Invalid initialVideoBitrate parameter. Should be a number.");if((0,z.Z)(e.initialAudioBitrate))f=y.audio;else if(f=Number(e.initialAudioBitrate),isNaN(f))throw new Error("Invalid initialAudioBitrate parameter. Should be a number.");if((0,z.Z)(e.minVideoBitrate))v=b.video;else if(v=Number(e.minVideoBitrate),isNaN(v))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if((0,z.Z)(e.minAudioBitrate))p=b.audio;else if(p=Number(e.minAudioBitrate),isNaN(p))throw new Error("Invalid minAudioBitrate parameter. Should be a number.");if((0,z.Z)(e.maxVideoBitrate))m=T.video;else{if(m=Number(e.maxVideoBitrate),isNaN(m))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if(v>m)throw new Error('Invalid maxVideoBitrate parameter. Its value, "'+m+'", is inferior to the set minVideoBitrate, "'+v+'"')}if((0,z.Z)(e.maxAudioBitrate))h=T.audio;else{if(h=Number(e.maxAudioBitrate),isNaN(h))throw new Error("Invalid maxAudioBitrate parameter. Should be a number.");if(p>h)throw new Error('Invalid maxAudioBitrate parameter. Its value, "'+h+'", is inferior to the set minAudioBitrate, "'+p+'"')}return{maxBufferAhead:t,maxBufferBehind:n,limitVideoWidth:Z,videoElement:c,wantedBufferAhead:r,maxVideoBufferSize:i,throttleWhenHidden:a,throttleVideoBitrateWhenHidden:o,preferredAudioTracks:s,preferredTextTracks:u,preferredVideoTracks:l,initialAudioBitrate:f,initialVideoBitrate:d,minAudioBitrate:p,minVideoBitrate:v,maxAudioBitrate:h,maxVideoBitrate:m,stopAtEnd:(0,z.Z)(e.stopAtEnd)?k:!!e.stopAtEnd}}(e),l=r.initialAudioBitrate,c=r.initialVideoBitrate,d=r.limitVideoWidth,f=r.minAudioBitrate,p=r.minVideoBitrate,v=r.maxAudioBitrate,h=r.maxBufferAhead,m=r.maxBufferBehind,g=r.maxVideoBitrate,y=r.preferredAudioTracks,_=r.preferredTextTracks,b=r.preferredVideoTracks,T=r.throttleWhenHidden,E=r.throttleVideoBitrateWhenHidden,S=r.videoElement,w=r.wantedBufferAhead,k=r.maxVideoBufferSize,A=r.stopAtEnd,x=P.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;return S.preload="auto",t.version="3.27.0-dev.2022032800",t.log=M.Z,t.state="STOPPED",t.videoElement=S,t._priv_destroy$=new i.x,t._priv_pictureInPictureEvent$=new a.t(1),tr(S).pipe((0,o.R)(t._priv_destroy$)).subscribe(t._priv_pictureInPictureEvent$),Jn(S).pipe((0,o.R)(t._priv_destroy$)).subscribe((function(){return t.trigger("fullscreenChange",t.isFullscreen())})),rr(S.textTracks).pipe((0,o.R)(t._priv_destroy$),(0,s.U)((function(e){for(var t=e.target,n=[],r=0;r<t.length;r++){var i=t[r];n.push(i)}return n})),(0,u.x)((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}))).subscribe((function(e){return t._priv_onNativeTextTracksNext(e)})),t._priv_isPlaying=(0,G.Z)(!1),t._priv_speed=(0,G.Z)(S.playbackRate),t._priv_preferTrickModeTracks=!1,t._priv_contentLock=(0,G.Z)(!1),t._priv_bufferOptions={wantedBufferAhead:(0,G.Z)(w),maxBufferAhead:(0,G.Z)(h),maxBufferBehind:(0,G.Z)(m),maxVideoBufferSize:(0,G.Z)(k)},t._priv_bitrateInfos={lastBitrates:{audio:l,video:c},minAutoBitrates:{audio:(0,G.Z)(f),video:(0,G.Z)(p)},maxAutoBitrates:{audio:(0,G.Z)(v),video:(0,G.Z)(g)},manualBitrates:{audio:(0,G.Z)(-1),video:(0,G.Z)(-1)}},t._priv_throttleWhenHidden=T,t._priv_throttleVideoBitrateWhenHidden=E,t._priv_limitVideoWidth=d,t._priv_mutedMemory=x,t._priv_trackChoiceManager=null,t._priv_mediaElementTrackChoiceManager=null,t._priv_currentError=null,t._priv_contentInfos=null,t._priv_contentEventsMemory={},t._priv_stopAtEnd=A,t._priv_setPlayerState(_n),t._priv_preferredAudioTracks=y,t._priv_preferredTextTracks=_,t._priv_preferredVideoTracks=b,t._priv_lastContentPlaybackInfos={},t}(0,t.Z)(r,n);var f=r.prototype;return f.stop=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this.state!==_n&&this._priv_setPlayerState(_n)},f.dispose=function(){this.stop(),null!==this.videoElement&&X(this.videoElement).catch((function(e){var t=e instanceof Error?e.message:"Unknown error";M.Z.error("API: Could not dispose decryption resources: "+t)})),this._priv_destroy$.next(),this._priv_destroy$.complete(),this._priv_pictureInPictureEvent$.complete(),this._priv_isPlaying.finish(),this._priv_speed.finish(),this._priv_contentLock.finish(),this._priv_bufferOptions.wantedBufferAhead.finish(),this._priv_bufferOptions.maxVideoBufferSize.finish(),this._priv_bufferOptions.maxBufferAhead.finish(),this._priv_bufferOptions.maxBufferBehind.finish(),this._priv_bitrateInfos.manualBitrates.video.finish(),this._priv_bitrateInfos.manualBitrates.audio.finish(),this._priv_bitrateInfos.minAutoBitrates.video.finish(),this._priv_bitrateInfos.minAutoBitrates.audio.finish(),this._priv_bitrateInfos.maxAutoBitrates.video.finish(),this._priv_bitrateInfos.maxAutoBitrates.audio.finish(),this._priv_lastContentPlaybackInfos={},this.videoElement=null},f.loadVideo=function(e){var t=function(e){var t,n,r,i,a,o,s,u,l,c,d,f,p=P.Z.getCurrent(),v=p.DEFAULT_AUDIO_TRACK_SWITCHING_MODE,h=p.DEFAULT_AUTO_PLAY,m=p.DEFAULT_CODEC_SWITCHING_BEHAVIOR,g=p.DEFAULT_ENABLE_FAST_SWITCHING,y=p.DEFAULT_MANUAL_BITRATE_SWITCHING_MODE,_=p.DEFAULT_SHOW_NATIVE_SUBTITLE,b=p.DEFAULT_TEXT_TRACK_MODE;if((0,z.Z)(e))throw new Error("No option set on loadVideo");if((0,z.Z)(e.url)){if((0,z.Z)(null===(t=e.transportOptions)||void 0===t?void 0:t.initialManifest)&&(0,z.Z)(null===(n=e.transportOptions)||void 0===n?void 0:n.manifestLoader))throw new Error("Unable to load a content: no url set on loadVideo.\nPlease provide at least either an `url` argument, a `transportOptions.initialManifest` option or a `transportOptions.manifestLoader` option so the RxPlayer can load the content.")}else s=String(e.url);if((0,z.Z)(e.transport))throw new Error("No transport set on loadVideo");u=String(e.transport);var T=(0,z.Z)(e.autoPlay)?h:!!e.autoPlay;if((0,z.Z)(e.keySystems))l=[];else for(var E,S=Zn(l=Array.isArray(e.keySystems)?e.keySystems:[e.keySystems]);!(E=S()).done;){var w=E.value;if("string"!=typeof w.type||"function"!=typeof w.getLicense)throw new Error("Invalid key system given: Missing type string or getLicense callback")}var k=void 0!==e.lowLatencyMode&&!!e.lowLatencyMode,A="object"==typeof e.transportOptions&&null!==e.transportOptions?e.transportOptions:{},x=null===(r=e.transportOptions)||void 0===r?void 0:r.initialManifest,I=null!==(a=null===(i=e.transportOptions)||void 0===i?void 0:i.minimumManifestUpdateInterval)&&void 0!==a?a:0,Z=(0,z.Z)(e.audioTrackSwitchingMode)?v:e.audioTrackSwitchingMode;(0,Te.Z)(["seamless","direct","reload"],Z)||(M.Z.warn("The `audioTrackSwitchingMode` loadVideo option must match one of the following strategy name:\n- `seamless`\n- `direct`\n- `reload`\nIf badly set, "+v+" strategy will be used as default"),Z=v);var R=(0,z.Z)(e.onCodecSwitch)?m:e.onCodecSwitch;(0,Te.Z)(["continue","reload"],R)||(M.Z.warn("The `onCodecSwitch` loadVideo option must match one of the following string:\n- `continue`\n- `reload`\nIf badly set, "+m+" will be used as default"),R=m);var C=(0,V.Z)({},A,{supplementaryImageTracks:[],supplementaryTextTracks:[],lowLatencyMode:k});if(delete C.initialManifest,delete C.minimumManifestUpdateInterval,void 0!==e.supplementaryTextTracks){(0,H.Z)("The `supplementaryTextTracks` loadVideo option is deprecated.\nPlease use the `TextTrackRenderer` tool instead.");for(var D,N=Array.isArray(e.supplementaryTextTracks)?e.supplementaryTextTracks:[e.supplementaryTextTracks],O=Zn(N);!(D=O()).done;){var L=D.value;if("string"!=typeof L.language||"string"!=typeof L.mimeType||"string"!=typeof L.url)throw new Error("Invalid supplementary text track given. Missing either language, mimetype or url")}C.supplementaryTextTracks=N}if(void 0!==e.supplementaryImageTracks){(0,H.Z)("The `supplementaryImageTracks` loadVideo option is deprecated.\nPlease use the `parseBifThumbnails` tool instead.");for(var B,U=Array.isArray(e.supplementaryImageTracks)?e.supplementaryImageTracks:[e.supplementaryImageTracks],F=Zn(U);!(B=F()).done;){var K=B.value;if("string"!=typeof K.mimeType||"string"!=typeof K.url)throw new Error("Invalid supplementary image track given. Missing either mimetype or url")}C.supplementaryImageTracks=U}if((0,z.Z)(e.textTrackMode))c=b;else{if("native"!==e.textTrackMode&&"html"!==e.textTrackMode)throw new Error("Invalid textTrackMode.");c=e.textTrackMode}(0,z.Z)(e.defaultAudioTrack)||(0,H.Z)("The `defaultAudioTrack` loadVideo option is deprecated.\nPlease use the `preferredAudioTracks` constructor option or the`setPreferredAudioTracks` method instead");var G=(0,In.iH)(e.defaultAudioTrack);(0,z.Z)(e.defaultTextTrack)||(0,H.Z)("The `defaultTextTrack` loadVideo option is deprecated.\nPlease use the `preferredTextTracks` constructor option or the`setPreferredTextTracks` method instead");var W=(0,In.Y1)(e.defaultTextTrack),j=!_;(0,z.Z)(e.hideNativeSubtitle)||((0,H.Z)("The `hideNativeSubtitle` loadVideo option is deprecated"),j=!!e.hideNativeSubtitle);var q=null!==(o=e.manualBitrateSwitchingMode)&&void 0!==o?o:y,Y=(0,z.Z)(e.enableFastSwitching)?g:e.enableFastSwitching;if("html"===c){if((0,z.Z)(e.textTrackElement))throw new Error('You have to provide a textTrackElement in "html" textTrackMode.');if(!(e.textTrackElement instanceof HTMLElement))throw new Error("textTrackElement should be an HTMLElement.");d=e.textTrackElement}else(0,z.Z)(e.textTrackElement)||M.Z.warn('API: You have set a textTrackElement without being in an "html" textTrackMode. It will be ignored.');if(!(0,z.Z)(e.startAt))if(e.startAt.wallClockTime instanceof Date){var $=e.startAt.wallClockTime.getTime()/1e3;f=(0,V.Z)({},e.startAt,{wallClockTime:$})}else f=e.startAt;return{autoPlay:T,defaultAudioTrack:G,defaultTextTrack:W,enableFastSwitching:Y,hideNativeSubtitle:j,keySystems:l,initialManifest:x,lowLatencyMode:k,manualBitrateSwitchingMode:q,audioTrackSwitchingMode:Z,minimumManifestUpdateInterval:I,networkConfig:(0,z.Z)(e.networkConfig)?{}:{manifestRetry:e.networkConfig.manifestRetry,offlineRetry:e.networkConfig.offlineRetry,segmentRetry:e.networkConfig.segmentRetry},onCodecSwitch:R,startAt:f,textTrackElement:d,textTrackMode:c,transport:u,transportOptions:C,url:s}}(e);M.Z.info("API: Calling loadvideo",t),this._priv_lastContentPlaybackInfos={options:t},this._priv_initializeContentPlayback(t)},f.reload=function(e){var t,n=this._priv_lastContentPlaybackInfos,r=n.options,i=n.manifest,a=n.lastPlaybackPosition;if(void 0===r||void 0===i||void 0===a)throw new Error("API: Can't reload without having previously loaded a content.");if(function(e){var t,n,r,i;if(null===e||"object"!=typeof e&&void 0!==e)throw new Error("API: reload - Invalid options format.");if(null===(null==e?void 0:e.reloadAt)||"object"!=typeof(null==e?void 0:e.reloadAt)&&void 0!==(null==e?void 0:e.reloadAt))throw new Error("API: reload - Invalid 'reloadAt' option format.");if("number"!=typeof(null===(t=null==e?void 0:e.reloadAt)||void 0===t?void 0:t.position)&&void 0!==(null===(n=null==e?void 0:e.reloadAt)||void 0===n?void 0:n.position))throw new Error("API: reload - Invalid 'reloadAt.position' option format.");if("number"!=typeof(null===(r=null==e?void 0:e.reloadAt)||void 0===r?void 0:r.relative)&&void 0!==(null===(i=null==e?void 0:e.reloadAt)||void 0===i?void 0:i.relative))throw new Error("API: reload - Invalid 'reloadAt.relative' option format.")}(e),void 0!==e&&void 0!==e.reloadAt&&void 0!==e.reloadAt.position)t=e.reloadAt.position;else{var o;if("STOPPED"===this.state||"ENDED"===this.state)o=a;else{if(null===this.videoElement)throw new Error("Can't reload when video element does not exist.");o=this.videoElement.currentTime}t=void 0!==e&&void 0!==e.reloadAt&&void 0!==e.reloadAt.relative?e.reloadAt.relative+o:o}var s=Object.assign(Object.assign({},r),{initialManifest:i});s.startAt={position:t},this._priv_initializeContentPlayback(s)},f._priv_initializeContentPlayback=function(e){var t,n,r,a=this,f=e.autoPlay,v=e.audioTrackSwitchingMode,x=e.defaultAudioTrack,I=e.defaultTextTrack,Z=e.enableFastSwitching,R=e.initialManifest,D=e.keySystems,N=e.lowLatencyMode,O=e.manualBitrateSwitchingMode,U=e.minimumManifestUpdateInterval,F=e.networkConfig,z=e.onCodecSwitch,K=e.startAt,G=e.transport,H=e.transportOptions,W=e.url;if(null===this.videoElement)throw new Error("the attached video element is disposed");var j,q="directfile"===G,Y=new i.x,$={url:W,stop$:Y,isDirectFile:q,segmentBuffersStore:null,thumbnails:null,manifest:null,currentPeriod:null,activeAdaptations:null,activeRepresentations:null,initialAudioTrack:x,initialTextTrack:I},X=this.videoElement,Q=new Cn(X,{withMediaSource:!q,lowLatencyMode:N});if(q){if(this.stop(),this._priv_currentError=null,this._priv_isPlaying.setValue(!1),null===L.Z.directfile)throw new Error("DirectFile feature not activated in your build.");this._priv_contentInfos=$,this._priv_mediaElementTrackChoiceManager=new L.Z.directfile.mediaElementTrackChoiceManager(this.videoElement);var J=void 0===x?this._priv_preferredAudioTracks:[x];this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(J,!0);var ee=void 0===I?this._priv_preferredTextTracks:[I];this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(ee,!0),this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),this.trigger("availableAudioTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableAudioTracks()),this.trigger("availableVideoTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableVideoTracks()),this.trigger("availableTextTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableTextTracks()),this.trigger("audioTrackChange",null!==(t=this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack())&&void 0!==t?t:null),this.trigger("textTrackChange",null!==(n=this._priv_mediaElementTrackChoiceManager.getChosenTextTrack())&&void 0!==n?n:null),this.trigger("videoTrackChange",null!==(r=this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack())&&void 0!==r?r:null),this._priv_mediaElementTrackChoiceManager.addEventListener("availableVideoTracksChange",(function(e){return a.trigger("availableVideoTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableAudioTracksChange",(function(e){return a.trigger("availableAudioTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableTextTracksChange",(function(e){return a.trigger("availableTextTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("audioTrackChange",(function(e){return a.trigger("audioTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("videoTrackChange",(function(e){return a.trigger("videoTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("textTrackChange",(function(e){return a.trigger("textTrackChange",e)}));var te=L.Z.directfile.initDirectFile({autoPlay:f,keySystems:D,mediaElement:X,speed:this._priv_speed,playbackObserver:Q,startAt:K,url:W}).pipe((0,o.R)(Y));j=h(te,{connector:function(){return new i.x},resetOnDisconnect:!1})}else{var ne=L.Z.transports[G];if("function"!=typeof ne)throw this.stop(),this._priv_currentError=null,this._priv_isPlaying.setValue(!1),new Error('transport "'+G+'" not supported');var re,ie=ne(H),ae=F.offlineRetry,oe=F.segmentRetry,se=F.manifestRetry,ue=new ge(W,ie,{lowLatencyMode:N,maxRetryRegular:se,maxRetryOffline:ae}),le=new ke(ie,{lowLatencyMode:N,maxRetryOffline:ae,maxRetryRegular:oe});(re=(re=R instanceof B.ZP?(0,l.of)({type:"parsed",manifest:R}):void 0!==R?ue.parse(R,{previousManifest:null,unsafeMode:!1}):ue.fetch(W).pipe((0,c.z)((function(e){return"warning"===e.type?(0,l.of)(e):e.parse({previousManifest:null,unsafeMode:!1})})))).pipe((0,o.R)(Y),(0,d.d)())).subscribe(),this.stop(),this._priv_currentError=null,this._priv_isPlaying.setValue(!1),this._priv_contentInfos=$;var ce=C(),de={throttle:{},throttleBitrate:{},limitWidth:{}};this._priv_throttleWhenHidden&&(ce?de.throttle={video:$n().pipe((0,s.U)((function(e){return e?1/0:0})),(0,o.R)(Y))}:M.Z.warn("API: Can't apply throttleWhenHidden because browser can't be trusted for visibility.")),this._priv_throttleVideoBitrateWhenHidden&&(ce?de.throttleBitrate={video:Xn(this._priv_pictureInPictureEvent$).pipe((0,s.U)((function(e){return e?1/0:0})),(0,o.R)(Y))}:M.Z.warn("API: Can't apply throttleVideoBitrateWhenHidden because browser can't be trusted for visibility.")),this._priv_limitVideoWidth&&(ce?de.limitWidth={video:ir(X,this._priv_pictureInPictureEvent$).pipe((0,o.R)(Y))}:M.Z.warn("API: Can't apply limitVideoWidth because browser can't be trusted for video size."));var fe={initialBitrates:this._priv_bitrateInfos.lastBitrates,lowLatencyMode:N,manualBitrates:this._priv_bitrateInfos.manualBitrates,minAutoBitrates:this._priv_bitrateInfos.minAutoBitrates,maxAutoBitrates:this._priv_bitrateInfos.maxAutoBitrates,throttlers:de},pe="native"===e.textTrackMode?{textTrackMode:"native",hideNativeSubtitle:e.hideNativeSubtitle}:{textTrackMode:"html",textTrackElement:e.textTrackElement},ve=(0,V.Z)({audioTrackSwitchingMode:v,enableFastSwitching:Z,manualBitrateSwitchingMode:O,onCodecSwitch:z},this._priv_bufferOptions),he=yn({adaptiveOptions:fe,autoPlay:f,bufferOptions:ve,playbackObserver:Q,keySystems:D,lowLatencyMode:N,manifest$:re,manifestFetcher:ue,mediaElement:X,minimumManifestUpdateInterval:U,segmentFetcherCreator:le,speed:this._priv_speed,startAt:K,textTrackOptions:pe}).pipe((0,o.R)(Y));j=h(he,{connector:function(){return new i.x},resetOnDisconnect:!1})}var me,ye=j.pipe((0,m.h)((function(e){return"stalled"===e.type||"unstalled"===e.type})),(0,s.U)((function(e){return e.value})),(0,u.x)((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e===t}))),_e=j.pipe((0,m.h)((function(e){return"loaded"===e.type})),(0,g.B)()),be=j.pipe((0,m.h)((function(e){return"reloading-media-source"===e.type})),(0,g.B)()),Te=Qn(X),Ee=nr(X),Se=(0,y.a)([this._priv_isPlaying.asObservable(),ye.pipe((0,_.O)(null)),Te.pipe((0,_.O)(null)),Ee.pipe((0,_.O)(null))]).pipe((0,o.R)(Y),(0,s.U)((function(e){var t=e[0],n=e[1];return function(e,t,n){var r=P.Z.getCurrent().FORCED_ENDED_THRESHOLD;if(e.ended)return wn;if(null!==n){var i=Math.abs(e.duration-e.currentTime);return null!=r&&i<r?wn:"seeking"===n?An:kn}return t?En:Sn}(X,t,n)}))),we=(0,b.z)((0,l.of)(Tn),_e.pipe((0,T.w)((function(e,t){var n,r=0===t;return(0,E.T)(be.pipe((0,s.U)((function(){return xn}))),r?(0,l.of)(bn):S.E,Se.pipe((0,o.R)(be),(n=function(e){return r&&e===Sn},(0,w.e)((function(e,t){var r=!1,i=0;e.subscribe(new k.Q(t,(function(e){return(r||(r=!n(e,i++)))&&t.next(e)})))})))))})))).pipe((0,u.x)());Y.pipe((0,A.q)(1)).subscribe((function(){void 0!==me&&me.unsubscribe()})),er(X).pipe((0,o.R)(Y)).subscribe((function(e){return a._priv_onPlayPauseNext("play"===e.type)}));var Ae=Q.observe(!0);Ae.pipe((0,o.R)(Y)).subscribe((function(e){return a._priv_triggerPositionUpdate(e)})),_e.pipe((0,T.w)((function(){return function(e,t){return(0,p.P)((function(){if(null===e)return S.E;var n=t.pipe((0,m.h)((function(e){return"seeking"===e.event})),(0,s.U)((function(){return"seeking"})));e.seeking&&(n=n.pipe((0,_.O)("seeking")));var r=n.pipe((0,T.w)((function(){return t.pipe((0,m.h)((function(e){return"seeked"===e.event})),(0,s.U)((function(){return"seeked"})),(0,A.q)(1))})));return(0,E.T)(n,r)}))}(a.videoElement,Ae)})),(0,o.R)(Y)).subscribe((function(e){M.Z.info('API: Triggering "'+e+'" event'),a.trigger(e,null)})),we.pipe((0,o.R)(Y)).subscribe((function(e){return a._priv_setPlayerState(e)})),(this._priv_stopAtEnd?Qn(X):S.E).pipe((0,o.R)(Y)).subscribe((function(){Y.next(),Y.complete()})),j.subscribe({next:function(e){return a._priv_onPlaybackEvent(e)},error:function(e){return a._priv_onPlaybackError(e)},complete:function(){return a._priv_onPlaybackFinished()}}),this._priv_contentLock.asObservable().pipe((0,m.h)((function(e){return!e})),(0,A.q)(1),(0,o.R)(Y)).subscribe((function(){me=j.connect()}))},f.getError=function(){return this._priv_currentError},f.getManifest=function(){return(0,H.Z)("getManifest is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos?null:this._priv_contentInfos.manifest},f.getCurrentAdaptations=function(){if((0,H.Z)("getCurrentAdaptations is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;return null===t||null===n||(0,z.Z)(n[t.id])?null:n[t.id]},f.getCurrentRepresentations=function(){return(0,H.Z)("getCurrentRepresentations is deprecated. Please open an issue if you used this API."),this._priv_getCurrentRepresentations()},f.getVideoElement=function(){return this.videoElement},f.getNativeTextTrack=function(){if((0,H.Z)("getNativeTextTrack is deprecated. Please open an issue if you used this API."),null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return e.textTracks.length>0?e.textTracks[0]:null},f.getPlayerState=function(){return this.state},f.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},f.areTrickModeTracksEnabled=function(){return this._priv_preferTrickModeTracks},f.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}},f.getVideoDuration=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration},f.getVideoBufferGap=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,K.L7)(e.buffered,e.currentTime)},f.getVideoLoadedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,K.at)(e.buffered,e.currentTime)},f.getVideoPlayedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,K.DD)(e.buffered,e.currentTime)},f.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;if(t){var r=this.videoElement;if("function"==typeof r.getStartDate){var i=r.getStartDate();if("number"==typeof i&&!isNaN(i))return i+r.currentTime}return r.currentTime}return null!==n?this.videoElement.currentTime+(void 0!==n.availabilityStartTime?n.availabilityStartTime:0):0},f.getPosition=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.currentTime},f.getPlaybackRate=function(){return this._priv_speed.getValue()},f.setPlaybackRate=function(e,t){e!==this._priv_speed.getValue()&&this._priv_speed.setValue(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()))},f.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.Z)(r.video)?[]:r.video.getAvailableBitrates()},f.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.Z)(r.audio)?[]:r.audio.getAvailableBitrates()},f.getManualAudioBitrate=function(){return this._priv_bitrateInfos.manualBitrates.audio.getValue()},f.getManualVideoBitrate=function(){return this._priv_bitrateInfos.manualBitrates.video.getValue()},f.getVideoBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,z.Z)(e.video))return e.video.bitrate},f.getAudioBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,z.Z)(e.audio))return e.audio.bitrate},f.getMinVideoBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.video.getValue()},f.getMinAudioBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.audio.getValue()},f.getMaxVideoBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.video.getValue()},f.getMaxAudioBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.audio.getValue()},f.play=function(){var e=this;if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement.play();return(0,z.Z)(t)||"function"!=typeof t.catch?Promise.resolve():t.catch((function(t){if("NotAllowedError"===t.name){var n=new D.Z("MEDIA_ERR_PLAY_NOT_ALLOWED",t.toString());e.trigger("warning",n)}throw t}))},f.pause=function(){if(null===this.videoElement)throw new Error("Disposed player");this.videoElement.pause()},f.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.Z)(a.relative))if((0,z.Z)(a.position)){if((0,z.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},f.isFullscreen=function(){return(0,H.Z)("isFullscreen is deprecated. Fullscreen management should now be managed by the application"),Z()},f.setFullscreen=function(e){if(void 0===e&&(e=!0),(0,H.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(!Z()){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):I()},f.exitFullscreen=function(){(0,H.Z)("exitFullscreen is deprecated. Fullscreen management should now be managed by the application"),I()},f.getVolume=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.volume},f.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))},f.isMute=function(){return 0===this.getVolume()},f.mute=function(){this._priv_mutedMemory=this.getVolume(),this.setVolume(0)},f.unMute=function(){var e=P.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;0===this.getVolume()&&this.setVolume(0===this._priv_mutedMemory?e:this._priv_mutedMemory)},f.setVideoBitrate=function(e){this._priv_bitrateInfos.manualBitrates.video.setValue(e)},f.setAudioBitrate=function(e){this._priv_bitrateInfos.manualBitrates.audio.setValue(e)},f.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.setValue(e)},f.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.setValue(e)},f.setMaxVideoBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.video.getValue();if(e<t)throw new Error('Invalid maximum video bitrate given. Its value, "'+e+'" is inferior the current minimum video birate, "'+t+'".');this._priv_bitrateInfos.maxAutoBitrates.video.setValue(e)},f.setMaxAudioBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.audio.getValue();if(e<t)throw new Error('Invalid maximum audio bitrate given. Its value, "'+e+'" is inferior the current minimum audio birate, "'+t+'".');this._priv_bitrateInfos.maxAutoBitrates.audio.setValue(e)},f.setMaxBufferBehind=function(e){this._priv_bufferOptions.maxBufferBehind.setValue(e)},f.setMaxBufferAhead=function(e){this._priv_bufferOptions.maxBufferAhead.setValue(e)},f.setWantedBufferAhead=function(e){this._priv_bufferOptions.wantedBufferAhead.setValue(e)},f.setMaxVideoBufferSize=function(e){this._priv_bufferOptions.maxVideoBufferSize.setValue(e)},f.getMaxBufferBehind=function(){return this._priv_bufferOptions.maxBufferBehind.getValue()},f.getMaxBufferAhead=function(){return this._priv_bufferOptions.maxBufferAhead.getValue()},f.getWantedBufferAhead=function(){return this._priv_bufferOptions.wantedBufferAhead.getValue()},f.getMaxVideoBufferSize=function(){return this._priv_bufferOptions.maxVideoBufferSize.getValue()},f.getCurrentKeySystem=function(){if(null===this.videoElement)throw new Error("Disposed player");return J(this.videoElement)},f.getAvailableAudioTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableAudioTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableAudioTracks(r)},f.getAvailableTextTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableTextTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableTextTracks(r)},f.getAvailableVideoTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableVideoTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableVideoTracks(r)},f.getAudioTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenAudioTrack(t)}},f.getTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenTextTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenTextTrack(t)}},f.getVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenVideoTrack(t)}},f.setAudioTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setAudioTrackById(e))}catch(e){throw new Error("player: unknown audio track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setAudioTrackByID(r,e)}catch(e){throw new Error("player: unknown audio track")}},f.setTextTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setTextTrackById(e))}catch(e){throw new Error("player: unknown text track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setTextTrackByID(r,e)}catch(e){throw new Error("player: unknown text track")}},f.disableTextTrack=function(){var e;if(null!==this._priv_contentInfos){var t=this._priv_contentInfos,n=t.currentPeriod;if(t.isDirectFile)null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.disableTextTrack();else if(null!==this._priv_trackChoiceManager&&null!==n)return this._priv_trackChoiceManager.disableTextTrack(n)}},f.setVideoTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setVideoTrackById(e))}catch(e){throw new Error("player: unknown video track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setVideoTrackByID(r,e)}catch(e){throw new Error("player: unknown video track")}},f.disableVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile&&null!==this._priv_mediaElementTrackChoiceManager)return this._priv_mediaElementTrackChoiceManager.disableVideoTrack();if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.disableVideoTrack(t)}},f.getPreferredAudioTracks=function(){return this._priv_preferredAudioTracks},f.getPreferredTextTracks=function(){return this._priv_preferredTextTracks},f.getPreferredVideoTracks=function(){return this._priv_preferredVideoTracks},f.setPreferredAudioTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredAudioTracks` argument. Should have been an Array.");this._priv_preferredAudioTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredAudioTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(e,t)},f.setPreferredTextTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredTextTracks` argument. Should have been an Array.");this._priv_preferredTextTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredTextTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(e,t)},f.setPreferredVideoTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredVideoTracks` argument. Should have been an Array.");this._priv_preferredVideoTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredVideoTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(e,t)},f.getImageTrackData=function(){return(0,H.Z)("`getImageTrackData` is deprecated.Please use the `parseBifThumbnails` tool instead."),null===this._priv_contentInfos?null:this._priv_contentInfos.thumbnails},f.getMinimumPosition=function(){if(null===this._priv_contentInfos)return null;if(this._priv_contentInfos.isDirectFile)return 0;var e=this._priv_contentInfos.manifest;return null!==e?e.getMinimumPosition():null},f.getMaximumPosition=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;if(t){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration}return null!==n?n.getMaximumPosition():null},f.__priv_getSegmentBufferContent=function(e){if(null===this._priv_contentInfos||null===this._priv_contentInfos.segmentBuffersStore)return null;var t=this._priv_contentInfos.segmentBuffersStore.getStatus(e);return"initialized"===t.type?t.value.getInventory():null},f._priv_cleanUpCurrentContentState=function(){var e,t=this;M.Z.debug("Locking `contentLock` to clean-up the current content."),this._priv_contentLock.setValue(!0),this._priv_contentInfos=null,this._priv_trackChoiceManager=null,null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.dispose(),this._priv_mediaElementTrackChoiceManager=null,this._priv_contentEventsMemory={};var n=function(){M.Z.debug("Unlocking `contentLock`. Next content can begin."),t._priv_contentLock.setValue(!1)};(0,z.Z)(this.videoElement)?n():ee(this.videoElement).then((function(){M.Z.debug("API: DRM session cleaned-up with success!"),n()}),(function(e){M.Z.error("API: An error arised when trying to clean-up the DRM session:"+(e instanceof Error?e.toString():"Unknown Error")),n()}))},f._priv_onPlaybackEvent=function(e){switch(e.type){case"inband-events":var t=e.value;return void this.trigger("inbandEvents",t);case"stream-event":this.trigger("streamEvent",e.value);break;case"stream-event-skip":this.trigger("streamEventSkip",e.value);break;case"activePeriodChanged":this._priv_onActivePeriodChanged(e.value);break;case"periodStreamReady":this._priv_onPeriodStreamReady(e.value);break;case"periodStreamCleared":this._priv_onPeriodStreamCleared(e.value);break;case"reloading-media-source":this._priv_onReloadingMediaSource();break;case"representationChange":this._priv_onRepresentationChange(e.value);break;case"adaptationChange":this._priv_onAdaptationChange(e.value);break;case"bitrateEstimationChange":this._priv_onBitrateEstimationChange(e.value);break;case"manifestReady":this._priv_onManifestReady(e.value);break;case"warning":this._priv_onPlaybackWarning(e.value);break;case"loaded":if(null===this._priv_contentInfos)return void M.Z.error("API: Loaded event while no content is loaded");this._priv_contentInfos.segmentBuffersStore=e.value.segmentBuffersStore;break;case"decipherabilityUpdate":this.trigger("decipherabilityUpdate",e.value);break;case"added-segment":if(null===this._priv_contentInfos)return void M.Z.error("API: Added segment while no content is loaded");var n=e.value,r=n.content,i=n.segmentData;if("image"===r.adaptation.type&&!(0,z.Z)(i)&&"bif"===i.type){var a=i.data;this._priv_contentInfos.thumbnails=a,this.trigger("imageTrackUpdate",{data:this._priv_contentInfos.thumbnails})}}},f._priv_onPlaybackError=function(e){var t=(0,N.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error stopped content playback."});t.fatal=!0,null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this._priv_currentError=t,M.Z.error("API: The player stopped because of an error:",e),this._priv_setPlayerState(_n),this._priv_currentError===t&&this.trigger("error",t)},f._priv_onPlaybackFinished=function(){M.Z.info("API: Previous playback finished. Stopping and cleaning-up..."),null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this._priv_setPlayerState(wn)},f._priv_onPlaybackWarning=function(e){var t=(0,N.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error happened."});M.Z.warn("API: Sending warning:",t),this.trigger("warning",t)},f._priv_onManifestReady=function(e){var t=this,n=e.manifest,r=this._priv_contentInfos;if(null!==r){r.manifest=n,this._priv_lastContentPlaybackInfos.manifest=n;var i=r.initialAudioTrack,a=r.initialTextTrack;this._priv_trackChoiceManager=new Un({preferTrickModeTracks:this._priv_preferTrickModeTracks});var s=void 0===i?this._priv_preferredAudioTracks:[i];this._priv_trackChoiceManager.setPreferredAudioTracks(s,!0);var u=void 0===a?this._priv_preferredTextTracks:[a];this._priv_trackChoiceManager.setPreferredTextTracks(u,!0),this._priv_trackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),(0,F.R)(n,"manifestUpdate").pipe((0,o.R)(r.stop$)).subscribe((function(){null!==t._priv_trackChoiceManager&&t._priv_trackChoiceManager.update()}))}else M.Z.error("API: The manifest is loaded but no content is.")},f._priv_onActivePeriodChanged=function(e){var t,n,r,i,a,o,s=e.period;if(null!==this._priv_contentInfos){if(this._priv_contentInfos.currentPeriod=s,this._priv_contentEventsMemory.periodChange!==s&&(this._priv_contentEventsMemory.periodChange=s,this.trigger("periodChange",s)),this.trigger("availableAudioTracksChange",this.getAvailableAudioTracks()),this.trigger("availableTextTracksChange",this.getAvailableTextTracks()),this.trigger("availableVideoTracksChange",this.getAvailableVideoTracks()),null!==this._priv_trackChoiceManager){var u=this._priv_trackChoiceManager.getChosenAudioTrack(s),l=this._priv_trackChoiceManager.getChosenTextTrack(s),c=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("audioTrackChange",u),this.trigger("textTrackChange",l),this.trigger("videoTrackChange",c)}else this.trigger("audioTrackChange",null),this.trigger("textTrackChange",null),this.trigger("videoTrackChange",null);this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",this.getAvailableAudioBitrates()),this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",this.getAvailableVideoBitrates());var d=null!==(r=null===(n=null===(t=this._priv_getCurrentRepresentations())||void 0===t?void 0:t.audio)||void 0===n?void 0:n.bitrate)&&void 0!==r?r:-1;this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",d);var f=null!==(o=null===(a=null===(i=this._priv_getCurrentRepresentations())||void 0===i?void 0:i.video)||void 0===a?void 0:a.bitrate)&&void 0!==o?o:-1;this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",f)}else M.Z.error("API: The active period changed but no content is loaded")},f._priv_onPeriodStreamReady=function(e){var t=e.type,n=e.period,r=e.adaptation$;switch(t){case"video":null===this._priv_trackChoiceManager?(M.Z.error("API: TrackChoiceManager not instanciated for a new video period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialVideoTrack(n));break;case"audio":null===this._priv_trackChoiceManager?(M.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialAudioTrack(n));break;case"text":null===this._priv_trackChoiceManager?(M.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialTextTrack(n));break;default:var i=n.adaptations[t];!(0,z.Z)(i)&&i.length>0?r.next(i[0]):r.next(null)}},f._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.Z)(i)&&!(0,z.Z)(i[n.id])){var o=i[n.id];delete o[t],0===Object.keys(o).length&&delete i[n.id]}if(!(0,z.Z)(a)&&!(0,z.Z)(a[n.id])){var s=a[n.id];delete s[t],0===Object.keys(s).length&&delete a[n.id]}}},f._priv_onReloadingMediaSource=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.segmentBuffersStore=null),null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.resetPeriods()},f._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.Z)(u))o[r.id]=((i={})[t]=n,i);else u[t]=n;if(null!==this._priv_trackChoiceManager&&null!==s&&!(0,z.Z)(r)&&r.id===s.id)switch(t){case"audio":var l=this._priv_trackChoiceManager.getChosenAudioTrack(s);this.trigger("audioTrackChange",l);var c=this.getAvailableAudioBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",c);break;case"text":var d=this._priv_trackChoiceManager.getChosenTextTrack(s);this.trigger("textTrackChange",d);break;case"video":var f=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("videoTrackChange",f);var p=this.getAvailableVideoBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",p)}}else M.Z.error("API: The adaptations changed but no content is loaded")},f._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.Z)(l))s[r.id]=((a={})[n]=i,a);else l[n]=i;var c=null!==(t=null==i?void 0:i.bitrate)&&void 0!==t?t:-1;(0,z.Z)(r)||null===u||u.id!==r.id||("video"===n?this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",c):"audio"===n&&this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",c))}else M.Z.error("API: The representations changed but no content is loaded")},f._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})},f._priv_onPlayPauseNext=function(e){if(null===this.videoElement)throw new Error("Disposed player");this._priv_isPlaying.setValue(e)},f._priv_onNativeTextTracksNext=function(e){this.trigger("nativeTextTracksChange",e)},f._priv_setPlayerState=function(e){this.state!==e&&(this.state=e,M.Z.info("API: playerStateChange event",e),this.trigger("playerStateChange",e))},f._priv_triggerPositionUpdate=function(e){var t;if(null!==this._priv_contentInfos){if(this.state!==xn){var n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if((r||null!==i)&&!(0,z.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 M.Z.warn("API: Cannot perform time update: no content loaded.")},f._priv_triggerAvailableBitratesChangeEvent=function(e,t){var n=this._priv_contentEventsMemory[e];void 0!==n&&(0,U.Z)(t,n)||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},f._priv_triggerCurrentBitrateChangeEvent=function(e,t){t!==this._priv_contentEventsMemory[e]&&(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},f._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.Z)(n[t.id])?null:n[t.id]},(0,e.Z)(r,null,[{key:"ErrorTypes",get:function(){return O.ZB}},{key:"ErrorCodes",get:function(){return O.SM}},{key:"LogLevel",get:function(){return M.Z.getLevel()},set:function(e){M.Z.setLevel(e)}}]),r}(F.Z);ar.version="3.27.0-dev.2022032800";var or=ar,sr=n(7273);!function(){sr.Z.ContentDecryptor=n(1266).ZP,sr.Z.imageBuffer=n(7127).Z,sr.Z.imageParser=n(3203).Z,sr.Z.transports.smooth=n(2339).Z,sr.Z.transports.dash=n(5877).Z,sr.Z.dashParsers.js=n(3501).Z,sr.Z.nativeTextTracksBuffer=n(9059).Z,sr.Z.nativeTextTracksParsers.vtt=n(9405).Z,sr.Z.nativeTextTracksParsers.ttml=n(1570).Z,sr.Z.nativeTextTracksParsers.sami=n(1812).Z,sr.Z.nativeTextTracksParsers.srt=n(8057).Z,sr.Z.htmlTextTracksBuffer=n(5192).Z,sr.Z.htmlTextTracksParsers.sami=n(5734).Z,sr.Z.htmlTextTracksParsers.ttml=n(7439).Z,sr.Z.htmlTextTracksParsers.srt=n(8675).Z,sr.Z.htmlTextTracksParsers.vtt=n(4099).Z;var e=n(8969).Z,t=n(7794).Z;sr.Z.directfile={initDirectFile:e,mediaElementTrackChoiceManager:t}}();var ur=or}(),r=r.default}()}));
2
+ !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={7757:function(e,t,n){e.exports=n(5666)},3774:function(e,t,n){"use strict";n.d(t,{J:function(){return a},c:function(){return o}});var r=n(1946),i=n(2203).Z?void 0:window,a=void 0===i?void 0:(0,r.Z)(i.MediaSource)?(0,r.Z)(i.MozMediaSource)?(0,r.Z)(i.WebKitMediaSource)?i.MSMediaSource:i.WebKitMediaSource:i.MozMediaSource:i.MediaSource,o={HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4}},3666:function(e,t,n){"use strict";n.d(t,{SB:function(){return p},YM:function(){return s},fq:function(){return o},kD:function(){return u},op:function(){return c},vS:function(){return f},vU:function(){return l},yS:function(){return d}});var r,i,a=n(2203),o=!a.Z&&void 0!==window.MSInputMethodContext&&void 0!==document.documentMode,s=!a.Z&&("Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&/(Trident|Edge)\//.test(navigator.userAgent)),u=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("edg/"),l=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),c=!a.Z&&/SamsungBrowser/.test(navigator.userAgent),d=!a.Z&&/Tizen/.test(navigator.userAgent),f=!a.Z&&(Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>=0||"[object SafariRemoteNotification]"===(null===(i=null===(r=window.safari)||void 0===r?void 0:r.pushNotification)||void 0===i?void 0:i.toString())),p=!a.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(1946);function a(e){var t=e.textTracks;if(!(0,i.Z)(t)){for(var n=0;n<t.length;n++)t[n].mode="disabled";if(e.hasChildNodes())for(var a=e.childNodes,o=a.length-1;o>=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 P},Y:function(){return D}});var r,i=n(3714),a=n(811),o=n(3666),s=n(2203),u=n(5059),l=n(3144),c=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 Promise((function(t){return t(e._mediaKeys)}))},t.getConfiguration=function(){return this._configuration},(0,l.Z)(e,[{key:"keySystem",get:function(){return this._keyType}}]),e}(),d=n(4578),f=n(6716),p=n(3071),v=n(3505),h=n(1959),m=n(4804);if(!s.Z){var g=window.MSMediaKeys;void 0!==g&&void 0!==g.prototype&&"function"==typeof g.isTypeSupported&&"function"==typeof g.prototype.createSession&&(r=g)}var y,_=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 f.x,n.closed=new Promise((function(e){n._closeSession$.subscribe(e)})),n.update=function(e){return new Promise((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,d.Z)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new Promise((function(e){var r=t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer);n._ss=n._mk.createSession("video/mp4",r),(0,p.T)(m.GJ(n._ss),m.GV(n._ss),m.Xe(n._ss)).pipe((0,v.R)(n._closeSession$)).subscribe((function(e){return n.trigger(e.type,e)})),e()}))},n.close=function(){var e=this;return new Promise((function(t){null!=e._ss&&(e._ss.close(),e._ss=void 0),e._closeSession$.next(),e._closeSession$.complete(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},(0,l.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}(h.Z),b=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 _(this._mediaKeys)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();if(!s.Z){var T=window.MozMediaKeys;void 0!==T&&void 0!==T.prototype&&"function"==typeof T.isTypeSupported&&"function"==typeof T.prototype.createSession&&(y=T)}var E=n(9689),S=n(8894),w=n(3635);function k(e){return"function"==typeof e.webkitGenerateKeyRequest}var A=function(e){function t(t,n){var r;(r=e.call(this)||this)._vid=t,r._key=n,r.sessionId="",r._closeSession=S.Z,r.keyStatuses=new Map,r.expiration=NaN;var i=function(e){r.trigger(e.type,e)};return r.closed=new Promise((function(e){r._closeSession=function(){["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(e){t.removeEventListener(e,i),t.removeEventListener("webkit"+e,i)})),e()}})),["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(e){t.addEventListener(e,i),t.addEventListener("webkit"+e,i)})),r}(0,d.Z)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new Promise((function(n,r){try{if(t._key.indexOf("clearkey")>=0){var i=e instanceof ArrayBuffer?new Uint8Array(e):e,a=JSON.parse((0,w.uR)(i)),o=(0,E.K)(a.keys[0].k),s=(0,E.K)(a.keys[0].kid);n(t._vid.webkitAddKey(t._key,o,s,""))}else n(t._vid.webkitAddKey(t._key,e,null,""))}catch(e){r(e)}}))},n.generateRequest=function(e,t){var n=this;return new Promise((function(e){n._vid.webkitGenerateKeyRequest(n._key,t),e()}))},n.close=function(){var e=this;return new Promise((function(t){e._closeSession(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},t}(h.Z),x=function(){function e(e){this._keySystem=e}var t=e.prototype;return t._setVideo=function(e){if(!k(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 A(this._videoElement,this._keySystem)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();var I=n(6968);var Z=n(158);function R(e,t){var n=e;if(void 0===n.webkitSetMediaKeys)throw new Error("No webKitMediaKeys API.");return n.webkitSetMediaKeys(t)}var M=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._serverCertificate=r,i._videoElement=t,i._keyType=n,i._unbindSession=S.Z,i._closeSession=S.Z,i.closed=new Promise((function(e){i._closeSession=e})),i.keyStatuses=new Map,i.expiration=NaN,i}(0,d.Z)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new Promise((function(n,r){if(void 0===t._nativeSession||void 0===t._nativeSession.update||"function"!=typeof t._nativeSession.update)return r("Unavailable WebKit key session.");try{var i;i=e instanceof ArrayBuffer?new Uint8Array(e):e instanceof Uint8Array?e:new Uint8Array(e.buffer),n(t._nativeSession.update(i))}catch(e){r(e)}}))},n.generateRequest=function(e,t){var n=this;return new Promise((function(e){var r,i,a,o=n._videoElement;if(void 0===(null===(r=o.webkitKeys)||void 0===r?void 0:r.createSession))throw new Error("No WebKitMediaKeys API.");if("com.apple.fps.1_0"===(a=n._keyType)||"com.apple.fps.2_0"===a){if(void 0===n._serverCertificate)throw new Error("A server certificate is needed for creating fairplay session.");i=function(e,t){var n=e instanceof Uint8Array?e:new Uint8Array(e),r=t instanceof Uint8Array?t:new Uint8Array(t);if((0,I.dN)(n,0)+4!==n.length)throw new Error("Unsupported WebKit initData.");var i=(0,w.wV)(n),a=i.indexOf("skd://"),o=a>-1?i.substring(a+6):i,s=(0,w.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,I.O_)(s.byteLength),u),u+=4,l.set(s,u),u+=s.byteLength,l.set((0,I.O_)(r.byteLength),u),u+=4,l.set(r,u),l}(t,n._serverCertificate)}else i=t;var s=o.webkitKeys.createSession("video/mp4",i);if(null==s)throw new Error("Impossible to get the key sessions");n._listenEvent(s),n._nativeSession=s,e()}))},n.close=function(){var e=this;return new Promise((function(t,n){e._unbindSession(),e._closeSession(),void 0!==e._nativeSession?(e._nativeSession.close(),t()):n("No session to close.")}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},n._listenEvent=function(e){var t=this;this._unbindSession();var n=function(e){t.trigger(e.type,e)};["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(t){e.addEventListener(t,n),e.addEventListener("webkit"+t,n)})),this._unbindSession=function(){["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(t){e.removeEventListener(t,n),e.removeEventListener("webkit"+t,n)}))}},(0,l.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}(h.Z),C=function(){function e(e){if(void 0===Z.t)throw new Error("No WebKitMediaKeys API.");this._keyType=e,this._mediaKeys=new Z.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 R(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 M(this._videoElement,this._keyType,this._serverCertificate)},t.setServerCertificate=function(e){return this._serverCertificate=e,Promise.resolve()},e}();var P=null,D=function(e,t){var n=e;return"function"==typeof n.setMediaKeys?n.setMediaKeys(t):"function"==typeof n.webkitSetMediaKeys?n.webkitSetMediaKeys(t):"function"==typeof n.mozSetMediaKeys?n.mozSetMediaKeys(t):"function"==typeof n.msSetMediaKeys&&null!==t?n.msSetMediaKeys(t):void 0};if(s.Z||null!=navigator.requestMediaKeySystemAccess&&!(0,u.Z)())P=function(){var e;return(e=navigator).requestMediaKeySystemAccess.apply(e,arguments)};else{var N,O;if(k(HTMLVideoElement.prototype)){var L={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 x(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof x))throw new Error("Custom setMediaKeys is supposed to be called with old webkit custom MediaKeys.");return t._setVideo(e)}}};N=L.isTypeSupported,O=L.createCustomMediaKeys,D=L.setMediaKeys}else if(void 0!==Z.t){var B=function(){if(void 0===Z.t)throw new Error("No WebKitMediaKeys API.");return{isTypeSupported:Z.t.isTypeSupported,createCustomMediaKeys:function(e){return new C(e)},setMediaKeys:function(e,t){if(null===t)return R(e,t);if(!(t instanceof C))throw new Error("Custom setMediaKeys is supposed to be called with webkit custom MediaKeys.");return t._setVideo(e)}}}();N=B.isTypeSupported,O=B.createCustomMediaKeys,D=B.setMediaKeys}else if(o.fq&&void 0!==r){var U={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 b(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof b))throw new Error("Custom setMediaKeys is supposed to be called with IE11 custom MediaKeys.");return t._setVideo(e)}}};N=U.isTypeSupported,O=U.createCustomMediaKeys,D=U.setMediaKeys}else if(void 0!==y){var F={isTypeSupported:function(e,t){if(void 0===y)throw new Error("No MozMediaKeys API.");return void 0!==t?y.isTypeSupported(e,t):y.isTypeSupported(e)},createCustomMediaKeys:function(e){if(void 0===y)throw new Error("No MozMediaKeys API.");return new y(e)},setMediaKeys:function(e,t){var n=e;if(void 0===n.mozSetMediaKeys||"function"!=typeof n.mozSetMediaKeys)throw new Error("Can't set video on MozMediaKeys.");return n.mozSetMediaKeys(t)}};N=F.isTypeSupported,O=F.createCustomMediaKeys,D=F.setMediaKeys}else{var z=window.MediaKeys,V=function(){if(void 0===z)throw new i.Z("MEDIA_KEYS_NOT_SUPPORTED","No `MediaKeys` implementation found in the current browser.");if(void 0===z.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.")}};N=function(e){return V(),(0,a.Z)("function"==typeof z.isTypeSupported),z.isTypeSupported(e)},O=function(e){return V(),new z(e)}}P=function(e,t){if(!N(e))return Promise.reject(new Error("Unsupported key type"));for(var n=0;n<t.length;n++){var r=t[n],i=r.videoCapabilities,a=r.audioCapabilities,o=r.initDataTypes,s=r.distinctiveIdentifier,u=!0;if(u=(u=u&&(null==o||o.some((function(e){return"cenc"===e}))))&&"required"!==s){var l={initDataTypes:["cenc"],distinctiveIdentifier:"not-allowed",persistentState:"required",sessionTypes:["temporary","persistent-license"]};void 0!==i&&(l.videoCapabilities=i),void 0!==a&&(l.audioCapabilities=a);var d=O(e);return Promise.resolve(new c(e,d,l))}}return Promise.reject(new Error("Unsupported configuration"))}}},158:function(e,t,n){"use strict";var r;if(n.d(t,{t:function(){return r}}),!n(2203).Z){var i=window.WebKitMediaKeys;void 0!==i&&"function"==typeof i.isTypeSupported&&"function"==typeof i.prototype.createSession&&"function"==typeof HTMLMediaElement.prototype.webkitSetMediaKeys&&(r=i)}},4804:function(e,t,n){"use strict";n.d(t,{Nh:function(){return B},_K:function(){return z},Oh:function(){return te},C1:function(){return W},Q1:function(){return j},GV:function(){return re},Xe:function(){return ie},GJ:function(){return ne},eX:function(){return ae},K4:function(){return K},yj:function(){return F},Qt:function(){return q},gg:function(){return ee},ik:function(){return H},d5:function(){return G},UG:function(){return X},ep:function(){return Q},ym:function(){return $},UA:function(){return Y},_E:function(){return J},$x:function(){return V}});var r=n(1480),i=n(2967),a=new r.y(i.Z);var o=n(7991),s=n(6362),u=n(4727),l=n(533),c=n(9127);var d=n(7877);function f(e,t){return t?function(n){return(0,s.z)(t.pipe((0,u.q)(1),(0,l.l)()),n.pipe(f(e)))}:(0,d.z)((function(t,n){return e(t,n).pipe((0,u.q)(1),function(e){return(0,c.U)((function(){return e}))}(t))}))}var p=n(6625);function v(e,t){void 0===t&&(t=o.z);var n=(0,p.H)(e,t);return f((function(){return n}))}var h=n(6798),m=n(2566),g=n(7878),y={leading:!0,trailing:!1};function _(e,t,n){void 0===t&&(t=o.z),void 0===n&&(n=y);var r,i,a,s,u,l=(0,p.H)(e,t);return r=function(){return l},s=(a=void 0===(i=n)?y:i).leading,u=a.trailing,(0,h.e)((function(e,t){var n=!1,i=null,a=null,o=!1,l=function(){null==a||a.unsubscribe(),a=null,u&&(f(),o&&t.complete())},c=function(){a=null,o&&t.complete()},d=function(e){return a=(0,g.Xf)(r(e)).subscribe(new m.Q(t,l,c))},f=function(){if(n){n=!1;var e=i;i=null,t.next(e),!o&&d(e)}};e.subscribe(new m.Q(t,(function(e){n=!0,i=e,(!a||a.closed)&&(s?f():d(e))}),(function(){o=!0,(!(u&&n&&a)||a.closed)&&t.complete()})))}))}var b=n(2401),T=n(3071),E=n(9917),S=n(6108),w=n(3741),k=n(4978),A=n(2817),x=n(2334),I=n(6697),Z=n(6872),R=n(6923),M=n(2203),C=n(5059),P=["","webkit","moz","ms"],D=M.Z||null==window.devicePixelRatio||0===window.devicePixelRatio?1:window.devicePixelRatio;function N(e,t){return t.filter((function(t){return function(e,t){var n=document.createElement(e.tagName),r="on"+t;return r in n||(n.setAttribute(r,"return;"),"function"==typeof n[r])}(e,t)}))[0]}function O(e,t){var n,r=function(e,t){return e.reduce((function(e,n){return e.concat((null==t?P:t).map((function(e){return e+n})))}),[])}(e,t);return function(e){return e instanceof HTMLElement?(void 0===n&&(n=N(e,r)),(0,R.Z)(n)?(0,b.R)(e,n):a):T.T.apply(void 0,r.map((function(t){return(0,b.R)(e,t)})))}}function L(){var e,t=document;null!=t.hidden?e="":null!=t.mozHidden?e="moz":null!=t.msHidden?e="ms":null!=t.webkitHidden&&(e="webkit");var n=(0,R.Z)(e)?e+"Hidden":"hidden",r=(0,R.Z)(e)?e+"visibilitychange":"visibilitychange";return(0,E.P)((function(){var e=document[n];return(0,b.R)(document,r).pipe((0,c.U)((function(){return!document[n]})),(0,S.O)(!e),(0,w.x)())}))}function B(){var e=Z.Z.getCurrent().INACTIVITY_DELAY;return L().pipe((0,k.w)((function(t){return t?(0,A.of)(t):(0,A.of)(t).pipe(v(e))})))}function U(e,t){var n=t.width,r=t.height/(e.clientHeight/e.clientWidth);return Math.min(n,r)}function F(e){return(0,E.P)((function(){var t=e;if(!0===t.webkitSupportsPresentationMode&&"function"==typeof t.webkitSetPresentationMode){var n="picture-in-picture"===t.webkitPresentationMode;return(0,b.R)(t,"webkitpresentationmodechanged").pipe((0,c.U)((function(){return{isEnabled:"picture-in-picture"===t.webkitPresentationMode,pipWindow:null}})),(0,S.O)({isEnabled:n,pipWindow:null}))}var r={isEnabled:document.pictureInPictureElement===t,pipWindow:null};return(0,T.T)((0,b.R)(t,"enterpictureinpicture").pipe((0,c.U)((function(e){var t;return{isEnabled:!0,pipWindow:null!==(t=e.pictureInPictureWindow)&&void 0!==t?t:null}}))),(0,b.R)(t,"leavepictureinpicture").pipe((0,c.U)((function(){return{isEnabled:!1,pipWindow:null}})))).pipe((0,S.O)(r))}))}function z(e){var t=Z.Z.getCurrent().INACTIVITY_DELAY;return(0,x.a)([L(),e]).pipe((0,k.w)((function(e){var n=e[0];return e[1].isEnabled||n?(0,A.of)(!0):(0,A.of)(!1).pipe(v(t))})),(0,w.x)())}function V(e,t){return(0,x.a)([t,(0,I.F)(2e4).pipe((0,S.O)(null)),(0,b.R)(window,"resize").pipe(_(500),(0,S.O)(null))]).pipe((0,k.w)((function(t){var n=t[0];if(n.isEnabled){if(null!=n.pipWindow){var r=n.pipWindow,i=U(e,r);return(0,b.R)(r,"resize").pipe((0,S.O)(i*D),(0,c.U)((function(){return U(e,r)*D})))}return(0,A.of)(1/0)}return(0,A.of)(e.clientWidth*D)})),(0,w.x)())}var K=O(["loadedmetadata"]),G=O(["seeking"]),H=O(["seeked"]),W=O(["ended"]),j=(O(["timeupdate"]),O(["fullscreenchange","FullscreenChange"],P.concat("MS"))),q=function(e){return(0,T.T)(O(["play"])(e),O(["pause"])(e))},Y=function(e){return(0,T.T)(O(["addtrack"])(e),O(["removetrack"])(e))},$=O(["sourceopen","webkitsourceopen"]),X=O(["sourceclose","webkitsourceclose"]),Q=O(["sourceended","webkitsourceended"]),J=O(["update"]),ee=O(["onremovesourcebuffer"]),te=O((0,C.Z)()?["needkey"]:["encrypted","needkey"]),ne=O(["keymessage","message"]),re=O(["keyadded","ready"]),ie=O(["keyerror","error"]),ae=O(["keystatuseschange"])},2203:function(e,t){"use strict";var n="undefined"==typeof window;t.Z=n},1988:function(e,t,n){"use strict";function r(e){return"function"==typeof window.VTTCue&&e instanceof window.VTTCue}n.d(t,{Z:function(){return r}})},7253:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946);function a(e,t,n){if(e>=t)return r.Z.warn("Compat: Invalid cue times: "+e+" - "+t),null;if((0,i.Z)(window.VTTCue)){if((0,i.Z)(window.TextTrackCue))throw new Error("VTT cues not supported in your target");return new TextTrackCue(e,t,n)}return new VTTCue(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.vS||r.SB)&&void 0!==i.t}},1669:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3666);function i(){return r.op}},6872:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r={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,DEFAULT_MAX_VIDEO_BUFFER_SIZE: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.5},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},REBUFFERING_GAP:{DEFAULT:.5,LOW_LATENCY:.2},MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING:2,UNFREEZING_SEEK_DELAY:6e3,FREEZING_STALLED_DELAY:600,UNFREEZING_DELTA_POSITION:.001,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_WAITING_DELAY_LOADED_SESSION_EMPTY_KEYSTATUSES:100,FORCED_ENDED_THRESHOLD:8e-4,ADAPTATION_SWITCH_BUFFER_PADDINGS:{video:{before:5,after: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,BUFFERED_HISTORY_RETENTION_TIME:6e4,BUFFERED_HISTORY_MAXIMUM_ENTRIES:200,MIN_BUFFER_AHEAD:5,UPTO_CURRENT_POSITION_CLEANUP:5},i=n(8026);function a(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function o(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(0===n.length)return e;var s=n.shift();if(a(e)&&a(s))for(var u in s)if(a(s[u])){var l;if(void 0===e[u])(0,i.Z)(e,((l={})[u]={},l));var c=e[u];o(c,s[u])}else{var d;(0,i.Z)(e,((d={})[u]=s[u],d))}return o.apply(void 0,[e].concat(n))}var s=new(function(){function e(){this._config=r}var t=e.prototype;return t.update=function(e){var t=o(this._config,e);this._config=t},t.getCurrent=function(){return this._config},e}())},7794:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(4578),i=n(811),a=n(1959),o=n(7829);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){var n;if(t.length!==e.length)return!0;for(var r=0;r<t.length;r++)if(t[r].nativeTrack!==(null===(n=e[r])||void 0===n?void 0:n.nativeTrack))return!0;return!1}function c(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],s=""===a.language?"nolang":a.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_audio_"+s+"_"+u.toString();r[s]=u+1;var c={language:a.language,id:l,normalized:(0,o.ZP)(a.language),audioDescription:!1,representations:[]};n.push({track:c,nativeTrack:a})}return n}function d(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],s=""===a.language?"nolang":a.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_text_"+s+"_"+u.toString();r[s]=u+1;var c={language:a.language,id:l,normalized:(0,o.ZP)(a.language),closedCaption:"captions"===a.kind};n.push({track:c,nativeTrack:a})}return n}function f(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],o=""===a.language?"nolang":a.language,s=null!==(t=r[o])&&void 0!==t?t:1,u="gen_video_"+o+"_"+s.toString();r[o]=s+1,n.push({track:{id:u,representations:[]},nativeTrack:a})}return n}var p=function(e){function t(t){var n,r,i,a;return(n=e.call(this)||this)._preferredAudioTracks=[],n._preferredTextTracks=[],n._preferredVideoTracks=[],n._nativeAudioTracks=t.audioTracks,n._nativeVideoTracks=t.videoTracks,n._nativeTextTracks=t.textTracks,n._audioTracks=void 0!==n._nativeAudioTracks?c(n._nativeAudioTracks):[],n._videoTracks=void 0!==n._nativeVideoTracks?f(n._nativeVideoTracks):[],n._textTracks=void 0!==n._nativeTextTracks?d(n._nativeTextTracks):[],n._lastEmittedNativeAudioTrack=null===(r=n._getPrivateChosenAudioTrack())||void 0===r?void 0:r.nativeTrack,n._lastEmittedNativeVideoTrack=null===(i=n._getPrivateChosenVideoTrack())||void 0===i?void 0:i.nativeTrack,n._lastEmittedNativeTextTrack=null===(a=n._getPrivateChosenTextTrack())||void 0===a?void 0:a.nativeTrack,n._handleNativeTracksCallbacks(),n}(0,r.Z)(t,e);var n=t.prototype;return n.setPreferredAudioTracks=function(e,t){this._preferredAudioTracks=e,t&&this._applyAudioPreferences()},n.setPreferredTextTracks=function(e,t){this._preferredTextTracks=e,t&&this._applyTextPreferences()},n.setPreferredVideoTracks=function(e,t){this._preferredVideoTracks=e,t&&this._applyVideoPreferences()},n.setAudioTrackById=function(e){for(var t=0;t<this._audioTracks.length;t++){var n=this._audioTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return this._enableAudioTrackFromIndex(t),void(this._audioTrackLockedOn=i)}throw new Error("Audio track not found.")},n.disableTextTrack=function(){v(this._textTracks),this._textTrackLockedOn=null},n.setTextTrackById=function(e){for(var t=!1,n=0;n<this._textTracks.length;n++){var r=this._textTracks[n],i=r.track,a=r.nativeTrack;i.id===e?(a.mode="showing",t=!0,this._textTrackLockedOn=a):"showing"!==a.mode&&"hidden"!==a.mode||(a.mode="disabled")}if(!t)throw new Error("Text track not found.")},n.disableVideoTrack=function(){m(this._videoTracks),this._videoTrackLockedOn=null},n.setVideoTrackById=function(e){for(var t=0;t<this._videoTracks.length;t++){var n=this._videoTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return i.selected=!0,void(this._videoTrackLockedOn=i)}throw new Error("Video track not found.")},n.getChosenAudioTrack=function(){var e=this._getPrivateChosenAudioTrack();return null!=e?e.track:e},n.getChosenTextTrack=function(){var e=this._getPrivateChosenTextTrack();return null!=e?e.track:e},n.getChosenVideoTrack=function(){var e=this._getPrivateChosenVideoTrack();return null!=e?e.track:e},n.getAvailableAudioTracks=function(){return this._audioTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,audioDescription:t.audioDescription,active:n.enabled,representations:t.representations}}))},n.getAvailableTextTracks=function(){return this._textTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,closedCaption:t.closedCaption,active:"showing"===n.mode}}))},n.getAvailableVideoTracks=function(){return this._videoTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,representations:t.representations,active:n.selected}}))},n.dispose=function(){void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onchange=null,this._nativeVideoTracks.onaddtrack=null,this._nativeVideoTracks.onremovetrack=null),void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onchange=null,this._nativeAudioTracks.onaddtrack=null,this._nativeAudioTracks.onremovetrack=null),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onchange=null,this._nativeTextTracks.onaddtrack=null,this._nativeTextTracks.onremovetrack=null),this.removeEventListener()},n._getPrivateChosenAudioTrack=function(){if(void 0!==this._nativeAudioTracks){for(var e=0;e<this._audioTracks.length;e++){var t=this._audioTracks[e];if(t.nativeTrack.enabled)return t}return null}},n._getPrivateChosenVideoTrack=function(){if(void 0!==this._nativeVideoTracks){for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e];if(t.nativeTrack.selected)return t}return null}},n._getPrivateChosenTextTrack=function(){if(void 0!==this._nativeTextTracks){for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e];if("showing"===t.nativeTrack.mode)return t}return null}},n._setOptimalAudioTrack=function(){if(void 0!==this._audioTrackLockedOn)for(var e=0;e<this._audioTracks.length;e++){if(this._audioTracks[e].nativeTrack===this._audioTrackLockedOn)return void this._enableAudioTrackFromIndex(e)}this._applyAudioPreferences()},n._applyAudioPreferences=function(){this._audioTrackLockedOn=void 0;for(var e=this._preferredAudioTracks,t=0;t<e.length;t++){var n=e[t];if(null!==n&&void 0!==n.language)for(var r=(0,o.ZP)(n.language),i=0;i<this._audioTracks.length;i++){var a=this._audioTracks[i];if(a.track.normalized===r&&a.track.audioDescription===n.audioDescription)return void this._enableAudioTrackFromIndex(i)}}},n._setOptimalTextTrack=function(){if(null!==this._textTrackLockedOn){if(void 0!==this._textTrackLockedOn)for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e].nativeTrack;if(t===this._textTrackLockedOn)return h(this._textTracks,t),void("showing"!==t.mode&&(t.mode="showing"))}this._applyTextPreferences()}else v(this._textTracks)},n._applyTextPreferences=function(){this._textTrackLockedOn=void 0;for(var e=this._preferredTextTracks,t=0;t<e.length;t++){var n=e[t];if(null===n)return void v(this._textTracks);for(var r=(0,o.ZP)(n.language),i=0;i<this._textTracks.length;i++){var a=this._textTracks[i];if(a.track.normalized===r&&a.track.closedCaption===n.closedCaption)return h(this._textTracks,a.nativeTrack),void("showing"!==a.nativeTrack.mode&&(a.nativeTrack.mode="showing"))}}v(this._textTracks)},n._setOptimalVideoTrack=function(){if(null!==this._videoTrackLockedOn){if(void 0!==this._videoTrackLockedOn)for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e].nativeTrack;if(t===this._videoTrackLockedOn)return void(t.selected=!0)}this._applyVideoPreferences()}else m(this._videoTracks)},n._applyVideoPreferences=function(){this._videoTrackLockedOn=void 0,this._preferredVideoTracks.some((function(e){return null===e}))&&m(this._videoTracks)},n._handleNativeTracksCallbacks=function(){var e=this;void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeAudioTracks){var r=c(e._nativeAudioTracks);if(l(e._audioTracks,r)){e._audioTracks=r,e._setOptimalAudioTrack(),e.trigger("availableAudioTracksChange",e.getAvailableAudioTracks());var i=e._getPrivateChosenAudioTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeAudioTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeAudioTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeAudioTracks){var r=c(e._nativeAudioTracks);if(l(e._audioTracks,r)){e._audioTracks=r,e.trigger("availableAudioTracksChange",e.getAvailableAudioTracks());var i=e._getPrivateChosenAudioTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeAudioTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeAudioTracks.onchange=function(){if(void 0!==e._audioTracks)for(var t=0;t<e._audioTracks.length;t++){var n=e._audioTracks[t],r=n.track,i=n.nativeTrack;if(i.enabled)return void(i!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",r),e._lastEmittedNativeAudioTrack=i))}null!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null),e._lastEmittedNativeAudioTrack=null)}),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeTextTracks){var r=d(e._nativeTextTracks);if(l(e._textTracks,r)){e._textTracks=r,e._setOptimalTextTrack(),e.trigger("availableTextTracksChange",e.getAvailableTextTracks());var i=e._getPrivateChosenTextTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeTextTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeTextTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeTextTracks){var r=d(e._nativeTextTracks);if(l(e._textTracks,r)){e._textTracks=r,e._setOptimalTextTrack(),e.trigger("availableTextTracksChange",e.getAvailableTextTracks());var i=e._getPrivateChosenTextTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeTextTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeTextTracks.onchange=function(){if(void 0!==e._textTracks)for(var t=0;t<e._textTracks.length;t++){var n=e._textTracks[t],r=n.track,i=n.nativeTrack;if("showing"===i.mode)return void(i!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",r),e._lastEmittedNativeTextTrack=i))}null!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null),e._lastEmittedNativeTextTrack=null)}),void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeVideoTracks){var r=f(e._nativeVideoTracks);if(l(e._videoTracks,r)){e._videoTracks=r,e._setOptimalVideoTrack(),e.trigger("availableVideoTracksChange",e.getAvailableVideoTracks());var i=e._getPrivateChosenVideoTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeVideoTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeVideoTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeVideoTracks){var r=f(e._nativeVideoTracks);if(l(e._videoTracks,r)){e._videoTracks=r,e._setOptimalVideoTrack(),e.trigger("availableVideoTracksChange",e.getAvailableVideoTracks());var i=e._getPrivateChosenVideoTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeVideoTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeVideoTracks.onchange=function(){if(void 0!==e._videoTracks)for(var t=0;t<e._videoTracks.length;t++){var n=e._videoTracks[t],r=n.track,i=n.nativeTrack;if(i.selected)return void(i!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",r),e._lastEmittedNativeVideoTrack=i))}null!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null),e._lastEmittedNativeVideoTrack=null)})},n._enableAudioTrackFromIndex=function(e){(0,i.Z)(e<this._audioTracks.length);for(var t,n=s(this._audioTracks);!(t=n()).done;){t.value.nativeTrack.enabled=!1}this._audioTracks[e].nativeTrack.enabled=!0},t}(a.Z);function v(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.mode="disabled"}}function h(e,t){for(var n=0;n<e.length;n++){var r=e[n].nativeTrack;r===t||"showing"!==r.mode&&"hidden"!==r.mode||(r.mode="disabled")}}function m(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.selected=!1}}},7665:function(e,t,n){"use strict";n.d(t,{u:function(){return St},Z:function(){return kt}});var r=n(5861),i=n(4578),a=n(7757),o=n.n(a),s=n(3887),u=n(6490),l=n(4791),c=n(6968),d=n(3635),f=(0,c.pX)((0,d.tG)("pssh"),0);function p(e,t){for(var n=0;n<e.length;n++){var r=e[n];if((void 0===t.systemId||void 0===r.systemId||t.systemId===r.systemId)&&(0,l.Z)(t.data,r.data))return!0}return!1}function v(e){var t=e.initData,n=e.initDataType;return null==t?(s.Z.warn("Compat: No init data found on media encrypted event."),null):{type:n,values:function(e){for(var t=[],n=0;n<e.length;){if(e.length<n+8||(0,c.pX)(e,n+4)!==f)return s.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var r=(0,c.pX)(new Uint8Array(e),n);if(n+r>e.length)return s.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var i=e.subarray(n,n+r),a={systemId:(0,u.Y)(i,8),data:i};p(t,a)?s.Z.warn("Compat: Duplicated PSSH found in initialization data, removing it."):t.push(a),n+=r}return n!==e.length?(s.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}]):t}(new Uint8Array(t))}}var h=n(4804),m=n(6872),g=n(5157),y=n(5389),_=n(3274),b=n(7714),T=n(1959),E=n(1946),S=n(288),w=n(6139),k=n(770);function A(e){k.Z.setState(e,null),(0,w.Y)(e,null)}function x(){return(x=(0,r.Z)(o().mark((function e(t,n,r){var i,a,u,l,c,d;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.keySystemOptions,a=n.loadedSessionsStore,u=n.mediaKeySystemAccess,l=n.mediaKeys,c=k.Z.getState(t),d=null!==c&&c.loadedSessionsStore!==a?c.loadedSessionsStore.closeAllSessions():Promise.resolve(),e.next=5,d;case 5:if(!r.isCancelled){e.next=7;break}throw r.cancellationError;case 7:if(k.Z.setState(t,{keySystemOptions:i,mediaKeySystemAccess:u,mediaKeys:l,loadedSessionsStore:a}),t.mediaKeys!==l){e.next=10;break}return e.abrupt("return");case 10:s.Z.info("DRM: Attaching MediaKeys to the media element"),(0,w.Y)(t,l),s.Z.info("DRM: MediaKeys attached with success");case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function I(e){if(""===e.sessionId)return!1;var t=e.keyStatuses,n=[];return t.forEach((function(e){n.push(e)})),n.length<=0?(s.Z.debug("DRM: isSessionUsable: MediaKeySession given has an empty keyStatuses",e.sessionId),!1):(0,b.Z)(n,"expired")?(s.Z.debug("DRM: isSessionUsable: MediaKeySession given has an expired key",e.sessionId),!1):(0,b.Z)(n,"internal-error")?(s.Z.debug("DRM: isSessionUsable: MediaKeySession given has a key with an internal-error",e.sessionId),!1):(s.Z.debug("DRM: isSessionUsable: MediaKeySession is usable",e.sessionId),!0)}function Z(e,t,n,r){var i=e.loadedSessionsStore,a=e.persistentSessionsStore;return"temporary"===n?R(i,t):null===a?(s.Z.warn("DRM: Cannot create persistent MediaKeySession, PersistentSessionsStore not created."),R(i,t)):function(e,t,n,r){return M.apply(this,arguments)}(i,a,t,r)}function R(e,t){s.Z.info("DRM: Creating a new temporary session");var n=e.createSession(t,"temporary");return Promise.resolve({type:"created-session",value:n})}function M(){return(M=(0,r.Z)(o().mark((function e(t,n,i,a){var u,l,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f=function(){return(f=(0,r.Z)(o().mark((function e(){var r,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===a.cancellationError){e.next=2;break}throw a.cancellationError;case 2:return s.Z.info("DRM: Removing previous persistent session."),null!==(r=n.get(i))&&n.delete(r.sessionId),e.next=7,t.closeSession(u.mediaKeySession);case 7:if(null===a.cancellationError){e.next=9;break}throw a.cancellationError;case 9:return l=t.createSession(i,"persistent-license"),e.abrupt("return",{type:"created-session",value:l});case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)},d=function(){return f.apply(this,arguments)},null===a.cancellationError){e.next=4;break}throw a.cancellationError;case 4:if(s.Z.info("DRM: Creating persistent MediaKeySession"),u=t.createSession(i,"persistent-license"),null!==(l=n.getAndReuse(i))){e.next=9;break}return e.abrupt("return",{type:"created-session",value:u});case 9:return e.prev=9,e.next=12,t.loadPersistentSession(u.mediaKeySession,l.sessionId);case 12:if(c=e.sent){e.next=17;break}return s.Z.warn("DRM: No data stored for the loaded session"),n.delete(l.sessionId),e.abrupt("return",{type:"created-session",value:u});case 17:if(!c||!I(u.mediaKeySession)){e.next=21;break}return n.add(i,i.keyIds,u.mediaKeySession),s.Z.info("DRM: Succeeded to load persistent session."),e.abrupt("return",{type:"loaded-persistent-session",value:u});case 21:return s.Z.warn("DRM: Previous persistent session not usable anymore."),e.abrupt("return",d());case 25:return e.prev=25,e.t0=e.catch(9),s.Z.warn("DRM: Unable to load persistent session: "+(e.t0 instanceof Error?e.t0.toString():"Unknown Error")),e.abrupt("return",d());case 29:case"end":return e.stop()}}),e,null,[[9,25]])})))).apply(this,arguments)}function C(e,t){return P.apply(this,arguments)}function P(){return(P=(0,r.Z)(o().mark((function e(t,n){var r,i,a,s,u;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n<0||n>=t.getLength())){e.next=2;break}return e.abrupt("return");case 2:for(r=[],i=t.getAll().slice(),a=i.length-n,s=0;s<a;s++)u=i[s],r.push(t.closeSession(u.mediaKeySession));return e.next=8,Promise.all(r);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D(e,t,n,r,i){return N.apply(this,arguments)}function N(){return(N=(0,r.Z)(o().mark((function e(t,n,r,i,a){var u,l,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=null,l=n.loadedSessionsStore,c=n.persistentSessionsStore,null===(d=l.reuse(t))){e.next=11;break}if(!I(u=d.mediaKeySession)){e.next=10;break}return s.Z.info("DRM: Reuse loaded session",u.sessionId),e.abrupt("return",{type:"loaded-open-session",value:{mediaKeySession:u,sessionType:d.sessionType,keySessionRecord:d.keySessionRecord}});case 10:null!==c&&""!==d.mediaKeySession.sessionId&&c.delete(d.mediaKeySession.sessionId);case 11:if(null===u){e.next=16;break}return e.next=14,l.closeSession(u);case 14:if(null===a.cancellationError){e.next=16;break}throw a.cancellationError;case 16:return e.next=18,C(l,i);case 18:if(null===a.cancellationError){e.next=20;break}throw a.cancellationError;case 20:return e.next=22,Z(n,t,r,a);case 22:return f=e.sent,e.abrupt("return",{type:f.type,value:{mediaKeySession:f.value.mediaKeySession,sessionType:f.value.sessionType,keySessionRecord:f.value.keySessionRecord}});case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var O=n(3666);var L=n(9592);function B(e,t,n){var r=t.getConfiguration();if(O.fq||null==r)return null;var i=e.filter((function(e){return e.type===n.type&&((!0!==e.persistentLicense&&!0!==e.persistentStateRequired||"required"===r.persistentState)&&(!0!==e.distinctiveIdentifierRequired||"required"===r.distinctiveIdentifier))}))[0];return null!=i?{keySystemOptions:i,keySystemAccess:t}:null}function U(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=m.Z.getCurrent().EME_DEFAULT_WIDEVINE_ROBUSTNESSES,o=null!=t.videoRobustnesses?t.videoRobustnesses:"widevine"===e?a:[],s=null!=t.audioRobustnesses?t.audioRobustnesses:"widevine"===e?a:[];return 0===o.length&&o.push(void 0),0===s.length&&s.push(void 0),[{initDataTypes:["cenc"],videoCapabilities:(0,L.Z)(s,(function(e){return['video/mp4;codecs="avc1.4d401e"','video/mp4;codecs="avc1.42e01e"','video/webm;codecs="vp8"'].map((function(t){return void 0!==e?{contentType:t,robustness:e}:{contentType:t}}))})),audioCapabilities:(0,L.Z)(s,(function(e){return['audio/mp4;codecs="mp4a.40.2"',"audio/webm;codecs=opus"].map((function(t){return void 0!==e?{contentType:t,robustness:e}:{contentType:t}}))})),distinctiveIdentifier:i,persistentState:r,sessionTypes:n}]}function F(e,t,n){s.Z.info("DRM: Searching for compatible MediaKeySystemAccess");var i=k.Z.getState(e);if(null!=i){var a=B(t,i.mediaKeySystemAccess,i.keySystemOptions);if(null!==a)return s.Z.info("DRM: Found cached compatible keySystem"),Promise.resolve({type:"reuse-media-key-system-access",value:{mediaKeySystemAccess:a.keySystemAccess,options:a.keySystemOptions}})}var u=t.reduce((function(e,t){var n,r=m.Z.getCurrent().EME_KEY_SYSTEMS[t.type];null!=r?n=r.map((function(e){return{keyName:t.type,keyType:e,keySystemOptions:t}})):n=[{keyName:function(e){for(var t=m.Z.getCurrent().EME_KEY_SYSTEMS,n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];if((0,b.Z)(t[i],e))return i}}(t.type),keyType:t.type,keySystemOptions:t}];return e.concat(n)}),[]);return l(0);function l(e){return c.apply(this,arguments)}function c(){return(c=(0,r.Z)(o().mark((function e(t){var r,i,a,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t>=u.length)){e.next=2;break}throw new g.Z("INCOMPATIBLE_KEYSYSTEMS","No key system compatible with your wanted configuration has been found in the current browser.");case 2:if(null!=w.N){e.next=4;break}throw new Error("requestMediaKeySystemAccess is not implemented in your browser.");case 4:return r=u[t],i=r.keyName,a=r.keyType,c=r.keySystemOptions,d=U(i,c),s.Z.debug("DRM: Request keysystem access "+a+","+(t+1)+" of "+u.length,d),e.prev=7,e.next=10,(0,w.N)(a,d);case 10:return f=e.sent,s.Z.info("DRM: Found compatible keysystem",a,d),e.abrupt("return",{type:"create-media-key-system-access",value:{options:c,mediaKeySystemAccess:f}});case 15:if(e.prev=15,e.t0=e.catch(7),s.Z.debug("DRM: Rejected access to keysystem",a,d),null===n.cancellationError){e.next=20;break}throw n.cancellationError;case 20:return e.abrupt("return",l(t+1));case 21:case"end":return e.stop()}}),e,null,[[7,15]])})))).apply(this,arguments)}}var z=n(2297);function V(e,t,n){var r;s.Z.debug("Compat: Calling generateRequest on the MediaKeySession");try{r=function(e){s.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;i<e.length;){if(e.length<i+8||(0,c.pX)(e,i+4)!==f)throw s.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var a=(0,c.pX)(new Uint8Array(e),i);if(i+a>e.length)throw s.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 u=(0,z.Xj)(o),l=null===u?void 0:o[u[1]];s.Z.info("Compat: CENC PSSH found with version",l),void 0===l?s.Z.warn("Compat: could not read version of CENC PSSH"):t===(1===l)?n=(0,c.zo)(n,o):1===l?(s.Z.warn("Compat: cenc version 1 encountered, removing every other cenc pssh box."),n=o,t=!0):s.Z.warn("Compat: filtering out cenc pssh box with wrong version",l)}else r=(0,c.zo)(r,o);i+=a}if(i!==e.length)throw s.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");return(0,c.zo)(r,n)}(n)}catch(e){r=n}var i=null!=t?t:"";return e.generateRequest(i,r).catch((function(t){if(""!==i||!(t instanceof TypeError))throw t;return s.Z.warn('Compat: error while calling `generateRequest` with an empty initialization data type. Retrying with a default "cenc" value.',t),e.generateRequest("cenc",r)}))}function K(e,t){return G.apply(this,arguments)}function G(){return(G=(0,r.Z)(o().mark((function e(t,n){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.Z.info("Compat/DRM: Load persisted session",n),e.next=3,t.load(n);case 3:if((r=e.sent)&&!(t.keyStatuses.size>0)){e.next=6;break}return e.abrupt("return",r);case 6:return e.abrupt("return",new Promise((function(e){t.addEventListener("keystatuseschange",i);var n=setTimeout(i,100);function i(){clearTimeout(n),t.removeEventListener("keystatuseschange",i),e(r)}})));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var H=n(7864);function W(e){var t=new S.ZP;return Promise.race([e.close().then((function(){t.cancel()})),e.closed.then((function(){t.cancel()})),function(){return n.apply(this,arguments)}()]);function n(){return(n=(0,r.Z)(o().mark((function e(){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,H.Z)(1e3,t.signal);case 3:return e.next=5,i();case 5:e.next=13;break;case 7:if(e.prev=7,e.t0=e.catch(0),!(e.t0 instanceof S.FU)){e.next=11;break}return e.abrupt("return");case 11:n=e.t0 instanceof Error?e.t0.message:"Unknown error made it impossible to close the session",s.Z.error("DRM: "+n);case 13:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function i(){return a.apply(this,arguments)}function a(){return(a=(0,r.Z)(o().mark((function n(){return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,e.update(new Uint8Array(1));case 3:n.next=13;break;case 5:if(n.prev=5,n.t0=n.catch(0),!t.isUsed){n.next=9;break}return n.abrupt("return");case 9:if(!(n.t0 instanceof Error&&"The session is already closed."===n.t0.message)){n.next=11;break}return n.abrupt("return");case 11:return n.next=13,(0,H.Z)(1e3,t.signal);case 13:if(!t.isUsed){n.next=15;break}return n.abrupt("return");case 15:throw new Error("Compat: Couldn't know if session is closed");case 16:case"end":return n.stop()}}),n,null,[[0,5]])})))).apply(this,arguments)}}function j(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Y(e,t){return e===t||(0,l.Z)(e,t)}function $(e,t){return t.some((function(t){return Y(t,e)}))}function X(e,t){for(var n,r=function(){var e=n.value;if(!t.some((function(t){return Y(t,e)})))return{v:!1}},i=j(e);!(n=i()).done;){var a=r();if("object"==typeof a)return a.v}return!0}function Q(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return J(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 J(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ee=function(){function e(e){this._initializationData=e,this._keyIds=null}var t=e.prototype;return t.associateKeyIds=function(e){null===this._keyIds&&(this._keyIds=[]);for(var t=0,n=Array.from(e);t<n.length;t++){var r=n[t];this.isAssociatedWithKeyId(r)||this._keyIds.push(r)}},t.isAssociatedWithKeyId=function(e){if(null===this._keyIds)return!1;for(var t,n=Q(this._keyIds);!(t=n()).done;){if(Y(t.value,e))return!0}return!1},t.getAssociatedKeyIds=function(){return null===this._keyIds?[]:this._keyIds},t.isCompatibleWith=function(e){var t=e.keyIds;if(void 0!==t){if(null!==this._keyIds&&X(t,this._keyIds))return!0;if(void 0!==this._initializationData.keyIds)return X(t,this._initializationData.keyIds)}return this._checkInitializationDataCompatibility(e)},t._checkInitializationDataCompatibility=function(e){return void 0!==e.keyIds&&void 0!==this._initializationData.keyIds?X(e.keyIds,this._initializationData.keyIds):this._initializationData.type===e.type&&this._initializationData.values.isCompatibleWith(e.values)},e}();function te(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ne(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var re=function(){function e(e){this._mediaKeys=e,this._storage=[]}var t=e.prototype;return t.createSession=function(e,t){var n=this,r=new ee(e),i=this._mediaKeys.createSession(t),a={mediaKeySession:i,sessionType:t,keySessionRecord:r,isGeneratingRequest:!1,isLoadingPersistentSession:!1,closingStatus:{type:"none"}};return(0,E.Z)(i.closed)||i.closed.then((function(){var e=n.getIndex(r);e>=0&&n._storage[e].mediaKeySession===i&&n._storage.splice(e,1)})).catch((function(e){s.Z.warn("DRM-LSS: MediaKeySession.closed rejected: "+e)})),s.Z.debug("DRM-LSS: Add MediaKeySession",a.sessionType),this._storage.push(Object.assign({},a)),a},t.reuse=function(e){for(var t=this._storage.length-1;t>=0;t--){var n=this._storage[t];if(n.keySessionRecord.isCompatibleWith(e))return this._storage.splice(t,1),this._storage.push(n),Object.assign({},n)}return null},t.getEntryForSession=function(e){for(var t=this._storage.length-1;t>=0;t--){var n=this._storage[t];if(n.mediaKeySession===e)return Object.assign({},n)}return null},t.generateLicenseRequest=function(){var e=(0,r.Z)(o().mark((function e(t,n,r){var i,a,u,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=te(this._storage);case 1:if((u=a()).done){e.next=8;break}if((l=u.value).mediaKeySession!==t){e.next=6;break}return i=l,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==i){e.next=11;break}return s.Z.error("DRM-LSS: generateRequest error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",V(t,n,r));case 11:if(i.isGeneratingRequest=!0,"none"===i.closingStatus.type){e.next=14;break}throw new Error("The `MediaKeySession` is being closed.");case 14:return e.prev=14,e.next=17,V(t,n,r);case 17:e.next=26;break;case 19:if(e.prev=19,e.t0=e.catch(14),void 0!==i){e.next=23;break}throw e.t0;case 23:throw i.isGeneratingRequest=!1,"awaiting"===i.closingStatus.type&&i.closingStatus.start(),e.t0;case 26:if(void 0!==i){e.next=28;break}return e.abrupt("return",void 0);case 28:i.isGeneratingRequest=!1,"awaiting"===i.closingStatus.type&&i.closingStatus.start();case 30:case"end":return e.stop()}}),e,this,[[14,19]])})));return function(t,n,r){return e.apply(this,arguments)}}(),t.loadPersistentSession=function(){var e=(0,r.Z)(o().mark((function e(t,n){var r,i,a,u,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=te(this._storage);case 1:if((a=i()).done){e.next=8;break}if((u=a.value).mediaKeySession!==t){e.next=6;break}return r=u,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==r){e.next=11;break}return s.Z.error("DRM-LSS: loadPersistentSession error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",K(t,n));case 11:if(r.isLoadingPersistentSession=!0,"none"===r.closingStatus.type){e.next=14;break}throw new Error("The `MediaKeySession` is being closed.");case 14:return e.prev=14,e.next=17,K(t,n);case 17:l=e.sent,e.next=27;break;case 20:if(e.prev=20,e.t0=e.catch(14),void 0!==r){e.next=24;break}throw e.t0;case 24:throw r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.t0;case 27:if(void 0!==r){e.next=29;break}return e.abrupt("return",l);case 29:return r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.abrupt("return",l);case 32:case"end":return e.stop()}}),e,this,[[14,20]])})));return function(t,n){return e.apply(this,arguments)}}(),t.closeSession=function(){var e=(0,r.Z)(o().mark((function e(t){var n,r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=te(this._storage);case 1:if((i=r()).done){e.next=8;break}if((a=i.value).mediaKeySession!==t){e.next=6;break}return n=a,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==n){e.next=11;break}return s.Z.warn("DRM-LSS: No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",Promise.resolve(!1));case 11:return e.abrupt("return",this._closeEntry(n));case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.getLength=function(){return this._storage.length},t.getAll=function(){return this._storage},t.closeAllSessions=function(){var e=(0,r.Z)(o().mark((function e(){var t,n,r=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._storage,s.Z.debug("DRM-LSS: Closing all current MediaKeySessions",t.length),this._storage=[],n=t.map((function(e){return r._closeEntry(e)})),e.next=6,Promise.all(n);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.getIndex=function(e){for(var t=0;t<this._storage.length;t++){if(this._storage[t].keySessionRecord===e)return t}return-1},t._closeEntry=function(){var e=(0,r.Z)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.mediaKeySession,e.abrupt("return",new Promise((function(e,r){function i(){void 0!==t&&(t.closingStatus={type:"pending"}),ie(n).then((function(){void 0!==t&&(t.closingStatus={type:"done"}),e(!0)})).catch((function(e){void 0!==t&&(t.closingStatus={type:"failed"}),r(e)}))}void 0!==t&&(t.isLoadingPersistentSession||t.isGeneratingRequest)?t.closingStatus={type:"awaiting",start:i}:i()})));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e}();function ie(e){return ae.apply(this,arguments)}function ae(){return(ae=(0,r.Z)(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.Z.debug("DRM: Trying to close a MediaKeySession",t.sessionId),e.prev=1,e.next=4,W(t);case 4:return s.Z.debug("DRM: Succeeded to close MediaKeySession"),e.abrupt("return");case 8:return e.prev=8,e.t0=e.catch(1),s.Z.error("DRM: Could not close MediaKeySession: "+(e.t0 instanceof Error?e.t0.toString():"Unknown error")),e.abrupt("return");case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}var oe=n(811),se=n(9689),ue=n(2870),le=n(6923),ce=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,se.J)(this.initData)},e.decode=function(e){return(0,se.K)(e)},e}();function de(e,t){var n,r;return null!==(r=null!==(n=fe(e,t))&&void 0!==n?n:fe(t,e))&&void 0!==r&&r}function fe(e,t){if(0===e.length)return!1;if(t.length<e.length)return null;for(var n=e[0],r=0,i=0;i<t.length;i++){var a=t[i];if(a.systemId===n.systemId){if(a.hash!==n.hash)return!1;var o=n.data instanceof Uint8Array?n.data:"string"==typeof n.data?ce.decode(n.data):n.data.initData,s=a.data instanceof Uint8Array?a.data:"string"==typeof a.data?ce.decode(a.data):a.data.initData;if(!(0,l.Z)(o,s))return!1;if(t.length-i<e.length)return null;for(r=1;r<e.length;r++){var u=e[r];for(i+=1;i<t.length;i++){var c=t[i];if(u.systemId===c.systemId){if(u.hash!==c.hash)return!1;var d=u.data instanceof Uint8Array?u.data:"string"==typeof u.data?ce.decode(u.data):u.data.initData,f=c.data instanceof Uint8Array?c.data:"string"==typeof c.data?ce.decode(c.data):c.data.initData;if(!(0,l.Z)(d,f))return!1;break}}if(r===t.length)return null}return!0}}return null}function pe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ve(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ve(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var he=function(){function e(e){!function(e){(0,oe.u)(e,{save:"function",load:"function"},"licenseStorage")}(e),this._entries=[],this._storage=e;try{var t=this._storage.load();Array.isArray(t)||(t=[]),this._entries=t}catch(e){s.Z.warn("DRM-PSS: Could not get entries from license storage",e),this.dispose()}}var t=e.prototype;return t.getLength=function(){return this._entries.length},t.getAll=function(){return this._entries},t.get=function(e){var t=this._getIndex(e);return-1===t?null:this._entries[t]},t.getAndReuse=function(e){var t=this._getIndex(e);if(-1===t)return null;var n=this._entries.splice(t,1)[0];return this._entries.push(n),n},t.add=function(e,t,n){if(!(0,E.Z)(n)&&(0,le.Z)(n.sessionId)){var r=n.sessionId,i=this.get(e);if(null===i||i.sessionId!==r){null!==i&&this.delete(i.sessionId),s.Z.info("DRM-PSS: Add new session",r);var a=e.values.getFormattedValues().map((function(e){var t=e.systemId,n=e.data;return{systemId:t,hash:e.hash,data:new ce(n)}}));void 0===t?this._entries.push({version:3,sessionId:r,values:a,initDataType:e.type}):this._entries.push({version:4,sessionId:r,keyIds:t.map((function(e){return new ce(e)})),values:a,initDataType:e.type}),this._save()}}else s.Z.warn("DRM-PSS: Invalid Persisten Session given.")},t.delete=function(e){for(var t=-1,n=0;n<this._entries.length;n++){if(this._entries[n].sessionId===e){t=n;break}}if(-1!==t){var r=this._entries[t];s.Z.warn("DRM-PSS: Delete session from store",r.sessionId),this._entries.splice(t,1),this._save()}else s.Z.warn("DRM-PSS: initData to delete not found.")},t.deleteOldSessions=function(e){s.Z.info("DRM-PSS: Deleting last "+e+" sessions."),e<=0||(e<=this._entries.length?this._entries.splice(0,e):(s.Z.warn("DRM-PSS: Asked to remove more information that it contains",e,this._entries.length),this._entries=[]),this._save())},t.dispose=function(){this._entries=[],this._save()},t._getIndex=function(e){var t=this,n=null;function r(){if(null===n){var t=e.values.constructRequestData();n={initData:t,initDataHash:(0,ue.Z)(t)}}return n}for(var i=function(n){var i=t._entries[n];if(i.initDataType===e.type)switch(i.version){case 4:if(void 0!==e.keyIds){if(e.keyIds.every((function(e){for(var t,n=(0,se.J)(e),r=pe(i.keyIds);!(t=r()).done;){var a=t.value;if("string"==typeof a){if(n===a)return!0}else if(Y(a.initData,e))return!0}return!1})))return{v:n}}else if(de(e.values.getFormattedValues(),i.values))return{v:n};break;case 3:if(de(e.values.getFormattedValues(),i.values))return{v:n};break;case 2:var a=r(),o=a.initData,u=a.initDataHash;if(i.initDataHash===u)try{var c="string"==typeof i.initData?ce.decode(i.initData):i.initData.initData;if((0,l.Z)(c,o))return{v:n}}catch(e){s.Z.warn("DRM-PSS: Could not decode initialization data.",e)}break;case 1:var d=r(),f=d.initData,p=d.initDataHash;if(i.initDataHash===p){if(void 0===i.initData.length)return{v:n};if((0,l.Z)(i.initData,f))return{v:n}}break;default:var v=r().initDataHash;if(i.initData===v)return{v:n}}},a=0;a<this._entries.length;a++){var o=i(a);if("object"==typeof o)return o.v}return-1},t._save=function(){try{this._storage.save(this._entries)}catch(e){s.Z.warn("DRM-PSS: Could not save licenses in localStorage")}},e}();var me=new WeakMap,ge=function(e){me.set(e,null)},ye=function(e,t){var n=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer),r=(0,ue.Z)(n);me.set(e,{hash:r,serverCertificate:n})},_e=function(e){var t=me.get(e);return void 0!==t&&(null!==t||void 0)},be=function(e,t){var n=me.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,ue.Z)(a)!==r||i.length!==a.length)return!1;for(var o=0;o<i.length;o++)if(i[o]!==a[o])return!1;return!0};function Te(e){if(!0!==e.persistentLicense)return null;var t=e.licenseStorage;if(null==t)throw new g.Z("INVALID_KEY_SYSTEM","No license storage found for persistent license.");return s.Z.debug("DRM: Set the given license storage"),new he(t)}function Ee(e,t,n){return Se.apply(this,arguments)}function Se(){return(Se=(0,r.Z)(o().mark((function e(t,n,r){var i,a,u,l,c,d,f,p,v,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F(t,n,r);case 2:if(i=e.sent,null===r.cancellationError){e.next=5;break}throw r.cancellationError;case 5:if(a=i.value,u=a.options,l=a.mediaKeySystemAccess,c=k.Z.getState(t),d=Te(u),null===c||"reuse-media-key-system-access"!==i.type){e.next=12;break}if(f=c.mediaKeys,p=c.loadedSessionsStore,!1!==_e(f)&&((0,E.Z)(u.serverCertificate)||!be(f,u.serverCertificate))){e.next=12;break}return e.abrupt("return",{mediaKeys:f,mediaKeySystemAccess:l,stores:{loadedSessionsStore:p,persistentSessionsStore:d},options:u});case 12:return e.next=14,we(l);case 14:return v=e.sent,s.Z.info("DRM: MediaKeys created with success"),h=new re(v),e.abrupt("return",{mediaKeys:v,mediaKeySystemAccess:l,stores:{loadedSessionsStore:h,persistentSessionsStore:d},options:u});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function we(e){return ke.apply(this,arguments)}function ke(){return(ke=(0,r.Z)(o().mark((function e(t){var n,r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.Z.info("DRM: Calling createMediaKeys on the MediaKeySystemAccess"),e.prev=1,e.next=4,t.createMediaKeys();case 4:return n=e.sent,e.abrupt("return",n);case 8:throw e.prev=8,e.t0=e.catch(1),r=e.t0 instanceof Error?e.t0.message:"Unknown error when creating MediaKeys.",new g.Z("CREATE_MEDIA_KEYS_ERROR",r);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}function Ae(){return(Ae=(0,r.Z)(o().mark((function e(t,n,r){var i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ee(t,n,r);case 2:return i=e.sent,a=i.mediaKeys,null!==t.mediaKeys&&void 0!==t.mediaKeys&&a!==t.mediaKeys&&(s.Z.debug("DRM: Disabling old MediaKeys"),A(t)),e.abrupt("return",i);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var xe=n(7326),Ie=n(2146),Ze=n(6716),Re=n(9127),Me=n(7877),Ce=n(9917),Pe=n(7991),De=n(1454),Ne=n(6798),Oe=n(7878),Le=n(1819),Be=n(2566),Ue=n(7845),Fe=(0,Le.d)((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function ze(e){throw new Fe(e)}var Ve=n(278),Ke=n(9878),Ge=n(3071),He=n(8474);var We=n(1545),je=n(2817),qe=n(3505),Ye=n(6362),$e=n(2006),Xe=n(533),Qe=n(8117),Je=n(6625),et=n(2572);var tt=n(5561);var nt="expired",rt="internal-error",it="output-restricted";function at(e,t,n){var r=[],i=[],a=[],o=t.fallbackOn,s=void 0===o?{}:o,u=t.throwOnLicenseExpiration;return e.keyStatuses.forEach((function(e,t){var o="string"==typeof e?[e,t]:[t,e],l=o[0],c=function(e,t){return-1!==e.indexOf("playready")&&(O.YM||O.kD)?(0,d.wO)(t):t}(n,new Uint8Array(o[1]));switch(l){case nt:var f=new g.Z("KEY_STATUS_CHANGE_ERROR","A decryption key expired ("+(0,d.ci)(c)+")");if(!1!==u)throw f;r.push({type:"warning",value:f}),a.push(c);break;case rt:var p=new g.Z("KEY_STATUS_CHANGE_ERROR",'A "'+l+'" status has been encountered ('+(0,d.ci)(c)+")");if(!0!==s.keyInternalError)throw p;r.push({type:"warning",value:p}),i.push(c);break;case it:var v=new g.Z("KEY_STATUS_CHANGE_ERROR",'A "'+l+'" status has been encountered ('+(0,d.ci)(c)+")");if(!0!==s.keyOutputRestricted)throw v;r.push({type:"warning",value:v}),i.push(c);break;default:a.push(c)}})),{warnings:r,blacklistedKeyIDs:i,whitelistedKeyIds:a}}var ot=h.Xe,st=h.GJ,ut=h.eX,lt=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,xe.Z)(r),t.prototype),r.sessionError=n,r}return(0,i.Z)(t,e),t}((0,Ie.Z)(Error));function ct(e,t,n){s.Z.info("DRM: Binding session events",e.sessionId);var r,i,a=new Ze.x,o=t.getLicenseConfig,u=void 0===o?{}:o,l=ot(e).pipe((0,Re.U)((function(e){throw new g.Z("KEY_ERROR",e.type)}))),c=ut(e).pipe((0,Me.z)((function(r){return function(e,t,n,r){s.Z.info("DRM: keystatuseschange event received",e.sessionId);var i=(0,Ce.P)((function(){return(0,tt.Z)((function(){return"function"!=typeof t.onKeyStatusesChange?We.E:(0,Qe.Z)(t.onKeyStatusesChange(r,e))}),void 0)})).pipe((0,Re.U)((function(t){return{type:"key-status-change-handled",value:{session:e,license:t}}})),(0,Ke.K)((function(e){var t=new g.Z("KEY_STATUS_CHANGE_ERROR","Unknown `onKeyStatusesChange` error");throw!(0,E.Z)(e)&&(0,le.Z)(e.message)&&(t.message=e.message),t})));return(0,Ge.T)(dt(e,t,n),i)}(e,t,n,r)}))),d=st(e).pipe((0,Me.z)((function(n){var r=new Uint8Array(n.message),i=(0,le.Z)(n.messageType)?n.messageType:"license-request";s.Z.info("DRM: Received message event, type "+i,e.sessionId,n);var o,l,c,d,f,p,v,h,m=(0,Ce.P)((function(){var e=t.getLicense(r,i),n=(0,E.Z)(u.timeout)?1e4:u.timeout;return(0,Qe.Z)(e).pipe(n>=0?function(e,t){var n=(0,De.q)(e)?{first:e}:"number"==typeof e?{each:e}:e,r=n.first,i=n.each,a=n.with,o=void 0===a?ze:a,s=n.scheduler,u=void 0===s?null!=t?t:Pe.z:s,l=n.meta,c=void 0===l?null:l;if(null==r&&null==i)throw new TypeError("No timeout provided.");return(0,Ne.e)((function(e,t){var n,a,s=null,l=0,d=function(e){a=(0,Ue.f)(t,u,(function(){try{n.unsubscribe(),(0,Oe.Xf)(o({meta:c,lastValue:s,seen:l})).subscribe(t)}catch(e){t.error(e)}}),e)};n=e.subscribe(new Be.Q(t,(function(e){null==a||a.unsubscribe(),l++,t.next(s=e),i>0&&d(i)}),void 0,void 0,(function(){(null==a?void 0:a.closed)||null==a||a.unsubscribe(),s=null}))),d(null!=r?"number"==typeof r?r:+r-u.now():i)}))}(n):Ve.y)})),g=function(e,t){return{totalRetry:null!=t?t:2,baseDelay:200,maxDelay:3e3,shouldRetry:function(e){return e instanceof Fe||(0,E.Z)(e)||!0!==e.noRetry},onRetry:function(t){return e.next({type:"warning",value:ft(t)})}}}(a,u.retry);return(o=m,l=g,c=l.baseDelay,d=l.maxDelay,f=l.totalRetry,p=l.shouldRetry,v=l.onRetry,h=0,o.pipe((0,Ke.K)((function(e,t){if(!(0,E.Z)(p)&&!p(e)||h++>=f)throw e;"function"==typeof v&&v(e,h);var n=Math.min(c*Math.pow(2,h-1),d),r=(0,et.Z)(n);return(0,Je.H)(r).pipe((0,Me.z)((function(){return t})))})))).pipe((0,Re.U)((function(t){return{type:"key-message-handled",value:{session:e,license:t}}})),(0,Ke.K)((function(e){var t=ft(e);if(!(0,E.Z)(e)&&!0===e.fallbackOnLastTry)throw s.Z.warn("DRM: Last `getLicense` attempt failed. Blacklisting the current session."),new lt(t);throw t})))}))),f=(0,Ge.T)(d,c).pipe((r=function(t){switch(t.type){case"key-message-handled":case"key-status-change-handled":return(0,E.Z)(t.value.license)?(s.Z.info("DRM: No message given, skipping session.update"),We.E):function(e,t){return s.Z.info("DRM: Updating MediaKeySession with message"),(0,Qe.Z)(e.update(t)).pipe((0,Ke.K)((function(e){var t=e instanceof Error?e.toString():"`session.update` failed";throw new g.Z("KEY_UPDATE_ERROR",t)})),(0,$e.b)((function(){s.Z.info("DRM: MediaKeySession update succeeded.")})),(0,Xe.l)())}(e,t.value.license);default:return(0,je.of)(t)}},(0,He.m)(i)?(0,Me.z)(r,i,1):(0,Me.z)(r,1))),p=(0,Ge.T)(dt(e,t,n),f,l,a);return(0,E.Z)(e.closed)?p:p.pipe((0,qe.R)((0,Qe.Z)(e.closed)))}function dt(e,t,n){return(0,Ce.P)((function(){if(0===e.keyStatuses.size)return We.E;var r=at(e,t,n),i=r.warnings,a=r.blacklistedKeyIDs,o=r.whitelistedKeyIds,s=i.length>0?je.of.apply(void 0,i):We.E,u=(0,je.of)({type:"keys-update",value:{whitelistedKeyIds:o,blacklistedKeyIDs:a}});return(0,Ye.z)(s,u)}))}function ft(e){if(e instanceof Fe)return new g.Z("KEY_LOAD_TIMEOUT","The license server took too much time to respond.");var t=new g.Z("KEY_LOAD_ERROR","An error occured when calling `getLicense`.");return!(0,E.Z)(e)&&(0,le.Z)(e.message)&&(t.message=e.message),t}var pt=n(9822);function vt(e,t){return ht.apply(this,arguments)}function ht(){return(ht=(0,r.Z)(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.setServerCertificate(n);case 3:return r=e.sent,e.abrupt("return",r);case 7:throw e.prev=7,e.t0=e.catch(0),s.Z.warn("DRM: mediaKeys.setServerCertificate returned an error",e.t0),i=e.t0 instanceof Error?e.t0.toString():"`setServerCertificate` error",new g.Z("LICENSE_SERVER_CERTIFICATE_ERROR",i);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function mt(e,t){return gt.apply(this,arguments)}function gt(){return(gt=(0,r.Z)(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!0!==_e(t)){e.next=3;break}return s.Z.info("DRM: The MediaKeys already has a server certificate, skipping..."),e.abrupt("return",{type:"already-has-one"});case 3:if("function"==typeof t.setServerCertificate){e.next=6;break}return s.Z.warn("DRM: Could not set the server certificate. mediaKeys.setServerCertificate is not a function"),e.abrupt("return",{type:"method-not-implemented"});case 6:return s.Z.info("DRM: Setting server certificate on the MediaKeys"),ge(t),e.prev=8,e.next=11,vt(t,n);case 11:return r=e.sent,ye(t,n),e.abrupt("return",{type:"success",value:r});case 16:return e.prev=16,e.t0=e.catch(8),i=(0,pt.Z)(e.t0)?e.t0:new g.Z("LICENSE_SERVER_CERTIFICATE_ERROR","Unknown error when setting the server certificate."),e.abrupt("return",{type:"error",value:i});case 20:case"end":return e.stop()}}),e,null,[[8,16]])})))).apply(this,arguments)}function yt(e,t){if(!(isNaN(t)||t<0||t>=e.getLength())){var n=e.getLength(),r=n-t;s.Z.info("DRM: Too many stored persistent sessions, removing some.",n,r),e.deleteOldSessions(r)}}var _t=n(9252);var bt=function(){function e(e){this._innerValues=e,this._lazyFormattedValues=null}var t=e.prototype;return t.constructRequestData=function(){return c.zo.apply(void 0,this._innerValues.map((function(e){return e.data})))},t.isCompatibleWith=function(t){var n=t instanceof e?t.getFormattedValues():t;return de(this.getFormattedValues(),n)},t.getFormattedValues=function(){return null===this._lazyFormattedValues&&(this._lazyFormattedValues=this._innerValues.slice().sort((function(e,t){return e.systemId===t.systemId?0:void 0===e.systemId?1:void 0===t.systemId||e.systemId<t.systemId?-1:1})).map((function(e){var t=e.systemId,n=e.data;return{systemId:t,data:n,hash:(0,ue.Z)(n)}}))),this._lazyFormattedValues},e}();function Tt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Et(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Et(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 Et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var St,wt=h.Oh,kt=function(e){function t(t,n){var r;r=e.call(this)||this,s.Z.debug("DRM: Starting ContentDecryptor logic.");var i=new S.ZP;r._currentSessions=[],r._canceller=i,r._wasAttachCalled=!1,r._initDataQueue=[],r._stateData={state:St.Initializing,isMediaKeysAttached:!1,isInitDataQueueLocked:!0,data:null},r.error=null;var a=wt(t).subscribe((function(e){s.Z.debug("DRM: Encrypted event received from media element.");var t=v(e);null!==t&&r.onInitializationData(t)}));return i.signal.register((function(){a.unsubscribe()})),function(e,t,n){return Ae.apply(this,arguments)}(t,n,i.signal).then((function(e){var n,i,a=e.options,o=e.mediaKeySystemAccess;((0,E.Z)(a.licenseStorage)||!0===a.licenseStorage.disableRetroCompatibility)&&(i=o.keySystem,n=(0,_t.Z)(i,"com.microsoft.playready")||"com.chromecast.playready"===i||"com.youtube.playready"===i?"9a04f07998404286ab92e65be0885f95":"com.widevine.alpha"===i?"edef8ba979d64acea3c827dcd51d21ed":(0,_t.Z)(i,"com.apple.fps")?"94ce86fb07ff4f43adb893d2fa968ca2":(0,_t.Z)(i,"com.nagra.")?"adb41c242dbf4a6d958b4457c0d27b95":void 0),r.systemId=n,r._stateData.state===St.Initializing&&(r._stateData={state:St.WaitingForAttachment,isInitDataQueueLocked:!0,isMediaKeysAttached:!1,data:{mediaKeysInfo:e,mediaElement:t}},r.trigger("stateChange",r._stateData.state))})).catch((function(e){r._onFatalError(e)})),r}(0,i.Z)(t,e);var n=t.prototype;return n.getState=function(){return this._stateData.state},n.attach=function(){var e=this;if(this._stateData.state!==St.WaitingForAttachment)throw new Error("`attach` should only be called when in the WaitingForAttachment state");if(this._wasAttachCalled)s.Z.warn("DRM: ContentDecryptor's `attach` method called more than once.");else{this._wasAttachCalled=!0;var t=this._stateData.data,n=t.mediaElement,i=t.mediaKeysInfo,a=i.options,u=i.mediaKeys,l=i.mediaKeySystemAccess,c={loadedSessionsStore:i.stores.loadedSessionsStore,mediaKeySystemAccess:l,mediaKeys:u,keySystemOptions:a};!0===a.disableMediaKeysAttachmentLock&&(this._stateData={state:St.ReadyForContent,isInitDataQueueLocked:!0,isMediaKeysAttached:!1,data:null},this.trigger("stateChange",this._stateData.state),this._isStopped())||(s.Z.debug("DRM: Attaching current MediaKeys"),function(e,t,n){return x.apply(this,arguments)}(n,c,this._canceller.signal).then((0,r.Z)(o().mark((function t(){var n,r,s;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=a.serverCertificate,(0,E.Z)(n)){t.next=6;break}return t.next=4,mt(u,n);case 4:"error"===(r=t.sent).type&&e.trigger("warning",r.value);case 6:if(!e._isStopped()){t.next=8;break}return t.abrupt("return");case 8:s=e._stateData.state,e._stateData={state:St.ReadyForContent,isMediaKeysAttached:!0,isInitDataQueueLocked:!1,data:{mediaKeysData:i}},s!==St.ReadyForContent&&e.trigger("stateChange",St.ReadyForContent),e._isStopped()||e._processCurrentInitDataQueue();case 12:case"end":return t.stop()}}),t)})))).catch((function(t){e._onFatalError(t)})))}},n.dispose=function(){this.removeEventListener(),this._stateData={state:St.Disposed,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("stateChange",this._stateData.state)},n.onInitializationData=function(e){var t=this;if(!1===this._stateData.isInitDataQueueLocked){var n=this._stateData.data.mediaKeysData,r=Object.assign(Object.assign({},e),{values:new bt(e.values)});this._processInitializationData(r,n).catch((function(e){t._onFatalError(e)}))}else{if(this._isStopped())throw new Error("ContentDecryptor either disposed or stopped.");this._initDataQueue.push(e)}},n._processInitializationData=function(){var e=(0,r.Z)(o().mark((function e(t,n){var r,i,a,u,l,c,f,p,v,h,y,b,T,E,S,w,k,A,x,I,Z,R,M,C,P,N,O,L,B,U,F,z,V,K,G=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.mediaKeySystemAccess,i=n.stores,a=n.options,!this._tryToUseAlreadyCreatedSession(t,n)&&!this._isStopped()){e.next=3;break}return e.abrupt("return");case 3:if("content"!==a.singleLicensePer){e.next=15;break}if(void 0===(u=(0,_.Z)(this._currentSessions,(function(e){return"created-session"===e.source})))){e.next=13;break}if(void 0!==(l=t.keyIds)){e.next=10;break}return void 0===t.content?s.Z.warn("DRM: Unable to fallback from a non-decipherable quality."):It(t.content.manifest,t),e.abrupt("return");case 10:return u.record.associateKeyIds(l),void 0!==t.content&&("DEBUG"===s.Z.getLevel()&&(c=l.reduce((function(e,t){return e+", "+(0,d.ci)(t)}),""),s.Z.debug("DRM: Blacklisting new key ids",c)),xt(t.content.manifest,[],l)),e.abrupt("return");case 13:e.next=37;break;case 15:if("periods"!==a.singleLicensePer||void 0===t.content){e.next=37;break}f=t.content.period,p=this._currentSessions.filter((function(e){return"created-session"===e.source})),Mt(v=new Set,f),h=Tt(p);case 21:if((y=h()).done){e.next=37;break}b=y.value,T=Array.from(v),E=0,S=T;case 25:if(!(E<S.length)){e.next=35;break}if(w=S[E],!b.record.isAssociatedWithKeyId(w)){e.next=32;break}for(b.record.associateKeyIds(v.values()),k=Tt(T);!(A=k()).done;)$(x=A.value,b.keyStatuses.whitelisted)||$(x,b.keyStatuses.blacklisted)||b.keyStatuses.blacklisted.push(x);return xt(t.content.manifest,b.keyStatuses.whitelisted,b.keyStatuses.blacklisted),e.abrupt("return");case 32:E++,e.next=25;break;case 35:e.next=21;break;case 37:return this._lockInitDataQueue(),!0!==a.persistentLicense?I="temporary":At(r)?I="persistent-license":(s.Z.warn('DRM: Cannot create "persistent-license" session: not supported'),I="temporary"),Z=m.Z.getCurrent(),R=Z.EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS,M=Z.EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION,C="number"==typeof a.maxSessionCacheSize?a.maxSessionCacheSize:R,e.next=43,D(t,i,I,C,this._canceller.signal);case 43:if(P=e.sent,!this._isStopped()){e.next=46;break}return e.abrupt("return");case 46:if(N={record:P.value.keySessionRecord,source:P.type,keyStatuses:{whitelisted:[],blacklisted:[]},blacklistedSessionError:null},this._currentSessions.push(N),O=P.value,L=O.mediaKeySession,B=O.sessionType,U=!1,F=ct(L,a,r.keySystem).subscribe({next:function(e){switch(e.type){case"warning":return void G.trigger("warning",e.value)}var n;if(n="created-session"===N.source?Zt(t,a.singleLicensePer,e.value.whitelistedKeyIds,e.value.blacklistedKeyIDs):{whitelisted:e.value.whitelistedKeyIds,blacklisted:e.value.blacklistedKeyIDs},N.record.associateKeyIds(n.whitelisted),N.record.associateKeyIds(n.blacklisted),N.keyStatuses={whitelisted:n.whitelisted,blacklisted:n.blacklisted},0!==N.record.getAssociatedKeyIds().length&&"persistent-license"===B&&null!==i.persistentSessionsStore&&!U){var r=i.persistentSessionsStore;yt(r,M-1),r.add(t,N.record.getAssociatedKeyIds(),L),U=!0}void 0!==t.content&&xt(t.content.manifest,n.whitelisted,n.blacklisted),G._unlockInitDataQueue()},error:function(e){if(e instanceof lt){if(N.blacklistedSessionError=e,void 0!==t.content){var n=t.content.manifest;s.Z.info("DRM: blacklisting Representations based on protection data."),It(n,t)}G._unlockInitDataQueue()}else G._onFatalError(e)}}),this._canceller.signal.register((function(){F.unsubscribe()})),void 0!==a.singleLicensePer&&"init-data"!==a.singleLicensePer||this._unlockInitDataQueue(),"created-session"!==P.type){e.next=68;break}return z=t.values.constructRequestData(),e.prev=55,e.next=58,i.loadedSessionsStore.generateLicenseRequest(L,t.type,z);case 58:e.next=68;break;case 60:if(e.prev=60,e.t0=e.catch(55),null!==(V=i.loadedSessionsStore.getEntryForSession(L))&&"none"===V.closingStatus.type){e.next=67;break}return(K=this._currentSessions.indexOf(N))>=0&&this._currentSessions.splice(K,1),e.abrupt("return",Promise.resolve());case 67:throw new g.Z("KEY_GENERATE_REQUEST_ERROR",e.t0 instanceof Error?e.t0.toString():"Unknown error");case 68:return e.abrupt("return",Promise.resolve());case 69:case"end":return e.stop()}}),e,this,[[55,60]])})));return function(t,n){return e.apply(this,arguments)}}(),n._tryToUseAlreadyCreatedSession=function(e,t){var n=t.stores,r=t.options,i=(0,_.Z)(this._currentSessions,(function(t){return t.record.isCompatibleWith(e)}));if(void 0===i)return!1;var a=i.blacklistedSessionError;if(!(0,E.Z)(a))return void 0===e.type||void 0===e.content?(s.Z.error("DRM: This initialization data has already been blacklisted but the current content is not known."),!0):(s.Z.info("DRM: This initialization data has already been blacklisted. Blacklisting the related content."),It(e.content.manifest,e),!0);if(void 0!==e.keyIds){var o;if(void 0===r.singleLicensePer||"init-data"===r.singleLicensePer){var u=i.keyStatuses.blacklisted;o=function(e,t){for(var n,r=function(){var e=n.value;if(t.some((function(t){return Y(t,e)})))return{v:!0}},i=j(e);!(n=i()).done;){var a=r();if("object"==typeof a)return a.v}return!1}(e.keyIds,u)}else{var l=i.keyStatuses.whitelisted;o=!X(e.keyIds,l)}if(o)return void 0===e.content?(s.Z.error("DRM: Cannot forbid key id, the content is unknown."),!0):(s.Z.info("DRM: Current initialization data is linked to blacklisted keys. Marking Representations as not decipherable"),xt(e.content.manifest,[],e.keyIds),!0)}if(null!==n.loadedSessionsStore.reuse(e))return s.Z.debug("DRM: Init data already processed. Skipping it."),!0;var c=this._currentSessions.indexOf(i);return-1===c?s.Z.error("DRM: Unable to remove processed init data: not found."):(s.Z.debug("DRM: A session from a processed init data is not available anymore. Re-processing it."),this._currentSessions.splice(c,1)),!1},n._onFatalError=function(e){if(!this._canceller.isUsed){var t=e instanceof Error?e:new y.Z("NONE","Unknown encryption error");this.error=t,this._initDataQueue.length=0,this._stateData={state:St.Error,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("error",t),this._stateData.state===St.Error&&this.trigger("stateChange",this._stateData.state)}},n._isStopped=function(){return this._stateData.state===St.Disposed||this._stateData.state===St.Error},n._processCurrentInitDataQueue=function(){for(;!1===this._stateData.isInitDataQueueLocked;){var e=this._initDataQueue.shift();if(void 0===e)return;this.onInitializationData(e)}},n._lockInitDataQueue=function(){!1===this._stateData.isInitDataQueueLocked&&(this._stateData.isInitDataQueueLocked=!0)},n._unlockInitDataQueue=function(){!0===this._stateData.isMediaKeysAttached?(this._stateData.isInitDataQueueLocked=!1,this._processCurrentInitDataQueue()):s.Z.error("DRM: Trying to unlock in the wrong state")},t}(T.Z);function At(e){var t=e.getConfiguration().sessionTypes;return void 0!==t&&(0,b.Z)(t,"persistent-license")}function xt(e,t,n){e.updateRepresentationsDeciperability((function(e){if(void 0===e.contentProtections)return e.decipherable;for(var r=e.contentProtections.keyIds,i=0;i<r.length;i++){for(var a=r[i],o=0;o<n.length;o++)if(Y(n[o],a.keyId))return!1;for(var s=0;s<t.length;s++)if(Y(t[s],a.keyId))return!0}return e.decipherable}))}function It(e,t){e.updateRepresentationsDeciperability((function(e){var n,r;if(!1===e.decipherable)return!1;for(var i=null!==(r=null===(n=e.contentProtections)||void 0===n?void 0:n.initData)&&void 0!==r?r:[],a=function(e){if((void 0===t.type||i[e].type===t.type)&&t.values.getFormattedValues().every((function(t){return i[e].values.some((function(e){return(void 0===t.systemId||e.systemId===t.systemId)&&(0,l.Z)(e.data,t.data)}))})))return{v:!1}},o=0;o<i.length;o++){var s=a(o);if("object"==typeof s)return s.v}return e.decipherable}))}function Zt(e,t,n,r){var i,a=[].concat(n,r);if(void 0!==t&&"init-data"!==t){var o=e.keyIds,s=e.content;if(void 0!==o){var u=o.filter((function(e){return!a.some((function(t){return Y(t,e)}))}));u.length>0&&a.push.apply(a,u)}if(void 0!==s)if("content"===t){for(var l,c=new Set,d=Tt(s.manifest.periods);!(l=d()).done;){Mt(c,l.value)}Rt(c,a)}else if("periods"===t)for(var f,p=Tt(s.manifest.periods);!(f=p()).done;){var v=f.value,h=new Set;if(Mt(h,v),(null===(i=e.content)||void 0===i?void 0:i.period.id)===v.id)Rt(h,a);else for(var m=Array.from(h),g=function(){var e=_[y];if(a.some((function(t){return Y(t,e)})))return Rt(h,a),"break"},y=0,_=m;y<_.length;y++){if("break"===g())break}}}return{whitelisted:n,blacklisted:a.slice(n.length)}}function Rt(e,t){for(var n=Array.from(e.values()),r=function(){var e=a[i];t.some((function(t){return Y(t,e)}))||t.push(e)},i=0,a=n;i<a.length;i++)r()}function Mt(e,t){for(var n,r=Tt(t.getAdaptations());!(n=r()).done;)for(var i,a=Tt(n.value.representations);!(i=a()).done;){var o=i.value;if(void 0!==o.contentProtections&&o.contentProtections.keyIds.length>=-1)for(var s,u=Tt(o.contentProtections.keyIds);!(s=u()).done;){var l=s.value;e.add(l.keyId)}}}!function(e){e[e.Initializing=0]="Initializing",e[e.WaitingForAttachment=1]="WaitingForAttachment",e[e.ReadyForContent=2]="ReadyForContent",e[e.Error=3]="Error",e[e.Disposed=4]="Disposed"}(St||(St={}))},1266:function(e,t,n){"use strict";var r=n(7665);t.ZP=r.Z},770: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)}}},5039:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(4727),i=n(3666);var a=n(1669),o=n(2793),s=n(8343);function u(e,t,n,u){return e.pipe((0,o.Z)((function(e){return null!==e.rebuffering||null!==e.freezing||0===e.readyState?null:function(e,t){return!e||!i.SB||t}(u,t.hasAttribute("playsinline"))?e.readyState>=3&&null!==e.currentRange&&(!(0,a.Z)()||t.duration>0)?s.Z.loaded(n):null:t.duration>0?s.Z.loaded(n):null}),null),(0,r.q)(1))}},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},7920:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var r=n(4975),i=n(4727),a=n(9127),o=n(9878),s=n(2817),u=n(2006),l=n(8515),c=n(7877),d=n(6108),f=n(6362),p=n(9917),v=n(8117),h=n(5561);var m=n(3774),g=n(4804);var y=n(1669),_=n(3714),b=n(3887),T=n(5095),E=n(8343);function S(e){return e.pipe((0,r.h)((function(e){var t=e.seeking,n=e.rebuffering,r=e.readyState;return!t&&null===n&&r>=1})),(0,i.q)(1),(0,a.U)((function(){})))}function w(e){return function(e){return(0,p.P)((function(){return(0,h.Z)((function(){return(0,v.Z)(e.play())}),void 0)}))}(e).pipe((0,a.U)((function(){return"autoplay"})),(0,o.K)((function(e){if(e instanceof Error&&"NotAllowedError"===e.name)return b.Z.warn("Init: Media element can't play. It may be due to browser auto-play policies."),(0,s.of)("autoplay-blocked");throw e})))}function k(e){var t=e.mediaElement,n=e.playbackObserver,r=e.startTime,a=e.mustAutoPlay,o=(0,T.$)(!1),p=(0,T.$)(!1);return{seekAndPlay$:function(e){return e.readyState>=m.c.HAVE_METADATA?(0,s.of)(null):(0,g.K4)(e).pipe((0,i.q)(1))}(t).pipe((0,i.q)(1),(0,u.b)((function(){b.Z.info("Init: Set initial time",r);var e="function"==typeof r?r():r;n.setCurrentTime(e),o.setValue(!0),o.finish()})),(0,l.d)({refCount:!0})).pipe((0,c.z)((function(){if(!(0,y.Z)()||t.duration>0)return S(n.observe(!0));var e=new _.Z("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");return S(n.observe(!0)).pipe((0,d.O)(E.Z.warning(e)))})),(0,c.z)((function(e){return void 0!==e?(0,s.of)(e):(b.Z.info("Init: Can begin to play content"),a?w(t).pipe((0,c.z)((function(e){if(p.setValue(!0),p.finish(),"autoplay"===e)return(0,s.of)({type:"autoplay"});var t=new _.Z("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");return(0,f.z)((0,s.of)(E.Z.warning(t)),(0,s.of)({type:"autoplay-blocked"}))}))):(t.autoplay&&b.Z.warn("Init: autoplay is enabled on HTML media element. Media will play as soon as possible."),p.setValue(!0),p.finish(),(0,s.of)({type:"skipped"})))})),(0,l.d)({refCount:!0})),initialPlayPerformed:p,initialSeekPerformed:o}}},8969:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(1545),i=n(5583),a=n(533),o=n(4975),s=n(4727),u=n(7877),l=n(4978),c=n(2817),d=n(3071),f=n(1480),p=n(3887),v=n(5767);var h=n(8333),m=n(5039),g=n(7920),y=n(9607),_=n(467),b=n(2447),T=n(2983);function E(e){var t=e.autoPlay,n=e.keySystems,E=e.mediaElement,S=e.playbackObserver,w=e.speed,k=e.startAt,A=e.url;if((0,v.Z)(E),null==A)throw new Error("No URL for a DirectFile content");var x=function(e,t){return new f.y((function(n){return p.Z.info("Setting URL to HTMLMediaElement",t),e.src=t,n.next(void 0),function(){(0,v.Z)(e)}}))}(E,A);p.Z.debug("Init: Calculating initial time");var I=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 p.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}(E,k)};p.Z.debug("Init: Initial time calculated:",I);var Z=(0,g.Z)({mediaElement:E,playbackObserver:S,startTime:I,mustAutoPlay:t}).seekAndPlay$,R=(0,y.Z)(E,n,r.E,x).pipe((0,h.Z)(),(0,i.B)()),M=(0,b.Z)(E),C=S.observe(!0),P=(0,T.Z)(E,w,C).pipe((0,a.l)()),D=(0,_.Z)(S,null,r.E,r.E),N=R.pipe((0,o.h)((function(e){return"decryption-ready"===e.type||"decryption-disabled"===e.type})),(0,s.q)(1),(0,u.z)((function(){return Z})),(0,l.w)((function(e){return"warning"===e.type?(0,c.of)(e):(0,m.Z)(C,E,null,!0)})));return(0,d.T)(N,R.pipe((0,a.l)()),M,P,D)}},9607:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(3071),i=n(9127),a=n(1480),o=n(6139);var s=n(4804),u=n(5157),l=n(7874),c=n(3887),d=n(7665),f=s.Oh;function p(e,t,n,s){var p=(0,r.T)(f(e),n);if(null==l.Z.ContentDecryptor)return(0,r.T)(p.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but EME feature not activated"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","EME feature not activated.")}))),s.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));if(0===t.length)return(0,r.T)(p.pipe((0,i.U)((function(){throw c.Z.error("Init: Ciphered media and no keySystem passed"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Media is encrypted and no `keySystems` given")}))),s.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));if("function"!=typeof o.N)return(0,r.T)(p.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but no EME API available"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Encryption APIs not found.")}))),s.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));c.Z.debug("Init: Creating ContentDecryptor");var v=l.Z.ContentDecryptor;return new a.y((function(r){var i,a=new v(e,t);a.addEventListener("stateChange",(function(e){e===d.u.WaitingForAttachment&&(a.removeEventListener("stateChange"),i=s.subscribe((function(e){a.addEventListener("stateChange",(function(t){t===d.u.ReadyForContent&&(r.next({type:"decryption-ready",value:{drmSystemId:a.systemId,mediaSource:e}}),a.removeEventListener("stateChange"))})),a.attach()})))})),a.addEventListener("error",(function(e){r.error(e)})),a.addEventListener("warning",(function(e){r.next({type:"warning",value:e})}));var o=n.subscribe((function(e){a.onInitializationData(e)}));return function(){o.unsubscribe(),null==i||i.unsubscribe(),a.dispose()}}))}},467:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(3428),i=n(3074),a=n(2006),o=n(533),s=n(9127),u=n(3071),l=n(3666).yS,c=n(6872),d=n(3714),f=n(3887),p=n(2829),v=n(8567),h=1/60;function m(e,t,n,d){var m,_=d.pipe((0,r.M)(e.observe(!0)),(0,i.R)((function(e,t){return function(e,t,n){for(;e.length>0&&void 0!==e[0].period.end&&e[0].period.end+10<n.position;)e.shift();var r=t.period,i=t.bufferType;if("audio"!==i&&"video"!==i)return e;for(var a=0;a<e.length;a++)if(e[a].period.id===r.id){if(e[a].bufferType===i)return g(t)?e[a]=t:e.splice(a,1),e}else if(e[a].period.start>r.start)return g(t)&&e.splice(a,0,t),e;g(t)&&e.push(t);return e}(e,t[0],t[1])}),[])),b=null,T=null,E=n.pipe((0,r.M)(e.observe(!0)),(0,a.b)((function(t){var n,r=t[0],i=t[1];if(i.rebuffering&&!i.paused&&("audio"===r.bufferType||"video"===r.bufferType)){var a=i.position,o=null!==(n=i.rebuffering.position)&&void 0!==n?n:a,s=r.period.start;a<s&&Math.abs(o-s)<1&&(f.Z.warn("Init: rebuffering because of a future locked stream.\nTrying to unlock by seeking to the next Period"),e.setCurrentTime(s+.001))}})),(0,o.l)()),S=e.observe(!0).pipe((0,r.M)(_),(0,s.U)((function(n){var r=n[0],i=n[1],a=r.buffered,o=r.position,s=r.readyState,u=r.rebuffering,d=r.freezing,g=c.Z.getCurrent(),_=g.BUFFER_DISCONTINUITY_THRESHOLD,E=g.FORCE_DISCONTINUITY_SEEK_DELAY,S=g.FREEZING_STALLED_DELAY,w=g.UNFREEZING_SEEK_DELAY,k=g.UNFREEZING_DELTA_POSITION;if(null!==d){var A=performance.now();if(A-(null===m?d.timestamp:m.attemptTimestamp)>w&&(f.Z.warn("Init: trying to seek to un-freeze player"),e.setCurrentTime(e.getCurrentTime()+k),m={attemptTimestamp:A}),A-d.timestamp>S)return{type:"stalled",value:"freezing"}}else m=null;if(null===u)return 1===s?{type:"stalled",value:r.seeking?r.internalSeeking?"internal-seek":"seeking":"not-ready"}:{type:"unstalled",value:null};var x="seeking"===u.reason&&r.internalSeeking?"internal-seek":u.reason;if(r.seeking)b=r.position;else if(null!==b){var I=performance.now();if(null===T&&(T=I),l&&r.position<b&&I-T<E)return{type:"stalled",value:x};b=null}if(T=null,null===t)return{type:"stalled",value:x};var Z=u.position;if(null!==Z){var R=function(e,t,n){if(0===e.length)return null;for(var r=null,i=0;i<e.length;i++){var a=e[i].period;if(a.start>n)return r;var o=void 0;if(void 0===a.end||a.end>n){var s=e[i],u=s.discontinuity,l=s.position,c=u.start,d=u.end;if(n>=(null!=c?c:l)-h)if(null===d){var p=t.getPeriodAfter(a);null!==p?o=p.start+h:f.Z.warn("Init: discontinuity at Period's end but no next Period")}else n<d+h&&(o=d+h);void 0!==o&&(f.Z.info("Init: discontinuity found",n,o),r=null!==r&&r>o?r:o)}}return r}(i,t,Z);if(null!==R){var M=R+.001;if(!(M<=e.getCurrentTime()))return f.Z.warn("SA: skippable discontinuity found in the stream",o,M),e.setCurrentTime(M),v.Z.warning(y(Z,M));f.Z.info("Init: position to seek already reached, no seeking",e.getCurrentTime(),M)}}var C=null!=Z?Z:o,P=(0,p.XS)(a,C);if(P<_){var D=C+P+h;if(e.getCurrentTime()<D)return f.Z.warn("Init: discontinuity encountered inferior to the threshold",C,D,_),e.setCurrentTime(D),v.Z.warning(y(C,D))}for(var N=t.periods.length-2;N>=0;N--){var O=t.periods[N];if(void 0!==O.end&&O.end<=C){if(t.periods[N+1].start>C&&t.periods[N+1].start>e.getCurrentTime()){var L=t.periods[N+1];return e.setCurrentTime(L.start),v.Z.warning(y(C,L.start))}break}}return{type:"stalled",value:x}})));return(0,u.T)(E,S)}function g(e){return null!==e.discontinuity}function y(e,t){return new d.Z("DISCONTINUITY_ENCOUNTERED","A discontinuity has been encountered at position "+String(e)+", seeked at position "+String(t))}},2447:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2401),i=n(7877),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 d}});var r=n(9127),i=n(6108),a=n(3741),o=n(4978),s=n(9917),u=n(2817),l=n(2006),c=n(3887);function d(e,t,n){return n.pipe((0,r.U)((function(e){return null!==e.rebuffering})),(0,i.O)(!1),(0,a.x)()).pipe((0,o.w)((function(n){return n?(0,s.P)((function(){return c.Z.info("Init: Pause playback to build buffer"),e.playbackRate=0,(0,u.of)(0)})):t.asObservable().pipe((0,l.b)((function(t){c.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(4578),i=n(9917),a=n(2817),o=n(3887),s=n(9612),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,c=u.end,d=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/d,h=c/d,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,t._buffered),(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 D}});var r=n(4578),i=n(3071),a=n(6697),o=n(6108),s=n(4978),u=n(6362),l=n(9127),c=n(3505),d=n(2817),f=n(6716),p=n(9917),v=n(4804),h=n(1480),m=n(3741),g=n(3887),y=n(2203).Z?void 0:window.ResizeObserver;var _=n(6872),b=n(9612),T=n(4309),E=n(7874);function S(e,t){return Math.abs(e-t)<=.2}function w(e,t){for(var n=e.length-1;n>=0;n--){if(e[n].start<t)return e.slice(0,n+1)}return[]}function k(e,t){for(var n=0;n<e.length;n++){if(e[n].end>t)return e.slice(n,e.length)}return[]}function A(e,t,n){var r=Math.max(e.start,t),i=w(e.cues,t),a={start:e.start,end:r,cues:i},o=Math.min(n,e.end),s=k(e.cues,n);return[a,{start:o,end:e.end,cues:s}]}var x=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.end&&e>=i.start){for(var a=i.cues,o=0;o<a.length;o++)e>=a[o].start&&e<a[o].end&&n.push(a[o].element);return n}}return[]},t.remove=function(e,t){for(var n=Math.max(e,t),r=this._cuesBuffer,i=0;i<r.length;i++)if(r[i].end>e){var a=r[i];if(a.start>=n)return;if(a.end>=n){if(e<=a.start)a.cues=k(a.cues,n),a.start=n;else{var o=A(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=w(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=k(t.cues,i.end),t.start=i.end),r.splice(e,0,i))}for(var o=0;o<r.length;o++){var s=r[o];if(t<s.end){if(S(t,s.start)){if(S(n,s.end))return void(r[o]=i);if(n<s.end)return s.cues=k(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(t<s.start){if(n<s.start)return void r.splice(o,0,i);if(S(n,s.start))return s.start=n,void r.splice(o,0,i);if(S(n,s.end))return void r.splice(o,1,i);if(n<s.end)return s.cues=k(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(S(s.end,n))return s.cues=w(s.cues,t),s.end=t,void r.splice(o+1,0,i);if(s.end>n){var u=A(s,t,n),l=u[0],c=u[1];return this._cuesBuffer[o]=l,r.splice(o+1,0,i),void r.splice(o+2,0,c)}s.cues=w(s.cues,t),s.end=t;var d=o+1;for(s=r[d];void 0!==s&&n>s.end;)r.splice(d,1),s=r[d];return void a(d)}}r.push(i)},e}();function I(e,t,n,r){for(var i=[t/n.columns,e/n.rows],a=r.getElementsByClassName("proportional-style"),o=0;o<a.length;o++){var s=a[o];if(s instanceof HTMLElement){var u=s.getAttribute("data-proportional-font-size");null===u||isNaN(+u)||(s.style.fontSize=String(+u*i[1])+"px");var l=s.getAttribute("data-proportional-width");null===l||isNaN(+l)||(s.style.width=String(+l*i[0])+"px");var c=s.getAttribute("data-proportional-height");null===c||isNaN(+c)||(s.style.height=String(+c*i[1])+"px");var d=s.getAttribute("data-proportional-line-height");null===d||isNaN(+d)||(s.style.lineHeight=String(+d*i[1])+"px");var f=s.getAttribute("data-proportional-left");null===f||isNaN(+f)||(s.style.left=String(+f*i[0])+"px");var p=s.getAttribute("data-proportional-top");null===p||isNaN(+p)||(s.style.top=String(+p*i[1])+"px");var v=s.getAttribute("data-proportional-padding-top");null===v||isNaN(+v)||(s.style.paddingTop=String(+v*i[1])+"px");var h=s.getAttribute("data-proportional-padding-bottom");null===h||isNaN(+h)||(s.style.paddingBottom=String(+h*i[1])+"px");var m=s.getAttribute("data-proportional-padding-left");null===m||isNaN(+m)||(s.style.paddingLeft=String(+m*i[0])+"px");var g=s.getAttribute("data-proportional-padding-right");null===g||isNaN(+g)||(s.style.paddingRight=String(+g*i[0])+"px")}}return a.length>0}var Z=v.C1,R=v.ik,M=v.d5;function C(e,t){try{e.removeChild(t)}catch(e){g.Z.warn("HTSB: Can't remove text track: not in the element.")}}function P(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 D=function(e){function t(t,n){var r;return g.Z.debug("HTSB: Creating HTMLTextSegmentBuffer"),(r=e.call(this)||this).bufferType="text",r._buffered=new T.Z,r._videoElement=t,r._textTrackElement=n,r._clearSizeUpdates$=new f.x,r._destroy$=new f.x,r._buffer=new x,r._currentCues=[],function(e){var t=M(e),n=R(e),r=Z(e),f=_.Z.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,p=(0,i.T)(n,r),v=(0,a.F)(f).pipe((0,o.O)(null));return p.pipe((0,o.O)(null),(0,s.w)((function(){return(0,u.z)(v.pipe((0,l.U)((function(){return!0})),(0,c.R)(t)),(0,d.of)(!1))})))}(r._videoElement).pipe((0,c.R)(r._destroy$)).subscribe((function(e){if(e){var t=_.Z.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,n=Math.max(r._videoElement.currentTime+t/1e3/2,0),i=r._buffer.get(n);0===i.length?r._disableCurrentCues():r._displayCues(i)}else r._disableCurrentCues()})),r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,p.P)((function(){return t.pushChunkSync(e),(0,d.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,p.P)((function(){return n.removeBufferSync(e,t),(0,d.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,p.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,d.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){g.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;g.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,c=o.end,d=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){g.Z.debug("HTSB: Finding parser for html text tracks:",e);var i=E.Z.htmlTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");g.Z.debug("HTSB: Parser found, parsing...");var a=i(t,n,r);return g.Z.debug("HTTB: Parsed successfully!",a),a}(f,d,i,p);if(0!==v&&h!==1/0){for(var y=0;y<m.length&&m[y].end<=v;)y++;for(m.splice(0,y),y=0;y<m.length&&m[y].start<v;)m[y].start=v,y++;for(y=m.length-1;y>=0&&m[y].start>=h;)y--;for(m.splice(y,m.length),y=m.length-1;y>=0&&m[y].end>h;)m[y].end=h,y--}if(void 0!==l)s=Math.max(v,l);else{if(m.length<=0)return void g.Z.warn("HTSB: Current text tracks have no cues nor start time. Aborting");g.Z.warn("HTSB: No start time given. Guessing from cues."),s=m[0].start}if(void 0!==c)u=Math.min(h,c);else{if(m.length<=0)return void g.Z.warn("HTSB: Current text tracks have no cues nor end time. Aborting");g.Z.warn("HTSB: No end time given. Guessing from cues."),u=m[m.length-1].end}u<=s?g.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){g.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;e<this._currentCues.length;e++)C(this._textTrackElement,this._currentCues[e].element);this._currentCues=[]}},n._displayCues=function(e){if(!(this._currentCues.length===e.length&&this._currentCues.every((function(t,n){return t.element===e[n]})))){this._clearSizeUpdates$.next();for(var t=0;t<this._currentCues.length;t++)C(this._textTrackElement,this._currentCues[t].element);this._currentCues=[];for(var n=0;n<e.length;n++){var r=e[n],i=P(r);this._currentCues.push({element:r,resolution:i}),this._textTrackElement.appendChild(r)}var s=this._currentCues.filter((function(e){return null!==e.resolution}));if(s.length>0){var u=_.Z.getCurrent().TEXT_TRACK_SIZE_CHECKS_INTERVAL;(function(e,t){return(0,p.P)((function(){if(void 0!==y){var n=-1,r=-1;return new h.y((function(t){var i=new y((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 g.Z.error("Compat: Resized but no observed element.")}));return i.observe(e),function(){i.disconnect()}}))}return(0,a.F)(t).pipe((0,o.O)(null),(0,l.U)((function(){var t=e.getBoundingClientRect();return{height:t.height,width:t.width}})),(0,m.x)((function(e,t){return e.height===t.height&&e.width===t.width})))}))})(this._textTrackElement,u).pipe((0,c.R)(this._clearSizeUpdates$),(0,c.R)(this._destroy$)).subscribe((function(e){for(var t=e.height,n=e.width,r=0;r<s.length;r++){var i=s[r];I(t,n,i.resolution,i.element)}}))}}},t}(b.C)},9059:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(4578),i=n(9917),a=n(2817),o=n(3666);var s=n(3887);function u(e,t){if(o.vU&&function(e,t){var n=e.activeCues;if(null===n)return!1;for(var r=0;r<n.length;r++)if(n[r]===t)return!0;return!1}(e,t)){var n=e.mode;e.mode="hidden";try{e.removeCue(t)}catch(e){s.Z.warn("Compat: Could not remove cue from text track.")}e.mode=n}else try{e.removeCue(t)}catch(e){s.Z.warn("Compat: Could not remove cue from text track.")}}var l=n(9612),c=n(4309),d=n(7874);var f=function(e){function t(t,n){var r;s.Z.debug("NTSB: Creating NativeTextSegmentBuffer"),r=e.call(this)||this;var i=function(e,t){var n,r,i,a,s="subtitles";if(o.YM){var u=e.textTracks.length;(i=u>0?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 c.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,c=u.appendWindow,f=u.chunk,p=f.start,v=f.end,h=f.data,m=f.type,g=f.language,y=null!==(n=c[0])&&void 0!==n?n:0,_=null!==(r=c[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=d.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<b.length&&b[T].endTime<=y;)T++;for(b.splice(0,T),T=0;T<b.length&&b[T].startTime<y;)b[T].startTime=y,T++;for(T=b.length-1;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],S=t._track.cues;null!==S&&S.length>0&&E.startTime<S[S.length-1].startTime&&t._removeData(E.startTime,1/0);for(var w=0;w<b.length;w++)t._track.addCue(b[w])}return t._buffered.insert(i,o),null!==e.inventoryInfos&&t._segmentInventory.insertChunk(e.inventoryInfos),(0,a.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,i.P)((function(){return n._removeData(e,t),(0,a.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,i.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,a.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){s.Z.debug("NTSB: Aborting NativeTextSegmentBuffer"),this._removeData(0,1/0);var e=this._trackElement,t=this._videoElement;if(void 0!==e&&t.hasChildNodes())try{t.removeChild(e)}catch(e){s.Z.warn("NTSB: Can't remove track element from the video")}this._track.mode="disabled",void 0!==this._trackElement&&(this._trackElement.innerHTML="")},n._removeData=function(e,t){s.Z.debug("NTSB: Removing native text track data",e,t);var n=this._track,r=n.cues;if(null!==r)for(var i=r.length-1;i>=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)},9612:function(e,t,n){"use strict";n.d(t,{C:function(){return y},f:function(){return m}});var r=n(6872),i=n(3887),a=n(520),o=n(5278);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var l=function(){function e(e,t){this._history=[],this._lifetime=e,this._maxHistoryLength=t}var t=e.prototype;return t.addBufferedSegment=function(e,t,n){var r=performance.now();this._history.push({date:r,bufferedStart:t,bufferedEnd:n,context:e}),this._cleanHistory(r)},t.getHistoryFor=function(e){return this._history.filter((function(t){return(0,a.z)(t.context,e)}))},t._cleanHistory=function(e){for(var t,n=e-this._lifetime,r=0,i=s(this._history);!(t=i()).done;){if(!(t.value.date<n))break;r++}if(r>0&&(this._history=this._history.splice(r)),this._history.length>this._maxHistoryLength){var a=this._history.length-this._maxHistoryLength;this._history=this._history.splice(a)}},e}();function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e){if(void 0===e.bufferedStart||e.partiallyPushed)return!1;var t=e.start,n=e.end-t,i=r.Z.getCurrent(),a=i.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,o=i.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE;return Math.abs(t-e.bufferedStart)<=a&&(void 0===e.bufferedEnd||e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-n)<=Math.min(o,n/3))}function p(e){if(void 0===e.bufferedEnd||e.partiallyPushed)return!1;var t=e.start,n=e.end,i=n-t,a=r.Z.getCurrent(),o=a.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,s=a.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE;return Math.abs(n-e.bufferedEnd)<=o&&null!=e.bufferedStart&&e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-i)<=Math.min(s,i/3)}function v(e,t,n,a){var o=r.Z.getCurrent().MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE;void 0!==e.bufferedStart?(e.bufferedStart<t&&(i.Z.debug("SI: Segment partially GCed at the start",a,e.bufferedStart,t),e.bufferedStart=t),!e.precizeStart&&f(e)&&(e.start=e.bufferedStart,e.precizeStart=!0)):e.precizeStart?(i.Z.debug("SI: buffered start is precize start",a,e.start),e.bufferedStart=e.start):null!==n&&n.end>t&&(n.precizeEnd||e.start-n.end<=o)?(i.Z.debug("SI: buffered start is end of previous segment",a,t,e.start,n.end),e.bufferedStart=n.end,f(e)&&(e.start=n.end,e.precizeStart=!0)):e.start-t<=o?(i.Z.debug("SI: found true buffered start",a,t,e.start),e.bufferedStart=t,f(e)&&(e.start=t,e.precizeStart=!0)):t<e.start?i.Z.debug("SI: range start too far from expected start",a,t,e.start):(i.Z.debug("SI: Segment appears immediately garbage collected at the start",a,e.bufferedStart,t),e.bufferedStart=t)}function h(e,t,n){var a=r.Z.getCurrent().MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE;void 0!==e.bufferedEnd?(e.bufferedEnd>t&&(i.Z.debug("SI: Segment partially GCed at the end",n,e.bufferedEnd,t),e.bufferedEnd=t),!e.precizeEnd&&t-e.end<=a&&p(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<=a?(i.Z.debug("SI: found true buffered end",n,t,e.end),e.bufferedEnd=t,p(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 m,g=function(){function e(){var e=r.Z.getCurrent(),t=e.BUFFERED_HISTORY_RETENTION_TIME,n=e.BUFFERED_HISTORY_MAXIMUM_ENTRIES;this._inventory=[],this._bufferedHistory=new l(t,n)}var t=e.prototype;return t.reset=function(){this._inventory.length=0},t.synchronizeBuffered=function(e){for(var t=this._inventory,n=0,a=t[0],s=r.Z.getCurrent().MINIMUM_SEGMENT_SIZE,u=null==a?void 0:a.infos.adaptation.type,l=e.length,c=0;c<l;c++){if(void 0===a)return;var d=e.start(c),f=e.end(c);if(f-d<s)i.Z.warn("SI: skipped TimeRange when synchronizing because it was too small",u,d,f);else{for(var p=n;void 0!==a&&(0,o.Z)(a.bufferedEnd,a.end)-d<s;)a=t[++n];var m=null,g=n-p;if(g>0){var y=t[p+g-1];m={end:(0,o.Z)(y.bufferedEnd,y.end),precizeEnd:y.precizeEnd},i.Z.debug("SI: "+g+" segments GCed.",u),t.splice(p,g),n=p}if(void 0===a)return;if(f-(0,o.Z)(a.bufferedStart,a.start)>=s){if(v(a,d,m,u),n===t.length-1)return void h(a,f,u);a=t[++n];for(var _=(0,o.Z)(a.bufferedStart,a.start),b=(0,o.Z)(a.bufferedEnd,a.end),T=c<l-1?e.start(c+1):void 0;void 0!==a&&f-_>=s&&(void 0===T||f-_>=b-T);){var E=t[n-1];void 0===E.bufferedEnd&&(E.bufferedEnd=a.precizeStart?a.start:E.end,i.Z.debug("SI: calculating buffered end of contiguous segment",u,E.bufferedEnd,E.end)),a.bufferedStart=E.bufferedEnd,void 0!==(a=t[++n])&&(_=(0,o.Z)(a.bufferedStart,a.start),b=(0,o.Z)(a.bufferedEnd,a.end))}}var S=t[n-1];void 0!==S&&h(S,f,u)}}null!=a&&(i.Z.debug("SI: last segments have been GCed",u,n,t.length),t.splice(n,t.length-n)),void 0!==u&&"DEBUG"===i.Z.getLevel()&&i.Z.debug("SI: current "+u+" 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<e.length;u++){var l=e[u];if(void 0!==l.bufferedStart&&void 0!==l.bufferedEnd){var c,d=l.infos.period.id,f=l.infos.representation.id,p=n[d],v=void 0;if(void 0===p)v=o(l.infos),n[d]=((c={})[f]=v,c);else void 0===p[f]?(v=o(l.infos),p[f]=v):v=p[f];null===i?s+=l.bufferedStart.toFixed(2)+"|"+v+"|":a===v?i.bufferedEnd+t<l.bufferedStart&&(s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+v+"|"):s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+v+"|",i=l,a=v}}null!==i&&(s+=String(i.end.toFixed(2)));return r.forEach((function(e){var t;s+="\n["+e.letter+"] P: "+e.periodId+" || R: "+e.representationId+"("+(null!==(t=e.bitrate)&&void 0!==t?t:"unknown bitrate")+")"})),s}(this._inventory))},t.insertChunk=function(e){var t=e.period,n=e.adaptation,r=e.representation,a=e.segment,o=e.chunkSize,s=e.start,u=e.end;if(!a.isInit){var l=n.type;if(s>=u)i.Z.warn("SI: Invalid chunked inserted: starts before it ends",l,s,u);else{for(var c=this._inventory,d={partiallyPushed:!0,chunkSize:o,splitted:!1,start:s,end:u,precizeStart:!1,precizeEnd:!1,bufferedStart:void 0,bufferedEnd:void 0,infos:{segment:a,period:t,adaptation:n,representation:r}},f=c.length-1;f>=0;f--){var p=c[f];if(p.start<=s){if(p.end<=s){for(i.Z.debug("SI: Pushing segment strictly after previous one.",l,s,p.end),this._inventory.splice(f+1,0,d),f+=2;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}if(p.start===s){if(p.end<=u){for(i.Z.debug("SI: Segment pushed replace another one",l,s,u,p.end),this._inventory.splice(f,1,d),f+=1;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}return i.Z.debug("SI: Segment pushed ends before another with the same start",l,s,u,p.end),c.splice(f,0,d),p.start=d.end,p.bufferedStart=void 0,void(p.precizeStart=p.precizeStart&&d.precizeEnd)}if(p.end<=d.end){for(i.Z.debug("SI: Segment pushed updates end of previous one",l,s,u,p.start,p.end),this._inventory.splice(f+1,0,d),p.end=d.start,p.bufferedEnd=void 0,p.precizeEnd=p.precizeEnd&&d.precizeStart,f+=2;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}i.Z.warn("SI: Segment pushed is contained in a previous one",l,s,u,p.start,p.end);var v={partiallyPushed:p.partiallyPushed,chunkSize:p.chunkSize,splitted:!0,start:d.end,end:p.end,precizeStart:p.precizeStart&&p.precizeEnd&&d.precizeEnd,precizeEnd:p.precizeEnd,bufferedStart:void 0,bufferedEnd:p.end,infos:p.infos};return p.end=d.start,p.splitted=!0,p.bufferedEnd=void 0,p.precizeEnd=p.precizeEnd&&d.precizeStart,c.splice(f+1,0,d),void c.splice(f+2,0,v)}}var h=this._inventory[0];if(void 0===h)return i.Z.debug("SI: first segment pushed",l,s,u),void this._inventory.push(d);if(!(h.start>=u)){if(h.end<=u){for(i.Z.debug("SI: Segment pushed starts before and completely recovers the previous first one",l,s,u,h.start,h.end),this._inventory.splice(0,1,d);c.length>1&&c[1].start<d.end;){if(c[1].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[1].start),c[1].start=d.end,c[1].bufferedStart=void 0,void(c[1].precizeStart=d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[1].start,c[1].end),c.splice(1,1)}return}return i.Z.debug("SI: Segment pushed start of the next one",l,s,u,h.start,h.end),h.start=u,h.bufferedStart=void 0,h.precizeStart=d.precizeEnd,void this._inventory.splice(0,0,d)}i.Z.debug("SI: Segment pushed comes before all previous ones",l,s,u,h.start),this._inventory.splice(0,0,d)}}},t.completeSegment=function(e,t){if(!e.segment.isInit){for(var n=this._inventory,r=[],o=0;o<n.length;o++)if((0,a.z)(n[o].infos,e)){var s=!1;r.length>0&&(s=!0,1===r.length&&(i.Z.warn("SI: Completed Segment is splitted.",e),r[0].splitted=!0));var u=o,l=n[o].chunkSize;for(o+=1;o<n.length&&(0,a.z)(n[o].infos,e);){var d=n[o].chunkSize;void 0!==l&&void 0!==d&&(l+=d),o++}var f=o-1,p=f-u,v=n[f].end,h=n[f].bufferedEnd;p>0&&(this._inventory.splice(u+1,p),o-=p),this._inventory[u].partiallyPushed=!1,this._inventory[u].chunkSize=l,this._inventory[u].end=v,this._inventory[u].bufferedEnd=h,this._inventory[u].splitted=s,r.push(this._inventory[u])}if(0===r.length)i.Z.warn("SI: Completed Segment not found",e);else{this.synchronizeBuffered(t);for(var m,g=c(r);!(m=g()).done;){var y=m.value;void 0!==y.bufferedStart&&void 0!==y.bufferedEnd?this._bufferedHistory.addBufferedSegment(y.infos,y.bufferedStart,y.bufferedEnd):i.Z.debug("SI: buffered range not known after sync. Skipping history.",y)}}}},t.getInventory=function(){return this._inventory},t.getHistoryFor=function(e){return this._bufferedHistory.getHistoryFor(e)},e}(),y=function(){function e(){this._segmentInventory=new g}var t=e.prototype;return t.synchronizeInventory=function(){this._segmentInventory.synchronizeBuffered(this.getBufferedRanges())},t.getInventory=function(){return this._segmentInventory.getInventory()},t.getPendingOperations=function(){return[]},t.getSegmentHistory=function(e){return this._segmentInventory.getHistoryFor(e)},e}();!function(e){e[e.Push=0]="Push",e[e.Remove=1]="Remove",e[e.EndOfSegment=2]="EndOfSegment"}(m||(m={}))},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}()},8567:function(e,t,n){"use strict";var r=n(8026),i={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){return{type:"needs-media-source-reload",value:{position:e,autoPlay:t}}},lockedStream:function(e,t){return{type:"locked-stream",value:{bufferType:e,period:t}}},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,t){return{type:"encryption-data-encountered",value:(0,r.Z)({content:t},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}},waitingMediaSourceReload:function(e,t,n,r){return{type:"waiting-media-source-reload",value:{bufferType:e,period:t,position:n,autoPlay:r}}}};t.Z=i},7839:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7326),i=n(4578),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(2146).Z)(Error))},5157:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),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,{SM:function(){return a},ZB:function(){return r},br:function(){return i}});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}})},8750:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(9822),i=n(5389);function a(e,t){var n=t.defaultCode,a=t.defaultReason;if((0,r.Z)(e))return e;var o=e instanceof Error?e.toString():a;return new i.Z(n,o)}},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(7326),i=n(4578),a=n(2146),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(7326),i=n(4578),a=n(2146),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(7326),i=n(4578),a=n(2146),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(7326),i=n(4578),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,void 0!==o&&(s.xhr=o),s.status=i,s.type=a,s.message=a,s}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error))},7273:function(e,t){"use strict";t.Z={dashParsers:{wasm:null,js:null},directfile:null,ContentDecryptor: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 d},Z:function(){return f}});var r=n(3274),i=n(1946),a=n(7829);var o="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}))},s=n(3774);var u=n(3887),l=n(4791),c=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!=s.J&&("function"!=typeof s.J.isTypeSupported||s.J.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;i<n.length;i++)for(var a=!1,o=n[i],s=0;s<o.values.length;s++)if(o.values[s].systemId.toLowerCase()===e.toLowerCase())if(a)r[r.length-1].values.push(o.values[s]);else{var u=null===(t=this.contentProtections)||void 0===t?void 0:t.keyIds.map((function(e){return e.keyId}));r.push({type:o.type,keyIds:u,values:[o.values[s]]}),a=!0}return r},t.getAllEncryptionData=function(){var e;if(void 0===this.contentProtections||0===this.contentProtections.initData.length)return[];var t=null===(e=this.contentProtections)||void 0===e?void 0:e.keyIds.map((function(e){return e.keyId}));return this.contentProtections.initData.map((function(e){return{type:e.type,keyIds:t,values:e.values}}))},t._addProtectionData=function(e,t){var n=!1;if(void 0===this.contentProtections)return this.contentProtections={keyIds:[],initData:[{type:e,values:t}]},!0;for(var r=this.contentProtections.initData,i=0;i<r.length;i++)if(r[i].type===e){for(var a=r[i].values,o=0;o<t.length;o++){var s=t[o],c=void 0;for(c=0;c<a.length;c++)if(s.systemId===a[c].systemId){if((0,l.Z)(s.data,a[c].data))break;u.Z.warn("Manifest: different init data for the same system ID")}c===a.length&&(a.push(s),n=!0)}return n}return this.contentProtections.initData.push({type:e,values:t}),!0},e}(),d=["audio","video","text","image"],f=function(){function e(t,n){void 0===n&&(n={});var r=t.trickModeTracks,o=n,s=o.representationFilter,u=o.isManuallyAdded;this.id=t.id,this.type=t.type,void 0!==t.isTrickModeTrack&&(this.isTrickModeTrack=t.isTrickModeTrack),void 0!==t.language&&(this.language=t.language,this.normalizedLanguage=(0,a.ZP)(t.language)),void 0!==t.closedCaption&&(this.isClosedCaption=t.closedCaption),void 0!==t.audioDescription&&(this.isAudioDescription=t.audioDescription),void 0!==t.isDub&&(this.isDub=t.isDub),void 0!==t.isSignInterpreted&&(this.isSignInterpreted=t.isSignInterpreted),void 0!==r&&r.length>0&&(this.trickModeTracks=r.map((function(t){return new e(t)})));for(var l=t.representations,d=[],f=!1,p=0;p<l.length;p++){var v=new c(l[p],{type:this.type});((0,i.Z)(s)||s(v,{bufferType:this.type,language:this.language,normalizedLanguage:this.normalizedLanguage,isClosedCaption:this.isClosedCaption,isDub:this.isDub,isAudioDescription:this.isAudioDescription,isSignInterpreted:this.isSignInterpreted}))&&(d.push(v),!f&&v.isSupported&&(f=!0))}d.sort((function(e,t){return e.bitrate-t.bitrate})),this.representations=d,this.isSupported=f,this.manuallyAdded=!0===u}var t=e.prototype;return t.getAvailableBitrates=function(){for(var e=[],t=0;t<this.representations.length;t++){var n=this.representations[t];!1!==n.decipherable&&e.push(n.bitrate)}return o(e)},t.getPlayableRepresentations=function(){return this.representations.filter((function(e){return e.isSupported&&!1!==e.decipherable}))},t.getRepresentation=function(e){return(0,r.Z)(this.representations,(function(t){var n=t.id;return e===n}))},e}()},1989:function(e,t,n){"use strict";n.d(t,{ZP:function(){return T}});var r,i=n(4578),a=n(3714),o=n(3274),s=n(1959),u=n(908),l=n(8806),c=n(8999),d=n(1679),f=function(){function e(e,t){var n=this;if(this.contentWarnings=[],this.id=e.id,this.adaptations=Object.keys(e.adaptations).reduce((function(r,i){var o=e.adaptations[i];if(null==o)return r;var s=o.map((function(e){var r=new c.Z(e,{representationFilter:t});if(r.representations.length>0&&!r.isSupported){var i=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");n.contentWarnings.push(i)}return r})).filter((function(e){return e.representations.length>0}));if(s.every((function(e){return!e.isSupported}))&&o.length>0&&("video"===i||"audio"===i))throw new a.Z("MANIFEST_PARSE_ERROR","No supported "+i+" adaptations");return s.length>0&&(r[i]=s),r}),{}),!Array.isArray(this.adaptations.video)&&!Array.isArray(this.adaptations.audio))throw new a.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,d.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}(),p=n(3887),v=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,complete:!0,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(){p.Z.warn("Tried to replace a static RepresentationIndex")},t._update=function(){p.Z.warn("Tried to update a static RepresentationIndex")},e}();!function(e){e[e.Full=0]="Full",e[e.Partial=1]="Partial"}(r||(r={}));var h=n(5138);function m(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)p.Z.warn('Manifest: Adaptation "'+i[e].id+'" not found when merging.');else for(var u=i[e].representations,l=s.representations,c=function(e){var t=u[e],i=(0,o.Z)(l,(function(e){return e.id===t.id}));void 0===i?p.Z.warn('Manifest: Representation "'+u[e].id+'" not found when merging.'):n===r.Full?t.index._replace(i.index):t.index._update(i.index)},d=0;d<u.length;d++)c(d)},u=0;u<i.length;u++)s(u)}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _=(0,u.Z)(),b=(0,u.Z)();var T=function(e){function t(t,n){var r,i;r=e.call(this)||this;var a=n.supplementaryTextTracks,o=void 0===a?[]:a,s=n.supplementaryImageTracks,u=void 0===s?[]:s,l=n.representationFilter,c=n.manifestUpdateUrl;return r.contentWarnings=[],r.id=b(),r.expired=null!==(i=t.expired)&&void 0!==i?i:null,r.transport=t.transportType,r.clockOffset=t.clockOffset,r.periods=t.periods.map((function(e){var t,n=new f(e,l);return(t=r.contentWarnings).push.apply(t,n.contentWarnings),n})).sort((function(e,t){return e.start-t.start})),r.adaptations=void 0===r.periods[0]?{}:r.periods[0].adaptations,r._timeBounds=t.timeBounds,r.isDynamic=t.isDynamic,r.isLive=t.isLive,r.isLastPeriodKnown=t.isLastPeriodKnown,r.uris=void 0===t.uris?[]:t.uris,r.updateUrl=c,r.lifetime=t.lifetime,r.suggestedPresentationDelay=t.suggestedPresentationDelay,r.availabilityStartTime=t.availabilityStartTime,r.publishTime=t.publishTime,u.length>0&&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||t<e.end}));return void 0===n?null:n},n.getUrl=function(){return this.uris[0]},n.replace=function(e){this._performUpdate(e,r.Full)},n.update=function(e){this._performUpdate(e,r.Partial)},n.getMinimumPosition=function(){var e,t,n=this._timeBounds;if(null===n.timeshiftDepth)return null!==(e=n.absoluteMinimumTime)&&void 0!==e?e:0;var r,i=n.maximumTimeData;if(n.maximumTimeData.isLinear){var a=performance.now()-i.time;r=i.value+a/1e3}else r=i.value;var o=r-n.timeshiftDepth;return Math.max(null!==(t=n.absoluteMinimumTime)&&void 0!==t?t:0,o)},n.getMaximumPosition=function(){var e=this._timeBounds.maximumTimeData;if(!e.isLinear)return e.value;var t=performance.now()-e.time;return e.value+t/1e3},n.updateRepresentationsDeciperability=function(e){var t=function(e,t){for(var n,r=[],i=g(e.periods);!(n=i()).done;)for(var a,o=n.value,s=g(o.getAdaptations());!(a=s()).done;)for(var u,l=a.value,c=g(l.representations);!(u=c()).done;){var d=u.value,f=t(d);f!==d.decipherable&&(r.push({manifest:e,period:o,adaptation:l,representation:d}),d.decipherable=f)}return r}(this,e);t.length>0&&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=e.mimeType,r=e.url,i="gen-image-ada-"+_(),o="gen-image-rep-"+_(),s=new c.Z({id:i,type:"image",representations:[{bitrate:0,id:o,mimeType:n,index:new v({media:r})}]},{isManuallyAdded:!0});if(s.representations.length>0&&!s.isSupported){var u=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(u)}return 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,o=n.url,s=n.language,u=n.languages,l=n.closedCaption,d=null!=s?[s]:null!=u?u:[];return e.concat(d.map((function(e){var n="gen-text-ada-"+_(),s="gen-text-rep-"+_(),u=new c.Z({id:n,type:"text",language:e,closedCaption:l,representations:[{bitrate:0,id:s,mimeType:r,codecs:i,index:new v({media:o})}]},{isManuallyAdded:!0});if(u.representations.length>0&&!u.isSupported){var d=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(d)}return u})))}),[]);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.contentWarnings=e.contentWarnings,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;i<t.length;i++){for(var a=t[i],o=n,s=e[o];null!=s&&s.id!==a.id;)s=e[++o];if(null!=s){m(s,a,r.Full);var u=t.slice(n,i),l=o-n;e.splice.apply(e,[n,l].concat(u)),n=i+1}}if(n>e.length)p.Z.error("Manifest: error when updating Periods");else{n<e.length&&e.splice(n,e.length-n);var c=t.slice(n,t.length);c.length>0&&e.push.apply(e,c)}}(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.start<t[0].start){if(n.end!==t[0].start)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");e.push.apply(e,t)}else{var i=(0,h.Z)(e,(function(e){return e.id===t[0].id}));if(i<0)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: incoherent data");m(e[i],t[0],r.Partial);for(var o=i+1,s=1;s<t.length;s++){for(var u=t[s],l=-1,c=o;c<e.length;c++)if(u.id===e[c].id){l=c;break}if(l<0)return void e.splice.apply(e,[o,e.length-o].concat(t.slice(s,t.length)));l>o&&(e.splice(o,l-o),l=o),m(e[l],u,r.Full),o++}o<e.length&&e.splice(o,e.length-o)}}}else e.splice.apply(e,[0,0].concat(t))}(this.periods,e.periods);for(var n=this.getMinimumPosition();this.periods.length>0;){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)},520:function(e,t,n){"use strict";n.d(t,{K:function(){return a},z:function(){return i}});var r=n(1946);function i(e,t){return e.segment.id===t.segment.id&&e.representation.id===t.representation.id&&e.adaptation.id===t.adaptation.id&&e.period.id===t.period.id}function a(e){if((0,r.Z)(e))return"";var t=e.period,n=e.adaptation,i=e.representation,a=e.segment;return n.type+" P: "+t.id+" A: "+n.id+" R: "+i.id+" S: "+(a.isInit?"init":a.complete?a.time+"-"+a.duration:""+a.time)}},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,{Qy:function(){return l},Xj:function(){return d},iz:function(){return u},lp:function(){return s},nR:function(){return c},t_:function(){return o}});var r=n(3887),i=n(811),a=n(6968);function o(e,t){var n=l(e,t);return null!==n?e.subarray(n[1],n[2]):null}function s(e,t){for(var n=[],r=e;;){var a=l(r,t);if(null===a)return n;(0,i.Z)(0!==a[2]&&0!==r.length),n.push(r.subarray(a[1],a[2])),r=r.subarray(a[2])}}function u(e,t){var n=l(e,t);return null!==n?e.subarray(n[0],n[2]):null}function l(e,t){for(var n,r,i=e.length,o=0,s=0;o+8<=i;){if(r=o,s=(0,a.pX)(e,r),r+=4,n=(0,a.pX)(e,r),r+=4,0===s)s=i-o;else if(1===s){if(r+8>i)return null;s=(0,a.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 c(e,t,n,r,i){for(var o,s=e.length,u=0;u<s;u+=o){var l=u;o=(0,a.pX)(e,l),l+=4;var c=(0,a.pX)(e,l);if(l+=4,0===o)o=s-u;else if(1===o){if(l+8>s)return;o=(0,a.pV)(e,l),l+=8}if(1970628964===c&&l+16<=s&&(0,a.pX)(e,l)===t&&(0,a.pX)(e,l+4)===n&&(0,a.pX)(e,l+8)===r&&(0,a.pX)(e,l+12)===i)return l+=16,e.subarray(l,u+o)}}function d(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,i=(0,a.pX)(e,n);n+=4;var o=(0,a.pX)(e,n);if(n+=4,0===i)i=t;else if(1===i){if(n+8>t)return r.Z.warn("ISOBMFF: box too short, cannot find offsets"),null;i=(0,a.pV)(e,n),n+=8}if(i<0)throw new Error("ISOBMFF: Size out of range");return 1970628964===o&&(n+=16),[0,n,i]}},6807:function(e,t,n){"use strict";n.d(t,{E3:function(){return u},Le:function(){return o},XA:function(){return i},fs:function(){return s},uq:function(){return a}});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.lp)(e,1836019558).reduce((function(e,t){var n=(0,r.t_)(t,1953653094);return null!==n&&e.push(n),e}),[])}function o(e){return(0,r.t_)(e,1835295092)}function s(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 u(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=[];t<n.length;){var s=void 0;try{s=(0,o.Qy)(n,1886614376)}catch(e){return r.Z.warn("ISOBMFF:",e),a}if(null==s)return a;var l=i(n,s[0],s[2]),c=u(l,s[1]-s[0]);void 0!==c&&a.push({systemId:c,data:l}),n[s[0]+4]=102,n[s[0]+5]=114,n[s[0]+6]=101,n[s[0]+7]=101,t=s[2]}return a}function u(e,t){if(e[t]>1)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,{J6:function(){return m},LD:function(){return h},MM:function(){return v},Qx:function(){return f},Wf:function(){return d},s9:function(){return g}});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="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(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,c=(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 d=[];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,d.push({time:l,duration:h,timescale:c,range:[r,r+v-1]}),l+=h,r+=v}return d}function f(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 p(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)}}function v(e){var t=(0,u.uq)(e);if(0!==t.length){for(var n,r=0,a=l(t);!(n=a()).done;){var o=n.value,c=(0,s.t_)(o,1953658222);if(null===c)return;var d=0,f=c[d];if(d+=1,f>1)return;var v=(0,i.QI)(c,d);d+=3;var h=(256&v)>0,m=0;if(!h&&void 0===(m=p(o)))return;var g=(1&v)>0,y=(4&v)>0,_=(512&v)>0,b=(1024&v)>0,T=(2048&v)>0,E=(0,i.pX)(c,d);d+=4,g&&(d+=4),y&&(d+=4);for(var S=E,w=0;S-- >0;)h?(w+=(0,i.pX)(c,d),d+=4):w+=m,_&&(d+=4),b&&(d+=4),T&&(d+=4);r+=w}return r}}function h(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 m(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 g(e){for(var t=[],n=0;n<e.length;){var o=(0,u.E3)(e,n);if(null===o)break;var s=o.length;n+=s;var l=o[0];if(0!==l)r.Z.warn("ISOBMFF: EMSG version "+l.toString()+" not supported.");else{var c=4,d=(0,a.DM)(o,c),f=d.end,p=d.string;c=f;var v=(0,a.DM)(o,c),h=v.end,m=v.string;c=h;var g=(0,i.pX)(o,c);c+=4;var y=(0,i.pX)(o,c);c+=4;var _=(0,i.pX)(o,c);c+=4;var b=(0,i.pX)(o,c);c+=4;var T={schemeIdUri:p,value:m,timescale:g,presentationTimeDelta:y,eventDuration:_,id:b,messageData:o.subarray(c,s)};t.push(T)}}if(0!==t.length)return t}},3203:function(e,t,n){"use strict";var r=n(6968),i=n(3635);t.Z=function(e){var t=0,n=e.length,a=(0,i.uR)(e.subarray(t+1,t+8));if(t+=8,137!==e[0]||"BIF\r\n\n"!==a)throw new Error("Invalid BIF file");var o=e[t],s=e[t+=1],u=e[t+=1],l=e[t+=1];t+=1;var c=[o,s,u,l].join(".");if(s>0)throw new Error("Unhandled version: "+s);var d=(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===d)throw new Error("bif: no images to parse");for(var _=0,b=null;t<n;){var T=(0,r.dN)(e,t);t+=4;var E=(0,r.dN)(e,t);if(t+=4,null!==b){var S=b.timestamp*f,w=f,k=e.slice(b.offset,E);y.push({index:_,duration:w,ts:S,data:k}),_++}if(4294967295===T)break;b={timestamp:T,offset:E}}return{fileFormat:"BIF",version:c,imageCount:d,timescale:1e3,format:p,width:v,height:h,aspectRatio:m,isVod:g,thumbs:y}}},7403:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(3887),i=n(3911),a=n(1915),o=n(6394),s=n(4784);function u(e,t){if(t.timescale!==e.timescale){var n=e.timescale;e.timeline.push({start:t.time/t.timescale*n,duration:t.duration/t.timescale*n,repeatCount:void 0===t.count?0:t.count,range:t.range})}else e.timeline.push({start:t.time,duration:t.duration,repeatCount:void 0===t.count?0:t.count,range:t.range});return!0}var l=function(){function e(e,t){var n,r,a=t.periodStart,o=t.periodEnd,u=t.representationBaseURLs,l=t.representationId,c=t.representationBitrate,d=t.isEMSGWhitelisted,f=null!==(n=e.timescale)&&void 0!==n?n:1,p=(null!=e.presentationTimeOffset?e.presentationTimeOffset:0)-a*f,v=u.map((function(e){return e.url})),h=(0,s.k6)(v,void 0!==e.initialization?e.initialization.media:void 0,l,c),m=void 0!==e.initialization?e.initialization.range:void 0!==e.indexRange?[0,e.indexRange[0]-1]:void 0;this._index={indexRange:e.indexRange,indexTimeOffset:p,initialization:{mediaURLs:h,range:m},mediaURLs:(0,s.k6)(v,e.media,l,c),startNumber:e.startNumber,timeline:null!==(r=e.timeline)&&void 0!==r?r:[],timescale:f},this._scaledPeriodEnd=null==o?void 0:(0,i.gT)(o,this._index),this._isInitialized=this._index.timeline.length>0,this._isEMSGWhitelisted=d}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;t<e.length;t++)u(this._index,e[t]);this._isInitialized=!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return this._isInitialized},t._replace=function(e){this._index=e._index,this._isInitialized=e._isInitialized,this._scaledPeriodEnd=e._scaledPeriodEnd,this._isEMSGWhitelisted=e._isEMSGWhitelisted},t._update=function(){r.Z.error("Base RepresentationIndex: Cannot update a SegmentList")},e}()},1915:function(e,t,n){"use strict";function r(e,t){var n,r,i=e.initialization;return void 0!==t&&(r={isEMSGWhitelisted:t}),{id:"init",isInit:!0,time:0,end:0,duration:0,timescale:1,range:null!=i?i.range:void 0,indexRange:e.indexRange,mediaURLs:null!==(n=null==i?void 0:i.mediaURLs)&&void 0!==n?n:null,complete:!0,privateInfos:r,timestampOffset:-e.indexTimeOffset/e.timescale}}n.d(t,{Z:function(){return r}})},6394:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3911),i=n(4784);function a(e,t,n,a,o){for(var s,u,l=(0,r.gT)(t,e),c=(0,r.gT)(t+n,e),d=e.timeline,f=e.timescale,p=e.mediaURLs,v=e.startNumber,h=null!=v?v:1,m=[],g=d.length,y=d.length>0&&null!=d[0].duration?d[0].duration:0,_=0;_<g;_++){var b=d[_],T=b.duration,E=b.start,S=b.range;y=Math.max(y,T);for(var w=(0,r.KF)(b,d[_+1],o),k=!1!==e.availabilityTimeComplete||_!==g-1&&0!==w,A=(s=T,u=void 0,(u=l-E)>0?Math.floor(u/s):0),x=E+A*T;x<c&&A<=w;){var I=h+A,Z=null===p?null:p.map((0,i.QB)(x,I)),R=x-e.indexTimeOffset,M={id:String(x),time:R/f,end:(R+T)/f,duration:T/f,isInit:!1,range:S,timescale:1,mediaURLs:Z,number:I,timestampOffset:-e.indexTimeOffset/f,complete:k,privateInfos:{isEMSGWhitelisted:a}};m.push(M),x=E+ ++A*T}if(x>=c)return m;h+=w+1}return m}},4784:function(e,t,n){"use strict";n.d(t,{QB:function(){return u},k6:function(){return o}});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)}))}}},3501:function(e,t,n){"use strict";n.d(t,{Z:function(){return He}});var r=n(7904),i=n(1946),a=n(6872),o=n(3887),s=n(3274),u=n(9829);function l(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<t.length;r++){var i=t[r].index.getLastPosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.min(n,i))}return null===n?null:n}function d(e){for(var t=e.length-1;t>=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 f(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getFirstPosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.max(n,i))}return null===n?null:n}function p(e){for(var t=0;t<=e.length-1;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=f(r);if(void 0===u)return;a=u}if(void 0!==i){var l=f(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 next one to calculate first position");if(null!==s)return null!==a?Math.max(a,s):s;if(null!==a)return a}}}var v=n(9592),h=n(908),m=n(1679),g=n(3635);var y=function(){function e(e){this._isDynamic=e.isDynamic,this._timeShiftBufferDepth=e.isDynamic&&void 0!==e.timeShiftBufferDepth?e.timeShiftBufferDepth:null}var t=e.prototype;return t.setLastPosition=function(e,t){this._lastPosition=e,this._positionTime=t},t.lastPositionIsKnown=function(){return this._isDynamic?null!=this._positionTime&&null!=this._lastPosition:null!=this._lastPosition},t.estimateMinimumBound=function(){if(!this._isDynamic||null===this._timeShiftBufferDepth)return 0;var e=this.estimateMaximumBound();return void 0!==e?e-this._timeShiftBufferDepth:void 0},t.estimateMaximumBound=function(){return this._isDynamic&&null!=this._positionTime&&null!=this._lastPosition?Math.max(this._lastPosition-this._positionTime+performance.now()/1e3,0):this._lastPosition},e}(),_=n(8999),b=n(5138),T=n(7714),E=n(6923);function S(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var k=function(e,t){for(var n,r=S(t);!(n=r()).done;)for(var i,a=n.value,o=a.adaptation,s=S(a.trickModeAttachedAdaptationIds);!(i=s()).done;)for(var u,l=i.value,c=S(_.r);!(u=c()).done;){var d=e[u.value];if(void 0!==d)for(var f,p=S(d);!(f=p()).done;){var v=f.value;v.id===l&&(void 0===v.trickModeTracks&&(v.trickModeTracks=[]),v.trickModeTracks.push(o))}}},A=["subtitle","caption"];function x(e,t,n,r){function i(e,t){var n=e.split("/")[0];return(0,T.Z)(_.r,n)?n:"application/bif"===e?"image":"application/ttml+xml"===e||"application/mp4"===e&&null!=t&&null!=(0,s.Z)(t,(function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri&&(0,T.Z)(A,e.value)}))?"text":void 0}function a(e){switch(e.substring(0,3)){case"avc":case"hev":case"hvc":case"vp8":case"vp9":case"av1":return"video";case"vtt":return"text";case"bif":return"image"}switch(e.substring(0,4)){case"mp4a":return"audio";case"wvtt":case"stpp":return"text"}}if(null!==t){var o=i(t,r);if(void 0!==o)return o}if(null!==n){var u=a(n);if(void 0!==u)return u}for(var l=0;l<e.length;l++){var c=e[l].attributes,d=c.mimeType,f=c.codecs;if(void 0!==d){var p=i(d,r);if(void 0!==p)return p}if(void 0!==f){var v=a(f);if(void 0!==v)return v}}}var I=n(8026);var Z=n(7403),R=n(3911),M=n(1915),C=n(4784),P=function(){function e(e,t){var n;if(void 0===e.duration)throw new Error("Invalid SegmentList: no duration");var r=t.periodStart,i=t.representationBaseURLs,a=t.representationId,o=t.representationBitrate,s=t.isEMSGWhitelisted;this._isEMSGWhitelisted=s,this._periodStart=r;var u=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,l=null!==(n=e.timescale)&&void 0!==n?n:1,c=u-r*l,d=i.map((function(e){return e.url})),f=e.list.map((function(e){return{mediaURLs:(0,C.k6)(d,e.media,a,o),mediaRange:e.mediaRange}}));this._index={list:f,timescale:l,duration:e.duration,indexTimeOffset:c,indexRange:e.indexRange,initialization:null==e.initialization?void 0:{mediaURLs:(0,C.k6)(d,e.initialization.media,a,o),range:e.initialization.range}}}var t=e.prototype;return t.getInitSegment=function(){var e=(0,M.Z)(this._index);return void 0===e.privateInfos&&(e.privateInfos={}),e.privateInfos.isEMSGWhitelisted=this._isEMSGWhitelisted,e},t.getSegments=function(e,t){for(var n=this._index,r=n.duration,i=n.list,a=n.timescale,o=r/a,s=e-this._periodStart,u=(0,R.PZ)(s,t,a),l=u[0],c=u[1],d=Math.min(i.length-1,Math.floor(c/r)),f=[],p=Math.floor(l/r);p<=d;){var v=i[p].mediaRange,h=i[p].mediaURLs,m=p*o+this._periodStart,g={id:String(p),time:m,isInit:!1,range:v,duration:o,timescale:1,end:m+o,mediaURLs:h,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};f.push(g),p++}return f},t.shouldRefresh=function(e,t){return!1},t.getFirstPosition=function(){return this._periodStart},t.getLastPosition=function(){var e=this._index,t=e.duration;return e.list.length*t/e.timescale+this._periodStart},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index},t._update=function(){o.Z.error("List RepresentationIndex: Cannot update a SegmentList")},e}(),D=n(9362),N=n(8232),O=n(1091),L=n(5505),B=n(6394);function U(e,t,n){return t+a.Z.getCurrent().DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR*e>=n}function F(e,t,n,r){var a=e.start,s=e.duration,u=e.repeatCount;return void 0===a&&(null===t?a=r:(0,i.Z)(t.duration)||(a=t.start+t.duration*(t.repeatCount+1))),void 0!==s&&!isNaN(s)||null===n||void 0===n.start||isNaN(n.start)||void 0===a||isNaN(a)||(s=n.start-a),void 0===a||isNaN(a)||void 0===s||isNaN(s)||void 0!==u&&isNaN(u)?(o.Z.warn('DASH: A "S" Element could not have been parsed.'),null):{start:a,duration:s,repeatCount:void 0===u?0:u}}function z(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"t":var i=parseInt(r.value,10);isNaN(i)?o.Z.warn('DASH: invalid t ("'+r.value+'")'):t.start=i;break;case"d":var a=parseInt(r.value,10);isNaN(a)?o.Z.warn('DASH: invalid d ("'+r.value+'")'):t.duration=a;break;case"r":var s=parseInt(r.value,10);isNaN(s)?o.Z.warn('DASH: invalid r ("'+r.value+'")'):t.repeatCount=s}}return t}function V(e,t){for(var n=[],r=0;r<e.length;r++)n.push(z(e[r]));for(var i=[],a=0;a<n.length;a++){var o=F(n[a],void 0===i[i.length-1]?null:i[i.length-1],void 0===n[a+1]?null:n[a+1],t);null!==o&&i.push(o)}return i}function K(e,t,n){var r,i=function(e,t){if(0===e.length||0===t.length)return null;var n=e[0].start,r=t[0].getAttribute("t"),i=null===r?null:parseInt(r,10);if(null===i||Number.isNaN(i))return null;if(n===i)return{prevSegmentsIdx:0,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(n<i)for(var a=e[0],o=0;;){if(a.repeatCount>0){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],c=i;;){var d=l.getAttribute("d"),f=null===d?null:parseInt(d,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-c;if(h%f==0&&h/f<=v)return{repeatNumberInPrevSegments:0,repeatNumberInNewElements:h/f,prevSegmentsIdx:0,newElementsIdx:u}}c+=f*(v+1)}else c+=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;c=g}if(c===n)return{newElementsIdx:u,prevSegmentsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(c>i)return null}}(t,e);if(null===i)return o.Z.warn('DASH: Cannot perform "based" update. Common segment not found.'),V(e,n);var a=i.prevSegmentsIdx,s=i.newElementsIdx,u=i.repeatNumberInPrevSegments,l=i.repeatNumberInNewElements,c=t.length-a+s-1;if(c>=e.length)return o.Z.info('DASH: Cannot perform "based" update. New timeline too short'),V(e,n);var d=t.slice(a);if(u>0){var f=d[0];f.start+=f.duration*u,d[0].repeatCount-=u}if(l>0&&0!==s)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form.'),V(e,n);var p=d[d.length-1],v=z(e[c]),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.'),V(e,n);void 0!==v.repeatCount&&v.repeatCount>p.repeatCount&&(p.repeatCount=v.repeatCount);for(var m=[],g=[],y=c+1;y<e.length;y++)g.push(z(e[y]));for(var _=0;_<g.length;_++){var b=F(g[_],void 0===m[m.length-1]?p:m[m.length-1],void 0===g[_+1]?null:g[_+1],n);null!==b&&m.push(b)}return d.concat(m)}var G=function(){function e(t,n){var r,i,a;if(!e.isTimelineIndexArgument(t))throw new Error("The given index is not compatible with a TimelineRepresentationIndex.");var o=n.availabilityTimeComplete,s=n.manifestBoundsCalculator,u=n.isDynamic,l=n.isLastPeriod,c=n.representationBaseURLs,d=n.representationId,f=n.representationBitrate,p=n.periodStart,v=n.periodEnd,h=n.isEMSGWhitelisted,m=null!==(r=t.timescale)&&void 0!==r?r:1,g=(null!=t.presentationTimeOffset?t.presentationTimeOffset:0)-p*m;this._manifestBoundsCalculator=s,this._isEMSGWhitelisted=h,this._isLastPeriod=l,this._lastUpdate=null==n.receivedTime?performance.now():n.receivedTime,this._unsafelyBaseOnPreviousIndex=null,null!==n.unsafelyBaseOnPreviousRepresentation&&n.unsafelyBaseOnPreviousRepresentation.index instanceof e&&(n.unsafelyBaseOnPreviousRepresentation.index._unsafelyBaseOnPreviousIndex=null,this._unsafelyBaseOnPreviousIndex=n.unsafelyBaseOnPreviousRepresentation.index),this._isDynamic=u,this._parseTimeline=null!==(i=t.timelineParser)&&void 0!==i?i:null;var y=c.map((function(e){return e.url}));this._index={availabilityTimeComplete:o,indexRange:t.indexRange,indexTimeOffset:g,initialization:null==t.initialization?void 0:{mediaURLs:(0,C.k6)(y,t.initialization.media,d,f),range:t.initialization.range},mediaURLs:(0,C.k6)(y,t.media,d,f),startNumber:t.startNumber,timeline:null!==(a=t.timeline)&&void 0!==a?a:null,timescale:m},this._scaledPeriodStart=(0,R.gT)(p,this._index),this._scaledPeriodEnd=null==v?void 0:(0,R.gT)(v,this._index)}var t=e.prototype;return t.getInitSegment=function(){return(0,M.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var n=this._index,r=n.mediaURLs,i=n.startNumber,a=n.timeline,o=n.timescale,s=n.indexTimeOffset;return(0,B.Z)({mediaURLs:r,startNumber:i,timeline:a,timescale:o,indexTimeOffset:s},e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstPosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;return 0===e.length?null:(0,R.zG)(e[0].start,this._index)},t.getLastPosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=e.getIndexEnd(this._index.timeline,this._scaledPeriodStart);return null===t?null:(0,R.zG)(t,this._index)},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=this._index,n=t.timeline,r=t.timescale,i=t.indexTimeOffset;return(0,O.Z)(e,n,r,i)},t.checkDiscontinuity=function(e){this._refreshTimeline();var t=this._index.timeline;return null===t&&(t=this._getTimeline(),this._index.timeline=t),(0,R._j)({timeline:t,timescale:this._index.timescale,indexTimeOffset:this._index.indexTimeOffset},e,this._scaledPeriodEnd)},t.canBeOutOfSyncError=function(e){return!!this._isDynamic&&(e instanceof D.Z&&e.isHttpError(404))},t.areSegmentsChronologicallyGenerated=function(){return!0},t._replace=function(e){this._parseTimeline=e._parseTimeline,this._index=e._index,this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._manifestBoundsCalculator=e._manifestBoundsCalculator,this._isLastPeriod=e._isLastPeriod},t._update=function(e){null===this._index.timeline&&(this._index.timeline=this._getTimeline()),null===e._index.timeline&&(e._index.timeline=e._getTimeline()),(0,L.Z)(this._index.timeline,e._index.timeline)&&(this._index.startNumber=e._index.startNumber),this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._isLastPeriod=e._isLastPeriod},t.isFinished=function(){if(!this._isDynamic||!this._isLastPeriod)return!0;null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;if(void 0===this._scaledPeriodEnd||0===e.length)return!1;var t=e[e.length-1],n=(0,R.jH)(t,null,this._scaledPeriodEnd);return U(this._index.timescale,n,this._scaledPeriodEnd)},t.isInitialized=function(){return!0},e.isTimelineIndexArgument=function(e){return"function"==typeof e.timelineParser||Array.isArray(e.timeline)},t._refreshTimeline=function(){null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._manifestBoundsCalculator.estimateMinimumBound();if(null!=e){var t=(0,R.gT)(e,this._index),n=(0,N.Z)(this._index.timeline,t);void 0!==this._index.startNumber&&(this._index.startNumber+=n)}},e.getIndexEnd=function(e,t){return e.length<=0?null:(0,R.jH)(e[e.length-1],null,t)},t._getTimeline=function(){if(null===this._parseTimeline)return null!==this._index.timeline?this._index.timeline:(o.Z.error("DASH: Timeline already lazily parsed."),[]);var e=this._parseTimeline();this._parseTimeline=null;var t,n=a.Z.getCurrent().MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY;return null===this._unsafelyBaseOnPreviousIndex||e.length<n?V(e,this._scaledPeriodStart):(null===this._unsafelyBaseOnPreviousIndex._index.timeline?(t=this._unsafelyBaseOnPreviousIndex._getTimeline(),this._unsafelyBaseOnPreviousIndex._index.timeline=t):t=this._unsafelyBaseOnPreviousIndex._index.timeline,this._unsafelyBaseOnPreviousIndex=null,K(e,t,this._scaledPeriodStart))},e}(),H=function(){function e(e,t){var n,r=t.aggressiveMode,i=t.availabilityTimeOffset,a=t.manifestBoundsCalculator,o=t.isDynamic,s=t.periodEnd,u=t.periodStart,l=t.representationBaseURLs,c=t.representationId,d=t.representationBitrate,f=t.isEMSGWhitelisted,p=null!==(n=e.timescale)&&void 0!==n?n:1,v=0===l.length?0:l.reduce((function(e,t){return Math.min(e,t.availabilityTimeOffset)}),1/0);this._availabilityTimeOffset=i+v,this._manifestBoundsCalculator=a,this._aggressiveMode=r;var h=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,m=h-u*p;if(void 0===e.duration)throw new Error("Invalid SegmentTemplate: no duration");var g=l.map((function(e){return e.url}));this._index={duration:e.duration,timescale:p,indexRange:e.indexRange,indexTimeOffset:m,initialization:null==e.initialization?void 0:{mediaURLs:(0,C.k6)(g,e.initialization.media,c,d),range:e.initialization.range},mediaURLs:(0,C.k6)(g,e.media,c,d),presentationTimeOffset:h,startNumber:e.startNumber},this._isDynamic=o,this._periodStart=u,this._scaledPeriodEnd=null==s?void 0:(s-u)*p,this._isEMSGWhitelisted=f}var t=e.prototype;return t.getInitSegment=function(){return(0,M.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){var n=this._index,r=n.duration,i=n.startNumber,a=n.timescale,o=n.mediaURLs,s=this._periodStart*a,u=this._scaledPeriodEnd,l=e*a-s,c=(e+t)*a-s,d=this._getFirstSegmentStart(),f=this._getLastSegmentStart();if(null==d||null==f)return[];var p=Math.max(d,l),v=Math.min(f,c);if(v+r<=p)return[];for(var h=[],m=null!=i?i:1,g=Math.floor(p/r),y=g*r;y<=v;y+=r){var _=g+m,b=null!=u&&y+r>u?u-y:r,T=y+s,E=y+this._index.presentationTimeOffset,S=null===o?null:o.map((0,C.QB)(E,_)),w={id:String(_),number:_,time:T/a,end:(T+b)/a,duration:b/a,timescale:1,isInit:!1,scaledDuration:b/a,mediaURLs:S,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};h.push(w),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&&U(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&&e<this._periodStart)return null}var t=this._index,n=t.duration,r=t.timescale,i=this._manifestBoundsCalculator.estimateMinimumBound();if(void 0!==i){var a=i>this._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 o=this._aggressiveMode?n/r:0;if(null!=this._scaledPeriodEnd&&this._scaledPeriodEnd<(i+o-this._periodStart)*this._index.timescale)return this._scaledPeriodEnd<n?null:(Math.floor(this._scaledPeriodEnd/n)-1)*n;var s=(i-this._periodStart)*r;if(s<0)return null;var u=((void 0!==this._availabilityTimeOffset?this._availabilityTimeOffset:0)+o)*r,l=Math.floor((s+u)/n);return l<=0?null:(l-1)*n}var c=null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:0,d=Math.ceil(c/n)-1,f=d*n;return c-f>a.Z.getCurrent().MINIMUM_SEGMENT_SIZE*r||0===d?f:(d-1)*n},e}();function W(e,t){if(0===t.length)return e;var n=t.map((function(e){var t,n;return{url:e.value,availabilityTimeOffset:null!==(t=e.attributes.availabilityTimeOffset)&&void 0!==t?t:0,availabilityTimeComplete:null===(n=e.attributes.availabilityTimeComplete)||void 0===n||n}}));if(0===e.length)return n;for(var r=[],i=0;i<e.length;i++)for(var a=e[i],o=0;o<n.length;o++){var s=n[o],l=(0,u.Z)(a.url,s.url),c=a.availabilityTimeOffset+s.availabilityTimeOffset;r.push({url:l,availabilityTimeOffset:c,availabilityTimeComplete:s.availabilityTimeComplete})}return r}function j(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Y(e){var t=e.adaptationProfiles,n=e.manifestProfiles,r=e.codecs;if(void 0!==r)return-1===((null!=t?t:"")+(null!=n?n:"")).indexOf("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")||"hvc1.2.4.L153.B0"!==r&&"hev1.2.4.L153.B0"!==r?/^vp(08|09|10)/.exec(r)?function(e){var t,n,r,i=e.split("."),a=i[0],o=(i[1],i[2],i[3]),s=(i[4],i[5]),u=i[6],l=i[7];if(("vp08"===a||"vp09"===a||"vp10"===a)&&((void 0!==o&&"10"===o||"12"===o)&&(t=parseInt(o,10)),void 0!==u&&("16"===u?n="pq":"18"===u&&(n="hlg")),void 0!==s&&void 0!==l&&"09"===s&&"09"===l&&(r="rec2020"),void 0!==t&&void 0!==n))return{colorDepth:t,eotf:n,colorSpace:r}}(r):void 0:{colorDepth:10,eotf:"pq",colorSpace:"rec2020"}}function $(e,t,n){for(var r,i,a,u,l,c=[],d=function(){for(var e=l.value,d=null!=e.attributes.id?e.attributes.id:String(e.attributes.bitrate)+(null!=e.attributes.height?"-"+e.attributes.height:"")+(null!=e.attributes.width?"-"+e.attributes.width:"")+(null!=e.attributes.mimeType?"-"+e.attributes.mimeType:"")+(null!=e.attributes.codecs?"-"+e.attributes.codecs:"");c.some((function(e){return e.id===d}));)d+="-dup";var f=null!==(i=null===(r=n.unsafelyBaseOnPreviousAdaptation)||void 0===r?void 0:r.getRepresentation(d))&&void 0!==i?i:null,p=function(e,t){var n=[];if(void 0!==e.children.inbandEventStreams&&n.push.apply(n,e.children.inbandEventStreams),void 0!==t.children.inbandEventStreams&&n.push.apply(n,t.children.inbandEventStreams),0!==n.length)return n}(e,t),v=null!==(a=e.attributes.availabilityTimeComplete)&&void 0!==a?a:n.availabilityTimeComplete,h=(null!==(u=e.attributes.availabilityTimeOffset)&&void 0!==u?u:0)+n.availabilityTimeOffset,m=function(e,t){var n,r,i,a=W(t.baseURLs,e.children.baseURLs),o=t.aggressiveMode,s=t.availabilityTimeOffset,u=t.manifestBoundsCalculator,l=t.isDynamic,c=t.end,d=t.start,f=t.receivedTime,p=t.timeShiftBufferDepth,v=t.unsafelyBaseOnPreviousRepresentation,h=t.inbandEventStreams,m={aggressiveMode:o,availabilityTimeComplete:!0,availabilityTimeOffset:s,unsafelyBaseOnPreviousRepresentation:v,isEMSGWhitelisted:function(e){return void 0!==h&&h.some((function(t){return t.schemeIdUri===e.schemeIdUri}))},isLastPeriod:t.isLastPeriod,manifestBoundsCalculator:u,isDynamic:l,periodEnd:c,periodStart:d,receivedTime:f,representationBaseURLs:a,representationBitrate:e.attributes.bitrate,representationId:e.attributes.id,timeShiftBufferDepth:p};if(void 0!==e.children.segmentBase){var g=e.children.segmentBase;i=new Z.Z(g,m)}else if(void 0!==e.children.segmentList){var y=e.children.segmentList;i=new P(y,m)}else if(void 0!==e.children.segmentTemplate||t.parentSegmentTemplates.length>0){var _=t.parentSegmentTemplates.slice(),b=e.children.segmentTemplate;void 0!==b&&_.push(b);var T=I.Z.apply(void 0,[{}].concat(_));m.availabilityTimeComplete=null!==(n=T.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,m.availabilityTimeOffset=(null!==(r=T.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,i=G.isTimelineIndexArgument(T)?new G(T,m):new H(T,m)}else{var E=t.adaptation.children;if(void 0!==E.segmentBase){var S=E.segmentBase;i=new Z.Z(S,m)}else if(void 0!==E.segmentList){var w=E.segmentList;i=new P(w,m)}else i=new H({duration:Number.MAX_VALUE,timescale:1,startNumber:0,media:""},m)}return i}(e,(0,I.Z)({},n,{availabilityTimeOffset:h,availabilityTimeComplete:v,unsafelyBaseOnPreviousRepresentation:f,adaptation:t,inbandEventStreams:p})),g=void 0;null==e.attributes.bitrate?(o.Z.warn("DASH: No usable bitrate found in the Representation."),g=0):g=e.attributes.bitrate;var y={bitrate:g,index:m,id:d},_=void 0;null!=e.attributes.codecs?_=e.attributes.codecs:null!=t.attributes.codecs&&(_=t.attributes.codecs),null!=_&&(_="mp4a.40.02"===_?"mp4a.40.2":_,y.codecs=_),null!=e.attributes.frameRate?y.frameRate=e.attributes.frameRate:null!=t.attributes.frameRate&&(y.frameRate=t.attributes.frameRate),null!=e.attributes.height?y.height=e.attributes.height:null!=t.attributes.height&&(y.height=t.attributes.height),null!=e.attributes.mimeType?y.mimeType=e.attributes.mimeType:null!=t.attributes.mimeType&&(y.mimeType=t.attributes.mimeType),null!=e.attributes.width?y.width=e.attributes.width:null!=t.attributes.width&&(y.width=t.attributes.width);var b=void 0!==t.children.contentProtections?t.children.contentProtections:[];if(void 0!==e.children.contentProtections&&b.push.apply(b,e.children.contentProtections),b.length>0){var T=b.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,i=[],a=j(t.children.cencPssh);!(r=a()).done;){var o=r.value;i.push({systemId:n,data:o})}if(i.length>0){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(T.initData).length>0||T.keyIds.length>0)&&(y.contentProtections=T)}y.hdrInfo=Y({adaptationProfiles:t.attributes.profiles,manifestProfiles:n.manifestProfiles,codecs:_}),c.push(y)},f=j(e);!(l=f()).done;)d();return c}function X(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function J(e){if(void 0===e)return!1;var t="urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"1"===e.value,n="urn:mpeg:dash:role:2011"===e.schemeIdUri&&"description"===e.value;return t||n}function ee(e){return void 0!==e&&("urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"2"===e.value)}function te(e){return void 0!==e&&("urn:mpeg:dash:role:2011"===e.schemeIdUri&&"sign"===e.value)}function ne(e,t){if((0,E.Z)(e.attributes.id))return e.attributes.id;var n=t.isClosedCaption,r=t.isAudioDescription,i=t.isSignInterpreted,a=t.isTrickModeTrack,o=t.type;return(0,E.Z)(e.attributes.language)&&(o+="-"+e.attributes.language),!0===n&&(o+="-cc"),!0===r&&(o+="-ad"),!0===i&&(o+="-si"),a&&(o+="-trickMode"),(0,E.Z)(e.attributes.contentType)&&(o+="-"+e.attributes.contentType),(0,E.Z)(e.attributes.codecs)&&(o+="-"+e.attributes.codecs),(0,E.Z)(e.attributes.mimeType)&&(o+="-"+e.attributes.mimeType),(0,E.Z)(e.attributes.frameRate)&&(o+="-"+e.attributes.frameRate),o}function re(e){if(null!=e.children.supplementalProperties)for(var t,n=X(e.children.supplementalProperties);!(t=n()).done;){var r=t.value;if("urn:mpeg:dash:adaptation-set-switching:2016"===r.schemeIdUri&&null!=r.value)return r.value.split(",").map((function(e){return e.trim()})).filter((function(e){return e}))}return[]}function ie(e,t){var n=t[1].priority-e[1].priority;return 0!==n?n:e[1].isMainAdaptation!==t[1].isMainAdaptation?e[1].isMainAdaptation?-1:1:e[1].indexInMpd-t[1].indexInMpd}function ae(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return oe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var se=(0,h.Z)();function ue(e,t){var n,r,i,a,u,l,c=[],d=function(e,t){var n=[];return e.forEach((function(r,i){var a,o;if(null!=r.attributes.start)a=r.attributes.start;else if(0===i)a=t.isDynamic&&null!=t.availabilityStartTime?t.availabilityStartTime:0;else{var s=n[n.length-1];if(null==s||null==s.periodEnd)throw new Error("Missing start time when parsing periods.");a=s.periodEnd}var u=e[i+1];null!=r.attributes.duration?o=r.attributes.duration:i===e.length-1?o=t.duration:null!=u.attributes.start&&(o=u.attributes.start-a);var l=null!=o?a+o:void 0;n.push({periodStart:a,periodDuration:o,periodEnd:l})})),n}(e,t);if(d.length!==e.length)throw new Error("MPD parsing error: the time information are incoherent.");var f=t.isDynamic,p=t.timeShiftBufferDepth,h=new y({isDynamic:f,timeShiftBufferDepth:p});f||null==t.duration||h.setLastPosition(t.duration);for(var S=function(y){var S=y===e.length-1,w=e[y],A=t.xlinkInfos.get(w),I=W(t.baseURLs,w.children.baseURLs),Z=d[y],R=Z.periodStart,M=Z.periodDuration,C=Z.periodEnd,P=void 0;for(null==w.attributes.id?(o.Z.warn("DASH: No usable id found in the Period. Generating one."),P="gen-dash-period-"+se()):P=w.attributes.id;c.some((function(e){return e.id===P}));)P+="-dup";var D=void 0!==A?A.receivedTime:t.receivedTime,N=null!==(r=null===(n=t.unsafelyBaseOnPreviousManifest)||void 0===n?void 0:n.getPeriod(P))&&void 0!==r?r:null,O=null===(i=w.attributes.availabilityTimeComplete)||void 0===i||i,L=null!==(a=w.attributes.availabilityTimeOffset)&&void 0!==a?a:0,B=t.aggressiveMode,U=t.manifestProfiles,F=w.children.segmentTemplate,z={aggressiveMode:B,availabilityTimeComplete:O,availabilityTimeOffset:L,baseURLs:I,manifestBoundsCalculator:h,end:C,isDynamic:f,isLastPeriod:S,manifestProfiles:U,receivedTime:D,segmentTemplate:F,start:R,timeShiftBufferDepth:p,unsafelyBaseOnPreviousPeriod:N},V=function(e,t){for(var n,r,i,a,u,l,c,d,f={video:[],audio:[],text:[],image:[]},p=[],v={},h=[],m=-1,g=0;g<e.length;g++){var y=e[g],S=y.children,w=S.essentialProperties,A=S.roles,I=Array.isArray(A)&&A.some((function(e){return"main"===e.value}))&&A.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri})),Z=y.children.representations,R=null!==(n=y.attributes.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,M=(null!==(r=y.attributes.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,C=y.attributes.mimeType,P=y.attributes.codecs,D=x(Z,(0,E.Z)(C)?C:null,(0,E.Z)(P)?P:null,null!=S.roles?S.roles:null);if(void 0!==D){var N=null!==(i=y.attributes.selectionPriority)&&void 0!==i?i:1,O=y.attributes.id,L=void 0,B=re(y),U=[];void 0!==t.segmentTemplate&&U.push(t.segmentTemplate),void 0!==y.children.segmentTemplate&&U.push(y.children.segmentTemplate);var F={aggressiveMode:t.aggressiveMode,availabilityTimeComplete:R,availabilityTimeOffset:M,baseURLs:W(t.baseURLs,S.baseURLs),manifestBoundsCalculator:t.manifestBoundsCalculator,end:t.end,isDynamic:t.isDynamic,isLastPeriod:t.isLastPeriod,manifestProfiles:t.manifestProfiles,parentSegmentTemplates:U,receivedTime:t.receivedTime,start:t.start,timeShiftBufferDepth:t.timeShiftBufferDepth,unsafelyBaseOnPreviousAdaptation:null},z=Array.isArray(w)?(0,s.Z)(w,(function(e){return"http://dashif.org/guidelines/trickmode"===e.schemeIdUri})):void 0,V=null===(a=null==z?void 0:z.value)||void 0===a?void 0:a.split(" "),K=void 0!==V;if("video"===D&&I&&m>=0&&f.video.length>m&&!K){var G,H=f.video[m][0];F.unsafelyBaseOnPreviousAdaptation=null!==(l=null===(u=t.unsafelyBaseOnPreviousPeriod)||void 0===u?void 0:u.getAdaptation(H.id))&&void 0!==l?l:null;var j=$(Z,y,F);(G=H.representations).push.apply(G,j),L=H.id}else{var q=S.accessibilities,Y=void 0;void 0!==A&&A.some((function(e){return"dub"===e.value}))&&(Y=!0);var Q=void 0;"text"!==D?Q=!1:void 0!==q&&(Q=q.some(ee));var ae=void 0;"audio"!==D?ae=!1:void 0!==q&&(ae=q.some(J));var oe=void 0;"video"!==D?oe=!1:void 0!==q&&(oe=q.some(te));for(var se=ne(y,{isAudioDescription:ae,isClosedCaption:Q,isSignInterpreted:oe,isTrickModeTrack:K,type:D});(0,T.Z)(h,se);)se+="-dup";L=se,h.push(se),F.unsafelyBaseOnPreviousAdaptation=null!==(d=null===(c=t.unsafelyBaseOnPreviousPeriod)||void 0===c?void 0:c.getAdaptation(se))&&void 0!==d?d:null;var ue={id:se,representations:$(Z,y,F),type:D,isTrickModeTrack:K};if(null!=y.attributes.language&&(ue.language=y.attributes.language),null!=Q&&(ue.closedCaption=Q),null!=ae&&(ue.audioDescription=ae),!0===Y&&(ue.isDub=!0),!0===oe&&(ue.isSignInterpreted=!0),void 0!==V)p.push({adaptation:ue,trickModeAttachedAdaptationIds:V});else{for(var le,ce=-1,de=function(){var e=le.value,t=v[e];if(void 0!==t&&t.newID!==L&&(0,T.Z)(t.adaptationSetSwitchingIDs,O)){ce=(0,b.Z)(f[D],(function(t){return t[0].id===e}));var n,r=f[D][ce];void 0!==r&&r[0].audioDescription===ue.audioDescription&&r[0].closedCaption===ue.closedCaption&&r[0].language===ue.language&&(o.Z.info('DASH Parser: merging "switchable" AdaptationSets',O,e),(n=r[0].representations).push.apply(n,ue.representations),"video"===D&&I&&!r[1].isMainAdaptation&&(m=Math.max(m,ce)),r[1]={priority:Math.max(N,r[1].priority),isMainAdaptation:I||r[1].isMainAdaptation,indexInMpd:Math.min(g,r[1].indexInMpd)})}},fe=X(B);!(le=fe()).done;)de();ce<0&&(f[D].push([ue,{priority:N,isMainAdaptation:I,indexInMpd:g}]),"video"===D&&I&&(m=f.video.length-1))}}null!=O&&null==v[O]&&(v[O]={newID:L,adaptationSetSwitchingIDs:B})}}var pe=_.r.reduce((function(e,t){var n=f[t];return n.length>0&&(n.sort(ie),e[t]=n.map((function(e){return e[0]}))),e}),{});return f.video.sort(ie),k(pe,p),pe}(w.children.adaptations,z),K=(null!==(u=t.xmlNamespaces)&&void 0!==u?u:[]).concat(null!==(l=w.attributes.namespaces)&&void 0!==l?l:[]),G=function(e,t,n){for(var r,i,a,o=[],s=ae(e);!(a=s()).done;)for(var u,l=a.value,c=l.attributes,d=c.schemeIdUri,f=void 0===d?"":d,p=c.timescale,v=void 0===p?1:p,h=n.concat(null!==(r=l.attributes.namespaces)&&void 0!==r?r:[]),m=ae(l.children.events);!(u=m()).done;){var y=u.value;if(void 0!==y.eventStreamData){var _=(null!==(i=y.presentationTime)&&void 0!==i?i:0)/v+t,b=void 0===y.duration?void 0:_+y.duration/v,T=void 0;if(y.eventStreamData instanceof Element)T=y.eventStreamData;else{var E=h.reduce((function(e,t){return e+"xmlns:"+t.key+'="'+t.value+'" '}),"<toremove ");E+=">";var S=(0,g.uR)(new Uint8Array(y.eventStreamData));T=(new DOMParser).parseFromString(E+S+"</toremove>","application/xml").documentElement.childNodes[0]}o.push({start:_,end:b,id:y.id,data:{type:"dash-event-stream",value:{schemeIdUri:f,timescale:v,element:T}}})}}return o}(w.children.eventStreams,R,K),H={id:P,start:R,end:C,duration:M,adaptations:V,streamEvents:G};if(c.unshift(H),!h.lastPositionIsKnown()){var j=function(e){for(var t,n=null,r=!0,i=(0,m.Z)(e).filter((function(e){return null!=e})),a=ae((0,v.Z)(i,(function(e){return e})));!(t=a()).done;)for(var o,s=ae(t.value.representations);!(o=s()).done;){var u=o.value.index.getLastPosition();null!==u&&(r=!1,"number"==typeof u&&(n=null==n?u:Math.max(n,u)))}if(null!=n)return n;if(r)return null;return}(V);if(f)if("number"==typeof j){var q=performance.now()/1e3;h.setLastPosition(j,q)}else{var Y=le(t,R);if(void 0!==Y){var Q=Y[0],oe=Y[1];h.setLastPosition(Q,oe)}}else"number"==typeof j&&h.setLastPosition(j)}},w=e.length-1;w>=0;w--)S(w);if(t.isDynamic&&!h.lastPositionIsKnown()){var A=le(t,0);if(void 0!==A){var I=A[0],Z=A[1];h.setLastPosition(I,Z)}}return function(e){if(0===e.length)return[];for(var t=[e[0]],n=1;n<e.length;n++){for(var r=e[n],i=t[t.length-1];void 0===i.duration||i.start+i.duration>r.start;)o.Z.warn("DASH: Updating overlapping Periods.",null==i?void 0:i.start,r.start),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}(c)}function le(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]}}function ce(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return de(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return de(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 de(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var fe=function e(t,n,r,i,c){void 0===c&&(c=new WeakMap);var f=t.children,v=t.attributes;if(null==n.externalClockOffset){var h="dynamic"===v.type,m=(0,s.Z)(f.utcTimings,(function(e){return"urn:mpeg:dash:utc:direct:2014"===e.schemeIdUri&&null!=e.value})),g=null!=m&&null!=m.value?l(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||"urn:mpeg:dash:utc:http-xsdate: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 i.success?(n.externalClockOffset=l(i.data),e(t,n,r,!0)):(r.push(i.error),o.Z.warn("DASH Parser: Error on fetching the clock ressource",i.error),e(t,n,r,!0))}}}}}for(var b=[],T=0;T<f.periods.length;T++){var E=f.periods[T].attributes,S=E.xlinkHref,w=E.xlinkActuate;null!=S&&"onLoad"===w&&b.push({index:T,ressource:S})}return 0===b.length?function(e,t,n,r){var i,s,l,c,f,v,h=e.children,m=e.attributes,g="dynamic"===m.type,y=W(void 0!==t.url?[{url:(0,u.f)(t.url),availabilityTimeOffset:0,availabilityTimeComplete:!0}]:[],h.baseURLs),_=function(e,t){return"dynamic"!==e.type?0:null==e.availabilityStartTime?null==t?0:t:e.availabilityStartTime}(m,t.referenceDateTime),b=m.timeShiftBufferDepth,T=t.externalClockOffset,E=t.unsafelyBaseOnPreviousManifest,S={aggressiveMode:t.aggressiveMode,availabilityStartTime:_,baseURLs:y,clockOffset:T,duration:m.duration,isDynamic:g,manifestProfiles:e.attributes.profiles,receivedTime:t.manifestReceivedTime,timeShiftBufferDepth:b,unsafelyBaseOnPreviousManifest:E,xlinkInfos:r,xmlNamespaces:e.attributes.namespaces},w=ue(h.periods,S),k=m.duration,A=null;void 0!==m.minimumUpdatePeriod&&m.minimumUpdatePeriod>=0&&(c=0===m.minimumUpdatePeriod?a.Z.getCurrent().DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:m.minimumUpdatePeriod);var x=function(e){if(0===e.length)throw new Error("DASH Parser: no period available for a dynamic content");return[p(e),d(e)]}(w),I=x[0],Z=x[1],R=performance.now();if(g){var M;if(f=I,A=null!=b?b:null,void 0!==Z)M=Z;else{var C=null!=_?_:0,P=t.externalClockOffset;if(void 0===P)o.Z.warn("DASH Parser: use system clock to define maximum position"),M=Date.now()/1e3-C;else M=(performance.now()+P)/1e3-C}v={isLinear:!0,value:M,time:R},null!==A&&void 0!==f&&M-f>A&&(A=M-f)}else{f=void 0!==I?I:void 0!==(null===(i=w[0])||void 0===i?void 0:i.start)?w[0].start:0;var D=null!=k?k:1/0;if(void 0!==w[w.length-1]){var N=w[w.length-1],O=null!==(s=N.end)&&void 0!==s?s:void 0!==N.duration?N.start+N.duration:void 0;void 0!==O&&O<D&&(D=O)}void 0!==Z&&Z<D&&(D=Z),v={isLinear:!1,value:D,time:R}}var L=!g||void 0===e.attributes.minimumUpdatePeriod&&(void 0!==(null===(l=w[w.length-1])||void 0===l?void 0:l.end)||void 0!==e.attributes.duration);return{type:"done",value:{parsed:{availabilityStartTime:_,clockOffset:t.externalClockOffset,isDynamic:g,isLive:g,isLastPeriodKnown:L,periods:w,publishTime:m.publishTime,suggestedPresentationDelay:m.suggestedPresentationDelay,transportType:"dash",timeBounds:{absoluteMinimumTime:f,timeshiftDepth:A,maximumTimeData:v},lifetime:c,uris:null==t.url?h.locations:[t.url].concat(h.locations)},warnings:n}}}(t,n,r,c):{type:"needs-xlinks",value:{xlinksUrls:b.map((function(e){return e.ressource})),continue:function(a){if(a.length!==b.length)throw new Error("DASH parser: wrong number of loaded ressources.");for(var o=a.length-1;o>=0;o--){var s,u=b[o].index,l=a[o],d=l.parsed,p=l.warnings,v=l.receivedTime,h=l.sendingTime,m=l.url;p.length>0&&r.push.apply(r,p);for(var g,y=ce(d);!(g=y()).done;){var _=g.value;c.set(_,{receivedTime:v,sendingTime:h,url:m})}(s=f.periods).splice.apply(s,[u,1].concat(d))}return e(t,n,r,i,c)}}}},pe=n(7326),ve=n(4578),he=n(2146),me=n(9689),ge=/^P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,ye=/([0-9]+)-([0-9]+)/;function _e(e,t){return"true"===e?[!0,null]:"false"===e?[!1,null]:[!1,new Ze("`"+t+'` property is not a boolean value but "'+e+'"')]}function be(e,t){var n=parseInt(e,10);return isNaN(n)?[null,new Ze("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function Te(e,t){if("INF"===e)return[1/0,null];var n=parseFloat(e);return isNaN(n)?[null,new Ze("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function Ee(e,t){if("true"===e)return[!0,null];if("false"===e)return[!1,null];var n=parseInt(e,10);return isNaN(n)?[null,new Ze("`"+t+'` property is not a boolean nor an integer but "'+e+'"')]:[n,null]}function Se(e,t){var n=Date.parse(e);return isNaN(n)?[null,new Ze("`"+t+'` is in an invalid date format: "'+e+'"')]:[new Date(Date.parse(e)).getTime()/1e3,null]}function we(e,t){if(!(0,E.Z)(e))return[0,new Ze("`"+t+"` property is empty")];var n=ge.exec(e);return null===n?[null,new Ze("`"+t+'` property has an unrecognized format "'+e+'"')]:[365*parseFloat((0,E.Z)(n[2])?n[2]:"0")*24*60*60+30*parseFloat((0,E.Z)(n[4])?n[4]:"0")*24*60*60+24*parseFloat((0,E.Z)(n[6])?n[6]:"0")*60*60+60*parseFloat((0,E.Z)(n[8])?n[8]:"0")*60+60*parseFloat((0,E.Z)(n[10])?n[10]:"0")+parseFloat((0,E.Z)(n[12])?n[12]:"0"),null]}function ke(e,t){var n=ye.exec(e);return null===n?[null,new Ze("`"+t+'` property has an unrecognized format "'+e+'"')]:[[+n[1],+n[2]],null]}function Ae(e,t){try{return[(0,me.K)(e),null]}catch(n){return[null,new Ze("`"+t+'` is not a valid base64 string: "'+e+'"')]}}function xe(e){for(var t,n,r=0;r<e.attributes.length;r++){var i=e.attributes[r];switch(i.name){case"schemeIdUri":t=i.value;break;case"value":n=i.value}}return{schemeIdUri:t,value:n}}function Ie(e,t){return function(n,r){var i=r.asKey,a=(0,r.parser)(n,r.dashName),s=a[0],u=a[1];null!==u&&(o.Z.warn(u.message),t.push(u)),null!==s&&(e[i]=s)}}var Ze=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,pe.Z)(r),t.prototype),r.name="MPDError",r.message=n,r}return(0,ve.Z)(t,e),t}((0,he.Z)(Error));function Re(e){var t={},n=e.textContent,r=[],i=Ie(t,r);if(null===n||0===n.length)return[void 0,r];for(var a=0;a<e.attributes.length;a++){var o=e.attributes[a];switch(o.name){case"availabilityTimeOffset":i(o.value,{asKey:"availabilityTimeOffset",parser:Te,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":i(o.value,{asKey:"availabilityTimeComplete",parser:_e,dashName:"availabilityTimeComplete"})}}return[{value:n,attributes:t},r]}function Me(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"id":t.id=r.value;break;case"lang":t.language=r.value;break;case"contentType":t.contentType=r.value;break;case"par":t.par=r.value}}return t}function Ce(e){var t=function(e){for(var t=[],n=[],r=0;r<e.length;r++)if(e[r].nodeType===Node.ELEMENT_NODE){var i=e[r];if("cenc:pssh"===i.nodeName){var a=i.textContent;if(null!==a&&a.length>0){var s=Ae(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;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"schemeIdUri":t.schemeIdUri=r.value;break;case"value":t.value=r.value;break;case"cenc:default_KID":t.keyId=(0,g.nr)(r.value.replace(/-/g,""))}}return t}(e)},r]}function Pe(e){for(var t={},n=[],r=Ie(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"range":r(a.value,{asKey:"range",parser:ke,dashName:"range"});break;case"sourceURL":t.media=a.value}}return[t,n]}function De(e){for(var t={},n=[],r=Ie(t,n),i=e.childNodes,a=0;a<i.length;a++)if(i[a].nodeType===Node.ELEMENT_NODE){var o=i[a];if("Initialization"===o.nodeName){var s=Pe(o),u=s[0],l=s[1];t.initialization=u,n=n.concat(l)}}for(var c=0;c<e.attributes.length;c++){var d=e.attributes[c];switch(d.name){case"timescale":r(d.value,{asKey:"timescale",parser:be,dashName:"timescale"});break;case"presentationTimeOffset":r(d.value,{asKey:"presentationTimeOffset",parser:Te,dashName:"presentationTimeOffset"});break;case"indexRange":r(d.value,{asKey:"indexRange",parser:ke,dashName:"indexRange"});break;case"indexRangeExact":r(d.value,{asKey:"indexRangeExact",parser:_e,dashName:"indexRangeExact"});break;case"availabilityTimeOffset":r(d.value,{asKey:"availabilityTimeOffset",parser:Te,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(d.value,{asKey:"availabilityTimeComplete",parser:_e,dashName:"availabilityTimeComplete"});break;case"duration":r(d.value,{asKey:"duration",parser:be,dashName:"duration"});break;case"startNumber":r(d.value,{asKey:"startNumber",parser:be,dashName:"startNumber"})}}return[t,n]}function Ne(e){for(var t={},n=[],r=Ie(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"media":t.media=a.value;break;case"indexRange":r(a.value,{asKey:"indexRange",parser:ke,dashName:"indexRange"});break;case"index":t.index=a.value;break;case"mediaRange":r(a.value,{asKey:"mediaRange",parser:ke,dashName:"mediaRange"})}}return[t,n]}function Oe(e){for(var t=De(e),n=t[0],r=t[1],i=[],a=e.childNodes,o=0;o<a.length;o++)if(a[o].nodeType===Node.ELEMENT_NODE){var s=a[o];if("SegmentURL"===s.nodeName){var u=Ne(s),l=u[0],c=u[1];i.push(l),r=r.concat(c)}}return[(0,I.Z)(n,{list:i}),r]}function Le(e){var t=null;return function(){if(null===t){var n=e.getElementsByTagName("S");return t=n,n}return t}}function Be(e){for(var t,n=De(e),r=n[0],i=n[1],a=0;a<e.childNodes.length;a++)if(e.childNodes[a].nodeType===Node.ELEMENT_NODE){var o=e.childNodes[a];"SegmentTimeline"===o.nodeName&&(t=Le(o))}for(var s=(0,I.Z)({},r,{duration:r.duration,timelineParser:t}),u=Ie(s,i),l=0;l<e.attributes.length;l++){var c=e.attributes[l];switch(c.nodeName){case"initialization":null==s.initialization&&(s.initialization={media:c.value});break;case"index":s.index=c.value;break;case"availabilityTimeOffset":u(c.value,{asKey:"availabilityTimeOffset",parser:Te,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":u(c.value,{asKey:"availabilityTimeComplete",parser:_e,dashName:"availabilityTimeComplete"});break;case"media":s.media=c.value;break;case"bitstreamSwitching":u(c.value,{asKey:"bitstreamSwitching",parser:_e,dashName:"bitstreamSwitching"})}}return[s,i]}function Ue(e){var t=function(e){for(var t={baseURLs:[]},n=[],r=[],i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE){var a=e[i];switch(a.nodeName){case"BaseURL":var o=Re(a),s=o[0],u=o[1];void 0!==s&&t.baseURLs.push(s),r=r.concat(u);break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(xe(a));break;case"SegmentBase":var l=De(a),c=l[0],d=l[1];t.segmentBase=c,d.length>0&&(r=r.concat(d));break;case"SegmentList":var f=Oe(a),p=f[0],v=f[1];r=r.concat(v),t.segmentList=p;break;case"SegmentTemplate":var h=Be(a),m=h[0],g=h[1];r=r.concat(g),t.segmentTemplate=m;break;case"ContentProtection":var y=Ce(a),_=y[0],b=y[1];b.length>0&&(r=r.concat(b)),void 0!==_&&n.push(_)}}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=Ie(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"bandwidth":r(a.value,{asKey:"bitrate",parser:be,dashName:"bandwidth"});break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:_e,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:be,dashName:"height"});break;case"id":t.id=a.value;break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:Te,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:Te,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"qualityRanking":r(a.value,{asKey:"qualityRanking",parser:be,dashName:"qualityRanking"});break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:be,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:Te,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:_e,dashName:"availabilityTimeComplete"})}}return void 0===t.bitrate&&n.push(new Ze("No bitrate found on a Representation")),[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Fe(e){var t=function(e){for(var t={baseURLs:[],representations:[]},n=[],r=[],i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE){var a=e[i];switch(a.nodeName){case"Accessibility":void 0===t.accessibilities?t.accessibilities=[xe(a)]:t.accessibilities.push(xe(a));break;case"BaseURL":var o=Re(a),s=o[0],u=o[1];void 0!==s&&t.baseURLs.push(s),u.length>0&&(r=r.concat(u));break;case"ContentComponent":t.contentComponent=Me(a);break;case"EssentialProperty":null==t.essentialProperties?t.essentialProperties=[xe(a)]:t.essentialProperties.push(xe(a));break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(xe(a));break;case"Representation":var l=Ue(a),c=l[0],d=l[1];t.representations.push(c),d.length>0&&(r=r.concat(d));break;case"Role":null==t.roles?t.roles=[xe(a)]:t.roles.push(xe(a));break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[xe(a)]:t.supplementalProperties.push(xe(a));break;case"SegmentBase":var f=De(a),p=f[0],v=f[1];t.segmentBase=p,v.length>0&&(r=r.concat(v));break;case"SegmentList":var h=Oe(a),m=h[0],g=h[1];t.segmentList=m,g.length>0&&(r=r.concat(g));break;case"SegmentTemplate":var y=Be(a),_=y[0],b=y[1];t.segmentTemplate=_,b.length>0&&(r=r.concat(b));break;case"ContentProtection":var T=Ce(a),E=T[0],S=T[1];S.length>0&&(r=r.concat(S)),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=Ie(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"group":r(a.value,{asKey:"group",parser:be,dashName:"group"});break;case"lang":t.language=a.value;break;case"contentType":t.contentType=a.value;break;case"par":t.par=a.value;break;case"minBandwidth":r(a.value,{asKey:"minBitrate",parser:be,dashName:"minBandwidth"});break;case"maxBandwidth":r(a.value,{asKey:"maxBitrate",parser:be,dashName:"maxBandwidth"});break;case"minWidth":r(a.value,{asKey:"minWidth",parser:be,dashName:"minWidth"});break;case"maxWidth":r(a.value,{asKey:"maxWidth",parser:be,dashName:"maxWidth"});break;case"minHeight":r(a.value,{asKey:"minHeight",parser:be,dashName:"minHeight"});break;case"maxHeight":r(a.value,{asKey:"maxHeight",parser:be,dashName:"maxHeight"});break;case"minFrameRate":t.minFrameRate=a.value;break;case"maxFrameRate":t.maxFrameRate=a.value;break;case"selectionPriority":r(a.value,{asKey:"selectionPriority",parser:be,dashName:"selectionPriority"});break;case"segmentAlignment":r(a.value,{asKey:"segmentAlignment",parser:Ee,dashName:"segmentAlignment"});break;case"subsegmentAlignment":r(a.value,{asKey:"subsegmentAlignment",parser:Ee,dashName:"subsegmentAlignment"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:_e,dashName:"bitstreamSwitching"});break;case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:_e,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:be,dashName:"height"});break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:Te,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:Te,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:be,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:Te,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:_e,dashName:"availabilityTimeComplete"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function ze(e){for(var t={children:{events:[]},attributes:{}},n=[],r=Ie(t.attributes,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"schemeIdUri":t.attributes.schemeIdUri=a.value;break;case"timescale":r(a.value,{asKey:"timescale",parser:be,dashName:"timescale"});break;case"value":t.attributes.value=a.value}}for(var o=0;o<e.childNodes.length;o++)if(e.childNodes[o].nodeType===Node.ELEMENT_NODE){var s=e.childNodes[o];switch(s.nodeName){case"Event":var u=Ve(s),l=u[0],c=u[1];t.children.events.push(l),c.length>0&&(n=n.concat(c))}}return[t,n]}function Ve(e){for(var t={eventStreamData:e},n=[],r=Ie(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"presentationTime":r(a.value,{asKey:"presentationTime",parser:be,dashName:"presentationTime"});break;case"duration":r(a.value,{asKey:"duration",parser:be,dashName:"duration"});break;case"id":t.id=a.value}}return[t,n]}function Ke(e){var t=function(e){for(var t,n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=Re(s),l=u[0],c=u[1];void 0!==l&&n.push(l),i=i.concat(c);break;case"AdaptationSet":var d=Fe(s),f=d[0],p=d[1];r.push(f),i=i.concat(p);break;case"EventStream":var v=ze(s),h=v[0],m=v[1];a.push(h),i=i.concat(m);break;case"SegmentTemplate":var g=Be(s),y=g[0],_=g[1];t=y,_.length>0&&(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=Ie(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"start":r(a.value,{asKey:"start",parser:we,dashName:"start"});break;case"duration":r(a.value,{asKey:"duration",parser:we,dashName:"duration"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:_e,dashName:"bitstreamSwitching"});break;case"xlink:href":t.xlinkHref=a.value;break;case"xlink:actuate":t.xlinkActuate=a.value}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Ge(e){var t=function(e){for(var t=[],n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=Re(s),l=u[0],c=u[1];void 0!==l&&t.push(l),a=a.concat(c);break;case"Location":n.push(null===s.textContent?"":s.textContent);break;case"Period":var d=Ke(s),f=d[0],p=d[1];r.push(f),a=a.concat(p);break;case"UTCTiming":var v=xe(s);i.push(v)}}return[{baseURLs:t,locations:n,periods:r,utcTimings:i},a]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Ie(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"profiles":t.profiles=a.value;break;case"type":t.type=a.value;break;case"availabilityStartTime":r(a.value,{asKey:"availabilityStartTime",parser:Se,dashName:"availabilityStartTime"});break;case"availabilityEndTime":r(a.value,{asKey:"availabilityEndTime",parser:Se,dashName:"availabilityEndTime"});break;case"publishTime":r(a.value,{asKey:"publishTime",parser:Se,dashName:"publishTime"});break;case"mediaPresentationDuration":r(a.value,{asKey:"duration",parser:we,dashName:"mediaPresentationDuration"});break;case"minimumUpdatePeriod":r(a.value,{asKey:"minimumUpdatePeriod",parser:we,dashName:"minimumUpdatePeriod"});break;case"minBufferTime":r(a.value,{asKey:"minBufferTime",parser:we,dashName:"minBufferTime"});break;case"timeShiftBufferDepth":r(a.value,{asKey:"timeShiftBufferDepth",parser:we,dashName:"timeShiftBufferDepth"});break;case"suggestedPresentationDelay":r(a.value,{asKey:"suggestedPresentationDelay",parser:we,dashName:"suggestedPresentationDelay"});break;case"maxSegmentDuration":r(a.value,{asKey:"maxSegmentDuration",parser:we,dashName:"maxSegmentDuration"});break;case"maxSubsegmentDuration":r(a.value,{asKey:"maxSubsegmentDuration",parser:we,dashName:"maxSubsegmentDuration"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}var He=function(e,t){var n=e.documentElement;if((0,i.Z)(n)||"MPD"!==n.nodeName)throw new Error("DASH Parser: document root should be MPD");var a=Ge(n),o=a[0],s=a[1];return function e(t){if("done"===t.type)return t;if("needs-clock"===t.type)return{type:"needs-resources",value:{urls:[t.value.url],format:"string",continue:function(n){if(1!==n.length)throw new Error("DASH parser: wrong number of loaded ressources.");var r=t.value.continue(n[0].responseData);return e(r)}}};if("needs-xlinks"===t.type)return{type:"needs-resources",value:{urls:t.value.xlinksUrls,format:"string",continue:function(n){for(var r=[],i=0;i<n.length;i++){var a=n[i],o=a.responseData,s=a.receivedTime,u=a.sendingTime,l=a.url;if(!o.success)throw o.error;var c="<root>"+o.data+"</root>",d=(new DOMParser).parseFromString(c,"text/xml");if(null==d||0===d.children.length)throw new Error("DASH parser: Invalid external ressources");for(var f=d.children[0].children,p=[],v=[],h=0;h<f.length;h++)if(f[h].nodeType===Node.ELEMENT_NODE){var m=Ke(f[h]),g=m[0],y=m[1];v.push.apply(v,y),p.push(g)}r.push({url:l,receivedTime:s,sendingTime:u,parsed:p,warnings:v})}var _=t.value.continue(r);return e(_)}}};(0,r.Z)(t)}(fe(o,t,s))}},8232:function(e,t,n){"use strict";function r(e,t){for(var n=0;e.length>0;){var r=e[0];if(r.start>=t)return n;if(-1===r.repeatCount)return n;if(0===r.repeatCount)e.shift(),n+=1;else{var i=e[1];if(void 0!==i&&i.start<=t)e.shift(),n+=1;else{if(r.duration<=0)return n;for(var a=r.start+r.duration,o=1;a<t&&o<=r.repeatCount;)a+=r.duration,o++;if(!(o>r.repeatCount)){var s=r.repeatCount-o;return r.start=a,r.repeatCount=s,n+=o}e.shift(),n=r.repeatCount+1}}}return n}n.d(t,{Z:function(){return r}})},3911:function(e,t,n){"use strict";n.d(t,{KF:function(){return i},PZ:function(){return u},_j:function(){return l},gT:function(){return o},jH:function(){return a},zG:function(){return s}});var r=n(1946);function i(e,t,n){var i,a=e.repeatCount;return a>=0?a:(i=(0,r.Z)(t)?void 0!==n?n:Number.MAX_VALUE:t.start,Math.ceil((i-e.start)/e.duration)-1)}function a(e,t,n){var r=e.start,a=e.duration;return a<=0?r:r+(i(e,t,n)+1)*a}function o(e,t){var n;return e*t.timescale+(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0)}function s(e,t){var n;return(e-(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0))/t.timescale}function u(e,t,n){return[e*n,(e+t)*n]}function l(e,t,n){var r=e.timeline,i=o(t,e);if(i<0)return null;var u=function(e,t){for(var n=0,r=e.length;n<r;){var i=n+r>>>1;e[i].start<=t?n=i+1:r=i}return n-1}(r,i);if(u<0||u>=r.length-1)return null;var l=r[u];if(l.duration<=0)return null;var c=r[u+1];if(void 0===c)return null;var d=c.start;return i>=a(l,c,n)&&i<d?s(d,e):null}},1091:function(e,t,n){"use strict";function r(e,t,n,r){for(var i=0;i<t.length;i++){var a=t[i],o=(a.start-r)/n;if(o>e.time)return!1;if(o===e.time)return void 0===a.range?void 0===e.range:null!=e.range&&a.range[0]===e.range[0]&&a.range[1]===e.range[1];if(a.repeatCount>=0&&void 0!==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){if(0===e.length)return e.push.apply(e,t),!0;if(0===t.length)return!1;var n=e.length,o=t[0].start,s=e[n-1];if((0,a.jH)(s,t[0])<o)throw new r.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");for(var u=n-1;u>=0;u--){var l=e[u].start;if(l===o){var c=n-u;return e.splice.apply(e,[u,c].concat(t)),!1}if(l<o){var d=e[u];if(d.start+d.duration>o)return i.Z.warn("RepresentationIndex: Manifest update removed all previous segments"),e.splice.apply(e,[0,n].concat(t)),!0;if(void 0===d.repeatCount||d.repeatCount<=0)return d.repeatCount<0&&(d.repeatCount=Math.floor((o-d.start)/d.duration)-1),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;if(d.start+d.duration*(d.repeatCount+1)<=o)return e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;var f=(o-d.start)/d.duration-1;if(f%1==0&&d.duration===t[0].duration){var p=t[0].repeatCount<0?-1:t[0].repeatCount+f+1;return e.splice.apply(e,[u,n-u].concat(t)),e[u].start=d.start,e[u].repeatCount=p,!1}return i.Z.warn("RepresentationIndex: Manifest update removed previous segments"),e[u].repeatCount=Math.floor(f),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1}}var v=e[e.length-1],h=t[t.length-1];return void 0!==v.repeatCount&&v.repeatCount<0?v.start>h.start?(i.Z.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0):v.start+v.duration*(v.repeatCount+1)>=h.start+h.duration*(h.repeatCount+1)?(i.Z.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0)}},5734:function(e,t,n){"use strict";var r=n(6923),i=/&#([0-9]+);/g,a=/<br>/gi,o=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,s=/\s*<p (?:class=([^>]+))?>(.*)/i,u=/<sync[^>]+?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 c,d,f=/<sync[ >]/gi,p=/<sync[ >]|<\/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(;c=f.exec(e),d=p.exec(e),null!==c||null!==d;){if(null===c||null===d||c.index>=d.index)throw new Error("parse error");var b=e.slice(c.index,d.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)");S(b.split("\n"),E/1e3)}return v;function S(e,n){for(var o=e.length;--o>=0;){var u=s.exec(e[o]);if(Array.isArray(u)){var l=u[1],c=u[2];if(g===l)if("&nbsp;"===c)v[v.length-1].end=n;else{var d=document.createElement("DIV");d.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=c.split(a),m=0;m<h.length;m++){0!==m&&p.appendChild(document.createElement("BR"));var y=document.createElement("SPAN");y.className="rxp-texttrack-span",y.textContent=h[m].replace(i,(function(e,t){return String.fromCharCode(Number(t))})),p.appendChild(y)}f.appendChild(p),d.appendChild(f),v.push({element:d,start:n+t,end:-1})}}}}}},1812:function(e,t,n){"use strict";var r=n(7253),i=n(6923),a=/&#([0-9]+);/g,o=/<br>/gi,s=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,u=/\s*<p (?:class=([^>]+))?>(.*)/i,l=/<sync[^>]+?start="?([0-9]*)"?[^0-9]/i;function c(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,f,p=/<sync[ >]/gi,v=/<sync[ >]|<\/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=c(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(;d=p.exec(e),f=v.exec(e),null!==d||null!==f;){if(null===d||null===f||d.index>=f.index)throw new Error("parse error");var b=e.slice(d.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)");S(b.split("\n"),E/1e3)}return function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n],o=a.start,s=a.end,u=a.text;if((0,i.Z)(u)&&null!=s){var l=(0,r.Z)(o,s,u);null!=l&&t.push(l)}}return t}(h);function S(e,n){for(var r,i,s=e.length;--s>=0;)if(null!==(r=u.exec(e[s]))){var l=r,c=l[1],d=l[2];y===c&&("&nbsp;"===d?h[h.length-1].end=n:h.push({text:(i=d,i.replace(o,"\n").replace(a,(function(e,t){return String.fromCharCode(Number(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;n<e.length;n++)if((0,r.Z)(e[n])){var a=i(e,n),o=e.slice(n,a);o.length>0&&(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;u<a.length;u++){var l=(0,i.Z)(a[u],t);if(null!=l){var c=o(l);null!=c&&s.push(c)}}return s}function o(e){var t=e.start,n=e.end,r=e.payload,i=document.createElement("div");i.className="rxp-texttrack-p",i.style.fontSize="28px",i.style.position="absolute",i.style.bottom="5%",i.style.width="100%",i.style.textAlign="center",i.style.color="#fff",i.style.textShadow="-1px -1px 2px #000,1px -1px 2px #000,-1px 1px 2px #000,1px 1px 2px #000";for(var a=0;a<r.length;a++){0!==a&&i.appendChild(document.createElement("br"));var o=s(r[a]);i.appendChild(o)}return{start:t,end:n,element:i}}function s(e){var t=document.createElement("div");t.innerHTML=e;return function e(t){var n=t.childNodes,r=document.createElement("span");r.className="rxp-texttrack-span";for(var i=0;i<n.length;i++){var a=n[i];if("#text"===a.nodeName){for(var o=a.wholeText.split("\n"),s=0;s<o.length;s++)if(0!==s&&r.appendChild(document.createElement("br")),o[s].length>0){var l=document.createTextNode(o[s]);r.appendChild(l)}}else if("B"===a.nodeName){var c=e(a);c.style.fontWeight="bold",r.appendChild(c)}else if("I"===a.nodeName){var d=e(a);d.style.fontStyle="italic",r.appendChild(d)}else if("U"===a.nodeName){var f=e(a);f.style.textDecoration="underline",r.appendChild(f)}else if(u(a)&&"string"==typeof a.color){var p=e(a);p.style.color=a.color,r.appendChild(p)}else{var v=e(a);r.appendChild(v)}}return r}(t)}function u(e){return"FONT"===e.nodeName&&"color"in e}},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,c=e.split(/\r\n|\n|\r/),d=(0,i.Z)(c),f=[],p=0;p<d.length;p++){var v=(0,a.Z)(d[p],t);if(null!==v){var h=(o=void 0,s=void 0,u=void 0,l=void 0,o=(n=v).start,s=n.end,u=n.payload,l=u.join("\n"),(0,r.Z)(o,s,l));null!==h&&f.push(h)}}return f}},788:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":");if((0,r.Z)(t[2])){var n=parseInt(t[0],10),i=parseInt(t[1],10),a=parseFloat(t[2].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){if(0===e.length)return null;var n,a,o=[];if((0,r.Z)(e[1])&&-1!==e[1].indexOf("--\x3e")){var s=e[1].split("--\x3e").map((function(e){return e.trim()}));n=s[0],a=s[1],o=e.slice(2,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a)){var u=e[0].split("--\x3e").map((function(e){return e.trim()}));n=u[0],a=u[1],o=e.slice(1,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a))return null;var l=i(n),c=i(a);return void 0===l||void 0===c?null:{start:l+t,end:c+t,payload:o}}},4123:function(e,t,n){"use strict";function r(e,t){if(!(e.parentNode instanceof Element))return[];return function e(n){var r=[];n.tagName.toLowerCase()===t.toLowerCase()&&r.push(n);var i=n.parentNode;return i instanceof Element&&r.push.apply(r,e(i)),r}(e.parentNode)}n.d(t,{Z:function(){return r}})},3791:function(e,t,n){"use strict";n.d(t,{U:function(){return s},b:function(){return u}});var r=n(3274),i=n(7714),a=n(6923),o=n(9252);function s(e,t,n,o){for(var s={},u=e.slice(),l=0;l<=t.length-1;l++){var c=t[l];if(void 0!==c){var d=function(){var e=void 0,t=void 0;if(c.nodeType===Node.ELEMENT_NODE)for(var l=c,d=0;d<=l.attributes.length-1;d++){var f=l.attributes[d],p=f.name;if("style"===p)e=f.value;else if("region"===p)t=f.value;else{var v=p.substring(4);if((0,i.Z)(u,v)&&(s[v]=f.value,u.splice(d,1),0===u.length))return{v:s}}}if((0,a.Z)(e)){var h=(0,r.Z)(n,(function(t){return t.id===e}));if(void 0!==h)for(var m=0;m<=u.length-1;m++){var g=u[m];if(!(0,a.Z)(s[g])&&(0,a.Z)(h.style[g])){if(s[g]=h.style[g],u.splice(m,1),0===u.length)return{v:s};m--}}}if((0,a.Z)(t)){var y=(0,r.Z)(o,(function(e){return e.id===t}));if(void 0!==y)for(var _=0;_<=u.length-1;_++){var b=u[_];if(!(0,a.Z)(s[b])&&(0,a.Z)(y.style[b])){if(s[b]=y.style[b],u.splice(_,1),0===u.length)return{v:s};_--}}}}();if("object"==typeof d)return d.v}}return s}function u(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};for(var t=e,n={},r=0;r<=t.attributes.length-1;r++){var i=t.attributes[r];if((0,o.Z)(i.name,"tts"))n[i.name.substring(4)]=i.value}return n}},6177:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(6923),i=n(5336);function a(e,t){var n=e.exec(t);if(null===n||""===n[0])return null;var r=Number(n[1]);isNaN(r)&&(r=0);var i=Number(n[2]);isNaN(i)&&(i=0);var a=Number(n[3]);isNaN(a)&&(a=0);var o=Number(n[4]);return isNaN(o)&&(o=0),o/1e3+a+60*i+3600*r}var o=function(e,t){return i.gu.test(e)?function(e,t){var n=i.gu.exec(t),r=Number(n[1]),a=Number(n[2]),o=Number(n[3]),s=Number(n[4]),u=Number(n[5]);isNaN(u)&&(u=0);return s+=u/e.subFrameRate,(o+=s/e.frameRate)+60*a+3600*r}(t,e):i.KO.test(e)?a(i.KO,e):i.wf.test(e)?a(i.wf,e):i.jb.test(e)?function(e,t){var n=i.jb.exec(t);return Number(n[1])/e.frameRate}(t,e):i.Du.test(e)?function(e,t){var n=i.Du.exec(t);return Number(n[1])/e.tickRate}(t,e):i.te.test(e)?a(i.te,e):void 0};function s(e,t){var n=e.getAttribute("begin"),i=e.getAttribute("dur"),a=e.getAttribute("end"),s=(0,r.Z)(n)?o(n,t):null,u=(0,r.Z)(i)?o(i,t):null,l=(0,r.Z)(a)?o(a,t):null;if(null==s||null==l&&null==u)throw new Error("Invalid text cue");return{start:s,end:null==l?s+u:l}}},7439:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(5403);function i(e){return void 0===e.extent&&void 0===e.origin&&void 0===e.displayAlign&&void 0===e.display&&void 0===e.textAlign&&void 0===e.fontSize}function a(e){e.extent="70% 20%",e.fontSize="1c",e.origin="15% 80%",e.displayAlign="before",e.textAlign="center"}var o,s=n(6177);function u(e,t){(void 0===o&&(o=void 0!==e.classList&&"function"==typeof e.classList.add),o)?e.classList.add(t):(" "+e.className+" ").indexOf(" "+t+" ")<0&&(e.className+=" "+t)}var l=n(6923),c=n(8026),d=n(4123),f=n(3791),p=n(3887),v=n(5336);function h(e,t){return"-1px -1px "+t+" "+e+",1px -1px "+t+" "+e+",-1px 1px "+t+" "+e+",1px 1px "+t+" "+e}function m(e){var t;return null!=(t=v.Dq.exec(e))?"rgba("+String(parseInt(t[1],16))+","+String(parseInt(t[2],16))+","+String(parseInt(t[3],16))+","+String(parseInt(t[4],16)/255)+")":null!=(t=v.YU.exec(e))?"rgba("+String(parseInt(t[1]+t[1],16))+","+String(parseInt(t[2]+t[2],16))+","+String(parseInt(t[3]+t[3],16))+","+String(parseInt(t[4]+t[4],16)/255)+")":null!=(t=v.GK.exec(e))?"rgb("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+")":null!=(t=v.ev.exec(e))?"rgba("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+","+String(+t[4]/255)+")":e}var g=["color","direction","display","fontFamily","fontSize","fontStyle","fontWeight","textDecoration","textOutline","unicodeBidi","visibility","wrapOption"];function y(e,t,n){var r=t.color;(0,l.Z)(r)&&(e.style.color=m(r));var i=t.backgroundColor;(0,l.Z)(i)&&(e.style.backgroundColor=m(i));var a=t.textOutline;if((0,l.Z)(a)){var o=a.trim().replace(/\s+/g," ").split(" "),s=o.length;if(3===s){var c=m(o[0]),d=o[1];e.style.textShadow=h(c,d)}else if((0,l.Z)(r)&&1===s){var f=o[0];e.style.textShadow=h(r,f)}else if(2===s){var g=/^[#A-Z]/i.test(o[0]);if(g!==/^[0-9]/.test(o[0]))if(g){var y=m(o[0]),_=o[1];e.style.textShadow=h(y,_)}else if((0,l.Z)(r)){var b=o[0];e.style.textShadow=h(r,b)}}}var T=t.textDecoration;if((0,l.Z)(T))switch(T){case"noUnderline":case"noLineThrough":case"noOverline":e.style.textDecoration="none";break;case"lineThrough":e.style.textDecoration="line-through";break;default:e.style.textDecoration=T}var E=t.fontFamily;if((0,l.Z)(E))switch(E){case"proportionalSansSerif":e.style.fontFamily="Arial, Helvetica, Liberation Sans, sans-serif";break;case"monospaceSansSerif":case"sansSerif":e.style.fontFamily="sans-serif";break;case"monospaceSerif":case"default":e.style.fontFamily="Courier New, Liberation Mono, monospace";break;case"proportionalSerif":e.style.fontFamily="serif";break;default:e.style.fontFamily=E}var S=t.fontStyle;(0,l.Z)(S)&&(e.style.fontStyle=S);var w=t.fontWeight;(0,l.Z)(w)&&(e.style.fontWeight=w);var k=t.fontSize;(0,l.Z)(k)?function(e,t){var n=t.trim().split(" ");if(0!==n.length){var r=v.eT.exec(n[0]);if(null!==r)if("px"===r[2]||"em"===r[2])e.style.fontSize=r[1]+r[2];else if("c"===r[2])e.style.position="relative",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size",r[1]);else if("%"===r[2]){var i=Number(r[1]);isNaN(i)?p.Z.warn('TTML Parser: could not parse fontSize value "'+r[1]+'" into a number'):(e.style.position="relative",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size",String(i/100)))}else p.Z.warn("TTML Parser: unhandled fontSize unit:",r[2])}}(e,k):(u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1"));var A=t.direction;(0,l.Z)(A)&&(e.style.direction=A);var x=t.unicodeBidi;if((0,l.Z)(x))switch(x){case"bidiOverride":e.style.unicodeBidi="bidi-override";break;case"embed":e.style.unicodeBidi="embed";break;default:e.style.unicodeBidi="normal"}var I=t.visibility;(0,l.Z)(I)&&(e.style.visibility=I),"none"===t.display&&(e.style.display="none");var Z=t.wrapOption;e.style.whiteSpace="noWrap"===Z?n?"nowrap":"pre":n?"normal":"pre-wrap"}function _(e,t){e.style.color="white",e.style.position="absolute";var n=t.extent;(0,l.Z)(n)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=v.eT.exec(r[0]),a=v.eT.exec(r[1]);null!==i&&null!==a&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.width=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-width",i[1])):p.Z.warn("TTML Parser: unhandled extent unit:",i[2]),"px"===a[2]||"%"===a[2]||"em"===a[2]?e.style.height=a[1]+a[2]:"c"===a[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-height",a[1])):p.Z.warn("TTML Parser: unhandled extent unit:",a[2]))}}}(e,n);var r=t.writingMode;(0,l.Z)(r);var i=t.overflow;e.style.overflow=(0,l.Z)(i)?i:"hidden";var a=t.padding;(0,l.Z)(a)&&function(e,t){var n=t.trim().split(" ");if(!(n.length<1)){var r=v.eT.exec(n[0]);if(null!==r){if("px"===r[2]||"%"===r[2]||"em"===r[2]){var i=r[1]+r[2];1===n.length?e.style.padding=i:2===n.length?(e.style.paddingTop=i,e.style.paddingBottom=i):e.style.paddingTop=i}else"c"===r[2]?(u(e,"proportional-style"),1===n.length?(e.setAttribute("data-proportional-padding-top",r[1]),e.setAttribute("data-proportional-padding-bottom",r[1]),e.setAttribute("data-proportional-padding-left",r[1]),e.setAttribute("data-proportional-padding-right",r[1])):2===n.length?(e.setAttribute("data-proportional-padding-top",r[1]),e.setAttribute("data-proportional-padding-bottom",r[1])):e.setAttribute("data-proportional-padding-top",r[1])):p.Z.warn("TTML Parser: unhandled padding unit:",r[2]);if(1!==n.length){var a=v.eT.exec(n[1]);if(null!==a){if("px"===a[2]||"%"===a[2]||"em"===a[2]){var o=a[1]+a[2];n.length<4?(e.style.paddingLeft=o,e.style.paddingRight=o):e.style.paddingRight=o}else"c"===a[2]?(u(e,"proportional-style"),n.length<4?(e.setAttribute("data-proportional-padding-left",a[1]),e.setAttribute("data-proportional-padding-right",a[1])):e.setAttribute("data-proportional-padding-right",a[1])):p.Z.warn("TTML Parser: unhandled padding unit:",a[2]);if(2!==n.length){var s=v.eT.exec(n[2]);if(null!==s){if("px"===s[2]||"%"===s[2]||"em"===s[2]){var l=s[1]+s[2];e.style.paddingBottom=l}else"c"===s[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-bottom",s[1])):p.Z.warn("TTML Parser: unhandled padding unit:",s[2]);if(3!==n.length){var c=v.eT.exec(n[3]);if(null!==c)if("px"===c[2]||"%"===c[2]||"em"===c[2]){var d=c[1]+c[2];e.style.paddingLeft=d}else"c"===c[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-left",c[1])):p.Z.warn("TTML Parser: unhandled padding unit:",c[2])}}}}}}}}(e,a);var o=t.origin;(0,l.Z)(o)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=v.eT.exec(r[0]),a=v.eT.exec(r[1]);null!==i&&null!==a&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.left=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-left",i[1])):p.Z.warn("TTML Parser: unhandled origin unit:",i[2]),"px"===a[2]||"%"===a[2]||"em"===a[2]?e.style.top=a[1]+a[2]:"c"===a[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-top",a[1])):p.Z.warn("TTML Parser: unhandled origin unit:",a[2]))}}}(e,o);var s=t.displayAlign;if((0,l.Z)(s))switch(e.style.display="flex",e.style.flexDirection="column",s){case"before":e.style.justifyContent="flex-start";break;case"center":e.style.justifyContent="center";break;case"after":e.style.justifyContent="flex-end"}var c=t.opacity;(0,l.Z)(c)&&(e.style.opacity=c);var d=t.visibility;(0,l.Z)(d)&&(e.style.visibility=d),"none"===t.display&&(e.style.display="none")}function b(e,t){e.style.margin="0px";var n=t.backgroundColor;(0,l.Z)(n)&&(e.style.backgroundColor=m(n));var r=t.lineHeight;(0,l.Z)(r)&&function(e,t){var n=t.trim();if("auto"!==n){var r=v.eT.exec(n[0]);null!==r&&("px"===r[2]||"%"===r[2]||"em"===r[2]?e.style.lineHeight=r[1]+r[2]:"c"===r[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-line-height",r[1])):p.Z.warn("TTML Parser: unhandled lineHeight unit:",r[2]))}}(e,r);var i=t.textAlign;if((0,l.Z)(i))switch(i){case"center":e.style.textAlign="center";break;case"left":case"start":e.style.textAlign="left";break;case"right":case"end":e.style.textAlign="right"}}function T(e,t,n){var r=document.createElement("span"),i=null===e.textContent?"":e.textContent;if(n){var a=i.trim();i=a=a.replace(/\s+/g," ")}return r.innerHTML=i,r.className="rxp-texttrack-span",y(r,t,n),r}function E(e,t,n,r,i,a){var o=a.cellResolution,s=a.shouldTrimWhiteSpace,u=(0,d.Z)(e,"div"),p=document.createElement("DIV");if(p.className="rxp-texttrack-region",p.setAttribute("data-resolution-columns",String(o.columns)),p.setAttribute("data-resolution-rows",String(o.rows)),_(p,i),null!==t){var v=(0,f.U)(["backgroundColor"],[].concat(u,[t]),r,n).bodyBackgroundColor;(0,l.Z)(v)&&(p.style.backgroundColor=m(v))}var h=document.createElement("p");h.className="rxp-texttrack-p",b(h,i);for(var y=function(e,t,n,r,i){return function e(r,i,a,o){for(var s=r.childNodes,u=[],d=0;d<s.length;d++){var p=s[d];if("#text"===p.nodeName){var v=(0,f.U)(["backgroundColor"],a,n,t).backgroundColor;(0,l.Z)(v)?i.backgroundColor=v:delete i.backgroundColor;var h=T(p,i,o);u.push(h)}else if("br"===p.nodeName){var m=document.createElement("BR");u.push(m)}else if("span"===p.nodeName&&p.nodeType===Node.ELEMENT_NODE&&p.childNodes.length>0){var y=p.getAttribute("xml:space"),_=(0,l.Z)(y)?"default"===y:o,b=(0,c.Z)({},i,(0,f.U)(g,[p],n,t));u.push.apply(u,e(p,b,[p].concat(a),_))}}return u}(e,(0,c.Z)({},r),[],i)}(e,n,r,i,s),E=0;E<y.length;E++)h.appendChild(y[E]);return p.appendChild(h),p}function S(e){var t=e.paragraph,n=e.ttParams,r=e.body,i=e.regionStyles,a=e.idStyles,o=e.paragraphStyle,u=e.timeOffset,l=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var c=n.cellResolution,d=(0,s.Z)(t,n);return{start:d.start+u,end:d.end+u,element:E(t,r,i,a,o,{cellResolution:c,shouldTrimWhiteSpace:l})}}var w=function(e,t){for(var n=(0,r.Z)(e,t),o=[],s=0;s<n.length;s++){var u=n[s].paragraphStyle;i(u)&&a(u);var l=S(n[s]);null!==l&&o.push(l)}return o}},1570:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(5403),i=n(7253),a=n(1988),o=n(6923),s=n(6177),u=n(5336),l={left:"start",center:"center",right:"end",start:"start",end:"end"},c={left:"line-left",center:"center",right:"line-right"};function d(e){var t=e.paragraph,n=e.timeOffset,r=e.paragraphStyle,d=e.ttParams,f=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var p=(0,s.Z)(t,d),v=p.start,h=p.end,m=function(e,t){function n(e,t){for(var r=e.childNodes,i="",a=0;a<r.length;a++){var s=r[a];if("#text"===s.nodeName){var u=s.textContent;if(null===u&&(u=""),t){var l=u.trim();u=l=l.replace(/\s+/g," ")}i+=u.replace(/&|\u0026/g,"&amp;").replace(/<|\u003C/g,"&lt;").replace(/>|\u2265/g,"&gt;").replace(/\u200E/g,"&lrm;").replace(/\u200F/g,"&rlm;").replace(/\u00A0/g,"&nbsp;")}else if("br"===s.nodeName)i+="\n";else if("span"===s.nodeName&&s.nodeType===Node.ELEMENT_NODE&&s.childNodes.length>0){var c=s.getAttribute("xml:space");i+=n(s,(0,o.Z)(c)?"default"===c: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=c[a];e.positionAlign=void 0===s?"":s;var d=l[a];e.lineAlign=void 0===d?"":d}}(g,r),g)}var f=function(e,t){for(var n=(0,r.Z)(e,t),i=[],a=0;a<n.length;a++){var o=d(n[a]);null!==o&&i.push(o)}return i}},5403:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(3274),i=n(6923),a=n(8026),o=n(3887),s=/(\d+) (\d+)/;var u=n(4123),l=n(3791);var c=n(5138),d=n(7714);var f=["align","backgroundColor","color","direction","display","displayAlign","extent","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","opacity","origin","overflow","padding","textAlign","textDecoration","textOutline","unicodeBidi","visibility","wrapOption","writingMode"];function p(e,t){var n=[],p=(new DOMParser).parseFromString(e,"text/xml");if(null!=p){var v=p.getElementsByTagName("tt")[0];if(void 0===v)throw new Error("invalid XML");for(var h=function(e){var t=e.getElementsByTagName("body");return t.length>0?t[0]:null}(v),m=function(e){return e.getElementsByTagName("style")}(v),g=function(e){return e.getElementsByTagName("region")}(v),y=function(e){return e.getElementsByTagName("p")}(v),_=function(e){var t=e.getAttribute("ttp:frameRate"),n=e.getAttribute("ttp:subFramRate"),r=e.getAttribute("ttp:tickRate"),a=e.getAttribute("ttp:frameRateMultiplier"),u=e.getAttribute("xml:space"),l=e.getAttribute("ttp:cellResolution"),c={columns:32,rows:15};if(null!==l){var d=s.exec(l);if(null===d||d.length<3)o.Z.warn("TTML Parser: Invalid cellResolution");else{var f=parseInt(d[1],10),p=parseInt(d[2],10);isNaN(f)||isNaN(p)?o.Z.warn("TTML Parser: Invalid cellResolution"):c={columns:f,rows:p}}}if((0,i.Z)(u)&&"default"!==u&&"preserve"!==u)throw new Error("Invalid spacing style");var v=Number(t);(isNaN(v)||v<=0)&&(v=30);var h=Number(n);(isNaN(h)||h<=0)&&(h=1);var m=Number(r);(isNaN(m)||m<=0)&&(m=void 0);var g=v,y=null!=h?h:1,_=null!==u?u:"default",b=void 0!==m?m:v*h;if(null!==a){var T=/^(\d+) (\d+)$/g.exec(a);null!==T&&(g=v*(Number(T[1])/Number(T[2])))}return{cellResolution:c,tickRate:b,frameRate:g,subFrameRate:y,spaceStyle:_}}(v),b=[],T=0;T<=m.length-1;T++){var E=m[T];if(E instanceof Element){var S=E.getAttribute("xml:id");if(null!==S){var w=E.getAttribute("style"),k=null===w?[]:w.split(" ");b.push({id:S,style:(0,l.b)(E),extendsStyles:k})}}}!function(e){var t=[];function n(r,i){t.push(i);for(var s=function(i){var s=r.extendsStyles[i],u=(0,c.Z)(e,(function(e){return e.id===s}));if(u<0)o.Z.warn("TTML Parser: unknown style inheritance: "+s);else{var l=e[u];(0,d.Z)(t,u)?o.Z.warn("TTML Parser: infinite style inheritance loop avoided"):n(l,u),r.style=(0,a.Z)({},l.style,r.style)}},u=0;u<r.extendsStyles.length;u++)s(u);r.extendsStyles.length=0}for(var r=0;r<e.length;r++)n(e[r],r),t.length=0}(b);for(var A=[],x=0;x<=g.length-1;x++){var I=g[x];if(I instanceof Element){var Z=I.getAttribute("xml:id");null!==Z&&function(){var e=(0,l.b)(I),t=I.getAttribute("style");if((0,i.Z)(t)){var n=(0,r.Z)(b,(function(e){return e.id===t}));void 0!==n&&(e=(0,a.Z)({},n.style,e))}A.push({id:Z,style:e,extendsStyles:[]})}()}}for(var R=(0,l.U)(f,null!==h?[h]:[],b,A),M="default"===(null!==h?h.getAttribute("xml:space"):void 0)||"default"===_.spaceStyle,C=0;C<y.length;C++){var P=y[C];if(P instanceof Element){var D=(0,u.Z)(P,"div"),N=(0,a.Z)({},R,(0,l.U)(f,[P].concat(D),b,A)),O=P.getAttribute("xml:space"),L=(0,i.Z)(O)?"default"===O:M,B={paragraph:P,timeOffset:t,idStyles:b,regionStyles:A,body:h,paragraphStyle:N,ttParams:_,shouldTrimWhiteSpace:L};null!==B&&n.push(B)}}}return n}},5336:function(e,t,n){"use strict";n.d(t,{Dq:function(){return d},Du:function(){return s},GK:function(){return p},KO:function(){return i},YU:function(){return f},_0:function(){return l},eT:function(){return c},ev:function(){return v},gu:function(){return r},jb:function(){return o},te:function(){return u},wf:function(){return a}});var r=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,i=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,a=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,o=/^(\d*\.?\d*)f$/,s=/^(\d*\.?\d*)t$/,u=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/,l=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,c=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/,d=/^#([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})$/,f=/^#([0-9A-f])([0-9A-f])([0-9A-f])([0-9A-f])$/,p=/^rgb\( *(\d+) *, *(\d+) *, *(\d+) *\)/,v=/^rgba\( *(\d+) *, *(\d+) *, *(\d+) *, *(\d+) *\)/},1138:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923),i=n(360);function a(e,t){for(var n=[],a=t;a<e.length;a++)if((0,i.tq)(e,a)){var o=(0,i.$4)(e,a);n.push(e.slice(a,o)),a=o}else if((0,r.Z)(e[a]))for(;(0,r.Z)(e[a]);)a++;return n}},4099:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var r=n(1138),i=n(6923),a=n(360);var o=n(9525),s={white:"#ffffff",lime:"#00ff00",cyan:"#00ffff",red:"#ff0000",yellow:"#ffff00",magenta:"#ff00ff",blue:"#0000ff",black:"#000000"};function u(e){var t=Object.keys(s).reduce((function(e,t){return e[t]="color: "+s[t]+";",e["bg_"+t]="background-color: "+s[t]+";",e}),{}),n="";return e.forEach((function(e){if(e.length>=2)for(var r=1;r<e.length;r++){var a=e[r];if(Array.isArray(/::cue {/.exec(a)))for(a=e[++r];(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)n+=a,a=e[++r];else!function(){for(var n=[],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);(0,i.Z)(a)&&Array.isArray(o);)n.push(o[1]),a=e[++r],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);for(var s="";(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)s+=a,a=e[++r];n.forEach((function(e){void 0===t[e]?t[e]=s:t[e]+=s}))}()}})),{classes:t,global:n}}var l=n(7714);function c(e,t){var n,r=["u","i","b"],a=e.nodeName.toLowerCase().split(".")[0];if((0,l.Z)(["u","i","b","c","#text"],a))if("#text"===a){var o=e.wholeText.split("\n");n=document.createElement("span");for(var s=0;s<o.length;s++)if(s>0&&n.appendChild(document.createElement("br")),o[s].length>0){var u=document.createTextNode(o[s]);n.appendChild(u)}}else{var d=e.nodeName.toLowerCase().split("."),f=[];if(d.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<e.childNodes.length;m++){var g=c(e.childNodes[m],t);n.appendChild(g)}}else{n=document.createElement("span");for(var y=0;y<e.childNodes.length;y++){var _=c(e.childNodes[y],t);n.appendChild(_)}}return n}var d=n(1679);var f,p,v,h=function(e){if(!(void 0!==e&&0!==(0,d.Z)(e).length))return"text-align:center";var t=m(e),n=_(e);return"position: absolute;margin: 0;transform: translate("+t.offset+"%,"+n.offset+"%);width: "+S(e.size)+"%;left: "+t.position+"%;top: "+(null!==n.position?n.position+"%":"auto")+";text-align: "+E(e.align)+";"};!function(e){e.LINE_LEFT="line-left",e.CENTER="center",e.LINE_RIGHT="line-right"}(f||(f={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(p||(p={})),function(e){e.START="start",e.CENTER="center",e.END="end"}(v||(v={}));var m=function(e){return{position:g(e),offset:y(e)}},g=function(e){var t,n=k(e.position);if(null!==n)return n;var r=E(e.align);return((t={})[p.LEFT]=0,t[p.CENTER]=50,t[p.RIGHT]=100,t)[r]},y=function(e){var t,n,r,i,a=((t={})[f.LINE_LEFT]=0,t[f.CENTER]=-50,t[f.LINE_RIGHT]=-100,t),o=void 0!==e.position?(r=e.position,i=/,(line-left|line-right|center)/.exec(r),!Array.isArray(i)||i.length<2?null:i[1]):null;return null!==o?a[o]:((n={})[p.LEFT]=0,n[p.CENTER]=-50,n[p.RIGHT]=-100,n)[void 0!==e.align?E(e.align):p.CENTER]},_=function(e){return{position:b(e.line),offset:T(e.line)}},b=function(e){return k(e)},T=function(e){var t,n=((t={})[v.START]=0,t[v.CENTER]=-50,t[v.END]=-100,t);if(void 0===e)return n[v.START];var r,i=(r=/,(start|center|end)/.exec(e),!Array.isArray(r)||r.length<2?null:r[1]);return null!==i?n[i]:n[v.START]},E=function(e){switch(e){case"left":case"start":return"left";case"right":case"end":return"right";default:return"center"}},S=function(e){return w(e,100)},w=function(e,t){var n=k(e);return null!==n?n:t},k=function(e){if(void 0===e)return null;var t=/^([\d.]+)%/.exec(e);return!Array.isArray(t)||t.length<2?null:parseInt(t[1],10)};function A(e,t){var n=e.start,r=e.end,a=e.settings,o=e.header,s=e.payload,u=document.createElement("div"),l=document.createAttribute("style");l.value="width:100%;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;",u.setAttributeNode(l);var d=document.createElement("p"),f=function(e){var t=document.createAttribute("style");return t.value=h(e),t}(a);d.setAttributeNode(f);var p=document.createElement("span"),v=document.createAttribute("style");v.value="background-color:rgba(0,0,0,0.8);color:white;",p.setAttributeNode(v);var m=t.global,g=t.classes,y=[m,(0,i.Z)(o)?g[o]:void 0].filter((function(e){return void 0!==e})).join("");return v.value+=y,p.setAttributeNode(v),function(e,t){for(var n=e.replace(/<[0-9]{2}:[0-9]{2}.[0-9]{3}>/,"").replace(/<([u,i,b,c])(\..*?)?(?: .*?)?>(.*?)<\/\1>/g,"<$1$2>$3</$1$2>"),r=(new DOMParser).parseFromString(n,"text/html").body.childNodes,i=[],a=0;a<r.length;a++)i.push(c(r[a],t));return i}(s.join("\n"),g).forEach((function(e){p.appendChild(e)})),u.appendChild(d),d.appendChild(p),{start:n,end:r,element:u}}var x=function(e,t){var n=e.split(/\r\n|\n|\r/g),s=[];if(null===/^WEBVTT( |\t|\n|\r|$)/.exec(n[0]))throw new Error("Can't parse WebVTT: Invalid File.");for(var l=(0,a.yE)(n),c=function(e,t){for(var n=[],r=t;r<e.length;r++)if((0,a.JF)(e,r)){var o=r;for(r++;(0,i.Z)(e[r]);)r++;var s=e.slice(o,r);n.push(s)}else if((0,i.Z)(e[r]))for(;(0,i.Z)(e[r]);)r++;return n}(n,l),d=(0,r.Z)(n,l),f=u(c),p=0;p<d.length;p++){var v=(0,o.Z)(d[p],t);if(null!=v){var h=A(v,f);s.push(h)}}return s}},9405:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(1988),i=n(1138),a=n(9525),o=n(360),s=n(7714),u=n(6923);function l(e,t){if(!(0,u.Z)(e.vertical)||"rl"!==e.vertical&&"lr"!==e.vertical||(t.vertical=e.vertical),(0,u.Z)(e.line)){var n=/^(\d+(\.\d+)?)%(,([a-z]+))?/.exec(e.line);if(Array.isArray(n))t.line=Number(n[1]),t.snapToLines=!1,(0,s.Z)(["start","center","end"],n[4])&&(t.lineAlign=n[4]);else{var r=/^(-?\d+)(,([a-z]+))?/.exec(e.line);Array.isArray(r)&&(t.line=Number(r[1]),t.snapToLines=!0,(0,s.Z)(["start","center","end"],r[3])&&(t.lineAlign=r[3]))}}if((0,u.Z)(e.position)){var i=/^([\d\.]+)%(?:,(line-left|line-right|center))?$/.exec(e.position);if(Array.isArray(i)&&i.length>=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 c=n(7253);var d=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,d,f,p=(0,o.yE)(n),v=(0,i.Z)(n,p),h=[],m=0;m<v.length;m++){var g=(0,a.Z)(v[m],t);if(null!=g){var y=(u=void 0,d=void 0,f=void 0,u=(s=g).start,d=s.end,f=s.payload.join("\n"),(0,c.Z)(u,d,f));null!=y&&((0,r.Z)(y)&&l(g.settings,y),h.push(y))}}return h}},9525:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":").reverse();if((0,r.Z)(t[2])||(0,r.Z)(t[1])){var n=(0,r.Z)(t[2])?parseInt(t[2],10):0,i=parseInt(t[1],10),a=parseFloat(t[0].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){var n,r,a,o=/-->/;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,{$4:function(){return s},JF:function(){return a},tq:function(){return o},yE:function(){return i}});var r=n(6923);function i(e){for(var t=0;t<e.length;){if(""===e[t])return t+1;t++}return t}function a(e,t){return"string"==typeof e[t]&&/^STYLE( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}function o(e,t){var n=e[t];if(void 0===n||""===n||a(e,t)||function(e,t){return"string"==typeof e[t]&&/^REGION( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}(e,t)||function(e,t){return"string"==typeof e[t]&&/^NOTE( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}(e,t))return!1;if(n.indexOf("--\x3e")>=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}},5877:function(e,t,n){"use strict";n.d(t,{Z:function(){return re}});var r=n(7874),i=n(8791),a=n(5861),o=n(7757),s=n.n(o),u=n(4597),l=n(5278);function c(e,t,n,r){return d.apply(this,arguments)}function d(){return(d=(0,a.Z)(s().mark((function e(t,n,r,i){var a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.segment.isInit&&null!==t){e.next=3;break}return e.abrupt("return",{resultType:"segment-created",resultData:null});case 3:return e.next=5,(0,u.ZP)({url:t,responseType:"arraybuffer",onProgress:i.onProgress,cancelSignal:r});case 5:return a=e.sent,e.abrupt("return",{resultType:"segment-loaded",resultData:a});case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(e,t){var n=t.segment,i=t.period,a=e.data,o=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(o)throw new Error("Image data should not be downloaded in chunks");var s=(0,l.Z)(n.timestampOffset,0);return null===a||null===r.Z.imageParser?{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:{duration:n.duration,time:n.time},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}:{segmentType:"media",chunkData:{data:r.Z.imageParser(new Uint8Array(a)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkSize:void 0,chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}}var p=n(8750),v=n(3887),h=n(1989),m=n(8026),g=n(3635);function y(e){var t=e.aggressiveMode,n=e.referenceDateTime,i=void 0!==e.serverSyncInfos?e.serverSyncInfos.serverTimestamp-e.serverSyncInfos.clientTime:void 0;return function(a,o,s,l,c){var d,f=a.responseData,y=o.externalClockOffset,_=null!==(d=a.url)&&void 0!==d?d:o.originalUrl,b=null!=i?i:y,T={aggressiveMode:!0===t,unsafelyBaseOnPreviousManifest:o.unsafeMode?o.previousManifest:null,url:_,referenceDateTime:n,externalClockOffset:b},E=r.Z.dashParsers;if(null===E.wasm||"uninitialized"===E.wasm.status||"failure"===E.wasm.status)return v.Z.debug("DASH: WASM MPD Parser not initialized. Running JS one."),w();var S=function(e){if(e instanceof ArrayBuffer)return e;if("string"==typeof e)return(0,g.tG)(e).buffer;if(e instanceof Document)return(0,g.tG)(e.documentElement.innerHTML).buffer;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(f);return 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}(S)?"initialized"===E.wasm.status?(v.Z.debug("DASH: Running WASM MPD Parser."),k(E.wasm.runWasmParser(S,T))):(v.Z.debug("DASH: Awaiting WASM initialization before parsing the MPD."),E.wasm.waitForInitialization().catch((function(){})).then((function(){return null===E.wasm||"initialized"!==E.wasm.status?(v.Z.warn("DASH: WASM MPD parser initialization failed. Running JS parser instead"),w()):(v.Z.debug("DASH: Running WASM MPD Parser."),k(E.wasm.runWasmParser(S,T)))}))):(v.Z.info("DASH: MPD doesn't seem to be UTF-8-encoded. Running JS parser instead of the WASM one."),w());function w(){if(null===E.js)throw new Error("No MPD parser is imported");var e=function(e){if(e instanceof ArrayBuffer)return(new DOMParser).parseFromString((0,g.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")}(f);return k(E.js(e,T))}function k(t){if("done"===t.type)return t.value.warnings.length>0&&s(t.value.warnings),l.isCancelled?Promise.reject(l.cancellationError):{manifest:new h.ZP(t.value.parsed,e),url:_};var n=t.value,r=n.urls.map((function(e){return c((function(){return"string"===n.format?(0,u.ZP)({url:e,responseType:"text",cancelSignal:l}):(0,u.ZP)({url:e,responseType:"arraybuffer",cancelSignal:l})})).then((function(e){if("string"===n.format){if("string"!=typeof e.responseData)throw new Error("External DASH resources should have been a string");return(0,m.Z)(e,{responseData:{success:!0,data:e.responseData}})}if(!(e.responseData instanceof ArrayBuffer))throw new Error("External DASH resources should have been ArrayBuffers");return(0,m.Z)(e,{responseData:{success:!0,data:e.responseData}})}),(function(e){var t=(0,p.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"An unknown error occured when parsing ressources."});return(0,m.Z)({},{size:void 0,requestDuration:void 0,responseData:{success:!1,error:t}})}))}));return Promise.all(r).then((function(e){return n.format,k(n.continue(e))}))}}}var _=n(7839),b=n(6872),T=n(9105),E=n(5992),S=n(1946),w="function"==typeof Headers?Headers:null,k="function"==typeof AbortController?AbortController:null;function A(){return"function"==typeof window.fetch&&!(0,S.Z)(k)&&!(0,S.Z)(w)}var x=n(8806),I=n(281);function Z(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 R=n(288),M=n(4460);function C(e){return function(t,n,r,i){return new Promise((function(o,s){var u=new R.ZP({cancelOn:r}),l=u.signal.register(s);e(t,n,u.signal,Object.assign(Object.assign({},i),{onNewChunk:function(e){try{a(e),i.onNewChunk(e)}catch(e){l(),u.cancel(),s(e)}}})).then((function(e){if(!u.isUsed){if(l(),"segment-loaded"===e.resultType)try{a(e.resultData.responseData)}catch(e){return void s(e)}o(e)}}),(function(e){l(),s(e)}))}));function a(e){(e instanceof ArrayBuffer||e instanceof Uint8Array)&&"mp4"===Z(n.adaptation.type,n.representation)&&(0,M.Z)(new Uint8Array(e),n.segment.isInit)}}}var P=n(6968);function D(e,t,n,r){if(void 0===t.range)return(0,u.ZP)({url:e,responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(void 0===t.indexRange)return(0,u.ZP)({url:e,headers:{Range:(0,I.Z)(t.range)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(t.range[1]+1===t.indexRange[0])return(0,u.ZP)({url:e,headers:{Range:(0,I.Z)([t.range[0],t.indexRange[1]])},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));var i=(0,u.ZP)({url:e,headers:{Range:(0,I.Z)(t.range)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}),a=(0,u.ZP)({url:e,headers:{Range:(0,I.Z)(t.indexRange)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress});return Promise.all([i,a]).then((function(t){var n=t[0],r=t[1],i=(0,P.zo)(new Uint8Array(n.responseData),new Uint8Array(r.responseData)),a=Math.min(n.sendingTime,r.sendingTime),o=Math.max(n.receivedTime,r.receivedTime);return{resultType:"segment-loaded",resultData:{url:e,responseData:i,size:n.size+r.size,requestDuration:o-a,sendingTime:a,receivedTime:o}}}))}var N=n(8766);function O(e,t,n,r){var i=t.segment,o=void 0!==i.range?{Range:(0,I.Z)(i.range)}:void 0,u=null;return function(e){var t;if(!(0,S.Z)(e.headers))if((0,S.Z)(w))t=e.headers;else{t=new w;for(var n=Object.keys(e.headers),r=0;r<n.length;r++){var i=n[r];t.append(i,e.headers[i])}}v.Z.debug("Fetch: Called with URL",e.url);var o=null,u=!1,l=performance.now(),c=(0,S.Z)(k)?null:new k;function d(){(0,S.Z)(c)?v.Z.warn("Fetch: AbortController API not available."):c.abort()}var f=(0,S.Z)(e.timeout)?b.Z.getCurrent().DEFAULT_REQUEST_TIMEOUT:e.timeout,p=window.setTimeout((function(){u=!0,d()}),f),h=e.cancelSignal.register((function(e){o=e,d()})),m={method:"GET"};return void 0!==t&&(m.headers=t),m.signal=(0,S.Z)(c)?null:c.signal,fetch(e.url,m).then((function(t){if((0,S.Z)(p)||clearTimeout(p),t.status>=300)throw v.Z.warn("Fetch: Request HTTP Error",t),new T.Z(t.url,t.status,E.br.ERROR_HTTP_CODE);if((0,S.Z)(t.body))throw new T.Z(t.url,t.status,E.br.PARSE_ERROR);var n=t.headers.get("Content-Length"),r=(0,S.Z)(n)||isNaN(+n)?void 0:+n,i=t.body.getReader(),o=0;return u();function u(){return c.apply(this,arguments)}function c(){return(c=(0,a.Z)(s().mark((function n(){var a,c,d,f,p;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i.read();case 2:if((a=n.sent).done||(0,S.Z)(a.value)){n.next=11;break}return o+=a.value.byteLength,c=performance.now(),d={url:t.url,currentTime:c,duration:c-l,sendingTime:l,chunkSize:a.value.byteLength,chunk:a.value.buffer,size:o,totalSize:r},e.onData(d),n.abrupt("return",u());case 11:if(!a.done){n.next=16;break}return h(),f=performance.now(),p=f-l,n.abrupt("return",{requestDuration:p,receivedTime:f,sendingTime:l,size:o,status:t.status,url:t.url});case 16:return n.abrupt("return",u());case 17:case"end":return n.stop()}}),n)})))).apply(this,arguments)}})).catch((function(t){if(null!==o)throw o;if(h(),u)throw v.Z.warn("Fetch: Request timeouted."),new T.Z(e.url,0,E.br.TIMEOUT);if(t instanceof T.Z)throw t;throw v.Z.warn("Fetch: Request Error",t instanceof Error?t.toString():""),new T.Z(e.url,0,E.br.ERROR_EVENT)}))}({url:e,headers:o,onData:function(e){var t=new Uint8Array(e.chunk),i=function(e){for(var t=0,n=[];t<e.length;){var r=e.subarray(t,1/0),i=(0,N.Z)(r,1836019558);if(i<0)return[n,r];var a=t+i+(0,P.pX)(e,i+t);if(a>e.length)return[n,r];var o=(0,N.Z)(r,1835295092);if(o<0)return[n,r];var s=t+o+(0,P.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!==u?(0,P.zo)(u,t):t),a=i[0];u=i[1];for(var o=0;o<a.length;o++)if(n.onNewChunk(a[o]),r.isCancelled)return;n.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize}),r.isCancelled},cancelSignal:r}).then((function(e){return{resultType:"chunk-complete",resultData:e}}))}function L(e,t,n,r,i){if(t.segment.isInit)return D(e,t.segment,i,r);var a=Z(t.adaptation.type,t.representation);if(n&&("mp4"===a||void 0===a)){if(A())return O(e,t,r,i);(0,x.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 o=t.segment;return(0,u.ZP)({url:e,responseType:"arraybuffer",headers:void 0!==o.range?{Range:(0,I.Z)(o.range)}:void 0,cancelSignal:i,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}var B=n(6490),U=n(4644),F=408125543,z=357149030;function V(e,t,n,r){for(var i=r[0],a=r[1],o=i;o<a;){var s=W(n,o);if(null==s)return null;var u=s.value,l=o+s.length,c=j(n,l);if(null==c)return null;var d=l+c.length,f=d+c.value;if(u===e)return[d,f];if(t.length>0)for(var p=0;p<t.length;p++){if(u===t[p])return V(e,t.slice(p+1,t.length),n,[d,f])}o=f}return null}function K(e,t){var n=V(2807729,[F,z],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 1e9/q(e,n[0],r)}function G(e,t){var n=V(17545,[F,z],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 4===r?function(e,t){return new DataView(e.buffer).getFloat32(t)}(e,n[0]):8===r?function(e,t){return new DataView(e.buffer).getFloat64(t)}(e,n[0]):null}function H(e,t){for(var n=1;n<=8;n++)if(e[t]>=Math.pow(2,8-n))return n}function W(e,t){var n=H(e,t);if(null==n)return v.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return v.Z.warn("webm: impossible length"),null;for(var r=0,i=0;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return{length:n,value:r}}function j(e,t){var n=H(e,t);if(null==n)return v.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return v.Z.warn("webm: impossible length"),null;for(var r=(e[t]&(1<<8-n)-1)*Math.pow(2,8*(n-1)),i=1;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return{length:n,value:r}}function q(e,t,n){for(var r=0,i=0;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return r}var Y=n(7403);function $(e,t,n,r){var i=(0,U.Qx)(e);if(void 0===i||void 0===r)return null;var a,o=void 0!==n.timestampOffset?i+n.timestampOffset*r:i,s=(0,U.MM)(e);if(t||!n.complete)return void 0===s&&v.Z.warn("DASH: Chunked segments should indicate a duration through their trun boxes"),{time:o/r,duration:void 0!==s?s/r:void 0};var u=n.duration*r,l=Math.min(.9*r,u/4);return void 0!==s&&Math.abs(s-u)<=l&&(a=s),{time:o/r,duration:void 0!==a?a/r:a}}function X(e,t){if(0!==e.length){var n=e.reduce((function(e,t){return"urn:mpeg:dash:event:2012"===t.schemeIdUri&&"1"===t.value?(void 0===e.manifestRefreshEventsFromEMSGs&&(e.manifestRefreshEventsFromEMSGs=[]),e.manifestRefreshEventsFromEMSGs.push(t)):(void 0===e.EMSGs&&(e.EMSGs=[]),e.EMSGs.push(t)),e}),{manifestRefreshEventsFromEMSGs:void 0,EMSGs:void 0}),r=n.manifestRefreshEventsFromEMSGs,i=n.EMSGs;return{inbandEvents:null==i?void 0:i.map((function(e){return{type:"emsg",value:e}})),needsManifestRefresh:void 0!==t&&void 0!==r&&function(e,t){if(e.length<=0)return!1;for(var n=e.length,r=0;r<n;r++){var i=t,a=e[r].messageData,o=(0,g.uR)(a),s=Date.parse(o);if(void 0===i||void 0===s||isNaN(s)||s>=i)return!0}return!1}(r,t)}}}function Q(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i=n.period,a=n.adaptation,o=n.representation,s=n.segment,u=n.manifest,c=e.data,d=e.isChunked,f=[i.start,i.end];if(null===c)return s.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:f};var p=c instanceof Uint8Array?c:new Uint8Array(c),v=Z(a.type,o),h="mp4"===v||void 0===v,m=!1;if(h){var g=(0,B.Z)(p);g.length>0&&(m=o._addProtectionData("cenc",g))}if(!s.isInit){var y=h?$(p,d,s,r):null,_=(0,l.Z)(s.timestampOffset,0);if(h){var b=(0,U.s9)(p);if(void 0!==b){var T=X(b.filter((function(e){return void 0!==s.privateInfos&&void 0!==s.privateInfos.isEMSGWhitelisted&&s.privateInfos.isEMSGWhitelisted(e)})),u.publishTime);if(void 0!==T){var E=T.needsManifestRefresh,w=T.inbandEvents;return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:y,chunkOffset:_,appendWindow:f,inbandEvents:w,protectionDataUpdate:m,needsManifestRefresh:E}}}}return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:y,chunkOffset:_,protectionDataUpdate:m,appendWindow:f}}var k=s.indexRange,A=null;if("webm"===v)A=function(e,t){var n=V(F,[],e,[t,e.length]);if(null==n)return null;var r=n[0],i=n[1],a=K(e,r);if(null==a)return null;var o=G(e,r);if(null==o)return null;var s=V(475249515,[],e,[r,i]);if(null==s)return null;for(var u=[],l=s[0];l<s[1];){var c=V(187,[],e,[l,s[1]]);if(null==c)break;var d=V(179,[],e,[c[0],c[1]]);if(null==d)return null;var f=q(e,d[0],d[1]-d[0]),p=V(241,[183],e,[c[0],c[1]]);if(null==p)return null;var v=q(e,p[0],p[1]-p[0])+r;u.push({time:f,rangeStart:v}),l=c[1]}for(var h=[],m=0;m<u.length;m++){var g=u[m];m===u.length-1?h.push({time:g.time,timescale:a,duration:0===m?o:o-g.time,range:[g.rangeStart,1/0]}):h.push({time:g.time,timescale:a,duration:u[m+1].time-g.time,range:[g.rangeStart,u[m+1].rangeStart-1]})}return h}(p,0);else if(h&&(A=(0,U.Wf)(p,Array.isArray(k)?k[0]:0),!0===t&&null!==A&&A.length>0)){var x=A[A.length-1];Array.isArray(x.range)&&(x.range[1]=1/0)}o.index instanceof Y.Z&&null!==A&&A.length>0&&o.index.initializeIndex(A);var I=h?(0,U.LD)(p):"webm"===v?K(p,0):void 0,R=(0,S.Z)(I)?void 0:I;return{segmentType:"init",initializationData:p,initializationDataSize:p.length,protectionDataUpdate:m,initTimescale:R}}}var J=n(6807);function ee(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):v.Z.warn("Transport: Unavailable time data for current text track."):(i=n.time,void 0!==n.duration?a=i+n.duration:!r&&o.complete&&(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,J.Le)(e);return null===t?"":(0,g.uR)(t)}(t),type:l,language:s.language,start:i,end:a}}function te(e,t,n){var r,i,a=e.segment,o=e.adaptation,s=e.representation;return a.isInit?null:(n?v.Z.warn("Transport: Unavailable time data for current text track."):(r=a.time,a.complete&&(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 ne(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a=n.period,o=n.adaptation,s=n.representation,u=n.segment,c=e.data,d=e.isChunked;if(null===c)return u.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:null,chunkOffset:null!==(i=u.timestampOffset)&&void 0!==i?i:0,protectionDataUpdate:!1,appendWindow:[a.start,a.end]};var f=Z(o.type,s);if("webm"===f)throw new Error("Text tracks with a WEBM container are not yet handled.");return"mp4"===f?function(e,t,n,r,i){var a=n.period,o=n.representation,s=n.segment,u=s.isInit,c=s.indexRange,d="string"==typeof e?(0,g.tG)(e):e instanceof Uint8Array?e:new Uint8Array(e);if(u){var f=(0,U.Wf)(d,Array.isArray(c)?c[0]:0);if(!0===i&&null!==f&&f.length>0){var p=f[f.length-1];Array.isArray(p.range)&&(p.range[1]=1/0)}var v=(0,U.LD)(d);return o.index instanceof Y.Z&&null!==f&&f.length>0&&o.index.initializeIndex(f),{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:v}}var h=$(d,t,s,r),m=ee(n,d,h,t),y=(0,l.Z)(s.timestampOffset,0);return{segmentType:"media",chunkData:m,chunkSize:d.length,chunkInfos:h,chunkOffset:y,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(c,d,n,r,t):function(e,t,n){var r,i,a=n.period,o=n.segment,s=o.timestampOffset,u=void 0===s?0:s;if(o.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if("string"!=typeof e){var l=e instanceof Uint8Array?e:new Uint8Array(e);r=(0,g.uR)(l),i=l.length}else r=e;return{segmentType:"media",chunkData:te(n,r,t),chunkSize:i,chunkInfos:null,chunkOffset:u,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(c,d,n)}}var re=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=y(e),a=function(e){var t=e.lowLatencyMode,n=e.segmentLoader;return!0!==e.checkMediaSegmentIntegrity?r:C(r);function r(e,r,i,a){if(null==e)return Promise.resolve({resultType:"segment-created",resultData:null});if(t||void 0===n)return L(e,r,t,a,i);var o={adaptation:r.adaptation,manifest:r.manifest,period:r.period,representation:r.representation,segment:r.segment,transport:"dash",url:e};return new Promise((function(s,u){var l=!1,c=n(o,{reject:function(e){var t,n,r;if(!l&&!i.isCancelled){l=!0,i.deregister(d);var a=e,o=null!==(t=null==a?void 0:a.message)&&void 0!==t?t:"Unknown error when fetching a DASH segment through a custom segmentLoader.",s=new _.Z(o,null!==(n=null==a?void 0:a.canRetry)&&void 0!==n&&n,null!==(r=null==a?void 0:a.isOfflineError)&&void 0!==r&&r,null==a?void 0:a.xhr);u(s)}},resolve:function(e){l||i.isCancelled||(l=!0,i.deregister(d),s({resultType:"segment-loaded",resultData:{responseData:e.data,size:e.size,requestDuration:e.duration}}))},progress:function(e){l||i.isCancelled||a.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})},fallback:function(){l||i.isCancelled||(l=!0,i.deregister(d),L(e,r,t,a,i).then(s,u))}});function d(e){l||(l=!0,"function"==typeof c&&c(),u(e))}i.register(d)}))}}(e),o=Q(e);return{manifest:{loadManifest:t,parseManifest:n},audio:{loadSegment:a,parseSegment:o},video:{loadSegment:a,parseSegment:o},text:{loadSegment:function(e){var t=e.lowLatencyMode;return!0!==e.checkMediaSegmentIntegrity?n:C(n);function n(e,n,r,i){var a=n.adaptation,o=n.representation,s=n.segment,l=s.range;if(null===e)return Promise.resolve({resultType:"segment-created",resultData:null});if(s.isInit)return D(e,s,r,i);var c=Z(a.type,o),d="mp4"===c||void 0===c;if(t&&d){if(A())return O(e,n,i,r);(0,x.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")}return d?(0,u.ZP)({url:e,responseType:"arraybuffer",headers:Array.isArray(l)?{Range:(0,I.Z)(l)}:null,onProgress:i.onProgress,cancelSignal:r}).then((function(e){return{resultType:"segment-loaded",resultData:e}})):(0,u.ZP)({url:e,responseType:"text",headers:Array.isArray(l)?{Range:(0,I.Z)(l)}:null,onProgress:i.onProgress,cancelSignal:r}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}}(e),parseSegment:ne(e)},image:{loadSegment:c,parseSegment:f}}}},2339:function(e,t,n){"use strict";n.d(t,{Z:function(){return me}});var r=n(5861),i=n(7757),a=n.n(i),o=n(7874),s=n(3887),u=n(1989),l=n(6807),c=n(8999),d=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 S(e,t){return E(e,p.zo.apply(void 0,t))}function w(e){var t=[];e.periods.forEach((function(n){var r=n.id;if((0,d.Z)(t,r)){s.Z.warn("Two periods with the same ID found. Updating.");var i=r+"-dup";n.id=i,w(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,d.Z)(o,n)){s.Z.warn("Two adaptations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,w(e),o.push(r)}else o.push(n);var i=[];t.representations.forEach((function(t){var n=t.id;if((0,d.Z)(i,n)){s.Z.warn("Two representations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,w(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),R=n(3911),M=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,R.jH)(a,null)&&(a.duration===o.duration?a.repeatCount++:e.timeline.push({duration:o.duration,start:o.time,repeatCount:0}),!0))}function D(e,t){return e.replace(/\{start time\}/g,String(t))}function N(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,R.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,complete:!0}},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,c=this._isAggressiveMode,d=[],f=s.length,p=null==this._scaledLiveGap?void 0:performance.now()/1e3*u-this._scaledLiveGap,v=0;v<f;v++){for(var h=s[v],m=h.duration,g=h.start,y=O(h,s[v+1]),_=N(g,i,m),b=g+_*m,T=c?0:m;b<a&&_<=y&&(null==p||b+T<=p);){var E=b,S=null!=n?n+_:void 0,w={id:String(b),isInit:!1,time:E/u,end:(E+m)/u,duration:m/u,timescale:1,number:S,mediaURLs:[D(l,E)],complete:!0,privateInfos:{smoothMediaSegment:{time:E,duration:m}}};d.push(w),b=g+ ++_*m}if(b>=a)return d;null!=n&&(n+=y+1)}return d},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>=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,R.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,R._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,M.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,R.jH)(o,null);if(!((0,R.jH)(a,null)<=u))for(var l=0;l<t.length;l++){var c=t[l],d=(0,R.jH)(c,null);if(d===u)return void(this._index.timeline=this._index.timeline.concat(t.slice(l+1)));if(d>u){if(c.duration!==o.duration)return;var f=u-c.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%c.duration!=0)return;var p=f/c.duration-1,v=c.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<e.length;n++)P(this._index,e[n],t)},t._refreshTimeline=function(){if(null!=this._initialScaledLastPosition){var e=this._index,t=this._timeShiftBufferDepth,n=(performance.now()-this._indexValidityTime)/1e3+this._initialScaledLastPosition/e.timescale;if(null!=t){var r=(n-t)*e.timescale;(0,Z.Z)(e.timeline,r)}}},e}();function B(e,t,n){for(var r=e.firstElementChild,i=n;null!==r;)i=t(i,r.nodeName,r),r=r.nextElementSibling;return i}var U={audio:"audio/mp4",video:"video/mp4",text:"application/ttml+xml"},F={AACL:"audio/mp4",AVC1:"video/mp4",H264:"video/mp4",TTML:"application/ttml+xml+mp4",DFXP:"application/ttml+xml+mp4"};var z=function(e){void 0===e&&(e={});var t=void 0===e.referenceDateTime?Date.UTC(1970,0,1,0,0,0,0)/1e3:e.referenceDateTime,n=void 0===e.minRepresentationBitrate?0:e.minRepresentationBitrate,r=e.serverSyncInfos,i=void 0!==r?r.serverTimestamp-r.clientTime:void 0;function a(e,t){var n=B(e,(function(e,t,n){return"CustomAttributes"===t&&e.push.apply(e,B(n,(function(e,t,n){if("Attribute"===t){var r=n.getAttribute("Name"),i=n.getAttribute("Value");null!==r&&null!==i&&e.push(r+"="+i)}return e}),[])),e}),[]);function r(t){var n=e.getAttribute(t);return null==n?void 0:n}switch(t){case"audio":var i=r("AudioTag"),a=r("BitsPerSample"),o=r("Channels"),u=r("CodecPrivateData"),l=r("FourCC"),c=r("PacketSize"),d=r("SamplingRate"),f=r("Bitrate"),p=void 0===f||isNaN(parseInt(f,10))?0:parseInt(f,10);if(void 0!==l&&void 0===F[l]||void 0===u)return s.Z.warn("Smooth parser: Unsupported audio codec. Ignoring quality level."),null;var h=function(e,t){var n;return 0==(n="AACH"===t?5:(0,v.Z)(e)?(248&parseInt(e.substring(0,2),16))>>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!==c?parseInt(c,10):c,samplingRate:void 0!==d?parseInt(d,10):d};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 S=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:S,width:void 0!==_?parseInt(_,10):void 0,height:void 0!==b?parseInt(b,10):void 0};case"text":var w=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)(w,"")};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,S=r.getAttribute("Type");if(null===S)throw new Error("StreamIndex without type.");(0,d.Z)(c.r,S)||s.Z.warn("Smooth Parser: Unrecognized adaptation type:",S);var w=S,k=r.getAttribute("Subtype"),A=r.getAttribute("Language"),x=r.getAttribute("Url"),I=null===x?"":x;var Z,R=B(r,(function(e,t,r){switch(t){case"QualityLevel":var i=a(r,w);if(null===i)return e;("video"!==w||i.bitrate>n)&&e.qualityLevels.push(i);break;case"c":e.cNodes.push(r)}return e}),{qualityLevels:[],cNodes:[]}),M=R.qualityLevels,C=R.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 c=Z[n+1];if(void 0===c)return e;var d=c.getAttribute("t"),f=(0,v.Z)(d)?+d: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!==M.length,"Adaptation should have at least one playable representation.");var D=w+((0,v.Z)(A)?"_"+A:""),N=M.map((function(t){var n,r,i,a,s=(0,m.Z)(o,I),c={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]:""))},d=(0,v.Z)(t.mimeType)?t.mimeType:U[w],f=t.codecs,b=D+"_"+(null!=w?w+"-":"")+(null!=d?d+"-":"")+(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 S={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(c,{aggressiveMode:k,isLive:_,manifestReceivedTime:y,segmentPrivateInfos:S,timeShiftBufferDepth:l}),x=(0,h.Z)({},t,{index:A,mimeType:d,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 R=[{type:"cenc",values:Z}];x.contentProtections={keyIds:T,initData:R}}else x.contentProtections={keyIds:T,initData:[]}}return x}));if("ADVT"===k)return null;var O={id:D,type:w,representations:N,language:null==A?void 0:A};return"text"===w&&"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"),c=u.getAttribute("MinorVersion");if(null===l||null===c||!/^[2]-[0-2]$/.test(l+"-"+c))throw new Error("Version should be 2.0, 2.1 or 2.2");var d,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(d=u.getAttribute("IsLive"))?d:"string"==typeof d&&"TRUE"===d.toUpperCase();if(b){var T=u.getAttribute("DVRWindowLength");null==T||isNaN(+T)||0==+T||(f=+T/h)}var E,S,k,A,I,Z,R=_.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}),{}),M=null,C=void 0!==R.video?R.video[0]:void 0,P=void 0!==R.audio?R.audio[0]:void 0;if(void 0!==C||void 0!==P){var D=[],N=[];if(void 0!==C){var O=C.representations[0];if(void 0!==O){var L=O.index.getFirstPosition(),U=O.index.getLastPosition();null!=L&&D.push(L),null!=U&&N.push(U)}}if(void 0!==P){var F=P.representations[0];if(void 0!==F){var z=F.index.getFirstPosition(),V=F.index.getLastPosition();null!=z&&D.push(z),null!=V&&N.push(V)}}D.length>0&&(I=Math.max.apply(Math,D)),N.length>0&&(Z=Math.min.apply(Math,N))}var K=u.getAttribute("Duration"),G=null!=K&&0!=+K?+K/h:void 0;b?(E=e.suggestedPresentationDelay,S=t,k=null!=I?I:S,A={isLinear:!0,value:null!=Z?Z:Date.now()/1e3-S,time:performance.now()},M=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,j={availabilityStartTime:void 0===S?0:S,clockOffset:i,isLive:b,isDynamic:b,isLastPeriodKnown:!0,timeBounds:{absoluteMinimumTime:k,timeshiftDepth:M,maximumTimeData:A},periods:[{adaptations:R,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 w(j),j}},V=n(4597),K=n(8806),G=n(4460),H=n(8791),W=n(4644),j=n(2297);function q(e,t,n,r,i){var a,o,u,c=[];if(i){var d=(0,l.XA)(e);null!==d?(u=function(e){var t=(0,j.nR)(e,3565190898,3392751253,2387879627,2655430559);if(void 0===t)return[];for(var n=[],r=t[0],i=t[4],a=0;a<i;a++){var o=void 0,s=void 0;1===r?(s=(0,p.pV)(t,16*a+5),o=(0,p.pV)(t,16*a+5+8)):(s=(0,p.pX)(t,8*a+5),o=(0,p.pX)(t,8*a+5+4)),n.push({time:s,duration:o})}return n}(d),o=function(e){var t=(0,j.nR)(e,1830656773,1121273062,2162299933,2952222642);if(void 0!==t)return{duration:(0,p.pV)(t,12),time:(0,p.pV)(t,4)}}(d)):s.Z.warn("smooth: could not find traf atom")}if(void 0!==u)for(var f=0;f<u.length;f++)c.push({time:u[f].time,duration:u[f].duration,timescale:n});if(void 0!==o)return{nextSegments:c,chunkInfos:{time:o.time/n,duration:o.duration/n},scaledSegmentTime:o.time};if(t||!r.complete)return{nextSegments:c,chunkInfos:null,scaledSegmentTime:void 0};var v=r.duration*n,h=Math.min(.9*n,v/4),m=(0,W.MM)(e),g=void 0!==(null===(a=r.privateInfos)||void 0===a?void 0:a.smoothMediaSegment)?r.privateInfos.smoothMediaSegment.time:Math.round(r.time*n);return{nextSegments:c,chunkInfos:void 0!==m&&Math.abs(m-v)<=h?{time:r.time,duration:m/n}:{time:r.time,duration:r.duration},scaledSegmentTime:g}}var Y=n(3666);function $(e,t){return E("schm",(0,p.zo)(4,(0,g.tG)(e),(0,p.kh)(t)))}function X(e){return E("frma",(0,g.tG)(e))}function Q(e){var t=[7,[e.length]];return E("stsd",p.zo.apply(void 0,t.concat(e)))}function J(e,t,n){return E("tenc",(0,p.zo)(6,[e,t],n))}function ee(e,t,n,r,i){var a=[e,t,n];return void 0!==i&&a.push(E("senc",i),function(e){if(0===e.length)return E("saiz",new Uint8Array(0));var t=(0,p.pX)(e,0),n=(0,p.pX)(e,4),r=new Uint8Array(n+9);r.set((0,p.kh)(n),5);for(var i,a,o=9,s=8;s<e.length;)s+=8,2==(2&t)?(a=2,s+=6*(i=(0,p.zK)(e,s))+2):(i=0,a=0),r[o]=6*i+8+a,o++;return E("saiz",r)}(i),function(e,t,n,r){return E("saio",(0,p.zo)(4,[0,0,0,1],(0,p.kh)(e.length+t.length+n.length+r.length+8+8+8+8)))}(r,e,t,n)),S("traf",a)}function te(e,t){var n=(0,j.Qy)(e,1836019558);if(null===n)throw new Error("Smooth: Invalid ISOBMFF given");var r=e.subarray(n[1],n[2]),i=(0,j.iz)(r,1835427940),a=(0,j.t_)(r,1953653094);if(null===a||null===i)throw new Error("Smooth: Invalid ISOBMFF given");var o=(0,j.Qy)(a,1952868452),s=(0,j.Qy)(a,1953658222);if(null===o||null===s)throw new Error("Smooth: Invalid ISOBMFF given");var u=a.subarray(o[0],o[2]),l=a.subarray(s[0],s[2]);u.set([0,0,0,1],o[1]-o[0]+4);var c=function(e){return E("tfdt",(0,p.zo)([1,0,0,0],(0,p.el)(e)))}(t),d=function(e,t){if((1&e[t+3])>0)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,W.J6)(n)}(l,s[1]-s[0]),f=ee(u,c,d,i,(0,j.nR)(a,2721664850,1520127764,2722393154,2086964724)),v=S("moof",[i,f]),h=(0,j.Qy)(v,1836019558),m=(0,j.Qy)(f,1953653094),g=(0,j.Qy)(d,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+c.length+(g[1]-g[0])+8,_=n[2]-n[0],b=v.length-_,T=(0,j.Qy)(e,1835295092);if(null===T)throw new Error("Smooth: Invalid ISOBMFF given");if(!Y.YM&&(0===b||b<=-8)){var w=T[1];return v.set((0,p.kh)(w),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 ne=n(7839),re=n(281);function ie(e,t,n,r,i,a){var o,s,u,l=S("stbl",[n,E("stts",new Uint8Array(8)),E("stsc",new Uint8Array(8)),E("stsz",new Uint8Array(12)),E("stco",new Uint8Array(8))]),c=S("dinf",[function(e){return E("dref",(0,p.zo)(7,[1],e))}(E("url ",new Uint8Array([0,0,0,1])))]),d=S("minf",[r,c,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=S("mdia",[function(e){return E("mdhd",(0,p.zo)(12,(0,p.kh)(e),8))}(e),f,d]),h=S("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=S("mvex",[(o=1,E("trex",(0,p.zo)(4,(0,p.kh)(o),[0,0,0,1],12)))]),y=function(e,t,n){return S("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 ae(e,t,n,r,i,a,o,s){var u=o.split("00000001"),l=u[1],c=u[2];if(void 0===l||void 0===c)throw new Error("Smooth: unsupported codec private data.");var d,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)(c),a);if(void 0===s){d=Q([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=S("schi",[J(1,8,s)]),m=$("cenc",65536);d=Q([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,S("sinf",[X("avc1"),m,h]))])}return ie(e,"video",d,((f=new Uint8Array(12))[3]=1,E("vmhd",f)),t,n)}var oe=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];function se(e,t,n,r,i,a,o){var s,u,l,c=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&oe.indexOf(s))<<4)|31&u)<<3,(0,g.ci)((0,p.XT)(l))):a);return ie(e,"audio",function(){if(void 0===o)return Q([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,c)]);var e=S("schi",[J(1,8,o)]),a=$("cenc",65536),s=S("sinf",[X("mp4a"),a,e]);return Q([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,c,s)])}(),E("smhd",new Uint8Array(8)),0,0)}var ue=/(\.isml?)(\?token=\S+)?$/,le=/\?token=(\S+)/;function ce(e,t){return(0,v.Z)(t)?e.replace(le,"?token="+t):e.replace(le,"")}function de(e){return"string"==typeof e.mimeType&&e.mimeType.indexOf("mp4")>=0}function fe(e,t,n,r,i){var a,o=t.segment.range;return Array.isArray(o)&&(a={Range:(0,re.Z)(o)}),(0,V.ZP)({url:e,responseType:"arraybuffer",headers:a,cancelSignal:r,onProgress:n.onProgress}).then((function(e){if(!de(t.representation)||!0!==i)return{resultType:"segment-loaded",resultData:e};var n=new Uint8Array(e.responseData);return(0,G.Z)(n,t.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},e),{responseData:n})}}))}var pe=function(e){var t=e.checkMediaSegmentIntegrity,n=e.customSegmentLoader;return function(e,r,i,a){var o=r.segment,s=r.manifest,u=r.period,l=r.adaptation,c=r.representation;if(o.isInit){if(void 0===o.privateInfos||void 0===o.privateInfos.smoothInitSegment)throw new Error("Smooth: Invalid segment format");var d,f=o.privateInfos.smoothInitSegment,p=f.codecPrivateData,v=f.timescale,h=f.protection,m=void 0===h?{keyId:void 0,keySystems:void 0}:h;if(void 0===p)throw new Error("Smooth: no codec private data.");switch(l.type){case"video":var g=c.width,y=void 0===g?0:g,_=c.height;d=ae(v,y,void 0===_?0:_,72,72,4,p,m.keyId);break;case"audio":var b=f.channels,T=void 0===b?0:b,E=f.bitsPerSample,S=void 0===E?0:E,w=f.packetSize,k=void 0===w?0:w,A=f.samplingRate;d=se(v,T,S,k,void 0===A?0:A,p,m.keyId);break;default:0,d=new Uint8Array(0)}return Promise.resolve({resultType:"segment-created",resultData:d})}if(null===e)return Promise.resolve({resultType:"segment-created",resultData:null});var x={adaptation:l,manifest:s,period:u,representation:c,segment:o,transport:"smooth",url:e};return"function"!=typeof n?fe(e,r,a,i,t):new Promise((function(o,s){var u=!1,l=n(x,{reject:function(e){var t,n,r;if(!u&&!i.isCancelled){u=!0,i.deregister(c);var a=e,o=null!==(t=null==a?void 0:a.message)&&void 0!==t?t:"Unknown error when fetching a Smooth segment through a custom segmentLoader.",l=new ne.Z(o,null!==(n=null==a?void 0:a.canRetry)&&void 0!==n&&n,null!==(r=null==a?void 0:a.isOfflineError)&&void 0!==r&&r,null==a?void 0:a.xhr);s(l)}},resolve:function(e){if(!u&&!i.isCancelled){u=!0,i.deregister(c),de(r.representation)&&!0===t||o({resultType:"segment-loaded",resultData:{responseData:e.data,size:e.size,requestDuration:e.duration}});var n=e.data instanceof Uint8Array?e.data:new Uint8Array(e.data);(0,G.Z)(n,r.segment.isInit),o({resultType:"segment-loaded",resultData:{responseData:n,size:e.size,requestDuration:e.duration}})}},fallback:function(){u||i.isCancelled||(u=!0,i.deregister(c),fe(e,r,a,i,t).then(o,s))},progress:function(e){u||i.isCancelled||a.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})}});function c(e){u||((u=!0)||"function"!=typeof l||l(),s(e))}i.register(c)}))}},ve=/\.wsx?(\?token=\S+)?/;function he(e,t,n){var r;s.Z.debug("Smooth Parser: update segments information.");for(var i=e.representations,a=0;a<i.length;a++){var o=i[a];o.index instanceof L&&void 0!==(null===(r=null==n?void 0:n.privateInfos)||void 0===r?void 0:r.smoothMediaSegment)?o.index.addNewSegments(t,n.privateInfos.smoothMediaSegment):s.Z.warn("Smooth Parser: should only encounter SmoothRepresentationIndex")}}var me=function(e){var t=z(e),n=pe(e),i={customManifestLoader:e.manifestLoader},c={loadSegment:function(e,t,r,i){return n(e,t,r,i)},parseSegment:function(e,t,n){var r,i,a=t.segment,o=t.adaptation,s=t.manifest,u=e.data,l=e.isChunked;if(null===u)return a.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var c=u instanceof Uint8Array?u:new Uint8Array(u);if(a.isInit){var d=null===(i=null===(r=a.privateInfos)||void 0===r?void 0:r.smoothInitSegment)||void 0===i?void 0:i.timescale;return{segmentType:"init",initializationData:u,initializationDataSize:u.byteLength,initTimescale:d,protectionDataUpdate:!1}}var f=void 0!==n?q(c,l,n,a,s.isLive):null;if(null===f||null===f.chunkInfos||void 0===f.scaledSegmentTime)throw new Error("Smooth Segment without time information");var p=f.nextSegments,v=f.chunkInfos,h=te(c,f.scaledSegmentTime);return p.length>0&&he(o,p,a),{segmentType:"media",chunkData:h,chunkInfos:v,chunkOffset:0,chunkSize:h.length,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}};return{manifest:{resolveManifestUrl:function(e,t){if(void 0===e)return Promise.resolve(void 0);var n;ve.test(e)?((0,K.Z)("Giving WSX URL to loadVideo is deprecated. You should only give Manifest URLs."),n=(0,V.ZP)({url:ce(e,""),responseType:"document",cancelSignal:t}).then((function(e){var t=e.responseData.getElementsByTagName("media")[0].getAttribute("src");if(null===t||0===t.length)throw new Error("Invalid ISML");return t}))):n=Promise.resolve(e);var r=function(e){var t=le.exec(e);if(null!==t){var n=t[1];if(void 0!==n)return n}return""}(e);return n.then((function(e){return ce(function(e){return ue.test(e)?((0,K.Z)("Giving a isml URL to loadVideo is deprecated. Please give the Manifest URL directly"),e.replace(ue,"$1/manifest$2")):e}(e),r)}))},loadManifest:(0,H.Z)(i,"text"),parseManifest:function(n,r){var i,a=null!==(i=n.url)&&void 0!==i?i:r.originalUrl,o=n.receivedTime,s=n.responseData,l="string"==typeof s?(new DOMParser).parseFromString(s,"text/xml"):s,c=t(l,a,o);return{manifest:new u.ZP(c,{representationFilter:e.representationFilter,supplementaryImageTracks:e.supplementaryImageTracks,supplementaryTextTracks:e.supplementaryTextTracks}),url:a}}},audio:c,video:c,text:{loadSegment:function(t,n,r,i){var a=n.segment,o=n.representation;return a.isInit||null===t?Promise.resolve({resultType:"segment-created",resultData:null}):de(o)?(0,V.ZP)({url:t,responseType:"arraybuffer",cancelSignal:r,onProgress:i.onProgress}).then((function(t){if(!0!==e.checkMediaSegmentIntegrity)return{resultType:"segment-loaded",resultData:t};var r=new Uint8Array(t.responseData);return(0,G.Z)(r,n.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},t),{responseData:r})}})):(0,V.ZP)({url:t,responseType:"text",cancelSignal:r,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))},parseSegment:function(e,t,n){var r,i,a,o=t.manifest,u=t.adaptation,c=t.representation,d=t.segment,f=u.language,p=de(c),v=c.mimeType,h=void 0===v?"":v,m=c.codec,y=void 0===m?"":m,_=e.data,b=e.isChunked;if(d.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(null===_)return{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var T,E,S,w,k=null;if(p){var A;i=(A="string"==typeof _?(0,g.tG)(_):_ instanceof Uint8Array?_:new Uint8Array(_)).length;var x=void 0!==n?q(A,b,n,d,o.isLive):null;a=null==x?void 0:x.nextSegments,null===(k=null!==(r=null==x?void 0:x.chunkInfos)&&void 0!==r?r:null)?b?s.Z.warn("Smooth: Unavailable time data for current text track."):(T=d.time,E=d.end):(T=k.time,E=void 0!==k.duration?k.time+k.duration:d.end);var I=y.toLowerCase();if("application/ttml+xml+mp4"===h||"stpp"===I||"stpp.ttml.im1t"===I)w="ttml";else{if("wvtt"!==I)throw new Error("could not find a text-track parser for the type "+h);w="vtt"}var Z=(0,l.Le)(A);S=null===Z?"":(0,g.uR)(Z)}else{var R;if(T=d.time,E=d.end,"string"!=typeof _){var M=_ instanceof Uint8Array?_:new Uint8Array(_);i=M.length,R=(0,g.uR)(M)}else R=_;switch(h){case"application/x-sami":case"application/smil":w="sami";break;case"application/ttml+xml":w="ttml";break;case"text/vtt":w="vtt"}if(void 0===w){if("srt"!==y.toLowerCase())throw new Error("could not find a text-track parser for the type "+h);w="srt"}S=R}return null!==k&&Array.isArray(a)&&a.length>0&&he(u,a,d),{segmentType:"media",chunkData:{type:w,data:S,start:T,end:E,language:f},chunkSize:i,chunkInfos:k,chunkOffset:null!=T?T:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}},image:{loadSegment:function(e,t,n,i){return(0,r.Z)(a().mark((function r(){var o;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!t.segment.isInit&&null!==e){r.next=2;break}return r.abrupt("return",{resultType:"segment-created",resultData:null});case 2:return r.next=4,(0,V.ZP)({url:e,responseType:"arraybuffer",onProgress:i.onProgress,cancelSignal:n});case 4:return o=r.sent,r.abrupt("return",{resultType:"segment-loaded",resultData:o});case 6:case"end":return r.stop()}}),r)})))()},parseSegment:function(e,t,n){var r=e.data,i=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(i)throw new Error("Image data should not be downloaded in chunks");return null===r||null===o.Z.imageParser?{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}:{segmentType:"media",chunkData:{data:o.Z.imageParser(new Uint8Array(r)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkSize:void 0,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 o}});var r=n(7904),i=n(4597),a=n(7839);function o(e,t){var n=e.customManifestLoader,o=function(e){return function(t,n){if(void 0===t)throw new Error("Cannot perform HTTP(s) request. URL not known");switch(e){case"arraybuffer":return(0,i.ZP)({url:t,responseType:"arraybuffer",cancelSignal:n});case"text":return(0,i.ZP)({url:t,responseType:"text",cancelSignal:n});case"document":return(0,i.ZP)({url:t,responseType:"document",cancelSignal:n});default:(0,r.Z)(e)}}}(t);return"function"!=typeof n?o:function(e,t){return function(n,r){return new Promise((function(i,o){var s=Date.now()-performance.now(),u=!1,l=e(n,{reject:function(e){var t,n,i;if(!u&&!r.isCancelled){u=!0,r.deregister(c);var s=e,l=null!==(t=null==s?void 0:s.message)&&void 0!==t?t:"Unknown error when fetching the Manifest through a custom manifestLoader.",d=new a.Z(l,null!==(n=null==s?void 0:s.canRetry)&&void 0!==n&&n,null!==(i=null==s?void 0:s.isOfflineError)&&void 0!==i&&i,null==s?void 0:s.xhr);o(d)}},resolve:function(e){if(!u&&!r.isCancelled){u=!0,r.deregister(c);var t=void 0!==e.receivingTime?e.receivingTime-s:void 0,n=void 0!==e.sendingTime?e.sendingTime-s:void 0;i({responseData:e.data,size:e.size,requestDuration:e.duration,url:e.url,receivedTime:t,sendingTime:n})}},fallback:function(){u||r.isCancelled||(u=!0,r.deregister(c),t(n,r).then(i,o))}});function c(e){u||(u=!0,"function"==typeof l&&l(),o(e))}r.register(c)}))}}(n,o)}},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<r;i++){var a=e[i];if(t.call(n,a,i,e))return a}}n.d(t,{Z:function(){return r}})},5138:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.findIndex)return e.findIndex(t,n);for(var r=e.length>>>0,i=0;i<r;i++)if(t.call(n,e[i],i,e))return i;return-1}n.d(t,{Z:function(){return r}})},7714:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.includes)return e.includes(t,n);var r=e.length>>>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<r;){if((i=e[s])===(a=t)||"number"==typeof i&&"number"==typeof a&&isNaN(i)&&isNaN(a))return!0;s++}return!1}n.d(t,{Z:function(){return r}})},811:function(e,t,n){"use strict";n.d(t,{Z:function(){return i},u:function(){return a}});var r=n(1946);function i(e,t){0}function a(e,t,n){for(var a in void 0===n&&(n="object"),i((0,r.Z)(e)),t)t.hasOwnProperty(a)&&i((e[a],t[a]),t[a])}},7904:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7326),i=n(4578),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(2146).Z)(Error));function o(e){throw new a("Unreachable path taken")}},9689:function(e,t,n){"use strict";n.d(t,{J:function(){return s},K:function(){return u}});var r=n(3887),i=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],a=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];function o(e){if(e>=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<r;t+=3)n+=i[e[t-2]>>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<n.length-2)throw new Error("Unable to parse base64 string.");for(var a,s=n.endsWith("==")?2:n.endsWith("=")?1:0,u=n.length,l=new Uint8Array(u/4*3),c=0,d=0;c<u;c+=4,d+=3)a=o(n.charCodeAt(c))<<18|o(n.charCodeAt(c+1))<<12|o(n.charCodeAt(c+2))<<6|o(n.charCodeAt(c+3)),l[d]=a>>16,l[d+1]=a>>8&255,l[d+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;++n<t;)r+="number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?e:e.length;var i=new Uint8Array(r),a=0;for(n=-1;++n<t;)"number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?a+=e:e.length>0&&(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 c(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 d(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,{O_:function(){return p},QI:function(){return a},XT:function(){return u},_f:function(){return v},dN:function(){return f},el:function(){return c},kh:function(){return l},pV:function(){return s},pX:function(){return o},qb:function(){return d},zK:function(){return i},zo:function(){return r}})},7864:function(e,t,n){"use strict";function r(e,t){return new Promise((function(n,r){var i=setTimeout((function(){a(),n()}),e),a=t.register((function(e){clearTimeout(i),r(e)}))}))}n.d(t,{Z:function(){return r}})},8117:function(e,t,n){"use strict";var r=n(1480),i=n(3102),a=n(2817),o=n(1946);t.Z=function(e){return e instanceof r.y?e:e instanceof Promise||!(0,o.Z)(e)&&"function"==typeof e.then?(0,i.D)(e):(0,a.of)(e)}},8333: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},c=function(e){u(e)},d={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=d.delegate;return((null==n?void 0:n.setImmediate)||l).apply(void 0,(0,i.ev)([],(0,i.CR)(e)))},clearImmediate:function(e){var t=d.delegate;return((null==t?void 0:t.clearImmediate)||c)(e)},delegate:void 0},f=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return(0,i.ZT)(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=d.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&&(d.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<i&&(e=n.shift()));if(this._active=!1,t){for(;++r<i&&(e=n.shift());)e.unsubscribe();throw t}},t}(n(9682).v))(f),v=n(8720);function h(){return function(e){return e.pipe((0,v.R)(p))}}},1959:function(e,t,n){"use strict";n.d(t,{R:function(){return s},Z:function(){return o}});var r=n(1480),i=n(3887),a=n(1946),o=function(){function e(){this._listeners={}}var t=e.prototype;return t.addEventListener=function(e,t){var n=this._listeners[e];Array.isArray(n)?n.push(t):this._listeners[e]=[t]},t.removeEventListener=function(e,t){if((0,a.Z)(e))this._listeners={};else{var n=this._listeners[e];if(Array.isArray(n))if((0,a.Z)(t))delete this._listeners[e];else{var r=n.indexOf(t);-1!==r&&n.splice(r,1),0===n.length&&delete this._listeners[e]}}},t.trigger=function(e,t){var n=this._listeners[e];Array.isArray(n)&&n.slice().forEach((function(e){try{e(t)}catch(e){i.Z.error(e,e instanceof Error?e.stack:null)}}))},e}();function s(e,t){return new r.y((function(n){function r(e){n.next(e)}return e.addEventListener(t,r),function(){e.removeEventListener(t,r)}}))}},2793:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(9917),i=n(9127),a=n(4975);function o(e,t){return function(n){return(0,r.P)((function(){return n.pipe((0,i.U)(e),(0,a.h)((function(e){return e!==t})))}))}}},9592:function(e,t,n){"use strict";function r(e,t){return"function"==typeof Array.prototype.flatMap?e.flatMap(t):e.reduce((function(e,n){var r=t(n);return Array.isArray(r)?(e.push.apply(e,r),e):(e.push(r),e)}),[])}n.d(t,{Z:function(){return r}})},2572:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});function r(e){return e*(.3*(2*Math.random()-1)+1)}},2870:function(e,t,n){"use strict";function r(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e[n],t&=t;return t}n.d(t,{Z:function(){return r}})},908:function(e,t,n){"use strict";function r(){var e="",t=-1;return function(){return++t>=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 c},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 c=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]}))}},2829:function(e,t,n){"use strict";n.d(t,{A1:function(){return o},DD:function(){return h},F_:function(){return p},JN:function(){return c},L7:function(){return m},Ti:function(){return s},XS:function(){return f},at:function(){return v},kR:function(){return g},rx:function(){return d},tn:function(){return _},uH:function(){return b}});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<e.length;n++)if(s(e[n],t))return!0;return!1}function s(e,t){var n=e.start,r=e.end;return n<=t&&t<r}function u(e,t){return s(e,t.start)||e.start<t.end&&t.end<e.end||s(t,e.start)}function l(e,t){return r(t.start,e.end)||r(t.end,e.start)}function c(e){for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}function d(e,t){for(var n=e.length-1;n>=0;n--){var r=e.start(n);if(t>=r){var i=e.end(n);if(t<i)return{start:r,end:i}}}return null}function f(e,t){for(var n=e.length,r=0;r<n;r++){var i=e.start(r);if(t<i)return i-t}return 1/0}function p(e,t){for(var n=null,r=[],i=0;i<e.length;i++){var a=e.start(i),o=e.end(i);t<a||t>=o?r.push({start:a,end:o}):n={start:a,end:o}}return{outerRanges:r,innerRange:n}}function v(e,t){var n=d(e,t);return null!==n?n.end-n.start:0}function h(e,t){var n=d(e,t);return null!==n?t-n.start:0}function m(e,t){var n=d(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;r<e.length;r++){var o=e[r],s=u(n,o),c=l(n,o);if(s||c)n=i(n,o),e.splice(r--,1);else if(0===r){if(a(n,e[0]))break}else if(a(e[r-1],n)&&a(n,o))break}return e.splice(r,0,n),function(e){for(var t=1;t<e.length;t++){var n=e[t-1],r=e[t];if(l(n,r)){var a=i(n,r);e.splice(--t,2,a)}}return e}(function(e){for(var t=0;t<e.length;t++){var n=e[t];n.start===n.end&&e.splice(t--,1)}return e}(e))}function y(e,t){for(var n=[],r=0;r<t.length;r++)u(e,t[r])&&n.push(t[r]);return n}function _(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=y(i,t);if(a.length>0)for(var o=0;o<a.length;o++){var s=a[o];n.push({start:Math.max(i.start,s.start),end:Math.min(i.end,s.end)})}}return n}function b(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=[],o=y(i,t);if(o.length>0)for(var s=0;s<o.length;s++){var u=o[s];a.push({start:Math.max(i.start,u.start),end:Math.min(i.end,u.end)})}if(0===a.length)n.push(i);else{for(var l=i.start,c=0;c<a.length;c++)a[c].start>l&&n.push({start:l,end:a[c].start}),l=a[c].end;l<i.end&&n.push({start:l,end:i.end})}}return n}},5095:function(e,t,n){"use strict";n.d(t,{$:function(){return o}});var r=n(1480);function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e){var t=e,n=[],a=!1;return{getValue:function(){return t},setValue:function(e){if(!a&&(t=e,0!==n.length))for(var r,o=i(n.slice());!(r=o()).done;){var s=r.value;try{s.hasBeenCleared||s.trigger(e)}catch(e){}}},setValueIfChanged:function(e){e!==t&&this.setValue(e)},asObservable:function(e){return new r.y((function(r){if(!0!==e&&r.next(t),!a){var i={trigger:r.next.bind(r),complete:r.complete.bind(r),hasBeenCleared:!1};return n.push(i),function(){i.hasBeenCleared=!0;var e=n.indexOf(i);e>=0&&n.splice(e,1)}}r.complete()}))},onUpdate:function(e,r){if(!0===(null==r?void 0:r.emitCurrentValue)&&e(t),!a){var i={trigger:e,complete:o,hasBeenCleared:!1};n.push(i),void 0!==(null==r?void 0:r.clearSignal)&&r.clearSignal.register(o)}function o(){i.hasBeenCleared=!0;var e=n.indexOf(i);e>=0&&n.splice(e,1)}},finish:function(){a=!0;for(var e,t=i(n.slice());!(e=t()).done;){var r=e.value;try{r.hasBeenCleared||r.complete()}catch(e){}}}}}t.Z=o},4597:function(e,t,n){"use strict";n.d(t,{ZP:function(){return s}});var r=n(6872),i=n(9105),a=n(6923),o=n(1946);var s=function(e){var t=r.Z.getCurrent().DEFAULT_REQUEST_TIMEOUT,n={url:e.url,headers:e.headers,responseType:(0,o.Z)(e.responseType)?"json":e.responseType,timeout:(0,o.Z)(e.timeout)?t:e.timeout};return new Promise((function(t,r){var s=e.onProgress,u=e.cancelSignal,l=n.url,c=n.headers,d=n.responseType,f=n.timeout,p=new XMLHttpRequest;if(p.open("GET",l,!0),f>=0&&(p.timeout=f),p.responseType=d,"document"===p.responseType&&p.overrideMimeType("text/xml"),!(0,o.Z)(c)){var v=c;for(var h in v)v.hasOwnProperty(h)&&p.setRequestHeader(h,v[h])}var m=performance.now(),g=null;void 0!==u&&(g=u.register((function(e){(0,o.Z)(p)||4===p.readyState||p.abort(),r(e)})),u.isCancelled)||(p.onerror=function(){null!==g&&g(),r(new i.Z(l,p.status,"ERROR_EVENT",p))},p.ontimeout=function(){null!==g&&g(),r(new i.Z(l,p.status,"TIMEOUT",p))},void 0!==s&&(p.onprogress=function(e){var t=performance.now();s({url:l,duration:t-m,sendingTime:m,currentTime:t,size:e.loaded,totalSize:e.total})}),p.onload=function(e){if(4===p.readyState)if(null!==g&&g(),p.status>=200&&p.status<300){var n,s=performance.now(),u=p.response instanceof ArrayBuffer?p.response.byteLength:e.total,c=p.status,d=p.responseType,f=(0,a.Z)(p.responseURL)?p.responseURL:l;if(n="json"===d?"object"==typeof p.response?p.response:function(e){try{return JSON.parse(e)}catch(e){return null}}(p.responseText):p.response,(0,o.Z)(n))return void r(new i.Z(l,p.status,"PARSE_ERROR",p));t({status:c,url:f,responseType:d,sendingTime:m,receivedTime:s,requestDuration:s-m,size:u,responseData:n})}else r(new i.Z(l,p.status,"ERROR_HTTP_CODE",p))},p.send())}))}},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<a;r++)if(".."===n[r])t.pop();else{if("."===n[r])continue;t.push(n[r])}return t.join("/")}function o(){var e=arguments.length;if(0===e)return"";for(var t="",n=0;n<e;n++){var i=n<0||arguments.length<=n?void 0:arguments[n];"string"==typeof i&&""!==i&&(r.test(i)?t=i:("/"===i[0]&&(i=i.substring(1)),"/"===t[t.length-1]&&(t=t.substring(0,t.length-1)),t=t+"/"+i))}return a(t)}function s(e){var t=e.lastIndexOf("/");if(t<0)return e;if(r.test(e)){var n=e.indexOf("/");if(n>=0&&t===n+1)return e}var i=e.indexOf("?");return i>=0&&i<t?s(e.substring(0,i)):e.substring(0,t+1)}},5561:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3610);function i(e,t){try{return e(t)}catch(e){return(0,r._)((function(){return e}))}}},9252:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof String.prototype.startsWith)return e.startsWith(t,n);var r="number"==typeof n?Math.max(n,0):0;return e.substring(r,r+t.length)===t}n.d(t,{Z:function(){return r}})},3635:function(e,t,n){"use strict";n.d(t,{DM:function(){return h},TZ:function(){return s},ci:function(){return p},nr:function(){return f},tG:function(){return l},uR:function(){return d},wO:function(){return v},wV:function(){return u}});var r=n(3887),i=n(811),a="object"==typeof window&&"function"==typeof window.TextDecoder,o="object"==typeof window&&"function"==typeof window.TextEncoder;function s(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint8Array(t),r=0;r<n.length;r+=2){var i=e.charCodeAt(r/2);n[r]=255&i,n[r+1]=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<e.length;n+=2)t+=String.fromCharCode((e[n+1]<<8)+e[n]);return t}function l(e){if(o)try{return(new TextEncoder).encode(e)}catch(e){r.Z.warn("Utils: could not use TextEncoder to encode string into UTF-8, fallbacking to another implementation",e)}var t,n=encodeURIComponent(e);if("function"==typeof unescape)t=unescape(n);else{var i=/[0-9a-fA-F]/,a=n.length;t="";for(var s=0;s<n.length;s++){var u=!1;if("%"===n[s])if(s<=a-6&&"u"===n[s+1]&&i.test(n[s+2])&&i.test(n[s+3])&&i.test(n[s+4])&&i.test(n[s+5])){var l=parseInt(n.substring(s+1,s+6),16);t+=String.fromCharCode(l),u=!0,s+=5}else if(s<=a-3&&i.test(n[s+1])&&i.test(n[s+2])){var c=parseInt(n.substring(s+1,s+3),16);t+=String.fromCharCode(c),u=!0,s+=2}u||(t+=n[s])}}for(var d=new Uint8Array(t.length),f=0;f<t.length;f++)d[f]=255&t.charCodeAt(f);return d}function c(e,t){var n=e.toString(16);return n.length>=t?n:new Array(t-n.length+1).join("0")+n}function d(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<e.length;n+=16e3){var r=e.subarray(n,n+16e3);t+=String.fromCharCode.apply(null,r)}return t}(t);if("function"==typeof escape)n=escape(i);else{var o=/[A-Za-z0-9*_\+-\.\/]/;n="";for(var s=0;s<i.length;s++)if(o.test(i[s]))n+=i[s];else{var u=i.charCodeAt(s);n+=u>=256?"%u"+c(u,4):"%"+c(u,2)}}return decodeURIComponent(n)}function f(e){for(var t=e.length,n=new Uint8Array(t/2),r=0,i=0;r<t;r+=2,i++)n[i]=255&parseInt(e.substring(r,r+2),16);return n}function p(e,t){void 0===t&&(t="");for(var n="",r=0;r<e.byteLength;r++)n+=(e[r]>>>4).toString(16),n+=(15&e[r]).toString(16),t.length>0&&r<e.byteLength-1&&(n+=t);return n}function v(e){(0,i.Z)(16===e.length,"GUID length should be 16");var t=e[0],n=e[1],r=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=new Uint8Array(16);return c[0]=a,c[1]=r,c[2]=n,c[3]=t,c[4]=s,c[5]=o,c[6]=l,c[7]=u,c.set(e.subarray(8,16),8),c}function h(e,t){for(var n=t;n<e.length;){if(0===e[n])break;n+=1}return{end:n+1,string:d(e.subarray(t,n))}}},5278:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1946);function i(){for(var e=0,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(var a=n.length;e<a;){var o=n[e];if(!(0,r.Z)(o))return o;e++}}},288:function(e,t,n){"use strict";n.d(t,{FU:function(){return c},ZP:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(811),s=n(8894),u=function(){function e(e){var t,n=this,r=(t=s.Z,[function(e){t(e)},function(e){t=e}]),i=r[0],a=r[1];if(this.isUsed=!1,this._trigger=i,this.signal=new l(a),void 0!==(null==e?void 0:e.cancelOn)){var o=e.cancelOn.register((function(){n.cancel()}));this.signal.register(o)}}return e.prototype.cancel=function(e){if(!this.isUsed){this.isUsed=!0;var t=null!=e?e:new c;this._trigger(t)}},e.isCancellationError=function(e){return e instanceof c},e}(),l=function(){function e(e){var t=this;this.isCancelled=!1,this.cancellationError=null,this._listeners=[],e((function(e){for(t.cancellationError=e,t.isCancelled=!0;t._listeners.length>0;){(0,t._listeners.splice(t._listeners.length-1,1)[0])(e)}}))}var t=e.prototype;return t.register=function(e){var t=this;return this.isCancelled&&((0,o.Z)(null!==this.cancellationError),e(this.cancellationError)),this._listeners.push(e),function(){return t.deregister(e)}},t.deregister=function(e){if(!this.isCancelled)for(var t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)},e}(),c=function(e){function t(){var n;return n=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(n),t.prototype),n.name="CancellationError",n.message="This task was cancelled.",n}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},8806:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7714),i=[];function a(e){(0,r.Z)(i,e)||(console.warn(e),i.push(e))}},7473:function(e){"use strict";var t=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},n=function(e){var n,r,i=document.createTextNode(""),a=0;return new e((function(){var e;if(n)r&&(n=r.concat(n));else{if(!r)return;n=r}if(r=n,n=null,"function"==typeof r)return e=r,r=null,void e();for(i.data=a=++a%2;r;)e=r.shift(),r.length||(r=null),e()})).observe(i,{characterData:!0}),function(e){t(e),n?"function"==typeof n?n=[n,e]:n.push(e):(n=e,i.data=a=++a%2)}};e.exports=function(){if("object"==typeof process&&process&&"function"==typeof process.nextTick)return process.nextTick;if("function"==typeof queueMicrotask)return function(e){queueMicrotask(t(e))};if("object"==typeof document&&document){if("function"==typeof MutationObserver)return n(MutationObserver);if("function"==typeof WebKitMutationObserver)return n(WebKitMutationObserver)}return"function"==typeof setImmediate?function(e){setImmediate(t(e))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(e){setTimeout(t(e),0)}:null}()},5666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),o=new I(r||[]);return a._invoke=function(e,t,n){var r=d;return function(i,a){if(r===p)throw new Error("Generator is already running");if(r===v){if("throw"===i)throw a;return R()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=k(o,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=c(e,t,n);if("normal"===u.type){if(r=n.done?v:f,u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=v,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",p="executing",v="completed",h={};function m(){}function g(){}function y(){}var _={};u(_,a,(function(){return this}));var b=Object.getPrototypeOf,T=b&&b(b(Z([])));T&&T!==n&&r.call(T,a)&&(_=T);var E=y.prototype=m.prototype=Object.create(_);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function n(i,a,o,s){var u=c(e[i],e,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(d).then((function(e){l.value=e,o(l)}),(function(e){return n("throw",e,o,s)}))}s(u.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function k(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,k(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var i=c(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,h;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function Z(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:R}}function R(){return{value:t,done:!0}}return g.prototype=y,u(E,"constructor",y),u(y,"constructor",g),g.displayName=u(y,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,u(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},S(w.prototype),u(w.prototype,o,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new w(l(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},S(E),u(E,s,"Generator"),u(E,a,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=Z,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=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<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=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){"object"==typeof globalThis?globalThis.regeneratorRuntime=t: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),c=n(8846),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=this,s=(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);return(0,c.x)((function(){var e=o,t=e.operator,n=e.source;s.add(t?t.call(s,n):n?o._subscribe(s):o._trySubscribe(s))})),s},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=f(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;t<arguments.length;t++)e[t]=arguments[t];return s(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function f(e){var t;return null!==(t=null!=e?e:u.v.Promise)&&void 0!==t?t:Promise}},3:function(e,t,n){"use strict";n.d(t,{t:function(){return o}});var r=n(5987),i=n(6716),a=n(4318),o=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=a.l);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return(0,r.ZT)(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,u=1;u<r.length&&r[u]<=o;u+=2)s=u;s&&r.splice(0,s+1)}},t}(i.x)},6716:function(e,t,n){"use strict";n.d(t,{x:function(){return l}});var r=n(5987),i=n(1480),a=n(5720),o=(0,n(1819).d)((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),s=n(3699),u=n(8846),l=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,r.ZT)(t,e),t.prototype.lift=function(e){var t=new c(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new o},t.prototype.next=function(e){var t=this;(0,u.x)((function(){var n,i;if(t._throwIfClosed(),!t.isStopped){var a=t.observers.slice();try{for(var o=(0,r.XA)(a),s=o.next();!s.done;s=o.next()){s.value.next(e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;(0,u.x)((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;(0,u.x)((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},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 c(e,t)},t}(i.y),c=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}(l)},6267:function(e,t,n){"use strict";n.d(t,{Hp:function(){return v},Lv:function(){return p}});var r=n(5987),i=n(8474),a=n(5720),o=n(3912),s=n(5),u=n(2967),l=c("C",void 0,void 0);function c(e,t,n){return{kind:e,value:t,error:n}}var d=n(8380),f=n(8846),p=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=y,n}return(0,r.ZT)(t,e),t.create=function(e,t,n){return new v(e,t,n)},t.prototype.next=function(e){this.isStopped?g(function(e){return c("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?g(c("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?g(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),v=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?h(a,s):u.Z,error:h(null!=n?n:m,s),complete:r?h(r,s):u.Z},s}return(0,r.ZT)(t,e),t}(p);function h(e,t){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{e.apply(void 0,(0,r.ev)([],(0,r.CR)(t)))}catch(e){o.v.useDeprecatedSynchronousErrorHandling?(0,f.O)(e):(0,s.h)(e)}}}function m(e){throw e}function g(e,t){var n=o.v.onStoppedNotification;n&&d.z.setTimeout((function(){return n(e,t)}))}var y={closed:!0,next:u.Z,error:m,complete:u.Z}},5720:function(e,t,n){"use strict";n.d(t,{Lc:function(){return u},w0:function(){return s},Nn:function(){return l}});var r=n(5987),i=n(8474),a=(0,n(1819).d)((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}})),o=n(3699),s=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._teardowns=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,o,s;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var l=(0,r.XA)(u),d=l.next();!d.done;d=l.next()){d.value.remove(this)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}else u.remove(this);var f=this.initialTeardown;if((0,i.m)(f))try{f()}catch(e){s=e instanceof a?e.errors:[e]}var p=this._teardowns;if(p){this._teardowns=null;try{for(var v=(0,r.XA)(p),h=v.next();!h.done;h=v.next()){var m=h.value;try{c(m)}catch(e){s=null!=s?s:[],e instanceof a?s=(0,r.ev)((0,r.ev)([],(0,r.CR)(s)),(0,r.CR)(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}if(s)throw new a(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)c(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&(0,o.P)(t,e)},e.prototype.remove=function(t){var n=this._teardowns;n&&(0,o.P)(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),u=s.EMPTY;function l(e){return e instanceof s||e&&"closed"in e&&(0,i.m)(e.remove)&&(0,i.m)(e.add)&&(0,i.m)(e.unsubscribe)}function c(e){(0,i.m)(e)?e():e.unsubscribe()}},3912:function(e,t,n){"use strict";n.d(t,{v:function(){return r}});var r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},2334:function(e,t,n){"use strict";n.d(t,{a:function(){return m}});var r=n(1480),i=Array.isArray,a=Object.getPrototypeOf,o=Object.prototype,s=Object.keys;function u(e){if(1===e.length){var t=e[0];if(i(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&a(r)===o){var n=s(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var l=n(3102),c=n(278),d=n(3211),f=n(2457);function p(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}var v=n(2566),h=n(7845);function m(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,f.yG)(e),i=(0,f.jO)(e),a=u(e),o=a.args,s=a.keys;if(0===o.length)return(0,l.D)([],n);var v=new r.y(g(o,n,s?function(e){return p(s,e)}:c.y));return i?v.pipe((0,d.Z)(i)):v}function g(e,t,n){return void 0===n&&(n=c.y),function(r){y(t,(function(){for(var i=e.length,a=new Array(i),o=i,s=i,u=function(i){y(t,(function(){var u=(0,l.D)(e[i],t),c=!1;u.subscribe(new v.Q(r,(function(e){a[i]=e,c||(c=!0,s--),s||r.next(n(a.slice()))}),(function(){--o||r.complete()})))}),r)},c=0;c<i;c++)u(c)}),r)}}function y(e,t,n){e?(0,h.f)(n,e,t):t()}},6362:function(e,t,n){"use strict";n.d(t,{z:function(){return o}});var r=n(9834),i=n(2457),a=n(3102);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,r.u)()((0,a.D)(e,(0,i.yG)(e)))}},9917:function(e,t,n){"use strict";n.d(t,{P:function(){return a}});var r=n(1480),i=n(7878);function a(e){return new r.y((function(t){(0,i.Xf)(e()).subscribe(t)}))}},1545:function(e,t,n){"use strict";n.d(t,{E:function(){return r}});var r=new(n(1480).y)((function(e){return e.complete()}))},3102:function(e,t,n){"use strict";n.d(t,{D:function(){return T}});var r=n(7878),i=n(7845),a=n(6798),o=n(2566);function s(e,t){return void 0===t&&(t=0),(0,a.e)((function(n,r){n.subscribe(new o.Q(r,(function(n){return(0,i.f)(r,e,(function(){return r.next(n)}),t)}),(function(){return(0,i.f)(r,e,(function(){return r.complete()}),t)}),(function(n){return(0,i.f)(r,e,(function(){return r.error(n)}),t)})))}))}var u=n(8720);var l=n(1480);var c=n(9768),d=n(8474);function f(e,t){if(!e)throw new Error("Iterable cannot be null");return new l.y((function(n){(0,i.f)(n,t,(function(){var r=e[Symbol.asyncIterator]();(0,i.f)(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}var p=n(1764),v=n(3841),h=n(5685),m=n(1837),g=n(8430),y=n(8729),_=n(8671);function b(e,t){if(null!=e){if((0,p.c)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,h.z)(e))return function(e,t){return new l.y((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if((0,v.t)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,g.D)(e))return f(e,t);if((0,m.T)(e))return function(e,t){return new l.y((function(n){var r;return(0,i.f)(n,t,(function(){r=e[c.h](),(0,i.f)(n,t,(function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){return void n.error(e)}i?n.complete():n.next(t)}),0,!0)})),function(){return(0,d.m)(null==r?void 0:r.return)&&r.return()}}))}(e,t);if((0,_.L)(e))return function(e,t){return f((0,_.Q)(e),t)}(e,t)}throw(0,y.z)(e)}function T(e,t){return t?b(e,t):(0,r.Xf)(e)}},2401:function(e,t,n){"use strict";n.d(t,{R:function(){return p}});var r=n(5987),i=n(7878),a=n(1480),o=n(7877),s=n(5685),u=n(8474),l=n(3211),c=["addListener","removeListener"],d=["addEventListener","removeEventListener"],f=["on","off"];function p(e,t,n,h){if((0,u.m)(n)&&(h=n,n=void 0),h)return p(e,t,n).pipe((0,l.Z)(h));var m=(0,r.CR)(function(e){return(0,u.m)(e.addEventListener)&&(0,u.m)(e.removeEventListener)}(e)?d.map((function(r){return function(i){return e[r](t,i,n)}})):function(e){return(0,u.m)(e.addListener)&&(0,u.m)(e.removeListener)}(e)?c.map(v(e,t)):function(e){return(0,u.m)(e.on)&&(0,u.m)(e.off)}(e)?f.map(v(e,t)):[],2),g=m[0],y=m[1];if(!g&&(0,s.z)(e))return(0,o.z)((function(e){return p(e,t,n)}))((0,i.Xf)(e));if(!g)throw new TypeError("Invalid event target");return new a.y((function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return g(t),function(){return y(t)}}))}function v(e,t){return function(n){return function(r){return e[n](t,r)}}}},7878:function(e,t,n){"use strict";n.d(t,{Xf:function(){return h}});var r=n(5987),i=n(5685),a=n(3841),o=n(1480),s=n(1764),u=n(8430),l=n(8729),c=n(1837),d=n(8671),f=n(8474),p=n(5),v=n(6766);function h(e){if(e instanceof o.y)return e;if(null!=e){if((0,s.c)(e))return y=e,new o.y((function(e){var t=y[v.L]();if((0,f.m)(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if((0,i.z)(e))return g=e,new o.y((function(e){for(var t=0;t<g.length&&!e.closed;t++)e.next(g[t]);e.complete()}));if((0,a.t)(e))return h=e,new o.y((function(e){h.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,p.h)}));if((0,u.D)(e))return m(e);if((0,c.T)(e))return n=e,new o.y((function(e){var t,i;try{for(var a=(0,r.XA)(n),o=a.next();!o.done;o=a.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}e.complete()}));if((0,d.L)(e))return t=e,m((0,d.Q)(t))}var t,n,h,g,y;throw(0,l.z)(e)}function m(e){return new o.y((function(t){(function(e,t){var n,i,a,o;return(0,r.mG)(this,void 0,void 0,(function(){var s,u;return(0,r.Jh)(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=(0,r.KL)(e),l.label=1;case 1:return[4,n.next()];case 2:if((i=l.sent()).done)return[3,4];if(s=i.value,t.next(s),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=l.sent(),a={error:u},[3,11];case 6:return l.trys.push([6,,9,10]),i&&!i.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}},6697:function(e,t,n){"use strict";n.d(t,{F:function(){return a}});var r=n(7991),i=n(6625);function a(e,t){return void 0===e&&(e=0),void 0===t&&(t=r.z),e<0&&(e=0),(0,i.H)(e,e,t)}},3071:function(e,t,n){"use strict";n.d(t,{T:function(){return u}});var r=n(4367),i=n(7878),a=n(1545),o=n(2457),s=n(3102);function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,o.yG)(e),u=(0,o._6)(e,1/0),l=e;return l.length?1===l.length?(0,i.Xf)(l[0]):(0,r.J)(u)((0,s.D)(l,n)):a.E}},2817:function(e,t,n){"use strict";n.d(t,{of:function(){return a}});var r=n(2457),i=n(3102);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,r.yG)(e);return(0,i.D)(e,n)}},3610:function(e,t,n){"use strict";n.d(t,{_:function(){return a}});var r=n(1480),i=n(8474);function a(e,t){var n=(0,i.m)(e)?e:function(){return e},a=function(e){return e.error(n())};return new r.y(t?function(e){return t.schedule(a,0,e)}:a)}},6625:function(e,t,n){"use strict";n.d(t,{H:function(){return s}});var r=n(1480),i=n(7991),a=n(4865),o=n(1454);function s(e,t,n){void 0===e&&(e=0),void 0===n&&(n=i.P);var s=-1;return null!=t&&((0,a.K)(t)?n=t:s=t),new r.y((function(t){var r=(0,o.q)(e)?+e-n.now():e;r<0&&(r=0);var i=0;return n.schedule((function(){t.closed||(t.next(i++),0<=s?this.schedule(void 0,s):t.complete())}),r)}))}},2566:function(e,t,n){"use strict";n.d(t,{Q:function(){return i}});var r=n(5987),i=function(e){function t(t,n,r,i,a){var o=e.call(this,t)||this;return o.onFinalize=a,o._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,o._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,o._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,o}return(0,r.ZT)(t,e),t.prototype.unsubscribe=function(){var t,n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))},t}(n(6267).Lv)},9878:function(e,t,n){"use strict";n.d(t,{K:function(){return o}});var r=n(7878),i=n(2566),a=n(6798);function o(e){return(0,a.e)((function(t,n){var a,s=null,u=!1;s=t.subscribe(new i.Q(n,void 0,void 0,(function(i){a=(0,r.Xf)(e(i,o(e)(t))),s?(s.unsubscribe(),s=null,a.subscribe(n)):u=!0}))),u&&(s.unsubscribe(),s=null,a.subscribe(n))}))}},9834:function(e,t,n){"use strict";n.d(t,{u:function(){return i}});var r=n(4367);function i(){return(0,r.J)(1)}},3741:function(e,t,n){"use strict";n.d(t,{x:function(){return o}});var r=n(278),i=n(6798),a=n(2566);function o(e,t){return void 0===t&&(t=r.y),e=null!=e?e:s,(0,i.e)((function(n,r){var i,o=!0;n.subscribe(new a.Q(r,(function(n){var a=t(n);!o&&e(i,a)||(o=!1,i=a,r.next(n))})))}))}function s(e,t){return e===t}},4975:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe(new i.Q(r,(function(n){return e.call(t,n,a++)&&r.next(n)})))}))}},533:function(e,t,n){"use strict";n.d(t,{l:function(){return o}});var r=n(6798),i=n(2566),a=n(2967);function o(){return(0,r.e)((function(e,t){e.subscribe(new i.Q(t,a.Z))}))}},9127:function(e,t,n){"use strict";n.d(t,{U:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe(new i.Q(r,(function(n){r.next(e.call(t,n,a++))})))}))}},4367:function(e,t,n){"use strict";n.d(t,{J:function(){return a}});var r=n(7877),i=n(278);function a(e){return void 0===e&&(e=1/0),(0,r.z)(i.y,e)}},7877:function(e,t,n){"use strict";n.d(t,{z:function(){return l}});var r=n(9127),i=n(7878),a=n(6798),o=n(7845),s=n(2566);var u=n(8474);function l(e,t,n){return void 0===n&&(n=1/0),(0,u.m)(t)?l((function(n,a){return(0,r.U)((function(e,r){return t(n,e,a,r)}))((0,i.Xf)(e(n,a)))}),n):("number"==typeof t&&(n=t),(0,a.e)((function(t,r){return function(e,t,n,r,a,u,l,c){var d=[],f=0,p=0,v=!1,h=function(){!v||d.length||f||t.complete()},m=function(e){return f<r?g(e):d.push(e)},g=function(e){u&&t.next(e),f++;var c=!1;(0,i.Xf)(n(e,p++)).subscribe(new s.Q(t,(function(e){null==a||a(e),u?m(e):t.next(e)}),(function(){c=!0}),void 0,(function(){if(c)try{f--;for(var e=function(){var e=d.shift();l?(0,o.f)(t,l,(function(){return g(e)})):g(e)};d.length&&f<r;)e();h()}catch(e){t.error(e)}})))};return e.subscribe(new s.Q(t,m,(function(){v=!0,h()}))),function(){null==c||c()}}(t,r,e,n)})))}},3074:function(e,t,n){"use strict";n.d(t,{R:function(){return o}});var r=n(6798),i=n(2566);function a(e,t,n,r,a){return function(o,s){var u=n,l=t,c=0;o.subscribe(new i.Q(s,(function(t){var n=c++;l=u?e(l,t,n):(u=!0,t),r&&s.next(l)}),a&&function(){u&&s.next(l),s.complete()}))}}function o(e,t){return(0,r.e)(a(e,t,arguments.length>=2,!0))}},5583:function(e,t,n){"use strict";n.d(t,{B:function(){return l}});var r=n(5987),i=n(3102),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,d=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=c(g,p))})),y.subscribe(u),t||(t=new s.Hp({next:function(e){return y.next(e)},error:function(e){v=!0,h(),r=c(m,a,e),y.error(e)},complete:function(){f=!0,h(),r=c(m,d),y.complete()}}),(0,i.D)(e).subscribe(t))}))(e)}}function c(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return!0===t?(e(),null):!1===t?null:t.apply(void 0,(0,r.ev)([],(0,r.CR)(n))).pipe((0,a.q)(1)).subscribe((function(){return e()}))}},8515:function(e,t,n){"use strict";n.d(t,{d:function(){return a}});var r=n(3),i=n(5583);function a(e,t,n){var a,o,s,u=!1;return e&&"object"==typeof e?(s=null!==(a=e.bufferSize)&&void 0!==a?a:1/0,t=null!==(o=e.windowTime)&&void 0!==o?o:1/0,u=!!e.refCount,n=e.scheduler):s=null!=e?e:1/0,(0,i.B)({connector:function(){return new r.t(s,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:u})}},6108:function(e,t,n){"use strict";n.d(t,{O:function(){return o}});var r=n(6362),i=n(2457),a=n(6798);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,i.yG)(e);return(0,a.e)((function(t,i){(n?(0,r.z)(e,t,n):(0,r.z)(e,t)).subscribe(i)}))}},8720:function(e,t,n){"use strict";n.d(t,{R:function(){return i}});var r=n(6798);function i(e,t){return void 0===t&&(t=0),(0,r.e)((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}},4978:function(e,t,n){"use strict";n.d(t,{w:function(){return o}});var r=n(7878),i=n(6798),a=n(2566);function o(e,t){return(0,i.e)((function(n,i){var o=null,s=0,u=!1,l=function(){return u&&!o&&i.complete()};n.subscribe(new a.Q(i,(function(n){null==o||o.unsubscribe();var u=0,c=s++;(0,r.Xf)(e(n,c)).subscribe(o=new a.Q(i,(function(e){return i.next(t?t(n,e,c,u++):e)}),(function(){o=null,l()})))}),(function(){u=!0,l()})))}))}},4727:function(e,t,n){"use strict";n.d(t,{q:function(){return o}});var r=n(1545),i=n(6798),a=n(2566);function o(e){return e<=0?function(){return r.E}:(0,i.e)((function(t,n){var r=0;t.subscribe(new a.Q(n,(function(t){++r<=e&&(n.next(t),e<=r&&n.complete())})))}))}},3505:function(e,t,n){"use strict";n.d(t,{R:function(){return s}});var r=n(6798),i=n(2566),a=n(7878),o=n(2967);function s(e){return(0,r.e)((function(t,n){(0,a.Xf)(e).subscribe(new i.Q(n,(function(){return n.complete()}),o.Z)),!n.closed&&t.subscribe(n)}))}},2006:function(e,t,n){"use strict";n.d(t,{b:function(){return s}});var r=n(8474),i=n(6798),a=n(2566),o=n(278);function s(e,t,n){var s=(0,r.m)(e)||t||n?{next:e,error:t,complete:n}:e;return s?(0,i.e)((function(e,t){var n;null===(n=s.subscribe)||void 0===n||n.call(s);var r=!0;e.subscribe(new a.Q(t,(function(e){var n;null===(n=s.next)||void 0===n||n.call(s,e),t.next(e)}),(function(){var e;r=!1,null===(e=s.complete)||void 0===e||e.call(s),t.complete()}),(function(e){var n;r=!1,null===(n=s.error)||void 0===n||n.call(s,e),t.error(e)}),(function(){var e,t;r&&(null===(e=s.unsubscribe)||void 0===e||e.call(s)),null===(t=s.finalize)||void 0===t||t.call(s)})))})):o.y}},3428:function(e,t,n){"use strict";n.d(t,{M:function(){return c}});var r=n(5987),i=n(6798),a=n(2566),o=n(7878),s=n(278),u=n(2967),l=n(2457);function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,l.jO)(e);return(0,i.e)((function(t,i){for(var l=e.length,c=new Array(l),d=e.map((function(){return!1})),f=!1,p=function(t){(0,o.Xf)(e[t]).subscribe(new a.Q(i,(function(e){c[t]=e,f||d[t]||(d[t]=!0,(f=d.every(s.y))&&(d=null))}),u.Z))},v=0;v<l;v++)p(v);t.subscribe(new a.Q(i,(function(e){if(f){var t=(0,r.ev)([e],(0,r.CR)(c));i.next(n?n.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):t)}})))}))}},8337:function(e,t,n){"use strict";n.d(t,{o:function(){return s}});var r=n(5987),i=function(e){function t(t,n){return e.call(this)||this}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(5720).w0),a={setInterval:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.delegate;return((null==n?void 0:n.setInterval)||setInterval).apply(void 0,(0,r.ev)([],(0,r.CR)(e)))},clearInterval:function(e){var t=a.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},o=n(3699),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),a.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;a.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,o.P)(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(i)},9682:function(e,t,n){"use strict";n.d(t,{v:function(){return o}});var r=n(5987),i=n(4318),a=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=i.l.now,e}(),o=function(e){function t(t,n){void 0===n&&(n=a.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return(0,r.ZT)(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(a)},7991:function(e,t,n){"use strict";n.d(t,{P:function(){return a},z:function(){return i}});var r=n(8337),i=new(n(9682).v)(r.o),a=i},4318:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r={now:function(){return(r.delegate||Date).now()},delegate:void 0}},8380:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});var r=n(5987),i={setTimeout:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=i.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,(0,r.ev)([],(0,r.CR)(e)))},clearTimeout:function(e){var t=i.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},9768:function(e,t,n){"use strict";n.d(t,{h:function(){return r}});var r="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},6766:function(e,t,n){"use strict";n.d(t,{L:function(){return r}});var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},2457:function(e,t,n){"use strict";n.d(t,{_6:function(){return u},jO:function(){return o},yG:function(){return s}});var r=n(8474),i=n(4865);function a(e){return e[e.length-1]}function o(e){return(0,r.m)(a(e))?e.pop():void 0}function s(e){return(0,i.K)(a(e))?e.pop():void 0}function u(e,t){return"number"==typeof a(e)?e.pop():t}},3699:function(e,t,n){"use strict";function r(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}n.d(t,{P:function(){return r}})},1819:function(e,t,n){"use strict";function r(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}n.d(t,{d:function(){return r}})},8846:function(e,t,n){"use strict";n.d(t,{O:function(){return o},x:function(){return a}});var r=n(3912),i=null;function a(e){if(r.v.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var n=i,a=n.errorThrown,o=n.error;if(i=null,a)throw o}}else e()}function o(e){r.v.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},7845:function(e,t,n){"use strict";function r(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var a=t.schedule((function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(a),!i)return a}n.d(t,{f:function(){return r}})},278:function(e,t,n){"use strict";function r(e){return e}n.d(t,{y:function(){return r}})},5685:function(e,t,n){"use strict";n.d(t,{z:function(){return r}});var r=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},8430:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});var r=n(8474);function i(e){return Symbol.asyncIterator&&(0,r.m)(null==e?void 0:e[Symbol.asyncIterator])}},1454:function(e,t,n){"use strict";function r(e){return e instanceof Date&&!isNaN(e)}n.d(t,{q:function(){return r}})},8474:function(e,t,n){"use strict";function r(e){return"function"==typeof e}n.d(t,{m:function(){return r}})},1764:function(e,t,n){"use strict";n.d(t,{c:function(){return a}});var r=n(6766),i=n(8474);function a(e){return(0,i.m)(e[r.L])}},1837:function(e,t,n){"use strict";n.d(t,{T:function(){return a}});var r=n(9768),i=n(8474);function a(e){return(0,i.m)(null==e?void 0:e[r.h])}},3841:function(e,t,n){"use strict";n.d(t,{t:function(){return i}});var r=n(8474);function i(e){return(0,r.m)(null==e?void 0:e.then)}},8671:function(e,t,n){"use strict";n.d(t,{L:function(){return o},Q:function(){return a}});var r=n(5987),i=n(8474);function a(e){return(0,r.FC)(this,arguments,(function(){var t,n,i;return(0,r.Jh)(this,(function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,(0,r.qq)(t.read())];case 3:return n=a.sent(),i=n.value,n.done?[4,(0,r.qq)(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,(0,r.qq)(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function o(e){return(0,i.m)(null==e?void 0:e.getReader)}},4865:function(e,t,n){"use strict";n.d(t,{K:function(){return i}});var r=n(8474);function i(e){return e&&(0,r.m)(e.schedule)}},6798:function(e,t,n){"use strict";n.d(t,{e:function(){return i}});var r=n(8474);function i(e){return function(t){if(function(e){return(0,r.m)(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},3211:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(5987),i=n(9127),a=Array.isArray;function o(e){return(0,i.U)((function(t){return function(e,t){return a(t)?e.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):e(t)}(e,t)}))}},2967:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},5:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(3912),i=n(8380);function a(e){i.z.setTimeout((function(){var t=r.v.onUnhandledError;if(!t)throw e;t(e)}))}},8729:function(e,t,n){"use strict";function r(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}n.d(t,{z:function(){return r}})},5987:function(e,t,n){"use strict";n.d(t,{CR:function(){return u},FC:function(){return d},Jh:function(){return o},KL:function(){return f},XA:function(){return s},ZT:function(){return i},ev:function(){return l},mG:function(){return a},qq:function(){return c}});var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function a(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))}function o(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=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;n<r;n++,i++)e[i]=t[n];return e}function c(e){return this instanceof c?(this.v=e,this):new c(e)}function d(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof c?Promise.resolve(n.value.v).then(u,l):d(a[0][2],n)}catch(e){d(a[0][3],e)}var n}function u(e){s("next",e)}function l(e){s("throw",e)}function d(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},7326: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}})},5861:function(e,t,n){"use strict";function r(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 i(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,u,"next",e)}function u(e){r(o,i,a,s,u,"throw",e)}s(void 0)}))}}n.d(t,{Z:function(){return i}})},3144:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(t,{Z:function(){return i}})},4578:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9611);function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,r.Z)(e,t)}},9611:function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,{Z:function(){return r}})},2146:function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,{Z:function(){return s}});var i=n(9611);function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function o(e,t,n){return(o=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&(0,i.Z)(a,n.prototype),a}).apply(null,arguments)}function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return o(e,arguments,r(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),(0,i.Z)(a,e)})(e)}}},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.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";n.d(r,{default:function(){return lr}});var e=n(3144),t=n(4578),i=n(6716),a=n(3),o=n(3505),s=n(9127),u=n(3741),l=n(2817),c=n(7877),d=n(8515),f=n(1480),p=n(9917),v={connector:function(){return new i.x},resetOnDisconnect:!0};function h(e,t){void 0===t&&(t=v);var n=null,r=t.connector,i=t.resetOnDisconnect,a=void 0===i||i,o=r(),s=new f.y((function(e){return o.subscribe(e)}));return s.connect=function(){return n&&!n.closed||(n=(0,p.P)((function(){return e})).subscribe(o),a&&n.add((function(){return o=r()}))),n},s}var m=n(4975),g=n(5583),y=n(2334),_=n(6108),b=n(6362),T=n(4978),E=n(3071),S=n(1545),w=n(6798),k=n(2566);var A=n(4727),x=n(4804);function I(e){var t=e;if("function"==typeof t.getStartDate){var n=t.getStartDate();if("object"==typeof n&&null!==n){var r=+n;if(!isNaN(r))return r/1e3}else if("number"==typeof n&&!isNaN(n))return n}}function Z(){if(R()){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 R(){var e=document;return null!=e.fullscreenElement||null!=e.mozFullScreenElement||null!=e.webkitFullscreenElement||null!=e.msFullscreenElement}var M=n(3666),C=n(3887);function P(){if(!M.vU)return!0;var e=function(){if(!M.vU)return C.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}();if(null===e||e<67)return!0;var t=null===HTMLVideoElement||void 0===HTMLVideoElement?void 0:HTMLVideoElement.prototype;return void 0!==(null==t?void 0:t.requirePictureInPicture)}var D=n(6872),N=n(3714),O=n(8750),L=n(5992),B=n(7874),U=n(1989),F=n(4791),z=n(1959),V=n(1946),K=n(8026),G=n(2829),H=n(5095),W=n(8806),j=n(5861),q=n(7757),Y=n.n(q),$=n(6139),X=n(770);function Q(e){return J.apply(this,arguments)}function J(){return(J=(0,j.Z)(Y().mark((function e(t){var n,r;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(n=X.Z.getState(t))){e.next=3;break}return e.abrupt("return");case 3:return C.Z.info("DRM: Disposing of the current MediaKeys"),r=n.loadedSessionsStore,X.Z.clearState(t),e.next=8,r.closeAllSessions();case 8:(0,$.Y)(t,null);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ee(e){var t=X.Z.getState(e);return null==t?null:t.keySystemOptions.type}function te(e){if(C.Z.info("DRM: Clearing-up DRM session."),M.fq)return C.Z.info("DRM: disposing current MediaKeys."),Q(e);var t=X.Z.getState(e);return null!==t&&!0===t.keySystemOptions.closeSessionsOnStop?(C.Z.info("DRM: closing all current sessions."),t.loadedSessionsStore.closeAllSessions()):(C.Z.info("DRM: Nothing to clear. Returning right away. No state =",null===t),Promise.resolve())}var ne=n(811),re=n(288),ie=n(9105),ae=n(9362);function oe(e){return e instanceof ie.Z?new ae.Z("PIPELINE_LOAD_ERROR",e):(0,O.Z)(e,{defaultCode:"PIPELINE_LOAD_ERROR",defaultReason:"Unknown error when fetching the Manifest"})}var se=n(7839),ue=n(9822),le=n(7864),ce=n(2572);function de(e){return e instanceof ie.Z?e.type===L.br.ERROR_HTTP_CODE?e.status>=500||404===e.status||415===e.status||412===e.status:e.type===L.br.TIMEOUT||e.type===L.br.ERROR_EVENT:e instanceof se.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,ue.Z)(e)&&"INTEGRITY_ERROR"===e.code}function fe(e){return e instanceof ie.Z?e.type===L.br.ERROR_EVENT&&!1===navigator.onLine:e instanceof se.Z&&e.isOfflineError}function pe(e){return fe(e)?2:1}function ve(e,t,n,r){if(r.isCancelled)return Promise.reject(r.cancellationError);var i=n.baseDelay,a=n.maxDelay,o=n.maxRetryRegular,s=n.maxRetryOffline,u=n.onRetry,l=0,c=0,d=e.slice();return 0===d.length?(C.Z.warn("Fetchers: no URL given to `tryURLsWithBackoff`."),Promise.reject(new Error("No URL to request"))):f(d[0],0);function f(e,t){return p.apply(this,arguments)}function p(){return(p=(0,j.Z)(Y().mark((function e(n,p){var v,h,m,g,y,_,b,T;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t(n,r);case 3:return v=e.sent,e.abrupt("return",v);case 7:if(e.prev=7,e.t0=e.catch(0),!re.ZP.isCancellationError(e.t0)){e.next=11;break}throw e.t0;case 11:if(de(e.t0)){e.next=20;break}if(!(d.length<=1)){e.next=14;break}throw e.t0;case 14:if(d.splice(p,1),h=p>=d.length-1?0:p,u(e.t0),!r.isCancelled){e.next=19;break}throw r.cancellationError;case 19:return e.abrupt("return",f(d[h],h));case 20:if(m=pe(e.t0),g=2===m?s:o,m!==c&&(l=0,c=m),!(p<d.length-1)){e.next=29;break}if(y=p+1,u(e.t0),!r.isCancelled){e.next=28;break}throw r.cancellationError;case 28:return e.abrupt("return",f(d[y],y));case 29:if(!(++l>g)){e.next=32;break}throw e.t0;case 32:if(_=Math.min(i*Math.pow(2,l-1),a),b=(0,ce.Z)(_),T=d[0],u(e.t0),!r.isCancelled){e.next=38;break}throw r.cancellationError;case 38:return e.next=40,(0,le.Z)(b,r);case 40:return e.abrupt("return",f(T,0));case 41:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}}function he(e,t,n){return ve([null],e,t,n)}function me(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ge(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ye=function(){function e(e,t,n){this._manifestUrl=e,this._pipelines=t.manifest,this._settings=n}var t=e.prototype;return t.fetch=function(e){var t=this;return new f.y((function(n){var r,i,a=t._pipelines,o=null!=e?e:t._manifestUrl,s=!1,u=new re.ZP,l=t._getBackoffSetting((function(e){n.next({type:"warning",value:oe(e)})}));return(void 0===a.resolveManifestUrl?c(o):(r=o,i=a.resolveManifestUrl,(0,ne.Z)(void 0!==i),he((function(){return i(r,u.signal)}),l,u.signal)).then(c)).then((function(e){s=!0,n.next({type:"response",parse:function(n){return t._parseLoadedManifest(e,n)}}),n.complete()})).catch((function(e){u.isUsed||(s=!0,n.error(oe(e)))})),function(){s||u.cancel()};function c(e){var t=a.loadManifest;return he((function(){return t(e,u.signal)}),l,u.signal)}}))},t.parse=function(e,t){return this._parseLoadedManifest({responseData:e,size:void 0,requestDuration:void 0},t)},t._parseLoadedManifest=function(e,t){var n=this;return new f.y((function(r){var i=performance.now(),a=new re.ZP,o=e.sendingTime,s=e.receivedTime,u=n._getBackoffSetting((function(e){r.next({type:"warning",value:oe(e)})})),l={externalClockOffset:t.externalClockOffset,unsafeMode:t.unsafeMode,previousManifest:t.previousManifest,originalUrl:n._manifestUrl};try{var c=n._pipelines.parseManifest(e,l,f,a.signal,(function(e){return d.apply(this,arguments)}));c instanceof Promise?c.then((function(e){return p(e.manifest)})).catch((function(e){a.isUsed||v(e,!0)})):p(c.manifest)}catch(e){if(a.isUsed)return;v(e,!0)}return function(){a.cancel()};function d(){return(d=(0,j.Z)(Y().mark((function e(t){var n;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,he(t,u,a.signal);case 3:return n=e.sent,e.abrupt("return",n);case 7:throw e.prev=7,e.t0=e.catch(0),oe(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function f(e){for(var t,n=me(e);!(t=n()).done;){var r=t.value;if(a.isUsed)return;v(r,!1)}}function p(e){f(e.contentWarnings);var t=performance.now()-i;C.Z.info("MF: Manifest parsed in "+t+"ms"),r.next({type:"parsed",manifest:e,sendingTime:o,receivedTime:s,parsingTime:t}),r.complete()}function v(e,t){var n=(0,O.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});t?r.error(n):r.next({type:"warning",value:n})}}))},t._getBackoffSetting=function(e){var t=D.Z.getCurrent(),n=t.DEFAULT_MAX_MANIFEST_REQUEST_RETRY,r=t.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,i=t.INITIAL_BACKOFF_DELAY_BASE,a=t.MAX_BACKOFF_DELAY_BASE,o=this._settings,s=o.lowLatencyMode,u=o.maxRetryRegular,l=o.maxRetryOffline;return{onRetry:e,baseDelay:s?i.LOW_LATENCY:i.REGULAR,maxDelay:s?a.LOW_LATENCY:a.REGULAR,maxRetryRegular:null!=u?u:n,maxRetryOffline:null!=l?l:r}},e}();var _e=n(5138),be=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 f.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,_e.Z)(n._waitingQueue,(function(e){return e.observable===r}));if(e>=0)n._waitingQueue.splice(e,1);else{var t=(0,_e.Z)(n._pendingTasks,(function(e){return e.observable===r}));if(t<0)return void C.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,_e.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,_e.Z)(this._pendingTasks,(function(t){return t.observable===e}));if(i<0)C.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||t<this._minPendingPriority)this._minPendingPriority=t;else{if(this._minPendingPriority!==o)return;1===this._pendingTasks.length?this._minPendingPriority=t:this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority}))),this._loopThroughWaitingQueue()}this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks()}}},t._loopThroughWaitingQueue=function(){var e=this._waitingQueue.reduce((function(e,t){return null===e||e>t.priority?t.priority:e}),null);if(!(null===e||null!==this._minPendingPriority&&this._minPendingPriority<e))for(var t=0;t<this._waitingQueue.length;t++){var n=null===this._minPendingPriority?e:Math.min(this._minPendingPriority,e);this._waitingQueue[t].priority<=n&&(this._startWaitingQueueTask(t),t--)}},t._interruptCancellableTasks=function(){for(var e=0;e<this._pendingTasks.length;e++){var t=this._pendingTasks[e];if(t.priority>=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,_e.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0?C.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,_e.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}(),Te=n(520),Ee=n(7714),Se=n(908),we=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}(),ke=(0,Se.Z)();var Ae=function(){function e(e,t){var n=D.Z.getCurrent(),r=n.MIN_CANCELABLE_PRIORITY,i=n.MAX_HIGH_PRIORITY_LEVEL;this._transport=e,this._prioritizer=new be({prioritySteps:{high:i,low:r}}),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,a=D.Z.getCurrent(),o=a.DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR,s=a.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,u=a.INITIAL_BACKOFF_DELAY_BASE,l=a.MAX_BACKOFF_DELAY_BASE;return{maxRetryRegular:"image"===e?0:null!=n?n:o,maxRetryOffline:null!=r?r:s,baseDelay:i?u.LOW_LATENCY:u.REGULAR,maxDelay:i?l.LOW_LATENCY:l.REGULAR}}(e,this._backoffOptions),o=function(e,t,n,r){var i=(0,Ee.Z)(["audio","video"],e)?new we:void 0,a=t.loadSegment,o=t.parseSegment;return function(e){var t=e.segment,s=(0,Te.K)(e);return new f.y((function(u){var l,c,d,f=ke(),p=new re.ZP,v=[],h=0,m=!1,g={onProgress:function(e){var t;void 0!==e.totalSize&&e.size<e.totalSize&&(null===(t=n.onProgress)||void 0===t||t.call(n,{duration:e.duration,size:e.size,totalSize:e.totalSize,timestamp:performance.now(),id:f}))},onNewChunk:function(e){u.next({type:"chunk",parse:_(e,!0)})}},y=void 0!==i?i.get(e):null;return null!==y?(C.Z.debug("SF: Found wanted segment in cache",s),u.next({type:"chunk",parse:_(y,!1)}),u.next({type:"chunk-complete"}),void u.complete()):(C.Z.debug("SF: Beginning request",s),null===(l=n.onRequestBegin)||void 0===l||l.call(n,{requestTimestamp:performance.now(),id:f,content:e}),ve(null!==(c=t.mediaURLs)&&void 0!==c?c:[null],(function(t,n){return a(t,e,n,g)}),(0,K.Z)({onRetry:function(e){u.next({type:"retry",value:oe(e)})}},r),p.signal).then((function(t){var r;if(C.Z.debug("SF: Segment request ended with success",s),"segment-loaded"===t.resultType){var a=t.resultData.responseData;void 0!==i&&i.add(e,t.resultData.responseData),u.next({type:"chunk",parse:_(a,!1)})}else"segment-created"===t.resultType&&u.next({type:"chunk",parse:_(t.resultData,!1)});C.Z.debug("SF: Segment request ended with success",s),u.next({type:"chunk-complete"}),"segment-created"!==t.resultType?(d=t.resultData,b()):d=null,p.isUsed||null===(r=n.onRequestEnd)||void 0===r||r.call(n,{id:f}),u.complete()})).catch((function(e){C.Z.debug("SF: Segment request failed",s),d=null,u.error(oe(e))})),function(){var e;void 0===d&&(C.Z.debug("SF: Segment request cancelled",s),d=null,p.cancel(),null===(e=n.onRequestEnd)||void 0===e||e.call(n,{id:f}))});function _(t,n){v.push(!1);var r=v.length-1;return function(i){var a={data:t,isChunked:n};try{var s=o(a,e,i);return v[r]||(h=void 0!==h&&"media"===s.segmentType&&null!==s.chunkInfos&&void 0!==s.chunkInfos.duration?h+s.chunkInfos.duration:void 0,v[r]=!0,b()),s}catch(e){throw(0,O.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown parsing error"})}}}function b(){var t;m||!(0,V.Z)(d)&&void 0!==d.size&&void 0!==d.requestDuration&&v.length>0&&v.every((function(e){return e}))&&(m=!0,null===(t=n.onMetrics)||void 0===t||t.call(n,{size:d.size,requestDuration:d.requestDuration,content:e,segmentDuration:h}))}}))}}(e,this._transport[e],t,a);return n=this._prioritizer,r=o,i=new WeakMap,{createRequest:function(e,t){void 0===t&&(t=0);var a=n.create(r(e),t),o=a.pipe((0,s.U)((function(e){return"data"===e.type?e.value:e})));return i.set(o,a),o},updatePriority:function(e,t){var r=i.get(e);void 0!==r?n.updatePriority(r,t):C.Z.warn("Fetchers: Cannot update the priority of a request: task not found.")}}},e}();function xe(e){return(0,w.e)((function(t,n){try{t.subscribe(n)}finally{n.add(e)}}))}var Ie=n(533);var Ze=n(8333),Re=n(2793),Me=n(5278),Ce=function(){function e(e){this._alpha=Math.exp(Math.log(.5)/e),this._lastEstimate=0,this._totalWeight=0}var t=e.prototype;return t.addSample=function(e,t){var n=Math.pow(this._alpha,e),r=t*(1-n)+n*this._lastEstimate;isNaN(r)||(this._lastEstimate=r,this._totalWeight+=e)},t.getEstimate=function(){var e=1-Math.pow(this._alpha,this._totalWeight);return this._lastEstimate/e},e}(),Pe=function(){function e(){var e=D.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new Ce(t),this._slowEWMA=new Ce(n),this._bytesSampled=0}var t=e.prototype;return t.addSample=function(e,t){if(!(t<D.Z.getCurrent().ABR_MINIMUM_CHUNK_SIZE)){var n=8e3*t/e,r=e/1e3;this._bytesSampled+=t,this._fastEWMA.addSample(r,n),this._slowEWMA.addSample(r,n)}},t.getEstimate=function(){var e=D.Z.getCurrent().ABR_MINIMUM_TOTAL_BYTES;if(!(this._bytesSampled<e))return Math.min(this._fastEWMA.getEstimate(),this._slowEWMA.getEstimate())},t.reset=function(){var e=D.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new Ce(t),this._slowEWMA=new Ce(n),this._bytesSampled=0},e}(),De=n(2006),Ne=n(3428);function Oe(e){var t=e.map((function(t){return Math.log(t/e[0])})),n=t.map((function(e){return e-t[0]+1})),r=(n[n.length-1]-1)/(2*e.length+10),i=1/r;return e.map((function(e,t){return a(t)}));function a(t){if(0===t)return 0;var o=Math.min(Math.max(1,t),e.length-1);return e[o]===e[o-1]?a(t-1):i*(r+(e[o]*n[o-1]-e[o-1]*n[o])/(e[o]-e[o-1]))+4}}var Le=function(){function e(e){this._levelsMap=Oe(e),this._bitrates=e,C.Z.debug("ABR: Steps for buffer based chooser.",this._levelsMap.map((function(t,n){return{bufferLevel:t,bitrate:e[n]}})))}return e.prototype.getEstimate=function(e){var t=this._levelsMap,n=this._bitrates,r=e.bufferGap,i=e.currentBitrate,a=e.currentScore,o=e.speed;if(null==i)return n[0];var s,u=(0,_e.Z)(n,(function(e){return e===i}));if(u<0||n.length!==t.length)return C.Z.error("ABR: Current Bitrate not found in the calculated levels"),n[0];if(null!=a&&(s=0===o?a:a/o),null!=s&&s>1){var l=t[u],c=function(){for(var e=u+1;e<t.length;e++)if(t[e]>l)return e}();if(null!=c)if(r>=t[c])return n[c]}if((null==s||s<1.15)&&r<t[u]){for(var d=u-1;d>=0;d--)if(n[d]<i)return n[d];return i}return i},e}(),Be=n(3274);function Ue(e){if(!(e.progress.length<5)){for(var t=new Ce(2),n=e.progress,r=1;r<n.length;r++){var i=n[r].size-n[r-1].size,a=n[r].timestamp-n[r-1].timestamp,o=8*i/(a/1e3);t.addSample(a/1e3,o)}return t.getEstimate()}}function Fe(e,t){var n=8*(e.totalSize-e.size);return Math.max(n/t,0)}var ze=function(){function e(e,t){var n=D.Z.getCurrent(),r=n.ABR_STARVATION_GAP,i=n.OUT_OF_STARVATION_GAP,a=n.ABR_STARVATION_FACTOR,o=n.ABR_REGULAR_FACTOR;this._initialBitrate=e,this._inStarvationMode=!1,this._lowLatencyMode=t,this._config=t?{starvationGap:r.LOW_LATENCY,outOfStarvationGap:i.LOW_LATENCY,starvationBitrateFactor:a.LOW_LATENCY,regularBitrateFactor:o.LOW_LATENCY}:{starvationGap:r.DEFAULT,outOfStarvationGap:i.DEFAULT,starvationBitrateFactor:a.DEFAULT,regularBitrateFactor:o.DEFAULT}}var t=e.prototype;return t.getBandwidthEstimate=function(e,t,n,r,i){var a,o,s=this._config,u=e.bufferGap,l=e.position,c=e.duration,d=isFinite(u)?u:0,f=D.Z.getCurrent().ABR_STARVATION_DURATION_DELTA;return isNaN(c)||d+l<c-f?!this._inStarvationMode&&d<=s.starvationGap?(C.Z.info("ABR: enter starvation mode."),this._inStarvationMode=!0):this._inStarvationMode&&d>=s.outOfStarvationGap&&(C.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1):this._inStarvationMode&&(C.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1),this._inStarvationMode&&null!=(o=function(e,t,n,r,i){if(!r){var a=t.bufferGap,o=t.speed,s=t.position,u=isFinite(a)?a:0,l=function(e,t){for(var n=-1,r=0;r<e.length;r++){var i=e[r].content.segment;if(!(i.duration<=0)){var a=i.time+i.duration;if(!i.complete&&r===e.length-1&&t-i.time>-1.2){n=r;break}if(a>t&&t-i.time>-1.2){n=r;break}}}if(n<0)return[];for(var o=e[n],s=o.content.segment.time,u=[o],l=n+1;l<e.length&&e[l].content.segment.time===s;l++)u.push(e[l]);return u}(e,s+u);if(1===l.length){var c=l[0],d=performance.now(),f=c.progress.length>0?c.progress[c.progress.length-1]:void 0,p=Ue(c);if(void 0!==f&&void 0!==p){var v=Fe(f,p);if((d-f.timestamp)/1e3<=v&&v-u/o>2e3)return p}if(c.content.segment.complete){var h=c.content.segment.duration,m=(d-c.requestTimestamp)/1e3;if(null!=n&&!(m<=(1.5*h+2)/o)){var g=h/m,y=n.bitrate*Math.min(.7,g);return void 0===i||y<i?y:void 0}}}}}(r,e,n,this._lowLatencyMode,i))&&(C.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,n){if(n)return!0;var r=isFinite(e.bufferGap)?e.bufferGap:0,i=e.position+r,a=(0,Be.Z)(t,(function(e){var t=e.content;return t.segment.duration>0&&t.segment.time+t.segment.duration>i}));if(void 0===a)return!0;var o=performance.now(),s=a.progress.length>0?a.progress[a.progress.length-1]:void 0,u=Ue(a);if(void 0===s||void 0===u)return!0;var l=Fe(s,u);return(o-s.timestamp)/1e3>1.2*l||l-r/e.speed>-1.5}(r,n,this._lowLatencyMode))},e}();function Ve(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ke(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ke(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 Ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ge=function(){function e(e,t){this._scoreCalculator=e,this._lastAbrEstimate=t,this._consecutiveWrongGuesses=0,this._blockGuessesUntil=0,this._lastMaintanableBitrate=null}var t=e.prototype;return t.getGuess=function(e,t,n,r,i){var a=t.bufferGap,o=t.speed,s=this._lastAbrEstimate.representation;if(null===s)return null;if(r>s.bitrate)return 2===this._lastAbrEstimate.algorithmType&&(null!==this._lastAbrEstimate.representation&&(this._lastMaintanableBitrate=this._lastAbrEstimate.representation.bitrate),this._consecutiveWrongGuesses=0),null;var u=this._scoreCalculator.getEstimate(n);if(2!==this._lastAbrEstimate.algorithmType){if(void 0===u)return null;if(this._canGuessHigher(a,o,u)){var l=He(e,n);if(null!==l)return l}return null}if(this._isLastGuessValidated(s,r,u)&&(C.Z.debug("ABR: Guessed Representation validated",s.bitrate),this._lastMaintanableBitrate=s.bitrate,this._consecutiveWrongGuesses=0),n.id!==s.id)return s;if(this._shouldStopGuess(n,u,a,i))return this._consecutiveWrongGuesses++,this._blockGuessesUntil=performance.now()+Math.min(15e3*this._consecutiveWrongGuesses,12e4),function(e,t){var n=(0,_e.Z)(e,(function(e){return e.id===t.id}));if(n<0)return C.Z.error("ABR: Current Representation not found."),null;for(;--n>=0;)if(e[n].bitrate<t.bitrate)return e[n];return null}(e,n);if(void 0===u)return n;if(this._canGuessHigher(a,o,u)){var c=He(e,n);if(null!==c)return c}return n},t._canGuessHigher=function(e,t,n){var r=n[0],i=n[1];return isFinite(e)&&e>=2.5&&performance.now()>this._blockGuessesUntil&&1===i&&r/t>1.01},t._shouldStopGuess=function(e,t,n,r){if(void 0!==t&&t[0]<1.01)return!0;if((void 0===t||t[0]<1.2)&&n<.6)return!0;for(var i,a=r.filter((function(t){return t.content.representation.id===e.id})),o=performance.now(),s=Ve(a);!(i=s()).done;){var u=i.value,l=o-u.requestTimestamp;if(u.content.segment.isInit){if(l>1e3)return!0}else{if(l>1e3*u.content.segment.duration+200)return!0;var c=Ue(u);if(void 0!==c&&c<.8*e.bitrate)return!0}}return!1},t._isLastGuessValidated=function(e,t,n){return void 0!==n&&1===n[1]&&n[0]>1.5||t>=e.bitrate&&(null===this._lastMaintanableBitrate||this._lastMaintanableBitrate<e.bitrate)},e}();function He(e,t){var n=e.length,r=(0,_e.Z)(e,(function(e){return e.id===t.id}));if(r<0)return C.Z.error("ABR: Current Representation not found."),null;for(;++r<n;)if(e[r].bitrate>t.bitrate)return e[r];return null}var We=function(){function e(){this.bandwidth=void 0,this.representation=null,this.algorithmType=3}return e.prototype.update=function(e,t,n){this.representation=e,this.bandwidth=t,this.algorithmType=n},e}(),je=n(1679),qe=function(){function e(){this._currentRequests={}}var t=e.prototype;return t.add=function(e){var t=e.id,n=e.requestTimestamp,r=e.content;this._currentRequests[t]={requestTimestamp:n,progress:[],content:r}},t.addProgress=function(e){var t=this._currentRequests[e.id];null!=t?t.progress.push(e):C.Z.warn("ABR: progress for a request not added")},t.remove=function(e){null==this._currentRequests[e]&&C.Z.warn("ABR: can't remove unknown request"),delete this._currentRequests[e]},t.getRequests=function(){return(0,je.Z)(this._currentRequests).filter((function(e){return null!=e})).sort((function(e,t){return e.content.segment.time-t.content.segment.time}))},e}(),Ye=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._currentRepresentationData;null!==a&&a.representation.id===e.id?(r=a.ewma,a.ewma.addSample(t,i),a.loadedDuration+=n,a.loadedSegments++):((r=new Ce(5)).addSample(t,i),this._currentRepresentationData={representation:e,ewma:r,loadedDuration:n,loadedSegments:0}),r.getEstimate()>1&&this._lastRepresentationWithGoodScore!==e&&(C.Z.debug("ABR: New last stable representation",e.bitrate),this._lastRepresentationWithGoodScore=e)},t.getEstimate=function(e){if(null!==this._currentRepresentationData&&this._currentRepresentationData.representation.id===e.id){var t=this._currentRepresentationData,n=t.ewma,r=t.loadedSegments,i=t.loadedDuration;return[n.getEstimate(),r>=5&&i>=10?1:0]}},t.getLastStableRepresentation=function(){return this._lastRepresentationWithGoodScore},e}();function $e(e,t,n,r){var i=t<=n?n:t>=r?r:t,a=(0,_e.Z)(e,(function(e){return e.bitrate>i}));return-1===a?e[e.length-1]:0===a?e[0]:e[a-1]}function Xe(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,_e.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,Me.Z)(e.width,0)-(0,Me.Z)(t.width,0)})),r=(0,Be.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 Qe(e){var t=e.bandwidthEstimator,n=e.observation$,r=e.filters$,i=e.initialBitrate,a=e.lowLatencyMode,o=e.manualBitrate$,u=e.minAutoBitrate$,c=e.maxAutoBitrate$,d=e.representations,f=e.streamEvents$,v=new Ye,h=new ze(null==i?0:i,a),g=new qe;var b=f.pipe((0,m.h)((function(e){return"metrics"===e.type})),(0,De.b)((function(e){return function(e){var n=e.requestDuration,r=e.segmentDuration,i=e.size,a=e.content;if(t.addSample(n,i),!a.segment.isInit){var o=a.segment,s=a.representation;if(void 0===r&&!o.complete)return;var u=null!=r?r:o.duration;v.addSample(s,n/1e3,u)}}(e.value)})),(0,Ie.l)()),S=f.pipe((0,De.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,Ie.l)()),w=f.pipe((0,m.h)((function(e){return"representationChange"===e.type})),(0,s.U)((function(e){return e.value.representation})),(0,_.O)(null)),k=(0,p.P)((function(){if(0===d.length)throw new Error("ABRManager: no representation choice given");return 1===d.length?(0,l.of)({bitrate:void 0,representation:d[0],manual:!1,urgent:!0,knownStableBitrate:void 0}):o.pipe((0,T.w)((function(e){if(e>=0){var i=$e(d,e,0,1/0);return(0,l.of)({representation:i,bitrate:void 0,knownStableBitrate:void 0,manual:!0,urgent:!0})}var o=new We,p=!1,b=new Ge(v,o),T=f.pipe((0,m.h)((function(e){return"added-segment"===e.type})),(0,Ne.M)(n),(0,s.U)((function(e){var t=e[0].value,n=e[1],r=n.speed,i=n.position,a=t.buffered,o=(0,G.L7)(a,i),s=t.content.representation,u=v.getEstimate(s),l=null==u?void 0:u[0];return{bufferGap:o,currentBitrate:s.bitrate,currentScore:l,speed:r}}))),E=d.map((function(e){return e.bitrate})),S=new Le(E),k=T.pipe((0,s.U)((function(e){return S.getEstimate(e)})),(0,_.O)(void 0));return(0,y.a)([n,u,c,r,k]).pipe((0,Ne.M)(w),(0,s.U)((function(e){var n=e[0],r=n[0],i=n[1],s=n[2],u=n[3],l=n[4],c=e[1],f=r.bufferGap,m=r.liveGap,y=Xe(d,u),_=g.getRequests(),T=h.getBandwidthEstimate(r,t,c,_,o.bandwidth),E=T.bandwidthEstimate,S=T.bitrateChosen,w=v.getLastStableRepresentation(),k=null===w?void 0:w.bitrate/(r.speed>0?r.speed:1);p&&f<=5?p=!1:!p&&isFinite(f)&&f>10&&(p=!0);var A=$e(y,S,i,s),x=A.bitrate,I=null;p&&void 0!==l&&l>x&&(x=(I=$e(y,l,i,s)).bitrate);var Z=null;return a&&null!==c&&void 0!==m&&m<40&&(Z=b.getGuess(d,r,c,x,_)),null!==Z&&Z.bitrate>x?(C.Z.debug("ABR: Choosing representation with guess-based estimation.",Z.bitrate,Z.id),o.update(Z,E,2),{bitrate:E,representation:Z,urgent:null===c||Z.bitrate<c.bitrate,manual:!1,knownStableBitrate:k}):null!==I?(C.Z.debug("ABR: Choosing representation with buffer-based estimation.",I.bitrate,I.id),o.update(I,E,0),{bitrate:E,representation:I,urgent:h.isUrgent(I.bitrate,c,_,r),manual:!1,knownStableBitrate:k}):(C.Z.debug("ABR: Choosing representation with bandwidth estimation.",A.bitrate,A.id),o.update(A,E,1),{bitrate:E,representation:A,urgent:h.isUrgent(A.bitrate,c,_,r),manual:!1,knownStableBitrate:k})})))})))}));return(0,E.T)(b,S,k)}var Je=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,u=this._getBandwidthEstimator(e),c=(0,Me.Z)(null===(i=this._manualBitrates[e])||void 0===i?void 0:i.asObservable(),(0,l.of)(-1)),d=(0,Me.Z)(null===(a=this._minAutoBitrates[e])||void 0===a?void 0:a.asObservable(),(0,l.of)(0)),f=(0,Me.Z)(null===(o=this._maxAutoBitrates[e])||void 0===o?void 0:o.asObservable(),(0,l.of)(1/0)),p=(0,Me.Z)(this._initialBitrates[e],0);return Qe({bandwidthEstimator:u,streamEvents$:r,observation$:n,filters$:function(e,t,n){var r=[];null!=e&&r.push(e.pipe((0,s.U)((function(e){return{width:e}}))));null!=n&&r.push(n.pipe((0,s.U)((function(e){return{bitrate:e}}))));null!=t&&r.push(t.pipe((0,s.U)((function(e){return{bitrate:e}}))));return r.length>0?(0,y.a)(r).pipe((0,s.U)((function(e){return K.Z.apply(void 0,[{}].concat(e))}))):(0,l.of)({})}(this._throttlers.limitWidth[e],this._throttlers.throttleBitrate[e],this._throttlers.throttle[e]),initialBitrate:p,manualBitrate$:c,minAutoBitrate$:d,maxAutoBitrate$:f,representations:t,lowLatencyMode:this._lowLatencyMode})},t._getBandwidthEstimator=function(e){var t=this._bandwidthEstimators[e];if(null==t){C.Z.debug("ABR: Creating new BandwidthEstimator for ",e);var n=new Pe;return this._bandwidthEstimators[e]=n,n}return t},e}(),et=n(5767),tt=n(3774),nt=n(6923),rt=x.ym;function it(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&&(C.Z.info("Init: Removing SourceBuffer from mediaSource"),o.abort()),t.removeSourceBuffer(o)}catch(e){C.Z.warn("Init: Error while disposing SourceBuffer",e)}}i.length>0&&C.Z.warn("Init: Not all SourceBuffers could have been removed.")}if((0,et.Z)(e),null!==n)try{C.Z.debug("Init: Revoking previous URL"),URL.revokeObjectURL(n)}catch(e){C.Z.warn("Init: Error while revoking the media source URL",e)}}function at(e){return function(e){return new f.y((function(t){if(null==tt.J)throw new N.Z("MEDIA_SOURCE_NOT_SUPPORTED","No MediaSource Object was found in the current browser.");var n=(0,nt.Z)(e.src)?e.src:null;it(e,null,n),C.Z.info("Init: Creating MediaSource");var r=new tt.J,i=URL.createObjectURL(r);return C.Z.info("Init: Attaching MediaSource URL to the media element",i),e.src=i,t.next(r),function(){it(e,r,i)}}))}(e).pipe((0,c.z)((function(e){return rt(e).pipe((0,A.q)(1),(0,s.U)((function(){return e})))})))}var ot=n(8343);var st=n(9607),ut=n(3610),lt=n(6697),ct=n(2401);var dt=n(7904),ft=n(6968),pt=n(2870),vt=n(9612);var ht=function(e){function n(t,n,r){var a;a=e.call(this)||this;var s=r.addSourceBuffer(n);a._destroy$=new i.x,a.bufferType=t,a._mediaSource=r,a._sourceBuffer=s,a._queue=[],a._pendingTask=null,a._lastInitSegment=null,a.codec=n;var u=D.Z.getCurrent().SOURCE_BUFFER_FLUSHING_INTERVAL;return(0,lt.F)(u).pipe((0,De.b)((function(){return a._flush()})),(0,o.R)(a._destroy$)).subscribe(),(0,ct.R)(a._sourceBuffer,"error").pipe((0,De.b)((function(e){return a._onPendingTaskError(e)})),(0,o.R)(a._destroy$)).subscribe(),(0,ct.R)(a._sourceBuffer,"updateend").pipe((0,De.b)((function(){return a._flush()})),(0,o.R)(a._destroy$)).subscribe(),a}(0,t.Z)(n,e);var r=n.prototype;return r.pushChunk=function(e){return C.Z.debug("AVSB: receiving order to push data to the SourceBuffer",this.bufferType,(0,Te.K)(e.inventoryInfos)),this._addToQueue({type:vt.f.Push,value:e})},r.removeBuffer=function(e,t){return C.Z.debug("AVSB: receiving order to remove data from the SourceBuffer",this.bufferType,e,t),this._addToQueue({type:vt.f.Remove,value:{start:e,end:t}})},r.endOfSegment=function(e){return C.Z.debug("AVSB: receiving order for validating end of segment",this.bufferType,(0,Te.K)(e)),this._addToQueue({type:vt.f.EndOfSegment,value:e})},r.getBufferedRanges=function(){return this._sourceBuffer.buffered},r.getPendingOperations=function(){var e=function(e){switch(e.type){case vt.f.Push:case vt.f.Remove:case vt.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){C.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 f.y((function(n){var r=0===t._queue.length&&null===t._pendingTask,a=new i.x,o=(0,K.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!==vt.f.Push||0===e.data.length){switch(e.type){case vt.f.Push:null!==e.inventoryData&&this._segmentInventory.insertChunk(e.inventoryData);break;case vt.f.EndOfSegment:this._segmentInventory.completeSegment(e.value,this.getBufferedRanges());break;case vt.f.Remove:this.synchronizeInventory();break;default:(0,dt.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!==vt.f.Push)this._pendingTask=n;else{var r,i=n.value;try{r=this._preparePushOperation(i.data)}catch(e){this._pendingTask=(0,K.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,K.Z)({data:r,inventoryData:i.inventoryInfos},n)}}try{switch(this._pendingTask.type){case vt.f.EndOfSegment:return C.Z.debug("AVSB: Acknowledging complete segment",(0,Te.K)(this._pendingTask.value)),void this._flush();case vt.f.Push:var o=this._pendingTask.data.shift();if(void 0===o)return void this._flush();C.Z.debug("AVSB: pushing segment",this.bufferType,(0,Te.K)(this._pendingTask.inventoryData)),this._sourceBuffer.appendBuffer(o);break;case vt.f.Remove:var s=this._pendingTask.value,u=s.start,l=s.end;C.Z.debug("AVSB: removing data from SourceBuffer",this.bufferType,u,l),this._sourceBuffer.remove(u,l);break;default:(0,dt.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&&(C.Z.debug("AVSB: updating codec",n),(a=function(e,t){if("function"==typeof e.changeType){try{e.changeType(t)}catch(e){return C.Z.warn("Could not call 'changeType' on the given SourceBuffer:",e),!1}return!0}return!1}(this._sourceBuffer,n))?this.codec=n:C.Z.debug("AVSB: could not update codec",n,this.codec)),this._sourceBuffer.timestampOffset!==r){var o=r;C.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,ft._f)(s);this._lastInitSegment={data:u,hash:(0,pt.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,ft._f)(e);if((0,pt.Z)(n)===this._lastInitSegment.hash&&(0,F.Z)(t,n))return!0}return!1},n}(vt.C),mt=["audio","video","text","image"];function gt(e){return"audio"===e||"video"===e}var yt=function(){function e(e,t){this._mediaElement=e,this._mediaSource=t,this._initializedSegmentBuffers={},this._onNativeBufferAddedOrDisabled=[]}e.isNative=function(e){return gt(e)};var t=e.prototype;return t.getBufferTypes=function(){var e=this.getNativeBufferTypes();return null==B.Z.nativeTextTracksBuffer&&null==B.Z.htmlTextTracksBuffer||e.push("text"),null!=B.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,l.of)(void 0):new f.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 C.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(gt(e)){if(null!=i)return i instanceof ht&&i.codec!==t?C.Z.warn("SB: Reusing native SegmentBuffer with codec",i.codec,"for codec",t):C.Z.info("SB: Reusing native SegmentBuffer with codec",t),i;C.Z.info("SB: Adding native SegmentBuffer with codec",t);var a=new ht(e,t,this._mediaSource);return this._initializedSegmentBuffers[e]=a,this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()})),a}if(null!=i)return C.Z.info("SB: Reusing a previous custom SegmentBuffer for the type",e),i;if("text"===e){if(C.Z.info("SB: Creating a new text SegmentBuffer"),"html"===n.textTrackMode){if(null==B.Z.htmlTextTracksBuffer)throw new Error("HTML Text track feature not activated");r=new B.Z.htmlTextTracksBuffer(this._mediaElement,n.textTrackElement)}else{if(null==B.Z.nativeTextTracksBuffer)throw new Error("Native Text track feature not activated");r=new B.Z.nativeTextTracksBuffer(this._mediaElement,!0===n.hideNativeSubtitle)}return this._initializedSegmentBuffers.text=r,r}if("image"===e){if(null==B.Z.imageBuffer)throw new Error("Image buffer feature not activated");return C.Z.info("SB: Creating a new image SegmentBuffer"),r=new B.Z.imageBuffer,this._initializedSegmentBuffers.image=r,r}throw C.Z.error("SB: Unknown buffer type:",e),new N.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?(C.Z.info("SB: Aborting SegmentBuffer",e),t.dispose(),delete this._initializedSegmentBuffers[e]):C.Z.warn("SB: Trying to dispose a SegmentBuffer that does not exist")},t.disposeAll=function(){var e=this;mt.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}(),_t=n(7878);function bt(e,t){return t?function(n){return n.pipe(bt((function(n,r){return(0,_t.Xf)(e(n,r)).pipe((0,s.U)((function(e,i){return t(n,e,r,i)})))})))}:(0,w.e)((function(t,n){var r=0,i=null,a=!1;t.subscribe(new k.Q(n,(function(t){i||(i=new k.Q(n,void 0,(function(){i=null,a&&n.complete()})),(0,_t.Xf)(e(t,r++)).subscribe(i))}),(function(){a=!0,!i&&n.complete()})))}))}var Tt=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<e;n++)t[n]=arguments[n];t.sort(this._sortingFn);for(var r=0,i=0;i<t.length;i++){for(var a=t[i],o=!1;!o&&r<this._array.length;)this._sortingFn(a,this._array[r])<0?(this._array.splice(r,0,a),o=!0):r++;o||this._array.push(a)}},t.length=function(){return this._array.length},t.get=function(e){if(e<0||e>=this._array.length)throw new Error("Invalid index.");return this._array[e]},t.findFirst=function(e){return(0,Be.Z)(this._array,e)},t.has=function(e){return(0,Ee.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}(),Et=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}(),St=n(3102),wt=n(9834);function kt(e){var t=e.segmentBuffer,n=e.currentTime$,r=e.maxBufferBehind$,i=e.maxBufferAhead$;return(0,y.a)([n,r,i]).pipe((0,c.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 S.E;var i=[],a=(0,G.F_)(e.getBufferedRanges(),t),o=a.innerRange,s=a.outerRanges,u=function(){if(isFinite(r)){for(var e=0;e<s.length;e++){var n=s[e];t+r<=n.start?i.push(n):t<=n.start&&t+r<n.end&&t+r>n.start&&i.push({start:t+r,end:n.end})}null!=o&&t+r<o.end&&i.push({start:t+r,end:o.end})}};return function(){if(isFinite(n)){for(var e=0;e<s.length;e++){var r=s[e];t-n>=r.end?i.push(r):t>=r.end&&t-n>r.start&&t-n<r.end&&i.push({start:r.start,end:t-n})}null!=o&&t-n>o.start&&i.push({start:o.start,end:t-n})}}(),u(),(0,St.D)(i.map((function(t){return C.Z.debug("GC: cleaning range from SegmentBuffer",t),t.start>=t.end?(0,l.of)(null):e.removeBuffer(t.start,t.end)}))).pipe((0,wt.u)(),(0,Ie.l)())}(t,n,r,i)})))}var At=n(8567),xt=n(9878);function It(e,t,n,r){return n.observe(!0).pipe((0,s.U)((function(i){var a,o=n.getCurrentTime()+r,s=Math.min(Math.max(e.start,o),null!==(a=e.end)&&void 0!==a?a:1/0);return At.Z.waitingMediaSourceReload(t,e,s,!i.isPaused)})))}var Zt=n(7473),Rt=n.n(Zt);var Mt=function(){function e(e,t,n,r){this._content=e,this._currentObs$=null,this._downloadQueue=t,this._initSegmentRequest=null,this._mediaSegmentRequest=null,this._segmentFetcher=n,this._initSegmentMetadata$=new a.t(1),this._mediaSegmentsAwaitingInitMetadata=new Set,r||this._initSegmentMetadata$.next(void 0)}var t=e.prototype;return t.getRequestedInitSegment=function(){return null===this._initSegmentRequest?null:this._initSegmentRequest.segment},t.getRequestedMediaSegment=function(){return null===this._mediaSegmentRequest?null:this._mediaSegmentRequest.segment},t.start=function(){var e=this;if(null!==this._currentObs$)return this._currentObs$;var t=(0,p.P)((function(){var t=e._downloadQueue.asObservable().pipe((0,m.h)((function(t){for(var n=t.segmentQueue,r=0;r<n.length;r++){var i=n[r].segment;if(!e._mediaSegmentsAwaitingInitMetadata.has(i.id))break}var a=e._mediaSegmentRequest;if(r>=n.length)return null!==a;if(null===a)return!0;var o=n[r];return a.segment.id!==o.segment.id||(a.priority!==o.priority&&e._segmentFetcher.updatePriority(a.request$,o.priority),!1)})),(0,T.w)((function(t){return t.segmentQueue.length>0?e._requestMediaSegments():S.E}))),n=e._downloadQueue.asObservable().pipe((0,m.h)((function(t){var n=e._initSegmentRequest;return null!==t.initSegment&&null!==n?(t.initSegment.priority!==n.priority&&e._segmentFetcher.updatePriority(n.request$,t.initSegment.priority),!1):null===t.initSegment||null===n})),(0,T.w)((function(t){return null===t.initSegment?S.E:e._requestInitSegment(t.initSegment)})));return(0,E.T)(n,t)})).pipe((0,g.B)());return this._currentObs$=t,t},t._requestMediaSegments=function(){var e=this,t=this._downloadQueue.getValue().segmentQueue[0],n=function t(n){if(void 0===n)return(0,l.of)({type:"end-of-queue",value:null});var r=n.segment,i=n.priority,a=(0,K.Z)({segment:r},e._content),o=e._segmentFetcher.createRequest(a,i);return e._mediaSegmentRequest={segment:r,priority:i,request$:o},o.pipe((0,c.z)((function(n){switch(n.type){case"retry":return(0,l.of)({type:"retry",value:{segment:r,error:n.value}});case"interrupted":return C.Z.info("Stream: segment request interrupted temporarly.",r),S.E;case"ended":e._mediaSegmentRequest=null;var i=e._downloadQueue.getValue().segmentQueue;return 0===i.length?(0,l.of)({type:"end-of-queue",value:null}):(i[0].segment.id===r.id&&i.shift(),t(i[0]));case"chunk":case"chunk-complete":return e._mediaSegmentsAwaitingInitMetadata.add(r.id),e._initSegmentMetadata$.pipe((0,A.q)(1),(0,s.U)((function(e){if("chunk-complete"===n.type)return{type:"end-of-segment",value:{segment:r}};var t=n.parse(e);return(0,ne.Z)("media"===t.segmentType,"Should have loaded a media segment."),(0,K.Z)({},t,{type:"parsed-media",segment:r})})),xe((function(){e._mediaSegmentsAwaitingInitMetadata.delete(r.id)})));default:(0,dt.Z)(n)}})))};return(0,p.P)((function(){return n(t)})).pipe(xe((function(){e._mediaSegmentRequest=null})))},t._requestInitSegment=function(e){var t=this;if(null===e)return this._initSegmentRequest=null,S.E;var n=e.segment,r=e.priority,i=(0,K.Z)({segment:n},this._content),a=this._segmentFetcher.createRequest(i,r);return this._initSegmentRequest={segment:n,priority:r,request$:a},a.pipe((0,c.z)((function(e){switch(e.type){case"retry":return(0,l.of)({type:"retry",value:{segment:n,error:e.value}});case"interrupted":return C.Z.info("Stream: init segment request interrupted temporarly.",n),S.E;case"chunk":var r=e.parse(void 0);return(0,ne.Z)("init"===r.segmentType,"Should have loaded an init segment."),(0,b.z)((0,l.of)((0,K.Z)({},r,{type:"parsed-init",segment:n})),(0,p.P)((function(){return"init"===r.segmentType&&t._initSegmentMetadata$.next(r.initTimescale),S.E})));case"chunk-complete":return(0,l.of)({type:"end-of-segment",value:{segment:n}});case"ended":return S.E;default:(0,dt.Z)(e)}}))).pipe(xe((function(){t._initSegmentRequest=null})))},e}();function Ct(e,t,n,r,i){var a=e.period,o=e.adaptation,s=e.representation,u=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(void 0===r.bufferedStart||void 0===r.bufferedEnd||r.bufferedStart>=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 c=i[u];if(void 0!==c.bufferedStart&&c.bufferedStart>t.start&&(null===n||c.infos.segment.end<=n))return C.Z.debug("RS: current discontinuity encountered",o.type,c.bufferedStart),{start:void 0,end:c.bufferedStart};var d=function(e,t,n){if(n<=0)return C.Z.error("RS: Asked to check a discontinuity before the first chunk."),null;for(var r=n;r<e.length;r++){var i=e[r],a=e[r-1];if(void 0===i.bufferedStart||void 0===a.bufferedEnd||i.bufferedStart>=t.end)return null;if(i.bufferedStart-a.bufferedEnd>0)return r}return null}(i,t,u+1);if(null!==d&&(null===n||i[d].infos.segment.end<=n)){var f=i[d-1].bufferedEnd,p=i[d].bufferedStart;return C.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<a.end)return null;var v=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(void 0===r.bufferedStart)return null;if(r.bufferedStart<t)return n}return null}(i,a.end);if(null!==v){var h=i[v];if(void 0!==h.bufferedEnd&&h.bufferedEnd<a.end)return C.Z.debug("RS: discontinuity encountered at the end of the current period",o.type,h.bufferedEnd,a.end),{start:h.bufferedEnd,end:null}}}if(void 0!==a.end&&t.end>=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<t.end){if(void 0!==g.bufferedEnd&&g.bufferedEnd<t.end){var y=s.index.checkDiscontinuity(t.end);if(null!==y)return{start:g.bufferedEnd,end:y}}return null}}}return null}function Pt(e){var t=e.bufferedSegments,n=e.content,r=e.currentPlaybackTime,i=e.fastSwitchThreshold,a=e.getBufferedHistory,o=e.neededRange,s=e.segmentsBeingPushed,u=e.maxBufferSize,l=n.representation,c=function(e,t,n){var r=n;return r-=t.reduce((function(e,t){return e+t.representation.bitrate/8e3*t.segment.duration}),0),e.reduce((function(e,t){return void 0!==t.chunkSize?e-t.chunkSize/1e3:e}),r)}(t,s,u),d=l.index.getSegments(o.start,o.end-o.start),f=t.filter((function(e){return!Nt(e.infos,n,r,i)})).filter((function(e,t,n){var r=0===t?null:n[t-1],i=t>=n.length-1?null:n[t+1],s=null;if(function(e,t,n){var r=D.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedStart)return C.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(n<e.bufferedStart&&e.bufferedStart-e.start>r)return C.Z.info("Stream: The start of the wanted segment has been garbage collected",e),!0;return!1}(e,r,o.start)){if(function(e,t){if(e.length<2)return!0;var n=e[e.length-1].bufferedStart;if(void 0!==t&&t-n>.05)return!0;var r=e[e.length-2].bufferedStart;return Math.abs(r-n)>.01}(s=a(e.infos),e.bufferedStart))return!1;C.Z.debug("Stream: skipping segment gc-ed at the start",e)}if(function(e,t,n){var r=D.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedEnd)return C.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>r)return C.Z.info("Stream: The end of the wanted segment has been garbage collected",e),!0;return!1}(e,i,o.end)){if(function(e,t){if(e.length<2)return!0;var n=e[e.length-1].bufferedEnd;if(void 0!==t&&n-t>.05)return!0;var r=e[e.length-2].bufferedEnd;return Math.abs(r-n)>.01}(s=null!=s?s:a(e.infos),e.bufferedEnd))return!1;C.Z.debug("Stream: skipping segment gc-ed at the end",e)}return!0})),p=D.Z.getCurrent(),v=p.MINIMUM_SEGMENT_SIZE,h=p.MIN_BUFFER_AHEAD,m=!1,g=Math.min(1/60,v),y=!1,_=[];return{segmentsToLoad:d.filter((function(e){var t=(0,K.Z)({segment:e},n);if(s.length>0&&s.some((function(e){return(0,Te.z)(t,e)})))return!1;var a=e.duration,u=e.time,l=e.end;if(e.isInit)return!0;if(m)return _.push(e),!1;if(e.complete&&a<v)return!1;if(s.length>0&&s.some((function(e){if(e.period.id!==n.period.id||e.adaptation.id!==n.adaptation.id)return!1;var a=e.segment;return!(a.time-g>u)&&(!(a.end+g<l)&&!Nt(e,t,r,i))})))return!1;for(var d=0;d<f.length;d++){var p=f[d];if(p.infos.period.id===n.period.id){var b=p.infos.segment;if(u-b.time>-g&&b.end-l>-g)return!1}}var T=a*n.representation.bitrate/8e3;if(c-T<0&&(y=!0,u>o.start+h))return m=!0,_.push(e),!1;for(var E=0;E<f.length;E++){var S=f[E];if(S.end+g>u){var w=S.start>u+g||Dt(f,E).end<l-g;return w&&(c-=T),w}}return c-=T,!0})),segmentsOnHold:_,isBufferFull:y}}function Dt(e,t){for(var n=t+1,r=D.Z.getCurrent().MINIMUM_SEGMENT_SIZE,i=Math.min(1/60,r);n<e.length-1&&e[n-1].end+i>e[n].start;)n++;return e[--n]}function Nt(e,t,n,r){var i=D.Z.getCurrent().CONTENT_REPLACEMENT_PADDING;return e.period.id===t.period.id&&(!(e.segment.time<n+i)&&(e.adaptation.id!==t.adaptation.id||function(e,t,n){var r=e.bitrate,i=D.Z.getCurrent().BITRATE_REBUFFERING_RATIO;if(void 0===n){var a=r*i;return t.bitrate>a}return r<n&&t.bitrate>r}(e.representation,t.representation,r)))}function Ot(e,t){for(var n=e-t,r=D.Z.getCurrent().SEGMENT_PRIORITIES_STEPS,i=0;i<r.length;i++)if(n<r[i])return i;return r.length}function Lt(e,t,n,r,i,a,o){var s,u=e.period,l=e.representation;o.synchronizeInventory();var c,d,f=t+i,p={start:Math.max(t,u.start),end:Math.min(f,null!==(s=u.end)&&void 0!==s?s:1/0)},v=l.index.shouldRefresh(t,f),h=o.getPendingOperations().filter((function(e){return e.type===vt.f.EndOfSegment})).map((function(e){return e.value})),m=function(e,t){for(var n=D.Z.getCurrent().MINIMUM_SEGMENT_SIZE,r=Math.max(1/60,n),i=e.start+r,a=e.end-r,o=[],s=t.length-1;s>=0;s--){var u=t[s],l=u.infos.representation;if(!u.partiallyPushed&&!1!==l.decipherable&&l.isSupported){var c=u.infos.segment,d=c.time/c.timescale;((c.complete?d+c.duration/c.timescale:u.end)>i&&d<a||u.end>i&&u.start<a)&&o.unshift(u)}}return o}({start:Math.max(p.start-.5,0),end:p.end+.5},o.getInventory()),g=Pt({content:e,bufferedSegments:m,currentPlaybackTime:n.getCurrentTime(),fastSwitchThreshold:r,getBufferedHistory:o.getSegmentHistory.bind(o),neededRange:p,segmentsBeingPushed:h,maxBufferSize:a}),y=g.segmentsToLoad,_=g.segmentsOnHold,b=g.isBufferFull,T=y.map((function(e){return{priority:Ot(e.time,t),segment:e}})),E=l.index.getLastPosition();if(!l.index.isInitialized()||void 0===u.end||T.length>0||_.length>0)c=!1;else if(void 0===E)c=p.end>=u.end&&l.index.isFinished();else if(null===E)c=l.index.isFinished();else{var S=void 0!==u.end?Math.min(u.end,E):E;c=p.end>=S&&l.index.isFinished()}if(l.index.isInitialized()&&(l.index.areSegmentsChronologicallyGenerated()||c)){var w=null;h.length>0&&(w=Math.min.apply(Math,h.map((function(e){return e.segment.time})))),_.length>0&&(w=null!==w?Math.min(w,_[0].time):_[0].time),T.length>0&&(w=null!==w?Math.min(w,T[0].segment.time):T[0].segment.time),d=Ct(e,p,w,c,m)}else d=null;return{imminentDiscontinuity:d,hasFinishedLoading:c,neededSegments:T,isBufferFull:b,shouldRefreshManifest:v}}function Bt(e,t,n){for(var r=(0,G.F_)(t,e),i=r.innerRange,a=r.outerRanges,o=[],s=0;s<a.length;s++){var u=a[s];(e-n>u.end||e+n<u.start)&&o.push(u)}return null!==i&&(C.Z.debug("Stream: GC removing part of inner range",o),e-n>i.start&&o.push({start:i.start,end:e-n}),e+n<i.end&&o.push({start:e+n,end:i.end})),o}function Ut(e,t,n){var r=t.pushChunk(n);return r.pipe((0,xt.K)((function(n){if(!(n instanceof Error)||"QuotaExceededError"!==n.name){var i=n instanceof Error?n.toString():"An unknown error happened when pushing content";throw new N.Z("BUFFER_APPEND_ERROR",i)}return e.observe(!0).pipe((0,A.q)(1),(0,c.z)((function(e){var n,i,a=e.position+e.wantedTimeOffset;return(0,b.z)((n=a,i=t,(0,p.P)((function(){var e=D.Z.getCurrent().BUFFER_GC_GAPS.CALM,t=D.Z.getCurrent().BUFFER_GC_GAPS.BEEFY;C.Z.warn("Stream: Running garbage collector");var r=i.getBufferedRanges(),a=Bt(n,r,e);return 0===a.length&&(a=Bt(n,r,t)),C.Z.debug("Stream: GC cleaning",a),(0,St.D)(a.map((function(e){var t=e.start,n=e.end;return t>=n?(0,l.of)(null):i.removeBuffer(t,n)}))).pipe((0,wt.u)())}))).pipe((0,Ie.l)()),r).pipe((0,xt.K)((function(e){var t=e instanceof Error?e.toString():"Could not clean the buffer";throw new N.Z("BUFFER_FULL_ERROR",t)})))})))})))}var Ft=function(e){var t=e.content,n=e.options,r=e.playbackObserver,a=e.segmentBuffer,o=e.segmentFetcher,u=e.terminate$,d=t.period,f=t.adaptation,v=t.representation,h=n.bufferGoal$,m=n.maxBufferSize$,T=n.drmSystemId,x=n.fastSwitchThreshold$,I=f.type,Z={segment:v.index.getInitSegment(),segmentData:null,isLoaded:!1},R=new i.x,M=(0,H.$)({initSegment:null,segmentQueue:[]}),P=null!==Z.segment,N=new Mt(t,M,o,P);P||(Z.segmentData=null,Z.isLoaded=!0);var O=!1,L=S.E;if(void 0!==T){var B=v.getEncryptionData(T);B.length>0&&(L=l.of.apply(void 0,B.map((function(e){return At.Z.encryptionDataEncountered(e,t)}))),O=!0)}var U,F,z=N.start().pipe((0,c.z)((function(e){switch(e.type){case"retry":return(0,b.z)((0,l.of)({type:"warning",value:e.value.error}),(0,p.P)((function(){var t=e.value.segment,n=v.index;if(!1===n.isSegmentStillAvailable(t))R.next();else if(n.canBeOutOfSyncError(e.value.error,t))return(0,l.of)(At.Z.manifestMightBeOufOfSync());return S.E})));case"parsed-init":case"parsed-media":return function(e){if("init"===e.segmentType){Rt()((function(){R.next()})),Z.segmentData=e.initializationData,Z.isLoaded=!0;var n=v.getAllEncryptionData(),i=!O&&n.length>0?l.of.apply(void 0,n.map((function(e){return At.Z.encryptionDataEncountered(e,t)}))):S.E,o=function(e){var t=e.playbackObserver,n=e.content,r=e.segment,i=e.segmentData,a=e.segmentBuffer;return(0,p.P)((function(){if(null===i)return S.E;var e=n.representation.getMimeTypeString();return Ut(t,a,{data:{initSegment:i,chunk:null,timestampOffset:0,appendWindow:[void 0,void 0],codec:e},inventoryInfos:null}).pipe((0,s.U)((function(){var e=a.getBufferedRanges();return At.Z.addedSegment(n,r,e,i)})))}))}({playbackObserver:r,content:t,segment:e.segment,segmentData:e.initializationData,segmentBuffer:a});return(0,E.T)(i,o)}var u=e.inbandEvents,c=e.needsManifestRefresh,d=e.protectionDataUpdate&&!O?l.of.apply(void 0,v.getAllEncryptionData().map((function(e){return At.Z.encryptionDataEncountered(e,t)}))):S.E,f=!0===c?(0,l.of)(At.Z.needsManifestRefresh()):S.E,h=void 0!==u&&u.length>0?(0,l.of)({type:"inband-events",value:u}):S.E,m=Z.segmentData,g=function(e){var t=e.playbackObserver,n=e.content,r=e.initSegmentData,i=e.parsedSegment,a=e.segment,o=e.segmentBuffer;return(0,p.P)((function(){var e,u;if(null===i.chunkData)return S.E;var l=i.chunkData,c=i.chunkInfos,d=i.chunkOffset,f=i.chunkSize,p=i.appendWindow,v=n.representation.getMimeTypeString(),h=D.Z.getCurrent().APPEND_WINDOW_SECURITIES,m=[void 0!==p[0]?Math.max(0,p[0]-h.START):void 0,void 0!==p[1]?p[1]+h.END:void 0],g={initSegment:r,chunk:l,timestampOffset:d,appendWindow:m,codec:v},y=null!==(e=null==c?void 0:c.time)&&void 0!==e?e:a.time,_=y+(null!==(u=null==c?void 0:c.duration)&&void 0!==u?u:a.duration);void 0!==m[0]&&(y=Math.max(y,m[0])),void 0!==m[1]&&(_=Math.min(_,m[1]));var b=(0,K.Z)({segment:a,chunkSize:f,start:y,end:_},n);return Ut(t,o,{data:g,inventoryInfos:b}).pipe((0,s.U)((function(){var e=o.getBufferedRanges();return At.Z.addedSegment(n,a,e,l)})))}))}({playbackObserver:r,content:t,initSegmentData:m,parsedSegment:e,segment:e.segment,segmentBuffer:a});return(0,b.z)(d,f,h,g)}(e);case"end-of-segment":var n=e.value.segment;return a.endOfSegment((0,K.Z)({segment:n},t)).pipe((0,Ie.l)());case"end-of-queue":return R.next(),S.E;default:(0,dt.Z)(e)}}))),V=(0,y.a)([r.observe(!0),h,m,u.pipe((0,A.q)(1),(0,_.O)(null)),R.pipe((0,_.O)(void 0))]).pipe((0,Ne.M)(x),(0,c.z)((function(e){var n=e[0],i=n[0],o=n[1],s=n[2],u=n[3],c=e[1],f=i.position+i.wantedTimeOffset,p=Lt(t,f,r,c,o,s,a),h=p.neededSegments,m=null;if(v.index.isInitialized()){if(h.length>0&&!Z.isLoaded&&null!==Z.segment){var g=h[0].priority;m={segment:Z.segment,priority:g}}}else if(null===Z.segment)C.Z.warn("Stream: Uninitialized index without an initialization segment");else if(Z.isLoaded)C.Z.warn("Stream: Uninitialized index with an already loaded initialization segment");else{var y=i.position+i.wantedTimeOffset;m={segment:Z.segment,priority:Ot(d.start,y)}}if(null===u)M.setValue({initSegment:m,segmentQueue:h});else{if(u.urgent)return C.Z.debug("Stream: Urgent switch, terminate now.",I),M.setValue({initSegment:null,segmentQueue:[]}),M.finish(),(0,l.of)(At.Z.streamTerminating());var _=h[0],T=N.getRequestedInitSegment(),E=N.getRequestedMediaSegment(),w=null===E||void 0===_||E.id!==_.segment.id?[]:[_],k=null===T?null:m;if(M.setValue({initSegment:k,segmentQueue:w}),0===w.length&&null===k)return C.Z.debug("Stream: No request left, terminate",I),M.finish(),(0,l.of)(At.Z.streamTerminating())}var A=(0,l.of)({type:"stream-status",value:{period:d,position:i.position,bufferType:I,imminentDiscontinuity:p.imminentDiscontinuity,hasFinishedLoading:p.hasFinishedLoading,neededSegments:p.neededSegments}}),x=S.E,R=D.Z.getCurrent().UPTO_CURRENT_POSITION_CLEANUP;if(p.isBufferFull){var P=Math.max(0,f-R);P>0&&(x=a.removeBuffer(0,P).pipe((0,Ie.l)()))}return p.shouldRefreshManifest?(0,b.z)((0,l.of)(At.Z.needsManifestRefresh()),A,x):(0,b.z)(A,x)})),(U=function(e){return"stream-terminating"!==e.type},void 0===(F=!0)&&(F=!1),(0,w.e)((function(e,t){var n=0;e.subscribe(new k.Q(t,(function(e){var r=U(e,n++);(r||F)&&t.next(e),!r&&t.complete()})))}))));return(0,E.T)(V,z,L).pipe((0,g.B)())};var zt=function(e){var t=e.abrManager,n=e.playbackObserver,r=e.content,a=e.options,o=e.segmentBuffer,d=e.segmentFetcherCreator,f=e.wantedBufferAhead,v=e.maxVideoBufferSize,h="direct"===a.manualBitrateSwitchingMode,y=r.manifest,_=r.period,w=r.adaptation,k={},x=function(e,t,n){var r=e.manifest,a=e.adaptation,o=new i.x;return{estimator$:(0,E.T)((0,z.R)(r,"decipherabilityUpdate"),(0,l.of)(null)).pipe((0,s.U)((function(){var e=a.getPlayableRepresentations();if(e.length<=0)throw new N.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+a.type+" Adaptation can be played");return e})),(0,u.x)((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<t.length;n++)if(e[n].id!==t[n].id)return!1;return!0})),(0,T.w)((function(e){return t.get$(a.type,e,n,o)}))),abrFeedbacks$:o}}(r,t,n.observe(!0)),I=x.estimator$,Z=x.abrFeedbacks$,R=d.createSegmentFetcher(w.type,{onRequestBegin:function(e){Z.next({type:"requestBegin",value:e})},onRequestEnd:function(e){Z.next({type:"requestEnd",value:e})},onProgress:function(e){Z.next({type:"progress",value:e})},onMetrics:function(e){Z.next({type:"metrics",value:e})}}),M=(0,H.$)(null),P=I.pipe((0,De.b)((function(e){M.setValue(e)})),(0,Ze.Z)(),(0,g.B)()),L=P.pipe((0,m.h)((function(e){return null!=e.bitrate})),(0,u.x)((function(e,t){return e.bitrate===t.bitrate})),(0,s.U)((function(e){var t=e.bitrate;return C.Z.debug("Stream: new "+w.type+" bitrate estimate",t),At.Z.bitrateEstimationChange(w.type,t)}))),B=P.pipe(bt((function(e,t){return U(e,0===t)})));return(0,E.T)(B,L);function U(e,t){var r=e.representation;if(h&&e.manual&&!t){var i=D.Z.getCurrent().DELTA_POSITION_AFTER_RELOAD;return It(_,w.type,n,i.bitrateSwitch)}var o=M.asObservable().pipe((0,m.h)((function(t){return null===t||t.representation.id!==r.id||t.manual&&!e.manual})),(0,A.q)(1),(0,s.U)((function(e){return null===e?(C.Z.info("Stream: urgent Representation termination",w.type),{urgent:!0}):e.urgent?(C.Z.info("Stream: urgent Representation switch",w.type),{urgent:!0}):(C.Z.info("Stream: slow Representation switch",w.type),{urgent:!1})}))),d=a.enableFastSwitching?M.asObservable().pipe((0,s.U)((function(e){return null===e?void 0:e.knownStableBitrate})),(0,u.x)()):(0,l.of)(0),f=(0,l.of)(At.Z.representationChange(w.type,_,r));return(0,b.z)(f,F(r,o,d)).pipe((0,De.b)((function(e){if("representationChange"===e.type||"added-segment"===e.type)return Z.next(e)})),(0,c.z)((function(e){if("stream-terminating"===e.type){var t=M.getValue();return null===t?S.E:U(t,!1)}return(0,l.of)(e)})))}function F(e,t,r){return(0,p.P)((function(){var i=k[e.id],u=null!=i?i:1;k[e.id]=u;var c=f.asObservable().pipe((0,s.U)((function(e){return e*u}))),d="video"===w.type?v.asObservable():(0,l.of)(1/0);return C.Z.info("Stream: changing representation",w.type,e.id,e.bitrate),Ft({playbackObserver:n,content:{representation:e,adaptation:w,period:_,manifest:y},segmentBuffer:o,segmentFetcher:R,terminate$:t,options:{bufferGoal$:c,maxBufferSize$:d,drmSystemId:a.drmSystemId,fastSwitchThreshold$:r}}).pipe((0,xt.K)((function(n){var i=(0,O.Z)(n,{defaultCode:"NONE",defaultReason:"Unknown `RepresentationStream` error"});if("BUFFER_FULL_ERROR"===i.code){var a=f.getValue(),o=u;if(o<=.25||a*o<=2)throw i;return k[e.id]=o-.25,F(e,t,r)}throw i})))}))}};function Vt(e,t,n,r){var i=r.period,a=!1,o=t.asObservable(),s=e.observe(!0);return(0,y.a)([s,o]).pipe((0,c.z)((function(e){var t=e[0],r=e[1],o=t.position;return void 0!==i.end&&o+r>=i.end&&(C.Z.debug('Stream: full "empty" AdaptationStream',n),a=!0),(0,l.of)({type:"stream-status",value:{period:i,bufferType:n,position:t.position,imminentDiscontinuity:null,hasFinishedLoading:a,neededSegments:[],shouldRefreshManifest:!1}})})))}var Kt=n(9252);var Gt=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,Be.Z)(i,(function(e){return(0,Kt.Z)(e,"codecs=")})),l=(0,Be.Z)(s,(function(e){return(0,Kt.Z)(e,"codecs=")}));if(void 0===u||void 0===l)return!1;var c=u.substring(7),d=l.substring(7);return c.split(".")[0]===d.split(".")[0]};function Ht(e,t,n,r,i){if(void 0!==e.codec&&"reload"===i.onCodecSwitch&&!function(e,t){return e.getPlayableRepresentations().some((function(e){return Gt(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,G.JN)(a),s=t.start,u=null==t.end?1/0:t.end,l=(0,G.tn)(o,[{start:s,end:u}]);if(0===l.length)return{type:"continue",value:void 0};e.synchronizeInventory();var c=e.getInventory();if(!c.some((function(e){return e.infos.period.id===t.id&&e.infos.adaptation.id!==n.id})))return{type:"continue",value:void 0};var d=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}),[])}(c,t,n),f=(0,G.uH)(l,d);if(0===f.length)return{type:"continue",value:void 0};var p=r.currentTime,v=i.audioTrackSwitchingMode;if(("video"===n.type||"audio"===n.type&&"reload"===v)&&(0,G.Ti)({start:s,end:u},p)&&(r.readyState>1||!n.getPlayableRepresentations().some((function(t){var n;return Gt(t.getMimeTypeString(),null!==(n=e.codec)&&void 0!==n?n:"")})))&&!(0,G.A1)(d,p))return{type:"needs-reload",value:void 0};var h="audio"===n.type&&"direct"===v,m=[],g=function(e,t){for(var n=0;n<e.length;n++)if(e[n].infos.period.start>=t.start)return n>0?e[n-1]:null;return e.length>0?e[e.length-1]:null}(c,t);null!==g&&(void 0===g.bufferedEnd||t.start-g.bufferedEnd<1)&&m.push({start:0,end:t.start+1});var y=n.type,_=D.Z.getCurrent().ADAPTATION_SWITCH_BUFFER_PADDINGS,b=_[y].before;null==b&&(b=0);var T=_[y].after;if(null==T&&(T=0),h||m.push({start:p-b,end:p+T}),void 0!==t.end){var E=function(e,t){for(var n=0;n<e.length;n++)if(e[n].infos.period.start>t.start)return e[n];return null}(c,t);null!==E&&(void 0===E.bufferedStart||E.bufferedStart-t.end<1)&&m.push({start:t.end-1,end:Number.MAX_VALUE})}var S=(0,G.uH)(f,m);return 0===S.length?{type:"continue",value:void 0}:h?{type:"flush-buffer",value:S}:{type:"clean-buffer",value:S}}var Wt=function(e){var t=e.abrManager,n=e.bufferType,r=e.content,i=e.garbageCollectors,o=e.playbackObserver,u=e.segmentFetcherCreator,d=e.segmentBuffersStore,f=e.options,v=e.wantedBufferAhead,h=e.maxVideoBufferSize,m=r.period,g=new a.t(1);return g.pipe((0,T.w)((function(e,a){var g=D.Z.getCurrent().DELTA_POSITION_AFTER_RELOAD,y=0===a?0:"audio"===n?g.trackSwitch.audio:"video"===n?g.trackSwitch.video:g.trackSwitch.other;if(null===e){C.Z.info("Stream: Set no "+n+" Adaptation. P:",m.start);var _,T=d.getStatus(n);if("initialized"===T.type){if(C.Z.info("Stream: Clearing previous "+n+" SegmentBuffer"),yt.isNative(n))return It(m,n,o,0);_=void 0===m.end?T.value.removeBuffer(m.start,1/0):m.end<=m.start?(0,l.of)(null):T.value.removeBuffer(m.start,m.end)}else"uninitialized"===T.type&&d.disableSegmentBuffer(n),_=(0,l.of)(null);return(0,b.z)(_.pipe((0,s.U)((function(){return At.Z.adaptationChange(n,null,m)}))),Vt(o,v,n,{period:m}))}if(yt.isNative(n)&&"disabled"===d.getStatus(n).type)return It(m,n,o,y);C.Z.info("Stream: Updating "+n+" adaptation","A: "+e.id,"P: "+m.start);var w=(0,p.P)((function(){var a=o.getReadyState(),p=function(e,t,n,r){var i=e.getStatus(t);if("initialized"===i.type)return C.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)}(d,n,e,f),g={currentTime:o.getCurrentTime(),readyState:a},_=Ht(p,m,e,g,f);if("needs-reload"===_.type)return It(m,n,o,y);var T="flush-buffer"===_.type?(0,l.of)(At.Z.needsBufferFlush()):S.E,w="clean-buffer"===_.type||"flush-buffer"===_.type?b.z.apply(void 0,_.value.map((function(e){var t=e.start,n=e.end;return p.removeBuffer(t,n)}))).pipe((0,Ie.l)()):S.E,k=i.get(p),A=function(e,i){var a=r.manifest,c=function(e,t){return e.deriveReadOnlyObserver((function(e){return e.pipe((0,s.U)(n))}),n);function n(e){var n=t.getBufferedRanges();return(0,K.Z)({},e,{bufferGap:(0,G.L7)(n,e.position)})}}(o,i);return zt({abrManager:t,content:{manifest:a,period:m,adaptation:e},options:f,playbackObserver:c,segmentBuffer:i,segmentFetcherCreator:u,wantedBufferAhead:v,maxVideoBufferSize:h}).pipe((0,xt.K)((function(e){if(!yt.isNative(n)){C.Z.error("Stream: "+n+" Stream crashed. Aborting it.",e),d.disposeSegmentBuffer(n);var t=(0,O.Z)(e,{defaultCode:"NONE",defaultReason:"Unknown `AdaptationStream` error"});return(0,b.z)((0,l.of)(At.Z.warning(t)),Vt(o,v,n,{period:m}))}throw C.Z.error("Stream: "+n+" Stream crashed. Stopping playback.",e),e})))}(e,p);return d.waitForUsableBuffers().pipe((0,c.z)((function(){return(0,b.z)(w,T,(0,E.T)(A,k))})))}));return(0,b.z)((0,l.of)(At.Z.adaptationChange(n,e,m)),w)})),(0,_.O)(At.Z.periodStreamReady(n,m,g)))},jt=n(3074);function qt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map((function(e){return e.pipe((0,m.h)((function(e){return"complete-stream"===e.type||"stream-status"===e.type&&!e.value.hasFinishedLoading})),(0,s.U)((function(e){return"complete-stream"===e.type})),(0,_.O)(!1),(0,u.x)())}));return(0,y.a)(r).pipe((0,s.U)((function(e){return e.every((function(e){return e}))})),(0,u.x)())}var Yt=function(e,t,n,r,a,d){var f,v,h=e.manifest,T=e.initialPeriod,w=d.maxBufferAhead,k=d.maxBufferBehind,x=d.wantedBufferAhead,I=d.maxVideoBufferSize,Z=D.Z.getCurrent(),R=Z.MAXIMUM_MAX_BUFFER_AHEAD,M=Z.MAXIMUM_MAX_BUFFER_BEHIND,P=new Et((function(e){var n=e.bufferType,r=null!=M[n]?M[n]:1/0,i=null!=R[n]?R[n]:1/0;return kt({segmentBuffer:e,currentTime$:t.observe(!0).pipe((0,s.U)((function(e){return e.position+e.wantedTimeOffset}))),maxBufferBehind$:k.asObservable().pipe((0,s.U)((function(e){return Math.min(e,r)}))),maxBufferAhead$:w.asObservable().pipe((0,s.U)((function(e){return Math.min(e,i)})))})})),O=t.observe(!0).pipe((0,Re.Z)((function(e){var t=e.position,n=e.wantedTimeOffset+t;if(n<h.getMinimumPosition()){var r=new N.Z("MEDIA_TIME_BEFORE_MANIFEST","The current position is behind the earliest time announced in the Manifest.");return At.Z.warning(r)}if(n>h.getMaximumPosition()){var i=new N.Z("MEDIA_TIME_AFTER_MANIFEST","The current position is after the latest time announced in the Manifest.");return At.Z.warning(i)}return null}),null)),L=r.getBufferTypes().map((function(e){return function(e,n){var a=new Tt((function(e,t){return e.start-t.start})),o=new i.x,u=!1;function d(t){return V(e,t,o).pipe((0,s.U)((function(e){switch(e.type){case"waiting-media-source-reload":var t=a.head();if(void 0===t||t.id!==e.value.period.id)return At.Z.lockedStream(e.value.bufferType,e.value.period);var n=e.value,r=n.position,i=n.autoPlay;return At.Z.needsMediaSourceReload(r,i);case"periodStreamReady":u=!0,a.add(e.value.period);break;case"periodStreamCleared":a.removeElement(e.value.period)}return e})),(0,g.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)<e)}var v=t.observe(!0).pipe((0,Re.Z)((function(t){var n,r=t.position,i=t.wantedTimeOffset,a=i+r;if(!u||!f(a))return null;var s=null!==(n=h.getPeriodForTime(a))&&void 0!==n?n:h.getNextPeriod(a);return void 0===s?null:(C.Z.info("SO: Current position out of the bounds of the active periods,re-creating Streams.",e,r+i),u=!1,o.next(),s)}),null),(0,c.z)((function(e){if(null==e)throw new N.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return d(e)}))),m=(0,z.R)(h,"decipherabilityUpdate").pipe((0,c.z)((function(n){var i=r.getStatus(e),a=n.filter((function(t){return t.adaptation.type===e}));if(0===a.length||"initialized"!==i.type)return S.E;var s=a.filter((function(e){return!1===e.representation.decipherable})),f=i.value,v=function(e,t){if(0===t.length)return[];e.synchronizeInventory();for(var n=[],r=e.getInventory(),i=function(i){var a=r[i];if(t.some((function(e){return a.infos.period.id===e.period.id&&a.infos.adaptation.id===e.adaptation.id&&a.infos.representation.id===e.representation.id}))){var o=a.bufferedStart,s=a.bufferedEnd;if(void 0===o||void 0===s){C.Z.warn("SO: No buffered start or end found from a segment.");var u=e.getBufferedRanges(),l=u.length;return 0===l?{v:[]}:{v:[{start:u.start(0),end:u.end(l-1)}]}}var c=n[n.length-1];void 0!==c&&c.end===o?c.end=s:n.push({start:o,end:s})}},a=0;a<r.length;a++){var o=i(a);if("object"==typeof o)return o.v}return n}(f,s);return 0===v.length?S.E:(u=!1,o.next(),b.z.apply(void 0,v.map((function(e){var t=e.start,n=e.end;return t>=n?S.E:f.removeBuffer(t,n).pipe((0,Ie.l)())})).concat([t.observe(!0).pipe((0,A.q)(1),(0,c.z)((function(e){return(0,b.z)((0,l.of)(At.Z.needsDecipherabilityFlush(e.position,!e.isPaused,e.duration)),(0,p.P)((function(){var t=e.position+e.wantedTimeOffset,n=h.getPeriodForTime(t);if(null==n)throw new N.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return d(n)})))})))])))})));return(0,E.T)(v,m,d(n))}(e,T).pipe((0,Ze.Z)(),(0,g.B)())})),B=(f=L,v=f.length,E.T.apply(void 0,f).pipe((0,m.h)((function(e){var t=e.type;return"periodStreamCleared"===t||"adaptationChange"===t||"representationChange"===t})),(0,jt.R)((function(e,t){switch(t.type){case"periodStreamCleared":var n=t.value,r=n.period,i=n.type,a=e[r.id];void 0!==a&&a.buffers.has(i)&&(a.buffers.delete(i),0===a.buffers.size&&delete e[r.id]);break;case"adaptationChange":if(null!==t.value.adaptation)return e;case"representationChange":var o=t.value,s=o.period,u=o.type,l=e[s.id];if(void 0===l){var c=new Set;c.add(u),e[s.id]={period:s,buffers:c}}else l.buffers.has(u)||l.buffers.add(u)}return e}),{}),(0,s.U)((function(e){for(var t=Object.keys(e),n=[],r=0;r<t.length;r++){var i=e[t[r]];void 0!==i&&i.buffers.size===v&&n.push(i.period)}return n.reduce((function(e,t){return null===e||t.start<e.start?t:e}),null)})),(0,u.x)((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e.id===t.id})))).pipe((0,m.h)((function(e){return null!==e})),(0,s.U)((function(e){return C.Z.info("Stream: New active period",e.start),At.Z.activePeriodChanged(e)}))),U=(0,z.R)(h,"manifestUpdate").pipe((0,s.U)((function(){return h.isLastPeriodKnown})),(0,_.O)(h.isLastPeriodKnown),(0,u.x)()),F=(0,y.a)([qt.apply(void 0,L),U]).pipe((0,s.U)((function(e){var t=e[0],n=e[1];return t&&n})),(0,u.x)(),(0,s.U)((function(e){return e?At.Z.endOfStream():At.Z.resumeStream()})));return E.T.apply(void 0,L.concat([B,F,O]));function V(e,s,u){C.Z.info("SO: Creating new Stream for",e,s.start);var f=new i.x,p=new i.x,v=t.observe(!0).pipe((0,m.h)((function(e){var t=e.position,n=e.wantedTimeOffset;return null!=s.end&&t+n>=s.end}))),y=f.pipe(bt((function(t){return V(e,t,p)}))),_=u.pipe((0,A.q)(1),(0,De.b)((function(){f.complete(),p.next(),p.complete()})),(0,g.B)()),T=(0,E.T)(v,_),S=Wt({abrManager:n,bufferType:e,content:{manifest:h,period:s},garbageCollectors:P,segmentFetcherCreator:a,segmentBuffersStore:r,options:d,playbackObserver:t,wantedBufferAhead:x,maxVideoBufferSize:I}).pipe((0,c.z)((function(t){if("stream-status"===t.type)if(t.value.hasFinishedLoading){var n=h.getPeriodAfter(s);if(null===n)return(0,b.z)((0,l.of)(t),(0,l.of)(At.Z.streamComplete(e)));f.next(n)}else p.next();return(0,l.of)(t)})),(0,g.B)()),w=(0,b.z)(S.pipe((0,o.R)(T)),(0,l.of)(At.Z.periodStreamCleared(e,s)).pipe((0,De.b)((function(){C.Z.info("SO: Destroying Stream for",e,s.start)}))));return(0,E.T)(w,y,_.pipe((0,Ie.l)()))}};function $t(e,t,n){return function(e){return(0,E.T)((0,x.ym)(e).pipe((0,s.U)((function(){return!0}))),(0,x.ep)(e).pipe((0,s.U)((function(){return!1}))),(0,x.UG)(e).pipe((0,s.U)((function(){return!1})))).pipe((0,_.O)("open"===e.readyState),(0,u.x)())}(e).pipe((0,T.w)((function(t){return t?function(e){if(0===e.length)return(0,l.of)(void 0);for(var t=[],n=function(n){var r=e[n];t.push((0,E.T)((0,ct.R)(r,"updatestart").pipe((0,s.U)((function(){return!0}))),(0,ct.R)(r,"update").pipe((0,s.U)((function(){return!1}))),(0,lt.F)(500).pipe((0,s.U)((function(){return r.updating})))).pipe((0,_.O)(r.updating),(0,u.x)()))},r=0;r<e.length;r++)n(r);return(0,y.a)(t).pipe((0,m.h)((function(e){return e.every((function(e){return!e}))})),(0,s.U)((function(){})))}(e.sourceBuffers):S.E})),(0,A.q)(1),(0,s.U)((function(){var r=t.getMaximumPosition(),i=t.isLive?Math.max(Math.pow(2,32),r+31536e3):r;return e.duration>=i||i===n?null:isNaN(e.duration)||!isFinite(e.duration)||i-e.duration>.01?(C.Z.info("Init: Updating duration",i),e.duration=i,i):null})),(0,xt.K)((function(e){return C.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e),(0,l.of)(null)})))}var Xt=n(5039),Qt=Array.isArray;function Jt(e){return 1===e.length&&Qt(e[0])?e[0]:e}function en(e){return function(t){for(var n=[],r=function(r){n.push((0,_t.Xf)(e[r]).subscribe(new k.Q(t,(function(e){if(n){for(var i=0;i<n.length;i++)i!==r&&n[i].unsubscribe();n=null}t.next(e)}))))},i=0;n&&!t.closed&&i<e.length;i++)r(i)}}var tn=n(5987);var nn=x.gg,rn=x.ym,an=x._E;function on(e){return(0,p.P)((function(){if(C.Z.debug("Init: Trying to call endOfStream"),"open"!==e.readyState)return C.Z.debug("Init: MediaSource not open, cancel endOfStream"),(0,l.of)(null);var t=e.sourceBuffers,n=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.updating&&t.push(r)}return t}(t);if(0===n.length)return C.Z.info("Init: Triggering end of stream"),e.endOfStream(),(0,l.of)(null);C.Z.debug("Init: Waiting SourceBuffers to be updated before calling endOfStream.");var r,i=n.map((function(e){return an(e).pipe((0,A.q)(1))}));return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=Jt(e)).length?(0,_t.Xf)(e[0]):new f.y(en(e))}(E.T.apply(void 0,i).pipe((r=1,r<=0?function(){return S.E}:(0,w.e)((function(e,t){var n=[];e.subscribe(new k.Q(t,(function(e){n.push(e),r<n.length&&n.shift()}),(function(){var e,r;try{for(var i=(0,tn.XA)(n),a=i.next();!a.done;a=i.next()){var o=a.value;t.next(o)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}t.complete()}),void 0,(function(){n=null})))})))),nn(t).pipe((0,A.q)(1))).pipe((0,c.z)((function(){return on(e)})))}))}var sn=n(7920),un=n(467);var ln=function(e,t){return e.id===t.id&&e.start===t.start&&e.end===t.end};var cn=function(e,t){for(var n=[],r=t.periods,i=0;i<r.length;i++){r[i].streamEvents.forEach((function(t){for(var r=t.start,i=t.end,a=t.id,o=t.data,s=0;s<e.length;s++){var u=e[s];if(ln(u,{id:a,start:r,end:i}))return void n.push(u)}if(void 0===i){var l={start:r,id:a,data:o,publicEvent:{start:r,data:o}};n.push(l)}else{var c={start:r,end:i,id:a,data:o,publicEvent:{start:r,end:i,data:o}};n.push(c)}}))}return n};function dn(e){return void 0!==e.end}var fn=function(e,t,n){var r=new WeakMap,i=[];return(0,z.R)(e,"manifestUpdate").pipe((0,_.O)(null),(0,jt.R)((function(t){return cn(t,e)}),[])).pipe((0,De.b)((function(e){return i=e})),(0,s.U)((function(e){return e.length>0})),(0,u.x)(),(0,T.w)((function(e){if(!e)return S.E;var a=D.Z.getCurrent().STREAM_EVENT_EMITTER_POLL_INTERVAL;return(0,y.a)([(0,lt.F)(a).pipe((0,_.O)(null)),n]).pipe((0,s.U)((function(e){e[0];return{isSeeking:e[1].seeking,currentTime:t.currentTime}})),(0,w.e)((function(e,t){var n,r=!1;e.subscribe(new k.Q(t,(function(e){var i=n;n=e,r&&t.next([i,e]),r=!0})))})),(0,c.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=[],u=[],c=0;c<e.length;c++){var d=e[c],f=d.start,p=dn(d)?d.end:void 0;r.has(d)?(f>o||void 0!==p&&o>=p)&&(dn(d)&&u.push(d.publicEvent),r.delete(d)):f<=o&&void 0!==p&&o<p?(s.push({type:"stream-event",value:d.publicEvent}),r.set(d,!0)):i<f&&o>=(null!=p?p:f)&&(a?s.push({type:"stream-event-skip",value:d.publicEvent}):(s.push({type:"stream-event",value:d.publicEvent}),dn(d)&&u.push(d.publicEvent)))}return(0,b.z)(s.length>0?l.of.apply(void 0,s):S.E,u.length>0?l.of.apply(void 0,u).pipe((0,De.b)((function(e){"function"==typeof e.onExit&&e.onExit()})),(0,Ie.l)()):S.E)}(i,t,n)})))})))},pn=n(2983);function vn(e){var t=e.mediaElement,n=e.manifest,r=e.speed,a=e.bufferOptions,u=e.abrManager,d=e.playbackObserver,f=e.segmentFetcherCreator;return function(e,v,h){var g,b=function(e,t){return(0,p.P)((function(){var n;return $t(t,e).pipe((0,c.z)((function(r){return null!==r&&(n=r),(0,z.R)(e,"manifestUpdate").pipe((0,T.w)((function(){return $t(t,e,n)})),(0,De.b)((function(e){null!==e&&(n=e)})))})),(0,Ie.l)())}))}(n,e),w=null!==(g=n.getPeriodForTime(v))&&void 0!==g?g:n.getNextPeriod(v);if(void 0===w){var k=new N.Z("MEDIA_STARTING_TIME_NOT_FOUND","Wanted starting time not found in the Manifest.");return(0,ut._)((function(){return k}))}var A=new yt(t,e),x=(0,sn.Z)({mediaElement:t,playbackObserver:d,startTime:v,mustAutoPlay:h}),I=x.seekAndPlay$,Z=x.initialPlayPerformed,R=x.initialSeekPerformed,M=d.observe(!0),P=Z.asObservable().pipe((0,m.h)((function(e){return e})),(0,c.z)((function(){return fn(n,t,M)}))),D=function(e,t,n){var r=n.autoPlay,i=n.initialPlayPerformed,a=n.initialSeekPerformed,o=n.speed,u=n.startTime;return t.deriveReadOnlyObserver((function(t){return(0,y.a)([t,o.asObservable()]).pipe((0,s.U)((function(t){var n=t[0],o=t[1];return{liveGap:e.isLive?e.getMaximumPosition()-n.position:void 0,position:n.position,duration:n.duration,isPaused:i.getValue()?n.paused:!r,readyState:n.readyState,speed:o,wantedTimeOffset:a.getValue()?0:u-n.position}})))}))}(n,d,{autoPlay:h,initialPlayPerformed:Z,initialSeekPerformed:R,speed:r,startTime:v}),O=new i.x,L=new i.x,B=new i.x,U=Yt({manifest:n,initialPeriod:w},D,u,A,f,a).pipe((0,c.z)((function(t){switch(t.type){case"end-of-stream":return C.Z.debug("Init: end-of-stream order received."),function(e){return rn(e).pipe((0,_.O)(null),(0,T.w)((function(){return on(e)})))}(e).pipe((0,Ie.l)(),(0,o.R)(O));case"resume-stream":return C.Z.debug("Init: resume-stream order received."),O.next(null),S.E;case"stream-status":var n=t.value,r=n.period,i=n.bufferType,a=n.imminentDiscontinuity,s=n.position;return L.next({period:r,bufferType:i,discontinuity:a,position:s}),S.E;case"locked-stream":return B.next(t.value),S.E;default:return(0,l.of)(t)}}))),F=(0,pn.Z)(t,r,M).pipe((0,Ie.l)()),V=(0,un.Z)(d,n,B,L),K=I.pipe((0,T.w)((function(e){return"warning"===e.type?(0,l.of)(e):(0,Xt.Z)(M,t,A,!1)})));return(0,E.T)(b,K,F,V,U,P).pipe(xe((function(){A.disposeAll()})))}}var hn=n(6625);function mn(e){var t,n,r=e.initialManifest,i=e.manifestFetcher,a=e.minimumManifestUpdateInterval,o=e.scheduleRefresh$,u=(t=function(e,t){return i.fetch(e).pipe((0,c.z)((function(e){return"warning"===e.type?(0,l.of)(e):e.parse(t)})),(0,g.B)())},n=!1,function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return new f.y((function(e){if(!n){n=!0;var i=t.apply(void 0,r).subscribe({next:function(t){e.next(t)},error:function(t){n=!1,e.error(t)},complete:function(){n=!1,e.complete()}});return function(){i.unsubscribe(),n=!1}}e.complete()}))}),d=r.manifest,v=0;return(0,p.P)((function(){return h(r)}));function h(e){var t=e.sendingTime,n=e.parsingTime,r=e.updatingTime,i=void 0!==n?n+(null!=r?r:0):void 0,u=D.Z.getCurrent(),f=u.MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE,p=u.MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE,g=v>0?v<f:void 0!==i&&i>=p,y=void 0===t?0:performance.now()-t,_=Math.max(a-y,0),b=o.pipe((0,c.z)((function(e){var n=e.completeRefresh,r=e.delay,i=e.canUseUnsafeMode&&g;return gn(null!=r?r:0,a,t).pipe((0,s.U)((function(){return{completeRefresh:n,unsafeMode:i}})))}))),T=null===d.expired?S.E:(0,hn.H)(_).pipe((0,c.z)((function(){return null===d.expired?S.E:(0,St.D)(d.expired)})),(0,s.U)((function(){return{completeRefresh:!0,unsafeMode:g}}))),w=function(){if(void 0===d.lifetime||d.lifetime<0)return S.E;var e,t=1e3*d.lifetime-y;void 0===i?e=t:d.lifetime<3&&i>=100?(e=Math.min(Math.max(3e3-y,Math.max(t,0)+i),6*t),C.Z.info("MUS: Manifest update rythm is too frequent. Postponing next request.",t,e)):i>=1e3*d.lifetime/10?(e=Math.min(Math.max(t,0)+i,6*t),C.Z.info("MUS: Manifest took too long to parse. Postponing next request",e,e)):e=t;return(0,hn.H)(Math.max(e,_)).pipe((0,s.U)((function(){return{completeRefresh:!1,unsafeMode:g}})))}();return(0,E.T)(w,b,T).pipe((0,A.q)(1),(0,c.z)((function(e){return m({completeRefresh:e.completeRefresh,unsafeMode:e.unsafeMode})})),(0,c.z)((function(e){return"warning"===e.type?(0,l.of)(e):h(e)})))}function m(e){var t=e.completeRefresh,n=e.unsafeMode,r=d.updateUrl,i=t||void 0===r,o=i?d.getUrl():r,s=d.clockOffset;return n?(v+=1,C.Z.info('Init: Refreshing the Manifest in "unsafeMode" for the '+String(v)+" consecutive time.")):v>0&&(C.Z.info('Init: Not parsing the Manifest in "unsafeMode" anymore after '+String(v)+" consecutive times."),v=0),u(o,{externalClockOffset:s,previousManifest:d,unsafeMode:n}).pipe((0,c.z)((function(e){if("warning"===e.type)return(0,l.of)(e);var t=e.manifest,n=e.sendingTime,r=e.receivedTime,o=e.parsingTime,s=performance.now();if(i)d.replace(t);else try{d.update(t)}catch(e){var u=e instanceof Error?e.message:"unknown error";return C.Z.warn("MUS: Attempt to update Manifest failed: "+u,"Re-downloading the Manifest fully"),gn(D.Z.getCurrent().FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY,a,n).pipe((0,c.z)((function(){return m({completeRefresh:!0,unsafeMode:!1})})))}return(0,l.of)({type:"parsed",manifest:d,sendingTime:n,receivedTime:r,parsingTime:o,updatingTime:performance.now()-s})})))}}function gn(e,t,n){return(0,p.P)((function(){var r=void 0===n?0:performance.now()-n,i=Math.max(t-r,0);return(0,hn.H)(Math.max(e-r,i))}))}var yn=n(2447);var _n=function(e){var t=e.adaptiveOptions,n=e.autoPlay,r=e.bufferOptions,a=e.keySystems,u=e.lowLatencyMode,f=e.manifest$,p=e.manifestFetcher,v=e.mediaElement,h=e.minimumManifestUpdateInterval,b=e.playbackObserver,S=e.segmentFetcherCreator,w=e.speed,k=e.startAt,x=e.textTrackOptions,I=new Je(t),Z=at(v).pipe((0,d.d)({refCount:!0})),R=new i.x,M=(0,st.Z)(v,a,R,Z).pipe((0,Ze.Z)(),(0,g.B)()),P=(0,yn.Z)(v),N=M.pipe((0,m.h)((function(e){return"decryption-ready"===e.type||"decryption-disabled"===e.type})),(0,s.U)((function(e){return e.value})),(0,A.q)(1)),O=(0,y.a)([f,N]).pipe((0,c.z)((function(e){var t=e[0],a=e[1],d=a.drmSystemId,f=a.mediaSource;if("warning"===t.type)return(0,l.of)(t);var m=t.manifest;C.Z.debug("Init: Calculating initial time");var g=function(e,t,n){if(null!=n){var r=e.getMinimumPosition(),i=e.getMaximumPosition();if(null!=n.position)return C.Z.debug("Init: using startAt.minimumPosition"),Math.max(Math.min(n.position,i),r);if(null!=n.wallClockTime){C.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){C.Z.debug("Init: using startAt.fromFirstPosition");var s=n.fromFirstPosition;return s<=0?r:Math.min(i,r+s)}if(null!=n.fromLastPosition){C.Z.debug("Init: using startAt.fromLastPosition");var u=n.fromLastPosition;return u>=0?i:Math.max(r,i+u)}if(null!=n.percentage){C.Z.debug("Init: using startAt.percentage");var l=n.percentage;return l>100?i:l<0?r:r+ +l/100*(i-r)}}var c=e.getMinimumPosition();if(e.isLive){var d,f=e.suggestedPresentationDelay,p=e.clockOffset,v=e.getMaximumPosition(),h=D.Z.getCurrent().DEFAULT_LIVE_GAP;if(null==p)C.Z.info("Init: no clock offset found for a live content, starting close to maximum available position"),d=v;else{C.Z.info("Init: clock offset found for a live content, checking if we can start close to it");var m=null==e.availabilityStartTime?0:e.availabilityStartTime,g=(performance.now()+p)/1e3-m;d=Math.min(v,g)}var y=void 0!==f?f:t?h.LOW_LATENCY:h.DEFAULT;return C.Z.debug("Init: "+d+" defined as the live time, applying a live gap of "+y),Math.max(d-y,c)}return C.Z.info("Init: starting at the minimum available position:",c),c}(m,u,k);C.Z.debug("Init: Initial time calculated:",g);var y=vn({abrManager:I,bufferOptions:(0,K.Z)({textTrackOptions:x,drmSystemId:d},r),manifest:m,mediaElement:v,playbackObserver:b,segmentFetcherCreator:S,speed:w}),A=function e(t,n,r){var a=new i.x,s=y(t,n,r).pipe((0,Re.Z)((function(e){switch(e.type){case"needs-manifest-refresh":return Z.next({completeRefresh:!1,canUseUnsafeMode:!0}),null;case"manifest-might-be-out-of-sync":var t=D.Z.getCurrent().OUT_OF_SYNC_MANIFEST_REFRESH_DELAY;return Z.next({completeRefresh:!0,canUseUnsafeMode:!1,delay:t}),null;case"needs-media-source-reload":return a.next(e.value),null;case"needs-decipherability-flush":var n=ee(v);if(null===(i=n)||i.indexOf("widevine")<0)return a.next(e.value),null;var r=e.value.position;return r+.001<e.value.duration?b.setCurrentTime(v.currentTime+.001):b.setCurrentTime(r),null;case"encryption-data-encountered":return R.next(e.value),null;case"needs-buffer-flush":return b.setCurrentTime(v.currentTime+.001),null}var i;return e}),null)).pipe((0,o.R)(a)),u=a.pipe((0,T.w)((function(t){return at(v).pipe((0,c.z)((function(n){return e(n,t.position,t.autoPlay)})),(0,_.O)(ot.Z.reloadingMediaSource()))})));return(0,E.T)(u,s)}(f,g,n),Z=new i.x,M=mn({initialManifest:t,manifestFetcher:p,minimumManifestUpdateInterval:h,scheduleRefresh$:Z}),P=(0,E.T)((0,z.R)(m,"manifestUpdate").pipe((0,s.U)((function(){return ot.Z.manifestUpdate()}))),(0,z.R)(m,"decipherabilityUpdate").pipe((0,s.U)(ot.Z.decipherabilityUpdate)));return(0,E.T)(P,M,A).pipe((0,_.O)(ot.Z.manifestReady(m)),xe((function(){Z.complete()})))})));return(0,E.T)(O,P,M.pipe((0,Ie.l)()))};var bn="STOPPED",Tn="LOADED",En="LOADING",Sn="PLAYING",wn="PAUSED",kn="ENDED",An="BUFFERING",xn="SEEKING",In="RELOADING";var Zn=n(5553);function Rn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Mn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mn(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=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 Mn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Cn=["canplay","play","seeking","seeked","loadedmetadata","ratechange"],Pn=function(){function e(e,t){this._internalSeekingEventsIncomingCounter=0,this._mediaElement=e,this._withMediaSource=t.withMediaSource,this._lowLatencyMode=t.lowLatencyMode,this._lastObservation=null,this._observation$=null}var t=e.prototype;return t.getCurrentTime=function(){return this._mediaElement.currentTime},t.setCurrentTime=function(e){this._internalSeekingEventsIncomingCounter+=1,this._mediaElement.currentTime=e},t.getReadyState=function(){return this._mediaElement.readyState},t.observe=function(e){var t=this;return(0,p.P)((function(){return null===t._observation$||null===t._lastObservation?(t._lastObservation=t._generateInitialObservation(),t._observation$=t._createInnerObservable().pipe((0,g.B)()),t.observe(e)):e?t._observation$.pipe((0,_.O)(t._lastObservation)):t._observation$}))},t.deriveReadOnlyObserver=function(e){return On(this,e)},t._createInnerObservable=function(){var e=this;return(0,p.P)((function(){var t=D.Z.getCurrent(),n=t.SAMPLING_INTERVAL_MEDIASOURCE,r=t.SAMPLING_INTERVAL_LOW_LATENCY,i=t.SAMPLING_INTERVAL_NO_MEDIASOURCE,a=function(t){var n,r=t;"seeking"===r&&e._internalSeekingEventsIncomingCounter>0&&(r="internal-seeking",e._internalSeekingEventsIncomingCounter-=1);var i=null!==(n=e._lastObservation)&&void 0!==n?n:e._generateInitialObservation(),a=Nn(e._mediaElement,r),o=a.seeking&&("internal-seeking"===r||i.internalSeeking&&"seeking"!==r),s=function(e,t,n){var r,i,a=n.withMediaSource,o=n.lowLatencyMode,s=D.Z.getCurrent().REBUFFERING_GAP,u=t.event,l=t.position,c=t.bufferGap,d=t.currentRange,f=t.duration,p=t.paused,v=t.readyState,h=t.ended,m=e.rebuffering,g=e.event,y=e.position,_=function(e,t,n){var r=D.Z.getCurrent().REBUFFERING_GAP,i=n?"LOW_LATENCY":"DEFAULT";return null!==e&&t-e.end<=r[i]}(d,f,o),b=v>=1&&"loadedmetadata"!==u&&null===m&&!(_||h),T=null,E=o?s.LOW_LATENCY:s.DEFAULT;if(a){if(b)c<=E?(r=!0,T=l+c):c===1/0&&(r=!0,T=l);else if(null!==m){var S=Dn(m,o);!0!==r&&null!==m&&v>1&&(_||h||c<1/0&&c>S)?i=!0:(c===1/0||c<=S)&&(T=c===1/0?l:l+c)}}else b&&(!p&&"timeupdate"===u&&"timeupdate"===g&&l===y||"seeking"===u&&c===1/0)?r=!0:null!==m&&("seeking"!==u&&l!==y||"canplay"===u||c<1/0&&(c>Dn(m,o)||_||h))&&(i=!0);if(!0===i)return null;var w;if(!0===r||null!==m)return w="seeking"===u||null!==m&&"seeking"===m.reason||t.seeking?"seeking":1===v?"not-ready":"buffering",null!==m&&m.reason===w?{reason:m.reason,timestamp:m.timestamp,position:T}:{reason:w,timestamp:performance.now(),position:T};return null}(i,a,{lowLatencyMode:e._lowLatencyMode,withMediaSource:e._withMediaSource}),u=function(e,t){var n=D.Z.getCurrent().MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING;if(e.freezing)return t.ended||t.paused||0===t.readyState||0===t.playbackRate||e.position!==t.position?null:e.freezing;return"timeupdate"===t.event&&t.bufferGap>n&&!t.ended&&!t.paused&&t.readyState>=1&&0!==t.playbackRate&&t.position===e.position?{timestamp:performance.now()}:null}(i,a),l=(0,K.Z)({},{rebuffering:s,freezing:u,internalSeeking:o},a);return C.Z.debug("API: current media element state",l),l},o=Cn.map((function(t){return(0,ct.R)(e._mediaElement,t).pipe((0,s.U)((function(){return t})))})),u=e._lowLatencyMode?r:e._withMediaSource?n:i,l=(0,lt.F)(u).pipe((0,s.U)((function(){return"timeupdate"})));return E.T.apply(void 0,[l].concat(o)).pipe((0,s.U)((function(t){var n=a(t);return"DEBUG"===C.Z.getLevel()&&C.Z.debug("API: current playback timeline:\n"+function(e,t){for(var n="",r="",i=0;i<e.length;i++){var a=e.start(i),o=e.end(i),s=a.toFixed(2),u=o.toFixed(2),l=s+"|=="+(o-a).toFixed(2)+"==|"+u;if(n+=l,0===r.length&&o>t){var c=n.length-Math.floor(l.length/2);r=" ".repeat(c)+"^"+t}if(i<e.length-1){var d=e.start(i+1),f=" ~"+(d-o).toFixed(2)+"~ ";if(n+=f,0===r.length&&t<d){var p=n.length-Math.floor(f.length/2);r=" ".repeat(p)+"^"+t}}}0===r.length&&(r=" ".repeat(n.length)+"^"+t);return n+"\n"+r}(n.buffered,n.position),"\n"+t),e._lastObservation=n,n})))}))},t._generateInitialObservation=function(){return(0,K.Z)(Nn(this._mediaElement,"init"),{rebuffering:null,freezing:null,internalSeeking:!1})},e}();function Dn(e,t){if(null===e)return 0;var n=t?"LOW_LATENCY":"DEFAULT",r=D.Z.getCurrent(),i=r.RESUME_GAP_AFTER_SEEKING,a=r.RESUME_GAP_AFTER_NOT_ENOUGH_DATA,o=r.RESUME_GAP_AFTER_BUFFERING;switch(e.reason){case"seeking":return i[n];case"not-ready":return a[n];case"buffering":return o[n]}}function Nn(e,t){var n=e.buffered,r=e.currentTime,i=e.duration,a=e.ended,o=e.paused,s=e.playbackRate,u=e.readyState,l=e.seeking,c=(0,G.rx)(n,r);return{bufferGap:null!==c?c.end-r:1/0,buffered:n,currentRange:c,position:r,duration:i,ended:a,paused:o,playbackRate:s,readyState:u,seeking:l,event:t}}function On(e,t){var n=(0,p.P)((function(){return t(e.observe(!0))})).pipe((0,d.d)({bufferSize:1,refCount:!0}));return{getCurrentTime:function(){return e.getCurrentTime()},getReadyState:function(){return e.getReadyState()},observe:function(e){return e?n:n.pipe((t=1,(0,m.h)((function(e,n){return t<=n}))));var t},deriveReadOnlyObserver:function(e){return On(this,e)}}}var Ln=n(7829);function Bn(e){return e.map((function(e){return null===e?e:{normalized:void 0===e.language?void 0:(0,Ln.ZP)(e.language),audioDescription:e.audioDescription,codec:e.codec}}))}function Un(e){return e.map((function(e){return null===e?e:{normalized:(0,Ln.ZP)(e.language),closedCaption:e.closedCaption}}))}var Fn=function(){function e(e){this._periods=new Tt((function(e,t){return e.period.start-t.period.start})),this._audioChoiceMemory=new WeakMap,this._textChoiceMemory=new WeakMap,this._videoChoiceMemory=new WeakMap,this._preferredAudioTracks=[],this._preferredTextTracks=[],this._preferredVideoTracks=[],this.trickModeTrackEnabled=e.preferTrickModeTracks}var t=e.prototype;return t.setPreferredAudioTracks=function(e,t){this._preferredAudioTracks=e,t&&this._applyAudioPreferences()},t.setPreferredTextTracks=function(e,t){this._preferredTextTracks=e,t&&this._applyTextPreferences()},t.setPreferredVideoTracks=function(e,t){this._preferredVideoTracks=e,t&&this._applyVideoPreferences()},t.addPeriod=function(e,t,n){var r=jn(this._periods,t),i=t.getSupportedAdaptations(e);if(void 0!==r){if(void 0!==r[e])return void C.Z.warn("TrackChoiceManager: "+e+" already added for period",t.start);r[e]={adaptations:i,adaptation$:n}}else{var a;this._periods.add(((a={period:t})[e]={adaptations:i,adaptation$:n},a))}},t.removePeriod=function(e,t){var n=function(e,t){for(var n=0;n<e.length();n++){if(e.get(n).period.id===t.id)return n}}(this._periods,t);if(void 0!==n){var r=this._periods.get(n);void 0!==r[e]?(delete r[e],void 0===r.audio&&void 0===r.text&&void 0===r.video&&this._periods.removeElement(r)):C.Z.warn("TrackChoiceManager: "+e+" already removed for period",t.start)}else C.Z.warn("TrackChoiceManager: "+e+" not found for period",t.start)},t.resetPeriods=function(){for(;this._periods.length()>0;)this._periods.pop()},t.update=function(){this._resetChosenAudioTracks(),this._resetChosenTextTracks(),this._resetChosenVideoTracks()},t.setInitialAudioTrack=function(e){var t=jn(this._periods,e),n=void 0!==t?t.audio:null;if((0,V.Z)(n)||void 0===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,Ee.Z)(r,i))n.adaptation$.next(i);else{var a=Vn(r,Bn(this._preferredAudioTracks));this._audioChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialTextTrack=function(e){var t=jn(this._periods,e),n=void 0!==t?t.text:null;if((0,V.Z)(n)||void 0===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,Ee.Z)(r,i))n.adaptation$.next(i);else{var a=Gn(r,Un(this._preferredTextTracks));this._textChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialVideoTrack=function(e){var t=jn(this._periods,e),n=void 0!==t?t.video:null;if((0,V.Z)(n)||void 0===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,Ee.Z)(i,a.baseAdaptation))r=a.baseAdaptation;else{r=Wn(i,this._preferredVideoTracks)}if(null===r)return this._videoChoiceMemory.set(e,null),void n.adaptation$.next(null);var o=$n(r,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:r,adaptation:o}),n.adaptation$.next(o)},t.setAudioTrackByID=function(e,t){var n=jn(this._periods,e),r=void 0!==n?n.audio:null;if((0,V.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,Be.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=jn(this._periods,e),r=void 0!==n?n.text:null;if((0,V.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,Be.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=jn(this._periods,e),r=void 0!==n?n.video:null;if((0,V.Z)(r))throw new Error("LanguageManager: Given Period not found.");var i=(0,Be.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Video Track not found.");var a=$n(i,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:i,adaptation:a}),r.adaptation$.next(a)},t.disableTextTrack=function(e){var t=jn(this._periods,e),n=void 0!==t?t.text:null;if((0,V.Z)(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=jn(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=jn(this._periods,e),n=void 0!==t?t.audio:null;if((0,V.Z)(n))return null;var r=this._audioChoiceMemory.get(e);if((0,V.Z)(r))return null;var i={language:(0,Me.Z)(r.language,""),normalized:(0,Me.Z)(r.normalizedLanguage,""),audioDescription:!0===r.isAudioDescription,id:r.id,representations:r.representations.map(Yn)};return!0===r.isDub&&(i.dub=!0),i},t.getChosenTextTrack=function(e){var t=jn(this._periods,e),n=void 0!==t?t.text:null;if((0,V.Z)(n))return null;var r=this._textChoiceMemory.get(e);return(0,V.Z)(r)?null:{language:(0,Me.Z)(r.language,""),normalized:(0,Me.Z)(r.normalizedLanguage,""),closedCaption:!0===r.isClosedCaption,id:r.id}},t.getChosenVideoTrack=function(e){var t=jn(this._periods,e),n=void 0!==t?t.video:null;if((0,V.Z)(n))return null;var r=this._videoChoiceMemory.get(e);if((0,V.Z)(r))return null;var i=r.adaptation,a=void 0!==i.trickModeTracks?i.trickModeTracks.map((function(e){var t=e.representations.map(qn),n={id:e.id,representations:t,isTrickModeTrack:!0};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),n})):void 0,o={id:i.id,representations:i.representations.map(qn)};return!0===i.isSignInterpreted&&(o.signInterpreted=!0),!0===i.isTrickModeTrack&&(o.isTrickModeTrack=!0),void 0!==a&&(o.trickModeTracks=a),o},t.getAvailableAudioTracks=function(e){var t=jn(this._periods,e),n=void 0!==t?t.audio:null;if((0,V.Z)(n))return[];var r=this._audioChoiceMemory.get(e),i=(0,V.Z)(r)?null:r.id;return n.adaptations.map((function(e){var t={language:(0,Me.Z)(e.language,""),normalized:(0,Me.Z)(e.normalizedLanguage,""),audioDescription:!0===e.isAudioDescription,id:e.id,active:null!==i&&i===e.id,representations:e.representations.map(Yn)};return!0===e.isDub&&(t.dub=!0),t}))},t.getAvailableTextTracks=function(e){var t=jn(this._periods,e),n=void 0!==t?t.text:null;if((0,V.Z)(n))return[];var r=this._textChoiceMemory.get(e),i=(0,V.Z)(r)?null:r.id;return n.adaptations.map((function(e){return{language:(0,Me.Z)(e.language,""),normalized:(0,Me.Z)(e.normalizedLanguage,""),closedCaption:!0===e.isClosedCaption,id:e.id,active:null!==i&&i===e.id}}))},t.getAvailableVideoTracks=function(e){var t,n=jn(this._periods,e),r=void 0!==n?n.video:null;if((0,V.Z)(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(qn),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(qn)};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=Bn(this._preferredAudioTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,V.Z)(i.audio))n(r+1);else{var a=i.period,o=i.audio,s=a.getSupportedAdaptations("audio"),u=e._audioChoiceMemory.get(a);if(null===u||void 0!==u&&(0,Ee.Z)(s,u))n(r+1);else{var l=Vn(s,t);e._audioChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenTextTracks=function(){var e=this,t=Un(this._preferredTextTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,V.Z)(i.text))n(r+1);else{var a=i.period,o=i.text,s=a.getSupportedAdaptations("text"),u=e._textChoiceMemory.get(a);if(null===u||void 0!==u&&(0,Ee.Z)(s,u))n(r+1);else{var l=Gn(s,t);e._textChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(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((0,V.Z)(i.video))n(r+1);else{var a=i.period,o=i.video,s=a.getSupportedAdaptations("video"),u=e._videoChoiceMemory.get(a);if(null!==u){if(void 0!==u&&(0,Ee.Z)(s,u.baseAdaptation)){var l=$n(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 c=Wn(s,t);if(null===c)return e._videoChoiceMemory.set(a,null),o.adaptation$.next(null),n(0);var d=$n(c,e.trickModeTrackEnabled);return e._videoChoiceMemory.set(a,{baseAdaptation:c,adaptation:d}),o.adaptation$.next(d),n(0)}n(r+1)}}}(0)},e}();function zn(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 Vn(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=zn(r),a=(0,Be.Z)(e,i);if(void 0!==a)return a}return e[0]}function Kn(e){return function(t){return(0,Me.Z)(t.normalizedLanguage,"")===e.normalized&&(e.closedCaption?!0===t.isClosedCaption:!0!==t.isClosedCaption)}}function Gn(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=Kn(r),a=(0,Be.Z)(e,i);if(void 0!==a)return a}return null}function Hn(e){return function(t){if(void 0!==e.signInterpreted&&e.signInterpreted!==t.isSignInterpreted)return!1;if(void 0===e.codec)return!0;var n=e.codec.test,r=function(e){return void 0!==e.codec&&n.test(e.codec)};return e.codec.all?t.representations.every(r):t.representations.some(r)}}function Wn(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=Hn(r),a=(0,Be.Z)(e,i);if(void 0!==a)return a}return e[0]}function jn(e,t){for(var n=0;n<e.length();n++){var r=e.get(n);if(r.period.id===t.id)return r}}function qn(e){return{id:e.id,bitrate:e.bitrate,frameRate:e.frameRate,width:e.width,height:e.height,codec:e.codec,hdrInfo:e.hdrInfo}}function Yn(e){return{id:e.id,bitrate:e.bitrate,codec:e.codec}}function $n(e,t){var n;return t&&void 0!==(null===(n=e.trickModeTracks)||void 0===n?void 0:n[0])?e.trickModeTracks[0]:e}var Xn=x.Nh,Qn=x._K,Jn=x.C1,er=x.Q1,tr=x.Qt,nr=x.yj,rr=x.d5,ir=x.UA,ar=x.$x,or=function(n){function r(e){var t;void 0===e&&(e={}),t=n.call(this)||this;var r=function(e){var t,n,r,i,a,o,s,u,l,c,d,f,p,v,h,m,g=D.Z.getCurrent(),y=g.DEFAULT_INITIAL_BITRATES,_=g.DEFAULT_LIMIT_VIDEO_WIDTH,b=g.DEFAULT_MIN_BITRATES,T=g.DEFAULT_MAX_BITRATES,E=g.DEFAULT_MAX_BUFFER_AHEAD,S=g.DEFAULT_MAX_BUFFER_BEHIND,w=g.DEFAULT_MAX_VIDEO_BUFFER_SIZE,k=g.DEFAULT_STOP_AT_END,A=g.DEFAULT_THROTTLE_WHEN_HIDDEN,x=g.DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN,I=g.DEFAULT_WANTED_BUFFER_AHEAD;if((0,V.Z)(e.maxBufferAhead))t=E;else if(t=Number(e.maxBufferAhead),isNaN(t))throw new Error("Invalid maxBufferAhead parameter. Should be a number.");if((0,V.Z)(e.maxBufferBehind))n=S;else if(n=Number(e.maxBufferBehind),isNaN(n))throw new Error("Invalid maxBufferBehind parameter. Should be a number.");if((0,V.Z)(e.wantedBufferAhead))r=I;else if(r=Number(e.wantedBufferAhead),isNaN(r))throw new Error("Invalid wantedBufferAhead parameter. Should be a number.");if((0,V.Z)(e.maxVideoBufferSize))i=w;else if(i=Number(e.maxVideoBufferSize),isNaN(i))throw new Error("Invalid maxVideoBufferSize parameter. Should be a number.");var Z=(0,V.Z)(e.limitVideoWidth)?_:!!e.limitVideoWidth;if((0,V.Z)(e.throttleWhenHidden)?a=A:((0,W.Z)("`throttleWhenHidden` API is deprecated. Consider using `throttleVideoBitrateWhenHidden` instead."),a=!!e.throttleWhenHidden),o=!a&&((0,V.Z)(e.throttleVideoBitrateWhenHidden)?x:!!e.throttleVideoBitrateWhenHidden),void 0!==e.preferredTextTracks?Array.isArray(e.preferredTextTracks)?u=e.preferredTextTracks:((0,W.Z)("Invalid `preferredTextTracks` option, it should be an Array"),u=[]):u=[],void 0!==e.preferredAudioTracks?Array.isArray(e.preferredAudioTracks)?s=e.preferredAudioTracks:((0,W.Z)("Invalid `preferredAudioTracks` option, it should be an Array"),s=[]):s=[],void 0!==e.preferredVideoTracks?Array.isArray(e.preferredVideoTracks)?l=e.preferredVideoTracks:((0,W.Z)("Invalid `preferredVideoTracks` option, it should be an Array"),l=[]):l=[],(0,V.Z)(e.videoElement))c=document.createElement("video");else{if(!(e.videoElement instanceof HTMLMediaElement))throw new Error("Invalid videoElement parameter. Should be a HTMLMediaElement.");c=e.videoElement}if((0,V.Z)(e.initialVideoBitrate))d=y.video;else if(d=Number(e.initialVideoBitrate),isNaN(d))throw new Error("Invalid initialVideoBitrate parameter. Should be a number.");if((0,V.Z)(e.initialAudioBitrate))f=y.audio;else if(f=Number(e.initialAudioBitrate),isNaN(f))throw new Error("Invalid initialAudioBitrate parameter. Should be a number.");if((0,V.Z)(e.minVideoBitrate))v=b.video;else if(v=Number(e.minVideoBitrate),isNaN(v))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if((0,V.Z)(e.minAudioBitrate))p=b.audio;else if(p=Number(e.minAudioBitrate),isNaN(p))throw new Error("Invalid minAudioBitrate parameter. Should be a number.");if((0,V.Z)(e.maxVideoBitrate))m=T.video;else{if(m=Number(e.maxVideoBitrate),isNaN(m))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if(v>m)throw new Error('Invalid maxVideoBitrate parameter. Its value, "'+m+'", is inferior to the set minVideoBitrate, "'+v+'"')}if((0,V.Z)(e.maxAudioBitrate))h=T.audio;else{if(h=Number(e.maxAudioBitrate),isNaN(h))throw new Error("Invalid maxAudioBitrate parameter. Should be a number.");if(p>h)throw new Error('Invalid maxAudioBitrate parameter. Its value, "'+h+'", is inferior to the set minAudioBitrate, "'+p+'"')}return{maxBufferAhead:t,maxBufferBehind:n,limitVideoWidth:Z,videoElement:c,wantedBufferAhead:r,maxVideoBufferSize:i,throttleWhenHidden:a,throttleVideoBitrateWhenHidden:o,preferredAudioTracks:s,preferredTextTracks:u,preferredVideoTracks:l,initialAudioBitrate:f,initialVideoBitrate:d,minAudioBitrate:p,minVideoBitrate:v,maxAudioBitrate:h,maxVideoBitrate:m,stopAtEnd:(0,V.Z)(e.stopAtEnd)?k:!!e.stopAtEnd}}(e),l=r.initialAudioBitrate,c=r.initialVideoBitrate,d=r.limitVideoWidth,f=r.minAudioBitrate,p=r.minVideoBitrate,v=r.maxAudioBitrate,h=r.maxBufferAhead,m=r.maxBufferBehind,g=r.maxVideoBitrate,y=r.preferredAudioTracks,_=r.preferredTextTracks,b=r.preferredVideoTracks,T=r.throttleWhenHidden,E=r.throttleVideoBitrateWhenHidden,S=r.videoElement,w=r.wantedBufferAhead,k=r.maxVideoBufferSize,A=r.stopAtEnd,x=D.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;return S.preload="auto",t.version="3.27.0",t.log=C.Z,t.state="STOPPED",t.videoElement=S,t._priv_destroy$=new i.x,t._priv_pictureInPictureEvent$=new a.t(1),nr(S).pipe((0,o.R)(t._priv_destroy$)).subscribe(t._priv_pictureInPictureEvent$),er(S).pipe((0,o.R)(t._priv_destroy$)).subscribe((function(){return t.trigger("fullscreenChange",t.isFullscreen())})),ir(S.textTracks).pipe((0,o.R)(t._priv_destroy$),(0,s.U)((function(e){for(var t=e.target,n=[],r=0;r<t.length;r++){var i=t[r];n.push(i)}return n})),(0,u.x)((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}))).subscribe((function(e){return t._priv_onNativeTextTracksNext(e)})),t._priv_isPlaying=(0,H.Z)(!1),t._priv_speed=(0,H.Z)(S.playbackRate),t._priv_preferTrickModeTracks=!1,t._priv_contentLock=(0,H.Z)(!1),t._priv_bufferOptions={wantedBufferAhead:(0,H.Z)(w),maxBufferAhead:(0,H.Z)(h),maxBufferBehind:(0,H.Z)(m),maxVideoBufferSize:(0,H.Z)(k)},t._priv_bitrateInfos={lastBitrates:{audio:l,video:c},minAutoBitrates:{audio:(0,H.Z)(f),video:(0,H.Z)(p)},maxAutoBitrates:{audio:(0,H.Z)(v),video:(0,H.Z)(g)},manualBitrates:{audio:(0,H.Z)(-1),video:(0,H.Z)(-1)}},t._priv_throttleWhenHidden=T,t._priv_throttleVideoBitrateWhenHidden=E,t._priv_limitVideoWidth=d,t._priv_mutedMemory=x,t._priv_trackChoiceManager=null,t._priv_mediaElementTrackChoiceManager=null,t._priv_currentError=null,t._priv_contentInfos=null,t._priv_contentEventsMemory={},t._priv_stopAtEnd=A,t._priv_setPlayerState(bn),t._priv_preferredAudioTracks=y,t._priv_preferredTextTracks=_,t._priv_preferredVideoTracks=b,t._priv_lastContentPlaybackInfos={},t}(0,t.Z)(r,n);var f=r.prototype;return f.stop=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this.state!==bn&&this._priv_setPlayerState(bn)},f.dispose=function(){this.stop(),null!==this.videoElement&&Q(this.videoElement).catch((function(e){var t=e instanceof Error?e.message:"Unknown error";C.Z.error("API: Could not dispose decryption resources: "+t)})),this._priv_destroy$.next(),this._priv_destroy$.complete(),this._priv_pictureInPictureEvent$.complete(),this._priv_isPlaying.finish(),this._priv_speed.finish(),this._priv_contentLock.finish(),this._priv_bufferOptions.wantedBufferAhead.finish(),this._priv_bufferOptions.maxVideoBufferSize.finish(),this._priv_bufferOptions.maxBufferAhead.finish(),this._priv_bufferOptions.maxBufferBehind.finish(),this._priv_bitrateInfos.manualBitrates.video.finish(),this._priv_bitrateInfos.manualBitrates.audio.finish(),this._priv_bitrateInfos.minAutoBitrates.video.finish(),this._priv_bitrateInfos.minAutoBitrates.audio.finish(),this._priv_bitrateInfos.maxAutoBitrates.video.finish(),this._priv_bitrateInfos.maxAutoBitrates.audio.finish(),this._priv_lastContentPlaybackInfos={},this.videoElement=null},f.loadVideo=function(e){var t=function(e){var t,n,r,i,a,o,s,u,l,c,d,f,p=D.Z.getCurrent(),v=p.DEFAULT_AUDIO_TRACK_SWITCHING_MODE,h=p.DEFAULT_AUTO_PLAY,m=p.DEFAULT_CODEC_SWITCHING_BEHAVIOR,g=p.DEFAULT_ENABLE_FAST_SWITCHING,y=p.DEFAULT_MANUAL_BITRATE_SWITCHING_MODE,_=p.DEFAULT_SHOW_NATIVE_SUBTITLE,b=p.DEFAULT_TEXT_TRACK_MODE;if((0,V.Z)(e))throw new Error("No option set on loadVideo");if((0,V.Z)(e.url)){if((0,V.Z)(null===(t=e.transportOptions)||void 0===t?void 0:t.initialManifest)&&(0,V.Z)(null===(n=e.transportOptions)||void 0===n?void 0:n.manifestLoader))throw new Error("Unable to load a content: no url set on loadVideo.\nPlease provide at least either an `url` argument, a `transportOptions.initialManifest` option or a `transportOptions.manifestLoader` option so the RxPlayer can load the content.")}else s=String(e.url);if((0,V.Z)(e.transport))throw new Error("No transport set on loadVideo");u=String(e.transport);var T=(0,V.Z)(e.autoPlay)?h:!!e.autoPlay;if((0,V.Z)(e.keySystems))l=[];else for(var E,S=Rn(l=Array.isArray(e.keySystems)?e.keySystems:[e.keySystems]);!(E=S()).done;){var w=E.value;if("string"!=typeof w.type||"function"!=typeof w.getLicense)throw new Error("Invalid key system given: Missing type string or getLicense callback")}var k=void 0!==e.lowLatencyMode&&!!e.lowLatencyMode,A="object"==typeof e.transportOptions&&null!==e.transportOptions?e.transportOptions:{},x=null===(r=e.transportOptions)||void 0===r?void 0:r.initialManifest,I=null!==(a=null===(i=e.transportOptions)||void 0===i?void 0:i.minimumManifestUpdateInterval)&&void 0!==a?a:0,Z=(0,V.Z)(e.audioTrackSwitchingMode)?v:e.audioTrackSwitchingMode;(0,Ee.Z)(["seamless","direct","reload"],Z)||(C.Z.warn("The `audioTrackSwitchingMode` loadVideo option must match one of the following strategy name:\n- `seamless`\n- `direct`\n- `reload`\nIf badly set, "+v+" strategy will be used as default"),Z=v);var R=(0,V.Z)(e.onCodecSwitch)?m:e.onCodecSwitch;(0,Ee.Z)(["continue","reload"],R)||(C.Z.warn("The `onCodecSwitch` loadVideo option must match one of the following string:\n- `continue`\n- `reload`\nIf badly set, "+m+" will be used as default"),R=m);var M=(0,K.Z)({},A,{supplementaryImageTracks:[],supplementaryTextTracks:[],lowLatencyMode:k});if(delete M.initialManifest,delete M.minimumManifestUpdateInterval,void 0!==e.supplementaryTextTracks){(0,W.Z)("The `supplementaryTextTracks` loadVideo option is deprecated.\nPlease use the `TextTrackRenderer` tool instead.");for(var P,N=Array.isArray(e.supplementaryTextTracks)?e.supplementaryTextTracks:[e.supplementaryTextTracks],O=Rn(N);!(P=O()).done;){var L=P.value;if("string"!=typeof L.language||"string"!=typeof L.mimeType||"string"!=typeof L.url)throw new Error("Invalid supplementary text track given. Missing either language, mimetype or url")}M.supplementaryTextTracks=N}if(void 0!==e.supplementaryImageTracks){(0,W.Z)("The `supplementaryImageTracks` loadVideo option is deprecated.\nPlease use the `parseBifThumbnails` tool instead.");for(var B,U=Array.isArray(e.supplementaryImageTracks)?e.supplementaryImageTracks:[e.supplementaryImageTracks],F=Rn(U);!(B=F()).done;){var z=B.value;if("string"!=typeof z.mimeType||"string"!=typeof z.url)throw new Error("Invalid supplementary image track given. Missing either mimetype or url")}M.supplementaryImageTracks=U}if((0,V.Z)(e.textTrackMode))c=b;else{if("native"!==e.textTrackMode&&"html"!==e.textTrackMode)throw new Error("Invalid textTrackMode.");c=e.textTrackMode}(0,V.Z)(e.defaultAudioTrack)||(0,W.Z)("The `defaultAudioTrack` loadVideo option is deprecated.\nPlease use the `preferredAudioTracks` constructor option or the`setPreferredAudioTracks` method instead");var G=(0,Zn.iH)(e.defaultAudioTrack);(0,V.Z)(e.defaultTextTrack)||(0,W.Z)("The `defaultTextTrack` loadVideo option is deprecated.\nPlease use the `preferredTextTracks` constructor option or the`setPreferredTextTracks` method instead");var H=(0,Zn.Y1)(e.defaultTextTrack),j=!_;(0,V.Z)(e.hideNativeSubtitle)||((0,W.Z)("The `hideNativeSubtitle` loadVideo option is deprecated"),j=!!e.hideNativeSubtitle);var q=null!==(o=e.manualBitrateSwitchingMode)&&void 0!==o?o:y,Y=(0,V.Z)(e.enableFastSwitching)?g:e.enableFastSwitching;if("html"===c){if((0,V.Z)(e.textTrackElement))throw new Error('You have to provide a textTrackElement in "html" textTrackMode.');if(!(e.textTrackElement instanceof HTMLElement))throw new Error("textTrackElement should be an HTMLElement.");d=e.textTrackElement}else(0,V.Z)(e.textTrackElement)||C.Z.warn('API: You have set a textTrackElement without being in an "html" textTrackMode. It will be ignored.');if(!(0,V.Z)(e.startAt))if(e.startAt.wallClockTime instanceof Date){var $=e.startAt.wallClockTime.getTime()/1e3;f=(0,K.Z)({},e.startAt,{wallClockTime:$})}else f=e.startAt;return{autoPlay:T,defaultAudioTrack:G,defaultTextTrack:H,enableFastSwitching:Y,hideNativeSubtitle:j,keySystems:l,initialManifest:x,lowLatencyMode:k,manualBitrateSwitchingMode:q,audioTrackSwitchingMode:Z,minimumManifestUpdateInterval:I,networkConfig:(0,V.Z)(e.networkConfig)?{}:{manifestRetry:e.networkConfig.manifestRetry,offlineRetry:e.networkConfig.offlineRetry,segmentRetry:e.networkConfig.segmentRetry},onCodecSwitch:R,startAt:f,textTrackElement:d,textTrackMode:c,transport:u,transportOptions:M,url:s}}(e);C.Z.info("API: Calling loadvideo",t),this._priv_lastContentPlaybackInfos={options:t},this._priv_initializeContentPlayback(t)},f.reload=function(e){var t,n=this._priv_lastContentPlaybackInfos,r=n.options,i=n.manifest,a=n.lastPlaybackPosition;if(void 0===r||void 0===i||void 0===a)throw new Error("API: Can't reload without having previously loaded a content.");if(function(e){var t,n,r,i;if(null===e||"object"!=typeof e&&void 0!==e)throw new Error("API: reload - Invalid options format.");if(null===(null==e?void 0:e.reloadAt)||"object"!=typeof(null==e?void 0:e.reloadAt)&&void 0!==(null==e?void 0:e.reloadAt))throw new Error("API: reload - Invalid 'reloadAt' option format.");if("number"!=typeof(null===(t=null==e?void 0:e.reloadAt)||void 0===t?void 0:t.position)&&void 0!==(null===(n=null==e?void 0:e.reloadAt)||void 0===n?void 0:n.position))throw new Error("API: reload - Invalid 'reloadAt.position' option format.");if("number"!=typeof(null===(r=null==e?void 0:e.reloadAt)||void 0===r?void 0:r.relative)&&void 0!==(null===(i=null==e?void 0:e.reloadAt)||void 0===i?void 0:i.relative))throw new Error("API: reload - Invalid 'reloadAt.relative' option format.")}(e),void 0!==e&&void 0!==e.reloadAt&&void 0!==e.reloadAt.position)t=e.reloadAt.position;else{var o;if("STOPPED"===this.state||"ENDED"===this.state)o=a;else{if(null===this.videoElement)throw new Error("Can't reload when video element does not exist.");o=this.videoElement.currentTime}t=void 0!==e&&void 0!==e.reloadAt&&void 0!==e.reloadAt.relative?e.reloadAt.relative+o:o}var s=Object.assign(Object.assign({},r),{initialManifest:i});s.startAt={position:t},this._priv_initializeContentPlayback(s)},f._priv_initializeContentPlayback=function(e){var t,n,r,a=this,f=e.autoPlay,v=e.audioTrackSwitchingMode,x=e.defaultAudioTrack,I=e.defaultTextTrack,Z=e.enableFastSwitching,R=e.initialManifest,M=e.keySystems,N=e.lowLatencyMode,O=e.manualBitrateSwitchingMode,L=e.minimumManifestUpdateInterval,F=e.networkConfig,z=e.onCodecSwitch,V=e.startAt,G=e.transport,H=e.transportOptions,W=e.url;if(null===this.videoElement)throw new Error("the attached video element is disposed");var j,q="directfile"===G,Y=new i.x,$={url:W,stop$:Y,isDirectFile:q,segmentBuffersStore:null,thumbnails:null,manifest:null,currentPeriod:null,activeAdaptations:null,activeRepresentations:null,initialAudioTrack:x,initialTextTrack:I},X=this.videoElement,Q=new Pn(X,{withMediaSource:!q,lowLatencyMode:N});if(q){if(this.stop(),this._priv_currentError=null,this._priv_isPlaying.setValue(!1),null===B.Z.directfile)throw new Error("DirectFile feature not activated in your build.");this._priv_contentInfos=$,this._priv_mediaElementTrackChoiceManager=new B.Z.directfile.mediaElementTrackChoiceManager(this.videoElement);var J=void 0===x?this._priv_preferredAudioTracks:[x];this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(J,!0);var ee=void 0===I?this._priv_preferredTextTracks:[I];this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(ee,!0),this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),this.trigger("availableAudioTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableAudioTracks()),this.trigger("availableVideoTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableVideoTracks()),this.trigger("availableTextTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableTextTracks()),this.trigger("audioTrackChange",null!==(t=this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack())&&void 0!==t?t:null),this.trigger("textTrackChange",null!==(n=this._priv_mediaElementTrackChoiceManager.getChosenTextTrack())&&void 0!==n?n:null),this.trigger("videoTrackChange",null!==(r=this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack())&&void 0!==r?r:null),this._priv_mediaElementTrackChoiceManager.addEventListener("availableVideoTracksChange",(function(e){return a.trigger("availableVideoTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableAudioTracksChange",(function(e){return a.trigger("availableAudioTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableTextTracksChange",(function(e){return a.trigger("availableTextTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("audioTrackChange",(function(e){return a.trigger("audioTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("videoTrackChange",(function(e){return a.trigger("videoTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("textTrackChange",(function(e){return a.trigger("textTrackChange",e)}));var te=B.Z.directfile.initDirectFile({autoPlay:f,keySystems:M,mediaElement:X,speed:this._priv_speed,playbackObserver:Q,startAt:V,url:W}).pipe((0,o.R)(Y));j=h(te,{connector:function(){return new i.x},resetOnDisconnect:!1})}else{var ne=B.Z.transports[G];if("function"!=typeof ne)throw this.stop(),this._priv_currentError=null,this._priv_isPlaying.setValue(!1),new Error('transport "'+G+'" not supported');var re,ie=ne(H),ae=F.offlineRetry,oe=F.segmentRetry,se=F.manifestRetry,ue=new ye(W,ie,{lowLatencyMode:N,maxRetryRegular:se,maxRetryOffline:ae}),le=new Ae(ie,{lowLatencyMode:N,maxRetryOffline:ae,maxRetryRegular:oe});(re=(re=R instanceof U.ZP?(0,l.of)({type:"parsed",manifest:R}):void 0!==R?ue.parse(R,{previousManifest:null,unsafeMode:!1}):ue.fetch(W).pipe((0,c.z)((function(e){return"warning"===e.type?(0,l.of)(e):e.parse({previousManifest:null,unsafeMode:!1})})))).pipe((0,o.R)(Y),(0,d.d)())).subscribe(),this.stop(),this._priv_currentError=null,this._priv_isPlaying.setValue(!1),this._priv_contentInfos=$;var ce=P(),de={throttle:{},throttleBitrate:{},limitWidth:{}};this._priv_throttleWhenHidden&&(ce?de.throttle={video:Xn().pipe((0,s.U)((function(e){return e?1/0:0})),(0,o.R)(Y))}:C.Z.warn("API: Can't apply throttleWhenHidden because browser can't be trusted for visibility.")),this._priv_throttleVideoBitrateWhenHidden&&(ce?de.throttleBitrate={video:Qn(this._priv_pictureInPictureEvent$).pipe((0,s.U)((function(e){return e?1/0:0})),(0,o.R)(Y))}:C.Z.warn("API: Can't apply throttleVideoBitrateWhenHidden because browser can't be trusted for visibility.")),this._priv_limitVideoWidth&&(ce?de.limitWidth={video:ar(X,this._priv_pictureInPictureEvent$).pipe((0,o.R)(Y))}:C.Z.warn("API: Can't apply limitVideoWidth because browser can't be trusted for video size."));var fe={initialBitrates:this._priv_bitrateInfos.lastBitrates,lowLatencyMode:N,manualBitrates:this._priv_bitrateInfos.manualBitrates,minAutoBitrates:this._priv_bitrateInfos.minAutoBitrates,maxAutoBitrates:this._priv_bitrateInfos.maxAutoBitrates,throttlers:de},pe="native"===e.textTrackMode?{textTrackMode:"native",hideNativeSubtitle:e.hideNativeSubtitle}:{textTrackMode:"html",textTrackElement:e.textTrackElement},ve=(0,K.Z)({audioTrackSwitchingMode:v,enableFastSwitching:Z,manualBitrateSwitchingMode:O,onCodecSwitch:z},this._priv_bufferOptions),he=_n({adaptiveOptions:fe,autoPlay:f,bufferOptions:ve,playbackObserver:Q,keySystems:M,lowLatencyMode:N,manifest$:re,manifestFetcher:ue,mediaElement:X,minimumManifestUpdateInterval:L,segmentFetcherCreator:le,speed:this._priv_speed,startAt:V,textTrackOptions:pe}).pipe((0,o.R)(Y));j=h(he,{connector:function(){return new i.x},resetOnDisconnect:!1})}var me,ge=j.pipe((0,m.h)((function(e){return"stalled"===e.type||"unstalled"===e.type})),(0,s.U)((function(e){return e.value})),(0,u.x)((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e===t}))),_e=j.pipe((0,m.h)((function(e){return"loaded"===e.type})),(0,g.B)()),be=j.pipe((0,m.h)((function(e){return"reloading-media-source"===e.type})),(0,g.B)()),Te=Jn(X),Ee=rr(X),Se=(0,y.a)([this._priv_isPlaying.asObservable(),ge.pipe((0,_.O)(null)),Te.pipe((0,_.O)(null)),Ee.pipe((0,_.O)(null))]).pipe((0,o.R)(Y),(0,s.U)((function(e){var t=e[0],n=e[1];return function(e,t,n){var r=D.Z.getCurrent().FORCED_ENDED_THRESHOLD;if(e.ended)return kn;if(null!==n){var i=Math.abs(e.duration-e.currentTime);return null!=r&&i<r?kn:"seeking"===n?xn:An}return t?Sn:wn}(X,t,n)}))),we=(0,b.z)((0,l.of)(En),_e.pipe((0,T.w)((function(e,t){var n,r=0===t;return(0,E.T)(be.pipe((0,s.U)((function(){return In}))),r?(0,l.of)(Tn):S.E,Se.pipe((0,o.R)(be),(n=function(e){return r&&e===wn},(0,w.e)((function(e,t){var r=!1,i=0;e.subscribe(new k.Q(t,(function(e){return(r||(r=!n(e,i++)))&&t.next(e)})))})))))})))).pipe((0,u.x)());Y.pipe((0,A.q)(1)).subscribe((function(){void 0!==me&&me.unsubscribe()})),tr(X).pipe((0,o.R)(Y)).subscribe((function(e){return a._priv_onPlayPauseNext("play"===e.type)}));var ke=Q.observe(!0);ke.pipe((0,o.R)(Y)).subscribe((function(e){return a._priv_triggerPositionUpdate(e)})),_e.pipe((0,T.w)((function(){return function(e,t){return(0,p.P)((function(){if(null===e)return S.E;var n=t.pipe((0,m.h)((function(e){return"seeking"===e.event})),(0,s.U)((function(){return"seeking"})));e.seeking&&(n=n.pipe((0,_.O)("seeking")));var r=n.pipe((0,T.w)((function(){return t.pipe((0,m.h)((function(e){return"seeked"===e.event})),(0,s.U)((function(){return"seeked"})),(0,A.q)(1))})));return(0,E.T)(n,r)}))}(a.videoElement,ke)})),(0,o.R)(Y)).subscribe((function(e){C.Z.info('API: Triggering "'+e+'" event'),a.trigger(e,null)})),we.pipe((0,o.R)(Y)).subscribe((function(e){return a._priv_setPlayerState(e)})),(this._priv_stopAtEnd?Jn(X):S.E).pipe((0,o.R)(Y)).subscribe((function(){Y.next(),Y.complete()})),j.subscribe({next:function(e){return a._priv_onPlaybackEvent(e)},error:function(e){return a._priv_onPlaybackError(e)},complete:function(){return a._priv_onPlaybackFinished()}}),this._priv_contentLock.asObservable().pipe((0,m.h)((function(e){return!e})),(0,A.q)(1),(0,o.R)(Y)).subscribe((function(){me=j.connect()}))},f.getError=function(){return this._priv_currentError},f.getManifest=function(){return(0,W.Z)("getManifest is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos?null:this._priv_contentInfos.manifest},f.getCurrentAdaptations=function(){if((0,W.Z)("getCurrentAdaptations is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;return null===t||null===n||(0,V.Z)(n[t.id])?null:n[t.id]},f.getCurrentRepresentations=function(){return(0,W.Z)("getCurrentRepresentations is deprecated. Please open an issue if you used this API."),this._priv_getCurrentRepresentations()},f.getVideoElement=function(){return this.videoElement},f.getNativeTextTrack=function(){if((0,W.Z)("getNativeTextTrack is deprecated. Please open an issue if you used this API."),null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return e.textTracks.length>0?e.textTracks[0]:null},f.getPlayerState=function(){return this.state},f.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},f.areTrickModeTracksEnabled=function(){return this._priv_preferTrickModeTracks},f.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}},f.getVideoDuration=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration},f.getVideoBufferGap=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,G.L7)(e.buffered,e.currentTime)},f.getVideoLoadedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,G.at)(e.buffered,e.currentTime)},f.getVideoPlayedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,G.DD)(e.buffered,e.currentTime)},f.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;if(t){var r=I(this.videoElement);return(null!=r?r:0)+this.videoElement.currentTime}return null!==n?this.videoElement.currentTime+(void 0!==n.availabilityStartTime?n.availabilityStartTime:0):0},f.getPosition=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.currentTime},f.getPlaybackRate=function(){return this._priv_speed.getValue()},f.setPlaybackRate=function(e,t){e!==this._priv_speed.getValue()&&this._priv_speed.setValue(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()))},f.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,V.Z)(r.video)?[]:r.video.getAvailableBitrates()},f.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,V.Z)(r.audio)?[]:r.audio.getAvailableBitrates()},f.getManualAudioBitrate=function(){return this._priv_bitrateInfos.manualBitrates.audio.getValue()},f.getManualVideoBitrate=function(){return this._priv_bitrateInfos.manualBitrates.video.getValue()},f.getVideoBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,V.Z)(e.video))return e.video.bitrate},f.getAudioBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,V.Z)(e.audio))return e.audio.bitrate},f.getMinVideoBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.video.getValue()},f.getMinAudioBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.audio.getValue()},f.getMaxVideoBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.video.getValue()},f.getMaxAudioBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.audio.getValue()},f.play=function(){var e=this;if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement.play();return(0,V.Z)(t)||"function"!=typeof t.catch?Promise.resolve():t.catch((function(t){if("NotAllowedError"===t.name){var n=new N.Z("MEDIA_ERR_PLAY_NOT_ALLOWED",t.toString());e.trigger("warning",n)}throw t}))},f.pause=function(){if(null===this.videoElement)throw new Error("Disposed player");this.videoElement.pause()},f.seekTo=function(e){var t;if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)throw new Error("player: no content loaded");var n,r=this._priv_contentInfos,i=r.isDirectFile,a=r.manifest;if(!i&&null===a)throw new Error("player: the content did not load yet");if("number"==typeof e)n=e;else if("object"==typeof e){var o=e,s=this.videoElement.currentTime;if((0,V.Z)(o.relative))if((0,V.Z)(o.position)){if((0,V.Z)(o.wallClockTime))throw new Error('invalid time object. You must set one of the following properties: "relative", "position" or "wallClockTime"');if(null!==a)n=o.wallClockTime-(null!==(t=a.availabilityStartTime)&&void 0!==t?t:0);else if(i&&null!==this.videoElement){var u=I(this.videoElement);void 0!==u&&(n=o.wallClockTime-u)}void 0===n&&(n=o.wallClockTime)}else n=o.position;else n=s+o.relative}if(void 0===n)throw new Error("invalid time given");var l=n;if(null!==a&&!a.isLive){var c=a.getMaximumPosition();l=void 0!==c?Math.min(n,c-.001):n}return this.videoElement.currentTime=l,n},f.isFullscreen=function(){return(0,W.Z)("isFullscreen is deprecated. Fullscreen management should now be managed by the application"),R()},f.setFullscreen=function(e){if(void 0===e&&(e=!0),(0,W.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(!R()){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):Z()},f.exitFullscreen=function(){(0,W.Z)("exitFullscreen is deprecated. Fullscreen management should now be managed by the application"),Z()},f.getVolume=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.volume},f.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))},f.isMute=function(){return 0===this.getVolume()},f.mute=function(){this._priv_mutedMemory=this.getVolume(),this.setVolume(0)},f.unMute=function(){var e=D.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;0===this.getVolume()&&this.setVolume(0===this._priv_mutedMemory?e:this._priv_mutedMemory)},f.setVideoBitrate=function(e){this._priv_bitrateInfos.manualBitrates.video.setValue(e)},f.setAudioBitrate=function(e){this._priv_bitrateInfos.manualBitrates.audio.setValue(e)},f.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.setValue(e)},f.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.setValue(e)},f.setMaxVideoBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.video.getValue();if(e<t)throw new Error('Invalid maximum video bitrate given. Its value, "'+e+'" is inferior the current minimum video birate, "'+t+'".');this._priv_bitrateInfos.maxAutoBitrates.video.setValue(e)},f.setMaxAudioBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.audio.getValue();if(e<t)throw new Error('Invalid maximum audio bitrate given. Its value, "'+e+'" is inferior the current minimum audio birate, "'+t+'".');this._priv_bitrateInfos.maxAutoBitrates.audio.setValue(e)},f.setMaxBufferBehind=function(e){this._priv_bufferOptions.maxBufferBehind.setValue(e)},f.setMaxBufferAhead=function(e){this._priv_bufferOptions.maxBufferAhead.setValue(e)},f.setWantedBufferAhead=function(e){this._priv_bufferOptions.wantedBufferAhead.setValue(e)},f.setMaxVideoBufferSize=function(e){this._priv_bufferOptions.maxVideoBufferSize.setValue(e)},f.getMaxBufferBehind=function(){return this._priv_bufferOptions.maxBufferBehind.getValue()},f.getMaxBufferAhead=function(){return this._priv_bufferOptions.maxBufferAhead.getValue()},f.getWantedBufferAhead=function(){return this._priv_bufferOptions.wantedBufferAhead.getValue()},f.getMaxVideoBufferSize=function(){return this._priv_bufferOptions.maxVideoBufferSize.getValue()},f.getCurrentKeySystem=function(){if(null===this.videoElement)throw new Error("Disposed player");return ee(this.videoElement)},f.getAvailableAudioTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableAudioTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableAudioTracks(r)},f.getAvailableTextTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableTextTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableTextTracks(r)},f.getAvailableVideoTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableVideoTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableVideoTracks(r)},f.getAudioTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenAudioTrack(t)}},f.getTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenTextTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenTextTrack(t)}},f.getVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenVideoTrack(t)}},f.setAudioTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setAudioTrackById(e))}catch(e){throw new Error("player: unknown audio track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setAudioTrackByID(r,e)}catch(e){throw new Error("player: unknown audio track")}},f.setTextTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setTextTrackById(e))}catch(e){throw new Error("player: unknown text track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setTextTrackByID(r,e)}catch(e){throw new Error("player: unknown text track")}},f.disableTextTrack=function(){var e;if(null!==this._priv_contentInfos){var t=this._priv_contentInfos,n=t.currentPeriod;if(t.isDirectFile)null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.disableTextTrack();else if(null!==this._priv_trackChoiceManager&&null!==n)return this._priv_trackChoiceManager.disableTextTrack(n)}},f.setVideoTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setVideoTrackById(e))}catch(e){throw new Error("player: unknown video track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setVideoTrackByID(r,e)}catch(e){throw new Error("player: unknown video track")}},f.disableVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile&&null!==this._priv_mediaElementTrackChoiceManager)return this._priv_mediaElementTrackChoiceManager.disableVideoTrack();if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.disableVideoTrack(t)}},f.getPreferredAudioTracks=function(){return this._priv_preferredAudioTracks},f.getPreferredTextTracks=function(){return this._priv_preferredTextTracks},f.getPreferredVideoTracks=function(){return this._priv_preferredVideoTracks},f.setPreferredAudioTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredAudioTracks` argument. Should have been an Array.");this._priv_preferredAudioTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredAudioTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(e,t)},f.setPreferredTextTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredTextTracks` argument. Should have been an Array.");this._priv_preferredTextTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredTextTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(e,t)},f.setPreferredVideoTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredVideoTracks` argument. Should have been an Array.");this._priv_preferredVideoTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredVideoTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(e,t)},f.getImageTrackData=function(){return(0,W.Z)("`getImageTrackData` is deprecated.Please use the `parseBifThumbnails` tool instead."),null===this._priv_contentInfos?null:this._priv_contentInfos.thumbnails},f.getMinimumPosition=function(){if(null===this._priv_contentInfos)return null;if(this._priv_contentInfos.isDirectFile)return 0;var e=this._priv_contentInfos.manifest;return null!==e?e.getMinimumPosition():null},f.getMaximumPosition=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;if(t){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration}return null!==n?n.getMaximumPosition():null},f.__priv_getSegmentBufferContent=function(e){if(null===this._priv_contentInfos||null===this._priv_contentInfos.segmentBuffersStore)return null;var t=this._priv_contentInfos.segmentBuffersStore.getStatus(e);return"initialized"===t.type?t.value.getInventory():null},f._priv_cleanUpCurrentContentState=function(){var e,t=this;C.Z.debug("Locking `contentLock` to clean-up the current content."),this._priv_contentLock.setValue(!0),this._priv_contentInfos=null,this._priv_trackChoiceManager=null,null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.dispose(),this._priv_mediaElementTrackChoiceManager=null,this._priv_contentEventsMemory={};var n=function(){C.Z.debug("Unlocking `contentLock`. Next content can begin."),t._priv_contentLock.setValue(!1)};(0,V.Z)(this.videoElement)?n():te(this.videoElement).then((function(){C.Z.debug("API: DRM session cleaned-up with success!"),n()}),(function(e){C.Z.error("API: An error arised when trying to clean-up the DRM session:"+(e instanceof Error?e.toString():"Unknown Error")),n()}))},f._priv_onPlaybackEvent=function(e){switch(e.type){case"inband-events":var t=e.value;return void this.trigger("inbandEvents",t);case"stream-event":this.trigger("streamEvent",e.value);break;case"stream-event-skip":this.trigger("streamEventSkip",e.value);break;case"activePeriodChanged":this._priv_onActivePeriodChanged(e.value);break;case"periodStreamReady":this._priv_onPeriodStreamReady(e.value);break;case"periodStreamCleared":this._priv_onPeriodStreamCleared(e.value);break;case"reloading-media-source":this._priv_onReloadingMediaSource();break;case"representationChange":this._priv_onRepresentationChange(e.value);break;case"adaptationChange":this._priv_onAdaptationChange(e.value);break;case"bitrateEstimationChange":this._priv_onBitrateEstimationChange(e.value);break;case"manifestReady":this._priv_onManifestReady(e.value);break;case"warning":this._priv_onPlaybackWarning(e.value);break;case"loaded":if(null===this._priv_contentInfos)return void C.Z.error("API: Loaded event while no content is loaded");this._priv_contentInfos.segmentBuffersStore=e.value.segmentBuffersStore;break;case"decipherabilityUpdate":this.trigger("decipherabilityUpdate",e.value);break;case"added-segment":if(null===this._priv_contentInfos)return void C.Z.error("API: Added segment while no content is loaded");var n=e.value,r=n.content,i=n.segmentData;if("image"===r.adaptation.type&&!(0,V.Z)(i)&&"bif"===i.type){var a=i.data;this._priv_contentInfos.thumbnails=a,this.trigger("imageTrackUpdate",{data:this._priv_contentInfos.thumbnails})}}},f._priv_onPlaybackError=function(e){var t=(0,O.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error stopped content playback."});t.fatal=!0,null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this._priv_currentError=t,C.Z.error("API: The player stopped because of an error:",e),this._priv_setPlayerState(bn),this._priv_currentError===t&&this.trigger("error",t)},f._priv_onPlaybackFinished=function(){C.Z.info("API: Previous playback finished. Stopping and cleaning-up..."),null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this._priv_setPlayerState(kn)},f._priv_onPlaybackWarning=function(e){var t=(0,O.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error happened."});C.Z.warn("API: Sending warning:",t),this.trigger("warning",t)},f._priv_onManifestReady=function(e){var t=this,n=e.manifest,r=this._priv_contentInfos;if(null!==r){r.manifest=n,this._priv_lastContentPlaybackInfos.manifest=n;var i=r.initialAudioTrack,a=r.initialTextTrack;this._priv_trackChoiceManager=new Fn({preferTrickModeTracks:this._priv_preferTrickModeTracks});var s=void 0===i?this._priv_preferredAudioTracks:[i];this._priv_trackChoiceManager.setPreferredAudioTracks(s,!0);var u=void 0===a?this._priv_preferredTextTracks:[a];this._priv_trackChoiceManager.setPreferredTextTracks(u,!0),this._priv_trackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),(0,z.R)(n,"manifestUpdate").pipe((0,o.R)(r.stop$)).subscribe((function(){null!==t._priv_trackChoiceManager&&t._priv_trackChoiceManager.update()}))}else C.Z.error("API: The manifest is loaded but no content is.")},f._priv_onActivePeriodChanged=function(e){var t,n,r,i,a,o,s=e.period;if(null!==this._priv_contentInfos){if(this._priv_contentInfos.currentPeriod=s,this._priv_contentEventsMemory.periodChange!==s&&(this._priv_contentEventsMemory.periodChange=s,this.trigger("periodChange",s)),this.trigger("availableAudioTracksChange",this.getAvailableAudioTracks()),this.trigger("availableTextTracksChange",this.getAvailableTextTracks()),this.trigger("availableVideoTracksChange",this.getAvailableVideoTracks()),null!==this._priv_trackChoiceManager){var u=this._priv_trackChoiceManager.getChosenAudioTrack(s),l=this._priv_trackChoiceManager.getChosenTextTrack(s),c=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("audioTrackChange",u),this.trigger("textTrackChange",l),this.trigger("videoTrackChange",c)}else this.trigger("audioTrackChange",null),this.trigger("textTrackChange",null),this.trigger("videoTrackChange",null);this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",this.getAvailableAudioBitrates()),this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",this.getAvailableVideoBitrates());var d=null!==(r=null===(n=null===(t=this._priv_getCurrentRepresentations())||void 0===t?void 0:t.audio)||void 0===n?void 0:n.bitrate)&&void 0!==r?r:-1;this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",d);var f=null!==(o=null===(a=null===(i=this._priv_getCurrentRepresentations())||void 0===i?void 0:i.video)||void 0===a?void 0:a.bitrate)&&void 0!==o?o:-1;this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",f)}else C.Z.error("API: The active period changed but no content is loaded")},f._priv_onPeriodStreamReady=function(e){var t=e.type,n=e.period,r=e.adaptation$;switch(t){case"video":null===this._priv_trackChoiceManager?(C.Z.error("API: TrackChoiceManager not instanciated for a new video period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialVideoTrack(n));break;case"audio":null===this._priv_trackChoiceManager?(C.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialAudioTrack(n));break;case"text":null===this._priv_trackChoiceManager?(C.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialTextTrack(n));break;default:var i=n.adaptations[t];!(0,V.Z)(i)&&i.length>0?r.next(i[0]):r.next(null)}},f._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,V.Z)(i)&&!(0,V.Z)(i[n.id])){var o=i[n.id];delete o[t],0===Object.keys(o).length&&delete i[n.id]}if(!(0,V.Z)(a)&&!(0,V.Z)(a[n.id])){var s=a[n.id];delete s[t],0===Object.keys(s).length&&delete a[n.id]}}},f._priv_onReloadingMediaSource=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.segmentBuffersStore=null),null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.resetPeriods()},f._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,V.Z)(u))o[r.id]=((i={})[t]=n,i);else u[t]=n;if(null!==this._priv_trackChoiceManager&&null!==s&&!(0,V.Z)(r)&&r.id===s.id)switch(t){case"audio":var l=this._priv_trackChoiceManager.getChosenAudioTrack(s);this.trigger("audioTrackChange",l);var c=this.getAvailableAudioBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",c);break;case"text":var d=this._priv_trackChoiceManager.getChosenTextTrack(s);this.trigger("textTrackChange",d);break;case"video":var f=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("videoTrackChange",f);var p=this.getAvailableVideoBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",p)}}else C.Z.error("API: The adaptations changed but no content is loaded")},f._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,V.Z)(l))s[r.id]=((a={})[n]=i,a);else l[n]=i;var c=null!==(t=null==i?void 0:i.bitrate)&&void 0!==t?t:-1;(0,V.Z)(r)||null===u||u.id!==r.id||("video"===n?this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",c):"audio"===n&&this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",c))}else C.Z.error("API: The representations changed but no content is loaded")},f._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})},f._priv_onPlayPauseNext=function(e){if(null===this.videoElement)throw new Error("Disposed player");this._priv_isPlaying.setValue(e)},f._priv_onNativeTextTracksNext=function(e){this.trigger("nativeTextTracksChange",e)},f._priv_setPlayerState=function(e){this.state!==e&&(this.state=e,C.Z.info("API: playerStateChange event",e),this.trigger("playerStateChange",e))},f._priv_triggerPositionUpdate=function(e){var t;if(null!==this._priv_contentInfos){if(this.state!==In){var n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if((r||null!==i)&&!(0,V.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}else if(r&&null!==this.videoElement){var u=I(this.videoElement);void 0!==u&&(o.wallClockTime=u+e.position)}this.trigger("positionUpdate",o)}}}else C.Z.warn("API: Cannot perform time update: no content loaded.")},f._priv_triggerAvailableBitratesChangeEvent=function(e,t){var n=this._priv_contentEventsMemory[e];void 0!==n&&(0,F.Z)(t,n)||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},f._priv_triggerCurrentBitrateChangeEvent=function(e,t){t!==this._priv_contentEventsMemory[e]&&(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},f._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,V.Z)(n[t.id])?null:n[t.id]},(0,e.Z)(r,null,[{key:"ErrorTypes",get:function(){return L.ZB}},{key:"ErrorCodes",get:function(){return L.SM}},{key:"LogLevel",get:function(){return C.Z.getLevel()},set:function(e){C.Z.setLevel(e)}}]),r}(z.Z);or.version="3.27.0";var sr=or,ur=n(7273);!function(){ur.Z.ContentDecryptor=n(1266).ZP,ur.Z.imageBuffer=n(7127).Z,ur.Z.imageParser=n(3203).Z,ur.Z.transports.smooth=n(2339).Z,ur.Z.transports.dash=n(5877).Z,ur.Z.dashParsers.js=n(3501).Z,ur.Z.nativeTextTracksBuffer=n(9059).Z,ur.Z.nativeTextTracksParsers.vtt=n(9405).Z,ur.Z.nativeTextTracksParsers.ttml=n(1570).Z,ur.Z.nativeTextTracksParsers.sami=n(1812).Z,ur.Z.nativeTextTracksParsers.srt=n(8057).Z,ur.Z.htmlTextTracksBuffer=n(5192).Z,ur.Z.htmlTextTracksParsers.sami=n(5734).Z,ur.Z.htmlTextTracksParsers.ttml=n(7439).Z,ur.Z.htmlTextTracksParsers.srt=n(8675).Z,ur.Z.htmlTextTracksParsers.vtt=n(4099).Z;var e=n(8969).Z,t=n(7794).Z;ur.Z.directfile={initDirectFile:e,mediaElementTrackChoiceManager:t}}();var lr=sr}(),r=r.default}()}));