aboutsummaryrefslogtreecommitdiff
path: root/assets/clapprio
diff options
context:
space:
mode:
authorAndreas Hubel2019-12-29 00:16:34 +0100
committerAndreas Hubel2019-12-29 00:16:34 +0100
commit55ca2627ad063129f7e9e97b3f64a828490e2678 (patch)
treeb7636d2e9edb647c94cb6c6423ca2057c79c3d35 /assets/clapprio
parent4cc715ab6f0a4f3f9ccb9e6af0ba95276815a1f2 (diff)
fix sourceMap 404 errors in firefox
Diffstat (limited to 'assets/clapprio')
-rw-r--r--assets/clapprio/dash-shaka-playback.min.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/assets/clapprio/dash-shaka-playback.min.js b/assets/clapprio/dash-shaka-playback.min.js
index ca58633..0cf777a 100644
--- a/assets/clapprio/dash-shaka-playback.min.js
+++ b/assets/clapprio/dash-shaka-playback.min.js
@@ -1,2 +1 @@
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("clappr")):"function"==typeof define&&define.amd?define(["clappr"],e):"object"==typeof exports?exports.DashShakaPlayback=e(require("clappr")):t.DashShakaPlayback=e(t.Clappr)}("undefined"!=typeof self?self:this,function(t){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="dist/",e(e.s=0)}([function(t,e,n){"use strict";function i(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,n,i)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(i)},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),c=n(1),h=n(2),l=function(t){return t&&t.__esModule?t:{default:t}}(h),f=function(t){function e(){var t;r(this,e);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];var s=a(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(i)));return s._levels=[],s._pendingAdaptationEvent=!1,s._isShakaReadyState=!1,s._minDvrSize=void 0===s.options.dashMinimumDvrSize?60:s.options.dashMinimumDvrSize,s}return o(e,t),u(e,[{key:"name",get:function(){return"dash_shaka_playback"}},{key:"shakaVersion",get:function(){return l.default.player.Player.version}},{key:"shakaPlayerInstance",get:function(){return this._player}},{key:"levels",get:function(){return this._levels}},{key:"currentLevel",set:function(t){var e=this;this._currentLevelId=t;var n=-1===this._currentLevelId;this.trigger(c.Events.PLAYBACK_LEVEL_SWITCH_START),n?(this._player.configure({abr:{enabled:!0}}),this.trigger(c.Events.PLAYBACK_LEVEL_SWITCH_END)):(this._player.configure({abr:{enabled:!1}}),this._pendingAdaptationEvent=!0,this.selectTrack(this.videoTracks.filter(function(t){return t.id===e._currentLevelId})[0]))},get:function(){return this._currentLevelId||-1}}],[{key:"canPlay",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";l.default.polyfill.installAll();var n=l.default.Player.isBrowserSupported(),i=t.split("?")[0].match(/.*\.(.*)$/)||[];return n&&("mpd"===i[1]||e.indexOf("application/dash+xml")>-1)}},{key:"Events",get:function(){return{SHAKA_READY:"shaka:ready"}}}]),u(e,[{key:"play",value:function(){if(this._player||this._setup(),!this.isReady)return void this.once(e.Events.SHAKA_READY,this.play);this._stopped=!1,this._src=this.el.src,s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"play",this).call(this),this._startUpdateTimers()}},{key:"pause",value:function(){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"pause",this).call(this),this.dvrEnabled&&this._updateDvr(!0)}},{key:"_setupSrc",value:function(){}},{key:"_startUpdateTimers",value:function(){var t=this;this._timeUpdateTimer||(this._timeUpdateTimer=setInterval(function(){t._onDurationChange(),t._onTimeUpdate()},200))}},{key:"_stopUpdateTimers",value:function(){clearInterval(this._timeUpdateTimer),this._timeUpdateTimer=null,clearInterval(this._progressUpdateTimer),this._progressUpdateTimer=null}},{key:"_ready",value:function(){}},{key:"_onShakaReady",value:function(){this._isShakaReadyState=!0,this.trigger(e.Events.SHAKA_READY),this.trigger(c.Events.PLAYBACK_READY,this.name)}},{key:"error",value:function(t){c.Log.error("an error was raised by the video tag",t,this.el.error)}},{key:"isHighDefinitionInUse",value:function(){return!1}},{key:"stop",value:function(){var t=this;clearInterval(this.sendStatsId),this._stopUpdateTimers(),this._stopped=!0,this._player?(this._sendStats(),this._player.unload().then(function(){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stop",t).call(t),t._player=null,t._isShakaReadyState=!1}).catch(function(){c.Log.error("shaka could not be unloaded")})):s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stop",this).call(this)}},{key:"getPlaybackType",value:function(){return this._playbackType}},{key:"getCurrentTime",value:function(){return Math.max(0,this.el.currentTime-this._startTime)}},{key:"getDuration",value:function(){return this._duration}},{key:"isSeekEnabled",value:function(){return this._playbackType===c.Playback.VOD||this.dvrEnabled}},{key:"seekPercentage",value:function(t){var e=this._duration;t>0&&(e=this._duration*(t/100)),this.seek(e)}},{key:"seek",value:function(t){t<0&&(c.Log.warn("Attempt to seek to a negative time. Resetting to live point."),t=this.getDuration()),this.dvrEnabled&&this._updateDvr(t<this.getDuration()-3),t+=this._startTime,s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"seek",this).call(this,t)}},{key:"selectAudioLanguage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._player.selectAudioLanguage(t,e)}},{key:"selectTrack",value:function(t){if("text"===t.type)this._player.selectTextTrack(t);else{if("variant"!==t.type)throw new Error("Unhandled track type:",t.type);this._player.selectVariantTrack(t),t.mimeType.startsWith("video/")&&this._onAdaptation()}}},{key:"_enableShakaTextTrack",value:function(t){this.el.textTracks&&(this._shakaTTVisible=t,Array.from(this.el.textTracks).filter(function(t){return"subtitles"===t.kind}).forEach(function(e){return e.mode=!0===t?"showing":"hidden"}))}},{key:"_checkForClosedCaptions",value:function(){if(!this._ccIsSetup){if(this.hasClosedCaptionsTracks){this.trigger(c.Events.PLAYBACK_SUBTITLE_AVAILABLE);var t=this.closedCaptionsTrackId;this.closedCaptionsTrackId=t}this._ccIsSetup=!0}}},{key:"destroy",value:function(){var t=this;this._stopUpdateTimers(),clearInterval(this.sendStatsId),this._player?this._player.destroy().then(function(){return t._destroy()}).catch(function(){t._destroy(),c.Log.error("shaka could not be destroyed")}):this._destroy(),s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}},{key:"_setup",value:function(){var t=this;this._isShakaReadyState=!1,this._ccIsSetup=!1,this._player=this._createPlayer(),this._options.shakaConfiguration&&this._player.configure(this._options.shakaConfiguration),this._options.shakaOnBeforeLoad&&this._options.shakaOnBeforeLoad(this._player),this._player.load(this._options.src).then(function(){return t._loaded()}).catch(function(e){return t._setupError(e)})}},{key:"_createPlayer",value:function(){var t=new l.default.Player(this.el);return t.addEventListener("error",this._onError.bind(this)),t.addEventListener("adaptation",this._onAdaptation.bind(this)),t.addEventListener("buffering",this._onBuffering.bind(this)),t}},{key:"_onBuffering",value:function(t){if(!this._stopped){var e=t.buffering?c.Events.PLAYBACK_BUFFERING:c.Events.PLAYBACK_BUFFERFULL;this.trigger(e)}}},{key:"_onProgress",value:function(){if(this.el.buffered.length){for(var t=[],e=0,n=0;n<this.el.buffered.length;n++)t=[].concat(i(t),[{start:Math.max(0,this.el.buffered.start(n)-this._startTime),end:Math.max(0,this.el.buffered.end(n)-this._startTime)}]),this.el.currentTime>=t[n].start&&this.el.currentTime<=t[n].end&&(e=n);var r={start:t[e].start,current:t[e].end,total:this.getDuration()};this.trigger(c.Events.PLAYBACK_PROGRESS,r,t)}}},{key:"_onDurationChange",value:function(){var t=this.getDuration();this._lastDuration!==t&&(this._lastDuration=t,s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_onDurationChange",this).call(this))}},{key:"_updateSettings",value:function(){this._playbackType===c.Playback.VOD?this.settings.left=["playpause","position","duration"]:this.dvrEnabled?this.settings.left=["playpause"]:this.settings.left=["playstop"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(c.Events.PLAYBACK_SETTINGSUPDATE)}},{key:"_onTimeUpdate",value:function(){var t={current:this.getCurrentTime(),total:this.getDuration(),firstFragDateTime:this._player.getPresentationStartTimeAsDate()};this._lastTimeUpdate&&t.current===this._lastTimeUpdate.current&&t.total===this._lastTimeUpdate.total||(this._lastTimeUpdate=t,this.trigger(c.Events.PLAYBACK_TIMEUPDATE,t,this.name))}},{key:"_updateDvr",value:function(t){this.trigger(c.Events.PLAYBACK_DVR,t),this.trigger(c.Events.PLAYBACK_STATS_ADD,{dvr:t})}},{key:"_loaded",value:function(){this._onShakaReady(),this._startToSendStats(),this._fillLevels(),this._checkForClosedCaptions()}},{key:"_fillLevels",value:function(){0===this._levels.length&&(this._levels=this.videoTracks.slice(0).reverse(),this.trigger(c.Events.PLAYBACK_LEVELS_AVAILABLE,this.levels))}},{key:"_startToSendStats",value:function(){var t=this,e=this._options.shakaSendStatsInterval||3e4;this.sendStatsId=setInterval(function(){return t._sendStats()},e)}},{key:"_sendStats",value:function(){this.trigger(c.Events.PLAYBACK_STATS_ADD,this._player.getStats())}},{key:"_setupError",value:function(t){this._onError(t)}},{key:"_onError",value:function(t){var n=this,i={shakaError:t,videoError:this.el.error},r=i.shakaError.detail||i.shakaError,a=r.category,o=r.code,u=r.severity;if(i.videoError||!o&&!a)return s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_onError",this).call(this);var h=u===l.default.util.Error.Severity.CRITICAL,f={code:a+"_"+o,description:"Category: "+a+", code: "+o+", severity: "+u,level:h?c.PlayerError.Levels.FATAL:c.PlayerError.Levels.WARN,raw:t},d=this.createError(f);c.Log.error("Shaka error event:",d),this.trigger(c.Events.PLAYBACK_ERROR,d),t.detail&&2==t.detail.severity&&1002==t.detail.code&&(console.log("retrying"),this.stop(),setTimeout(function(){return n.play()},1e3))}},{key:"_onAdaptation",value:function(){var t=this.videoTracks.filter(function(t){return!0===t.active})[0];this._fillLevels(),this._sendStats(),this._pendingAdaptationEvent_&&(this.trigger(c.Events.PLAYBACK_LEVEL_SWITCH_END),this._pendingAdaptationEvent=!1),c.Log.debug("an adaptation has happened:",t),this.trigger(c.Events.PLAYBACK_BITRATE,{bandwidth:t.bandwidth,language:t.language,width:t.width,height:t.height,level:t.id})}},{key:"_destroy",value:function(){this._isShakaReadyState=!1,c.Log.debug("shaka was destroyed")}},{key:"isReady",get:function(){return this._isShakaReadyState}},{key:"textTracks",get:function(){return this.isReady&&this._player.getTextTracks()}},{key:"audioLanguages",get:function(){return this.isReady&&this._player.getAudioLanguages()}},{key:"audioTracks",get:function(){return this.isReady&&this._player.getVariantTracks().filter(function(t){return t.mimeType.startsWith("audio/")})}},{key:"videoTracks",get:function(){return this.isReady&&this._player.getVariantTracks().filter(function(t){return t.mimeType.startsWith("video/")})}},{key:"dvrEnabled",get:function(){return this._player.isLive()&&this._duration>=this._minDvrSize}},{key:"_startTime",get:function(){return this._player.seekRange().start}},{key:"_duration",get:function(){if(!this._player)return 0;var t=this._player.seekRange(),e=t.start;return t.end-e}},{key:"_playbackType",get:function(){return(this.isReady&&this._player.isLive()?c.Playback.LIVE:c.Playback.VOD)||""}},{key:"closedCaptionsTracks",get:function(){var t=0,e=function(){return t++};return(this.textTracks||[]).filter(function(t){return"subtitle"===t.kind}).map(function(t){return{id:e(),name:t.label||t.language,track:t}})}},{key:"closedCaptionsTrackId",get:function(){return s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"closedCaptionsTrackId",this)},set:function(t){if(this._player){var e=this.closedCaptionsTracks,n=void 0;if(-1!==t){if(!(n=e.find(function(e){return e.id===t})))return void c.Log.warn('Track id "'+t+'" not found');if(this._shakaTTVisible&&!0===n.track.active)return void c.Log.info('Track id "'+t+'" already showing')}n?(this._player.selectTextTrack(n.track),this._enableShakaTextTrack(!0)):this._enableShakaTextTrack(!1),this._ccTrackId=t,this.trigger(c.Events.PLAYBACK_SUBTITLE_CHANGED,{id:t})}}}]),e}(c.HTML5Video);e.default=f,t.exports=e.default},function(e,n){e.exports=t},function(t,e,n){(function(t){!function(){var n="undefined"!=typeof window?window:t,i={};(function(t,e){function n(){n=function(){},Bu.Symbol||(Bu.Symbol=Fu)}function i(){n();var t=Bu.Symbol.iterator;t||(t=Bu.Symbol.iterator=Bu.Symbol("iterator")),"function"!=typeof Array.prototype[t]&&ju(Array.prototype,t,{configurable:!0,writable:!0,value:function(){return r(this)}}),i=function(){}}function r(t){var e=0;return a(function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}})}function a(t){return i(),t={next:t},t[Bu.Symbol.iterator]=function(){return this},t}function o(t){i();var e=t[Symbol.iterator];return e?e.call(t):r(t)}function s(t,e){if(e){for(var n=Bu,i=t.split("."),r=0;r<i.length-1;r++){var a=i[r];a in n||(n[a]={}),n=n[a]}i=i[i.length-1],r=n[i],a=e(r),a!=r&&null!=a&&ju(n,i,{configurable:!0,writable:!0,value:a})}}function u(t){function e(e){return t.next(e)}function n(e){return t.throw(e)}return new Promise(function(i,r){function a(t){t.done?i(t.value):Promise.resolve(t.value).then(e,n).then(a,r)}a(t.next())})}function c(t){return u(t())}function h(){this.g=!1,this.c=null,this.K=void 0,this.w=1,this.b=this.f=0,this.i=this.a=null}function l(t){if(t.g)throw new TypeError("Generator is already running");t.g=!0}function f(t,e){t.a={rc:e,yc:!0},t.w=t.f||t.b}function d(t,e,n){return t.w=n,{value:e}}function p(t,e,n){t.f=e,void 0!=n&&(t.b=n)}function m(t){t.f=0,t.b=2}function v(t){t.w=0,t.f=0}function y(t){t.f=0;var e=t.a.rc;return t.a=null,e}function g(t){t.i=[t.a],t.f=0,t.b=0}function b(t,e){var n=t.i.splice(0)[0];(n=t.a=t.a||n)?n.yc?t.w=t.f||t.b:void 0!=n.V&&t.b<n.V?(t.w=n.V,t.a=null):t.w=t.b:t.w=e}function w(t){this.a=new h,this.b=t}function T(t,e){l(t.a);var n=t.a.c;return n?E(t,"return"in n?n.return:function(t){return{value:t,done:!0}},e,t.a.return):(t.a.return(e),S(t))}function E(t,e,n,i){try{var r=e.call(t.a.c,n);if(!(r instanceof Object))throw new TypeError("Iterator result "+r+" is not an object");if(!r.done)return t.a.g=!1,r;var a=r.value}catch(e){return t.a.c=null,f(t.a,e),S(t)}return t.a.c=null,i.call(t.a,a),S(t)}function S(t){for(;t.a.w;)try{var e=t.b(t.a);if(e)return t.a.g=!1,{value:e.value,done:!1}}catch(e){t.a.K=void 0,f(t.a,e)}if(t.a.g=!1,t.a.a){if(e=t.a.a,t.a.a=null,e.yc)throw e.rc;return{value:e.return,done:!0}}return{value:void 0,done:!0}}function k(t){this.next=function(e){return l(t.a),t.a.c?e=E(t,t.a.c.next,e,t.a.h):(t.a.h(e),e=S(t)),e},this.throw=function(e){return l(t.a),t.a.c?e=E(t,t.a.c.throw,e,t.a.h):(f(t.a,e),e=S(t)),e},this.return=function(e){return T(t,e)},i(),this[Symbol.iterator]=function(){return this}}function A(t,e){return k.prototype=t.prototype,new k(new w(e))}function _(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function I(t,e){var n=t.split("."),i=Vu;n[0]in i||!i.execScript||i.execScript("var "+n[0]);for(var r;n.length&&(r=n.shift());)n.length||void 0===e?i=i[r]?i[r]:i[r]={}:i[r]=e}function x(t,e){function n(){}n.prototype=e.prototype,t.hf=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.ff=function(t,n,i){return e.prototype[n].apply(t,Array.prototype.slice.call(arguments,2))}}function P(t){this.c=Math.exp(Math.log(.5)/t),this.b=this.a=0}function R(t,e,n){var i=Math.pow(t.c,e);n=n*(1-i)+i*t.a,isNaN(n)||(t.a=n,t.b+=e)}function N(t){return t.a/(1-Math.pow(t.c,t.b))}function D(){this.b=new P(2),this.c=new P(5),this.a=0}function C(){}function M(){}function L(t){var e;t instanceof L?(O(this,t.ia),this.Fa=t.Fa,this.la=t.la,U(this,t.Qa),this.aa=t.aa,j(this,H(t.a)),this.za=t.za):t&&(e=String(t).match(Ku))?(O(this,e[1]||"",!0),this.Fa=B(e[2]||""),this.la=B(e[3]||"",!0),U(this,e[4]),this.aa=B(e[5]||"",!0),j(this,e[6]||"",!0),this.za=B(e[7]||"")):this.a=new K(null)}function O(t,e,n){t.ia=n?B(e,!0):e,t.ia&&(t.ia=t.ia.replace(/:$/,""))}function U(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.Qa=e}else t.Qa=null}function j(t,e,n){e instanceof K?t.a=e:(n||(e=F(e,Xu)),t.a=new K(e))}function B(t,e){return t?e?decodeURI(t):decodeURIComponent(t):""}function F(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,V),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function V(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(15&t).toString(16)}function K(t){this.b=t||null}function H(t){var e=new K;if(e.b=t.b,t.a){var n,i={};for(n in t.a)i[n]=t.a[n].concat();e.a=i,e.c=t.c}return e}function q(){var t,e,n=new Promise(function(n,i){t=n,e=i});return n.resolve=t,n.reject=e,n}function G(t,e){var n=Y();this.i=null==t.maxAttempts?n.maxAttempts:t.maxAttempts,this.f=null==t.baseDelay?n.baseDelay:t.baseDelay,this.h=null==t.fuzzFactor?n.fuzzFactor:t.fuzzFactor,this.g=null==t.backoffFactor?n.backoffFactor:t.backoffFactor,this.a=0,this.b=this.f,(this.c=e||!1)&&(this.a=1)}function X(e){if(e.a>=e.i){if(!e.c)return Promise.reject();e.a=1,e.b=e.f}var n=new q;return e.a?(t.setTimeout(n.resolve,e.b*(1+(2*Math.random()-1)*e.h)),e.b*=e.g):n.resolve(),e.a++,n}function Y(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0}}function z(t,e,n,i){this.severity=t,this.category=e,this.code=n,this.data=Array.prototype.slice.call(arguments,3),this.handled=!1}function W(t,e){this.promise=t,this.b=e,this.a=!1}function $(t){return new W(Promise.reject(t),function(){return Promise.resolve()})}function J(){var t=Promise.reject(new z(2,7,7001));return t.catch(function(){}),new W(t,function(){return Promise.resolve()})}function Q(t){return new W(Promise.resolve(t),function(){return Promise.resolve()})}function Z(t){return new W(t,function(){return t.catch(function(){})})}function tt(t){return new W(Promise.all(t.map(function(t){return t.promise})),function(){return Promise.all(t.map(function(t){return t.abort()}))})}function et(t,e,n){try{var i=t(e);return i&&i.promise&&i.abort?(n.resolve(i.promise),function(){return i.abort()}):(n.resolve(i),function(){return Promise.resolve(i).then(function(){}).catch(function(){})})}catch(t){return n.reject(t),function(){return Promise.resolve()}}}function nt(t,e){return!("number"!=typeof t||"number"!=typeof e||!isNaN(t)||!isNaN(e))||t===e}function it(t,e){e||(e=nt);for(var n=[],i=o(t),r=i.next();!r.done;r=i.next())r=r.value,-1==rt(n,r,e)&&n.push(r);return n}function rt(t,e,n){for(var i=0;i<t.length;++i)if(n(t[i],e))return i;return-1}function at(t,e){var n=t.indexOf(e);-1<n&&t.splice(n,1)}function ot(t,e){var n=0;return t.forEach(function(t){n+=e(t)?1:0}),n}function st(t,e,n,i,r){var a,o=r in i,s=!0;for(a in e){var u=r+"."+a,c=o?i[r]:n[a];o||a in t?void 0===e[a]?void 0===c||o?delete t[a]:t[a]=ut(c):c.constructor==Object&&e[a]&&e[a].constructor==Object?(t[a]||(t[a]=ut(c)),u=st(t[a],e[a],c,i,u),s=s&&u):typeof e[a]!=typeof c||null==e[a]||e[a].constructor!=c.constructor?s=!1:t[a]=e[a]:s=!1}return s}function ut(t){function e(t){switch(typeof t){case"undefined":case"boolean":case"number":case"string":case"symbol":case"function":return t;default:if(!t||t.buffer&&t.buffer.constructor==ArrayBuffer)return t;if(0<=n.indexOf(t))return null;var i=t.constructor==Array;if(t.constructor!=Object&&!i)return null;n.push(t);var r,a=i?[]:{};for(r in t)a[r]=e(t[r]);return i&&(a.length=t.length),a}}var n=[];return e(t)}function ct(t,e){function n(){return Promise.all(t.map(function(t){return t.destroy()}))}return Promise.resolve(e()).then(function(t){return n().then(function(){return t})},function(t){return n().then(function(){throw t})})}function ht(){this.a=[]}function lt(t,e){t.a.push(e.finally(function(){at(t.a,e)}))}function ft(t){this.c=!1,this.g=new ht,this.a=[],this.b=[],this.f=t||null}function dt(t,e,n){n=n||3;var i=zu[t];(!i||n>=i.priority)&&(zu[t]={priority:n,me:e})}function pt(t,e){return{uris:t,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:e}}function mt(t){return t.then=function(e,n){return C("The network request interface has changed! Please update your application to the new interface, which allows operations to be aborted. Support for the old API will be removed in v2.5."),t.promise.then(e,n)},t.catch=function(e){return C("The network request interface has changed! Please update your application to the new interface, which allows operations to be aborted. Support for the old API will be removed in v2.5."),t.promise.catch(e)},t}function vt(t,e,n){var i=Q(void 0);return t.a.forEach(function(t){i=i.X(function(){return t(e,n)})}),i.X(void 0,function(t){if(t&&7001==t.code)throw t;throw new z(2,1,1006,t)})}function yt(t,e,n,i,r,a){var o=new L(n.uris[r]),s=o.ia;s||(s=location.protocol,s=s.slice(0,-1),O(o,s),n.uris[r]=o.toString());var u=(s=zu[s])?s.me:null;if(!u)return $(new z(2,1,1e3,o));var c;return Z(X(i)).X(function(){if(t.c)return J();c=Date.now();var i=u(n.uris[r],n,e);return void 0==i.promise&&(C("The scheme plugin interface has changed! Please update your scheme plugins to the new interface to add support for abort(). Support for the old plugin interface will be removed in v2.5."),i=Z(i)),i}).X(function(t){return void 0==t.timeMs&&(t.timeMs=Date.now()-c),t},function(o){if(o&&7001==o.code)throw o;if(t.c)return J();if(o&&1==o.severity)return r=(r+1)%n.uris.length,yt(t,e,n,i,r,o);throw o||a})}function gt(t,e,n){var i=Q(void 0);return t.b.forEach(function(t){i=i.X(function(){return t(e,n)})}),i.X(function(){return n},function(t){if(t&&7001==t.code)throw t;var e=2;throw t instanceof z&&(e=t.severity),new z(e,1,1007,t)})}function bt(){this.a={}}function wt(){this.a=new bt}function Tt(t,e,n,i){t.a&&(e=new kt(e,n,i),t.a.push(n,e))}function Et(t,e,n,i){Tt(t,e,n,function(t){this.pa(e,n),i(t)}.bind(t))}function St(t){if(t.a){var e,n=t.a,i=[];for(e in n.a)i.push.apply(i,n.a[e]);for(n=0;n<i.length;++n)i[n].pa();t.a.a={}}}function kt(t,e,n){this.target=t,this.type=e,this.a=n,this.target.addEventListener(e,n,!1)}function At(e,n){var i,r=n||{};for(i in r)this[i]=r[i];this.defaultPrevented=this.cancelable=this.bubbles=!1,this.timeStamp=t.performance&&t.performance.now?t.performance.now():Date.now(),this.type=e,this.isTrusted=!1,this.target=this.currentTarget=null,this.a=!1}function _t(t,e){return t.reduce(function(t,e,n){return e.catch(t.bind(null,n))}.bind(null,e),Promise.reject())}function It(t,e){return t.concat(e)}function xt(){}function Pt(t){return null!=t}function Rt(t,e,n){return n.indexOf(t)==e}function Nt(t,e){if(0==e.length)return t;var n=e.map(function(t){return new L(t)});return t.map(function(t){return new L(t)}).map(function(t){return n.map(t.resolve.bind(t))}).reduce(It,[]).map(function(t){return t.toString()})}function Dt(t,e){return{keySystem:t,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:e||[],keyIds:[]}}function Ct(t,e){var n=t;return e&&(n+='; codecs="'+e+'"'),n}function Mt(t){if(!t)return"";t=new Uint8Array(t),239==t[0]&&187==t[1]&&191==t[2]&&(t=t.subarray(3)),t=escape(jt(t));try{return decodeURIComponent(t)}catch(t){throw new z(2,2,2004)}}function Lt(t,e,n){if(!t)return"";if(!n&&0!=t.byteLength%2)throw new z(2,2,2004);if(t instanceof ArrayBuffer)var i=t;else n=new Uint8Array(t.byteLength),n.set(new Uint8Array(t)),i=n.buffer;t=Math.floor(t.byteLength/2),n=new Uint16Array(t),i=new DataView(i);for(var r=0;r<t;r++)n[r]=i.getUint16(2*r,e);return jt(n)}function Ot(t){var e=new Uint8Array(t);if(239==e[0]&&187==e[1]&&191==e[2])return Mt(e);if(254==e[0]&&255==e[1])return Lt(e.subarray(2),!1);if(255==e[0]&&254==e[1])return Lt(e.subarray(2),!0);var n=function(t,e){return t.byteLength<=e||32<=t[e]&&126>=t[e]}.bind(null,e);if(0==e[0]&&0==e[2])return Lt(t,!1);if(0==e[1]&&0==e[3])return Lt(t,!0);if(n(0)&&n(1)&&n(2)&&n(3))return Mt(t);throw new z(2,2,2003)}function Ut(t){t=encodeURIComponent(t),t=unescape(t);for(var e=new Uint8Array(t.length),n=0;n<t.length;++n)e[n]=t.charCodeAt(n);return e.buffer}function jt(t){for(var e="",n=0;n<t.length;n+=16e3)e+=String.fromCharCode.apply(null,t.subarray(n,n+16e3));return e}function Bt(t){this.a=null,this.b=function(){this.a=null,t()}.bind(this)}function Ft(t){var e=tc;t.cancel(),t.a=setTimeout(t.b,1e3*e)}function Vt(t,e){t.cancel();var n=function(){this.b(),this.a=setTimeout(n,1e3*e)}.bind(t);t.a=setTimeout(n,1e3*e)}function Kt(e,n){var i=void 0==n||n,r=t.btoa(jt(e)).replace(/\+/g,"-").replace(/\//g,"_");return i?r:r.replace(/=*$/,"")}function Ht(e){e=t.atob(e.replace(/-/g,"+").replace(/_/g,"/"));for(var n=new Uint8Array(e.length),i=0;i<e.length;++i)n[i]=e.charCodeAt(i);return n}function qt(e){for(var n=new Uint8Array(e.length/2),i=0;i<e.length;i+=2)n[i/2]=t.parseInt(e.substr(i,2),16);return n}function Gt(t){for(var e="",n=0;n<t.length;++n){var i=t[n].toString(16);1==i.length&&(i="0"+i),e+=i}return e}function Xt(t,e){if(!t&&!e)return!0;if(!t||!e||t.length!=e.length)return!1;for(var n=0;n<t.length;++n)if(t[n]!=e[n])return!1;return!0}function Yt(t){for(var e=0,n=0;n<arguments.length;++n)e+=arguments[n].length;e=new Uint8Array(e);for(var i=n=0;i<arguments.length;++i)e.set(arguments[i],n),n+=arguments[i].length;return e}function zt(t){this.s=t,this.l=this.j=this.u=null,this.L=!1,this.b=null,this.g=new wt,this.a=[],this.o=[],this.i=new q,this.f=null,this.h=function(e){this.i.reject(e),t.onError(e)}.bind(this),this.S={},this.m={},this.G=new Bt(this.oe.bind(this)),this.ga=this.c=!1,this.I=[],this.Y=!1,this.A=new Bt(this.ne.bind(this)),Vt(this.A,1),this.i.catch(function(){})}function Wt(t,e){return Promise.all(e.map(function(t){return oe(this,t).then(function(t){if(t){for(var e=new q,n=0;n<this.a.length;n++)if(this.a[n].ja==t){this.a[n].qa=e;break}return Promise.all([t.remove(),e])}}.bind(this))}.bind(t)))}function $t(t){var e=t.b?t.b.initData:[];return e.forEach(function(t){se(this,t.initDataType,t.initData)}.bind(t)),t.o.forEach(function(t){oe(this,t)}.bind(t)),e.length||t.o.length||t.i.resolve(),t.i}function Jt(t,e,n){for(var i=o(t.a),r=i.next();!r.done;r=i.next())if(Xt(n,r.value.initData))return;se(t,e,n)}function Qt(t){return t.a.map(function(t){return t.ja.sessionId})}function Zt(e,n,i,r,a){var o=ne(e),s=ie(e,n);n.periods.forEach(function(e){e.variants.forEach(function(e){o&&(e.drmInfos=[o]),s&&(e.drmInfos=s),e.drmInfos.forEach(function(n){ee(this,n),t.cast&&t.cast.__platform__&&"com.microsoft.playready"==n.keySystem&&(n.keySystem="com.chromecast.playready");var o=r[n.keySystem];o||(o={audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:i?"required":"optional",sessionTypes:[i?"persistent-license":"temporary"],label:n.keySystem,drmInfos:[]},r[n.keySystem]=o,a.push(n.keySystem)),o.drmInfos.push(n),n.distinctiveIdentifierRequired&&(o.distinctiveIdentifier="required"),n.persistentStateRequired&&(o.persistentState="required");var s=[];e.video&&s.push(e.video),e.audio&&s.push(e.audio),s.forEach(function(t){("video"==t.type?o.videoCapabilities:o.audioCapabilities).push({robustness:("video"==t.type?n.videoRobustness:n.audioRobustness)||"",contentType:Ct(t.mimeType,t.codecs)})}.bind(this))}.bind(this))}.bind(this))}.bind(e))}function te(t,e,n,i){if(1==n.length&&""==n[0])return Promise.reject(new z(2,6,6e3));var r=new q,a=r;return[!0,!1].forEach(function(t){n.forEach(function(n){var i=e[n];i.drmInfos.some(function(t){return!!t.licenseServerUri})==t&&(0==i.audioCapabilities.length&&delete i.audioCapabilities,0==i.videoCapabilities.length&&delete i.videoCapabilities,a=a.catch(function(){return this.c?Promise.reject():navigator.requestMediaKeySystemAccess(n,[i])}.bind(this)))}.bind(this))}.bind(t)),a=a.catch(function(){return Promise.reject(new z(2,6,6001))}),a=a.then(function(t){if(this.c)return Promise.reject();var n=0<=navigator.userAgent.indexOf("Edge/"),i=t.getConfiguration();return this.u=(i.audioCapabilities||[]).concat(i.videoCapabilities||[]).map(function(t){return t.contentType}),n&&(this.u=null),n=e[t.keySystem],re(this,t.keySystem,n,n.drmInfos),this.b.licenseServerUri?t.createMediaKeys():Promise.reject(new z(2,6,6012))}.bind(t)).then(function(t){if(this.c)return Promise.reject();this.j=t,this.L=!0}.bind(t)).catch(function(t){return this.c?Promise.resolve():(this.u=this.b=null,t instanceof z?Promise.reject(t):Promise.reject(new z(2,6,6002,t.message)))}.bind(t)),i||(a=a.catch(function(){})),r.reject(),a}function ee(t,e){var n=e.keySystem;if(n){if(!e.licenseServerUri){var i=t.f.servers[n];i&&(e.licenseServerUri=i)}e.keyIds||(e.keyIds=[]),(n=t.f.advanced[n])&&(e.distinctiveIdentifierRequired||(e.distinctiveIdentifierRequired=n.distinctiveIdentifierRequired),e.persistentStateRequired||(e.persistentStateRequired=n.persistentStateRequired),e.videoRobustness||(e.videoRobustness=n.videoRobustness),e.audioRobustness||(e.audioRobustness=n.audioRobustness),e.serverCertificate||(e.serverCertificate=n.serverCertificate))}}function ne(e){if($u.empty(e.f.clearKeys))return null;var n,i=[],r=[];for(n in e.f.clearKeys){var a=e.f.clearKeys[n],o=qt(n);a=qt(a),o={kty:"oct",kid:Kt(o,!1),k:Kt(a,!1)},i.push(o),r.push(o.kid)}return e=JSON.stringify({keys:i}),r=JSON.stringify({kids:r}),r=[{initData:new Uint8Array(Ut(r)),initDataType:"keyids"}],{keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64,"+t.btoa(e),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:r,keyIds:[]}}function ie(t,e){var n=t.f,i=Object.keys(n.servers);return!i.length||e.periods.some(function(t){return t.variants.some(function(t){return t.drmInfos.length})})?null:i.map(function(t){return{keySystem:t,licenseServerUri:n.servers[t],distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[]}})}function re(t,e,n,i){var r=[],a=[],o=[],s=[];ae(i,r,a,o,s),t.b={keySystem:e,licenseServerUri:r[0],distinctiveIdentifierRequired:"required"==n.distinctiveIdentifier,persistentStateRequired:"required"==n.persistentState,audioRobustness:n.audioCapabilities?n.audioCapabilities[0].robustness:"",videoRobustness:n.videoCapabilities?n.videoCapabilities[0].robustness:"",serverCertificate:a[0],initData:o,keyIds:s}}function ae(t,e,n,i,r){function a(t,e){return!(!t.keyId||t.keyId!=e.keyId)||t.initDataType==e.initDataType&&Xt(t.initData,e.initData)}t.forEach(function(t){if(-1==e.indexOf(t.licenseServerUri)&&e.push(t.licenseServerUri),t.serverCertificate&&-1==rt(n,t.serverCertificate,Xt)&&n.push(t.serverCertificate),t.initData&&t.initData.forEach(function(t){-1==rt(i,t,a)&&i.push(t)}),t.keyIds)for(var o=0;o<t.keyIds.length;++o)-1==r.indexOf(t.keyIds[o])&&r.push(t.keyIds[o])})}function oe(t,e){try{var n=t.j.createSession("persistent-license")}catch(e){var i=new z(2,6,6005,e.message);return t.h(i),Promise.reject(i)}Tt(t.g,n,"message",t.Ic.bind(t)),Tt(t.g,n,"keystatuseschange",t.Ec.bind(t));var r={initData:null,ja:n,loaded:!1,Tb:1/0,qa:null};return t.a.push(r),n.load(e).then(function(t){if(!this.c){if(t)return r.loaded=!0,this.a.every(function(t){return t.loaded})&&this.i.resolve(),n;this.a.splice(this.a.indexOf(r),1),this.h(new z(2,6,6013))}}.bind(t),function(t){this.c||(this.a.splice(this.a.indexOf(r),1),this.h(new z(2,6,6005,t.message)))}.bind(t))}function se(t,e,n){try{var i=t.ga?t.j.createSession("persistent-license"):t.j.createSession()}catch(e){return void t.h(new z(2,6,6005,e.message))}Tt(t.g,i,"message",t.Ic.bind(t)),Tt(t.g,i,"keystatuseschange",t.Ec.bind(t)),t.a.push({initData:n,ja:i,loaded:!1,Tb:1/0,qa:null}),i.generateRequest(e,n.buffer).catch(function(t){if(!this.c){for(var e=0;e<this.a.length;++e)if(this.a[e].ja==i){this.a.splice(e,1);break}this.h(new z(2,6,6006,t.message))}}.bind(t))}function ue(t,e){for(var n,i=e.target,r=0;r<t.a.length;r++)if(t.a[r].ja==i){n=t.a[r];break}r=pt([t.b.licenseServerUri],t.f.retryParameters),r.body=e.message,r.method="POST","com.microsoft.playready"!=t.b.keySystem&&"com.chromecast.playready"!=t.b.keySystem||ce(r),t.s.$a.request(2,r).promise.then(function(t){return this.c?Promise.reject():i.update(t.data).then(function(){this.s.onEvent(new At("drmsessionupdate")),n&&(n.qa&&n.qa.resolve(),setTimeout(function(){n.loaded=!0,this.a.every(function(t){return t.loaded})&&this.i.resolve()}.bind(this),1e3*Zu))}.bind(this))}.bind(t),function(t){if(this.c)return Promise.resolve();t=new z(2,6,6007,t),this.h(t),n&&n.qa&&n.qa.reject(t)}.bind(t)).catch(function(t){if(this.c)return Promise.resolve();t=new z(2,6,6008,t.message),this.h(t),n&&n.qa&&n.qa.reject(t)}.bind(t))}function ce(t){var e=Lt(t.body,!0,!0);if(-1==e.indexOf("PlayReadyKeyMessage"))t.headers["Content-Type"]="text/xml; charset=utf-8";else{e=(new DOMParser).parseFromString(e,"application/xml");for(var n=e.getElementsByTagName("HttpHeader"),i=0;i<n.length;++i)t.headers[n[i].querySelector("name").textContent]=n[i].querySelector("value").textContent;t.body=Ht(e.querySelector("Challenge").textContent).buffer}}function he(){var t=[],e=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],n=[{videoCapabilities:e,persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:e}],i={};return"org.w3.clearkey com.widevine.alpha com.microsoft.playready com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" ").forEach(function(e){var r=navigator.requestMediaKeySystemAccess(e,n).then(function(t){var n=t.getConfiguration().sessionTypes;return n=!!n&&0<=n.indexOf("persistent-license"),0<=navigator.userAgent.indexOf("Tizen 3")&&(n=!1),i[e]={persistentState:n},t.createMediaKeys()}).catch(function(){i[e]=null});t.push(r)}),Promise.all(t).then(function(){return i})}function le(t,e){var n=t.keySystem();return 0==e.drmInfos.length||e.drmInfos.some(function(t){return t.keySystem==n})}function fe(t,e){if(!t.length)return e;if(!e.length)return t;for(var n=[],i=0;i<t.length;i++)for(var r=0;r<e.length;r++)if(t[i].keySystem==e[r].keySystem){var a=t[i];r=e[r];var o=[];o=o.concat(a.initData||[]),o=o.concat(r.initData||[]);var s=[];s=s.concat(a.keyIds),s=s.concat(r.keyIds),n.push({keySystem:a.keySystem,licenseServerUri:a.licenseServerUri||r.licenseServerUri,distinctiveIdentifierRequired:a.distinctiveIdentifierRequired||r.distinctiveIdentifierRequired,persistentStateRequired:a.persistentStateRequired||r.persistentStateRequired,videoRobustness:a.videoRobustness||r.videoRobustness,audioRobustness:a.audioRobustness||r.audioRobustness,serverCertificate:a.serverCertificate||r.serverCertificate,initData:o,keyIds:s});break}return n}function de(t){return!t||1==t.length&&1e-6>t.end(0)-t.start(0)?null:t.length?t.end(t.length-1):null}function pe(t,e,n){return n=void 0===n?0:n,!(!t||!t.length||1==t.length&&1e-6>t.end(0)-t.start(0)||e>t.end(t.length-1))&&e+n>=t.start(0)}function me(t,e){if(!t||!t.length||1==t.length&&1e-6>t.end(0)-t.start(0))return 0;for(var n=0,i=t.length-1;0<=i&&t.end(i)>e;--i)n+=t.end(i)-Math.max(t.start(i),e);return n}function ve(t){if(!t)return[];for(var e=[],n=0;n<t.length;n++)e.push({start:t.start(n),end:t.end(n)});return e}function ye(t,e,n){this.startTime=t,this.endTime=e,this.payload=n,this.region=new ge,this.position=null,this.positionAlign=ec,this.size=100,this.textAlign=nc,this.writingDirection=oc,this.lineInterpretation=sc,this.line=null,this.lineHeight="",this.lineAlign=uc,this.displayAlign=rc,this.fontSize=this.backgroundColor=this.color="",this.fontWeight=hc,this.fontStyle=lc,this.fontFamily="",this.textDecoration=[],this.wrapLine=!0,this.id=""}function ge(){this.id="",this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0,this.height=this.width=100,this.viewportAnchorUnits=this.widthUnits=this.heightUnits=dc,this.scroll=pc}function be(){this.a=new muxjs.mp4.Transmuxer({keepOriginalTimestamps:!0}),this.b=null,this.g=[],this.c=[],this.f=!1,this.a.on("data",this.i.bind(this)),this.a.on("done",this.h.bind(this))}function we(e,n){return!(!t.muxjs||"mp2t"!=e.split(";")[0].split("/")[1])&&(n?MediaSource.isTypeSupported(Te(n,e)):MediaSource.isTypeSupported(Te("audio",e))||MediaSource.isTypeSupported(Te("video",e)))}function Te(t,e){var n=e.replace("mp2t","mp4");"audio"==t&&(n=n.replace("video","audio"));var i=/avc1\.(66|77|100)\.(\d+)/.exec(n);if(i){var r="avc1.",a=i[1],o=Number(i[2]);r=("66"==a?r+"4200":"77"==a?r+"4d00":r+"6400")+(o>>4).toString(16),r+=(15&o).toString(16),n=n.replace(i[0],r)}return n}function Ee(t,e){t.f=!0,t.b=new q,t.g=[],t.c=[];var n=new Uint8Array(e);return t.a.push(n),t.a.flush(),t.f&&t.b.reject(new z(2,3,3018)),t.b}function Se(t){this.f=null,this.c=t,this.h=this.i=0,this.g=1/0,this.b=this.a=null}function ke(t,e,n,i){return Promise.resolve().then(function(){if(this.f&&this.c)if(null==n||null==i)this.f.parseInit(new Uint8Array(e));else{var t={periodStart:this.i,segmentStart:n,segmentEnd:i};t=this.f.parseMedia(new Uint8Array(e),t).filter(function(t){return t.startTime>=this.h&&t.startTime<this.g}.bind(this)),this.c.append(t),null==this.a&&(this.a=Math.max(n,this.h)),this.b=Math.min(i,this.g)}}.bind(t))}function Ae(e){this.f=e,this.o=null,this.b={},this.a=null,this.c={},this.h=new wt,this.m=!1,this.i={},this.l=!1,e=this.j=new q;var n=new MediaSource;Et(this.h,n,"sourceopen",e.resolve),this.f.src=t.URL.createObjectURL(n),this.g=n}function _e(){var t={};return'video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="opus",audio/mp4; codecs="flac",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").forEach(function(e){t[e]=!!mc[e]||MediaSource.isTypeSupported(e)||we(e);var n=e.split(";")[0];t[n]=t[n]||t[e]}),t}function Ie(t,e){t.a||(t.a=new Se(t.o)),t.a.f=new mc[e]}function xe(t,e){if("text"==e)var n=t.a.a;else n=Ne(t,e),n=!n||1==n.length&&1e-6>n.end(0)-n.start(0)?null:1==n.length&&0>n.start(0)?0:n.length?n.start(0):null;return n}function Pe(t,e){return"text"==e?t.a.b:de(Ne(t,e))}function Re(t,e,n){return"text"==e?(t=t.a,null==t.b||t.b<n?0:t.b-Math.max(n,t.a)):(t=Ne(t,e),me(t,n))}function Ne(t,e){try{return t.b[e].buffered}catch(t){return null}}function De(t,e,n,i,r){return"text"==e?ke(t.a,n,i,r):t.i[e]?Ee(t.i[e],n).then(function(t){return this.a||Ie(this,"text/vtt"),this.l&&this.a.lc(t.cues),Le(this,e,this.Vc.bind(this,e,t.data.buffer))}.bind(t)):Le(t,e,t.Vc.bind(t,e,n))}function Ce(t,e){return"text"==e?t.a?t.a.remove(0,1/0):Promise.resolve():Le(t,e,t.Wc.bind(t,e,0,t.g.duration))}function Me(t,e,n,i,r){return"text"==e?(t.a.i=n,t=t.a,t.h=i,t.g=r,Promise.resolve()):Promise.all([Le(t,e,t.cd.bind(t,e)),Le(t,e,t.Ge.bind(t,e,n)),Le(t,e,t.De.bind(t,e,i,r))])}function Le(t,e,n){if(t.m)return Promise.reject();if(n={start:n,p:new q},t.c[e].push(n),1==t.c[e].length)try{n.start()}catch(i){"QuotaExceededError"==i.name?n.p.reject(new z(2,3,3017,e)):n.p.reject(new z(2,3,3015,i)),Ue(t,e)}return n.p}function Oe(t,e){if(t.m)return Promise.reject();var n,i=[];for(n in t.b){var r=new q,a={start:function(t){t.resolve()}.bind(null,r),p:r};t.c[n].push(a),i.push(r),1==t.c[n].length&&a.start()}return Promise.all(i).then(function(){try{e()}catch(e){var t=Promise.reject(new z(2,3,3015,e))}for(var n in this.b)Ue(this,n);return t}.bind(t),function(){return Promise.reject()}.bind(t))}function Ue(t,e){t.c[e].shift();var n=t.c[e][0];if(n)try{n.start()}catch(i){n.p.reject(new z(2,3,3015,i)),Ue(t,e)}}function je(t,e,n){return n==e||t>=vc&&n==e.split("-")[0]||t>=yc&&n.split("-")[0]==e.split("-")[0]}function Be(t){t=t.toLowerCase().split("-");var e=gc[t[0]];return e&&(t[0]=e),t.join("-")}function Fe(t,e,n){var i=t.video;return!(i&&(i.width<e.minWidth||i.width>e.maxWidth||i.width>n.width||i.height<e.minHeight||i.height>e.maxHeight||i.height>n.height||i.width*i.height<e.minPixels||i.width*i.height>e.maxPixels)||t.bandwidth<e.minBandwidth||t.bandwidth>e.maxBandwidth)}function Ve(t,e,n){var i=!1;return t.variants.forEach(function(t){var r=t.allowedByApplication;t.allowedByApplication=Fe(t,e,n),r!=t.allowedByApplication&&(i=!0)}),i}function Ke(t,e,n,i){i.variants=i.variants.filter(function(i){return!(t&&t.L&&!le(t,i))&&(He(i.audio,t,e)&&He(i.video,t,n))}),i.textStreams=i.textStreams.filter(function(t){return!!mc[Ct(t.mimeType,t.codecs)]})}function He(t,e,n){if(!t)return!0;var i=null;e&&e.L&&(i=e.u),e=Ct(t.mimeType,t.codecs);var r,a=Ct(t.mimeType,t.codecs),o=t.mimeType;for(r in Ju){var s=t[r],u=Ju[r];s&&(o+="; "+u+'="'+s+'"')}return!(!(mc[a]||MediaSource.isTypeSupported(o)||we(a,t.type))||i&&t.encrypted&&0>i.indexOf(e)||n&&(t.mimeType!=n.mimeType||t.codecs.split(".")[0]!=n.codecs.split(".")[0]))}function qe(t){var e=t.audio,n=t.video,i=e?e.codecs:null,r=n?n.codecs:null,a=[];r&&a.push(r),i&&a.push(i);var o=[];n&&o.push(n.mimeType),e&&o.push(e.mimeType),o=o[0]||null;var s=[];e&&s.push(e.kind),n&&s.push(n.kind),s=s[0]||null;var u=[];return e&&u.push.apply(u,e.roles),n&&u.push.apply(u,n.roles),u=it(u),t={id:t.id,active:!1,type:"variant",bandwidth:t.bandwidth,language:t.language,label:null,kind:s,width:null,height:null,frameRate:null,mimeType:o,codecs:a.join(", "),audioCodec:i,videoCodec:r,primary:t.primary,roles:u,videoId:null,audioId:null,channelsCount:null,audioBandwidth:null,videoBandwidth:null},n&&(t.videoId=n.id,t.width=n.width||null,t.height=n.height||null,t.frameRate=n.frameRate||null,t.videoBandwidth=n.bandwidth||null),e&&(t.audioId=e.id,t.channelsCount=e.channelsCount,t.audioBandwidth=e.bandwidth||null,t.label=e.label),t}function Ge(t){return{id:t.id,active:!1,type:"text",bandwidth:0,language:t.language,label:t.label,kind:t.kind||null,width:null,height:null,frameRate:null,mimeType:t.mimeType,codecs:t.codecs||null,audioCodec:null,videoCodec:null,primary:t.primary,roles:t.roles,videoId:null,audioId:null,channelsCount:null,audioBandwidth:null,videoBandwidth:null}}function Xe(t){var e=[],n=Je(t.variants);return t=t.textStreams,n.forEach(function(t){e.push(qe(t))}),t.forEach(function(t){e.push(Ge(t))}),e}function Ye(t,e,n){return Je(t.variants).map(function(t){var i=qe(t);return t.video&&t.audio?i.active=n==t.video.id&&e==t.audio.id:t.video?i.active=n==t.video.id:t.audio&&(i.active=e==t.audio.id),i})}function ze(t,e){return t.textStreams.map(function(t){var n=Ge(t);return n.active=e==t.id,n})}function We(t,e){for(var n=0;n<t.variants.length;n++)if(t.variants[n].id==e.id)return t.variants[n];return null}function $e(t){return t.allowedByApplication&&t.allowedByKeySystem}function Je(t){return t.filter(function(t){return $e(t)})}function Qe(t,e,n,i,r){return t=Ze(t,e,n,r),tn(t,i)}function Ze(t,e,n,i){var r=Je(t),a=r;t=r.filter(function(t){return t.primary}),t.length&&(a=t);var o=a.length?a[0].language:"";if(a=a.filter(function(t){return t.language==o}),e){var s=Be(e);[yc,vc,0].forEach(function(t){var e=!1;r.forEach(function(n){s=Be(s);var r=Be(n.language);je(t,s,r)&&(e?a.push(n):(a=[n],e=!0),i&&(i.audio=!0))})})}return n&&(e=nn(a,n),e.length)?e:(e=a.map(function(t){return(t.audio?t.audio.roles:[]).concat(t.video?t.video.roles:[])}).reduce(It,[]),e.length?nn(a,e[0]):a)}function tn(t,e){var n=t.filter(function(t){return t.audio&&t.audio.channelsCount}).reduce(function(t,e){var n=e.audio.channelsCount;return t[n]?t[n].push(e):t[n]=[e],t},{}),i=Object.keys(n);if(0==i.length)return t;var r=i.filter(function(t){return t<=e});return r.length?n[Math.max.apply(null,r)]:n[Math.min.apply(null,i)]}function en(t,e,n,i){var r=t,a=t.filter(function(t){return t.primary});a.length&&(r=a);var o=r.length?r[0].language:"";if(r=r.filter(function(t){return t.language==o}),e){var s=Be(e);[yc,vc,0].forEach(function(e){var n=!1;t.forEach(function(t){var a=Be(t.language);je(e,s,a)&&(n?r.push(t):(r=[t],n=!0),i&&(i.text=!0))})})}if(n){if(e=rn(r,n),e.length)return e}else if(e=r.filter(function(t){return 0==t.roles.length}),e.length)return e;return e=r.map(function(t){return t.roles}).reduce(It,[]),e.length?rn(r,e[0]):r}function nn(t,e){return t.filter(function(t){return t.audio&&0<=t.audio.roles.indexOf(e)||t.video&&0<=t.video.roles.indexOf(e)})}function rn(t,e){return t.filter(function(t){return 0<=t.roles.indexOf(e)})}function an(t,e,n){for(var i=0;i<n.length;i++)if(n[i].audio==t&&n[i].video==e)return n[i];return null}function on(t,e,n){function i(t,e){return null==t?null==e:e.id==t}for(var r=0;r<n.length;r++)if(i(t,n[r].audio)&&i(e,n[r].video))return n[r];return null}function sn(t,e){for(var n=t.periods.length-1;0<n;--n)if(e+Wu>=t.periods[n].startTime)return n;return 0}function un(t,e){for(var n=0;n<t.periods.length;++n){var i=t.periods[n];if("text"==e.type){for(var r=0;r<i.textStreams.length;++r)if(i.textStreams[r]==e)return n}else for(r=0;r<i.variants.length;++r){var a=i.variants[r];if(a.audio==e||a.video==e||a.video&&a.video.trickModeVideo==e)return n}}return-1}function cn(){this.h=null,this.f=!1,this.b=new D,this.c=[],this.i=!1,this.a=this.g=null}function hn(t,e){return t&&(e=e.filter(function(e){return Fe(e,t,{width:1/0,height:1/0})})),e.sort(function(t,e){return t.bandwidth-e.bandwidth})}function ln(t){return JSON.stringify(t,function(t,e){if("function"!=typeof e){if(e instanceof Event||e instanceof At){var n,i={};for(n in e){var r=e[n];r&&"object"==typeof r?"detail"==n&&(i[n]=r):n in Event||(i[n]=r)}return i}if(e instanceof TimeRanges)for(i={__type__:"TimeRanges",length:e.length,start:[],end:[]},n=0;n<e.length;++n)i.start.push(e.start(n)),i.end.push(e.end(n));else i="number"==typeof e?isNaN(e)?"NaN":isFinite(e)?e:0>e?"-Infinity":"Infinity":e;return i}})}function fn(t){return JSON.parse(t,function(t,e){return"NaN"==e?NaN:"-Infinity"==e?-1/0:"Infinity"==e?1/0:e&&"object"==typeof e&&"TimeRanges"==e.__type__?dn(e):e})}function dn(t){return{length:t.length,start:function(e){return t.start[e]},end:function(e){return t.end[e]}}}function pn(t,e,n,i,r,a){this.I=t,this.g=e,this.L=n,this.j=!1,this.A=i,this.G=r,this.s=a,this.b=this.h=!1,this.u="",this.i=null,this.l=this.Cc.bind(this),this.m=this.Pd.bind(this),this.a={video:{},player:{}},this.o=0,this.c={},this.f=null}function mn(t){var e=Nc;e.removeUpdateListener(t.l),e.removeMessageListener("urn:x-cast:com.google.shaka.v2",t.m)}function vn(t){for(var e in t.c){var n=t.c[e];delete t.c[e],n.reject(new z(1,7,7e3))}}function yn(t){t=ln(t),Nc.sendMessage("urn:x-cast:com.google.shaka.v2",t,function(){},M)}function gn(){this.Bb=new bt,this.jb=this}function bn(t,e,n){gn.call(this),this.c=t,this.b=e,this.i=this.g=this.f=this.j=this.h=null,this.a=new pn(n,this.Le.bind(this),this.Me.bind(this),this.Ne.bind(this),this.Oe.bind(this),this.tc.bind(this)),wn(this)}function wn(t){t.a.init(),t.i=new wt,bc.forEach(function(t){Tt(this.i,this.c,t,this.$e.bind(this))}.bind(t)),Sc.forEach(function(t){Tt(this.i,this.b,t,this.le.bind(this))}.bind(t)),t.h={};for(var e in t.c)Object.defineProperty(t.h,e,{configurable:!1,enumerable:!0,get:t.Ze.bind(t,e),set:t.af.bind(t,e)});t.j={};for(var n in t.b)Object.defineProperty(t.j,n,{configurable:!1,enumerable:!0,get:t.ke.bind(t,n)});t.f=new gn,t.f.jb=t.h,t.g=new gn,t.g.jb=t.j}function Tn(t,e,n,i){gn.call(this),this.a=t,this.b=e,this.c=new wt,this.s={video:t,player:e},this.u=n||function(){},this.A=i||function(t){return t},this.o=!1,this.h=!0,this.g=0,this.m=!1,this.j=!0,this.l=this.i=this.f=null,En(this)}function En(e){var n=cast.receiver.CastReceiverManager.getInstance();n.onSenderConnected=e.Hc.bind(e),n.onSenderDisconnected=e.Hc.bind(e),n.onSystemVolumeChanged=e.ld.bind(e),e.i=n.getCastMessageBus("urn:x-cast:com.google.cast.media"),e.i.onMessage=e.Kd.bind(e),e.f=n.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),e.f.onMessage=e.Zd.bind(e),n.start(),bc.forEach(function(t){Tt(this.c,this.a,t,this.Kc.bind(this,"video"))}.bind(e)),Sc.forEach(function(t){Tt(this.c,this.b,t,this.Kc.bind(this,"player"))}.bind(e)),cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?e.b.cc(3840,2160):e.b.cc(1920,1080),Tt(e.c,e.a,"loadeddata",function(){this.m=!0}.bind(e)),Tt(e.c,e.b,"loading",function(){this.h=!1,Sn(this)}.bind(e)),Tt(e.c,e.a,"playing",function(){this.h=!1,Sn(this)}.bind(e)),Tt(e.c,e.a,"pause",function(){Sn(this)}.bind(e)),Tt(e.c,e.b,"unloading",function(){this.h=!0,Sn(this)}.bind(e)),Tt(e.c,e.a,"ended",function(){t.setTimeout(function(){this.a&&this.a.ended&&(this.h=!0,Sn(this))}.bind(this),5e3)}.bind(e))}function Sn(t){Promise.resolve().then(function(){this.b&&(this.dispatchEvent(new At("caststatuschanged")),An(this)||xn(this,0))}.bind(t))}function kn(t,e,n){for(var i in e.player)t.b[i](e.player[i]);t.u(n),n=Promise.resolve();var r=t.a.autoplay;e.manifest&&(t.a.autoplay=!1,n=t.b.load(e.manifest,e.startTime)),n.then(function(){if(t.b){for(var n in e.video)t.a[n]=e.video[n];for(var i in e.playerAfterLoad)t.b[i](e.playerAfterLoad[i]);t.a.autoplay=r,e.manifest&&(t.a.play(),xn(t,0))}},function(e){t.b.dispatchEvent(new At("error",{detail:e}))})}function An(t){return!(!t.j||!t.a.duration&&!t.b.P())&&(_n(t),t.j=!1,!0)}function _n(t){xn(t,0,{contentId:t.b.Ib(),streamType:t.b.P()?"LIVE":"BUFFERED",duration:t.a.duration,contentType:""})}function In(t,e,n,i){t.o&&(t=ln(e),i?n.getCastChannel(i).send(t):n.broadcast(t))}function xn(t,e,n){var i=t.a.playbackRate,r=Dc;r=t.h?r.IDLE:t.b.xc()?r.Yc:t.a.paused?r.$c:r.ad,i={mediaSessionId:0,playbackRate:i,playerState:r,currentTime:t.a.currentTime,supportedMediaCommands:15,volume:{level:t.a.volume,muted:t.a.muted}},n&&(i.media=n),In(t,{requestId:e,type:"MEDIA_STATUS",status:[i]},t.i)}function Pn(t,e){var n=Rn(t,e);return 1!=n.length?null:n[0]}function Rn(t,e){return Array.prototype.filter.call(t.childNodes,function(t){return t instanceof Element&&t.tagName==e})}function Nn(t){return Array.prototype.filter.call(t.childNodes,function(t){return t instanceof Element&&"pssh"==t.localName&&"urn:mpeg:cenc:2013"==t.namespaceURI})}function Dn(t,e,n){return t.hasAttributeNS(e,n)?t.getAttributeNS(e,n):null}function Cn(t){return Array.prototype.every.call(t.childNodes,function(t){return t.nodeType==Node.TEXT_NODE||t.nodeType==Node.CDATA_SECTION_NODE})?t.textContent.trim():null}function Mn(t,e,n,i){var r=null;return t=t.getAttribute(e),null!=t&&(r=n(t)),null==r?void 0!=i?i:null:r}function Ln(t){return t?(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t)&&(t+="Z"),t=Date.parse(t),isNaN(t)?null:Math.floor(t/1e3)):null}function On(t){return t&&(t=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(t))?(t=31536e3*Number(t[1]||null)+2592e3*Number(t[2]||null)+86400*Number(t[3]||null)+3600*Number(t[4]||null)+60*Number(t[5]||null)+Number(t[6]||null),isFinite(t)?t:null):null}function Un(t){var e=/([0-9]+)-([0-9]+)/.exec(t);return e?(t=Number(e[1]),isFinite(t)?(e=Number(e[2]),isFinite(e)?{start:t,end:e}:null):null):null}function jn(t){return t=Number(t),0==t%1?t:null}function Bn(t){return t=Number(t),0==t%1&&0<t?t:null}function Fn(t){return t=Number(t),0==t%1&&0<=t?t:null}function Vn(t){var e;return t=(e=t.match(/^(\d+)\/(\d+)$/))?Number(e[1]/e[2]):Number(t),isNaN(t)?null:t}function Kn(t,e,n){t=Gn(t);var i=null,r=[],a=[],o=t.map(function(t){return t.keyId}).filter(Pt);if(o.length&&1<o.filter(Rt).length)throw new z(2,4,4010);n||(a=t.filter(function(t){return"urn:mpeg:dash:mp4protection:2011"!=t.Pc||(i=t.init||i,!1)}),a.length&&(r=qn(i,e,a),0==r.length&&(r=[Dt("",i)]))),!t.length||!n&&a.length||(r=$u.values(Cc).filter(function(t){return"org.w3.clearkey"!=t}).map(function(t){return Dt(t,i)}));var s=o[0]||null;return s&&r.forEach(function(t){t.initData.forEach(function(t){t.keyId=s})}),{nc:s,gf:i,drmInfos:r,sc:!0}}function Hn(t,e,n,i){var r=Kn(t,e,i);if(n.sc)t=1==n.drmInfos.length&&!n.drmInfos[0].keySystem,e=0==r.drmInfos.length,(0==n.drmInfos.length||t&&!e)&&(n.drmInfos=r.drmInfos),n.sc=!1;else if(0<r.drmInfos.length&&(n.drmInfos=n.drmInfos.filter(function(t){return r.drmInfos.some(function(e){return e.keySystem==t.keySystem})}),0==n.drmInfos.length))throw new z(2,4,4008);return r.nc||n.nc}function qn(t,e,n){return n.map(function(n){var i=Cc[n.Pc];return i?[Dt(i,n.init||t)]:e(n.node)||[]}).reduce(It,[])}function Gn(t){return t.map(function(t){var e=t.getAttribute("schemeIdUri"),n=Dn(t,"urn:mpeg:cenc:2013","default_KID"),i=Nn(t).map(Cn);if(!e)return null;if(e=e.toLowerCase(),n&&(n=n.replace(/-/g,"").toLowerCase(),0<=n.indexOf(" ")))throw new z(2,4,4009);var r=[];try{r=i.map(function(t){return{initDataType:"cenc",initData:Ht(t),keyId:null}})}catch(t){throw new z(2,4,4007)}return{node:t,Pc:e,keyId:n,init:0<r.length?r:null}}).filter(Pt)}function Xn(e,n,i,r,a){var o={RepresentationID:n,Number:i,Bandwidth:r,Time:a};return e.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,function(e,n,i,r){if("$$"==e)return"$";var a=o[n];if(null==a)return e;switch("RepresentationID"==n&&i&&(i=void 0),"Time"==n&&(a=Math.round(a)),r){case void 0:case"d":case"i":case"u":e=a.toString();break;case"o":e=a.toString(8);break;case"x":e=a.toString(16);break;case"X":e=a.toString(16).toUpperCase();break;default:e=a.toString()}return i=t.parseInt(i,10)||1,Array(Math.max(0,i-e.length)+1).join("0")+e})}function Yn(t,e){var n=zn(t,e,"timescale"),i=1;n&&(i=Bn(n)||1),n=zn(t,e,"duration"),(n=Bn(n||""))&&(n/=i);var r=zn(t,e,"startNumber"),a=Number(zn(t,e,"presentationTimeOffset"))||0,o=Fn(r||"");null!=r&&null!=o||(o=1);var s=Wn(t,e,"SegmentTimeline");if(r=null,s){r=i;var u=t.M.duration||1/0;s=Rn(s,"S");for(var c=[],h=0,l=0;l<s.length;++l){var f=s[l],d=Mn(f,"t",Fn),p=Mn(f,"d",Fn);if(f=Mn(f,"r",jn),null!=d&&(d-=a),!p)break;if(d=null!=d?d:h,0>(f=f||0))if(l+1<s.length){if(null==(f=Mn(s[l+1],"t",Fn)))break;if(d>=f)break;f=Math.ceil((f-d)/p)-1}else{if(1/0==u)break;if(d/r>=u)break;f=Math.ceil((u*r-d)/p)-1}0<c.length&&d!=h&&(c[c.length-1].end=d/r);for(var m=0;m<=f;++m)h=d+p,c.push({start:d/r,end:h/r,We:d}),d=h}r=c}return{timescale:i,R:n,Ea:o,da:a/i||0,ic:a,H:r}}function zn(t,e,n){return[e(t.v),e(t.W),e(t.ba)].filter(Pt).map(function(t){return t.getAttribute(n)}).reduce(function(t,e){return t||e})}function Wn(t,e,n){return[e(t.v),e(t.W),e(t.ba)].filter(Pt).map(function(t){return Pn(t,n)}).reduce(function(t,e){return t||e})}function $n(t,e){var n=new DOMParser;try{var i=Mt(t),r=n.parseFromString(i,"text/xml")}catch(t){}if(r&&r.documentElement.tagName==e)var a=r.documentElement;return a&&0<a.getElementsByTagName("parsererror").length?null:a}function Jn(t,e,n,i,r,a){for(var o=Dn(t,"http://www.w3.org/1999/xlink","href"),s=Dn(t,"http://www.w3.org/1999/xlink","actuate")||"onRequest",u=0;u<t.attributes.length;u++){var c=t.attributes[u];"http://www.w3.org/1999/xlink"==c.namespaceURI&&(t.removeAttributeNS(c.namespaceURI,c.localName),--u)}if(5<=a)return $(new z(2,4,4028));if("onLoad"!=s)return $(new z(2,4,4027));var h=Nt([i],[o]);return r.request(0,pt(h,e)).X(function(i){if(!(i=$n(i.data,t.tagName)))return $(new z(2,4,4001,o));for(;t.childNodes.length;)t.removeChild(t.childNodes[0]);for(;i.childNodes.length;){var s=i.childNodes[0];i.removeChild(s),t.appendChild(s)}for(s=0;s<i.attributes.length;s++){var u=i.attributes[s].nodeName,c=i.getAttribute(u);t.setAttribute(u,c)}return Qn(t,e,n,h[0],r,a+1)})}function Qn(t,e,n,i,r,a){if(a=a||0,Dn(t,"http://www.w3.org/1999/xlink","href")){var o=Jn(t,e,n,i,r,a);return n&&(o=o.X(void 0,function(){return Qn(t,e,n,i,r,a)})),o}o=[];for(var s=0;s<t.childNodes.length;s++){var u=t.childNodes[s];u instanceof Element&&("urn:mpeg:dash:resolve-to-zero:2013"==Dn(u,"http://www.w3.org/1999/xlink","href")?(t.removeChild(u),--s):"SegmentTimeline"!=u.tagName&&o.push(Qn(u,e,n,i,r,a)))}return tt(o).X(function(){return t})}function Zn(t,e,n){this.c=t,this.b=e,this.a=n}function ti(t,e,n,i,r,a){this.position=t,this.startTime=e,this.endTime=n,this.c=i,this.b=r,this.a=a}function ei(t,e){this.D=t,this.b=e==Mc,this.a=0}function ni(){throw new z(2,3,3e3)}function ii(){this.c=[],this.b=[],this.a=!1}function ri(t){for(;t.reader.ha()&&!t.parser.a;)t.parser.xb(t.start,t.reader,t.partialOkay)}function ai(t){for(var e=t.reader.B();0<e&&!t.parser.a;--e)t.parser.xb(t.start,t.reader,t.partialOkay)}function oi(t){return function(e){t(e.reader.Da(e.reader.D.byteLength-e.reader.U()))}}function si(t){for(var e=0,n=0;n<t.length;n++)e=e<<8|t.charCodeAt(n);return e}function ui(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)}function ci(t,e,n,i){var r,a=(new ii).Z("sidx",function(t){r=hi(e,i,n,t)});if(t&&a.parse(t),r)return r;throw new z(2,3,3004)}function hi(t,e,n,i){var r=[];i.reader.F(4);var a=i.reader.B();if(0==a)throw new z(2,3,3005);if(0==i.version)var o=i.reader.B(),s=i.reader.B();else o=i.reader.Ra(),s=i.reader.Ra();i.reader.F(2);var u=i.reader.bb();for(t=t+i.size+s,s=0;s<u;s++){var c=i.reader.B(),h=(2147483648&c)>>>31;c&=2147483647;var l=i.reader.B();if(i.reader.F(4),1==h)throw new z(2,3,3006);r.push(new ti(r.length,o/a-e,(o+l)/a-e,function(){return n},t,t+c-1)),o+=l,t+=c}return i.parser.stop(),r}function li(t){this.a=t}function fi(t,e){for(;t.a.length&&t.a[t.a.length-1].startTime>=e;)t.a.pop();for(;t.a.length&&0>=t.a[0].endTime;)t.a.shift();if(0!=t.a.length){var n=t.a[t.a.length-1];t.a[t.a.length-1]=new ti(n.position,n.startTime,e,n.c,n.b,n.a)}}function di(t){this.b=t,this.a=new ei(t,0),Lc||(Lc=[new Uint8Array([255]),new Uint8Array([127,255]),new Uint8Array([63,255,255]),new Uint8Array([31,255,255,255]),new Uint8Array([15,255,255,255,255]),new Uint8Array([7,255,255,255,255,255]),new Uint8Array([3,255,255,255,255,255,255]),new Uint8Array([1,255,255,255,255,255,255,255])])}function pi(t){var e=mi(t);if(7<e.length)throw new z(2,3,3002);for(var n=0,i=0;i<e.length;i++)n=256*n+e[i];e=n,n=mi(t);t:{for(i=0;i<Lc.length;i++)if(Xt(n,Lc[i])){i=!0;break t}i=!1}if(i)n=t.b.byteLength-t.a.U();else{if(8==n.length&&224&n[1])throw new z(2,3,3001);i=n[0]&(1<<8-n.length)-1;for(var r=1;r<n.length;r++)i=256*i+n[r];n=i}return n=t.a.U()+n<=t.b.byteLength?n:t.b.byteLength-t.a.U(),i=new DataView(t.b.buffer,t.b.byteOffset+t.a.U(),n),t.a.F(n),new vi(e,i)}function mi(t){var e,n=t.a.ca();for(e=1;8>=e&&!(n&1<<8-e);e++);if(8<e)throw new z(2,3,3002);var i=new Uint8Array(e);for(i[0]=n,n=1;n<e;n++)i[n]=t.a.ca();return i}function vi(t,e){this.id=t,this.a=e}function yi(t){if(8<t.a.byteLength)throw new z(2,3,3002);if(8==t.a.byteLength&&224&t.a.getUint8(0))throw new z(2,3,3001);for(var e=0,n=0;n<t.a.byteLength;n++){e=256*e+t.a.getUint8(n)}return e}function gi(){}function bi(t,e,n,i,r,a){function o(){return r}var s=[];t=new di(t.a);for(var u=null,c=null;t.ha();){var h=pi(t);if(187==h.id){var l=wi(h);l&&(h=n*l.Xe,l=e+l.re,null!=u&&s.push(new ti(s.length,u-a,h-a,o,c,l-1)),u=h,c=l)}}return null!=u&&s.push(new ti(s.length,u-a,i-a,o,c,null)),s}function wi(t){var e=new di(t.a);if(t=pi(e),179!=t.id)throw new z(2,3,3013);if(t=yi(t),e=pi(e),183!=e.id)throw new z(2,3,3012);e=new di(e.a);for(var n=0;e.ha();){var i=pi(e);if(241==i.id){n=yi(i);break}}return{Xe:t,re:n}}function Ti(t,e){var n=Wn(t,e,"Initialization");if(!n)return null;var i=t.v.ea,r=n.getAttribute("sourceURL");r&&(i=Nt(t.v.ea,[r])),r=0;var a=null;return(n=Mn(n,"range",Un))&&(r=n.start,a=n.end),new Zn(function(){return i},r,a)}function Ei(t,e){var n=Number(zn(t,ki,"presentationTimeOffset"))||0,i=zn(t,ki,"timescale"),r=1;i&&(r=Bn(i)||1),n=n/r||0,i=Ti(t,ki);var a=t.v.contentType;if(r=t.v.mimeType.split("/")[1],"text"!=a&&"mp4"!=r&&"webm"!=r)throw new z(2,4,4006);if("webm"==r&&!i)throw new z(2,4,4005);a=Wn(t,ki,"RepresentationIndex");var o=zn(t,ki,"indexRange"),s=t.v.ea;if(o=Un(o||""),a){var u=a.getAttribute("sourceURL");u&&(s=Nt(t.v.ea,[u])),o=Mn(a,"range",Un,o)}if(!o)throw new z(2,4,4002);return r=Si(t,e,i,s,o.start,o.end,r,n),{createSegmentIndex:r.createSegmentIndex,findSegmentPosition:r.findSegmentPosition,getSegmentReference:r.getSegmentReference,initSegmentReference:i,da:n}}function Si(t,e,n,i,r,a,o,s){var u=t.presentationTimeline,c=!t.Ia||!t.M.Lb,h=t.M.index,l=t.M.duration,f=e,d=null;return{createSegmentIndex:function(){var t=[f(i,r,a),"webm"==o?f(n.c(),n.b,n.a):null];return f=null,Promise.all(t).then(function(t){var e=t[0];t=t[1]||null,e="mp4"==o?ci(e,r,i,s):(new gi).parse(e,t,i,s),u.Na(e,0==h),d=new li(e),c&&fi(d,l)})},findSegmentPosition:function(t){return d.find(t)},getSegmentReference:function(t){return d.get(t)}}}function ki(t){return t.cb}function Ai(t,e){var n=Ti(t,_i),i=xi(t),r=Yn(t,_i),a=r.Ea;0==a&&(a=1);var o=0;if(r.R?o=r.R*(a-1):r.H&&0<r.H.length&&(o=r.H[0].start),i={R:r.R,startTime:o,Ea:a,da:r.da,H:r.H,Ma:i},!i.R&&!i.H&&1<i.Ma.length)throw new z(2,4,4002);if(!i.R&&!t.M.duration&&!i.H&&1==i.Ma.length)throw new z(2,4,4002);if(i.H&&0==i.H.length)throw new z(2,4,4002);return a=r=null,t.ba.id&&t.v.id&&(a=t.ba.id+","+t.v.id,r=e[a]),o=Ii(t.M.duration,i.Ea,t.v.ea,i),r?(r.Pb(o),a=t.presentationTimeline.Xa(),r.Fb(a-t.M.start)):(t.presentationTimeline.Na(o,0==t.M.index),r=new li(o),a&&t.Ia&&(e[a]=r)),t.Ia&&t.M.Lb||fi(r,t.M.duration),{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:r.find.bind(r),getSegmentReference:r.get.bind(r),initSegmentReference:n,da:i.da}}function _i(t){return t.ta}function Ii(t,e,n,i){var r=i.Ma.length;i.H&&i.H.length!=i.Ma.length&&(r=Math.min(i.H.length,i.Ma.length));for(var a=[],o=i.startTime,s=0;s<r;s++){var u=i.Ma[s],c=Nt(n,[u.Gd]),h=void 0;h=null!=i.R?o+i.R:i.H?i.H[s].end:o+t,a.push(new ti(s+e,o,h,function(t){return t}.bind(null,c),u.start,u.end)),o=h}return a}function xi(t){return[t.v.ta,t.W.ta,t.ba.ta].filter(Pt).map(function(t){return Rn(t,"SegmentURL")}).reduce(function(t,e){return 0<t.length?t:e}).map(function(e){e.getAttribute("indexRange")&&!t.wc&&(t.wc=!0);var n=e.getAttribute("media");return e=Mn(e,"mediaRange",Un,{start:0,end:null}),{Gd:n,start:e.start,end:e.end}})}function Pi(t,e,n,i){var r=Ci(t),a=Yn(t,Ri),o=zn(t,Ri,"media"),s=zn(t,Ri,"index");if(a={R:a.R,timescale:a.timescale,Ea:a.Ea,da:a.da,ic:a.ic,H:a.H,Ob:o,Za:s},o=a.Za?1:0,o+=a.H?1:0,0==(o+=a.R?1:0))throw new z(2,4,4002);if(1!=o&&(a.Za&&(a.H=null),a.R=null),!a.Za&&!a.Ob)throw new z(2,4,4002);if(a.Za){if("mp4"!=(n=t.v.mimeType.split("/")[1])&&"webm"!=n)throw new z(2,4,4006);if("webm"==n&&!r)throw new z(2,4,4005);i=Xn(a.Za,t.v.id,null,t.bandwidth||null,null),i=Nt(t.v.ea,[i]),t=Si(t,e,r,i,0,null,n,a.da)}else a.R?(i||t.presentationTimeline.Rb(a.R),t=Ni(t,a)):(o=e=null,t.ba.id&&t.v.id&&(o=t.ba.id+","+t.v.id,e=n[o]),s=Di(t,a),i=!t.Ia||!t.M.Lb,e?(i&&fi(new li(s),t.M.duration),e.Pb(s),n=t.presentationTimeline.Xa(),e.Fb(n-t.M.start)):(t.presentationTimeline.Na(s,0==t.M.index),e=new li(s),o&&t.Ia&&(n[o]=e)),i&&fi(e,t.M.duration),t={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:e.find.bind(e),getSegmentReference:e.get.bind(e)});return{createSegmentIndex:t.createSegmentIndex,findSegmentPosition:t.findSegmentPosition,getSegmentReference:t.getSegmentReference,initSegmentReference:r,da:a.da}}function Ri(t){return t.fb}function Ni(t,e){var n=t.M.duration,i=e.R,r=e.Ea,a=e.timescale,o=e.Ob,s=t.bandwidth||null,u=t.v.id,c=t.v.ea;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(t){return 0>t||n&&t>=n?null:Math.floor(t/i)},getSegmentReference:function(t){var e=t*i,h=e+i;return n&&(h=Math.min(h,n)),0>h||n&&e>=n?null:new ti(t,e,h,function(){var n=Xn(o,u,t+r,s,e*a);return Nt(c,[n])},0,null)}}}function Di(t,e){for(var n=[],i=0;i<e.H.length;i++){var r=i+e.Ea;n.push(new ti(r,e.H[i].start,e.H[i].end,function(t,e,n,i,r,a){return t=Xn(t,e,r,n,a),Nt(i,[t]).map(function(t){return t.toString()})}.bind(null,e.Ob,t.v.id,t.bandwidth||null,t.v.ea,r,e.H[i].We+e.ic),0,null))}return n}function Ci(t){var e=zn(t,Ri,"initialization");if(!e)return null;var n=t.v.id,i=t.bandwidth||null,r=t.v.ea;return new Zn(function(){var t=Xn(e,n,null,i,null);return Nt(r,[t])},0,null)}function Mi(){var t,e={};for(t in Oc)e[t]=!0;for(var n in Uc)e[n]=!0;return["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"].forEach(function(t){e[t]=!!Oc[t]}),["mpd","m3u8","ism"].forEach(function(t){e[t]=!!Uc[t]}),e}function Li(t,e,n,i){var r=i;return r||(i=new L(t).aa.split("/").pop().split("."),1<i.length&&(i=i.pop().toLowerCase(),r=Uc[i])),r?Promise.resolve(r):(n=pt([t],n),n.method="HEAD",e.request(0,n).promise.then(function(e){return(e=e.headers["content-type"])&&(e=e.toLowerCase()),(r=Oc[e])?r:Promise.reject(new z(2,4,4e3,t))},function(t){return t.severity=2,Promise.reject(t)}))}function Oi(t,e){this.f=t,this.l=e,this.c=this.b=1/0,this.a=1,this.j=this.h=0,this.i=!0,this.g=0}function Ui(){this.a=this.b=null,this.h=[],this.c=null,this.j=[],this.i=1,this.l={},this.m=0,this.o=new P(5),this.g=null,this.f=new ht}function ji(t){var e=Date.now(),n=t.a.networkingEngine.request(0,pt(t.h,t.b.retryParameters));return lt(t.f,n),n.promise.then(function(e){if(t.a)return Bi(t,e.data,e.uri)}).then(function(){var n=(Date.now()-e)/1e3;return R(t.o,1,n),n})}function Bi(t,e,n){if(!(e=$n(e,"MPD")))throw new z(2,4,4001,n);return e=Qn(e,t.b.retryParameters,t.b.dash.xlinkFailGracefully,n,t.a.networkingEngine),lt(t.f,e),e.promise.then(function(e){return Fi(t,e,n)})}function Fi(t,e,n){n=[n];var i=Rn(e,"Location").map(Cn).filter(Pt);0<i.length&&(n=t.h=i),i=Rn(e,"BaseURL").map(Cn),n=Nt(n,i);var r=Mn(e,"minBufferTime",On);t.m=Mn(e,"minimumUpdatePeriod",On,-1);var a=Mn(e,"availabilityStartTime",Ln);i=Mn(e,"timeShiftBufferDepth",On);var o=Mn(e,"suggestedPresentationDelay",On),s=Mn(e,"maxSegmentDuration",On),u=e.getAttribute("type")||"static";if(t.c)var c=t.c.presentationTimeline;else{var h=Math.max(t.b.dash.defaultPresentationDelay,1.5*r);c=new Oi(a,null!=o?o:h)}a=Vi(t,{Ia:"static"!=u,presentationTimeline:c,ba:null,M:null,W:null,v:null,bandwidth:0,wc:!1},n,e),o=a.duration;var l=a.periods;return c.yb("static"==u),"static"!=u&&a.oc||c.ka(o||1/0),(u=c.P())&&!isNaN(t.b.availabilityWindowOverride)&&(i=t.b.availabilityWindowOverride),null==i&&(i=1/0),c.dc(i),c.Rb(s||1),t.c?Promise.resolve():(e=Rn(e,"UTCTiming"),$i(t,n,e,u).then(function(t){this.a&&(c.Rc(t),this.c={presentationTimeline:c,periods:l,offlineSessionIds:[],minBufferTime:r||0})}.bind(t)))}function Vi(t,e,n,i){var r=Mn(i,"mediaPresentationDuration",On),a=[],o=0;i=Rn(i,"Period");for(var s=0;s<i.length;s++){var u=i[s];o=Mn(u,"start",On,o);var c=Mn(u,"duration",On),h=null;if(s!=i.length-1){var l=Mn(i[s+1],"start",On);null!=l&&(h=l-o)}else null!=r&&(h=r-o);if(null==h&&(h=c),u=Ki(t,e,n,{start:o,duration:h,node:u,index:s,Lb:null==h||s==i.length-1}),a.push(u),c=e.ba.id,-1==t.j.indexOf(c)&&(t.j.push(c),t.c&&(t.a.filterNewPeriod(u),t.c.periods.push(u))),null==h){o=null;break}o+=h}return null==t.c&&t.a.filterAllPeriods(a),null!=r?{periods:a,duration:r,oc:!1}:{periods:a,duration:o,oc:!0}}function Ki(t,e,n,i){e.ba=Xi(i.node,null,n),e.M=i,e.ba.id||(e.ba.id="__shaka_period_"+i.start),Rn(i.node,"EventStream").forEach(t.ie.bind(t,i.start,i.duration)),n=Rn(i.node,"AdaptationSet").map(t.ge.bind(t,e)).filter(Pt);var r=n.map(function(t){return t.te}).reduce(It,[]),a=r.filter(Rt);if(e.Ia&&r.length!=a.length)throw new z(2,4,4018);var o=n.filter(function(t){return!t.hc});if(n.filter(function(t){return t.hc}).forEach(function(t){var e=t.streams[0],n=t.hc;o.forEach(function(t){t.id==n&&t.streams.forEach(function(t){t.trickModeVideo=e})})}),n=Hi(o,"video"),r=Hi(o,"audio"),!n.length&&!r.length)throw new z(2,4,4004);for(r.length||(r=[null]),n.length||(n=[null]),e=[],a=0;a<r.length;a++)for(var s=0;s<n.length;s++)qi(t,r[a],n[s],e);for(t=Hi(o,"text"),n=[],r=0;r<t.length;r++)n.push.apply(n,t[r].streams);return{startTime:i.start,textStreams:n,variants:e}}function Hi(t,e){return t.filter(function(t){return t.contentType==e})}function qi(t,e,n,i){if(e||n)if(e&&n){var r=e.drmInfos,a=n.drmInfos;if(r.length&&a.length?0<fe(r,a).length:1){a=fe(e.drmInfos,n.drmInfos);for(var o=0;o<e.streams.length;o++)for(var s=0;s<n.streams.length;s++)r=(n.streams[s].bandwidth||0)+(e.streams[o].bandwidth||0),r={id:t.i++,language:e.language,primary:e.Nb||n.Nb,audio:e.streams[o],video:n.streams[s],bandwidth:r,drmInfos:a,allowedByApplication:!0,allowedByKeySystem:!0},i.push(r)}}else for(a=e||n,o=0;o<a.streams.length;o++)r=a.streams[o].bandwidth||0,r={id:t.i++,language:a.language||"und",primary:a.Nb,audio:e?a.streams[o]:null,video:n?a.streams[o]:null,bandwidth:r,drmInfos:a.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0},i.push(r)}function Gi(e,n){0>e.m||(e.g=t.setTimeout(e.Pe.bind(e),1e3*Math.max(3,e.m-n,N(e.o))))}function Xi(t,e,n){e=e||{contentType:"",mimeType:"",codecs:"",containsEmsgBoxes:!1,frameRate:void 0,Sb:null},n=n||e.ea;var i=Rn(t,"BaseURL").map(Cn),r=t.getAttribute("contentType")||e.contentType,a=t.getAttribute("mimeType")||e.mimeType,o=t.getAttribute("codecs")||e.codecs,s=Mn(t,"frameRate",Vn)||e.frameRate,u=!!Rn(t,"InbandEventStream").length,c=Rn(t,"AudioChannelConfiguration");return c=Yi(c)||e.Sb,r||(r=Ji(a,o)),{ea:Nt(n,i),cb:Pn(t,"SegmentBase")||e.cb,ta:Pn(t,"SegmentList")||e.ta,fb:Pn(t,"SegmentTemplate")||e.fb,width:Mn(t,"width",Fn)||e.width,height:Mn(t,"height",Fn)||e.height,contentType:r,mimeType:a,codecs:o,frameRate:s,containsEmsgBoxes:u||e.containsEmsgBoxes,id:t.getAttribute("id"),Sb:c}}function Yi(t){for(var e=0;e<t.length;++e){var n=t[e],i=n.getAttribute("schemeIdUri");if(i&&(n=n.getAttribute("value")))switch(i){case"urn:mpeg:dash:outputChannelPositionList:2012":return n.trim().split(/ +/).length;case"urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case"urn:dts:dash:audio_channel_configuration:2012":if(!(i=parseInt(n,10)))continue;return i;case"tag:dolby.com,2014:dash:audio_channel_configuration:2011":case"urn:dolby:dash:audio_channel_configuration:2011":if(i=parseInt(n,16)){for(t=0;i;)1&i&&++t,i>>=1;return t}}}return null}function zi(t){var e=t.cb?1:0;return e+=t.ta?1:0,0==(e+=t.fb?1:0)?"text"==t.contentType||"application"==t.contentType:(1!=e&&(t.cb&&(t.ta=null),t.fb=null),!0)}function Wi(t,e,n,i){return e=Nt(e,[n]),e=pt(e,t.b.retryParameters),e.method=i,e=t.a.networkingEngine.request(0,e),lt(t.f,e),e.promise.then(function(t){if("HEAD"==i){if(!t.headers||!t.headers.date)return 0;t=t.headers.date}else t=Mt(t.data);return t=Date.parse(t),isNaN(t)?0:t-Date.now()})}function $i(t,e,n,i){n=n.map(function(t){return{scheme:t.getAttribute("schemeIdUri"),value:t.getAttribute("value")}});var r=t.b.dash.clockSyncUri;return i&&!n.length&&r&&n.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:r}),_t(n,function(t){var n=t.value;switch(t.scheme){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return Wi(this,e,n,"HEAD");case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":return Wi(this,e,n,"GET");case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return t=Date.parse(n),isNaN(t)?0:t-Date.now();case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:return Promise.reject()}}.bind(t)).catch(function(){return 0})}function Ji(t,e){return mc[Ct(t,e)]?"text":t.split("/")[0]}function Qi(t,e,n,i){this.uri=t,this.type=e,this.a=n,this.segments=i||null}function Zi(t,e,n,i){this.id=t,this.name=e,this.a=n,this.value=i||null}function tr(t,e){this.name=t,this.value=e}function er(t,e,n){return n=n||null,(t=t.getAttribute(e))?t.value:n}function nr(t,e){this.a=e,this.uri=t}function ir(t,e){return t.filter(function(t){return t.name==e})}function rr(t,e){var n=ir(t,e);return n.length?n[0]:null}function ar(t,e,n){return t.filter(function(t){var i=t.getAttribute("TYPE");return t=t.getAttribute("GROUP-ID"),i.value==e&&t.value==n})}function or(t,e){return Nt([t],[e])[0]}function sr(t){this.b=t,this.a=0}function ur(t){cr(t,/[ \t]+/gm)}function cr(t,e){e.lastIndex=t.a;var n=e.exec(t.b);return n=null==n?null:{position:n.index,length:n[0].length,we:n},t.a==t.b.length||null==n||n.position!=t.a?null:(t.a+=n.length,n.we)}function hr(t){return t.a==t.b.length?null:(t=cr(t,/[^ \t\n]*/gm))?t[0]:null}function lr(){this.a=0}function fr(t,e,n){e=Mt(e),e=e.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();var i=e.split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(i[0]))throw new z(2,4,4015);e=0;for(var r=1;r<i.length;r++)if(!/^#(?!EXT)/m.test(i[r])){var a=pr(t,i[r]);if(--t.a,0<=jc.indexOf(a.name)){e=1;break}"EXT-X-STREAM-INF"==a.name&&(r+=1)}for(r=[],a=1;a<i.length;)if(/^#(?!EXT)/m.test(i[a]))a+=1;else{var o=pr(t,i[a]);if(0<=Bc.indexOf(o.name)){if(1!=e)throw new z(2,4,4017);return i=i.splice(a,i.length-a),t=dr(t,i,r),new Qi(n,e,r,t)}r.push(o),a+=1,"EXT-X-STREAM-INF"==o.name&&(o.a.push(new tr("URI",i[a])),a+=1)}return new Qi(n,e,r)}function dr(t,e,n){var i=[],r=[];return e.forEach(function(e){if(/^(#EXT)/.test(e))e=pr(t,e),0<=jc.indexOf(e.name)?n.push(e):r.push(e);else{if(/^#(?!EXT)/m.test(e))return[];i.push(new nr(e.trim(),r)),r=[]}}),i}function pr(t,e){t:{var n=t.a++,i=e.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!i)throw new z(2,4,4016,e);var r=i[1],a=i[2];if(i=[],a&&0<=a.indexOf("=")){a=new sr(a);for(var o,s=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;o=cr(a,s);)i.push(new tr(o[1],o[2]||o[3]))}else if(a){n=new Zi(n,r,i,a);break t}n=new Zi(n,r,i)}return n}function mr(t){try{var e=mr.parse(t);return Q({uri:t,data:e.data,headers:{"content-type":e.contentType}})}catch(t){return $(t)}}function vr(){this.g=this.c=null,this.L=1,this.u={},this.I={},this.Y={},this.a={},this.b=null,this.m="",this.s=new lr,this.j=this.i=null,this.f=Hc,this.o=null,this.l=0,this.A=1/0,this.h=new ht,this.G=[]}function yr(t,e,n){Vr(t,n).then(function(t){var i=qc,r=fr(this.s,t.data,n);if(1!=r.type)throw new z(2,4,4017);t=rr(r.a,"EXT-X-MEDIA-SEQUENCE");var a=e.stream;Dr(this,r,t?Number(t.value):0,a.mimeType,a.codecs).then(function(t){e.eb.a=t,t=t[t.length-1],rr(r.a,"EXT-X-ENDLIST")&&(Hr(this,i.ra),this.b.ka(t.endTime))}.bind(this))}.bind(t))}function gr(t,e,n){if(e=fr(t.s,e,n),0!=e.type)throw new z(2,4,4022);return br(t,e).then(function(t){this.c.filterAllPeriods([t]);var e=1/0,n=0,i=0,r=1/0;for(o in this.a){var a=this.a[o];e=Math.min(e,a.Qb),n=Math.max(n,a.Qb),i=Math.max(i,a.Fd),"text"!=a.stream.type&&(r=Math.min(r,a.duration))}var o=null;if(a=0,this.f!=qc.ra&&(o=Date.now()/1e3-i,a=3*this.l),this.b=new Oi(o,a),this.b.yb(this.f==qc.ra),Nr(this),this.f!=qc.ra){for(e=3*this.l,this.b.Sc(e),this.i=this.A,this.f==qc.jc&&(isNaN(this.g.availabilityWindowOverride)||(e=this.g.availabilityWindowOverride),this.b.dc(e)),e=0;95443.7176888889<=n;)e+=95443.7176888889,n-=95443.7176888889;if(e)for(var s in this.a)n=this.a[s],95443.7176888889>n.Qb&&(n.stream.presentationTimeOffset=-e,n.eb.offset(e))}else{this.b.ka(r);for(var u in this.a)s=this.a[u],s.stream.presentationTimeOffset=e,s.eb.offset(-e),fi(s.eb,r)}this.o={presentationTimeline:this.b,periods:[t],offlineSessionIds:[],minBufferTime:0}}.bind(t))}function br(t,e){var n=e.a,i=ir(e.a,"EXT-X-MEDIA").filter(function(t){return"SUBTITLES"==Br(t,"TYPE")}.bind(t)).map(function(t){return kr(this,t)}.bind(t));return Promise.all(i).then(function(t){var i=ir(n,"EXT-X-STREAM-INF").map(function(t){return wr(this,t,e)}.bind(this));return Promise.all(i).then(function(e){return{startTime:0,variants:e.reduce(It,[]),textStreams:t}}.bind(this))}.bind(t))}function wr(t,e,n){var i=er(e,"CODECS","avc1.42E01E,mp4a.40.2").split(/\s*,\s*/),r=e.getAttribute("RESOLUTION"),a=null,o=null,s=er(e,"FRAME-RATE"),u=Number(Br(e,"BANDWIDTH"));if(r){var c=r.value.split("x");a=c[0],o=c[1]}n=ir(n.a,"EXT-X-MEDIA");var h=er(e,"AUDIO"),l=er(e,"VIDEO");if(h?n=ar(n,"AUDIO",h):l&&(n=ar(n,"VIDEO",l)),c=Ur("text",i)){var f=er(e,"SUBTITLES");f&&(f=ar(n,"SUBTITLES",f),f.length&&(t.u[f[0].id].stream.codecs=c)),i.splice(i.indexOf(c),1)}n=n.map(function(t){return Ar(this,t,i)}.bind(t));var d=[],p=[];return Promise.all(n).then(function(t){if(h?d=t:l&&(p=t),t=!1,d.length||p.length)if(d.length)if(Br(e,"URI")==d[0].$b){var n="audio";t=!0}else n="video";else n="audio";else 1==i.length?(n=Ur("video",i),n=r||s||n?"video":"audio"):(n="video",i=[i.join(",")]);return t?Promise.resolve():Ir(this,e,i,n)}.bind(t)).then(function(t){return t&&("audio"==t.stream.type?d=[t]:p=[t]),p&&Tr(p),d&&Tr(d),Er(this,d,p,u,a,o,s)}.bind(t))}function Tr(t){t.forEach(function(t){var e=t.stream.codecs.split(",");e=e.filter(function(t){return"mp4a.40.34"!=t}),t.stream.codecs=e.join(",")})}function Er(t,e,n,i,r,a,o){n.forEach(function(t){(t=t.stream)&&(t.width=Number(r)||void 0,t.height=Number(a)||void 0,t.frameRate=Number(o)||void 0)}.bind(t)),e.length||(e=[null]),n.length||(n=[null]);for(var s=[],u=0;u<e.length;u++)for(var c=0;c<n.length;c++){var h=e[u]?e[u].stream:null,l=n[c]?n[c].stream:null,f=e[u]?e[u].drmInfos:null,d=n[c]?n[c].drmInfos:null,p=void 0;if(h&&l){if(!(f.length&&d.length?0<fe(f,d).length:1))continue;p=fe(f,d)}else h?p=f:l&&(p=d);f=(n[u]?n[u].$b:"")+" - "+(e[u]?e[u].$b:""),t.I[f]||(h=Sr(t,h,l,i,p),s.push(h),t.I[f]=h)}return s}function Sr(t,e,n,i,r){return{id:t.L++,language:e?e.language:"und",primary:!!e&&e.primary||!!n&&n.primary,audio:e,video:n,bandwidth:i,drmInfos:r,allowedByApplication:!0,allowedByKeySystem:!0}}function kr(t,e){return Br(e,"TYPE"),Ar(t,e,[]).then(function(t){return t.stream})}function Ar(t,e,n){var i=Br(e,"URI");if(i=or(t.m,i),t.a[i])return Promise.resolve(t.a[i]);var r=Br(e,"TYPE").toLowerCase();"subtitles"==r&&(r="text");var a=Be(er(e,"LANGUAGE","und")),o=er(e,"NAME"),s=e.getAttribute("DEFAULT"),u=e.getAttribute("AUTOSELECT"),c=er(e,"CHANNELS");return xr(t,i,n,r,a,!!s||!!u,o,"audio"==r?_r(c):null).then(function(t){return this.a[i]?this.a[i]:(this.u[e.id]=t,this.a[i]=t)}.bind(t))}function _r(t){return t?(t=t.split("/")[0],parseInt(t,10)):null}function Ir(t,e,n,i){var r=Br(e,"URI");return r=or(t.m,r),t.a[r]?Promise.resolve(t.a[r]):xr(t,r,n,i,"und",!1,null,null).then(function(t){return this.a[r]?this.a[r]:this.a[r]=t}.bind(t))}function xr(t,e,n,i,r,a,o,s){var u=e;e=or(t.m,e);var c,h,l="";return Vr(t,e).then(function(t){if(c=fr(this.s,t.data,e),1!=c.type)throw new z(2,4,4017);t=c;var r=qc,a=rr(t.a,"EXT-X-PLAYLIST-TYPE"),o=rr(t.a,"EXT-X-ENDLIST");if(o=a&&"VOD"==a.value||o,a=a&&"EVENT"==a.value&&!o,a=!o&&!a,o?Hr(this,r.ra):(a?Hr(this,r.jc):Hr(this,r.Zc),t=Fr(t.a,"EXT-X-TARGETDURATION"),t=Number(t.value),this.l=Math.max(t,this.l),this.A=Math.min(t,this.A)),1==n.length)l=n[0];else{if(null==(t=Ur(i,n)))throw new z(2,4,4025,n);l=t}return jr(this,i,l,c)}.bind(t)).then(function(t){return h=t,t=rr(c.a,"EXT-X-MEDIA-SEQUENCE"),Dr(this,c,t?Number(t.value):0,h,l)}.bind(t)).then(function(t){var e=t[0].startTime,n=t[t.length-1].endTime,f=n-e;t=new li(t);var d=Pr(c),p=void 0;"text"==i&&(p="subtitle");var m=[];c.segments.forEach(function(t){t=ir(t.a,"EXT-X-KEY"),m.push.apply(m,t)});var v=!1,y=[],g=null;if(m.forEach(function(t){if("NONE"!=Br(t,"METHOD")){v=!0;var e=Br(t,"KEYFORMAT");(t=(e=Kc[e])?e(t):null)&&(t.keyIds.length&&(g=t.keyIds[0]),y.push(t))}}),v&&!y.length)throw new z(2,4,4026);return d={id:this.L++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:t.find.bind(t),getSegmentReference:t.get.bind(t),initSegmentReference:d,presentationTimeOffset:0,mimeType:h,codecs:l,kind:p,encrypted:v,keyId:g,language:r,label:o||null,type:i,primary:a,trickModeVideo:null,containsEmsgBoxes:!1,frameRate:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:[],channelsCount:s},this.Y[d.id]=t,{stream:d,eb:t,drmInfos:y,$b:u,Qb:e,Fd:n,duration:f}}.bind(t))}function Pr(t){var e=ir(t.a,"EXT-X-MAP");if(!e.length)return null;if(1<e.length)throw new z(2,4,4020);e=e[0];var n=Br(e,"URI"),i=or(t.uri,n);return t=0,n=null,(e=er(e,"BYTERANGE"))&&(t=e.split("@"),e=Number(t[0]),t=Number(t[1]),n=t+e-1),new Zn(function(){return[i]},t,n)}function Rr(t,e,n,i,r){var a=n.a,o=or(t.uri,n.uri);t=Fr(a,"EXTINF").value.split(","),t=r+Number(t[0]),n=0;var s=null;return(a=rr(a,"EXT-X-BYTERANGE"))&&(n=a.value.split("@"),a=Number(n[0]),n=n[1]?Number(n[1]):e.a+1,s=n+a-1),new ti(i,r,t,function(){return[o]},n,s)}function Nr(t){t.b&&(t.G.forEach(function(e){t.b.Na(e,!0)}),t.G=[])}function Dr(t,e,n,i,r){var a=e.segments,o=[],s=or(e.uri,a[0].uri),u=Rr(e,null,a[0],n,0),c=Pr(e);return Mr(t,e.uri,c,u,i,r).then(function(t){s.split("/").pop();for(var i=0;i<a.length;++i){var r=o[o.length-1];r=Rr(e,r,a[i],n+i,0==i?t:r.endTime),o.push(r)}return this.G.push(o),Nr(this),o}.bind(t))}function Cr(t,e){var n=t.c.networkingEngine,i=pt(e.c(),t.g.retryParameters),r={},a=e.b;r.Range="bytes="+a+"-"+(a+2048-1);var o={};return 0==a&&null==e.a||(a="bytes="+a+"-",null!=e.a&&(a+=e.a),o.Range=a),i.headers=r,r=n.request(1,i),lt(t.h,r),r.promise.catch(function(){C("Unable to fetch a partial HLS segment! Falling back to a full segment request, which is expensive! Your server should support Range requests and CORS preflights.",i.uris[0]),i.headers=o;var e=n.request(1,i);return lt(t.h,e),e.promise})}function Mr(t,e,n,i,r,a){return t.o&&(e=t.a[e].eb.get(i.position))?Promise.resolve(e.startTime):(i=[Cr(t,i)],"video/mp4"!=r&&"audio/mp4"!=r||(n?i.push(Cr(t,n)):i.push(i[0])),Promise.all(i).then(function(t){if("video/mp4"==r||"audio/mp4"==r)return Lr(t[0].data,t[1].data);if("audio/mpeg"==r)return 0;if("video/mp2t"==r)return Or(t[0].data);if("application/mp4"==r||0==r.indexOf("text/")){t=t[0].data;var e=Ct(r,a);if(mc[e]){var n=new Se(null);n.f=new mc[e],t=n.Kb(t)}else t=0;return t}throw new z(2,4,4030)}.bind(t)))}function Lr(t,e){var n=0;if((new ii).C("moov",ri).C("trak",ri).C("mdia",ri).Z("mdhd",function(t){t.reader.F(0==t.version?8:16),n=t.reader.B(),t.parser.stop()}).parse(e,!0),!n)throw new z(2,4,4030);var i=0,r=!1;if((new ii).C("moof",ri).C("traf",ri).Z("tfdt",function(t){i=(0==t.version?t.reader.B():t.reader.Ra())/n,r=!0,t.parser.stop()}).parse(t,!0),!r)throw new z(2,4,4030);return i}function Or(t){function e(){throw new z(2,4,4030)}t=new ei(new DataView(t),0);for(var n=0,i=0;;){if(n=t.U(),i=t.ca(),71!=i&&e(),16384&t.bb()||e(),i=(48&t.ca())>>4,0!=i&&2!=i||e(),3==i&&(i=t.ca(),t.F(i)),1==t.B()>>8)return t.F(3),n=t.ca()>>6,0!=n&&1!=n||e(),0==t.ca()&&e(),n=t.ca(),i=t.bb(),t=t.bb(),(1073741824*((14&n)>>1)+((65534&i)<<14|(65534&t)>>1))/9e4;t.seek(n+188),i=t.ca(),71!=i&&(t.seek(n+192),i=t.ca()),71!=i&&(t.seek(n+204),i=t.ca()),71!=i&&e(),t.Oc(1)}}function Ur(t,e){for(var n=Fc[t],i=0;i<n.length;i++)for(var r=0;r<e.length;r++)if(n[i].test(e[r].trim()))return e[r].trim();return"text"==t?"":null}function jr(t,e,n,i){i=or(i.uri,i.segments[0].uri);var r=new L(i).aa.split(".").pop(),a=Vc[e][r];return a?Promise.resolve(a):"text"==e?n&&"vtt"!=n?Promise.resolve("application/mp4"):Promise.resolve("text/vtt"):(e=pt([i],t.g.retryParameters),e.method="HEAD",e=t.c.networkingEngine.request(1,e),lt(t.h,e),e.promise.then(function(t){if(!(t=t.headers["content-type"]))throw new z(2,4,4021,r);return t.split(";")[0]}))}function Br(t,e){var n=t.getAttribute(e);if(!n)throw new z(2,4,4023,e);return n.value}function Fr(t,e){var n=rr(t,e);if(!n)throw new z(2,4,4024,e);return n}function Vr(t,e){var n=t.c.networkingEngine.request(0,pt([e],t.g.retryParameters));return lt(t.h,n),n.promise}function Kr(e,n){null!=e.i&&null!=n&&(e.j=t.setTimeout(e.S.bind(e),1e3*n))}function Hr(e,n){e.f=n,e.b&&e.b.yb(e.f==qc.ra),e.f==qc.ra&&null!=e.j&&(t.clearTimeout(e.j),e.j=null,e.i=null)}function qr(t,e,n,i){this.a=t,this.s=e,this.o=n,this.u=i,this.h=new wt,this.b=null,this.g=!1,this.m=t.readyState,this.c=!1,this.j=this.A=-1,this.f=this.i=!1,e=this.l.bind(this),Tt(this.h,t,"waiting",e),this.b=new Bt(e),Vt(this.b,.25)}function Gr(t,e,n){this.a=t,this.i=e,this.h=n,this.c=new wt,this.f=1,this.g=!1,this.b=null,0<t.readyState?this.Fc():Et(this.c,t,"loadedmetadata",this.Fc.bind(this)),Tt(this.c,t,"ratechange",this.Vd.bind(this))}function Xr(t){return 0<t.a.readyState?t.a.currentTime:t.h}function Yr(t,e){0<t.a.readyState?Wr(t,t.a.currentTime,e):(t.h=e,setTimeout(t.i,0))}function zr(t,e){null!=t.b&&(t.b.cancel(),t.b=null),t.f=e,t.a.playbackRate=t.g||0>e?0:e,!t.g&&0>e&&(t.b=new Bt(function(){t.a.currentTime+=e/4}),Vt(t.b,.25))}function Wr(t,e,n){function i(){!t.a||10<=r++||t.a.currentTime!=e||(t.a.currentTime=n,setTimeout(i,100))}t.a.currentTime=n;var r=0;setTimeout(i,100)}function $r(t,e,n,i,r,a){this.c=t,this.b=e,this.h=n,this.j=r,this.f=null,this.g=new qr(t,e,n,a),e=this.Xd.bind(this),n=this.b.presentationTimeline,null==i?i=1/0>n.T()?n.Ja():n.ma():0>i&&(i=n.ma()+i),i=Qr(this,ta(this,i)),this.a=new Gr(t,e,i),this.f=new Bt(this.Ud.bind(this)),Vt(this.f,.25)}function Jr(t){var e=Xr(t.a);return 0<t.c.readyState&&(t.c.paused||(e=ta(t,e))),e}function Qr(t,e){var n=t.b.presentationTimeline.T();return e>=n?n-t.h.durationBackoff:e}function Zr(t,e){var n=pe.bind(null,t.c.buffered),i=Math.max(t.b.minBufferTime||0,t.h.rebufferingGoal),r=t.b.presentationTimeline,a=r.Ja(),o=r.ma(),s=r.T();3>o-a&&(a=o-3);var u=r.Wa(i),c=r.Wa(5);return i=r.Wa(i+5),e>=s?Qr(t,e):e>o?o:e<a?n(c)?c:i:e>=u||n(e)?e:i}function ta(t,e){var n=t.b.presentationTimeline.Ja();return e<n?n:(n=t.b.presentationTimeline.ma(),e>n?n:e)}function ea(t,e,n,i,r,a,o){this.a=t,this.u=e,this.g=n,this.s=i,this.l=r,this.h=a,this.A=o,this.c=[],this.j=new wt,this.b=!1,this.i=-1,this.f=null,ia(this)}function na(t){var e=ut(t);return e.eventElement=t.eventElement,e}function ia(e){ra(e),e.f=t.setTimeout(e.G.bind(e),250)}function ra(e){e.f&&(t.clearTimeout(e.f),e.f=null)}function aa(t,e){this.a=e,this.b=t,this.g=null,this.j=1,this.m=Promise.resolve(),this.h=[],this.i={},this.c={},this.o=!1,this.A=null,this.u=this.f=this.l=!1,this.s=0}function oa(t){var e=Jr(t.a.Pa);return t.b.periods[sn(t.b,e)]}function sa(t){var e=t.c.video||t.c.audio;return e?t.b.periods[e.Ba]:null}function ua(t){return ha(t,"audio")}function ca(t){return ha(t,"video")}function ha(t,e){var n=t.c[e];return n?n.sa||n.stream:null}function la(t,e){Ce(t.a.J,"text"),t.s++,t.u=!1;var n=t.s;return t.a.J.init({text:e},!1).then(function(){return Ta(t,[e])}).then(function(){if(!t.f&&t.s==n&&!t.c.text&&!t.u){var i=Jr(t.a.Pa);t.c.text=ba(e,sn(t.b,i)),Oa(t,t.c.text,0)}})}function fa(t){t.u=!0,t.c.text&&(Ua(t.c.text),delete t.c.text)}function da(t,e){var n=t.c.video;if(n){var i=n.stream;if(i)if(e){var r=i.trickModeVideo;r&&!n.sa&&(ma(t,r,!1),n.sa=i)}else(i=n.sa)&&(n.sa=null,ma(t,i,!0))}}function pa(t,e,n){e.video&&ma(t,e.video,n),e.audio&&ma(t,e.audio,n)}function ma(t,e,n){var i=t.c[e.type];if(!i&&"text"==e.type&&t.g.ignoreTextStreamFailures)la(t,e);else if(i){var r=un(t.b,e);n&&r!=i.Ba?ya(t):(i.sa&&(e.trickModeVideo?(i.sa=e,e=e.trickModeVideo):i.sa=null),(r=t.h[r])&&r.Sa&&(r=t.i[e.id])&&r.Sa&&i.stream!=e&&("text"==e.type&&Ie(t.a.J,Ct(e.mimeType,e.codecs)),i.stream=e,i.wb=!0,n&&(i.ya?i.zb=!0:i.Ca?(i.va=!0,i.zb=!0):(Ua(i),La(t,i,!0)))))}}function va(t){var e=Jr(t.a.Pa),n=t.g.smallGapLimit;Object.keys(t.c).every(function(t){var i=this.a.J;return"text"==t?(t=i.a,t=e>=t.a&&e<t.b):(t=Ne(i,t),t=pe(t,e,n)),t}.bind(t))||ya(t)}function ya(t){for(var e in t.c){var n=t.c[e];n.ya||n.va||(n.Ca?n.va=!0:null==xe(t.a.J,e)?null==n.ua&&Oa(t,n,0):(Ua(n),La(t,n,!1)))}}function ga(t,e,n){var i=Jr(t.a.Pa),r=sn(t.b,i),a={},o=[];return e.variant&&e.variant.audio&&(a.audio=e.variant.audio,o.push(e.variant.audio)),e.variant&&e.variant.video&&(a.video=e.variant.video,o.push(e.variant.video)),e.text&&(a.text=e.text,o.push(e.text)),t.a.J.init(a,t.g.forceTransmuxTS).then(function(){if(!t.f){var e=t.b.presentationTimeline.T();return 1/0>e?t.a.J.ka(e):t.a.J.ka(Math.pow(2,32)),Ta(t,o)}}).then(function(){if(!t.f)for(var e in a){var i=a[e];t.c[e]||(t.c[e]=ba(i,r,n),Oa(t,t.c[e],0))}})}function ba(t,e,n){return{stream:t,type:t.type,La:null,na:null,sa:null,wb:!0,Ba:e,endOfStream:!1,Ca:!1,ua:null,va:!1,zb:!1,ya:!1,Zb:!1,Ya:!1,Nc:n||0}}function wa(t,e){var n=t.h[e];if(n)return n.promise;n={promise:new q,Sa:!1},t.h[e]=n;var i=t.b.periods[e].variants.map(function(t){var e=[];return t.audio&&e.push(t.audio),t.video&&e.push(t.video),t.video&&t.video.trickModeVideo&&e.push(t.video.trickModeVideo),e}).reduce(It,[]).filter(Rt);return i.push.apply(i,t.b.periods[e].textStreams),t.m=t.m.then(function(){if(!this.f)return Ta(this,i)}.bind(t)).then(function(){this.f||(this.h[e].promise.resolve(),this.h[e].Sa=!0)}.bind(t)).catch(function(t){this.f||(this.h[e].promise.catch(function(){}),this.h[e].promise.reject(),delete this.h[e],this.a.onError(t))}.bind(t)),n.promise}function Ta(t,e){e.map(function(t){return t.id}).filter(Rt);for(var n=[],i=0;i<e.length;++i){var r=e[i],a=t.i[r.id];a?n.push(a.promise):(t.i[r.id]={promise:new q,Sa:!1},n.push(r.createSegmentIndex()))}return Promise.all(n).then(function(){if(!this.f)for(var t=0;t<e.length;++t){var n=this.i[e[t].id];n.Sa||(n.promise.resolve(),n.Sa=!0)}}.bind(t)).catch(function(t){if(!this.f){for(var n=0;n<e.length;n++)this.i[e[n].id].promise.catch(function(){}),this.i[e[n].id].promise.reject(),delete this.i[e[n].id];return Promise.reject(t)}}.bind(t))}function Ea(t,e){var n=Jr(t.a.Pa),i=Sa(t,e,n),r=un(t.b,e.stream),a=sn(t.b,i),o=Re(t.a.J,e.type,n),s=Math.max(t.j*Math.max(t.b.minBufferTime||0,t.g.rebufferingGoal),t.j*t.g.bufferingGoal);if(i>=t.b.presentationTimeline.T())return e.endOfStream=!0,null;if(e.endOfStream=!1,e.Ba=a,a!=r)return null;if(o>=s)return.5;if(a=Pe(t.a.J,e.type),!(a=ka(t,e,n,a,r)))return 1;var u=1/0;return $u.values(t.c).forEach(function(e){u=Math.min(u,Sa(t,e,n))}),i>=u+t.b.presentationTimeline.a?1:(e.Nc=0,_a(t,e,n,r,a),null)}function Sa(t,e,n){return e.La&&e.na?t.b.periods[un(t.b,e.La)].startTime+e.na.endTime:Math.max(n,e.Nc)}function ka(t,e,n,i,r){if(e.na&&e.stream==e.La)return Aa(t,e,r,e.na.position+1);if(null==(n=e.na?e.stream.findSegmentPosition(Math.max(0,t.b.periods[un(t.b,e.La)].startTime+e.na.endTime-t.b.periods[r].startTime)):e.stream.findSegmentPosition(Math.max(0,(i||n)-t.b.periods[r].startTime))))return null;var a=null;return null==i&&(a=Aa(t,e,r,Math.max(0,n-1))),a||Aa(t,e,r,n)}function Aa(t,e,n,i){return n=t.b.periods[n],(e=e.stream.getSegmentReference(i))?(i=t.b.presentationTimeline,t=i.Xa(),i=i.Ka(),n.startTime+e.endTime<t||n.startTime+e.startTime>i?null:e):null}function _a(t,e,n,i,r){var a=t.b.periods[i],o=e.stream,s=t.b.presentationTimeline.T(),u=t.b.periods[i+1];i=xa(t,e,i,Math.max(0,a.startTime-.1),u?u.startTime:s),e.Ca=!0,e.wb=!1,s=Ma(t,r),Promise.all([i,s]).then(function(t){if(!this.f&&!this.l)return Pa(this,e,n,a,o,r,t[1])}.bind(t)).then(function(){this.f||this.l||(e.Ca=!1,e.Zb=!1,e.va||this.a.ab(),Oa(this,e,0),Na(this,o))}.bind(t)).catch(function(t){this.f||this.l||(e.Ca=!1,"text"==e.type&&this.g.ignoreTextStreamFailures?delete this.c.text:3017==t.code?Ia(this,e,t):(e.Ya=!0,t.severity=2,ja(this,t)))}.bind(t))}function Ia(t,e,n){if(!$u.values(t.c).some(function(t){return t!=e&&t.Zb})){var i=Math.round(100*t.j);if(20<i)t.j-=.2;else{if(!(4<i))return e.Ya=!0,t.l=!0,void t.a.onError(n);t.j-=.04}e.Zb=!0}Oa(t,e,4)}function xa(t,e,n,i,r){return e.wb?(n=Me(t.a.J,e.type,t.b.periods[n].startTime-e.stream.presentationTimeOffset,i,r),e.stream.initSegmentReference?(t=Ma(t,e.stream.initSegmentReference).then(function(t){if(!this.f)return De(this.a.J,e.type,t,null,null)}.bind(t)).catch(function(t){return e.wb=!0,Promise.reject(t)}),Promise.all([n,t])):n):Promise.resolve()}function Pa(t,e,n,i,r,a,o){return r.containsEmsgBoxes&&(new ii).Z("emsg",t.he.bind(t,i,a)).parse(o),Ra(t,e,n).then(function(){if(!this.f)return De(this.a.J,e.type,o,a.startTime+i.startTime,a.endTime+i.startTime)}.bind(t)).then(function(){if(!this.f)return e.La=r,e.na=a,Promise.resolve()}.bind(t))}function Ra(t,e,n){var i=Math.max(t.g.bufferBehind,t.b.presentationTimeline.a),r=xe(t.a.J,e.type);return null==r?Promise.resolve():(n=n-r-i,0>=n?Promise.resolve():t.a.J.remove(e.type,r,r+n).then(function(){}.bind(t)))}function Na(t,e){if(!t.o&&(t.o=$u.values(t.c).every(function(t){return"text"==t.type||!t.va&&!t.ya&&t.na}),t.o)){var n=un(t.b,e);for(t.h[n]||wa(t,n).then(function(){this.f||this.a.zc()}.bind(t)).catch(xt),n=0;n<t.b.periods.length;++n)wa(t,n).catch(xt);t.a.$d&&t.a.$d()}}function Da(t,e){if(e.Ba!=un(t.b,e.stream)){var n=e.Ba,i=$u.values(t.c);i.every(function(t){return t.Ba==n})&&i.every(Ca)&&wa(t,n).then(function(){if(!this.f&&i.every(function(t){var e=un(this.b,t.stream);return Ca(t)&&t.Ba==n&&e!=n}.bind(this))){var t=this.b.periods[n],e=this.a.Ac(t),r={};e.variant&&e.variant.video&&(r.video=e.variant.video),e.variant&&e.variant.audio&&(r.audio=e.variant.audio),e.text&&(r.text=e.text);for(var a in this.c)if(!r[a]&&"text"!=a)return void this.a.onError(new z(2,5,5005));for(var o in r)if(!this.c[o]){if("text"!=o)return void this.a.onError(new z(2,5,5005));ga(this,{text:r.text},t.startTime),delete r[o]}for(var s in this.c)(t=r[s])?(ma(this,t,!1),Oa(this,this.c[s],0)):delete this.c[s];this.a.zc()}}.bind(t)).catch(xt)}}function Ca(t){return!t.Ca&&null==t.ua&&!t.va&&!t.ya}function Ma(t,e){var n=pt(e.c(),t.g.retryParameters);if(0!=e.b||null!=e.a){var i="bytes="+e.b+"-";null!=e.a&&(i+=e.a),n.headers.Range=i}return t.a.$a.request(1,n).promise.then(function(t){return t.data})}function La(t,e,n){e.va=!1,e.zb=!1,e.ya=!0,Ce(t.a.J,e.type).then(function(){if(!this.f&&n)return this.a.J.flush(e.type)}.bind(t)).then(function(){this.f||(e.La=null,e.na=null,e.ya=!1,e.endOfStream=!1,Oa(this,e,0))}.bind(t))}function Oa(e,n,i){n.ua=t.setTimeout(e.Re.bind(e,n),1e3*i)}function Ua(e){null!=e.ua&&(t.clearTimeout(e.ua),e.ua=null)}function ja(t,e){X(t.A).then(function(){this.f||(this.a.onError(e),e.handled||this.g.failureCallback(e))}.bind(t))}function Ba(t,e,n,i,r,a){if(200<=n&&299>=n&&202!=n)return r&&(i=r),{uri:i,data:e,headers:t,fromCache:!!t["x-shaka-from-cache"]};r=null;try{r=Ot(e)}catch(t){}throw new z(401==n||403==n?2:1,1,1001,i,n,r,t,a)}function Fa(t,e,n){var i=new Fa.b;$u.forEach(e.headers,function(t,e){i.append(t,e)});var r,a=new Fa.a,o={body:e.body||void 0,headers:i,method:e.method,signal:a.signal,credentials:e.allowCrossSiteCredentials?"include":void 0},s={mc:!1,Xc:!1};return e.retryParameters.timeout&&(r=setTimeout(function(){s.Xc=!0,a.abort()},e.retryParameters.timeout)),t=Fa.f(t,n,o,s,r),new W(t,function(){return s.mc=!0,a.abort(),Promise.resolve()})}function Va(t,e,n){var i=new Va.g;return new W(new Promise(function(r,a){i.open(e.method,t,!0),i.responseType="arraybuffer",i.timeout=e.retryParameters.timeout,i.withCredentials=e.allowCrossSiteCredentials,i.onabort=function(){a(new z(1,1,7001,t,n))},i.onload=function(e){e=e.target;var i=e.getAllResponseHeaders().trim().split("\r\n").reduce(function(t,e){var n=e.split(": ");return t[n[0].toLowerCase()]=n.slice(1).join(": "),t},{});try{var o=Ba(i,e.response,e.status,t,e.responseURL,n);r(o)}catch(t){a(t)}},i.onerror=function(e){a(new z(1,1,1002,t,e,n))},i.ontimeout=function(){a(new z(1,1,1003,t,n))};for(var o in e.headers)i.setRequestHeader(o.toLowerCase(),e.headers[o]);i.send(e.body)}),function(){return i.abort(),Promise.resolve()})}function Ka(t){this.a={},this.c=Promise.resolve(),this.h=!1,this.i=t,this.f=this.b=this.g=0}function Ha(t,e,n,i,r){t.a[e]=t.a[e]||[],t.a[e].push({request:n,pc:i,Id:r})}function qa(t,e){var n=$u.values(t.a);t.a={},n.forEach(function(e){e.forEach(function(e){t.b+=e.pc})});var i=Promise.resolve().then(function(){return Ya(t),Promise.all(n.map(function(n){return Ga(t,e,n)}))});return t.c=t.c.then(function(){return i}),i}function Ga(t,e,n){var i=Promise.resolve();return n.forEach(function(n){i=i.then(function(){return Ya(t),Xa(t,e,n)})}),i}function Xa(t,e,n){return Promise.resolve().then(function(){return Ya(t),e.request(1,n.request).promise}).then(function(e){return Ya(t),t.g+=n.pc,t.f+=e.data.byteLength,t.i(t.b?t.g/t.b:0,t.f),n.Id(e.data)})}function Ya(t){if(t.h)throw new z(2,9,7001)}function za(t,e){var n=this;this.c=t,this.b=t.objectStore(e),this.a=new q,t.onabort=function(t){t.preventDefault(),n.a.reject()},t.onerror=function(t){t.preventDefault(),n.a.reject()},t.oncomplete=function(){n.a.resolve()}}function Wa(t){this.b=t,this.a=[]}function $a(t,e){return Ja(t,e,"readwrite")}function Ja(t,e,n){n=t.b.transaction([e],n);var i=new za(n,e);return t.a.push(i),i.promise().then(function(){at(t.a,i)},function(){at(t.a,i)}),i}function Qa(){this.a={}}function Za(t){var e=null;if($u.forEach(t.a,function(t,n){$u.forEach(n.getCells(),function(n,i){i.hasFixedKeySpace()||e||(e={path:{fa:t,N:n},N:i})})}),e)return e;throw new z(2,9,9013,"Could not find a cell that supports add-operations")}function to(t,e){$u.forEach(t.a,function(t,n){$u.forEach(n.getCells(),function(n,i){e({fa:t,N:n},i)})})}function eo(t,e,n){if(!(t=t.a[e]))throw new z(2,9,9013,"Could not find mechanism with name "+e);if(!(e=t.getCells()[n]))throw new z(2,9,9013,"Could not find cell with name "+n);return e}function no(t){return c(function e(){var n,i,r,a;return A(e,function(e){switch(e.w){case 1:return n=$u,i=Object.values(t.a),r=0<i.length,r||(a=Gc,n.forEach(a,function(t,e){var n=e();n&&i.push(n)})),d(e,Promise.all(i.map(function(t){return t.erase()})),2);case 2:if(!r)return d(e,Promise.all(i.map(function(t){return t.destroy()})),0);e.V(0)}})})}function io(){return $u.values(Gc).some(function(t){return!!(t=t())&&(t.destroy(),!0)})}function ro(t){this.a=new Wa(t)}function ao(t){return Promise.reject(new z(2,9,9011,"Cannot add new value to "+t))}function oo(t,e,n,i){t=$a(t.a,e);var r=t.store();return n.forEach(function(t){r.delete(t).onsuccess=function(){return i(t)}}),t.promise()}function so(t,e,n){t=Ja(t.a,e,"readonly");var i=t.store(),r={},a=[];return n.forEach(function(t){i.get(t).onsuccess=function(e){e=e.target.result,void 0==e&&a.push(t),r[t]=e}}),t.promise().then(function(){return a.length?Promise.reject(new z(2,9,9012,"Could not find values for "+a)):n.map(function(t){return r[t]})})}function uo(t){return{originalManifestUri:t.originalManifestUri,duration:t.duration,size:t.size,expiration:null==t.expiration?1/0:t.expiration,periods:t.periods.map(co),sessionIds:t.sessionIds,drmInfo:t.drmInfo,appMetadata:t.appMetadata}}function co(t){return mo(t),t.streams.forEach(function(){}),{startTime:t.startTime,streams:t.streams.map(ho)}}function ho(t){var e=t.Cd?po(t.Cd):null;return{id:t.id,primary:t.primary,presentationTimeOffset:t.presentationTimeOffset,contentType:t.contentType,mimeType:t.mimeType,codecs:t.codecs,frameRate:t.frameRate,kind:t.kind,language:t.language,label:t.label,width:t.width,height:t.height,initSegmentKey:e,encrypted:t.encrypted,keyId:t.keyId,segments:t.segments.map(lo),variantIds:t.variantIds}}function lo(t){var e=po(t.uri);return{startTime:t.startTime,endTime:t.endTime,dataKey:e}}function fo(t){return{data:t.data}}function po(t){var e;if((e=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(t))||(e=/^offline:segment\/([0-9]+)$/.exec(t)))return Number(e[1]);throw new z(2,9,9004,"Could not parse uri "+t)}function mo(t){var e=t.streams.filter(function(t){return"audio"==t.contentType}),n=t.streams.filter(function(t){return"video"==t.contentType});if(!e.every(function(t){return t.variantIds})||!n.every(function(t){return t.variantIds})){e.forEach(function(t){t.variantIds=[]}),n.forEach(function(t){t.variantIds=[]});var i=0;if(n.length&&!e.length){var r=i++;n.forEach(function(t){t.variantIds.push(r)})}if(!n.length&&e.length){var a=i++;e.forEach(function(t){t.variantIds.push(a)})}n.length&&e.length&&e.forEach(function(t){n.forEach(function(e){var n=i++;t.variantIds.push(n),e.variantIds.push(n)})})}}function vo(t,e,n,i){this.a=new Wa(t),this.c=e,this.b=n,this.f=i}function yo(t,e,n){if(t.f)return Promise.reject(new z(1,9,9011,"Cannot add new value to "+e));t=$a(t.a,e);var i=t.store(),r=[];return n.forEach(function(t){i.add(t).onsuccess=function(t){r.push(t.target.result)}}),t.promise().then(function(){return r})}function go(t,e,n,i){t=$a(t.a,e);var r=t.store();return n.forEach(function(t){r.delete(t).onsuccess=function(){return i(t)}}),t.promise()}function bo(t,e,n){t=Ja(t.a,e,"readonly");var i=t.store(),r={},a=[];return n.forEach(function(t){var e=i.get(t);e.onsuccess=function(){void 0==e.result&&a.push(t),r[t]=e.result}}),t.promise().then(function(){return a.length?Promise.reject(new z(1,9,9012,"Could not find values for "+a)):n.map(function(t){return r[t]})})}function wo(){this.c=this.b=this.a=this.f=null}function To(){var e=new q,n=t.indexedDB.deleteDatabase("shaka_offline_db");return n.onblocked=function(){},n.onsuccess=function(){e.resolve()},n.onerror=function(t){e.reject(new z(2,9,9001,n.error)),t.preventDefault()},e}function Eo(t,e,n,i){this.a=t,this.g=e,this.f=n,this.c=i,this.b=["offline:",t,"/",e,"/",n,"/",i].join("")}function So(t){if(null==(t=/^offline:([a-z]+)\/([^\/]+)\/([^\/]+)\/([0-9]+)$/.exec(t)))return null;var e=t[1];if("manifest"!=e&&"segment"!=e)return null;var n=t[2];if(!n)return null;var i=t[3];return i&&null!=e?new Eo(e,n,i,Number(t[4])):null}function ko(t,e){this.b=t,this.a=e}function Ao(t,e){var n=new Oi(null,0);n.ka(e.duration);var i=e.periods.map(function(e){return _o(t,e,n)}),r=e.drmInfo?[e.drmInfo]:[];return e.drmInfo&&i.forEach(function(t){t.variants.forEach(function(t){t.drmInfos=r})}),{presentationTimeline:n,minBufferTime:2,offlineSessionIds:e.sessionIds,periods:i}}function _o(t,e,n){var i=e.streams.filter(function(t){return"audio"==t.contentType}),r=e.streams.filter(function(t){return"video"==t.contentType});return i=Io(t,i,r),r=e.streams.filter(function(t){return"text"==t.contentType}).map(function(e){return xo(t,e)}),e.streams.forEach(function(e,i){var r=e.segments.map(function(e,n){return Po(t,n,e)});n.Na(r,0==i)}),{startTime:e.startTime,variants:i,textStreams:r}}function Io(t,e,n){var i={},r=[];return r.push.apply(r,e),r.push.apply(r,n),r.forEach(function(t){t.variantIds.forEach(function(t){i[t]=i[t]||{id:t,language:"",primary:!1,audio:null,video:null,bandwidth:0,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0}})}),e.forEach(function(e){var n=xo(t,e);e.variantIds.forEach(function(t){t=i[t],t.language=n.language,t.primary=t.primary||n.primary,t.audio=n})}),n.forEach(function(e){var n=xo(t,e);e.variantIds.forEach(function(t){t=i[t],t.primary=t.primary||n.primary,t.video=n})}),$u.values(i)}function xo(t,e){var n=e.segments.map(function(e,n){return Po(t,n,e)}),i=new li(n);return n={id:e.id,createSegmentIndex:function(){return Promise.resolve()},findSegmentPosition:function(t){return i.find(t)},getSegmentReference:function(t){return i.get(t)},initSegmentReference:null,presentationTimeOffset:e.presentationTimeOffset,mimeType:e.mimeType,codecs:e.codecs,width:e.width||void 0,height:e.height||void 0,frameRate:e.frameRate||void 0,kind:e.kind,encrypted:e.encrypted,keyId:e.keyId,language:e.language,label:e.label||null,type:e.contentType,primary:e.primary,trickModeVideo:null,containsEmsgBoxes:!1,roles:[],channelsCount:null},null!=e.initSegmentKey&&(n.initSegmentReference=Ro(t,e.initSegmentKey)),n}function Po(t,e,n){var i=new Eo("segment",t.b,t.a,n.dataKey);return new ti(e,n.startTime,n.endTime,function(){return[i.toString()]},0,null)}function Ro(t,e){var n=new Eo("segment",t.b,t.a,e);return new Zn(function(){return[n.toString()]},0,null)}function No(){this.a=null}function Do(t){var e=So(t);return e&&"manifest"==e.a?Do.a(t):e&&"segment"==e.a?Do.b(e.key(),e):$(new z(2,1,9004,t))}function Co(t){this.a=null;for(var e=0;e<t.textTracks.length;++e){var n=t.textTracks[e];n.mode="disabled","Shaka Player TextTrack"==n.label&&(this.a=n)}this.a||(this.a=t.addTextTrack("subtitles","Shaka Player TextTrack")),this.a.mode="hidden"}function Mo(t){if(t.startTime>=t.endTime)return null;var e=new VTTCue(t.startTime,t.endTime,t.payload);e.lineAlign=t.lineAlign,e.positionAlign=t.positionAlign,e.size=t.size;try{e.align=t.textAlign}catch(t){}return"center"==t.textAlign&&"center"!=e.align&&(e.align="middle"),2==t.writingDirection?e.vertical="lr":3==t.writingDirection&&(e.vertical="rl"),1==t.lineInterpretation&&(e.snapToLines=!1),null!=t.line&&(e.line=t.line),null!=t.position&&(e.position=t.position),e}function Lo(t,e){var n=t.mode;t.mode="showing"==n?"showing":"hidden";for(var i=t.cues,r=i.length-1;0<=r;r--){var a=i[r];a&&e(a)&&t.removeCue(a)}t.mode=n}function Oo(e,n){var i=this;gn.call(this),this.wa=!1,this.f=null,this.pb=!1,this.u=null,this.o=new wt,this.Ab=this.h=this.Cb=this.b=this.m=this.a=this.A=this.g=this.j=this.i=this.s=null,this.bd=1e9,this.lb=[],this.ob=!1,this.xa=!0,this.S=this.qb=this.Ha=null,this.kc=!1,this.G=null,this.nb=[],this.I={},this.c=Wo(this),this.mb={width:1/0,height:1/0},this.l=$o(),this.kb=0,this.L=this.c.preferredAudioLanguage,this.ga=this.c.preferredTextLanguage,this.Ga=this.c.preferredVariantRole,this.Ua=this.c.preferredTextRole,this.Y=this.c.preferredAudioChannelCount,n&&n(this),this.s=new ft(this.Je.bind(this)),e&&this.rb(e,!0),Tt(this.o,t,"online",function(){i.ac()})}function Uo(t){if(!t.Ha)return Promise.resolve();var e=Promise.resolve();return t.m&&(e=t.m.stop(),t.m=null),Promise.all([e,t.Ha()])}function jo(t,e,n){return c(function i(){var r,a;return A(i,function(i){switch(i.w){case 1:return d(i,Li(e,t.s,t.c.manifest.retryParameters,n),2);case 2:return r=i.K,t.m=new r,t.m.configure(t.c.manifest),a={networkingEngine:t.s,filterNewPeriod:t.tb.bind(t),filterAllPeriods:t.ec.bind(t),onTimelineRegionAdded:t.ae.bind(t),onEvent:t.gb.bind(t),onError:t.Ta.bind(t)},i.return(t.m.start(e,a))}})})}function Bo(t){function e(t){return t.video&&t.audio||t.video&&t.video.codecs.includes(",")}if(t.b.periods.some(function(t){return t.variants.some(e)})&&t.b.periods.forEach(function(t){t.variants=t.variants.filter(e)}),0==t.b.periods.length)throw new z(2,4,4014)}function Fo(t){var e=t.b.presentationTimeline.T(),n=t.c.playRangeEnd,i=t.c.playRangeStart;0<i&&(t.P()||t.b.presentationTimeline.Tc(i)),n<e&&(t.P()||t.b.presentationTimeline.ka(n))}function Vo(t){function e(t){return(t.video?t.video.codecs.split(".")[0]:"")+"-"+(t.audio?t.audio.codecs.split(".")[0]:"")}var n=t.b.periods.reduce(function(t,e){return t.concat(e.variants)},[]);n=tn(n,t.c.preferredAudioChannelCount);var i={};n.forEach(function(t){var n=e(t);n in i||(i[n]=[]),i[n].push(t)});var r=null,a=1/0;$u.forEach(i,function(t,e){var n=0,i=0;e.forEach(function(t){n+=t.bandwidth||0,++i});var o=n/i;o<a&&(r=t,a=o)}),t.b.periods.forEach(function(t){t.variants=t.variants.filter(function(t){return e(t)==r})})}function Ko(t){if(t.m&&t.m.configure(t.c.manifest),t.i&&t.i.configure(t.c.drm),t.a){t.a.configure(t.c.streaming);try{t.b.periods.forEach(t.tb.bind(t))}catch(e){t.Ta(e)}var e=ua(t.a),n=ca(t.a),i=oa(t.a);(e=an(e,n,i.variants))&&e.allowedByApplication&&e.allowedByKeySystem||es(t,i)}t.h&&(t.h.configure(t.c.abr),t.c.abr.enabled&&!t.xa?t.h.enable():t.h.disable())}function Ho(t){var e=[];return t.forEach(function(t){if(t){var n=t.language;t.roles.length?t.roles.forEach(function(t){e.push({language:n,role:t})}):e.push({language:n,role:""})}else e.push({language:"und",role:""})}),it(e,function(t,e){return t.language==e.language&&t.role==e.role})}function qo(t,e,n){e.video&&Xo(t,e.video),e.audio&&Xo(t,e.audio);var i=sa(t.a);e!=an(ua(t.a),ca(t.a),i?i.variants:[])&&t.l.switchHistory.push({timestamp:Date.now()/1e3,id:e.id,type:"variant",fromAdaptation:n,bandwidth:e.bandwidth})}function Go(t,e,n){Xo(t,e),t.l.switchHistory.push({timestamp:Date.now()/1e3,id:e.id,type:"text",fromAdaptation:n,bandwidth:null})}function Xo(t,e){var n=un(t.b,e);t.I[n]||(t.I[n]={}),t.I[n][e.type]=e.id}function Yo(t){t.o&&(t.o.pa(t.f,"loadeddata"),t.o.pa(t.f,"playing"),t.o.pa(t.f,"pause"),t.o.pa(t.f,"ended"));var e=t.i,n=Promise.all([t.h?t.h.stop():null,t.j?t.j.destroy():null,t.g?t.g.destroy():null,t.A?t.A.destroy():null,t.a?t.a.destroy():null,t.m?t.m.stop():null,t.u?t.u.destroy():null]).then(function(){return e?e.destroy():null});return t.xa=!0,t.i=null,t.j=null,t.g=null,t.A=null,t.a=null,t.m=null,t.u=null,t.b=null,t.Cb=null,t.nb=[],t.I={},t.l=$o(),n}function zo(){return{".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",serverCertificate:new Uint8Array(0)}}}function Wo(t){var e=5e5,n=1/0;return navigator.connection&&navigator.connection.type&&(e=1e6*navigator.connection.downlink,navigator.connection.saveData&&(n=360)),{drm:{retryParameters:Y(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1},manifest:{retryParameters:Y(),availabilityWindowOverride:NaN,dash:{customScheme:function(t){if(t)return null},clockSyncUri:"",ignoreDrmInfo:!1,xlinkFailGracefully:!1,defaultPresentationDelay:10}},streaming:{retryParameters:Y(),failureCallback:t.kd.bind(t),rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,smallGapLimit:.5,jumpLargeGaps:!1,durationBackoff:1,forceTransmuxTS:!1},abrFactory:cn,textDisplayFactory:function(){return new Co(t.f)},abr:{enabled:!0,defaultBandwidthEstimate:e,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:n,minPixels:0,maxPixels:1/0,minBandwidth:0,maxBandwidth:1/0}},preferredAudioLanguage:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minBandwidth:0,maxBandwidth:1/0},playRangeStart:0,playRangeEnd:1/0}}function $o(){return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,estimatedBandwidth:NaN,loadLatency:NaN,playTime:0,bufferingTime:0,switchHistory:[],stateHistory:[]}}function Jo(t,e,n){t.xa?(t.S=e,t.kc=n||!1):pa(t.a,e,n||!1)}function Qo(t){if(t.b){var e=Date.now()/1e3;t.ob?t.l.bufferingTime+=e-t.kb:t.l.playTime+=e-t.kb,t.kb=e}}function Zo(t,e){function n(t,e){if(!t)return null;var n=t.findSegmentPosition(e-a.startTime);return null==n?null:(n=t.getSegmentReference(n))?n.startTime+a.startTime:null}var i=ua(t.a),r=ca(t.a),a=oa(t.a);return i=n(i,e),r=n(r,e),null!=r&&null!=i?Math.max(r,i):null!=r?r:null!=i?i:e}function ts(t,e){return e&&e.length?(t.h.setVariants(e),t.h.chooseVariant()):(t.Ta(new z(2,4,4012)),null)}function es(t,e){var n=Qe(e.variants,t.L,t.Ga,t.Y),i=en(e.textStreams,t.ga,t.Ua);(n=ts(t,n))&&(qo(t,n,!0),Jo(t,n,!0)),(i=i[0])&&(t.c.streaming.alwaysStreamText||t.Mb())&&(Go(t,i,!0),t.xa?t.G=i:ma(t.a,i,!0)),ns(t)}function ns(t){Promise.resolve().then(function(){this.wa||this.dispatchEvent(new At("adaptation"))}.bind(t))}function is(t){Promise.resolve().then(function(){this.wa||this.dispatchEvent(new At("trackschanged"))}.bind(t))}function rs(t){t.dispatchEvent(new At("texttrackvisibility"))}function as(t,e,n){var i=void 0==e.expiration?1/0:e.expiration,r=e.presentationTimeline.T();return e=Xe(e.periods[0]),{offlineUri:null,originalManifestUri:t,duration:r,size:0,expiration:i,tracks:e,appMetadata:n}}function os(t,e){var n=_o(new ko(t.fa(),t.N()),e.periods[0],new Oi(null,0)),i=e.appMetadata||{};return n=Xe(n),{offlineUri:t.toString(),originalManifestUri:e.originalManifestUri,duration:e.duration,size:e.size,expiration:e.expiration,tracks:n,appMetadata:i}}function ss(){this.a={}}function us(t,e,n){return n=n.endTime-n.startTime,cs(t,e)*n}function cs(t,e){var n=t.a[e];return null==n&&(n=0),n}function hs(t){if(!t||t.constructor!=Oo)throw new z(2,9,9008);this.a=t,this.b=ys(this),this.g=!1,this.c=null,this.f=[]}function ls(){return io()}function fs(t,e,n,i,r,a){var o,s=as(r,i,a),u=new Ka(function(e,n){s.size=n,t.b.progressCallback(s,e)});return ct([u],function(){return o=Ts(t,u,e,n,i,r,a),qa(u,t.a.s)}).then(function(){return o.size=s.size,o})}function ds(t,e,n){var i,r=new zt({$a:t.a.s,onError:function(t){6013!=t.code&&(i=t)},Ub:function(){},onExpirationUpdated:function(){},onEvent:function(){}});r.configure(t.a.getConfiguration().drm);var a=Ao(new ko(e.fa(),e.N()),n);return ct([r],function(){return c(function e(){return A(e,function(e){switch(e.w){case 1:return d(e,r.init(a,t.b.usePersistentLicense),2);case 2:return d(e,Wt(r,n.sessionIds),0)}})})}).then(function(){if(i)throw i})}function ps(t,e,n,i){function r(){s+=1,t.b.progressCallback(u,s/o)}var a=xs(i),o=a.length+1,s=0,u=os(n,i);return Promise.all([e.removeSegments(a,r),e.removeManifests([n.key()],r)])}function ms(t,e,n,i){function r(){}var a,o,s,u=t.a.s,c=t.a.getConfiguration();return Li(e,u,c.manifest.retryParameters,i).then(function(t){var i=this;As(this),o=new zt({$a:u,onError:n,Ub:r,onExpirationUpdated:function(){},onEvent:function(){}}),o.configure(c.drm);var a={networkingEngine:u,filterAllPeriods:function(t){gs(i,o,t)},filterNewPeriod:function(t){bs(i,o,t)},onTimelineRegionAdded:function(){},onEvent:function(){},onError:n};return s=new t,s.configure(c.manifest),s.start(e,a)}.bind(t)).then(function(t){return As(this),a=t,o.init(a,this.b.usePersistentLicense)}.bind(t)).then(function(){return As(this),ws(a)}.bind(t)).then(function(){return As(this),$t(o)}.bind(t)).then(function(){return As(this),s.stop()}.bind(t)).then(function(){return As(this),{manifest:a,Eb:o}}.bind(t)).catch(function(t){if(s)return s.stop().then(function(){throw t});throw t})}function vs(t,e){var n=[],i=Be(t),r=[0,vc,yc],a=e.filter(function(t){return"variant"==t.type});r=r.map(function(t){return a.filter(function(e){return e=Be(e.language),je(t,i,e)})});for(var o,s=0;s<r.length;s++)if(r[s].length){o=r[s];break}o||(r=a.filter(function(t){return t.primary}),r.length&&(o=r)),o||(o=a,a.map(function(t){return t.language}).filter(Rt));var u=o.filter(function(t){return t.height&&480>=t.height});return u.length&&(u.sort(function(t,e){return e.height-t.height}),o=u.filter(function(t){return t.height==u[0].height})),o.sort(function(t,e){return t.bandwidth-e.bandwidth}),o.length&&n.push(o[Math.floor(o.length/2)]),n.push.apply(n,e.filter(function(t){return"text"==t.type})),n}function ys(t){return{trackSelectionCallback:function(e){return vs(t.a.getConfiguration().preferredAudioLanguage,e)},progressCallback:function(t,e){if(t||e)return null},usePersistentLicense:!0}}function gs(t,e,n){n.forEach(function(n){return bs(t,e,n)})}function bs(t,e,n){var i=null;if(t.c){var r=t.c.filter(function(t){return"variant"==t.type})[0];r&&(i=We(n,r))}var a=r=null;i&&(i.audio&&(r=i.audio),i.video&&(a=i.video)),Ke(e,r,a,n),Ve(n,t.a.getConfiguration().restrictions,{width:1/0,height:1/0})}function ws(t){var e=t.periods.map(function(t){return t.variants}).reduce(It,[]).map(function(t){var e=[];return t.audio&&e.push(t.audio),t.video&&e.push(t.video),e}).reduce(It,[]).filter(Rt);return t=t.periods.map(function(t){return t.textStreams}).reduce(It,[]),e.push.apply(e,t),Promise.all(e.map(function(t){return t.createSegmentIndex()}))}function Ts(t,e,n,i,r,a,o){var s=new ss,u=r.periods.map(function(a){return Es(t,e,n,s,i,r,a)}),c=i.b,h=Qt(i);if(c&&t.b.usePersistentLicense){if(!h.length)throw new z(2,9,9007,a);c.initData=[]}return{originalManifestUri:a,duration:r.presentationTimeline.T(),size:0,expiration:i.vb(),periods:u,sessionIds:t.b.usePersistentLicense?h:[],drmInfo:c,appMetadata:o}}function Es(t,e,n,i,r,a,o){var s=Ye(o,null,null),u=ze(o,null);s=t.b.trackSelectionCallback(s.concat(u)),null==t.c&&(t.c=s,gs(t,r,a.periods)),Ps(s),a.periods.forEach(function(t){t.variants.forEach(function(t){var e=t.audio,n=t.video;if(e&&!n&&(i.a[e.id]=e.bandwidth||t.bandwidth),!e&&n&&(i.a[n.id]=n.bandwidth||t.bandwidth),e&&n){var r=e.bandwidth||393216,a=n.bandwidth||t.bandwidth-r;0>=a&&(a=t.bandwidth),i.a[e.id]=r,i.a[n.id]=a}}),t.textStreams.forEach(function(t){i.a[t.id]=52})});var c={};s.forEach(function(t){"variant"==t.type&&null!=t.audioId&&(c[t.audioId]=!0),"variant"==t.type&&null!=t.videoId&&(c[t.videoId]=!0),"text"==t.type&&(c[t.id]=!0)});var h={};return Rs(a).filter(function(t){return!!c[t.id]}).forEach(function(r){h[r.id]=Ss(t,e,n,i,a,r)}),s.forEach(function(t){"variant"==t.type&&null!=t.audioId&&h[t.audioId].variantIds.push(t.id),"variant"==t.type&&null!=t.videoId&&h[t.videoId].variantIds.push(t.id)}),{startTime:o.startTime,streams:$u.values(h)}}function Ss(t,e,n,i,r,a){var o={id:a.id,primary:a.primary,presentationTimeOffset:a.presentationTimeOffset||0,contentType:a.type,mimeType:a.mimeType,codecs:a.codecs,frameRate:a.frameRate,kind:a.kind,language:a.language,label:a.label,width:a.width||null,height:a.height||null,initSegmentKey:null,encrypted:a.encrypted,keyId:a.keyId,segments:[],variantIds:[]};r=r.presentationTimeline.Xa();var s=a.id;return ks(a,r,function(r){Ha(e,s,Is(t,r),us(i,a.id,r),function(e){return n.addSegments([{data:e}]).then(function(e){t.f.push(e[0]),o.segments.push({startTime:r.startTime,endTime:r.endTime,dataKey:e[0]})})})}),(r=a.initSegmentReference)&&Ha(e,s,Is(t,r),.5*cs(i,a.id),function(e){return n.addSegments([{data:e}]).then(function(e){t.f.push(e[0]),o.initSegmentKey=e[0]})}),o}function ks(t,e,n){e=t.findSegmentPosition(e);for(var i=null==e?null:t.getSegmentReference(e);i;)n(i),i=t.getSegmentReference(++e)}function As(t){if(!t.a)throw new z(2,9,7001)}function _s(){if(!io())throw new z(2,9,9e3)}function Is(t,e){var n=t.a.getConfiguration().streaming.retryParameters;return n=pt(e.c(),n),0==e.b&&null==e.a||(n.headers.Range="bytes="+e.b+"-"+(null==e.a?"":e.a)),n}function xs(t){var e=[];return t.periods.forEach(function(t){t.streams.forEach(function(t){null!=t.initSegmentKey&&e.push(t.initSegmentKey),t.segments.forEach(function(t){e.push(t.dataKey)})})}),e}function Ps(t){t.some(function(e){return t.some(function(t){return e!=t&&e.type==t.type&&e.kind==t.kind&&e.language==t.language})})}function Rs(t){var e={};return t.periods.forEach(function(t){t.textStreams.forEach(function(t){e[t.id]=t}),t.variants.forEach(function(t){t.audio&&(e[t.audio.id]=t.audio),t.video&&(e[t.video.id]=t.video)})}),$u.values(e)}function Ns(t,e){e=e||0;for(var n={priority:e,dd:t},i=0;i<Yc.length;i++)if(Yc[i].priority<e)return void Yc.splice(i,0,n);Yc.push(n)}function Ds(t){var e=t.type.replace(/^(webkit|moz|MS)/,"").toLowerCase();if("function"==typeof Event)var n=new Event(e,t);else n=document.createEvent("Event"),n.initEvent(e,t.bubbles,t.cancelable);t.target.dispatchEvent(n)}function Cs(t,e,n){if("input"==t)switch(this.type){case"range":t="change"}zc.call(this,t,e,n)}function Ms(){var t=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var e=t.apply(this,arguments);return e.abort=function(){},e}}function Ls(){var t=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(e,n){return t.call(this,e,n-.001)}}function Os(){var t=MediaSource.prototype.endOfStream;MediaSource.prototype.endOfStream=function(){for(var e=0,n=0;n<this.sourceBuffers.length;++n){var i=this.sourceBuffers[n];i=i.buffered.end(i.buffered.length-1),e=Math.max(e,i)}if(!isNaN(this.duration)&&e<this.duration)for(this.vc=!0,e=0;e<this.sourceBuffers.length;++e)this.sourceBuffers[e].qc=!1;return t.apply(this,arguments)};var e=!1,n=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var t=n.apply(this,arguments);return t.mediaSource_=this,t.addEventListener("updateend",Us,!1),e||(this.addEventListener("sourceclose",js,!1),e=!0),t}}function Us(t){var e=t.target,n=e.mediaSource_;if(n.vc){for(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.qc=!0,t=0;t<n.sourceBuffers.length;++t)if(0==n.sourceBuffers[t].qc)return;n.vc=!1}}function js(t){t=t.target;for(var e=0;e<t.sourceBuffers.length;++e)t.sourceBuffers[e].removeEventListener("updateend",Us,!1);t.removeEventListener("sourceclose",js,!1)}function Bs(){var t=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(e){return"mp2t"!=e.split(/ *; */)[0].split("/")[1]&&t(e)}}function Fs(){var t=MediaSource.isTypeSupported,e=/^dv(?:he|av)\./;MediaSource.isTypeSupported=function(n){for(var i=n.split(/ *; */),r=i[0],a={},o=1;o<i.length;++o){var s=i[o].split("="),u=s[0];s=s[1].replace(/"(.*)"/,"$1"),a[u]=s}if(!(i=a.codecs))return t(n);var c=!1,h=!1;n=i.split(",").filter(function(t){return e.test(t)?(h=!0,!1):(/^(hev|hvc)1\.2/.test(t)&&(c=!0),!0)}),h&&(c=!1),a.codecs=n.join(","),c&&(a.eotf="smpte2084");for(var l in a)r+="; "+l+'="'+a[l]+'"';return cast.__platform__.canDisplayType(r)}}function Vs(t){this.f=[],this.b=[],this.a=[],(new ii).Z("pssh",this.c.bind(this)).parse(t.buffer)}function Ks(t,e){try{var n=new Hs(t,e);return Promise.resolve(n)}catch(t){return Promise.reject(t)}}function Hs(t,e){this.keySystem=t;for(var n=!1,i=0;i<e.length;++i){var r=e[i],a={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:r.initDataTypes,sessionTypes:["temporary"],label:r.label},o=!1;if(r.audioCapabilities)for(var s=0;s<r.audioCapabilities.length;++s){var u=r.audioCapabilities[s];if(u.contentType){o=!0;var c=u.contentType.split(";")[0];MSMediaKeys.isTypeSupported(this.keySystem,c)&&(a.audioCapabilities.push(u),n=!0)}}if(r.videoCapabilities)for(s=0;s<r.videoCapabilities.length;++s)u=r.videoCapabilities[s],u.contentType&&(o=!0,c=u.contentType.split(";")[0],MSMediaKeys.isTypeSupported(this.keySystem,c)&&(a.videoCapabilities.push(u),n=!0));if(o||(n=MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),"required"==r.persistentState&&(n=!1),n)return void(this.a=a)}throw n=Error("Unsupported keySystem"),n.name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n}function qs(t){var e=this.mediaKeys;return e&&e!=t&&Xs(e,null),delete this.mediaKeys,(this.mediaKeys=t)?Xs(t,this):Promise.resolve()}function Gs(t){this.a=new MSMediaKeys(t),this.b=new wt}function Xs(t,e){function n(){e.msSetMediaKeys(i.a),e.removeEventListener("loadedmetadata",n)}if(St(t.b),!e)return Promise.resolve();Tt(t.b,e,"msneedkey",zs);var i=t;try{return 1<=e.readyState?e.msSetMediaKeys(t.a):e.addEventListener("loadedmetadata",n),Promise.resolve()}catch(t){return Promise.reject(t)}}function Ys(t){gn.call(this),this.c=null,this.g=t,this.b=this.a=null,this.f=new wt,this.sessionId="",this.expiration=NaN,this.closed=new q,this.keyStatuses=new Js}function zs(t){var e=document.createEvent("CustomEvent");if(e.initCustomEvent("encrypted",!1,!1,null),e.initDataType="cenc",t=t.initData){var n=new Vs(t);if(!(1>=n.a.length)){for(var i=[],r=0;r<n.a.length;r++)i.push(t.subarray(n.a[r].start,n.a[r].end+1));for(t=it(i,Ws),i=n=0;i<t.length;i++)n+=t[i].length;for(n=new Uint8Array(n),r=i=0;r<t.length;r++)n.set(t[r],i),i+=t[r].length;t=n}}e.initData=t,this.dispatchEvent(e)}function Ws(t,e){return Xt(t,e)}function $s(t,e){var n=t.keyStatuses;n.size=void 0==e?0:1,n.a=e,t.dispatchEvent(new At("keystatuseschange"))}function Js(){this.size=0,this.a=void 0}function Qs(){return Promise.reject(Error("The key system specified is not supported."))}function Zs(t){return null==t?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}function tu(){throw new TypeError("Illegal constructor.")}function eu(){throw new TypeError("Illegal constructor.")}function nu(t){var e=$c;return e?e+t.charAt(0).toUpperCase()+t.slice(1):t}function iu(t,e){try{var n=new au(t,e);return Promise.resolve(n)}catch(t){return Promise.reject(t)}}function ru(t){var e=this.mediaKeys;return e&&e!=t&&su(e,null),delete this.mediaKeys,(this.mediaKeys=t)&&su(t,this),Promise.resolve()}function au(t,e){this.a=this.keySystem=t;var n=!1;"org.w3.clearkey"==t&&(this.a="webkit-org.w3.clearkey",n=!1);var i=!1,r=document.getElementsByTagName("video");r=r.length?r[0]:document.createElement("video");for(var a=0;a<e.length;++a){var o=e[a],s={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:o.initDataTypes,sessionTypes:["temporary"],label:o.label},u=!1;if(o.audioCapabilities)for(var c=0;c<o.audioCapabilities.length;++c){var h=o.audioCapabilities[c];if(h.contentType){u=!0;var l=h.contentType.split(";")[0];r.canPlayType(l,this.a)&&(s.audioCapabilities.push(h),i=!0)}}if(o.videoCapabilities)for(c=0;c<o.videoCapabilities.length;++c)h=o.videoCapabilities[c],h.contentType&&(u=!0,r.canPlayType(h.contentType,this.a)&&(s.videoCapabilities.push(h),i=!0));if(u||(i=r.canPlayType("video/mp4",this.a)||r.canPlayType("video/webm",this.a)),"required"==o.persistentState&&(n?(s.persistentState="required",s.sessionTypes=["persistent-license"]):i=!1),i)return void(this.b=s)}throw n="Unsupported keySystem","org.w3.clearkey"!=t&&"com.widevine.alpha"!=t||(n="None of the requested configurations were supported."),n=Error(n),n.name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n}function ou(t){this.g=t,this.b=null,this.a=new wt,this.c=[],this.f={}}function su(t,e){t.b=e,St(t.a);var n=$c;e&&(Tt(t.a,e,n+"needkey",t.fe.bind(t)),Tt(t.a,e,n+"keymessage",t.ee.bind(t)),Tt(t.a,e,n+"keyadded",t.ce.bind(t)),Tt(t.a,e,n+"keyerror",t.de.bind(t)))}function uu(t,e){var n=t.f[e];return n||((n=t.c.shift())?(n.sessionId=e,t.f[e]=n):null)}function cu(t,e,n){gn.call(this),this.f=t,this.h=!1,this.a=this.b=null,this.c=e,this.g=n,this.sessionId="",this.expiration=NaN,this.closed=new q,this.keyStatuses=new fu}function hu(t,e,n){if(t.h)return Promise.reject(Error("The session is already initialized."));t.h=!0;try{if("persistent-license"==t.g)if(n)var i=new Uint8Array(Ut("LOAD_SESSION|"+n));else{var r=Ut("PERSISTENT|"),a=new Uint8Array(r.byteLength+e.byteLength);a.set(new Uint8Array(r),0),a.set(new Uint8Array(e),r.byteLength),i=a}else i=new Uint8Array(e)}catch(t){return Promise.reject(t)}t.b=new q;var o=nu("generateKeyRequest");try{t.f[o](t.c,i)}catch(e){if("InvalidStateError"!=e.name)return t.b=null,Promise.reject(e);setTimeout(function(){try{this.f[o](this.c,i)}catch(t){this.b.reject(t),this.b=null}}.bind(t),10)}return t.b}function lu(t,e){var n=t.keyStatuses;n.size=void 0==e?0:1,n.a=e,t.dispatchEvent(new At("keystatuseschange"))}function fu(){this.size=0,this.a=void 0}function du(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}function pu(e,n,i){return new t.TextTrackCue(e,n,i)}function mu(e,n,i){return new t.TextTrackCue(e+"-"+n+"-"+i,e,n,i)}function vu(){}function yu(t){var e=[];if(!t)return e;for(var n=t.childNodes,i=0;i<n.length;i++){var r="span"==n[i].nodeName&&"p"==t.nodeName;n[i].nodeType!=Node.ELEMENT_NODE||"br"==n[i].nodeName||r||(r=yu(n[i]),e=e.concat(r))}return e.length||e.push(t),e}function gu(t,e){for(var n=t.childNodes,i=0;i<n.length;i++)if("br"==n[i].nodeName&&0<i)n[i-1].textContent+="\n";else if(0<n[i].childNodes.length)gu(n[i],e);else if(e){var r=n[i].textContent.trim();r=r.replace(/\s+/g," "),n[i].textContent=r}}function bu(t,e,n,i,r,a,o){if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(t.textContent))return null;gu(t,o),o=_u(t.getAttribute("begin"),n);var s=_u(t.getAttribute("end"),n);n=_u(t.getAttribute("dur"),n);var u=t.textContent;if(null==s&&null!=n&&(s=o+n),null==o||null==s)throw new z(2,2,2001);if(e=new ye(o+e,s+e,u),(r=Au(t,"region",r))&&r.getAttribute("xml:id")){var c=r.getAttribute("xml:id");a=a.filter(function(t){return t.id==c}),e.region=a[0]}return wu(e,t,r,i),e}function wu(t,e,n,i){"rtl"==Eu(e,n,i,"direction")&&(t.writingDirection=1);var r=Eu(e,n,i,"writingMode");"tb"==r||"tblr"==r?t.writingDirection=2:"tbrl"==r?t.writingDirection=3:"rltb"==r||"rl"==r?t.writingDirection=1:r&&(t.writingDirection=oc),(r=Eu(e,n,i,"textAlign"))&&(t.positionAlign=uh[r],t.lineAlign=sh[r],t.textAlign=ic[r.toUpperCase()]),(r=Eu(e,n,i,"displayAlign"))&&(t.displayAlign=ac[r.toUpperCase()]),(r=Eu(e,n,i,"color"))&&(t.color=r),(r=Eu(e,n,i,"backgroundColor"))&&(t.backgroundColor=r),(r=Eu(e,n,i,"fontFamily"))&&(t.fontFamily=r),(r=Eu(e,n,i,"fontWeight"))&&"bold"==r&&(t.fontWeight=700),(r=Eu(e,n,i,"wrapOption"))&&"noWrap"==r&&(t.wrapLine=!1),(r=Eu(e,n,i,"lineHeight"))&&r.match(Zc)&&(t.lineHeight=r),(r=Eu(e,n,i,"fontSize"))&&r.match(Zc)&&(t.fontSize=r),(r=Eu(e,n,i,"fontStyle"))&&(t.fontStyle=fc[r.toUpperCase()]),(n=Su(n,i,"textDecoration"))&&Tu(t,n),(e=ku(e,i,"textDecoration"))&&Tu(t,e)}function Tu(t,e){for(var n=e.split(" "),i=0;i<n.length;i++)switch(n[i]){case"underline":0>t.textDecoration.indexOf("underline")&&t.textDecoration.push("underline");break;case"noUnderline":0<=t.textDecoration.indexOf("underline")&&at(t.textDecoration,"underline");break;case"lineThrough":0>t.textDecoration.indexOf("lineThrough")&&t.textDecoration.push("lineThrough");break;case"noLineThrough":0<=t.textDecoration.indexOf("lineThrough")&&at(t.textDecoration,"lineThrough");break;case"overline":0>t.textDecoration.indexOf("overline")&&t.textDecoration.push("overline");break;case"noOverline":0<=t.textDecoration.indexOf("overline")&&at(t.textDecoration,"overline")}}function Eu(t,e,n,i){return(t=ku(t,n,i))?t:Su(e,n,i)}function Su(t,e,n){for(var i=yu(t),r=0;r<i.length;r++){var a=Dn(i[r],"http://www.w3.org/ns/ttml#styling",n);if(a)return a}return(t=Au(t,"style",e))?Dn(t,"http://www.w3.org/ns/ttml#styling",n):null}function ku(t,e,n){return(t=Au(t,"style",e))?Dn(t,"http://www.w3.org/ns/ttml#styling",n):null}function Au(t,e,n){if(!t||1>n.length)return null;var i=null,r=t;for(t=null;r&&!(t=r.getAttribute(e))&&(r=r.parentNode)instanceof Element;);if(e=t)for(t=0;t<n.length;t++)if(n[t].getAttribute("xml:id")==e){i=n[t];break}return i}function _u(t,e){var n=null;if(eh.test(t)){n=eh.exec(t);var i=Number(n[1]),r=Number(n[2]),a=Number(n[3]),o=Number(n[4]);o+=(Number(n[5])||0)/e.b,a+=o/e.frameRate,n=a+60*r+3600*i}else nh.test(t)?n=Iu(nh,t):ih.test(t)?n=Iu(ih,t):rh.test(t)?(n=rh.exec(t),n=Number(n[1])/e.frameRate):ah.test(t)?(n=ah.exec(t),n=Number(n[1])/e.a):oh.test(t)&&(n=Iu(oh,t));return n}function Iu(t,e){var n=t.exec(e);return null==n||""==n[0]?null:(Number(n[4])||0)/1e3+(Number(n[3])||0)+60*(Number(n[2])||0)+3600*(Number(n[1])||0)}function xu(t,e,n,i){this.frameRate=Number(t)||30,this.b=Number(e)||1,this.a=Number(i),0==this.a&&(this.a=t?this.frameRate*this.b:1),n&&(t=/^(\d+) (\d+)$/g.exec(n))&&(this.frameRate*=t[1]/t[2])}function Pu(){this.a=new vu}function Ru(){}function Nu(t,e,n){var i;(i=/^align:(start|middle|center|end|left|right)$/.exec(e))?(e=i[1],t.textAlign="middle"==e?nc:ic[e.toUpperCase()]):(i=/^vertical:(lr|rl)$/.exec(e))?t.writingDirection="lr"==i[1]?2:3:(i=/^size:([\d.]+)%$/.exec(e))?t.size=Number(i[1]):(i=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(e))?(t.position=Number(i[1]),i[2]&&(e=i[2],t.positionAlign="line-left"==e||"start"==e?"line-left":"line-right"==e||"end"==e?"line-right":"center")):(i=/^region:(.*)$/.exec(e))?(e=Du(n,i[1]))&&(t.region=e):(n=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(e))?(t.lineInterpretation=1,t.line=Number(n[1]),n[2]&&(t.lineAlign=cc[n[2].toUpperCase()])):(n=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(e))&&(t.lineInterpretation=sc,t.line=Number(n[1]),n[2]&&(t.lineAlign=cc[n[2].toUpperCase()]))}function Du(t,e){var n=t.filter(function(t){return t.id==e});return n.length?n[0]:null}function Cu(t){if(null==(t=cr(t,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g)))return null;var e=Number(t[2]),n=Number(t[3]);return 59<e||59<n?null:Number(t[4])/1e3+n+60*e+3600*(Number(t[1])||0)}function Mu(){this.a=null}function Lu(t,e,n){var i,r,a;return(new ii).C("payl",oi(function(t){i=Mt(t)})).C("iden",oi(function(t){r=Mt(t)})).C("sttg",oi(function(t){a=Mt(t)})).parse(t),i?Ou(i,r,a,e,n):null}function Ou(t,e,n,i,r){if(t=new ye(i,r,t),e&&(t.id=e),n)for(e=new sr(n),n=hr(e);n;)Nu(t,n,[]),ur(e),n=hr(e);return t}var Uu,ju="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)},Bu=void 0!==t&&t===this?this:void 0!==e&&null!=e?e:this,Fu=function(){var t=0;return function(e){return"jscomp_symbol_"+(e||"")+t++}}();s("Promise",function(t){function e(t){this.b=0,this.g=void 0,this.a=[];var e=this.c();try{t(e.resolve,e.reject)}catch(t){e.reject(t)}}function n(){this.a=null}function i(t){return t instanceof e?t:new e(function(e){e(t)})}if(t)return t;n.prototype.b=function(t){null==this.a&&(this.a=[],this.f()),this.a.push(t)},n.prototype.f=function(){var t=this;this.c(function(){t.h()})};var r=Bu.setTimeout;n.prototype.c=function(t){r(t,0)},n.prototype.h=function(){for(;this.a&&this.a.length;){var t=this.a;this.a=[];for(var e=0;e<t.length;++e){var n=t[e];t[e]=null;try{n()}catch(t){this.g(t)}}}this.a=null},n.prototype.g=function(t){this.c(function(){throw t})},e.prototype.c=function(){function t(t){return function(i){n||(n=!0,t.call(e,i))}}var e=this,n=!1;return{resolve:t(this.m),reject:t(this.f)}},e.prototype.m=function(t){if(t===this)this.f(new TypeError("A Promise cannot resolve to itself"));else if(t instanceof e)this.o(t);else{t:switch(typeof t){case"object":var n=null!=t;break t;case"function":n=!0;break t;default:n=!1}n?this.l(t):this.h(t)}},e.prototype.l=function(t){var e=void 0;try{e=t.then}catch(t){return void this.f(t)}"function"==typeof e?this.s(e,t):this.h(t)},e.prototype.f=function(t){this.i(2,t)},e.prototype.h=function(t){this.i(1,t)},e.prototype.i=function(t,e){if(0!=this.b)throw Error("Cannot settle("+t+", "+e+"): Promise already settled in state"+this.b);this.b=t,this.g=e,this.j()},e.prototype.j=function(){if(null!=this.a){for(var t=0;t<this.a.length;++t)a.b(this.a[t]);this.a=null}};var a=new n;return e.prototype.o=function(t){var e=this.c();t.sb(e.resolve,e.reject)},e.prototype.s=function(t,e){var n=this.c();try{t.call(e,n.resolve,n.reject)}catch(t){n.reject(t)}},e.prototype.then=function(t,n){function i(t,e){return"function"==typeof t?function(e){try{r(t(e))}catch(t){a(t)}}:e}var r,a,o=new e(function(t,e){r=t,a=e});return this.sb(i(t,r),i(n,a)),o},e.prototype.catch=function(t){return this.then(void 0,t)},e.prototype.sb=function(t,e){function n(){switch(i.b){case 1:t(i.g);break;case 2:e(i.g);break;default:throw Error("Unexpected state: "+i.b)}}var i=this;null==this.a?a.b(n):this.a.push(n)},e.resolve=i,e.reject=function(t){return new e(function(e,n){n(t)})},e.race=function(t){return new e(function(e,n){for(var r=o(t),a=r.next();!a.done;a=r.next())i(a.value).sb(e,n)})},e.all=function(t){var n=o(t),r=n.next();return r.done?i([]):new e(function(t,e){var a=[],o=0;do{a.push(void 0),o++,i(r.value).sb(function(e){return function(n){a[e]=n,0==--o&&t(a)}}(a.length-1),e),r=n.next()}while(!r.done)})},e}),s("Promise.prototype.finally",function(t){return t||function(t){return this.then(function(e){return Promise.resolve(t()).then(function(){return e})},function(e){return Promise.resolve(t()).then(function(){throw e})})}}),h.prototype.h=function(t){this.K=t},h.prototype.return=function(t){this.a={return:t},this.w=this.b},h.prototype.V=function(t){this.w=t},s("WeakMap",function(t){function e(t){if(this.a=(u+=Math.random()+1).toString(),t){n(),i(),t=o(t);for(var e;!(e=t.next()).done;)e=e.value,this.set(e[0],e[1])}}function r(t){_(t,s)||ju(t,s,{value:{}})}function a(t){var e=Object[t];e&&(Object[t]=function(t){return r(t),e(t)})}if(function(){if(!t||!Object.seal)return!1;try{var e=Object.seal({}),n=Object.seal({}),i=new t([[e,2],[n,3]]);return 2==i.get(e)&&3==i.get(n)&&(i.delete(e),i.set(n,4),!i.has(e)&&4==i.get(n))}catch(t){return!1}}())return t;var s="$jscomp_hidden_"+Math.random();a("freeze"),a("preventExtensions"),a("seal");var u=0;return e.prototype.set=function(t,e){if(r(t),!_(t,s))throw Error("WeakMap key fail: "+t);return t[s][this.a]=e,this},e.prototype.get=function(t){return _(t,s)?t[s][this.a]:void 0},e.prototype.has=function(t){return _(t,s)&&_(t[s],this.a)},e.prototype.delete=function(t){return!(!_(t,s)||!_(t[s],this.a))&&delete t[s][this.a]},e}),s("Map",function(t){function e(){var t={};return t.oa=t.next=t.head=t}function r(t,e){var n=t.a;return a(function(){if(n){for(;n.head!=t.a;)n=n.oa;for(;n.next!=n.head;)return n=n.next,{done:!1,value:e(n)};n=null}return{done:!0,value:void 0}})}function s(t,e){var n=e&&typeof e;"object"==n||"function"==n?c.has(e)?n=c.get(e):(n=""+ ++h,c.set(e,n)):n="p_"+e;var i=t.b[n];if(i&&_(t.b,n))for(var r=0;r<i.length;r++){var a=i[r];if(e!==e&&a.key!==a.key||e===a.key)return{id:n,list:i,index:r,O:a}}return{id:n,list:i,index:-1,O:void 0}}function u(t){if(this.b={},this.a=e(),this.size=0,t){t=o(t);for(var n;!(n=t.next()).done;)n=n.value,this.set(n[0],n[1])}}if(function(){if(!t||"function"!=typeof t||!t.prototype.entries||"function"!=typeof Object.seal)return!1;try{var e=Object.seal({x:4}),n=new t(o([[e,"s"]]));if("s"!=n.get(e)||1!=n.size||n.get({x:4})||n.set({x:4},"t")!=n||2!=n.size)return!1;var i=n.entries(),r=i.next();return!r.done&&r.value[0]==e&&"s"==r.value[1]&&(r=i.next(),!(r.done||4!=r.value[0].x||"t"!=r.value[1]||!i.next().done))}catch(t){return!1}}())return t;n(),i();var c=new WeakMap;u.prototype.set=function(t,e){var n=s(this,t);return n.list||(n.list=this.b[n.id]=[]),n.O?n.O.value=e:(n.O={next:this.a,oa:this.a.oa,head:this.a,key:t,value:e},n.list.push(n.O),this.a.oa.next=n.O,this.a.oa=n.O,this.size++),this},u.prototype.delete=function(t){return t=s(this,t),!(!t.O||!t.list)&&(t.list.splice(t.index,1),t.list.length||delete this.b[t.id],t.O.oa.next=t.O.next,t.O.next.oa=t.O.oa,t.O.head=null,this.size--,!0)},u.prototype.clear=function(){this.b={},this.a=this.a.oa=e(),this.size=0},u.prototype.has=function(t){return!!s(this,t).O},u.prototype.get=function(t){return(t=s(this,t).O)&&t.value},u.prototype.entries=function(){return r(this,function(t){return[t.key,t.value]})},u.prototype.keys=function(){return r(this,function(t){return t.key})},u.prototype.values=function(){return r(this,function(t){return t.value})},u.prototype.forEach=function(t,e){for(var n,i=this.entries();!(n=i.next()).done;)n=n.value,t.call(e,n[1],n[0],this)},u.prototype[Symbol.iterator]=u.prototype.entries;var h=0;return u}),s("Array.prototype.find",function(t){return t||function(t,e){t:{var n=this;n instanceof String&&(n=String(n));for(var i=n.length,r=0;r<i;r++){var a=n[r];if(t.call(e,a,r,n)){n=a;break t}}n=void 0}return n}}),s("Object.values",function(t){return t||function(t){var e,n=[];for(e in t)_(t,e)&&n.push(t[e]);return n}}),s("Object.is",function(t){return t||function(t,e){return t===e?0!==t||1/t==1/e:t!==t&&e!==e}}),s("Array.prototype.includes",function(t){return t||function(t,e){var n=this;n instanceof String&&(n=String(n));var i=n.length,r=e||0;for(0>r&&(r=Math.max(r+i,0));r<i;r++){var a=n[r];if(a===t||Object.is(a,t))return!0}return!1}}),s("String.prototype.includes",function(t){return t||function(t,e){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(t,e||0)}});var Vu=this;Vu.a=!0,D.prototype.getBandwidthEstimate=function(t){return 128e3>this.a?t:Math.min(N(this.b),N(this.c))},t.console&&t.console.log.bind&&(C=console.warn.bind(console));var Ku=/^(?:([^:\/?#.]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/#?]*?)(?::([0-9]+))?(?=[\/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;Uu=L.prototype,Uu.ia="",Uu.Fa="",Uu.la="",Uu.Qa=null,Uu.aa="",Uu.za="",Uu.toString=function(){var t=[],e=this.ia;if(e&&t.push(F(e,Hu,!0),":"),e=this.la){t.push("//");var n=this.Fa;n&&t.push(F(n,Hu,!0),"@"),t.push(encodeURIComponent(e).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e=this.Qa,null!=e&&t.push(":",String(e))}return(e=this.aa)&&(this.la&&"/"!=e.charAt(0)&&t.push("/"),t.push(F(e,"/"==e.charAt(0)?Gu:qu,!0))),(e=this.a.toString())&&t.push("?",e),(e=this.za)&&t.push("#",F(e,Yu)),t.join("")},Uu.resolve=function(t){var e=new L(this);"data"===e.ia&&(e=new L);var n=!!t.ia;n?O(e,t.ia):n=!!t.Fa,n?e.Fa=t.Fa:n=!!t.la,n?e.la=t.la:n=null!=t.Qa;var i=t.aa;if(n)U(e,t.Qa);else if(n=!!t.aa){if("/"!=i.charAt(0))if(this.la&&!this.aa)i="/"+i;else{var r=e.aa.lastIndexOf("/");-1!=r&&(i=e.aa.substr(0,r+1)+i)}if(".."==i||"."==i)i="";else if(-1!=i.indexOf("./")||-1!=i.indexOf("/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var a=[],o=0;o<i.length;){var s=i[o++];"."==s?r&&o==i.length&&a.push(""):".."==s?((1<a.length||1==a.length&&""!=a[0])&&a.pop(),r&&o==i.length&&a.push("")):(a.push(s),r=!0)}i=a.join("/")}}return n?e.aa=i:n=""!==t.a.toString(),n?j(e,H(t.a)):n=!!t.za,n&&(e.za=t.za),e};var Hu=/[#\/\?@]/g,qu=/[#\?:]/g,Gu=/[#\?]/g,Xu=/[#\?@]/g,Yu=/#/g;K.prototype.a=null,K.prototype.c=null,K.prototype.add=function(t,e){if(!this.a&&(this.a={},this.c=0,this.b))for(var n=this.b.split("&"),i=0;i<n.length;i++){var r=n[i].indexOf("="),a=null;if(0<=r){var o=n[i].substring(0,r);a=n[i].substring(r+1)}else o=n[i];o=decodeURIComponent(o.replace(/\+/g," ")),a=a||"",this.add(o,decodeURIComponent(a.replace(/\+/g," ")))}return this.b=null,(n=this.a.hasOwnProperty(t)&&this.a[t])||(this.a[t]=n=[]),n.push(e),this.c++,this},K.prototype.toString=function(){if(this.b)return this.b;if(!this.a)return"";var t,e=[];for(t in this.a)for(var n=encodeURIComponent(t),i=this.a[t],r=0;r<i.length;r++){var a=n;""!==i[r]&&(a+="="+encodeURIComponent(i[r])),e.push(a)}return this.b=e.join("&")},q.prototype.resolve=function(){},q.prototype.reject=function(){},I("shaka.util.Error",z),z.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},z.Severity={RECOVERABLE:1,CRITICAL:2},z.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9},z.Code={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,INVALID_TEXT_HEADER:2e3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,BUFFER_READ_OUT_OF_BOUNDS:3e3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,UNABLE_TO_GUESS_MANIFEST_TYPE:4e3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_COULD_NOT_GUESS_MIME_TYPE:4021,HLS_MASTER_PLAYLIST_NOT_PROVIDED:4022,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,HLS_COULD_NOT_PARSE_SEGMENT_START_TIME:4030,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,INVALID_STREAMS_CHOSEN:5005,NO_RECOGNIZED_KEY_SYSTEMS:6e3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,LOAD_INTERRUPTED:7e3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,CAST_API_UNAVAILABLE:8e3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9e3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,STORE_ALREADY_IN_PROGRESS:9006,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013},I("shaka.util.AbortableOperation",W),W.failed=$,W.aborted=J,W.completed=Q,W.notAbortable=Z,W.prototype.abort=function(){return this.a=!0,this.b()},W.prototype.abort=W.prototype.abort,W.all=tt,W.prototype.finally=function(t){return this.promise.then(function(){return t(!0)},function(){return t(!1)}),this},W.prototype.finally=W.prototype.finally,W.prototype.X=function(t,e){function n(){return r.reject(new z(2,7,7001)),i.abort()}var i=this,r=new q;return this.promise.then(function(e){i.a?r.reject(new z(2,7,7001)):t?n=et(t,e,r):r.resolve(e)},function(t){e?n=et(e,t,r):r.reject(t)}),new W(r,function(){return n()})},W.prototype.chain=W.prototype.X,ht.prototype.destroy=function(){var t=[];return this.a.forEach(function(e){e.promise.catch(function(){}),t.push(e.abort())}),this.a=[],Promise.all(t)},I("shaka.net.NetworkingEngine",ft),ft.RequestType={MANIFEST:0,SEGMENT:1,LICENSE:2,APP:3},ft.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:3};var zu={};ft.registerScheme=dt,ft.unregisterScheme=function(t){delete zu[t]},ft.prototype.pe=function(t){this.a.push(t)},ft.prototype.registerRequestFilter=ft.prototype.pe,ft.prototype.Ue=function(t){at(this.a,t)},ft.prototype.unregisterRequestFilter=ft.prototype.Ue,ft.prototype.hd=function(){this.a=[]},ft.prototype.clearAllRequestFilters=ft.prototype.hd,ft.prototype.qe=function(t){this.b.push(t)},ft.prototype.registerResponseFilter=ft.prototype.qe,ft.prototype.Ve=function(t){at(this.b,t)},ft.prototype.unregisterResponseFilter=ft.prototype.Ve,ft.prototype.jd=function(){this.b=[]},ft.prototype.clearAllResponseFilters=ft.prototype.jd,ft.prototype.destroy=function(){return this.c=!0,this.a=[],this.b=[],this.g.destroy()},ft.prototype.destroy=ft.prototype.destroy,ft.prototype.request=function(t,e){var n=this;if(this.c)return mt(J());e.method=e.method||"GET",e.headers=e.headers||{},e.retryParameters=e.retryParameters?ut(e.retryParameters):Y(),e.uris=ut(e.uris);var i=vt(this,t,e),r=i.X(function(){return yt(n,t,e,new G(e.retryParameters,!1),0,null)}),a=r.X(function(e){return gt(n,t,e)}),o=Date.now(),s=0;i.promise.then(function(){s=Date.now()-o},function(){});var u=0;return r.promise.then(function(){u=Date.now()},function(){}),i=a.X(function(e){var i=Date.now()-u;return e.timeMs+=s,e.timeMs+=i,n.f&&!e.fromCache&&1==t&&n.f(e.timeMs,e.data.byteLength),e},function(t){throw t&&(t.severity=2),t}),lt(this.g,i),mt(i)},ft.prototype.request=ft.prototype.request,bt.prototype.push=function(t,e){this.a.hasOwnProperty(t)?this.a[t].push(e):this.a[t]=[e]},bt.prototype.get=function(t){return(t=this.a[t])?t.slice():null},bt.prototype.remove=function(t,e){var n=this.a[t];if(n)for(var i=0;i<n.length;++i)n[i]==e&&(n.splice(i,1),--i)},wt.prototype.destroy=function(){return St(this),this.a=null,Promise.resolve()},wt.prototype.pa=function(t,e){if(this.a)for(var n=this.a.get(e)||[],i=0;i<n.length;++i){var r=n[i];r.target==t&&(r.pa(),this.a.remove(e,r))}},kt.prototype.pa=function(){this.target.removeEventListener(this.type,this.a,!1),this.a=this.target=null},At.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},At.prototype.stopImmediatePropagation=function(){this.a=!0},At.prototype.stopPropagation=function(){};var Wu=1/15,$u={empty:function(t){return!t||0==Object.keys(t).length},values:function(t){return Object.keys(t).map(function(e){return t[e]})},map:function(t,e){return Object.keys(t).reduce(function(n,i){return n[i]=e(t[i],i),n},{})},every:function(t,e){return Object.keys(t).every(function(n){return e(n,t[n])})},forEach:function(t,e){Object.keys(t).forEach(function(n){e(n,t[n])})},df:function(t){var e=new Map;return Object.keys(t).forEach(function(n){e.set(n,t[n])}),e},ef:function(t){var e={};return t.forEach(function(t,n){e[n]=t}),e}},Ju={codecs:"codecs",frameRate:"framerate",bandwidth:"bitrate",width:"width",height:"height",channelsCount:"channels"};I("shaka.util.StringUtils.fromUTF8",Mt),I("shaka.util.StringUtils.fromUTF16",Lt),I("shaka.util.StringUtils.fromBytesAutoDetect",Ot),I("shaka.util.StringUtils.toUTF8",Ut),Bt.prototype.cancel=function(){null!=this.a&&(clearTimeout(this.a),this.a=null)},I("shaka.util.Uint8ArrayUtils.toBase64",Kt),I("shaka.util.Uint8ArrayUtils.fromBase64",Ht),I("shaka.util.Uint8ArrayUtils.fromHex",qt),I("shaka.util.Uint8ArrayUtils.toHex",Gt),I("shaka.util.Uint8ArrayUtils.equal",Xt),I("shaka.util.Uint8ArrayUtils.concat",Yt),Uu=zt.prototype,Uu.destroy=function(){this.c=!0;var t=[];return this.a.forEach(function(e){e=e.ja.close().catch(xt);var n=new Promise(function(t){setTimeout(t,1e3*Qu)});t.push(Promise.race([e,n]))}),this.i.reject(),this.g&&t.push(this.g.destroy()),this.l&&t.push(this.l.setMediaKeys(null).catch(xt)),this.A&&(this.A.cancel(),this.A=null),this.G&&(this.G.cancel(),this.G=null),this.g=this.l=this.j=this.u=this.b=null,this.a=[],this.o=[],this.s=this.h=this.f=null,Promise.all(t)},Uu.configure=function(t){this.f=t},Uu.init=function(t,e){var n={},i=[],r=t.periods.some(function(t){return t.variants.some(function(t){return t.drmInfos.length})});return this.ga=e,this.o=t.offlineSessionIds,Zt(this,t,e||0<t.offlineSessionIds.length,n,i),i.length?te(this,n,i,r):(this.L=!0,Promise.resolve())},Uu.rb=function(t){if(!this.j)return Et(this.g,t,"encrypted",function(){this.h(new z(2,6,6010))}.bind(this)),Promise.resolve();this.l=t,Et(this.g,this.l,"play",this.Td.bind(this)),t=this.l.setMediaKeys(this.j),t=t.catch(function(t){return Promise.reject(new z(2,6,6003,t.message))});var e=null;return this.b.serverCertificate&&this.b.serverCertificate.length&&(e=this.j.setServerCertificate(this.b.serverCertificate).then(function(){}).catch(function(t){return Promise.reject(new z(2,6,6004,t.message))})),Promise.all([t,e]).then(function(){var t=this;if(this.c)return Promise.reject();$t(this),this.b.initData.length||this.o.length||Tt(this.g,this.l,"encrypted",function(e){return Jt(t,e.initDataType,new Uint8Array(e.initData))})}.bind(this)).catch(function(t){return this.c?Promise.resolve():Promise.reject(t)}.bind(this))},Uu.keySystem=function(){return this.b?this.b.keySystem:""},Uu.vb=function(){var t=this.a.map(function(t){return t=t.ja.expiration,isNaN(t)?1/0:t});return Math.min.apply(Math,t)},Uu.Ic=function(t){this.f.delayLicenseRequestUntilPlayed&&this.l.paused&&!this.Y?this.I.push(t):ue(this,t)},Uu.Ec=function(t){t=t.target;var e;for(e=0;e<this.a.length&&this.a[e].ja!=t;++e);if(e!=this.a.length){var n=!1;t.keyStatuses.forEach(function(t,i){if("string"==typeof i){var r=i;i=t,t=r}if("com.microsoft.playready"==this.b.keySystem&&16==i.byteLength){r=new DataView(i);var a=r.getUint32(0,!0),o=r.getUint16(4,!0),s=r.getUint16(6,!0);r.setUint32(0,a,!1),r.setUint16(4,o,!1),r.setUint16(6,s,!1)}"com.microsoft.playready"==this.b.keySystem&&"status-pending"==t&&(t="usable"),"status-pending"!=t&&(this.a[e].loaded=!0),"expired"==t&&(n=!0),r=Gt(new Uint8Array(i)),this.S[r]=t}.bind(this));var i=t.expiration-Date.now();(0>i||n&&1e3>i)&&!this.a[e].qa&&(this.a.splice(e,1),t.close().catch(function(){})),this.a.every(function(t){return t.loaded})&&(this.i.resolve(),Ft(this.G))}},Uu.oe=function(){function t(t,e){return"expired"==e}this.m={};for(var e in this.S)this.m[e]=this.S[e];!$u.empty(this.m)&&$u.every(this.m,t)&&this.h(new z(2,6,6014)),this.s.Ub(this.m)},Uu.Td=function(){for(var t=0;t<this.I.length;t++)ue(this,this.I[t]);this.Y=!0,this.I=[]},Uu.ne=function(){this.a.forEach(function(t){var e=t.Tb,n=t.ja.expiration;isNaN(n)&&(n=1/0),n!=e&&(this.s.onExpirationUpdated(t.ja.sessionId,n),t.Tb=n)}.bind(this))};var Qu=1,Zu=5,tc=.5;I("shaka.text.Cue",ye);var ec="auto";ye.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:ec};var nc="center",ic={LEFT:"left",RIGHT:"right",CENTER:nc,START:"start",END:"end"};ye.textAlign=ic;var rc="before",ac={BEFORE:rc,CENTER:"center",AFTER:"after"};ye.displayAlign=ac;var oc=0;ye.writingDirection={HORIZONTAL_LEFT_TO_RIGHT:oc,HORIZONTAL_RIGHT_TO_LEFT:1,VERTICAL_LEFT_TO_RIGHT:2,VERTICAL_RIGHT_TO_LEFT:3};var sc=0;ye.lineInterpretation={LINE_NUMBER:sc,PERCENTAGE:1};var uc="center",cc={CENTER:uc,START:"start",END:"end"};ye.lineAlign=cc;var hc=400;ye.fontWeight={NORMAL:hc,BOLD:700};var lc="normal",fc={NORMAL:lc,ITALIC:"italic",OBLIQUE:"oblique"};ye.fontStyle=fc,ye.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"},I("shaka.text.CueRegion",ge);var dc=1;ge.units={PX:0,PERCENTAGE:dc,LINES:2};var pc="";ge.scrollMode={NONE:pc,UP:"up"},be.prototype.destroy=function(){return this.a.dispose(),this.a=null,Promise.resolve()},be.prototype.i=function(t){for(var e=0;e<t.captions.length;e++){var n=t.captions[e];this.c.push(new ye(n.startTime,n.endTime,n.text))}e=new Uint8Array(t.data.byteLength+t.initSegment.byteLength),e.set(t.initSegment,0),e.set(t.data,t.initSegment.byteLength),this.g.push(e)},be.prototype.h=function(){var t={data:Yt.apply(null,this.g),cues:this.c};this.b.resolve(t),this.f=!1};var mc={};I("shaka.text.TextEngine.registerParser",function(t,e){mc[t]=e}),I("shaka.text.TextEngine.unregisterParser",function(t){delete mc[t]}),Se.prototype.destroy=function(){return this.c=this.f=null,Promise.resolve()},Se.prototype.Ee=function(t){this.c=t},Se.prototype.setDisplayer=Se.prototype.Ee,Se.prototype.Kb=function(t){var e={periodStart:0,segmentStart:null,segmentEnd:0};try{return this.f.parseMedia(new Uint8Array(t),e)[0].startTime}catch(t){throw new z(2,2,2009,t)}},Se.prototype.remove=function(t,e){return Promise.resolve().then(function(){!this.c||!this.c.remove(t,e)||null==this.a||e<=this.a||t>=this.b||(t<=this.a&&e>=this.b?this.a=this.b=null:t<=this.a&&e<this.b?this.a=e:t>this.a&&e>=this.b&&(this.b=t))}.bind(this))},Se.prototype.lc=function(t){this.c.append(t)},Se.prototype.appendCues=Se.prototype.lc,Uu=Ae.prototype,Uu.destroy=function(){this.m=!0;var t,e=[];for(t in this.c){var n=this.c[t],i=n[0];for(this.c[t]=n.slice(0,1),i&&e.push(i.p.catch(xt)),i=1;i<n.length;++i)n[i].p.catch(xt),n[i].p.reject()}this.a&&e.push(this.a.destroy());for(var r in this.i)e.push(this.i[r].destroy());return Promise.all(e).then(function(){var t=this.h?this.h.destroy():null;return this.f&&(this.f.removeAttribute("src"),this.f.load()),this.o=this.a=this.g=this.f=this.h=null,this.b={},this.i={},this.c={},t}.bind(this))},Uu.init=function(t,e){var n=this;return this.j.then(function(){for(var i in t){var r=t[i];r=Ct(r.mimeType,r.codecs),"text"==i?Ie(n,r):(!e&&MediaSource.isTypeSupported(r)||!we(r,i)||(n.i[i]=new be,r=Te(i,r)),r=n.g.addSourceBuffer(r),Tt(n.h,r,"error",n.Qe.bind(n,i)),Tt(n.h,r,"updateend",n.Oa.bind(n,i)),n.b[i]=r,n.c[i]=[])}})},Uu.Gb=function(){var t=this.a&&null!=this.a.a?[{start:this.a.a,end:this.a.b}]:[];return{total:ve(this.f.buffered),audio:ve(Ne(this,"audio")),video:ve(Ne(this,"video")),text:t}},Uu.remove=function(t,e,n){return"text"==t?this.a.remove(e,n):Le(this,t,this.Wc.bind(this,t,e,n))},Uu.flush=function(t){return"text"==t?Promise.resolve():Le(this,t,this.md.bind(this,t))},Uu.endOfStream=function(t){return Oe(this,function(){t?this.g.endOfStream(t):this.g.endOfStream()}.bind(this))},Uu.ka=function(t){return Oe(this,function(){this.g.duration=t}.bind(this))},Uu.T=function(){return this.g.duration},Uu.Vc=function(t,e){this.b[t].appendBuffer(e)},Uu.Wc=function(t,e,n){n<=e?this.Oa(t):this.b[t].remove(e,n)},Uu.cd=function(t){var e=this.b[t].appendWindowStart,n=this.b[t].appendWindowEnd;this.b[t].abort(),this.b[t].appendWindowStart=e,this.b[t].appendWindowEnd=n,this.Oa(t)},Uu.md=function(t){this.f.currentTime-=.001,this.Oa(t)},Uu.Ge=function(t,e){0>e&&(e+=.001),this.b[t].timestampOffset=e,this.Oa(t)},Uu.De=function(t,e,n){this.b[t].appendWindowStart=0,this.b[t].appendWindowEnd=n,this.b[t].appendWindowStart=e,this.Oa(t)},Uu.Qe=function(t){this.c[t][0].p.reject(new z(2,3,3014,this.f.error?this.f.error.code:0))},Uu.Oa=function(t){var e=this.c[t][0];e&&(e.p.resolve(),Ue(this,t))};var vc=1,yc=2,gc={aar:"aa",abk:"ab",afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arg:"an",arm:"hy",asm:"as",ava:"av",ave:"ae",aym:"ay",aze:"az",bak:"ba",bam:"bm",baq:"eu",bel:"be",ben:"bn",bih:"bh",bis:"bi",bod:"bo",bos:"bs",bre:"br",bul:"bg",bur:"my",cat:"ca",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cor:"kw",cos:"co",cre:"cr",cym:"cy",cze:"cs",dan:"da",deu:"de",div:"dv",dut:"nl",dzo:"dz",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fij:"fj",fin:"fi",fra:"fr",fre:"fr",fry:"fy",ful:"ff",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",glv:"gv",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",heb:"he",her:"hz",hin:"hi",hmo:"ho",hrv:"hr",hun:"hu",hye:"hy",ibo:"ig",ice:"is",ido:"io",iii:"ii",iku:"iu",ile:"ie",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",jav:"jv",jpn:"ja",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",khm:"km",kik:"ki",kin:"rw",kir:"ky",kom:"kv",kon:"kg",kor:"ko",kua:"kj",kur:"ku",lao:"lo",lat:"la",lav:"lv",lim:"li",lin:"ln",lit:"lt",ltz:"lb",lub:"lu",lug:"lg",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",mkd:"mk",mlg:"mg",mlt:"mt",mon:"mn",mri:"mi",msa:"ms",mya:"my",nau:"na",nav:"nv",nbl:"nr",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nno:"nn",nob:"nb",nor:"no",nya:"ny",oci:"oc",oji:"oj",ori:"or",orm:"om",oss:"os",pan:"pa",per:"fa",pli:"pi",pol:"pl",por:"pt",pus:"ps",que:"qu",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sin:"si",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",sqi:"sq",srd:"sc",srp:"sr",ssw:"ss",sun:"su",swa:"sw",swe:"sv",tah:"ty",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tgl:"tl",tha:"th",tib:"bo",tir:"ti",ton:"to",tsn:"tn",tso:"ts",tuk:"tk",tur:"tr",twi:"tw",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",zho:"zh",zul:"zu"};I("shaka.abr.SimpleAbrManager",cn),cn.prototype.stop=function(){this.h=null,this.f=!1,this.c=[],this.g=null},cn.prototype.stop=cn.prototype.stop,cn.prototype.init=function(t){this.h=t},cn.prototype.init=cn.prototype.init,cn.prototype.chooseVariant=function(){var t=hn(this.a.restrictions,this.c),e=this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate);this.c.length&&!t.length&&(t=hn(null,this.c),t=[t[0]]);for(var n=t[0]||null,i=0;i<t.length;++i){var r=t[i],a=(t[i+1]||{bandwidth:1/0}).bandwidth/this.a.bandwidthUpgradeTarget;e>=r.bandwidth/this.a.bandwidthDowngradeTarget&&e<=a&&(n=r)}return this.g=Date.now(),n},cn.prototype.chooseVariant=cn.prototype.chooseVariant,cn.prototype.enable=function(){this.f=!0},cn.prototype.enable=cn.prototype.enable,cn.prototype.disable=function(){this.f=!1},cn.prototype.disable=cn.prototype.disable,cn.prototype.segmentDownloaded=function(t,e){var n=this.b;if(!(16e3>e)){var i=8e3*e/t,r=t/1e3;n.a+=e,R(n.b,r,i),R(n.c,r,i)}if(null!=this.g&&this.f)t:{if(this.i){if(Date.now()-this.g<1e3*this.a.switchInterval)break t}else{if(!(128e3<=this.b.a))break t;this.i=!0}n=this.chooseVariant(),this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate),this.h(n)}},cn.prototype.segmentDownloaded=cn.prototype.segmentDownloaded,cn.prototype.getBandwidthEstimate=function(){return this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate)},cn.prototype.getBandwidthEstimate=cn.prototype.getBandwidthEstimate,cn.prototype.setVariants=function(t){this.c=t},cn.prototype.setVariants=cn.prototype.setVariants,cn.prototype.configure=function(t){this.a=t},cn.prototype.configure=cn.prototype.configure;var bc="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),wc="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),Tc=["loop","playbackRate"],Ec=["pause","play"],Sc="adaptation buffering emsg error loading streaming texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged unloading".split(" "),kc={getAudioLanguages:2,getAudioLanguagesAndRoles:2,getBufferedInfo:2,getConfiguration:2,getExpiration:2,getManifestUri:2,getPlaybackRate:2,getTextLanguages:2,getTextLanguagesAndRoles:2,getTextTracks:2,getStats:5,usingEmbeddedTextTrack:2,getVariantTracks:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1},Ac={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20},_c=[["getConfiguration","configure"]],Ic=[["isTextTrackVisible","setTextTrackVisibility"]],xc="addTextTrack cancelTrickPlay configure resetConfiguration retryStreaming selectAudioLanguage selectEmbeddedTextTrack selectTextLanguage selectTextTrack selectVariantTrack setTextTrackVisibility trickPlay".split(" "),Pc=["attach","detach","load","unload"],Rc=!1,Nc=null;Uu=pn.prototype,Uu.destroy=function(){return vn(this),Nc&&mn(this),this.G=this.A=this.g=null,this.b=this.h=!1,this.m=this.l=this.f=this.c=this.a=this.i=null,Promise.resolve()},Uu.$=function(){return this.b},Uu.Yb=function(){return this.u},Uu.init=function(){if(t.chrome&&chrome.cast&&chrome.cast.isAvailable){delete t.__onGCastApiAvailable,this.h=!0,this.g();var e=new chrome.cast.SessionRequest(this.I);e=new chrome.cast.ApiConfig(e,this.Dc.bind(this),this.Wd.bind(this),"origin_scoped"),chrome.cast.initialize(e,function(){},function(){}),Rc&&setTimeout(this.g.bind(this),20),(e=Nc)&&e.status!=chrome.cast.SessionStatus.STOPPED?this.Dc(e):Nc=null}else t.__onGCastApiAvailable=function(t){t&&this.init()}.bind(this)},Uu.bc=function(t){this.i=t,this.b&&yn({type:"appData",appData:this.i})},Uu.cast=function(t){return this.h?Rc?this.b?Promise.reject(new z(1,8,8002)):(this.f=new q,chrome.cast.requestSession(this.Vb.bind(this,t),this.Bc.bind(this)),this.f):Promise.reject(new z(1,8,8001)):Promise.reject(new z(1,8,8e3))},Uu.ub=function(){this.b&&(vn(this),Nc&&(mn(this),Nc.stop(function(){},function(){}),Nc=null))},Uu.get=function(t,e){if("video"==t){if(0<=Ec.indexOf(e))return this.Mc.bind(this,t,e)}else if("player"==t){if(Ac[e]&&!this.get("player","isLive")())return function(){};if(0<=xc.indexOf(e))return this.Mc.bind(this,t,e);if(0<=Pc.indexOf(e))return this.se.bind(this,t,e);if(kc[e])return this.Jc.bind(this,t,e)}return this.Jc(t,e)},Uu.set=function(t,e,n){this.a[t][e]=n,yn({type:"set",targetName:t,property:e,value:n})},Uu.Vb=function(t,e){Nc=e,e.addUpdateListener(this.l),e.addMessageListener("urn:x-cast:com.google.shaka.v2",this.m),this.Cc(),yn({type:"init",initState:t,appData:this.i}),this.f.resolve()},Uu.Bc=function(t){var e=8003;switch(t.code){case"cancel":e=8004;break;case"timeout":e=8005;break;case"receiver_unavailable":e=8006}this.f.reject(new z(2,8,e,t))},Uu.Jc=function(t,e){return this.a[t][e]},Uu.Mc=function(t,e){yn({type:"call",targetName:t,methodName:e,args:Array.prototype.slice.call(arguments,2)})},Uu.se=function(t,e){var n=Array.prototype.slice.call(arguments,2),i=new q,r=this.o.toString();return this.o++,this.c[r]=i,yn({type:"asyncCall",targetName:t,methodName:e,args:n,id:r}),i},Uu.Dc=function(t){var e=this.s();this.f=new q,this.j=!0,this.Vb(e,t)},Uu.Wd=function(t){Rc="available"==t,this.g()},Uu.Cc=function(){var t=!!Nc&&"connected"==Nc.status;if(this.b&&!t){this.G();for(var e in this.a)this.a[e]={};vn(this)}this.u=(this.b=t)?Nc.receiver.friendlyName:"",this.g()},Uu.Pd=function(t,e){var n=fn(e);switch(n.type){case"event":var i=n.event;this.A(n.targetName,new At(i.type,i));break;case"update":i=n.update;for(var r in i){n=this.a[r]||{};for(var a in i[r])n[a]=i[r][a]}this.j&&(this.L(),this.j=!1);break;case"asyncComplete":if(r=n.id,n=n.error,a=this.c[r],delete this.c[r],a)if(n){r=new z(n.severity,n.category,n.code);for(i in n)r[i]=n[i];a.reject(r)}else a.resolve()}},gn.prototype.addEventListener=function(t,e){this.Bb.push(t,e)},gn.prototype.removeEventListener=function(t,e){this.Bb.remove(t,e)},gn.prototype.dispatchEvent=function(t){for(var e=this.Bb.get(t.type)||[],n=0;n<e.length;++n){t.target=this.jb,t.currentTarget=this.jb;var i=e[n];try{i.handleEvent?i.handleEvent(t):i.call(this,t)}catch(t){}if(t.a)break}return t.defaultPrevented},x(bn,gn),I("shaka.cast.CastProxy",bn),bn.prototype.destroy=function(t){return t&&this.a&&this.a.ub(),t=[this.i?this.i.destroy():null,this.b?this.b.destroy():null,this.a?this.a.destroy():null],this.a=this.i=this.j=this.h=this.b=this.c=null,Promise.all(t)},bn.prototype.destroy=bn.prototype.destroy,bn.prototype.Bd=function(){return this.h},bn.prototype.getVideo=bn.prototype.Bd,bn.prototype.td=function(){return this.j},bn.prototype.getPlayer=bn.prototype.td,bn.prototype.ed=function(){return!!this.a&&(this.a.h&&Rc)},bn.prototype.canCast=bn.prototype.ed,bn.prototype.$=function(){return!!this.a&&this.a.$()},bn.prototype.isCasting=bn.prototype.$,bn.prototype.Yb=function(){return this.a?this.a.Yb():""},bn.prototype.receiverName=bn.prototype.Yb,bn.prototype.cast=function(){var t=this.tc();return this.a.cast(t).then(function(){if(this.b)return this.b.hb()}.bind(this))},bn.prototype.cast=bn.prototype.cast,bn.prototype.bc=function(t){this.a.bc(t)},bn.prototype.setAppData=bn.prototype.bc,bn.prototype.Se=function(){var t=this.a;if(t.b){var e=t.s();chrome.cast.requestSession(t.Vb.bind(t,e),t.Bc.bind(t))}},bn.prototype.suggestDisconnect=bn.prototype.Se,bn.prototype.ub=function(){this.a.ub()},bn.prototype.forceDisconnect=bn.prototype.ub,Uu=bn.prototype,Uu.tc=function(){var t={video:{},player:{},playerAfterLoad:{},manifest:this.b.Ib(),startTime:null};return this.c.pause(),Tc.forEach(function(e){t.video[e]=this.c[e]}.bind(this)),this.c.ended||(t.startTime=this.c.currentTime),_c.forEach(function(e){var n=e[1];e=this.b[e[0]](),t.player[n]=e}.bind(this)),Ic.forEach(function(e){var n=e[1];e=this.b[e[0]](),t.playerAfterLoad[n]=e}.bind(this)),t},Uu.Le=function(){this.dispatchEvent(new At("caststatuschanged"))},Uu.Me=function(){this.f.dispatchEvent(new At(this.h.paused?"pause":"play"))},Uu.Oe=function(){var t=this;_c.forEach(function(t){var e=t[1];t=this.a.get("player",t[0])(),this.b[e](t)}.bind(this));var e=this.a.get("player","getManifestUri")(),n=this.a.get("video","ended"),i=Promise.resolve(),r=this.c.autoplay,a=null;n||(a=this.a.get("video","currentTime")),e&&(this.c.autoplay=!1,i=this.b.load(e,a));var o={};Tc.forEach(function(t){o[t]=this.a.get("video",t)}.bind(this)),i.then(function(){t.c&&(Tc.forEach(function(t){this.c[t]=o[t]}.bind(t)),Ic.forEach(function(t){var e=t[1];t=this.a.get("player",t[0])(),this.b[e](t)}.bind(t)),t.c.autoplay=r,e&&t.c.play())},function(e){t.b.dispatchEvent(new At("error",{detail:e}))})},Uu.Ze=function(t){if("addEventListener"==t)return this.f.addEventListener.bind(this.f);if("removeEventListener"==t)return this.f.removeEventListener.bind(this.f);if(this.a.$()&&0==Object.keys(this.a.a.video).length){var e=this.c[t];if("function"!=typeof e)return e}return this.a.$()?this.a.get("video",t):(t=this.c[t],"function"==typeof t&&(t=t.bind(this.c)),t)},Uu.af=function(t,e){this.a.$()?this.a.set("video",t,e):this.c[t]=e},Uu.$e=function(t){this.a.$()||this.f.dispatchEvent(new At(t.type,t))},Uu.ke=function(t){if("addEventListener"==t)return this.g.addEventListener.bind(this.g);if("removeEventListener"==t)return this.g.removeEventListener.bind(this.g);if("getMediaElement"==t)return function(){return this.h}.bind(this);if("getNetworkingEngine"==t)return this.b.uc.bind(this.b);if(this.a.$()){if("getManifest"==t||"drmInfo"==t)return function(){return C(t+"() does not work while casting!"),null};if("attach"==t||"detach"==t)return function(){return C(t+"() does not work while casting!"),Promise.resolve()}}return this.a.$()&&0==Object.keys(this.a.a.video).length&&kc[t]||!this.a.$()?this.b[t].bind(this.b):this.a.get("player",t)},Uu.le=function(t){this.a.$()||this.g.dispatchEvent(t)},Uu.Ne=function(t,e){this.a.$()&&("video"==t?this.f.dispatchEvent(e):"player"==t&&this.g.dispatchEvent(e))},x(Tn,gn),I("shaka.cast.CastReceiver",Tn),Tn.prototype.isConnected=function(){return this.o},Tn.prototype.isConnected=Tn.prototype.isConnected,Tn.prototype.Ed=function(){return this.h},Tn.prototype.isIdle=Tn.prototype.Ed,Tn.prototype.destroy=function(){var e=[this.c?this.c.destroy():null,this.b?this.b.destroy():null];return null!=this.l&&t.clearTimeout(this.l),this.u=this.s=this.c=this.b=this.a=null,this.o=!1,this.h=!0,this.l=this.i=this.f=null,Promise.all(e).then(function(){cast.receiver.CastReceiverManager.getInstance().stop()})},Tn.prototype.destroy=Tn.prototype.destroy,Uu=Tn.prototype,Uu.Hc=function(){this.g=0,this.j=!0,this.o=0!=cast.receiver.CastReceiverManager.getInstance().getSenders().length,Sn(this)},Uu.Kc=function(t,e){this.b&&(this.Wb(),In(this,{type:"event",targetName:t,event:e},this.f))},Uu.Wb=function(){null!=this.l&&t.clearTimeout(this.l),this.l=t.setTimeout(this.Wb.bind(this),500);var e={video:{},player:{}};if(wc.forEach(function(t){e.video[t]=this.a[t]}.bind(this)),this.b.P())for(var n in Ac)0==this.g%Ac[n]&&(e.player[n]=this.b[n]());for(var i in kc)0==this.g%kc[i]&&(e.player[i]=this.b[i]());(n=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())&&(e.video.volume=n.level,e.video.muted=n.muted),this.m&&(this.g+=1),In(this,{type:"update",update:e},this.f),An(this)},Uu.ld=function(){var t=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();t&&In(this,{type:"update",update:{video:{volume:t.level,muted:t.muted}}},this.f),In(this,{type:"event",targetName:"video",event:{type:"volumechange"}},this.f)},Uu.Zd=function(t){var e=fn(t.data);switch(e.type){case"init":this.g=0,this.m=!1,this.j=!0,kn(this,e.initState,e.appData),this.Wb();break;case"appData":this.u(e.appData);break;case"set":var n=e.targetName,i=e.property;if(e=e.value,"video"==n){var r=cast.receiver.CastReceiverManager.getInstance();if("volume"==i){r.setSystemVolumeLevel(e);break}if("muted"==i){r.setSystemVolumeMuted(e);break}}this.s[n][i]=e;break;case"call":n=this.s[e.targetName],n[e.methodName].apply(n,e.args);break;case"asyncCall":n=e.targetName,i=e.methodName,"player"==n&&"load"==i&&(this.g=0,this.m=!1),r=e.id,t=t.senderId;var a=this.s[n];e=a[i].apply(a,e.args),"player"==n&&"load"==i&&(e=e.then(function(){this.j=!0}.bind(this))),e.then(this.Qc.bind(this,t,r,null),this.Qc.bind(this,t,r))}},Uu.Kd=function(t){var e=fn(t.data);switch(e.type){case"PLAY":this.a.play(),xn(this,0);break;case"PAUSE":this.a.pause(),xn(this,0);break;case"SEEK":t=e.currentTime;var n=e.resumeState;null!=t&&(this.a.currentTime=Number(t)),n&&"PLAYBACK_START"==n?(this.a.play(),xn(this,0)):n&&"PLAYBACK_PAUSE"==n&&(this.a.pause(),xn(this,0));break;case"STOP":this.b.hb().then(function(){this.b&&xn(this,0)}.bind(this));break;case"GET_STATUS":xn(this,Number(e.requestId));break;case"VOLUME":n=e.volume,t=n.level,n=n.muted;var i=this.a.volume,r=this.a.muted;null!=t&&(this.a.volume=Number(t)),null!=n&&(this.a.muted=n),i==this.a.volume&&r==this.a.muted||xn(this,0);break;case"LOAD":this.g=0,this.j=this.m=!1,t=e.currentTime,n=this.A(e.media.contentId),this.a.autoplay=!0,this.b.load(n,t).then(function(){this.b&&_n(this)}.bind(this)).catch(function(t){var n="LOAD_FAILED";7==t.category&&7e3==t.code&&(n="LOAD_CANCELLED"),In(this,{requestId:Number(e.requestId),type:n},this.i)}.bind(this));break;default:In(this,{requestId:Number(e.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},this.i)}},Uu.Qc=function(t,e,n){this.b&&In(this,{type:"asyncComplete",id:e,error:n},this.f,t)};var Dc={IDLE:"IDLE",ad:"PLAYING",Yc:"BUFFERING",$c:"PAUSED"},Cc={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"};I("shaka.media.InitSegmentReference",Zn),Zn.prototype.Db=function(){return this.c()},Zn.prototype.createUris=Zn.prototype.Db,Zn.prototype.Jb=function(){return this.b},Zn.prototype.getStartByte=Zn.prototype.Jb,Zn.prototype.Hb=function(){return this.a},Zn.prototype.getEndByte=Zn.prototype.Hb,I("shaka.media.SegmentReference",ti),ti.prototype.U=function(){return this.position},ti.prototype.getPosition=ti.prototype.U,ti.prototype.Kb=function(){return this.startTime},ti.prototype.getStartTime=ti.prototype.Kb,ti.prototype.pd=function(){return this.endTime},ti.prototype.getEndTime=ti.prototype.pd,ti.prototype.Db=function(){return this.c()},ti.prototype.createUris=ti.prototype.Db,ti.prototype.Jb=function(){return this.b},ti.prototype.getStartByte=ti.prototype.Jb,ti.prototype.Hb=function(){return this.a},ti.prototype.getEndByte=ti.prototype.Hb,I("shaka.util.DataViewReader",ei);var Mc=1;ei.Endianness={bf:0,cf:Mc},ei.prototype.ha=function(){return this.a<this.D.byteLength},ei.prototype.hasMoreData=ei.prototype.ha,ei.prototype.U=function(){return this.a},ei.prototype.getPosition=ei.prototype.U,ei.prototype.qd=function(){return this.D.byteLength},ei.prototype.getLength=ei.prototype.qd,ei.prototype.ca=function(){try{var t=this.D.getUint8(this.a);return this.a+=1,t}catch(t){ni()}},ei.prototype.readUint8=ei.prototype.ca,ei.prototype.bb=function(){try{var t=this.D.getUint16(this.a,this.b);return this.a+=2,t}catch(t){ni()}},ei.prototype.readUint16=ei.prototype.bb,ei.prototype.B=function(){try{var t=this.D.getUint32(this.a,this.b);return this.a+=4,t}catch(t){ni()}},ei.prototype.readUint32=ei.prototype.B,ei.prototype.Lc=function(){try{var t=this.D.getInt32(this.a,this.b);return this.a+=4,t}catch(t){ni()}},ei.prototype.readInt32=ei.prototype.Lc,ei.prototype.Ra=function(){try{if(this.b)var t=this.D.getUint32(this.a,!0),e=this.D.getUint32(this.a+4,!0);else e=this.D.getUint32(this.a,!1),t=this.D.getUint32(this.a+4,!1)}catch(t){ni()}if(2097151<e)throw new z(2,3,3001);return this.a+=8,e*Math.pow(2,32)+t},ei.prototype.readUint64=ei.prototype.Ra,ei.prototype.Da=function(t){this.a+t>this.D.byteLength&&ni();var e=new Uint8Array(this.D.buffer,this.D.byteOffset+this.a,t);return this.a+=t,new Uint8Array(e)},ei.prototype.readBytes=ei.prototype.Da,ei.prototype.F=function(t){this.a+t>this.D.byteLength&&ni(),this.a+=t},ei.prototype.skip=ei.prototype.F,ei.prototype.Oc=function(t){this.a<t&&ni(),this.a-=t},ei.prototype.rewind=ei.prototype.Oc,ei.prototype.seek=function(t){(0>t||t>this.D.byteLength)&&ni(),this.a=t},ei.prototype.seek=ei.prototype.seek,ei.prototype.Xb=function(){for(var t=this.a;this.ha()&&0!=this.D.getUint8(this.a);)this.a+=1;return t=new Uint8Array(this.D.buffer,this.D.byteOffset+t,this.a-t),this.a+=1,Mt(t)},ei.prototype.readTerminatedString=ei.prototype.Xb,I("shaka.util.Mp4Parser",ii),ii.prototype.C=function(t,e){var n=si(t);return this.c[n]=0,this.b[n]=e,this},ii.prototype.box=ii.prototype.C,ii.prototype.Z=function(t,e){var n=si(t);return this.c[n]=1,this.b[n]=e,this},ii.prototype.fullBox=ii.prototype.Z,ii.prototype.stop=function(){this.a=!0},ii.prototype.stop=ii.prototype.stop,ii.prototype.parse=function(t,e){var n=new Uint8Array(t);for(n=new ei(new DataView(n.buffer,n.byteOffset,n.byteLength),0),this.a=!1;n.ha()&&!this.a;)this.xb(0,n,e)},ii.prototype.parse=ii.prototype.parse,ii.prototype.xb=function(t,e,n){var i=e.U(),r=e.B(),a=e.B();switch(r){case 0:r=e.D.byteLength-i;break;case 1:r=e.Ra()}var o=this.b[a];if(o){var s=null,u=null;1==this.c[a]&&(u=e.B(),s=u>>>24,u&=16777215),a=i+r,n&&a>e.D.byteLength&&(a=e.D.byteLength),a-=e.U(),e=0<a?e.Da(a):new Uint8Array(0),e=new ei(new DataView(e.buffer,e.byteOffset,e.byteLength),0),o({parser:this,partialOkay:n||!1,version:s,flags:u,reader:e,size:r,start:i+t})}else e.F(Math.min(i+r-e.U(),e.D.byteLength-e.U()))},ii.prototype.parseNext=ii.prototype.xb,ii.children=ri,ii.sampleDescription=ai,ii.allData=oi,ii.typeToString=ui,I("shaka.media.SegmentIndex",li),li.prototype.destroy=function(){return this.a=null,Promise.resolve()},li.prototype.destroy=li.prototype.destroy,li.prototype.find=function(t){for(var e=this.a.length-1;0<=e;--e){var n=this.a[e];if(t>=n.startTime&&t<n.endTime)return n.position}return this.a.length&&t<this.a[0].startTime?this.a[0].position:null},li.prototype.find=li.prototype.find,li.prototype.get=function(t){return 0==this.a.length?null:(t-=this.a[0].position,0>t||t>=this.a.length?null:this.a[t])},li.prototype.get=li.prototype.get,li.prototype.offset=function(t){for(var e=0;e<this.a.length;++e)this.a[e].startTime+=t,this.a[e].endTime+=t},li.prototype.offset=li.prototype.offset,li.prototype.Pb=function(t){for(var e=[],n=0,i=0;n<this.a.length&&i<t.length;){var r=this.a[n],a=t[i];r.startTime<a.startTime?(e.push(r),n++):(r.startTime>a.startTime?0==n&&e.push(a):(.1<Math.abs(r.endTime-a.endTime)?e.push(new ti(r.position,a.startTime,a.endTime,a.c,a.b,a.a)):e.push(r),n++),i++)}for(;n<this.a.length;)e.push(this.a[n++]);if(e.length)for(n=e[e.length-1].position+1;i<t.length;)r=t[i++],r=new ti(n++,r.startTime,r.endTime,r.c,r.b,r.a),e.push(r);else e=t;this.a=e},li.prototype.merge=li.prototype.Pb,li.prototype.Fb=function(t){for(var e=0;e<this.a.length;++e)if(this.a[e].endTime>t)return void this.a.splice(0,e);this.a=[]},li.prototype.evict=li.prototype.Fb;var Lc;di.prototype.ha=function(){return this.a.ha()},gi.prototype.parse=function(t,e,n,i){var r;if(e=new di(new DataView(e)),440786851!=pi(e).id)throw new z(2,3,3008);var a=pi(e);if(408125543!=a.id)throw new z(2,3,3009);for(e=a.a.byteOffset,a=new di(a.a),r=null;a.ha();){var o=pi(a);if(357149030==o.id){r=o;break}}if(!r)throw new z(2,3,3010);for(a=new di(r.a),r=1e6,o=null;a.ha();){var s=pi(a);if(2807729==s.id)r=yi(s);else if(17545==s.id)if(o=s,4==o.a.byteLength)o=o.a.getFloat32(0);else{if(8!=o.a.byteLength)throw new z(2,3,3003);o=o.a.getFloat64(0)}}if(null==o)throw new z(2,3,3011);if(a=r/1e9,r=o*a,t=pi(new di(new DataView(t))),475249515!=t.id)throw new z(2,3,3007);return bi(t,e,a,r,n,i)};var Oc={},Uc={};I("shaka.media.ManifestParser.registerParserByExtension",function(t,e){Uc[t]=e}),I("shaka.media.ManifestParser.registerParserByMime",function(t,e){Oc[t]=e}),I("shaka.media.PresentationTimeline",Oi),Oi.prototype.T=function(){return this.b},Oi.prototype.getDuration=Oi.prototype.T,Oi.prototype.ka=function(t){this.b=t},Oi.prototype.setDuration=Oi.prototype.ka,Oi.prototype.vd=function(){return this.f},Oi.prototype.getPresentationStartTime=Oi.prototype.vd,Oi.prototype.Rc=function(t){this.j=t},Oi.prototype.setClockOffset=Oi.prototype.Rc,Oi.prototype.yb=function(t){this.i=t},Oi.prototype.setStatic=Oi.prototype.yb,Oi.prototype.dc=function(t){this.c=t},Oi.prototype.setSegmentAvailabilityDuration=Oi.prototype.dc,Oi.prototype.Sc=function(t){this.l=t},Oi.prototype.setDelay=Oi.prototype.Sc,Oi.prototype.Na=function(t,e){0!=t.length&&(e&&(this.h=Math.max(this.h,t[0].startTime)),this.a=t.reduce(function(t,e){return Math.max(t,e.endTime-e.startTime)},this.a))},Oi.prototype.notifySegments=Oi.prototype.Na,Oi.prototype.Rb=function(t){this.a=Math.max(this.a,t)},Oi.prototype.notifyMaxSegmentDuration=Oi.prototype.Rb,Oi.prototype.P=function(){return 1/0==this.b&&!this.i},Oi.prototype.isLive=Oi.prototype.P,Oi.prototype.Aa=function(){return 1/0!=this.b&&!this.i},Oi.prototype.isInProgress=Oi.prototype.Aa,Oi.prototype.Xa=function(){if(1/0==this.c)return this.g;var t=this.Ka()-this.c;return Math.max(this.g,t)},Oi.prototype.getSegmentAvailabilityStart=Oi.prototype.Xa,Oi.prototype.Tc=function(t){this.g=t},Oi.prototype.setUserSeekStart=Oi.prototype.Tc,Oi.prototype.Ka=function(){return this.P()||this.Aa()?Math.min(Math.max(0,(Date.now()+this.j)/1e3-this.a-this.f),this.b):this.b},Oi.prototype.getSegmentAvailabilityEnd=Oi.prototype.Ka,Oi.prototype.Wa=function(t){var e=Math.max(this.h,this.g);if(1/0==this.c)return e;var n=this.Ka()-this.c;return t=Math.min(n+t,this.ma()),Math.max(e,t)},Oi.prototype.getSafeSeekRangeStart=Oi.prototype.Wa,Oi.prototype.Ja=function(){return this.Wa(0)},Oi.prototype.getSeekRangeStart=Oi.prototype.Ja,Oi.prototype.ma=function(){var t=this.P()||this.Aa()?this.l:0;return Math.max(0,this.Ka()-t)},Oi.prototype.getSeekRangeEnd=Oi.prototype.ma,I("shaka.dash.DashParser",Ui),Uu=Ui.prototype,Uu.configure=function(t){this.b=t},Uu.start=function(t,e){return this.h=[t],this.a=e,ji(this).then(function(t){return this.a&&Gi(this,t),this.c}.bind(this))},Uu.stop=function(){return this.b=this.a=null,this.h=[],this.c=null,this.j=[],this.l={},null!=this.g&&(t.clearTimeout(this.g),this.g=null),this.f.destroy()},Uu.update=function(){ji(this).catch(function(t){this.a&&this.a.onError(t)}.bind(this))},Uu.onExpirationUpdated=function(){},Uu.ge=function(t,e){t.W=Xi(e,t.ba,null);var n=!1,i=Rn(e,"Role"),r=i.map(function(t){return t.getAttribute("value")}).filter(Pt),a=void 0,o="text"==t.W.contentType;o&&(a="subtitle");for(var s=0;s<i.length;s++){var u=i[s].getAttribute("schemeIdUri");if(null==u||"urn:mpeg:dash:role:2011"==u)switch(u=i[s].getAttribute("value")){case"main":n=!0;break;case"caption":case"subtitle":a=u}}var c=null,h=!1;if(Rn(e,"EssentialProperty").forEach(function(t){"http://dashif.org/guidelines/trickmode"==t.getAttribute("schemeIdUri")?c=t.getAttribute("value"):h=!0}),h)return null;i=Rn(e,"ContentProtection");var l=Kn(i,this.b.dash.customScheme,this.b.dash.ignoreDrmInfo);if(i=Be(e.getAttribute("lang")||"und"),u=e.getAttribute("label"),s=Rn(e,"Representation"),r=s.map(this.je.bind(this,t,l,a,i,u,n,r)).filter(function(t){return!!t}),0==r.length){if(o)return null;throw new z(2,4,4003)}return t.W.contentType&&"application"!=t.W.contentType||(t.W.contentType=Ji(r[0].mimeType,r[0].codecs),r.forEach(function(e){e.type=t.W.contentType})),r.forEach(function(t){l.drmInfos.forEach(function(e){t.keyId&&e.keyIds.push(t.keyId)})}),o=s.map(function(t){return t.getAttribute("id")}).filter(Pt),{id:t.W.id||"__fake__"+this.i++,contentType:t.W.contentType,language:i,Nb:n,streams:r,drmInfos:l.drmInfos,hc:c,te:o}},Uu.je=function(t,e,n,i,r,a,o,s){if(t.v=Xi(s,t.W,null),!zi(t.v))return null;t.bandwidth=Mn(s,"bandwidth",Bn)||0;var u=t.v.contentType;u="text"==u||"application"==u;try{var c=this.ue.bind(this);if(t.v.cb)var h=Ei(t,c);else if(t.v.ta)h=Ai(t,this.l);else if(t.v.fb)h=Pi(t,c,this.l,!!this.c);else{var l=t.v.ea,f=t.M.duration||0;h={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(t){return 0<=t&&t<f?1:null},getSegmentReference:function(t){return 1!=t?null:new ti(1,0,f,function(){return l},0,null)},initSegmentReference:null,da:0}}}catch(t){if(u&&4002==t.code)return null;throw t}return s=Rn(s,"ContentProtection"),s=Hn(s,this.b.dash.customScheme,e,this.b.dash.ignoreDrmInfo),{id:this.i++,createSegmentIndex:h.createSegmentIndex,findSegmentPosition:h.findSegmentPosition,getSegmentReference:h.getSegmentReference,initSegmentReference:h.initSegmentReference,presentationTimeOffset:h.da,mimeType:t.v.mimeType,codecs:t.v.codecs,frameRate:t.v.frameRate,bandwidth:t.bandwidth,width:t.v.width,height:t.v.height,kind:n,encrypted:0<e.drmInfos.length,keyId:s,language:i,label:r,type:t.W.contentType,primary:a,trickModeVideo:null,containsEmsgBoxes:t.v.containsEmsgBoxes,roles:o,channelsCount:t.v.Sb}},Uu.Pe=function(){this.g=null,ji(this).then(function(t){this.a&&Gi(this,t)}.bind(this)).catch(function(t){this.a&&(t.severity=1,this.a.onError(t),Gi(this,0))}.bind(this))},Uu.ie=function(t,e,n){var i=n.getAttribute("schemeIdUri")||"",r=n.getAttribute("value")||"",a=Mn(n,"timescale",Fn)||1;Rn(n,"Event").forEach(function(n){var o=Mn(n,"presentationTime",Fn)||0,s=Mn(n,"duration",Fn)||0;o=o/a+t,s=o+s/a,null!=e&&(o=Math.min(o,t+e),s=Math.min(s,t+e)),n={schemeIdUri:i,value:r,startTime:o,endTime:s,id:n.getAttribute("id")||"",eventElement:n},this.a.onTimelineRegionAdded(n)}.bind(this))},Uu.ue=function(t,e,n){return t=pt(t,this.b.retryParameters),null!=e&&(t.headers.Range="bytes="+e+"-"+(null!=n?n:"")),e=this.a.networkingEngine.request(1,t),lt(this.f,e),e.promise.then(function(t){return t.data})},Uc.mpd=Ui,Oc["application/dash+xml"]=Ui,Zi.prototype.toString=function(){function t(t){return t.name+'="'+t.value+'"'}return this.value?"#"+this.name+":"+this.value:0<this.a.length?"#"+this.name+":"+this.a.map(t).join(","):"#"+this.name},Zi.prototype.getAttribute=function(t){var e=this.a.filter(function(e){return e.name==t});return e.length?e[0]:null};var jc="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-MAP EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST".split(" "),Bc="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE".split(" ");I("shaka.net.DataUriPlugin",mr),mr.parse=function(e){var n=e.split(":");if(2>n.length||"data"!=n[0])throw new z(2,1,1004,e);if(n=n.slice(1).join(":").split(","),2>n.length)throw new z(2,1,1004,e);var i=n[0];n=t.decodeURIComponent(n.slice(1).join(",")),i=i.split(";");var r=null;if(1<i.length&&(r=i[1]),"base64"==r)e=Ht(n).buffer;else{if(r)throw new z(2,1,1005,e);e=Ut(n)}return{data:e,contentType:i[0]}},dt("data",mr),I("shaka.hls.HlsParser",vr),Uu=vr.prototype,Uu.configure=function(t){this.g=t},Uu.start=function(t,e){return this.c=e,this.m=t,Vr(this,t).then(function(e){return gr(this,e.data,t).then(function(){return Kr(this,this.i),this.o}.bind(this))}.bind(this))},Uu.stop=function(){return this.g=this.c=null,this.u={},this.I={},this.o=null,this.h.destroy()},Uu.update=function(){if(this.f!=qc.ra){var t,e=[];for(t in this.a)e.push(yr(this,this.a[t],t));return Promise.all(e)}},Uu.onExpirationUpdated=function(){};var Fc={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/],text:[/^vtt$/,/^wvtt/,/^stpp/]},Vc={audio:{mp4:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",ts:"video/mp2t"},video:{mp4:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",ts:"video/mp2t"},text:{mp4:"application/mp4",m4s:"application/mp4",m4i:"application/mp4",vtt:"text/vtt",ttml:"application/ttml+xml"}};vr.prototype.S=function(){this.c&&(this.j=null,this.update().then(function(){Kr(this,this.i)}.bind(this)).catch(function(t){this.c&&(t.severity=1,this.c.onError(t),Kr(this,0))}.bind(this)))};var Kc={"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(t){var e=Br(t,"METHOD");return"SAMPLE-AES-CENC"!=e&&"SAMPLE-AES-CTR"!=e?null:(e=Br(t,"URI"),e=mr.parse(e),e=new Uint8Array(e.data),e=Dt("com.widevine.alpha",[{initDataType:"cenc",initData:e}]),(t=er(t,"KEYID"))&&(e.keyIds=[t.substr(2).toLowerCase()]),e)}},Hc="VOD",qc={ra:Hc,Zc:"EVENT",jc:"LIVE"};Uc.m3u8=vr,Oc["application/x-mpegurl"]=vr,Oc["application/vnd.apple.mpegurl"]=vr,qr.prototype.destroy=function(){var t=this.h.destroy();return this.u=this.s=this.a=this.h=null,null!=this.b&&(this.b.cancel(),this.b=null),t},qr.prototype.ab=function(){this.f=!0,this.l()},qr.prototype.l=function(){if(0!=this.a.readyState){if(this.a.seeking){if(!this.g)return}else this.g=!1;if(!this.a.paused){this.a.readyState!=this.m&&(this.c=!1,this.m=this.a.readyState);var t=this.o.smallGapLimit,e=this.a.currentTime,n=this.a.buffered;t:{if(n&&n.length&&!(1==n.length&&1e-6>n.end(0)-n.start(0))){var i=.1;/(Edge\/|Trident\/|Tizen)/.test(navigator.userAgent)&&(i=.5);for(var r=0;r<n.length;r++)if(n.start(r)>e&&(0==r||n.end(r-1)-e<=i)){i=r;break t}}i=null}if(null==i){if(n=this.a.currentTime,e=this.a.buffered,!this.a.paused&&0<this.a.playbackRate)if(this.j!=n)this.j=n,this.A=Date.now(),this.i=!1;else if(!this.i&&this.A<Date.now()-1e3)for(i=0;i<e.length;i++)if(n>=e.start(i)&&n<e.end(i)-.5){this.a.currentTime+=.1,this.j=this.a.currentTime,this.i=!0;break}}else if(0!=i||this.f){r=n.start(i);var a=this.s.presentationTimeline.ma();if(!(r>=a)){a=r-e,t=a<=t;var o=!1;.001>a||(t||this.c||(this.c=!0,e=new At("largegap",{currentTime:e,gapSize:a}),e.cancelable=!0,this.u(e),this.o.jumpLargeGaps&&!e.defaultPrevented&&(o=!0)),!t&&!o)||(0!=i&&n.end(i-1),this.a.currentTime=r)}}}}},Uu=Gr.prototype,Uu.destroy=function(){var t=this.c.destroy();return this.c=null,null!=this.b&&(this.b.cancel(),this.b=null),this.i=this.a=null,t},Uu.Va=function(){return this.f},Uu.Vd=function(){var t=this.g||0>this.f?0:this.f;this.a.playbackRate&&this.a.playbackRate!=t&&zr(this,this.a.playbackRate)},Uu.Fc=function(){.001>Math.abs(this.a.currentTime-this.h)?this.Gc():(Et(this.c,this.a,"seeking",this.Gc.bind(this)),this.a.currentTime=0==this.a.currentTime?this.h:this.a.currentTime)},Uu.Gc=function(){var t=this;Tt(this.c,this.a,"seeking",function(){return t.i()})},Uu=$r.prototype,Uu.destroy=function(){var t=Promise.all([this.a.destroy(),this.g.destroy()]);return this.g=this.a=null,null!=this.f&&(this.f.cancel(),this.f=null),this.j=this.h=this.b=this.c=null,t},Uu.Va=function(){return this.a.Va()},Uu.ab=function(){this.g.ab()},Uu.Ud=function(){if(0!=this.c.readyState&&!this.c.paused){var t=this.c.currentTime,e=this.b.presentationTimeline,n=e.Ja();e=e.ma(),3>e-n&&(n=e-3),t<n&&(t=Zr(this,t),this.c.currentTime=t)}},Uu.Xd=function(){var t=this.g;t.g=!0,t.f=!1,t.c=!1;var e=Xr(this.a);if(t=Zr(this,e),.001<Math.abs(t-e)&&(e=(new Date).getTime()/1e3,!this.i||this.i<e-1))return this.i=e,void Yr(this.a,t);this.j()},ea.prototype.destroy=function(){var t=this.j?this.j.destroy():Promise.resolve();return this.j=null,ra(this),this.A=this.h=this.l=this.s=this.g=this.u=this.a=null,this.c=[],t},ea.prototype.o=function(t){if(!this.c.some(function(e){return e.info.schemeIdUri==t.schemeIdUri&&e.info.startTime==t.startTime&&e.info.endTime==t.endTime})){var e={info:t,status:1};this.c.push(e);var n=new At("timelineregionadded",{detail:na(t)});this.h(n),this.m(!0,e)}},ea.prototype.m=function(t,e){var n=e.info.startTime>this.a.currentTime?1:e.info.endTime<this.a.currentTime?3:2,i=2==e.status,r=2==n;n!=e.status&&((!t||i||r)&&(i||this.h(new At("timelineregionenter",{detail:na(e.info)})),r||this.h(new At("timelineregionexit",{detail:na(e.info)}))),e.status=n)},ea.prototype.G=function(){this.f=null,ia(this);var t=sn(this.g,this.a.currentTime);t!=this.i&&(-1!=this.i&&this.A(),this.i=t),t=me(this.a.buffered,this.a.currentTime);var e=de(this.a.buffered),n=this.g.presentationTimeline,i=n.Ka();e=n.P()&&e>=i,n=this.u,n=!n.g||"ended"==n.g.readyState,e=e||this.a.ended||n,this.b?(n=Math.max(this.g.minBufferTime||0,this.s.rebufferingGoal),(e||t>=n)&&0!=this.b&&(this.b=!1,this.l(!1))):!e&&.5>t&&1!=this.b&&(this.b=!0,this.l(!0)),this.c.forEach(this.m.bind(this,!1))},Uu=aa.prototype,Uu.destroy=function(){for(var t in this.c)Ua(this.c[t]);return this.g=this.c=this.i=this.h=this.m=this.b=this.a=null,this.f=!0,Promise.resolve()},Uu.configure=function(t){this.g=t,this.A=new G({maxAttempts:Math.max(t.retryParameters.maxAttempts,2),baseDelay:t.retryParameters.baseDelay,backoffFactor:t.retryParameters.backoffFactor,fuzzFactor:t.retryParameters.fuzzFactor,timeout:0},!0)},Uu.init=function(){var t=Jr(this.a.Pa);return t=this.a.Ac(this.b.periods[sn(this.b,t)]),t.variant||t.text?ga(this,t).then(function(){!this.f&&this.a&&this.a.Ld&&this.a.Ld()}.bind(this)):Promise.reject(new z(2,5,5005))},Uu.Re=function(t){if(!this.f&&!t.Ca&&null!=t.ua&&!t.ya)if(t.ua=null,t.va)La(this,t,t.zb);else{try{var e=Ea(this,t);null!=e&&(Oa(this,t,e),t.Ya=!1)}catch(t){return void ja(this,t)}e=$u.values(this.c),Da(this,t),e.every(function(t){return t.endOfStream})&&this.a.J.endOfStream().then(function(){if(!this.f){var t=this.a.J.T();t<this.b.presentationTimeline.T()&&this.b.presentationTimeline.ka(t)}}.bind(this))}},Uu.he=function(t,e,n){var i=n.reader.Xb(),r=n.reader.Xb(),a=n.reader.B(),o=n.reader.B(),s=n.reader.B(),u=n.reader.B();n=n.reader.Da(n.reader.D.byteLength-n.reader.U()),t=t.startTime+e.startTime+o/a,"urn:mpeg:dash:event:2012"==i?this.a.Nd():this.a.onEvent(new At("emsg",{detail:{startTime:t,endTime:t+s/a,schemeIdUri:i,value:r,timescale:a,presentationTimeDelta:o,eventDuration:s,id:u,messageData:n}}))},I("shaka.net.HttpFetchPlugin",Fa),Fa.f=function(t,e,n,i,r){return c(function a(){var o,s,u,c,h,l;return A(a,function(a){switch(a.w){case 1:return o=Fa.c,p(a,2,3),d(a,o(t,n),5);case 5:return s=a.K,d(a,s.arrayBuffer(),6);case 6:u=a.K;case 3:g(a),clearTimeout(r),b(a,4);break;case 2:if(c=y(a),i.mc)throw new z(1,1,7001,t,e);if(i.Xc)throw new z(1,1,1003,t,e);throw new z(1,1,1002,t,c,e);case 4:return h={},l=s.headers,l.forEach(function(t,e){h[e.trim()]=t}),a.return(Ba(h,u,s.status,t,s.url,e))}})})},Fa.isSupported=function(){return!(!t.fetch||!t.AbortController)},Fa.isSupported=Fa.isSupported,Fa.c=t.fetch,Fa.a=t.AbortController,Fa.b=t.Headers,Fa.isSupported()&&(dt("http",Fa,2),dt("https",Fa,2)),I("shaka.net.HttpXHRPlugin",Va),Va.g=t.XMLHttpRequest,dt("http",Va,1),dt("https",Va,1),Ka.prototype.destroy=function(){this.h=!0;var t=this.c.catch(function(){});return this.c=Promise.resolve(),t},za.prototype.abort=function(){try{this.c.abort()}catch(t){}return this.a.catch(function(){})},za.prototype.store=function(){return this.b},za.prototype.promise=function(){return this.a},Wa.prototype.destroy=function(){return Promise.all(this.a.map(function(t){return t.abort()}))},Qa.prototype.destroy=function(){var t=$u.values(this.a).map(function(t){return t.destroy()});return this.a={},Promise.all(t)},Qa.prototype.init=function(){var t=this;$u.forEach(Gc,function(e,n){var i=n();i&&(t.a[e]=i)});var e=$u.values(this.a).map(function(t){return t.init()});return Promise.all(e)},I("shaka.offline.StorageMuxer.register",function(t,e){Gc[t]=e}),I("shaka.offline.StorageMuxer.unregister",function(t){delete Gc[t]});var Gc={};Uu=ro.prototype,Uu.destroy=function(){return this.a.destroy()},Uu.hasFixedKeySpace=function(){return!0},Uu.addSegments=function(){return ao("segment")},Uu.removeSegments=function(t,e){return oo(this,"segment",t,e)},Uu.getSegments=function(t){return so(this,"segment",t).then(function(t){return t.map(fo)})},Uu.addManifests=function(){return ao("manifest")},Uu.updateManifestExpiration=function(t,e){var n=$a(this.a,"manifest"),i=n.store(),r=new q;return i.get(t).onsuccess=function(n){(n=n.target.result)?(n.expiration=e,i.put(n),r.resolve()):r.reject(new z(2,9,9012,"Could not find values for "+t))},n.promise().then(function(){return r})},Uu.removeManifests=function(t,e){return oo(this,"manifest",t,e)},Uu.getManifests=function(t){return so(this,"manifest",t).then(function(t){return t.map(uo)})},Uu.getAllManifests=function(){var t=Ja(this.a,"manifest","readonly"),e={};return t.store().openCursor().onsuccess=function(t){(t=t.target.result)&&(e[t.key]=uo(t.value),t.continue())},t.promise().then(function(){return e})},Uu=vo.prototype,Uu.destroy=function(){return this.a.destroy()},Uu.hasFixedKeySpace=function(){return this.f},Uu.addSegments=function(t){return yo(this,this.c,t)},Uu.removeSegments=function(t,e){return go(this,this.c,t,e)},Uu.getSegments=function(t){return bo(this,this.c,t)},Uu.addManifests=function(t){return yo(this,this.b,t)},Uu.updateManifestExpiration=function(t,e){var n=$a(this.a,this.b),i=n.store();return i.get(t).onsuccess=function(n){(n=n.target.result)&&(n.expiration=e,i.put(n,t))},n.promise()},Uu.removeManifests=function(t,e){return go(this,this.b,t,e)},Uu.getManifests=function(t){return bo(this,this.b,t)},Uu.getAllManifests=function(){var t=Ja(this.a,this.b,"readonly"),e={};return t.store().openCursor().onsuccess=function(t){(t=t.target.result)&&(e[t.key]=t.value,t.continue())},t.promise().then(function(){return e})},wo.prototype.init=function(){var e=this,n=new q,i=t.indexedDB.open("shaka_offline_db",3);return i.onsuccess=function(t){t=t.target.result,e.f=t;var i=t.objectStoreNames;i=i.contains("manifest")&&i.contains("segment")?new ro(t):null,e.a=i,i=t.objectStoreNames,i=i.contains("manifest-v2")&&i.contains("segment-v2")?new vo(t,"segment-v2","manifest-v2",!0):null,e.b=i,i=t.objectStoreNames,t=i.contains("manifest-v3")&&i.contains("segment-v3")?new vo(t,"segment-v3","manifest-v3",!1):null,e.c=t,n.resolve()},i.onupgradeneeded=function(t){t=t.target.result;var e={autoIncrement:!0};t.createObjectStore("manifest-v3",e),t.createObjectStore("segment-v3",e)},i.onerror=function(t){n.reject(new z(2,9,9001,i.error)),t.preventDefault()},n},wo.prototype.destroy=function(){var t=this;return c(function e(){return A(e,function(e){switch(e.w){case 1:if(!t.a){e.V(2);break}return d(e,t.a.destroy(),2);case 2:if(!t.b){e.V(4);break}return d(e,t.b.destroy(),4);case 4:if(!t.c){e.V(6);break}return d(e,t.c.destroy(),6);case 6:t.f&&t.f.close(),e.w=0}})})},wo.prototype.getCells=function(){var t={};return this.a&&(t.v1=this.a),this.b&&(t.v2=this.b),this.c&&(t.v3=this.c),t},wo.prototype.erase=function(){var t=this;return c(function e(){return A(e,function(e){switch(e.w){case 1:if(!t.a){e.V(2);break}return d(e,t.a.destroy(),2);case 2:if(!t.b){e.V(4);break}return d(e,t.b.destroy(),4);case 4:if(!t.c){e.V(6);break}return d(e,t.c.destroy(),6);case 6:return t.f&&t.f.close(),d(e,To(),8);case 8:return t.f=null,t.a=null,t.b=null,t.c=null,d(e,t.init(),0)}})})},Gc.idb=function(){return t.indexedDB?new wo:null},Eo.prototype.fa=function(){return this.g},Eo.prototype.N=function(){return this.f},Eo.prototype.key=function(){return this.c},Eo.prototype.toString=function(){return this.b},Uu=No.prototype,Uu.configure=function(){},Uu.start=function(t){var e=So(t);if(this.a=e,null==e||"manifest"!=e.a)return Promise.reject(new z(2,1,9004,e));var n=new Qa;return ct([n],function(){return c(function t(){var i,r,a,o;return A(t,function(t){switch(t.w){case 1:return d(t,n.init(),2);case 2:return d(t,eo(n,e.fa(),e.N()),3);case 3:return i=t.K,d(t,i.getManifests([e.key()]),4);case 4:return r=t.K,a=r[0],o=new ko(e.fa(),e.N()),t.return(Ao(o,a))}})})})},Uu.stop=function(){return Promise.resolve()},Uu.update=function(){},Uu.onExpirationUpdated=function(t,e){var n=this.a,i=new Qa;return ct([i],function(){return c(function r(){var a,o,s,u,c;return A(r,function(r){switch(r.w){case 1:return d(r,i.init(),2);case 2:return d(r,eo(i,n.fa(),n.N()),3);case 3:return a=r.K,d(r,a.getManifests([n.key()]),4);case 4:if(o=r.K,s=o[0],u=0<=s.sessionIds.indexOf(t),c=void 0==s.expiration||s.expiration>e,u&&c)return d(r,a.updateManifestExpiration(n.key(),e),0);r.V(0)}})})}).catch(function(){})},Oc["application/x-offline-manifest"]=No,I("shaka.offline.OfflineScheme",Do),Do.a=function(t){return t={uri:t,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}},Q(t)},Do.b=function(t,e){var n=new Qa;return Z(ct([n],function(){return c(function t(){var i,r,a;return A(t,function(t){switch(t.w){case 1:return d(t,n.init(),2);case 2:return d(t,eo(n,e.fa(),e.N()),3);case 3:return i=t.K,d(t,i.getSegments([e.key()]),4);case 4:return r=t.K,a=r[0],t.return({uri:e,data:a.data,headers:{}})}})})}))},dt("offline",Do),I("shaka.text.SimpleTextDisplayer",Co),Co.prototype.remove=function(t,e){return!!this.a&&(Lo(this.a,function(n){return!(n.startTime>=e||n.endTime<=t)}),!0)},Co.prototype.remove=Co.prototype.remove,Co.prototype.append=function(t){for(var e=Mo,n=[],i=0;i<t.length;i++){var r=e(t[i]);r&&n.push(r)}n.slice().sort(function(t,e){return t.startTime!=e.startTime?t.startTime-e.startTime:t.endTime!=e.endTime?t.endTime-e.startTime:n.indexOf(e)-n.indexOf(t)}).forEach(function(t){this.a.addCue(t)}.bind(this))},Co.prototype.append=Co.prototype.append,Co.prototype.destroy=function(){return this.a&&Lo(this.a,function(){return!0}),this.a=null,Promise.resolve()},Co.prototype.destroy=Co.prototype.destroy,Co.prototype.isTextVisible=function(){return"showing"==this.a.mode},Co.prototype.isTextVisible=Co.prototype.isTextVisible,Co.prototype.setTextVisibility=function(t){this.a.mode=t?"showing":"hidden"},Co.prototype.setTextVisibility=Co.prototype.setTextVisibility,x(Oo,gn),I("shaka.Player",Oo),Oo.prototype.destroy=function(){var t=this;return c(function e(){var n;return A(e,function(e){switch(e.w){case 1:return d(e,t.detach(),2);case 2:return t.wa=!0,n=Promise.all([t.o?t.o.destroy():null,t.s?t.s.destroy():null]),t.pb=!1,t.o=null,t.h=null,t.Ab=null,t.s=null,t.c=null,d(e,n,0)}})})},Oo.prototype.destroy=Oo.prototype.destroy,Oo.version="v2.4.5";var Xc={};Oo.registerSupportPlugin=function(t,e){Xc[t]=e},Oo.isBrowserSupported=function(){return!!(t.Promise&&t.Uint8Array&&Array.prototype.forEach&&t.MediaSource&&MediaSource.isTypeSupported&&t.MediaKeys&&t.navigator&&t.navigator.requestMediaKeySystemAccess&&t.MediaKeySystemAccess&&t.MediaKeySystemAccess.prototype.getConfiguration)},Oo.probeSupport=function(){return he().then(function(t){t={manifest:Mi(),media:_e(),drm:t};for(var e in Xc)t[e]=Xc[e]();return t})},Oo.prototype.rb=function(t,e){var n=this;return c(function i(){return A(i,function(i){switch(i.w){case 1:if(void 0===e&&(e=!0),!n.f){i.V(2);break}return d(i,n.detach(),2);case 2:if(n.f=t,Tt(n.o,n.f,"error",n.be.bind(n)),e)return n.j=new Ae(n.f),d(i,n.j.j,0);i.V(0)}})})},Oo.prototype.attach=Oo.prototype.rb,Oo.prototype.detach=function(){var t=this;return c(function e(){return A(e,function(e){switch(e.w){case 1:return t.f?d(e,t.hb(!1),2):e.return();case 2:t.o.pa(t.f,"error"),t.f=null,e.w=0}})})},Oo.prototype.detach=Oo.prototype.detach,Oo.prototype.load=function(t,e,n){var i=this;return c(function r(){var a,o,s,u,c,h,l,f,m,g,b;return A(r,function(r){switch(r.w){case 1:if(!i.f)throw new z(2,7,7002);return o=new q,s=function(){return a=new z(2,7,7e3),o},i.dispatchEvent(new At("loading")),u=Date.now(),p(r,2),c=i.hb(),i.Ha=s,d(r,c,4);case 4:if(i.l=$o(),Tt(i.o,i.f,"playing",i.ib.bind(i)),Tt(i.o,i.f,"pause",i.ib.bind(i)),Tt(i.o,i.f,"ended",i.ib.bind(i)),h=i.c.abrFactory,i.h&&i.Ab==h||(i.Ab=h,i.h=new h,i.h.configure(i.c.abr)),i.u=new i.c.textDisplayFactory,i.u.setTextVisibility(i.pb),a)throw a;return l=i,d(r,jo(i,t,n),5);case 5:if(l.b=r.K,i.Cb=t,a)throw a;return Bo(i),i.i=new zt({$a:i.s,onError:i.Ta.bind(i),Ub:i.Md.bind(i),onExpirationUpdated:i.Jd.bind(i),onEvent:i.gb.bind(i)}),i.i.configure(i.c.drm),d(r,i.i.init(i.b,!1),6);case 6:if(a)throw a;return i.ec(i.b.periods),i.kb=Date.now()/1e3,i.L=i.c.preferredAudioLanguage,i.ga=i.c.preferredTextLanguage,i.Y=i.c.preferredAudioChannelCount,Fo(i),d(r,i.i.rb(i.f),7);case 7:if(a)throw a;return i.h.init(i.Ke.bind(i)),i.j||(i.j=new Ae(i.f)),i.j.o=i.u,i.g=new $r(i.f,i.b,i.c.streaming,void 0==e?null:e,i.Ie.bind(i),i.gb.bind(i)),i.A=new ea(i.f,i.j,i.b,i.c.streaming,i.Uc.bind(i),i.gb.bind(i),i.He.bind(i)),i.a=new aa(i.b,{Pa:i.g,J:i.j,$a:i.s,Ac:i.Hd.bind(i),zc:i.fd.bind(i),onError:i.Ta.bind(i),onEvent:i.gb.bind(i),Nd:i.Od.bind(i),ab:i.Yd.bind(i),filterNewPeriod:i.tb.bind(i),filterAllPeriods:i.ec.bind(i)}),i.a.configure(i.c.streaming),Vo(i),i.dispatchEvent(new At("streaming")),d(r,i.a.init(),8);case 8:if(a)throw a;if(i.c.streaming.startAtSegmentBoundary&&(f=Zo(i,Jr(i.g)),Yr(i.g.a,f)),i.b.periods.forEach(i.tb.bind(i)),is(i),ns(i),m=oa(i.a),g=Qe(m.variants,i.L,i.Ga,i.Y),i.h.setVariants(g),m.variants.some(function(t){return t.primary}),i.nb.forEach(i.A.o.bind(i.A)),i.nb=[],Et(i.o,i.f,"loadeddata",function(){this.l.loadLatency=(Date.now()-u)/1e3}.bind(i)),a)throw a;i.Ha=null,v(r);break;case 2:return b=y(r),o.resolve(),i.Ha==s&&(i.Ha=null,i.dispatchEvent(new At("unloading"))),a?r.return(Promise.reject(a)):r.return(Promise.reject(b))}})})},Oo.prototype.load=Oo.prototype.load,Oo.prototype.configure=function(t,e){if(2==arguments.length&&"string"==typeof t){for(var n=t,i={},r=i,a=0,o=0;!(0>(a=n.indexOf(".",a)));)0!=a&&"\\"==n[a-1]||(o=n.substring(o,a).replace(/\\\./g,"."),r[o]={},r=r[o],o=a+1),a+=1;r[n.substring(o).replace(/\\\./g,".")]=e,t=i}return n=st(this.c,t,Wo(this),zo(),""),Ko(this),n},Oo.prototype.configure=Oo.prototype.configure,Oo.prototype.getConfiguration=function(){var t=Wo(this);return st(t,this.c,Wo(this),zo(),""),t},Oo.prototype.getConfiguration=Oo.prototype.getConfiguration,Oo.prototype.ve=function(){this.c=Wo(this),Ko(this)},Oo.prototype.resetConfiguration=Oo.prototype.ve,Oo.prototype.sd=function(){return this.f},Oo.prototype.getMediaElement=Oo.prototype.sd,Oo.prototype.uc=function(){return this.s},Oo.prototype.getNetworkingEngine=Oo.prototype.uc,Oo.prototype.Ib=function(){return this.Cb},Oo.prototype.getManifestUri=Oo.prototype.Ib,Oo.prototype.P=function(){return!!this.b&&this.b.presentationTimeline.P()},Oo.prototype.isLive=Oo.prototype.P,Oo.prototype.Aa=function(){return!!this.b&&this.b.presentationTimeline.Aa()},Oo.prototype.isInProgress=Oo.prototype.Aa,Oo.prototype.Dd=function(){if(!this.b||!this.b.periods.length)return!1;var t=this.b.periods[0].variants;return!!t.length&&!t[0].video},Oo.prototype.isAudioOnly=Oo.prototype.Dd,Oo.prototype.xe=function(){var t=0,e=0;return this.b&&(e=this.b.presentationTimeline,t=e.Ja(),e=e.ma()),{start:t,end:e}},Oo.prototype.seekRange=Oo.prototype.xe,Oo.prototype.keySystem=function(){return this.i?this.i.keySystem():""},Oo.prototype.keySystem=Oo.prototype.keySystem,Oo.prototype.drmInfo=function(){return this.i?this.i.b:null},Oo.prototype.drmInfo=Oo.prototype.drmInfo,Oo.prototype.vb=function(){return this.i?this.i.vb():1/0},Oo.prototype.getExpiration=Oo.prototype.vb,Oo.prototype.xc=function(){return this.ob},Oo.prototype.isBuffering=Oo.prototype.xc,Oo.prototype.hb=function(t){var e=this;return c(function n(){return A(n,function(n){switch(n.w){case 1:return e.wa?n.return():(void 0===t&&(t=!0),e.dispatchEvent(new At("unloading")),d(n,Uo(e),2));case 2:return e.qb||(e.qb=Yo(e).then(function(){e.Uc(!1),e.qb=null})),d(n,e.qb,3);case 3:if(t)return e.j=new Ae(e.f),d(n,e.j.j,0);n.V(0)}})})},Oo.prototype.unload=Oo.prototype.hb,Oo.prototype.Va=function(){return this.g?this.g.Va():0},Oo.prototype.getPlaybackRate=Oo.prototype.Va,Oo.prototype.Te=function(t){this.g&&zr(this.g.a,t),this.a&&da(this.a,1!=t)},Oo.prototype.trickPlay=Oo.prototype.Te,Oo.prototype.gd=function(){this.g&&zr(this.g.a,1),this.a&&da(this.a,!1)},Oo.prototype.cancelTrickPlay=Oo.prototype.gd,Oo.prototype.Ad=function(){if(!this.b||!this.g)return[];var t=sn(this.b,Jr(this.g)),e=this.I[t]||{};return Ye(this.b.periods[t],e.audio,e.video)},Oo.prototype.getVariantTracks=Oo.prototype.Ad,Oo.prototype.zd=function(){if(!this.b||!this.g)return[];var t=sn(this.b,Jr(this.g)),e=this.I[t]||{};if(!e.text){var n=en(this.b.periods[t].textStreams,this.ga,this.Ua);n.length&&(e.text=n[0].id)}return ze(this.b.periods[t],e.text).filter(function(t){return 0>this.lb.indexOf(t.id)}.bind(this))},Oo.prototype.getTextTracks=Oo.prototype.zd,Oo.prototype.Be=function(t){if(this.a){var e=oa(this.a);t:{for(var n=0;n<e.textStreams.length;n++)if(e.textStreams[n].id==t.id){t=e.textStreams[n];break t}t=null}t&&(this.j.l=!1,Go(this,t,!1),e=t,this.xa?this.G=e:ma(this.a,e,!0),this.ga=t.language)}},Oo.prototype.selectTextTrack=Oo.prototype.Be,Oo.prototype.ze=function(){this.j.l=!0,fa(this.a)},Oo.prototype.selectEmbeddedTextTrack=Oo.prototype.ze,Oo.prototype.Ye=function(){return!!this.j&&this.j.l},Oo.prototype.usingEmbeddedTextTrack=Oo.prototype.Ye,Oo.prototype.Ce=function(t,e){if(this.a){this.c.abr.enabled&&C("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var n=oa(this.a),i=We(n,t);i&&$e(i)&&(qo(this,i,!1),Jo(this,i,e),this.L=i.language,i.audio&&i.audio.channelsCount&&(this.Y=i.audio.channelsCount),n=Qe(n.variants,this.L,this.Ga,this.Y),this.h.setVariants(n))}},Oo.prototype.selectVariantTrack=Oo.prototype.Ce,Oo.prototype.od=function(){if(!this.a)return[];var t=oa(this.a);return t=Je(t.variants).map(function(t){return t.audio}).filter(Rt),Ho(t)},Oo.prototype.getAudioLanguagesAndRoles=Oo.prototype.od,Oo.prototype.yd=function(){return this.a?Ho(oa(this.a).textStreams):[]},Oo.prototype.getTextLanguagesAndRoles=Oo.prototype.yd,Oo.prototype.nd=function(){return this.a?Je(oa(this.a).variants).map(function(t){return t.language}).filter(Rt):[]},Oo.prototype.getAudioLanguages=Oo.prototype.nd,Oo.prototype.xd=function(){return this.a?oa(this.a).textStreams.map(function(t){return t.language}).filter(Rt):[]},Oo.prototype.getTextLanguages=Oo.prototype.xd,Oo.prototype.ye=function(t,e){if(this.a){var n=oa(this.a);this.L=t,this.Ga=e||"",es(this,n)}},Oo.prototype.selectAudioLanguage=Oo.prototype.ye,Oo.prototype.Ae=function(t,e){if(this.a){var n=oa(this.a);this.ga=t,this.Ua=e||"",es(this,n)}},Oo.prototype.selectTextLanguage=Oo.prototype.Ae,Oo.prototype.Mb=function(){return this.u?this.u.isTextVisible():this.pb},Oo.prototype.isTextTrackVisible=Oo.prototype.Mb,Oo.prototype.Fe=function(t){this.u&&this.u.setTextVisibility(t),this.pb=t,rs(this),!this.c.streaming.alwaysStreamText&&this.a&&(t?(t=oa(this.a),(t=en(t.textStreams,this.ga,this.Ua)[0])&&la(this.a,t)):fa(this.a))},Oo.prototype.setTextTrackVisibility=Oo.prototype.Fe,Oo.prototype.ud=function(){return this.b?new Date(1e3*this.b.presentationTimeline.f+1e3*this.f.currentTime):null},Oo.prototype.getPlayheadTimeAsDate=Oo.prototype.ud,Oo.prototype.wd=function(){return this.b?new Date(1e3*this.b.presentationTimeline.f):null},Oo.prototype.getPresentationStartTimeAsDate=Oo.prototype.wd,Oo.prototype.Gb=function(){return this.j?this.j.Gb():{total:[],audio:[],video:[],text:[]}},Oo.prototype.getBufferedInfo=Oo.prototype.Gb,Oo.prototype.getStats=function(){Qo(this),this.ib();var t=null,e=null,n=this.f;if(n=n&&n.getVideoPlaybackQuality?n.getVideoPlaybackQuality():{},this.g&&this.b){var i=sn(this.b,Jr(this.g)),r=this.b.periods[i];(i=this.I[i])&&(e=on(i.audio,i.video,r.variants),t=e.video||{})}return t||(t={}),e||(e={}),{width:t.width||0,height:t.height||0,streamBandwidth:e.bandwidth||0,decodedFrames:Number(n.totalVideoFrames),droppedFrames:Number(n.droppedVideoFrames),estimatedBandwidth:this.h?this.h.getBandwidthEstimate():NaN,loadLatency:this.l.loadLatency,playTime:this.l.playTime,bufferingTime:this.l.bufferingTime,switchHistory:ut(this.l.switchHistory),stateHistory:ut(this.l.stateHistory)}},Oo.prototype.getStats=Oo.prototype.getStats,Oo.prototype.addTextTrack=function(t,e,n,i,r,a){if(!this.a)return Promise.reject();var o=oa(this.a),s=this.b.periods.indexOf(o)+1,u=(s>=this.b.periods.length?this.b.presentationTimeline.T():this.b.periods[s].startTime)-o.startTime;if(1/0==u)return Promise.reject(new z(1,4,4033));var c={id:this.bd++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return 1},getSegmentReference:function(e){return 1!=e?null:new ti(1,0,u,function(){return[t]},0,null)},initSegmentReference:null,presentationTimeOffset:0,mimeType:i,codecs:r||"",kind:n,encrypted:!1,keyId:null,language:e,label:a||null,type:"text",primary:!1,trickModeVideo:null,containsEmsgBoxes:!1,roles:[],channelsCount:null};return this.lb.push(c.id),o.textStreams.push(c),la(this.a,c).then(function(){if(!this.wa){var t=this.b.periods.indexOf(o),i=ha(this.a,"text");return i&&(this.I[t].text=i.id),this.lb.splice(this.lb.indexOf(c.id),1),es(this,o),is(this),{id:c.id,active:!1,type:"text",bandwidth:0,language:e,label:a||null,kind:n,width:null,height:null}}}.bind(this))},Oo.prototype.addTextTrack=Oo.prototype.addTextTrack,Oo.prototype.cc=function(t,e){this.mb.width=t,this.mb.height=e},Oo.prototype.setMaxHardwareResolution=Oo.prototype.cc,Oo.prototype.ac=function(){if(this.a){var t=this.a;if(t.f)t=!1;else if(t.l)t=!1;else{for(var e in t.c){var n=t.c[e];n.Ya&&(n.Ya=!1,Oa(t,n,.1))}t=!0}}else t=!1;return t},Oo.prototype.retryStreaming=Oo.prototype.ac,Oo.prototype.rd=function(){return this.b},Oo.prototype.getManifest=Oo.prototype.rd,Uu=Oo.prototype,Uu.kd=function(t){var e=[1001,1002,1003];this.P()&&0<=e.indexOf(t.code)&&(t.severity=1,this.ac())},Uu.ec=function(t){t.forEach(Ke.bind(null,this.i,this.a?ua(this.a):null,this.a?ca(this.a):null));var e=ot(t,function(t){return t.variants.some($e)});if(0==e)throw new z(2,4,4032);if(e<t.length)throw new z(2,4,4011);t.forEach(function(t){if(Ve(t,this.c.restrictions,this.mb)&&this.a&&oa(this.a)==t&&is(this),!t.variants.some($e))throw new z(2,4,4012)}.bind(this))},Uu.tb=function(t){Ke(this.i,this.a?ua(this.a):null,this.a?ca(this.a):null,t);var e=t.variants,n=e.some($e);if(Ve(t,this.c.restrictions,this.mb)&&this.a&&oa(this.a)==t&&is(this),t=e.some($e),!n)throw new z(2,4,4011);if(!t)throw new z(2,4,4012);if(n=this.i?this.i.b:null)for(e=o(e),t=e.next();!t.done;t=e.next()){t=o(t.value.drmInfos);for(var i=t.next();!i.done;i=t.next())if(i=i.value,i.keySystem==n.keySystem){i=o(i.initData||[]);for(var r=i.next();!r.done;r=i.next())r=r.value,Jt(this.i,r.initDataType,r.initData)}}},Uu.Je=function(t,e){this.h&&this.h.segmentDownloaded(t,e)},Uu.Uc=function(t){if(Qo(this),this.ob=t,this.ib(),this.g){var e=this.g.a;t!=e.g&&(e.g=t,zr(e,e.f))}this.dispatchEvent(new At("buffering",{buffering:t}))},Uu.He=function(){is(this)},Uu.ib=function(){if(!this.wa){var t=this.ob?"buffering":this.f.ended?"ended":this.f.paused?"paused":"playing",e=Date.now()/1e3;if(this.l.stateHistory.length){var n=this.l.stateHistory[this.l.stateHistory.length-1];if(n.duration=e-n.timestamp,t==n.state)return}this.l.stateHistory.push({timestamp:e,state:t,duration:0})}},Uu.Ie=function(){if(this.A){var t=this.A;t.c.forEach(t.m.bind(t,!0))}this.a&&va(this.a)},Uu.Hd=function(t){this.xa=!0,this.h.disable();var e={audio:!1,text:!1},n=Qe(t.variants,this.L,this.Ga,this.Y,e),i=en(t.textStreams,this.ga,this.Ua,e);if(n=ts(this,n),i=i[0]||null,this.S){t:{for(var r=this.b,a=0;a<r.periods.length;++a)for(var o=r.periods[a],s=0;s<o.variants.length;++s)if(o.variants[s]==this.S){r=a;break t}r=-1}this.b.periods[r]==t&&(n=this.S),this.S=null}return this.G&&(this.b.periods[un(this.b,this.G)]==t&&(i=this.G),this.G=null),n&&qo(this,n,!0),i&&(Go(this,i,!0),!sa(this.a)&&n&&n.audio&&e.text&&i.language!=n.audio.language&&(this.u.setTextVisibility(!0),rs(this))),this.c.streaming.alwaysStreamText||this.Mb()?{variant:n,text:i}:{variant:n,text:null}},Uu.fd=function(){this.xa=!1,this.c.abr.enabled&&this.h.enable(),this.S&&(pa(this.a,this.S,this.kc),this.S=null),this.G&&(ma(this.a,this.G,!0),this.G=null)},Uu.Od=function(){this.m&&this.m.update&&this.m.update()},Uu.Yd=function(){this.g&&this.g.ab()},Uu.Ke=function(t,e){qo(this,t,!0),this.a&&(pa(this.a,t,e||!1),ns(this))},Uu.Ta=function(t){if(!this.wa){var e=new At("error",{detail:t});this.dispatchEvent(e),e.defaultPrevented&&(t.handled=!0)}},Uu.ae=function(t){this.A?this.A.o(t):this.nb.push(t)},Uu.gb=function(t){this.dispatchEvent(t)},Uu.be=function(){if(this.f.error){var t=this.f.error.code;if(1!=t){var e=this.f.error.msExtendedCode;e&&(0>e&&(e+=Math.pow(2,32)),e=e.toString(16)),this.Ta(new z(2,3,3016,t,e,this.f.error.message))}}},Uu.Md=function(t){var e=["output-restricted","internal-error"],n=oa(this.a),i=!1,r=Object.keys(t),a=1==r.length&&"00"==r[0];r.length&&n.variants.forEach(function(n){var r=[];n.audio&&r.push(n.audio),n.video&&r.push(n.video),r.forEach(function(r){var o=n.allowedByKeySystem;r.keyId&&(r=t[a?"00":r.keyId],n.allowedByKeySystem=!!r&&0>e.indexOf(r)),o!=n.allowedByKeySystem&&(i=!0)})}),(r=an(ua(this.a),ca(this.a),n.variants))&&!r.allowedByKeySystem&&es(this,n),i&&(is(this),n=Qe(n.variants,this.L,this.Ga,this.Y),this.h.setVariants(n))},Uu.Jd=function(t,e){this.m&&this.m.onExpirationUpdated&&this.m.onExpirationUpdated(t,e),this.dispatchEvent(new At("expirationupdated"))},I("shaka.offline.Storage",hs),hs.support=ls,hs.prototype.destroy=function(){return this.a=this.b=null,Promise.resolve()},hs.prototype.destroy=hs.prototype.destroy,hs.prototype.configure=function(t){st(this.b,t,ys(this),{},"")},hs.prototype.configure=hs.prototype.configure,hs.prototype.store=function(t,e,n){var i=this;return c(function r(){var a,o,s,u,h,l;return A(r,function(r){switch(r.w){case 1:return _s(),i.g?r.return(Promise.reject(new z(2,9,9006))):(i.g=!0,a=e||{},o=null,s=function(t){o=o||t},d(r,ms(i,t,s,n),2));case 2:if(u=r.K,!(h=!u.manifest.presentationTimeline.P()&&!u.manifest.presentationTimeline.Aa()))throw new z(2,9,9005,t);if(As(i),o)throw o;return l=new Qa,r.return(ct([l,u.Eb],function(){return c(function e(){var n,r,s,c,h,f,v;return A(e,function(e){switch(e.w){case 1:return m(e),d(e,l.init(),4);case 4:return As(i),gs(i,u.Eb,u.manifest.periods),d(e,Za(l),5);case 5:return n=e.K,As(i),p(e,6),d(e,fs(i,n.N,u.Eb,u.manifest,t,a||{}),8);case 8:return r=e.K,As(i),d(e,n.N.addManifests([r]),9);case 9:return s=e.K,As(i),c=new Eo("manifest",n.path.fa,n.path.N,s[0]),e.return(os(c,r));case 6:return h=y(e),f=i.f,v=function(){},d(e,n.N.removeSegments(f,v),10);case 10:throw o||h;case 2:g(e),i.g=!1,i.c=null,i.f=[],b(e,0)}})})}))}})})},hs.prototype.store=hs.prototype.store,hs.prototype.remove=function(t){var e=this;_s();var n=So(t);if(null==n||"manifest"!=n.a)return Promise.reject(new z(2,9,9004,t));var i=new Qa;return ct([i],function(){return c(function t(){var r,a,o;return A(t,function(t){switch(t.w){case 1:return d(t,i.init(),2);case 2:return d(t,eo(i,n.fa(),n.N()),3);case 3:return r=t.K,d(t,r.getManifests([n.key()]),4);case 4:return a=t.K,o=a[0],d(t,Promise.all([ds(e,n,o),ps(e,r,n,o)]),0)}})})})},hs.prototype.remove=hs.prototype.remove,hs.prototype.list=function(){function t(t,n){return c(function i(){var r;return A(i,function(i){switch(i.w){case 1:return d(i,n.getAllManifests(),2);case 2:r=i.K,$u.forEach(r,function(n,i){var r=os(new Eo("manifest",t.fa,t.N,n),i);e.push(r)}),i.w=0}})})}_s();var e=[],n=new Qa;return ct([n],function(){return c(function e(){var i;return A(e,function(e){switch(e.w){case 1:return d(e,n.init(),2);case 2:return i=Promise.resolve(),to(n,function(e,n){i=i.then(function(){return t(e,n)})}),d(e,i,0)}})})}).then(function(){return e})},hs.prototype.list=hs.prototype.list,hs.deleteAll=function(){return c(function t(){var e;return A(t,function(t){switch(t.w){case 1:return e=new Qa,m(t),d(t,no(e),2);case 2:return g(t),d(t,e.destroy(),5);case 5:b(t,0)}})})},Xc.offline=ls,I("shaka.polyfill.installAll",function(){for(var t=0;t<Yc.length;++t)Yc[t].dd()});var Yc=[];I("shaka.polyfill.register",Ns),Ns(function(){if(t.Document){var e=Element.prototype;e.requestFullscreen=e.requestFullscreen||e.mozRequestFullScreen||e.msRequestFullscreen||e.webkitRequestFullscreen,e=Document.prototype,e.exitFullscreen=e.exitFullscreen||e.mozCancelFullScreen||e.msExitFullscreen||e.webkitExitFullscreen,"fullscreenElement"in document||(Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}})),document.addEventListener("webkitfullscreenchange",Ds),document.addEventListener("webkitfullscreenerror",Ds),document.addEventListener("mozfullscreenchange",Ds),document.addEventListener("mozfullscreenerror",Ds),document.addEventListener("MSFullscreenChange",Ds),document.addEventListener("MSFullscreenError",Ds)}}),Ns(function(){var e=navigator.userAgent;e&&0<=e.indexOf("CrKey")&&delete t.indexedDB});var zc;Ns(function(){0>navigator.userAgent.indexOf("Trident/")||HTMLInputElement.prototype.addEventListener==Cs||(zc=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=Cs)}),Ns(function(){}),Ns(function(){if(t.MediaSource)if(t.cast&&cast.__platform__&&cast.__platform__.canDisplayType)Fs();else if(navigator.vendor&&0<=navigator.vendor.indexOf("Apple")){var e=navigator.appVersion;Bs(),0<=e.indexOf("Version/8")?t.MediaSource=null:0<=e.indexOf("Version/9")?Ms():0<=e.indexOf("Version/10")?(Ms(),Os()):0<=e.indexOf("Version/11")&&(Ms(),Ls())}}),Vs.prototype.c=function(t){if(!(1<t.version)){var e=Gt(t.reader.Da(16)),n=[];if(0<t.version)for(var i=t.reader.B(),r=0;r<i;++r){var a=Gt(t.reader.Da(16));n.push(a)}i=t.reader.B(),t.reader.F(i),this.b.push.apply(this.b,n),this.f.push(e),this.a.push({start:t.start,end:t.start+t.size-1})}},Hs.prototype.createMediaKeys=function(){var t=new Gs(this.keySystem);return Promise.resolve(t)},Hs.prototype.getConfiguration=function(){return this.a},Gs.prototype.createSession=function(t){var e=t||"temporary";if("temporary"!=e)throw new TypeError("Session type "+t+" is unsupported on this platform.");return new Ys(this.a,e)},Gs.prototype.setServerCertificate=function(){return Promise.resolve(!1)},x(Ys,gn),Uu=Ys.prototype,Uu.generateRequest=function(t,e){this.a=new q;try{this.c=this.g.createSession("video/mp4",new Uint8Array(e),null),Tt(this.f,this.c,"mskeymessage",this.Sd.bind(this)),Tt(this.f,this.c,"mskeyadded",this.Qd.bind(this)),Tt(this.f,this.c,"mskeyerror",this.Rd.bind(this)),$s(this,"status-pending")}catch(t){this.a.reject(t)}return this.a},Uu.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},Uu.update=function(t){this.b=new q;try{this.c.update(new Uint8Array(t))}catch(t){this.b.reject(t)}return this.b},Uu.close=function(){try{this.c.close(),this.closed.resolve(),St(this.f)}catch(t){this.closed.reject(t)}return this.closed},Uu.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))},Uu.Sd=function(t){this.a&&(this.a.resolve(),this.a=null),this.dispatchEvent(new At("message",{messageType:void 0==this.keyStatuses.a?"licenserequest":"licenserenewal",message:t.message.buffer}))},Uu.Qd=function(){this.a?($s(this,"usable"),this.a.resolve(),this.a=null):this.b&&($s(this,"usable"),this.b.resolve(),this.b=null)},Uu.Rd=function(){var t=Error("EME PatchedMediaKeysMs key error");if(t.errorCode=this.c.error,null!=this.a)this.a.reject(t),this.a=null;else if(null!=this.b)this.b.reject(t),this.b=null;else switch(this.c.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:$s(this,"output-not-allowed");break;default:$s(this,"internal-error")}};var Wc;Uu=Js.prototype,Uu.forEach=function(t){this.a&&t(this.a,Wc)},Uu.get=function(t){if(this.has(t))return this.a},Uu.has=function(t){var e=Wc;return!(!this.a||!Xt(new Uint8Array(t),new Uint8Array(e)))},Uu.entries=function(){},Uu.keys=function(){},Uu.values=function(){},Ns(function(){!t.HTMLVideoElement||!t.MSMediaKeys||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(Wc=new Uint8Array([0]).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=qs,t.MediaKeys=Gs,t.MediaKeySystemAccess=Hs,navigator.requestMediaKeySystemAccess=Ks)}),tu.prototype.createSession=function(){},tu.prototype.setServerCertificate=function(){},eu.prototype.getConfiguration=function(){},eu.prototype.createMediaKeys=function(){},Ns(function(){!t.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(navigator.requestMediaKeySystemAccess=Qs,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Zs,t.MediaKeys=tu,t.MediaKeySystemAccess=eu)},-10);var $c="";au.prototype.createMediaKeys=function(){var t=new ou(this.a);return Promise.resolve(t)},au.prototype.getConfiguration=function(){return this.b},Uu=ou.prototype,Uu.createSession=function(t){var e=t||"temporary";if("temporary"!=e&&"persistent-license"!=e)throw new TypeError("Session type "+t+" is unsupported on this platform.");return t=this.b||document.createElement("video"),t.src||(t.src="about:blank"),e=new cu(t,this.g,e),this.c.push(e),e},Uu.setServerCertificate=function(){return Promise.resolve(!1)},Uu.fe=function(t){var e=document.createEvent("CustomEvent");e.initCustomEvent("encrypted",!1,!1,null),e.initDataType="webm",e.initData=t.initData,this.b.dispatchEvent(e)},Uu.ee=function(t){var e=uu(this,t.sessionId);e&&(t=new At("message",{messageType:void 0==e.keyStatuses.a?"licenserequest":"licenserenewal",message:t.message}),e.b&&(e.b.resolve(),e.b=null),e.dispatchEvent(t))},Uu.ce=function(t){(t=uu(this,t.sessionId))&&(lu(t,"usable"),t.a&&t.a.resolve(),t.a=null)},Uu.de=function(t){var e=uu(this,t.sessionId);if(e){var n=Error("EME v0.1b key error");n.errorCode=t.errorCode,n.errorCode.systemCode=t.systemCode,!t.sessionId&&e.b?(n.method="generateRequest",45==t.systemCode&&(n.message="Unsupported session type."),e.b.reject(n),e.b=null):t.sessionId&&e.a?(n.method="update",e.a.reject(n),e.a=null):(n=t.systemCode,t.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?lu(e,"output-restricted"):1==n?lu(e,"expired"):lu(e,"internal-error"))}},x(cu,gn),Uu=cu.prototype,Uu.fc=function(t,e){if(this.a)this.a.then(this.fc.bind(this,t,e)).catch(this.fc.bind(this,t,e));else{if(this.a=t,"webkit-org.w3.clearkey"==this.c){var n=Mt(e),i=JSON.parse(n);"oct"!=i.keys[0].kty&&(this.a.reject(Error("Response is not a valid JSON Web Key Set.")),this.a=null),n=Ht(i.keys[0].k),i=Ht(i.keys[0].kid)}else n=new Uint8Array(e),i=null;var r=nu("addKey");try{this.f[r](this.c,n,i,this.sessionId)}catch(t){this.a.reject(t),this.a=null}}},Uu.generateRequest=function(t,e){return hu(this,e,null)},Uu.load=function(t){return"persistent-license"==this.g?hu(this,null,t):Promise.reject(Error("Not a persistent session."))},Uu.update=function(t){var e=new q;return this.fc(e,t),e},Uu.close=function(){if("persistent-license"!=this.g){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var t=nu("cancelKeyRequest");try{this.f[t](this.c,this.sessionId)}catch(t){}}return this.closed.resolve(),this.closed},Uu.remove=function(){return"persistent-license"!=this.g?Promise.reject(Error("Not a persistent session.")):this.close()};var Jc;Uu=fu.prototype,Uu.forEach=function(t){this.a&&t(this.a,Jc)},Uu.get=function(t){if(this.has(t))return this.a},Uu.has=function(t){var e=Jc;return!(!this.a||!Xt(new Uint8Array(t),new Uint8Array(e)))},Uu.entries=function(){},Uu.keys=function(){},Uu.values=function(){},Ns(function(){if(!(!t.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)$c="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;Jc=new Uint8Array([0]).buffer,navigator.requestMediaKeySystemAccess=iu,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=ru,t.MediaKeys=ou,t.MediaKeySystemAccess=au}}),Ns(function(){if(t.HTMLMediaElement){var e=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var t=e.apply(this,arguments);return t&&t.catch(function(){}),t}}}),Ns(function(){if(t.HTMLVideoElement){var e=HTMLVideoElement.prototype;!e.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in e&&(e.getVideoPlaybackQuality=du)}}),Ns(function(){if(!t.VTTCue&&t.TextTrackCue){var e=TextTrackCue.length;if(3==e)t.VTTCue=pu;else if(6==e)t.VTTCue=mu;else{try{var n=!!pu(1,2,"")}catch(t){n=!1}n&&(t.VTTCue=pu)}}}),vu.prototype.parseInit=function(){},vu.prototype.parseMedia=function(t,e){var n=Mt(t),i=[],r=new DOMParser,a=null;try{a=r.parseFromString(n,"text/xml")}catch(t){throw new z(2,2,2005)}if(a){if(!(r=a.getElementsByTagName("tt")[0]))throw new z(2,2,2005);a=Dn(r,"http://www.w3.org/ns/ttml#parameter","frameRate");var o=Dn(r,"http://www.w3.org/ns/ttml#parameter","subFrameRate"),s=Dn(r,"http://www.w3.org/ns/ttml#parameter","frameRateMultiplier"),u=Dn(r,"http://www.w3.org/ns/ttml#parameter","tickRate");if("default"!=(n=r.getAttribute("xml:space")||"default")&&"preserve"!=n)throw new z(2,2,2005);n="default"==n,a=new xu(a,o,s,u),o=yu(r.getElementsByTagName("styling")[0]),s=yu(r.getElementsByTagName("layout")[0]),u=[];for(var c=0;c<s.length;c++){var h=s[c],l=o,f=new ge,d=h.getAttribute("xml:id");if(d){f.id=d;var p;(p=Su(h,l,"extent"))&&null!=(p=(d=Qc.exec(p))||th.exec(p))&&(f.width=Number(p[1]),f.height=Number(p[2]),f.widthUnits=d?dc:0,f.heightUnits=d?dc:0),(h=Su(h,l,"origin"))&&null!=(p=(d=Qc.exec(h))||th.exec(h))&&(f.viewportAnchorX=Number(p[1]),f.viewportAnchorY=Number(p[2]),f.viewportAnchorUnits=d?dc:0)}else f=null;f&&u.push(f)}for(r=yu(r.getElementsByTagName("body")[0]),c=0;c<r.length;c++)(f=bu(r[c],e.periodStart,a,o,s,u,n))&&i.push(f)}return i};var Qc=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,Zc=/^(\d+px|\d+em)$/,th=/^(\d+)px (\d+)px$/,eh=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,nh=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,ih=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,rh=/^(\d*(?:\.\d*)?)f$/,ah=/^(\d*(?:\.\d*)?)t$/,oh=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,sh={left:"start",center:uc,right:"end",start:"start",end:"end"},uh={left:"line-left",center:"center",right:"line-right"};mc["application/ttml+xml"]=vu,Pu.prototype.parseInit=function(t){var e=!1;if((new ii).C("moov",ri).C("trak",ri).C("mdia",ri).C("minf",ri).C("stbl",ri).Z("stsd",ai).C("stpp",function(t){e=!0,t.parser.stop()}).parse(t),!e)throw new z(2,2,2007)},Pu.prototype.parseMedia=function(t,e){var n=!1,i=[];if((new ii).C("mdat",oi(function(t){n=!0,i=i.concat(this.a.parseMedia(t,e))}.bind(this))).parse(t),!n)throw new z(2,2,2007);return i},mc['application/mp4; codecs="stpp"']=Pu,mc['application/mp4; codecs="stpp.TTML.im1t"']=Pu,Ru.prototype.parseInit=function(){},Ru.prototype.parseMedia=function(t,e){var n=Mt(t);if(n=n.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n"),n=n.split(/\n{2,}/m),!/^WEBVTT($|[ \t\n])/m.test(n[0]))throw new z(2,2,2e3);var i=e.segmentStart;if(null==i&&(i=0,0<=n[0].indexOf("X-TIMESTAMP-MAP"))){var r=n[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),a=n[0].match(/MPEGTS:(\d+)/m);r&&a&&(i=Cu(new sr(r[1])),i=e.periodStart+(Number(a[1])/9e4-i))}a=[];var o=n[0].split("\n");for(r=1;r<o.length;r++)if(/^Region:/.test(o[r])){var s=new sr(o[r]),u=new ge;hr(s),ur(s);for(var c=hr(s);c;){var h=u,l=c;(c=/^id=(.*)$/.exec(l))?h.id=c[1]:(c=/^width=(\d{1,2}|100)%$/.exec(l))?h.width=Number(c[1]):(c=/^lines=(\d+)$/.exec(l))?(h.height=Number(c[1]),h.heightUnits=2):(c=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(l))?(h.regionAnchorX=Number(c[1]),h.regionAnchorY=Number(c[2])):(c=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(l))?(h.viewportAnchorX=Number(c[1]),h.viewportAnchorY=Number(c[2])):/^scroll=up$/.exec(l)&&(h.scroll="up"),ur(s),c=hr(s)}a.push(u)}for(r=[],s=1;s<n.length;s++){if(o=n[s].split("\n"),c=o,l=i,o=a,1==c.length&&!c[0]||/^NOTE($|[ \t])/.test(c[0])||"STYLE"==c[0])o=null;else{u=null,0>c[0].indexOf("--\x3e")&&(u=c[0],c.splice(0,1)),h=new sr(c[0]);var f=Cu(h),d=cr(h,/[ \t]+--\x3e[ \t]+/g),p=Cu(h);if(null==f||null==d||null==p)throw new z(2,2,2001);for(c=new ye(f+l,p+l,c.slice(1).join("\n").trim()),ur(h),l=hr(h);l;)Nu(c,l,o),ur(h),l=hr(h);null!=u&&(c.id=u),o=c}o&&r.push(o)}return r},mc["text/vtt"]=Ru,mc['text/vtt; codecs="vtt"']=Ru,Mu.prototype.parseInit=function(t){var e=!1;if((new ii).C("moov",ri).C("trak",ri).C("mdia",ri).Z("mdhd",function(t){0==t.version?(t.reader.F(4),t.reader.F(4),this.a=t.reader.B(),t.reader.F(4)):(t.reader.F(8),t.reader.F(8),this.a=t.reader.B(),t.reader.F(8)),t.reader.F(4)}.bind(this)).C("minf",ri).C("stbl",ri).Z("stsd",ai).C("wvtt",function(){e=!0}).parse(t),!this.a)throw new z(2,2,2008);if(!e)throw new z(2,2,2008)},Mu.prototype.parseMedia=function(t,e){var n=this;if(!this.a)throw new z(2,2,2008);var i,r=0,a=[],o=[],s=!1,u=!1,c=!1,h=null;if((new ii).C("moof",ri).C("traf",ri).Z("tfdt",function(t){s=!0,r=0==t.version?t.reader.B():t.reader.Ra()}).Z("tfhd",function(t){var e=t.flags;t=t.reader,t.F(4),1&e&&t.F(8),2&e&&t.F(4),h=8&e?t.B():null}).Z("trun",function(t){u=!0;var e=t.version,n=t.flags;t=t.reader;var i=t.B();1&n&&t.F(4),4&n&&t.F(4);for(var r=[],o=0;o<i;o++){var s={duration:null,sampleSize:null,gc:null};256&n&&(s.duration=t.B()),512&n&&(s.sampleSize=t.B()),1024&n&&t.F(4),2048&n&&(s.gc=0==e?t.B():t.Lc()),r.push(s)}a=r}).C("mdat",oi(function(t){c=!0,i=t})).parse(t),!c&&!s&&!u)throw new z(2,2,2008);var l=r,f=new DataView(i.buffer,i.byteOffset,i.byteLength),d=new ei(f,0);return a.forEach(function(t){var i=t.duration||h,a=t.gc?r+t.gc:l;l=a+(i||0);var s=0;do{var u=d.B();s+=u;var c=d.B(),f=null;"vttc"==ui(c)?8<u&&(f=d.Da(u-8)):d.F(u-8),i&&f&&o.push(Lu(f,e.periodStart+a/n.a,e.periodStart+l/n.a))}while(t.sampleSize&&s<t.sampleSize)}),o.filter(Pt)},mc['application/mp4; codecs="wvtt"']=Mu}).call(i,n,n);for(var r in i.shaka)e[r]=i.shaka[r]}()}).call(e,n(3))},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n}])});
-//# sourceMappingURL=dash-shaka-playback.min.js.map \ No newline at end of file
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("clappr")):"function"==typeof define&&define.amd?define(["clappr"],e):"object"==typeof exports?exports.DashShakaPlayback=e(require("clappr")):t.DashShakaPlayback=e(t.Clappr)}("undefined"!=typeof self?self:this,function(t){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="dist/",e(e.s=0)}([function(t,e,n){"use strict";function i(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,n,i)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(i)},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),c=n(1),h=n(2),l=function(t){return t&&t.__esModule?t:{default:t}}(h),f=function(t){function e(){var t;r(this,e);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];var s=a(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(i)));return s._levels=[],s._pendingAdaptationEvent=!1,s._isShakaReadyState=!1,s._minDvrSize=void 0===s.options.dashMinimumDvrSize?60:s.options.dashMinimumDvrSize,s}return o(e,t),u(e,[{key:"name",get:function(){return"dash_shaka_playback"}},{key:"shakaVersion",get:function(){return l.default.player.Player.version}},{key:"shakaPlayerInstance",get:function(){return this._player}},{key:"levels",get:function(){return this._levels}},{key:"currentLevel",set:function(t){var e=this;this._currentLevelId=t;var n=-1===this._currentLevelId;this.trigger(c.Events.PLAYBACK_LEVEL_SWITCH_START),n?(this._player.configure({abr:{enabled:!0}}),this.trigger(c.Events.PLAYBACK_LEVEL_SWITCH_END)):(this._player.configure({abr:{enabled:!1}}),this._pendingAdaptationEvent=!0,this.selectTrack(this.videoTracks.filter(function(t){return t.id===e._currentLevelId})[0]))},get:function(){return this._currentLevelId||-1}}],[{key:"canPlay",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";l.default.polyfill.installAll();var n=l.default.Player.isBrowserSupported(),i=t.split("?")[0].match(/.*\.(.*)$/)||[];return n&&("mpd"===i[1]||e.indexOf("application/dash+xml")>-1)}},{key:"Events",get:function(){return{SHAKA_READY:"shaka:ready"}}}]),u(e,[{key:"play",value:function(){if(this._player||this._setup(),!this.isReady)return void this.once(e.Events.SHAKA_READY,this.play);this._stopped=!1,this._src=this.el.src,s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"play",this).call(this),this._startUpdateTimers()}},{key:"pause",value:function(){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"pause",this).call(this),this.dvrEnabled&&this._updateDvr(!0)}},{key:"_setupSrc",value:function(){}},{key:"_startUpdateTimers",value:function(){var t=this;this._timeUpdateTimer||(this._timeUpdateTimer=setInterval(function(){t._onDurationChange(),t._onTimeUpdate()},200))}},{key:"_stopUpdateTimers",value:function(){clearInterval(this._timeUpdateTimer),this._timeUpdateTimer=null,clearInterval(this._progressUpdateTimer),this._progressUpdateTimer=null}},{key:"_ready",value:function(){}},{key:"_onShakaReady",value:function(){this._isShakaReadyState=!0,this.trigger(e.Events.SHAKA_READY),this.trigger(c.Events.PLAYBACK_READY,this.name)}},{key:"error",value:function(t){c.Log.error("an error was raised by the video tag",t,this.el.error)}},{key:"isHighDefinitionInUse",value:function(){return!1}},{key:"stop",value:function(){var t=this;clearInterval(this.sendStatsId),this._stopUpdateTimers(),this._stopped=!0,this._player?(this._sendStats(),this._player.unload().then(function(){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stop",t).call(t),t._player=null,t._isShakaReadyState=!1}).catch(function(){c.Log.error("shaka could not be unloaded")})):s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stop",this).call(this)}},{key:"getPlaybackType",value:function(){return this._playbackType}},{key:"getCurrentTime",value:function(){return Math.max(0,this.el.currentTime-this._startTime)}},{key:"getDuration",value:function(){return this._duration}},{key:"isSeekEnabled",value:function(){return this._playbackType===c.Playback.VOD||this.dvrEnabled}},{key:"seekPercentage",value:function(t){var e=this._duration;t>0&&(e=this._duration*(t/100)),this.seek(e)}},{key:"seek",value:function(t){t<0&&(c.Log.warn("Attempt to seek to a negative time. Resetting to live point."),t=this.getDuration()),this.dvrEnabled&&this._updateDvr(t<this.getDuration()-3),t+=this._startTime,s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"seek",this).call(this,t)}},{key:"selectAudioLanguage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._player.selectAudioLanguage(t,e)}},{key:"selectTrack",value:function(t){if("text"===t.type)this._player.selectTextTrack(t);else{if("variant"!==t.type)throw new Error("Unhandled track type:",t.type);this._player.selectVariantTrack(t),t.mimeType.startsWith("video/")&&this._onAdaptation()}}},{key:"_enableShakaTextTrack",value:function(t){this.el.textTracks&&(this._shakaTTVisible=t,Array.from(this.el.textTracks).filter(function(t){return"subtitles"===t.kind}).forEach(function(e){return e.mode=!0===t?"showing":"hidden"}))}},{key:"_checkForClosedCaptions",value:function(){if(!this._ccIsSetup){if(this.hasClosedCaptionsTracks){this.trigger(c.Events.PLAYBACK_SUBTITLE_AVAILABLE);var t=this.closedCaptionsTrackId;this.closedCaptionsTrackId=t}this._ccIsSetup=!0}}},{key:"destroy",value:function(){var t=this;this._stopUpdateTimers(),clearInterval(this.sendStatsId),this._player?this._player.destroy().then(function(){return t._destroy()}).catch(function(){t._destroy(),c.Log.error("shaka could not be destroyed")}):this._destroy(),s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}},{key:"_setup",value:function(){var t=this;this._isShakaReadyState=!1,this._ccIsSetup=!1,this._player=this._createPlayer(),this._options.shakaConfiguration&&this._player.configure(this._options.shakaConfiguration),this._options.shakaOnBeforeLoad&&this._options.shakaOnBeforeLoad(this._player),this._player.load(this._options.src).then(function(){return t._loaded()}).catch(function(e){return t._setupError(e)})}},{key:"_createPlayer",value:function(){var t=new l.default.Player(this.el);return t.addEventListener("error",this._onError.bind(this)),t.addEventListener("adaptation",this._onAdaptation.bind(this)),t.addEventListener("buffering",this._onBuffering.bind(this)),t}},{key:"_onBuffering",value:function(t){if(!this._stopped){var e=t.buffering?c.Events.PLAYBACK_BUFFERING:c.Events.PLAYBACK_BUFFERFULL;this.trigger(e)}}},{key:"_onProgress",value:function(){if(this.el.buffered.length){for(var t=[],e=0,n=0;n<this.el.buffered.length;n++)t=[].concat(i(t),[{start:Math.max(0,this.el.buffered.start(n)-this._startTime),end:Math.max(0,this.el.buffered.end(n)-this._startTime)}]),this.el.currentTime>=t[n].start&&this.el.currentTime<=t[n].end&&(e=n);var r={start:t[e].start,current:t[e].end,total:this.getDuration()};this.trigger(c.Events.PLAYBACK_PROGRESS,r,t)}}},{key:"_onDurationChange",value:function(){var t=this.getDuration();this._lastDuration!==t&&(this._lastDuration=t,s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_onDurationChange",this).call(this))}},{key:"_updateSettings",value:function(){this._playbackType===c.Playback.VOD?this.settings.left=["playpause","position","duration"]:this.dvrEnabled?this.settings.left=["playpause"]:this.settings.left=["playstop"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(c.Events.PLAYBACK_SETTINGSUPDATE)}},{key:"_onTimeUpdate",value:function(){var t={current:this.getCurrentTime(),total:this.getDuration(),firstFragDateTime:this._player.getPresentationStartTimeAsDate()};this._lastTimeUpdate&&t.current===this._lastTimeUpdate.current&&t.total===this._lastTimeUpdate.total||(this._lastTimeUpdate=t,this.trigger(c.Events.PLAYBACK_TIMEUPDATE,t,this.name))}},{key:"_updateDvr",value:function(t){this.trigger(c.Events.PLAYBACK_DVR,t),this.trigger(c.Events.PLAYBACK_STATS_ADD,{dvr:t})}},{key:"_loaded",value:function(){this._onShakaReady(),this._startToSendStats(),this._fillLevels(),this._checkForClosedCaptions()}},{key:"_fillLevels",value:function(){0===this._levels.length&&(this._levels=this.videoTracks.slice(0).reverse(),this.trigger(c.Events.PLAYBACK_LEVELS_AVAILABLE,this.levels))}},{key:"_startToSendStats",value:function(){var t=this,e=this._options.shakaSendStatsInterval||3e4;this.sendStatsId=setInterval(function(){return t._sendStats()},e)}},{key:"_sendStats",value:function(){this.trigger(c.Events.PLAYBACK_STATS_ADD,this._player.getStats())}},{key:"_setupError",value:function(t){this._onError(t)}},{key:"_onError",value:function(t){var n=this,i={shakaError:t,videoError:this.el.error},r=i.shakaError.detail||i.shakaError,a=r.category,o=r.code,u=r.severity;if(i.videoError||!o&&!a)return s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_onError",this).call(this);var h=u===l.default.util.Error.Severity.CRITICAL,f={code:a+"_"+o,description:"Category: "+a+", code: "+o+", severity: "+u,level:h?c.PlayerError.Levels.FATAL:c.PlayerError.Levels.WARN,raw:t},d=this.createError(f);c.Log.error("Shaka error event:",d),this.trigger(c.Events.PLAYBACK_ERROR,d),t.detail&&2==t.detail.severity&&1002==t.detail.code&&(console.log("retrying"),this.stop(),setTimeout(function(){return n.play()},1e3))}},{key:"_onAdaptation",value:function(){var t=this.videoTracks.filter(function(t){return!0===t.active})[0];this._fillLevels(),this._sendStats(),this._pendingAdaptationEvent_&&(this.trigger(c.Events.PLAYBACK_LEVEL_SWITCH_END),this._pendingAdaptationEvent=!1),c.Log.debug("an adaptation has happened:",t),this.trigger(c.Events.PLAYBACK_BITRATE,{bandwidth:t.bandwidth,language:t.language,width:t.width,height:t.height,level:t.id})}},{key:"_destroy",value:function(){this._isShakaReadyState=!1,c.Log.debug("shaka was destroyed")}},{key:"isReady",get:function(){return this._isShakaReadyState}},{key:"textTracks",get:function(){return this.isReady&&this._player.getTextTracks()}},{key:"audioLanguages",get:function(){return this.isReady&&this._player.getAudioLanguages()}},{key:"audioTracks",get:function(){return this.isReady&&this._player.getVariantTracks().filter(function(t){return t.mimeType.startsWith("audio/")})}},{key:"videoTracks",get:function(){return this.isReady&&this._player.getVariantTracks().filter(function(t){return t.mimeType.startsWith("video/")})}},{key:"dvrEnabled",get:function(){return this._player.isLive()&&this._duration>=this._minDvrSize}},{key:"_startTime",get:function(){return this._player.seekRange().start}},{key:"_duration",get:function(){if(!this._player)return 0;var t=this._player.seekRange(),e=t.start;return t.end-e}},{key:"_playbackType",get:function(){return(this.isReady&&this._player.isLive()?c.Playback.LIVE:c.Playback.VOD)||""}},{key:"closedCaptionsTracks",get:function(){var t=0,e=function(){return t++};return(this.textTracks||[]).filter(function(t){return"subtitle"===t.kind}).map(function(t){return{id:e(),name:t.label||t.language,track:t}})}},{key:"closedCaptionsTrackId",get:function(){return s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"closedCaptionsTrackId",this)},set:function(t){if(this._player){var e=this.closedCaptionsTracks,n=void 0;if(-1!==t){if(!(n=e.find(function(e){return e.id===t})))return void c.Log.warn('Track id "'+t+'" not found');if(this._shakaTTVisible&&!0===n.track.active)return void c.Log.info('Track id "'+t+'" already showing')}n?(this._player.selectTextTrack(n.track),this._enableShakaTextTrack(!0)):this._enableShakaTextTrack(!1),this._ccTrackId=t,this.trigger(c.Events.PLAYBACK_SUBTITLE_CHANGED,{id:t})}}}]),e}(c.HTML5Video);e.default=f,t.exports=e.default},function(e,n){e.exports=t},function(t,e,n){(function(t){!function(){var n="undefined"!=typeof window?window:t,i={};(function(t,e){function n(){n=function(){},Bu.Symbol||(Bu.Symbol=Fu)}function i(){n();var t=Bu.Symbol.iterator;t||(t=Bu.Symbol.iterator=Bu.Symbol("iterator")),"function"!=typeof Array.prototype[t]&&ju(Array.prototype,t,{configurable:!0,writable:!0,value:function(){return r(this)}}),i=function(){}}function r(t){var e=0;return a(function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}})}function a(t){return i(),t={next:t},t[Bu.Symbol.iterator]=function(){return this},t}function o(t){i();var e=t[Symbol.iterator];return e?e.call(t):r(t)}function s(t,e){if(e){for(var n=Bu,i=t.split("."),r=0;r<i.length-1;r++){var a=i[r];a in n||(n[a]={}),n=n[a]}i=i[i.length-1],r=n[i],a=e(r),a!=r&&null!=a&&ju(n,i,{configurable:!0,writable:!0,value:a})}}function u(t){function e(e){return t.next(e)}function n(e){return t.throw(e)}return new Promise(function(i,r){function a(t){t.done?i(t.value):Promise.resolve(t.value).then(e,n).then(a,r)}a(t.next())})}function c(t){return u(t())}function h(){this.g=!1,this.c=null,this.K=void 0,this.w=1,this.b=this.f=0,this.i=this.a=null}function l(t){if(t.g)throw new TypeError("Generator is already running");t.g=!0}function f(t,e){t.a={rc:e,yc:!0},t.w=t.f||t.b}function d(t,e,n){return t.w=n,{value:e}}function p(t,e,n){t.f=e,void 0!=n&&(t.b=n)}function m(t){t.f=0,t.b=2}function v(t){t.w=0,t.f=0}function y(t){t.f=0;var e=t.a.rc;return t.a=null,e}function g(t){t.i=[t.a],t.f=0,t.b=0}function b(t,e){var n=t.i.splice(0)[0];(n=t.a=t.a||n)?n.yc?t.w=t.f||t.b:void 0!=n.V&&t.b<n.V?(t.w=n.V,t.a=null):t.w=t.b:t.w=e}function w(t){this.a=new h,this.b=t}function T(t,e){l(t.a);var n=t.a.c;return n?E(t,"return"in n?n.return:function(t){return{value:t,done:!0}},e,t.a.return):(t.a.return(e),S(t))}function E(t,e,n,i){try{var r=e.call(t.a.c,n);if(!(r instanceof Object))throw new TypeError("Iterator result "+r+" is not an object");if(!r.done)return t.a.g=!1,r;var a=r.value}catch(e){return t.a.c=null,f(t.a,e),S(t)}return t.a.c=null,i.call(t.a,a),S(t)}function S(t){for(;t.a.w;)try{var e=t.b(t.a);if(e)return t.a.g=!1,{value:e.value,done:!1}}catch(e){t.a.K=void 0,f(t.a,e)}if(t.a.g=!1,t.a.a){if(e=t.a.a,t.a.a=null,e.yc)throw e.rc;return{value:e.return,done:!0}}return{value:void 0,done:!0}}function k(t){this.next=function(e){return l(t.a),t.a.c?e=E(t,t.a.c.next,e,t.a.h):(t.a.h(e),e=S(t)),e},this.throw=function(e){return l(t.a),t.a.c?e=E(t,t.a.c.throw,e,t.a.h):(f(t.a,e),e=S(t)),e},this.return=function(e){return T(t,e)},i(),this[Symbol.iterator]=function(){return this}}function A(t,e){return k.prototype=t.prototype,new k(new w(e))}function _(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function I(t,e){var n=t.split("."),i=Vu;n[0]in i||!i.execScript||i.execScript("var "+n[0]);for(var r;n.length&&(r=n.shift());)n.length||void 0===e?i=i[r]?i[r]:i[r]={}:i[r]=e}function x(t,e){function n(){}n.prototype=e.prototype,t.hf=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.ff=function(t,n,i){return e.prototype[n].apply(t,Array.prototype.slice.call(arguments,2))}}function P(t){this.c=Math.exp(Math.log(.5)/t),this.b=this.a=0}function R(t,e,n){var i=Math.pow(t.c,e);n=n*(1-i)+i*t.a,isNaN(n)||(t.a=n,t.b+=e)}function N(t){return t.a/(1-Math.pow(t.c,t.b))}function D(){this.b=new P(2),this.c=new P(5),this.a=0}function C(){}function M(){}function L(t){var e;t instanceof L?(O(this,t.ia),this.Fa=t.Fa,this.la=t.la,U(this,t.Qa),this.aa=t.aa,j(this,H(t.a)),this.za=t.za):t&&(e=String(t).match(Ku))?(O(this,e[1]||"",!0),this.Fa=B(e[2]||""),this.la=B(e[3]||"",!0),U(this,e[4]),this.aa=B(e[5]||"",!0),j(this,e[6]||"",!0),this.za=B(e[7]||"")):this.a=new K(null)}function O(t,e,n){t.ia=n?B(e,!0):e,t.ia&&(t.ia=t.ia.replace(/:$/,""))}function U(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.Qa=e}else t.Qa=null}function j(t,e,n){e instanceof K?t.a=e:(n||(e=F(e,Xu)),t.a=new K(e))}function B(t,e){return t?e?decodeURI(t):decodeURIComponent(t):""}function F(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,V),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function V(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(15&t).toString(16)}function K(t){this.b=t||null}function H(t){var e=new K;if(e.b=t.b,t.a){var n,i={};for(n in t.a)i[n]=t.a[n].concat();e.a=i,e.c=t.c}return e}function q(){var t,e,n=new Promise(function(n,i){t=n,e=i});return n.resolve=t,n.reject=e,n}function G(t,e){var n=Y();this.i=null==t.maxAttempts?n.maxAttempts:t.maxAttempts,this.f=null==t.baseDelay?n.baseDelay:t.baseDelay,this.h=null==t.fuzzFactor?n.fuzzFactor:t.fuzzFactor,this.g=null==t.backoffFactor?n.backoffFactor:t.backoffFactor,this.a=0,this.b=this.f,(this.c=e||!1)&&(this.a=1)}function X(e){if(e.a>=e.i){if(!e.c)return Promise.reject();e.a=1,e.b=e.f}var n=new q;return e.a?(t.setTimeout(n.resolve,e.b*(1+(2*Math.random()-1)*e.h)),e.b*=e.g):n.resolve(),e.a++,n}function Y(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0}}function z(t,e,n,i){this.severity=t,this.category=e,this.code=n,this.data=Array.prototype.slice.call(arguments,3),this.handled=!1}function W(t,e){this.promise=t,this.b=e,this.a=!1}function $(t){return new W(Promise.reject(t),function(){return Promise.resolve()})}function J(){var t=Promise.reject(new z(2,7,7001));return t.catch(function(){}),new W(t,function(){return Promise.resolve()})}function Q(t){return new W(Promise.resolve(t),function(){return Promise.resolve()})}function Z(t){return new W(t,function(){return t.catch(function(){})})}function tt(t){return new W(Promise.all(t.map(function(t){return t.promise})),function(){return Promise.all(t.map(function(t){return t.abort()}))})}function et(t,e,n){try{var i=t(e);return i&&i.promise&&i.abort?(n.resolve(i.promise),function(){return i.abort()}):(n.resolve(i),function(){return Promise.resolve(i).then(function(){}).catch(function(){})})}catch(t){return n.reject(t),function(){return Promise.resolve()}}}function nt(t,e){return!("number"!=typeof t||"number"!=typeof e||!isNaN(t)||!isNaN(e))||t===e}function it(t,e){e||(e=nt);for(var n=[],i=o(t),r=i.next();!r.done;r=i.next())r=r.value,-1==rt(n,r,e)&&n.push(r);return n}function rt(t,e,n){for(var i=0;i<t.length;++i)if(n(t[i],e))return i;return-1}function at(t,e){var n=t.indexOf(e);-1<n&&t.splice(n,1)}function ot(t,e){var n=0;return t.forEach(function(t){n+=e(t)?1:0}),n}function st(t,e,n,i,r){var a,o=r in i,s=!0;for(a in e){var u=r+"."+a,c=o?i[r]:n[a];o||a in t?void 0===e[a]?void 0===c||o?delete t[a]:t[a]=ut(c):c.constructor==Object&&e[a]&&e[a].constructor==Object?(t[a]||(t[a]=ut(c)),u=st(t[a],e[a],c,i,u),s=s&&u):typeof e[a]!=typeof c||null==e[a]||e[a].constructor!=c.constructor?s=!1:t[a]=e[a]:s=!1}return s}function ut(t){function e(t){switch(typeof t){case"undefined":case"boolean":case"number":case"string":case"symbol":case"function":return t;default:if(!t||t.buffer&&t.buffer.constructor==ArrayBuffer)return t;if(0<=n.indexOf(t))return null;var i=t.constructor==Array;if(t.constructor!=Object&&!i)return null;n.push(t);var r,a=i?[]:{};for(r in t)a[r]=e(t[r]);return i&&(a.length=t.length),a}}var n=[];return e(t)}function ct(t,e){function n(){return Promise.all(t.map(function(t){return t.destroy()}))}return Promise.resolve(e()).then(function(t){return n().then(function(){return t})},function(t){return n().then(function(){throw t})})}function ht(){this.a=[]}function lt(t,e){t.a.push(e.finally(function(){at(t.a,e)}))}function ft(t){this.c=!1,this.g=new ht,this.a=[],this.b=[],this.f=t||null}function dt(t,e,n){n=n||3;var i=zu[t];(!i||n>=i.priority)&&(zu[t]={priority:n,me:e})}function pt(t,e){return{uris:t,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:e}}function mt(t){return t.then=function(e,n){return C("The network request interface has changed! Please update your application to the new interface, which allows operations to be aborted. Support for the old API will be removed in v2.5."),t.promise.then(e,n)},t.catch=function(e){return C("The network request interface has changed! Please update your application to the new interface, which allows operations to be aborted. Support for the old API will be removed in v2.5."),t.promise.catch(e)},t}function vt(t,e,n){var i=Q(void 0);return t.a.forEach(function(t){i=i.X(function(){return t(e,n)})}),i.X(void 0,function(t){if(t&&7001==t.code)throw t;throw new z(2,1,1006,t)})}function yt(t,e,n,i,r,a){var o=new L(n.uris[r]),s=o.ia;s||(s=location.protocol,s=s.slice(0,-1),O(o,s),n.uris[r]=o.toString());var u=(s=zu[s])?s.me:null;if(!u)return $(new z(2,1,1e3,o));var c;return Z(X(i)).X(function(){if(t.c)return J();c=Date.now();var i=u(n.uris[r],n,e);return void 0==i.promise&&(C("The scheme plugin interface has changed! Please update your scheme plugins to the new interface to add support for abort(). Support for the old plugin interface will be removed in v2.5."),i=Z(i)),i}).X(function(t){return void 0==t.timeMs&&(t.timeMs=Date.now()-c),t},function(o){if(o&&7001==o.code)throw o;if(t.c)return J();if(o&&1==o.severity)return r=(r+1)%n.uris.length,yt(t,e,n,i,r,o);throw o||a})}function gt(t,e,n){var i=Q(void 0);return t.b.forEach(function(t){i=i.X(function(){return t(e,n)})}),i.X(function(){return n},function(t){if(t&&7001==t.code)throw t;var e=2;throw t instanceof z&&(e=t.severity),new z(e,1,1007,t)})}function bt(){this.a={}}function wt(){this.a=new bt}function Tt(t,e,n,i){t.a&&(e=new kt(e,n,i),t.a.push(n,e))}function Et(t,e,n,i){Tt(t,e,n,function(t){this.pa(e,n),i(t)}.bind(t))}function St(t){if(t.a){var e,n=t.a,i=[];for(e in n.a)i.push.apply(i,n.a[e]);for(n=0;n<i.length;++n)i[n].pa();t.a.a={}}}function kt(t,e,n){this.target=t,this.type=e,this.a=n,this.target.addEventListener(e,n,!1)}function At(e,n){var i,r=n||{};for(i in r)this[i]=r[i];this.defaultPrevented=this.cancelable=this.bubbles=!1,this.timeStamp=t.performance&&t.performance.now?t.performance.now():Date.now(),this.type=e,this.isTrusted=!1,this.target=this.currentTarget=null,this.a=!1}function _t(t,e){return t.reduce(function(t,e,n){return e.catch(t.bind(null,n))}.bind(null,e),Promise.reject())}function It(t,e){return t.concat(e)}function xt(){}function Pt(t){return null!=t}function Rt(t,e,n){return n.indexOf(t)==e}function Nt(t,e){if(0==e.length)return t;var n=e.map(function(t){return new L(t)});return t.map(function(t){return new L(t)}).map(function(t){return n.map(t.resolve.bind(t))}).reduce(It,[]).map(function(t){return t.toString()})}function Dt(t,e){return{keySystem:t,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:e||[],keyIds:[]}}function Ct(t,e){var n=t;return e&&(n+='; codecs="'+e+'"'),n}function Mt(t){if(!t)return"";t=new Uint8Array(t),239==t[0]&&187==t[1]&&191==t[2]&&(t=t.subarray(3)),t=escape(jt(t));try{return decodeURIComponent(t)}catch(t){throw new z(2,2,2004)}}function Lt(t,e,n){if(!t)return"";if(!n&&0!=t.byteLength%2)throw new z(2,2,2004);if(t instanceof ArrayBuffer)var i=t;else n=new Uint8Array(t.byteLength),n.set(new Uint8Array(t)),i=n.buffer;t=Math.floor(t.byteLength/2),n=new Uint16Array(t),i=new DataView(i);for(var r=0;r<t;r++)n[r]=i.getUint16(2*r,e);return jt(n)}function Ot(t){var e=new Uint8Array(t);if(239==e[0]&&187==e[1]&&191==e[2])return Mt(e);if(254==e[0]&&255==e[1])return Lt(e.subarray(2),!1);if(255==e[0]&&254==e[1])return Lt(e.subarray(2),!0);var n=function(t,e){return t.byteLength<=e||32<=t[e]&&126>=t[e]}.bind(null,e);if(0==e[0]&&0==e[2])return Lt(t,!1);if(0==e[1]&&0==e[3])return Lt(t,!0);if(n(0)&&n(1)&&n(2)&&n(3))return Mt(t);throw new z(2,2,2003)}function Ut(t){t=encodeURIComponent(t),t=unescape(t);for(var e=new Uint8Array(t.length),n=0;n<t.length;++n)e[n]=t.charCodeAt(n);return e.buffer}function jt(t){for(var e="",n=0;n<t.length;n+=16e3)e+=String.fromCharCode.apply(null,t.subarray(n,n+16e3));return e}function Bt(t){this.a=null,this.b=function(){this.a=null,t()}.bind(this)}function Ft(t){var e=tc;t.cancel(),t.a=setTimeout(t.b,1e3*e)}function Vt(t,e){t.cancel();var n=function(){this.b(),this.a=setTimeout(n,1e3*e)}.bind(t);t.a=setTimeout(n,1e3*e)}function Kt(e,n){var i=void 0==n||n,r=t.btoa(jt(e)).replace(/\+/g,"-").replace(/\//g,"_");return i?r:r.replace(/=*$/,"")}function Ht(e){e=t.atob(e.replace(/-/g,"+").replace(/_/g,"/"));for(var n=new Uint8Array(e.length),i=0;i<e.length;++i)n[i]=e.charCodeAt(i);return n}function qt(e){for(var n=new Uint8Array(e.length/2),i=0;i<e.length;i+=2)n[i/2]=t.parseInt(e.substr(i,2),16);return n}function Gt(t){for(var e="",n=0;n<t.length;++n){var i=t[n].toString(16);1==i.length&&(i="0"+i),e+=i}return e}function Xt(t,e){if(!t&&!e)return!0;if(!t||!e||t.length!=e.length)return!1;for(var n=0;n<t.length;++n)if(t[n]!=e[n])return!1;return!0}function Yt(t){for(var e=0,n=0;n<arguments.length;++n)e+=arguments[n].length;e=new Uint8Array(e);for(var i=n=0;i<arguments.length;++i)e.set(arguments[i],n),n+=arguments[i].length;return e}function zt(t){this.s=t,this.l=this.j=this.u=null,this.L=!1,this.b=null,this.g=new wt,this.a=[],this.o=[],this.i=new q,this.f=null,this.h=function(e){this.i.reject(e),t.onError(e)}.bind(this),this.S={},this.m={},this.G=new Bt(this.oe.bind(this)),this.ga=this.c=!1,this.I=[],this.Y=!1,this.A=new Bt(this.ne.bind(this)),Vt(this.A,1),this.i.catch(function(){})}function Wt(t,e){return Promise.all(e.map(function(t){return oe(this,t).then(function(t){if(t){for(var e=new q,n=0;n<this.a.length;n++)if(this.a[n].ja==t){this.a[n].qa=e;break}return Promise.all([t.remove(),e])}}.bind(this))}.bind(t)))}function $t(t){var e=t.b?t.b.initData:[];return e.forEach(function(t){se(this,t.initDataType,t.initData)}.bind(t)),t.o.forEach(function(t){oe(this,t)}.bind(t)),e.length||t.o.length||t.i.resolve(),t.i}function Jt(t,e,n){for(var i=o(t.a),r=i.next();!r.done;r=i.next())if(Xt(n,r.value.initData))return;se(t,e,n)}function Qt(t){return t.a.map(function(t){return t.ja.sessionId})}function Zt(e,n,i,r,a){var o=ne(e),s=ie(e,n);n.periods.forEach(function(e){e.variants.forEach(function(e){o&&(e.drmInfos=[o]),s&&(e.drmInfos=s),e.drmInfos.forEach(function(n){ee(this,n),t.cast&&t.cast.__platform__&&"com.microsoft.playready"==n.keySystem&&(n.keySystem="com.chromecast.playready");var o=r[n.keySystem];o||(o={audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:i?"required":"optional",sessionTypes:[i?"persistent-license":"temporary"],label:n.keySystem,drmInfos:[]},r[n.keySystem]=o,a.push(n.keySystem)),o.drmInfos.push(n),n.distinctiveIdentifierRequired&&(o.distinctiveIdentifier="required"),n.persistentStateRequired&&(o.persistentState="required");var s=[];e.video&&s.push(e.video),e.audio&&s.push(e.audio),s.forEach(function(t){("video"==t.type?o.videoCapabilities:o.audioCapabilities).push({robustness:("video"==t.type?n.videoRobustness:n.audioRobustness)||"",contentType:Ct(t.mimeType,t.codecs)})}.bind(this))}.bind(this))}.bind(this))}.bind(e))}function te(t,e,n,i){if(1==n.length&&""==n[0])return Promise.reject(new z(2,6,6e3));var r=new q,a=r;return[!0,!1].forEach(function(t){n.forEach(function(n){var i=e[n];i.drmInfos.some(function(t){return!!t.licenseServerUri})==t&&(0==i.audioCapabilities.length&&delete i.audioCapabilities,0==i.videoCapabilities.length&&delete i.videoCapabilities,a=a.catch(function(){return this.c?Promise.reject():navigator.requestMediaKeySystemAccess(n,[i])}.bind(this)))}.bind(this))}.bind(t)),a=a.catch(function(){return Promise.reject(new z(2,6,6001))}),a=a.then(function(t){if(this.c)return Promise.reject();var n=0<=navigator.userAgent.indexOf("Edge/"),i=t.getConfiguration();return this.u=(i.audioCapabilities||[]).concat(i.videoCapabilities||[]).map(function(t){return t.contentType}),n&&(this.u=null),n=e[t.keySystem],re(this,t.keySystem,n,n.drmInfos),this.b.licenseServerUri?t.createMediaKeys():Promise.reject(new z(2,6,6012))}.bind(t)).then(function(t){if(this.c)return Promise.reject();this.j=t,this.L=!0}.bind(t)).catch(function(t){return this.c?Promise.resolve():(this.u=this.b=null,t instanceof z?Promise.reject(t):Promise.reject(new z(2,6,6002,t.message)))}.bind(t)),i||(a=a.catch(function(){})),r.reject(),a}function ee(t,e){var n=e.keySystem;if(n){if(!e.licenseServerUri){var i=t.f.servers[n];i&&(e.licenseServerUri=i)}e.keyIds||(e.keyIds=[]),(n=t.f.advanced[n])&&(e.distinctiveIdentifierRequired||(e.distinctiveIdentifierRequired=n.distinctiveIdentifierRequired),e.persistentStateRequired||(e.persistentStateRequired=n.persistentStateRequired),e.videoRobustness||(e.videoRobustness=n.videoRobustness),e.audioRobustness||(e.audioRobustness=n.audioRobustness),e.serverCertificate||(e.serverCertificate=n.serverCertificate))}}function ne(e){if($u.empty(e.f.clearKeys))return null;var n,i=[],r=[];for(n in e.f.clearKeys){var a=e.f.clearKeys[n],o=qt(n);a=qt(a),o={kty:"oct",kid:Kt(o,!1),k:Kt(a,!1)},i.push(o),r.push(o.kid)}return e=JSON.stringify({keys:i}),r=JSON.stringify({kids:r}),r=[{initData:new Uint8Array(Ut(r)),initDataType:"keyids"}],{keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64,"+t.btoa(e),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:r,keyIds:[]}}function ie(t,e){var n=t.f,i=Object.keys(n.servers);return!i.length||e.periods.some(function(t){return t.variants.some(function(t){return t.drmInfos.length})})?null:i.map(function(t){return{keySystem:t,licenseServerUri:n.servers[t],distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[]}})}function re(t,e,n,i){var r=[],a=[],o=[],s=[];ae(i,r,a,o,s),t.b={keySystem:e,licenseServerUri:r[0],distinctiveIdentifierRequired:"required"==n.distinctiveIdentifier,persistentStateRequired:"required"==n.persistentState,audioRobustness:n.audioCapabilities?n.audioCapabilities[0].robustness:"",videoRobustness:n.videoCapabilities?n.videoCapabilities[0].robustness:"",serverCertificate:a[0],initData:o,keyIds:s}}function ae(t,e,n,i,r){function a(t,e){return!(!t.keyId||t.keyId!=e.keyId)||t.initDataType==e.initDataType&&Xt(t.initData,e.initData)}t.forEach(function(t){if(-1==e.indexOf(t.licenseServerUri)&&e.push(t.licenseServerUri),t.serverCertificate&&-1==rt(n,t.serverCertificate,Xt)&&n.push(t.serverCertificate),t.initData&&t.initData.forEach(function(t){-1==rt(i,t,a)&&i.push(t)}),t.keyIds)for(var o=0;o<t.keyIds.length;++o)-1==r.indexOf(t.keyIds[o])&&r.push(t.keyIds[o])})}function oe(t,e){try{var n=t.j.createSession("persistent-license")}catch(e){var i=new z(2,6,6005,e.message);return t.h(i),Promise.reject(i)}Tt(t.g,n,"message",t.Ic.bind(t)),Tt(t.g,n,"keystatuseschange",t.Ec.bind(t));var r={initData:null,ja:n,loaded:!1,Tb:1/0,qa:null};return t.a.push(r),n.load(e).then(function(t){if(!this.c){if(t)return r.loaded=!0,this.a.every(function(t){return t.loaded})&&this.i.resolve(),n;this.a.splice(this.a.indexOf(r),1),this.h(new z(2,6,6013))}}.bind(t),function(t){this.c||(this.a.splice(this.a.indexOf(r),1),this.h(new z(2,6,6005,t.message)))}.bind(t))}function se(t,e,n){try{var i=t.ga?t.j.createSession("persistent-license"):t.j.createSession()}catch(e){return void t.h(new z(2,6,6005,e.message))}Tt(t.g,i,"message",t.Ic.bind(t)),Tt(t.g,i,"keystatuseschange",t.Ec.bind(t)),t.a.push({initData:n,ja:i,loaded:!1,Tb:1/0,qa:null}),i.generateRequest(e,n.buffer).catch(function(t){if(!this.c){for(var e=0;e<this.a.length;++e)if(this.a[e].ja==i){this.a.splice(e,1);break}this.h(new z(2,6,6006,t.message))}}.bind(t))}function ue(t,e){for(var n,i=e.target,r=0;r<t.a.length;r++)if(t.a[r].ja==i){n=t.a[r];break}r=pt([t.b.licenseServerUri],t.f.retryParameters),r.body=e.message,r.method="POST","com.microsoft.playready"!=t.b.keySystem&&"com.chromecast.playready"!=t.b.keySystem||ce(r),t.s.$a.request(2,r).promise.then(function(t){return this.c?Promise.reject():i.update(t.data).then(function(){this.s.onEvent(new At("drmsessionupdate")),n&&(n.qa&&n.qa.resolve(),setTimeout(function(){n.loaded=!0,this.a.every(function(t){return t.loaded})&&this.i.resolve()}.bind(this),1e3*Zu))}.bind(this))}.bind(t),function(t){if(this.c)return Promise.resolve();t=new z(2,6,6007,t),this.h(t),n&&n.qa&&n.qa.reject(t)}.bind(t)).catch(function(t){if(this.c)return Promise.resolve();t=new z(2,6,6008,t.message),this.h(t),n&&n.qa&&n.qa.reject(t)}.bind(t))}function ce(t){var e=Lt(t.body,!0,!0);if(-1==e.indexOf("PlayReadyKeyMessage"))t.headers["Content-Type"]="text/xml; charset=utf-8";else{e=(new DOMParser).parseFromString(e,"application/xml");for(var n=e.getElementsByTagName("HttpHeader"),i=0;i<n.length;++i)t.headers[n[i].querySelector("name").textContent]=n[i].querySelector("value").textContent;t.body=Ht(e.querySelector("Challenge").textContent).buffer}}function he(){var t=[],e=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],n=[{videoCapabilities:e,persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:e}],i={};return"org.w3.clearkey com.widevine.alpha com.microsoft.playready com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" ").forEach(function(e){var r=navigator.requestMediaKeySystemAccess(e,n).then(function(t){var n=t.getConfiguration().sessionTypes;return n=!!n&&0<=n.indexOf("persistent-license"),0<=navigator.userAgent.indexOf("Tizen 3")&&(n=!1),i[e]={persistentState:n},t.createMediaKeys()}).catch(function(){i[e]=null});t.push(r)}),Promise.all(t).then(function(){return i})}function le(t,e){var n=t.keySystem();return 0==e.drmInfos.length||e.drmInfos.some(function(t){return t.keySystem==n})}function fe(t,e){if(!t.length)return e;if(!e.length)return t;for(var n=[],i=0;i<t.length;i++)for(var r=0;r<e.length;r++)if(t[i].keySystem==e[r].keySystem){var a=t[i];r=e[r];var o=[];o=o.concat(a.initData||[]),o=o.concat(r.initData||[]);var s=[];s=s.concat(a.keyIds),s=s.concat(r.keyIds),n.push({keySystem:a.keySystem,licenseServerUri:a.licenseServerUri||r.licenseServerUri,distinctiveIdentifierRequired:a.distinctiveIdentifierRequired||r.distinctiveIdentifierRequired,persistentStateRequired:a.persistentStateRequired||r.persistentStateRequired,videoRobustness:a.videoRobustness||r.videoRobustness,audioRobustness:a.audioRobustness||r.audioRobustness,serverCertificate:a.serverCertificate||r.serverCertificate,initData:o,keyIds:s});break}return n}function de(t){return!t||1==t.length&&1e-6>t.end(0)-t.start(0)?null:t.length?t.end(t.length-1):null}function pe(t,e,n){return n=void 0===n?0:n,!(!t||!t.length||1==t.length&&1e-6>t.end(0)-t.start(0)||e>t.end(t.length-1))&&e+n>=t.start(0)}function me(t,e){if(!t||!t.length||1==t.length&&1e-6>t.end(0)-t.start(0))return 0;for(var n=0,i=t.length-1;0<=i&&t.end(i)>e;--i)n+=t.end(i)-Math.max(t.start(i),e);return n}function ve(t){if(!t)return[];for(var e=[],n=0;n<t.length;n++)e.push({start:t.start(n),end:t.end(n)});return e}function ye(t,e,n){this.startTime=t,this.endTime=e,this.payload=n,this.region=new ge,this.position=null,this.positionAlign=ec,this.size=100,this.textAlign=nc,this.writingDirection=oc,this.lineInterpretation=sc,this.line=null,this.lineHeight="",this.lineAlign=uc,this.displayAlign=rc,this.fontSize=this.backgroundColor=this.color="",this.fontWeight=hc,this.fontStyle=lc,this.fontFamily="",this.textDecoration=[],this.wrapLine=!0,this.id=""}function ge(){this.id="",this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0,this.height=this.width=100,this.viewportAnchorUnits=this.widthUnits=this.heightUnits=dc,this.scroll=pc}function be(){this.a=new muxjs.mp4.Transmuxer({keepOriginalTimestamps:!0}),this.b=null,this.g=[],this.c=[],this.f=!1,this.a.on("data",this.i.bind(this)),this.a.on("done",this.h.bind(this))}function we(e,n){return!(!t.muxjs||"mp2t"!=e.split(";")[0].split("/")[1])&&(n?MediaSource.isTypeSupported(Te(n,e)):MediaSource.isTypeSupported(Te("audio",e))||MediaSource.isTypeSupported(Te("video",e)))}function Te(t,e){var n=e.replace("mp2t","mp4");"audio"==t&&(n=n.replace("video","audio"));var i=/avc1\.(66|77|100)\.(\d+)/.exec(n);if(i){var r="avc1.",a=i[1],o=Number(i[2]);r=("66"==a?r+"4200":"77"==a?r+"4d00":r+"6400")+(o>>4).toString(16),r+=(15&o).toString(16),n=n.replace(i[0],r)}return n}function Ee(t,e){t.f=!0,t.b=new q,t.g=[],t.c=[];var n=new Uint8Array(e);return t.a.push(n),t.a.flush(),t.f&&t.b.reject(new z(2,3,3018)),t.b}function Se(t){this.f=null,this.c=t,this.h=this.i=0,this.g=1/0,this.b=this.a=null}function ke(t,e,n,i){return Promise.resolve().then(function(){if(this.f&&this.c)if(null==n||null==i)this.f.parseInit(new Uint8Array(e));else{var t={periodStart:this.i,segmentStart:n,segmentEnd:i};t=this.f.parseMedia(new Uint8Array(e),t).filter(function(t){return t.startTime>=this.h&&t.startTime<this.g}.bind(this)),this.c.append(t),null==this.a&&(this.a=Math.max(n,this.h)),this.b=Math.min(i,this.g)}}.bind(t))}function Ae(e){this.f=e,this.o=null,this.b={},this.a=null,this.c={},this.h=new wt,this.m=!1,this.i={},this.l=!1,e=this.j=new q;var n=new MediaSource;Et(this.h,n,"sourceopen",e.resolve),this.f.src=t.URL.createObjectURL(n),this.g=n}function _e(){var t={};return'video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="opus",audio/mp4; codecs="flac",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").forEach(function(e){t[e]=!!mc[e]||MediaSource.isTypeSupported(e)||we(e);var n=e.split(";")[0];t[n]=t[n]||t[e]}),t}function Ie(t,e){t.a||(t.a=new Se(t.o)),t.a.f=new mc[e]}function xe(t,e){if("text"==e)var n=t.a.a;else n=Ne(t,e),n=!n||1==n.length&&1e-6>n.end(0)-n.start(0)?null:1==n.length&&0>n.start(0)?0:n.length?n.start(0):null;return n}function Pe(t,e){return"text"==e?t.a.b:de(Ne(t,e))}function Re(t,e,n){return"text"==e?(t=t.a,null==t.b||t.b<n?0:t.b-Math.max(n,t.a)):(t=Ne(t,e),me(t,n))}function Ne(t,e){try{return t.b[e].buffered}catch(t){return null}}function De(t,e,n,i,r){return"text"==e?ke(t.a,n,i,r):t.i[e]?Ee(t.i[e],n).then(function(t){return this.a||Ie(this,"text/vtt"),this.l&&this.a.lc(t.cues),Le(this,e,this.Vc.bind(this,e,t.data.buffer))}.bind(t)):Le(t,e,t.Vc.bind(t,e,n))}function Ce(t,e){return"text"==e?t.a?t.a.remove(0,1/0):Promise.resolve():Le(t,e,t.Wc.bind(t,e,0,t.g.duration))}function Me(t,e,n,i,r){return"text"==e?(t.a.i=n,t=t.a,t.h=i,t.g=r,Promise.resolve()):Promise.all([Le(t,e,t.cd.bind(t,e)),Le(t,e,t.Ge.bind(t,e,n)),Le(t,e,t.De.bind(t,e,i,r))])}function Le(t,e,n){if(t.m)return Promise.reject();if(n={start:n,p:new q},t.c[e].push(n),1==t.c[e].length)try{n.start()}catch(i){"QuotaExceededError"==i.name?n.p.reject(new z(2,3,3017,e)):n.p.reject(new z(2,3,3015,i)),Ue(t,e)}return n.p}function Oe(t,e){if(t.m)return Promise.reject();var n,i=[];for(n in t.b){var r=new q,a={start:function(t){t.resolve()}.bind(null,r),p:r};t.c[n].push(a),i.push(r),1==t.c[n].length&&a.start()}return Promise.all(i).then(function(){try{e()}catch(e){var t=Promise.reject(new z(2,3,3015,e))}for(var n in this.b)Ue(this,n);return t}.bind(t),function(){return Promise.reject()}.bind(t))}function Ue(t,e){t.c[e].shift();var n=t.c[e][0];if(n)try{n.start()}catch(i){n.p.reject(new z(2,3,3015,i)),Ue(t,e)}}function je(t,e,n){return n==e||t>=vc&&n==e.split("-")[0]||t>=yc&&n.split("-")[0]==e.split("-")[0]}function Be(t){t=t.toLowerCase().split("-");var e=gc[t[0]];return e&&(t[0]=e),t.join("-")}function Fe(t,e,n){var i=t.video;return!(i&&(i.width<e.minWidth||i.width>e.maxWidth||i.width>n.width||i.height<e.minHeight||i.height>e.maxHeight||i.height>n.height||i.width*i.height<e.minPixels||i.width*i.height>e.maxPixels)||t.bandwidth<e.minBandwidth||t.bandwidth>e.maxBandwidth)}function Ve(t,e,n){var i=!1;return t.variants.forEach(function(t){var r=t.allowedByApplication;t.allowedByApplication=Fe(t,e,n),r!=t.allowedByApplication&&(i=!0)}),i}function Ke(t,e,n,i){i.variants=i.variants.filter(function(i){return!(t&&t.L&&!le(t,i))&&(He(i.audio,t,e)&&He(i.video,t,n))}),i.textStreams=i.textStreams.filter(function(t){return!!mc[Ct(t.mimeType,t.codecs)]})}function He(t,e,n){if(!t)return!0;var i=null;e&&e.L&&(i=e.u),e=Ct(t.mimeType,t.codecs);var r,a=Ct(t.mimeType,t.codecs),o=t.mimeType;for(r in Ju){var s=t[r],u=Ju[r];s&&(o+="; "+u+'="'+s+'"')}return!(!(mc[a]||MediaSource.isTypeSupported(o)||we(a,t.type))||i&&t.encrypted&&0>i.indexOf(e)||n&&(t.mimeType!=n.mimeType||t.codecs.split(".")[0]!=n.codecs.split(".")[0]))}function qe(t){var e=t.audio,n=t.video,i=e?e.codecs:null,r=n?n.codecs:null,a=[];r&&a.push(r),i&&a.push(i);var o=[];n&&o.push(n.mimeType),e&&o.push(e.mimeType),o=o[0]||null;var s=[];e&&s.push(e.kind),n&&s.push(n.kind),s=s[0]||null;var u=[];return e&&u.push.apply(u,e.roles),n&&u.push.apply(u,n.roles),u=it(u),t={id:t.id,active:!1,type:"variant",bandwidth:t.bandwidth,language:t.language,label:null,kind:s,width:null,height:null,frameRate:null,mimeType:o,codecs:a.join(", "),audioCodec:i,videoCodec:r,primary:t.primary,roles:u,videoId:null,audioId:null,channelsCount:null,audioBandwidth:null,videoBandwidth:null},n&&(t.videoId=n.id,t.width=n.width||null,t.height=n.height||null,t.frameRate=n.frameRate||null,t.videoBandwidth=n.bandwidth||null),e&&(t.audioId=e.id,t.channelsCount=e.channelsCount,t.audioBandwidth=e.bandwidth||null,t.label=e.label),t}function Ge(t){return{id:t.id,active:!1,type:"text",bandwidth:0,language:t.language,label:t.label,kind:t.kind||null,width:null,height:null,frameRate:null,mimeType:t.mimeType,codecs:t.codecs||null,audioCodec:null,videoCodec:null,primary:t.primary,roles:t.roles,videoId:null,audioId:null,channelsCount:null,audioBandwidth:null,videoBandwidth:null}}function Xe(t){var e=[],n=Je(t.variants);return t=t.textStreams,n.forEach(function(t){e.push(qe(t))}),t.forEach(function(t){e.push(Ge(t))}),e}function Ye(t,e,n){return Je(t.variants).map(function(t){var i=qe(t);return t.video&&t.audio?i.active=n==t.video.id&&e==t.audio.id:t.video?i.active=n==t.video.id:t.audio&&(i.active=e==t.audio.id),i})}function ze(t,e){return t.textStreams.map(function(t){var n=Ge(t);return n.active=e==t.id,n})}function We(t,e){for(var n=0;n<t.variants.length;n++)if(t.variants[n].id==e.id)return t.variants[n];return null}function $e(t){return t.allowedByApplication&&t.allowedByKeySystem}function Je(t){return t.filter(function(t){return $e(t)})}function Qe(t,e,n,i,r){return t=Ze(t,e,n,r),tn(t,i)}function Ze(t,e,n,i){var r=Je(t),a=r;t=r.filter(function(t){return t.primary}),t.length&&(a=t);var o=a.length?a[0].language:"";if(a=a.filter(function(t){return t.language==o}),e){var s=Be(e);[yc,vc,0].forEach(function(t){var e=!1;r.forEach(function(n){s=Be(s);var r=Be(n.language);je(t,s,r)&&(e?a.push(n):(a=[n],e=!0),i&&(i.audio=!0))})})}return n&&(e=nn(a,n),e.length)?e:(e=a.map(function(t){return(t.audio?t.audio.roles:[]).concat(t.video?t.video.roles:[])}).reduce(It,[]),e.length?nn(a,e[0]):a)}function tn(t,e){var n=t.filter(function(t){return t.audio&&t.audio.channelsCount}).reduce(function(t,e){var n=e.audio.channelsCount;return t[n]?t[n].push(e):t[n]=[e],t},{}),i=Object.keys(n);if(0==i.length)return t;var r=i.filter(function(t){return t<=e});return r.length?n[Math.max.apply(null,r)]:n[Math.min.apply(null,i)]}function en(t,e,n,i){var r=t,a=t.filter(function(t){return t.primary});a.length&&(r=a);var o=r.length?r[0].language:"";if(r=r.filter(function(t){return t.language==o}),e){var s=Be(e);[yc,vc,0].forEach(function(e){var n=!1;t.forEach(function(t){var a=Be(t.language);je(e,s,a)&&(n?r.push(t):(r=[t],n=!0),i&&(i.text=!0))})})}if(n){if(e=rn(r,n),e.length)return e}else if(e=r.filter(function(t){return 0==t.roles.length}),e.length)return e;return e=r.map(function(t){return t.roles}).reduce(It,[]),e.length?rn(r,e[0]):r}function nn(t,e){return t.filter(function(t){return t.audio&&0<=t.audio.roles.indexOf(e)||t.video&&0<=t.video.roles.indexOf(e)})}function rn(t,e){return t.filter(function(t){return 0<=t.roles.indexOf(e)})}function an(t,e,n){for(var i=0;i<n.length;i++)if(n[i].audio==t&&n[i].video==e)return n[i];return null}function on(t,e,n){function i(t,e){return null==t?null==e:e.id==t}for(var r=0;r<n.length;r++)if(i(t,n[r].audio)&&i(e,n[r].video))return n[r];return null}function sn(t,e){for(var n=t.periods.length-1;0<n;--n)if(e+Wu>=t.periods[n].startTime)return n;return 0}function un(t,e){for(var n=0;n<t.periods.length;++n){var i=t.periods[n];if("text"==e.type){for(var r=0;r<i.textStreams.length;++r)if(i.textStreams[r]==e)return n}else for(r=0;r<i.variants.length;++r){var a=i.variants[r];if(a.audio==e||a.video==e||a.video&&a.video.trickModeVideo==e)return n}}return-1}function cn(){this.h=null,this.f=!1,this.b=new D,this.c=[],this.i=!1,this.a=this.g=null}function hn(t,e){return t&&(e=e.filter(function(e){return Fe(e,t,{width:1/0,height:1/0})})),e.sort(function(t,e){return t.bandwidth-e.bandwidth})}function ln(t){return JSON.stringify(t,function(t,e){if("function"!=typeof e){if(e instanceof Event||e instanceof At){var n,i={};for(n in e){var r=e[n];r&&"object"==typeof r?"detail"==n&&(i[n]=r):n in Event||(i[n]=r)}return i}if(e instanceof TimeRanges)for(i={__type__:"TimeRanges",length:e.length,start:[],end:[]},n=0;n<e.length;++n)i.start.push(e.start(n)),i.end.push(e.end(n));else i="number"==typeof e?isNaN(e)?"NaN":isFinite(e)?e:0>e?"-Infinity":"Infinity":e;return i}})}function fn(t){return JSON.parse(t,function(t,e){return"NaN"==e?NaN:"-Infinity"==e?-1/0:"Infinity"==e?1/0:e&&"object"==typeof e&&"TimeRanges"==e.__type__?dn(e):e})}function dn(t){return{length:t.length,start:function(e){return t.start[e]},end:function(e){return t.end[e]}}}function pn(t,e,n,i,r,a){this.I=t,this.g=e,this.L=n,this.j=!1,this.A=i,this.G=r,this.s=a,this.b=this.h=!1,this.u="",this.i=null,this.l=this.Cc.bind(this),this.m=this.Pd.bind(this),this.a={video:{},player:{}},this.o=0,this.c={},this.f=null}function mn(t){var e=Nc;e.removeUpdateListener(t.l),e.removeMessageListener("urn:x-cast:com.google.shaka.v2",t.m)}function vn(t){for(var e in t.c){var n=t.c[e];delete t.c[e],n.reject(new z(1,7,7e3))}}function yn(t){t=ln(t),Nc.sendMessage("urn:x-cast:com.google.shaka.v2",t,function(){},M)}function gn(){this.Bb=new bt,this.jb=this}function bn(t,e,n){gn.call(this),this.c=t,this.b=e,this.i=this.g=this.f=this.j=this.h=null,this.a=new pn(n,this.Le.bind(this),this.Me.bind(this),this.Ne.bind(this),this.Oe.bind(this),this.tc.bind(this)),wn(this)}function wn(t){t.a.init(),t.i=new wt,bc.forEach(function(t){Tt(this.i,this.c,t,this.$e.bind(this))}.bind(t)),Sc.forEach(function(t){Tt(this.i,this.b,t,this.le.bind(this))}.bind(t)),t.h={};for(var e in t.c)Object.defineProperty(t.h,e,{configurable:!1,enumerable:!0,get:t.Ze.bind(t,e),set:t.af.bind(t,e)});t.j={};for(var n in t.b)Object.defineProperty(t.j,n,{configurable:!1,enumerable:!0,get:t.ke.bind(t,n)});t.f=new gn,t.f.jb=t.h,t.g=new gn,t.g.jb=t.j}function Tn(t,e,n,i){gn.call(this),this.a=t,this.b=e,this.c=new wt,this.s={video:t,player:e},this.u=n||function(){},this.A=i||function(t){return t},this.o=!1,this.h=!0,this.g=0,this.m=!1,this.j=!0,this.l=this.i=this.f=null,En(this)}function En(e){var n=cast.receiver.CastReceiverManager.getInstance();n.onSenderConnected=e.Hc.bind(e),n.onSenderDisconnected=e.Hc.bind(e),n.onSystemVolumeChanged=e.ld.bind(e),e.i=n.getCastMessageBus("urn:x-cast:com.google.cast.media"),e.i.onMessage=e.Kd.bind(e),e.f=n.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),e.f.onMessage=e.Zd.bind(e),n.start(),bc.forEach(function(t){Tt(this.c,this.a,t,this.Kc.bind(this,"video"))}.bind(e)),Sc.forEach(function(t){Tt(this.c,this.b,t,this.Kc.bind(this,"player"))}.bind(e)),cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?e.b.cc(3840,2160):e.b.cc(1920,1080),Tt(e.c,e.a,"loadeddata",function(){this.m=!0}.bind(e)),Tt(e.c,e.b,"loading",function(){this.h=!1,Sn(this)}.bind(e)),Tt(e.c,e.a,"playing",function(){this.h=!1,Sn(this)}.bind(e)),Tt(e.c,e.a,"pause",function(){Sn(this)}.bind(e)),Tt(e.c,e.b,"unloading",function(){this.h=!0,Sn(this)}.bind(e)),Tt(e.c,e.a,"ended",function(){t.setTimeout(function(){this.a&&this.a.ended&&(this.h=!0,Sn(this))}.bind(this),5e3)}.bind(e))}function Sn(t){Promise.resolve().then(function(){this.b&&(this.dispatchEvent(new At("caststatuschanged")),An(this)||xn(this,0))}.bind(t))}function kn(t,e,n){for(var i in e.player)t.b[i](e.player[i]);t.u(n),n=Promise.resolve();var r=t.a.autoplay;e.manifest&&(t.a.autoplay=!1,n=t.b.load(e.manifest,e.startTime)),n.then(function(){if(t.b){for(var n in e.video)t.a[n]=e.video[n];for(var i in e.playerAfterLoad)t.b[i](e.playerAfterLoad[i]);t.a.autoplay=r,e.manifest&&(t.a.play(),xn(t,0))}},function(e){t.b.dispatchEvent(new At("error",{detail:e}))})}function An(t){return!(!t.j||!t.a.duration&&!t.b.P())&&(_n(t),t.j=!1,!0)}function _n(t){xn(t,0,{contentId:t.b.Ib(),streamType:t.b.P()?"LIVE":"BUFFERED",duration:t.a.duration,contentType:""})}function In(t,e,n,i){t.o&&(t=ln(e),i?n.getCastChannel(i).send(t):n.broadcast(t))}function xn(t,e,n){var i=t.a.playbackRate,r=Dc;r=t.h?r.IDLE:t.b.xc()?r.Yc:t.a.paused?r.$c:r.ad,i={mediaSessionId:0,playbackRate:i,playerState:r,currentTime:t.a.currentTime,supportedMediaCommands:15,volume:{level:t.a.volume,muted:t.a.muted}},n&&(i.media=n),In(t,{requestId:e,type:"MEDIA_STATUS",status:[i]},t.i)}function Pn(t,e){var n=Rn(t,e);return 1!=n.length?null:n[0]}function Rn(t,e){return Array.prototype.filter.call(t.childNodes,function(t){return t instanceof Element&&t.tagName==e})}function Nn(t){return Array.prototype.filter.call(t.childNodes,function(t){return t instanceof Element&&"pssh"==t.localName&&"urn:mpeg:cenc:2013"==t.namespaceURI})}function Dn(t,e,n){return t.hasAttributeNS(e,n)?t.getAttributeNS(e,n):null}function Cn(t){return Array.prototype.every.call(t.childNodes,function(t){return t.nodeType==Node.TEXT_NODE||t.nodeType==Node.CDATA_SECTION_NODE})?t.textContent.trim():null}function Mn(t,e,n,i){var r=null;return t=t.getAttribute(e),null!=t&&(r=n(t)),null==r?void 0!=i?i:null:r}function Ln(t){return t?(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t)&&(t+="Z"),t=Date.parse(t),isNaN(t)?null:Math.floor(t/1e3)):null}function On(t){return t&&(t=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(t))?(t=31536e3*Number(t[1]||null)+2592e3*Number(t[2]||null)+86400*Number(t[3]||null)+3600*Number(t[4]||null)+60*Number(t[5]||null)+Number(t[6]||null),isFinite(t)?t:null):null}function Un(t){var e=/([0-9]+)-([0-9]+)/.exec(t);return e?(t=Number(e[1]),isFinite(t)?(e=Number(e[2]),isFinite(e)?{start:t,end:e}:null):null):null}function jn(t){return t=Number(t),0==t%1?t:null}function Bn(t){return t=Number(t),0==t%1&&0<t?t:null}function Fn(t){return t=Number(t),0==t%1&&0<=t?t:null}function Vn(t){var e;return t=(e=t.match(/^(\d+)\/(\d+)$/))?Number(e[1]/e[2]):Number(t),isNaN(t)?null:t}function Kn(t,e,n){t=Gn(t);var i=null,r=[],a=[],o=t.map(function(t){return t.keyId}).filter(Pt);if(o.length&&1<o.filter(Rt).length)throw new z(2,4,4010);n||(a=t.filter(function(t){return"urn:mpeg:dash:mp4protection:2011"!=t.Pc||(i=t.init||i,!1)}),a.length&&(r=qn(i,e,a),0==r.length&&(r=[Dt("",i)]))),!t.length||!n&&a.length||(r=$u.values(Cc).filter(function(t){return"org.w3.clearkey"!=t}).map(function(t){return Dt(t,i)}));var s=o[0]||null;return s&&r.forEach(function(t){t.initData.forEach(function(t){t.keyId=s})}),{nc:s,gf:i,drmInfos:r,sc:!0}}function Hn(t,e,n,i){var r=Kn(t,e,i);if(n.sc)t=1==n.drmInfos.length&&!n.drmInfos[0].keySystem,e=0==r.drmInfos.length,(0==n.drmInfos.length||t&&!e)&&(n.drmInfos=r.drmInfos),n.sc=!1;else if(0<r.drmInfos.length&&(n.drmInfos=n.drmInfos.filter(function(t){return r.drmInfos.some(function(e){return e.keySystem==t.keySystem})}),0==n.drmInfos.length))throw new z(2,4,4008);return r.nc||n.nc}function qn(t,e,n){return n.map(function(n){var i=Cc[n.Pc];return i?[Dt(i,n.init||t)]:e(n.node)||[]}).reduce(It,[])}function Gn(t){return t.map(function(t){var e=t.getAttribute("schemeIdUri"),n=Dn(t,"urn:mpeg:cenc:2013","default_KID"),i=Nn(t).map(Cn);if(!e)return null;if(e=e.toLowerCase(),n&&(n=n.replace(/-/g,"").toLowerCase(),0<=n.indexOf(" ")))throw new z(2,4,4009);var r=[];try{r=i.map(function(t){return{initDataType:"cenc",initData:Ht(t),keyId:null}})}catch(t){throw new z(2,4,4007)}return{node:t,Pc:e,keyId:n,init:0<r.length?r:null}}).filter(Pt)}function Xn(e,n,i,r,a){var o={RepresentationID:n,Number:i,Bandwidth:r,Time:a};return e.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,function(e,n,i,r){if("$$"==e)return"$";var a=o[n];if(null==a)return e;switch("RepresentationID"==n&&i&&(i=void 0),"Time"==n&&(a=Math.round(a)),r){case void 0:case"d":case"i":case"u":e=a.toString();break;case"o":e=a.toString(8);break;case"x":e=a.toString(16);break;case"X":e=a.toString(16).toUpperCase();break;default:e=a.toString()}return i=t.parseInt(i,10)||1,Array(Math.max(0,i-e.length)+1).join("0")+e})}function Yn(t,e){var n=zn(t,e,"timescale"),i=1;n&&(i=Bn(n)||1),n=zn(t,e,"duration"),(n=Bn(n||""))&&(n/=i);var r=zn(t,e,"startNumber"),a=Number(zn(t,e,"presentationTimeOffset"))||0,o=Fn(r||"");null!=r&&null!=o||(o=1);var s=Wn(t,e,"SegmentTimeline");if(r=null,s){r=i;var u=t.M.duration||1/0;s=Rn(s,"S");for(var c=[],h=0,l=0;l<s.length;++l){var f=s[l],d=Mn(f,"t",Fn),p=Mn(f,"d",Fn);if(f=Mn(f,"r",jn),null!=d&&(d-=a),!p)break;if(d=null!=d?d:h,0>(f=f||0))if(l+1<s.length){if(null==(f=Mn(s[l+1],"t",Fn)))break;if(d>=f)break;f=Math.ceil((f-d)/p)-1}else{if(1/0==u)break;if(d/r>=u)break;f=Math.ceil((u*r-d)/p)-1}0<c.length&&d!=h&&(c[c.length-1].end=d/r);for(var m=0;m<=f;++m)h=d+p,c.push({start:d/r,end:h/r,We:d}),d=h}r=c}return{timescale:i,R:n,Ea:o,da:a/i||0,ic:a,H:r}}function zn(t,e,n){return[e(t.v),e(t.W),e(t.ba)].filter(Pt).map(function(t){return t.getAttribute(n)}).reduce(function(t,e){return t||e})}function Wn(t,e,n){return[e(t.v),e(t.W),e(t.ba)].filter(Pt).map(function(t){return Pn(t,n)}).reduce(function(t,e){return t||e})}function $n(t,e){var n=new DOMParser;try{var i=Mt(t),r=n.parseFromString(i,"text/xml")}catch(t){}if(r&&r.documentElement.tagName==e)var a=r.documentElement;return a&&0<a.getElementsByTagName("parsererror").length?null:a}function Jn(t,e,n,i,r,a){for(var o=Dn(t,"http://www.w3.org/1999/xlink","href"),s=Dn(t,"http://www.w3.org/1999/xlink","actuate")||"onRequest",u=0;u<t.attributes.length;u++){var c=t.attributes[u];"http://www.w3.org/1999/xlink"==c.namespaceURI&&(t.removeAttributeNS(c.namespaceURI,c.localName),--u)}if(5<=a)return $(new z(2,4,4028));if("onLoad"!=s)return $(new z(2,4,4027));var h=Nt([i],[o]);return r.request(0,pt(h,e)).X(function(i){if(!(i=$n(i.data,t.tagName)))return $(new z(2,4,4001,o));for(;t.childNodes.length;)t.removeChild(t.childNodes[0]);for(;i.childNodes.length;){var s=i.childNodes[0];i.removeChild(s),t.appendChild(s)}for(s=0;s<i.attributes.length;s++){var u=i.attributes[s].nodeName,c=i.getAttribute(u);t.setAttribute(u,c)}return Qn(t,e,n,h[0],r,a+1)})}function Qn(t,e,n,i,r,a){if(a=a||0,Dn(t,"http://www.w3.org/1999/xlink","href")){var o=Jn(t,e,n,i,r,a);return n&&(o=o.X(void 0,function(){return Qn(t,e,n,i,r,a)})),o}o=[];for(var s=0;s<t.childNodes.length;s++){var u=t.childNodes[s];u instanceof Element&&("urn:mpeg:dash:resolve-to-zero:2013"==Dn(u,"http://www.w3.org/1999/xlink","href")?(t.removeChild(u),--s):"SegmentTimeline"!=u.tagName&&o.push(Qn(u,e,n,i,r,a)))}return tt(o).X(function(){return t})}function Zn(t,e,n){this.c=t,this.b=e,this.a=n}function ti(t,e,n,i,r,a){this.position=t,this.startTime=e,this.endTime=n,this.c=i,this.b=r,this.a=a}function ei(t,e){this.D=t,this.b=e==Mc,this.a=0}function ni(){throw new z(2,3,3e3)}function ii(){this.c=[],this.b=[],this.a=!1}function ri(t){for(;t.reader.ha()&&!t.parser.a;)t.parser.xb(t.start,t.reader,t.partialOkay)}function ai(t){for(var e=t.reader.B();0<e&&!t.parser.a;--e)t.parser.xb(t.start,t.reader,t.partialOkay)}function oi(t){return function(e){t(e.reader.Da(e.reader.D.byteLength-e.reader.U()))}}function si(t){for(var e=0,n=0;n<t.length;n++)e=e<<8|t.charCodeAt(n);return e}function ui(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)}function ci(t,e,n,i){var r,a=(new ii).Z("sidx",function(t){r=hi(e,i,n,t)});if(t&&a.parse(t),r)return r;throw new z(2,3,3004)}function hi(t,e,n,i){var r=[];i.reader.F(4);var a=i.reader.B();if(0==a)throw new z(2,3,3005);if(0==i.version)var o=i.reader.B(),s=i.reader.B();else o=i.reader.Ra(),s=i.reader.Ra();i.reader.F(2);var u=i.reader.bb();for(t=t+i.size+s,s=0;s<u;s++){var c=i.reader.B(),h=(2147483648&c)>>>31;c&=2147483647;var l=i.reader.B();if(i.reader.F(4),1==h)throw new z(2,3,3006);r.push(new ti(r.length,o/a-e,(o+l)/a-e,function(){return n},t,t+c-1)),o+=l,t+=c}return i.parser.stop(),r}function li(t){this.a=t}function fi(t,e){for(;t.a.length&&t.a[t.a.length-1].startTime>=e;)t.a.pop();for(;t.a.length&&0>=t.a[0].endTime;)t.a.shift();if(0!=t.a.length){var n=t.a[t.a.length-1];t.a[t.a.length-1]=new ti(n.position,n.startTime,e,n.c,n.b,n.a)}}function di(t){this.b=t,this.a=new ei(t,0),Lc||(Lc=[new Uint8Array([255]),new Uint8Array([127,255]),new Uint8Array([63,255,255]),new Uint8Array([31,255,255,255]),new Uint8Array([15,255,255,255,255]),new Uint8Array([7,255,255,255,255,255]),new Uint8Array([3,255,255,255,255,255,255]),new Uint8Array([1,255,255,255,255,255,255,255])])}function pi(t){var e=mi(t);if(7<e.length)throw new z(2,3,3002);for(var n=0,i=0;i<e.length;i++)n=256*n+e[i];e=n,n=mi(t);t:{for(i=0;i<Lc.length;i++)if(Xt(n,Lc[i])){i=!0;break t}i=!1}if(i)n=t.b.byteLength-t.a.U();else{if(8==n.length&&224&n[1])throw new z(2,3,3001);i=n[0]&(1<<8-n.length)-1;for(var r=1;r<n.length;r++)i=256*i+n[r];n=i}return n=t.a.U()+n<=t.b.byteLength?n:t.b.byteLength-t.a.U(),i=new DataView(t.b.buffer,t.b.byteOffset+t.a.U(),n),t.a.F(n),new vi(e,i)}function mi(t){var e,n=t.a.ca();for(e=1;8>=e&&!(n&1<<8-e);e++);if(8<e)throw new z(2,3,3002);var i=new Uint8Array(e);for(i[0]=n,n=1;n<e;n++)i[n]=t.a.ca();return i}function vi(t,e){this.id=t,this.a=e}function yi(t){if(8<t.a.byteLength)throw new z(2,3,3002);if(8==t.a.byteLength&&224&t.a.getUint8(0))throw new z(2,3,3001);for(var e=0,n=0;n<t.a.byteLength;n++){e=256*e+t.a.getUint8(n)}return e}function gi(){}function bi(t,e,n,i,r,a){function o(){return r}var s=[];t=new di(t.a);for(var u=null,c=null;t.ha();){var h=pi(t);if(187==h.id){var l=wi(h);l&&(h=n*l.Xe,l=e+l.re,null!=u&&s.push(new ti(s.length,u-a,h-a,o,c,l-1)),u=h,c=l)}}return null!=u&&s.push(new ti(s.length,u-a,i-a,o,c,null)),s}function wi(t){var e=new di(t.a);if(t=pi(e),179!=t.id)throw new z(2,3,3013);if(t=yi(t),e=pi(e),183!=e.id)throw new z(2,3,3012);e=new di(e.a);for(var n=0;e.ha();){var i=pi(e);if(241==i.id){n=yi(i);break}}return{Xe:t,re:n}}function Ti(t,e){var n=Wn(t,e,"Initialization");if(!n)return null;var i=t.v.ea,r=n.getAttribute("sourceURL");r&&(i=Nt(t.v.ea,[r])),r=0;var a=null;return(n=Mn(n,"range",Un))&&(r=n.start,a=n.end),new Zn(function(){return i},r,a)}function Ei(t,e){var n=Number(zn(t,ki,"presentationTimeOffset"))||0,i=zn(t,ki,"timescale"),r=1;i&&(r=Bn(i)||1),n=n/r||0,i=Ti(t,ki);var a=t.v.contentType;if(r=t.v.mimeType.split("/")[1],"text"!=a&&"mp4"!=r&&"webm"!=r)throw new z(2,4,4006);if("webm"==r&&!i)throw new z(2,4,4005);a=Wn(t,ki,"RepresentationIndex");var o=zn(t,ki,"indexRange"),s=t.v.ea;if(o=Un(o||""),a){var u=a.getAttribute("sourceURL");u&&(s=Nt(t.v.ea,[u])),o=Mn(a,"range",Un,o)}if(!o)throw new z(2,4,4002);return r=Si(t,e,i,s,o.start,o.end,r,n),{createSegmentIndex:r.createSegmentIndex,findSegmentPosition:r.findSegmentPosition,getSegmentReference:r.getSegmentReference,initSegmentReference:i,da:n}}function Si(t,e,n,i,r,a,o,s){var u=t.presentationTimeline,c=!t.Ia||!t.M.Lb,h=t.M.index,l=t.M.duration,f=e,d=null;return{createSegmentIndex:function(){var t=[f(i,r,a),"webm"==o?f(n.c(),n.b,n.a):null];return f=null,Promise.all(t).then(function(t){var e=t[0];t=t[1]||null,e="mp4"==o?ci(e,r,i,s):(new gi).parse(e,t,i,s),u.Na(e,0==h),d=new li(e),c&&fi(d,l)})},findSegmentPosition:function(t){return d.find(t)},getSegmentReference:function(t){return d.get(t)}}}function ki(t){return t.cb}function Ai(t,e){var n=Ti(t,_i),i=xi(t),r=Yn(t,_i),a=r.Ea;0==a&&(a=1);var o=0;if(r.R?o=r.R*(a-1):r.H&&0<r.H.length&&(o=r.H[0].start),i={R:r.R,startTime:o,Ea:a,da:r.da,H:r.H,Ma:i},!i.R&&!i.H&&1<i.Ma.length)throw new z(2,4,4002);if(!i.R&&!t.M.duration&&!i.H&&1==i.Ma.length)throw new z(2,4,4002);if(i.H&&0==i.H.length)throw new z(2,4,4002);return a=r=null,t.ba.id&&t.v.id&&(a=t.ba.id+","+t.v.id,r=e[a]),o=Ii(t.M.duration,i.Ea,t.v.ea,i),r?(r.Pb(o),a=t.presentationTimeline.Xa(),r.Fb(a-t.M.start)):(t.presentationTimeline.Na(o,0==t.M.index),r=new li(o),a&&t.Ia&&(e[a]=r)),t.Ia&&t.M.Lb||fi(r,t.M.duration),{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:r.find.bind(r),getSegmentReference:r.get.bind(r),initSegmentReference:n,da:i.da}}function _i(t){return t.ta}function Ii(t,e,n,i){var r=i.Ma.length;i.H&&i.H.length!=i.Ma.length&&(r=Math.min(i.H.length,i.Ma.length));for(var a=[],o=i.startTime,s=0;s<r;s++){var u=i.Ma[s],c=Nt(n,[u.Gd]),h=void 0;h=null!=i.R?o+i.R:i.H?i.H[s].end:o+t,a.push(new ti(s+e,o,h,function(t){return t}.bind(null,c),u.start,u.end)),o=h}return a}function xi(t){return[t.v.ta,t.W.ta,t.ba.ta].filter(Pt).map(function(t){return Rn(t,"SegmentURL")}).reduce(function(t,e){return 0<t.length?t:e}).map(function(e){e.getAttribute("indexRange")&&!t.wc&&(t.wc=!0);var n=e.getAttribute("media");return e=Mn(e,"mediaRange",Un,{start:0,end:null}),{Gd:n,start:e.start,end:e.end}})}function Pi(t,e,n,i){var r=Ci(t),a=Yn(t,Ri),o=zn(t,Ri,"media"),s=zn(t,Ri,"index");if(a={R:a.R,timescale:a.timescale,Ea:a.Ea,da:a.da,ic:a.ic,H:a.H,Ob:o,Za:s},o=a.Za?1:0,o+=a.H?1:0,0==(o+=a.R?1:0))throw new z(2,4,4002);if(1!=o&&(a.Za&&(a.H=null),a.R=null),!a.Za&&!a.Ob)throw new z(2,4,4002);if(a.Za){if("mp4"!=(n=t.v.mimeType.split("/")[1])&&"webm"!=n)throw new z(2,4,4006);if("webm"==n&&!r)throw new z(2,4,4005);i=Xn(a.Za,t.v.id,null,t.bandwidth||null,null),i=Nt(t.v.ea,[i]),t=Si(t,e,r,i,0,null,n,a.da)}else a.R?(i||t.presentationTimeline.Rb(a.R),t=Ni(t,a)):(o=e=null,t.ba.id&&t.v.id&&(o=t.ba.id+","+t.v.id,e=n[o]),s=Di(t,a),i=!t.Ia||!t.M.Lb,e?(i&&fi(new li(s),t.M.duration),e.Pb(s),n=t.presentationTimeline.Xa(),e.Fb(n-t.M.start)):(t.presentationTimeline.Na(s,0==t.M.index),e=new li(s),o&&t.Ia&&(n[o]=e)),i&&fi(e,t.M.duration),t={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:e.find.bind(e),getSegmentReference:e.get.bind(e)});return{createSegmentIndex:t.createSegmentIndex,findSegmentPosition:t.findSegmentPosition,getSegmentReference:t.getSegmentReference,initSegmentReference:r,da:a.da}}function Ri(t){return t.fb}function Ni(t,e){var n=t.M.duration,i=e.R,r=e.Ea,a=e.timescale,o=e.Ob,s=t.bandwidth||null,u=t.v.id,c=t.v.ea;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(t){return 0>t||n&&t>=n?null:Math.floor(t/i)},getSegmentReference:function(t){var e=t*i,h=e+i;return n&&(h=Math.min(h,n)),0>h||n&&e>=n?null:new ti(t,e,h,function(){var n=Xn(o,u,t+r,s,e*a);return Nt(c,[n])},0,null)}}}function Di(t,e){for(var n=[],i=0;i<e.H.length;i++){var r=i+e.Ea;n.push(new ti(r,e.H[i].start,e.H[i].end,function(t,e,n,i,r,a){return t=Xn(t,e,r,n,a),Nt(i,[t]).map(function(t){return t.toString()})}.bind(null,e.Ob,t.v.id,t.bandwidth||null,t.v.ea,r,e.H[i].We+e.ic),0,null))}return n}function Ci(t){var e=zn(t,Ri,"initialization");if(!e)return null;var n=t.v.id,i=t.bandwidth||null,r=t.v.ea;return new Zn(function(){var t=Xn(e,n,null,i,null);return Nt(r,[t])},0,null)}function Mi(){var t,e={};for(t in Oc)e[t]=!0;for(var n in Uc)e[n]=!0;return["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"].forEach(function(t){e[t]=!!Oc[t]}),["mpd","m3u8","ism"].forEach(function(t){e[t]=!!Uc[t]}),e}function Li(t,e,n,i){var r=i;return r||(i=new L(t).aa.split("/").pop().split("."),1<i.length&&(i=i.pop().toLowerCase(),r=Uc[i])),r?Promise.resolve(r):(n=pt([t],n),n.method="HEAD",e.request(0,n).promise.then(function(e){return(e=e.headers["content-type"])&&(e=e.toLowerCase()),(r=Oc[e])?r:Promise.reject(new z(2,4,4e3,t))},function(t){return t.severity=2,Promise.reject(t)}))}function Oi(t,e){this.f=t,this.l=e,this.c=this.b=1/0,this.a=1,this.j=this.h=0,this.i=!0,this.g=0}function Ui(){this.a=this.b=null,this.h=[],this.c=null,this.j=[],this.i=1,this.l={},this.m=0,this.o=new P(5),this.g=null,this.f=new ht}function ji(t){var e=Date.now(),n=t.a.networkingEngine.request(0,pt(t.h,t.b.retryParameters));return lt(t.f,n),n.promise.then(function(e){if(t.a)return Bi(t,e.data,e.uri)}).then(function(){var n=(Date.now()-e)/1e3;return R(t.o,1,n),n})}function Bi(t,e,n){if(!(e=$n(e,"MPD")))throw new z(2,4,4001,n);return e=Qn(e,t.b.retryParameters,t.b.dash.xlinkFailGracefully,n,t.a.networkingEngine),lt(t.f,e),e.promise.then(function(e){return Fi(t,e,n)})}function Fi(t,e,n){n=[n];var i=Rn(e,"Location").map(Cn).filter(Pt);0<i.length&&(n=t.h=i),i=Rn(e,"BaseURL").map(Cn),n=Nt(n,i);var r=Mn(e,"minBufferTime",On);t.m=Mn(e,"minimumUpdatePeriod",On,-1);var a=Mn(e,"availabilityStartTime",Ln);i=Mn(e,"timeShiftBufferDepth",On);var o=Mn(e,"suggestedPresentationDelay",On),s=Mn(e,"maxSegmentDuration",On),u=e.getAttribute("type")||"static";if(t.c)var c=t.c.presentationTimeline;else{var h=Math.max(t.b.dash.defaultPresentationDelay,1.5*r);c=new Oi(a,null!=o?o:h)}a=Vi(t,{Ia:"static"!=u,presentationTimeline:c,ba:null,M:null,W:null,v:null,bandwidth:0,wc:!1},n,e),o=a.duration;var l=a.periods;return c.yb("static"==u),"static"!=u&&a.oc||c.ka(o||1/0),(u=c.P())&&!isNaN(t.b.availabilityWindowOverride)&&(i=t.b.availabilityWindowOverride),null==i&&(i=1/0),c.dc(i),c.Rb(s||1),t.c?Promise.resolve():(e=Rn(e,"UTCTiming"),$i(t,n,e,u).then(function(t){this.a&&(c.Rc(t),this.c={presentationTimeline:c,periods:l,offlineSessionIds:[],minBufferTime:r||0})}.bind(t)))}function Vi(t,e,n,i){var r=Mn(i,"mediaPresentationDuration",On),a=[],o=0;i=Rn(i,"Period");for(var s=0;s<i.length;s++){var u=i[s];o=Mn(u,"start",On,o);var c=Mn(u,"duration",On),h=null;if(s!=i.length-1){var l=Mn(i[s+1],"start",On);null!=l&&(h=l-o)}else null!=r&&(h=r-o);if(null==h&&(h=c),u=Ki(t,e,n,{start:o,duration:h,node:u,index:s,Lb:null==h||s==i.length-1}),a.push(u),c=e.ba.id,-1==t.j.indexOf(c)&&(t.j.push(c),t.c&&(t.a.filterNewPeriod(u),t.c.periods.push(u))),null==h){o=null;break}o+=h}return null==t.c&&t.a.filterAllPeriods(a),null!=r?{periods:a,duration:r,oc:!1}:{periods:a,duration:o,oc:!0}}function Ki(t,e,n,i){e.ba=Xi(i.node,null,n),e.M=i,e.ba.id||(e.ba.id="__shaka_period_"+i.start),Rn(i.node,"EventStream").forEach(t.ie.bind(t,i.start,i.duration)),n=Rn(i.node,"AdaptationSet").map(t.ge.bind(t,e)).filter(Pt);var r=n.map(function(t){return t.te}).reduce(It,[]),a=r.filter(Rt);if(e.Ia&&r.length!=a.length)throw new z(2,4,4018);var o=n.filter(function(t){return!t.hc});if(n.filter(function(t){return t.hc}).forEach(function(t){var e=t.streams[0],n=t.hc;o.forEach(function(t){t.id==n&&t.streams.forEach(function(t){t.trickModeVideo=e})})}),n=Hi(o,"video"),r=Hi(o,"audio"),!n.length&&!r.length)throw new z(2,4,4004);for(r.length||(r=[null]),n.length||(n=[null]),e=[],a=0;a<r.length;a++)for(var s=0;s<n.length;s++)qi(t,r[a],n[s],e);for(t=Hi(o,"text"),n=[],r=0;r<t.length;r++)n.push.apply(n,t[r].streams);return{startTime:i.start,textStreams:n,variants:e}}function Hi(t,e){return t.filter(function(t){return t.contentType==e})}function qi(t,e,n,i){if(e||n)if(e&&n){var r=e.drmInfos,a=n.drmInfos;if(r.length&&a.length?0<fe(r,a).length:1){a=fe(e.drmInfos,n.drmInfos);for(var o=0;o<e.streams.length;o++)for(var s=0;s<n.streams.length;s++)r=(n.streams[s].bandwidth||0)+(e.streams[o].bandwidth||0),r={id:t.i++,language:e.language,primary:e.Nb||n.Nb,audio:e.streams[o],video:n.streams[s],bandwidth:r,drmInfos:a,allowedByApplication:!0,allowedByKeySystem:!0},i.push(r)}}else for(a=e||n,o=0;o<a.streams.length;o++)r=a.streams[o].bandwidth||0,r={id:t.i++,language:a.language||"und",primary:a.Nb,audio:e?a.streams[o]:null,video:n?a.streams[o]:null,bandwidth:r,drmInfos:a.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0},i.push(r)}function Gi(e,n){0>e.m||(e.g=t.setTimeout(e.Pe.bind(e),1e3*Math.max(3,e.m-n,N(e.o))))}function Xi(t,e,n){e=e||{contentType:"",mimeType:"",codecs:"",containsEmsgBoxes:!1,frameRate:void 0,Sb:null},n=n||e.ea;var i=Rn(t,"BaseURL").map(Cn),r=t.getAttribute("contentType")||e.contentType,a=t.getAttribute("mimeType")||e.mimeType,o=t.getAttribute("codecs")||e.codecs,s=Mn(t,"frameRate",Vn)||e.frameRate,u=!!Rn(t,"InbandEventStream").length,c=Rn(t,"AudioChannelConfiguration");return c=Yi(c)||e.Sb,r||(r=Ji(a,o)),{ea:Nt(n,i),cb:Pn(t,"SegmentBase")||e.cb,ta:Pn(t,"SegmentList")||e.ta,fb:Pn(t,"SegmentTemplate")||e.fb,width:Mn(t,"width",Fn)||e.width,height:Mn(t,"height",Fn)||e.height,contentType:r,mimeType:a,codecs:o,frameRate:s,containsEmsgBoxes:u||e.containsEmsgBoxes,id:t.getAttribute("id"),Sb:c}}function Yi(t){for(var e=0;e<t.length;++e){var n=t[e],i=n.getAttribute("schemeIdUri");if(i&&(n=n.getAttribute("value")))switch(i){case"urn:mpeg:dash:outputChannelPositionList:2012":return n.trim().split(/ +/).length;case"urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case"urn:dts:dash:audio_channel_configuration:2012":if(!(i=parseInt(n,10)))continue;return i;case"tag:dolby.com,2014:dash:audio_channel_configuration:2011":case"urn:dolby:dash:audio_channel_configuration:2011":if(i=parseInt(n,16)){for(t=0;i;)1&i&&++t,i>>=1;return t}}}return null}function zi(t){var e=t.cb?1:0;return e+=t.ta?1:0,0==(e+=t.fb?1:0)?"text"==t.contentType||"application"==t.contentType:(1!=e&&(t.cb&&(t.ta=null),t.fb=null),!0)}function Wi(t,e,n,i){return e=Nt(e,[n]),e=pt(e,t.b.retryParameters),e.method=i,e=t.a.networkingEngine.request(0,e),lt(t.f,e),e.promise.then(function(t){if("HEAD"==i){if(!t.headers||!t.headers.date)return 0;t=t.headers.date}else t=Mt(t.data);return t=Date.parse(t),isNaN(t)?0:t-Date.now()})}function $i(t,e,n,i){n=n.map(function(t){return{scheme:t.getAttribute("schemeIdUri"),value:t.getAttribute("value")}});var r=t.b.dash.clockSyncUri;return i&&!n.length&&r&&n.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:r}),_t(n,function(t){var n=t.value;switch(t.scheme){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return Wi(this,e,n,"HEAD");case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":return Wi(this,e,n,"GET");case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return t=Date.parse(n),isNaN(t)?0:t-Date.now();case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:return Promise.reject()}}.bind(t)).catch(function(){return 0})}function Ji(t,e){return mc[Ct(t,e)]?"text":t.split("/")[0]}function Qi(t,e,n,i){this.uri=t,this.type=e,this.a=n,this.segments=i||null}function Zi(t,e,n,i){this.id=t,this.name=e,this.a=n,this.value=i||null}function tr(t,e){this.name=t,this.value=e}function er(t,e,n){return n=n||null,(t=t.getAttribute(e))?t.value:n}function nr(t,e){this.a=e,this.uri=t}function ir(t,e){return t.filter(function(t){return t.name==e})}function rr(t,e){var n=ir(t,e);return n.length?n[0]:null}function ar(t,e,n){return t.filter(function(t){var i=t.getAttribute("TYPE");return t=t.getAttribute("GROUP-ID"),i.value==e&&t.value==n})}function or(t,e){return Nt([t],[e])[0]}function sr(t){this.b=t,this.a=0}function ur(t){cr(t,/[ \t]+/gm)}function cr(t,e){e.lastIndex=t.a;var n=e.exec(t.b);return n=null==n?null:{position:n.index,length:n[0].length,we:n},t.a==t.b.length||null==n||n.position!=t.a?null:(t.a+=n.length,n.we)}function hr(t){return t.a==t.b.length?null:(t=cr(t,/[^ \t\n]*/gm))?t[0]:null}function lr(){this.a=0}function fr(t,e,n){e=Mt(e),e=e.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();var i=e.split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(i[0]))throw new z(2,4,4015);e=0;for(var r=1;r<i.length;r++)if(!/^#(?!EXT)/m.test(i[r])){var a=pr(t,i[r]);if(--t.a,0<=jc.indexOf(a.name)){e=1;break}"EXT-X-STREAM-INF"==a.name&&(r+=1)}for(r=[],a=1;a<i.length;)if(/^#(?!EXT)/m.test(i[a]))a+=1;else{var o=pr(t,i[a]);if(0<=Bc.indexOf(o.name)){if(1!=e)throw new z(2,4,4017);return i=i.splice(a,i.length-a),t=dr(t,i,r),new Qi(n,e,r,t)}r.push(o),a+=1,"EXT-X-STREAM-INF"==o.name&&(o.a.push(new tr("URI",i[a])),a+=1)}return new Qi(n,e,r)}function dr(t,e,n){var i=[],r=[];return e.forEach(function(e){if(/^(#EXT)/.test(e))e=pr(t,e),0<=jc.indexOf(e.name)?n.push(e):r.push(e);else{if(/^#(?!EXT)/m.test(e))return[];i.push(new nr(e.trim(),r)),r=[]}}),i}function pr(t,e){t:{var n=t.a++,i=e.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!i)throw new z(2,4,4016,e);var r=i[1],a=i[2];if(i=[],a&&0<=a.indexOf("=")){a=new sr(a);for(var o,s=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;o=cr(a,s);)i.push(new tr(o[1],o[2]||o[3]))}else if(a){n=new Zi(n,r,i,a);break t}n=new Zi(n,r,i)}return n}function mr(t){try{var e=mr.parse(t);return Q({uri:t,data:e.data,headers:{"content-type":e.contentType}})}catch(t){return $(t)}}function vr(){this.g=this.c=null,this.L=1,this.u={},this.I={},this.Y={},this.a={},this.b=null,this.m="",this.s=new lr,this.j=this.i=null,this.f=Hc,this.o=null,this.l=0,this.A=1/0,this.h=new ht,this.G=[]}function yr(t,e,n){Vr(t,n).then(function(t){var i=qc,r=fr(this.s,t.data,n);if(1!=r.type)throw new z(2,4,4017);t=rr(r.a,"EXT-X-MEDIA-SEQUENCE");var a=e.stream;Dr(this,r,t?Number(t.value):0,a.mimeType,a.codecs).then(function(t){e.eb.a=t,t=t[t.length-1],rr(r.a,"EXT-X-ENDLIST")&&(Hr(this,i.ra),this.b.ka(t.endTime))}.bind(this))}.bind(t))}function gr(t,e,n){if(e=fr(t.s,e,n),0!=e.type)throw new z(2,4,4022);return br(t,e).then(function(t){this.c.filterAllPeriods([t]);var e=1/0,n=0,i=0,r=1/0;for(o in this.a){var a=this.a[o];e=Math.min(e,a.Qb),n=Math.max(n,a.Qb),i=Math.max(i,a.Fd),"text"!=a.stream.type&&(r=Math.min(r,a.duration))}var o=null;if(a=0,this.f!=qc.ra&&(o=Date.now()/1e3-i,a=3*this.l),this.b=new Oi(o,a),this.b.yb(this.f==qc.ra),Nr(this),this.f!=qc.ra){for(e=3*this.l,this.b.Sc(e),this.i=this.A,this.f==qc.jc&&(isNaN(this.g.availabilityWindowOverride)||(e=this.g.availabilityWindowOverride),this.b.dc(e)),e=0;95443.7176888889<=n;)e+=95443.7176888889,n-=95443.7176888889;if(e)for(var s in this.a)n=this.a[s],95443.7176888889>n.Qb&&(n.stream.presentationTimeOffset=-e,n.eb.offset(e))}else{this.b.ka(r);for(var u in this.a)s=this.a[u],s.stream.presentationTimeOffset=e,s.eb.offset(-e),fi(s.eb,r)}this.o={presentationTimeline:this.b,periods:[t],offlineSessionIds:[],minBufferTime:0}}.bind(t))}function br(t,e){var n=e.a,i=ir(e.a,"EXT-X-MEDIA").filter(function(t){return"SUBTITLES"==Br(t,"TYPE")}.bind(t)).map(function(t){return kr(this,t)}.bind(t));return Promise.all(i).then(function(t){var i=ir(n,"EXT-X-STREAM-INF").map(function(t){return wr(this,t,e)}.bind(this));return Promise.all(i).then(function(e){return{startTime:0,variants:e.reduce(It,[]),textStreams:t}}.bind(this))}.bind(t))}function wr(t,e,n){var i=er(e,"CODECS","avc1.42E01E,mp4a.40.2").split(/\s*,\s*/),r=e.getAttribute("RESOLUTION"),a=null,o=null,s=er(e,"FRAME-RATE"),u=Number(Br(e,"BANDWIDTH"));if(r){var c=r.value.split("x");a=c[0],o=c[1]}n=ir(n.a,"EXT-X-MEDIA");var h=er(e,"AUDIO"),l=er(e,"VIDEO");if(h?n=ar(n,"AUDIO",h):l&&(n=ar(n,"VIDEO",l)),c=Ur("text",i)){var f=er(e,"SUBTITLES");f&&(f=ar(n,"SUBTITLES",f),f.length&&(t.u[f[0].id].stream.codecs=c)),i.splice(i.indexOf(c),1)}n=n.map(function(t){return Ar(this,t,i)}.bind(t));var d=[],p=[];return Promise.all(n).then(function(t){if(h?d=t:l&&(p=t),t=!1,d.length||p.length)if(d.length)if(Br(e,"URI")==d[0].$b){var n="audio";t=!0}else n="video";else n="audio";else 1==i.length?(n=Ur("video",i),n=r||s||n?"video":"audio"):(n="video",i=[i.join(",")]);return t?Promise.resolve():Ir(this,e,i,n)}.bind(t)).then(function(t){return t&&("audio"==t.stream.type?d=[t]:p=[t]),p&&Tr(p),d&&Tr(d),Er(this,d,p,u,a,o,s)}.bind(t))}function Tr(t){t.forEach(function(t){var e=t.stream.codecs.split(",");e=e.filter(function(t){return"mp4a.40.34"!=t}),t.stream.codecs=e.join(",")})}function Er(t,e,n,i,r,a,o){n.forEach(function(t){(t=t.stream)&&(t.width=Number(r)||void 0,t.height=Number(a)||void 0,t.frameRate=Number(o)||void 0)}.bind(t)),e.length||(e=[null]),n.length||(n=[null]);for(var s=[],u=0;u<e.length;u++)for(var c=0;c<n.length;c++){var h=e[u]?e[u].stream:null,l=n[c]?n[c].stream:null,f=e[u]?e[u].drmInfos:null,d=n[c]?n[c].drmInfos:null,p=void 0;if(h&&l){if(!(f.length&&d.length?0<fe(f,d).length:1))continue;p=fe(f,d)}else h?p=f:l&&(p=d);f=(n[u]?n[u].$b:"")+" - "+(e[u]?e[u].$b:""),t.I[f]||(h=Sr(t,h,l,i,p),s.push(h),t.I[f]=h)}return s}function Sr(t,e,n,i,r){return{id:t.L++,language:e?e.language:"und",primary:!!e&&e.primary||!!n&&n.primary,audio:e,video:n,bandwidth:i,drmInfos:r,allowedByApplication:!0,allowedByKeySystem:!0}}function kr(t,e){return Br(e,"TYPE"),Ar(t,e,[]).then(function(t){return t.stream})}function Ar(t,e,n){var i=Br(e,"URI");if(i=or(t.m,i),t.a[i])return Promise.resolve(t.a[i]);var r=Br(e,"TYPE").toLowerCase();"subtitles"==r&&(r="text");var a=Be(er(e,"LANGUAGE","und")),o=er(e,"NAME"),s=e.getAttribute("DEFAULT"),u=e.getAttribute("AUTOSELECT"),c=er(e,"CHANNELS");return xr(t,i,n,r,a,!!s||!!u,o,"audio"==r?_r(c):null).then(function(t){return this.a[i]?this.a[i]:(this.u[e.id]=t,this.a[i]=t)}.bind(t))}function _r(t){return t?(t=t.split("/")[0],parseInt(t,10)):null}function Ir(t,e,n,i){var r=Br(e,"URI");return r=or(t.m,r),t.a[r]?Promise.resolve(t.a[r]):xr(t,r,n,i,"und",!1,null,null).then(function(t){return this.a[r]?this.a[r]:this.a[r]=t}.bind(t))}function xr(t,e,n,i,r,a,o,s){var u=e;e=or(t.m,e);var c,h,l="";return Vr(t,e).then(function(t){if(c=fr(this.s,t.data,e),1!=c.type)throw new z(2,4,4017);t=c;var r=qc,a=rr(t.a,"EXT-X-PLAYLIST-TYPE"),o=rr(t.a,"EXT-X-ENDLIST");if(o=a&&"VOD"==a.value||o,a=a&&"EVENT"==a.value&&!o,a=!o&&!a,o?Hr(this,r.ra):(a?Hr(this,r.jc):Hr(this,r.Zc),t=Fr(t.a,"EXT-X-TARGETDURATION"),t=Number(t.value),this.l=Math.max(t,this.l),this.A=Math.min(t,this.A)),1==n.length)l=n[0];else{if(null==(t=Ur(i,n)))throw new z(2,4,4025,n);l=t}return jr(this,i,l,c)}.bind(t)).then(function(t){return h=t,t=rr(c.a,"EXT-X-MEDIA-SEQUENCE"),Dr(this,c,t?Number(t.value):0,h,l)}.bind(t)).then(function(t){var e=t[0].startTime,n=t[t.length-1].endTime,f=n-e;t=new li(t);var d=Pr(c),p=void 0;"text"==i&&(p="subtitle");var m=[];c.segments.forEach(function(t){t=ir(t.a,"EXT-X-KEY"),m.push.apply(m,t)});var v=!1,y=[],g=null;if(m.forEach(function(t){if("NONE"!=Br(t,"METHOD")){v=!0;var e=Br(t,"KEYFORMAT");(t=(e=Kc[e])?e(t):null)&&(t.keyIds.length&&(g=t.keyIds[0]),y.push(t))}}),v&&!y.length)throw new z(2,4,4026);return d={id:this.L++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:t.find.bind(t),getSegmentReference:t.get.bind(t),initSegmentReference:d,presentationTimeOffset:0,mimeType:h,codecs:l,kind:p,encrypted:v,keyId:g,language:r,label:o||null,type:i,primary:a,trickModeVideo:null,containsEmsgBoxes:!1,frameRate:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:[],channelsCount:s},this.Y[d.id]=t,{stream:d,eb:t,drmInfos:y,$b:u,Qb:e,Fd:n,duration:f}}.bind(t))}function Pr(t){var e=ir(t.a,"EXT-X-MAP");if(!e.length)return null;if(1<e.length)throw new z(2,4,4020);e=e[0];var n=Br(e,"URI"),i=or(t.uri,n);return t=0,n=null,(e=er(e,"BYTERANGE"))&&(t=e.split("@"),e=Number(t[0]),t=Number(t[1]),n=t+e-1),new Zn(function(){return[i]},t,n)}function Rr(t,e,n,i,r){var a=n.a,o=or(t.uri,n.uri);t=Fr(a,"EXTINF").value.split(","),t=r+Number(t[0]),n=0;var s=null;return(a=rr(a,"EXT-X-BYTERANGE"))&&(n=a.value.split("@"),a=Number(n[0]),n=n[1]?Number(n[1]):e.a+1,s=n+a-1),new ti(i,r,t,function(){return[o]},n,s)}function Nr(t){t.b&&(t.G.forEach(function(e){t.b.Na(e,!0)}),t.G=[])}function Dr(t,e,n,i,r){var a=e.segments,o=[],s=or(e.uri,a[0].uri),u=Rr(e,null,a[0],n,0),c=Pr(e);return Mr(t,e.uri,c,u,i,r).then(function(t){s.split("/").pop();for(var i=0;i<a.length;++i){var r=o[o.length-1];r=Rr(e,r,a[i],n+i,0==i?t:r.endTime),o.push(r)}return this.G.push(o),Nr(this),o}.bind(t))}function Cr(t,e){var n=t.c.networkingEngine,i=pt(e.c(),t.g.retryParameters),r={},a=e.b;r.Range="bytes="+a+"-"+(a+2048-1);var o={};return 0==a&&null==e.a||(a="bytes="+a+"-",null!=e.a&&(a+=e.a),o.Range=a),i.headers=r,r=n.request(1,i),lt(t.h,r),r.promise.catch(function(){C("Unable to fetch a partial HLS segment! Falling back to a full segment request, which is expensive! Your server should support Range requests and CORS preflights.",i.uris[0]),i.headers=o;var e=n.request(1,i);return lt(t.h,e),e.promise})}function Mr(t,e,n,i,r,a){return t.o&&(e=t.a[e].eb.get(i.position))?Promise.resolve(e.startTime):(i=[Cr(t,i)],"video/mp4"!=r&&"audio/mp4"!=r||(n?i.push(Cr(t,n)):i.push(i[0])),Promise.all(i).then(function(t){if("video/mp4"==r||"audio/mp4"==r)return Lr(t[0].data,t[1].data);if("audio/mpeg"==r)return 0;if("video/mp2t"==r)return Or(t[0].data);if("application/mp4"==r||0==r.indexOf("text/")){t=t[0].data;var e=Ct(r,a);if(mc[e]){var n=new Se(null);n.f=new mc[e],t=n.Kb(t)}else t=0;return t}throw new z(2,4,4030)}.bind(t)))}function Lr(t,e){var n=0;if((new ii).C("moov",ri).C("trak",ri).C("mdia",ri).Z("mdhd",function(t){t.reader.F(0==t.version?8:16),n=t.reader.B(),t.parser.stop()}).parse(e,!0),!n)throw new z(2,4,4030);var i=0,r=!1;if((new ii).C("moof",ri).C("traf",ri).Z("tfdt",function(t){i=(0==t.version?t.reader.B():t.reader.Ra())/n,r=!0,t.parser.stop()}).parse(t,!0),!r)throw new z(2,4,4030);return i}function Or(t){function e(){throw new z(2,4,4030)}t=new ei(new DataView(t),0);for(var n=0,i=0;;){if(n=t.U(),i=t.ca(),71!=i&&e(),16384&t.bb()||e(),i=(48&t.ca())>>4,0!=i&&2!=i||e(),3==i&&(i=t.ca(),t.F(i)),1==t.B()>>8)return t.F(3),n=t.ca()>>6,0!=n&&1!=n||e(),0==t.ca()&&e(),n=t.ca(),i=t.bb(),t=t.bb(),(1073741824*((14&n)>>1)+((65534&i)<<14|(65534&t)>>1))/9e4;t.seek(n+188),i=t.ca(),71!=i&&(t.seek(n+192),i=t.ca()),71!=i&&(t.seek(n+204),i=t.ca()),71!=i&&e(),t.Oc(1)}}function Ur(t,e){for(var n=Fc[t],i=0;i<n.length;i++)for(var r=0;r<e.length;r++)if(n[i].test(e[r].trim()))return e[r].trim();return"text"==t?"":null}function jr(t,e,n,i){i=or(i.uri,i.segments[0].uri);var r=new L(i).aa.split(".").pop(),a=Vc[e][r];return a?Promise.resolve(a):"text"==e?n&&"vtt"!=n?Promise.resolve("application/mp4"):Promise.resolve("text/vtt"):(e=pt([i],t.g.retryParameters),e.method="HEAD",e=t.c.networkingEngine.request(1,e),lt(t.h,e),e.promise.then(function(t){if(!(t=t.headers["content-type"]))throw new z(2,4,4021,r);return t.split(";")[0]}))}function Br(t,e){var n=t.getAttribute(e);if(!n)throw new z(2,4,4023,e);return n.value}function Fr(t,e){var n=rr(t,e);if(!n)throw new z(2,4,4024,e);return n}function Vr(t,e){var n=t.c.networkingEngine.request(0,pt([e],t.g.retryParameters));return lt(t.h,n),n.promise}function Kr(e,n){null!=e.i&&null!=n&&(e.j=t.setTimeout(e.S.bind(e),1e3*n))}function Hr(e,n){e.f=n,e.b&&e.b.yb(e.f==qc.ra),e.f==qc.ra&&null!=e.j&&(t.clearTimeout(e.j),e.j=null,e.i=null)}function qr(t,e,n,i){this.a=t,this.s=e,this.o=n,this.u=i,this.h=new wt,this.b=null,this.g=!1,this.m=t.readyState,this.c=!1,this.j=this.A=-1,this.f=this.i=!1,e=this.l.bind(this),Tt(this.h,t,"waiting",e),this.b=new Bt(e),Vt(this.b,.25)}function Gr(t,e,n){this.a=t,this.i=e,this.h=n,this.c=new wt,this.f=1,this.g=!1,this.b=null,0<t.readyState?this.Fc():Et(this.c,t,"loadedmetadata",this.Fc.bind(this)),Tt(this.c,t,"ratechange",this.Vd.bind(this))}function Xr(t){return 0<t.a.readyState?t.a.currentTime:t.h}function Yr(t,e){0<t.a.readyState?Wr(t,t.a.currentTime,e):(t.h=e,setTimeout(t.i,0))}function zr(t,e){null!=t.b&&(t.b.cancel(),t.b=null),t.f=e,t.a.playbackRate=t.g||0>e?0:e,!t.g&&0>e&&(t.b=new Bt(function(){t.a.currentTime+=e/4}),Vt(t.b,.25))}function Wr(t,e,n){function i(){!t.a||10<=r++||t.a.currentTime!=e||(t.a.currentTime=n,setTimeout(i,100))}t.a.currentTime=n;var r=0;setTimeout(i,100)}function $r(t,e,n,i,r,a){this.c=t,this.b=e,this.h=n,this.j=r,this.f=null,this.g=new qr(t,e,n,a),e=this.Xd.bind(this),n=this.b.presentationTimeline,null==i?i=1/0>n.T()?n.Ja():n.ma():0>i&&(i=n.ma()+i),i=Qr(this,ta(this,i)),this.a=new Gr(t,e,i),this.f=new Bt(this.Ud.bind(this)),Vt(this.f,.25)}function Jr(t){var e=Xr(t.a);return 0<t.c.readyState&&(t.c.paused||(e=ta(t,e))),e}function Qr(t,e){var n=t.b.presentationTimeline.T();return e>=n?n-t.h.durationBackoff:e}function Zr(t,e){var n=pe.bind(null,t.c.buffered),i=Math.max(t.b.minBufferTime||0,t.h.rebufferingGoal),r=t.b.presentationTimeline,a=r.Ja(),o=r.ma(),s=r.T();3>o-a&&(a=o-3);var u=r.Wa(i),c=r.Wa(5);return i=r.Wa(i+5),e>=s?Qr(t,e):e>o?o:e<a?n(c)?c:i:e>=u||n(e)?e:i}function ta(t,e){var n=t.b.presentationTimeline.Ja();return e<n?n:(n=t.b.presentationTimeline.ma(),e>n?n:e)}function ea(t,e,n,i,r,a,o){this.a=t,this.u=e,this.g=n,this.s=i,this.l=r,this.h=a,this.A=o,this.c=[],this.j=new wt,this.b=!1,this.i=-1,this.f=null,ia(this)}function na(t){var e=ut(t);return e.eventElement=t.eventElement,e}function ia(e){ra(e),e.f=t.setTimeout(e.G.bind(e),250)}function ra(e){e.f&&(t.clearTimeout(e.f),e.f=null)}function aa(t,e){this.a=e,this.b=t,this.g=null,this.j=1,this.m=Promise.resolve(),this.h=[],this.i={},this.c={},this.o=!1,this.A=null,this.u=this.f=this.l=!1,this.s=0}function oa(t){var e=Jr(t.a.Pa);return t.b.periods[sn(t.b,e)]}function sa(t){var e=t.c.video||t.c.audio;return e?t.b.periods[e.Ba]:null}function ua(t){return ha(t,"audio")}function ca(t){return ha(t,"video")}function ha(t,e){var n=t.c[e];return n?n.sa||n.stream:null}function la(t,e){Ce(t.a.J,"text"),t.s++,t.u=!1;var n=t.s;return t.a.J.init({text:e},!1).then(function(){return Ta(t,[e])}).then(function(){if(!t.f&&t.s==n&&!t.c.text&&!t.u){var i=Jr(t.a.Pa);t.c.text=ba(e,sn(t.b,i)),Oa(t,t.c.text,0)}})}function fa(t){t.u=!0,t.c.text&&(Ua(t.c.text),delete t.c.text)}function da(t,e){var n=t.c.video;if(n){var i=n.stream;if(i)if(e){var r=i.trickModeVideo;r&&!n.sa&&(ma(t,r,!1),n.sa=i)}else(i=n.sa)&&(n.sa=null,ma(t,i,!0))}}function pa(t,e,n){e.video&&ma(t,e.video,n),e.audio&&ma(t,e.audio,n)}function ma(t,e,n){var i=t.c[e.type];if(!i&&"text"==e.type&&t.g.ignoreTextStreamFailures)la(t,e);else if(i){var r=un(t.b,e);n&&r!=i.Ba?ya(t):(i.sa&&(e.trickModeVideo?(i.sa=e,e=e.trickModeVideo):i.sa=null),(r=t.h[r])&&r.Sa&&(r=t.i[e.id])&&r.Sa&&i.stream!=e&&("text"==e.type&&Ie(t.a.J,Ct(e.mimeType,e.codecs)),i.stream=e,i.wb=!0,n&&(i.ya?i.zb=!0:i.Ca?(i.va=!0,i.zb=!0):(Ua(i),La(t,i,!0)))))}}function va(t){var e=Jr(t.a.Pa),n=t.g.smallGapLimit;Object.keys(t.c).every(function(t){var i=this.a.J;return"text"==t?(t=i.a,t=e>=t.a&&e<t.b):(t=Ne(i,t),t=pe(t,e,n)),t}.bind(t))||ya(t)}function ya(t){for(var e in t.c){var n=t.c[e];n.ya||n.va||(n.Ca?n.va=!0:null==xe(t.a.J,e)?null==n.ua&&Oa(t,n,0):(Ua(n),La(t,n,!1)))}}function ga(t,e,n){var i=Jr(t.a.Pa),r=sn(t.b,i),a={},o=[];return e.variant&&e.variant.audio&&(a.audio=e.variant.audio,o.push(e.variant.audio)),e.variant&&e.variant.video&&(a.video=e.variant.video,o.push(e.variant.video)),e.text&&(a.text=e.text,o.push(e.text)),t.a.J.init(a,t.g.forceTransmuxTS).then(function(){if(!t.f){var e=t.b.presentationTimeline.T();return 1/0>e?t.a.J.ka(e):t.a.J.ka(Math.pow(2,32)),Ta(t,o)}}).then(function(){if(!t.f)for(var e in a){var i=a[e];t.c[e]||(t.c[e]=ba(i,r,n),Oa(t,t.c[e],0))}})}function ba(t,e,n){return{stream:t,type:t.type,La:null,na:null,sa:null,wb:!0,Ba:e,endOfStream:!1,Ca:!1,ua:null,va:!1,zb:!1,ya:!1,Zb:!1,Ya:!1,Nc:n||0}}function wa(t,e){var n=t.h[e];if(n)return n.promise;n={promise:new q,Sa:!1},t.h[e]=n;var i=t.b.periods[e].variants.map(function(t){var e=[];return t.audio&&e.push(t.audio),t.video&&e.push(t.video),t.video&&t.video.trickModeVideo&&e.push(t.video.trickModeVideo),e}).reduce(It,[]).filter(Rt);return i.push.apply(i,t.b.periods[e].textStreams),t.m=t.m.then(function(){if(!this.f)return Ta(this,i)}.bind(t)).then(function(){this.f||(this.h[e].promise.resolve(),this.h[e].Sa=!0)}.bind(t)).catch(function(t){this.f||(this.h[e].promise.catch(function(){}),this.h[e].promise.reject(),delete this.h[e],this.a.onError(t))}.bind(t)),n.promise}function Ta(t,e){e.map(function(t){return t.id}).filter(Rt);for(var n=[],i=0;i<e.length;++i){var r=e[i],a=t.i[r.id];a?n.push(a.promise):(t.i[r.id]={promise:new q,Sa:!1},n.push(r.createSegmentIndex()))}return Promise.all(n).then(function(){if(!this.f)for(var t=0;t<e.length;++t){var n=this.i[e[t].id];n.Sa||(n.promise.resolve(),n.Sa=!0)}}.bind(t)).catch(function(t){if(!this.f){for(var n=0;n<e.length;n++)this.i[e[n].id].promise.catch(function(){}),this.i[e[n].id].promise.reject(),delete this.i[e[n].id];return Promise.reject(t)}}.bind(t))}function Ea(t,e){var n=Jr(t.a.Pa),i=Sa(t,e,n),r=un(t.b,e.stream),a=sn(t.b,i),o=Re(t.a.J,e.type,n),s=Math.max(t.j*Math.max(t.b.minBufferTime||0,t.g.rebufferingGoal),t.j*t.g.bufferingGoal);if(i>=t.b.presentationTimeline.T())return e.endOfStream=!0,null;if(e.endOfStream=!1,e.Ba=a,a!=r)return null;if(o>=s)return.5;if(a=Pe(t.a.J,e.type),!(a=ka(t,e,n,a,r)))return 1;var u=1/0;return $u.values(t.c).forEach(function(e){u=Math.min(u,Sa(t,e,n))}),i>=u+t.b.presentationTimeline.a?1:(e.Nc=0,_a(t,e,n,r,a),null)}function Sa(t,e,n){return e.La&&e.na?t.b.periods[un(t.b,e.La)].startTime+e.na.endTime:Math.max(n,e.Nc)}function ka(t,e,n,i,r){if(e.na&&e.stream==e.La)return Aa(t,e,r,e.na.position+1);if(null==(n=e.na?e.stream.findSegmentPosition(Math.max(0,t.b.periods[un(t.b,e.La)].startTime+e.na.endTime-t.b.periods[r].startTime)):e.stream.findSegmentPosition(Math.max(0,(i||n)-t.b.periods[r].startTime))))return null;var a=null;return null==i&&(a=Aa(t,e,r,Math.max(0,n-1))),a||Aa(t,e,r,n)}function Aa(t,e,n,i){return n=t.b.periods[n],(e=e.stream.getSegmentReference(i))?(i=t.b.presentationTimeline,t=i.Xa(),i=i.Ka(),n.startTime+e.endTime<t||n.startTime+e.startTime>i?null:e):null}function _a(t,e,n,i,r){var a=t.b.periods[i],o=e.stream,s=t.b.presentationTimeline.T(),u=t.b.periods[i+1];i=xa(t,e,i,Math.max(0,a.startTime-.1),u?u.startTime:s),e.Ca=!0,e.wb=!1,s=Ma(t,r),Promise.all([i,s]).then(function(t){if(!this.f&&!this.l)return Pa(this,e,n,a,o,r,t[1])}.bind(t)).then(function(){this.f||this.l||(e.Ca=!1,e.Zb=!1,e.va||this.a.ab(),Oa(this,e,0),Na(this,o))}.bind(t)).catch(function(t){this.f||this.l||(e.Ca=!1,"text"==e.type&&this.g.ignoreTextStreamFailures?delete this.c.text:3017==t.code?Ia(this,e,t):(e.Ya=!0,t.severity=2,ja(this,t)))}.bind(t))}function Ia(t,e,n){if(!$u.values(t.c).some(function(t){return t!=e&&t.Zb})){var i=Math.round(100*t.j);if(20<i)t.j-=.2;else{if(!(4<i))return e.Ya=!0,t.l=!0,void t.a.onError(n);t.j-=.04}e.Zb=!0}Oa(t,e,4)}function xa(t,e,n,i,r){return e.wb?(n=Me(t.a.J,e.type,t.b.periods[n].startTime-e.stream.presentationTimeOffset,i,r),e.stream.initSegmentReference?(t=Ma(t,e.stream.initSegmentReference).then(function(t){if(!this.f)return De(this.a.J,e.type,t,null,null)}.bind(t)).catch(function(t){return e.wb=!0,Promise.reject(t)}),Promise.all([n,t])):n):Promise.resolve()}function Pa(t,e,n,i,r,a,o){return r.containsEmsgBoxes&&(new ii).Z("emsg",t.he.bind(t,i,a)).parse(o),Ra(t,e,n).then(function(){if(!this.f)return De(this.a.J,e.type,o,a.startTime+i.startTime,a.endTime+i.startTime)}.bind(t)).then(function(){if(!this.f)return e.La=r,e.na=a,Promise.resolve()}.bind(t))}function Ra(t,e,n){var i=Math.max(t.g.bufferBehind,t.b.presentationTimeline.a),r=xe(t.a.J,e.type);return null==r?Promise.resolve():(n=n-r-i,0>=n?Promise.resolve():t.a.J.remove(e.type,r,r+n).then(function(){}.bind(t)))}function Na(t,e){if(!t.o&&(t.o=$u.values(t.c).every(function(t){return"text"==t.type||!t.va&&!t.ya&&t.na}),t.o)){var n=un(t.b,e);for(t.h[n]||wa(t,n).then(function(){this.f||this.a.zc()}.bind(t)).catch(xt),n=0;n<t.b.periods.length;++n)wa(t,n).catch(xt);t.a.$d&&t.a.$d()}}function Da(t,e){if(e.Ba!=un(t.b,e.stream)){var n=e.Ba,i=$u.values(t.c);i.every(function(t){return t.Ba==n})&&i.every(Ca)&&wa(t,n).then(function(){if(!this.f&&i.every(function(t){var e=un(this.b,t.stream);return Ca(t)&&t.Ba==n&&e!=n}.bind(this))){var t=this.b.periods[n],e=this.a.Ac(t),r={};e.variant&&e.variant.video&&(r.video=e.variant.video),e.variant&&e.variant.audio&&(r.audio=e.variant.audio),e.text&&(r.text=e.text);for(var a in this.c)if(!r[a]&&"text"!=a)return void this.a.onError(new z(2,5,5005));for(var o in r)if(!this.c[o]){if("text"!=o)return void this.a.onError(new z(2,5,5005));ga(this,{text:r.text},t.startTime),delete r[o]}for(var s in this.c)(t=r[s])?(ma(this,t,!1),Oa(this,this.c[s],0)):delete this.c[s];this.a.zc()}}.bind(t)).catch(xt)}}function Ca(t){return!t.Ca&&null==t.ua&&!t.va&&!t.ya}function Ma(t,e){var n=pt(e.c(),t.g.retryParameters);if(0!=e.b||null!=e.a){var i="bytes="+e.b+"-";null!=e.a&&(i+=e.a),n.headers.Range=i}return t.a.$a.request(1,n).promise.then(function(t){return t.data})}function La(t,e,n){e.va=!1,e.zb=!1,e.ya=!0,Ce(t.a.J,e.type).then(function(){if(!this.f&&n)return this.a.J.flush(e.type)}.bind(t)).then(function(){this.f||(e.La=null,e.na=null,e.ya=!1,e.endOfStream=!1,Oa(this,e,0))}.bind(t))}function Oa(e,n,i){n.ua=t.setTimeout(e.Re.bind(e,n),1e3*i)}function Ua(e){null!=e.ua&&(t.clearTimeout(e.ua),e.ua=null)}function ja(t,e){X(t.A).then(function(){this.f||(this.a.onError(e),e.handled||this.g.failureCallback(e))}.bind(t))}function Ba(t,e,n,i,r,a){if(200<=n&&299>=n&&202!=n)return r&&(i=r),{uri:i,data:e,headers:t,fromCache:!!t["x-shaka-from-cache"]};r=null;try{r=Ot(e)}catch(t){}throw new z(401==n||403==n?2:1,1,1001,i,n,r,t,a)}function Fa(t,e,n){var i=new Fa.b;$u.forEach(e.headers,function(t,e){i.append(t,e)});var r,a=new Fa.a,o={body:e.body||void 0,headers:i,method:e.method,signal:a.signal,credentials:e.allowCrossSiteCredentials?"include":void 0},s={mc:!1,Xc:!1};return e.retryParameters.timeout&&(r=setTimeout(function(){s.Xc=!0,a.abort()},e.retryParameters.timeout)),t=Fa.f(t,n,o,s,r),new W(t,function(){return s.mc=!0,a.abort(),Promise.resolve()})}function Va(t,e,n){var i=new Va.g;return new W(new Promise(function(r,a){i.open(e.method,t,!0),i.responseType="arraybuffer",i.timeout=e.retryParameters.timeout,i.withCredentials=e.allowCrossSiteCredentials,i.onabort=function(){a(new z(1,1,7001,t,n))},i.onload=function(e){e=e.target;var i=e.getAllResponseHeaders().trim().split("\r\n").reduce(function(t,e){var n=e.split(": ");return t[n[0].toLowerCase()]=n.slice(1).join(": "),t},{});try{var o=Ba(i,e.response,e.status,t,e.responseURL,n);r(o)}catch(t){a(t)}},i.onerror=function(e){a(new z(1,1,1002,t,e,n))},i.ontimeout=function(){a(new z(1,1,1003,t,n))};for(var o in e.headers)i.setRequestHeader(o.toLowerCase(),e.headers[o]);i.send(e.body)}),function(){return i.abort(),Promise.resolve()})}function Ka(t){this.a={},this.c=Promise.resolve(),this.h=!1,this.i=t,this.f=this.b=this.g=0}function Ha(t,e,n,i,r){t.a[e]=t.a[e]||[],t.a[e].push({request:n,pc:i,Id:r})}function qa(t,e){var n=$u.values(t.a);t.a={},n.forEach(function(e){e.forEach(function(e){t.b+=e.pc})});var i=Promise.resolve().then(function(){return Ya(t),Promise.all(n.map(function(n){return Ga(t,e,n)}))});return t.c=t.c.then(function(){return i}),i}function Ga(t,e,n){var i=Promise.resolve();return n.forEach(function(n){i=i.then(function(){return Ya(t),Xa(t,e,n)})}),i}function Xa(t,e,n){return Promise.resolve().then(function(){return Ya(t),e.request(1,n.request).promise}).then(function(e){return Ya(t),t.g+=n.pc,t.f+=e.data.byteLength,t.i(t.b?t.g/t.b:0,t.f),n.Id(e.data)})}function Ya(t){if(t.h)throw new z(2,9,7001)}function za(t,e){var n=this;this.c=t,this.b=t.objectStore(e),this.a=new q,t.onabort=function(t){t.preventDefault(),n.a.reject()},t.onerror=function(t){t.preventDefault(),n.a.reject()},t.oncomplete=function(){n.a.resolve()}}function Wa(t){this.b=t,this.a=[]}function $a(t,e){return Ja(t,e,"readwrite")}function Ja(t,e,n){n=t.b.transaction([e],n);var i=new za(n,e);return t.a.push(i),i.promise().then(function(){at(t.a,i)},function(){at(t.a,i)}),i}function Qa(){this.a={}}function Za(t){var e=null;if($u.forEach(t.a,function(t,n){$u.forEach(n.getCells(),function(n,i){i.hasFixedKeySpace()||e||(e={path:{fa:t,N:n},N:i})})}),e)return e;throw new z(2,9,9013,"Could not find a cell that supports add-operations")}function to(t,e){$u.forEach(t.a,function(t,n){$u.forEach(n.getCells(),function(n,i){e({fa:t,N:n},i)})})}function eo(t,e,n){if(!(t=t.a[e]))throw new z(2,9,9013,"Could not find mechanism with name "+e);if(!(e=t.getCells()[n]))throw new z(2,9,9013,"Could not find cell with name "+n);return e}function no(t){return c(function e(){var n,i,r,a;return A(e,function(e){switch(e.w){case 1:return n=$u,i=Object.values(t.a),r=0<i.length,r||(a=Gc,n.forEach(a,function(t,e){var n=e();n&&i.push(n)})),d(e,Promise.all(i.map(function(t){return t.erase()})),2);case 2:if(!r)return d(e,Promise.all(i.map(function(t){return t.destroy()})),0);e.V(0)}})})}function io(){return $u.values(Gc).some(function(t){return!!(t=t())&&(t.destroy(),!0)})}function ro(t){this.a=new Wa(t)}function ao(t){return Promise.reject(new z(2,9,9011,"Cannot add new value to "+t))}function oo(t,e,n,i){t=$a(t.a,e);var r=t.store();return n.forEach(function(t){r.delete(t).onsuccess=function(){return i(t)}}),t.promise()}function so(t,e,n){t=Ja(t.a,e,"readonly");var i=t.store(),r={},a=[];return n.forEach(function(t){i.get(t).onsuccess=function(e){e=e.target.result,void 0==e&&a.push(t),r[t]=e}}),t.promise().then(function(){return a.length?Promise.reject(new z(2,9,9012,"Could not find values for "+a)):n.map(function(t){return r[t]})})}function uo(t){return{originalManifestUri:t.originalManifestUri,duration:t.duration,size:t.size,expiration:null==t.expiration?1/0:t.expiration,periods:t.periods.map(co),sessionIds:t.sessionIds,drmInfo:t.drmInfo,appMetadata:t.appMetadata}}function co(t){return mo(t),t.streams.forEach(function(){}),{startTime:t.startTime,streams:t.streams.map(ho)}}function ho(t){var e=t.Cd?po(t.Cd):null;return{id:t.id,primary:t.primary,presentationTimeOffset:t.presentationTimeOffset,contentType:t.contentType,mimeType:t.mimeType,codecs:t.codecs,frameRate:t.frameRate,kind:t.kind,language:t.language,label:t.label,width:t.width,height:t.height,initSegmentKey:e,encrypted:t.encrypted,keyId:t.keyId,segments:t.segments.map(lo),variantIds:t.variantIds}}function lo(t){var e=po(t.uri);return{startTime:t.startTime,endTime:t.endTime,dataKey:e}}function fo(t){return{data:t.data}}function po(t){var e;if((e=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(t))||(e=/^offline:segment\/([0-9]+)$/.exec(t)))return Number(e[1]);throw new z(2,9,9004,"Could not parse uri "+t)}function mo(t){var e=t.streams.filter(function(t){return"audio"==t.contentType}),n=t.streams.filter(function(t){return"video"==t.contentType});if(!e.every(function(t){return t.variantIds})||!n.every(function(t){return t.variantIds})){e.forEach(function(t){t.variantIds=[]}),n.forEach(function(t){t.variantIds=[]});var i=0;if(n.length&&!e.length){var r=i++;n.forEach(function(t){t.variantIds.push(r)})}if(!n.length&&e.length){var a=i++;e.forEach(function(t){t.variantIds.push(a)})}n.length&&e.length&&e.forEach(function(t){n.forEach(function(e){var n=i++;t.variantIds.push(n),e.variantIds.push(n)})})}}function vo(t,e,n,i){this.a=new Wa(t),this.c=e,this.b=n,this.f=i}function yo(t,e,n){if(t.f)return Promise.reject(new z(1,9,9011,"Cannot add new value to "+e));t=$a(t.a,e);var i=t.store(),r=[];return n.forEach(function(t){i.add(t).onsuccess=function(t){r.push(t.target.result)}}),t.promise().then(function(){return r})}function go(t,e,n,i){t=$a(t.a,e);var r=t.store();return n.forEach(function(t){r.delete(t).onsuccess=function(){return i(t)}}),t.promise()}function bo(t,e,n){t=Ja(t.a,e,"readonly");var i=t.store(),r={},a=[];return n.forEach(function(t){var e=i.get(t);e.onsuccess=function(){void 0==e.result&&a.push(t),r[t]=e.result}}),t.promise().then(function(){return a.length?Promise.reject(new z(1,9,9012,"Could not find values for "+a)):n.map(function(t){return r[t]})})}function wo(){this.c=this.b=this.a=this.f=null}function To(){var e=new q,n=t.indexedDB.deleteDatabase("shaka_offline_db");return n.onblocked=function(){},n.onsuccess=function(){e.resolve()},n.onerror=function(t){e.reject(new z(2,9,9001,n.error)),t.preventDefault()},e}function Eo(t,e,n,i){this.a=t,this.g=e,this.f=n,this.c=i,this.b=["offline:",t,"/",e,"/",n,"/",i].join("")}function So(t){if(null==(t=/^offline:([a-z]+)\/([^\/]+)\/([^\/]+)\/([0-9]+)$/.exec(t)))return null;var e=t[1];if("manifest"!=e&&"segment"!=e)return null;var n=t[2];if(!n)return null;var i=t[3];return i&&null!=e?new Eo(e,n,i,Number(t[4])):null}function ko(t,e){this.b=t,this.a=e}function Ao(t,e){var n=new Oi(null,0);n.ka(e.duration);var i=e.periods.map(function(e){return _o(t,e,n)}),r=e.drmInfo?[e.drmInfo]:[];return e.drmInfo&&i.forEach(function(t){t.variants.forEach(function(t){t.drmInfos=r})}),{presentationTimeline:n,minBufferTime:2,offlineSessionIds:e.sessionIds,periods:i}}function _o(t,e,n){var i=e.streams.filter(function(t){return"audio"==t.contentType}),r=e.streams.filter(function(t){return"video"==t.contentType});return i=Io(t,i,r),r=e.streams.filter(function(t){return"text"==t.contentType}).map(function(e){return xo(t,e)}),e.streams.forEach(function(e,i){var r=e.segments.map(function(e,n){return Po(t,n,e)});n.Na(r,0==i)}),{startTime:e.startTime,variants:i,textStreams:r}}function Io(t,e,n){var i={},r=[];return r.push.apply(r,e),r.push.apply(r,n),r.forEach(function(t){t.variantIds.forEach(function(t){i[t]=i[t]||{id:t,language:"",primary:!1,audio:null,video:null,bandwidth:0,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0}})}),e.forEach(function(e){var n=xo(t,e);e.variantIds.forEach(function(t){t=i[t],t.language=n.language,t.primary=t.primary||n.primary,t.audio=n})}),n.forEach(function(e){var n=xo(t,e);e.variantIds.forEach(function(t){t=i[t],t.primary=t.primary||n.primary,t.video=n})}),$u.values(i)}function xo(t,e){var n=e.segments.map(function(e,n){return Po(t,n,e)}),i=new li(n);return n={id:e.id,createSegmentIndex:function(){return Promise.resolve()},findSegmentPosition:function(t){return i.find(t)},getSegmentReference:function(t){return i.get(t)},initSegmentReference:null,presentationTimeOffset:e.presentationTimeOffset,mimeType:e.mimeType,codecs:e.codecs,width:e.width||void 0,height:e.height||void 0,frameRate:e.frameRate||void 0,kind:e.kind,encrypted:e.encrypted,keyId:e.keyId,language:e.language,label:e.label||null,type:e.contentType,primary:e.primary,trickModeVideo:null,containsEmsgBoxes:!1,roles:[],channelsCount:null},null!=e.initSegmentKey&&(n.initSegmentReference=Ro(t,e.initSegmentKey)),n}function Po(t,e,n){var i=new Eo("segment",t.b,t.a,n.dataKey);return new ti(e,n.startTime,n.endTime,function(){return[i.toString()]},0,null)}function Ro(t,e){var n=new Eo("segment",t.b,t.a,e);return new Zn(function(){return[n.toString()]},0,null)}function No(){this.a=null}function Do(t){var e=So(t);return e&&"manifest"==e.a?Do.a(t):e&&"segment"==e.a?Do.b(e.key(),e):$(new z(2,1,9004,t))}function Co(t){this.a=null;for(var e=0;e<t.textTracks.length;++e){var n=t.textTracks[e];n.mode="disabled","Shaka Player TextTrack"==n.label&&(this.a=n)}this.a||(this.a=t.addTextTrack("subtitles","Shaka Player TextTrack")),this.a.mode="hidden"}function Mo(t){if(t.startTime>=t.endTime)return null;var e=new VTTCue(t.startTime,t.endTime,t.payload);e.lineAlign=t.lineAlign,e.positionAlign=t.positionAlign,e.size=t.size;try{e.align=t.textAlign}catch(t){}return"center"==t.textAlign&&"center"!=e.align&&(e.align="middle"),2==t.writingDirection?e.vertical="lr":3==t.writingDirection&&(e.vertical="rl"),1==t.lineInterpretation&&(e.snapToLines=!1),null!=t.line&&(e.line=t.line),null!=t.position&&(e.position=t.position),e}function Lo(t,e){var n=t.mode;t.mode="showing"==n?"showing":"hidden";for(var i=t.cues,r=i.length-1;0<=r;r--){var a=i[r];a&&e(a)&&t.removeCue(a)}t.mode=n}function Oo(e,n){var i=this;gn.call(this),this.wa=!1,this.f=null,this.pb=!1,this.u=null,this.o=new wt,this.Ab=this.h=this.Cb=this.b=this.m=this.a=this.A=this.g=this.j=this.i=this.s=null,this.bd=1e9,this.lb=[],this.ob=!1,this.xa=!0,this.S=this.qb=this.Ha=null,this.kc=!1,this.G=null,this.nb=[],this.I={},this.c=Wo(this),this.mb={width:1/0,height:1/0},this.l=$o(),this.kb=0,this.L=this.c.preferredAudioLanguage,this.ga=this.c.preferredTextLanguage,this.Ga=this.c.preferredVariantRole,this.Ua=this.c.preferredTextRole,this.Y=this.c.preferredAudioChannelCount,n&&n(this),this.s=new ft(this.Je.bind(this)),e&&this.rb(e,!0),Tt(this.o,t,"online",function(){i.ac()})}function Uo(t){if(!t.Ha)return Promise.resolve();var e=Promise.resolve();return t.m&&(e=t.m.stop(),t.m=null),Promise.all([e,t.Ha()])}function jo(t,e,n){return c(function i(){var r,a;return A(i,function(i){switch(i.w){case 1:return d(i,Li(e,t.s,t.c.manifest.retryParameters,n),2);case 2:return r=i.K,t.m=new r,t.m.configure(t.c.manifest),a={networkingEngine:t.s,filterNewPeriod:t.tb.bind(t),filterAllPeriods:t.ec.bind(t),onTimelineRegionAdded:t.ae.bind(t),onEvent:t.gb.bind(t),onError:t.Ta.bind(t)},i.return(t.m.start(e,a))}})})}function Bo(t){function e(t){return t.video&&t.audio||t.video&&t.video.codecs.includes(",")}if(t.b.periods.some(function(t){return t.variants.some(e)})&&t.b.periods.forEach(function(t){t.variants=t.variants.filter(e)}),0==t.b.periods.length)throw new z(2,4,4014)}function Fo(t){var e=t.b.presentationTimeline.T(),n=t.c.playRangeEnd,i=t.c.playRangeStart;0<i&&(t.P()||t.b.presentationTimeline.Tc(i)),n<e&&(t.P()||t.b.presentationTimeline.ka(n))}function Vo(t){function e(t){return(t.video?t.video.codecs.split(".")[0]:"")+"-"+(t.audio?t.audio.codecs.split(".")[0]:"")}var n=t.b.periods.reduce(function(t,e){return t.concat(e.variants)},[]);n=tn(n,t.c.preferredAudioChannelCount);var i={};n.forEach(function(t){var n=e(t);n in i||(i[n]=[]),i[n].push(t)});var r=null,a=1/0;$u.forEach(i,function(t,e){var n=0,i=0;e.forEach(function(t){n+=t.bandwidth||0,++i});var o=n/i;o<a&&(r=t,a=o)}),t.b.periods.forEach(function(t){t.variants=t.variants.filter(function(t){return e(t)==r})})}function Ko(t){if(t.m&&t.m.configure(t.c.manifest),t.i&&t.i.configure(t.c.drm),t.a){t.a.configure(t.c.streaming);try{t.b.periods.forEach(t.tb.bind(t))}catch(e){t.Ta(e)}var e=ua(t.a),n=ca(t.a),i=oa(t.a);(e=an(e,n,i.variants))&&e.allowedByApplication&&e.allowedByKeySystem||es(t,i)}t.h&&(t.h.configure(t.c.abr),t.c.abr.enabled&&!t.xa?t.h.enable():t.h.disable())}function Ho(t){var e=[];return t.forEach(function(t){if(t){var n=t.language;t.roles.length?t.roles.forEach(function(t){e.push({language:n,role:t})}):e.push({language:n,role:""})}else e.push({language:"und",role:""})}),it(e,function(t,e){return t.language==e.language&&t.role==e.role})}function qo(t,e,n){e.video&&Xo(t,e.video),e.audio&&Xo(t,e.audio);var i=sa(t.a);e!=an(ua(t.a),ca(t.a),i?i.variants:[])&&t.l.switchHistory.push({timestamp:Date.now()/1e3,id:e.id,type:"variant",fromAdaptation:n,bandwidth:e.bandwidth})}function Go(t,e,n){Xo(t,e),t.l.switchHistory.push({timestamp:Date.now()/1e3,id:e.id,type:"text",fromAdaptation:n,bandwidth:null})}function Xo(t,e){var n=un(t.b,e);t.I[n]||(t.I[n]={}),t.I[n][e.type]=e.id}function Yo(t){t.o&&(t.o.pa(t.f,"loadeddata"),t.o.pa(t.f,"playing"),t.o.pa(t.f,"pause"),t.o.pa(t.f,"ended"));var e=t.i,n=Promise.all([t.h?t.h.stop():null,t.j?t.j.destroy():null,t.g?t.g.destroy():null,t.A?t.A.destroy():null,t.a?t.a.destroy():null,t.m?t.m.stop():null,t.u?t.u.destroy():null]).then(function(){return e?e.destroy():null});return t.xa=!0,t.i=null,t.j=null,t.g=null,t.A=null,t.a=null,t.m=null,t.u=null,t.b=null,t.Cb=null,t.nb=[],t.I={},t.l=$o(),n}function zo(){return{".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",serverCertificate:new Uint8Array(0)}}}function Wo(t){var e=5e5,n=1/0;return navigator.connection&&navigator.connection.type&&(e=1e6*navigator.connection.downlink,navigator.connection.saveData&&(n=360)),{drm:{retryParameters:Y(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1},manifest:{retryParameters:Y(),availabilityWindowOverride:NaN,dash:{customScheme:function(t){if(t)return null},clockSyncUri:"",ignoreDrmInfo:!1,xlinkFailGracefully:!1,defaultPresentationDelay:10}},streaming:{retryParameters:Y(),failureCallback:t.kd.bind(t),rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,smallGapLimit:.5,jumpLargeGaps:!1,durationBackoff:1,forceTransmuxTS:!1},abrFactory:cn,textDisplayFactory:function(){return new Co(t.f)},abr:{enabled:!0,defaultBandwidthEstimate:e,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:n,minPixels:0,maxPixels:1/0,minBandwidth:0,maxBandwidth:1/0}},preferredAudioLanguage:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minBandwidth:0,maxBandwidth:1/0},playRangeStart:0,playRangeEnd:1/0}}function $o(){return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,estimatedBandwidth:NaN,loadLatency:NaN,playTime:0,bufferingTime:0,switchHistory:[],stateHistory:[]}}function Jo(t,e,n){t.xa?(t.S=e,t.kc=n||!1):pa(t.a,e,n||!1)}function Qo(t){if(t.b){var e=Date.now()/1e3;t.ob?t.l.bufferingTime+=e-t.kb:t.l.playTime+=e-t.kb,t.kb=e}}function Zo(t,e){function n(t,e){if(!t)return null;var n=t.findSegmentPosition(e-a.startTime);return null==n?null:(n=t.getSegmentReference(n))?n.startTime+a.startTime:null}var i=ua(t.a),r=ca(t.a),a=oa(t.a);return i=n(i,e),r=n(r,e),null!=r&&null!=i?Math.max(r,i):null!=r?r:null!=i?i:e}function ts(t,e){return e&&e.length?(t.h.setVariants(e),t.h.chooseVariant()):(t.Ta(new z(2,4,4012)),null)}function es(t,e){var n=Qe(e.variants,t.L,t.Ga,t.Y),i=en(e.textStreams,t.ga,t.Ua);(n=ts(t,n))&&(qo(t,n,!0),Jo(t,n,!0)),(i=i[0])&&(t.c.streaming.alwaysStreamText||t.Mb())&&(Go(t,i,!0),t.xa?t.G=i:ma(t.a,i,!0)),ns(t)}function ns(t){Promise.resolve().then(function(){this.wa||this.dispatchEvent(new At("adaptation"))}.bind(t))}function is(t){Promise.resolve().then(function(){this.wa||this.dispatchEvent(new At("trackschanged"))}.bind(t))}function rs(t){t.dispatchEvent(new At("texttrackvisibility"))}function as(t,e,n){var i=void 0==e.expiration?1/0:e.expiration,r=e.presentationTimeline.T();return e=Xe(e.periods[0]),{offlineUri:null,originalManifestUri:t,duration:r,size:0,expiration:i,tracks:e,appMetadata:n}}function os(t,e){var n=_o(new ko(t.fa(),t.N()),e.periods[0],new Oi(null,0)),i=e.appMetadata||{};return n=Xe(n),{offlineUri:t.toString(),originalManifestUri:e.originalManifestUri,duration:e.duration,size:e.size,expiration:e.expiration,tracks:n,appMetadata:i}}function ss(){this.a={}}function us(t,e,n){return n=n.endTime-n.startTime,cs(t,e)*n}function cs(t,e){var n=t.a[e];return null==n&&(n=0),n}function hs(t){if(!t||t.constructor!=Oo)throw new z(2,9,9008);this.a=t,this.b=ys(this),this.g=!1,this.c=null,this.f=[]}function ls(){return io()}function fs(t,e,n,i,r,a){var o,s=as(r,i,a),u=new Ka(function(e,n){s.size=n,t.b.progressCallback(s,e)});return ct([u],function(){return o=Ts(t,u,e,n,i,r,a),qa(u,t.a.s)}).then(function(){return o.size=s.size,o})}function ds(t,e,n){var i,r=new zt({$a:t.a.s,onError:function(t){6013!=t.code&&(i=t)},Ub:function(){},onExpirationUpdated:function(){},onEvent:function(){}});r.configure(t.a.getConfiguration().drm);var a=Ao(new ko(e.fa(),e.N()),n);return ct([r],function(){return c(function e(){return A(e,function(e){switch(e.w){case 1:return d(e,r.init(a,t.b.usePersistentLicense),2);case 2:return d(e,Wt(r,n.sessionIds),0)}})})}).then(function(){if(i)throw i})}function ps(t,e,n,i){function r(){s+=1,t.b.progressCallback(u,s/o)}var a=xs(i),o=a.length+1,s=0,u=os(n,i);return Promise.all([e.removeSegments(a,r),e.removeManifests([n.key()],r)])}function ms(t,e,n,i){function r(){}var a,o,s,u=t.a.s,c=t.a.getConfiguration();return Li(e,u,c.manifest.retryParameters,i).then(function(t){var i=this;As(this),o=new zt({$a:u,onError:n,Ub:r,onExpirationUpdated:function(){},onEvent:function(){}}),o.configure(c.drm);var a={networkingEngine:u,filterAllPeriods:function(t){gs(i,o,t)},filterNewPeriod:function(t){bs(i,o,t)},onTimelineRegionAdded:function(){},onEvent:function(){},onError:n};return s=new t,s.configure(c.manifest),s.start(e,a)}.bind(t)).then(function(t){return As(this),a=t,o.init(a,this.b.usePersistentLicense)}.bind(t)).then(function(){return As(this),ws(a)}.bind(t)).then(function(){return As(this),$t(o)}.bind(t)).then(function(){return As(this),s.stop()}.bind(t)).then(function(){return As(this),{manifest:a,Eb:o}}.bind(t)).catch(function(t){if(s)return s.stop().then(function(){throw t});throw t})}function vs(t,e){var n=[],i=Be(t),r=[0,vc,yc],a=e.filter(function(t){return"variant"==t.type});r=r.map(function(t){return a.filter(function(e){return e=Be(e.language),je(t,i,e)})});for(var o,s=0;s<r.length;s++)if(r[s].length){o=r[s];break}o||(r=a.filter(function(t){return t.primary}),r.length&&(o=r)),o||(o=a,a.map(function(t){return t.language}).filter(Rt));var u=o.filter(function(t){return t.height&&480>=t.height});return u.length&&(u.sort(function(t,e){return e.height-t.height}),o=u.filter(function(t){return t.height==u[0].height})),o.sort(function(t,e){return t.bandwidth-e.bandwidth}),o.length&&n.push(o[Math.floor(o.length/2)]),n.push.apply(n,e.filter(function(t){return"text"==t.type})),n}function ys(t){return{trackSelectionCallback:function(e){return vs(t.a.getConfiguration().preferredAudioLanguage,e)},progressCallback:function(t,e){if(t||e)return null},usePersistentLicense:!0}}function gs(t,e,n){n.forEach(function(n){return bs(t,e,n)})}function bs(t,e,n){var i=null;if(t.c){var r=t.c.filter(function(t){return"variant"==t.type})[0];r&&(i=We(n,r))}var a=r=null;i&&(i.audio&&(r=i.audio),i.video&&(a=i.video)),Ke(e,r,a,n),Ve(n,t.a.getConfiguration().restrictions,{width:1/0,height:1/0})}function ws(t){var e=t.periods.map(function(t){return t.variants}).reduce(It,[]).map(function(t){var e=[];return t.audio&&e.push(t.audio),t.video&&e.push(t.video),e}).reduce(It,[]).filter(Rt);return t=t.periods.map(function(t){return t.textStreams}).reduce(It,[]),e.push.apply(e,t),Promise.all(e.map(function(t){return t.createSegmentIndex()}))}function Ts(t,e,n,i,r,a,o){var s=new ss,u=r.periods.map(function(a){return Es(t,e,n,s,i,r,a)}),c=i.b,h=Qt(i);if(c&&t.b.usePersistentLicense){if(!h.length)throw new z(2,9,9007,a);c.initData=[]}return{originalManifestUri:a,duration:r.presentationTimeline.T(),size:0,expiration:i.vb(),periods:u,sessionIds:t.b.usePersistentLicense?h:[],drmInfo:c,appMetadata:o}}function Es(t,e,n,i,r,a,o){var s=Ye(o,null,null),u=ze(o,null);s=t.b.trackSelectionCallback(s.concat(u)),null==t.c&&(t.c=s,gs(t,r,a.periods)),Ps(s),a.periods.forEach(function(t){t.variants.forEach(function(t){var e=t.audio,n=t.video;if(e&&!n&&(i.a[e.id]=e.bandwidth||t.bandwidth),!e&&n&&(i.a[n.id]=n.bandwidth||t.bandwidth),e&&n){var r=e.bandwidth||393216,a=n.bandwidth||t.bandwidth-r;0>=a&&(a=t.bandwidth),i.a[e.id]=r,i.a[n.id]=a}}),t.textStreams.forEach(function(t){i.a[t.id]=52})});var c={};s.forEach(function(t){"variant"==t.type&&null!=t.audioId&&(c[t.audioId]=!0),"variant"==t.type&&null!=t.videoId&&(c[t.videoId]=!0),"text"==t.type&&(c[t.id]=!0)});var h={};return Rs(a).filter(function(t){return!!c[t.id]}).forEach(function(r){h[r.id]=Ss(t,e,n,i,a,r)}),s.forEach(function(t){"variant"==t.type&&null!=t.audioId&&h[t.audioId].variantIds.push(t.id),"variant"==t.type&&null!=t.videoId&&h[t.videoId].variantIds.push(t.id)}),{startTime:o.startTime,streams:$u.values(h)}}function Ss(t,e,n,i,r,a){var o={id:a.id,primary:a.primary,presentationTimeOffset:a.presentationTimeOffset||0,contentType:a.type,mimeType:a.mimeType,codecs:a.codecs,frameRate:a.frameRate,kind:a.kind,language:a.language,label:a.label,width:a.width||null,height:a.height||null,initSegmentKey:null,encrypted:a.encrypted,keyId:a.keyId,segments:[],variantIds:[]};r=r.presentationTimeline.Xa();var s=a.id;return ks(a,r,function(r){Ha(e,s,Is(t,r),us(i,a.id,r),function(e){return n.addSegments([{data:e}]).then(function(e){t.f.push(e[0]),o.segments.push({startTime:r.startTime,endTime:r.endTime,dataKey:e[0]})})})}),(r=a.initSegmentReference)&&Ha(e,s,Is(t,r),.5*cs(i,a.id),function(e){return n.addSegments([{data:e}]).then(function(e){t.f.push(e[0]),o.initSegmentKey=e[0]})}),o}function ks(t,e,n){e=t.findSegmentPosition(e);for(var i=null==e?null:t.getSegmentReference(e);i;)n(i),i=t.getSegmentReference(++e)}function As(t){if(!t.a)throw new z(2,9,7001)}function _s(){if(!io())throw new z(2,9,9e3)}function Is(t,e){var n=t.a.getConfiguration().streaming.retryParameters;return n=pt(e.c(),n),0==e.b&&null==e.a||(n.headers.Range="bytes="+e.b+"-"+(null==e.a?"":e.a)),n}function xs(t){var e=[];return t.periods.forEach(function(t){t.streams.forEach(function(t){null!=t.initSegmentKey&&e.push(t.initSegmentKey),t.segments.forEach(function(t){e.push(t.dataKey)})})}),e}function Ps(t){t.some(function(e){return t.some(function(t){return e!=t&&e.type==t.type&&e.kind==t.kind&&e.language==t.language})})}function Rs(t){var e={};return t.periods.forEach(function(t){t.textStreams.forEach(function(t){e[t.id]=t}),t.variants.forEach(function(t){t.audio&&(e[t.audio.id]=t.audio),t.video&&(e[t.video.id]=t.video)})}),$u.values(e)}function Ns(t,e){e=e||0;for(var n={priority:e,dd:t},i=0;i<Yc.length;i++)if(Yc[i].priority<e)return void Yc.splice(i,0,n);Yc.push(n)}function Ds(t){var e=t.type.replace(/^(webkit|moz|MS)/,"").toLowerCase();if("function"==typeof Event)var n=new Event(e,t);else n=document.createEvent("Event"),n.initEvent(e,t.bubbles,t.cancelable);t.target.dispatchEvent(n)}function Cs(t,e,n){if("input"==t)switch(this.type){case"range":t="change"}zc.call(this,t,e,n)}function Ms(){var t=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var e=t.apply(this,arguments);return e.abort=function(){},e}}function Ls(){var t=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(e,n){return t.call(this,e,n-.001)}}function Os(){var t=MediaSource.prototype.endOfStream;MediaSource.prototype.endOfStream=function(){for(var e=0,n=0;n<this.sourceBuffers.length;++n){var i=this.sourceBuffers[n];i=i.buffered.end(i.buffered.length-1),e=Math.max(e,i)}if(!isNaN(this.duration)&&e<this.duration)for(this.vc=!0,e=0;e<this.sourceBuffers.length;++e)this.sourceBuffers[e].qc=!1;return t.apply(this,arguments)};var e=!1,n=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var t=n.apply(this,arguments);return t.mediaSource_=this,t.addEventListener("updateend",Us,!1),e||(this.addEventListener("sourceclose",js,!1),e=!0),t}}function Us(t){var e=t.target,n=e.mediaSource_;if(n.vc){for(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.qc=!0,t=0;t<n.sourceBuffers.length;++t)if(0==n.sourceBuffers[t].qc)return;n.vc=!1}}function js(t){t=t.target;for(var e=0;e<t.sourceBuffers.length;++e)t.sourceBuffers[e].removeEventListener("updateend",Us,!1);t.removeEventListener("sourceclose",js,!1)}function Bs(){var t=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(e){return"mp2t"!=e.split(/ *; */)[0].split("/")[1]&&t(e)}}function Fs(){var t=MediaSource.isTypeSupported,e=/^dv(?:he|av)\./;MediaSource.isTypeSupported=function(n){for(var i=n.split(/ *; */),r=i[0],a={},o=1;o<i.length;++o){var s=i[o].split("="),u=s[0];s=s[1].replace(/"(.*)"/,"$1"),a[u]=s}if(!(i=a.codecs))return t(n);var c=!1,h=!1;n=i.split(",").filter(function(t){return e.test(t)?(h=!0,!1):(/^(hev|hvc)1\.2/.test(t)&&(c=!0),!0)}),h&&(c=!1),a.codecs=n.join(","),c&&(a.eotf="smpte2084");for(var l in a)r+="; "+l+'="'+a[l]+'"';return cast.__platform__.canDisplayType(r)}}function Vs(t){this.f=[],this.b=[],this.a=[],(new ii).Z("pssh",this.c.bind(this)).parse(t.buffer)}function Ks(t,e){try{var n=new Hs(t,e);return Promise.resolve(n)}catch(t){return Promise.reject(t)}}function Hs(t,e){this.keySystem=t;for(var n=!1,i=0;i<e.length;++i){var r=e[i],a={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:r.initDataTypes,sessionTypes:["temporary"],label:r.label},o=!1;if(r.audioCapabilities)for(var s=0;s<r.audioCapabilities.length;++s){var u=r.audioCapabilities[s];if(u.contentType){o=!0;var c=u.contentType.split(";")[0];MSMediaKeys.isTypeSupported(this.keySystem,c)&&(a.audioCapabilities.push(u),n=!0)}}if(r.videoCapabilities)for(s=0;s<r.videoCapabilities.length;++s)u=r.videoCapabilities[s],u.contentType&&(o=!0,c=u.contentType.split(";")[0],MSMediaKeys.isTypeSupported(this.keySystem,c)&&(a.videoCapabilities.push(u),n=!0));if(o||(n=MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),"required"==r.persistentState&&(n=!1),n)return void(this.a=a)}throw n=Error("Unsupported keySystem"),n.name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n}function qs(t){var e=this.mediaKeys;return e&&e!=t&&Xs(e,null),delete this.mediaKeys,(this.mediaKeys=t)?Xs(t,this):Promise.resolve()}function Gs(t){this.a=new MSMediaKeys(t),this.b=new wt}function Xs(t,e){function n(){e.msSetMediaKeys(i.a),e.removeEventListener("loadedmetadata",n)}if(St(t.b),!e)return Promise.resolve();Tt(t.b,e,"msneedkey",zs);var i=t;try{return 1<=e.readyState?e.msSetMediaKeys(t.a):e.addEventListener("loadedmetadata",n),Promise.resolve()}catch(t){return Promise.reject(t)}}function Ys(t){gn.call(this),this.c=null,this.g=t,this.b=this.a=null,this.f=new wt,this.sessionId="",this.expiration=NaN,this.closed=new q,this.keyStatuses=new Js}function zs(t){var e=document.createEvent("CustomEvent");if(e.initCustomEvent("encrypted",!1,!1,null),e.initDataType="cenc",t=t.initData){var n=new Vs(t);if(!(1>=n.a.length)){for(var i=[],r=0;r<n.a.length;r++)i.push(t.subarray(n.a[r].start,n.a[r].end+1));for(t=it(i,Ws),i=n=0;i<t.length;i++)n+=t[i].length;for(n=new Uint8Array(n),r=i=0;r<t.length;r++)n.set(t[r],i),i+=t[r].length;t=n}}e.initData=t,this.dispatchEvent(e)}function Ws(t,e){return Xt(t,e)}function $s(t,e){var n=t.keyStatuses;n.size=void 0==e?0:1,n.a=e,t.dispatchEvent(new At("keystatuseschange"))}function Js(){this.size=0,this.a=void 0}function Qs(){return Promise.reject(Error("The key system specified is not supported."))}function Zs(t){return null==t?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}function tu(){throw new TypeError("Illegal constructor.")}function eu(){throw new TypeError("Illegal constructor.")}function nu(t){var e=$c;return e?e+t.charAt(0).toUpperCase()+t.slice(1):t}function iu(t,e){try{var n=new au(t,e);return Promise.resolve(n)}catch(t){return Promise.reject(t)}}function ru(t){var e=this.mediaKeys;return e&&e!=t&&su(e,null),delete this.mediaKeys,(this.mediaKeys=t)&&su(t,this),Promise.resolve()}function au(t,e){this.a=this.keySystem=t;var n=!1;"org.w3.clearkey"==t&&(this.a="webkit-org.w3.clearkey",n=!1);var i=!1,r=document.getElementsByTagName("video");r=r.length?r[0]:document.createElement("video");for(var a=0;a<e.length;++a){var o=e[a],s={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:o.initDataTypes,sessionTypes:["temporary"],label:o.label},u=!1;if(o.audioCapabilities)for(var c=0;c<o.audioCapabilities.length;++c){var h=o.audioCapabilities[c];if(h.contentType){u=!0;var l=h.contentType.split(";")[0];r.canPlayType(l,this.a)&&(s.audioCapabilities.push(h),i=!0)}}if(o.videoCapabilities)for(c=0;c<o.videoCapabilities.length;++c)h=o.videoCapabilities[c],h.contentType&&(u=!0,r.canPlayType(h.contentType,this.a)&&(s.videoCapabilities.push(h),i=!0));if(u||(i=r.canPlayType("video/mp4",this.a)||r.canPlayType("video/webm",this.a)),"required"==o.persistentState&&(n?(s.persistentState="required",s.sessionTypes=["persistent-license"]):i=!1),i)return void(this.b=s)}throw n="Unsupported keySystem","org.w3.clearkey"!=t&&"com.widevine.alpha"!=t||(n="None of the requested configurations were supported."),n=Error(n),n.name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n}function ou(t){this.g=t,this.b=null,this.a=new wt,this.c=[],this.f={}}function su(t,e){t.b=e,St(t.a);var n=$c;e&&(Tt(t.a,e,n+"needkey",t.fe.bind(t)),Tt(t.a,e,n+"keymessage",t.ee.bind(t)),Tt(t.a,e,n+"keyadded",t.ce.bind(t)),Tt(t.a,e,n+"keyerror",t.de.bind(t)))}function uu(t,e){var n=t.f[e];return n||((n=t.c.shift())?(n.sessionId=e,t.f[e]=n):null)}function cu(t,e,n){gn.call(this),this.f=t,this.h=!1,this.a=this.b=null,this.c=e,this.g=n,this.sessionId="",this.expiration=NaN,this.closed=new q,this.keyStatuses=new fu}function hu(t,e,n){if(t.h)return Promise.reject(Error("The session is already initialized."));t.h=!0;try{if("persistent-license"==t.g)if(n)var i=new Uint8Array(Ut("LOAD_SESSION|"+n));else{var r=Ut("PERSISTENT|"),a=new Uint8Array(r.byteLength+e.byteLength);a.set(new Uint8Array(r),0),a.set(new Uint8Array(e),r.byteLength),i=a}else i=new Uint8Array(e)}catch(t){return Promise.reject(t)}t.b=new q;var o=nu("generateKeyRequest");try{t.f[o](t.c,i)}catch(e){if("InvalidStateError"!=e.name)return t.b=null,Promise.reject(e);setTimeout(function(){try{this.f[o](this.c,i)}catch(t){this.b.reject(t),this.b=null}}.bind(t),10)}return t.b}function lu(t,e){var n=t.keyStatuses;n.size=void 0==e?0:1,n.a=e,t.dispatchEvent(new At("keystatuseschange"))}function fu(){this.size=0,this.a=void 0}function du(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}function pu(e,n,i){return new t.TextTrackCue(e,n,i)}function mu(e,n,i){return new t.TextTrackCue(e+"-"+n+"-"+i,e,n,i)}function vu(){}function yu(t){var e=[];if(!t)return e;for(var n=t.childNodes,i=0;i<n.length;i++){var r="span"==n[i].nodeName&&"p"==t.nodeName;n[i].nodeType!=Node.ELEMENT_NODE||"br"==n[i].nodeName||r||(r=yu(n[i]),e=e.concat(r))}return e.length||e.push(t),e}function gu(t,e){for(var n=t.childNodes,i=0;i<n.length;i++)if("br"==n[i].nodeName&&0<i)n[i-1].textContent+="\n";else if(0<n[i].childNodes.length)gu(n[i],e);else if(e){var r=n[i].textContent.trim();r=r.replace(/\s+/g," "),n[i].textContent=r}}function bu(t,e,n,i,r,a,o){if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(t.textContent))return null;gu(t,o),o=_u(t.getAttribute("begin"),n);var s=_u(t.getAttribute("end"),n);n=_u(t.getAttribute("dur"),n);var u=t.textContent;if(null==s&&null!=n&&(s=o+n),null==o||null==s)throw new z(2,2,2001);if(e=new ye(o+e,s+e,u),(r=Au(t,"region",r))&&r.getAttribute("xml:id")){var c=r.getAttribute("xml:id");a=a.filter(function(t){return t.id==c}),e.region=a[0]}return wu(e,t,r,i),e}function wu(t,e,n,i){"rtl"==Eu(e,n,i,"direction")&&(t.writingDirection=1);var r=Eu(e,n,i,"writingMode");"tb"==r||"tblr"==r?t.writingDirection=2:"tbrl"==r?t.writingDirection=3:"rltb"==r||"rl"==r?t.writingDirection=1:r&&(t.writingDirection=oc),(r=Eu(e,n,i,"textAlign"))&&(t.positionAlign=uh[r],t.lineAlign=sh[r],t.textAlign=ic[r.toUpperCase()]),(r=Eu(e,n,i,"displayAlign"))&&(t.displayAlign=ac[r.toUpperCase()]),(r=Eu(e,n,i,"color"))&&(t.color=r),(r=Eu(e,n,i,"backgroundColor"))&&(t.backgroundColor=r),(r=Eu(e,n,i,"fontFamily"))&&(t.fontFamily=r),(r=Eu(e,n,i,"fontWeight"))&&"bold"==r&&(t.fontWeight=700),(r=Eu(e,n,i,"wrapOption"))&&"noWrap"==r&&(t.wrapLine=!1),(r=Eu(e,n,i,"lineHeight"))&&r.match(Zc)&&(t.lineHeight=r),(r=Eu(e,n,i,"fontSize"))&&r.match(Zc)&&(t.fontSize=r),(r=Eu(e,n,i,"fontStyle"))&&(t.fontStyle=fc[r.toUpperCase()]),(n=Su(n,i,"textDecoration"))&&Tu(t,n),(e=ku(e,i,"textDecoration"))&&Tu(t,e)}function Tu(t,e){for(var n=e.split(" "),i=0;i<n.length;i++)switch(n[i]){case"underline":0>t.textDecoration.indexOf("underline")&&t.textDecoration.push("underline");break;case"noUnderline":0<=t.textDecoration.indexOf("underline")&&at(t.textDecoration,"underline");break;case"lineThrough":0>t.textDecoration.indexOf("lineThrough")&&t.textDecoration.push("lineThrough");break;case"noLineThrough":0<=t.textDecoration.indexOf("lineThrough")&&at(t.textDecoration,"lineThrough");break;case"overline":0>t.textDecoration.indexOf("overline")&&t.textDecoration.push("overline");break;case"noOverline":0<=t.textDecoration.indexOf("overline")&&at(t.textDecoration,"overline")}}function Eu(t,e,n,i){return(t=ku(t,n,i))?t:Su(e,n,i)}function Su(t,e,n){for(var i=yu(t),r=0;r<i.length;r++){var a=Dn(i[r],"http://www.w3.org/ns/ttml#styling",n);if(a)return a}return(t=Au(t,"style",e))?Dn(t,"http://www.w3.org/ns/ttml#styling",n):null}function ku(t,e,n){return(t=Au(t,"style",e))?Dn(t,"http://www.w3.org/ns/ttml#styling",n):null}function Au(t,e,n){if(!t||1>n.length)return null;var i=null,r=t;for(t=null;r&&!(t=r.getAttribute(e))&&(r=r.parentNode)instanceof Element;);if(e=t)for(t=0;t<n.length;t++)if(n[t].getAttribute("xml:id")==e){i=n[t];break}return i}function _u(t,e){var n=null;if(eh.test(t)){n=eh.exec(t);var i=Number(n[1]),r=Number(n[2]),a=Number(n[3]),o=Number(n[4]);o+=(Number(n[5])||0)/e.b,a+=o/e.frameRate,n=a+60*r+3600*i}else nh.test(t)?n=Iu(nh,t):ih.test(t)?n=Iu(ih,t):rh.test(t)?(n=rh.exec(t),n=Number(n[1])/e.frameRate):ah.test(t)?(n=ah.exec(t),n=Number(n[1])/e.a):oh.test(t)&&(n=Iu(oh,t));return n}function Iu(t,e){var n=t.exec(e);return null==n||""==n[0]?null:(Number(n[4])||0)/1e3+(Number(n[3])||0)+60*(Number(n[2])||0)+3600*(Number(n[1])||0)}function xu(t,e,n,i){this.frameRate=Number(t)||30,this.b=Number(e)||1,this.a=Number(i),0==this.a&&(this.a=t?this.frameRate*this.b:1),n&&(t=/^(\d+) (\d+)$/g.exec(n))&&(this.frameRate*=t[1]/t[2])}function Pu(){this.a=new vu}function Ru(){}function Nu(t,e,n){var i;(i=/^align:(start|middle|center|end|left|right)$/.exec(e))?(e=i[1],t.textAlign="middle"==e?nc:ic[e.toUpperCase()]):(i=/^vertical:(lr|rl)$/.exec(e))?t.writingDirection="lr"==i[1]?2:3:(i=/^size:([\d.]+)%$/.exec(e))?t.size=Number(i[1]):(i=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(e))?(t.position=Number(i[1]),i[2]&&(e=i[2],t.positionAlign="line-left"==e||"start"==e?"line-left":"line-right"==e||"end"==e?"line-right":"center")):(i=/^region:(.*)$/.exec(e))?(e=Du(n,i[1]))&&(t.region=e):(n=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(e))?(t.lineInterpretation=1,t.line=Number(n[1]),n[2]&&(t.lineAlign=cc[n[2].toUpperCase()])):(n=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(e))&&(t.lineInterpretation=sc,t.line=Number(n[1]),n[2]&&(t.lineAlign=cc[n[2].toUpperCase()]))}function Du(t,e){var n=t.filter(function(t){return t.id==e});return n.length?n[0]:null}function Cu(t){if(null==(t=cr(t,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g)))return null;var e=Number(t[2]),n=Number(t[3]);return 59<e||59<n?null:Number(t[4])/1e3+n+60*e+3600*(Number(t[1])||0)}function Mu(){this.a=null}function Lu(t,e,n){var i,r,a;return(new ii).C("payl",oi(function(t){i=Mt(t)})).C("iden",oi(function(t){r=Mt(t)})).C("sttg",oi(function(t){a=Mt(t)})).parse(t),i?Ou(i,r,a,e,n):null}function Ou(t,e,n,i,r){if(t=new ye(i,r,t),e&&(t.id=e),n)for(e=new sr(n),n=hr(e);n;)Nu(t,n,[]),ur(e),n=hr(e);return t}var Uu,ju="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)},Bu=void 0!==t&&t===this?this:void 0!==e&&null!=e?e:this,Fu=function(){var t=0;return function(e){return"jscomp_symbol_"+(e||"")+t++}}();s("Promise",function(t){function e(t){this.b=0,this.g=void 0,this.a=[];var e=this.c();try{t(e.resolve,e.reject)}catch(t){e.reject(t)}}function n(){this.a=null}function i(t){return t instanceof e?t:new e(function(e){e(t)})}if(t)return t;n.prototype.b=function(t){null==this.a&&(this.a=[],this.f()),this.a.push(t)},n.prototype.f=function(){var t=this;this.c(function(){t.h()})};var r=Bu.setTimeout;n.prototype.c=function(t){r(t,0)},n.prototype.h=function(){for(;this.a&&this.a.length;){var t=this.a;this.a=[];for(var e=0;e<t.length;++e){var n=t[e];t[e]=null;try{n()}catch(t){this.g(t)}}}this.a=null},n.prototype.g=function(t){this.c(function(){throw t})},e.prototype.c=function(){function t(t){return function(i){n||(n=!0,t.call(e,i))}}var e=this,n=!1;return{resolve:t(this.m),reject:t(this.f)}},e.prototype.m=function(t){if(t===this)this.f(new TypeError("A Promise cannot resolve to itself"));else if(t instanceof e)this.o(t);else{t:switch(typeof t){case"object":var n=null!=t;break t;case"function":n=!0;break t;default:n=!1}n?this.l(t):this.h(t)}},e.prototype.l=function(t){var e=void 0;try{e=t.then}catch(t){return void this.f(t)}"function"==typeof e?this.s(e,t):this.h(t)},e.prototype.f=function(t){this.i(2,t)},e.prototype.h=function(t){this.i(1,t)},e.prototype.i=function(t,e){if(0!=this.b)throw Error("Cannot settle("+t+", "+e+"): Promise already settled in state"+this.b);this.b=t,this.g=e,this.j()},e.prototype.j=function(){if(null!=this.a){for(var t=0;t<this.a.length;++t)a.b(this.a[t]);this.a=null}};var a=new n;return e.prototype.o=function(t){var e=this.c();t.sb(e.resolve,e.reject)},e.prototype.s=function(t,e){var n=this.c();try{t.call(e,n.resolve,n.reject)}catch(t){n.reject(t)}},e.prototype.then=function(t,n){function i(t,e){return"function"==typeof t?function(e){try{r(t(e))}catch(t){a(t)}}:e}var r,a,o=new e(function(t,e){r=t,a=e});return this.sb(i(t,r),i(n,a)),o},e.prototype.catch=function(t){return this.then(void 0,t)},e.prototype.sb=function(t,e){function n(){switch(i.b){case 1:t(i.g);break;case 2:e(i.g);break;default:throw Error("Unexpected state: "+i.b)}}var i=this;null==this.a?a.b(n):this.a.push(n)},e.resolve=i,e.reject=function(t){return new e(function(e,n){n(t)})},e.race=function(t){return new e(function(e,n){for(var r=o(t),a=r.next();!a.done;a=r.next())i(a.value).sb(e,n)})},e.all=function(t){var n=o(t),r=n.next();return r.done?i([]):new e(function(t,e){var a=[],o=0;do{a.push(void 0),o++,i(r.value).sb(function(e){return function(n){a[e]=n,0==--o&&t(a)}}(a.length-1),e),r=n.next()}while(!r.done)})},e}),s("Promise.prototype.finally",function(t){return t||function(t){return this.then(function(e){return Promise.resolve(t()).then(function(){return e})},function(e){return Promise.resolve(t()).then(function(){throw e})})}}),h.prototype.h=function(t){this.K=t},h.prototype.return=function(t){this.a={return:t},this.w=this.b},h.prototype.V=function(t){this.w=t},s("WeakMap",function(t){function e(t){if(this.a=(u+=Math.random()+1).toString(),t){n(),i(),t=o(t);for(var e;!(e=t.next()).done;)e=e.value,this.set(e[0],e[1])}}function r(t){_(t,s)||ju(t,s,{value:{}})}function a(t){var e=Object[t];e&&(Object[t]=function(t){return r(t),e(t)})}if(function(){if(!t||!Object.seal)return!1;try{var e=Object.seal({}),n=Object.seal({}),i=new t([[e,2],[n,3]]);return 2==i.get(e)&&3==i.get(n)&&(i.delete(e),i.set(n,4),!i.has(e)&&4==i.get(n))}catch(t){return!1}}())return t;var s="$jscomp_hidden_"+Math.random();a("freeze"),a("preventExtensions"),a("seal");var u=0;return e.prototype.set=function(t,e){if(r(t),!_(t,s))throw Error("WeakMap key fail: "+t);return t[s][this.a]=e,this},e.prototype.get=function(t){return _(t,s)?t[s][this.a]:void 0},e.prototype.has=function(t){return _(t,s)&&_(t[s],this.a)},e.prototype.delete=function(t){return!(!_(t,s)||!_(t[s],this.a))&&delete t[s][this.a]},e}),s("Map",function(t){function e(){var t={};return t.oa=t.next=t.head=t}function r(t,e){var n=t.a;return a(function(){if(n){for(;n.head!=t.a;)n=n.oa;for(;n.next!=n.head;)return n=n.next,{done:!1,value:e(n)};n=null}return{done:!0,value:void 0}})}function s(t,e){var n=e&&typeof e;"object"==n||"function"==n?c.has(e)?n=c.get(e):(n=""+ ++h,c.set(e,n)):n="p_"+e;var i=t.b[n];if(i&&_(t.b,n))for(var r=0;r<i.length;r++){var a=i[r];if(e!==e&&a.key!==a.key||e===a.key)return{id:n,list:i,index:r,O:a}}return{id:n,list:i,index:-1,O:void 0}}function u(t){if(this.b={},this.a=e(),this.size=0,t){t=o(t);for(var n;!(n=t.next()).done;)n=n.value,this.set(n[0],n[1])}}if(function(){if(!t||"function"!=typeof t||!t.prototype.entries||"function"!=typeof Object.seal)return!1;try{var e=Object.seal({x:4}),n=new t(o([[e,"s"]]));if("s"!=n.get(e)||1!=n.size||n.get({x:4})||n.set({x:4},"t")!=n||2!=n.size)return!1;var i=n.entries(),r=i.next();return!r.done&&r.value[0]==e&&"s"==r.value[1]&&(r=i.next(),!(r.done||4!=r.value[0].x||"t"!=r.value[1]||!i.next().done))}catch(t){return!1}}())return t;n(),i();var c=new WeakMap;u.prototype.set=function(t,e){var n=s(this,t);return n.list||(n.list=this.b[n.id]=[]),n.O?n.O.value=e:(n.O={next:this.a,oa:this.a.oa,head:this.a,key:t,value:e},n.list.push(n.O),this.a.oa.next=n.O,this.a.oa=n.O,this.size++),this},u.prototype.delete=function(t){return t=s(this,t),!(!t.O||!t.list)&&(t.list.splice(t.index,1),t.list.length||delete this.b[t.id],t.O.oa.next=t.O.next,t.O.next.oa=t.O.oa,t.O.head=null,this.size--,!0)},u.prototype.clear=function(){this.b={},this.a=this.a.oa=e(),this.size=0},u.prototype.has=function(t){return!!s(this,t).O},u.prototype.get=function(t){return(t=s(this,t).O)&&t.value},u.prototype.entries=function(){return r(this,function(t){return[t.key,t.value]})},u.prototype.keys=function(){return r(this,function(t){return t.key})},u.prototype.values=function(){return r(this,function(t){return t.value})},u.prototype.forEach=function(t,e){for(var n,i=this.entries();!(n=i.next()).done;)n=n.value,t.call(e,n[1],n[0],this)},u.prototype[Symbol.iterator]=u.prototype.entries;var h=0;return u}),s("Array.prototype.find",function(t){return t||function(t,e){t:{var n=this;n instanceof String&&(n=String(n));for(var i=n.length,r=0;r<i;r++){var a=n[r];if(t.call(e,a,r,n)){n=a;break t}}n=void 0}return n}}),s("Object.values",function(t){return t||function(t){var e,n=[];for(e in t)_(t,e)&&n.push(t[e]);return n}}),s("Object.is",function(t){return t||function(t,e){return t===e?0!==t||1/t==1/e:t!==t&&e!==e}}),s("Array.prototype.includes",function(t){return t||function(t,e){var n=this;n instanceof String&&(n=String(n));var i=n.length,r=e||0;for(0>r&&(r=Math.max(r+i,0));r<i;r++){var a=n[r];if(a===t||Object.is(a,t))return!0}return!1}}),s("String.prototype.includes",function(t){return t||function(t,e){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(t,e||0)}});var Vu=this;Vu.a=!0,D.prototype.getBandwidthEstimate=function(t){return 128e3>this.a?t:Math.min(N(this.b),N(this.c))},t.console&&t.console.log.bind&&(C=console.warn.bind(console));var Ku=/^(?:([^:\/?#.]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/#?]*?)(?::([0-9]+))?(?=[\/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;Uu=L.prototype,Uu.ia="",Uu.Fa="",Uu.la="",Uu.Qa=null,Uu.aa="",Uu.za="",Uu.toString=function(){var t=[],e=this.ia;if(e&&t.push(F(e,Hu,!0),":"),e=this.la){t.push("//");var n=this.Fa;n&&t.push(F(n,Hu,!0),"@"),t.push(encodeURIComponent(e).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e=this.Qa,null!=e&&t.push(":",String(e))}return(e=this.aa)&&(this.la&&"/"!=e.charAt(0)&&t.push("/"),t.push(F(e,"/"==e.charAt(0)?Gu:qu,!0))),(e=this.a.toString())&&t.push("?",e),(e=this.za)&&t.push("#",F(e,Yu)),t.join("")},Uu.resolve=function(t){var e=new L(this);"data"===e.ia&&(e=new L);var n=!!t.ia;n?O(e,t.ia):n=!!t.Fa,n?e.Fa=t.Fa:n=!!t.la,n?e.la=t.la:n=null!=t.Qa;var i=t.aa;if(n)U(e,t.Qa);else if(n=!!t.aa){if("/"!=i.charAt(0))if(this.la&&!this.aa)i="/"+i;else{var r=e.aa.lastIndexOf("/");-1!=r&&(i=e.aa.substr(0,r+1)+i)}if(".."==i||"."==i)i="";else if(-1!=i.indexOf("./")||-1!=i.indexOf("/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var a=[],o=0;o<i.length;){var s=i[o++];"."==s?r&&o==i.length&&a.push(""):".."==s?((1<a.length||1==a.length&&""!=a[0])&&a.pop(),r&&o==i.length&&a.push("")):(a.push(s),r=!0)}i=a.join("/")}}return n?e.aa=i:n=""!==t.a.toString(),n?j(e,H(t.a)):n=!!t.za,n&&(e.za=t.za),e};var Hu=/[#\/\?@]/g,qu=/[#\?:]/g,Gu=/[#\?]/g,Xu=/[#\?@]/g,Yu=/#/g;K.prototype.a=null,K.prototype.c=null,K.prototype.add=function(t,e){if(!this.a&&(this.a={},this.c=0,this.b))for(var n=this.b.split("&"),i=0;i<n.length;i++){var r=n[i].indexOf("="),a=null;if(0<=r){var o=n[i].substring(0,r);a=n[i].substring(r+1)}else o=n[i];o=decodeURIComponent(o.replace(/\+/g," ")),a=a||"",this.add(o,decodeURIComponent(a.replace(/\+/g," ")))}return this.b=null,(n=this.a.hasOwnProperty(t)&&this.a[t])||(this.a[t]=n=[]),n.push(e),this.c++,this},K.prototype.toString=function(){if(this.b)return this.b;if(!this.a)return"";var t,e=[];for(t in this.a)for(var n=encodeURIComponent(t),i=this.a[t],r=0;r<i.length;r++){var a=n;""!==i[r]&&(a+="="+encodeURIComponent(i[r])),e.push(a)}return this.b=e.join("&")},q.prototype.resolve=function(){},q.prototype.reject=function(){},I("shaka.util.Error",z),z.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},z.Severity={RECOVERABLE:1,CRITICAL:2},z.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9},z.Code={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,INVALID_TEXT_HEADER:2e3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,BUFFER_READ_OUT_OF_BOUNDS:3e3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,UNABLE_TO_GUESS_MANIFEST_TYPE:4e3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_COULD_NOT_GUESS_MIME_TYPE:4021,HLS_MASTER_PLAYLIST_NOT_PROVIDED:4022,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,HLS_COULD_NOT_PARSE_SEGMENT_START_TIME:4030,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,INVALID_STREAMS_CHOSEN:5005,NO_RECOGNIZED_KEY_SYSTEMS:6e3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,LOAD_INTERRUPTED:7e3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,CAST_API_UNAVAILABLE:8e3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9e3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,STORE_ALREADY_IN_PROGRESS:9006,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013},I("shaka.util.AbortableOperation",W),W.failed=$,W.aborted=J,W.completed=Q,W.notAbortable=Z,W.prototype.abort=function(){return this.a=!0,this.b()},W.prototype.abort=W.prototype.abort,W.all=tt,W.prototype.finally=function(t){return this.promise.then(function(){return t(!0)},function(){return t(!1)}),this},W.prototype.finally=W.prototype.finally,W.prototype.X=function(t,e){function n(){return r.reject(new z(2,7,7001)),i.abort()}var i=this,r=new q;return this.promise.then(function(e){i.a?r.reject(new z(2,7,7001)):t?n=et(t,e,r):r.resolve(e)},function(t){e?n=et(e,t,r):r.reject(t)}),new W(r,function(){return n()})},W.prototype.chain=W.prototype.X,ht.prototype.destroy=function(){var t=[];return this.a.forEach(function(e){e.promise.catch(function(){}),t.push(e.abort())}),this.a=[],Promise.all(t)},I("shaka.net.NetworkingEngine",ft),ft.RequestType={MANIFEST:0,SEGMENT:1,LICENSE:2,APP:3},ft.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:3};var zu={};ft.registerScheme=dt,ft.unregisterScheme=function(t){delete zu[t]},ft.prototype.pe=function(t){this.a.push(t)},ft.prototype.registerRequestFilter=ft.prototype.pe,ft.prototype.Ue=function(t){at(this.a,t)},ft.prototype.unregisterRequestFilter=ft.prototype.Ue,ft.prototype.hd=function(){this.a=[]},ft.prototype.clearAllRequestFilters=ft.prototype.hd,ft.prototype.qe=function(t){this.b.push(t)},ft.prototype.registerResponseFilter=ft.prototype.qe,ft.prototype.Ve=function(t){at(this.b,t)},ft.prototype.unregisterResponseFilter=ft.prototype.Ve,ft.prototype.jd=function(){this.b=[]},ft.prototype.clearAllResponseFilters=ft.prototype.jd,ft.prototype.destroy=function(){return this.c=!0,this.a=[],this.b=[],this.g.destroy()},ft.prototype.destroy=ft.prototype.destroy,ft.prototype.request=function(t,e){var n=this;if(this.c)return mt(J());e.method=e.method||"GET",e.headers=e.headers||{},e.retryParameters=e.retryParameters?ut(e.retryParameters):Y(),e.uris=ut(e.uris);var i=vt(this,t,e),r=i.X(function(){return yt(n,t,e,new G(e.retryParameters,!1),0,null)}),a=r.X(function(e){return gt(n,t,e)}),o=Date.now(),s=0;i.promise.then(function(){s=Date.now()-o},function(){});var u=0;return r.promise.then(function(){u=Date.now()},function(){}),i=a.X(function(e){var i=Date.now()-u;return e.timeMs+=s,e.timeMs+=i,n.f&&!e.fromCache&&1==t&&n.f(e.timeMs,e.data.byteLength),e},function(t){throw t&&(t.severity=2),t}),lt(this.g,i),mt(i)},ft.prototype.request=ft.prototype.request,bt.prototype.push=function(t,e){this.a.hasOwnProperty(t)?this.a[t].push(e):this.a[t]=[e]},bt.prototype.get=function(t){return(t=this.a[t])?t.slice():null},bt.prototype.remove=function(t,e){var n=this.a[t];if(n)for(var i=0;i<n.length;++i)n[i]==e&&(n.splice(i,1),--i)},wt.prototype.destroy=function(){return St(this),this.a=null,Promise.resolve()},wt.prototype.pa=function(t,e){if(this.a)for(var n=this.a.get(e)||[],i=0;i<n.length;++i){var r=n[i];r.target==t&&(r.pa(),this.a.remove(e,r))}},kt.prototype.pa=function(){this.target.removeEventListener(this.type,this.a,!1),this.a=this.target=null},At.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},At.prototype.stopImmediatePropagation=function(){this.a=!0},At.prototype.stopPropagation=function(){};var Wu=1/15,$u={empty:function(t){return!t||0==Object.keys(t).length},values:function(t){return Object.keys(t).map(function(e){return t[e]})},map:function(t,e){return Object.keys(t).reduce(function(n,i){return n[i]=e(t[i],i),n},{})},every:function(t,e){return Object.keys(t).every(function(n){return e(n,t[n])})},forEach:function(t,e){Object.keys(t).forEach(function(n){e(n,t[n])})},df:function(t){var e=new Map;return Object.keys(t).forEach(function(n){e.set(n,t[n])}),e},ef:function(t){var e={};return t.forEach(function(t,n){e[n]=t}),e}},Ju={codecs:"codecs",frameRate:"framerate",bandwidth:"bitrate",width:"width",height:"height",channelsCount:"channels"};I("shaka.util.StringUtils.fromUTF8",Mt),I("shaka.util.StringUtils.fromUTF16",Lt),I("shaka.util.StringUtils.fromBytesAutoDetect",Ot),I("shaka.util.StringUtils.toUTF8",Ut),Bt.prototype.cancel=function(){null!=this.a&&(clearTimeout(this.a),this.a=null)},I("shaka.util.Uint8ArrayUtils.toBase64",Kt),I("shaka.util.Uint8ArrayUtils.fromBase64",Ht),I("shaka.util.Uint8ArrayUtils.fromHex",qt),I("shaka.util.Uint8ArrayUtils.toHex",Gt),I("shaka.util.Uint8ArrayUtils.equal",Xt),I("shaka.util.Uint8ArrayUtils.concat",Yt),Uu=zt.prototype,Uu.destroy=function(){this.c=!0;var t=[];return this.a.forEach(function(e){e=e.ja.close().catch(xt);var n=new Promise(function(t){setTimeout(t,1e3*Qu)});t.push(Promise.race([e,n]))}),this.i.reject(),this.g&&t.push(this.g.destroy()),this.l&&t.push(this.l.setMediaKeys(null).catch(xt)),this.A&&(this.A.cancel(),this.A=null),this.G&&(this.G.cancel(),this.G=null),this.g=this.l=this.j=this.u=this.b=null,this.a=[],this.o=[],this.s=this.h=this.f=null,Promise.all(t)},Uu.configure=function(t){this.f=t},Uu.init=function(t,e){var n={},i=[],r=t.periods.some(function(t){return t.variants.some(function(t){return t.drmInfos.length})});return this.ga=e,this.o=t.offlineSessionIds,Zt(this,t,e||0<t.offlineSessionIds.length,n,i),i.length?te(this,n,i,r):(this.L=!0,Promise.resolve())},Uu.rb=function(t){if(!this.j)return Et(this.g,t,"encrypted",function(){this.h(new z(2,6,6010))}.bind(this)),Promise.resolve();this.l=t,Et(this.g,this.l,"play",this.Td.bind(this)),t=this.l.setMediaKeys(this.j),t=t.catch(function(t){return Promise.reject(new z(2,6,6003,t.message))});var e=null;return this.b.serverCertificate&&this.b.serverCertificate.length&&(e=this.j.setServerCertificate(this.b.serverCertificate).then(function(){}).catch(function(t){return Promise.reject(new z(2,6,6004,t.message))})),Promise.all([t,e]).then(function(){var t=this;if(this.c)return Promise.reject();$t(this),this.b.initData.length||this.o.length||Tt(this.g,this.l,"encrypted",function(e){return Jt(t,e.initDataType,new Uint8Array(e.initData))})}.bind(this)).catch(function(t){return this.c?Promise.resolve():Promise.reject(t)}.bind(this))},Uu.keySystem=function(){return this.b?this.b.keySystem:""},Uu.vb=function(){var t=this.a.map(function(t){return t=t.ja.expiration,isNaN(t)?1/0:t});return Math.min.apply(Math,t)},Uu.Ic=function(t){this.f.delayLicenseRequestUntilPlayed&&this.l.paused&&!this.Y?this.I.push(t):ue(this,t)},Uu.Ec=function(t){t=t.target;var e;for(e=0;e<this.a.length&&this.a[e].ja!=t;++e);if(e!=this.a.length){var n=!1;t.keyStatuses.forEach(function(t,i){if("string"==typeof i){var r=i;i=t,t=r}if("com.microsoft.playready"==this.b.keySystem&&16==i.byteLength){r=new DataView(i);var a=r.getUint32(0,!0),o=r.getUint16(4,!0),s=r.getUint16(6,!0);r.setUint32(0,a,!1),r.setUint16(4,o,!1),r.setUint16(6,s,!1)}"com.microsoft.playready"==this.b.keySystem&&"status-pending"==t&&(t="usable"),"status-pending"!=t&&(this.a[e].loaded=!0),"expired"==t&&(n=!0),r=Gt(new Uint8Array(i)),this.S[r]=t}.bind(this));var i=t.expiration-Date.now();(0>i||n&&1e3>i)&&!this.a[e].qa&&(this.a.splice(e,1),t.close().catch(function(){})),this.a.every(function(t){return t.loaded})&&(this.i.resolve(),Ft(this.G))}},Uu.oe=function(){function t(t,e){return"expired"==e}this.m={};for(var e in this.S)this.m[e]=this.S[e];!$u.empty(this.m)&&$u.every(this.m,t)&&this.h(new z(2,6,6014)),this.s.Ub(this.m)},Uu.Td=function(){for(var t=0;t<this.I.length;t++)ue(this,this.I[t]);this.Y=!0,this.I=[]},Uu.ne=function(){this.a.forEach(function(t){var e=t.Tb,n=t.ja.expiration;isNaN(n)&&(n=1/0),n!=e&&(this.s.onExpirationUpdated(t.ja.sessionId,n),t.Tb=n)}.bind(this))};var Qu=1,Zu=5,tc=.5;I("shaka.text.Cue",ye);var ec="auto";ye.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:ec};var nc="center",ic={LEFT:"left",RIGHT:"right",CENTER:nc,START:"start",END:"end"};ye.textAlign=ic;var rc="before",ac={BEFORE:rc,CENTER:"center",AFTER:"after"};ye.displayAlign=ac;var oc=0;ye.writingDirection={HORIZONTAL_LEFT_TO_RIGHT:oc,HORIZONTAL_RIGHT_TO_LEFT:1,VERTICAL_LEFT_TO_RIGHT:2,VERTICAL_RIGHT_TO_LEFT:3};var sc=0;ye.lineInterpretation={LINE_NUMBER:sc,PERCENTAGE:1};var uc="center",cc={CENTER:uc,START:"start",END:"end"};ye.lineAlign=cc;var hc=400;ye.fontWeight={NORMAL:hc,BOLD:700};var lc="normal",fc={NORMAL:lc,ITALIC:"italic",OBLIQUE:"oblique"};ye.fontStyle=fc,ye.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"},I("shaka.text.CueRegion",ge);var dc=1;ge.units={PX:0,PERCENTAGE:dc,LINES:2};var pc="";ge.scrollMode={NONE:pc,UP:"up"},be.prototype.destroy=function(){return this.a.dispose(),this.a=null,Promise.resolve()},be.prototype.i=function(t){for(var e=0;e<t.captions.length;e++){var n=t.captions[e];this.c.push(new ye(n.startTime,n.endTime,n.text))}e=new Uint8Array(t.data.byteLength+t.initSegment.byteLength),e.set(t.initSegment,0),e.set(t.data,t.initSegment.byteLength),this.g.push(e)},be.prototype.h=function(){var t={data:Yt.apply(null,this.g),cues:this.c};this.b.resolve(t),this.f=!1};var mc={};I("shaka.text.TextEngine.registerParser",function(t,e){mc[t]=e}),I("shaka.text.TextEngine.unregisterParser",function(t){delete mc[t]}),Se.prototype.destroy=function(){return this.c=this.f=null,Promise.resolve()},Se.prototype.Ee=function(t){this.c=t},Se.prototype.setDisplayer=Se.prototype.Ee,Se.prototype.Kb=function(t){var e={periodStart:0,segmentStart:null,segmentEnd:0};try{return this.f.parseMedia(new Uint8Array(t),e)[0].startTime}catch(t){throw new z(2,2,2009,t)}},Se.prototype.remove=function(t,e){return Promise.resolve().then(function(){!this.c||!this.c.remove(t,e)||null==this.a||e<=this.a||t>=this.b||(t<=this.a&&e>=this.b?this.a=this.b=null:t<=this.a&&e<this.b?this.a=e:t>this.a&&e>=this.b&&(this.b=t))}.bind(this))},Se.prototype.lc=function(t){this.c.append(t)},Se.prototype.appendCues=Se.prototype.lc,Uu=Ae.prototype,Uu.destroy=function(){this.m=!0;var t,e=[];for(t in this.c){var n=this.c[t],i=n[0];for(this.c[t]=n.slice(0,1),i&&e.push(i.p.catch(xt)),i=1;i<n.length;++i)n[i].p.catch(xt),n[i].p.reject()}this.a&&e.push(this.a.destroy());for(var r in this.i)e.push(this.i[r].destroy());return Promise.all(e).then(function(){var t=this.h?this.h.destroy():null;return this.f&&(this.f.removeAttribute("src"),this.f.load()),this.o=this.a=this.g=this.f=this.h=null,this.b={},this.i={},this.c={},t}.bind(this))},Uu.init=function(t,e){var n=this;return this.j.then(function(){for(var i in t){var r=t[i];r=Ct(r.mimeType,r.codecs),"text"==i?Ie(n,r):(!e&&MediaSource.isTypeSupported(r)||!we(r,i)||(n.i[i]=new be,r=Te(i,r)),r=n.g.addSourceBuffer(r),Tt(n.h,r,"error",n.Qe.bind(n,i)),Tt(n.h,r,"updateend",n.Oa.bind(n,i)),n.b[i]=r,n.c[i]=[])}})},Uu.Gb=function(){var t=this.a&&null!=this.a.a?[{start:this.a.a,end:this.a.b}]:[];return{total:ve(this.f.buffered),audio:ve(Ne(this,"audio")),video:ve(Ne(this,"video")),text:t}},Uu.remove=function(t,e,n){return"text"==t?this.a.remove(e,n):Le(this,t,this.Wc.bind(this,t,e,n))},Uu.flush=function(t){return"text"==t?Promise.resolve():Le(this,t,this.md.bind(this,t))},Uu.endOfStream=function(t){return Oe(this,function(){t?this.g.endOfStream(t):this.g.endOfStream()}.bind(this))},Uu.ka=function(t){return Oe(this,function(){this.g.duration=t}.bind(this))},Uu.T=function(){return this.g.duration},Uu.Vc=function(t,e){this.b[t].appendBuffer(e)},Uu.Wc=function(t,e,n){n<=e?this.Oa(t):this.b[t].remove(e,n)},Uu.cd=function(t){var e=this.b[t].appendWindowStart,n=this.b[t].appendWindowEnd;this.b[t].abort(),this.b[t].appendWindowStart=e,this.b[t].appendWindowEnd=n,this.Oa(t)},Uu.md=function(t){this.f.currentTime-=.001,this.Oa(t)},Uu.Ge=function(t,e){0>e&&(e+=.001),this.b[t].timestampOffset=e,this.Oa(t)},Uu.De=function(t,e,n){this.b[t].appendWindowStart=0,this.b[t].appendWindowEnd=n,this.b[t].appendWindowStart=e,this.Oa(t)},Uu.Qe=function(t){this.c[t][0].p.reject(new z(2,3,3014,this.f.error?this.f.error.code:0))},Uu.Oa=function(t){var e=this.c[t][0];e&&(e.p.resolve(),Ue(this,t))};var vc=1,yc=2,gc={aar:"aa",abk:"ab",afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arg:"an",arm:"hy",asm:"as",ava:"av",ave:"ae",aym:"ay",aze:"az",bak:"ba",bam:"bm",baq:"eu",bel:"be",ben:"bn",bih:"bh",bis:"bi",bod:"bo",bos:"bs",bre:"br",bul:"bg",bur:"my",cat:"ca",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cor:"kw",cos:"co",cre:"cr",cym:"cy",cze:"cs",dan:"da",deu:"de",div:"dv",dut:"nl",dzo:"dz",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fij:"fj",fin:"fi",fra:"fr",fre:"fr",fry:"fy",ful:"ff",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",glv:"gv",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",heb:"he",her:"hz",hin:"hi",hmo:"ho",hrv:"hr",hun:"hu",hye:"hy",ibo:"ig",ice:"is",ido:"io",iii:"ii",iku:"iu",ile:"ie",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",jav:"jv",jpn:"ja",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",khm:"km",kik:"ki",kin:"rw",kir:"ky",kom:"kv",kon:"kg",kor:"ko",kua:"kj",kur:"ku",lao:"lo",lat:"la",lav:"lv",lim:"li",lin:"ln",lit:"lt",ltz:"lb",lub:"lu",lug:"lg",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",mkd:"mk",mlg:"mg",mlt:"mt",mon:"mn",mri:"mi",msa:"ms",mya:"my",nau:"na",nav:"nv",nbl:"nr",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nno:"nn",nob:"nb",nor:"no",nya:"ny",oci:"oc",oji:"oj",ori:"or",orm:"om",oss:"os",pan:"pa",per:"fa",pli:"pi",pol:"pl",por:"pt",pus:"ps",que:"qu",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sin:"si",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",sqi:"sq",srd:"sc",srp:"sr",ssw:"ss",sun:"su",swa:"sw",swe:"sv",tah:"ty",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tgl:"tl",tha:"th",tib:"bo",tir:"ti",ton:"to",tsn:"tn",tso:"ts",tuk:"tk",tur:"tr",twi:"tw",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",zho:"zh",zul:"zu"};I("shaka.abr.SimpleAbrManager",cn),cn.prototype.stop=function(){this.h=null,this.f=!1,this.c=[],this.g=null},cn.prototype.stop=cn.prototype.stop,cn.prototype.init=function(t){this.h=t},cn.prototype.init=cn.prototype.init,cn.prototype.chooseVariant=function(){var t=hn(this.a.restrictions,this.c),e=this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate);this.c.length&&!t.length&&(t=hn(null,this.c),t=[t[0]]);for(var n=t[0]||null,i=0;i<t.length;++i){var r=t[i],a=(t[i+1]||{bandwidth:1/0}).bandwidth/this.a.bandwidthUpgradeTarget;e>=r.bandwidth/this.a.bandwidthDowngradeTarget&&e<=a&&(n=r)}return this.g=Date.now(),n},cn.prototype.chooseVariant=cn.prototype.chooseVariant,cn.prototype.enable=function(){this.f=!0},cn.prototype.enable=cn.prototype.enable,cn.prototype.disable=function(){this.f=!1},cn.prototype.disable=cn.prototype.disable,cn.prototype.segmentDownloaded=function(t,e){var n=this.b;if(!(16e3>e)){var i=8e3*e/t,r=t/1e3;n.a+=e,R(n.b,r,i),R(n.c,r,i)}if(null!=this.g&&this.f)t:{if(this.i){if(Date.now()-this.g<1e3*this.a.switchInterval)break t}else{if(!(128e3<=this.b.a))break t;this.i=!0}n=this.chooseVariant(),this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate),this.h(n)}},cn.prototype.segmentDownloaded=cn.prototype.segmentDownloaded,cn.prototype.getBandwidthEstimate=function(){return this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate)},cn.prototype.getBandwidthEstimate=cn.prototype.getBandwidthEstimate,cn.prototype.setVariants=function(t){this.c=t},cn.prototype.setVariants=cn.prototype.setVariants,cn.prototype.configure=function(t){this.a=t},cn.prototype.configure=cn.prototype.configure;var bc="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),wc="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),Tc=["loop","playbackRate"],Ec=["pause","play"],Sc="adaptation buffering emsg error loading streaming texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged unloading".split(" "),kc={getAudioLanguages:2,getAudioLanguagesAndRoles:2,getBufferedInfo:2,getConfiguration:2,getExpiration:2,getManifestUri:2,getPlaybackRate:2,getTextLanguages:2,getTextLanguagesAndRoles:2,getTextTracks:2,getStats:5,usingEmbeddedTextTrack:2,getVariantTracks:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1},Ac={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20},_c=[["getConfiguration","configure"]],Ic=[["isTextTrackVisible","setTextTrackVisibility"]],xc="addTextTrack cancelTrickPlay configure resetConfiguration retryStreaming selectAudioLanguage selectEmbeddedTextTrack selectTextLanguage selectTextTrack selectVariantTrack setTextTrackVisibility trickPlay".split(" "),Pc=["attach","detach","load","unload"],Rc=!1,Nc=null;Uu=pn.prototype,Uu.destroy=function(){return vn(this),Nc&&mn(this),this.G=this.A=this.g=null,this.b=this.h=!1,this.m=this.l=this.f=this.c=this.a=this.i=null,Promise.resolve()},Uu.$=function(){return this.b},Uu.Yb=function(){return this.u},Uu.init=function(){if(t.chrome&&chrome.cast&&chrome.cast.isAvailable){delete t.__onGCastApiAvailable,this.h=!0,this.g();var e=new chrome.cast.SessionRequest(this.I);e=new chrome.cast.ApiConfig(e,this.Dc.bind(this),this.Wd.bind(this),"origin_scoped"),chrome.cast.initialize(e,function(){},function(){}),Rc&&setTimeout(this.g.bind(this),20),(e=Nc)&&e.status!=chrome.cast.SessionStatus.STOPPED?this.Dc(e):Nc=null}else t.__onGCastApiAvailable=function(t){t&&this.init()}.bind(this)},Uu.bc=function(t){this.i=t,this.b&&yn({type:"appData",appData:this.i})},Uu.cast=function(t){return this.h?Rc?this.b?Promise.reject(new z(1,8,8002)):(this.f=new q,chrome.cast.requestSession(this.Vb.bind(this,t),this.Bc.bind(this)),this.f):Promise.reject(new z(1,8,8001)):Promise.reject(new z(1,8,8e3))},Uu.ub=function(){this.b&&(vn(this),Nc&&(mn(this),Nc.stop(function(){},function(){}),Nc=null))},Uu.get=function(t,e){if("video"==t){if(0<=Ec.indexOf(e))return this.Mc.bind(this,t,e)}else if("player"==t){if(Ac[e]&&!this.get("player","isLive")())return function(){};if(0<=xc.indexOf(e))return this.Mc.bind(this,t,e);if(0<=Pc.indexOf(e))return this.se.bind(this,t,e);if(kc[e])return this.Jc.bind(this,t,e)}return this.Jc(t,e)},Uu.set=function(t,e,n){this.a[t][e]=n,yn({type:"set",targetName:t,property:e,value:n})},Uu.Vb=function(t,e){Nc=e,e.addUpdateListener(this.l),e.addMessageListener("urn:x-cast:com.google.shaka.v2",this.m),this.Cc(),yn({type:"init",initState:t,appData:this.i}),this.f.resolve()},Uu.Bc=function(t){var e=8003;switch(t.code){case"cancel":e=8004;break;case"timeout":e=8005;break;case"receiver_unavailable":e=8006}this.f.reject(new z(2,8,e,t))},Uu.Jc=function(t,e){return this.a[t][e]},Uu.Mc=function(t,e){yn({type:"call",targetName:t,methodName:e,args:Array.prototype.slice.call(arguments,2)})},Uu.se=function(t,e){var n=Array.prototype.slice.call(arguments,2),i=new q,r=this.o.toString();return this.o++,this.c[r]=i,yn({type:"asyncCall",targetName:t,methodName:e,args:n,id:r}),i},Uu.Dc=function(t){var e=this.s();this.f=new q,this.j=!0,this.Vb(e,t)},Uu.Wd=function(t){Rc="available"==t,this.g()},Uu.Cc=function(){var t=!!Nc&&"connected"==Nc.status;if(this.b&&!t){this.G();for(var e in this.a)this.a[e]={};vn(this)}this.u=(this.b=t)?Nc.receiver.friendlyName:"",this.g()},Uu.Pd=function(t,e){var n=fn(e);switch(n.type){case"event":var i=n.event;this.A(n.targetName,new At(i.type,i));break;case"update":i=n.update;for(var r in i){n=this.a[r]||{};for(var a in i[r])n[a]=i[r][a]}this.j&&(this.L(),this.j=!1);break;case"asyncComplete":if(r=n.id,n=n.error,a=this.c[r],delete this.c[r],a)if(n){r=new z(n.severity,n.category,n.code);for(i in n)r[i]=n[i];a.reject(r)}else a.resolve()}},gn.prototype.addEventListener=function(t,e){this.Bb.push(t,e)},gn.prototype.removeEventListener=function(t,e){this.Bb.remove(t,e)},gn.prototype.dispatchEvent=function(t){for(var e=this.Bb.get(t.type)||[],n=0;n<e.length;++n){t.target=this.jb,t.currentTarget=this.jb;var i=e[n];try{i.handleEvent?i.handleEvent(t):i.call(this,t)}catch(t){}if(t.a)break}return t.defaultPrevented},x(bn,gn),I("shaka.cast.CastProxy",bn),bn.prototype.destroy=function(t){return t&&this.a&&this.a.ub(),t=[this.i?this.i.destroy():null,this.b?this.b.destroy():null,this.a?this.a.destroy():null],this.a=this.i=this.j=this.h=this.b=this.c=null,Promise.all(t)},bn.prototype.destroy=bn.prototype.destroy,bn.prototype.Bd=function(){return this.h},bn.prototype.getVideo=bn.prototype.Bd,bn.prototype.td=function(){return this.j},bn.prototype.getPlayer=bn.prototype.td,bn.prototype.ed=function(){return!!this.a&&(this.a.h&&Rc)},bn.prototype.canCast=bn.prototype.ed,bn.prototype.$=function(){return!!this.a&&this.a.$()},bn.prototype.isCasting=bn.prototype.$,bn.prototype.Yb=function(){return this.a?this.a.Yb():""},bn.prototype.receiverName=bn.prototype.Yb,bn.prototype.cast=function(){var t=this.tc();return this.a.cast(t).then(function(){if(this.b)return this.b.hb()}.bind(this))},bn.prototype.cast=bn.prototype.cast,bn.prototype.bc=function(t){this.a.bc(t)},bn.prototype.setAppData=bn.prototype.bc,bn.prototype.Se=function(){var t=this.a;if(t.b){var e=t.s();chrome.cast.requestSession(t.Vb.bind(t,e),t.Bc.bind(t))}},bn.prototype.suggestDisconnect=bn.prototype.Se,bn.prototype.ub=function(){this.a.ub()},bn.prototype.forceDisconnect=bn.prototype.ub,Uu=bn.prototype,Uu.tc=function(){var t={video:{},player:{},playerAfterLoad:{},manifest:this.b.Ib(),startTime:null};return this.c.pause(),Tc.forEach(function(e){t.video[e]=this.c[e]}.bind(this)),this.c.ended||(t.startTime=this.c.currentTime),_c.forEach(function(e){var n=e[1];e=this.b[e[0]](),t.player[n]=e}.bind(this)),Ic.forEach(function(e){var n=e[1];e=this.b[e[0]](),t.playerAfterLoad[n]=e}.bind(this)),t},Uu.Le=function(){this.dispatchEvent(new At("caststatuschanged"))},Uu.Me=function(){this.f.dispatchEvent(new At(this.h.paused?"pause":"play"))},Uu.Oe=function(){var t=this;_c.forEach(function(t){var e=t[1];t=this.a.get("player",t[0])(),this.b[e](t)}.bind(this));var e=this.a.get("player","getManifestUri")(),n=this.a.get("video","ended"),i=Promise.resolve(),r=this.c.autoplay,a=null;n||(a=this.a.get("video","currentTime")),e&&(this.c.autoplay=!1,i=this.b.load(e,a));var o={};Tc.forEach(function(t){o[t]=this.a.get("video",t)}.bind(this)),i.then(function(){t.c&&(Tc.forEach(function(t){this.c[t]=o[t]}.bind(t)),Ic.forEach(function(t){var e=t[1];t=this.a.get("player",t[0])(),this.b[e](t)}.bind(t)),t.c.autoplay=r,e&&t.c.play())},function(e){t.b.dispatchEvent(new At("error",{detail:e}))})},Uu.Ze=function(t){if("addEventListener"==t)return this.f.addEventListener.bind(this.f);if("removeEventListener"==t)return this.f.removeEventListener.bind(this.f);if(this.a.$()&&0==Object.keys(this.a.a.video).length){var e=this.c[t];if("function"!=typeof e)return e}return this.a.$()?this.a.get("video",t):(t=this.c[t],"function"==typeof t&&(t=t.bind(this.c)),t)},Uu.af=function(t,e){this.a.$()?this.a.set("video",t,e):this.c[t]=e},Uu.$e=function(t){this.a.$()||this.f.dispatchEvent(new At(t.type,t))},Uu.ke=function(t){if("addEventListener"==t)return this.g.addEventListener.bind(this.g);if("removeEventListener"==t)return this.g.removeEventListener.bind(this.g);if("getMediaElement"==t)return function(){return this.h}.bind(this);if("getNetworkingEngine"==t)return this.b.uc.bind(this.b);if(this.a.$()){if("getManifest"==t||"drmInfo"==t)return function(){return C(t+"() does not work while casting!"),null};if("attach"==t||"detach"==t)return function(){return C(t+"() does not work while casting!"),Promise.resolve()}}return this.a.$()&&0==Object.keys(this.a.a.video).length&&kc[t]||!this.a.$()?this.b[t].bind(this.b):this.a.get("player",t)},Uu.le=function(t){this.a.$()||this.g.dispatchEvent(t)},Uu.Ne=function(t,e){this.a.$()&&("video"==t?this.f.dispatchEvent(e):"player"==t&&this.g.dispatchEvent(e))},x(Tn,gn),I("shaka.cast.CastReceiver",Tn),Tn.prototype.isConnected=function(){return this.o},Tn.prototype.isConnected=Tn.prototype.isConnected,Tn.prototype.Ed=function(){return this.h},Tn.prototype.isIdle=Tn.prototype.Ed,Tn.prototype.destroy=function(){var e=[this.c?this.c.destroy():null,this.b?this.b.destroy():null];return null!=this.l&&t.clearTimeout(this.l),this.u=this.s=this.c=this.b=this.a=null,this.o=!1,this.h=!0,this.l=this.i=this.f=null,Promise.all(e).then(function(){cast.receiver.CastReceiverManager.getInstance().stop()})},Tn.prototype.destroy=Tn.prototype.destroy,Uu=Tn.prototype,Uu.Hc=function(){this.g=0,this.j=!0,this.o=0!=cast.receiver.CastReceiverManager.getInstance().getSenders().length,Sn(this)},Uu.Kc=function(t,e){this.b&&(this.Wb(),In(this,{type:"event",targetName:t,event:e},this.f))},Uu.Wb=function(){null!=this.l&&t.clearTimeout(this.l),this.l=t.setTimeout(this.Wb.bind(this),500);var e={video:{},player:{}};if(wc.forEach(function(t){e.video[t]=this.a[t]}.bind(this)),this.b.P())for(var n in Ac)0==this.g%Ac[n]&&(e.player[n]=this.b[n]());for(var i in kc)0==this.g%kc[i]&&(e.player[i]=this.b[i]());(n=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())&&(e.video.volume=n.level,e.video.muted=n.muted),this.m&&(this.g+=1),In(this,{type:"update",update:e},this.f),An(this)},Uu.ld=function(){var t=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();t&&In(this,{type:"update",update:{video:{volume:t.level,muted:t.muted}}},this.f),In(this,{type:"event",targetName:"video",event:{type:"volumechange"}},this.f)},Uu.Zd=function(t){var e=fn(t.data);switch(e.type){case"init":this.g=0,this.m=!1,this.j=!0,kn(this,e.initState,e.appData),this.Wb();break;case"appData":this.u(e.appData);break;case"set":var n=e.targetName,i=e.property;if(e=e.value,"video"==n){var r=cast.receiver.CastReceiverManager.getInstance();if("volume"==i){r.setSystemVolumeLevel(e);break}if("muted"==i){r.setSystemVolumeMuted(e);break}}this.s[n][i]=e;break;case"call":n=this.s[e.targetName],n[e.methodName].apply(n,e.args);break;case"asyncCall":n=e.targetName,i=e.methodName,"player"==n&&"load"==i&&(this.g=0,this.m=!1),r=e.id,t=t.senderId;var a=this.s[n];e=a[i].apply(a,e.args),"player"==n&&"load"==i&&(e=e.then(function(){this.j=!0}.bind(this))),e.then(this.Qc.bind(this,t,r,null),this.Qc.bind(this,t,r))}},Uu.Kd=function(t){var e=fn(t.data);switch(e.type){case"PLAY":this.a.play(),xn(this,0);break;case"PAUSE":this.a.pause(),xn(this,0);break;case"SEEK":t=e.currentTime;var n=e.resumeState;null!=t&&(this.a.currentTime=Number(t)),n&&"PLAYBACK_START"==n?(this.a.play(),xn(this,0)):n&&"PLAYBACK_PAUSE"==n&&(this.a.pause(),xn(this,0));break;case"STOP":this.b.hb().then(function(){this.b&&xn(this,0)}.bind(this));break;case"GET_STATUS":xn(this,Number(e.requestId));break;case"VOLUME":n=e.volume,t=n.level,n=n.muted;var i=this.a.volume,r=this.a.muted;null!=t&&(this.a.volume=Number(t)),null!=n&&(this.a.muted=n),i==this.a.volume&&r==this.a.muted||xn(this,0);break;case"LOAD":this.g=0,this.j=this.m=!1,t=e.currentTime,n=this.A(e.media.contentId),this.a.autoplay=!0,this.b.load(n,t).then(function(){this.b&&_n(this)}.bind(this)).catch(function(t){var n="LOAD_FAILED";7==t.category&&7e3==t.code&&(n="LOAD_CANCELLED"),In(this,{requestId:Number(e.requestId),type:n},this.i)}.bind(this));break;default:In(this,{requestId:Number(e.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},this.i)}},Uu.Qc=function(t,e,n){this.b&&In(this,{type:"asyncComplete",id:e,error:n},this.f,t)};var Dc={IDLE:"IDLE",ad:"PLAYING",Yc:"BUFFERING",$c:"PAUSED"},Cc={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"};I("shaka.media.InitSegmentReference",Zn),Zn.prototype.Db=function(){return this.c()},Zn.prototype.createUris=Zn.prototype.Db,Zn.prototype.Jb=function(){return this.b},Zn.prototype.getStartByte=Zn.prototype.Jb,Zn.prototype.Hb=function(){return this.a},Zn.prototype.getEndByte=Zn.prototype.Hb,I("shaka.media.SegmentReference",ti),ti.prototype.U=function(){return this.position},ti.prototype.getPosition=ti.prototype.U,ti.prototype.Kb=function(){return this.startTime},ti.prototype.getStartTime=ti.prototype.Kb,ti.prototype.pd=function(){return this.endTime},ti.prototype.getEndTime=ti.prototype.pd,ti.prototype.Db=function(){return this.c()},ti.prototype.createUris=ti.prototype.Db,ti.prototype.Jb=function(){return this.b},ti.prototype.getStartByte=ti.prototype.Jb,ti.prototype.Hb=function(){return this.a},ti.prototype.getEndByte=ti.prototype.Hb,I("shaka.util.DataViewReader",ei);var Mc=1;ei.Endianness={bf:0,cf:Mc},ei.prototype.ha=function(){return this.a<this.D.byteLength},ei.prototype.hasMoreData=ei.prototype.ha,ei.prototype.U=function(){return this.a},ei.prototype.getPosition=ei.prototype.U,ei.prototype.qd=function(){return this.D.byteLength},ei.prototype.getLength=ei.prototype.qd,ei.prototype.ca=function(){try{var t=this.D.getUint8(this.a);return this.a+=1,t}catch(t){ni()}},ei.prototype.readUint8=ei.prototype.ca,ei.prototype.bb=function(){try{var t=this.D.getUint16(this.a,this.b);return this.a+=2,t}catch(t){ni()}},ei.prototype.readUint16=ei.prototype.bb,ei.prototype.B=function(){try{var t=this.D.getUint32(this.a,this.b);return this.a+=4,t}catch(t){ni()}},ei.prototype.readUint32=ei.prototype.B,ei.prototype.Lc=function(){try{var t=this.D.getInt32(this.a,this.b);return this.a+=4,t}catch(t){ni()}},ei.prototype.readInt32=ei.prototype.Lc,ei.prototype.Ra=function(){try{if(this.b)var t=this.D.getUint32(this.a,!0),e=this.D.getUint32(this.a+4,!0);else e=this.D.getUint32(this.a,!1),t=this.D.getUint32(this.a+4,!1)}catch(t){ni()}if(2097151<e)throw new z(2,3,3001);return this.a+=8,e*Math.pow(2,32)+t},ei.prototype.readUint64=ei.prototype.Ra,ei.prototype.Da=function(t){this.a+t>this.D.byteLength&&ni();var e=new Uint8Array(this.D.buffer,this.D.byteOffset+this.a,t);return this.a+=t,new Uint8Array(e)},ei.prototype.readBytes=ei.prototype.Da,ei.prototype.F=function(t){this.a+t>this.D.byteLength&&ni(),this.a+=t},ei.prototype.skip=ei.prototype.F,ei.prototype.Oc=function(t){this.a<t&&ni(),this.a-=t},ei.prototype.rewind=ei.prototype.Oc,ei.prototype.seek=function(t){(0>t||t>this.D.byteLength)&&ni(),this.a=t},ei.prototype.seek=ei.prototype.seek,ei.prototype.Xb=function(){for(var t=this.a;this.ha()&&0!=this.D.getUint8(this.a);)this.a+=1;return t=new Uint8Array(this.D.buffer,this.D.byteOffset+t,this.a-t),this.a+=1,Mt(t)},ei.prototype.readTerminatedString=ei.prototype.Xb,I("shaka.util.Mp4Parser",ii),ii.prototype.C=function(t,e){var n=si(t);return this.c[n]=0,this.b[n]=e,this},ii.prototype.box=ii.prototype.C,ii.prototype.Z=function(t,e){var n=si(t);return this.c[n]=1,this.b[n]=e,this},ii.prototype.fullBox=ii.prototype.Z,ii.prototype.stop=function(){this.a=!0},ii.prototype.stop=ii.prototype.stop,ii.prototype.parse=function(t,e){var n=new Uint8Array(t);for(n=new ei(new DataView(n.buffer,n.byteOffset,n.byteLength),0),this.a=!1;n.ha()&&!this.a;)this.xb(0,n,e)},ii.prototype.parse=ii.prototype.parse,ii.prototype.xb=function(t,e,n){var i=e.U(),r=e.B(),a=e.B();switch(r){case 0:r=e.D.byteLength-i;break;case 1:r=e.Ra()}var o=this.b[a];if(o){var s=null,u=null;1==this.c[a]&&(u=e.B(),s=u>>>24,u&=16777215),a=i+r,n&&a>e.D.byteLength&&(a=e.D.byteLength),a-=e.U(),e=0<a?e.Da(a):new Uint8Array(0),e=new ei(new DataView(e.buffer,e.byteOffset,e.byteLength),0),o({parser:this,partialOkay:n||!1,version:s,flags:u,reader:e,size:r,start:i+t})}else e.F(Math.min(i+r-e.U(),e.D.byteLength-e.U()))},ii.prototype.parseNext=ii.prototype.xb,ii.children=ri,ii.sampleDescription=ai,ii.allData=oi,ii.typeToString=ui,I("shaka.media.SegmentIndex",li),li.prototype.destroy=function(){return this.a=null,Promise.resolve()},li.prototype.destroy=li.prototype.destroy,li.prototype.find=function(t){for(var e=this.a.length-1;0<=e;--e){var n=this.a[e];if(t>=n.startTime&&t<n.endTime)return n.position}return this.a.length&&t<this.a[0].startTime?this.a[0].position:null},li.prototype.find=li.prototype.find,li.prototype.get=function(t){return 0==this.a.length?null:(t-=this.a[0].position,0>t||t>=this.a.length?null:this.a[t])},li.prototype.get=li.prototype.get,li.prototype.offset=function(t){for(var e=0;e<this.a.length;++e)this.a[e].startTime+=t,this.a[e].endTime+=t},li.prototype.offset=li.prototype.offset,li.prototype.Pb=function(t){for(var e=[],n=0,i=0;n<this.a.length&&i<t.length;){var r=this.a[n],a=t[i];r.startTime<a.startTime?(e.push(r),n++):(r.startTime>a.startTime?0==n&&e.push(a):(.1<Math.abs(r.endTime-a.endTime)?e.push(new ti(r.position,a.startTime,a.endTime,a.c,a.b,a.a)):e.push(r),n++),i++)}for(;n<this.a.length;)e.push(this.a[n++]);if(e.length)for(n=e[e.length-1].position+1;i<t.length;)r=t[i++],r=new ti(n++,r.startTime,r.endTime,r.c,r.b,r.a),e.push(r);else e=t;this.a=e},li.prototype.merge=li.prototype.Pb,li.prototype.Fb=function(t){for(var e=0;e<this.a.length;++e)if(this.a[e].endTime>t)return void this.a.splice(0,e);this.a=[]},li.prototype.evict=li.prototype.Fb;var Lc;di.prototype.ha=function(){return this.a.ha()},gi.prototype.parse=function(t,e,n,i){var r;if(e=new di(new DataView(e)),440786851!=pi(e).id)throw new z(2,3,3008);var a=pi(e);if(408125543!=a.id)throw new z(2,3,3009);for(e=a.a.byteOffset,a=new di(a.a),r=null;a.ha();){var o=pi(a);if(357149030==o.id){r=o;break}}if(!r)throw new z(2,3,3010);for(a=new di(r.a),r=1e6,o=null;a.ha();){var s=pi(a);if(2807729==s.id)r=yi(s);else if(17545==s.id)if(o=s,4==o.a.byteLength)o=o.a.getFloat32(0);else{if(8!=o.a.byteLength)throw new z(2,3,3003);o=o.a.getFloat64(0)}}if(null==o)throw new z(2,3,3011);if(a=r/1e9,r=o*a,t=pi(new di(new DataView(t))),475249515!=t.id)throw new z(2,3,3007);return bi(t,e,a,r,n,i)};var Oc={},Uc={};I("shaka.media.ManifestParser.registerParserByExtension",function(t,e){Uc[t]=e}),I("shaka.media.ManifestParser.registerParserByMime",function(t,e){Oc[t]=e}),I("shaka.media.PresentationTimeline",Oi),Oi.prototype.T=function(){return this.b},Oi.prototype.getDuration=Oi.prototype.T,Oi.prototype.ka=function(t){this.b=t},Oi.prototype.setDuration=Oi.prototype.ka,Oi.prototype.vd=function(){return this.f},Oi.prototype.getPresentationStartTime=Oi.prototype.vd,Oi.prototype.Rc=function(t){this.j=t},Oi.prototype.setClockOffset=Oi.prototype.Rc,Oi.prototype.yb=function(t){this.i=t},Oi.prototype.setStatic=Oi.prototype.yb,Oi.prototype.dc=function(t){this.c=t},Oi.prototype.setSegmentAvailabilityDuration=Oi.prototype.dc,Oi.prototype.Sc=function(t){this.l=t},Oi.prototype.setDelay=Oi.prototype.Sc,Oi.prototype.Na=function(t,e){0!=t.length&&(e&&(this.h=Math.max(this.h,t[0].startTime)),this.a=t.reduce(function(t,e){return Math.max(t,e.endTime-e.startTime)},this.a))},Oi.prototype.notifySegments=Oi.prototype.Na,Oi.prototype.Rb=function(t){this.a=Math.max(this.a,t)},Oi.prototype.notifyMaxSegmentDuration=Oi.prototype.Rb,Oi.prototype.P=function(){return 1/0==this.b&&!this.i},Oi.prototype.isLive=Oi.prototype.P,Oi.prototype.Aa=function(){return 1/0!=this.b&&!this.i},Oi.prototype.isInProgress=Oi.prototype.Aa,Oi.prototype.Xa=function(){if(1/0==this.c)return this.g;var t=this.Ka()-this.c;return Math.max(this.g,t)},Oi.prototype.getSegmentAvailabilityStart=Oi.prototype.Xa,Oi.prototype.Tc=function(t){this.g=t},Oi.prototype.setUserSeekStart=Oi.prototype.Tc,Oi.prototype.Ka=function(){return this.P()||this.Aa()?Math.min(Math.max(0,(Date.now()+this.j)/1e3-this.a-this.f),this.b):this.b},Oi.prototype.getSegmentAvailabilityEnd=Oi.prototype.Ka,Oi.prototype.Wa=function(t){var e=Math.max(this.h,this.g);if(1/0==this.c)return e;var n=this.Ka()-this.c;return t=Math.min(n+t,this.ma()),Math.max(e,t)},Oi.prototype.getSafeSeekRangeStart=Oi.prototype.Wa,Oi.prototype.Ja=function(){return this.Wa(0)},Oi.prototype.getSeekRangeStart=Oi.prototype.Ja,Oi.prototype.ma=function(){var t=this.P()||this.Aa()?this.l:0;return Math.max(0,this.Ka()-t)},Oi.prototype.getSeekRangeEnd=Oi.prototype.ma,I("shaka.dash.DashParser",Ui),Uu=Ui.prototype,Uu.configure=function(t){this.b=t},Uu.start=function(t,e){return this.h=[t],this.a=e,ji(this).then(function(t){return this.a&&Gi(this,t),this.c}.bind(this))},Uu.stop=function(){return this.b=this.a=null,this.h=[],this.c=null,this.j=[],this.l={},null!=this.g&&(t.clearTimeout(this.g),this.g=null),this.f.destroy()},Uu.update=function(){ji(this).catch(function(t){this.a&&this.a.onError(t)}.bind(this))},Uu.onExpirationUpdated=function(){},Uu.ge=function(t,e){t.W=Xi(e,t.ba,null);var n=!1,i=Rn(e,"Role"),r=i.map(function(t){return t.getAttribute("value")}).filter(Pt),a=void 0,o="text"==t.W.contentType;o&&(a="subtitle");for(var s=0;s<i.length;s++){var u=i[s].getAttribute("schemeIdUri");if(null==u||"urn:mpeg:dash:role:2011"==u)switch(u=i[s].getAttribute("value")){case"main":n=!0;break;case"caption":case"subtitle":a=u}}var c=null,h=!1;if(Rn(e,"EssentialProperty").forEach(function(t){"http://dashif.org/guidelines/trickmode"==t.getAttribute("schemeIdUri")?c=t.getAttribute("value"):h=!0}),h)return null;i=Rn(e,"ContentProtection");var l=Kn(i,this.b.dash.customScheme,this.b.dash.ignoreDrmInfo);if(i=Be(e.getAttribute("lang")||"und"),u=e.getAttribute("label"),s=Rn(e,"Representation"),r=s.map(this.je.bind(this,t,l,a,i,u,n,r)).filter(function(t){return!!t}),0==r.length){if(o)return null;throw new z(2,4,4003)}return t.W.contentType&&"application"!=t.W.contentType||(t.W.contentType=Ji(r[0].mimeType,r[0].codecs),r.forEach(function(e){e.type=t.W.contentType})),r.forEach(function(t){l.drmInfos.forEach(function(e){t.keyId&&e.keyIds.push(t.keyId)})}),o=s.map(function(t){return t.getAttribute("id")}).filter(Pt),{id:t.W.id||"__fake__"+this.i++,contentType:t.W.contentType,language:i,Nb:n,streams:r,drmInfos:l.drmInfos,hc:c,te:o}},Uu.je=function(t,e,n,i,r,a,o,s){if(t.v=Xi(s,t.W,null),!zi(t.v))return null;t.bandwidth=Mn(s,"bandwidth",Bn)||0;var u=t.v.contentType;u="text"==u||"application"==u;try{var c=this.ue.bind(this);if(t.v.cb)var h=Ei(t,c);else if(t.v.ta)h=Ai(t,this.l);else if(t.v.fb)h=Pi(t,c,this.l,!!this.c);else{var l=t.v.ea,f=t.M.duration||0;h={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(t){return 0<=t&&t<f?1:null},getSegmentReference:function(t){return 1!=t?null:new ti(1,0,f,function(){return l},0,null)},initSegmentReference:null,da:0}}}catch(t){if(u&&4002==t.code)return null;throw t}return s=Rn(s,"ContentProtection"),s=Hn(s,this.b.dash.customScheme,e,this.b.dash.ignoreDrmInfo),{id:this.i++,createSegmentIndex:h.createSegmentIndex,findSegmentPosition:h.findSegmentPosition,getSegmentReference:h.getSegmentReference,initSegmentReference:h.initSegmentReference,presentationTimeOffset:h.da,mimeType:t.v.mimeType,codecs:t.v.codecs,frameRate:t.v.frameRate,bandwidth:t.bandwidth,width:t.v.width,height:t.v.height,kind:n,encrypted:0<e.drmInfos.length,keyId:s,language:i,label:r,type:t.W.contentType,primary:a,trickModeVideo:null,containsEmsgBoxes:t.v.containsEmsgBoxes,roles:o,channelsCount:t.v.Sb}},Uu.Pe=function(){this.g=null,ji(this).then(function(t){this.a&&Gi(this,t)}.bind(this)).catch(function(t){this.a&&(t.severity=1,this.a.onError(t),Gi(this,0))}.bind(this))},Uu.ie=function(t,e,n){var i=n.getAttribute("schemeIdUri")||"",r=n.getAttribute("value")||"",a=Mn(n,"timescale",Fn)||1;Rn(n,"Event").forEach(function(n){var o=Mn(n,"presentationTime",Fn)||0,s=Mn(n,"duration",Fn)||0;o=o/a+t,s=o+s/a,null!=e&&(o=Math.min(o,t+e),s=Math.min(s,t+e)),n={schemeIdUri:i,value:r,startTime:o,endTime:s,id:n.getAttribute("id")||"",eventElement:n},this.a.onTimelineRegionAdded(n)}.bind(this))},Uu.ue=function(t,e,n){return t=pt(t,this.b.retryParameters),null!=e&&(t.headers.Range="bytes="+e+"-"+(null!=n?n:"")),e=this.a.networkingEngine.request(1,t),lt(this.f,e),e.promise.then(function(t){return t.data})},Uc.mpd=Ui,Oc["application/dash+xml"]=Ui,Zi.prototype.toString=function(){function t(t){return t.name+'="'+t.value+'"'}return this.value?"#"+this.name+":"+this.value:0<this.a.length?"#"+this.name+":"+this.a.map(t).join(","):"#"+this.name},Zi.prototype.getAttribute=function(t){var e=this.a.filter(function(e){return e.name==t});return e.length?e[0]:null};var jc="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-MAP EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST".split(" "),Bc="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE".split(" ");I("shaka.net.DataUriPlugin",mr),mr.parse=function(e){var n=e.split(":");if(2>n.length||"data"!=n[0])throw new z(2,1,1004,e);if(n=n.slice(1).join(":").split(","),2>n.length)throw new z(2,1,1004,e);var i=n[0];n=t.decodeURIComponent(n.slice(1).join(",")),i=i.split(";");var r=null;if(1<i.length&&(r=i[1]),"base64"==r)e=Ht(n).buffer;else{if(r)throw new z(2,1,1005,e);e=Ut(n)}return{data:e,contentType:i[0]}},dt("data",mr),I("shaka.hls.HlsParser",vr),Uu=vr.prototype,Uu.configure=function(t){this.g=t},Uu.start=function(t,e){return this.c=e,this.m=t,Vr(this,t).then(function(e){return gr(this,e.data,t).then(function(){return Kr(this,this.i),this.o}.bind(this))}.bind(this))},Uu.stop=function(){return this.g=this.c=null,this.u={},this.I={},this.o=null,this.h.destroy()},Uu.update=function(){if(this.f!=qc.ra){var t,e=[];for(t in this.a)e.push(yr(this,this.a[t],t));return Promise.all(e)}},Uu.onExpirationUpdated=function(){};var Fc={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/],text:[/^vtt$/,/^wvtt/,/^stpp/]},Vc={audio:{mp4:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",ts:"video/mp2t"},video:{mp4:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",ts:"video/mp2t"},text:{mp4:"application/mp4",m4s:"application/mp4",m4i:"application/mp4",vtt:"text/vtt",ttml:"application/ttml+xml"}};vr.prototype.S=function(){this.c&&(this.j=null,this.update().then(function(){Kr(this,this.i)}.bind(this)).catch(function(t){this.c&&(t.severity=1,this.c.onError(t),Kr(this,0))}.bind(this)))};var Kc={"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(t){var e=Br(t,"METHOD");return"SAMPLE-AES-CENC"!=e&&"SAMPLE-AES-CTR"!=e?null:(e=Br(t,"URI"),e=mr.parse(e),e=new Uint8Array(e.data),e=Dt("com.widevine.alpha",[{initDataType:"cenc",initData:e}]),(t=er(t,"KEYID"))&&(e.keyIds=[t.substr(2).toLowerCase()]),e)}},Hc="VOD",qc={ra:Hc,Zc:"EVENT",jc:"LIVE"};Uc.m3u8=vr,Oc["application/x-mpegurl"]=vr,Oc["application/vnd.apple.mpegurl"]=vr,qr.prototype.destroy=function(){var t=this.h.destroy();return this.u=this.s=this.a=this.h=null,null!=this.b&&(this.b.cancel(),this.b=null),t},qr.prototype.ab=function(){this.f=!0,this.l()},qr.prototype.l=function(){if(0!=this.a.readyState){if(this.a.seeking){if(!this.g)return}else this.g=!1;if(!this.a.paused){this.a.readyState!=this.m&&(this.c=!1,this.m=this.a.readyState);var t=this.o.smallGapLimit,e=this.a.currentTime,n=this.a.buffered;t:{if(n&&n.length&&!(1==n.length&&1e-6>n.end(0)-n.start(0))){var i=.1;/(Edge\/|Trident\/|Tizen)/.test(navigator.userAgent)&&(i=.5);for(var r=0;r<n.length;r++)if(n.start(r)>e&&(0==r||n.end(r-1)-e<=i)){i=r;break t}}i=null}if(null==i){if(n=this.a.currentTime,e=this.a.buffered,!this.a.paused&&0<this.a.playbackRate)if(this.j!=n)this.j=n,this.A=Date.now(),this.i=!1;else if(!this.i&&this.A<Date.now()-1e3)for(i=0;i<e.length;i++)if(n>=e.start(i)&&n<e.end(i)-.5){this.a.currentTime+=.1,this.j=this.a.currentTime,this.i=!0;break}}else if(0!=i||this.f){r=n.start(i);var a=this.s.presentationTimeline.ma();if(!(r>=a)){a=r-e,t=a<=t;var o=!1;.001>a||(t||this.c||(this.c=!0,e=new At("largegap",{currentTime:e,gapSize:a}),e.cancelable=!0,this.u(e),this.o.jumpLargeGaps&&!e.defaultPrevented&&(o=!0)),!t&&!o)||(0!=i&&n.end(i-1),this.a.currentTime=r)}}}}},Uu=Gr.prototype,Uu.destroy=function(){var t=this.c.destroy();return this.c=null,null!=this.b&&(this.b.cancel(),this.b=null),this.i=this.a=null,t},Uu.Va=function(){return this.f},Uu.Vd=function(){var t=this.g||0>this.f?0:this.f;this.a.playbackRate&&this.a.playbackRate!=t&&zr(this,this.a.playbackRate)},Uu.Fc=function(){.001>Math.abs(this.a.currentTime-this.h)?this.Gc():(Et(this.c,this.a,"seeking",this.Gc.bind(this)),this.a.currentTime=0==this.a.currentTime?this.h:this.a.currentTime)},Uu.Gc=function(){var t=this;Tt(this.c,this.a,"seeking",function(){return t.i()})},Uu=$r.prototype,Uu.destroy=function(){var t=Promise.all([this.a.destroy(),this.g.destroy()]);return this.g=this.a=null,null!=this.f&&(this.f.cancel(),this.f=null),this.j=this.h=this.b=this.c=null,t},Uu.Va=function(){return this.a.Va()},Uu.ab=function(){this.g.ab()},Uu.Ud=function(){if(0!=this.c.readyState&&!this.c.paused){var t=this.c.currentTime,e=this.b.presentationTimeline,n=e.Ja();e=e.ma(),3>e-n&&(n=e-3),t<n&&(t=Zr(this,t),this.c.currentTime=t)}},Uu.Xd=function(){var t=this.g;t.g=!0,t.f=!1,t.c=!1;var e=Xr(this.a);if(t=Zr(this,e),.001<Math.abs(t-e)&&(e=(new Date).getTime()/1e3,!this.i||this.i<e-1))return this.i=e,void Yr(this.a,t);this.j()},ea.prototype.destroy=function(){var t=this.j?this.j.destroy():Promise.resolve();return this.j=null,ra(this),this.A=this.h=this.l=this.s=this.g=this.u=this.a=null,this.c=[],t},ea.prototype.o=function(t){if(!this.c.some(function(e){return e.info.schemeIdUri==t.schemeIdUri&&e.info.startTime==t.startTime&&e.info.endTime==t.endTime})){var e={info:t,status:1};this.c.push(e);var n=new At("timelineregionadded",{detail:na(t)});this.h(n),this.m(!0,e)}},ea.prototype.m=function(t,e){var n=e.info.startTime>this.a.currentTime?1:e.info.endTime<this.a.currentTime?3:2,i=2==e.status,r=2==n;n!=e.status&&((!t||i||r)&&(i||this.h(new At("timelineregionenter",{detail:na(e.info)})),r||this.h(new At("timelineregionexit",{detail:na(e.info)}))),e.status=n)},ea.prototype.G=function(){this.f=null,ia(this);var t=sn(this.g,this.a.currentTime);t!=this.i&&(-1!=this.i&&this.A(),this.i=t),t=me(this.a.buffered,this.a.currentTime);var e=de(this.a.buffered),n=this.g.presentationTimeline,i=n.Ka();e=n.P()&&e>=i,n=this.u,n=!n.g||"ended"==n.g.readyState,e=e||this.a.ended||n,this.b?(n=Math.max(this.g.minBufferTime||0,this.s.rebufferingGoal),(e||t>=n)&&0!=this.b&&(this.b=!1,this.l(!1))):!e&&.5>t&&1!=this.b&&(this.b=!0,this.l(!0)),this.c.forEach(this.m.bind(this,!1))},Uu=aa.prototype,Uu.destroy=function(){for(var t in this.c)Ua(this.c[t]);return this.g=this.c=this.i=this.h=this.m=this.b=this.a=null,this.f=!0,Promise.resolve()},Uu.configure=function(t){this.g=t,this.A=new G({maxAttempts:Math.max(t.retryParameters.maxAttempts,2),baseDelay:t.retryParameters.baseDelay,backoffFactor:t.retryParameters.backoffFactor,fuzzFactor:t.retryParameters.fuzzFactor,timeout:0},!0)},Uu.init=function(){var t=Jr(this.a.Pa);return t=this.a.Ac(this.b.periods[sn(this.b,t)]),t.variant||t.text?ga(this,t).then(function(){!this.f&&this.a&&this.a.Ld&&this.a.Ld()}.bind(this)):Promise.reject(new z(2,5,5005))},Uu.Re=function(t){if(!this.f&&!t.Ca&&null!=t.ua&&!t.ya)if(t.ua=null,t.va)La(this,t,t.zb);else{try{var e=Ea(this,t);null!=e&&(Oa(this,t,e),t.Ya=!1)}catch(t){return void ja(this,t)}e=$u.values(this.c),Da(this,t),e.every(function(t){return t.endOfStream})&&this.a.J.endOfStream().then(function(){if(!this.f){var t=this.a.J.T();t<this.b.presentationTimeline.T()&&this.b.presentationTimeline.ka(t)}}.bind(this))}},Uu.he=function(t,e,n){var i=n.reader.Xb(),r=n.reader.Xb(),a=n.reader.B(),o=n.reader.B(),s=n.reader.B(),u=n.reader.B();n=n.reader.Da(n.reader.D.byteLength-n.reader.U()),t=t.startTime+e.startTime+o/a,"urn:mpeg:dash:event:2012"==i?this.a.Nd():this.a.onEvent(new At("emsg",{detail:{startTime:t,endTime:t+s/a,schemeIdUri:i,value:r,timescale:a,presentationTimeDelta:o,eventDuration:s,id:u,messageData:n}}))},I("shaka.net.HttpFetchPlugin",Fa),Fa.f=function(t,e,n,i,r){return c(function a(){var o,s,u,c,h,l;return A(a,function(a){switch(a.w){case 1:return o=Fa.c,p(a,2,3),d(a,o(t,n),5);case 5:return s=a.K,d(a,s.arrayBuffer(),6);case 6:u=a.K;case 3:g(a),clearTimeout(r),b(a,4);break;case 2:if(c=y(a),i.mc)throw new z(1,1,7001,t,e);if(i.Xc)throw new z(1,1,1003,t,e);throw new z(1,1,1002,t,c,e);case 4:return h={},l=s.headers,l.forEach(function(t,e){h[e.trim()]=t}),a.return(Ba(h,u,s.status,t,s.url,e))}})})},Fa.isSupported=function(){return!(!t.fetch||!t.AbortController)},Fa.isSupported=Fa.isSupported,Fa.c=t.fetch,Fa.a=t.AbortController,Fa.b=t.Headers,Fa.isSupported()&&(dt("http",Fa,2),dt("https",Fa,2)),I("shaka.net.HttpXHRPlugin",Va),Va.g=t.XMLHttpRequest,dt("http",Va,1),dt("https",Va,1),Ka.prototype.destroy=function(){this.h=!0;var t=this.c.catch(function(){});return this.c=Promise.resolve(),t},za.prototype.abort=function(){try{this.c.abort()}catch(t){}return this.a.catch(function(){})},za.prototype.store=function(){return this.b},za.prototype.promise=function(){return this.a},Wa.prototype.destroy=function(){return Promise.all(this.a.map(function(t){return t.abort()}))},Qa.prototype.destroy=function(){var t=$u.values(this.a).map(function(t){return t.destroy()});return this.a={},Promise.all(t)},Qa.prototype.init=function(){var t=this;$u.forEach(Gc,function(e,n){var i=n();i&&(t.a[e]=i)});var e=$u.values(this.a).map(function(t){return t.init()});return Promise.all(e)},I("shaka.offline.StorageMuxer.register",function(t,e){Gc[t]=e}),I("shaka.offline.StorageMuxer.unregister",function(t){delete Gc[t]});var Gc={};Uu=ro.prototype,Uu.destroy=function(){return this.a.destroy()},Uu.hasFixedKeySpace=function(){return!0},Uu.addSegments=function(){return ao("segment")},Uu.removeSegments=function(t,e){return oo(this,"segment",t,e)},Uu.getSegments=function(t){return so(this,"segment",t).then(function(t){return t.map(fo)})},Uu.addManifests=function(){return ao("manifest")},Uu.updateManifestExpiration=function(t,e){var n=$a(this.a,"manifest"),i=n.store(),r=new q;return i.get(t).onsuccess=function(n){(n=n.target.result)?(n.expiration=e,i.put(n),r.resolve()):r.reject(new z(2,9,9012,"Could not find values for "+t))},n.promise().then(function(){return r})},Uu.removeManifests=function(t,e){return oo(this,"manifest",t,e)},Uu.getManifests=function(t){return so(this,"manifest",t).then(function(t){return t.map(uo)})},Uu.getAllManifests=function(){var t=Ja(this.a,"manifest","readonly"),e={};return t.store().openCursor().onsuccess=function(t){(t=t.target.result)&&(e[t.key]=uo(t.value),t.continue())},t.promise().then(function(){return e})},Uu=vo.prototype,Uu.destroy=function(){return this.a.destroy()},Uu.hasFixedKeySpace=function(){return this.f},Uu.addSegments=function(t){return yo(this,this.c,t)},Uu.removeSegments=function(t,e){return go(this,this.c,t,e)},Uu.getSegments=function(t){return bo(this,this.c,t)},Uu.addManifests=function(t){return yo(this,this.b,t)},Uu.updateManifestExpiration=function(t,e){var n=$a(this.a,this.b),i=n.store();return i.get(t).onsuccess=function(n){(n=n.target.result)&&(n.expiration=e,i.put(n,t))},n.promise()},Uu.removeManifests=function(t,e){return go(this,this.b,t,e)},Uu.getManifests=function(t){return bo(this,this.b,t)},Uu.getAllManifests=function(){var t=Ja(this.a,this.b,"readonly"),e={};return t.store().openCursor().onsuccess=function(t){(t=t.target.result)&&(e[t.key]=t.value,t.continue())},t.promise().then(function(){return e})},wo.prototype.init=function(){var e=this,n=new q,i=t.indexedDB.open("shaka_offline_db",3);return i.onsuccess=function(t){t=t.target.result,e.f=t;var i=t.objectStoreNames;i=i.contains("manifest")&&i.contains("segment")?new ro(t):null,e.a=i,i=t.objectStoreNames,i=i.contains("manifest-v2")&&i.contains("segment-v2")?new vo(t,"segment-v2","manifest-v2",!0):null,e.b=i,i=t.objectStoreNames,t=i.contains("manifest-v3")&&i.contains("segment-v3")?new vo(t,"segment-v3","manifest-v3",!1):null,e.c=t,n.resolve()},i.onupgradeneeded=function(t){t=t.target.result;var e={autoIncrement:!0};t.createObjectStore("manifest-v3",e),t.createObjectStore("segment-v3",e)},i.onerror=function(t){n.reject(new z(2,9,9001,i.error)),t.preventDefault()},n},wo.prototype.destroy=function(){var t=this;return c(function e(){return A(e,function(e){switch(e.w){case 1:if(!t.a){e.V(2);break}return d(e,t.a.destroy(),2);case 2:if(!t.b){e.V(4);break}return d(e,t.b.destroy(),4);case 4:if(!t.c){e.V(6);break}return d(e,t.c.destroy(),6);case 6:t.f&&t.f.close(),e.w=0}})})},wo.prototype.getCells=function(){var t={};return this.a&&(t.v1=this.a),this.b&&(t.v2=this.b),this.c&&(t.v3=this.c),t},wo.prototype.erase=function(){var t=this;return c(function e(){return A(e,function(e){switch(e.w){case 1:if(!t.a){e.V(2);break}return d(e,t.a.destroy(),2);case 2:if(!t.b){e.V(4);break}return d(e,t.b.destroy(),4);case 4:if(!t.c){e.V(6);break}return d(e,t.c.destroy(),6);case 6:return t.f&&t.f.close(),d(e,To(),8);case 8:return t.f=null,t.a=null,t.b=null,t.c=null,d(e,t.init(),0)}})})},Gc.idb=function(){return t.indexedDB?new wo:null},Eo.prototype.fa=function(){return this.g},Eo.prototype.N=function(){return this.f},Eo.prototype.key=function(){return this.c},Eo.prototype.toString=function(){return this.b},Uu=No.prototype,Uu.configure=function(){},Uu.start=function(t){var e=So(t);if(this.a=e,null==e||"manifest"!=e.a)return Promise.reject(new z(2,1,9004,e));var n=new Qa;return ct([n],function(){return c(function t(){var i,r,a,o;return A(t,function(t){switch(t.w){case 1:return d(t,n.init(),2);case 2:return d(t,eo(n,e.fa(),e.N()),3);case 3:return i=t.K,d(t,i.getManifests([e.key()]),4);case 4:return r=t.K,a=r[0],o=new ko(e.fa(),e.N()),t.return(Ao(o,a))}})})})},Uu.stop=function(){return Promise.resolve()},Uu.update=function(){},Uu.onExpirationUpdated=function(t,e){var n=this.a,i=new Qa;return ct([i],function(){return c(function r(){var a,o,s,u,c;return A(r,function(r){switch(r.w){case 1:return d(r,i.init(),2);case 2:return d(r,eo(i,n.fa(),n.N()),3);case 3:return a=r.K,d(r,a.getManifests([n.key()]),4);case 4:if(o=r.K,s=o[0],u=0<=s.sessionIds.indexOf(t),c=void 0==s.expiration||s.expiration>e,u&&c)return d(r,a.updateManifestExpiration(n.key(),e),0);r.V(0)}})})}).catch(function(){})},Oc["application/x-offline-manifest"]=No,I("shaka.offline.OfflineScheme",Do),Do.a=function(t){return t={uri:t,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}},Q(t)},Do.b=function(t,e){var n=new Qa;return Z(ct([n],function(){return c(function t(){var i,r,a;return A(t,function(t){switch(t.w){case 1:return d(t,n.init(),2);case 2:return d(t,eo(n,e.fa(),e.N()),3);case 3:return i=t.K,d(t,i.getSegments([e.key()]),4);case 4:return r=t.K,a=r[0],t.return({uri:e,data:a.data,headers:{}})}})})}))},dt("offline",Do),I("shaka.text.SimpleTextDisplayer",Co),Co.prototype.remove=function(t,e){return!!this.a&&(Lo(this.a,function(n){return!(n.startTime>=e||n.endTime<=t)}),!0)},Co.prototype.remove=Co.prototype.remove,Co.prototype.append=function(t){for(var e=Mo,n=[],i=0;i<t.length;i++){var r=e(t[i]);r&&n.push(r)}n.slice().sort(function(t,e){return t.startTime!=e.startTime?t.startTime-e.startTime:t.endTime!=e.endTime?t.endTime-e.startTime:n.indexOf(e)-n.indexOf(t)}).forEach(function(t){this.a.addCue(t)}.bind(this))},Co.prototype.append=Co.prototype.append,Co.prototype.destroy=function(){return this.a&&Lo(this.a,function(){return!0}),this.a=null,Promise.resolve()},Co.prototype.destroy=Co.prototype.destroy,Co.prototype.isTextVisible=function(){return"showing"==this.a.mode},Co.prototype.isTextVisible=Co.prototype.isTextVisible,Co.prototype.setTextVisibility=function(t){this.a.mode=t?"showing":"hidden"},Co.prototype.setTextVisibility=Co.prototype.setTextVisibility,x(Oo,gn),I("shaka.Player",Oo),Oo.prototype.destroy=function(){var t=this;return c(function e(){var n;return A(e,function(e){switch(e.w){case 1:return d(e,t.detach(),2);case 2:return t.wa=!0,n=Promise.all([t.o?t.o.destroy():null,t.s?t.s.destroy():null]),t.pb=!1,t.o=null,t.h=null,t.Ab=null,t.s=null,t.c=null,d(e,n,0)}})})},Oo.prototype.destroy=Oo.prototype.destroy,Oo.version="v2.4.5";var Xc={};Oo.registerSupportPlugin=function(t,e){Xc[t]=e},Oo.isBrowserSupported=function(){return!!(t.Promise&&t.Uint8Array&&Array.prototype.forEach&&t.MediaSource&&MediaSource.isTypeSupported&&t.MediaKeys&&t.navigator&&t.navigator.requestMediaKeySystemAccess&&t.MediaKeySystemAccess&&t.MediaKeySystemAccess.prototype.getConfiguration)},Oo.probeSupport=function(){return he().then(function(t){t={manifest:Mi(),media:_e(),drm:t};for(var e in Xc)t[e]=Xc[e]();return t})},Oo.prototype.rb=function(t,e){var n=this;return c(function i(){return A(i,function(i){switch(i.w){case 1:if(void 0===e&&(e=!0),!n.f){i.V(2);break}return d(i,n.detach(),2);case 2:if(n.f=t,Tt(n.o,n.f,"error",n.be.bind(n)),e)return n.j=new Ae(n.f),d(i,n.j.j,0);i.V(0)}})})},Oo.prototype.attach=Oo.prototype.rb,Oo.prototype.detach=function(){var t=this;return c(function e(){return A(e,function(e){switch(e.w){case 1:return t.f?d(e,t.hb(!1),2):e.return();case 2:t.o.pa(t.f,"error"),t.f=null,e.w=0}})})},Oo.prototype.detach=Oo.prototype.detach,Oo.prototype.load=function(t,e,n){var i=this;return c(function r(){var a,o,s,u,c,h,l,f,m,g,b;return A(r,function(r){switch(r.w){case 1:if(!i.f)throw new z(2,7,7002);return o=new q,s=function(){return a=new z(2,7,7e3),o},i.dispatchEvent(new At("loading")),u=Date.now(),p(r,2),c=i.hb(),i.Ha=s,d(r,c,4);case 4:if(i.l=$o(),Tt(i.o,i.f,"playing",i.ib.bind(i)),Tt(i.o,i.f,"pause",i.ib.bind(i)),Tt(i.o,i.f,"ended",i.ib.bind(i)),h=i.c.abrFactory,i.h&&i.Ab==h||(i.Ab=h,i.h=new h,i.h.configure(i.c.abr)),i.u=new i.c.textDisplayFactory,i.u.setTextVisibility(i.pb),a)throw a;return l=i,d(r,jo(i,t,n),5);case 5:if(l.b=r.K,i.Cb=t,a)throw a;return Bo(i),i.i=new zt({$a:i.s,onError:i.Ta.bind(i),Ub:i.Md.bind(i),onExpirationUpdated:i.Jd.bind(i),onEvent:i.gb.bind(i)}),i.i.configure(i.c.drm),d(r,i.i.init(i.b,!1),6);case 6:if(a)throw a;return i.ec(i.b.periods),i.kb=Date.now()/1e3,i.L=i.c.preferredAudioLanguage,i.ga=i.c.preferredTextLanguage,i.Y=i.c.preferredAudioChannelCount,Fo(i),d(r,i.i.rb(i.f),7);case 7:if(a)throw a;return i.h.init(i.Ke.bind(i)),i.j||(i.j=new Ae(i.f)),i.j.o=i.u,i.g=new $r(i.f,i.b,i.c.streaming,void 0==e?null:e,i.Ie.bind(i),i.gb.bind(i)),i.A=new ea(i.f,i.j,i.b,i.c.streaming,i.Uc.bind(i),i.gb.bind(i),i.He.bind(i)),i.a=new aa(i.b,{Pa:i.g,J:i.j,$a:i.s,Ac:i.Hd.bind(i),zc:i.fd.bind(i),onError:i.Ta.bind(i),onEvent:i.gb.bind(i),Nd:i.Od.bind(i),ab:i.Yd.bind(i),filterNewPeriod:i.tb.bind(i),filterAllPeriods:i.ec.bind(i)}),i.a.configure(i.c.streaming),Vo(i),i.dispatchEvent(new At("streaming")),d(r,i.a.init(),8);case 8:if(a)throw a;if(i.c.streaming.startAtSegmentBoundary&&(f=Zo(i,Jr(i.g)),Yr(i.g.a,f)),i.b.periods.forEach(i.tb.bind(i)),is(i),ns(i),m=oa(i.a),g=Qe(m.variants,i.L,i.Ga,i.Y),i.h.setVariants(g),m.variants.some(function(t){return t.primary}),i.nb.forEach(i.A.o.bind(i.A)),i.nb=[],Et(i.o,i.f,"loadeddata",function(){this.l.loadLatency=(Date.now()-u)/1e3}.bind(i)),a)throw a;i.Ha=null,v(r);break;case 2:return b=y(r),o.resolve(),i.Ha==s&&(i.Ha=null,i.dispatchEvent(new At("unloading"))),a?r.return(Promise.reject(a)):r.return(Promise.reject(b))}})})},Oo.prototype.load=Oo.prototype.load,Oo.prototype.configure=function(t,e){if(2==arguments.length&&"string"==typeof t){for(var n=t,i={},r=i,a=0,o=0;!(0>(a=n.indexOf(".",a)));)0!=a&&"\\"==n[a-1]||(o=n.substring(o,a).replace(/\\\./g,"."),r[o]={},r=r[o],o=a+1),a+=1;r[n.substring(o).replace(/\\\./g,".")]=e,t=i}return n=st(this.c,t,Wo(this),zo(),""),Ko(this),n},Oo.prototype.configure=Oo.prototype.configure,Oo.prototype.getConfiguration=function(){var t=Wo(this);return st(t,this.c,Wo(this),zo(),""),t},Oo.prototype.getConfiguration=Oo.prototype.getConfiguration,Oo.prototype.ve=function(){this.c=Wo(this),Ko(this)},Oo.prototype.resetConfiguration=Oo.prototype.ve,Oo.prototype.sd=function(){return this.f},Oo.prototype.getMediaElement=Oo.prototype.sd,Oo.prototype.uc=function(){return this.s},Oo.prototype.getNetworkingEngine=Oo.prototype.uc,Oo.prototype.Ib=function(){return this.Cb},Oo.prototype.getManifestUri=Oo.prototype.Ib,Oo.prototype.P=function(){return!!this.b&&this.b.presentationTimeline.P()},Oo.prototype.isLive=Oo.prototype.P,Oo.prototype.Aa=function(){return!!this.b&&this.b.presentationTimeline.Aa()},Oo.prototype.isInProgress=Oo.prototype.Aa,Oo.prototype.Dd=function(){if(!this.b||!this.b.periods.length)return!1;var t=this.b.periods[0].variants;return!!t.length&&!t[0].video},Oo.prototype.isAudioOnly=Oo.prototype.Dd,Oo.prototype.xe=function(){var t=0,e=0;return this.b&&(e=this.b.presentationTimeline,t=e.Ja(),e=e.ma()),{start:t,end:e}},Oo.prototype.seekRange=Oo.prototype.xe,Oo.prototype.keySystem=function(){return this.i?this.i.keySystem():""},Oo.prototype.keySystem=Oo.prototype.keySystem,Oo.prototype.drmInfo=function(){return this.i?this.i.b:null},Oo.prototype.drmInfo=Oo.prototype.drmInfo,Oo.prototype.vb=function(){return this.i?this.i.vb():1/0},Oo.prototype.getExpiration=Oo.prototype.vb,Oo.prototype.xc=function(){return this.ob},Oo.prototype.isBuffering=Oo.prototype.xc,Oo.prototype.hb=function(t){var e=this;return c(function n(){return A(n,function(n){switch(n.w){case 1:return e.wa?n.return():(void 0===t&&(t=!0),e.dispatchEvent(new At("unloading")),d(n,Uo(e),2));case 2:return e.qb||(e.qb=Yo(e).then(function(){e.Uc(!1),e.qb=null})),d(n,e.qb,3);case 3:if(t)return e.j=new Ae(e.f),d(n,e.j.j,0);n.V(0)}})})},Oo.prototype.unload=Oo.prototype.hb,Oo.prototype.Va=function(){return this.g?this.g.Va():0},Oo.prototype.getPlaybackRate=Oo.prototype.Va,Oo.prototype.Te=function(t){this.g&&zr(this.g.a,t),this.a&&da(this.a,1!=t)},Oo.prototype.trickPlay=Oo.prototype.Te,Oo.prototype.gd=function(){this.g&&zr(this.g.a,1),this.a&&da(this.a,!1)},Oo.prototype.cancelTrickPlay=Oo.prototype.gd,Oo.prototype.Ad=function(){if(!this.b||!this.g)return[];var t=sn(this.b,Jr(this.g)),e=this.I[t]||{};return Ye(this.b.periods[t],e.audio,e.video)},Oo.prototype.getVariantTracks=Oo.prototype.Ad,Oo.prototype.zd=function(){if(!this.b||!this.g)return[];var t=sn(this.b,Jr(this.g)),e=this.I[t]||{};if(!e.text){var n=en(this.b.periods[t].textStreams,this.ga,this.Ua);n.length&&(e.text=n[0].id)}return ze(this.b.periods[t],e.text).filter(function(t){return 0>this.lb.indexOf(t.id)}.bind(this))},Oo.prototype.getTextTracks=Oo.prototype.zd,Oo.prototype.Be=function(t){if(this.a){var e=oa(this.a);t:{for(var n=0;n<e.textStreams.length;n++)if(e.textStreams[n].id==t.id){t=e.textStreams[n];break t}t=null}t&&(this.j.l=!1,Go(this,t,!1),e=t,this.xa?this.G=e:ma(this.a,e,!0),this.ga=t.language)}},Oo.prototype.selectTextTrack=Oo.prototype.Be,Oo.prototype.ze=function(){this.j.l=!0,fa(this.a)},Oo.prototype.selectEmbeddedTextTrack=Oo.prototype.ze,Oo.prototype.Ye=function(){return!!this.j&&this.j.l},Oo.prototype.usingEmbeddedTextTrack=Oo.prototype.Ye,Oo.prototype.Ce=function(t,e){if(this.a){this.c.abr.enabled&&C("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var n=oa(this.a),i=We(n,t);i&&$e(i)&&(qo(this,i,!1),Jo(this,i,e),this.L=i.language,i.audio&&i.audio.channelsCount&&(this.Y=i.audio.channelsCount),n=Qe(n.variants,this.L,this.Ga,this.Y),this.h.setVariants(n))}},Oo.prototype.selectVariantTrack=Oo.prototype.Ce,Oo.prototype.od=function(){if(!this.a)return[];var t=oa(this.a);return t=Je(t.variants).map(function(t){return t.audio}).filter(Rt),Ho(t)},Oo.prototype.getAudioLanguagesAndRoles=Oo.prototype.od,Oo.prototype.yd=function(){return this.a?Ho(oa(this.a).textStreams):[]},Oo.prototype.getTextLanguagesAndRoles=Oo.prototype.yd,Oo.prototype.nd=function(){return this.a?Je(oa(this.a).variants).map(function(t){return t.language}).filter(Rt):[]},Oo.prototype.getAudioLanguages=Oo.prototype.nd,Oo.prototype.xd=function(){return this.a?oa(this.a).textStreams.map(function(t){return t.language}).filter(Rt):[]},Oo.prototype.getTextLanguages=Oo.prototype.xd,Oo.prototype.ye=function(t,e){if(this.a){var n=oa(this.a);this.L=t,this.Ga=e||"",es(this,n)}},Oo.prototype.selectAudioLanguage=Oo.prototype.ye,Oo.prototype.Ae=function(t,e){if(this.a){var n=oa(this.a);this.ga=t,this.Ua=e||"",es(this,n)}},Oo.prototype.selectTextLanguage=Oo.prototype.Ae,Oo.prototype.Mb=function(){return this.u?this.u.isTextVisible():this.pb},Oo.prototype.isTextTrackVisible=Oo.prototype.Mb,Oo.prototype.Fe=function(t){this.u&&this.u.setTextVisibility(t),this.pb=t,rs(this),!this.c.streaming.alwaysStreamText&&this.a&&(t?(t=oa(this.a),(t=en(t.textStreams,this.ga,this.Ua)[0])&&la(this.a,t)):fa(this.a))},Oo.prototype.setTextTrackVisibility=Oo.prototype.Fe,Oo.prototype.ud=function(){return this.b?new Date(1e3*this.b.presentationTimeline.f+1e3*this.f.currentTime):null},Oo.prototype.getPlayheadTimeAsDate=Oo.prototype.ud,Oo.prototype.wd=function(){return this.b?new Date(1e3*this.b.presentationTimeline.f):null},Oo.prototype.getPresentationStartTimeAsDate=Oo.prototype.wd,Oo.prototype.Gb=function(){return this.j?this.j.Gb():{total:[],audio:[],video:[],text:[]}},Oo.prototype.getBufferedInfo=Oo.prototype.Gb,Oo.prototype.getStats=function(){Qo(this),this.ib();var t=null,e=null,n=this.f;if(n=n&&n.getVideoPlaybackQuality?n.getVideoPlaybackQuality():{},this.g&&this.b){var i=sn(this.b,Jr(this.g)),r=this.b.periods[i];(i=this.I[i])&&(e=on(i.audio,i.video,r.variants),t=e.video||{})}return t||(t={}),e||(e={}),{width:t.width||0,height:t.height||0,streamBandwidth:e.bandwidth||0,decodedFrames:Number(n.totalVideoFrames),droppedFrames:Number(n.droppedVideoFrames),estimatedBandwidth:this.h?this.h.getBandwidthEstimate():NaN,loadLatency:this.l.loadLatency,playTime:this.l.playTime,bufferingTime:this.l.bufferingTime,switchHistory:ut(this.l.switchHistory),stateHistory:ut(this.l.stateHistory)}},Oo.prototype.getStats=Oo.prototype.getStats,Oo.prototype.addTextTrack=function(t,e,n,i,r,a){if(!this.a)return Promise.reject();var o=oa(this.a),s=this.b.periods.indexOf(o)+1,u=(s>=this.b.periods.length?this.b.presentationTimeline.T():this.b.periods[s].startTime)-o.startTime;if(1/0==u)return Promise.reject(new z(1,4,4033));var c={id:this.bd++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return 1},getSegmentReference:function(e){return 1!=e?null:new ti(1,0,u,function(){return[t]},0,null)},initSegmentReference:null,presentationTimeOffset:0,mimeType:i,codecs:r||"",kind:n,encrypted:!1,keyId:null,language:e,label:a||null,type:"text",primary:!1,trickModeVideo:null,containsEmsgBoxes:!1,roles:[],channelsCount:null};return this.lb.push(c.id),o.textStreams.push(c),la(this.a,c).then(function(){if(!this.wa){var t=this.b.periods.indexOf(o),i=ha(this.a,"text");return i&&(this.I[t].text=i.id),this.lb.splice(this.lb.indexOf(c.id),1),es(this,o),is(this),{id:c.id,active:!1,type:"text",bandwidth:0,language:e,label:a||null,kind:n,width:null,height:null}}}.bind(this))},Oo.prototype.addTextTrack=Oo.prototype.addTextTrack,Oo.prototype.cc=function(t,e){this.mb.width=t,this.mb.height=e},Oo.prototype.setMaxHardwareResolution=Oo.prototype.cc,Oo.prototype.ac=function(){if(this.a){var t=this.a;if(t.f)t=!1;else if(t.l)t=!1;else{for(var e in t.c){var n=t.c[e];n.Ya&&(n.Ya=!1,Oa(t,n,.1))}t=!0}}else t=!1;return t},Oo.prototype.retryStreaming=Oo.prototype.ac,Oo.prototype.rd=function(){return this.b},Oo.prototype.getManifest=Oo.prototype.rd,Uu=Oo.prototype,Uu.kd=function(t){var e=[1001,1002,1003];this.P()&&0<=e.indexOf(t.code)&&(t.severity=1,this.ac())},Uu.ec=function(t){t.forEach(Ke.bind(null,this.i,this.a?ua(this.a):null,this.a?ca(this.a):null));var e=ot(t,function(t){return t.variants.some($e)});if(0==e)throw new z(2,4,4032);if(e<t.length)throw new z(2,4,4011);t.forEach(function(t){if(Ve(t,this.c.restrictions,this.mb)&&this.a&&oa(this.a)==t&&is(this),!t.variants.some($e))throw new z(2,4,4012)}.bind(this))},Uu.tb=function(t){Ke(this.i,this.a?ua(this.a):null,this.a?ca(this.a):null,t);var e=t.variants,n=e.some($e);if(Ve(t,this.c.restrictions,this.mb)&&this.a&&oa(this.a)==t&&is(this),t=e.some($e),!n)throw new z(2,4,4011);if(!t)throw new z(2,4,4012);if(n=this.i?this.i.b:null)for(e=o(e),t=e.next();!t.done;t=e.next()){t=o(t.value.drmInfos);for(var i=t.next();!i.done;i=t.next())if(i=i.value,i.keySystem==n.keySystem){i=o(i.initData||[]);for(var r=i.next();!r.done;r=i.next())r=r.value,Jt(this.i,r.initDataType,r.initData)}}},Uu.Je=function(t,e){this.h&&this.h.segmentDownloaded(t,e)},Uu.Uc=function(t){if(Qo(this),this.ob=t,this.ib(),this.g){var e=this.g.a;t!=e.g&&(e.g=t,zr(e,e.f))}this.dispatchEvent(new At("buffering",{buffering:t}))},Uu.He=function(){is(this)},Uu.ib=function(){if(!this.wa){var t=this.ob?"buffering":this.f.ended?"ended":this.f.paused?"paused":"playing",e=Date.now()/1e3;if(this.l.stateHistory.length){var n=this.l.stateHistory[this.l.stateHistory.length-1];if(n.duration=e-n.timestamp,t==n.state)return}this.l.stateHistory.push({timestamp:e,state:t,duration:0})}},Uu.Ie=function(){if(this.A){var t=this.A;t.c.forEach(t.m.bind(t,!0))}this.a&&va(this.a)},Uu.Hd=function(t){this.xa=!0,this.h.disable();var e={audio:!1,text:!1},n=Qe(t.variants,this.L,this.Ga,this.Y,e),i=en(t.textStreams,this.ga,this.Ua,e);if(n=ts(this,n),i=i[0]||null,this.S){t:{for(var r=this.b,a=0;a<r.periods.length;++a)for(var o=r.periods[a],s=0;s<o.variants.length;++s)if(o.variants[s]==this.S){r=a;break t}r=-1}this.b.periods[r]==t&&(n=this.S),this.S=null}return this.G&&(this.b.periods[un(this.b,this.G)]==t&&(i=this.G),this.G=null),n&&qo(this,n,!0),i&&(Go(this,i,!0),!sa(this.a)&&n&&n.audio&&e.text&&i.language!=n.audio.language&&(this.u.setTextVisibility(!0),rs(this))),this.c.streaming.alwaysStreamText||this.Mb()?{variant:n,text:i}:{variant:n,text:null}},Uu.fd=function(){this.xa=!1,this.c.abr.enabled&&this.h.enable(),this.S&&(pa(this.a,this.S,this.kc),this.S=null),this.G&&(ma(this.a,this.G,!0),this.G=null)},Uu.Od=function(){this.m&&this.m.update&&this.m.update()},Uu.Yd=function(){this.g&&this.g.ab()},Uu.Ke=function(t,e){qo(this,t,!0),this.a&&(pa(this.a,t,e||!1),ns(this))},Uu.Ta=function(t){if(!this.wa){var e=new At("error",{detail:t});this.dispatchEvent(e),e.defaultPrevented&&(t.handled=!0)}},Uu.ae=function(t){this.A?this.A.o(t):this.nb.push(t)},Uu.gb=function(t){this.dispatchEvent(t)},Uu.be=function(){if(this.f.error){var t=this.f.error.code;if(1!=t){var e=this.f.error.msExtendedCode;e&&(0>e&&(e+=Math.pow(2,32)),e=e.toString(16)),this.Ta(new z(2,3,3016,t,e,this.f.error.message))}}},Uu.Md=function(t){var e=["output-restricted","internal-error"],n=oa(this.a),i=!1,r=Object.keys(t),a=1==r.length&&"00"==r[0];r.length&&n.variants.forEach(function(n){var r=[];n.audio&&r.push(n.audio),n.video&&r.push(n.video),r.forEach(function(r){var o=n.allowedByKeySystem;r.keyId&&(r=t[a?"00":r.keyId],n.allowedByKeySystem=!!r&&0>e.indexOf(r)),o!=n.allowedByKeySystem&&(i=!0)})}),(r=an(ua(this.a),ca(this.a),n.variants))&&!r.allowedByKeySystem&&es(this,n),i&&(is(this),n=Qe(n.variants,this.L,this.Ga,this.Y),this.h.setVariants(n))},Uu.Jd=function(t,e){this.m&&this.m.onExpirationUpdated&&this.m.onExpirationUpdated(t,e),this.dispatchEvent(new At("expirationupdated"))},I("shaka.offline.Storage",hs),hs.support=ls,hs.prototype.destroy=function(){return this.a=this.b=null,Promise.resolve()},hs.prototype.destroy=hs.prototype.destroy,hs.prototype.configure=function(t){st(this.b,t,ys(this),{},"")},hs.prototype.configure=hs.prototype.configure,hs.prototype.store=function(t,e,n){var i=this;return c(function r(){var a,o,s,u,h,l;return A(r,function(r){switch(r.w){case 1:return _s(),i.g?r.return(Promise.reject(new z(2,9,9006))):(i.g=!0,a=e||{},o=null,s=function(t){o=o||t},d(r,ms(i,t,s,n),2));case 2:if(u=r.K,!(h=!u.manifest.presentationTimeline.P()&&!u.manifest.presentationTimeline.Aa()))throw new z(2,9,9005,t);if(As(i),o)throw o;return l=new Qa,r.return(ct([l,u.Eb],function(){return c(function e(){var n,r,s,c,h,f,v;return A(e,function(e){switch(e.w){case 1:return m(e),d(e,l.init(),4);case 4:return As(i),gs(i,u.Eb,u.manifest.periods),d(e,Za(l),5);case 5:return n=e.K,As(i),p(e,6),d(e,fs(i,n.N,u.Eb,u.manifest,t,a||{}),8);case 8:return r=e.K,As(i),d(e,n.N.addManifests([r]),9);case 9:return s=e.K,As(i),c=new Eo("manifest",n.path.fa,n.path.N,s[0]),e.return(os(c,r));case 6:return h=y(e),f=i.f,v=function(){},d(e,n.N.removeSegments(f,v),10);case 10:throw o||h;case 2:g(e),i.g=!1,i.c=null,i.f=[],b(e,0)}})})}))}})})},hs.prototype.store=hs.prototype.store,hs.prototype.remove=function(t){var e=this;_s();var n=So(t);if(null==n||"manifest"!=n.a)return Promise.reject(new z(2,9,9004,t));var i=new Qa;return ct([i],function(){return c(function t(){var r,a,o;return A(t,function(t){switch(t.w){case 1:return d(t,i.init(),2);case 2:return d(t,eo(i,n.fa(),n.N()),3);case 3:return r=t.K,d(t,r.getManifests([n.key()]),4);case 4:return a=t.K,o=a[0],d(t,Promise.all([ds(e,n,o),ps(e,r,n,o)]),0)}})})})},hs.prototype.remove=hs.prototype.remove,hs.prototype.list=function(){function t(t,n){return c(function i(){var r;return A(i,function(i){switch(i.w){case 1:return d(i,n.getAllManifests(),2);case 2:r=i.K,$u.forEach(r,function(n,i){var r=os(new Eo("manifest",t.fa,t.N,n),i);e.push(r)}),i.w=0}})})}_s();var e=[],n=new Qa;return ct([n],function(){return c(function e(){var i;return A(e,function(e){switch(e.w){case 1:return d(e,n.init(),2);case 2:return i=Promise.resolve(),to(n,function(e,n){i=i.then(function(){return t(e,n)})}),d(e,i,0)}})})}).then(function(){return e})},hs.prototype.list=hs.prototype.list,hs.deleteAll=function(){return c(function t(){var e;return A(t,function(t){switch(t.w){case 1:return e=new Qa,m(t),d(t,no(e),2);case 2:return g(t),d(t,e.destroy(),5);case 5:b(t,0)}})})},Xc.offline=ls,I("shaka.polyfill.installAll",function(){for(var t=0;t<Yc.length;++t)Yc[t].dd()});var Yc=[];I("shaka.polyfill.register",Ns),Ns(function(){if(t.Document){var e=Element.prototype;e.requestFullscreen=e.requestFullscreen||e.mozRequestFullScreen||e.msRequestFullscreen||e.webkitRequestFullscreen,e=Document.prototype,e.exitFullscreen=e.exitFullscreen||e.mozCancelFullScreen||e.msExitFullscreen||e.webkitExitFullscreen,"fullscreenElement"in document||(Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}})),document.addEventListener("webkitfullscreenchange",Ds),document.addEventListener("webkitfullscreenerror",Ds),document.addEventListener("mozfullscreenchange",Ds),document.addEventListener("mozfullscreenerror",Ds),document.addEventListener("MSFullscreenChange",Ds),document.addEventListener("MSFullscreenError",Ds)}}),Ns(function(){var e=navigator.userAgent;e&&0<=e.indexOf("CrKey")&&delete t.indexedDB});var zc;Ns(function(){0>navigator.userAgent.indexOf("Trident/")||HTMLInputElement.prototype.addEventListener==Cs||(zc=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=Cs)}),Ns(function(){}),Ns(function(){if(t.MediaSource)if(t.cast&&cast.__platform__&&cast.__platform__.canDisplayType)Fs();else if(navigator.vendor&&0<=navigator.vendor.indexOf("Apple")){var e=navigator.appVersion;Bs(),0<=e.indexOf("Version/8")?t.MediaSource=null:0<=e.indexOf("Version/9")?Ms():0<=e.indexOf("Version/10")?(Ms(),Os()):0<=e.indexOf("Version/11")&&(Ms(),Ls())}}),Vs.prototype.c=function(t){if(!(1<t.version)){var e=Gt(t.reader.Da(16)),n=[];if(0<t.version)for(var i=t.reader.B(),r=0;r<i;++r){var a=Gt(t.reader.Da(16));n.push(a)}i=t.reader.B(),t.reader.F(i),this.b.push.apply(this.b,n),this.f.push(e),this.a.push({start:t.start,end:t.start+t.size-1})}},Hs.prototype.createMediaKeys=function(){var t=new Gs(this.keySystem);return Promise.resolve(t)},Hs.prototype.getConfiguration=function(){return this.a},Gs.prototype.createSession=function(t){var e=t||"temporary";if("temporary"!=e)throw new TypeError("Session type "+t+" is unsupported on this platform.");return new Ys(this.a,e)},Gs.prototype.setServerCertificate=function(){return Promise.resolve(!1)},x(Ys,gn),Uu=Ys.prototype,Uu.generateRequest=function(t,e){this.a=new q;try{this.c=this.g.createSession("video/mp4",new Uint8Array(e),null),Tt(this.f,this.c,"mskeymessage",this.Sd.bind(this)),Tt(this.f,this.c,"mskeyadded",this.Qd.bind(this)),Tt(this.f,this.c,"mskeyerror",this.Rd.bind(this)),$s(this,"status-pending")}catch(t){this.a.reject(t)}return this.a},Uu.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},Uu.update=function(t){this.b=new q;try{this.c.update(new Uint8Array(t))}catch(t){this.b.reject(t)}return this.b},Uu.close=function(){try{this.c.close(),this.closed.resolve(),St(this.f)}catch(t){this.closed.reject(t)}return this.closed},Uu.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))},Uu.Sd=function(t){this.a&&(this.a.resolve(),this.a=null),this.dispatchEvent(new At("message",{messageType:void 0==this.keyStatuses.a?"licenserequest":"licenserenewal",message:t.message.buffer}))},Uu.Qd=function(){this.a?($s(this,"usable"),this.a.resolve(),this.a=null):this.b&&($s(this,"usable"),this.b.resolve(),this.b=null)},Uu.Rd=function(){var t=Error("EME PatchedMediaKeysMs key error");if(t.errorCode=this.c.error,null!=this.a)this.a.reject(t),this.a=null;else if(null!=this.b)this.b.reject(t),this.b=null;else switch(this.c.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:$s(this,"output-not-allowed");break;default:$s(this,"internal-error")}};var Wc;Uu=Js.prototype,Uu.forEach=function(t){this.a&&t(this.a,Wc)},Uu.get=function(t){if(this.has(t))return this.a},Uu.has=function(t){var e=Wc;return!(!this.a||!Xt(new Uint8Array(t),new Uint8Array(e)))},Uu.entries=function(){},Uu.keys=function(){},Uu.values=function(){},Ns(function(){!t.HTMLVideoElement||!t.MSMediaKeys||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(Wc=new Uint8Array([0]).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=qs,t.MediaKeys=Gs,t.MediaKeySystemAccess=Hs,navigator.requestMediaKeySystemAccess=Ks)}),tu.prototype.createSession=function(){},tu.prototype.setServerCertificate=function(){},eu.prototype.getConfiguration=function(){},eu.prototype.createMediaKeys=function(){},Ns(function(){!t.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(navigator.requestMediaKeySystemAccess=Qs,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Zs,t.MediaKeys=tu,t.MediaKeySystemAccess=eu)},-10);var $c="";au.prototype.createMediaKeys=function(){var t=new ou(this.a);return Promise.resolve(t)},au.prototype.getConfiguration=function(){return this.b},Uu=ou.prototype,Uu.createSession=function(t){var e=t||"temporary";if("temporary"!=e&&"persistent-license"!=e)throw new TypeError("Session type "+t+" is unsupported on this platform.");return t=this.b||document.createElement("video"),t.src||(t.src="about:blank"),e=new cu(t,this.g,e),this.c.push(e),e},Uu.setServerCertificate=function(){return Promise.resolve(!1)},Uu.fe=function(t){var e=document.createEvent("CustomEvent");e.initCustomEvent("encrypted",!1,!1,null),e.initDataType="webm",e.initData=t.initData,this.b.dispatchEvent(e)},Uu.ee=function(t){var e=uu(this,t.sessionId);e&&(t=new At("message",{messageType:void 0==e.keyStatuses.a?"licenserequest":"licenserenewal",message:t.message}),e.b&&(e.b.resolve(),e.b=null),e.dispatchEvent(t))},Uu.ce=function(t){(t=uu(this,t.sessionId))&&(lu(t,"usable"),t.a&&t.a.resolve(),t.a=null)},Uu.de=function(t){var e=uu(this,t.sessionId);if(e){var n=Error("EME v0.1b key error");n.errorCode=t.errorCode,n.errorCode.systemCode=t.systemCode,!t.sessionId&&e.b?(n.method="generateRequest",45==t.systemCode&&(n.message="Unsupported session type."),e.b.reject(n),e.b=null):t.sessionId&&e.a?(n.method="update",e.a.reject(n),e.a=null):(n=t.systemCode,t.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?lu(e,"output-restricted"):1==n?lu(e,"expired"):lu(e,"internal-error"))}},x(cu,gn),Uu=cu.prototype,Uu.fc=function(t,e){if(this.a)this.a.then(this.fc.bind(this,t,e)).catch(this.fc.bind(this,t,e));else{if(this.a=t,"webkit-org.w3.clearkey"==this.c){var n=Mt(e),i=JSON.parse(n);"oct"!=i.keys[0].kty&&(this.a.reject(Error("Response is not a valid JSON Web Key Set.")),this.a=null),n=Ht(i.keys[0].k),i=Ht(i.keys[0].kid)}else n=new Uint8Array(e),i=null;var r=nu("addKey");try{this.f[r](this.c,n,i,this.sessionId)}catch(t){this.a.reject(t),this.a=null}}},Uu.generateRequest=function(t,e){return hu(this,e,null)},Uu.load=function(t){return"persistent-license"==this.g?hu(this,null,t):Promise.reject(Error("Not a persistent session."))},Uu.update=function(t){var e=new q;return this.fc(e,t),e},Uu.close=function(){if("persistent-license"!=this.g){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var t=nu("cancelKeyRequest");try{this.f[t](this.c,this.sessionId)}catch(t){}}return this.closed.resolve(),this.closed},Uu.remove=function(){return"persistent-license"!=this.g?Promise.reject(Error("Not a persistent session.")):this.close()};var Jc;Uu=fu.prototype,Uu.forEach=function(t){this.a&&t(this.a,Jc)},Uu.get=function(t){if(this.has(t))return this.a},Uu.has=function(t){var e=Jc;return!(!this.a||!Xt(new Uint8Array(t),new Uint8Array(e)))},Uu.entries=function(){},Uu.keys=function(){},Uu.values=function(){},Ns(function(){if(!(!t.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)$c="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;Jc=new Uint8Array([0]).buffer,navigator.requestMediaKeySystemAccess=iu,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=ru,t.MediaKeys=ou,t.MediaKeySystemAccess=au}}),Ns(function(){if(t.HTMLMediaElement){var e=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var t=e.apply(this,arguments);return t&&t.catch(function(){}),t}}}),Ns(function(){if(t.HTMLVideoElement){var e=HTMLVideoElement.prototype;!e.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in e&&(e.getVideoPlaybackQuality=du)}}),Ns(function(){if(!t.VTTCue&&t.TextTrackCue){var e=TextTrackCue.length;if(3==e)t.VTTCue=pu;else if(6==e)t.VTTCue=mu;else{try{var n=!!pu(1,2,"")}catch(t){n=!1}n&&(t.VTTCue=pu)}}}),vu.prototype.parseInit=function(){},vu.prototype.parseMedia=function(t,e){var n=Mt(t),i=[],r=new DOMParser,a=null;try{a=r.parseFromString(n,"text/xml")}catch(t){throw new z(2,2,2005)}if(a){if(!(r=a.getElementsByTagName("tt")[0]))throw new z(2,2,2005);a=Dn(r,"http://www.w3.org/ns/ttml#parameter","frameRate");var o=Dn(r,"http://www.w3.org/ns/ttml#parameter","subFrameRate"),s=Dn(r,"http://www.w3.org/ns/ttml#parameter","frameRateMultiplier"),u=Dn(r,"http://www.w3.org/ns/ttml#parameter","tickRate");if("default"!=(n=r.getAttribute("xml:space")||"default")&&"preserve"!=n)throw new z(2,2,2005);n="default"==n,a=new xu(a,o,s,u),o=yu(r.getElementsByTagName("styling")[0]),s=yu(r.getElementsByTagName("layout")[0]),u=[];for(var c=0;c<s.length;c++){var h=s[c],l=o,f=new ge,d=h.getAttribute("xml:id");if(d){f.id=d;var p;(p=Su(h,l,"extent"))&&null!=(p=(d=Qc.exec(p))||th.exec(p))&&(f.width=Number(p[1]),f.height=Number(p[2]),f.widthUnits=d?dc:0,f.heightUnits=d?dc:0),(h=Su(h,l,"origin"))&&null!=(p=(d=Qc.exec(h))||th.exec(h))&&(f.viewportAnchorX=Number(p[1]),f.viewportAnchorY=Number(p[2]),f.viewportAnchorUnits=d?dc:0)}else f=null;f&&u.push(f)}for(r=yu(r.getElementsByTagName("body")[0]),c=0;c<r.length;c++)(f=bu(r[c],e.periodStart,a,o,s,u,n))&&i.push(f)}return i};var Qc=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,Zc=/^(\d+px|\d+em)$/,th=/^(\d+)px (\d+)px$/,eh=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,nh=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,ih=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,rh=/^(\d*(?:\.\d*)?)f$/,ah=/^(\d*(?:\.\d*)?)t$/,oh=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,sh={left:"start",center:uc,right:"end",start:"start",end:"end"},uh={left:"line-left",center:"center",right:"line-right"};mc["application/ttml+xml"]=vu,Pu.prototype.parseInit=function(t){var e=!1;if((new ii).C("moov",ri).C("trak",ri).C("mdia",ri).C("minf",ri).C("stbl",ri).Z("stsd",ai).C("stpp",function(t){e=!0,t.parser.stop()}).parse(t),!e)throw new z(2,2,2007)},Pu.prototype.parseMedia=function(t,e){var n=!1,i=[];if((new ii).C("mdat",oi(function(t){n=!0,i=i.concat(this.a.parseMedia(t,e))}.bind(this))).parse(t),!n)throw new z(2,2,2007);return i},mc['application/mp4; codecs="stpp"']=Pu,mc['application/mp4; codecs="stpp.TTML.im1t"']=Pu,Ru.prototype.parseInit=function(){},Ru.prototype.parseMedia=function(t,e){var n=Mt(t);if(n=n.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n"),n=n.split(/\n{2,}/m),!/^WEBVTT($|[ \t\n])/m.test(n[0]))throw new z(2,2,2e3);var i=e.segmentStart;if(null==i&&(i=0,0<=n[0].indexOf("X-TIMESTAMP-MAP"))){var r=n[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),a=n[0].match(/MPEGTS:(\d+)/m);r&&a&&(i=Cu(new sr(r[1])),i=e.periodStart+(Number(a[1])/9e4-i))}a=[];var o=n[0].split("\n");for(r=1;r<o.length;r++)if(/^Region:/.test(o[r])){var s=new sr(o[r]),u=new ge;hr(s),ur(s);for(var c=hr(s);c;){var h=u,l=c;(c=/^id=(.*)$/.exec(l))?h.id=c[1]:(c=/^width=(\d{1,2}|100)%$/.exec(l))?h.width=Number(c[1]):(c=/^lines=(\d+)$/.exec(l))?(h.height=Number(c[1]),h.heightUnits=2):(c=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(l))?(h.regionAnchorX=Number(c[1]),h.regionAnchorY=Number(c[2])):(c=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(l))?(h.viewportAnchorX=Number(c[1]),h.viewportAnchorY=Number(c[2])):/^scroll=up$/.exec(l)&&(h.scroll="up"),ur(s),c=hr(s)}a.push(u)}for(r=[],s=1;s<n.length;s++){if(o=n[s].split("\n"),c=o,l=i,o=a,1==c.length&&!c[0]||/^NOTE($|[ \t])/.test(c[0])||"STYLE"==c[0])o=null;else{u=null,0>c[0].indexOf("--\x3e")&&(u=c[0],c.splice(0,1)),h=new sr(c[0]);var f=Cu(h),d=cr(h,/[ \t]+--\x3e[ \t]+/g),p=Cu(h);if(null==f||null==d||null==p)throw new z(2,2,2001);for(c=new ye(f+l,p+l,c.slice(1).join("\n").trim()),ur(h),l=hr(h);l;)Nu(c,l,o),ur(h),l=hr(h);null!=u&&(c.id=u),o=c}o&&r.push(o)}return r},mc["text/vtt"]=Ru,mc['text/vtt; codecs="vtt"']=Ru,Mu.prototype.parseInit=function(t){var e=!1;if((new ii).C("moov",ri).C("trak",ri).C("mdia",ri).Z("mdhd",function(t){0==t.version?(t.reader.F(4),t.reader.F(4),this.a=t.reader.B(),t.reader.F(4)):(t.reader.F(8),t.reader.F(8),this.a=t.reader.B(),t.reader.F(8)),t.reader.F(4)}.bind(this)).C("minf",ri).C("stbl",ri).Z("stsd",ai).C("wvtt",function(){e=!0}).parse(t),!this.a)throw new z(2,2,2008);if(!e)throw new z(2,2,2008)},Mu.prototype.parseMedia=function(t,e){var n=this;if(!this.a)throw new z(2,2,2008);var i,r=0,a=[],o=[],s=!1,u=!1,c=!1,h=null;if((new ii).C("moof",ri).C("traf",ri).Z("tfdt",function(t){s=!0,r=0==t.version?t.reader.B():t.reader.Ra()}).Z("tfhd",function(t){var e=t.flags;t=t.reader,t.F(4),1&e&&t.F(8),2&e&&t.F(4),h=8&e?t.B():null}).Z("trun",function(t){u=!0;var e=t.version,n=t.flags;t=t.reader;var i=t.B();1&n&&t.F(4),4&n&&t.F(4);for(var r=[],o=0;o<i;o++){var s={duration:null,sampleSize:null,gc:null};256&n&&(s.duration=t.B()),512&n&&(s.sampleSize=t.B()),1024&n&&t.F(4),2048&n&&(s.gc=0==e?t.B():t.Lc()),r.push(s)}a=r}).C("mdat",oi(function(t){c=!0,i=t})).parse(t),!c&&!s&&!u)throw new z(2,2,2008);var l=r,f=new DataView(i.buffer,i.byteOffset,i.byteLength),d=new ei(f,0);return a.forEach(function(t){var i=t.duration||h,a=t.gc?r+t.gc:l;l=a+(i||0);var s=0;do{var u=d.B();s+=u;var c=d.B(),f=null;"vttc"==ui(c)?8<u&&(f=d.Da(u-8)):d.F(u-8),i&&f&&o.push(Lu(f,e.periodStart+a/n.a,e.periodStart+l/n.a))}while(t.sampleSize&&s<t.sampleSize)}),o.filter(Pt)},mc['application/mp4; codecs="wvtt"']=Mu}).call(i,n,n);for(var r in i.shaka)e[r]=i.shaka[r]}()}).call(e,n(3))},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n}])}); \ No newline at end of file